Commit d6f55ae8 by Muhammad Usman

job detail profile view added

parent 5b85b3ee
......@@ -65,7 +65,6 @@ export class EducationComponent extends BaseComponent implements OnInit {
edu.WhenCompletedField = UtilsService.convertStringToDate(edu.WhenCompleted);
})
}
console.log(this.careerProfile);
this.utilsService.addObjsToJSONByObjectID(this.updatedObjs, this.careerProfile.EducationCertificates);
if (this.careerProfile.EducationCertificates.length === 0 && !this.careerProfile.NoEducationQualification) {
for (let i = 0; i < this.careerProfile.NoOfQualifications || 0; i++) {
......
......@@ -31,6 +31,7 @@ export const CLASSES = {
ILWorkExperience: 'performa.orm.ILWorkExperience',
ILSkill: 'performa.orm.ILSkill',
Job: 'performa.orm.Job',
ApplicantJob: 'performa.orm.ApplicantJob',
};
export const SERVICES = {
......
......@@ -10,48 +10,83 @@
<form #form="ngForm" class="mc-card position-relative">
<app-overlay [isActive]="isLoading"></app-overlay>
<div class="mc-page-body-heading">{{isEditMode ? 'Update' : 'Enter'}} Job Details </div>
<div class="row mt-3">
<div class="col-md-6 form-group">
<label>Job Title</label>
<app-form-control>
<input type="text" class="form-control" placeholder="Enter job title" required name="JobTitle"
[(ngModel)]="applicantJob.JobTitle">
</app-form-control>
</div>
<ng-container *ngIf="detailStep === 1">
<div class="col-md-6 form-group">
<label>Employer</label>
<app-form-control>
<input type="text" class="form-control" placeholder="Enter Employer" required name="Employer"
[(ngModel)]="applicantJob.Employer">
</app-form-control>
</div>
<div class="mc-page-body-heading">{{isEditMode ? 'Update' : 'Enter'}} Job Details </div>
<div class="col-md-6 form-group">
<label>Contact Name</label>
<app-form-control>
<input type="text" class="form-control" placeholder="Enter contact name" required name="ContactName"
[(ngModel)]="applicantJob.ContactName">
</app-form-control>
</div>
<div class="row mt-3">
<div class="col-md-6 form-group">
<label>Job Title</label>
<app-form-control>
<input type="text" class="form-control" placeholder="Enter job title" required name="JobTitle"
[(ngModel)]="applicantJob.JobTitle">
</app-form-control>
</div>
<div class="col-md-6 form-group">
<label>Employer</label>
<app-form-control>
<input type="text" class="form-control" placeholder="Enter Employer" required name="Employer"
[(ngModel)]="applicantJob.Employer">
</app-form-control>
</div>
<div class="col-md-6 form-group">
<label>Where was Job Posted?</label>
<app-form-control>
<p-dropdown placeholder="Select job post location" [options]="jobPostLocations"
[dropdownIcon]="isLoadingJobLocations ? 'pi pi-spin pi-spinner' : 'pi pi-chevron-down'"
optionLabel="Description" name="JobPostedLocation" dataKey="Value" required
[(ngModel)]="applicantJob.JobPostedLocation">
</p-dropdown>
</app-form-control>
<div class="col-md-6 form-group">
<label>Contact Name</label>
<app-form-control>
<input type="text" class="form-control" placeholder="Enter contact name" required name="ContactName"
[(ngModel)]="applicantJob.ContactName">
</app-form-control>
</div>
<div class="col-md-6 form-group">
<label>Where was Job Posted?</label>
<app-form-control>
<p-dropdown placeholder="Select job post location" [options]="jobPostLocations"
[dropdownIcon]="isLoadingJobLocations ? 'pi pi-spin pi-spinner' : 'pi pi-chevron-down'"
optionLabel="Description" name="JobPostedLocation" dataKey="Value" required
[(ngModel)]="applicantJob.JobPostedLocation">
</p-dropdown>
</app-form-control>
</div>
<div class="col-md-12 d-flex justify-content-end">
<button (click)="selectProfile()" pButton label="Next" class="mc-btn-primary" [disabled]="isLoading"></button>
</div>
</div>
<div class="col-md-12 d-flex justify-content-end">
<button (click)="saveApplicantJob()" pButton label="Next" class="mc-btn-primary" [disabled]="isLoading"></button>
</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 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>
</ng-container>
</form>
</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';
import { NgForm } from '@angular/forms';
import { HelperService } from '../../../services/helper.service';
import { ToasterService } from '../../../services/toaster.service';
import { PersonalDetailsService } from '../../../services/personal-details.service';
import { CareerProfileModel } from '../../../models/career-profile.model';
@Component({
selector: 'app-job',
......@@ -17,11 +19,14 @@ import { ToasterService } from '../../../services/toaster.service';
export class JobDetailsComponent extends BaseComponent implements OnInit {
applicantJob: ApplicantJobModel = new ApplicantJobModel();
careerProfile: CareerProfileModel = new CareerProfileModel();
applicantJobId;
isLoadingJobLocations = false;
jobPostLocations = [];
detailStep = 1;
@ViewChild('form') form: NgForm;
constructor(
......@@ -30,6 +35,7 @@ export class JobDetailsComponent extends BaseComponent implements OnInit {
private utilsService: UtilsService,
private toastService: ToasterService,
private helperService: HelperService,
private personalDetailsService: PersonalDetailsService,
private router: Router
) {
super();
......@@ -42,19 +48,39 @@ export class JobDetailsComponent extends BaseComponent implements OnInit {
if (params.id && params.id !== 'new') {
this.isEditMode = true;
this.applicantJobId = params.id;
this.getApplicantJob()
} else {
this.applicantJob = new ApplicantJobModel();
this.utilsService.createObject(this.applicantJob, this.createdObjs)
}
});
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()
} else {
this.applicantJob = new ApplicantJobModel();
this.applicantJob.Candidate = this.careerProfile.Candidate;
this.utilsService.createObject(this.applicantJob, this.createdObjs)
}
}
getApplicantJob(): void {
this.isLoading = true;
this.jobService.getApplicantJob(this.applicantJob)
this.jobService.getApplicantJob(this.applicantJobId)
.pipe(takeUntil(this.componentInView))
.subscribe(response => {
this.isLoading = false;
......@@ -78,22 +104,26 @@ export class JobDetailsComponent extends BaseComponent implements OnInit {
})
}
saveApplicantJob(): void {
selectProfile(): void {
if (this.form.invalid) {
return this.helperService.validateAllFormFields(this.form);
}
this.isLoading = true;
this.jobService.saveApplicantJob(this.createdObjs, this.updatedObjs, this.deletedObjs)
.pipe(takeUntil(this.componentInView))
.subscribe(response => {
this.isLoading = false;
this.toastService.success('Job saved');
console.log(response);
// this.router.navigate([`my-career-web/intro-letters`])
}, err => {
this.utilsService.handleError(err);
this.isLoading = false;
});
this.detailStep = 2;
}
saveApplicantJob(): void {
// this.isLoading = true;
// this.jobService.saveApplicantJob(this.createdObjs, this.updatedObjs, this.deletedObjs)
// .pipe(takeUntil(this.componentInView))
// .subscribe(response => {
// this.isLoading = false;
// this.toastService.success('Job saved');
// console.log(response);
// // this.router.navigate([`my-career-web/intro-letters`])
// }, err => {
// this.utilsService.handleError(err);
// this.isLoading = false;
// });
}
}
......@@ -10,31 +10,7 @@
<div class="mc-card position-relative">
<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>
@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 @@
</div>
<div class="mc-page-body container">
<div class="mc-card">
<div class="mc-card position-relative">
<app-overlay [isActive]="isLoading"></app-overlay>
<div class="mc-page-body-heading">Jobs</div>
......@@ -24,12 +24,12 @@
<div class="applicant-jobs">
<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 class="applicant-job" *ngFor="let applicantJob of applicantJobs;">
<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>
</div>
......
......@@ -30,7 +30,10 @@ export class JobsComponent extends BaseComponent implements OnInit {
getJobApplicants(): void {
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))
.subscribe(response => {
this.isLoading = false;
......
......@@ -2,11 +2,12 @@ import { BaseModel } from './base.model';
import { CLASSES } from '../config/constants';
export class ApplicantJobModel extends BaseModel {
ObjectClass = CLASSES.Job;
ObjectClass = CLASSES.ApplicantJob;
JobTitle: string;
Employer: string;
ContactName: string;
ApplicantJobStatus: string;
JobPostedLocation: any;
Candidate: 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