diff --git a/apps/web/screens/Organization/SocialInsuranceAdministration/PensionCalculator.tsx b/apps/web/screens/Organization/SocialInsuranceAdministration/PensionCalculator.tsx index 0641c14ad711..e85847b07997 100644 --- a/apps/web/screens/Organization/SocialInsuranceAdministration/PensionCalculator.tsx +++ b/apps/web/screens/Organization/SocialInsuranceAdministration/PensionCalculator.tsx @@ -437,6 +437,8 @@ const PensionCalculator: CustomScreen = ({ const maxTaxCardRatio: number = customPageData?.configJson?.maxTaxCardRatio ?? 100 + const isTurnedOff = customPageData?.configJson?.isTurnedOff ?? true + return ( = ({ customPageData?.configJson?.indexableBySearchEngine ?? false } > - -
- - - - - - - - - {title} - - - - - - - {formatMessage(translationStrings.introduction)} - - - - - { - if (option) { - setDateOfCalculations(option.value) - } - }} - /> - - - - - - - - - - - + {isTurnedOff && ( + + + + + + + {title} + + {formatMessage(translationStrings.isTurnedOff)} + + + + + + )} + {!isTurnedOff && ( + + + - - {hasStartDate(typeOfBasePension) && ( - - - - {formatMessage( - translationStrings.startOfPaymentsHeading, - )} - - - - - - {formatMessage( - translationStrings.startOfPaymentsDescription, - )} - - + + + + + {title} + + + + + + + {formatMessage(translationStrings.introduction)} + + - - - {formatMessage( - translationStrings.birthMonthAndYearDescription, - )} - - + + { + if (option) { + setDateOfCalculations(option.value) + } + }} + /> + + + + + + + + + - - - { - if (option.value > 10) { - methods.setValue('startMonth', 0) - if (startYear) { - methods.setValue( - 'startYear', - startYear + 1, - ) - } - } else { - methods.setValue( - 'startMonth', - option.value + 1, - ) - } - }} - /> - - - + + + + + {hasStartDate(typeOfBasePension) && ( + + + + {formatMessage( + translationStrings.startOfPaymentsHeading, )} - onSelect={(option) => { - methods.setValue( - 'startYear', - option.value + defaultPensionAge, - ) - }} - /> + - - {startYearOptions?.length > 0 && ( {formatMessage( - translationStrings.startMonthAndYearDescription, - { - month: - activeLocale !== 'en' - ? lowercaseFirstLetter( - defaultStartMonthLabel, - ) - : defaultStartMonthLabel, - year: startYearOptions?.[2]?.label, - }, + translationStrings.startOfPaymentsDescription, )} - )} - {typeof birthMonth === 'number' && - typeof birthYear === 'number' && ( - - - - - - - - - )} - - {typeof monthOffset === 'number' && - monthOffset !== 0 && ( + {formatMessage( - monthOffset > 0 - ? translationStrings.pensionStartIsDelayed - : translationStrings.pensionStartIsHurried, - { - monthAmount: `${Math.abs(monthOffset)} ${ - activeLocale === 'is' ? 'mánuð' : 'month' - }${ - Math.abs(monthOffset) !== 1 - ? activeLocale === 'is' - ? 'i' - : 's' - : '' - }`, - }, + translationStrings.birthMonthAndYearDescription, )} + + + + + { + if (option.value > 10) { + methods.setValue('startMonth', 0) + if (startYear) { + methods.setValue( + 'startYear', + startYear + 1, + ) + } + } else { + methods.setValue( + 'startMonth', + option.value + 1, + ) + } + }} + /> + + + { + methods.setValue( + 'startYear', + option.value + defaultPensionAge, + ) + }} + /> + + + + {startYearOptions?.length > 0 && ( + + + {formatMessage( + translationStrings.startMonthAndYearDescription, + { + month: + activeLocale !== 'en' + ? lowercaseFirstLetter( + defaultStartMonthLabel, + ) + : defaultStartMonthLabel, + year: startYearOptions?.[2]?.label, + }, + )} + + )} - - )} - - {formatMessage( - translationStrings.yourCircumstancesHeading, - )} - - - - - + + + + + + + )} - options={hasSpouseOptions} - /> - - - + {formatMessage( + monthOffset > 0 + ? translationStrings.pensionStartIsDelayed + : translationStrings.pensionStartIsHurried, + { + monthAmount: `${Math.abs(monthOffset)} ${ + activeLocale === 'is' + ? 'mánuð' + : 'month' + }${ + Math.abs(monthOffset) !== 1 + ? activeLocale === 'is' + ? 'i' + : 's' + : '' + }`, + }, + )} + )} - options={livingConditionOptions} - /> - + + )} + + {formatMessage( + translationStrings.yourCircumstancesHeading, + )} + - - - + + + + + - {(typeOfBasePension === BasePensionType.Disability || - typeOfBasePension === - BasePensionType.Rehabilitation) && ( - - )} - - {!hasDisabilityAssessment(typeOfBasePension) && ( - - - {formatMessage( - translationStrings.hasLivedAbroadLabel, - )} - + - - { - setHasLivedAbroad(false) - methods.setValue( - 'livingConditionAbroadInYears', - null, - ) - }} - label={formatMessage( - translationStrings.hasLivedAbroadNo, - )} - /> - { - setHasLivedAbroad(true) - }} - label={formatMessage( - translationStrings.hasLivedAbroadYes, - )} - /> - + - {hasLivedAbroad && ( + {(typeOfBasePension === + BasePensionType.Disability || + typeOfBasePension === + BasePensionType.Rehabilitation) && ( { - if ( - Number(value) > - maxLivingConditionAbroadInYears - ) { - value = String( - maxLivingConditionAbroadInYears, - ) - } - return `${value} ${formatMessage( - translationStrings.yearsSuffix, - )}` - }} /> )} - )} - - - - { - if (Number(value) > maxTaxCardRatio) { - value = String(maxTaxCardRatio) - } - return `${value}%` - }} - /> - - - - - - {formatMessage(translationStrings.mainIncomeHeading)} - - - - {formatMessage(translationStrings.incomeDisclaimer)} - - - - - {formatMessage( - translationStrings.incomeBeforeTaxHeading, - )} - - - - ( - - + {!hasDisabilityAssessment(typeOfBasePension) && ( + + + {formatMessage( + translationStrings.hasLivedAbroadLabel, + )} + + + { - onChange(PeriodIncomeType.Month) + setHasLivedAbroad(false) + methods.setValue( + 'livingConditionAbroadInYears', + null, + ) }} label={formatMessage( - translationStrings.typeOfPeriodIncomeMonthLabel, + translationStrings.hasLivedAbroadNo, )} /> - - { - onChange(PeriodIncomeType.Year) + setHasLivedAbroad(true) }} label={formatMessage( - translationStrings.typeOfPeriodIncomeYearLabel, + translationStrings.hasLivedAbroadYes, )} /> - - - )} - /> - - - - {formatMessage(translationStrings.amountDisclaimer)} - - - - - - - - + + - - - + { + if ( + Number(value) > + maxLivingConditionAbroadInYears + ) { + value = String( + maxLivingConditionAbroadInYears, + ) + } + return `${value} ${formatMessage( + translationStrings.yearsSuffix, + )}` + }} + /> + )} - placeholder="kr." - currency={true} - maxLength={currencyInputMaxLength} - /> - - - - )} - description={formatMessage( - translationStrings.privatePensionPaymentsDescription, - )} - > - - - - - - - - - + + + { + if (Number(value) > maxTaxCardRatio) { + value = String(maxTaxCardRatio) + } + return `${value}%` + }} + /> + + + - - - - - + + {formatMessage(translationStrings.mainIncomeHeading)} + - - - - - + + {formatMessage(translationStrings.incomeDisclaimer)} + + + + + {formatMessage( + translationStrings.incomeBeforeTaxHeading, + )} + - - ( + + + { + onChange(PeriodIncomeType.Month) + }} + label={formatMessage( + translationStrings.typeOfPeriodIncomeMonthLabel, + )} + /> + + + { + onChange(PeriodIncomeType.Year) + }} + label={formatMessage( + translationStrings.typeOfPeriodIncomeYearLabel, + )} + /> + + )} - placeholder="kr." - currency={true} - maxLength={currencyInputMaxLength} /> - + + + {formatMessage(translationStrings.amountDisclaimer)} + - - - - - + + + + + + - - - {formatMessage(translationStrings.disclaimer)} - - + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {formatMessage(translationStrings.disclaimer)} + + + + + - - - - - - -
-
+ + + + + + + + )}
) } diff --git a/apps/web/screens/Organization/SocialInsuranceAdministration/PensionCalculatorResults.tsx b/apps/web/screens/Organization/SocialInsuranceAdministration/PensionCalculatorResults.tsx index de4a3a81ddd2..c91b1984915a 100644 --- a/apps/web/screens/Organization/SocialInsuranceAdministration/PensionCalculatorResults.tsx +++ b/apps/web/screens/Organization/SocialInsuranceAdministration/PensionCalculatorResults.tsx @@ -268,6 +268,8 @@ const PensionCalculatorResults: CustomScreen = ({ const higlightedItemIsPresent = highlightedItems.length > 0 + const isTurnedOff = customPageData?.configJson?.isTurnedOff ?? false + return ( <> @@ -278,96 +280,53 @@ const PensionCalculatorResults: CustomScreen = ({ ogImageUrl={organizationPage.featuredImage?.url} indexableBySearchEngine={false} > - - - - - - + {isTurnedOff && ( + + + + + {title} - - - {formatMessage(translationStrings.resultDisclaimer)} - - + + {formatMessage(translationStrings.isTurnedOff)} + - {higlightedItemIsPresent && ( - - - - - - } - /> - )} - - - - - - - {!calculationIsPresent && ( - - )} - - {calculationIsPresent && ( - - - - - - - - - - - + + + + + )} - + {!isTurnedOff && ( + + + + + + + + {title} + + + + {formatMessage(translationStrings.resultDisclaimer)} + + + + {higlightedItemIsPresent && ( + = ({ - - - - )} - - - - - + } + /> + )} + + + + + + + {!calculationIsPresent && ( + + )} + + {calculationIsPresent && ( + + + + + + + + + + + + + + + + + + + + + )} + + + + + + )} diff --git a/apps/web/screens/Organization/SocialInsuranceAdministration/translationStrings.ts b/apps/web/screens/Organization/SocialInsuranceAdministration/translationStrings.ts index b53f71660b27..9f0e6098d253 100644 --- a/apps/web/screens/Organization/SocialInsuranceAdministration/translationStrings.ts +++ b/apps/web/screens/Organization/SocialInsuranceAdministration/translationStrings.ts @@ -1,6 +1,11 @@ import { defineMessages } from 'react-intl' export const translationStrings = defineMessages({ + isTurnedOff: { + id: 'web.pensionCalculator:isTurnedOff', + defaultMessage: 'Reiknivélin er ekki virk að svo stöddu', + description: 'Upplýsingar efst á fyrstu síðu ef slökkt er á reiknivél', + }, introduction: { id: 'web.pensionCalculator:introduction#markdown', defaultMessage: