Commit dd6df822 by Muhammad Usman

complete button disabled if not all tabs completed

parent 067d4d4a
...@@ -81,7 +81,7 @@ ...@@ -81,7 +81,7 @@
</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" (click)="saveProfile(true)"></button> <button class="mc-btn-primary" pButton label="Complete" [disabled]="!isComplete" (click)="saveProfile(true)"></button>
</div> </div>
</div> </div>
</ng-template> </ng-template>
...@@ -42,12 +42,18 @@ export class PublishComponent extends BaseComponent implements OnInit { ...@@ -42,12 +42,18 @@ export class PublishComponent extends BaseComponent implements OnInit {
this.careerProfile = response; this.careerProfile = response;
this.updatedObjs[this.careerProfile.ObjectID] = this.careerProfile; this.updatedObjs[this.careerProfile.ObjectID] = this.careerProfile;
this.careerProfileLoaded.emit(this.careerProfile); this.careerProfileLoaded.emit(this.careerProfile);
console.log(this.careerProfile);
}, err => { }, err => {
this.isLoading = false; this.isLoading = false;
this.utilsService.handleError(err); this.utilsService.handleError(err);
}) })
} }
get isComplete(): boolean {
return this.careerProfile.ProfileBulderTabCompletion && Object.keys(this.careerProfile.ProfileBulderTabCompletion)
.every(key => this.careerProfile.ProfileBulderTabCompletion[key]);
}
saveProfile(complete = false): void { saveProfile(complete = false): void {
this.isSaving = true; this.isSaving = true;
this.careerProfile.CurrentProfileBuilderTab = CAREER_TABS.PUBLISH; this.careerProfile.CurrentProfileBuilderTab = CAREER_TABS.PUBLISH;
......
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