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) {
|
public void setTenantCodeExists(ErrorDescription tenantCodeExists) {
|
||||||
this.tenantCodeExists = 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())
|
.groupIds(oldDmpEntity.getGroupId())
|
||||||
.isActive(IsActive.Active)
|
.isActive(IsActive.Active)
|
||||||
.count();
|
.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();
|
DmpEntity newDmp = new DmpEntity();
|
||||||
newDmp.setId(UUID.randomUUID());
|
newDmp.setId(UUID.randomUUID());
|
||||||
|
|
|
@ -80,3 +80,6 @@ error-thesaurus:
|
||||||
tenant-code-exists:
|
tenant-code-exists:
|
||||||
code: 130
|
code: 130
|
||||||
message: Tenant code exists
|
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,
|
TenantConfigurationTypeCanNotChange = 128,
|
||||||
MultipleTenantConfigurationTypeNotAllowed = 129,
|
MultipleTenantConfigurationTypeNotAllowed = 129,
|
||||||
TenantCodeExists = 130,
|
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-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.",
|
"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.",
|
"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": {
|
"FORM-VALIDATION-DISPLAY-DIALOG": {
|
||||||
"WARNING": "Warning!",
|
"WARNING": "Warning!",
|
||||||
|
|
|
@ -88,6 +88,9 @@ export class HttpErrorHandlingService {
|
||||||
else if(errorResponse.error.code === ResponseErrorCode.TenantCodeExists){
|
else if(errorResponse.error.code === ResponseErrorCode.TenantCodeExists){
|
||||||
this.uiNotificationService.snackBarNotification(this.language.instant("GENERAL.BACKEND-ERRORS.TENANT-CODE-EXISTS"), SnackBarNotificationLevel.Error);
|
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) {
|
else if (error.statusCode === 302 || error.statusCode === 400 || error.statusCode === 404) {
|
||||||
errorMessage ??= this.language.instant('GENERAL.SNACK-BAR.NOT-FOUND');
|
errorMessage ??= this.language.instant('GENERAL.SNACK-BAR.NOT-FOUND');
|
||||||
this.uiNotificationService.snackBarNotification(errorMessage, SnackBarNotificationLevel.Warning);
|
this.uiNotificationService.snackBarNotification(errorMessage, SnackBarNotificationLevel.Warning);
|
||||||
|
|
Loading…
Reference in New Issue