From 85ce395b68d9e4971c311fa65599f40a9f440af1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eir=C3=ADkur=20Hei=C3=B0ar=20Nilsson?= Date: Fri, 17 May 2024 13:48:44 +0000 Subject: [PATCH 1/2] chore(clients): Fix NX cache for university-careers (#14849) Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> --- libs/clients/university-careers/project.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/clients/university-careers/project.json b/libs/clients/university-careers/project.json index 93674067ed9c..212b9fc5db50 100644 --- a/libs/clients/university-careers/project.json +++ b/libs/clients/university-careers/project.json @@ -55,7 +55,7 @@ "yarn openapi-generator -o libs/clients/university-careers/src/lib/clients/university-of-iceland/gen/fetch -i libs/clients/university-careers/src/lib/clients/university-of-iceland/clientConfig.yaml" ] }, - "outputs": ["{projectRoot}/gen/fetch"] + "outputs": ["{projectRoot}/**/gen/fetch"] } }, "tags": ["lib:client", "scope:client"] From c83a658b69529a219bce79e622c8b7447e338af3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B3n=20Ingi?= <42949613+joningi98@users.noreply.github.com> Date: Fri, 17 May 2024 15:14:45 +0000 Subject: [PATCH 2/2] fix(inheritance-report): Assets validation (#14836) * Update error msg * remove placeholder on update * Update asset number validation * Update regex --- .../src/fields/AssetsRepeater/index.tsx | 1 + .../templates/inheritance-report/src/lib/dataSchema.ts | 9 +++++++-- .../templates/inheritance-report/src/lib/messages.ts | 3 ++- .../inheritance-report/src/lib/utils/helpers.ts | 2 +- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/libs/application/templates/inheritance-report/src/fields/AssetsRepeater/index.tsx b/libs/application/templates/inheritance-report/src/fields/AssetsRepeater/index.tsx index c163ac35ffea..f075d9dd8224 100644 --- a/libs/application/templates/inheritance-report/src/fields/AssetsRepeater/index.tsx +++ b/libs/application/templates/inheritance-report/src/fields/AssetsRepeater/index.tsx @@ -435,6 +435,7 @@ const RealEstateNumberField = ({ label={formatMessage(m.propertyNumber)} defaultValue={propertyNumberInput} error={error ? formatMessage(m.errorPropertyNumber) : undefined} + placeholder={propertyNumberInput > 0 ? '' : props.field.placeholder} {...props} /> ) diff --git a/libs/application/templates/inheritance-report/src/lib/dataSchema.ts b/libs/application/templates/inheritance-report/src/lib/dataSchema.ts index c11942cdf86e..60128a998ceb 100644 --- a/libs/application/templates/inheritance-report/src/lib/dataSchema.ts +++ b/libs/application/templates/inheritance-report/src/lib/dataSchema.ts @@ -35,7 +35,12 @@ const validateDeceasedShare = ({ } const validateAssetNumber = (assetNumber: string) => { - const assetNumberPattern = /^(F\d{3}-\d{4}|\d{7}|\d{3}-\d{4}|F\d{7})$/ + const assetNumberPattern = /^[Ff]{0,1}\d{7}$|^[Ll]{0,1}\d{6}$/ + return assetNumberPattern.test(assetNumber) +} + +const validateDebtBankAccount = (assetNumber: string) => { + const assetNumberPattern = /^\d{4}-\d{2}-\d{6}|\d{12}$/ return assetNumberPattern.test(assetNumber) } @@ -313,7 +318,7 @@ export const inheritanceReportSchema = z.object({ .object({ description: z.string(), nationalId: z.string(), - assetNumber: z.string(), + assetNumber: z.string().refine((v) => validateDebtBankAccount(v)), propertyValuation: z.string(), }) .refine( diff --git a/libs/application/templates/inheritance-report/src/lib/messages.ts b/libs/application/templates/inheritance-report/src/lib/messages.ts index 84abc26d0423..8aa6d9515554 100644 --- a/libs/application/templates/inheritance-report/src/lib/messages.ts +++ b/libs/application/templates/inheritance-report/src/lib/messages.ts @@ -1469,7 +1469,8 @@ export const m = defineMessages({ // Error messages errorPropertyNumber: { id: 'es.application:error.errorPropertyNumber', - defaultMessage: 'Verður að innihalda L og 6 tölustafi eða F og 7 tölustafi', + defaultMessage: + 'Verður að innihalda 6 tölustafi eða L + 6 fyrir landeignanúmeri, 7 tölustafi, F + 7 fyrir fasteignanúmeri', description: 'Property number is invalid', }, }) diff --git a/libs/application/templates/inheritance-report/src/lib/utils/helpers.ts b/libs/application/templates/inheritance-report/src/lib/utils/helpers.ts index f6d610ce9d09..d09229d172a0 100644 --- a/libs/application/templates/inheritance-report/src/lib/utils/helpers.ts +++ b/libs/application/templates/inheritance-report/src/lib/utils/helpers.ts @@ -84,7 +84,7 @@ export const valueToNumber = (value: unknown, delimiter = '.'): number => { } export const isValidRealEstate = (value: string) => { - const assetNumberPattern = /^(F\d{3}-\d{4}|\d{7}|\d{3}-\d{4}|F\d{7})$/ + const assetNumberPattern = /^[Ff]{0,1}\d{7}$|^[Ll]{0,1}\d{6}$/ return assetNumberPattern.test(value) }