hide undo finalize button in plan editor when plan is deposited
This commit is contained in:
parent
34873ca03c
commit
cacfd9375d
|
@ -57,12 +57,12 @@
|
|||
<button [disabled]="saving" mat-menu-item (click)="formSubmit()" type="button">{{ 'PLAN-EDITOR.ACTIONS.SAVE-AND-CONTINUE' | translate }}</button>
|
||||
</mat-menu>
|
||||
</div>
|
||||
<div class="col-auto d-flex align-items-center" *ngIf="canFinalize" [matTooltipDisabled]="canFinalize && formGroup.pristine" matTooltip="{{'PLAN-EDITOR.ACTIONS.FINALIZE.CAN-NOT-FINALIZE' | translate}}">
|
||||
<div class="col-auto d-flex align-items-center" *ngIf="canFinalize && this.hasNotDoi()" [matTooltipDisabled]="canFinalize && formGroup.pristine" matTooltip="{{'PLAN-EDITOR.ACTIONS.FINALIZE.CAN-NOT-FINALIZE' | translate}}">
|
||||
<button [disabled]="!formGroup.pristine" mat-raised-button class="save-btn mr-2" type="button" (click)="finalize()">{{ 'PLAN-EDITOR.ACTIONS.FINALIZE.FINALIZE' | translate }}</button>
|
||||
</div>
|
||||
<div *ngIf="formGroup.pristine" class="col-auto d-flex align-items-center">
|
||||
<button [disabled]="saving" *ngIf="isLocked" mat-raised-button class="save-btn mr-2" type="button">{{ 'PLAN-EDITOR.ACTIONS.LOCKED' | translate}}</button>
|
||||
<button [disabled]="saving" *ngIf="canReverseFinalize" mat-raised-button class="save-btn mr-2" type="button" (click)="reverseFinalization()">{{ 'PLAN-EDITOR.ACTIONS.REVERSE' | translate }}</button>
|
||||
<button [disabled]="saving" *ngIf="canReverseFinalize && this.hasNotDoi()" mat-raised-button class="save-btn mr-2" type="button" (click)="reverseFinalization()">{{ 'PLAN-EDITOR.ACTIONS.REVERSE' | translate }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -227,6 +227,7 @@ export class PlanEditorComponent extends BaseEditor<PlanEditorModel, Plan> imple
|
|||
if (data.planDescriptionTemplates) {
|
||||
data.planDescriptionTemplates = data.planDescriptionTemplates.filter(x => x.isActive === IsActive.Active);
|
||||
}
|
||||
if (data.entityDois && data.entityDois.length > 0) data.entityDois = data.entityDois.filter(x => x.isActive === IsActive.Active);
|
||||
|
||||
}
|
||||
this.item = data;
|
||||
|
@ -400,6 +401,10 @@ export class PlanEditorComponent extends BaseEditor<PlanEditorModel, Plan> imple
|
|||
});
|
||||
}
|
||||
|
||||
hasNotDoi() {
|
||||
return (this.item.entityDois == null || this.item.entityDois.length == 0);
|
||||
}
|
||||
|
||||
finalize() {
|
||||
const dialogRef = this.dialog.open(PlanFinalizeDialogComponent, {
|
||||
maxWidth: '500px',
|
||||
|
|
|
@ -14,6 +14,7 @@ import { BaseEditorResolver } from '@common/base/base-editor.resolver';
|
|||
import { Guid } from '@common/types/guid';
|
||||
import { takeUntil, tap } from 'rxjs/operators';
|
||||
import { nameof } from 'ts-simple-nameof';
|
||||
import { EntityDoi } from '@app/core/model/entity-doi/entity-doi';
|
||||
|
||||
@Injectable()
|
||||
export class PlanEditorEntityResolver extends BaseEditorResolver {
|
||||
|
@ -84,6 +85,10 @@ export class PlanEditorEntityResolver extends BaseEditorResolver {
|
|||
[nameof<Plan>(x => x.planDescriptionTemplates), nameof<PlanDescriptionTemplate>(x => x.descriptionTemplateGroupId)].join('.'),
|
||||
[nameof<Plan>(x => x.planDescriptionTemplates), nameof<PlanDescriptionTemplate>(x => x.isActive)].join('.'),
|
||||
|
||||
[nameof<Plan>(x => x.entityDois), nameof<EntityDoi>(x => x.id)].join('.'),
|
||||
[nameof<Plan>(x => x.entityDois), nameof<EntityDoi>(x => x.repositoryId)].join('.'),
|
||||
[nameof<Plan>(x => x.entityDois), nameof<EntityDoi>(x => x.doi)].join('.'),
|
||||
[nameof<Plan>(x => x.entityDois), nameof<EntityDoi>(x => x.isActive)].join('.'),
|
||||
|
||||
...PlanEditorEntityResolver.blueprintLookupFields(nameof<Plan>(x => x.blueprint)),
|
||||
|
||||
|
|
Loading…
Reference in New Issue