fixed editable contacts on finalized dmp
This commit is contained in:
parent
ee611ed7e0
commit
c23868af0f
|
@ -239,7 +239,7 @@
|
|||
</div>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<button mat-icon-button (click)="addContact()" [disabled]="!this.canSave && !isNew">
|
||||
<button mat-icon-button (click)="addContact()" [disabled]="isFinalized || (!this.canSave && !isNew)">
|
||||
<mat-icon>add</mat-icon>
|
||||
</button>
|
||||
</div>
|
||||
|
|
|
@ -63,6 +63,7 @@ export class DmpEditorComponent extends BaseEditor<DmpEditorModel, Dmp> implemen
|
|||
|
||||
isNew = true;
|
||||
isDeleted = false;
|
||||
isFinalized = false;
|
||||
item: Dmp;
|
||||
selectedBlueprint: DmpBlueprint;
|
||||
step: number = 0;
|
||||
|
@ -115,11 +116,11 @@ export class DmpEditorComponent extends BaseEditor<DmpEditorModel, Dmp> implemen
|
|||
}
|
||||
|
||||
protected get canSave(): boolean {
|
||||
return !this.isDeleted && (this.hasPermission(this.authService.permissionEnum.EditDmp) || this.item?.authorizationFlags?.some(x => x === AppPermission.EditDmp));
|
||||
return !this.isDeleted && !this.isFinalized && (this.hasPermission(this.authService.permissionEnum.EditDmp) || this.item?.authorizationFlags?.some(x => x === AppPermission.EditDmp));
|
||||
}
|
||||
|
||||
protected get canFinalize(): boolean {
|
||||
return !this.isDeleted && (this.hasPermission(this.authService.permissionEnum.EditDmp) || this.item?.authorizationFlags?.some(x => x === AppPermission.EditDmp));
|
||||
return !this.isDeleted && !this.isFinalized && (this.hasPermission(this.authService.permissionEnum.EditDmp) || this.item?.authorizationFlags?.some(x => x === AppPermission.EditDmp));
|
||||
}
|
||||
|
||||
protected canEditSection(id: Guid): boolean {
|
||||
|
@ -219,6 +220,7 @@ export class DmpEditorComponent extends BaseEditor<DmpEditorModel, Dmp> implemen
|
|||
|
||||
this.selectedBlueprint = data?.blueprint;
|
||||
this.isDeleted = data ? data.isActive === IsActive.Inactive : false;
|
||||
this.isFinalized = data ? data.status === DmpStatus.Finalized : false;
|
||||
|
||||
if (data && data.id) {
|
||||
const descriptionSectionPermissionResolverModel: DescriptionSectionPermissionResolver = {
|
||||
|
|
Loading…
Reference in New Issue