Fixes bug on DMP overview when trying to finalize and adds error message on failled finalize.
This commit is contained in:
parent
de56a1acc4
commit
2c8cfceba6
|
@ -347,16 +347,23 @@ export class DmpOverviewComponent extends BaseComponent implements OnInit {
|
||||||
});
|
});
|
||||||
dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe((result: DmpFinalizeDialogOutput) => {
|
dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe((result: DmpFinalizeDialogOutput) => {
|
||||||
if (result && !result.cancelled) {
|
if (result && !result.cancelled) {
|
||||||
this.dmp.status = DmpStatus.Finalized;
|
|
||||||
var datasetsToBeFinalized: DatasetsToBeFinalized = {
|
var datasetsToBeFinalized: DatasetsToBeFinalized = {
|
||||||
uuids: result.datasetsToBeFinalized
|
uuids: result.datasetsToBeFinalized
|
||||||
};
|
};
|
||||||
this.dmpService.finalize(datasetsToBeFinalized, this.dmp.id)
|
this.dmpService.finalize(datasetsToBeFinalized, this.dmp.id)
|
||||||
.pipe(takeUntil(this._destroyed))
|
.pipe(takeUntil(this._destroyed))
|
||||||
.subscribe(
|
.subscribe(
|
||||||
complete => this.onCallbackSuccess()
|
complete => {
|
||||||
|
this.dmp.status = DmpStatus.Finalized;
|
||||||
|
this.onCallbackSuccess()
|
||||||
|
},
|
||||||
|
error => this.onFinalizeCallbackError(error)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onFinalizeCallbackError(error) {
|
||||||
|
this.uiNotificationService.snackBarNotification(error.error.message ? error.error.message : this.language.instant('DMP-EDITOR.SNACK-BAR.UNSUCCESSFUL-FINALIZE'), SnackBarNotificationLevel.Error);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -509,7 +509,8 @@
|
||||||
},
|
},
|
||||||
"SNACK-BAR": {
|
"SNACK-BAR": {
|
||||||
"UNSUCCESSFUL-DOI": "Unsuccessful DOI creation",
|
"UNSUCCESSFUL-DOI": "Unsuccessful DOI creation",
|
||||||
"SUCCESSFUL-DOI": "Successful DOI creation"
|
"SUCCESSFUL-DOI": "Successful DOI creation",
|
||||||
|
"UNSUCCESSFUL-FINALIZE": "Unsuccessful DMP finalization"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"DMP-PROFILE-LISTING": {
|
"DMP-PROFILE-LISTING": {
|
||||||
|
|
Loading…
Reference in New Issue