Removed new version from file on dmp blueprint listing options, added version column, fixed header and save button disabled conditions on dmp blueprint editor
This commit is contained in:
parent
bc9691fa5d
commit
176d13d443
|
@ -10,6 +10,7 @@ export interface DmpBlueprint extends BaseEntity {
|
|||
label: string;
|
||||
definition: DmpBlueprintDefinition;
|
||||
status: DmpBlueprintStatus;
|
||||
version: number;
|
||||
}
|
||||
|
||||
export interface DmpBlueprintDefinition {
|
||||
|
@ -55,12 +56,6 @@ export interface DmpBlueprintPersist extends BaseEntityPersist {
|
|||
status: DmpBlueprintStatus;
|
||||
}
|
||||
|
||||
export interface CloneDmpBlueprintPersist {
|
||||
label: string;
|
||||
definition: DmpBlueprintDefinitionPersist;
|
||||
status: DmpBlueprintStatus;
|
||||
}
|
||||
|
||||
export interface NewVersionDmpBlueprintPersist {
|
||||
label: string;
|
||||
definition: DmpBlueprintDefinitionPersist;
|
||||
|
|
|
@ -2,7 +2,8 @@
|
|||
<div class="container-fluid dmp-blueprint-editor">
|
||||
<div class="row align-items-center mb-4" *ngIf="formGroup">
|
||||
<div class="col-auto">
|
||||
<h3 *ngIf="isNew">{{'DMP-BLUEPRINT-EDITOR.TITLE.NEW' | translate}}</h3>
|
||||
<h3 *ngIf="!isFinalized && !isNewVersion">{{'DMP-BLUEPRINT-EDITOR.TITLE.NEW' | translate}}</h3>
|
||||
<h3 *ngIf="isFinalized && !isNewVersion">{{formGroup.get('label').value}}</h3>
|
||||
<h3 *ngIf="isClone">
|
||||
<span>{{'DMP-BLUEPRINT-EDITOR.TITLE.CLONE' | translate}}</span>
|
||||
{{formGroup.get('label').value}}
|
||||
|
@ -11,7 +12,6 @@
|
|||
<span>{{'DMP-BLUEPRINT-EDITOR.TITLE.NEW-VERSION' | translate}}</span>
|
||||
{{formGroup.get('label').value}}
|
||||
</h3>
|
||||
<!-- <h3 *ngIf="!isNew">{{formGroup.get('label').value}}</h3> -->
|
||||
</div>
|
||||
<div class="col"></div>
|
||||
<div class="col-auto" *ngIf="!isNew">
|
||||
|
@ -256,7 +256,7 @@
|
|||
</div>
|
||||
<div class="col"></div>
|
||||
<div class="col-auto">
|
||||
<button mat-button class="action-btn" [disabled]="formGroup.disabled" type="submit">
|
||||
<button mat-button class="action-btn" [disabled]="!canSave" type="submit">
|
||||
{{'DMP-BLUEPRINT-EDITOR.ACTIONS.SAVE' | translate}}
|
||||
</button>
|
||||
</div>
|
||||
|
|
|
@ -78,13 +78,22 @@ export class DmpBlueprintEditorComponent extends BaseEditor<DmpBlueprintEditorMo
|
|||
}
|
||||
|
||||
protected get canSave(): boolean {
|
||||
return !this.isDeleted && this.hasPermission(this.authService.permissionEnum.EditDmpBlueprint);
|
||||
if (this.isDeleted || !this.hasPermission(this.authService.permissionEnum.EditDmpBlueprint)) return false;
|
||||
if (this.isNewVersion) return this.canCreateNewVersion;
|
||||
return !this.formGroup.disabled;
|
||||
}
|
||||
|
||||
protected get canFinalize(): boolean {
|
||||
return !this.isDeleted && this.hasPermission(this.authService.permissionEnum.EditDmpBlueprint);
|
||||
}
|
||||
|
||||
protected get canCreateNewVersion(): boolean {
|
||||
return this.isFinalized;
|
||||
}
|
||||
|
||||
protected get isFinalized(): boolean {
|
||||
return this.editorModel.status == DmpBlueprintStatus.Finalized;
|
||||
}
|
||||
|
||||
private hasPermission(permission: AppPermission): boolean {
|
||||
return this.authService.hasPermission(permission) || this.editorModel?.permissions?.includes(permission);
|
||||
|
|
|
@ -96,9 +96,6 @@
|
|||
<button mat-menu-item [routerLink]="['./new-version/' + row.id]">
|
||||
<mat-icon>queue</mat-icon>{{'DMP-BLUEPRINT-LISTING.ACTIONS.NEW-VERSION' | translate}}
|
||||
</button>
|
||||
<button mat-menu-item (click)="newVersionFromFile(row.id, row.label)">
|
||||
<mat-icon>file_copy</mat-icon>{{'DMP-BLUEPRINT-LISTING.ACTIONS.NEW-VERSION-FROM-FILE' | translate}}
|
||||
</button>
|
||||
<button mat-menu-item [routerLink]="['./clone/' + row.id]">
|
||||
<mat-icon>content_copy</mat-icon>{{'DMP-BLUEPRINT-LISTING.ACTIONS.CLONE' | translate}}
|
||||
</button>
|
||||
|
|
|
@ -49,6 +49,7 @@ export class DmpBlueprintListingComponent extends BaseListingComponent<DmpBluepr
|
|||
nameof<DmpBlueprint>(x => x.id),
|
||||
nameof<DmpBlueprint>(x => x.label),
|
||||
nameof<DmpBlueprint>(x => x.status),
|
||||
nameof<DmpBlueprint>(x => x.version),
|
||||
nameof<DmpBlueprint>(x => x.updatedAt),
|
||||
nameof<DmpBlueprint>(x => x.createdAt),
|
||||
nameof<DmpBlueprint>(x => x.hash),
|
||||
|
@ -103,12 +104,18 @@ export class DmpBlueprintListingComponent extends BaseListingComponent<DmpBluepr
|
|||
prop: nameof<DmpBlueprint>(x => x.label),
|
||||
sortable: true,
|
||||
languageName: 'DMP-BLUEPRINT-LISTING.FIELDS.NAME'
|
||||
}, {
|
||||
},
|
||||
{
|
||||
prop: nameof<DmpBlueprint>(x => x.status),
|
||||
sortable: true,
|
||||
languageName: 'DMP-BLUEPRINT-LISTING.FIELDS.STATUS',
|
||||
cellTemplate: this.dmpBlueprintStatus
|
||||
},
|
||||
{
|
||||
prop: nameof<DmpBlueprint>(x => x.version),
|
||||
sortable: true,
|
||||
languageName: 'DMP-BLUEPRINT-LISTING.FIELDS.VERSION'
|
||||
},
|
||||
{
|
||||
prop: nameof<DmpBlueprint>(x => x.createdAt),
|
||||
sortable: true,
|
||||
|
|
|
@ -1900,6 +1900,7 @@
|
|||
"FIELDS": {
|
||||
"NAME": "Name",
|
||||
"STATUS": "Status",
|
||||
"VERSION": "Version",
|
||||
"UPDATED-AT": "Updated",
|
||||
"CREATED-AT": "Created",
|
||||
"PUBLISHED-AT": "Published",
|
||||
|
@ -1922,7 +1923,6 @@
|
|||
"EDIT": "Edit",
|
||||
"CLONE": "Clone",
|
||||
"NEW-VERSION": "New Version",
|
||||
"NEW-VERSION-FROM-FILE": "New Version from File",
|
||||
"DOWNLOAD-XML": "Download XML"
|
||||
},
|
||||
"IMPORT": {
|
||||
|
|
Loading…
Reference in New Issue