From afae07bdb594331c86333869f94b176839f7c255 Mon Sep 17 00:00:00 2001 From: erikao1998 Date: Fri, 22 Dec 2023 18:40:26 +0200 Subject: [PATCH] Add dual use risk to the risk table --- src/client/components/ResultPage/TotalRisk.tsx | 10 +++++++++- src/client/locales/en.json | 1 + src/client/locales/fi.json | 1 + src/client/locales/sv.json | 1 + 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/client/components/ResultPage/TotalRisk.tsx b/src/client/components/ResultPage/TotalRisk.tsx index fb65371..e59c341 100644 --- a/src/client/components/ResultPage/TotalRisk.tsx +++ b/src/client/components/ResultPage/TotalRisk.tsx @@ -48,6 +48,10 @@ const TotalRisk = ({ .find((question) => question.id === 12) ?.optionData.options.find((o) => o.id === resultData[12])?.risk + const dualUseRisk = questions + .find((question) => question.id === 23) + ?.optionData.options.find((o) => o.id === resultData[23])?.risk + const riskArray = [ { id: 'country', @@ -74,6 +78,11 @@ const TotalRisk = ({ text: t('risks:durationRiskLevel'), riskLevel: durationRisk, }, + { + id: 'dualUse', + text: t('risks:dualUseRiskLevel'), + riskLevel: dualUseRisk, + }, ].filter((value) => possibleRiskLevels.includes(value.riskLevel)) if (riskArray.length === 0) return null @@ -119,7 +128,6 @@ const TotalRisk = ({ )} {riskArray.map( (risk) => - risk.riskLevel === 3 && risk.id !== 'country' && (