From a9fc14963d50c6f596911bdb0b079e5ce4cc3b1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilia=20M=C3=A4kel=C3=A4?= Date: Wed, 27 Mar 2024 11:48:03 +0200 Subject: [PATCH] fix: convert spaces to dashes in ahjo case page link (#2897) --- .../applications/pageContent/DecisionSummary.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend/benefit/applicant/src/components/applications/pageContent/DecisionSummary.tsx b/frontend/benefit/applicant/src/components/applications/pageContent/DecisionSummary.tsx index 4d053b250b..423a6a6dda 100644 --- a/frontend/benefit/applicant/src/components/applications/pageContent/DecisionSummary.tsx +++ b/frontend/benefit/applicant/src/components/applications/pageContent/DecisionSummary.tsx @@ -36,11 +36,10 @@ const DecisionSummary = ({ application }: Props): JSX.Element => { } const displayDecision = (): void => { + const id = application.ahjoCaseId.split(' ').join('-'); + // eslint-disable-next-line security/detect-non-literal-fs-filename - window.open( - `https://paatokset.hel.fi/fi/asia/${application.ahjoCaseId}`, - '_blank' - ); + window.open(`https://paatokset.hel.fi/fi/asia/${id}`, '_blank'); }; const hasHandledTermination = application.alterations.some( @@ -96,6 +95,7 @@ const DecisionSummary = ({ application }: Props): JSX.Element => { onClick={displayDecision} theme="black" variant="secondary" + role="link" > {t('common:applications.decision.actions.showDecision')}