--->
+-->
\ No newline at end of file
diff --git a/dmp-frontend/src/app/ui/dmp/overview/dmp-overview.component.ts b/dmp-frontend/src/app/ui/dmp/overview/dmp-overview.component.ts
index 506537218..d824b15f9 100644
--- a/dmp-frontend/src/app/ui/dmp/overview/dmp-overview.component.ts
+++ b/dmp-frontend/src/app/ui/dmp/overview/dmp-overview.component.ts
@@ -221,15 +221,15 @@ export class DmpOverviewComponent extends BaseComponent implements OnInit {
this.dmpService.delete(this.dmp.id)
.pipe(takeUntil(this._destroyed))
.subscribe(
- complete => { this.onCallbackSuccess() },
+ complete => { this.onDeleteCallbackSuccess() },
error => this.onDeleteCallbackError(error)
);
}
});
}
- onCallbackSuccess(): void {
- this.uiNotificationService.snackBarNotification(this.isNew ? this.language.instant('GENERAL.SNACK-BAR.SUCCESSFUL-CREATION') : this.language.instant('GENERAL.SNACK-BAR.SUCCESSFUL-UPDATE'), SnackBarNotificationLevel.Success);
+ onDeleteCallbackSuccess(): void {
+ this.uiNotificationService.snackBarNotification(this.language.instant('GENERAL.SNACK-BAR.SUCCESSFUL-DATASET-PROFILE-DELETE'), SnackBarNotificationLevel.Success);
this.router.navigate(['/plans']);
}
@@ -237,6 +237,15 @@ export class DmpOverviewComponent extends BaseComponent implements OnInit {
this.uiNotificationService.snackBarNotification(error.error.message ? error.error.message : this.language.instant('GENERAL.SNACK-BAR.UNSUCCESSFUL-DELETE'), SnackBarNotificationLevel.Error);
}
+ onUpdateCallbackSuccess(): void {
+ this.uiNotificationService.snackBarNotification(this.language.instant('GENERAL.SNACK-BAR.SUCCESSFUL-UPDATE'), SnackBarNotificationLevel.Success);
+ this.reloadPage();
+ }
+
+ onUpdateCallbackError(error) {
+ this.uiNotificationService.snackBarNotification(error.error.message ? error.error.message : this.language.instant('DATASET-UPLOAD.SNACK-BAR.UNSUCCESSFUL'), SnackBarNotificationLevel.Error);
+ }
+
downloadXml(id: string) {
this.dmpService.downloadXML(id)
.pipe(takeUntil(this._destroyed))
@@ -478,7 +487,7 @@ export class DmpOverviewComponent extends BaseComponent implements OnInit {
if (result) {
this.dmpService.publish(dmpId)
.pipe(takeUntil(this._destroyed))
- .subscribe(() => {
+ .subscribe(() => {
this.hasPublishButton = false;
this.reloadPage();
});
@@ -516,18 +525,14 @@ export class DmpOverviewComponent extends BaseComponent implements OnInit {
.subscribe(
complete => {
this.dmp.status = DmpStatus.Finalized;
- this.onCallbackSuccess()
+ this.onUpdateCallbackSuccess();
},
- error => this.onFinalizeCallbackError(error)
+ error => this.onUpdateCallbackError(error)
);
}
});
}
- onFinalizeCallbackError(error) {
- this.uiNotificationService.snackBarNotification(error.error.message ? error.error.message : this.language.instant('DMP-EDITOR.SNACK-BAR.UNSUCCESSFUL-FINALIZE'), SnackBarNotificationLevel.Error);
- }
-
newVersion(id: String, label: String) {
this.router.navigate(['/plans/new_version/' + id, { dmpLabel: label }]);
}
@@ -571,14 +576,27 @@ export class DmpOverviewComponent extends BaseComponent implements OnInit {
}
reverse() {
- this.dmpService.unfinalize(this.dmp.id).pipe(takeUntil(this._destroyed))
- .subscribe(
- complete => {
- this.dmp.status = DmpStatus.Draft;
- this.onCallbackSuccess()
- },
- error => this.onFinalizeCallbackError(error)
- );
+ const dialogRef = this.dialog.open(ConfirmationDialogComponent, {
+ restoreFocus: false,
+ data: {
+ message: this.language.instant('GENERAL.CONFIRMATION-DIALOG.UNFINALIZE-ITEM'),
+ confirmButton: this.language.instant('QUICKWIZARD.SAVE-DIALOG.ACTIONS.AFFIRMATIVE'),
+ cancelButton: this.language.instant('QUICKWIZARD.SAVE-DIALOG.ACTIONS.NEGATIVE'),
+ isDeleteConfirmation: false
+ }
+ });
+ dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe(result => {
+ if (result) {
+ this.dmpService.unfinalize(this.dmp.id).pipe(takeUntil(this._destroyed))
+ .subscribe(
+ complete => {
+ this.dmp.status = DmpStatus.Draft;
+ this.onUpdateCallbackSuccess()
+ },
+ error => this.onUpdateCallbackError(error)
+ );
+ }
+ });
}
goBack(): void {
@@ -595,10 +613,9 @@ export class DmpOverviewComponent extends BaseComponent implements OnInit {
return this.dmpService.updateUsers(this.dmp.id, this.dmp.users).pipe(takeUntil(this._destroyed))
.subscribe(
complete => {
- this.onCallbackSuccess();
- this.reloadPage();
+ this.onUpdateCallbackSuccess();
},
- error => this.onDeleteCallbackError(error)
+ error => this.onUpdateCallbackError(error)
);
}
diff --git a/dmp-frontend/src/assets/i18n/en.json b/dmp-frontend/src/assets/i18n/en.json
index 50e94b9d0..da85c1798 100644
--- a/dmp-frontend/src/assets/i18n/en.json
+++ b/dmp-frontend/src/assets/i18n/en.json
@@ -50,6 +50,7 @@
"DELETE-ITEM": "Delete this item?",
"DELETE-USER": "Remove this collaborator?",
"FINALIZE-ITEM": "Finalize this item?",
+ "UNFINALIZE-ITEM": "Undo Finalization?",
"PUBLISH-ITEM": "Publish this item?",
"ADD-DATASET": "Do you want to continue by adding a Dataset Description to your DMP? You can always add more Dataset Descriptions using \"Add Dataset Description (Wizard)\" menu.",
"ZENODO-DOI": "Would you like to create digital object identifier (DOI) with {{username}} account for the DMP?",
diff --git a/dmp-frontend/src/assets/i18n/es.json b/dmp-frontend/src/assets/i18n/es.json
index c20619dea..94837b2f7 100644
--- a/dmp-frontend/src/assets/i18n/es.json
+++ b/dmp-frontend/src/assets/i18n/es.json
@@ -50,6 +50,7 @@
"DELETE-ITEM": "¿Borrar este item?",
"DELETE-USER": "¿Borrar este colaborador?",
"FINALIZE-ITEM": "¿Finalizar este item?",
+ "UNFINALIZE-ITEM": "Undo Finalization?",
"PUBLISH-ITEM": "¿Publicar este item?",
"ADD-DATASET": "¿Quiere continuar añadiendo una descripción al Dataset de su PGD? Siempre puede añadir más descripciones al Dataset utilizado el menú\"(Asistente) Añadir una decripción del Dataset\".",
"ZENODO-DOI": "¿Quiere crear un Identificación de Objeto Digital (DOI) para el PGD?",
diff --git a/dmp-frontend/src/assets/i18n/gr.json b/dmp-frontend/src/assets/i18n/gr.json
index 5dd9b30f0..a14ef323f 100644
--- a/dmp-frontend/src/assets/i18n/gr.json
+++ b/dmp-frontend/src/assets/i18n/gr.json
@@ -50,6 +50,7 @@
"DELETE-ITEM": "Διαγραφή αυτού του στοιχείου;",
"DELETE-USER": "Αφαίρεση αυτού του συνεργάτη;",
"FINALIZE-ITEM": "Ολοκλήρωση αυτού του στοιχείου;",
+ "UNFINALIZE-ITEM": "Undo Finalization?",
"PUBLISH-ITEM": "Δημοσίευση αυτού του στοιχείου;",
"ADD-DATASET": "Θέλετε να συνεχίσετε προσθέτοντας μια Περιγραφή Συνόλου Δεδομένων στο Σχέδιο Διαχείρισης Δεδομένων σας; Μπορείτε πάντα να προσθέσετε περισσότερες Περιγραφές Συνόλων Δεδομένων χρησιμοποιώντας \"Add Dataset Description (Wizard)\" menu.",
"ZENODO-DOI": "Θέλετε να δημιουργήσετε μονοσήμαντο αναγνωριστικό ψηφιακού αντικειμένου (DOI) για το Σχέδιο Διαχείρισης Δεδομένων σας;",