diff --git a/libs/application/templates/rental-agreement/src/fields/Summary/ApplicantsRepresentativesSummary.tsx b/libs/application/templates/rental-agreement/src/fields/Summary/ApplicantsRepresentativesSummary.tsx index 094134e95bc2..1d5d8e767388 100644 --- a/libs/application/templates/rental-agreement/src/fields/Summary/ApplicantsRepresentativesSummary.tsx +++ b/libs/application/templates/rental-agreement/src/fields/Summary/ApplicantsRepresentativesSummary.tsx @@ -41,9 +41,9 @@ export const ApplicantsRepresentativesSummary = ({ answers }: Props) => { - {landlordRepresentatives.map((landlordRep) => { + {landlordRepresentatives.map((landlordRep, index) => { return ( - + { - {tenantRepresentatives.map((tenantRep) => { + {tenantRepresentatives.map((tenantRep, index) => { return ( - + { : formatMessage(summary.landlordsHeader) } > - {landlordListWithoutRepresentatives.map((landlord) => { + {landlordListWithoutRepresentatives.map((landlord, index) => { return ( - + { : formatMessage(summary.tenantsHeader) } > - {tenantListWithoutRepresentatives.map((tenant) => { + {tenantListWithoutRepresentatives.map((tenant, index) => { return ( - + { /> - + { const { formatMessage } = useLocale() const propertyType = (answer: string) => { - const options = getPropertyCategoryTypeOptions() + const options = getPropertyTypeOptions() + const matchingOption = options.find((option) => option.value === answer) + return matchingOption ? matchingOption.label : '-' + } + + const propertyClass = (answer: string) => { + const options = getPropertyClassOptions() const matchingOption = options.find((option) => option.value === answer) return matchingOption ? matchingOption.label : '-' } - const propertyCategory = (answer: string) => { - const options = getPropertyCategoryClassOptions() + const propertyClassGroup = (answer: string) => { + const options = getPropertyClassGroupOptions() const matchingOption = options.find((option) => option.value === answer) return matchingOption ? matchingOption.label : '-' } @@ -60,16 +70,29 @@ export const PropertyInfoSummary = ({ answers }: Props) => { - + + {answers.registerProperty.categoryClass === + RentalHousingCategoryClass.SPECIAL_GROUPS && + answers.registerProperty.categoryClassGroup && ( + + + + )} diff --git a/libs/application/templates/rental-agreement/src/fields/Summary/RentalInfoSummary.tsx b/libs/application/templates/rental-agreement/src/fields/Summary/RentalInfoSummary.tsx index dddb2ce63b04..3c4949672a14 100644 --- a/libs/application/templates/rental-agreement/src/fields/Summary/RentalInfoSummary.tsx +++ b/libs/application/templates/rental-agreement/src/fields/Summary/RentalInfoSummary.tsx @@ -179,23 +179,6 @@ export const RentalInfoSummary = ({ answers }: Props) => { )} - - {/* - - - - - - - - - */} ) } diff --git a/libs/application/templates/rental-agreement/src/fields/Summary/TenantInfoSummary.tsx b/libs/application/templates/rental-agreement/src/fields/Summary/TenantInfoSummary.tsx index a8cd6bbc15bf..ba81b0df136a 100644 --- a/libs/application/templates/rental-agreement/src/fields/Summary/TenantInfoSummary.tsx +++ b/libs/application/templates/rental-agreement/src/fields/Summary/TenantInfoSummary.tsx @@ -44,7 +44,10 @@ export const TenantInfoSummary = ({ answers }: Props) => { /> - + { - const { propertyCategoryClassOptions } = - getApplicationAnswers(answers) + const { propertyClassOptions } = getApplicationAnswers(answers) return ( - propertyCategoryClassOptions === - RentalHousingCategoryClass.SPECIAL_GROUPS + propertyClassOptions === RentalHousingCategoryClass.SPECIAL_GROUPS ) }, - options: getPropertyCategoryClassGroupOptions(), + options: getPropertyClassGroupOptions(), }), ], }), diff --git a/libs/application/templates/rental-agreement/src/forms/rentalPeriod/rentalPeriodDetails.ts b/libs/application/templates/rental-agreement/src/forms/rentalPeriod/rentalPeriodDetails.ts index 67aa65e8fe03..268007f7b5e5 100644 --- a/libs/application/templates/rental-agreement/src/forms/rentalPeriod/rentalPeriodDetails.ts +++ b/libs/application/templates/rental-agreement/src/forms/rentalPeriod/rentalPeriodDetails.ts @@ -19,8 +19,6 @@ const rentalPeriodIsDefinite = (answers: FormValue) => { return rentalPeriodDefinite && rentalPeriodDefinite.includes(TRUE) } -console.log('RentalPeriodIsDefinite: ', rentalPeriodIsDefinite) - export const RentalPeriodDetails = buildSubSection({ id: 'rentalPeriod', title: rentalPeriod.subSectionName, diff --git a/libs/application/templates/rental-agreement/src/lib/messages/summary.ts b/libs/application/templates/rental-agreement/src/lib/messages/summary.ts index bf6879e0f67e..030bbc2e85d1 100644 --- a/libs/application/templates/rental-agreement/src/lib/messages/summary.ts +++ b/libs/application/templates/rental-agreement/src/lib/messages/summary.ts @@ -166,10 +166,15 @@ export const summary = defineMessages({ defaultMessage: 'Fermetrar', description: 'Property size label', }, - propertyCategoryLabel: { - id: 'ra.application:summary.propertyCategoryLabel', + propertyClassLabel: { + id: 'ra.application:summary.propertyClassLabel', defaultMessage: 'Flokkun húsnæðis', - description: 'Property category label', + description: 'Property classification label', + }, + propertyClassGroupLabel: { + id: 'ra.application:summary.propertyClassGroupLabel', + defaultMessage: 'Hópur', + description: 'Property classification group label', }, propertyDescriptionLabel: { id: 'ra.application:summary.propertyDescriptionLabel', diff --git a/libs/application/templates/rental-agreement/src/lib/utils.ts b/libs/application/templates/rental-agreement/src/lib/utils.ts index b4fd8414f5e5..88fee7347e1a 100644 --- a/libs/application/templates/rental-agreement/src/lib/utils.ts +++ b/libs/application/templates/rental-agreement/src/lib/utils.ts @@ -32,17 +32,15 @@ export const formatCurrency = (answer: string) => answer.replace(/\B(?=(\d{3})+(?!\d))/g, '.') + ' ISK' export const getApplicationAnswers = (answers: Application['answers']) => { - const propertyCategoryTypeOptions = - getValueViaPath( - answers, - 'registerProperty.categoryType', - ) + const propertyTypeOptions = getValueViaPath( + answers, + 'registerProperty.categoryType', + ) - const propertyCategoryClassOptions = - getValueViaPath( - answers, - 'registerProperty.categoryClass', - ) + const propertyClassOptions = getValueViaPath( + answers, + 'registerProperty.categoryClass', + ) const inspectorOptions = getValueViaPath( answers, @@ -77,8 +75,8 @@ export const getApplicationAnswers = (answers: Application['answers']) => { ) return { - propertyCategoryTypeOptions, - propertyCategoryClassOptions, + propertyTypeOptions, + propertyClassOptions, inspectorOptions, rentalAmountIndexTypesOptions, rentalAmountPaymentDateOptions, @@ -88,7 +86,7 @@ export const getApplicationAnswers = (answers: Application['answers']) => { } } -export const getPropertyCategoryTypeOptions = () => [ +export const getPropertyTypeOptions = () => [ { value: RentalHousingCategoryTypes.ENTIRE_HOME, label: m.registerProperty.category.typeSelectLabelEntireHome, @@ -103,7 +101,7 @@ export const getPropertyCategoryTypeOptions = () => [ }, ] -export const getPropertyCategoryClassOptions = () => [ +export const getPropertyClassOptions = () => [ { value: RentalHousingCategoryClass.GENERAL_MARKET, label: m.registerProperty.category.classSelectLabelGeneralMarket, @@ -114,7 +112,7 @@ export const getPropertyCategoryClassOptions = () => [ }, ] -export const getPropertyCategoryClassGroupOptions = () => [ +export const getPropertyClassGroupOptions = () => [ { value: RentalHousingCategoryClassGroup.STUDENT_HOUSING, label: m.registerProperty.category.classGroupSelectLabelStudentHousing,