From 7cf3e27e8204983a32f693e37fd0c48ff9adc586 Mon Sep 17 00:00:00 2001 From: Jonni Date: Fri, 20 Sep 2024 13:25:16 +0000 Subject: [PATCH] fix: failed test and coderabbit --- .../src/fields/DelegationCheck/DelegationCheck.tsx | 2 -- .../src/fields/ElectionStatement/ElectionStatement.tsx | 4 ++-- .../src/fields/Overview/Overview.tsx | 2 +- .../src/fields/PartyOverview/PartyOverview.tsx | 2 +- .../src/utils/helpers.ts | 8 +------- 5 files changed, 5 insertions(+), 13 deletions(-) diff --git a/libs/application/templates/inao/financial-statement-political-party/src/fields/DelegationCheck/DelegationCheck.tsx b/libs/application/templates/inao/financial-statement-political-party/src/fields/DelegationCheck/DelegationCheck.tsx index 35c37a2785f4..79510986f3c2 100644 --- a/libs/application/templates/inao/financial-statement-political-party/src/fields/DelegationCheck/DelegationCheck.tsx +++ b/libs/application/templates/inao/financial-statement-political-party/src/fields/DelegationCheck/DelegationCheck.tsx @@ -20,8 +20,6 @@ export const DelegationCheck = ({ const userType = application.externalData.getUserType?.data const hasUserType = !!userType - console.log('UserType: ', userType) - if (hasUserType) { setError(VALIDATOR, { type: 'custom', diff --git a/libs/application/templates/inao/financial-statement-political-party/src/fields/ElectionStatement/ElectionStatement.tsx b/libs/application/templates/inao/financial-statement-political-party/src/fields/ElectionStatement/ElectionStatement.tsx index 88d22e04082f..89b4df521eaa 100644 --- a/libs/application/templates/inao/financial-statement-political-party/src/fields/ElectionStatement/ElectionStatement.tsx +++ b/libs/application/templates/inao/financial-statement-political-party/src/fields/ElectionStatement/ElectionStatement.tsx @@ -32,9 +32,9 @@ export const ElectionStatement = ({ const incomeLimit = getValueViaPath(answers, 'election.incomeLimit') if (incomeLimit === GREATER) { - goToScreen && goToScreen('attachments.file') + goToScreen?.('attachments.file') } else { - goToScreen && goToScreen('election') + goToScreen?.('election') } } diff --git a/libs/application/templates/inao/financial-statement-political-party/src/fields/Overview/Overview.tsx b/libs/application/templates/inao/financial-statement-political-party/src/fields/Overview/Overview.tsx index ff08d8d1d5d9..ac8d35ebf541 100644 --- a/libs/application/templates/inao/financial-statement-political-party/src/fields/Overview/Overview.tsx +++ b/libs/application/templates/inao/financial-statement-political-party/src/fields/Overview/Overview.tsx @@ -24,7 +24,7 @@ import { sectionColumn, starterColumnStyle, } from '../../components/css/overviewStyles.css' -import { CapitalNumberOverview } from '../../components/CApitalNumberOverview' +import { CapitalNumberOverview } from '../../components/CapitalNumberOverview' import { AssetDebtEquityOverview } from '../../components/AssetDebtEquityOverview' import { FileValueLine } from '../../components/FileValueLine' diff --git a/libs/application/templates/inao/financial-statement-political-party/src/fields/PartyOverview/PartyOverview.tsx b/libs/application/templates/inao/financial-statement-political-party/src/fields/PartyOverview/PartyOverview.tsx index 460888bcbbc9..0686562e1af4 100644 --- a/libs/application/templates/inao/financial-statement-political-party/src/fields/PartyOverview/PartyOverview.tsx +++ b/libs/application/templates/inao/financial-statement-political-party/src/fields/PartyOverview/PartyOverview.tsx @@ -26,7 +26,7 @@ import { sectionColumn, starterColumnStyle, } from '../../components/css/overviewStyles.css' -import { CapitalNumberOverview } from '../../components/CApitalNumberOverview' +import { CapitalNumberOverview } from '../../components/CapitalNumberOverview' export const PartyOverview = ({ application, diff --git a/libs/application/templates/inao/financial-statement-political-party/src/utils/helpers.ts b/libs/application/templates/inao/financial-statement-political-party/src/utils/helpers.ts index 73270de8b10c..82ac09edeb37 100644 --- a/libs/application/templates/inao/financial-statement-political-party/src/utils/helpers.ts +++ b/libs/application/templates/inao/financial-statement-political-party/src/utils/helpers.ts @@ -41,10 +41,4 @@ export const formatCurrency = (answer: string) => export const formatNumber = (num: number) => num.toLocaleString('de-DE') -export const checkIfNegative = (inputNumber: string) => { - if (Number(inputNumber) < 0) { - return false - } else { - return true - } -} +export const checkIfNegative = (inputNumber: string) => Number(inputNumber) >= 0