Commit d6f55ae8 by Muhammad Usman

job detail profile view added

parent 5b85b3ee
...@@ -65,7 +65,6 @@ export class EducationComponent extends BaseComponent implements OnInit { ...@@ -65,7 +65,6 @@ export class EducationComponent extends BaseComponent implements OnInit {
edu.WhenCompletedField = UtilsService.convertStringToDate(edu.WhenCompleted); edu.WhenCompletedField = UtilsService.convertStringToDate(edu.WhenCompleted);
}) })
} }
console.log(this.careerProfile);
this.utilsService.addObjsToJSONByObjectID(this.updatedObjs, this.careerProfile.EducationCertificates); this.utilsService.addObjsToJSONByObjectID(this.updatedObjs, this.careerProfile.EducationCertificates);
if (this.careerProfile.EducationCertificates.length === 0 && !this.careerProfile.NoEducationQualification) { if (this.careerProfile.EducationCertificates.length === 0 && !this.careerProfile.NoEducationQualification) {
for (let i = 0; i < this.careerProfile.NoOfQualifications || 0; i++) { for (let i = 0; i < this.careerProfile.NoOfQualifications || 0; i++) {
......
...@@ -31,6 +31,7 @@ export const CLASSES = { ...@@ -31,6 +31,7 @@ export const CLASSES = {
ILWorkExperience: 'performa.orm.ILWorkExperience', ILWorkExperience: 'performa.orm.ILWorkExperience',
ILSkill: 'performa.orm.ILSkill', ILSkill: 'performa.orm.ILSkill',
Job: 'performa.orm.Job', Job: 'performa.orm.Job',
ApplicantJob: 'performa.orm.ApplicantJob',
}; };
export const SERVICES = { export const SERVICES = {
......
...@@ -10,6 +10,8 @@ ...@@ -10,6 +10,8 @@
<form #form="ngForm" class="mc-card position-relative"> <form #form="ngForm" class="mc-card position-relative">
<app-overlay [isActive]="isLoading"></app-overlay> <app-overlay [isActive]="isLoading"></app-overlay>
<ng-container *ngIf="detailStep === 1">
<div class="mc-page-body-heading">{{isEditMode ? 'Update' : 'Enter'}} Job Details </div> <div class="mc-page-body-heading">{{isEditMode ? 'Update' : 'Enter'}} Job Details </div>
<div class="row mt-3"> <div class="row mt-3">
...@@ -49,9 +51,42 @@ ...@@ -49,9 +51,42 @@
</div> </div>
<div class="col-md-12 d-flex justify-content-end"> <div class="col-md-12 d-flex justify-content-end">
<button (click)="saveApplicantJob()" pButton label="Next" class="mc-btn-primary" [disabled]="isLoading"></button> <button (click)="selectProfile()" pButton label="Next" class="mc-btn-primary" [disabled]="isLoading"></button>
</div>
</div>
</ng-container>
<ng-container *ngIf="detailStep === 2">
<div class="mc-page-body-heading">Select a profile for the job </div>
<h5 class="mt-2">Would you like use the existing career Profile or create a custom profile?</h5>
<div class="row">
<div class="col-md-6 profile-option-wrapper">
<div class="profile-option selected">
<div class="mb-4">Use My Profile</div>
<button class="mc-btn-secondary" pButton label="Preview Profile"></button>
</div> </div>
</div> </div>
<div class="col-md-6 profile-option-wrapper">
<div class="profile-option">
Customize My Profile
</div>
</div>
<div class="col-md-12 mt-4 profile-actions">
<button class="mc-btn-primary" pButton label="Save and Exit"></button>
<button class="mc-btn-primary" pButton label="Next"></button>
</div>
</div>
</ng-container>
</form> </form>
</div> </div>
</div> </div>
@import "../../../../../styles/my-career-styles/variables";
.profile-option-wrapper {
display: flex;
align-items: center;
justify-content: center;
margin: 10% 0;
}
.profile-option {
border: 2px solid $greyBorder;
display: flex;
align-items: center;
justify-content: center;
width: 300px;
height: 250px;
flex-direction: column;
transition: .3s;
border-radius: 8px;
&.selected {
box-shadow: 0 0 18px 0 rgba(18, 168, 222, 0.6);
border-color: $primaryColor;
background: $primaryColor;
color: $white;
.mc-btn-secondary {
border-color: $white;
background: $primaryColor !important;
color: $white !important;
}
}
&:hover {
box-shadow: 0 0 18px 0 rgba(229, 232, 235, 0.6);
}
}
.profile-actions {
display: flex;
justify-content: space-between;
}
@media screen and (max-width: 1024px) {
.profile-actions {
flex-direction: column;
justify-content: center;
text-align: center;
.mc-btn-primary {
margin: 20px auto;
}
}
}
...@@ -8,6 +8,8 @@ import { ActivatedRoute, Router } from '@angular/router'; ...@@ -8,6 +8,8 @@ import { ActivatedRoute, Router } from '@angular/router';
import { NgForm } from '@angular/forms'; import { NgForm } from '@angular/forms';
import { HelperService } from '../../../services/helper.service'; import { HelperService } from '../../../services/helper.service';
import { ToasterService } from '../../../services/toaster.service'; import { ToasterService } from '../../../services/toaster.service';
import { PersonalDetailsService } from '../../../services/personal-details.service';
import { CareerProfileModel } from '../../../models/career-profile.model';
@Component({ @Component({
selector: 'app-job', selector: 'app-job',
...@@ -17,11 +19,14 @@ import { ToasterService } from '../../../services/toaster.service'; ...@@ -17,11 +19,14 @@ import { ToasterService } from '../../../services/toaster.service';
export class JobDetailsComponent extends BaseComponent implements OnInit { export class JobDetailsComponent extends BaseComponent implements OnInit {
applicantJob: ApplicantJobModel = new ApplicantJobModel(); applicantJob: ApplicantJobModel = new ApplicantJobModel();
careerProfile: CareerProfileModel = new CareerProfileModel();
applicantJobId; applicantJobId;
isLoadingJobLocations = false; isLoadingJobLocations = false;
jobPostLocations = []; jobPostLocations = [];
detailStep = 1;
@ViewChild('form') form: NgForm; @ViewChild('form') form: NgForm;
constructor( constructor(
...@@ -30,6 +35,7 @@ export class JobDetailsComponent extends BaseComponent implements OnInit { ...@@ -30,6 +35,7 @@ export class JobDetailsComponent extends BaseComponent implements OnInit {
private utilsService: UtilsService, private utilsService: UtilsService,
private toastService: ToasterService, private toastService: ToasterService,
private helperService: HelperService, private helperService: HelperService,
private personalDetailsService: PersonalDetailsService,
private router: Router private router: Router
) { ) {
super(); super();
...@@ -42,19 +48,39 @@ export class JobDetailsComponent extends BaseComponent implements OnInit { ...@@ -42,19 +48,39 @@ export class JobDetailsComponent extends BaseComponent implements OnInit {
if (params.id && params.id !== 'new') { if (params.id && params.id !== 'new') {
this.isEditMode = true; this.isEditMode = true;
this.applicantJobId = params.id; this.applicantJobId = params.id;
}
});
this.getCareerProfile();
this.getJobPostLocations();
}
getCareerProfile(): void {
this.isLoading = true;
this.personalDetailsService.getCareerProfile()
.pipe(takeUntil(this.componentInView))
.subscribe(response => {
this.isLoading = false;
this.careerProfile = response;
this.initiateApplicantJob();
}, err => {
this.isLoading = false;
this.utilsService.handleError(err);
})
}
initiateApplicantJob(): void {
if (this.isEditMode) {
this.getApplicantJob() this.getApplicantJob()
} else { } else {
this.applicantJob = new ApplicantJobModel(); this.applicantJob = new ApplicantJobModel();
this.applicantJob.Candidate = this.careerProfile.Candidate;
this.utilsService.createObject(this.applicantJob, this.createdObjs) this.utilsService.createObject(this.applicantJob, this.createdObjs)
} }
});
this.getJobPostLocations();
} }
getApplicantJob(): void { getApplicantJob(): void {
this.isLoading = true; this.isLoading = true;
this.jobService.getApplicantJob(this.applicantJob) this.jobService.getApplicantJob(this.applicantJobId)
.pipe(takeUntil(this.componentInView)) .pipe(takeUntil(this.componentInView))
.subscribe(response => { .subscribe(response => {
this.isLoading = false; this.isLoading = false;
...@@ -78,22 +104,26 @@ export class JobDetailsComponent extends BaseComponent implements OnInit { ...@@ -78,22 +104,26 @@ export class JobDetailsComponent extends BaseComponent implements OnInit {
}) })
} }
saveApplicantJob(): void { selectProfile(): void {
if (this.form.invalid) { if (this.form.invalid) {
return this.helperService.validateAllFormFields(this.form); return this.helperService.validateAllFormFields(this.form);
} }
this.isLoading = true; this.detailStep = 2;
this.jobService.saveApplicantJob(this.createdObjs, this.updatedObjs, this.deletedObjs) }
.pipe(takeUntil(this.componentInView))
.subscribe(response => { saveApplicantJob(): void {
this.isLoading = false; // this.isLoading = true;
this.toastService.success('Job saved'); // this.jobService.saveApplicantJob(this.createdObjs, this.updatedObjs, this.deletedObjs)
console.log(response); // .pipe(takeUntil(this.componentInView))
// this.router.navigate([`my-career-web/intro-letters`]) // .subscribe(response => {
}, err => { // this.isLoading = false;
this.utilsService.handleError(err); // this.toastService.success('Job saved');
this.isLoading = false; // console.log(response);
}); // // this.router.navigate([`my-career-web/intro-letters`])
// }, err => {
// this.utilsService.handleError(err);
// this.isLoading = false;
// });
} }
} }
...@@ -10,31 +10,7 @@ ...@@ -10,31 +10,7 @@
<div class="mc-card position-relative"> <div class="mc-card position-relative">
<app-overlay [isActive]="isLoading"></app-overlay> <app-overlay [isActive]="isLoading"></app-overlay>
<div class="mc-page-body-heading">Select a profile for the job </div>
<h5 class="mt-2">Would you like use the existing career Profile or create a custom profile?</h5>
<div class="row">
<div class="col-md-6 profile-option-wrapper">
<div class="profile-option selected">
<div class="mb-4">Use My Profile</div>
<button class="mc-btn-secondary" pButton label="Preview Profile"></button>
</div>
</div>
<div class="col-md-6 profile-option-wrapper">
<div class="profile-option">
Customize My Profile
</div>
</div>
<div class="col-md-12 mt-4 profile-actions">
<button class="mc-btn-primary" pButton label="Save and Exit"></button>
<button class="mc-btn-primary" pButton label="Next"></button>
</div>
</div>
</div> </div>
</div> </div>
</div> </div>
@import "../../../../../styles/my-career-styles/variables";
.profile-option-wrapper {
display: flex;
align-items: center;
justify-content: center;
margin: 10% 0;
}
.profile-option {
border: 2px solid $greyBorder;
display: flex;
align-items: center;
justify-content: center;
width: 300px;
height: 250px;
flex-direction: column;
transition: .3s;
border-radius: 8px;
&.selected {
box-shadow: 0 0 18px 0 rgba(18, 168, 222, 0.6);
border-color: $primaryColor;
background: $primaryColor;
color: $white;
.mc-btn-secondary {
border-color: $white;
background: $primaryColor !important;
color: $white !important;
}
}
&:hover {
box-shadow: 0 0 18px 0 rgba(229, 232, 235, 0.6);
}
}
.profile-actions {
display: flex;
justify-content: space-between;
}
@media screen and (max-width: 1024px) {
.profile-actions {
flex-direction: column;
justify-content: center;
text-align: center;
.mc-btn-primary {
margin: 20px auto;
}
}
}
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
</div> </div>
<div class="mc-page-body container"> <div class="mc-page-body container">
<div class="mc-card"> <div class="mc-card position-relative">
<app-overlay [isActive]="isLoading"></app-overlay> <app-overlay [isActive]="isLoading"></app-overlay>
<div class="mc-page-body-heading">Jobs</div> <div class="mc-page-body-heading">Jobs</div>
...@@ -24,12 +24,12 @@ ...@@ -24,12 +24,12 @@
<div class="applicant-jobs"> <div class="applicant-jobs">
<div class="applicant-job" *ngIf="applicantJobs.length === 0"> <div class="applicant-job" *ngIf="applicantJobs.length === 0">
<div class="job-title text-center" style="flex: 1;">No jobs found. </div> <div class="applicant-job-title text-center" style="flex: 1;">No jobs found. </div>
</div> </div>
<div class="applicant-job" *ngFor="let applicantJob of applicantJobs;"> <div class="applicant-job" *ngFor="let applicantJob of applicantJobs;">
<div class="applicant-job-title">{{applicantJob.JobTitle}} - {{applicantJob.Employer}} </div> <div class="applicant-job-title">{{applicantJob.JobTitle}} - {{applicantJob.Employer}} </div>
<div class="applicant-job-status">{{applicantJob.JobStatus.Description}}</div> <div class="applicant-job-status">{{applicantJob?.JobStatus?.Description || '-'}}</div>
<button class="mc-btn-secondary" pButton label="Edit" routerLink="/my-career-web/jobs/{{applicantJob.ObjectID}}"></button> <button class="mc-btn-secondary" pButton label="Edit" routerLink="/my-career-web/jobs/{{applicantJob.ObjectID}}"></button>
</div> </div>
......
...@@ -30,7 +30,10 @@ export class JobsComponent extends BaseComponent implements OnInit { ...@@ -30,7 +30,10 @@ export class JobsComponent extends BaseComponent implements OnInit {
getJobApplicants(): void { getJobApplicants(): void {
this.isLoading = true; this.isLoading = true;
this.jobsService.getApplicantTalentJobs({IncludeCompleted: this.includeCompleted}, this.assocs) this.jobsService.getApplicantTalentJobs({
IncludeCompleted: this.includeCompleted,
OnlyForLoggedin: true
}, this.assocs)
.pipe(takeUntil(this.componentInView)) .pipe(takeUntil(this.componentInView))
.subscribe(response => { .subscribe(response => {
this.isLoading = false; this.isLoading = false;
......
...@@ -2,11 +2,12 @@ import { BaseModel } from './base.model'; ...@@ -2,11 +2,12 @@ import { BaseModel } from './base.model';
import { CLASSES } from '../config/constants'; import { CLASSES } from '../config/constants';
export class ApplicantJobModel extends BaseModel { export class ApplicantJobModel extends BaseModel {
ObjectClass = CLASSES.Job; ObjectClass = CLASSES.ApplicantJob;
JobTitle: string; JobTitle: string;
Employer: string; Employer: string;
ContactName: string; ContactName: string;
ApplicantJobStatus: string; ApplicantJobStatus: string;
JobPostedLocation: any; JobPostedLocation: any;
Candidate: any;
JobStatus: any; JobStatus: any;
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment