From 61f7f170f2e6518ce923fd27b20531f71425870d Mon Sep 17 00:00:00 2001 From: Gunnar K Vilbergsson Date: Fri, 13 Dec 2024 13:15:01 +0000 Subject: [PATCH] Cleanup types --- .../reference-template/src/forms/ExampleForm.ts | 4 ++-- libs/application/types/src/lib/Fields.ts | 6 ++---- .../NationalIdWithName/NationalIdWithName.tsx | 14 +++++++------- 3 files changed, 11 insertions(+), 13 deletions(-) diff --git a/libs/application/templates/reference-template/src/forms/ExampleForm.ts b/libs/application/templates/reference-template/src/forms/ExampleForm.ts index 6af24b5a8d80..db8e48b6b621 100644 --- a/libs/application/templates/reference-template/src/forms/ExampleForm.ts +++ b/libs/application/templates/reference-template/src/forms/ExampleForm.ts @@ -51,9 +51,9 @@ export const ExampleForm: Form = buildForm({ phoneLabel: 'Símanúmer', emailLabel: 'Netfang', required: true, - phone: true, + showPhoneField: true, phoneRequired: true, - email: true, + showEmailField: true, emailRequired: true, }, }, diff --git a/libs/application/types/src/lib/Fields.ts b/libs/application/types/src/lib/Fields.ts index b440d40bcbe5..03d69a60a3a4 100644 --- a/libs/application/types/src/lib/Fields.ts +++ b/libs/application/types/src/lib/Fields.ts @@ -101,9 +101,9 @@ export type RepeaterItem = { activeField?: Record, ) => boolean dataTestId?: string - phone?: boolean + showPhoneField?: boolean phoneRequired?: boolean - email?: boolean + showEmailField?: boolean emailRequired?: boolean readonly?: | boolean @@ -627,8 +627,6 @@ export type TableRepeaterField = BaseField & { marginBottom?: ResponsiveProp titleVariant?: TitleVariants fields: Record - phone?: boolean - email?: boolean /** * Maximum rows that can be added to the table. * When the maximum is reached, the button to add a new row is disabled. diff --git a/libs/application/ui-components/src/components/NationalIdWithName/NationalIdWithName.tsx b/libs/application/ui-components/src/components/NationalIdWithName/NationalIdWithName.tsx index e6e215b472df..a53a4584c0a6 100644 --- a/libs/application/ui-components/src/components/NationalIdWithName/NationalIdWithName.tsx +++ b/libs/application/ui-components/src/components/NationalIdWithName/NationalIdWithName.tsx @@ -40,8 +40,8 @@ interface NationalIdWithNameProps { minAgePerson?: number searchPersons?: boolean searchCompanies?: boolean - phone?: boolean - email?: boolean + showPhoneField?: boolean + showEmailField?: boolean error?: string } @@ -69,8 +69,8 @@ export const NationalIdWithName: FC< minAgePerson, searchPersons = true, searchCompanies = false, - phone = false, - email = false, + showPhoneField = false, + showEmailField = false, error, }) => { const fieldId = customId.length > 0 ? customId : id @@ -269,9 +269,9 @@ export const NationalIdWithName: FC< /> - {(phone || email) && ( + {(showPhoneField || showEmailField) && ( - {phone && ( + {showPhoneField && ( )} - {email && ( + {showEmailField && (