Commit acfa0823 by Muhammad Usman

complete button functionality

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