Commit cc49f5d6 by Harsh Shah

Create Job - check visibility only if button is enabled

parent 908b2246
...@@ -192,31 +192,33 @@ export class AdminPortalLayoutComponent implements OnInit, OnDestroy { ...@@ -192,31 +192,33 @@ export class AdminPortalLayoutComponent implements OnInit, OnDestroy {
} }
createJobClicked(): void { createJobClicked(): void {
this.showLoader = true; if(!this.createJobDisabled) {
this.subscriptions.push( this.showLoader = true;
this.adminPortalLayoutService.createJob(this.selectedTeamID, this.companyUser) this.subscriptions.push(
.subscribe( this.adminPortalLayoutService.createJob(this.selectedTeamID, this.companyUser)
data => { .subscribe(
if (data.AllowCreateJob) { data => {
if (data.AllowCreateJob === 'REACHED_CAP') { if (data.AllowCreateJob) {
this.modalService.show(this.reachedCapModal); if (data.AllowCreateJob === 'REACHED_CAP') {
} else if (data.AllowCreateJob === 'TRIAL') { this.modalService.show(this.reachedCapModal);
this.modalService.show(this.trialNotAllowedModal); } else if (data.AllowCreateJob === 'TRIAL') {
} else { this.modalService.show(this.trialNotAllowedModal);
} else {
this.router.navigate(['admin/iframe-page', data.redirectURL]);
this.router.navigate(['admin/iframe-page', data.redirectURL]);
}
this.isStandardUser = data.StandardUser;
this.redirectURL = data.redirectURL;
this.showLoader = false;
} }
this.isStandardUser = data.StandardUser; },
this.redirectURL = data.redirectURL; error => {
this.showLoader = false; this.showLoader = false;
this.utilsService.handleError(error);
} }
}, )
error => { );
this.showLoader = false; }
this.utilsService.handleError(error);
}
)
);
} }
ngOnDestroy(): void { ngOnDestroy(): void {
......
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