Adds "Update" button on finalized "Dataset Template".
This commit is contained in:
parent
c8358f22dd
commit
1a160edece
|
@ -70,12 +70,17 @@
|
||||||
<!-- SAVE BUTTON -->
|
<!-- SAVE BUTTON -->
|
||||||
<div class="col-6 d-flex" *ngIf="!viewOnly">
|
<div class="col-6 d-flex" *ngIf="!viewOnly">
|
||||||
<div class="row mt-4">
|
<div class="row mt-4">
|
||||||
<button mat-raised-button class="col-auto mr-2" color="primary" type="button col-auto" (click)='onSubmit()' [disabled]="!form.valid">Save</button>
|
<button mat-raised-button class="col-auto mr-2" color="primary" type="button col-auto" (click)='onSubmit()' [disabled]="!form.valid">{{'DATASET-PROFILE-EDITOR.ACTIONS.SAVE' | translate}}</button>
|
||||||
<button mat-raised-button class="col-auto" color="primary" type="button col-auto" (click)='finalize()' [disabled]="!form.valid">Finalize</button>
|
<button mat-raised-button class="col-auto" color="primary" type="button col-auto" (click)='finalize()' [disabled]="!form.valid">{{'DATASET-PROFILE-EDITOR.ACTIONS.FINALIZE' | translate}}</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- SAVE BUTTON WHEN FINALIZED-->
|
||||||
|
<div class="col-6 d-flex" *ngIf="showUpdateButton()">
|
||||||
|
<div class="row mt-4">
|
||||||
|
<button mat-raised-button class="col-auto mr-2" color="primary" type="button col-auto" (click)='updateFinalized()' [disabled]="!form.valid">{{'DATASET-PROFILE-EDITOR.ACTIONS.UPDATE' | translate}}</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- DELETE BUTTON -->
|
<!-- DELETE BUTTON -->
|
||||||
<div class="col-6" *ngIf="viewOnly"></div>
|
|
||||||
<div class="col-6 d-flex justify-content-end" *ngIf="!isNew">
|
<div class="col-6 d-flex justify-content-end" *ngIf="!isNew">
|
||||||
<div class="row mt-4">
|
<div class="row mt-4">
|
||||||
<button mat-raised-button color="primary" (click)="delete()">
|
<button mat-raised-button color="primary" (click)="delete()">
|
||||||
|
|
|
@ -222,6 +222,18 @@ export class DatasetProfileEditorComponent extends BaseComponent implements OnIn
|
||||||
this.onSubmit();
|
this.onSubmit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
updateFinalized() {
|
||||||
|
this.datasetProfileService.updateForm(this.datasetProfileId, this.form.getRawValue())
|
||||||
|
.pipe(takeUntil(this._destroyed))
|
||||||
|
.subscribe(() => {
|
||||||
|
this.router.navigate(['/dataset-profiles']);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
showUpdateButton() {
|
||||||
|
return !this.isNew && this.dataModel.status === DatasetProfileEnum.FINALIZED;
|
||||||
|
}
|
||||||
|
|
||||||
isStepActive(step: number) {
|
isStepActive(step: number) {
|
||||||
return this.stepper && this.stepper.selectedIndex === step;
|
return this.stepper && this.stepper.selectedIndex === step;
|
||||||
}
|
}
|
||||||
|
|
|
@ -136,7 +136,7 @@ export class DatasetWizardComponent extends BaseComponent implements OnInit, IBr
|
||||||
// this.availableProfiles = this.datasetWizardModel.dmp.profiles;
|
// this.availableProfiles = this.datasetWizardModel.dmp.profiles;
|
||||||
},
|
},
|
||||||
error => {
|
error => {
|
||||||
this.uiNotificationService.snackBarNotification(this.language.instant('DATASET-WIZARD.MESSAGES.DATAESET-NOT-FOUND'), SnackBarNotificationLevel.Error);
|
this.uiNotificationService.snackBarNotification(this.language.instant('DATASET-WIZARD.MESSAGES.DATASET-NOT-FOUND'), SnackBarNotificationLevel.Error);
|
||||||
this.router.navigate(['/datasets/edit/' + this.itemId]);
|
this.router.navigate(['/datasets/edit/' + this.itemId]);
|
||||||
return observableOf(null);
|
return observableOf(null);
|
||||||
});
|
});
|
||||||
|
|
|
@ -330,6 +330,8 @@
|
||||||
},
|
},
|
||||||
"ACTIONS": {
|
"ACTIONS": {
|
||||||
"SAVE": "Save",
|
"SAVE": "Save",
|
||||||
|
"FINALIZE": "Finalize",
|
||||||
|
"UPDATE": "Update",
|
||||||
"CANCEL": "Cancel",
|
"CANCEL": "Cancel",
|
||||||
"DELETE": "Delete",
|
"DELETE": "Delete",
|
||||||
"ADD-PAGE": "Add Page +",
|
"ADD-PAGE": "Add Page +",
|
||||||
|
@ -453,7 +455,7 @@
|
||||||
"UPDATE-DATASET-PROFILE": "Update Template"
|
"UPDATE-DATASET-PROFILE": "Update Template"
|
||||||
},
|
},
|
||||||
"MESSAGES": {
|
"MESSAGES": {
|
||||||
"DATAESET-NOT-FOUND": "Dataset Description does not exist",
|
"DATASET-NOT-FOUND": "Dataset Description does not exist",
|
||||||
"SUCCESS-UPDATE-DATASET-PROFILE": "Dataset Description Template updated successfully"
|
"SUCCESS-UPDATE-DATASET-PROFILE": "Dataset Description Template updated successfully"
|
||||||
},
|
},
|
||||||
"UPLOAD": {
|
"UPLOAD": {
|
||||||
|
|
Loading…
Reference in New Issue