Commit acfa0823 by Muhammad Usman

complete button functionality

parent ac4ddec0
......@@ -25,7 +25,7 @@
</div>
<div class="assessment-body-tabs mc-card career-builder position-relative">
<div class="assessment-body-tabs mc-card career-builder position-relative" *ngIf="careerProfile">
<p-tabView (onChange)="tabChanged($event)">
<p-tabPanel header="1{{isMobileView ? '' : '. Templates'}}" [selected]="activeTab === 'templates'" rightIcon="fa fa-check" [headerStyleClass]="careerProfile?.ProfileBulderTabCompletion?.TEMPLATES ? 'completed' : ''">
<app-templates></app-templates>
......
......@@ -56,6 +56,9 @@ export class CareerHistoryComponent extends BaseComponent implements OnInit {
.subscribe(response => {
this.isLoading = false;
this.careerProfile = response;
if (!this.careerProfile.CurrentProfileBuilderTab) {
this.router.navigate(['/my-career-web/career-history/templates'])
}
}, err => {
this.isLoading = false;
this.utilsService.handleError(err);
......
......@@ -10,6 +10,7 @@ import { CertificationModel, EducationModel } from '../../../models/education.mo
import { environment } from '../../../../../environments/environment';
import { Router } from '@angular/router';
import { HelperService } from '../../../services/helper.service';
import { CAREER_TABS } from '../../../config/constants';
@Component({
selector: 'app-education',
......@@ -100,6 +101,7 @@ export class EducationComponent extends BaseComponent implements OnInit {
exp.WhenCompleted = UtilsService.convertDateToString(exp.WhenCompletedField);
});
this.isSaving = true;
this.careerProfile.CurrentProfileBuilderTab = CAREER_TABS.SKILLS;
this.personalDetailsService.saveProfile(this.createdObjs, this.updatedObjs, this.deletedObjs)
.pipe(takeUntil(this.componentInView))
.subscribe(res => {
......
......@@ -54,6 +54,6 @@
</div>
<div class="d-flex justify-content-center mt-5">
<button class="mc-btn-primary" pButton label="Complete"></button>
<button class="mc-btn-primary" pButton label="Complete" (click)="completeProfile()"></button>
</div>
</div>
......@@ -4,6 +4,8 @@ import { CareerProfileModel } from '../../../models/career-profile.model';
import { UtilsService } from '../../../../oneit/services/utils.service';
import { BaseComponent } from '../../../base/base.component';
import { takeUntil } from 'rxjs/operators';
import { ToasterService } from '../../../services/toaster.service';
import { Router } from '@angular/router';
@Component({
selector: 'app-publish',
......@@ -17,6 +19,8 @@ export class PublishComponent extends BaseComponent implements OnInit {
constructor(
private personalDetailsService: PersonalDetailsService,
private toasterService: ToasterService,
private router: Router,
private utilsService: UtilsService
) {
super();
......@@ -54,4 +58,9 @@ export class PublishComponent extends BaseComponent implements OnInit {
})
}
completeProfile(): void {
this.toasterService.success('Profile updated.');
this.router.navigate(['/my-career-web/dashboard/home']);
}
}
......@@ -11,6 +11,7 @@ import { environment } from '../../../../../environments/environment';
import { Router } from '@angular/router';
import { HelperService } from '../../../services/helper.service';
import { ToasterService } from '../../../services/toaster.service';
import { CAREER_TABS } from '../../../config/constants';
@Component({
selector: 'app-references',
......@@ -93,6 +94,7 @@ export class ReferencesComponent extends BaseComponent implements OnInit {
}
}
this.isSaving = true;
this.careerProfile.CurrentProfileBuilderTab = CAREER_TABS.PUBLISH;
this.personalDetailsService.saveProfile(this.createdObjs, this.updatedObjs, this.deletedObjs)
.pipe(takeUntil(this.componentInView))
.subscribe(res => {
......
......@@ -9,6 +9,7 @@ import { takeUntil } from 'rxjs/operators';
import { CareerSkillModel, SkillModel } from '../../../models/career-skill.model';
import { Router } from '@angular/router';
import { HelperService } from '../../../services/helper.service';
import { CAREER_TABS } from '../../../config/constants';
@Component({
selector: 'app-skills',
......@@ -101,6 +102,7 @@ export class SkillsComponent extends BaseComponent implements OnInit {
return this.helperService.validateAllFormFields(this.form);
}
this.isSaving = true;
this.careerProfile.CurrentProfileBuilderTab = CAREER_TABS.REFERENCES;
console.log(this.createdObjs, this.updatedObjs, this.deletedObjs);
this.personalDetailsService.saveProfile(this.createdObjs, this.updatedObjs, this.deletedObjs)
.pipe(takeUntil(this.componentInView))
......
......@@ -10,6 +10,7 @@ import { ConfirmationService } from 'primeng/api';
import { Router } from '@angular/router';
import { HelperService } from '../../../services/helper.service';
import { ToasterService } from '../../../services/toaster.service';
import { CAREER_TABS } from '../../../config/constants';
@Component({
selector: 'app-work-history',
......@@ -104,6 +105,7 @@ export class WorkHistoryComponent extends BaseComponent implements OnInit {
exp.EndMonth = UtilsService.convertDateToString(exp.EndMonthField);
});
this.isSaving = true;
this.careerProfile.CurrentProfileBuilderTab = CAREER_TABS.EDUCATION;
this.personalDetailsService.saveProfile(this.createdObjs, this.updatedObjs, this.deletedObjs)
.pipe(takeUntil(this.componentInView))
.subscribe(res => {
......
......@@ -130,3 +130,13 @@ export const PROFILE_TASKS = [
started: false
}
];
export const CAREER_TABS = {
PERSONAL_DATA: 'PERSONAL_DATA',
WORK_HISTORY: 'WORK_HISTORY',
EDUCATION: 'EDUCATION',
SKILLS: 'SKILLS',
REFERENCES: 'REFERENCES',
TEMPLATES: 'TEMPLATES',
PUBLISH: 'PUBLISH'
};
......@@ -9,6 +9,7 @@ import { ToasterService } from '../../services/toaster.service';
import { Router } from '@angular/router';
import { UtilsService } from '../../../oneit/services/utils.service';
import { HelperService } from '../../services/helper.service';
import { CAREER_TABS } from '../../config/constants';
@Component({
selector: 'app-personal-details',
......@@ -109,6 +110,9 @@ export class PersonalDetailsComponent extends BaseComponent implements OnInit {
}
this.careerProfile.Candidate.User.UserName = this.careerProfile.Candidate.User.Email;
this.isSaving = true;
if (this.asChildComponent && customRoute) {
this.careerProfile.CurrentProfileBuilderTab = CAREER_TABS.WORK_HISTORY;
}
this.personalDetailsService.saveProfile(this.createdObjs, this.updatedObjs, this.deletedObjs)
.pipe(takeUntil(this.componentInView))
.subscribe(res => {
......
......@@ -23,6 +23,7 @@ export class CareerProfileModel extends BaseModel {
Referees: RefereeModel[] = [];
NoWorkExperience: boolean;
NoEducationQualification: boolean;
CurrentProfileBuilderTab: string;
NoReference: boolean;
PublishProfile: boolean;
AssumedUser: boolean;
......
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