show generic backend error status 400 on save of dmp-description
This commit is contained in:
parent
f2a1ce4f0f
commit
2c98acb185
|
@ -667,6 +667,7 @@ export class DescriptionEditorComponent extends BaseEditor<DescriptionEditorMode
|
||||||
formSubmit(onSuccess?: (response) => void): void {
|
formSubmit(onSuccess?: (response) => void): void {
|
||||||
this.formService.removeAllBackEndErrors(this.formGroup);
|
this.formService.removeAllBackEndErrors(this.formGroup);
|
||||||
this.formService.touchAllFormFields(this.formGroup);
|
this.formService.touchAllFormFields(this.formGroup);
|
||||||
|
this.tocValidationService.validateForm();
|
||||||
if (this.formGroup.get('label').valid && this.formGroup.get('dmpId').valid && this.formGroup.get('dmpDescriptionTemplateId').valid
|
if (this.formGroup.get('label').valid && this.formGroup.get('dmpId').valid && this.formGroup.get('dmpDescriptionTemplateId').valid
|
||||||
&& this.formGroup.get('descriptionTemplateId').valid && this.formGroup.get('status').valid) {
|
&& this.formGroup.get('descriptionTemplateId').valid && this.formGroup.get('status').valid) {
|
||||||
this.persistEntity(onSuccess);
|
this.persistEntity(onSuccess);
|
||||||
|
|
|
@ -135,13 +135,16 @@ export abstract class BaseEditor<EditorModelType extends BaseEditorModel, Entity
|
||||||
if(errorResponse.error.code === ResponseErrorCode.HashConflict){
|
if(errorResponse.error.code === ResponseErrorCode.HashConflict){
|
||||||
this.uiNotificationService.snackBarNotification(errorResponse.error.error, SnackBarNotificationLevel.Error);
|
this.uiNotificationService.snackBarNotification(errorResponse.error.error, SnackBarNotificationLevel.Error);
|
||||||
}
|
}
|
||||||
if(errorResponse.error.code === ResponseErrorCode.DmpBlueprintHasNoDescriptionTemplates){
|
else if(errorResponse.error.code === ResponseErrorCode.DmpBlueprintHasNoDescriptionTemplates){
|
||||||
this.uiNotificationService.snackBarNotification(errorResponse.error.error, SnackBarNotificationLevel.Error);
|
this.uiNotificationService.snackBarNotification(errorResponse.error.error, SnackBarNotificationLevel.Error);
|
||||||
}
|
}
|
||||||
if(errorResponse.error.code === ResponseErrorCode.DmpDescriptionTemplateCanNotRemove){
|
else if(errorResponse.error.code === ResponseErrorCode.DmpDescriptionTemplateCanNotRemove){
|
||||||
this.uiNotificationService.snackBarNotification(errorResponse.error.error, SnackBarNotificationLevel.Error);
|
this.uiNotificationService.snackBarNotification(errorResponse.error.error, SnackBarNotificationLevel.Error);
|
||||||
this.refreshOnNavigateToData(null);
|
this.refreshOnNavigateToData(null);
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
this.uiNotificationService.snackBarNotification(error.getMessagesString(), SnackBarNotificationLevel.Warning);
|
||||||
|
}
|
||||||
this.formService.validateAllFormFields(this.formGroup);
|
this.formService.validateAllFormFields(this.formGroup);
|
||||||
} else {
|
} else {
|
||||||
this.uiNotificationService.snackBarNotification(error.getMessagesString(), SnackBarNotificationLevel.Warning);
|
this.uiNotificationService.snackBarNotification(error.getMessagesString(), SnackBarNotificationLevel.Warning);
|
||||||
|
|
Loading…
Reference in New Issue