From bd72ca9139b6714d49ea7ae91a0c2f6179130ce7 Mon Sep 17 00:00:00 2001 From: "CITE\\amentis" Date: Tue, 15 Oct 2024 12:19:35 +0300 Subject: [PATCH] add evaluate to plan status available actions --- .../opencdmp/commons/enums/PlanStatusAvailableActionType.java | 3 ++- .../app/core/common/enum/plan-status-available-action-type.ts | 3 ++- frontend/src/app/core/services/utilities/enum-utils.service.ts | 1 + frontend/src/app/ui/plan/overview/plan-overview.component.ts | 3 ++- frontend/src/assets/i18n/baq.json | 3 ++- frontend/src/assets/i18n/de.json | 3 ++- frontend/src/assets/i18n/en.json | 3 ++- frontend/src/assets/i18n/es.json | 3 ++- frontend/src/assets/i18n/gr.json | 3 ++- frontend/src/assets/i18n/hr.json | 3 ++- frontend/src/assets/i18n/pl.json | 3 ++- frontend/src/assets/i18n/pt.json | 3 ++- frontend/src/assets/i18n/sk.json | 3 ++- frontend/src/assets/i18n/sr.json | 3 ++- frontend/src/assets/i18n/tr.json | 3 ++- 15 files changed, 29 insertions(+), 14 deletions(-) diff --git a/backend/core/src/main/java/org/opencdmp/commons/enums/PlanStatusAvailableActionType.java b/backend/core/src/main/java/org/opencdmp/commons/enums/PlanStatusAvailableActionType.java index 5dd7d7aba..5210882c1 100644 --- a/backend/core/src/main/java/org/opencdmp/commons/enums/PlanStatusAvailableActionType.java +++ b/backend/core/src/main/java/org/opencdmp/commons/enums/PlanStatusAvailableActionType.java @@ -8,7 +8,8 @@ import java.util.Map; public enum PlanStatusAvailableActionType implements DatabaseEnum { Deposit((short) 0), - Export((short) 1); + Export((short) 1), + Evaluate((short) 2); private final Short value; diff --git a/frontend/src/app/core/common/enum/plan-status-available-action-type.ts b/frontend/src/app/core/common/enum/plan-status-available-action-type.ts index ef40ff21b..5fe6df11a 100644 --- a/frontend/src/app/core/common/enum/plan-status-available-action-type.ts +++ b/frontend/src/app/core/common/enum/plan-status-available-action-type.ts @@ -1,4 +1,5 @@ export enum PlanStatusAvailableActionType { Deposit = 0, - Export = 1 + Export = 1, + Evaluate = 2 } \ No newline at end of file diff --git a/frontend/src/app/core/services/utilities/enum-utils.service.ts b/frontend/src/app/core/services/utilities/enum-utils.service.ts index 611e1106e..06047be49 100644 --- a/frontend/src/app/core/services/utilities/enum-utils.service.ts +++ b/frontend/src/app/core/services/utilities/enum-utils.service.ts @@ -83,6 +83,7 @@ export class EnumUtils { switch (status) { case PlanStatusAvailableActionType.Deposit: return this.language.instant('TYPES.PLAN-STATUS-AVAILABLE-ACTION-TYPE.DEPOSIT'); case PlanStatusAvailableActionType.Export: return this.language.instant('TYPES.PLAN-STATUS-AVAILABLE-ACTION-TYPE.EXPORT'); + case PlanStatusAvailableActionType.Evaluate: return this.language.instant('TYPES.PLAN-STATUS-AVAILABLE-ACTION-TYPE.EVALUATE'); } } diff --git a/frontend/src/app/ui/plan/overview/plan-overview.component.ts b/frontend/src/app/ui/plan/overview/plan-overview.component.ts index 7a261abff..8780edd1d 100644 --- a/frontend/src/app/ui/plan/overview/plan-overview.component.ts +++ b/frontend/src/app/ui/plan/overview/plan-overview.component.ts @@ -322,7 +322,8 @@ export class PlanOverviewComponent extends BaseComponent implements OnInit { canEvaluatePlan(): boolean { const authorizationFlags = !this.isPublicView ? (this.plan as Plan).authorizationFlags : []; - return (authorizationFlags?.some(x => x === AppPermission.EvaluatePlan) || this.authentication.hasPermission(AppPermission.EvaluatePlan)); + return (authorizationFlags?.some(x => x === AppPermission.EvaluatePlan) || this.authentication.hasPermission(AppPermission.EvaluatePlan)) && + this.plan?.status?.definition?.availableActions?.filter(x => x === PlanStatusAvailableActionType.Evaluate).length > 0; } onEvaluatePlan(planId: Guid, evaluatorId: string, format: string, rankConfig: RankConfig ,isPublicView: boolean) { diff --git a/frontend/src/assets/i18n/baq.json b/frontend/src/assets/i18n/baq.json index 1b7473b5a..eb43df9b3 100644 --- a/frontend/src/assets/i18n/baq.json +++ b/frontend/src/assets/i18n/baq.json @@ -2159,7 +2159,8 @@ }, "PLAN-STATUS-AVAILABLE-ACTION-TYPE": { "DEPOSIT": "Deposit", - "EXPORT": "Export" + "EXPORT": "Export", + "EVALUATE": "Evaluate" }, "PLAN-VISIBILITY": { "PUBLIC": "Argitaratuta" diff --git a/frontend/src/assets/i18n/de.json b/frontend/src/assets/i18n/de.json index d2a50b019..dec9d8302 100644 --- a/frontend/src/assets/i18n/de.json +++ b/frontend/src/assets/i18n/de.json @@ -2162,7 +2162,8 @@ }, "PLAN-STATUS-AVAILABLE-ACTION-TYPE": { "DEPOSIT": "Deposit", - "EXPORT": "Export" + "EXPORT": "Export", + "EVALUATE": "Evaluate" }, "PLAN-VISIBILITY": { "PUBLIC": "Veröffentlicht" diff --git a/frontend/src/assets/i18n/en.json b/frontend/src/assets/i18n/en.json index a8573e102..9dec7a445 100644 --- a/frontend/src/assets/i18n/en.json +++ b/frontend/src/assets/i18n/en.json @@ -2162,7 +2162,8 @@ }, "PLAN-STATUS-AVAILABLE-ACTION-TYPE": { "DEPOSIT": "Deposit", - "EXPORT": "Export" + "EXPORT": "Export", + "EVALUATE": "Evaluate" }, "PLAN-VISIBILITY": { "PUBLIC": "Published" diff --git a/frontend/src/assets/i18n/es.json b/frontend/src/assets/i18n/es.json index c7fcdebef..a2f5bc03b 100644 --- a/frontend/src/assets/i18n/es.json +++ b/frontend/src/assets/i18n/es.json @@ -2162,7 +2162,8 @@ }, "PLAN-STATUS-AVAILABLE-ACTION-TYPE": { "DEPOSIT": "Deposit", - "EXPORT": "Export" + "EXPORT": "Export", + "EVALUATE": "Evaluate" }, "PLAN-VISIBILITY": { "PUBLIC": "Publicado" diff --git a/frontend/src/assets/i18n/gr.json b/frontend/src/assets/i18n/gr.json index af8389e11..b9be9893d 100644 --- a/frontend/src/assets/i18n/gr.json +++ b/frontend/src/assets/i18n/gr.json @@ -2162,7 +2162,8 @@ }, "PLAN-STATUS-AVAILABLE-ACTION-TYPE": { "DEPOSIT": "Deposit", - "EXPORT": "Export" + "EXPORT": "Export", + "EVALUATE": "Evaluate" }, "PLAN-VISIBILITY": { "PUBLIC": "Δημοσιευμένο" diff --git a/frontend/src/assets/i18n/hr.json b/frontend/src/assets/i18n/hr.json index 692d2158c..d514e2ceb 100644 --- a/frontend/src/assets/i18n/hr.json +++ b/frontend/src/assets/i18n/hr.json @@ -2162,7 +2162,8 @@ }, "PLAN-STATUS-AVAILABLE-ACTION-TYPE": { "DEPOSIT": "Deposit", - "EXPORT": "Export" + "EXPORT": "Export", + "EVALUATE": "Evaluate" }, "PLAN-VISIBILITY": { "PUBLIC": "Objavljeno" diff --git a/frontend/src/assets/i18n/pl.json b/frontend/src/assets/i18n/pl.json index c3c1e2330..fa3849666 100644 --- a/frontend/src/assets/i18n/pl.json +++ b/frontend/src/assets/i18n/pl.json @@ -2162,7 +2162,8 @@ }, "PLAN-STATUS-AVAILABLE-ACTION-TYPE": { "DEPOSIT": "Deposit", - "EXPORT": "Export" + "EXPORT": "Export", + "EVALUATE": "Evaluate" }, "PLAN-VISIBILITY": { "PUBLIC": "Opublikowane" diff --git a/frontend/src/assets/i18n/pt.json b/frontend/src/assets/i18n/pt.json index 9c302f94c..74b601745 100644 --- a/frontend/src/assets/i18n/pt.json +++ b/frontend/src/assets/i18n/pt.json @@ -2161,7 +2161,8 @@ }, "PLAN-STATUS-AVAILABLE-ACTION-TYPE": { "DEPOSIT": "Deposit", - "EXPORT": "Export" + "EXPORT": "Export", + "EVALUATE": "Evaluate" }, "PLAN-VISIBILITY": { "PUBLIC": "Publicado" diff --git a/frontend/src/assets/i18n/sk.json b/frontend/src/assets/i18n/sk.json index 4dce02cb5..f6970516f 100644 --- a/frontend/src/assets/i18n/sk.json +++ b/frontend/src/assets/i18n/sk.json @@ -2162,7 +2162,8 @@ }, "PLAN-STATUS-AVAILABLE-ACTION-TYPE": { "DEPOSIT": "Deposit", - "EXPORT": "Export" + "EXPORT": "Export", + "EVALUATE": "Evaluate" }, "PLAN-VISIBILITY": { "PUBLIC": "Publikované" diff --git a/frontend/src/assets/i18n/sr.json b/frontend/src/assets/i18n/sr.json index 866643c3c..10d2759e3 100644 --- a/frontend/src/assets/i18n/sr.json +++ b/frontend/src/assets/i18n/sr.json @@ -2162,7 +2162,8 @@ }, "PLAN-STATUS-AVAILABLE-ACTION-TYPE": { "DEPOSIT": "Deposit", - "EXPORT": "Export" + "EXPORT": "Export", + "EVALUATE": "Evaluate" }, "PLAN-VISIBILITY": { "PUBLIC": "Objavljeno" diff --git a/frontend/src/assets/i18n/tr.json b/frontend/src/assets/i18n/tr.json index ff16c1f7b..c110e8194 100644 --- a/frontend/src/assets/i18n/tr.json +++ b/frontend/src/assets/i18n/tr.json @@ -2162,7 +2162,8 @@ }, "PLAN-STATUS-AVAILABLE-ACTION-TYPE": { "DEPOSIT": "Deposit", - "EXPORT": "Export" + "EXPORT": "Export", + "EVALUATE": "Evaluate" }, "PLAN-VISIBILITY": { "PUBLIC": "Yayınlandı"