From 7a7f4efdab3447e2cfca7553183db0102bace61d Mon Sep 17 00:00:00 2001 From: Maks Turtiainen Date: Thu, 23 Nov 2023 16:49:02 +0200 Subject: [PATCH] fix: per month amounts in handled view (HL-1046) (#2518) --- .../DoneModalContent/DoneModalContent.tsx | 23 ++++++++----------- .../handledView/HandledView.tsx | 13 ++++------- 2 files changed, 13 insertions(+), 23 deletions(-) diff --git a/frontend/benefit/handler/src/components/applicationReview/actions/handlingApplicationActions/DoneModalContent/DoneModalContent.tsx b/frontend/benefit/handler/src/components/applicationReview/actions/handlingApplicationActions/DoneModalContent/DoneModalContent.tsx index 29c2f58759..633f4f1e51 100644 --- a/frontend/benefit/handler/src/components/applicationReview/actions/handlingApplicationActions/DoneModalContent/DoneModalContent.tsx +++ b/frontend/benefit/handler/src/components/applicationReview/actions/handlingApplicationActions/DoneModalContent/DoneModalContent.tsx @@ -62,20 +62,15 @@ const DoneModalContent: React.FC = ({ })} - {dateRangeRows.length === helsinkiBenefitMonthlyRows.length && - dateRangeRows.map((row, index) => ( - <$Text key={row.id}> - {t(`${translationsBase}.eurosPerMonth`, { - euros: formatFloatToCurrency( - helsinkiBenefitMonthlyRows[index].amount, - null, - 'fi-FI', - 0 - ), - dateRange: row.descriptionFi.toLocaleLowerCase(), - })} - - ))} + {helsinkiBenefitMonthlyRows.map((row, index) => ( + <$Text key={row.id}> + {t(`${translationsBase}.eurosPerMonth`, { + euros: formatFloatToCurrency(row.amount, null, 'fi-FI', 0), + dateRange: + dateRangeRows[index]?.descriptionFi.toLocaleLowerCase(), + })} + + ))} )} {description && ( diff --git a/frontend/benefit/handler/src/components/applicationReview/handledView/HandledView.tsx b/frontend/benefit/handler/src/components/applicationReview/handledView/HandledView.tsx index 3ebd173d62..9e988715e0 100644 --- a/frontend/benefit/handler/src/components/applicationReview/handledView/HandledView.tsx +++ b/frontend/benefit/handler/src/components/applicationReview/handledView/HandledView.tsx @@ -54,24 +54,19 @@ const HandledView: React.FC = ({ data }) => { )} {data.status === APPLICATION_STATUSES.ACCEPTED && - dateRangeRows.length === helsinkiBenefitMonthlyRows.length && - dateRangeRows.map((row, index) => ( + helsinkiBenefitMonthlyRows.map((row, index) => ( <$HandledRow key={row.id}> <$GridCell $colSpan={9} $colStart={1}> <$ViewField large> {t(`${translationsBase}.common.dateRange`, { - dateRange: row.descriptionFi.toLocaleLowerCase(), + dateRange: + dateRangeRows[index]?.descriptionFi.toLocaleLowerCase(), })} <$GridCell $colSpan={2}> <$ViewFieldBold large> - {formatFloatToCurrency( - helsinkiBenefitMonthlyRows[index].amount, - 'EUR', - 'fi-FI', - 0 - )} + {formatFloatToCurrency(row.amount, 'EUR', 'fi-FI', 0)} {t('common:utility.perMonth')}