fix dmp new version already draft error
This commit is contained in:
parent
39abb725bc
commit
878869ce61
|
@ -244,4 +244,15 @@ public class ErrorThesaurusProperties {
|
|||
public void setTenantCodeExists(ErrorDescription tenantCodeExists) {
|
||||
this.tenantCodeExists = tenantCodeExists;
|
||||
}
|
||||
|
||||
|
||||
private ErrorDescription dmpNewVersionAlreadyCreatedDraft;
|
||||
|
||||
public ErrorDescription getDmpNewVersionAlreadyCreatedDraft() {
|
||||
return dmpNewVersionAlreadyCreatedDraft;
|
||||
}
|
||||
|
||||
public void setDmpNewVersionAlreadyCreatedDraft(ErrorDescription dmpNewVersionAlreadyCreatedDraft) {
|
||||
this.dmpNewVersionAlreadyCreatedDraft = dmpNewVersionAlreadyCreatedDraft;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -408,7 +408,7 @@ public class DmpServiceImpl implements DmpService {
|
|||
.groupIds(oldDmpEntity.getGroupId())
|
||||
.isActive(IsActive.Active)
|
||||
.count();
|
||||
if (notFinalizedCount > 0) throw new MyValidationException(this.errors.getModelValidation().getCode(), "Already created draft for this template");
|
||||
if (notFinalizedCount > 0) throw new MyValidationException(this.errors.getDmpNewVersionAlreadyCreatedDraft().getCode(), this.errors.getDmpNewVersionAlreadyCreatedDraft().getMessage());
|
||||
|
||||
DmpEntity newDmp = new DmpEntity();
|
||||
newDmp.setId(UUID.randomUUID());
|
||||
|
|
|
@ -80,3 +80,6 @@ error-thesaurus:
|
|||
tenant-code-exists:
|
||||
code: 130
|
||||
message: Tenant code exists
|
||||
dmp-new-version-already-created-draft:
|
||||
code: 131
|
||||
message: Already created draft for this dmp
|
|
@ -25,4 +25,5 @@ export enum ResponseErrorCode {
|
|||
TenantConfigurationTypeCanNotChange = 128,
|
||||
MultipleTenantConfigurationTypeNotAllowed = 129,
|
||||
TenantCodeExists = 130,
|
||||
DmpNewVersionAlreadyCreatedDraft = 131
|
||||
}
|
||||
|
|
|
@ -54,7 +54,8 @@
|
|||
"TENANT-TAMPERING": "This operation affects data from a Tenant different than your selected. Please reselect your Tenant.",
|
||||
"TENANT-CONFIGURATION-TYPE-CAN-NOT-CHANGE": "The configuration type for this Tenant cannot be changed.",
|
||||
"MULTIPLE-TENANT-CONFIGURATION-TYPE-NOT-ALLOWED": "Tenant Configuration already exists for this Tenant.",
|
||||
"TENANT-CODE-EXISTS": "The Tenant code you provided already exists. Please choose a different code."
|
||||
"TENANT-CODE-EXISTS": "The Tenant code you provided already exists. Please choose a different code.",
|
||||
"DMP-NEW-VERSION-ALREADY-CREATED-DRAFT": "You have already created a new draft version for this plan."
|
||||
},
|
||||
"FORM-VALIDATION-DISPLAY-DIALOG": {
|
||||
"WARNING": "Warning!",
|
||||
|
|
|
@ -88,6 +88,9 @@ export class HttpErrorHandlingService {
|
|||
else if(errorResponse.error.code === ResponseErrorCode.TenantCodeExists){
|
||||
this.uiNotificationService.snackBarNotification(this.language.instant("GENERAL.BACKEND-ERRORS.TENANT-CODE-EXISTS"), SnackBarNotificationLevel.Error);
|
||||
}
|
||||
else if(errorResponse.error.code === ResponseErrorCode.DmpNewVersionAlreadyCreatedDraft){
|
||||
this.uiNotificationService.snackBarNotification(this.language.instant("GENERAL.BACKEND-ERRORS.DMP-NEW-VERSION-ALREADY-CREATED-DRAFT"), SnackBarNotificationLevel.Error);
|
||||
}
|
||||
else if (error.statusCode === 302 || error.statusCode === 400 || error.statusCode === 404) {
|
||||
errorMessage ??= this.language.instant('GENERAL.SNACK-BAR.NOT-FOUND');
|
||||
this.uiNotificationService.snackBarNotification(errorMessage, SnackBarNotificationLevel.Warning);
|
||||
|
|
Loading…
Reference in New Issue