diff --git a/backend/core/src/main/java/org/opencdmp/errorcode/ErrorThesaurusProperties.java b/backend/core/src/main/java/org/opencdmp/errorcode/ErrorThesaurusProperties.java index 280bad596..070710b6a 100644 --- a/backend/core/src/main/java/org/opencdmp/errorcode/ErrorThesaurusProperties.java +++ b/backend/core/src/main/java/org/opencdmp/errorcode/ErrorThesaurusProperties.java @@ -378,4 +378,14 @@ public class ErrorThesaurusProperties { public void setRequestHasExpired(ErrorDescription requestHasExpired) { this.requestHasExpired = requestHasExpired; } + + private ErrorDescription maxDescriptionsExceeded; + + public ErrorDescription getMaxDescriptionsExceeded() { + return maxDescriptionsExceeded; + } + + public void setMaxDescriptionsExceeded(ErrorDescription maxDescriptionsExceeded) { + this.maxDescriptionsExceeded = maxDescriptionsExceeded; + } } diff --git a/backend/core/src/main/java/org/opencdmp/model/persist/DescriptionPersist.java b/backend/core/src/main/java/org/opencdmp/model/persist/DescriptionPersist.java index 8d83fb872..3899436d2 100644 --- a/backend/core/src/main/java/org/opencdmp/model/persist/DescriptionPersist.java +++ b/backend/core/src/main/java/org/opencdmp/model/persist/DescriptionPersist.java @@ -222,6 +222,7 @@ public class DescriptionPersist { .must(() -> !this.isNull(item.getProperties())) .failOn(DescriptionPersist._properties).failWith(this.messageSource.getMessage("Validation_Required", new Object[]{DescriptionPersist._properties}, LocaleContextHolder.getLocale())), this.spec() + .iff(() -> item.getStatus() == DescriptionStatus.Finalized) .must(() -> this.isDescriptionTemplateMaxMultiplicityValid(finalPlanBlueprintEntity, item.getPlanId(), item.getPlanDescriptionTemplateId(), this.isValidGuid(item.getId()))) .failOn(DescriptionPersist._descriptionTemplateId).failWith(this.messageSource.getMessage("Validation.InvalidDescriptionTemplateMultiplicity", new Object[]{DescriptionPersist._descriptionTemplateId}, LocaleContextHolder.getLocale())), this.refSpec() diff --git a/backend/core/src/main/java/org/opencdmp/service/description/DescriptionServiceImpl.java b/backend/core/src/main/java/org/opencdmp/service/description/DescriptionServiceImpl.java index 20bf21530..3e3075e95 100644 --- a/backend/core/src/main/java/org/opencdmp/service/description/DescriptionServiceImpl.java +++ b/backend/core/src/main/java/org/opencdmp/service/description/DescriptionServiceImpl.java @@ -39,6 +39,7 @@ import org.opencdmp.commons.types.descriptiontemplate.importexport.fielddata.Ref import org.opencdmp.commons.types.notification.DataType; import org.opencdmp.commons.types.notification.FieldInfo; import org.opencdmp.commons.types.notification.NotificationFieldData; +import org.opencdmp.commons.types.planblueprint.SectionEntity; import org.opencdmp.commons.types.reference.DefinitionEntity; import org.opencdmp.convention.ConventionService; import org.opencdmp.data.*; @@ -221,6 +222,14 @@ public class DescriptionServiceImpl implements DescriptionService { if (!data.getPlanId().equals(model.getPlanId())) throw new MyValidationException(this.errors.getPlanCanNotChange().getCode(), this.errors.getPlanCanNotChange().getMessage()); if (!data.getPlanDescriptionTemplateId().equals(model.getPlanDescriptionTemplateId())) throw new MyValidationException(this.errors.getPlanDescriptionTemplateCanNotChange().getCode(), this.errors.getPlanDescriptionTemplateCanNotChange().getMessage()); } else { + PlanEntity planEntity = this.entityManager.find(PlanEntity.class, model.getPlanId(), true); + if (planEntity == null) throw new MyNotFoundException(this.messageSource.getMessage("General_ItemNotFound", new Object[]{model.getPlanId(), Plan.class.getSimpleName()}, LocaleContextHolder.getLocale())); + + PlanBlueprintEntity planBlueprintEntity = this.entityManager.find(PlanBlueprintEntity.class, planEntity.getBlueprintId()); + if (planBlueprintEntity == null) throw new MyNotFoundException(this.messageSource.getMessage("General_ItemNotFound", new Object[]{planEntity.getBlueprintId(), PlanBlueprint.class.getSimpleName()}, LocaleContextHolder.getLocale())); + + if (!this.isDescriptionTemplateMaxMultiplicityValid(planBlueprintEntity, model.getPlanId(),model.getPlanDescriptionTemplateId(), false)) throw new MyValidationException(this.errors.getMaxDescriptionsExceeded().getCode(), this.errors.getMaxDescriptionsExceeded().getMessage()); + data = new DescriptionEntity(); data.setId(UUID.randomUUID()); data.setIsActive(IsActive.Active); @@ -275,6 +284,37 @@ public class DescriptionServiceImpl implements DescriptionService { this.elasticService.persistDescription(data); return this.builderFactory.builder(DescriptionBuilder.class).authorize(AuthorizationFlags.AllExceptPublic).build(BaseFieldSet.build(fields, Description._id), data); } + + private boolean isDescriptionTemplateMaxMultiplicityValid(PlanBlueprintEntity planBlueprintEntity, UUID planId, UUID planDescriptionTemplateId, Boolean isUpdate){ + org.opencdmp.commons.types.planblueprint.DefinitionEntity definition = this.xmlHandlingService.fromXmlSafe(org.opencdmp.commons.types.planblueprint.DefinitionEntity.class, planBlueprintEntity.getDefinition()); + if (definition == null || this.conventionService.isListNullOrEmpty(definition.getSections())) return true; + + PlanDescriptionTemplateEntity planDescriptionTemplateEntity = this.queryFactory.query(PlanDescriptionTemplateQuery.class).disableTracking().ids(planDescriptionTemplateId).isActive(IsActive.Active).planIds(planId).first(); + if (planDescriptionTemplateEntity == null) return true; + + List descriptionEntities = this.queryFactory.query(DescriptionQuery.class).disableTracking().authorize(AuthorizationFlags.AllExceptPublic).planIds(planId).planDescriptionTemplateIds(planDescriptionTemplateId).isActive(IsActive.Active).collect(); + + for (SectionEntity section: definition.getSections()) { + if (planDescriptionTemplateEntity.getSectionId().equals(section.getId()) && section.getHasTemplates() && !this.conventionService.isListNullOrEmpty(section.getDescriptionTemplates())){ + int descriptionsCount; + if (isUpdate) descriptionsCount = -1; + else descriptionsCount = 0; + + for (org.opencdmp.commons.types.planblueprint.DescriptionTemplateEntity sectionDescriptionTemplate: section.getDescriptionTemplates()) { + if (sectionDescriptionTemplate.getDescriptionTemplateGroupId().equals(planDescriptionTemplateEntity.getDescriptionTemplateGroupId())){ + for (DescriptionEntity description: descriptionEntities){ + if (description.getPlanDescriptionTemplateId().equals(planDescriptionTemplateEntity.getId())) descriptionsCount++; + } + if (sectionDescriptionTemplate.getMaxMultiplicity() != null && sectionDescriptionTemplate.getMaxMultiplicity() <= descriptionsCount) return false; + } + + } + + } + + } + return true; + } @Override public void updateDescriptionTemplate(UpdateDescriptionTemplatePersist model) throws InvalidApplicationException, IOException { logger.debug(new MapLogEntry("update description template").And("model", model)); @@ -950,12 +990,14 @@ public class DescriptionServiceImpl implements DescriptionService { DescriptionTemplateEntity descriptionTemplateEntity = this.entityManager.find(DescriptionTemplateEntity.class, data.getDescriptionTemplateId(), true); if (descriptionTemplateEntity == null) throw new MyNotFoundException(this.messageSource.getMessage("General_ItemNotFound", new Object[]{data.getDescriptionTemplateId(), DescriptionTemplate.class.getSimpleName()}, LocaleContextHolder.getLocale())); + persist.setId(data.getId()); persist.setLabel(data.getLabel()); persist.setStatus(DescriptionStatus.Finalized); persist.setDescription(data.getDescription()); persist.setDescriptionTemplateId(data.getDescriptionTemplateId()); persist.setPlanId(data.getPlanId()); persist.setPlanDescriptionTemplateId(data.getPlanDescriptionTemplateId()); + persist.setHash(this.conventionService.hashValue(data.getUpdatedAt())); org.opencdmp.commons.types.descriptiontemplate.DefinitionEntity definition = this.xmlHandlingService.fromXmlSafe(org.opencdmp.commons.types.descriptiontemplate.DefinitionEntity.class, descriptionTemplateEntity.getDefinition()); diff --git a/backend/web/src/main/resources/config/errors.yml b/backend/web/src/main/resources/config/errors.yml index 8b2171f00..0e937d749 100644 --- a/backend/web/src/main/resources/config/errors.yml +++ b/backend/web/src/main/resources/config/errors.yml @@ -118,4 +118,7 @@ error-thesaurus: message: Invite user already confirmed requestHasExpired: code: 143 - message: Request has expired \ No newline at end of file + message: Request has expired + maxDescriptionsExceeded: + code: 144 + message: Max descriptions exceeded for this plan \ No newline at end of file diff --git a/frontend/src/app/core/common/enum/respone-error-code.ts b/frontend/src/app/core/common/enum/respone-error-code.ts index 8391bdcd7..7678cfd2c 100644 --- a/frontend/src/app/core/common/enum/respone-error-code.ts +++ b/frontend/src/app/core/common/enum/respone-error-code.ts @@ -41,6 +41,7 @@ export enum ResponseErrorCode { PrefillingSourceCodeExists = 141, InviteUserAlreadyConfirmed = 142, RequestHasExpired = 143, + MaxDescriptionsExceeded = 144, // Notification & Annotation Errors InvalidApiKey = 200, @@ -153,6 +154,8 @@ export class ResponseErrorCodeHelper { return language.instant("GENERAL.BACKEND-ERRORS.INVITE-USER-ALREADY-CONFIRMED"); case ResponseErrorCode.RequestHasExpired: return language.instant("GENERAL.BACKEND-ERRORS.REQUEST-HAS-EXPIRED"); + case ResponseErrorCode.MaxDescriptionsExceeded: + return language.instant("GENERAL.BACKEND-ERRORS.MAX-DESCRIPTION-EXCEEDED"); default: return language.instant("GENERAL.SNACK-BAR.NOT-FOUND"); } diff --git a/frontend/src/app/ui/description/editor/description-editor.component.ts b/frontend/src/app/ui/description/editor/description-editor.component.ts index bade72910..edb1312d3 100644 --- a/frontend/src/app/ui/description/editor/description-editor.component.ts +++ b/frontend/src/app/ui/description/editor/description-editor.component.ts @@ -261,7 +261,7 @@ export class DescriptionEditorComponent extends BaseEditor x.planDescriptionTemplate.descriptionTemplateGroupId == sectionDescriptionTemplate.descriptionTemplateGroupId); - if (commonDescriptions && commonDescriptions.length >= sectionDescriptionTemplate.maxMultiplicity) { + if (commonDescriptions && commonDescriptions.length > sectionDescriptionTemplate.maxMultiplicity) { rejectedPlanDescriptionTemplates.push.apply(rejectedPlanDescriptionTemplates, commonDescriptions.map(x => x.planDescriptionTemplate)); } } diff --git a/frontend/src/app/ui/plan/plan-editor-blueprint/plan-editor.component.ts b/frontend/src/app/ui/plan/plan-editor-blueprint/plan-editor.component.ts index 74f6ec141..5dc8ef427 100644 --- a/frontend/src/app/ui/plan/plan-editor-blueprint/plan-editor.component.ts +++ b/frontend/src/app/ui/plan/plan-editor-blueprint/plan-editor.component.ts @@ -674,16 +674,24 @@ export class PlanEditorComponent extends BaseEditor imple } let multiplicityValidResults: boolean[] = []; + const descriptionTemplatesGroupIds = this.formGroup.get('descriptionTemplates').get(section.id.toString()).value as Guid[] || []; + let descriptionTemplatesGroupIdsWithMaxMultitplicity: Guid[] = []; section.descriptionTemplates.forEach(sectionDescriptionTemplate => { if (sectionDescriptionTemplate.maxMultiplicity != null) { const count = descriptions.filter(x => x.planDescriptionTemplate.descriptionTemplateGroupId == sectionDescriptionTemplate.descriptionTemplateGroupId).length || 0; if (count >= sectionDescriptionTemplate.maxMultiplicity) multiplicityValidResults.push(false); else multiplicityValidResults.push(true); + descriptionTemplatesGroupIdsWithMaxMultitplicity.push(sectionDescriptionTemplate.descriptionTemplateGroupId); } else { multiplicityValidResults.push(true); } }) + if (descriptionTemplatesGroupIdsWithMaxMultitplicity.length > 0 && descriptionTemplatesGroupIds.length > 0){ + const descriptionTemplatesWithoutMaxMultiplicity = descriptionTemplatesGroupIds.filter(x => !descriptionTemplatesGroupIdsWithMaxMultitplicity.map(y => y).includes(x)) || []; + if (descriptionTemplatesWithoutMaxMultiplicity.length > 0 && this.formGroup.pristine) return true; + } + if (multiplicityValidResults.includes(true)) return true else return false; } else { diff --git a/frontend/src/assets/i18n/baq.json b/frontend/src/assets/i18n/baq.json index 01e0b87b3..fba1ab7b8 100644 --- a/frontend/src/assets/i18n/baq.json +++ b/frontend/src/assets/i18n/baq.json @@ -78,7 +78,8 @@ "PREFILLING-SOURCE-CODE-EXISTS": "The prefilling source code you provided already exists. Please choose a different code.", "DUPLICATE-PLAN-USER": "You can't invite authors with same role and plan section more than once", "INVITE-USER-ALREADY-CONFIRMED": "Ιnvitation has already confirmed", - "REQUEST-HAS-EXPIRED": "Request has expired" + "REQUEST-HAS-EXPIRED": "Request has expired", + "MAX-DESCRIPTION-EXCEEDED": "This plan has reached the maximun descriptions for this description template" }, "FORM-VALIDATION-DISPLAY-DIALOG": { "WARNING": "Kontuz!", @@ -2013,6 +2014,7 @@ "DESCRIPTION-MODIFIED": "Description Modified", "DESCRIPTION-FINALISED": "Description Finalised", "DESCRIPTION-ANNOTATION-CREATED": "Description Annotation Created", + "DESCRIPTION-ANNOTATION-STATUS-CHANGED": "Description Annotation Status Changed", "MERGE-ACCOUNT-CONFIRMATION": "Merge Account Confirmation", "REMOVE-CREDENTIAL-CONFIRMATION": "Remove Credential Confirmation", "PLAN-DEPOSIT": "Plan Deposit", diff --git a/frontend/src/assets/i18n/de.json b/frontend/src/assets/i18n/de.json index da3b6e53d..d44583997 100644 --- a/frontend/src/assets/i18n/de.json +++ b/frontend/src/assets/i18n/de.json @@ -78,7 +78,8 @@ "PREFILLING-SOURCE-CODE-EXISTS": "The prefilling source code you provided already exists. Please choose a different code.", "DUPLICATE-PLAN-USER": "You can't invite authors with same role and plan section more than once", "INVITE-USER-ALREADY-CONFIRMED": "Ιnvitation has already confirmed", - "REQUEST-HAS-EXPIRED": "Request has expired" + "REQUEST-HAS-EXPIRED": "Request has expired", + "MAX-DESCRIPTION-EXCEEDED": "This plan has reached the maximun descriptions for this description template" }, "FORM-VALIDATION-DISPLAY-DIALOG": { "WARNING": "Warnung!", @@ -2013,6 +2014,7 @@ "DESCRIPTION-MODIFIED": "Description Modified", "DESCRIPTION-FINALISED": "Description Finalised", "DESCRIPTION-ANNOTATION-CREATED": "Description Annotation Created", + "DESCRIPTION-ANNOTATION-STATUS-CHANGED": "Description Annotation Status Changed", "MERGE-ACCOUNT-CONFIRMATION": "Merge Account Confirmation", "REMOVE-CREDENTIAL-CONFIRMATION": "Remove Credential Confirmation", "PLAN-DEPOSIT": "Plan Deposit", diff --git a/frontend/src/assets/i18n/en.json b/frontend/src/assets/i18n/en.json index 3e31114a9..b8128fe45 100644 --- a/frontend/src/assets/i18n/en.json +++ b/frontend/src/assets/i18n/en.json @@ -78,7 +78,8 @@ "PREFILLING-SOURCE-CODE-EXISTS": "The prefilling source code you provided already exists. Please choose a different code.", "DUPLICATE-PLAN-USER": "You can't invite authors with same role and plan section more than once", "INVITE-USER-ALREADY-CONFIRMED": "Ιnvitation has already confirmed", - "REQUEST-HAS-EXPIRED": "Request has expired" + "REQUEST-HAS-EXPIRED": "Request has expired", + "MAX-DESCRIPTION-EXCEEDED": "This plan has reached the maximun descriptions for this description template" }, "FORM-VALIDATION-DISPLAY-DIALOG": { "WARNING": "Warning!", @@ -2013,6 +2014,7 @@ "DESCRIPTION-MODIFIED": "Description Modified", "DESCRIPTION-FINALISED": "Description Finalised", "DESCRIPTION-ANNOTATION-CREATED": "Description Annotation Created", + "DESCRIPTION-ANNOTATION-STATUS-CHANGED": "Description Annotation Status Changed", "MERGE-ACCOUNT-CONFIRMATION": "Merge Account Confirmation", "REMOVE-CREDENTIAL-CONFIRMATION": "Remove Credential Confirmation", "PLAN-DEPOSIT": "Plan Deposit", diff --git a/frontend/src/assets/i18n/es.json b/frontend/src/assets/i18n/es.json index a622ba737..82963a8f4 100644 --- a/frontend/src/assets/i18n/es.json +++ b/frontend/src/assets/i18n/es.json @@ -78,7 +78,8 @@ "PREFILLING-SOURCE-CODE-EXISTS": "The prefilling source code you provided already exists. Please choose a different code.", "DUPLICATE-PLAN-USER": "You can't invite authors with same role and plan section more than once", "INVITE-USER-ALREADY-CONFIRMED": "Ιnvitation has already confirmed", - "REQUEST-HAS-EXPIRED": "Request has expired" + "REQUEST-HAS-EXPIRED": "Request has expired", + "MAX-DESCRIPTION-EXCEEDED": "This plan has reached the maximun descriptions for this description template" }, "FORM-VALIDATION-DISPLAY-DIALOG": { "WARNING": "Atención!", @@ -2013,6 +2014,7 @@ "DESCRIPTION-MODIFIED": "Description Modified", "DESCRIPTION-FINALISED": "Description Finalised", "DESCRIPTION-ANNOTATION-CREATED": "Description Annotation Created", + "DESCRIPTION-ANNOTATION-STATUS-CHANGED": "Description Annotation Status Changed", "MERGE-ACCOUNT-CONFIRMATION": "Merge Account Confirmation", "REMOVE-CREDENTIAL-CONFIRMATION": "Remove Credential Confirmation", "PLAN-DEPOSIT": "Plan Deposit", diff --git a/frontend/src/assets/i18n/gr.json b/frontend/src/assets/i18n/gr.json index 318a27c7e..b3ee405af 100644 --- a/frontend/src/assets/i18n/gr.json +++ b/frontend/src/assets/i18n/gr.json @@ -78,7 +78,8 @@ "PREFILLING-SOURCE-CODE-EXISTS": "The prefilling source code you provided already exists. Please choose a different code.", "DUPLICATE-PLAN-USER": "You can't invite authors with same role and plan section more than once", "INVITE-USER-ALREADY-CONFIRMED": "Ιnvitation has already confirmed", - "REQUEST-HAS-EXPIRED": "Request has expired" + "REQUEST-HAS-EXPIRED": "Request has expired", + "MAX-DESCRIPTION-EXCEEDED": "This plan has reached the maximun descriptions for this description template" }, "FORM-VALIDATION-DISPLAY-DIALOG": { "WARNING": "Προσοχή!", @@ -2013,6 +2014,7 @@ "DESCRIPTION-MODIFIED": "Description Modified", "DESCRIPTION-FINALISED": "Description Finalised", "DESCRIPTION-ANNOTATION-CREATED": "Description Annotation Created", + "DESCRIPTION-ANNOTATION-STATUS-CHANGED": "Description Annotation Status Changed", "MERGE-ACCOUNT-CONFIRMATION": "Merge Account Confirmation", "REMOVE-CREDENTIAL-CONFIRMATION": "Remove Credential Confirmation", "PLAN-DEPOSIT": "Plan Deposit", diff --git a/frontend/src/assets/i18n/hr.json b/frontend/src/assets/i18n/hr.json index 56d56fe1d..fa031e584 100644 --- a/frontend/src/assets/i18n/hr.json +++ b/frontend/src/assets/i18n/hr.json @@ -78,7 +78,8 @@ "PREFILLING-SOURCE-CODE-EXISTS": "The prefilling source code you provided already exists. Please choose a different code.", "DUPLICATE-PLAN-USER": "You can't invite authors with same role and plan section more than once", "INVITE-USER-ALREADY-CONFIRMED": "Ιnvitation has already confirmed", - "REQUEST-HAS-EXPIRED": "Request has expired" + "REQUEST-HAS-EXPIRED": "Request has expired", + "MAX-DESCRIPTION-EXCEEDED": "This plan has reached the maximun descriptions for this description template" }, "FORM-VALIDATION-DISPLAY-DIALOG": { "WARNING": "Oprez!", @@ -2013,6 +2014,7 @@ "DESCRIPTION-MODIFIED": "Description Modified", "DESCRIPTION-FINALISED": "Description Finalised", "DESCRIPTION-ANNOTATION-CREATED": "Description Annotation Created", + "DESCRIPTION-ANNOTATION-STATUS-CHANGED": "Description Annotation Status Changed", "MERGE-ACCOUNT-CONFIRMATION": "Merge Account Confirmation", "REMOVE-CREDENTIAL-CONFIRMATION": "Remove Credential Confirmation", "PLAN-DEPOSIT": "Plan Deposit", diff --git a/frontend/src/assets/i18n/pl.json b/frontend/src/assets/i18n/pl.json index 5705df88d..beb8908e6 100644 --- a/frontend/src/assets/i18n/pl.json +++ b/frontend/src/assets/i18n/pl.json @@ -78,7 +78,8 @@ "PREFILLING-SOURCE-CODE-EXISTS": "The prefilling source code you provided already exists. Please choose a different code.", "DUPLICATE-PLAN-USER": "You can't invite authors with same role and plan section more than once", "INVITE-USER-ALREADY-CONFIRMED": "Ιnvitation has already confirmed", - "REQUEST-HAS-EXPIRED": "Request has expired" + "REQUEST-HAS-EXPIRED": "Request has expired", + "MAX-DESCRIPTION-EXCEEDED": "This plan has reached the maximun descriptions for this description template" }, "FORM-VALIDATION-DISPLAY-DIALOG": { "WARNING": "Ostrzeżenie!", @@ -2013,6 +2014,7 @@ "DESCRIPTION-MODIFIED": "Description Modified", "DESCRIPTION-FINALISED": "Description Finalised", "DESCRIPTION-ANNOTATION-CREATED": "Description Annotation Created", + "DESCRIPTION-ANNOTATION-STATUS-CHANGED": "Description Annotation Status Changed", "MERGE-ACCOUNT-CONFIRMATION": "Merge Account Confirmation", "REMOVE-CREDENTIAL-CONFIRMATION": "Remove Credential Confirmation", "PLAN-DEPOSIT": "Plan Deposit", diff --git a/frontend/src/assets/i18n/pt.json b/frontend/src/assets/i18n/pt.json index e16b64aba..2c7940c2f 100644 --- a/frontend/src/assets/i18n/pt.json +++ b/frontend/src/assets/i18n/pt.json @@ -78,7 +78,8 @@ "PREFILLING-SOURCE-CODE-EXISTS": "The prefilling source code you provided already exists. Please choose a different code.", "DUPLICATE-PLAN-USER": "You can't invite authors with same role and plan section more than once", "INVITE-USER-ALREADY-CONFIRMED": "Ιnvitation has already confirmed", - "REQUEST-HAS-EXPIRED": "Request has expired" + "REQUEST-HAS-EXPIRED": "Request has expired", + "MAX-DESCRIPTION-EXCEEDED": "This plan has reached the maximun descriptions for this description template" }, "FORM-VALIDATION-DISPLAY-DIALOG": { "WARNING": "Atenção!", @@ -2013,6 +2014,7 @@ "DESCRIPTION-MODIFIED": "Description Modified", "DESCRIPTION-FINALISED": "Description Finalised", "DESCRIPTION-ANNOTATION-CREATED": "Description Annotation Created", + "DESCRIPTION-ANNOTATION-STATUS-CHANGED": "Description Annotation Status Changed", "MERGE-ACCOUNT-CONFIRMATION": "Merge Account Confirmation", "REMOVE-CREDENTIAL-CONFIRMATION": "Remove Credential Confirmation", "PLAN-DEPOSIT": "Plan Deposit", diff --git a/frontend/src/assets/i18n/sk.json b/frontend/src/assets/i18n/sk.json index b5dd35722..7c251c2b4 100644 --- a/frontend/src/assets/i18n/sk.json +++ b/frontend/src/assets/i18n/sk.json @@ -78,7 +78,8 @@ "PREFILLING-SOURCE-CODE-EXISTS": "The prefilling source code you provided already exists. Please choose a different code.", "DUPLICATE-PLAN-USER": "You can't invite authors with same role and plan section more than once", "INVITE-USER-ALREADY-CONFIRMED": "Ιnvitation has already confirmed", - "REQUEST-HAS-EXPIRED": "Request has expired" + "REQUEST-HAS-EXPIRED": "Request has expired", + "MAX-DESCRIPTION-EXCEEDED": "This plan has reached the maximun descriptions for this description template" }, "FORM-VALIDATION-DISPLAY-DIALOG": { "WARNING": "Upozornenie!", @@ -2013,6 +2014,7 @@ "DESCRIPTION-MODIFIED": "Description Modified", "DESCRIPTION-FINALISED": "Description Finalised", "DESCRIPTION-ANNOTATION-CREATED": "Description Annotation Created", + "DESCRIPTION-ANNOTATION-STATUS-CHANGED": "Description Annotation Status Changed", "MERGE-ACCOUNT-CONFIRMATION": "Merge Account Confirmation", "REMOVE-CREDENTIAL-CONFIRMATION": "Remove Credential Confirmation", "PLAN-DEPOSIT": "Plan Deposit", diff --git a/frontend/src/assets/i18n/sr.json b/frontend/src/assets/i18n/sr.json index 86d2cb03a..e9bd5977d 100644 --- a/frontend/src/assets/i18n/sr.json +++ b/frontend/src/assets/i18n/sr.json @@ -78,7 +78,8 @@ "PREFILLING-SOURCE-CODE-EXISTS": "The prefilling source code you provided already exists. Please choose a different code.", "DUPLICATE-PLAN-USER": "You can't invite authors with same role and plan section more than once", "INVITE-USER-ALREADY-CONFIRMED": "Ιnvitation has already confirmed", - "REQUEST-HAS-EXPIRED": "Request has expired" + "REQUEST-HAS-EXPIRED": "Request has expired", + "MAX-DESCRIPTION-EXCEEDED": "This plan has reached the maximun descriptions for this description template" }, "FORM-VALIDATION-DISPLAY-DIALOG": { "WARNING": "Oprez!", @@ -2013,6 +2014,7 @@ "DESCRIPTION-MODIFIED": "Description Modified", "DESCRIPTION-FINALISED": "Description Finalised", "DESCRIPTION-ANNOTATION-CREATED": "Description Annotation Created", + "DESCRIPTION-ANNOTATION-STATUS-CHANGED": "Description Annotation Status Changed", "MERGE-ACCOUNT-CONFIRMATION": "Merge Account Confirmation", "REMOVE-CREDENTIAL-CONFIRMATION": "Remove Credential Confirmation", "PLAN-DEPOSIT": "Plan Deposit", diff --git a/frontend/src/assets/i18n/tr.json b/frontend/src/assets/i18n/tr.json index 5192ca53e..786261026 100644 --- a/frontend/src/assets/i18n/tr.json +++ b/frontend/src/assets/i18n/tr.json @@ -78,7 +78,8 @@ "PREFILLING-SOURCE-CODE-EXISTS": "The prefilling source code you provided already exists. Please choose a different code.", "DUPLICATE-PLAN-USER": "You can't invite authors with same role and plan section more than once", "INVITE-USER-ALREADY-CONFIRMED": "Ιnvitation has already confirmed", - "REQUEST-HAS-EXPIRED": "Request has expired" + "REQUEST-HAS-EXPIRED": "Request has expired", + "MAX-DESCRIPTION-EXCEEDED": "This plan has reached the maximun descriptions for this description template" }, "FORM-VALIDATION-DISPLAY-DIALOG": { "WARNING": "Uyarı!", @@ -2013,6 +2014,7 @@ "DESCRIPTION-MODIFIED": "Description Modified", "DESCRIPTION-FINALISED": "Description Finalised", "DESCRIPTION-ANNOTATION-CREATED": "Description Annotation Created", + "DESCRIPTION-ANNOTATION-STATUS-CHANGED": "Description Annotation Status Changed", "MERGE-ACCOUNT-CONFIRMATION": "Merge Account Confirmation", "REMOVE-CREDENTIAL-CONFIRMATION": "Remove Credential Confirmation", "PLAN-DEPOSIT": "Plan Deposit", diff --git a/frontend/src/notification-service/core/enum/notification-type.enum.ts b/frontend/src/notification-service/core/enum/notification-type.enum.ts index f0419b9f6..71d52198f 100644 --- a/frontend/src/notification-service/core/enum/notification-type.enum.ts +++ b/frontend/src/notification-service/core/enum/notification-type.enum.ts @@ -5,6 +5,7 @@ export enum NotificationType { planModifiedType = '4542262a-22f8-4baa-9db6-1c8e70ac1dbb', planFinalisedType = '90db0b46-42de-bd89-aebf-6f27efeb256e', descriptionAnnotationCreated = 'db1e99d2-a240-4e75-9bb2-ef25b234c1f0', + descriptionAnnotationStatusChanged = '3189e3a6-91e6-40c6-8ff8-275a68445aec', descriptionModifiedType = '4fdbfa80-7a71-4a69-b854-67cbb70648f1', descriptionFinalisedType = '33790bad-94d4-488a-8ee2-7f6295ca18ea', mergeAccountConfirmationType = 'bfe68845-cb05-4c5a-a03d-29161a7c9660', diff --git a/frontend/src/notification-service/core/formatting/enum-utils.service.ts b/frontend/src/notification-service/core/formatting/enum-utils.service.ts index 5c83bd856..862cb42cf 100644 --- a/frontend/src/notification-service/core/formatting/enum-utils.service.ts +++ b/frontend/src/notification-service/core/formatting/enum-utils.service.ts @@ -36,6 +36,7 @@ export class NotificationServiceEnumUtils extends BaseEnumUtilsService { case NotificationType.descriptionModifiedType: return this.language.instant('TYPES.NOTIFICATION-TEMPLATE-NOTIFICATION-TYPE.DESCRIPTION-MODIFIED'); case NotificationType.descriptionFinalisedType: return this.language.instant('TYPES.NOTIFICATION-TEMPLATE-NOTIFICATION-TYPE.DESCRIPTION-FINALISED'); case NotificationType.descriptionAnnotationCreated: return this.language.instant('TYPES.NOTIFICATION-TEMPLATE-NOTIFICATION-TYPE.DESCRIPTION-ANNOTATION-CREATED'); + case NotificationType.descriptionAnnotationStatusChanged: return this.language.instant('TYPES.NOTIFICATION-TEMPLATE-NOTIFICATION-TYPE.DESCRIPTION-ANNOTATION-STATUS-CHANGED'); case NotificationType.mergeAccountConfirmationType: return this.language.instant('TYPES.NOTIFICATION-TEMPLATE-NOTIFICATION-TYPE.MERGE-ACCOUNT-CONFIRMATION'); case NotificationType.removeCredentialConfirmationType: return this.language.instant('TYPES.NOTIFICATION-TEMPLATE-NOTIFICATION-TYPE.REMOVE-CREDENTIAL-CONFIRMATION'); case NotificationType.planDepositType: return this.language.instant('TYPES.NOTIFICATION-TEMPLATE-NOTIFICATION-TYPE.PLAN-DEPOSIT');