share certificate and share product maker checker
This commit is contained in:
@@ -13,6 +13,7 @@ import { MatDialog } from '@angular/material/dialog';
|
||||
|
||||
/** Custom Dialogs */
|
||||
import { DeleteDialogComponent } from 'app/shared/delete-dialog/delete-dialog.component';
|
||||
import { ShareCertificateDialogComponent } from './share-certificate-dialog/share-certificate-dialog.component';
|
||||
|
||||
/** Custom Services */
|
||||
import { SharesService } from '../shares.service';
|
||||
@@ -98,6 +99,9 @@ export class SharesAccountViewComponent implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
/** Whether this account has a details edit awaiting checker approval. */
|
||||
hasPendingEdit = false;
|
||||
|
||||
ngOnInit() {
|
||||
this.setConditionalButtons();
|
||||
if (this.router.url.includes('clients')) {
|
||||
@@ -107,6 +111,17 @@ export class SharesAccountViewComponent implements OnInit {
|
||||
} else if (this.router.url.includes('centers')) {
|
||||
this.entityType = 'Center';
|
||||
}
|
||||
this.sharesService.getPendingShareAccountEdit(this.sharesAccountData.id).subscribe({
|
||||
next: (edit: any) => {
|
||||
this.hasPendingEdit = !!edit && edit.status === 'PENDING';
|
||||
if (this.hasPendingEdit) {
|
||||
this.buttonConfig.removeOption('Edit Details');
|
||||
}
|
||||
},
|
||||
error: () => {
|
||||
this.hasPendingEdit = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -164,6 +179,12 @@ export class SharesAccountViewComponent implements OnInit {
|
||||
case 'Modify Application':
|
||||
this.router.navigate(['edit'], { relativeTo: this.route });
|
||||
break;
|
||||
case 'Edit Details':
|
||||
this.router.navigate(['edit-details'], { relativeTo: this.route });
|
||||
break;
|
||||
case 'Share Certificate':
|
||||
this.viewShareCertificate();
|
||||
break;
|
||||
case 'Delete':
|
||||
this.deleteSharesAccount();
|
||||
break;
|
||||
@@ -185,4 +206,15 @@ export class SharesAccountViewComponent implements OnInit {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private viewShareCertificate() {
|
||||
this.dialog.open(ShareCertificateDialogComponent, {
|
||||
data: {
|
||||
sharesAccountData: this.sharesAccountData,
|
||||
clientId: this.sharesAccountData.clientId
|
||||
},
|
||||
width: '850px',
|
||||
maxWidth: '95vw'
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user