Commit 8163f7e3 by Muhammad Usman

education tab fixes on no education

parent 9c1d2588
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
<div class="col-md-6 form-group"> <div class="col-md-6 form-group">
<label>Where Studied</label> <label>Where Studied</label>
<app-form-control> <app-form-control>
<p-autoComplete [suggestions]="filterStudied" (completeMethod)="suggestedStudiedAt($event)" placeholder="Where studied" name="WhereStudied{{i}}" [(ngModel)]="education.WhereStudied" required> <p-autoComplete [suggestions]="filterStudied" (completeMethod)="suggestedStudiedAt($event)" placeholder="Where studied" name="WhereStudied{{i}}" [(ngModel)]="education.WhereStudied">
</p-autoComplete> </p-autoComplete>
</app-form-control> </app-form-control>
</div> </div>
......
...@@ -66,7 +66,7 @@ export class EducationComponent extends BaseComponent implements OnInit { ...@@ -66,7 +66,7 @@ export class EducationComponent extends BaseComponent implements OnInit {
}) })
} }
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 || 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++) {
this.addEducation(true); this.addEducation(true);
} }
......
...@@ -42,6 +42,7 @@ export const SERVICES = { ...@@ -42,6 +42,7 @@ export const SERVICES = {
SAVE_WORKFLOW: 'SaveWorkFlowTemplate', SAVE_WORKFLOW: 'SaveWorkFlowTemplate',
SAVE: 'Save', SAVE: 'Save',
CAREER_PROFILES: 'CareerProfiles', CAREER_PROFILES: 'CareerProfiles',
CLONE_CAREER_PROFILES: 'CloneCareerProfile',
JOB_TITLES: 'JobTitles', JOB_TITLES: 'JobTitles',
SKILLS: 'Skills', SKILLS: 'Skills',
EMPLOYERS: 'Employers', EMPLOYERS: 'Employers',
......
...@@ -94,6 +94,7 @@ export class IntroLetterComponent extends BaseComponent implements OnInit { ...@@ -94,6 +94,7 @@ export class IntroLetterComponent extends BaseComponent implements OnInit {
} }
initialProcessing(): void { initialProcessing(): void {
if (this.careerProfile.WorkExperiences) {
this.careerProfile.WorkExperiences.forEach((w, i) => { this.careerProfile.WorkExperiences.forEach((w, i) => {
const ilWorkExperience = new ILWorkExperienceModel(); const ilWorkExperience = new ILWorkExperienceModel();
ilWorkExperience.IntroductionLetter = this.introductionLetter.ObjectID; ilWorkExperience.IntroductionLetter = this.introductionLetter.ObjectID;
...@@ -102,6 +103,8 @@ export class IntroLetterComponent extends BaseComponent implements OnInit { ...@@ -102,6 +103,8 @@ export class IntroLetterComponent extends BaseComponent implements OnInit {
ilWorkExperience.IsSelected = true; ilWorkExperience.IsSelected = true;
this.utilsService.addMultiRefObject(ilWorkExperience, this.introductionLetter, 'WorkExperiences', this.createdObjs); this.utilsService.addMultiRefObject(ilWorkExperience, this.introductionLetter, 'WorkExperiences', this.createdObjs);
}); });
}
if (this.careerProfile.Skills) {
this.careerProfile.Skills.forEach((s, i) => { this.careerProfile.Skills.forEach((s, i) => {
const ilSkillModel = new ILSkillModel(); const ilSkillModel = new ILSkillModel();
ilSkillModel.IntroductionLetter = this.introductionLetter.ObjectID; ilSkillModel.IntroductionLetter = this.introductionLetter.ObjectID;
...@@ -111,6 +114,7 @@ export class IntroLetterComponent extends BaseComponent implements OnInit { ...@@ -111,6 +114,7 @@ export class IntroLetterComponent extends BaseComponent implements OnInit {
this.utilsService.addMultiRefObject(ilSkillModel, this.introductionLetter, 'Skills', this.createdObjs); this.utilsService.addMultiRefObject(ilSkillModel, this.introductionLetter, 'Skills', this.createdObjs);
}); });
} }
}
saveIntroLetter(): void { saveIntroLetter(): void {
if (this.form.invalid) { if (this.form.invalid) {
......
...@@ -4,6 +4,10 @@ ...@@ -4,6 +4,10 @@
<div class="mc-page-header-logo"> <div class="mc-page-header-logo">
<img src="assets/my-career-web/images/MATCHD_LOGO.jpg" alt=""> <img src="assets/my-career-web/images/MATCHD_LOGO.jpg" alt="">
</div> </div>
<div class="mc-page-header-action">
<button pButton label="Exit" routerLink="/my-career-web/jobs" class="ui-button-info"></button>
</div>
</div> </div>
<div class="mc-page-body container"> <div class="mc-page-body container">
...@@ -65,7 +69,7 @@ ...@@ -65,7 +69,7 @@
<div class="row"> <div class="row">
<div class="col-md-6 profile-option-wrapper"> <div class="col-md-6 profile-option-wrapper">
<div class="profile-option selected"> <div class="profile-option" [ngClass]="{'selected' : selectedProfileType === 'same'}" (click)="selectedProfileType = 'same'">
<div class="mb-4">Use My Profile</div> <div class="mb-4">Use My Profile</div>
<button class="mc-btn-secondary" pButton label="Preview Profile"></button> <button class="mc-btn-secondary" pButton label="Preview Profile"></button>
...@@ -73,15 +77,15 @@ ...@@ -73,15 +77,15 @@
</div> </div>
<div class="col-md-6 profile-option-wrapper"> <div class="col-md-6 profile-option-wrapper">
<div class="profile-option"> <div class="profile-option" [ngClass]="{'selected' : selectedProfileType === 'customize'}" (click)="selectedProfileType = 'customize'">
Customize My Profile Customize My Profile
</div> </div>
</div> </div>
<div class="col-md-12 mt-4 profile-actions"> <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="Save and Exit" (click)="saveApplicantJob(true)"></button>
<button class="mc-btn-primary" pButton label="Next"></button> <button class="mc-btn-primary" pButton label="Next" (click)="saveApplicantJob()"></button>
</div> </div>
</div> </div>
......
...@@ -19,13 +19,14 @@ import { CareerProfileModel } from '../../../models/career-profile.model'; ...@@ -19,13 +19,14 @@ import { CareerProfileModel } from '../../../models/career-profile.model';
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(); clonedCareerProfile: CareerProfileModel = new CareerProfileModel();
applicantJobId; applicantJobId;
isLoadingJobLocations = false; isLoadingJobLocations = false;
jobPostLocations = []; jobPostLocations = [];
detailStep = 1; detailStep = 1;
selectedProfileType: 'same' | 'customize' = 'same';
@ViewChild('form') form: NgForm; @ViewChild('form') form: NgForm;
...@@ -50,22 +51,33 @@ export class JobDetailsComponent extends BaseComponent implements OnInit { ...@@ -50,22 +51,33 @@ export class JobDetailsComponent extends BaseComponent implements OnInit {
this.applicantJobId = params.id; this.applicantJobId = params.id;
} }
}); });
this.getCareerProfile(); this.getCloneCareerProfileID();
this.getJobPostLocations(); this.getJobPostLocations();
} }
getCareerProfile(): void { getCloneCareerProfileID(): void {
this.isLoading = true; this.isLoading = true;
this.personalDetailsService.getCareerProfile() this.personalDetailsService.getCloneCareerProfile()
.pipe(takeUntil(this.componentInView))
.subscribe(cloneProfileID => {
this.getCareerProfile(cloneProfileID);
}, err => {
this.isLoading = false;
this.utilsService.handleError(err);
});
}
getCareerProfile(id): void {
this.personalDetailsService.getCareerProfileById(id, [])
.pipe(takeUntil(this.componentInView)) .pipe(takeUntil(this.componentInView))
.subscribe(response => { .subscribe(response => {
this.isLoading = false; this.isLoading = false;
this.careerProfile = response; this.clonedCareerProfile = response;
this.initiateApplicantJob(); this.initiateApplicantJob();
}, err => { }, err => {
this.isLoading = false; this.isLoading = false;
this.utilsService.handleError(err); this.utilsService.handleError(err);
}) });
} }
initiateApplicantJob(): void { initiateApplicantJob(): void {
...@@ -73,7 +85,7 @@ export class JobDetailsComponent extends BaseComponent implements OnInit { ...@@ -73,7 +85,7 @@ export class JobDetailsComponent extends BaseComponent implements OnInit {
this.getApplicantJob() this.getApplicantJob()
} else { } else {
this.applicantJob = new ApplicantJobModel(); this.applicantJob = new ApplicantJobModel();
this.applicantJob.Candidate = this.careerProfile.Candidate; this.applicantJob.Candidate = this.clonedCareerProfile.Candidate;
this.utilsService.createObject(this.applicantJob, this.createdObjs) this.utilsService.createObject(this.applicantJob, this.createdObjs)
} }
} }
...@@ -84,7 +96,8 @@ export class JobDetailsComponent extends BaseComponent implements OnInit { ...@@ -84,7 +96,8 @@ export class JobDetailsComponent extends BaseComponent implements OnInit {
.pipe(takeUntil(this.componentInView)) .pipe(takeUntil(this.componentInView))
.subscribe(response => { .subscribe(response => {
this.isLoading = false; this.isLoading = false;
console.log(response); this.applicantJob = response;
this.updatedObjs[this.applicantJob.ObjectID] = this.applicantJob;
}, err => { }, err => {
this.utilsService.handleError(err); this.utilsService.handleError(err);
this.isLoading = false; this.isLoading = false;
...@@ -108,22 +121,33 @@ export class JobDetailsComponent extends BaseComponent implements OnInit { ...@@ -108,22 +121,33 @@ export class JobDetailsComponent extends BaseComponent implements OnInit {
if (this.form.invalid) { if (this.form.invalid) {
return this.helperService.validateAllFormFields(this.form); return this.helperService.validateAllFormFields(this.form);
} }
if (!this.isEditMode) {
this.detailStep = 2; this.detailStep = 2;
} else {
this.saveApplicantJob();
}
} }
saveApplicantJob(): void { saveApplicantJob(exit = false): void {
// this.isLoading = true; this.isLoading = true;
// this.jobService.saveApplicantJob(this.createdObjs, this.updatedObjs, this.deletedObjs) this.jobService.saveApplicantJob(this.createdObjs, this.updatedObjs, this.deletedObjs)
// .pipe(takeUntil(this.componentInView)) .pipe(takeUntil(this.componentInView))
// .subscribe(response => { .subscribe(() => {
// this.isLoading = false; this.isLoading = false;
// this.toastService.success('Job saved'); this.toastService.success(this.isEditMode ? 'Job updated.' : 'Job saved.');
// console.log(response); if (exit) {
// // this.router.navigate([`my-career-web/intro-letters`]) this.router.navigate([`my-career-web/jobs`]);
// }, err => { } else {
// this.utilsService.handleError(err); if (this.selectedProfileType === 'customize' || this.isEditMode) {
// this.isLoading = false; console.log('REDIRECT PERSONAL');
// }); } else if (this.selectedProfileType === 'same') {
console.log('REDIRECT TO LETTER');
}
}
}, err => {
this.utilsService.handleError(err);
this.isLoading = false;
});
} }
} }
...@@ -9,5 +9,6 @@ export class ApplicantJobModel extends BaseModel { ...@@ -9,5 +9,6 @@ export class ApplicantJobModel extends BaseModel {
ApplicantJobStatus: string; ApplicantJobStatus: string;
JobPostedLocation: any; JobPostedLocation: any;
Candidate: any; Candidate: any;
CareerProfile: any;
JobStatus: any; JobStatus: any;
} }
...@@ -5,7 +5,7 @@ import { SaveService } from '../../oneit/services/save.service'; ...@@ -5,7 +5,7 @@ import { SaveService } from '../../oneit/services/save.service';
import { SearchService } from '../../oneit/services/search.service'; import { SearchService } from '../../oneit/services/search.service';
import { UtilsService } from '../../oneit/services/utils.service'; import { UtilsService } from '../../oneit/services/utils.service';
import { SERVICES } from '../config/constants'; import { SERVICES } from '../config/constants';
import { JobApplicationModel } from '../../models/job-application.model'; import { ApplicantJobModel } from '../models/applicant-job.model';
@Injectable() @Injectable()
...@@ -29,7 +29,7 @@ export class JobService { ...@@ -29,7 +29,7 @@ export class JobService {
) )
} }
getApplicantJob(id, assocs = []): Observable<JobApplicationModel> { getApplicantJob(id, assocs = []): Observable<ApplicantJobModel> {
return this.searchService.getObjects(SERVICES.APPLICANT_TALENT_JOBS, 'ByID', {id: id}, assocs, null, null, null, null) return this.searchService.getObjects(SERVICES.APPLICANT_TALENT_JOBS, 'ByID', {id: id}, assocs, null, null, null, null)
.map( .map(
data => { data => {
......
...@@ -105,6 +105,24 @@ export class PersonalDetailsService { ...@@ -105,6 +105,24 @@ export class PersonalDetailsService {
) )
} }
getCareerProfileById(id, assocs = []): Observable<CareerProfileModel> {
return this.searchService.getObjects(SERVICES.CAREER_PROFILES, 'ByID', {id: id}, assocs, null, null, null, null)
.map(
data => {
return this.utilsService.convertResponseToObjects(data, assocs)[0];
}
)
}
getCloneCareerProfile(): Observable<number> {
return this.searchService.getObjects(SERVICES.CLONE_CAREER_PROFILES, 'All', {}, [], null, null, null, null)
.map(
data => {
return data.ClonedCareerFrofileID
}
)
}
saveProfile(createdObjs, updatedObjs, deletedObjs): Observable<any> { saveProfile(createdObjs, updatedObjs, deletedObjs): Observable<any> {
return this.saveService.saveObjects('svc/SavePersonalDetails',createdObjs, updatedObjs, deletedObjs); return this.saveService.saveObjects('svc/SavePersonalDetails',createdObjs, updatedObjs, deletedObjs);
} }
......
...@@ -98,6 +98,10 @@ label.with-help-text { ...@@ -98,6 +98,10 @@ label.with-help-text {
height: 32px; height: 32px;
} }
} }
&-action {
margin-right: 5%;
}
} }
&-body { &-body {
......
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