diff --git a/backend/core/src/main/java/org/opencdmp/commons/types/plan/importexport/PlanDescriptionTemplateImportExport.java b/backend/core/src/main/java/org/opencdmp/commons/types/plan/importexport/PlanDescriptionTemplateImportExport.java index bb2b8af23..20e20ffc4 100644 --- a/backend/core/src/main/java/org/opencdmp/commons/types/plan/importexport/PlanDescriptionTemplateImportExport.java +++ b/backend/core/src/main/java/org/opencdmp/commons/types/plan/importexport/PlanDescriptionTemplateImportExport.java @@ -12,6 +12,9 @@ public class PlanDescriptionTemplateImportExport { @XmlElement(name = "descriptionTemplateGroupId") private UUID descriptionTemplateGroupId; + @XmlElement(name = "descriptionTemplateCode") + private String descriptionTemplateCode; + @XmlElement(name = "sectionId") private UUID sectionId; @@ -30,4 +33,12 @@ public class PlanDescriptionTemplateImportExport { public void setSectionId(UUID sectionId) { this.sectionId = sectionId; } + + public String getDescriptionTemplateCode() { + return descriptionTemplateCode; + } + + public void setDescriptionTemplateCode(String descriptionTemplateCode) { + this.descriptionTemplateCode = descriptionTemplateCode; + } } diff --git a/backend/core/src/main/java/org/opencdmp/service/descriptiontemplate/DescriptionTemplateServiceImpl.java b/backend/core/src/main/java/org/opencdmp/service/descriptiontemplate/DescriptionTemplateServiceImpl.java index bad3ca74b..9e9763805 100644 --- a/backend/core/src/main/java/org/opencdmp/service/descriptiontemplate/DescriptionTemplateServiceImpl.java +++ b/backend/core/src/main/java/org/opencdmp/service/descriptiontemplate/DescriptionTemplateServiceImpl.java @@ -842,7 +842,7 @@ public class DescriptionTemplateServiceImpl implements DescriptionTemplateServic } } - throw new MyValidationException(this.errors.getDescriptionTemplateTypeImportNotFound().getCode(), !this.conventionService.isNullOrEmpty(importXml.getCode()) ? importXml.getCode() : importXml.getName()); + throw new MyValidationException(this.errors.getDescriptionTemplateTypeImportNotFound().getCode(), importXml.getCode()); } @Override diff --git a/backend/core/src/main/java/org/opencdmp/service/fielddatahelper/ReferenceTypeFieldDataHelperService.java b/backend/core/src/main/java/org/opencdmp/service/fielddatahelper/ReferenceTypeFieldDataHelperService.java index dc1f6d93d..d3bd1f51e 100644 --- a/backend/core/src/main/java/org/opencdmp/service/fielddatahelper/ReferenceTypeFieldDataHelperService.java +++ b/backend/core/src/main/java/org/opencdmp/service/fielddatahelper/ReferenceTypeFieldDataHelperService.java @@ -122,7 +122,7 @@ public class ReferenceTypeFieldDataHelperService extends BaseFieldDataHelperServ ReferenceTypeEntity referenceTypeEntity = data.getReferenceTypeId() != null ? this.queryFactory.query(ReferenceTypeQuery.class).disableTracking().ids(data.getReferenceTypeId()).disableTracking().firstAs(new BaseFieldSet().ensure(ReferenceType._id)) : null; if (referenceTypeEntity == null){ if (!this.conventionService.isNullOrEmpty(data.getReferenceTypeCode())) referenceTypeEntity = this.queryFactory.query(ReferenceTypeQuery.class).disableTracking().codes(data.getReferenceTypeCode()).disableTracking().firstAs(new BaseFieldSet().ensure(ReferenceType._id)); - if (referenceTypeEntity == null) throw new MyValidationException(this.errors.getReferenceTypeImportNotFound().getCode(), !this.conventionService.isNullOrEmpty(data.getReferenceTypeCode()) ? data.getReferenceTypeCode() : data.getReferenceTypeName()); + if (referenceTypeEntity == null) throw new MyValidationException(this.errors.getReferenceTypeImportNotFound().getCode(), data.getReferenceTypeCode()); } persist.setMultipleSelect(data.getMultipleSelect()); persist.setReferenceTypeId(referenceTypeEntity.getId()); @@ -134,7 +134,7 @@ public class ReferenceTypeFieldDataHelperService extends BaseFieldDataHelperServ ReferenceTypeEntity referenceTypeEntity = data.getReferenceType() != null && data.getReferenceType().getId() != null ? this.queryFactory.query(ReferenceTypeQuery.class).disableTracking().ids(data.getReferenceType().getId()).disableTracking().firstAs(new BaseFieldSet().ensure(ReferenceType._id)) : null; if (referenceTypeEntity == null){ if (!this.conventionService.isNullOrEmpty(data.getReferenceType().getCode())) referenceTypeEntity = this.queryFactory.query(ReferenceTypeQuery.class).disableTracking().codes(data.getReferenceType().getCode()).disableTracking().firstAs(new BaseFieldSet().ensure(ReferenceType._id)); - if (referenceTypeEntity == null) throw new MyValidationException(this.errors.getReferenceTypeImportNotFound().getCode(), data.getReferenceType() != null ? data.getReferenceType().getCode() : this.errors.getReferenceTypeImportNotFound().getMessage()); + if (referenceTypeEntity == null) throw new MyValidationException(this.errors.getReferenceTypeImportNotFound().getCode(), data.getReferenceType().getCode()); } persist.setMultipleSelect(data.getMultipleSelect()); persist.setReferenceTypeId(referenceTypeEntity.getId()); diff --git a/backend/core/src/main/java/org/opencdmp/service/plan/PlanServiceImpl.java b/backend/core/src/main/java/org/opencdmp/service/plan/PlanServiceImpl.java index fe12d3ceb..bf4b484bc 100644 --- a/backend/core/src/main/java/org/opencdmp/service/plan/PlanServiceImpl.java +++ b/backend/core/src/main/java/org/opencdmp/service/plan/PlanServiceImpl.java @@ -1782,18 +1782,25 @@ public class PlanServiceImpl implements PlanService { List planDescriptionTemplateEntities = this.queryFactory.query(PlanDescriptionTemplateQuery.class).disableTracking().authorize(AuthorizationFlags.All).planIds(data.getId()).isActive(IsActive.Active).collect(); if (!this.conventionService.isListNullOrEmpty(planDescriptionTemplateEntities)) { List planDescriptionTemplateImportExports = new LinkedList<>(); + List templatesWithCode = this.queryFactory.query(DescriptionTemplateQuery.class).disableTracking().groupIds(planDescriptionTemplateEntities.stream().map(PlanDescriptionTemplateEntity::getDescriptionTemplateGroupId).distinct().collect(Collectors.toList())).disableTracking().collectAs(new BaseFieldSet().ensure(org.opencdmp.data.DescriptionTemplateEntity._code).ensure(org.opencdmp.data.DescriptionTemplateEntity._groupId)); + for (PlanDescriptionTemplateEntity descriptionTemplateEntity : planDescriptionTemplateEntities) { - planDescriptionTemplateImportExports.add(this.planDescriptionTemplateToExport(descriptionTemplateEntity)); + planDescriptionTemplateImportExports.add(this.planDescriptionTemplateToExport(descriptionTemplateEntity, templatesWithCode)); } return planDescriptionTemplateImportExports; } return null; } - private PlanDescriptionTemplateImportExport planDescriptionTemplateToExport(PlanDescriptionTemplateEntity entity) { + private PlanDescriptionTemplateImportExport planDescriptionTemplateToExport(PlanDescriptionTemplateEntity entity, List templatesWithCode) { PlanDescriptionTemplateImportExport xml = new PlanDescriptionTemplateImportExport(); if (entity == null) return xml; + if (!this.conventionService.isListNullOrEmpty(templatesWithCode)) { + org.opencdmp.data.DescriptionTemplateEntity code = templatesWithCode.stream().filter(x -> x.getGroupId().equals(entity.getDescriptionTemplateGroupId())).findFirst().orElse(null); + if (code != null) xml.setDescriptionTemplateCode(code.getCode()); + } + xml.setDescriptionTemplateGroupId(entity.getDescriptionTemplateGroupId()); xml.setSectionId(entity.getSectionId()); @@ -2068,7 +2075,18 @@ public class PlanServiceImpl implements PlanService { PlanDescriptionTemplatePersist persist = new PlanDescriptionTemplatePersist(); - persist.setDescriptionTemplateGroupId(importXml.getDescriptionTemplateGroupId()); + org.opencdmp.data.DescriptionTemplateEntity data = importXml.getDescriptionTemplateGroupId() != null ? this.queryFactory.query(DescriptionTemplateQuery.class).disableTracking().groupIds(importXml.getDescriptionTemplateGroupId()).disableTracking().firstAs(new BaseFieldSet().ensure(DescriptionTemplate._groupId)) : null; + if (data != null ) { + persist.setDescriptionTemplateGroupId(importXml.getDescriptionTemplateGroupId()); + } else { + if (!this.conventionService.isNullOrEmpty(importXml.getDescriptionTemplateCode())) { + data = this.queryFactory.query(DescriptionTemplateQuery.class).disableTracking().codes(importXml.getDescriptionTemplateCode()).disableTracking().firstAs(new BaseFieldSet().ensure(DescriptionTemplate._code).ensure(DescriptionTemplate._groupId)); + if (data != null) persist.setDescriptionTemplateGroupId(data.getGroupId()); + } + } + + if (data == null) throw new MyValidationException(this.errors.getDescriptionTemplateImportNotFound().getCode(), importXml.getDescriptionTemplateCode()); + persist.setSectionId(importXml.getSectionId()); return persist; diff --git a/backend/core/src/main/java/org/opencdmp/service/planblueprint/PlanBlueprintServiceImpl.java b/backend/core/src/main/java/org/opencdmp/service/planblueprint/PlanBlueprintServiceImpl.java index 1fdb4d7ff..f7ecea14e 100644 --- a/backend/core/src/main/java/org/opencdmp/service/planblueprint/PlanBlueprintServiceImpl.java +++ b/backend/core/src/main/java/org/opencdmp/service/planblueprint/PlanBlueprintServiceImpl.java @@ -60,6 +60,7 @@ import java.io.IOException; import java.nio.charset.StandardCharsets; import java.time.Instant; import java.util.*; +import java.util.stream.Collectors; @Service public class PlanBlueprintServiceImpl implements PlanBlueprintService { @@ -580,8 +581,10 @@ public class PlanBlueprintServiceImpl implements PlanBlueprintService { List planBlueprintDescriptionTemplates = new LinkedList<>(); if (!this.conventionService.isListNullOrEmpty(entity.getDescriptionTemplates())) { + List templatesWithCode = this.queryFactory.query(DescriptionTemplateQuery.class).disableTracking().groupIds(entity.getDescriptionTemplates().stream().map(DescriptionTemplateEntity::getDescriptionTemplateGroupId).distinct().collect(Collectors.toList())).disableTracking().collectAs(new BaseFieldSet().ensure(org.opencdmp.data.DescriptionTemplateEntity._code).ensure(org.opencdmp.data.DescriptionTemplateEntity._groupId)); + for (DescriptionTemplateEntity descriptionTemplate : entity.getDescriptionTemplates()) { - planBlueprintDescriptionTemplates.add(this.blueprintDescriptionTemplateXmlToExport(descriptionTemplate)); + planBlueprintDescriptionTemplates.add(this.blueprintDescriptionTemplateXmlToExport(descriptionTemplate, templatesWithCode)); } } xml.setDescriptionTemplates(planBlueprintDescriptionTemplates); @@ -596,11 +599,15 @@ public class PlanBlueprintServiceImpl implements PlanBlueprintService { return xml; } - private BlueprintDescriptionTemplateImportExport blueprintDescriptionTemplateXmlToExport(DescriptionTemplateEntity entity) { + private BlueprintDescriptionTemplateImportExport blueprintDescriptionTemplateXmlToExport(DescriptionTemplateEntity entity, List templatesWithCode) { BlueprintDescriptionTemplateImportExport xml = new BlueprintDescriptionTemplateImportExport(); - org.opencdmp.data.DescriptionTemplateEntity data = this.queryFactory.query(DescriptionTemplateQuery.class).disableTracking().groupIds(entity.getDescriptionTemplateGroupId()).disableTracking().firstAs(new BaseFieldSet().ensure(org.opencdmp.data.DescriptionTemplateEntity._code)); - if (data != null) xml.setDescriptionTemplateCode(data.getCode()); + if (entity == null) return xml; + + if (!this.conventionService.isListNullOrEmpty(templatesWithCode)) { + org.opencdmp.data.DescriptionTemplateEntity code = templatesWithCode.stream().filter(x -> x.getGroupId().equals(entity.getDescriptionTemplateGroupId())).findFirst().orElse(null); + if (code != null) xml.setDescriptionTemplateCode(code.getCode()); + } xml.setDescriptionTemplateGroupId(entity.getDescriptionTemplateGroupId()); xml.setLabel(entity.getLabel()); if (entity.getMinMultiplicity() != null ) xml.setMinMultiplicity(entity.getMinMultiplicity()); @@ -812,7 +819,7 @@ public class PlanBlueprintServiceImpl implements PlanBlueprintService { } } - if (data == null) throw new MyValidationException(this.errors.getDescriptionTemplateImportNotFound().getCode(), !this.conventionService.isNullOrEmpty(importXml.getDescriptionTemplateCode()) ? importXml.getDescriptionTemplateCode() : importXml.getDescriptionTemplateGroupId().toString()); + if (data == null) throw new MyValidationException(this.errors.getDescriptionTemplateImportNotFound().getCode(), importXml.getDescriptionTemplateCode()); persist.setLabel(importXml.getLabel()); persist.setMinMultiplicity(importXml.getMinMultiplicity()); diff --git a/frontend/src/assets/i18n/baq.json b/frontend/src/assets/i18n/baq.json index a79cbda19..5125ef348 100644 --- a/frontend/src/assets/i18n/baq.json +++ b/frontend/src/assets/i18n/baq.json @@ -83,11 +83,12 @@ "USAGE-LIMIT-EXCEPTION": "Υou have exceeded the {{usageLimitLabel}} usage limit. Please contact your administrator.", "USAGE-LIMIT-METRIC-ALLREADY-EXISTS": "This usage limit metric is already defined in this tenant. Change metric or select other tenant.", "DESCRIPTION-TEMPLATE-TYPE-CODE-EXISTS": "The description template type code you provided already exists. Please choose a different code.", - "DESCRIPTION-TEMPLATE-TYPE-IMPORT-NOT-FOUND": "Description template type {{descriptionTemplateTypeLabel}} not found.", - "REFERENCE-TYPE-IMPORT-NOT-FOUND": "Reference type {{referenceTypeCode}} not found.", - "DESCRIPTION-TEMPLATE-IMPORT-NOT-FOUND": "Description template {{descriptionTemplateLabel}} not found.", + "DESCRIPTION-TEMPLATE-TYPE-IMPORT-NOT-FOUND": "Description template type with code '{{descriptionTemplateTypeLabel}}' not found.", + "REFERENCE-TYPE-IMPORT-NOT-FOUND": "Reference type with code '{{referenceTypeCode}}' not found.", + "DESCRIPTION-TEMPLATE-CODE-EXISTS": "The description template code you provided already exists. Please choose a different code.", + "DESCRIPTION-TEMPLATE-IMPORT-NOT-FOUND": "Description template with code '{{descriptionTemplateLabel}}' not found.", "PLAN-BLUEPRINT-CODE-EXISTS": "The plan blueprint code you provided already exists. Please choose a different code.", - "PLAN-BLUEPRINT-IMPORT-NOT-FOUND": "Plan blueprint {{planBlueprintLabel}} not found." + "PLAN-BLUEPRINT-IMPORT-NOT-FOUND": "Plan blueprint with code '{{planBlueprintLabel}}' not found." }, "FORM-VALIDATION-DISPLAY-DIALOG": { "WARNING": "Kontuz!", diff --git a/frontend/src/assets/i18n/de.json b/frontend/src/assets/i18n/de.json index ae7f24183..0dfe9f1b9 100644 --- a/frontend/src/assets/i18n/de.json +++ b/frontend/src/assets/i18n/de.json @@ -83,11 +83,12 @@ "USAGE-LIMIT-EXCEPTION": "Υou have exceeded the {{usageLimitLabel}} usage limit. Please contact your administrator.", "USAGE-LIMIT-METRIC-ALLREADY-EXISTS": "This usage limit metric is already defined in this tenant. Change metric or select other tenant.", "DESCRIPTION-TEMPLATE-TYPE-CODE-EXISTS": "The description template type code you provided already exists. Please choose a different code.", - "DESCRIPTION-TEMPLATE-TYPE-IMPORT-NOT-FOUND": "Description template type {{descriptionTemplateTypeLabel}} not found.", - "REFERENCE-TYPE-IMPORT-NOT-FOUND": "Reference type {{referenceTypeCode}} not found.", - "DESCRIPTION-TEMPLATE-IMPORT-NOT-FOUND": "Description template {{descriptionTemplateLabel}} not found.", + "DESCRIPTION-TEMPLATE-TYPE-IMPORT-NOT-FOUND": "Description template type with code '{{descriptionTemplateTypeLabel}}' not found.", + "REFERENCE-TYPE-IMPORT-NOT-FOUND": "Reference type with code '{{referenceTypeCode}}' not found.", + "DESCRIPTION-TEMPLATE-CODE-EXISTS": "The description template code you provided already exists. Please choose a different code.", + "DESCRIPTION-TEMPLATE-IMPORT-NOT-FOUND": "Description template with code '{{descriptionTemplateLabel}}' not found.", "PLAN-BLUEPRINT-CODE-EXISTS": "The plan blueprint code you provided already exists. Please choose a different code.", - "PLAN-BLUEPRINT-IMPORT-NOT-FOUND": "Plan blueprint {{planBlueprintLabel}} not found." + "PLAN-BLUEPRINT-IMPORT-NOT-FOUND": "Plan blueprint with code '{{planBlueprintLabel}}' not found." }, "FORM-VALIDATION-DISPLAY-DIALOG": { "WARNING": "Warnung!", diff --git a/frontend/src/assets/i18n/en.json b/frontend/src/assets/i18n/en.json index 566586f1b..e62b4e98b 100644 --- a/frontend/src/assets/i18n/en.json +++ b/frontend/src/assets/i18n/en.json @@ -83,12 +83,12 @@ "USAGE-LIMIT-EXCEPTION": "Υou have exceeded the {{usageLimitLabel}} usage limit. Please contact your administrator.", "USAGE-LIMIT-METRIC-ALLREADY-EXISTS": "This usage limit metric is already defined in this tenant. Change metric or select other tenant.", "DESCRIPTION-TEMPLATE-TYPE-CODE-EXISTS": "The description template type code you provided already exists. Please choose a different code.", - "DESCRIPTION-TEMPLATE-TYPE-IMPORT-NOT-FOUND": "Description template type {{descriptionTemplateTypeLabel}} not found.", - "REFERENCE-TYPE-IMPORT-NOT-FOUND": "Reference type {{referenceTypeCode}} not found.", + "DESCRIPTION-TEMPLATE-TYPE-IMPORT-NOT-FOUND": "Description template type with code '{{descriptionTemplateTypeLabel}}' not found.", + "REFERENCE-TYPE-IMPORT-NOT-FOUND": "Reference type with code '{{referenceTypeCode}}' not found.", "DESCRIPTION-TEMPLATE-CODE-EXISTS": "The description template code you provided already exists. Please choose a different code.", - "DESCRIPTION-TEMPLATE-IMPORT-NOT-FOUND": "Description template {{descriptionTemplateLabel}} not found.", + "DESCRIPTION-TEMPLATE-IMPORT-NOT-FOUND": "Description template with code '{{descriptionTemplateLabel}}' not found.", "PLAN-BLUEPRINT-CODE-EXISTS": "The plan blueprint code you provided already exists. Please choose a different code.", - "PLAN-BLUEPRINT-IMPORT-NOT-FOUND": "Plan blueprint {{planBlueprintLabel}} not found." + "PLAN-BLUEPRINT-IMPORT-NOT-FOUND": "Plan blueprint with code '{{planBlueprintLabel}}' not found." }, "FORM-VALIDATION-DISPLAY-DIALOG": { "WARNING": "Warning!", diff --git a/frontend/src/assets/i18n/es.json b/frontend/src/assets/i18n/es.json index 844d73981..5d8d06064 100644 --- a/frontend/src/assets/i18n/es.json +++ b/frontend/src/assets/i18n/es.json @@ -83,11 +83,12 @@ "USAGE-LIMIT-EXCEPTION": "Υou have exceeded the {{usageLimitLabel}} usage limit. Please contact your administrator.", "USAGE-LIMIT-METRIC-ALLREADY-EXISTS": "This usage limit metric is already defined in this tenant. Change metric or select other tenant.", "DESCRIPTION-TEMPLATE-TYPE-CODE-EXISTS": "The description template type code you provided already exists. Please choose a different code.", - "DESCRIPTION-TEMPLATE-TYPE-IMPORT-NOT-FOUND": "Description template type {{descriptionTemplateTypeLabel}} not found.", - "REFERENCE-TYPE-IMPORT-NOT-FOUND": "Reference type {{referenceTypeCode}} not found.", - "DESCRIPTION-TEMPLATE-IMPORT-NOT-FOUND": "Description template {{descriptionTemplateLabel}} not found.", + "DESCRIPTION-TEMPLATE-TYPE-IMPORT-NOT-FOUND": "Description template type with code '{{descriptionTemplateTypeLabel}}' not found.", + "REFERENCE-TYPE-IMPORT-NOT-FOUND": "Reference type with code '{{referenceTypeCode}}' not found.", + "DESCRIPTION-TEMPLATE-CODE-EXISTS": "The description template code you provided already exists. Please choose a different code.", + "DESCRIPTION-TEMPLATE-IMPORT-NOT-FOUND": "Description template with code '{{descriptionTemplateLabel}}' not found.", "PLAN-BLUEPRINT-CODE-EXISTS": "The plan blueprint code you provided already exists. Please choose a different code.", - "PLAN-BLUEPRINT-IMPORT-NOT-FOUND": "Plan blueprint {{planBlueprintLabel}} not found." + "PLAN-BLUEPRINT-IMPORT-NOT-FOUND": "Plan blueprint with code '{{planBlueprintLabel}}' not found." }, "FORM-VALIDATION-DISPLAY-DIALOG": { "WARNING": "Atención!", diff --git a/frontend/src/assets/i18n/gr.json b/frontend/src/assets/i18n/gr.json index af7523e39..071f5bae8 100644 --- a/frontend/src/assets/i18n/gr.json +++ b/frontend/src/assets/i18n/gr.json @@ -83,11 +83,12 @@ "USAGE-LIMIT-EXCEPTION": "Υou have exceeded the {{usageLimitLabel}} usage limit. Please contact your administrator.", "USAGE-LIMIT-METRIC-ALLREADY-EXISTS": "This usage limit metric is already defined in this tenant. Change metric or select other tenant.", "DESCRIPTION-TEMPLATE-TYPE-CODE-EXISTS": "The description template type code you provided already exists. Please choose a different code.", - "DESCRIPTION-TEMPLATE-TYPE-IMPORT-NOT-FOUND": "Description template type {{descriptionTemplateTypeLabel}} not found.", - "REFERENCE-TYPE-IMPORT-NOT-FOUND": "Reference type {{referenceTypeCode}} not found.", - "DESCRIPTION-TEMPLATE-IMPORT-NOT-FOUND": "Description template {{descriptionTemplateLabel}} not found.", + "DESCRIPTION-TEMPLATE-TYPE-IMPORT-NOT-FOUND": "Description template type with code '{{descriptionTemplateTypeLabel}}' not found.", + "REFERENCE-TYPE-IMPORT-NOT-FOUND": "Reference type with code '{{referenceTypeCode}}' not found.", + "DESCRIPTION-TEMPLATE-CODE-EXISTS": "The description template code you provided already exists. Please choose a different code.", + "DESCRIPTION-TEMPLATE-IMPORT-NOT-FOUND": "Description template with code '{{descriptionTemplateLabel}}' not found.", "PLAN-BLUEPRINT-CODE-EXISTS": "The plan blueprint code you provided already exists. Please choose a different code.", - "PLAN-BLUEPRINT-IMPORT-NOT-FOUND": "Plan blueprint {{planBlueprintLabel}} not found." + "PLAN-BLUEPRINT-IMPORT-NOT-FOUND": "Plan blueprint with code '{{planBlueprintLabel}}' not found." }, "FORM-VALIDATION-DISPLAY-DIALOG": { "WARNING": "Προσοχή!", diff --git a/frontend/src/assets/i18n/hr.json b/frontend/src/assets/i18n/hr.json index 7f32a498b..cfa66ad37 100644 --- a/frontend/src/assets/i18n/hr.json +++ b/frontend/src/assets/i18n/hr.json @@ -83,11 +83,12 @@ "USAGE-LIMIT-EXCEPTION": "Υou have exceeded the {{usageLimitLabel}} usage limit. Please contact your administrator.", "USAGE-LIMIT-METRIC-ALLREADY-EXISTS": "This usage limit metric is already defined in this tenant. Change metric or select other tenant.", "DESCRIPTION-TEMPLATE-TYPE-CODE-EXISTS": "The description template type code you provided already exists. Please choose a different code.", - "DESCRIPTION-TEMPLATE-TYPE-IMPORT-NOT-FOUND": "Description template type {{descriptionTemplateTypeLabel}} not found.", - "REFERENCE-TYPE-IMPORT-NOT-FOUND": "Reference type {{referenceTypeCode}} not found.", - "DESCRIPTION-TEMPLATE-IMPORT-NOT-FOUND": "Description template {{descriptionTemplateLabel}} not found.", + "DESCRIPTION-TEMPLATE-TYPE-IMPORT-NOT-FOUND": "Description template type with code '{{descriptionTemplateTypeLabel}}' not found.", + "REFERENCE-TYPE-IMPORT-NOT-FOUND": "Reference type with code '{{referenceTypeCode}}' not found.", + "DESCRIPTION-TEMPLATE-CODE-EXISTS": "The description template code you provided already exists. Please choose a different code.", + "DESCRIPTION-TEMPLATE-IMPORT-NOT-FOUND": "Description template with code '{{descriptionTemplateLabel}}' not found.", "PLAN-BLUEPRINT-CODE-EXISTS": "The plan blueprint code you provided already exists. Please choose a different code.", - "PLAN-BLUEPRINT-IMPORT-NOT-FOUND": "Plan blueprint {{planBlueprintLabel}} not found." + "PLAN-BLUEPRINT-IMPORT-NOT-FOUND": "Plan blueprint with code '{{planBlueprintLabel}}' not found." }, "FORM-VALIDATION-DISPLAY-DIALOG": { "WARNING": "Oprez!", diff --git a/frontend/src/assets/i18n/pl.json b/frontend/src/assets/i18n/pl.json index 3fbd27b3e..080e1f2e3 100644 --- a/frontend/src/assets/i18n/pl.json +++ b/frontend/src/assets/i18n/pl.json @@ -83,11 +83,12 @@ "USAGE-LIMIT-EXCEPTION": "Υou have exceeded the {{usageLimitLabel}} usage limit. Please contact your administrator.", "USAGE-LIMIT-METRIC-ALLREADY-EXISTS": "This usage limit metric is already defined in this tenant. Change metric or select other tenant.", "DESCRIPTION-TEMPLATE-TYPE-CODE-EXISTS": "The description template type code you provided already exists. Please choose a different code.", - "DESCRIPTION-TEMPLATE-TYPE-IMPORT-NOT-FOUND": "Description template type {{descriptionTemplateTypeLabel}} not found.", - "REFERENCE-TYPE-IMPORT-NOT-FOUND": "Reference type {{referenceTypeCode}} not found.", - "DESCRIPTION-TEMPLATE-IMPORT-NOT-FOUND": "Description template {{descriptionTemplateLabel}} not found.", + "DESCRIPTION-TEMPLATE-TYPE-IMPORT-NOT-FOUND": "Description template type with code '{{descriptionTemplateTypeLabel}}' not found.", + "REFERENCE-TYPE-IMPORT-NOT-FOUND": "Reference type with code '{{referenceTypeCode}}' not found.", + "DESCRIPTION-TEMPLATE-CODE-EXISTS": "The description template code you provided already exists. Please choose a different code.", + "DESCRIPTION-TEMPLATE-IMPORT-NOT-FOUND": "Description template with code '{{descriptionTemplateLabel}}' not found.", "PLAN-BLUEPRINT-CODE-EXISTS": "The plan blueprint code you provided already exists. Please choose a different code.", - "PLAN-BLUEPRINT-IMPORT-NOT-FOUND": "Plan blueprint {{planBlueprintLabel}} not found." + "PLAN-BLUEPRINT-IMPORT-NOT-FOUND": "Plan blueprint with code '{{planBlueprintLabel}}' not found." }, "FORM-VALIDATION-DISPLAY-DIALOG": { "WARNING": "Ostrzeżenie!", diff --git a/frontend/src/assets/i18n/pt.json b/frontend/src/assets/i18n/pt.json index 653eb3e9d..aba90a19f 100644 --- a/frontend/src/assets/i18n/pt.json +++ b/frontend/src/assets/i18n/pt.json @@ -83,11 +83,12 @@ "USAGE-LIMIT-EXCEPTION": "Υou have exceeded the {{usageLimitLabel}} usage limit. Please contact your administrator.", "USAGE-LIMIT-METRIC-ALLREADY-EXISTS": "This usage limit metric is already defined in this tenant. Change metric or select other tenant.", "DESCRIPTION-TEMPLATE-TYPE-CODE-EXISTS": "The description template type code you provided already exists. Please choose a different code.", - "DESCRIPTION-TEMPLATE-TYPE-IMPORT-NOT-FOUND": "Description template type {{descriptionTemplateTypeLabel}} not found.", - "REFERENCE-TYPE-IMPORT-NOT-FOUND": "Reference type {{referenceTypeCode}} not found.", - "DESCRIPTION-TEMPLATE-IMPORT-NOT-FOUND": "Description template {{descriptionTemplateLabel}} not found.", + "DESCRIPTION-TEMPLATE-TYPE-IMPORT-NOT-FOUND": "Description template type with code '{{descriptionTemplateTypeLabel}}' not found.", + "REFERENCE-TYPE-IMPORT-NOT-FOUND": "Reference type with code '{{referenceTypeCode}}' not found.", + "DESCRIPTION-TEMPLATE-CODE-EXISTS": "The description template code you provided already exists. Please choose a different code.", + "DESCRIPTION-TEMPLATE-IMPORT-NOT-FOUND": "Description template with code '{{descriptionTemplateLabel}}' not found.", "PLAN-BLUEPRINT-CODE-EXISTS": "The plan blueprint code you provided already exists. Please choose a different code.", - "PLAN-BLUEPRINT-IMPORT-NOT-FOUND": "Plan blueprint {{planBlueprintLabel}} not found." + "PLAN-BLUEPRINT-IMPORT-NOT-FOUND": "Plan blueprint with code '{{planBlueprintLabel}}' not found." }, "FORM-VALIDATION-DISPLAY-DIALOG": { "WARNING": "Atenção!", diff --git a/frontend/src/assets/i18n/sk.json b/frontend/src/assets/i18n/sk.json index 7a2eb123a..8f38b6691 100644 --- a/frontend/src/assets/i18n/sk.json +++ b/frontend/src/assets/i18n/sk.json @@ -83,11 +83,12 @@ "USAGE-LIMIT-EXCEPTION": "Υou have exceeded the {{usageLimitLabel}} usage limit. Please contact your administrator.", "USAGE-LIMIT-METRIC-ALLREADY-EXISTS": "This usage limit metric is already defined in this tenant. Change metric or select other tenant.", "DESCRIPTION-TEMPLATE-TYPE-CODE-EXISTS": "The description template type code you provided already exists. Please choose a different code.", - "DESCRIPTION-TEMPLATE-TYPE-IMPORT-NOT-FOUND": "Description template type {{descriptionTemplateTypeLabel}} not found.", - "REFERENCE-TYPE-IMPORT-NOT-FOUND": "Reference type {{referenceTypeCode}} not found.", - "DESCRIPTION-TEMPLATE-IMPORT-NOT-FOUND": "Description template {{descriptionTemplateLabel}} not found.", + "DESCRIPTION-TEMPLATE-TYPE-IMPORT-NOT-FOUND": "Description template type with code '{{descriptionTemplateTypeLabel}}' not found.", + "REFERENCE-TYPE-IMPORT-NOT-FOUND": "Reference type with code '{{referenceTypeCode}}' not found.", + "DESCRIPTION-TEMPLATE-CODE-EXISTS": "The description template code you provided already exists. Please choose a different code.", + "DESCRIPTION-TEMPLATE-IMPORT-NOT-FOUND": "Description template with code '{{descriptionTemplateLabel}}' not found.", "PLAN-BLUEPRINT-CODE-EXISTS": "The plan blueprint code you provided already exists. Please choose a different code.", - "PLAN-BLUEPRINT-IMPORT-NOT-FOUND": "Plan blueprint {{planBlueprintLabel}} not found." + "PLAN-BLUEPRINT-IMPORT-NOT-FOUND": "Plan blueprint with code '{{planBlueprintLabel}}' not found." }, "FORM-VALIDATION-DISPLAY-DIALOG": { "WARNING": "Upozornenie!", diff --git a/frontend/src/assets/i18n/sr.json b/frontend/src/assets/i18n/sr.json index 3bf9b3a26..4f65eb5a9 100644 --- a/frontend/src/assets/i18n/sr.json +++ b/frontend/src/assets/i18n/sr.json @@ -83,11 +83,12 @@ "USAGE-LIMIT-EXCEPTION": "Υou have exceeded the {{usageLimitLabel}} usage limit. Please contact your administrator.", "USAGE-LIMIT-METRIC-ALLREADY-EXISTS": "This usage limit metric is already defined in this tenant. Change metric or select other tenant.", "DESCRIPTION-TEMPLATE-TYPE-CODE-EXISTS": "The description template type code you provided already exists. Please choose a different code.", - "DESCRIPTION-TEMPLATE-TYPE-IMPORT-NOT-FOUND": "Description template type {{descriptionTemplateTypeLabel}} not found.", - "REFERENCE-TYPE-IMPORT-NOT-FOUND": "Reference type {{referenceTypeCode}} not found.", - "DESCRIPTION-TEMPLATE-IMPORT-NOT-FOUND": "Description template {{descriptionTemplateLabel}} not found.", + "DESCRIPTION-TEMPLATE-TYPE-IMPORT-NOT-FOUND": "Description template type with code '{{descriptionTemplateTypeLabel}}' not found.", + "REFERENCE-TYPE-IMPORT-NOT-FOUND": "Reference type with code '{{referenceTypeCode}}' not found.", + "DESCRIPTION-TEMPLATE-CODE-EXISTS": "The description template code you provided already exists. Please choose a different code.", + "DESCRIPTION-TEMPLATE-IMPORT-NOT-FOUND": "Description template with code '{{descriptionTemplateLabel}}' not found.", "PLAN-BLUEPRINT-CODE-EXISTS": "The plan blueprint code you provided already exists. Please choose a different code.", - "PLAN-BLUEPRINT-IMPORT-NOT-FOUND": "Plan blueprint {{planBlueprintLabel}} not found." + "PLAN-BLUEPRINT-IMPORT-NOT-FOUND": "Plan blueprint with code '{{planBlueprintLabel}}' not found." }, "FORM-VALIDATION-DISPLAY-DIALOG": { "WARNING": "Oprez!", diff --git a/frontend/src/assets/i18n/tr.json b/frontend/src/assets/i18n/tr.json index f78882d78..d6a5de63a 100644 --- a/frontend/src/assets/i18n/tr.json +++ b/frontend/src/assets/i18n/tr.json @@ -83,11 +83,12 @@ "USAGE-LIMIT-EXCEPTION": "Υou have exceeded the {{usageLimitLabel}} usage limit. Please contact your administrator.", "USAGE-LIMIT-METRIC-ALLREADY-EXISTS": "This usage limit metric is already defined in this tenant. Change metric or select other tenant.", "DESCRIPTION-TEMPLATE-TYPE-CODE-EXISTS": "The description template type code you provided already exists. Please choose a different code.", - "DESCRIPTION-TEMPLATE-TYPE-IMPORT-NOT-FOUND": "Description template type {{descriptionTemplateTypeLabel}} not found.", - "REFERENCE-TYPE-IMPORT-NOT-FOUND": "Reference type {{referenceTypeCode}} not found.", - "DESCRIPTION-TEMPLATE-IMPORT-NOT-FOUND": "Description template {{descriptionTemplateLabel}} not found.", + "DESCRIPTION-TEMPLATE-TYPE-IMPORT-NOT-FOUND": "Description template type with code '{{descriptionTemplateTypeLabel}}' not found.", + "REFERENCE-TYPE-IMPORT-NOT-FOUND": "Reference type with code '{{referenceTypeCode}}' not found.", + "DESCRIPTION-TEMPLATE-CODE-EXISTS": "The description template code you provided already exists. Please choose a different code.", + "DESCRIPTION-TEMPLATE-IMPORT-NOT-FOUND": "Description template with code '{{descriptionTemplateLabel}}' not found.", "PLAN-BLUEPRINT-CODE-EXISTS": "The plan blueprint code you provided already exists. Please choose a different code.", - "PLAN-BLUEPRINT-IMPORT-NOT-FOUND": "Plan blueprint {{planBlueprintLabel}} not found." + "PLAN-BLUEPRINT-IMPORT-NOT-FOUND": "Plan blueprint with code '{{planBlueprintLabel}}' not found." }, "FORM-VALIDATION-DISPLAY-DIALOG": { "WARNING": "Uyarı!", diff --git a/frontend/src/common/modules/errors/error-handling/http-error-handling.service.ts b/frontend/src/common/modules/errors/error-handling/http-error-handling.service.ts index 77d84dfb5..5aa106ac8 100644 --- a/frontend/src/common/modules/errors/error-handling/http-error-handling.service.ts +++ b/frontend/src/common/modules/errors/error-handling/http-error-handling.service.ts @@ -19,13 +19,13 @@ export class HttpErrorHandlingService { if(errorResponse.error && ResponseErrorCodeHelper.isBackendError(errorResponse.error?.code)){ if (errorResponse.error.code === ResponseErrorCode.UsageLimitException && errorResponse.error.error){ this.uiNotificationService.snackBarNotification(this.language.instant('GENERAL.BACKEND-ERRORS.USAGE-LIMIT-EXCEPTION', { 'usageLimitLabel': errorResponse.error.error }), SnackBarNotificationLevel.Error); - } if (errorResponse.error.code === ResponseErrorCode.descriptionTemplateTypeImportNotFound){ + } else if (errorResponse.error.code === ResponseErrorCode.descriptionTemplateTypeImportNotFound){ this.uiNotificationService.snackBarNotification(this.language.instant('GENERAL.BACKEND-ERRORS.DESCRIPTION-TEMPLATE-TYPE-IMPORT-NOT-FOUND', { 'descriptionTemplateTypeLabel': errorResponse.error.error }), SnackBarNotificationLevel.Error); - } if (errorResponse.error.code === ResponseErrorCode.referenceTypeImportNotFound){ + } else if (errorResponse.error.code === ResponseErrorCode.referenceTypeImportNotFound){ this.uiNotificationService.snackBarNotification(this.language.instant('GENERAL.BACKEND-ERRORS.REFERENCE-TYPE-IMPORT-NOT-FOUND', { 'referenceTypeCode': errorResponse.error.error }), SnackBarNotificationLevel.Error); - } if (errorResponse.error.code === ResponseErrorCode.descriptionTemplateImportNotFound){ + } else if (errorResponse.error.code === ResponseErrorCode.descriptionTemplateImportNotFound){ this.uiNotificationService.snackBarNotification(this.language.instant('GENERAL.BACKEND-ERRORS.DESCRIPTION-TEMPLATE-IMPORT-NOT-FOUND', { 'descriptionTemplateLabel': errorResponse.error.error }), SnackBarNotificationLevel.Error); - } if (errorResponse.error.code === ResponseErrorCode.planBlueprintImportNotFound){ + } else if (errorResponse.error.code === ResponseErrorCode.planBlueprintImportNotFound){ this.uiNotificationService.snackBarNotification(this.language.instant('GENERAL.BACKEND-ERRORS.PLAN-BLUEPRINT-IMPORT-NOT-FOUND', { 'planBlueprintLabel': errorResponse.error.error }), SnackBarNotificationLevel.Error); } else { this.uiNotificationService.snackBarNotification(ResponseErrorCodeHelper.getErrorMessageByBackendStatusCode(errorResponse.error.code, this.language), SnackBarNotificationLevel.Error);