From 37fe92be86722e95ff07f0ea2d18145c8b81793e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=9E=C3=B3rey=20J=C3=B3na?= Date: Thu, 12 Dec 2024 14:09:20 +0000 Subject: [PATCH 01/14] fix(native-app): Android build fixes (#17211) * fix: import for gradle-plugin * fix: update import for react-native-clipboard as well * fix: update build.gradle imports * fix: update reanimated * fix: add folder references to build.gradle * fix: remove react native clipboard from settings.gradle * fix(app): Use dev firebase in for dev android app * fix: remove added newline --------- Co-authored-by: Eirikur Nilsson Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> --- apps/native/app/android/app/build.gradle | 6 +- apps/native/app/android/build.gradle | 4 +- apps/native/app/android/settings.gradle | 5 +- apps/native/app/package.json | 2 +- codemagic.yaml | 2 +- yarn.lock | 184 ++++++++++++++++++++++- 6 files changed, 186 insertions(+), 17 deletions(-) diff --git a/apps/native/app/android/app/build.gradle b/apps/native/app/android/app/build.gradle index a32464e07a8f..997472187673 100644 --- a/apps/native/app/android/app/build.gradle +++ b/apps/native/app/android/app/build.gradle @@ -16,11 +16,11 @@ react { // The root of your project, i.e. where "package.json" lives. Default is '..' // root = file("../") // The folder where the react-native NPM package is. Default is ../node_modules/react-native - // reactNativeDir = file("../node_modules/react-native") + reactNativeDir = file("../../../../../node_modules/react-native") // The folder where the react-native Codegen package is. Default is ../node_modules/@react-native/codegen - // codegenDir = file("../node_modules/@react-native/codegen") + codegenDir = file("../../../../../node_modules/@react-native/codegen") // The cli.js file which is the React Native CLI entrypoint. Default is ../node_modules/react-native/cli.js - // cliFile = file("../node_modules/react-native/cli.js") + cliFile = file("../../../../../node_modules/react-native/cli.js") /* Variants */ // The list of variants to that are debuggable. For those we're going to diff --git a/apps/native/app/android/build.gradle b/apps/native/app/android/build.gradle index 46f7b30a85d0..06110e23ae99 100644 --- a/apps/native/app/android/build.gradle +++ b/apps/native/app/android/build.gradle @@ -33,11 +33,11 @@ allprojects { repositories { maven { // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm - url("$rootDir/../node_modules/react-native/android") + url("$rootDir/../../../../../node_modules/react-native/android") } maven { // Android JSC is installed from npm - url("$rootDir/../node_modules/jsc-android/dist") + url("$rootDir/../../../../../node_modules/jsc-android/dist") } mavenCentral { // We don't want to fetch react-native from Maven Central as there are diff --git a/apps/native/app/android/settings.gradle b/apps/native/app/android/settings.gradle index 12979ce6cda2..d9655025ec45 100644 --- a/apps/native/app/android/settings.gradle +++ b/apps/native/app/android/settings.gradle @@ -6,11 +6,8 @@ applyNativeModulesSettingsGradle(settings) include ':app', ':react-native-code-push' project(':react-native-code-push').projectDir = new File(rootProject.projectDir, '../../../../node_modules/react-native-code-push/android/app') -include ':react-native-clipboard' -project(':react-native-clipboard').projectDir = new File(rootProject.projectDir, '../../node_modules/@react-native-clipboard/clipboard/android') - include ':app' -includeBuild('../node_modules/@react-native/gradle-plugin') +includeBuild('../../../../node_modules/@react-native/gradle-plugin') apply from: new File(["node", "--print", "require.resolve('expo/package.json')"].execute(null, rootDir).text.trim(), "../scripts/autolinking.gradle") useExpoModules() diff --git a/apps/native/app/package.json b/apps/native/app/package.json index 3ebb950c5cba..f742ee2bb587 100644 --- a/apps/native/app/package.json +++ b/apps/native/app/package.json @@ -90,7 +90,7 @@ "react-native-pdf": "6.7.5", "react-native-quick-actions": "0.3.13", "react-native-quick-base64": "2.1.2", - "react-native-reanimated": "3.12.1", + "react-native-reanimated": "3.16.5", "react-native-share": "10.2.1", "react-native-spotlight-search": "2.0.0", "react-native-svg": "15.2.0", diff --git a/codemagic.yaml b/codemagic.yaml index a0840a6144b2..e6d07bc39ad9 100644 --- a/codemagic.yaml +++ b/codemagic.yaml @@ -219,7 +219,7 @@ workflows: - island-upload-keystore groups: - google_credentials - - firebase_credentials + - firebase_credentials_dev vars: <<: *shared_envs PACKAGE_NAME: 'is.island.app.dev' diff --git a/yarn.lock b/yarn.lock index e0441eb6d923..26095abdf270 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2754,6 +2754,15 @@ __metadata: languageName: node linkType: hard +"@babel/helper-annotate-as-pure@npm:^7.25.9": + version: 7.25.9 + resolution: "@babel/helper-annotate-as-pure@npm:7.25.9" + dependencies: + "@babel/types": ^7.25.9 + checksum: 41edda10df1ae106a9b4fe617bf7c6df77db992992afd46192534f5cff29f9e49a303231733782dd65c5f9409714a529f215325569f14282046e9d3b7a1ffb6c + languageName: node + linkType: hard + "@babel/helper-builder-binary-assignment-operator-visitor@npm:^7.18.6": version: 7.18.9 resolution: "@babel/helper-builder-binary-assignment-operator-visitor@npm:7.18.9" @@ -2954,6 +2963,23 @@ __metadata: languageName: node linkType: hard +"@babel/helper-create-class-features-plugin@npm:^7.25.9": + version: 7.25.9 + resolution: "@babel/helper-create-class-features-plugin@npm:7.25.9" + dependencies: + "@babel/helper-annotate-as-pure": ^7.25.9 + "@babel/helper-member-expression-to-functions": ^7.25.9 + "@babel/helper-optimise-call-expression": ^7.25.9 + "@babel/helper-replace-supers": ^7.25.9 + "@babel/helper-skip-transparent-expression-wrappers": ^7.25.9 + "@babel/traverse": ^7.25.9 + semver: ^6.3.1 + peerDependencies: + "@babel/core": ^7.0.0 + checksum: 91dd5f203ed04568c70b052e2f26dfaac7c146447196c00b8ecbb6d3d2f3b517abadb985d3321a19d143adaed6fe17f7f79f8f50e0c20e9d8ad83e1027b42424 + languageName: node + linkType: hard + "@babel/helper-create-regexp-features-plugin@npm:^7.16.7, @babel/helper-create-regexp-features-plugin@npm:^7.17.12": version: 7.17.12 resolution: "@babel/helper-create-regexp-features-plugin@npm:7.17.12" @@ -3017,6 +3043,19 @@ __metadata: languageName: node linkType: hard +"@babel/helper-create-regexp-features-plugin@npm:^7.25.9": + version: 7.26.3 + resolution: "@babel/helper-create-regexp-features-plugin@npm:7.26.3" + dependencies: + "@babel/helper-annotate-as-pure": ^7.25.9 + regexpu-core: ^6.2.0 + semver: ^6.3.1 + peerDependencies: + "@babel/core": ^7.0.0 + checksum: 50a27d8ce6da5c2fa0c62c132c4d27cfeb36e3233ff1e5220d643de3dafe49423b507382f0b72a696fce7486014b134c1e742f55438590f9405d26765b009af0 + languageName: node + linkType: hard + "@babel/helper-define-polyfill-provider@npm:^0.3.3": version: 0.3.3 resolution: "@babel/helper-define-polyfill-provider@npm:0.3.3" @@ -3258,6 +3297,16 @@ __metadata: languageName: node linkType: hard +"@babel/helper-member-expression-to-functions@npm:^7.25.9": + version: 7.25.9 + resolution: "@babel/helper-member-expression-to-functions@npm:7.25.9" + dependencies: + "@babel/traverse": ^7.25.9 + "@babel/types": ^7.25.9 + checksum: 8e2f1979b6d596ac2a8cbf17f2cf709180fefc274ac3331408b48203fe19134ed87800774ef18838d0275c3965130bae22980d90caed756b7493631d4b2cf961 + languageName: node + linkType: hard + "@babel/helper-module-imports@npm:^7.0.0, @babel/helper-module-imports@npm:^7.16.0, @babel/helper-module-imports@npm:^7.16.7, @babel/helper-module-imports@npm:^7.18.6": version: 7.18.6 resolution: "@babel/helper-module-imports@npm:7.18.6" @@ -3452,6 +3501,15 @@ __metadata: languageName: node linkType: hard +"@babel/helper-optimise-call-expression@npm:^7.25.9": + version: 7.25.9 + resolution: "@babel/helper-optimise-call-expression@npm:7.25.9" + dependencies: + "@babel/types": ^7.25.9 + checksum: f09d0ad60c0715b9a60c31841b3246b47d67650c512ce85bbe24a3124f1a4d66377df793af393273bc6e1015b0a9c799626c48e53747581c1582b99167cc65dc + languageName: node + linkType: hard + "@babel/helper-plugin-utils@npm:^7.0.0, @babel/helper-plugin-utils@npm:^7.10.4, @babel/helper-plugin-utils@npm:^7.12.13, @babel/helper-plugin-utils@npm:^7.13.0, @babel/helper-plugin-utils@npm:^7.14.5, @babel/helper-plugin-utils@npm:^7.16.7, @babel/helper-plugin-utils@npm:^7.17.12, @babel/helper-plugin-utils@npm:^7.18.6, @babel/helper-plugin-utils@npm:^7.19.0, @babel/helper-plugin-utils@npm:^7.8.0, @babel/helper-plugin-utils@npm:^7.8.3": version: 7.19.0 resolution: "@babel/helper-plugin-utils@npm:7.19.0" @@ -3494,6 +3552,13 @@ __metadata: languageName: node linkType: hard +"@babel/helper-plugin-utils@npm:^7.25.9": + version: 7.25.9 + resolution: "@babel/helper-plugin-utils@npm:7.25.9" + checksum: e19ec8acf0b696756e6d84531f532c5fe508dce57aa68c75572a77798bd04587a844a9a6c8ea7d62d673e21fdc174d091c9097fb29aea1c1b49f9c6eaa80f022 + languageName: node + linkType: hard + "@babel/helper-remap-async-to-generator@npm:^7.18.9": version: 7.18.9 resolution: "@babel/helper-remap-async-to-generator@npm:7.18.9" @@ -3627,6 +3692,19 @@ __metadata: languageName: node linkType: hard +"@babel/helper-replace-supers@npm:^7.25.9": + version: 7.25.9 + resolution: "@babel/helper-replace-supers@npm:7.25.9" + dependencies: + "@babel/helper-member-expression-to-functions": ^7.25.9 + "@babel/helper-optimise-call-expression": ^7.25.9 + "@babel/traverse": ^7.25.9 + peerDependencies: + "@babel/core": ^7.0.0 + checksum: 84f40e12520b7023e52d289bf9d569a06284879fe23bbbacad86bec5d978b2669769f11b073fcfeb1567d8c547168323005fda88607a4681ecaeb4a5cdd48bb9 + languageName: node + linkType: hard + "@babel/helper-simple-access@npm:^7.18.2, @babel/helper-simple-access@npm:^7.18.6": version: 7.19.4 resolution: "@babel/helper-simple-access@npm:7.19.4" @@ -3710,6 +3788,16 @@ __metadata: languageName: node linkType: hard +"@babel/helper-skip-transparent-expression-wrappers@npm:^7.25.9": + version: 7.25.9 + resolution: "@babel/helper-skip-transparent-expression-wrappers@npm:7.25.9" + dependencies: + "@babel/traverse": ^7.25.9 + "@babel/types": ^7.25.9 + checksum: fdbb5248932198bc26daa6abf0d2ac42cab9c2dbb75b7e9f40d425c8f28f09620b886d40e7f9e4e08ffc7aaa2cefe6fc2c44be7c20e81f7526634702fb615bdc + languageName: node + linkType: hard + "@babel/helper-split-export-declaration@npm:^7.16.7, @babel/helper-split-export-declaration@npm:^7.18.6": version: 7.18.6 resolution: "@babel/helper-split-export-declaration@npm:7.18.6" @@ -5153,6 +5241,18 @@ __metadata: languageName: node linkType: hard +"@babel/plugin-transform-class-properties@npm:^7.0.0-0": + version: 7.25.9 + resolution: "@babel/plugin-transform-class-properties@npm:7.25.9" + dependencies: + "@babel/helper-create-class-features-plugin": ^7.25.9 + "@babel/helper-plugin-utils": ^7.25.9 + peerDependencies: + "@babel/core": ^7.0.0-0 + checksum: a8d69e2c285486b63f49193cbcf7a15e1d3a5f632c1c07d7a97f65306df7f554b30270b7378dde143f8b557d1f8f6336c643377943dec8ec405e4cd11e90b9ea + languageName: node + linkType: hard + "@babel/plugin-transform-class-properties@npm:^7.22.3": version: 7.22.3 resolution: "@babel/plugin-transform-class-properties@npm:7.22.3" @@ -5234,6 +5334,22 @@ __metadata: languageName: node linkType: hard +"@babel/plugin-transform-classes@npm:^7.0.0-0": + version: 7.25.9 + resolution: "@babel/plugin-transform-classes@npm:7.25.9" + dependencies: + "@babel/helper-annotate-as-pure": ^7.25.9 + "@babel/helper-compilation-targets": ^7.25.9 + "@babel/helper-plugin-utils": ^7.25.9 + "@babel/helper-replace-supers": ^7.25.9 + "@babel/traverse": ^7.25.9 + globals: ^11.1.0 + peerDependencies: + "@babel/core": ^7.0.0-0 + checksum: d12584f72125314cc0fa8c77586ece2888d677788ac75f7393f5da574dfe4e45a556f7e3488fab29c8777ab3e5856d7a2d79f6df02834083aaa9d766440e3c68 + languageName: node + linkType: hard + "@babel/plugin-transform-classes@npm:^7.21.0": version: 7.21.0 resolution: "@babel/plugin-transform-classes@npm:7.21.0" @@ -7372,6 +7488,18 @@ __metadata: languageName: node linkType: hard +"@babel/plugin-transform-unicode-regex@npm:^7.0.0-0": + version: 7.25.9 + resolution: "@babel/plugin-transform-unicode-regex@npm:7.25.9" + dependencies: + "@babel/helper-create-regexp-features-plugin": ^7.25.9 + "@babel/helper-plugin-utils": ^7.25.9 + peerDependencies: + "@babel/core": ^7.0.0-0 + checksum: e8baae867526e179467c6ef5280d70390fa7388f8763a19a27c21302dd59b121032568be080749514b097097ceb9af716bf4b90638f1b3cf689aa837ba20150f + languageName: node + linkType: hard + "@babel/plugin-transform-unicode-regex@npm:^7.22.5": version: 7.22.5 resolution: "@babel/plugin-transform-unicode-regex@npm:7.22.5" @@ -13522,7 +13650,7 @@ __metadata: react-native-pdf: 6.7.5 react-native-quick-actions: 0.3.13 react-native-quick-base64: 2.1.2 - react-native-reanimated: 3.12.1 + react-native-reanimated: 3.16.5 react-native-share: 10.2.1 react-native-spotlight-search: 2.0.0 react-native-svg: 15.2.0 @@ -40842,7 +40970,7 @@ __metadata: languageName: node linkType: hard -"jsesc@npm:^3.0.2": +"jsesc@npm:^3.0.2, jsesc@npm:~3.0.2": version: 3.0.2 resolution: "jsesc@npm:3.0.2" bin: @@ -49993,15 +50121,18 @@ __metadata: languageName: node linkType: hard -"react-native-reanimated@npm:3.12.1": - version: 3.12.1 - resolution: "react-native-reanimated@npm:3.12.1" +"react-native-reanimated@npm:3.16.5": + version: 3.16.5 + resolution: "react-native-reanimated@npm:3.16.5" dependencies: "@babel/plugin-transform-arrow-functions": ^7.0.0-0 + "@babel/plugin-transform-class-properties": ^7.0.0-0 + "@babel/plugin-transform-classes": ^7.0.0-0 "@babel/plugin-transform-nullish-coalescing-operator": ^7.0.0-0 "@babel/plugin-transform-optional-chaining": ^7.0.0-0 "@babel/plugin-transform-shorthand-properties": ^7.0.0-0 "@babel/plugin-transform-template-literals": ^7.0.0-0 + "@babel/plugin-transform-unicode-regex": ^7.0.0-0 "@babel/preset-typescript": ^7.16.7 convert-source-map: ^2.0.0 invariant: ^2.2.4 @@ -50009,7 +50140,7 @@ __metadata: "@babel/core": ^7.0.0-0 react: "*" react-native: "*" - checksum: 91575b3a20a5878f42d0302cf304ed46ff35c12ce717018c0bfb6af047bf675f224ab95de778daae483b139e66c5290a661635c06304065879b02a5926243e1c + checksum: 29d28dcf99acb2e3928963106a2860d15c9929712832d8d8437fb563691d0199884a63e925548fe5e4b6fc7a9008eadec3e0294b521d9466c875caf16de9c303 languageName: node linkType: hard @@ -51053,6 +51184,15 @@ __metadata: languageName: node linkType: hard +"regenerate-unicode-properties@npm:^10.2.0": + version: 10.2.0 + resolution: "regenerate-unicode-properties@npm:10.2.0" + dependencies: + regenerate: ^1.4.2 + checksum: d5c5fc13f8b8d7e16e791637a4bfef741f8d70e267d51845ee7d5404a32fa14c75b181c4efba33e4bff8b0000a2f13e9773593713dfe5b66597df4259275ce63 + languageName: node + linkType: hard + "regenerate@npm:^1.4.2": version: 1.4.2 resolution: "regenerate@npm:1.4.2" @@ -51175,6 +51315,20 @@ __metadata: languageName: node linkType: hard +"regexpu-core@npm:^6.2.0": + version: 6.2.0 + resolution: "regexpu-core@npm:6.2.0" + dependencies: + regenerate: ^1.4.2 + regenerate-unicode-properties: ^10.2.0 + regjsgen: ^0.8.0 + regjsparser: ^0.12.0 + unicode-match-property-ecmascript: ^2.0.0 + unicode-match-property-value-ecmascript: ^2.1.0 + checksum: 67d3c4a3f6c99bc80b5d690074a27e6f675be1c1739f8a9acf028fbc36f1a468472574ea65e331e217995198ba4404d7878f3cb3739a73552dd3c70d3fb7f8e6 + languageName: node + linkType: hard + "regjsgen@npm:^0.6.0": version: 0.6.0 resolution: "regjsgen@npm:0.6.0" @@ -51182,6 +51336,24 @@ __metadata: languageName: node linkType: hard +"regjsgen@npm:^0.8.0": + version: 0.8.0 + resolution: "regjsgen@npm:0.8.0" + checksum: a1d925ff14a4b2be774e45775ee6b33b256f89c42d480e6d85152d2133f18bd3d6af662161b226fa57466f7efec367eaf7ccd2a58c0ec2a1306667ba2ad07b0d + languageName: node + linkType: hard + +"regjsparser@npm:^0.12.0": + version: 0.12.0 + resolution: "regjsparser@npm:0.12.0" + dependencies: + jsesc: ~3.0.2 + bin: + regjsparser: bin/parser + checksum: 094b55b0ab3e1fd58f8ce5132a1d44dab08d91f7b0eea4132b0157b303ebb8ded20a9cbd893d25402d2aeddb23fac1f428ab4947b295d6fa51dd1c334a9e76f0 + languageName: node + linkType: hard + "regjsparser@npm:^0.8.2": version: 0.8.4 resolution: "regjsparser@npm:0.8.4" From 057fb9e7eb9df544c8a82c924a26e5551cb85a38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B3nas=20G=2E=20Sigur=C3=B0sson?= Date: Thu, 12 Dec 2024 16:11:28 +0000 Subject: [PATCH 02/14] feat(accident-notification): procure for accident notifications (#16337) * feat: start of procure for accident notifications * feat: adjust aplicantInformationMultiField for procure * fix: typo in message * chore: simplify conditions and small clean up * chore: remove unused functions * chore: remove console.log * chore: make mapUserToRole slightly cleaner * chore: more concise if statement * chore: trigger deploy-feature * chore: move constants to utils * fix: typo * feat: remove two custom components with text * chore: remove unused messages * chore: remove unused import * chore: remove comment --------- Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> --- .../src/dataProviders/index.ts | 4 + .../src/fields/AgreementDescription/index.tsx | 25 ----- .../src/fields/DateOfAccident/index.tsx | 2 +- .../descriptionWithLink.css.ts | 11 --- .../src/fields/DescriptionWithLink/index.tsx | 43 -------- .../src/fields/FormOverview/index.tsx | 2 +- .../accident-notification/src/fields/index.ts | 2 - .../attachmentsSubSection.ts | 7 +- .../locationSubSection.ts | 2 +- .../workMachineSubSection.ts | 2 +- .../applicantInformationSection.ts | 2 - .../betaTestSection.ts | 24 ----- .../agreementDescriptionMultiField.ts | 30 ------ .../externalDataSection/index.ts | 10 -- .../forms/AccidentNotificationForm/index.ts | 6 -- .../juridicialPersonCompanySubSection.ts | 2 +- .../powerOfAttorneyUploadSubSection.ts | 2 +- .../whoIsTheNotificationForMultiField.ts | 39 ++++---- .../InReviewForm/addAttachmentsSection.ts | 2 +- .../PrerequisitesForm/dataHandlingSection.ts | 30 ++++++ .../externalDataSection.ts} | 25 ++++- .../src/forms/PrerequisitesForm/index.ts | 15 +++ .../externalDataSection.ts | 43 ++++++++ .../forms/PrerequisitesProcureForm/index.ts | 15 +++ .../src/lib/AccidentNotificationTemplate.ts | 98 ++++++++++++++++--- .../src/lib/dataSchema.ts | 2 +- .../src/lib/messages/applicantInformation.ts | 12 +++ .../src/lib/messages/externalData.ts | 58 +++++------ .../lib/messages/whoIsTheNotificationFor.ts | 10 ++ .../accident-notification/src/types/index.ts | 7 +- .../src/{ => utils}/constants/index.ts | 1 + .../getWhoIstheNotificationForOptions.ts | 32 ++++++ .../src/utils/getWorkplaceData.spec.ts | 2 +- .../src/utils/hasMissingDocuments.spec.ts | 2 +- .../src/utils/hasMissingDocuments.ts | 2 +- .../src/utils/index.spec.ts | 2 +- .../accident-notification/src/utils/index.ts | 2 +- .../src/utils/isFatalAccident.spec.ts | 2 +- .../src/utils/isFatalAccident.ts | 2 +- .../utils/isMachineRelatedAccident.spec.ts | 2 +- .../src/utils/isMachineRelatedAccident.ts | 2 +- ...RepresentativeOfCompanyOrInstitute.spec.ts | 2 +- .../isRepresentativeOfCompanyOrInstitute.ts | 2 +- .../announcement-of-death/src/types/index.ts | 4 - .../src/types/index.ts | 6 -- .../src/dataProviders/index.ts | 2 +- .../src/lib/dataSchema.ts | 2 +- .../src/types/index.ts | 6 -- .../src/fields/Overview/Overview.tsx | 14 +-- .../applicantInformationMultiField.ts | 12 +-- .../applicantInformationMultiField/types.ts | 2 +- 51 files changed, 349 insertions(+), 286 deletions(-) create mode 100644 libs/application/templates/accident-notification/src/dataProviders/index.ts delete mode 100644 libs/application/templates/accident-notification/src/fields/AgreementDescription/index.tsx delete mode 100644 libs/application/templates/accident-notification/src/fields/DescriptionWithLink/descriptionWithLink.css.ts delete mode 100644 libs/application/templates/accident-notification/src/fields/DescriptionWithLink/index.tsx delete mode 100644 libs/application/templates/accident-notification/src/forms/AccidentNotificationForm/betaTestSection.ts delete mode 100644 libs/application/templates/accident-notification/src/forms/AccidentNotificationForm/externalDataSection/agreementDescriptionMultiField.ts delete mode 100644 libs/application/templates/accident-notification/src/forms/AccidentNotificationForm/externalDataSection/index.ts create mode 100644 libs/application/templates/accident-notification/src/forms/PrerequisitesForm/dataHandlingSection.ts rename libs/application/templates/accident-notification/src/forms/{AccidentNotificationForm/externalDataSection/accidentNotificationSubSection.ts => PrerequisitesForm/externalDataSection.ts} (74%) create mode 100644 libs/application/templates/accident-notification/src/forms/PrerequisitesForm/index.ts create mode 100644 libs/application/templates/accident-notification/src/forms/PrerequisitesProcureForm/externalDataSection.ts create mode 100644 libs/application/templates/accident-notification/src/forms/PrerequisitesProcureForm/index.ts rename libs/application/templates/accident-notification/src/{ => utils}/constants/index.ts (90%) create mode 100644 libs/application/templates/accident-notification/src/utils/getWhoIstheNotificationForOptions.ts diff --git a/libs/application/templates/accident-notification/src/dataProviders/index.ts b/libs/application/templates/accident-notification/src/dataProviders/index.ts new file mode 100644 index 000000000000..fb1bb027a65c --- /dev/null +++ b/libs/application/templates/accident-notification/src/dataProviders/index.ts @@ -0,0 +1,4 @@ +export { + IdentityApi, + NationalRegistryUserApi, +} from '@island.is/application/types' diff --git a/libs/application/templates/accident-notification/src/fields/AgreementDescription/index.tsx b/libs/application/templates/accident-notification/src/fields/AgreementDescription/index.tsx deleted file mode 100644 index 0470ab316795..000000000000 --- a/libs/application/templates/accident-notification/src/fields/AgreementDescription/index.tsx +++ /dev/null @@ -1,25 +0,0 @@ -import { FieldBaseProps } from '@island.is/application/types' -import { Bullet, Stack } from '@island.is/island-ui/core' -import { useLocale } from '@island.is/localization' -import React, { FC } from 'react' -import { externalData } from '../../lib/messages' - -export const AgreementDescription: FC< - React.PropsWithChildren -> = () => { - const { formatMessage } = useLocale() - - return ( - - - {formatMessage(externalData.agreementDescription.bulletOne)} - - - {formatMessage(externalData.agreementDescription.bulletTwo)} - - - {formatMessage(externalData.agreementDescription.bulletThree)} - - - ) -} diff --git a/libs/application/templates/accident-notification/src/fields/DateOfAccident/index.tsx b/libs/application/templates/accident-notification/src/fields/DateOfAccident/index.tsx index b212e92ae31b..27627c0f8f2b 100644 --- a/libs/application/templates/accident-notification/src/fields/DateOfAccident/index.tsx +++ b/libs/application/templates/accident-notification/src/fields/DateOfAccident/index.tsx @@ -5,7 +5,7 @@ import { useLocale } from '@island.is/localization' import { DatePickerController } from '@island.is/shared/form-fields' import React, { FC, useCallback, useEffect, useState } from 'react' import { Controller, useFormContext } from 'react-hook-form' -import { NO, YES } from '../../constants' +import { NO, YES } from '../../utils/constants' import { useLazyIsHealthInsured } from '../../hooks/useLazyIsHealthInsured' import { AccidentNotification } from '../../lib/dataSchema' import { accidentDetails } from '../../lib/messages' diff --git a/libs/application/templates/accident-notification/src/fields/DescriptionWithLink/descriptionWithLink.css.ts b/libs/application/templates/accident-notification/src/fields/DescriptionWithLink/descriptionWithLink.css.ts deleted file mode 100644 index 8ed6d0294c97..000000000000 --- a/libs/application/templates/accident-notification/src/fields/DescriptionWithLink/descriptionWithLink.css.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { style } from '@vanilla-extract/css' -import { theme } from '@island.is/island-ui/theme' - -export const link = style({ - color: theme.color.blue600, - selectors: { - '&:hover': { - backgroundColor: theme.color.purple100, - }, - }, -}) diff --git a/libs/application/templates/accident-notification/src/fields/DescriptionWithLink/index.tsx b/libs/application/templates/accident-notification/src/fields/DescriptionWithLink/index.tsx deleted file mode 100644 index b83eaff05827..000000000000 --- a/libs/application/templates/accident-notification/src/fields/DescriptionWithLink/index.tsx +++ /dev/null @@ -1,43 +0,0 @@ -import { Link, Text } from '@island.is/island-ui/core' -import React, { FC } from 'react' -import { useLocale } from '@island.is/localization' -import { formatText } from '@island.is/application/core' -import { FieldBaseProps } from '@island.is/application/types' -import { Box } from '@island.is/island-ui/core' -import * as styles from './descriptionWithLink.css' - -type DescriptionLinkProps = { - field: { - props: { - descriptionFirstPart: string - descriptionSecondPart: string - linkName: string - url: string - } - } -} - -export const DescriptionWithLink: FC< - React.PropsWithChildren -> = ({ application, field }) => { - const { props } = field - const { formatMessage } = useLocale() - const { descriptionFirstPart, descriptionSecondPart, linkName, url } = props - return ( - - - - {`${formatText(descriptionFirstPart, application, formatMessage)} `} - - {` ${formatText( - linkName, - application, - formatMessage, - )}`} - - {formatText(descriptionSecondPart, application, formatMessage)} - - - - ) -} diff --git a/libs/application/templates/accident-notification/src/fields/FormOverview/index.tsx b/libs/application/templates/accident-notification/src/fields/FormOverview/index.tsx index e3401b90871a..3eb21101ca94 100644 --- a/libs/application/templates/accident-notification/src/fields/FormOverview/index.tsx +++ b/libs/application/templates/accident-notification/src/fields/FormOverview/index.tsx @@ -18,7 +18,7 @@ import is from 'date-fns/locale/is' import parseISO from 'date-fns/parseISO' import kennitala from 'kennitala' import React, { FC } from 'react' -import { States, YES } from '../../constants' +import { States, YES } from '../../utils/constants' import { AccidentNotification } from '../../lib/dataSchema' import { accidentDetails, diff --git a/libs/application/templates/accident-notification/src/fields/index.ts b/libs/application/templates/accident-notification/src/fields/index.ts index d2880db80314..82bbce3df36a 100644 --- a/libs/application/templates/accident-notification/src/fields/index.ts +++ b/libs/application/templates/accident-notification/src/fields/index.ts @@ -1,8 +1,6 @@ -export { AgreementDescription } from './AgreementDescription' export { DateOfAccident } from './DateOfAccident' export { FormOverview } from './FormOverview' export { HiddenInformation } from './HiddenInformation' export { ApplicationStatus } from './ApplicationStatus' export { FormOverviewInReview } from './FormOverviewInReview' export { ProxyDocument } from './ProxyDocument' -export { DescriptionWithLink } from './DescriptionWithLink' diff --git a/libs/application/templates/accident-notification/src/forms/AccidentNotificationForm/aboutTheAccidentSection/attachmentsSubSection.ts b/libs/application/templates/accident-notification/src/forms/AccidentNotificationForm/aboutTheAccidentSection/attachmentsSubSection.ts index 8d666ce9d97c..e8c71b90e331 100644 --- a/libs/application/templates/accident-notification/src/forms/AccidentNotificationForm/aboutTheAccidentSection/attachmentsSubSection.ts +++ b/libs/application/templates/accident-notification/src/forms/AccidentNotificationForm/aboutTheAccidentSection/attachmentsSubSection.ts @@ -21,7 +21,12 @@ import { isRepresentativeOfCompanyOrInstitute, } from '../../../utils' import { AttachmentsEnum } from '../../../types' -import { FILE_SIZE_LIMIT, NO, UPLOAD_ACCEPT, YES } from '../../../constants' +import { + FILE_SIZE_LIMIT, + NO, + UPLOAD_ACCEPT, + YES, +} from '../../../utils/constants' // Injury certificate and fatal accident section export const attachmentsSubSection = buildSubSection({ diff --git a/libs/application/templates/accident-notification/src/forms/AccidentNotificationForm/aboutTheAccidentSection/locationSubSection.ts b/libs/application/templates/accident-notification/src/forms/AccidentNotificationForm/aboutTheAccidentSection/locationSubSection.ts index 7e97ccbd88ae..be855a49a6f0 100644 --- a/libs/application/templates/accident-notification/src/forms/AccidentNotificationForm/aboutTheAccidentSection/locationSubSection.ts +++ b/libs/application/templates/accident-notification/src/forms/AccidentNotificationForm/aboutTheAccidentSection/locationSubSection.ts @@ -22,7 +22,7 @@ import { isRescueWorkAccident, isStudiesAccident, } from '../../../utils' -import { NO, YES } from '../../../constants' +import { NO, YES } from '../../../utils/constants' import { isSportAccidentAndEmployee } from '../../../utils/isSportAccidentAndEmployee' import { AgricultureAccidentLocationEnum, diff --git a/libs/application/templates/accident-notification/src/forms/AccidentNotificationForm/aboutTheAccidentSection/workMachineSubSection.ts b/libs/application/templates/accident-notification/src/forms/AccidentNotificationForm/aboutTheAccidentSection/workMachineSubSection.ts index 67b73e98e2d6..bdfa59c43e79 100644 --- a/libs/application/templates/accident-notification/src/forms/AccidentNotificationForm/aboutTheAccidentSection/workMachineSubSection.ts +++ b/libs/application/templates/accident-notification/src/forms/AccidentNotificationForm/aboutTheAccidentSection/workMachineSubSection.ts @@ -10,7 +10,7 @@ import { isGeneralWorkplaceAccident, } from '../../../utils' import { isSportAccidentAndEmployee } from '../../../utils/isSportAccidentAndEmployee' -import { NO, YES } from '../../../constants' +import { NO, YES } from '../../../utils/constants' // Workmachine information only applicable to generic workplace accidents export const workMachineSubSection = buildSubSection({ diff --git a/libs/application/templates/accident-notification/src/forms/AccidentNotificationForm/applicantInformationSection.ts b/libs/application/templates/accident-notification/src/forms/AccidentNotificationForm/applicantInformationSection.ts index dc0cde867058..f91bcfaaee43 100644 --- a/libs/application/templates/accident-notification/src/forms/AccidentNotificationForm/applicantInformationSection.ts +++ b/libs/application/templates/accident-notification/src/forms/AccidentNotificationForm/applicantInformationSection.ts @@ -1,8 +1,6 @@ import { buildSection } from '@island.is/application/core' - import { applicantInformation } from '../../lib/messages' import { applicantInformationMultiField } from '@island.is/application/ui-forms' - export const applicantInformationSection = buildSection({ id: 'informationAboutApplicantSection', title: applicantInformation.general.title, diff --git a/libs/application/templates/accident-notification/src/forms/AccidentNotificationForm/betaTestSection.ts b/libs/application/templates/accident-notification/src/forms/AccidentNotificationForm/betaTestSection.ts deleted file mode 100644 index c37d5bbc3359..000000000000 --- a/libs/application/templates/accident-notification/src/forms/AccidentNotificationForm/betaTestSection.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { buildCustomField, buildSection } from '@island.is/application/core' -import { betaTest } from '../../lib/messages' - -// Should only be here with the soft release, remove on official release. -export const betaTestSection = buildSection({ - id: 'betaTest.section', - title: betaTest.title, - children: [ - buildCustomField( - { - id: 'betaTest.section.textField', - title: betaTest.title, - component: 'DescriptionWithLink', - doesNotRequireAnswer: true, - }, - { - descriptionFirstPart: betaTest.descriptionFirstPart, - descriptionSecondPart: betaTest.descriptionSecondPart, - linkName: betaTest.emailText, - url: betaTest.email, - }, - ), - ], -}) diff --git a/libs/application/templates/accident-notification/src/forms/AccidentNotificationForm/externalDataSection/agreementDescriptionMultiField.ts b/libs/application/templates/accident-notification/src/forms/AccidentNotificationForm/externalDataSection/agreementDescriptionMultiField.ts deleted file mode 100644 index ff2088966a1e..000000000000 --- a/libs/application/templates/accident-notification/src/forms/AccidentNotificationForm/externalDataSection/agreementDescriptionMultiField.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { buildCustomField, buildMultiField } from '@island.is/application/core' -import { externalData } from '../../../lib/messages' - -export const agreementDescriptionMultiField = buildMultiField({ - title: externalData.agreementDescription.sectionTitle, - id: 'agreementDescriptionMultiField', - space: 2, - children: [ - buildCustomField({ - id: 'agreementDescriptionCustomField', - title: '', - component: 'AgreementDescription', - doesNotRequireAnswer: true, - }), - buildCustomField( - { - id: 'extrainformationWithDataprovider', - title: '', - component: 'DescriptionWithLink', - doesNotRequireAnswer: true, - }, - { - descriptionFirstPart: externalData.extraInformation.description, - descriptionSecondPart: '', - linkName: externalData.extraInformation.linkText, - url: externalData.extraInformation.link, - }, - ), - ], -}) diff --git a/libs/application/templates/accident-notification/src/forms/AccidentNotificationForm/externalDataSection/index.ts b/libs/application/templates/accident-notification/src/forms/AccidentNotificationForm/externalDataSection/index.ts deleted file mode 100644 index d46bf5c0c1b0..000000000000 --- a/libs/application/templates/accident-notification/src/forms/AccidentNotificationForm/externalDataSection/index.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { buildSection } from '@island.is/application/core' -import { agreementDescriptionMultiField } from './agreementDescriptionMultiField' -import { accidentNotificationSubSection } from './accidentNotificationSubSection' -import { externalData } from '../../../lib/messages' - -export const externalDataSection = buildSection({ - id: 'ExternalDataSection', - title: externalData.agreementDescription.listTitle, - children: [agreementDescriptionMultiField, accidentNotificationSubSection], -}) diff --git a/libs/application/templates/accident-notification/src/forms/AccidentNotificationForm/index.ts b/libs/application/templates/accident-notification/src/forms/AccidentNotificationForm/index.ts index 82a2dfd20d95..e3b6e2d8ed99 100644 --- a/libs/application/templates/accident-notification/src/forms/AccidentNotificationForm/index.ts +++ b/libs/application/templates/accident-notification/src/forms/AccidentNotificationForm/index.ts @@ -2,14 +2,10 @@ import { buildForm } from '@island.is/application/core' import { Form, FormModes } from '@island.is/application/types' import Logo from '../../assets/Logo' import { application } from '../../lib/messages' - import { conclusionSection } from './conclusionSection' - import { overviewSection } from './overviewSection' -import { betaTestSection } from './betaTestSection' import { applicantInformationSection } from './applicantInformationSection' import { whoIsTheNotificationForSection } from './whoIsTheNotificationForSection' -import { externalDataSection } from './externalDataSection' import { aboutTheAccidentSection } from './aboutTheAccidentSection' export const AccidentNotificationForm: Form = buildForm({ @@ -18,8 +14,6 @@ export const AccidentNotificationForm: Form = buildForm({ logo: Logo, mode: FormModes.DRAFT, children: [ - betaTestSection, - externalDataSection, applicantInformationSection, whoIsTheNotificationForSection, aboutTheAccidentSection, diff --git a/libs/application/templates/accident-notification/src/forms/AccidentNotificationForm/whoIsTheNotificationForSection/juridicialPersonCompanySubSection.ts b/libs/application/templates/accident-notification/src/forms/AccidentNotificationForm/whoIsTheNotificationForSection/juridicialPersonCompanySubSection.ts index 45ec29a5a2a7..5d747453c1d0 100644 --- a/libs/application/templates/accident-notification/src/forms/AccidentNotificationForm/whoIsTheNotificationForSection/juridicialPersonCompanySubSection.ts +++ b/libs/application/templates/accident-notification/src/forms/AccidentNotificationForm/whoIsTheNotificationForSection/juridicialPersonCompanySubSection.ts @@ -6,7 +6,7 @@ import { } from '@island.is/application/core' import { juridicalPerson } from '../../../lib/messages' import { isReportingOnBehalfOfEmployee } from '../../../utils' -import { YES } from '../../../constants' +import { YES } from '../../../utils/constants' export const juridicalPersonCompanySubSection = buildSubSection({ id: 'juridicalPerson.company', diff --git a/libs/application/templates/accident-notification/src/forms/AccidentNotificationForm/whoIsTheNotificationForSection/powerOfAttorneyUploadSubSection.ts b/libs/application/templates/accident-notification/src/forms/AccidentNotificationForm/whoIsTheNotificationForSection/powerOfAttorneyUploadSubSection.ts index d3defa608ae5..00ec8aff756d 100644 --- a/libs/application/templates/accident-notification/src/forms/AccidentNotificationForm/whoIsTheNotificationForSection/powerOfAttorneyUploadSubSection.ts +++ b/libs/application/templates/accident-notification/src/forms/AccidentNotificationForm/whoIsTheNotificationForSection/powerOfAttorneyUploadSubSection.ts @@ -5,7 +5,7 @@ import { buildSubSection, } from '@island.is/application/core' import { error, powerOfAttorney } from '../../../lib/messages' -import { FILE_SIZE_LIMIT, UPLOAD_ACCEPT } from '../../../constants' +import { FILE_SIZE_LIMIT, UPLOAD_ACCEPT } from '../../../utils/constants' import { isUploadNow } from '../../../utils/isUploadNow' export const powerOfAttorneyUploadSubSection = buildSubSection({ diff --git a/libs/application/templates/accident-notification/src/forms/AccidentNotificationForm/whoIsTheNotificationForSection/whoIsTheNotificationForMultiField.ts b/libs/application/templates/accident-notification/src/forms/AccidentNotificationForm/whoIsTheNotificationForSection/whoIsTheNotificationForMultiField.ts index 766ea3128bc2..d59f1f345a83 100644 --- a/libs/application/templates/accident-notification/src/forms/AccidentNotificationForm/whoIsTheNotificationForSection/whoIsTheNotificationForMultiField.ts +++ b/libs/application/templates/accident-notification/src/forms/AccidentNotificationForm/whoIsTheNotificationForSection/whoIsTheNotificationForMultiField.ts @@ -1,34 +1,33 @@ import { buildMultiField, buildRadioField } from '@island.is/application/core' import { whoIsTheNotificationFor } from '../../../lib/messages' -import { WhoIsTheNotificationForEnum } from '../../../types' +import { + whoIsTheNotificationForOptions, + whoIsTheNotificationForProcureOptions, +} from '../../../utils/getWhoIstheNotificationForOptions' export const whoIsTheNotificationForMultiField = buildMultiField({ id: 'whoIsTheNotificationFor', title: whoIsTheNotificationFor.general.heading, - description: whoIsTheNotificationFor.general.description, + description: (application) => { + if (application.externalData.identity) { + return whoIsTheNotificationFor.general.procureDescription + } + return whoIsTheNotificationFor.general.description + }, children: [ buildRadioField({ id: 'whoIsTheNotificationFor.answer', title: '', width: 'half', - options: [ - { - value: WhoIsTheNotificationForEnum.ME, - label: whoIsTheNotificationFor.labels.me, - }, - { - value: WhoIsTheNotificationForEnum.POWEROFATTORNEY, - label: whoIsTheNotificationFor.labels.powerOfAttorney, - }, - { - value: WhoIsTheNotificationForEnum.JURIDICALPERSON, - label: whoIsTheNotificationFor.labels.juridicalPerson, - }, - { - value: WhoIsTheNotificationForEnum.CHILDINCUSTODY, - label: whoIsTheNotificationFor.labels.childInCustody, - }, - ], + condition: (_answers, externalData) => !externalData.identity, + options: whoIsTheNotificationForOptions, + }), + buildRadioField({ + id: 'whoIsTheNotificationFor.answer', + title: '', + width: 'half', + condition: (_answers, externalData) => !!externalData.identity, + options: whoIsTheNotificationForProcureOptions, }), ], }) diff --git a/libs/application/templates/accident-notification/src/forms/InReviewForm/addAttachmentsSection.ts b/libs/application/templates/accident-notification/src/forms/InReviewForm/addAttachmentsSection.ts index 13d264c39118..f0c88a39c67a 100644 --- a/libs/application/templates/accident-notification/src/forms/InReviewForm/addAttachmentsSection.ts +++ b/libs/application/templates/accident-notification/src/forms/InReviewForm/addAttachmentsSection.ts @@ -7,7 +7,7 @@ import { buildSubmitField, } from '@island.is/application/core' import { DefaultEvents, FormValue } from '@island.is/application/types' -import { FILE_SIZE_LIMIT, UPLOAD_ACCEPT } from '../../constants' +import { FILE_SIZE_LIMIT, UPLOAD_ACCEPT } from '../../utils/constants' import { addDocuments, error } from '../../lib/messages' import { hasReceivedInjuryCertificate, diff --git a/libs/application/templates/accident-notification/src/forms/PrerequisitesForm/dataHandlingSection.ts b/libs/application/templates/accident-notification/src/forms/PrerequisitesForm/dataHandlingSection.ts new file mode 100644 index 000000000000..240af507eadb --- /dev/null +++ b/libs/application/templates/accident-notification/src/forms/PrerequisitesForm/dataHandlingSection.ts @@ -0,0 +1,30 @@ +import { + buildDescriptionField, + buildMultiField, + buildSection, +} from '@island.is/application/core' +import { externalData } from '../../lib/messages' + +export const dataHandlingSection = buildSection({ + id: 'ExternalDataSection', + title: externalData.agreementDescription.listTitle, + children: [ + buildMultiField({ + title: externalData.agreementDescription.sectionTitle, + id: 'agreementDescriptionMultiField', + space: 2, + children: [ + buildDescriptionField({ + id: 'agreementDescriptionDescriptionField', + title: '', + description: externalData.agreementDescription.bullets, + }), + buildDescriptionField({ + id: 'moreInformation', + title: '', + description: externalData.agreementDescription.moreInformation, + }), + ], + }), + ], +}) diff --git a/libs/application/templates/accident-notification/src/forms/AccidentNotificationForm/externalDataSection/accidentNotificationSubSection.ts b/libs/application/templates/accident-notification/src/forms/PrerequisitesForm/externalDataSection.ts similarity index 74% rename from libs/application/templates/accident-notification/src/forms/AccidentNotificationForm/externalDataSection/accidentNotificationSubSection.ts rename to libs/application/templates/accident-notification/src/forms/PrerequisitesForm/externalDataSection.ts index 9551bdb5bad5..9edaba894625 100644 --- a/libs/application/templates/accident-notification/src/forms/AccidentNotificationForm/externalDataSection/accidentNotificationSubSection.ts +++ b/libs/application/templates/accident-notification/src/forms/PrerequisitesForm/externalDataSection.ts @@ -1,13 +1,15 @@ import { buildDataProviderItem, buildExternalDataProvider, - buildSubSection, + buildSection, + buildSubmitField, + coreMessages, } from '@island.is/application/core' -import { externalData } from '../../../lib/messages' -import { NationalRegistryUserApi } from '@island.is/application/types' +import { externalData } from '../../lib/messages' +import { NationalRegistryUserApi } from '../../dataProviders' -export const accidentNotificationSubSection = buildSubSection({ - id: 'AccidentNotificationForm', +export const externalDataSection = buildSection({ + id: 'ExternalDataRegularSection', title: externalData.dataProvider.sectionTitle, children: [ buildExternalDataProvider({ @@ -16,6 +18,19 @@ export const accidentNotificationSubSection = buildSubSection({ subTitle: externalData.dataProvider.subTitle, description: '', checkboxLabel: externalData.dataProvider.checkboxLabel, + submitField: buildSubmitField({ + id: 'submit', + placement: 'footer', + title: '', + refetchApplicationAfterSubmit: true, + actions: [ + { + event: 'SUBMIT', + name: coreMessages.buttonNext, + type: 'primary', + }, + ], + }), dataProviders: [ buildDataProviderItem({ id: 'directoryOfLabor', diff --git a/libs/application/templates/accident-notification/src/forms/PrerequisitesForm/index.ts b/libs/application/templates/accident-notification/src/forms/PrerequisitesForm/index.ts new file mode 100644 index 000000000000..89c7e17800ad --- /dev/null +++ b/libs/application/templates/accident-notification/src/forms/PrerequisitesForm/index.ts @@ -0,0 +1,15 @@ +import { buildForm } from '@island.is/application/core' +import { Form } from '@island.is/application/types' +import { application } from '../../lib/messages' +import Logo from '../../assets/Logo' +import { dataHandlingSection } from './dataHandlingSection' +import { externalDataSection } from './externalDataSection' + +export const PrerequisitesForm: Form = buildForm({ + id: 'PrerequisitesForm', + title: application.general.name, + logo: Logo, + renderLastScreenButton: true, + renderLastScreenBackButton: true, + children: [dataHandlingSection, externalDataSection], +}) diff --git a/libs/application/templates/accident-notification/src/forms/PrerequisitesProcureForm/externalDataSection.ts b/libs/application/templates/accident-notification/src/forms/PrerequisitesProcureForm/externalDataSection.ts new file mode 100644 index 000000000000..8cf32a765fd2 --- /dev/null +++ b/libs/application/templates/accident-notification/src/forms/PrerequisitesProcureForm/externalDataSection.ts @@ -0,0 +1,43 @@ +import { + buildDataProviderItem, + buildExternalDataProvider, + buildSection, + buildSubmitField, + coreMessages, +} from '@island.is/application/core' +import { externalData } from '../../lib/messages' +import { IdentityApi } from '../../dataProviders' + +export const externalDataSection = buildSection({ + id: 'ExternalDataProcureSection', + title: externalData.agreementDescription.listTitle, + children: [ + buildExternalDataProvider({ + title: externalData.dataProvider.pageTitle, + id: 'approveExternalData', + subTitle: externalData.dataProvider.subTitle, + description: '', + checkboxLabel: externalData.dataProvider.checkboxLabel, + submitField: buildSubmitField({ + id: 'submit', + placement: 'footer', + title: '', + refetchApplicationAfterSubmit: true, + actions: [ + { + event: 'SUBMIT', + name: coreMessages.buttonNext, + type: 'primary', + }, + ], + }), + dataProviders: [ + buildDataProviderItem({ + provider: IdentityApi, + title: externalData.nationalRegistry.title, + subTitle: externalData.nationalRegistry.subTitle, + }), + ], + }), + ], +}) diff --git a/libs/application/templates/accident-notification/src/forms/PrerequisitesProcureForm/index.ts b/libs/application/templates/accident-notification/src/forms/PrerequisitesProcureForm/index.ts new file mode 100644 index 000000000000..f792bfe3737a --- /dev/null +++ b/libs/application/templates/accident-notification/src/forms/PrerequisitesProcureForm/index.ts @@ -0,0 +1,15 @@ +import { buildForm } from '@island.is/application/core' +import { Form } from '@island.is/application/types' +import { application } from '../../lib/messages' +import Logo from '../../assets/Logo' +import { dataHandlingSection } from '../PrerequisitesForm/dataHandlingSection' +import { externalDataSection } from './externalDataSection' + +export const PrerequisitesProcureForm: Form = buildForm({ + id: 'PrerequisitesProcureForm', + title: application.general.name, + logo: Logo, + renderLastScreenButton: true, + renderLastScreenBackButton: true, + children: [dataHandlingSection, externalDataSection], +}) diff --git a/libs/application/templates/accident-notification/src/lib/AccidentNotificationTemplate.ts b/libs/application/templates/accident-notification/src/lib/AccidentNotificationTemplate.ts index 064f8b9d2530..e28f58669588 100644 --- a/libs/application/templates/accident-notification/src/lib/AccidentNotificationTemplate.ts +++ b/libs/application/templates/accident-notification/src/lib/AccidentNotificationTemplate.ts @@ -14,30 +14,33 @@ import { ApplicationTypes, DefaultEvents, defineTemplateApi, - NationalRegistryUserApi, PendingAction, + FormModes, } from '@island.is/application/types' import set from 'lodash/set' import { assign } from 'xstate' import { AccidentTypeEnum, ReviewApprovalEnum } from '..' -import { States } from '../constants' +import { States } from '../utils/constants' import { ApiActions } from '../shared' import { WhoIsTheNotificationForEnum } from '../types' import { AccidentNotificationSchema } from './dataSchema' import { anPendingActionMessages, application } from './messages' +import { AuthDelegationType } from '@island.is/shared/types' +import { IdentityApi, NationalRegistryUserApi } from '../dataProviders' // The applicant is the applicant of the application, can be someone in power of attorney or the representative for the company // The assignee is the person who is assigned to review the application can be the injured person or the representative for the company // The assignee should see all data related to the application being submitted to sjukra but not data only relevant to applicant enum Roles { + PROCURER = 'procurer', APPLICANT = 'applicant', ASSIGNEE = 'assignee', } type AccidentNotificationEvent = | { type: DefaultEvents.APPROVE } - | { type: DefaultEvents.SUBMIT } | { type: DefaultEvents.REJECT } + | { type: DefaultEvents.SUBMIT } | { type: DefaultEvents.ASSIGN } const assignStatePendingAction = ( @@ -61,7 +64,7 @@ const assignStatePendingAction = ( } const reviewStatePendingAction = ( - application: Application, + _application: Application, role: string, ): PendingAction => { if (role === Roles.ASSIGNEE) { @@ -91,15 +94,72 @@ const AccidentNotificationTemplate: ApplicationTemplate< ApplicationConfigurations.AccidentNotification.translation, ], dataSchema: AccidentNotificationSchema, + allowedDelegations: [ + { + type: AuthDelegationType.ProcurationHolder, + }, + { + type: AuthDelegationType.Custom, + }, + ], stateMachineConfig: { - initial: States.DRAFT, + initial: States.PREREQUISITES, states: { + [States.PREREQUISITES]: { + meta: { + name: application.general.name.defaultMessage, + progress: 0, + lifecycle: DefaultStateLifeCycle, + status: FormModes.DRAFT, + actionCard: { + historyLogs: [ + { + onEvent: DefaultEvents.SUBMIT, + logMessage: coreHistoryMessages.applicationStarted, + }, + ], + }, + roles: [ + { + id: Roles.APPLICANT, + formLoader: () => + import('../forms/PrerequisitesForm').then((val) => + Promise.resolve(val.PrerequisitesForm), + ), + actions: [ + { event: 'SUBMIT', name: 'Staðfesta', type: 'primary' }, + ], + write: 'all', + api: [NationalRegistryUserApi, IdentityApi], + delete: true, + }, + { + id: Roles.PROCURER, + formLoader: () => + import('../forms/PrerequisitesProcureForm').then((val) => + Promise.resolve(val.PrerequisitesProcureForm), + ), + actions: [ + { event: 'SUBMIT', name: 'Staðfesta', type: 'primary' }, + ], + write: 'all', + api: [NationalRegistryUserApi, IdentityApi], + delete: true, + }, + ], + }, + on: { + [DefaultEvents.SUBMIT]: { + target: States.DRAFT, + }, + }, + }, [States.DRAFT]: { meta: { name: application.general.name.defaultMessage, progress: 0.4, lifecycle: DefaultStateLifeCycle, - status: 'draft', + status: FormModes.DRAFT, actionCard: { historyLogs: [ { @@ -122,6 +182,19 @@ const AccidentNotificationTemplate: ApplicationTemplate< api: [NationalRegistryUserApi], delete: true, }, + { + id: Roles.PROCURER, + formLoader: () => + import('../forms/AccidentNotificationForm/index').then((val) => + Promise.resolve(val.AccidentNotificationForm), + ), + actions: [ + { event: 'SUBMIT', name: 'Staðfesta', type: 'primary' }, + ], + write: 'all', + api: [NationalRegistryUserApi], + delete: true, + }, ], }, on: { @@ -346,17 +419,16 @@ const AccidentNotificationTemplate: ApplicationTemplate< id: string, application: Application, ): ApplicationRole | undefined { - if (id === application.applicant && application.assignees.includes(id)) { - return Roles.ASSIGNEE - } + const { applicant, applicantActors, assignees } = application - if (id === application.applicant) { + if (id === applicant) { + if (applicantActors.length) return Roles.PROCURER + if (assignees.includes(id)) return Roles.ASSIGNEE return Roles.APPLICANT } - if (application.assignees.includes(id)) { - return Roles.ASSIGNEE - } + if (assignees.includes(id)) return Roles.ASSIGNEE + return undefined }, } diff --git a/libs/application/templates/accident-notification/src/lib/dataSchema.ts b/libs/application/templates/accident-notification/src/lib/dataSchema.ts index a9ee0e7b182b..afb53946fe3b 100644 --- a/libs/application/templates/accident-notification/src/lib/dataSchema.ts +++ b/libs/application/templates/accident-notification/src/lib/dataSchema.ts @@ -1,7 +1,7 @@ import { applicantInformationSchema } from '@island.is/application/ui-forms' import * as kennitala from 'kennitala' import { z } from 'zod' -import { YES } from '../constants' +import { YES } from '../utils/constants' import { AccidentTypeEnum, AgricultureAccidentLocationEnum, diff --git a/libs/application/templates/accident-notification/src/lib/messages/applicantInformation.ts b/libs/application/templates/accident-notification/src/lib/messages/applicantInformation.ts index 9c9a7954b983..e02b7d08abc8 100644 --- a/libs/application/templates/accident-notification/src/lib/messages/applicantInformation.ts +++ b/libs/application/templates/accident-notification/src/lib/messages/applicantInformation.ts @@ -55,6 +55,18 @@ export const applicantInformation = { description: 'Telephone number', }, }), + procure: defineMessages({ + titill: { + id: 'an.application:applicantInfo.procure.title', + defaultMessage: 'Upplýsingar um ', + description: 'Name of the procure identity', + }, + name: { + id: 'an.application:applicantInfo.procure.name', + defaultMessage: 'Nafn', + description: 'Name of the procure identity', + }, + }), forThirdParty: defineMessages({ title: { id: 'an.application:applicantInfo.forThirdParty.title', diff --git a/libs/application/templates/accident-notification/src/lib/messages/externalData.ts b/libs/application/templates/accident-notification/src/lib/messages/externalData.ts index 017a2fefda6f..869618dbdc54 100644 --- a/libs/application/templates/accident-notification/src/lib/messages/externalData.ts +++ b/libs/application/templates/accident-notification/src/lib/messages/externalData.ts @@ -12,30 +12,24 @@ export const externalData = { defaultMessage: 'Meðferð á gögnum', description: 'Data handling list item title', }, - bulletOne: { - id: 'an.application:section.agreementDescription.BulletOne', - defaultMessage: - 'Þegar tilkynning um slys er send Sjúkratryggingum Íslands mun stofnunin miðla upplýsingum um afstöðu til bótaskyldu með þeim atvinnurekanda eða íþróttafélagi sem á í hlut. Ástæðan þess er að umræddir aðilar kunna að eiga rétt á endurgreiðslu útlagðs kostnaðar og/eða dagpeningum ef greidd hafa verið laun í veikindaforföllum vegna slyssins. Þessir aðilar fá aldrei afhentar heilsufars- eða sjúkraskrárupplýsingar.', - description: 'List item 1 on data gathering information', - }, - bulletTwo: { - id: 'an.application:section.agreementDescription.BulletTwo', - defaultMessage: - 'Vinnueftirlit ríkisins kann einnig að fá afrit af tilkynningunni undir ákveðnum kringumstæðum á grundvelli 4. mgr. 79. gr. laga nr. 46/1980 sem og Rannsóknarnefnd samgönguslysa á grundvelli 12. og 16. gr. laga nr. 18/2013.', - description: 'List item 2 on data gathering information', - }, - bulletThree: { - id: 'an.application:section.agreementDescription.BulletThree', - defaultMessage: - 'Eitthvað óvænt verður að hafa gerst sem veldur tjóni á líkama hins tryggða og áhorfandi getur áttað sig á að hafi gerst.', - description: 'List item 3 on data gathering information', - }, bulletFour: { id: 'an.application:section.agreementDescription.BulletFour', defaultMessage: 'Ef tilkynningaskylda er vanrækt skal það ekki vera því til fyrirstöðu að sá slasaði eða vandamenn geti gert kröfu til bóta. Heimilt er að veita undanþágu þótt meira en ár sé liðið ef atvik slyss eru alveg ljós og drátturinn torveldar ekki gagnaöflun um atriði sem skipta máli. Þá er það skilyrði að unnt sé að meta orsakasamband slyssins og heilsutjóns slasaða.', description: 'List item 4 on data gathering information', }, + bullets: { + id: 'an.application:section.agreementDescription.bullets#markdown', + defaultMessage: + '* Þegar tilkynning um slys er send Sjúkratryggingum Íslands mun stofnunin miðla upplýsingum um afstöðu til bótaskyldu með þeim atvinnurekanda eða íþróttafélagi sem á í hlut. Ástæða þess er að umræddir aðilar kunna að eiga rétt á endurgreiðslu útlagðs kostnaðar og/eða dagpeningum ef greidd hafa verið laun í veikindaforföllum vegna slyssins. Þessir aðilar fá aldrei afhentar heilsufars- eða sjúkraskrárupplýsingar. \n\n* Vinnueftirlit ríkisins kann einnig að fá afrit af tilkynningunni undir ákveðnum kringumstæðum á grundvelli 4. mgr. 79. gr. laga nr. 46/1980 sem og Rannsóknarnefnd samgönguslysa á grundvelli 12. og 16. gr. laga nr. 18/2013. \n\n* Eitthvað óvænt verður að hafa gerst sem veldur tjóni á líkama hins tryggða og áhorfandi getur áttað sig á að hafi gerst.', + description: 'Information on data handling before prerequisites', + }, + moreInformation: { + id: 'an.application:section.agreementDescription.moreInformation#markdown', + defaultMessage: + 'Nánari upplýsingar um vinnslu persónuupplýsinga hjá Sjúkratryggingum Íslands á [Persónuverndarsíðu Sjúkratrygginga](https://www.sjukra.is/personuvernd)', + description: 'More information about data handling', + }, }), dataProvider: defineMessages({ sectionTitle: { @@ -72,6 +66,16 @@ export const externalData = { 'Upplýsingar um nafn, kennitölu og heimilisfang. Upplýsingar um börn og maka.', description: 'Description: National Registry', }, + procureDescription: { + id: 'an.application:section.externalData.nationalRegistry.procureDescription', + defaultMessage: 'Upplýsingar um nafn, kennitölu og heimilisfang.', + description: 'Description: National Registry for procure holder', + }, + subTitle: { + id: 'an.application:section.externalData.nationalRegistry.subTitle', + defaultMessage: 'Hér sækjum við nafn, kennitölu og heimilisfang', + description: 'We will fetch name, national id and address', + }, }), accidentProvider: defineMessages({ title: { @@ -152,22 +156,4 @@ export const externalData = { 'Approval of gathering information from Approval of Municipal Collection Agency', }, }), - extraInformation: defineMessages({ - description: { - id: 'an.application:section.externalData.extraInformation.descriptionFirstPart', - defaultMessage: - 'Nánari upplýsingar um vinnslu persónuupplýsinga hjá Sjúkratryggingum Íslands ', - description: 'Description for link in extrainformation', - }, - linkText: { - id: 'an.application:section.externalData.extraInformation.linkText', - defaultMessage: 'Persónuverndarsíðu SÍ.', - description: 'Link text for link', - }, - link: { - id: 'an.application:section.externalData.extraInformation.link', - defaultMessage: 'https://www.sjukra.is/personuvernd.', - description: 'The url the link text links to', - }, - }), } diff --git a/libs/application/templates/accident-notification/src/lib/messages/whoIsTheNotificationFor.ts b/libs/application/templates/accident-notification/src/lib/messages/whoIsTheNotificationFor.ts index 0c5a1b8195b3..035a2a62108f 100644 --- a/libs/application/templates/accident-notification/src/lib/messages/whoIsTheNotificationFor.ts +++ b/libs/application/templates/accident-notification/src/lib/messages/whoIsTheNotificationFor.ts @@ -17,6 +17,11 @@ export const whoIsTheNotificationFor = { defaultMessage: `Hægt er að tilkynna slys í eigin nafni , fyrir aðra einstaklinga sem þú ert með skriflegt umboð frá eða fyrir starfsmann lögaðila. Foreldrar og forráðamenn geta líka sent inn tilkynningu fyrir hönd barna sem þeir fara með forsjá yfir. Stofnanir, samtök og félög sem eru virk á sviði persónuverndar geta sent inn tilkynningu án umboðs að uppfylltum skilyrðum 80. gr. reglugerðar (ESB) 2016/679 (almennu persónuverndarreglugerðarinnar).`, description: 'Description for who is the notifaction for', }, + procureDescription: { + id: 'an.application:whoIsTheNotificationFor.procureDescription', + defaultMessage: `Í umboði er hægt að tilkynna slys fyrir einstaklinga sem þú ert með umboð frá eða fyrir starfsmann lögaðila. Foreldrar og forráðamenn geta líka sent inn tilkynningu fyrir hönd barna sem þeir fara með forsjá yfir. Stofnanir, samtök og félög sem eru virk á sviði persónuverndar geta sent inn tilkynningu án umboðs að uppfylltum skilyrðum 80. gr. reglugerðar (ESB) 2016/679 (almennu persónuverndarreglugerðarinnar).`, + description: 'Description for who is the notifaction for', + }, }), labels: defineMessages({ juridicalPerson: { @@ -34,6 +39,11 @@ export const whoIsTheNotificationFor = { defaultMessage: 'Í umboði fyrir annan einstakling', description: 'Label for power of attorney option', }, + powerOfAttorneyProcure: { + id: 'an.application:whoIsTheNotificationFor.labels.powerOfAttorneyProcure', + defaultMessage: 'Einstakling', + description: 'Label for power of attorney option', + }, childInCustody: { id: 'an.application:whoIsTheNotificationFor.labels.childInCustody', defaultMessage: 'Fyrir barn í minni forsjá', diff --git a/libs/application/templates/accident-notification/src/types/index.ts b/libs/application/templates/accident-notification/src/types/index.ts index 1b3694a9b695..da316a4fd5f7 100644 --- a/libs/application/templates/accident-notification/src/types/index.ts +++ b/libs/application/templates/accident-notification/src/types/index.ts @@ -1,4 +1,4 @@ -import { NO, YES } from './../constants' +import { NO, YES } from '../utils/constants' export type CompanyInfo = { nationalRegistrationId: string @@ -58,11 +58,6 @@ export enum ChoiceEnum { NO = 'no', } -export enum DataProviderTypes { - NationalRegistry = 'NationalRegistryProvider', - UserProfile = 'UserProfileProvider', -} - export enum WhoIsTheNotificationForEnum { JURIDICALPERSON = 'juridicalPerson', ME = 'me', diff --git a/libs/application/templates/accident-notification/src/constants/index.ts b/libs/application/templates/accident-notification/src/utils/constants/index.ts similarity index 90% rename from libs/application/templates/accident-notification/src/constants/index.ts rename to libs/application/templates/accident-notification/src/utils/constants/index.ts index f17e43d36595..c13413335ab9 100644 --- a/libs/application/templates/accident-notification/src/constants/index.ts +++ b/libs/application/templates/accident-notification/src/utils/constants/index.ts @@ -7,6 +7,7 @@ export const FILE_SIZE_LIMIT = 10000000 // 10MB export enum States { // Draft flow + PREREQUISITES = 'prerequisites', DRAFT = 'draft', REVIEW = 'review', REVIEW_ADD_ATTACHMENT = 'reviewAddAttachment', diff --git a/libs/application/templates/accident-notification/src/utils/getWhoIstheNotificationForOptions.ts b/libs/application/templates/accident-notification/src/utils/getWhoIstheNotificationForOptions.ts new file mode 100644 index 000000000000..28910229cf83 --- /dev/null +++ b/libs/application/templates/accident-notification/src/utils/getWhoIstheNotificationForOptions.ts @@ -0,0 +1,32 @@ +import { WhoIsTheNotificationForEnum } from '../types' +import { whoIsTheNotificationFor } from '../lib/messages' + +export const whoIsTheNotificationForOptions = [ + { + value: WhoIsTheNotificationForEnum.ME, + label: whoIsTheNotificationFor.labels.me, + }, + { + value: WhoIsTheNotificationForEnum.POWEROFATTORNEY, + label: whoIsTheNotificationFor.labels.powerOfAttorney, + }, + { + value: WhoIsTheNotificationForEnum.JURIDICALPERSON, + label: whoIsTheNotificationFor.labels.juridicalPerson, + }, + { + value: WhoIsTheNotificationForEnum.CHILDINCUSTODY, + label: whoIsTheNotificationFor.labels.childInCustody, + }, +] + +export const whoIsTheNotificationForProcureOptions = [ + { + value: WhoIsTheNotificationForEnum.POWEROFATTORNEY, + label: whoIsTheNotificationFor.labels.powerOfAttorneyProcure, + }, + { + value: WhoIsTheNotificationForEnum.JURIDICALPERSON, + label: whoIsTheNotificationFor.labels.juridicalPerson, + }, +] diff --git a/libs/application/templates/accident-notification/src/utils/getWorkplaceData.spec.ts b/libs/application/templates/accident-notification/src/utils/getWorkplaceData.spec.ts index 83bd9755d9ad..45a3cb6d6a11 100644 --- a/libs/application/templates/accident-notification/src/utils/getWorkplaceData.spec.ts +++ b/libs/application/templates/accident-notification/src/utils/getWorkplaceData.spec.ts @@ -1,5 +1,5 @@ import { FormValue } from '@island.is/application/types' -import { YES } from '../constants' +import { YES } from './constants' import { AccidentTypeEnum, WorkAccidentTypeEnum } from '../types' import { getWorkplaceData } from './getWorkplaceData' diff --git a/libs/application/templates/accident-notification/src/utils/hasMissingDocuments.spec.ts b/libs/application/templates/accident-notification/src/utils/hasMissingDocuments.spec.ts index b36f131d049a..945c4858ce4f 100644 --- a/libs/application/templates/accident-notification/src/utils/hasMissingDocuments.spec.ts +++ b/libs/application/templates/accident-notification/src/utils/hasMissingDocuments.spec.ts @@ -4,7 +4,7 @@ import { hasReceivedAllDocuments, } from './hasMissingDocuments' import { WhoIsTheNotificationForEnum, AttachmentsEnum } from '../types' -import { NO, YES } from '../constants' +import { NO, YES } from './constants' import { FormatMessage } from '@island.is/localization' import { FormValue } from '@island.is/application/types' import { AccidentNotification } from '../lib/dataSchema' diff --git a/libs/application/templates/accident-notification/src/utils/hasMissingDocuments.ts b/libs/application/templates/accident-notification/src/utils/hasMissingDocuments.ts index 3c53fe8daf71..d262c07b6226 100644 --- a/libs/application/templates/accident-notification/src/utils/hasMissingDocuments.ts +++ b/libs/application/templates/accident-notification/src/utils/hasMissingDocuments.ts @@ -2,7 +2,7 @@ import { getValueViaPath } from '@island.is/application/core' import { FormValue } from '@island.is/application/types' import { FormatMessage } from '@island.is/localization' import { AttachmentsEnum, FileType, WhoIsTheNotificationForEnum } from '..' -import { YES } from '../constants' +import { YES } from './constants' import { attachments } from '../lib/messages' import { AccidentNotificationAttachmentStatus, diff --git a/libs/application/templates/accident-notification/src/utils/index.spec.ts b/libs/application/templates/accident-notification/src/utils/index.spec.ts index 33d834780e7d..9bde4080715f 100644 --- a/libs/application/templates/accident-notification/src/utils/index.spec.ts +++ b/libs/application/templates/accident-notification/src/utils/index.spec.ts @@ -1,5 +1,5 @@ import { FormatMessage } from '@island.is/localization' -import { YES } from '../constants' +import { YES } from './constants' import { AccidentNotification } from '../lib/dataSchema' import { AttachmentsEnum, WhoIsTheNotificationForEnum } from '../types' import { diff --git a/libs/application/templates/accident-notification/src/utils/index.ts b/libs/application/templates/accident-notification/src/utils/index.ts index 969019bb45bf..2c1059df92f6 100644 --- a/libs/application/templates/accident-notification/src/utils/index.ts +++ b/libs/application/templates/accident-notification/src/utils/index.ts @@ -1,6 +1,6 @@ import { AttachmentsEnum, FileType, WhoIsTheNotificationForEnum } from '..' import { getValueViaPath } from '@island.is/application/core' -import { YES } from '../constants' +import { YES } from './constants' import { AccidentNotification } from '../lib/dataSchema' import { attachments, overview } from '../lib/messages' import { FormatMessage } from '@island.is/localization' diff --git a/libs/application/templates/accident-notification/src/utils/isFatalAccident.spec.ts b/libs/application/templates/accident-notification/src/utils/isFatalAccident.spec.ts index e1e2118355d3..67b9f7bb25ec 100644 --- a/libs/application/templates/accident-notification/src/utils/isFatalAccident.spec.ts +++ b/libs/application/templates/accident-notification/src/utils/isFatalAccident.spec.ts @@ -1,6 +1,6 @@ import { FormValue } from '@island.is/application/types' import { isFatalAccident } from './isFatalAccident' -import { NO, YES } from '../constants' +import { NO, YES } from './constants' describe('isFatalAccident', () => { const fatal: FormValue = { diff --git a/libs/application/templates/accident-notification/src/utils/isFatalAccident.ts b/libs/application/templates/accident-notification/src/utils/isFatalAccident.ts index 3866ad16930f..4094c3efbc99 100644 --- a/libs/application/templates/accident-notification/src/utils/isFatalAccident.ts +++ b/libs/application/templates/accident-notification/src/utils/isFatalAccident.ts @@ -1,6 +1,6 @@ import { getValueViaPath } from '@island.is/application/core' import { FormValue } from '@island.is/application/types' -import { YES } from '../constants' +import { YES } from './constants' import { YesOrNo } from '../types' export const isFatalAccident = (formValue: FormValue) => { diff --git a/libs/application/templates/accident-notification/src/utils/isMachineRelatedAccident.spec.ts b/libs/application/templates/accident-notification/src/utils/isMachineRelatedAccident.spec.ts index 6a66f77d0ad2..017a1e679a26 100644 --- a/libs/application/templates/accident-notification/src/utils/isMachineRelatedAccident.spec.ts +++ b/libs/application/templates/accident-notification/src/utils/isMachineRelatedAccident.spec.ts @@ -1,5 +1,5 @@ import { FormValue } from '@island.is/application/types' -import { NO, YES } from '../constants' +import { NO, YES } from './constants' import { AccidentTypeEnum, WorkAccidentTypeEnum } from '../types' import { isMachineRelatedAccident } from './isMachineRelatedAccident' describe('isMachineRelatedAccident', () => { diff --git a/libs/application/templates/accident-notification/src/utils/isMachineRelatedAccident.ts b/libs/application/templates/accident-notification/src/utils/isMachineRelatedAccident.ts index 627f2da6c98b..fd3cabc5347b 100644 --- a/libs/application/templates/accident-notification/src/utils/isMachineRelatedAccident.ts +++ b/libs/application/templates/accident-notification/src/utils/isMachineRelatedAccident.ts @@ -1,6 +1,6 @@ import { getValueViaPath } from '@island.is/application/core' import { FormValue } from '@island.is/application/types' -import { YES } from '../constants' +import { YES } from './constants' import { YesOrNo } from '../types' import { isGeneralWorkplaceAccident } from './isGeneralWorkplaceAccident' diff --git a/libs/application/templates/accident-notification/src/utils/isRepresentativeOfCompanyOrInstitute.spec.ts b/libs/application/templates/accident-notification/src/utils/isRepresentativeOfCompanyOrInstitute.spec.ts index f1ce2bcfd63c..aeff9475efef 100644 --- a/libs/application/templates/accident-notification/src/utils/isRepresentativeOfCompanyOrInstitute.spec.ts +++ b/libs/application/templates/accident-notification/src/utils/isRepresentativeOfCompanyOrInstitute.spec.ts @@ -5,7 +5,7 @@ import { isInjuredAndRepresentativeOfCompanyOrInstitute, isRepresentativeOfCompanyOrInstitute, } from './isRepresentativeOfCompanyOrInstitute' -import { NO, YES } from '../constants' +import { NO, YES } from './constants' const emptyObject = {} diff --git a/libs/application/templates/accident-notification/src/utils/isRepresentativeOfCompanyOrInstitute.ts b/libs/application/templates/accident-notification/src/utils/isRepresentativeOfCompanyOrInstitute.ts index 77ba93c9a40a..f8c98b7b61f5 100644 --- a/libs/application/templates/accident-notification/src/utils/isRepresentativeOfCompanyOrInstitute.ts +++ b/libs/application/templates/accident-notification/src/utils/isRepresentativeOfCompanyOrInstitute.ts @@ -1,6 +1,6 @@ import { getValueViaPath } from '@island.is/application/core' import { FormValue } from '@island.is/application/types' -import { YES } from '../constants' +import { YES } from './constants' import { WhoIsTheNotificationForEnum } from '../types' export const isRepresentativeOfCompanyOrInstitute = (formValue: FormValue) => { diff --git a/libs/application/templates/announcement-of-death/src/types/index.ts b/libs/application/templates/announcement-of-death/src/types/index.ts index 191ffbeb2b7c..537b31b4a217 100644 --- a/libs/application/templates/announcement-of-death/src/types/index.ts +++ b/libs/application/templates/announcement-of-death/src/types/index.ts @@ -22,7 +22,3 @@ export interface Child { export interface NationalRegistry extends Person { children: Child[] } - -export enum DataProviderTypes { - NationalRegistry = 'NationalRegistryProvider', -} diff --git a/libs/application/templates/family-matters/children-residence-change-v2/src/types/index.ts b/libs/application/templates/family-matters/children-residence-change-v2/src/types/index.ts index 0a917b6ab728..9c90065864d8 100644 --- a/libs/application/templates/family-matters/children-residence-change-v2/src/types/index.ts +++ b/libs/application/templates/family-matters/children-residence-change-v2/src/types/index.ts @@ -23,9 +23,3 @@ export type CRCFieldBaseProps = Override< FieldBaseProps, { application: CRCApplication; errors: ErrorSchema } > - -export enum DataProviderTypes { - MockNationalRegistry = 'MockNationalRegistryProvider', - NationalRegistry = 'NationalRegistryProvider', - UserProfile = 'UserProfileProvider', -} diff --git a/libs/application/templates/general-fishing-license/src/dataProviders/index.ts b/libs/application/templates/general-fishing-license/src/dataProviders/index.ts index 90bb14e08174..57a090f5ae3d 100644 --- a/libs/application/templates/general-fishing-license/src/dataProviders/index.ts +++ b/libs/application/templates/general-fishing-license/src/dataProviders/index.ts @@ -20,5 +20,5 @@ export const ShipRegistryApi = defineTemplateApi({ }) export const IdentityApi = IdsApi.configure({ - externalDataId: 'identityRegistry', + externalDataId: 'identity', }) diff --git a/libs/application/templates/general-fishing-license/src/lib/dataSchema.ts b/libs/application/templates/general-fishing-license/src/lib/dataSchema.ts index 693e7797bf0b..90cfc3b6e76b 100644 --- a/libs/application/templates/general-fishing-license/src/lib/dataSchema.ts +++ b/libs/application/templates/general-fishing-license/src/lib/dataSchema.ts @@ -16,7 +16,7 @@ const FileSchema = z.object({ export const GeneralFishingLicenseSchema = z.object({ approveExternalData: z.boolean().refine((v) => v), externalData: z.object({ - identityRegistry: z.object({ + identity: z.object({ data: z.object({ date: z.string(), status: z.enum(['success', 'failure']), diff --git a/libs/application/templates/general-fishing-license/src/types/index.ts b/libs/application/templates/general-fishing-license/src/types/index.ts index 5c7c341f29b7..d5b63ee5f9d5 100644 --- a/libs/application/templates/general-fishing-license/src/types/index.ts +++ b/libs/application/templates/general-fishing-license/src/types/index.ts @@ -1,9 +1,3 @@ -export enum DataProviderTypes { - NationalRegistry = 'NationalRegistryProvider', - UserProfile = 'UserProfileProvider', - IdentityRegistry = 'IdentityProvider', -} - export enum FishingLicenseEnum { HOOKCATCHLIMIT = 'hookCatchLimit', FISHWITHDANISHSEINE = 'fishWithDanishSeine', // Dragnótaveiðileyfi diff --git a/libs/application/templates/public-debt-payment-plan/src/fields/Overview/Overview.tsx b/libs/application/templates/public-debt-payment-plan/src/fields/Overview/Overview.tsx index dc2d8f8c5f84..59646a7a88ad 100644 --- a/libs/application/templates/public-debt-payment-plan/src/fields/Overview/Overview.tsx +++ b/libs/application/templates/public-debt-payment-plan/src/fields/Overview/Overview.tsx @@ -53,7 +53,7 @@ export const Overview = ({ application, goToScreen }: FieldBaseProps) => { 'paymentPlans', ) as PaymentPlan[] - const identityRegistry = getValueViaPath( + const identity = getValueViaPath( application.externalData, 'identity', ) as IdentityResult @@ -138,14 +138,14 @@ export const Overview = ({ application, goToScreen }: FieldBaseProps) => { editAction('applicantSection')}> - {identityRegistry?.data?.name && ( + {identity?.data?.name && ( - {identityRegistry.data.name} + {identity.data.name} )} {applicant?.phoneNumber && ( @@ -158,12 +158,12 @@ export const Overview = ({ application, goToScreen }: FieldBaseProps) => { )} - {identityRegistry?.data?.address?.streetAddress && - identityRegistry?.data?.address?.postalCode && - identityRegistry?.data?.address?.city && ( + {identity?.data?.address?.streetAddress && + identity?.data?.address?.postalCode && + identity?.data?.address?.city && ( - {`${identityRegistry?.data?.address?.streetAddress}, ${identityRegistry?.data?.address?.postalCode} ${identityRegistry?.data?.address?.city}`} + {`${identity?.data?.address?.streetAddress}, ${identity?.data?.address?.postalCode} ${identity?.data?.address?.city}`} )} {applicant?.email && ( diff --git a/libs/application/ui-forms/src/lib/applicantInformationMultiField/applicantInformationMultiField.ts b/libs/application/ui-forms/src/lib/applicantInformationMultiField/applicantInformationMultiField.ts index 48052a903ad8..eaa4840bacd7 100644 --- a/libs/application/ui-forms/src/lib/applicantInformationMultiField/applicantInformationMultiField.ts +++ b/libs/application/ui-forms/src/lib/applicantInformationMultiField/applicantInformationMultiField.ts @@ -35,7 +35,7 @@ export const applicantInformationMultiField = ( disabled: true, defaultValue: (application: ApplicantInformationInterface) => application.externalData?.nationalRegistry?.data?.fullName ?? - application.externalData?.identityRegistry?.data?.name ?? + application.externalData?.identity?.data?.name ?? '', }), buildTextField({ @@ -47,7 +47,7 @@ export const applicantInformationMultiField = ( disabled: true, defaultValue: (application: ApplicantInformationInterface) => application.externalData?.nationalRegistry?.data?.nationalId ?? - application.externalData?.identityRegistry?.data?.nationalId ?? + application.externalData?.identity?.data?.nationalId ?? '', }), buildTextField({ @@ -59,8 +59,7 @@ export const applicantInformationMultiField = ( defaultValue: (application: ApplicantInformationInterface) => application.externalData?.nationalRegistry?.data?.address ?.streetAddress ?? - application.externalData?.identityRegistry?.data?.address - ?.streetAddress ?? + application.externalData?.identity?.data?.address?.streetAddress ?? '', }), buildTextField({ @@ -74,8 +73,7 @@ export const applicantInformationMultiField = ( return ( application.externalData?.nationalRegistry?.data?.address ?.postalCode ?? - application.externalData?.identityRegistry?.data?.address - ?.postalCode ?? + application.externalData?.identity?.data?.address?.postalCode ?? '' ) }, @@ -88,7 +86,7 @@ export const applicantInformationMultiField = ( disabled: true, defaultValue: (application: ApplicantInformationInterface) => application.externalData?.nationalRegistry?.data?.address?.city ?? - application.externalData?.identityRegistry?.data?.address?.city ?? + application.externalData?.identity?.data?.address?.city ?? '', }), buildTextField({ diff --git a/libs/application/ui-forms/src/lib/applicantInformationMultiField/types.ts b/libs/application/ui-forms/src/lib/applicantInformationMultiField/types.ts index eccb0b392c5d..e2f87089ef71 100644 --- a/libs/application/ui-forms/src/lib/applicantInformationMultiField/types.ts +++ b/libs/application/ui-forms/src/lib/applicantInformationMultiField/types.ts @@ -2,7 +2,7 @@ import { FormText } from '@island.is/application/types' export interface ApplicantInformationInterface { externalData: { // new dataprovider - identityRegistry: { + identity: { data: { name: 'string' nationalId: 'string' From de0bf4ccecc86a77600fc42e6e065da7cf7c7ce2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=BAnar=20Vestmann?= <43557895+RunarVestmann@users.noreply.github.com> Date: Thu, 12 Dec 2024 21:12:47 +0000 Subject: [PATCH 03/14] =?UTF-8?q?feat(web):=20Global=20search=20alias=20fo?= =?UTF-8?q?r=20'Vinnum=C3=A1lastofnun'=20(#17204)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> --- libs/content-search-toolkit/src/queries/search.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libs/content-search-toolkit/src/queries/search.ts b/libs/content-search-toolkit/src/queries/search.ts index d8bde3c182ea..82cdb3f98f53 100644 --- a/libs/content-search-toolkit/src/queries/search.ts +++ b/libs/content-search-toolkit/src/queries/search.ts @@ -35,6 +35,8 @@ export const searchQuery = ( // Handle aliases since the search engine has not been configured to support organization aliases if (queryString.trim().toLowerCase() === 'tr') { queryString = 'Tryggingastofnun' + } else if (queryString.trim().toLowerCase() === 'vmst') { + queryString = 'Vinnumálastofnun' } // * wildcard support for internal clients - eg. used by island.is app From 992ef025b28aadf8941bebe05e3c88d54ec19a4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=9Eorkell=20M=C3=A1ni=20=C3=9Eorkelsson?= Date: Thu, 12 Dec 2024 21:55:36 +0000 Subject: [PATCH 04/14] feat(web): updated grant status logic (#17127) * feat: updated status logic * feat: add time values * feat: add time part * chore: remove conidtional * chore: remove imports * fix: wrong message id * fix: add /en locale * fix: undefined if empty array --------- Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> --- apps/web/pages/en/grants-plaza/grant/[id].ts | 12 ++ .../web/pages/en/grants-plaza/grants/index.ts | 12 ++ apps/web/pages/en/grants-plaza/index.ts | 11 ++ .../web/screens/Grants/Grant/GrantSidebar.tsx | 23 ++- apps/web/screens/Grants/Home/GrantsHome.tsx | 3 +- .../SearchResults/SearchResultsContent.tsx | 22 +-- apps/web/screens/Grants/messages.ts | 30 +++- apps/web/screens/Grants/utils.ts | 138 ++++++++++++++-- apps/web/screens/queries/Grants.ts | 5 +- libs/cms/src/lib/cms.elasticsearch.service.ts | 30 +--- .../src/lib/generated/contentfulTypes.d.ts | 23 ++- libs/cms/src/lib/models/grant.model.ts | 156 ++++++++++++------ .../lib/search/importers/grants.service.ts | 12 +- 13 files changed, 347 insertions(+), 130 deletions(-) create mode 100644 apps/web/pages/en/grants-plaza/grant/[id].ts create mode 100644 apps/web/pages/en/grants-plaza/grants/index.ts create mode 100644 apps/web/pages/en/grants-plaza/index.ts diff --git a/apps/web/pages/en/grants-plaza/grant/[id].ts b/apps/web/pages/en/grants-plaza/grant/[id].ts new file mode 100644 index 000000000000..bc85b78454d8 --- /dev/null +++ b/apps/web/pages/en/grants-plaza/grant/[id].ts @@ -0,0 +1,12 @@ +import withApollo from '@island.is/web/graphql/withApollo' +import { withLocale } from '@island.is/web/i18n' +import GrantSinglePage from '@island.is/web/screens/Grants/Grant/Grant' +import { getServerSidePropsWrapper } from '@island.is/web/utils/getServerSidePropsWrapper' +// eslint-disable-next-line @typescript-eslint/ban-ts-comment +// @ts-ignore make web strict +// +const Screen = withApollo(withLocale('en')(GrantSinglePage)) + +export default Screen + +export const getServerSideProps = getServerSidePropsWrapper(Screen) diff --git a/apps/web/pages/en/grants-plaza/grants/index.ts b/apps/web/pages/en/grants-plaza/grants/index.ts new file mode 100644 index 000000000000..15cf49a9aa93 --- /dev/null +++ b/apps/web/pages/en/grants-plaza/grants/index.ts @@ -0,0 +1,12 @@ +import withApollo from '@island.is/web/graphql/withApollo' +import { withLocale } from '@island.is/web/i18n' +import GrantsSearchResults from '@island.is/web/screens/Grants/SearchResults/SearchResults' +import { getServerSidePropsWrapper } from '@island.is/web/utils/getServerSidePropsWrapper' +// eslint-disable-next-line @typescript-eslint/ban-ts-comment +// @ts-ignore make web strict +// +const Screen = withApollo(withLocale('en')(GrantsSearchResults)) + +export default Screen + +export const getServerSideProps = getServerSidePropsWrapper(Screen) diff --git a/apps/web/pages/en/grants-plaza/index.ts b/apps/web/pages/en/grants-plaza/index.ts new file mode 100644 index 000000000000..a95dff22d022 --- /dev/null +++ b/apps/web/pages/en/grants-plaza/index.ts @@ -0,0 +1,11 @@ +import withApollo from '@island.is/web/graphql/withApollo' +import { withLocale } from '@island.is/web/i18n' +import GrantsHome from '@island.is/web/screens/Grants/Home/GrantsHome' +import { getServerSidePropsWrapper } from '@island.is/web/utils/getServerSidePropsWrapper' +// eslint-disable-next-line @typescript-eslint/ban-ts-comment +// @ts-ignore make web strict +const Screen = withApollo(withLocale('en')(GrantsHome)) + +export default Screen + +export const getServerSideProps = getServerSidePropsWrapper(Screen) diff --git a/apps/web/screens/Grants/Grant/GrantSidebar.tsx b/apps/web/screens/Grants/Grant/GrantSidebar.tsx index fa83f4377950..77ac8aa2ac73 100644 --- a/apps/web/screens/Grants/Grant/GrantSidebar.tsx +++ b/apps/web/screens/Grants/Grant/GrantSidebar.tsx @@ -1,4 +1,5 @@ import { useMemo } from 'react' +import { useIntl } from 'react-intl' import { Box, @@ -16,7 +17,7 @@ import { Grant } from '@island.is/web/graphql/schema' import { LinkType, useLinkResolver } from '@island.is/web/hooks' import { m } from '../messages' -import { generateStatusTag } from '../utils' +import { generateStatusTag, parseStatus } from '../utils' interface Props { grant: Grant @@ -41,7 +42,7 @@ const generateSidebarPanel = ( data: Array, background: BoxProps['background'], ) => { - if (!data) { + if (!data.length) { return undefined } return ( @@ -53,7 +54,12 @@ const generateSidebarPanel = ( export const GrantSidebar = ({ grant, locale }: Props) => { const { linkResolver } = useLinkResolver() - const { formatMessage } = useLocale() + const { formatMessage } = useIntl() + + const status = useMemo( + () => parseStatus(grant, formatMessage, locale), + [grant, formatMessage, locale], + ) const detailPanelData = useMemo( () => @@ -95,20 +101,23 @@ export const GrantSidebar = ({ grant, locale }: Props) => { ), generateLine( formatMessage(m.single.deadline), - grant?.applicationDeadlineStatus ? ( - {grant.applicationDeadlineStatus} + status.deadlineStatus ? ( + {status.deadlineStatus} ) : undefined, ), generateLine( formatMessage(m.single.status), grant?.status ? ( - {generateStatusTag(grant.status, formatMessage)?.label} + { + generateStatusTag(status.applicationStatus, formatMessage) + ?.label + } ) : undefined, ), ].filter(isDefined) ?? [], - [grant, formatMessage, linkResolver], + [grant, formatMessage, linkResolver, status], ) const filesPanelData = useMemo( diff --git a/apps/web/screens/Grants/Home/GrantsHome.tsx b/apps/web/screens/Grants/Home/GrantsHome.tsx index 83ed0453f013..0b75b23ec399 100644 --- a/apps/web/screens/Grants/Home/GrantsHome.tsx +++ b/apps/web/screens/Grants/Home/GrantsHome.tsx @@ -42,8 +42,9 @@ const GrantsHomePage: CustomScreen = ({ locale, customPageData, }) => { - const { formatMessage } = useIntl() + const intl = useIntl() const { linkResolver } = useLinkResolver() + const { formatMessage } = intl const baseUrl = linkResolver('styrkjatorg', [], locale).href const searchUrl = linkResolver('styrkjatorgsearch', [], locale).href diff --git a/apps/web/screens/Grants/SearchResults/SearchResultsContent.tsx b/apps/web/screens/Grants/SearchResults/SearchResultsContent.tsx index 071b7f063483..d57cece2196d 100644 --- a/apps/web/screens/Grants/SearchResults/SearchResultsContent.tsx +++ b/apps/web/screens/Grants/SearchResults/SearchResultsContent.tsx @@ -1,4 +1,3 @@ -import { useIntl } from 'react-intl' import { useWindowSize } from 'react-use' import format from 'date-fns/format' import { useRouter } from 'next/router' @@ -13,7 +12,7 @@ import { Grant } from '@island.is/web/graphql/schema' import { useLinkResolver } from '@island.is/web/hooks' import { m } from '../messages' -import { generateStatusTag } from '../utils' +import { generateStatusTag, parseStatus } from '../utils' interface Props { grants?: Array @@ -44,6 +43,7 @@ export const SearchResultsContent = ({ grants, subheader, locale }: Props) => { return null } + const status = parseStatus(grant, formatMessage, locale) return ( {grant.applicationId && ( @@ -54,11 +54,10 @@ export const SearchResultsContent = ({ grants, subheader, locale }: Props) => { text={grant.description ?? ''} logo={grant.fund?.parentOrganization?.logo?.url ?? ''} logoAlt={grant.fund?.parentOrganization?.logo?.title ?? ''} - tag={ - grant.status - ? generateStatusTag(grant.status, formatMessage) - : undefined - } + tag={generateStatusTag( + status.applicationStatus, + formatMessage, + )} cta={{ label: formatMessage(m.general.seeMore), variant: 'text', @@ -80,14 +79,17 @@ export const SearchResultsContent = ({ grants, subheader, locale }: Props) => { text: `${format( new Date(grant.dateFrom), 'dd.MM.', - )}-${format(new Date(grant.dateTo), 'dd.MM.yyyy')}`, + )} - ${format( + new Date(grant.dateTo), + 'dd.MM.yyyy', + )}`, } : null, - grant.applicationDeadlineStatus + status.deadlineStatus ? { icon: 'time' as const, //todo: fix when the text is ready - text: grant.applicationDeadlineStatus, + text: status.deadlineStatus, } : undefined, grant.categoryTags diff --git a/apps/web/screens/Grants/messages.ts b/apps/web/screens/Grants/messages.ts index 3cc01d29b27d..4cb32b60e623 100644 --- a/apps/web/screens/Grants/messages.ts +++ b/apps/web/screens/Grants/messages.ts @@ -34,7 +34,7 @@ export const m = { }, applicationStatus: { id: 'web.grants:search.applicationStatus', - defaultMessage: 'Staða umsóknar', + defaultMessage: 'Staða umsókna', }, applicationOpen: { id: 'web.grants:search.applicationOpen', @@ -52,6 +52,34 @@ export const m = { id: 'web.grants:search.applicationSeeDescription', defaultMessage: 'Sjá lýsingu', }, + applicationOpensAt: { + id: 'web.grants:search.applicationOpensAt', + defaultMessage: 'Opnar {arg}', + }, + applicationEstimatedOpensAt: { + id: 'web.grants:search.applicationEstimatedOpensAt', + defaultMessage: 'Áætlað næst í {arg}', + }, + applicationOpensTo: { + id: 'web.grants:search.applicationOpensTo', + defaultMessage: 'Frestur til {arg}', + }, + applicationOpensToWithDay: { + id: 'web.grants:search.applicationOpensToWithDay', + defaultMessage: 'Frestur til og með {arg}', + }, + applicationWasOpenTo: { + id: 'web.grants:search.applicationWasOpenTo', + defaultMessage: 'Frestur var til {arg}', + }, + applicationWasOpenToAndWith: { + id: 'web.grants:search.applicationWasOpenToAndWith', + defaultMessage: 'Frestur var til og með {arg}', + }, + applicationAlwaysOpen: { + id: 'web.grants:search.applicationAlwaysOpen', + defaultMessage: 'Opið er allt árið', + }, category: { id: 'web.grants:search.category', defaultMessage: 'Flokkun', diff --git a/apps/web/screens/Grants/utils.ts b/apps/web/screens/Grants/utils.ts index 23ac43a63f74..86920ea957a4 100644 --- a/apps/web/screens/Grants/utils.ts +++ b/apps/web/screens/Grants/utils.ts @@ -1,29 +1,131 @@ -import { TagVariant } from '@island.is/island-ui/core' +import format from 'date-fns/format' +import localeEn from 'date-fns/locale/en-GB' +import localeIS from 'date-fns/locale/is' + import { FormatMessage } from '@island.is/localization' -import { GrantStatus } from '@island.is/web/graphql/schema' +import { Locale } from '@island.is/shared/types' +import { Grant, GrantStatus } from '@island.is/web/graphql/schema' + import { m } from './messages' +import { IntlFormatters, IntlShape } from 'react-intl' -export const generateStatusTag = ( - status: GrantStatus, - formatMessage: FormatMessage, -): { label: string; variant: TagVariant } | undefined => { - switch (status) { - case GrantStatus.Open: +interface Status { + applicationStatus: 'open' | 'closed' | 'unknown' + deadlineStatus: string + note?: string +} + +const formatDate = ( + date: Date, + locale: Locale, + stringFormat = 'dd.MMMM yyyy', +) => + format(date, stringFormat, { + locale: locale === 'is' ? localeIS : localeEn, + }) + +export const containsTimePart = (date: string) => date.includes('T') + +export const parseStatus = ( + grant: Grant, + formatMessage: IntlShape['formatMessage'], + locale: Locale, +): Status => { + switch (grant.status) { + case GrantStatus.Closed: { + return { + applicationStatus: 'closed', + deadlineStatus: grant.dateTo + ? formatMessage( + containsTimePart(grant.dateTo) + ? m.search.applicationWasOpenToAndWith + : m.search.applicationWasOpenTo, + { + arg: formatDate(new Date(grant.dateTo), locale), + }, + ) + : formatMessage(m.search.applicationClosed), + note: grant.statusText ?? undefined, + } + } + case GrantStatus.ClosedOpeningSoon: { + return { + applicationStatus: 'closed', + deadlineStatus: grant.dateFrom + ? formatMessage(m.search.applicationOpensAt, { + arg: formatDate(new Date(grant.dateFrom), locale), + }) + : formatMessage(m.search.applicationClosed), + note: grant.statusText ?? undefined, + } + } + case GrantStatus.ClosedOpeningSoonWithEstimation: { + return { + applicationStatus: 'closed', + deadlineStatus: grant.dateFrom + ? formatMessage(m.search.applicationEstimatedOpensAt, { + arg: formatDate(new Date(grant.dateFrom), locale, 'MMMM yyyy'), + }) + : formatMessage(m.search.applicationClosed), + note: grant.statusText ?? undefined, + } + } + case GrantStatus.ClosedWithNote: { + return { + applicationStatus: 'closed', + deadlineStatus: formatMessage(m.search.applicationSeeDescription), + note: grant.statusText ?? undefined, + } + } + case GrantStatus.AlwaysOpen: { return { - label: formatMessage(m.search.applicationOpen), - variant: 'mint', + applicationStatus: 'open', + deadlineStatus: formatMessage(m.search.applicationAlwaysOpen), + note: grant.statusText ?? undefined, } - case GrantStatus.Closed: + } + case GrantStatus.Open: { return { - label: formatMessage(m.search.applicationClosed), - variant: 'rose', + applicationStatus: 'open', + deadlineStatus: grant.dateTo + ? formatMessage( + containsTimePart(grant.dateTo) + ? m.search.applicationOpensToWithDay + : m.search.applicationOpensTo, + { + arg: formatDate(new Date(grant.dateTo), locale, 'dd.MMMM.'), + }, + ) + : formatMessage(m.search.applicationOpen), + note: grant.statusText ?? undefined, } - case GrantStatus.SeeDescription: + } + case GrantStatus.OpenWithNote: { return { - label: formatMessage(m.search.applicationSeeDescription), - variant: 'purple', + applicationStatus: 'open', + deadlineStatus: formatMessage(m.search.applicationSeeDescription), + note: grant.statusText ?? undefined, } - default: - return + } + default: { + return { + applicationStatus: 'unknown', + deadlineStatus: '', + } + } } } + +export const generateStatusTag = ( + status: Status['applicationStatus'], + formatMessage: IntlShape['formatMessage'], +) => + status !== 'unknown' + ? { + label: + status === 'open' + ? formatMessage(m.search.applicationOpen) + : formatMessage(m.search.applicationClosed), + variant: status === 'open' ? ('mint' as const) : ('rose' as const), + } + : undefined diff --git a/apps/web/screens/queries/Grants.ts b/apps/web/screens/queries/Grants.ts index 59160d38847b..cd120b0afcdc 100644 --- a/apps/web/screens/queries/Grants.ts +++ b/apps/web/screens/queries/Grants.ts @@ -16,8 +16,8 @@ export const GET_GRANTS_QUERY = gql` } dateFrom dateTo - isOpen status + statusText categoryTags { id title @@ -69,6 +69,9 @@ export const GET_GRANT_QUERY = gql` } applicationDeadlineStatus status + statusText + dateFrom + dateTo categoryTags { id title diff --git a/libs/cms/src/lib/cms.elasticsearch.service.ts b/libs/cms/src/lib/cms.elasticsearch.service.ts index e35685d85964..0a20025d9ed0 100644 --- a/libs/cms/src/lib/cms.elasticsearch.service.ts +++ b/libs/cms/src/lib/cms.elasticsearch.service.ts @@ -47,11 +47,8 @@ import { GenericListItem } from './models/genericListItem.model' import { GetTeamMembersInput } from './dto/getTeamMembers.input' import { TeamMemberResponse } from './models/teamMemberResponse.model' import { GetGrantsInput } from './dto/getGrants.input' -import { Grant, GrantStatus } from './models/grant.model' +import { Grant } from './models/grant.model' import { GrantList } from './models/grantList.model' -import { logger } from '@island.is/logging' -import { IGrantFields } from './generated/contentfulTypes' -import { isDefined } from '@island.is/shared/utils' @Injectable() export class CmsElasticsearchService { @@ -614,7 +611,6 @@ export class CmsElasticsearchService { search, page = 1, size = 8, - statuses, categories, types, organizations, @@ -719,30 +715,6 @@ export class CmsElasticsearchService { }) } - if (statuses) { - must.push({ - nested: { - path: 'tags', - query: { - bool: { - must: [ - { - terms: { - 'tags.key': statuses, - }, - }, - { - term: { - 'tags.type': 'status', - }, - }, - ], - }, - }, - }, - }) - } - const grantListResponse: ApiResponse> = await this.elasticService.findByQuery(index, { query: { diff --git a/libs/cms/src/lib/generated/contentfulTypes.d.ts b/libs/cms/src/lib/generated/contentfulTypes.d.ts index ec191a4968b0..aeb745479f33 100644 --- a/libs/cms/src/lib/generated/contentfulTypes.d.ts +++ b/libs/cms/src/lib/generated/contentfulTypes.d.ts @@ -1838,17 +1838,30 @@ export interface IGrantFields { /** Application hints */ grantApplicationHints?: Document | undefined - /** Date from */ + /** Open from */ grantDateFrom?: string | undefined - /** Date to */ + /** Open from hour */ + grantOpenFromHour?: number | undefined + + /** Open to */ grantDateTo?: string | undefined - /** Is open? */ - grantIsOpen?: boolean | undefined + /** Open to hour */ + grantOpenToHour?: number | undefined + + /** From date is estimated */ + grantFromDateIsEstimated?: boolean | undefined /** Status */ - grantStatus: 'open' | 'closed' | 'see_description' + grantStatus: + | 'Automatic' + | 'Always open' + | 'Open with note' + | 'Closed with note' + + /** Status Note */ + grantStatusNote?: string | undefined /** Files */ grantFiles?: Asset[] | undefined diff --git a/libs/cms/src/lib/models/grant.model.ts b/libs/cms/src/lib/models/grant.model.ts index b1f21752a40a..bd5f7247cc9b 100644 --- a/libs/cms/src/lib/models/grant.model.ts +++ b/libs/cms/src/lib/models/grant.model.ts @@ -1,6 +1,6 @@ import { Field, ObjectType, ID, registerEnumType } from '@nestjs/graphql' -import { IGrant } from '../generated/contentfulTypes' +import { IGrant, IGrantFields } from '../generated/contentfulTypes' import { GenericTag, mapGenericTag } from './genericTag.model' import { CacheField } from '@island.is/nest/graphql' import { mapDocument, SliceUnion } from '../unions/slice.union' @@ -9,10 +9,20 @@ import { ReferenceLink, mapReferenceLink } from './referenceLink.model' import { Fund, mapFund } from './fund.model' import { Link, mapLink } from './link.model' +import format from 'date-fns/format' +import addHours from 'date-fns/addHours' +import { isValidDate } from '@island.is/shared/utils' + export enum GrantStatus { CLOSED, + CLOSED_OPENING_SOON, + CLOSED_OPENING_SOON_WITH_ESTIMATION, + CLOSED_WITH_NOTE, OPEN, - SEE_DESCRIPTION, + OPEN_WITH_NOTE, + ALWAYS_OPEN, + INVALID, + UNKNOWN, } registerEnumType(GrantStatus, { name: 'GrantStatus' }) @@ -58,12 +68,12 @@ export class Grant { @Field({ nullable: true }) dateTo?: string - @Field({ nullable: true }) - isOpen?: boolean - @CacheField(() => GrantStatus, { nullable: true }) status?: GrantStatus + @Field({ nullable: true }) + statusText?: string + @CacheField(() => [Asset], { nullable: true }) files?: Array @@ -80,50 +90,94 @@ export class Grant { fund?: Fund } -export const mapGrant = ({ fields, sys }: IGrant): Grant => ({ - id: sys.id, - name: fields.grantName, - description: fields.grantDescription, - applicationId: fields.grantApplicationId, - applicationDeadlineStatus: fields.grantApplicationDeadlineStatus, - applicationUrl: fields.granApplicationUrl?.fields - ? mapReferenceLink(fields.granApplicationUrl) - : undefined, - specialEmphasis: fields.grantSpecialEmphasis - ? mapDocument(fields.grantSpecialEmphasis, sys.id + ':special-emphasis') - : [], - whoCanApply: fields.grantWhoCanApply - ? mapDocument(fields.grantWhoCanApply, sys.id + ':who-can-apply') - : [], - howToApply: fields.grantHowToApply - ? mapDocument(fields.grantHowToApply, sys.id + ':how-to-apply') - : [], - applicationDeadline: fields.grantApplicationDeadline - ? mapDocument( - fields.grantApplicationDeadline, - sys.id + ':application-deadline', - ) - : [], - applicationHints: fields.grantApplicationHints - ? mapDocument(fields.grantApplicationHints, sys.id + ':application-hints') - : [], - dateFrom: fields.grantDateFrom, - dateTo: fields.grantDateTo, - isOpen: fields.grantIsOpen ?? undefined, - status: - fields.grantStatus === 'open' - ? GrantStatus.OPEN - : fields.grantStatus === 'closed' - ? GrantStatus.CLOSED - : fields.grantStatus === 'see_description' - ? GrantStatus.SEE_DESCRIPTION +const parseStatus = (fields: IGrantFields): GrantStatus => { + switch (fields.grantStatus) { + case 'Automatic': { + const parsedDateTo = new Date(fields.grantDateTo ?? '') + const parsedDateFrom = new Date(fields.grantDateFrom ?? '') + + if (!isValidDate(parsedDateTo) || !isValidDate(parsedDateFrom)) { + return GrantStatus.INVALID + } + + const today = new Date() + + //opens soon! + if (today <= parsedDateFrom) { + return fields.grantFromDateIsEstimated + ? GrantStatus.CLOSED_OPENING_SOON_WITH_ESTIMATION + : GrantStatus.CLOSED_OPENING_SOON + } + if (today <= parsedDateTo) { + return GrantStatus.OPEN + } + return GrantStatus.CLOSED + } + case 'Always open': + return GrantStatus.ALWAYS_OPEN + case 'Closed with note': + return GrantStatus.CLOSED_WITH_NOTE + case 'Open with note': + return GrantStatus.OPEN_WITH_NOTE + default: + return GrantStatus.UNKNOWN + } +} + +const parseDate = (date?: string, time?: number): string | undefined => { + if (!date) { + return + } + const parsedDate = new Date(date) + if (!time) { + return format(parsedDate, 'yyyy-MM-dd') + } + return addHours(new Date(date), time).toISOString() +} + +export const mapGrant = ({ fields, sys }: IGrant): Grant => { + return { + id: sys.id, + name: fields.grantName, + description: fields.grantDescription, + applicationId: fields.grantApplicationId, + applicationDeadlineStatus: fields.grantApplicationDeadlineStatus, + applicationUrl: fields.granApplicationUrl?.fields + ? mapReferenceLink(fields.granApplicationUrl) + : undefined, + + specialEmphasis: fields.grantSpecialEmphasis + ? mapDocument(fields.grantSpecialEmphasis, sys.id + ':special-emphasis') + : [], + whoCanApply: fields.grantWhoCanApply + ? mapDocument(fields.grantWhoCanApply, sys.id + ':who-can-apply') + : [], + howToApply: fields.grantHowToApply + ? mapDocument(fields.grantHowToApply, sys.id + ':how-to-apply') + : [], + applicationDeadline: fields.grantApplicationDeadline + ? mapDocument( + fields.grantApplicationDeadline, + sys.id + ':application-deadline', + ) + : [], + applicationHints: fields.grantApplicationHints + ? mapDocument(fields.grantApplicationHints, sys.id + ':application-hints') + : [], + dateFrom: parseDate(fields.grantDateFrom, fields.grantOpenFromHour), + dateTo: parseDate(fields.grantDateTo, fields.grantOpenToHour), + status: parseStatus(fields), + statusText: fields.grantStatusNote, + fund: fields.grantFund ? mapFund(fields.grantFund) : undefined, + files: (fields.grantFiles ?? []).map((file) => mapAsset(file)) ?? [], + supportLinks: + (fields.grantSupportLinks ?? []).map((link) => mapLink(link)) ?? [], + + categoryTags: fields.grantCategoryTags + ? fields.grantCategoryTags.map((tag) => mapGenericTag(tag)) + : undefined, + typeTag: fields.grantTypeTag + ? mapGenericTag(fields.grantTypeTag) : undefined, - fund: fields.grantFund ? mapFund(fields.grantFund) : undefined, - files: (fields.grantFiles ?? []).map((file) => mapAsset(file)) ?? [], - supportLinks: - (fields.grantSupportLinks ?? []).map((link) => mapLink(link)) ?? [], - categoryTags: fields.grantCategoryTags - ? fields.grantCategoryTags.map((tag) => mapGenericTag(tag)) - : undefined, - typeTag: fields.grantTypeTag ? mapGenericTag(fields.grantTypeTag) : undefined, -}) + } +} diff --git a/libs/cms/src/lib/search/importers/grants.service.ts b/libs/cms/src/lib/search/importers/grants.service.ts index 7df8c4328ef6..3a58a59778d5 100644 --- a/libs/cms/src/lib/search/importers/grants.service.ts +++ b/libs/cms/src/lib/search/importers/grants.service.ts @@ -109,14 +109,9 @@ export class GrantsSyncService implements CmsSyncProvider { } switch (mapped.status) { - case GrantStatus.SEE_DESCRIPTION: - tags.push({ - key: 'see_description', - type: 'status', - value: 'see_description', - }) - break case GrantStatus.OPEN: + case GrantStatus.ALWAYS_OPEN: + case GrantStatus.OPEN_WITH_NOTE: tags.push({ key: 'open', type: 'status', @@ -124,6 +119,9 @@ export class GrantsSyncService implements CmsSyncProvider { }) break case GrantStatus.CLOSED: + case GrantStatus.CLOSED_OPENING_SOON: + case GrantStatus.CLOSED_OPENING_SOON_WITH_ESTIMATION: + case GrantStatus.CLOSED_WITH_NOTE: tags.push({ key: 'closed', type: 'status', From b22fd0a545d8de86e1a31e82029afd404d91fc07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B3nas=20G=2E=20Sigur=C3=B0sson?= Date: Thu, 12 Dec 2024 22:26:22 +0000 Subject: [PATCH 05/14] chore(inao-cem): Refactor custom components and fetch tax data (#17195) * chore: houskeeping, split up files and make code more radable * chore: refactor out custom components * fix: remove imports from codeowners * chore: remove console.log * chore: add loading state * chore: simplify logic * fix: coderabbit comments * fix: match indentation to lint * fix: codeowners * chore: add space to match indentation * chore: remove the inao folder from codeowners * chore: . * fix: typo in path * fix: indentation --------- Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> --- .github/CODEOWNERS | 780 +++++++++--------- .../src/dataProviders/index.ts | 13 +- .../src/fields/CemeteryIncomeLimit/index.tsx | 43 - .../fields/CemeteryOverview/AboutOverview.tsx | 48 +- .../CapitalNumbersOverview.tsx | 37 +- .../src/fields/CemeteryOverview/index.tsx | 153 +--- .../FetchDataBasedOnSelectedYear/index.tsx | 123 +++ .../src/fields/PowerOfAttorney/index.tsx | 96 --- .../src/fields/index.ts | 3 +- .../caretakerMultiField.ts | 17 - .../cemeteryCaretakerSection/index.ts | 29 +- .../index.ts | 22 +- .../capitalNumberSubSection.ts | 2 +- .../equityAndLiabilitySubSection.ts | 8 +- .../opperatingCostSubSection.ts | 6 +- .../clientInfoSection/index.ts | 62 +- .../src/hooks/useTotals.ts | 21 - .../src/lib/dataSchema.ts | 6 +- .../src/types/types.ts | 16 + .../src/utils/constants.ts | 1 + .../src/utils/currency.ts | 16 + .../src/utils/helpers.ts | 312 ++----- .../src/utils/overviewUtils.ts | 189 +++++ .../src/utils/sums.ts | 225 +++++ 24 files changed, 1190 insertions(+), 1038 deletions(-) delete mode 100644 libs/application/templates/inao/financial-statement-cemetery/src/fields/CemeteryIncomeLimit/index.tsx create mode 100644 libs/application/templates/inao/financial-statement-cemetery/src/fields/FetchDataBasedOnSelectedYear/index.tsx delete mode 100644 libs/application/templates/inao/financial-statement-cemetery/src/fields/PowerOfAttorney/index.tsx delete mode 100644 libs/application/templates/inao/financial-statement-cemetery/src/forms/applicationForm/cemeteryCaretakerSection/caretakerMultiField.ts delete mode 100644 libs/application/templates/inao/financial-statement-cemetery/src/hooks/useTotals.ts create mode 100644 libs/application/templates/inao/financial-statement-cemetery/src/utils/currency.ts create mode 100644 libs/application/templates/inao/financial-statement-cemetery/src/utils/overviewUtils.ts create mode 100644 libs/application/templates/inao/financial-statement-cemetery/src/utils/sums.ts diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index d9d7ad29b0f6..f4bc0d23934e 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -6,401 +6,409 @@ # Organisation name is @island-is, not @island.is # Fallback. If there is no owner, assign to core maintainers. -* @island-is/core +* @island-is/core # Top level project ownership. When a project contains, for example, templates or modules # that are developed by others teams, we first list down the team working on the core and # further below the other team working on other part of the project. -/apps/application-system/ @island-is/norda-applications -/apps/web*/ @island-is/juni @island-is/stefna -/libs/application/ @island-is/norda-applications -/libs/portals/my-pages/ @island-is/hugsmidjan -/libs/portals/admin/ @island-is/aranja -/libs/portals/core/ @island-is/aranja @island-is/hugsmidjan -/libs/shared/connected/ @island-is/stefna - -/* @island-is/core -/libs/api/domains/identity/ @island-is/core +/apps/application-system/ @island-is/norda-applications +/apps/web*/ @island-is/juni @island-is/stefna +/libs/application/ @island-is/norda-applications +/libs/portals/my-pages/ @island-is/hugsmidjan +/libs/portals/admin/ @island-is/aranja +/libs/portals/core/ @island-is/aranja @island-is/hugsmidjan +/libs/shared/connected/ @island-is/stefna + +/* @island-is/core +/libs/api/domains/identity/ @island-is/core # Edge case escaping the /infra/ and **/infra/ devops patterns below -/libs/infra-nest-server/src/lib/infra/ @island-is/core -/libs/testing/ @island-is/core -/libs/nest/swagger/ @island-is/core - -/apps/services/endorsements/ @island-is/juni -/apps/icelandic-names-registry*/ @island-is/juni -/apps/web/screens/PetitionView/ @island-is/juni -/libs/cms/ @island-is/juni @island-is/stefna -/libs/clients/cms/ @island-is/juni @island-is/aranja -/libs/residence-history @island-is/juni -/libs/api/domains/endorsement-system @island-is/juni -/libs/api/domains/icelandic-names-registry/ @island-is/juni -/libs/clients/rsk/ @island-is/juni -/libs/clients/zendesk/ @island-is/juni -/libs/icelandic-names-registry/ @island-is/juni -/libs/portals/my-pages/petitions/ @island-is/juni -/libs/portals/my-pages/signature-collection/ @island-is/juni -/libs/portals/my-pages/education/ @island-is/juni @island-is/hugsmidjan -/libs/portals/my-pages/education-career/ @island-is/juni @island-is/hugsmidjan -/libs/portals/my-pages/education-degree/ @island-is/juni @island-is/hugsmidjan -/libs/portals/my-pages/education-license/ @island-is/juni @island-is/hugsmidjan -/libs/portals/my-pages/education-student-assessment/ @island-is/juni @island-is/norda @island-is/hugsmidjan -/libs/clients/driving-license/ @island-is/juni -/libs/clients/judicial-administration/ @island-is/juni -/libs/application/templates/announcement-of-death/ @island-is/juni -/libs/application/template-api-modules/src/lib/modules/templates/announcement-of-death @island-is/juni -/libs/application/templates/driving-license/ @island-is/juni -/libs/application/templates/driving-assessment-approval/ @island-is/juni -/libs/application/templates/driving-learners-permit/ @island-is/juni -/libs/application/template-api-modules/src/lib/modules/templates/driving-learners-permit/ @island-is/juni -/libs/application/template-api-modules/src/lib/modules/templates/driving-license-submission @island-is/juni -/libs/api/domains/driving-license/ @island-is/juni -/libs/api/domains/education/ @island-is/juni @island-is/hugsmidjan @island-is/deloitte -/libs/application/templates/estate/ @island-is/juni -/libs/application/template-api-modules/src/lib/modules/templates/estate @island-is/juni -/libs/application/templates/general-petition/ @island-is/juni -/libs/shared/connected/src/lib/generalPetition/GeneralPetitionLists/ @island-is/juni -/libs/shared/connected/src/lib/SignatureLists/ @island-is/juni -/libs/api/domains/communications/ @island-is/juni @island-is/stefna -/apps/services/user-notification/ @island-is/juni @island-is/aranja -/apps/air-discount-scheme/ @island-is/hugsmidjan -/libs/air-discount-scheme/ @island-is/hugsmidjan -/libs/application/templates/p-sign/ @island-is/juni -/libs/application/template-api-modules/src/lib/modules/templates/p-sign-submission @island-is/juni -/libs/application/templates/marriage-conditions/ @island-is/juni -/libs/application/template-api-modules/src/lib/modules/templates/marriage-conditions-submission @island-is/juni -/libs/message-queue/ @island-is/juni -/libs/application/templates/example-payment/ @island-is/juni -/libs/application/template-api-modules/src/lib/modules/templates/example-payment-actions @island-is/juni -/libs/application/templates/driving-school-confirmation/ @island-is/juni -/libs/application/templates/driving-instructor-registrations/ @island-is/juni -/libs/api/domains/driving-license-book/ @island-is/juni -/libs/clients/driving-license-book/ @island-is/juni -/libs/application/template-api-modules/src/lib/modules/templates/passport @island-is/juni -/libs/application/templates/passport/ @island-is/juni -/libs/application/template-api-modules/src/lib/modules/templates/passport-annulment @island-is/juni -/libs/application/templates/passport-annulment/ @island-is/juni -/libs/application/template-api-modules/src/lib/modules/templates/driving-school-confirmation/ @island-is/juni -/libs/application/templates/operating-license/ @island-is/juni -/libs/application/template-api-modules/src/lib/modules/templates/operating-license/ @island-is/juni -/libs/application/templates/driving-license-duplicate/ @island-is/juni -/libs/application/template-api-modules/src/lib/modules/templates/driving-license-duplicate/ @island-is/juni -/libs/application/templates/inheritance-report/ @island-is/juni -/libs/application/template-api-modules/src/lib/modules/templates/inheritance-report @island-is/juni -/libs/application/templates/signature-collection @island-is/juni -/libs/api/domains/disability-license @island-is/juni -/libs/portals/admin/petition @island-is/juni -/libs/portals/admin/signature-collection @island-is/juni -/libs/portals/admin/icelandic-names-registry @island-is/juni -/libs/api/domains/signature-collection @island-is/juni -/libs/clients/signature-collection @island-is/juni -/libs/application/template-api-modules/src/lib/modules/templates/signature-collection @island-is/juni -/libs/application/template-api-modules/src/lib/modules/templates/general-petition @island-is/juni - -/apps/portals/admin/ @island-is/aranja -/libs/api/domains/auth-admin/ @island-is/aranja -/libs/api/domains/sessions/ @island-is/aranja -/libs/clients/auth/ @island-is/aranja -/libs/clients/middlewares/ @island-is/aranja -libs/clients/rsk/relationships/ @island-is/aranja -/libs/clients/sessions @island-is/aranja -/libs/portals/shared-modules/delegations @island-is/aranja -/libs/portals/admin/ids-admin @island-is/aranja -/libs/portals/my-pages/consent @island-is/aranja -/libs/portals/my-pages/restrictions @island-is/aranja -/libs/portals/my-pages/sessions @island-is/aranja -/apps/native/app/ @island-is/aranja-app -codemagic.yaml @island-is/aranja-app -/apps/web/public/.well-known/ @island-is/aranja-app - -/apps/judicial-system/ @island-is/kolibri-justice-league -/libs/judicial-system/ @island-is/kolibri-justice-league -/libs/nova-sms/ @island-is/kolibri-justice-league -/libs/dokobit-signing/ @island-is/kolibri-justice-league -/libs/email-service/ @island-is/kolibri-justice-league - -/apps/financial-aid/ @island-is/kolibri-robin-hood -/libs/financial-aid/ @island-is/kolibri-robin-hood -/libs/next-ids-auth/ @island-is/kolibri-robin-hood -/libs/clients/rsk/personal-tax-return @island-is/kolibri-robin-hood -/libs/application/templates/financial-aid/ @island-is/kolibri-robin-hood -/libs/api/domains/municipalities-financial-aid @island-is/kolibri-robin-hood -/libs/clients/municipalities-financial-aid @island-is/kolibri-robin-hood -/libs/application/template-api-modules/src/lib/modules/templates/financial-aid @island-is/kolibri-robin-hood - -/apps/download-service/ @island-is/hugsmidjan -/apps/portals/my-pages*/ @island-is/hugsmidjan -/apps/services/regulations-admin-backend/ @island-is/hugsmidjan -/apps/services/user-profile/ @island-is/hugsmidjan @island-is/juni @island-is/aranja -/apps/web/components/Grant/ @island-is/hugsmidjan -/apps/web/components/PlazaCard/ @island-is/hugsmidjan -/apps/web/screens/Grants/ @island-is/hugsmidjan -/apps/web/screens/Regulations/ @island-is/hugsmidjan -/apps/web/components/Regulations/ @island-is/hugsmidjan -/apps/web/screens/OfficialJournalOfIceland/ @island-is/hugsmidjan -/apps/web/components/OfficialJournalOfIceland/ @island-is/hugsmidjan -/libs/api/domains/air-discount-scheme @island-is/hugsmidjan -/libs/api/domains/documents/ @island-is/hugsmidjan -/libs/api/domains/finance/ @island-is/hugsmidjan -/libs/api/domains/assets/ @island-is/hugsmidjan -/libs/api/domains/health-directorate/ @island-is/hugsmidjan -/libs/api/domains/hms-loans/ @island-is/hugsmidjan -/libs/api/domains/license-service/ @island-is/hugsmidjan @island-is/aranja -/libs/api/domains/work-machines/ @island-is/hugsmidjan @island-is/origo -/libs/api/domains/national-registry/ @island-is/hugsmidjan -/libs/api/domains/notifications/ @island-is/hugsmidjan -/libs/api/domains/user-profile/ @island-is/hugsmidjan @island-is/juni @island-is/aranja -/libs/api/domains/passport/ @island-is/hugsmidjan -/libs/api/domains/vehicles/ @island-is/hugsmidjan -/libs/api/domains/university-careers/ @island-is/hugsmidjan -/libs/api/domains/regulations/ @island-is/hugsmidjan -/libs/api/domains/regulations-admin/ @island-is/hugsmidjan -/libs/api/domains/rights-portal @island-is/hugsmidjan -/libs/api/domains/social-insurance @island-is/hugsmidjan @island-is/stefna -/libs/api/domains/occupational-licenses/ @island-is/hugsmidjan -/libs/api/domains/occupational-licenses-v2/ @island-is/hugsmidjan -/libs/api/domains/intellectual-properties/ @island-is/hugsmidjan -/libs/api/domains/official-journal-of-iceland/ @island-is/hugsmidjan -/libs/api/domains/official-journal-of-iceland-application/ @island-is/hugsmidjan -/libs/api/domains/document-provider/ @island-is/hugsmidjan @island-is/core -/libs/api/domains/housing-benefits/ @island-is/hugsmidjan -/libs/api/domains/law-and-order/ @island-is/hugsmidjan -/libs/clients/documents/ @island-is/hugsmidjan -/libs/clients/documents-v2/ @island-is/hugsmidjan -/libs/clients/finance/ @island-is/hugsmidjan -/libs/clients/finance-v2/ @island-is/hugsmidjan -/libs/clients/adr-and-machine-license/ @island-is/hugsmidjan -/libs/clients/work-machines/ @island-is/hugsmidjan @island-is/origo -/libs/clients/disability-license/ @island-is/hugsmidjan -/libs/clients/firearm-license/ @island-is/hugsmidjan -/libs/clients/hunting-license/ @island-is/hugsmidjan -/libs/clients/smartsolutions/ @island-is/hugsmidjan -/libs/clients/smart-solutions-v2/ @island-is/hugsmidjan -/libs/clients/license-client/ @island-is/hugsmidjan @island-is/aranja -/libs/clients/intellectual-properties/ @island-is/hugsmidjan -/libs/clients/islykill/ @island-is/hugsmidjan -/libs/clients/national-registry/v3/ @island-is/hugsmidjan -/libs/clients/district-commissioners-licenses/ @island-is/hugsmidjan -/libs/clients/regulations/ @island-is/hugsmidjan -/libs/clients/vehicles/ @island-is/hugsmidjan @island-is/stefna -/libs/clients/vehicles-mileage/ @island-is/hugsmidjan -/libs/clients/user-notification/ @island-is/hugsmidjan -/libs/clients/passports/ @island-is/hugsmidjan -/libs/clients/p-card/ @island-is/hugsmidjan -/libs/clients/assets/ @island-is/hugsmidjan -/libs/clients/university-careers/ @island-is/hugsmidjan -/libs/clients/regulations-admin/ @island-is/hugsmidjan -/libs/clients/inna/ @island-is/hugsmidjan -/libs/clients/hms-loans/ @island-is/hugsmidjan -/libs/clients/official-journal-of-iceland/ @island-is/hugsmidjan -/libs/clients/hms-housing-benefits/ @island-is/hugsmidjan -/apps/services/license-api/ @island-is/hugsmidjan -/libs/regulations/ @island-is/hugsmidjan -/libs/portals/admin/regulations-admin/ @island-is/hugsmidjan -/libs/portals/admin/document-provider/ @island-is/hugsmidjan @island-is/core -/libs/clients/icelandic-health-insurance/rights-portal/ @island-is/hugsmidjan -/libs/clients/health-directorate @island-is/hugsmidjan -/libs/clients/health-directorate/src/lib/clients/occupational-license @island-is/hugsmidjan @island-is/origo -/libs/clients/mms/grade @island-is/hugsmidjan -/libs/portals/admin/air-discount-scheme @island-is/hugsmidjan -/libs/application/templates/official-journal-of-iceland/ @island-is/hugsmidjan -/libs/application/template-api-modules/src/lib/modules/templates/official-journal-of-iceland/ @island-is/hugsmidjan -/libs/clients/judicial-system-sp/ @island-is/hugsmidjan -/libs/application/templates/data-protection-complaint/ @island-is/norda -/libs/application/templates/institution-collaboration/ @island-is/norda @island-is/fuglar -/libs/application/templates/login-service/ @island-is/norda -/libs/application/template-api-modules/src/lib/modules/templates/login-service/ @island-is/norda -/libs/clients/payment-schedule/ @island-is/norda -/libs/api/domains/payment-schedule/ @island-is/norda -/libs/application/templates/funding-government-projects/ @island-is/norda -/libs/application/template-api-modules/src/lib/modules/templates/funding-government-projects/ @island-is/norda -/libs/application/template-api-modules/src/lib/modules/templates/institution-collaboration/ @island-is/norda -/libs/application/templates/public-debt-payment-plan/ @island-is/norda -/libs/application/templates/complaints-to-althingi-ombudsman/ @island-is/norda -/libs/application/template-api-modules/src/lib/modules/templates/complaints-to-althingi-ombudsman/ @island-is/norda -/libs/application/templates/accident-notification/ @island-is/norda -/libs/application/template-api-modules/src/lib/modules/templates/accident-notification/ @island-is/norda -/libs/application/template-api-modules/src/lib/modules/templates/health-insurance/ @island-is/norda -/libs/application/template-api-modules/src/lib/modules/templates/public-debt-payment-plan @island-is/norda -/libs/api/domains/health-insurance/ @island-is/norda -/libs/application/templates/health-insurance/ @island-is/norda -/libs/clients/rsk/company-registry @island-is/norda -/libs/clients/althingi-ombudsman/ @island-is/norda -/libs/api/domains/company-registry @island-is/norda -/libs/clients/icelandic-health-insurance/health-insurance/ @island-is/norda -/libs/clients/data-protection-complaint/ @island-is/norda -/libs/clients/fishing-license/ @island-is/norda -/libs/api/domains/fishing-license/ @island-is/norda -/libs/application/templates/general-fishing-license/ @island-is/norda -/libs/application/template-api-modules/src/lib/modules/templates/general-fishing-license/ @island-is/norda -/libs/application/template-api-modules/src/lib/modules/templates/data-protection-complaint/ @island-is/norda -/libs/shared/form-fields/ @island-is/norda @island-is/island-ui -/libs/clients/financial-statements-inao @island-is/norda -/libs/api/domains/financial-statements-inao/ @island-is/norda -/libs/application/templates/financial-statements-inao/ @island-is/norda -/libs/application/template-api-modules/src/lib/modules/templates/financial-statements-inao @island-is/norda - -/libs/portals/my-pages/applications/ @island-is/norda-applications -/libs/portals/admin/application-system/ @island-is/norda-applications -/libs/api/domains/application/ @island-is/norda-applications -/libs/api/domains/payment/ @island-is/norda-applications - -/apps/contentful-apps/ @island-is/stefna -/apps/services/search-indexer/ @island-is/stefna @island-is/juni -/apps/services/contentful-entry-tagger/ @island-is/stefna -/apps/tools/contentful-role-permissions/ @island-is/stefna -/apps/web/screens/Organization/ @island-is/stefna -/apps/web/screens/Project/ @island-is/stefna -/apps/web/components/Organization/ @island-is/stefna -/apps/web/components/ChatPanel/ @island-is/stefna -/apps/web/components/Form/ @island-is/stefna -/apps/web/components/Stepper/ @island-is/stefna -/libs/content-search-toolkit/ @island-is/stefna @island-is/juni -/libs/content-search-index-manager/ @island-is/stefna @island-is/juni -/libs/content-search-metrics/ @island-is/stefna @island-is/juni -/libs/content-search-indexer/ @island-is/stefna @island-is/juni -/libs/api/domains/content-search/ @island-is/stefna @island-is/juni -/libs/api/domains/syslumenn/ @island-is/stefna -/libs/api/domains/email-signup/ @island-is/stefna -/libs/api/domains/electronic-registration-statistics/ @island-is/stefna -/libs/clients/electronic-registration-statistics/ @island-is/stefna -/libs/api/domains/fiskistofa/ @island-is/stefna -/libs/clients/fiskistofa/ @island-is/stefna -/libs/clients/syslumenn/ @island-is/stefna @island-is/juni -/libs/api/domains/watson-assistant-chat/ @island-is/stefna -/libs/clients/icelandic-government-institution-vacancies/ @island-is/stefna -/libs/api/domains/icelandic-government-institution-vacancies/ @island-is/stefna -/libs/clients/aircraft-registry/ @island-is/stefna -/libs/api/domains/aircraft-registry/ @island-is/stefna -/libs/api/domains/housing-benefit-calculator/ @island-is/stefna -/libs/clients/housing-benefit-calculator/ @island-is/stefna -/libs/clients/ship-registry/ @island-is/stefna -/libs/api/domains/ship-registry/ @island-is/stefna -/libs/clients/administration-of-occupational-safety-and-health/ @island-is/stefna -/libs/api/domains/administration-of-occupational-safety-and-health/ @island-is/stefna -/libs/clients/ultraviolet-radiation/ @island-is/stefna -/libs/clients/ums-cost-of-living-calculator/ @island-is/stefna -/libs/api/domains/umbodsmadur-skuldara/ @island-is/stefna - -/libs/island-ui/ @island-is/island-ui - -/apps/consultation-portal/ @island-is/advania -/apps/services/form-system/ @island-is/advania -/libs/clients/consultation-portal/ @island-is/advania -/libs/api/domains/consultation-portal/ @island-is/advania - -/apps/skilavottord/ @island-is/deloitte -/libs/skilavottord/ @island-is/deloitte -/libs/application/templates/parental-leave/ @island-is/deloitte -/libs/application/template-api-modules/src/lib/modules/templates/parental-leave/ @island-is/deloitte -/libs/clients/vmst/ @island-is/deloitte -/libs/api/domains/directorate-of-labour/ @island-is/deloitte -/libs/application/template-api-modules/src/lib/modules/templates/social-insurance-administration @island-is/deloitte -/libs/application/templates/social-insurance-administration/ @island-is/deloitte -/libs/clients/social-insurance-administration/ @island-is/deloitte @island-is/stefna @island-is/hugsmidjan -/libs/application/templates/car-recycling/ @island-is/deloitte -/libs/application/template-api-modules/src/lib/modules/templates/car-recycling/ @island-is/deloitte -/libs/clients/car-recycling/ @island-is/deloitte -/libs/application/templates/new-primary-school/ @island-is/deloitte -/libs/application/template-api-modules/src/lib/modules/templates/new-primary-school/ @island-is/deloitte -/libs/clients/mms/frigg @island-is/deloitte - -/apps/services/auth/ids-api/ @island-is/fuglar @island-is/aranja -/apps/services/auth/admin-api/ @island-is/fuglar @island-is/aranja -/apps/services/auth/public-api/ @island-is/fuglar @island-is/aranja -/apps/services/auth/delegation-api/ @island-is/fuglar @island-is/aranja -/apps/services/sessions/ @island-is/fuglar @island-is/aranja -/apps/auth-admin-web/ @island-is/fuglar @island-is/aranja -/libs/auth-api-lib/ @island-is/fuglar @island-is/aranja -/libs/auth-api-lib/seeders/ @island-is/fuglar @island-is/aranja @island-is/origo-auth -/libs/auth-nest-tools/ @island-is/fuglar @island-is/aranja -/libs/application/templates/european-health-insurance-card/ @island-is/fuglar -/libs/application/template-api-modules/src/lib/modules/templates/european-health-insurance-card/ @island-is/fuglar -/libs/clients/ehic-client-v1 @island-is/fuglar - -/apps/services/auth/personal-representative/ @island-is/programm @island-is/aranja -/apps/services/auth/personal-representative-public/ @island-is/programm @island-is/aranja - -/libs/application/templates/criminal-record/ @island-is/origo -/libs/application/template-api-modules/src/lib/modules/templates/criminal-record-submission/ @island-is/origo -/libs/api/domains/criminal-record/ @island-is/origo -/libs/clients/criminal-record/ @island-is/origo - -/libs/application/templates/mortgage-certificate/ @island-is/origo -/libs/application/template-api-modules/src/lib/modules/templates/mortgage-certificate-submission/ @island-is/origo -/libs/api/domains/mortgage-certificate/ @island-is/origo - -/libs/application/templates/no-debt-certificate/ @island-is/origo -/libs/application/template-api-modules/src/lib/modules/templates/no-debt-certificate/ @island-is/origo - -/libs/application/templates/id-card/ @island-is/origo -/libs/application/template-api-modules/src/lib/modules/templates/id-card/ @island-is/origo - -/libs/clients/charge-fjs-v2/ @island-is/origo -/libs/clients/vehicle-service-fjs-v1/ @island-is/origo - -/libs/application/templates/transport-authority/ @island-is/origo -/libs/application/template-api-modules/src/lib/modules/templates/transport-authority/ @island-is/origo -/libs/api/domains/transport-authority/ @island-is/origo -/libs/clients/transport-authority/ @island-is/origo - -/libs/application/templates/driving-license-book-update-instructor/ @island-is/origo -/libs/application/template-api-modules/src/lib/modules/templates/driving-license-book-update-instructor/ @island-is/origo - -/apps/services/university-gateway/ @island-is/origo -/libs/clients/university-application/ @island-is/origo -/libs/clients/university-gateway-api/ @island-is/origo -/libs/api/domains/university-gateway/ @island-is/origo -/libs/university-gateway/ @island-is/origo -/apps/web/screens/UniversitySearch/ @island-is/origo -/apps/web/screens/queries/UniversityGateway.ts @island-is/origo -/apps/web/components/ListViewCard/ @island-is/origo - -/libs/application/templates/directorate-of-immigration/ @island-is/origo -/libs/application/template-api-modules/src/lib/modules/templates/directorate-of-immigration/ @island-is/origo -/libs/clients/directorate-of-immigration/ @island-is/origo - -/libs/application/templates/aosh/ @island-is/origo -/libs/application/template-api-modules/src/lib/modules/templates/aosh @island-is/origo - -/libs/application/templates/healthcare-license-certificate/ @island-is/origo -/libs/application/template-api-modules/src/lib/modules/templates/healthcare-license-certificate/ @island-is/origo - - -/libs/application/templates/healthcare-work-permit/ @island-is/origo -/libs/application/template-api-modules/src/lib/modules/templates/healthcare-work-permit/ @island-is/origo - -/libs/application/templates/energy-funds/ @island-is/origo -/libs/application/template-api-modules/src/lib/modules/templates/energy-funds/ @island-is/origo -/libs/api/domains/energy-funds/ @island-is/origo -/libs/clients/energy-funds/ @island-is/origo - -/libs/application/templates/university/ @island-is/origo -/libs/application/template-api-modules/src/lib/modules/templates/university/ @island-is/origo +/libs/infra-nest-server/src/lib/infra/ @island-is/core +/libs/testing/ @island-is/core +/libs/nest/swagger/ @island-is/core + +/apps/services/endorsements/ @island-is/juni +/apps/icelandic-names-registry*/ @island-is/juni +/apps/web/screens/PetitionView/ @island-is/juni +/libs/cms/ @island-is/juni @island-is/stefna +/libs/clients/cms/ @island-is/juni @island-is/aranja +/libs/residence-history @island-is/juni +/libs/api/domains/endorsement-system @island-is/juni +/libs/api/domains/icelandic-names-registry/ @island-is/juni +/libs/clients/rsk/ @island-is/juni +/libs/clients/zendesk/ @island-is/juni +/libs/icelandic-names-registry/ @island-is/juni +/libs/portals/my-pages/petitions/ @island-is/juni +/libs/portals/my-pages/signature-collection/ @island-is/juni +/libs/portals/my-pages/education/ @island-is/juni @island-is/hugsmidjan +/libs/portals/my-pages/education-career/ @island-is/juni @island-is/hugsmidjan +/libs/portals/my-pages/education-degree/ @island-is/juni @island-is/hugsmidjan +/libs/portals/my-pages/education-license/ @island-is/juni @island-is/hugsmidjan +/libs/portals/my-pages/education-student-assessment/ @island-is/juni @island-is/norda @island-is/hugsmidjan +/libs/clients/driving-license/ @island-is/juni +/libs/clients/judicial-administration/ @island-is/juni +/libs/application/templates/announcement-of-death/ @island-is/juni +/libs/application/template-api-modules/src/lib/modules/templates/announcement-of-death @island-is/juni +/libs/application/templates/driving-license/ @island-is/juni +/libs/application/templates/driving-assessment-approval/ @island-is/juni +/libs/application/templates/driving-learners-permit/ @island-is/juni +/libs/application/template-api-modules/src/lib/modules/templates/driving-learners-permit/ @island-is/juni +/libs/application/template-api-modules/src/lib/modules/templates/driving-license-submission @island-is/juni +/libs/api/domains/driving-license/ @island-is/juni +/libs/api/domains/education/ @island-is/juni @island-is/hugsmidjan @island-is/deloitte +/libs/application/templates/estate/ @island-is/juni +/libs/application/template-api-modules/src/lib/modules/templates/estate @island-is/juni +/libs/application/templates/general-petition/ @island-is/juni +/libs/shared/connected/src/lib/generalPetition/GeneralPetitionLists/ @island-is/juni +/libs/shared/connected/src/lib/SignatureLists/ @island-is/juni +/libs/api/domains/communications/ @island-is/juni @island-is/stefna +/apps/services/user-notification/ @island-is/juni @island-is/aranja +/apps/air-discount-scheme/ @island-is/hugsmidjan +/libs/air-discount-scheme/ @island-is/hugsmidjan +/libs/application/templates/p-sign/ @island-is/juni +/libs/application/template-api-modules/src/lib/modules/templates/p-sign-submission @island-is/juni +/libs/application/templates/marriage-conditions/ @island-is/juni +/libs/application/template-api-modules/src/lib/modules/templates/marriage-conditions-submission @island-is/juni +/libs/message-queue/ @island-is/juni +/libs/application/templates/example-payment/ @island-is/juni +/libs/application/template-api-modules/src/lib/modules/templates/example-payment-actions @island-is/juni +/libs/application/templates/driving-school-confirmation/ @island-is/juni +/libs/application/templates/driving-instructor-registrations/ @island-is/juni +/libs/api/domains/driving-license-book/ @island-is/juni +/libs/clients/driving-license-book/ @island-is/juni +/libs/application/template-api-modules/src/lib/modules/templates/passport @island-is/juni +/libs/application/templates/passport/ @island-is/juni +/libs/application/template-api-modules/src/lib/modules/templates/passport-annulment @island-is/juni +/libs/application/templates/passport-annulment/ @island-is/juni +/libs/application/template-api-modules/src/lib/modules/templates/driving-school-confirmation/ @island-is/juni +/libs/application/templates/operating-license/ @island-is/juni +/libs/application/template-api-modules/src/lib/modules/templates/operating-license/ @island-is/juni +/libs/application/templates/driving-license-duplicate/ @island-is/juni +/libs/application/template-api-modules/src/lib/modules/templates/driving-license-duplicate/ @island-is/juni +/libs/application/templates/inheritance-report/ @island-is/juni +/libs/application/template-api-modules/src/lib/modules/templates/inheritance-report @island-is/juni +/libs/application/templates/signature-collection @island-is/juni +/libs/api/domains/disability-license @island-is/juni +/libs/portals/admin/petition @island-is/juni +/libs/portals/admin/signature-collection @island-is/juni +/libs/portals/admin/icelandic-names-registry @island-is/juni +/libs/api/domains/signature-collection @island-is/juni +/libs/clients/signature-collection @island-is/juni +/libs/application/template-api-modules/src/lib/modules/templates/signature-collection @island-is/juni +/libs/application/template-api-modules/src/lib/modules/templates/general-petition @island-is/juni + +/apps/portals/admin/ @island-is/aranja +/libs/api/domains/auth-admin/ @island-is/aranja +/libs/api/domains/sessions/ @island-is/aranja +/libs/clients/auth/ @island-is/aranja +/libs/clients/middlewares/ @island-is/aranja +libs/clients/rsk/relationships/ @island-is/aranja +/libs/clients/sessions @island-is/aranja +/libs/portals/shared-modules/delegations @island-is/aranja +/libs/portals/admin/ids-admin @island-is/aranja +/libs/portals/my-pages/consent @island-is/aranja +/libs/portals/my-pages/restrictions @island-is/aranja +/libs/portals/my-pages/sessions @island-is/aranja +/apps/native/app/ @island-is/aranja-app +codemagic.yaml @island-is/aranja-app +/apps/web/public/.well-known/ @island-is/aranja-app + +/apps/judicial-system/ @island-is/kolibri-justice-league +/libs/judicial-system/ @island-is/kolibri-justice-league +/libs/nova-sms/ @island-is/kolibri-justice-league +/libs/dokobit-signing/ @island-is/kolibri-justice-league +/libs/email-service/ @island-is/kolibri-justice-league + +/apps/financial-aid/ @island-is/kolibri-robin-hood +/libs/financial-aid/ @island-is/kolibri-robin-hood +/libs/next-ids-auth/ @island-is/kolibri-robin-hood +/libs/clients/rsk/personal-tax-return @island-is/kolibri-robin-hood +/libs/application/templates/financial-aid/ @island-is/kolibri-robin-hood +/libs/api/domains/municipalities-financial-aid @island-is/kolibri-robin-hood +/libs/clients/municipalities-financial-aid @island-is/kolibri-robin-hood +/libs/application/template-api-modules/src/lib/modules/templates/financial-aid @island-is/kolibri-robin-hood + +/apps/download-service/ @island-is/hugsmidjan +/apps/portals/my-pages*/ @island-is/hugsmidjan +/apps/services/regulations-admin-backend/ @island-is/hugsmidjan +/apps/services/user-profile/ @island-is/hugsmidjan @island-is/juni @island-is/aranja +/apps/web/components/Grant/ @island-is/hugsmidjan +/apps/web/components/PlazaCard/ @island-is/hugsmidjan +/apps/web/screens/Grants/ @island-is/hugsmidjan +/apps/web/screens/Regulations/ @island-is/hugsmidjan +/apps/web/components/Regulations/ @island-is/hugsmidjan +/apps/web/screens/OfficialJournalOfIceland/ @island-is/hugsmidjan +/apps/web/components/OfficialJournalOfIceland/ @island-is/hugsmidjan +/libs/api/domains/air-discount-scheme @island-is/hugsmidjan +/libs/api/domains/documents/ @island-is/hugsmidjan +/libs/api/domains/finance/ @island-is/hugsmidjan +/libs/api/domains/assets/ @island-is/hugsmidjan +/libs/api/domains/health-directorate/ @island-is/hugsmidjan +/libs/api/domains/hms-loans/ @island-is/hugsmidjan +/libs/api/domains/license-service/ @island-is/hugsmidjan @island-is/aranja +/libs/api/domains/work-machines/ @island-is/hugsmidjan @island-is/origo +/libs/api/domains/national-registry/ @island-is/hugsmidjan +/libs/api/domains/notifications/ @island-is/hugsmidjan +/libs/api/domains/user-profile/ @island-is/hugsmidjan @island-is/juni @island-is/aranja +/libs/api/domains/passport/ @island-is/hugsmidjan +/libs/api/domains/vehicles/ @island-is/hugsmidjan +/libs/api/domains/university-careers/ @island-is/hugsmidjan +/libs/api/domains/regulations/ @island-is/hugsmidjan +/libs/api/domains/regulations-admin/ @island-is/hugsmidjan +/libs/api/domains/rights-portal @island-is/hugsmidjan +/libs/api/domains/social-insurance @island-is/hugsmidjan @island-is/stefna +/libs/api/domains/occupational-licenses/ @island-is/hugsmidjan +/libs/api/domains/occupational-licenses-v2/ @island-is/hugsmidjan +/libs/api/domains/intellectual-properties/ @island-is/hugsmidjan +/libs/api/domains/official-journal-of-iceland/ @island-is/hugsmidjan +/libs/api/domains/official-journal-of-iceland-application/ @island-is/hugsmidjan +/libs/api/domains/document-provider/ @island-is/hugsmidjan @island-is/core +/libs/api/domains/housing-benefits/ @island-is/hugsmidjan +/libs/api/domains/law-and-order/ @island-is/hugsmidjan +/libs/clients/documents/ @island-is/hugsmidjan +/libs/clients/documents-v2/ @island-is/hugsmidjan +/libs/clients/finance/ @island-is/hugsmidjan +/libs/clients/finance-v2/ @island-is/hugsmidjan +/libs/clients/adr-and-machine-license/ @island-is/hugsmidjan +/libs/clients/work-machines/ @island-is/hugsmidjan @island-is/origo +/libs/clients/disability-license/ @island-is/hugsmidjan +/libs/clients/firearm-license/ @island-is/hugsmidjan +/libs/clients/hunting-license/ @island-is/hugsmidjan +/libs/clients/smartsolutions/ @island-is/hugsmidjan +/libs/clients/smart-solutions-v2/ @island-is/hugsmidjan +/libs/clients/license-client/ @island-is/hugsmidjan @island-is/aranja +/libs/clients/intellectual-properties/ @island-is/hugsmidjan +/libs/clients/islykill/ @island-is/hugsmidjan +/libs/clients/national-registry/v3/ @island-is/hugsmidjan +/libs/clients/district-commissioners-licenses/ @island-is/hugsmidjan +/libs/clients/regulations/ @island-is/hugsmidjan +/libs/clients/vehicles/ @island-is/hugsmidjan @island-is/stefna +/libs/clients/vehicles-mileage/ @island-is/hugsmidjan +/libs/clients/user-notification/ @island-is/hugsmidjan +/libs/clients/passports/ @island-is/hugsmidjan +/libs/clients/p-card/ @island-is/hugsmidjan +/libs/clients/assets/ @island-is/hugsmidjan +/libs/clients/university-careers/ @island-is/hugsmidjan +/libs/clients/regulations-admin/ @island-is/hugsmidjan +/libs/clients/inna/ @island-is/hugsmidjan +/libs/clients/hms-loans/ @island-is/hugsmidjan +/libs/clients/official-journal-of-iceland/ @island-is/hugsmidjan +/libs/clients/hms-housing-benefits/ @island-is/hugsmidjan +/apps/services/license-api/ @island-is/hugsmidjan +/libs/regulations/ @island-is/hugsmidjan +/libs/portals/admin/regulations-admin/ @island-is/hugsmidjan +/libs/portals/admin/document-provider/ @island-is/hugsmidjan @island-is/core +/libs/clients/icelandic-health-insurance/rights-portal/ @island-is/hugsmidjan +/libs/clients/health-directorate @island-is/hugsmidjan +/libs/clients/health-directorate/src/lib/clients/occupational-license @island-is/hugsmidjan @island-is/origo +/libs/clients/mms/grade @island-is/hugsmidjan +/libs/portals/admin/air-discount-scheme @island-is/hugsmidjan +/libs/application/templates/official-journal-of-iceland/ @island-is/hugsmidjan +/libs/application/template-api-modules/src/lib/modules/templates/official-journal-of-iceland/ @island-is/hugsmidjan +/libs/clients/judicial-system-sp/ @island-is/hugsmidjan +/libs/application/templates/data-protection-complaint/ @island-is/norda +/libs/application/templates/institution-collaboration/ @island-is/norda @island-is/fuglar +/libs/application/templates/login-service/ @island-is/norda +/libs/application/template-api-modules/src/lib/modules/templates/login-service/ @island-is/norda +/libs/clients/payment-schedule/ @island-is/norda +/libs/api/domains/payment-schedule/ @island-is/norda +/libs/application/templates/funding-government-projects/ @island-is/norda +/libs/application/template-api-modules/src/lib/modules/templates/funding-government-projects/ @island-is/norda +/libs/application/template-api-modules/src/lib/modules/templates/institution-collaboration/ @island-is/norda +/libs/application/templates/public-debt-payment-plan/ @island-is/norda +/libs/application/templates/complaints-to-althingi-ombudsman/ @island-is/norda +/libs/application/template-api-modules/src/lib/modules/templates/complaints-to-althingi-ombudsman/ @island-is/norda +/libs/application/templates/accident-notification/ @island-is/norda +/libs/application/template-api-modules/src/lib/modules/templates/accident-notification/ @island-is/norda +/libs/application/template-api-modules/src/lib/modules/templates/health-insurance/ @island-is/norda +/libs/application/template-api-modules/src/lib/modules/templates/public-debt-payment-plan @island-is/norda +/libs/api/domains/health-insurance/ @island-is/norda +/libs/application/templates/health-insurance/ @island-is/norda +/libs/clients/rsk/company-registry @island-is/norda +/libs/clients/althingi-ombudsman/ @island-is/norda +/libs/api/domains/company-registry @island-is/norda +/libs/clients/icelandic-health-insurance/health-insurance/ @island-is/norda +/libs/clients/data-protection-complaint/ @island-is/norda +/libs/clients/fishing-license/ @island-is/norda +/libs/api/domains/fishing-license/ @island-is/norda +/libs/application/templates/general-fishing-license/ @island-is/norda +/libs/application/template-api-modules/src/lib/modules/templates/general-fishing-license/ @island-is/norda +/libs/application/template-api-modules/src/lib/modules/templates/data-protection-complaint/ @island-is/norda +/libs/shared/form-fields/ @island-is/norda @island-is/island-ui +/libs/clients/financial-statements-inao @island-is/norda +/libs/api/domains/financial-statements-inao/ @island-is/norda +/libs/application/templates/financial-statements-inao/ @island-is/norda +/libs/application/template-api-modules/src/lib/modules/templates/financial-statements-inao @island-is/norda +/libs/application/templates/inao/ @island-is/norda +/libs/application/templates/inao/financial-statement-cemetery/ @island-is/norda +/libs/application/templates/inao/financial-statement-individual-election/ @island-is/norda +/libs/application/templates/inao/financial-statement-political-party/ @island-is/norda +/libs/application/template-api-modules/src/lib/modules/templates/financial-statement-cemetery/ @island-is/norda +/libs/application/template-api-modules/src/lib/modules/templates/financial-statement-individual-election/ @island-is/norda +/libs/application/template-api-modules/src/lib/modules/templates/financial-statement-political-party/ @island-is/norda + + +/libs/portals/my-pages/applications/ @island-is/norda-applications +/libs/portals/admin/application-system/ @island-is/norda-applications +/libs/api/domains/application/ @island-is/norda-applications +/libs/api/domains/payment/ @island-is/norda-applications + +/apps/contentful-apps/ @island-is/stefna +/apps/services/search-indexer/ @island-is/stefna @island-is/juni +/apps/services/contentful-entry-tagger/ @island-is/stefna +/apps/tools/contentful-role-permissions/ @island-is/stefna +/apps/web/screens/Organization/ @island-is/stefna +/apps/web/screens/Project/ @island-is/stefna +/apps/web/components/Organization/ @island-is/stefna +/apps/web/components/ChatPanel/ @island-is/stefna +/apps/web/components/Form/ @island-is/stefna +/apps/web/components/Stepper/ @island-is/stefna +/libs/content-search-toolkit/ @island-is/stefna @island-is/juni +/libs/content-search-index-manager/ @island-is/stefna @island-is/juni +/libs/content-search-metrics/ @island-is/stefna @island-is/juni +/libs/content-search-indexer/ @island-is/stefna @island-is/juni +/libs/api/domains/content-search/ @island-is/stefna @island-is/juni +/libs/api/domains/syslumenn/ @island-is/stefna +/libs/api/domains/email-signup/ @island-is/stefna +/libs/api/domains/electronic-registration-statistics/ @island-is/stefna +/libs/clients/electronic-registration-statistics/ @island-is/stefna +/libs/api/domains/fiskistofa/ @island-is/stefna +/libs/clients/fiskistofa/ @island-is/stefna +/libs/clients/syslumenn/ @island-is/stefna @island-is/juni +/libs/api/domains/watson-assistant-chat/ @island-is/stefna +/libs/clients/icelandic-government-institution-vacancies/ @island-is/stefna +/libs/api/domains/icelandic-government-institution-vacancies/ @island-is/stefna +/libs/clients/aircraft-registry/ @island-is/stefna +/libs/api/domains/aircraft-registry/ @island-is/stefna +/libs/api/domains/housing-benefit-calculator/ @island-is/stefna +/libs/clients/housing-benefit-calculator/ @island-is/stefna +/libs/clients/ship-registry/ @island-is/stefna +/libs/api/domains/ship-registry/ @island-is/stefna +/libs/clients/administration-of-occupational-safety-and-health/ @island-is/stefna +/libs/api/domains/administration-of-occupational-safety-and-health/ @island-is/stefna +/libs/clients/ultraviolet-radiation/ @island-is/stefna +/libs/clients/ums-cost-of-living-calculator/ @island-is/stefna +/libs/api/domains/umbodsmadur-skuldara/ @island-is/stefna + +/libs/island-ui/ @island-is/island-ui + +/apps/consultation-portal/ @island-is/advania +/apps/services/form-system/ @island-is/advania +/libs/clients/consultation-portal/ @island-is/advania +/libs/api/domains/consultation-portal/ @island-is/advania + +/apps/skilavottord/ @island-is/deloitte +/libs/skilavottord/ @island-is/deloitte +/libs/application/templates/parental-leave/ @island-is/deloitte +/libs/application/template-api-modules/src/lib/modules/templates/parental-leave/ @island-is/deloitte +/libs/clients/vmst/ @island-is/deloitte +/libs/api/domains/directorate-of-labour/ @island-is/deloitte +/libs/application/template-api-modules/src/lib/modules/templates/social-insurance-administration @island-is/deloitte +/libs/application/templates/social-insurance-administration/ @island-is/deloitte +/libs/clients/social-insurance-administration/ @island-is/deloitte @island-is/stefna @island-is/hugsmidjan +/libs/application/templates/car-recycling/ @island-is/deloitte +/libs/application/template-api-modules/src/lib/modules/templates/car-recycling/ @island-is/deloitte +/libs/clients/car-recycling/ @island-is/deloitte +/libs/application/templates/new-primary-school/ @island-is/deloitte +/libs/application/template-api-modules/src/lib/modules/templates/new-primary-school/ @island-is/deloitte +/libs/clients/mms/frigg @island-is/deloitte + +/apps/services/auth/ids-api/ @island-is/fuglar @island-is/aranja +/apps/services/auth/admin-api/ @island-is/fuglar @island-is/aranja +/apps/services/auth/public-api/ @island-is/fuglar @island-is/aranja +/apps/services/auth/delegation-api/ @island-is/fuglar @island-is/aranja +/apps/services/sessions/ @island-is/fuglar @island-is/aranja +/apps/auth-admin-web/ @island-is/fuglar @island-is/aranja +/libs/auth-api-lib/ @island-is/fuglar @island-is/aranja +/libs/auth-api-lib/seeders/ @island-is/fuglar @island-is/aranja @island-is/origo-auth +/libs/auth-nest-tools/ @island-is/fuglar @island-is/aranja +/libs/application/templates/european-health-insurance-card/ @island-is/fuglar +/libs/application/template-api-modules/src/lib/modules/templates/european-health-insurance-card/ @island-is/fuglar +/libs/clients/ehic-client-v1 @island-is/fuglar + +/apps/services/auth/personal-representative/ @island-is/programm @island-is/aranja +/apps/services/auth/personal-representative-public/ @island-is/programm @island-is/aranja + +/libs/application/templates/criminal-record/ @island-is/origo +/libs/application/template-api-modules/src/lib/modules/templates/criminal-record-submission/ @island-is/origo +/libs/api/domains/criminal-record/ @island-is/origo +/libs/clients/criminal-record/ @island-is/origo + +/libs/application/templates/mortgage-certificate/ @island-is/origo +/libs/application/template-api-modules/src/lib/modules/templates/mortgage-certificate-submission/ @island-is/origo +/libs/api/domains/mortgage-certificate/ @island-is/origo + +/libs/application/templates/no-debt-certificate/ @island-is/origo +/libs/application/template-api-modules/src/lib/modules/templates/no-debt-certificate/ @island-is/origo + +/libs/application/templates/id-card/ @island-is/origo +/libs/application/template-api-modules/src/lib/modules/templates/id-card/ @island-is/origo + +/libs/clients/charge-fjs-v2/ @island-is/origo +/libs/clients/vehicle-service-fjs-v1/ @island-is/origo + +/libs/application/templates/transport-authority/ @island-is/origo +/libs/application/template-api-modules/src/lib/modules/templates/transport-authority/ @island-is/origo +/libs/api/domains/transport-authority/ @island-is/origo +/libs/clients/transport-authority/ @island-is/origo + +/libs/application/templates/driving-license-book-update-instructor/ @island-is/origo +/libs/application/template-api-modules/src/lib/modules/templates/driving-license-book-update-instructor/ @island-is/origo + +/apps/services/university-gateway/ @island-is/origo +/libs/clients/university-application/ @island-is/origo +/libs/clients/university-gateway-api/ @island-is/origo +/libs/api/domains/university-gateway/ @island-is/origo +/libs/university-gateway/ @island-is/origo +/apps/web/screens/UniversitySearch/ @island-is/origo +/apps/web/screens/queries/UniversityGateway.ts @island-is/origo +/apps/web/components/ListViewCard/ @island-is/origo + +/libs/application/templates/directorate-of-immigration/ @island-is/origo +/libs/application/template-api-modules/src/lib/modules/templates/directorate-of-immigration/ @island-is/origo +/libs/clients/directorate-of-immigration/ @island-is/origo + +/libs/application/templates/aosh/ @island-is/origo +/libs/application/template-api-modules/src/lib/modules/templates/aosh @island-is/origo + +/libs/application/templates/healthcare-license-certificate/ @island-is/origo +/libs/application/template-api-modules/src/lib/modules/templates/healthcare-license-certificate/ @island-is/origo + + +/libs/application/templates/healthcare-work-permit/ @island-is/origo +/libs/application/template-api-modules/src/lib/modules/templates/healthcare-work-permit/ @island-is/origo + +/libs/application/templates/energy-funds/ @island-is/origo +/libs/application/template-api-modules/src/lib/modules/templates/energy-funds/ @island-is/origo +/libs/api/domains/energy-funds/ @island-is/origo +/libs/clients/energy-funds/ @island-is/origo + +/libs/application/templates/university/ @island-is/origo +/libs/application/template-api-modules/src/lib/modules/templates/university/ @island-is/origo # DevOps -/.github/ @island-is/devops -/.githooks/ @island-is/devops -/apps/reference-backend/ @island-is/devops -/apps/github-actions-cache/ @island-is/devops -/infra/ @island-is/devops -**/infra/ @island-is/devops -/libs/logging/ @island-is/devops -/scripts/ @island-is/devops -/scripts/postinstall.js @island-is/devops @island-is/core -/scripts/codegen.js @island-is/devops @island-is/core -/charts/ @island-is/devops -.dockerignore @island-is/devops +/.github/ @island-is/devops +/.githooks/ @island-is/devops +/apps/reference-backend/ @island-is/devops +/apps/github-actions-cache/ @island-is/devops +/infra/ @island-is/devops +**/infra/ @island-is/devops +/libs/logging/ @island-is/devops +/scripts/ @island-is/devops +/scripts/postinstall.js @island-is/devops @island-is/core +/scripts/codegen.js @island-is/devops @island-is/core +/charts/ @island-is/devops +.dockerignore @island-is/devops # QA -/apps/system-e2e/ @island-is/qa -/libs/testing/e2e @island-is/qa +/apps/system-e2e/ @island-is/qa +/libs/testing/e2e @island-is/qa # Islandis -/apps/system-e2e/src/tests/islandis/admin-portal/ @island-is/aranja -/apps/system-e2e/src/tests/islandis/application-system/ @island-is/norda-applications -/apps/system-e2e/src/tests/islandis/application-system/acceptance/parental-leave.spec.ts @island-is/deloitte -/apps/system-e2e/src/tests/islandis/consultation-portal/ @island-is/advania -/apps/system-e2e/src/tests/islandis/service-portal/ @island-is/hugsmidjan @island-is/juni @island-is/norda-applications -/apps/system-e2e/src/tests/islandis/web/ @island-is/hugsmidjan @island-is/juni @island-is/stefna +/apps/system-e2e/src/tests/islandis/admin-portal/ @island-is/aranja +/apps/system-e2e/src/tests/islandis/application-system/ @island-is/norda-applications +/apps/system-e2e/src/tests/islandis/application-system/acceptance/parental-leave.spec.ts @island-is/deloitte +/apps/system-e2e/src/tests/islandis/consultation-portal/ @island-is/advania +/apps/system-e2e/src/tests/islandis/service-portal/ @island-is/hugsmidjan @island-is/juni @island-is/norda-applications +/apps/system-e2e/src/tests/islandis/web/ @island-is/hugsmidjan @island-is/juni @island-is/stefna # Judicial system -/apps/system-e2e/src/tests/judicial-system/ @island-is/kolibri-justice-league +/apps/system-e2e/src/tests/judicial-system/ @island-is/kolibri-justice-league diff --git a/libs/application/templates/inao/financial-statement-cemetery/src/dataProviders/index.ts b/libs/application/templates/inao/financial-statement-cemetery/src/dataProviders/index.ts index dd52c79ad7f2..b0b604d16ca3 100644 --- a/libs/application/templates/inao/financial-statement-cemetery/src/dataProviders/index.ts +++ b/libs/application/templates/inao/financial-statement-cemetery/src/dataProviders/index.ts @@ -1,10 +1,7 @@ import { defineTemplateApi } from '@island.is/application/types' import { UserProfileApi } from '@island.is/application/types' - -export { - NationalRegistryUserApi, - IdentityApi as IdentityApiProvider, -} from '@island.is/application/types' +import { IdentityApi } from '@island.is/application/types' +export { NationalRegistryUserApi } from '@island.is/application/types' export const CurrentUserTypeProvider = defineTemplateApi({ action: 'getUserType', @@ -16,3 +13,9 @@ export const UserInfoApi = UserProfileApi.configure({ catchMock: true, }, }) + +export const IdentityApiProvider = IdentityApi.configure({ + params: { + includeActorInfo: true, + }, +}) diff --git a/libs/application/templates/inao/financial-statement-cemetery/src/fields/CemeteryIncomeLimit/index.tsx b/libs/application/templates/inao/financial-statement-cemetery/src/fields/CemeteryIncomeLimit/index.tsx deleted file mode 100644 index 3e78d43e4af1..000000000000 --- a/libs/application/templates/inao/financial-statement-cemetery/src/fields/CemeteryIncomeLimit/index.tsx +++ /dev/null @@ -1,43 +0,0 @@ -import { useEffect } from 'react' -import { AlertMessage, ContentBlock } from '@island.is/island-ui/core' -import { useLocale } from '@island.is/localization' -import { useQuery } from '@apollo/client' -import { useFormContext } from 'react-hook-form' -import { m } from '../../lib/messages' -import { financialLimitQuery } from '../../graphql' -import { CEMETERYOPERATIONIDS } from '../../utils/constants' -import { FSIUSERTYPE } from '../../types/types' - -export const CemeteryIncomeLimit = () => { - const { getValues, setValue } = useFormContext() - const { formatMessage } = useLocale() - - const values = getValues() - const year: string = values?.conditionalAbout?.operatingYear - - const { data, error } = useQuery(financialLimitQuery, { - variables: { input: { year, clientType: `${FSIUSERTYPE.CEMETRY}` } }, - }) - - useEffect(() => { - const limit = data?.financialStatementsInaoClientFinancialLimit?.toString() - - if (limit) { - setValue(CEMETERYOPERATIONIDS.incomeLimit, limit) - } - }, [data, setValue]) - - if (error) { - return ( - - - - ) - } - - return null -} diff --git a/libs/application/templates/inao/financial-statement-cemetery/src/fields/CemeteryOverview/AboutOverview.tsx b/libs/application/templates/inao/financial-statement-cemetery/src/fields/CemeteryOverview/AboutOverview.tsx index 926d2038faba..f0d0177b8a94 100644 --- a/libs/application/templates/inao/financial-statement-cemetery/src/fields/CemeteryOverview/AboutOverview.tsx +++ b/libs/application/templates/inao/financial-statement-cemetery/src/fields/CemeteryOverview/AboutOverview.tsx @@ -1,61 +1,61 @@ import { GridColumn, GridRow } from '@island.is/island-ui/core' -import { formatPhoneNumber } from '@island.is/application/ui-components' - import { format as formatNationalId } from 'kennitala' -import { m } from '../../lib/messages' import { sectionColumn } from './overviewStyles.css' -import { FinancialStatementCemetery } from '../../lib/dataSchema' import { ValueLine } from './ValueLine' +import { FormValue } from '@island.is/application/types' +import { getAboutOverviewNumbers } from '../../utils/overviewUtils' +import { m } from '../../lib/messages' -export const AboutOverview = ({ - answers, -}: { - answers: FinancialStatementCemetery -}) => { +type Props = { + answers: FormValue +} + +export const AboutOverview = ({ answers }: Props) => { + const { + fullName, + nationalId, + powerOfAttorneyName, + powerOfAttorneyNationalId, + email, + phoneNumber, + } = getAboutOverviewNumbers(answers) return ( <> - + - {answers.about.powerOfAttorneyName ? ( + {powerOfAttorneyName ? ( ) : null} - {answers.about.powerOfAttorneyNationalId ? ( + {powerOfAttorneyNationalId ? ( ) : null} - + - + diff --git a/libs/application/templates/inao/financial-statement-cemetery/src/fields/CemeteryOverview/CapitalNumbersOverview.tsx b/libs/application/templates/inao/financial-statement-cemetery/src/fields/CemeteryOverview/CapitalNumbersOverview.tsx index f3e18079a7cf..8814e7cb42b8 100644 --- a/libs/application/templates/inao/financial-statement-cemetery/src/fields/CemeteryOverview/CapitalNumbersOverview.tsx +++ b/libs/application/templates/inao/financial-statement-cemetery/src/fields/CemeteryOverview/CapitalNumbersOverview.tsx @@ -1,18 +1,19 @@ import { Box, GridColumn, GridRow, Text } from '@island.is/island-ui/core' - -import { m } from '../../lib/messages' import { ValueLine } from './ValueLine' import { sectionColumn, starterColumnStyle } from './overviewStyles.css' import { useLocale } from '@island.is/localization' -import { FinancialStatementCemetery } from '../../lib/dataSchema' -import { formatCurrency } from '../../utils/helpers' +import { FormValue } from '@island.is/application/types' +import { getCapitalNumbersOverviewNumbers } from '../../utils/overviewUtils' +import { m } from '../../lib/messages' + +type Props = { + answers: FormValue +} -export const CapitalNumberOverview = ({ - answers, -}: { - answers: FinancialStatementCemetery -}) => { +export const CapitalNumberOverview = ({ answers }: Props) => { const { formatMessage } = useLocale() + const { capitalIncome, capitalCost, totalCapital } = + getCapitalNumbersOverviewNumbers(answers) return ( <> @@ -22,27 +23,17 @@ export const CapitalNumberOverview = ({ - + - {answers.capitalNumbers?.capitalCost ? ( + {capitalCost ? ( - + ) : null} - + diff --git a/libs/application/templates/inao/financial-statement-cemetery/src/fields/CemeteryOverview/index.tsx b/libs/application/templates/inao/financial-statement-cemetery/src/fields/CemeteryOverview/index.tsx index 0f8c89f2c9f0..b5e45641c1fd 100644 --- a/libs/application/templates/inao/financial-statement-cemetery/src/fields/CemeteryOverview/index.tsx +++ b/libs/application/templates/inao/financial-statement-cemetery/src/fields/CemeteryOverview/index.tsx @@ -1,6 +1,5 @@ import { Fragment } from 'react' import { FieldBaseProps } from '@island.is/application/types' -import { getValueViaPath } from '@island.is/application/core' import { AlertBanner, Box, @@ -11,9 +10,6 @@ import { } from '@island.is/island-ui/core' import { useLocale } from '@island.is/localization' import { format as formatNationalId } from 'kennitala' -import { m } from '../../lib/messages' -import { FinancialStatementCemetery } from '../../lib/dataSchema' -import { formatCurrency } from '../../utils/helpers' import { AboutOverview } from './AboutOverview' import { ValueLine } from './ValueLine' import { CapitalNumberOverview } from './CapitalNumbersOverview' @@ -24,117 +20,53 @@ import { sectionColumn, starterColumnStyle, } from './overviewStyles.css' +import { formatCurrency } from '../../utils/currency' +import { isCemetryUnderFinancialLimit } from '../../utils/helpers' +import { getOverviewNumbers } from '../../utils/overviewUtils' +import { m } from '../../lib/messages' export const CemeteryOverview = ({ application }: FieldBaseProps) => { const { formatMessage } = useLocale() - - const answers = application.answers as FinancialStatementCemetery - const file = getValueViaPath>(answers, 'attachments.file') - const fileName = file?.[0]?.name - const incomeLimit = - getValueViaPath(answers, 'cemeteryOperations.incomeLimit') ?? '0' - const email = getValueViaPath(answers, 'about.email') - const cemeteryCaretakers = answers.cemeteryCaretaker - - const careIncome = getValueViaPath( - answers, - 'cemeteryIncome.careIncome', - ) - const burialRevenue = getValueViaPath( - answers, - 'cemeteryIncome.burialRevenue', - ) - const grantFromTheCemeteryFund = getValueViaPath( - answers, - 'cemeteryIncome.grantFromTheCemeteryFund', - ) - const otherIncome = getValueViaPath( - answers, - 'cemeteryIncome.otherIncome', - ) - const totalIncome = getValueViaPath(answers, 'cemeteryIncome.total') - - const payroll = getValueViaPath(answers, 'cemeteryExpense.payroll') - const funeralCost = getValueViaPath( - answers, - 'cemeteryExpense.funeralCost', - ) - const chapelExpense = getValueViaPath( - answers, - 'cemeteryExpense.chapelExpense', - ) - const donationsToCemeteryFund = getValueViaPath( - answers, - 'cemeteryExpense.cemeteryFundExpense', - ) - const donationsToOther = getValueViaPath( - answers, - 'cemeteryExpense.donationsToOther', - ) - const otherOperationCost = getValueViaPath( - answers, - 'cemeteryExpense.otherOperationCost', - ) - const depreciation = getValueViaPath( - answers, - 'cemeteryExpense.depreciation', - ) - const totalExpenses = getValueViaPath( - answers, - 'cemeteryExpense.total', - ) - - const fixedAssetsTotal = getValueViaPath( - answers, - 'cemeteryAsset.fixedAssetsTotal', - ) - const currentAssets = getValueViaPath( - answers, - 'cemeteryAsset.currentAssets', - ) - const totalAssets = getValueViaPath(answers, 'assetsTotal') - - const longTerm = getValueViaPath( - answers, - 'cemeteryLiability.longTerm', - ) - const shortTerm = getValueViaPath( - answers, - 'cemeteryLiability.shortTerm', - ) - const totalLiabilities = getValueViaPath( - answers, - 'equityAndLiabilitiesTotals.liabilitiesTotal', - ) - - const equityAtTheBeginningOfTheYear = getValueViaPath( - answers, - 'cemeteryEquity.equityAtTheBeginningOfTheYear', - ) - const revaluationDueToPriceChanges = getValueViaPath( - answers, - 'cemeteryEquity.revaluationDueToPriceChanges', - ) - const reevaluateOther = getValueViaPath( - answers, - 'cemeteryEquity.reevaluateOther', - ) - const operationResult = getValueViaPath( - answers, - 'cemeteryEquity.operationResult', - ) - const totalEquity = getValueViaPath(answers, 'cemeteryEquity.total') - - const debtsAndCash = getValueViaPath( - answers, - 'equityAndLiabilitiesTotals.equityAndLiabilitiesTotal', + const cemeteryUnderFinancialLimit = isCemetryUnderFinancialLimit( + application.answers, ) + const { + careIncome, + burialRevenue, + grantFromTheCemeteryFund, + otherIncome, + totalIncome, + payroll, + funeralCost, + chapelExpense, + donationsToCemeteryFund, + donationsToOther, + otherOperationCost, + depreciation, + totalExpenses, + fixedAssetsTotal, + currentAssets, + totalAssets, + longTerm, + shortTerm, + totalLiabilities, + equityAtTheBeginningOfTheYear, + revaluationDueToPriceChanges, + reevaluateOther, + operationResult, + totalEquity, + debtsAndCash, + email, + fileName, + incomeLimit, + cemeteryCaretakers, + } = getOverviewNumbers(application.answers) return ( - + @@ -214,7 +146,7 @@ export const CemeteryOverview = ({ application }: FieldBaseProps) => { - + @@ -294,8 +226,9 @@ export const CemeteryOverview = ({ application }: FieldBaseProps) => { - {Number(totalIncome) < Number(incomeLimit) && - cemeteryCaretakers?.length > 0 ? ( + {cemeteryUnderFinancialLimit && + cemeteryCaretakers && + cemeteryCaretakers.length > 0 ? ( <> @@ -338,7 +271,7 @@ export const CemeteryOverview = ({ application }: FieldBaseProps) => { ) : null} {fileName ? ( <> - + ) : null} diff --git a/libs/application/templates/inao/financial-statement-cemetery/src/fields/FetchDataBasedOnSelectedYear/index.tsx b/libs/application/templates/inao/financial-statement-cemetery/src/fields/FetchDataBasedOnSelectedYear/index.tsx new file mode 100644 index 000000000000..1fbb78acc661 --- /dev/null +++ b/libs/application/templates/inao/financial-statement-cemetery/src/fields/FetchDataBasedOnSelectedYear/index.tsx @@ -0,0 +1,123 @@ +import { useEffect } from 'react' +import { + AlertMessage, + ContentBlock, + LoadingDots, +} from '@island.is/island-ui/core' +import { useLocale } from '@island.is/localization' +import { useQuery } from '@apollo/client' +import { useFormContext } from 'react-hook-form' +import { financialLimitQuery, taxInfoQuery } from '../../graphql' +import { CEMETERYOPERATIONIDS } from '../../utils/constants' +import { FSIUSERTYPE, TaxInfoData } from '../../types/types' +import { + getCareIncomeAndBurialRevenueAndGrant, + getTaxInfoFromAnswers, +} from '../../utils/helpers' +import { m } from '../../lib/messages' + +export const FetchDataBasedOnSelectedYear = () => { + const { getValues, setValue } = useFormContext() + const { formatMessage } = useLocale() + + const values = getValues() + const year: string = values?.conditionalAbout?.operatingYear + + const { data, error, loading } = useQuery(financialLimitQuery, { + variables: { input: { year, clientType: `${FSIUSERTYPE.CEMETRY}` } }, + }) + + const { data: taxInfoData, loading: taxInfoLoading } = useQuery( + taxInfoQuery, + { + variables: { year }, + }, + ) + + const { + careIncomeFromAnswers, + burialRevenueFromAnswers, + grantFromTheCemeteryFundFromAnswers, + donationsToCemeteryFundFromAnswers, + } = getTaxInfoFromAnswers(values) + + useEffect(() => { + const limit = data?.financialStatementsInaoClientFinancialLimit?.toString() + + if (limit) { + setValue(CEMETERYOPERATIONIDS.incomeLimit, limit) + } + }, [data, setValue]) + + useEffect(() => { + if (!taxInfoData) return + + const { + careIncome, + burialRevenue, + grantFromTheCemeteryFund, + donationsToCemeteryFund, + } = getCareIncomeAndBurialRevenueAndGrant( + taxInfoData.financialStatementsInaoTaxInfo, + ) + + const updates = [ + { + id: CEMETERYOPERATIONIDS.careIncome, + value: careIncome, + exists: careIncomeFromAnswers, + }, + { + id: CEMETERYOPERATIONIDS.burialRevenue, + value: burialRevenue, + exists: burialRevenueFromAnswers, + }, + { + id: CEMETERYOPERATIONIDS.grantFromTheCemeteryFund, + value: grantFromTheCemeteryFund, + exists: grantFromTheCemeteryFundFromAnswers, + }, + { + id: CEMETERYOPERATIONIDS.donationsToCemeteryFund, + value: donationsToCemeteryFund, + exists: donationsToCemeteryFundFromAnswers, + }, + ] + + updates.forEach((update) => { + if (!update.exists) { + setValue(update.id, update.value) + } + }) + }, [ + taxInfoData, + setValue, + careIncomeFromAnswers, + burialRevenueFromAnswers, + grantFromTheCemeteryFundFromAnswers, + donationsToCemeteryFundFromAnswers, + CEMETERYOPERATIONIDS, + ]) + + if (loading || taxInfoLoading) { + return ( + + + + ) + } + + if (error) { + return ( + + + + ) + } + + return null +} diff --git a/libs/application/templates/inao/financial-statement-cemetery/src/fields/PowerOfAttorney/index.tsx b/libs/application/templates/inao/financial-statement-cemetery/src/fields/PowerOfAttorney/index.tsx deleted file mode 100644 index f4dcf6f77248..000000000000 --- a/libs/application/templates/inao/financial-statement-cemetery/src/fields/PowerOfAttorney/index.tsx +++ /dev/null @@ -1,96 +0,0 @@ -import { useEffect } from 'react' -import { useFormContext } from 'react-hook-form' -import { useLazyQuery } from '@apollo/client' -import { - Box, - GridColumn, - GridContainer, - GridRow, - InputError, -} from '@island.is/island-ui/core' -import { InputController } from '@island.is/shared/form-fields' -import { useLocale } from '@island.is/localization' -import { IdentityInput, Query } from '@island.is/api/schema' -import { m } from '../../lib/messages' -import { FieldBaseProps } from '@island.is/application/types' -import { getErrorViaPath } from '@island.is/application/core' -import { IdentityQuery } from '../../graphql' -import { ABOUTIDS } from '../../utils/constants' - -export const PowerOfAttorneyFields = ({ application }: FieldBaseProps) => { - const { formatMessage } = useLocale() - const { - formState: { errors }, - setValue, - } = useFormContext() - - const currentActor = - application.applicantActors[application.applicantActors.length - 1] - - const [getIdentity, { loading, error: queryError }] = useLazyQuery< - Query, - { input: IdentityInput } - >(IdentityQuery, { - onCompleted: (data) => { - setValue(ABOUTIDS.powerOfAttorneyName, data.identity?.name ?? '') - }, - }) - - useEffect(() => { - if (currentActor) { - getIdentity({ - variables: { - input: { - nationalId: currentActor, - }, - }, - }) - } - }, []) - - if (application.applicantActors.length === 0) { - return null - } - - return ( - - - - - - - - - - - {queryError ? ( - - ) : null} - - - - - ) -} diff --git a/libs/application/templates/inao/financial-statement-cemetery/src/fields/index.ts b/libs/application/templates/inao/financial-statement-cemetery/src/fields/index.ts index 9903bafb3734..5c8739dcdcab 100644 --- a/libs/application/templates/inao/financial-statement-cemetery/src/fields/index.ts +++ b/libs/application/templates/inao/financial-statement-cemetery/src/fields/index.ts @@ -1,4 +1,3 @@ export { CemeteryCaretaker } from './CemeteryCareteker' -export { PowerOfAttorneyFields } from './PowerOfAttorney' export { CemeteryOverview } from './CemeteryOverview' -export { CemeteryIncomeLimit } from './CemeteryIncomeLimit' +export { FetchDataBasedOnSelectedYear } from './FetchDataBasedOnSelectedYear' diff --git a/libs/application/templates/inao/financial-statement-cemetery/src/forms/applicationForm/cemeteryCaretakerSection/caretakerMultiField.ts b/libs/application/templates/inao/financial-statement-cemetery/src/forms/applicationForm/cemeteryCaretakerSection/caretakerMultiField.ts deleted file mode 100644 index 21b59e7439fe..000000000000 --- a/libs/application/templates/inao/financial-statement-cemetery/src/forms/applicationForm/cemeteryCaretakerSection/caretakerMultiField.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { buildCustomField, buildMultiField } from '@island.is/application/core' -import { m } from '../../../lib/messages' -import { CEMETERYCARETAKER } from '../../../utils/constants' - -export const caretakerMultiField = buildMultiField({ - id: 'caretakers', - title: m.cemeteryBoardmembers, - description: m.cemeteryRegisterCaretakers, - children: [ - buildCustomField({ - id: 'cemeteryCaretaker', - title: m.cemeteryBoardmembers, - component: 'CemeteryCaretaker', - childInputIds: Object.values(CEMETERYCARETAKER), - }), - ], -}) diff --git a/libs/application/templates/inao/financial-statement-cemetery/src/forms/applicationForm/cemeteryCaretakerSection/index.ts b/libs/application/templates/inao/financial-statement-cemetery/src/forms/applicationForm/cemeteryCaretakerSection/index.ts index a5805af6e458..384036b026d1 100644 --- a/libs/application/templates/inao/financial-statement-cemetery/src/forms/applicationForm/cemeteryCaretakerSection/index.ts +++ b/libs/application/templates/inao/financial-statement-cemetery/src/forms/applicationForm/cemeteryCaretakerSection/index.ts @@ -1,9 +1,32 @@ -import { buildSection } from '@island.is/application/core' +import { + buildCustomField, + buildMultiField, + buildSection, +} from '@island.is/application/core' import { m } from '../../../lib/messages' -import { caretakerMultiField } from './caretakerMultiField' +import { CEMETERYCARETAKER } from '../../../utils/constants' +import { isCemetryUnderFinancialLimit } from '../../../utils/helpers' +// This section should appear if the cemetries total income is under the income limit export const cemeteryCaretekerSection = buildSection({ + condition: (answers) => { + return isCemetryUnderFinancialLimit(answers) + }, id: 'cemeteryCaretekerSection', title: m.cemeteryCaretakers, - children: [caretakerMultiField], + children: [ + buildMultiField({ + id: 'caretakers', + title: m.cemeteryBoardmembers, + description: m.cemeteryRegisterCaretakers, + children: [ + buildCustomField({ + id: 'cemeteryCaretaker', + title: m.cemeteryBoardmembers, + component: 'CemeteryCaretaker', + childInputIds: Object.values(CEMETERYCARETAKER), + }), + ], + }), + ], }) diff --git a/libs/application/templates/inao/financial-statement-cemetery/src/forms/applicationForm/cemeteryFinancialStatementSection/index.ts b/libs/application/templates/inao/financial-statement-cemetery/src/forms/applicationForm/cemeteryFinancialStatementSection/index.ts index 8df2c99ea9cd..b46b820b5714 100644 --- a/libs/application/templates/inao/financial-statement-cemetery/src/forms/applicationForm/cemeteryFinancialStatementSection/index.ts +++ b/libs/application/templates/inao/financial-statement-cemetery/src/forms/applicationForm/cemeteryFinancialStatementSection/index.ts @@ -1,30 +1,18 @@ import { buildFileUploadField, buildSection } from '@island.is/application/core' import { m } from '../../../lib/messages' -import { currencyStringToNumber } from '../../../utils/helpers' -import { FinancialStatementCemetery } from '../../../lib/dataSchema' +import { isCemetryUnderFinancialLimit } from '../../../utils/helpers' +// This section should appear if the cemetries total income is over the income limit export const cemeteryFinancialStatementSection = buildSection({ + condition: (answers) => { + return !isCemetryUnderFinancialLimit(answers) + }, id: 'documents', title: m.financialStatement, children: [ buildFileUploadField({ id: 'attachments.file', title: m.upload, - condition: (answers) => { - const applicationAnswers = answers as FinancialStatementCemetery - const careTakerLimit = - applicationAnswers.cemeteryOperation?.incomeLimit ?? '0' - const fixedAssetsTotal = - applicationAnswers.cemeteryAsset?.fixedAssetsTotal - const totalIncome = applicationAnswers.cemeteryIncome?.total - const longTermDebt = applicationAnswers.cemeteryLiability?.longTerm - const isUnderLimit = - currencyStringToNumber(totalIncome) < careTakerLimit - if (isUnderLimit && fixedAssetsTotal === '0' && longTermDebt === '0') { - return false - } - return true - }, introduction: m.uploadIntro, description: m.uploadDescription, uploadHeader: m.uploadHeader, diff --git a/libs/application/templates/inao/financial-statement-cemetery/src/forms/applicationForm/cemeteryKeyNumbersSection/capitalNumberSubSection.ts b/libs/application/templates/inao/financial-statement-cemetery/src/forms/applicationForm/cemeteryKeyNumbersSection/capitalNumberSubSection.ts index 86bc4ae3eaa0..c8f3ff8e67a3 100644 --- a/libs/application/templates/inao/financial-statement-cemetery/src/forms/applicationForm/cemeteryKeyNumbersSection/capitalNumberSubSection.ts +++ b/libs/application/templates/inao/financial-statement-cemetery/src/forms/applicationForm/cemeteryKeyNumbersSection/capitalNumberSubSection.ts @@ -6,7 +6,7 @@ import { } from '@island.is/application/core' import { m } from '../../../lib/messages' import { CAPITALNUMBERS } from '../../../utils/constants' -import { sumCapitalNumbers } from '../../../utils/helpers' +import { sumCapitalNumbers } from '../../../utils/sums' export const capitalNumberSubSection = buildSubSection({ id: 'keynumbers.capitalNumbers', diff --git a/libs/application/templates/inao/financial-statement-cemetery/src/forms/applicationForm/cemeteryKeyNumbersSection/equityAndLiabilitySubSection.ts b/libs/application/templates/inao/financial-statement-cemetery/src/forms/applicationForm/cemeteryKeyNumbersSection/equityAndLiabilitySubSection.ts index 1e0f6a2987f2..5a1b3b970132 100644 --- a/libs/application/templates/inao/financial-statement-cemetery/src/forms/applicationForm/cemeteryKeyNumbersSection/equityAndLiabilitySubSection.ts +++ b/libs/application/templates/inao/financial-statement-cemetery/src/forms/applicationForm/cemeteryKeyNumbersSection/equityAndLiabilitySubSection.ts @@ -13,12 +13,12 @@ import { } from '../../../utils/constants' import { operationResult, - showEquitiesAndLiabilitiesAlert, - sumAssets, sumLiabilities, - sumTotalEquity, sumTotalEquityAndLiabilities, -} from '../../../utils/helpers' + sumTotalEquity, + showEquitiesAndLiabilitiesAlert, + sumAssets, +} from '../../../utils/sums' export const equityAndLiabilitiesSubSection = buildSubSection({ id: 'keyNumbers.cemetryEquitiesAndLiabilities', diff --git a/libs/application/templates/inao/financial-statement-cemetery/src/forms/applicationForm/cemeteryKeyNumbersSection/opperatingCostSubSection.ts b/libs/application/templates/inao/financial-statement-cemetery/src/forms/applicationForm/cemeteryKeyNumbersSection/opperatingCostSubSection.ts index 34329fa8ee15..d15128bfd667 100644 --- a/libs/application/templates/inao/financial-statement-cemetery/src/forms/applicationForm/cemeteryKeyNumbersSection/opperatingCostSubSection.ts +++ b/libs/application/templates/inao/financial-statement-cemetery/src/forms/applicationForm/cemeteryKeyNumbersSection/opperatingCostSubSection.ts @@ -12,7 +12,7 @@ import { sumExpenses, sumIncome, sumOperatingResults, -} from '../../../utils/helpers' +} from '../../../utils/sums' export const opperatingCostSubSection = buildSubSection({ id: 'operatingCost', @@ -24,9 +24,9 @@ export const opperatingCostSubSection = buildSubSection({ description: m.fillOutAppopriate, children: [ buildCustomField({ - id: 'cemetryIncomeLimit', + id: 'fetchDataBasedOnYear', title: '', - component: 'CemeteryIncomeLimit', + component: 'FetchDataBasedOnSelectedYear', }), // Income buildDescriptionField({ diff --git a/libs/application/templates/inao/financial-statement-cemetery/src/forms/applicationForm/clientInfoSection/index.ts b/libs/application/templates/inao/financial-statement-cemetery/src/forms/applicationForm/clientInfoSection/index.ts index 9916366fd934..718b55a3d021 100644 --- a/libs/application/templates/inao/financial-statement-cemetery/src/forms/applicationForm/clientInfoSection/index.ts +++ b/libs/application/templates/inao/financial-statement-cemetery/src/forms/applicationForm/clientInfoSection/index.ts @@ -1,12 +1,13 @@ import { buildAsyncSelectField, - buildCustomField, buildDescriptionField, buildMultiField, + buildPhoneField, buildSection, buildTextField, + getValueViaPath, } from '@island.is/application/core' -import { Application, UserProfile } from '@island.is/application/types' +import { Application } from '@island.is/application/types' import { m } from '../../../lib/messages' import { ABOUTIDS } from '../../../utils/constants' import { Identity } from '@island.is/api/schema' @@ -58,42 +59,49 @@ export const clientInfoSection = buildSection({ return nationalRegistry.name }, }), - buildDescriptionField({ - id: 'about.description2', - title: '', + buildTextField({ + id: ABOUTIDS.powerOfAttorneyNationalId, + title: m.powerOfAttorneyNationalId, + width: 'half', + readOnly: true, + format: '######-####', + defaultValue: (application: Application) => + getValueViaPath( + application.externalData, + 'identity.data.actor.nationalId', + ), }), - buildCustomField({ - id: 'powerOfAttorney', - title: '', - description: '', - component: 'PowerOfAttorneyFields', - childInputIds: [ - ABOUTIDS.powerOfAttorneyNationalId, - ABOUTIDS.powerOfAttorneyName, - ], + buildTextField({ + id: ABOUTIDS.powerOfAttorneyName, + title: m.powerOfAttorneyName, + width: 'half', + readOnly: true, + defaultValue: (application: Application) => + getValueViaPath( + application.externalData, + 'identity.data.actor.name', + ), }), - buildTextField({ id: 'about.email', title: m.email, width: 'half', variant: 'email', - defaultValue: (application: Application) => { - const userProfile = application.externalData.userProfile - .data as UserProfile - return userProfile.email - }, + defaultValue: (application: Application) => + getValueViaPath( + application.externalData, + 'userProfile.data.email', + ), }), - buildTextField({ + buildPhoneField({ id: 'about.phoneNumber', title: m.phoneNumber, width: 'half', - variant: 'tel', - defaultValue: (application: Application) => { - const userProfile = application.externalData.userProfile - .data as UserProfile - return userProfile.mobilePhoneNumber - }, + defaultValue: (application: Application) => + getValueViaPath( + application.externalData, + 'userProfile.data.mobilePhoneNumber', + ), }), ], }), diff --git a/libs/application/templates/inao/financial-statement-cemetery/src/hooks/useTotals.ts b/libs/application/templates/inao/financial-statement-cemetery/src/hooks/useTotals.ts deleted file mode 100644 index 15a5873fdd5e..000000000000 --- a/libs/application/templates/inao/financial-statement-cemetery/src/hooks/useTotals.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { useCallback, useEffect, useState } from 'react' -import { useFormContext } from 'react-hook-form' -import { getTotal } from '../utils/helpers' - -const useTotals = (key: string): [() => void, number] => { - const [total, setTotal] = useState(0) - const { getValues } = useFormContext() - const getSum = useCallback(() => { - const values = getValues() - const sum = getTotal(values, key) - setTotal(sum) - }, [key, getValues, setTotal]) - - useEffect(() => { - getSum() - }, [getSum]) - - return [getSum, total] -} - -export { useTotals } diff --git a/libs/application/templates/inao/financial-statement-cemetery/src/lib/dataSchema.ts b/libs/application/templates/inao/financial-statement-cemetery/src/lib/dataSchema.ts index 97379678b103..35a8aefa428f 100644 --- a/libs/application/templates/inao/financial-statement-cemetery/src/lib/dataSchema.ts +++ b/libs/application/templates/inao/financial-statement-cemetery/src/lib/dataSchema.ts @@ -3,11 +3,9 @@ import { m } from './messages' import * as kennitala from 'kennitala' import { parsePhoneNumberFromString } from 'libphonenumber-js' import { BOARDMEMEBER, CARETAKER } from '../utils/constants' -import { - isPositiveNumberInString, - getBoardmembersAndCaretakers, -} from '../utils/helpers' +import { getBoardmembersAndCaretakers } from '../utils/helpers' import { YES } from '@island.is/application/types' +import { isPositiveNumberInString } from '../utils/currency' const FileSchema = z.object({ name: z.string(), diff --git a/libs/application/templates/inao/financial-statement-cemetery/src/types/types.ts b/libs/application/templates/inao/financial-statement-cemetery/src/types/types.ts index 53e29233513f..edd111488a8c 100644 --- a/libs/application/templates/inao/financial-statement-cemetery/src/types/types.ts +++ b/libs/application/templates/inao/financial-statement-cemetery/src/types/types.ts @@ -46,3 +46,19 @@ type InaoConfigItem = { export type AuditConfig = { financialStatementsInaoConfig: Array } + +export type CareTaker = { + nationalId: string + name: string + role: string +} + +export type TaxInfoItem = { + __typename: string + key: number + value: string +} + +export type TaxInfoData = { + financialStatementsInaoTaxInfo: Array +} diff --git a/libs/application/templates/inao/financial-statement-cemetery/src/utils/constants.ts b/libs/application/templates/inao/financial-statement-cemetery/src/utils/constants.ts index 2c0cb3bb6afe..190000af6700 100644 --- a/libs/application/templates/inao/financial-statement-cemetery/src/utils/constants.ts +++ b/libs/application/templates/inao/financial-statement-cemetery/src/utils/constants.ts @@ -26,6 +26,7 @@ export enum TaxInfoTypes { CARE_INCOME = 300, BURIAL_REVENUE = 301, GRANT_FROM_THE_CEMETERY_FUND = 302, + DONATIONS_TO_CEMETERYFUND = 334, } export const CEMETERYOPERATIONIDS = { diff --git a/libs/application/templates/inao/financial-statement-cemetery/src/utils/currency.ts b/libs/application/templates/inao/financial-statement-cemetery/src/utils/currency.ts new file mode 100644 index 000000000000..7ffe7149224c --- /dev/null +++ b/libs/application/templates/inao/financial-statement-cemetery/src/utils/currency.ts @@ -0,0 +1,16 @@ +export const currencyStringToNumber = (str: string) => { + if (!str) { + return str + } + const cleanString = str.replace(/[,\s]+|[.\s]+/g, '') + return parseInt(cleanString, 10) +} + +export const formatCurrency = (answer?: string) => { + if (!answer) return '0. kr' + return answer.replace(/\B(?=(\d{3})+(?!\d))/g, '.') + ' kr.' +} + +export const isPositiveNumberInString = (input: string) => { + return Number(input) >= 0 +} diff --git a/libs/application/templates/inao/financial-statement-cemetery/src/utils/helpers.ts b/libs/application/templates/inao/financial-statement-cemetery/src/utils/helpers.ts index aec943d790e8..9a6d72727122 100644 --- a/libs/application/templates/inao/financial-statement-cemetery/src/utils/helpers.ts +++ b/libs/application/templates/inao/financial-statement-cemetery/src/utils/helpers.ts @@ -1,42 +1,16 @@ -import { ExternalData, FormValue } from '@island.is/application/types' +import { FormValue } from '@island.is/application/types' import { getValueViaPath } from '@island.is/application/core' import { BOARDMEMEBER, - CAPITALNUMBERS, CARETAKER, CemeteriesBackwardLimit, CemeteriesYearAllowed, - CEMETERYEQUITIESANDLIABILITIESIDS, CEMETERYOPERATIONIDS, - EQUITYANDLIABILITIESTOTALS, - OPERATINGCOST, - TOTAL, + TaxInfoTypes, } from './constants' -import { FinancialStatementCemetery } from '../lib/dataSchema' import getYear from 'date-fns/getYear' import subYears from 'date-fns/subYears' -import { AuditConfig, BoardMember, Config, FSIUSERTYPE } from '../types/types' - -export const getTotal = (values: Record, key: string) => { - if (!values[key]) { - return 0 - } - const total = Object.entries(values[key]) - .filter(([k, v]) => k !== TOTAL && !isNaN(Number(v))) - .map(([_k, v]) => Number(v)) - .reduce((prev, current) => { - return (prev += current) - }, 0) - return total -} - -export const currencyStringToNumber = (str: string) => { - if (!str) { - return str - } - const cleanString = str.replace(/[,\s]+|[.\s]+/g, '') - return parseInt(cleanString, 10) -} +import { AuditConfig, BoardMember, TaxInfoItem } from '../types/types' export const getBoardmembersAndCaretakers = (members: Array) => { const careTakers = members @@ -60,11 +34,7 @@ export const isCemetryUnderFinancialLimit = (answers: FormValue) => { getValueViaPath(answers, 'cemeteryLiability.longTerm') || '0' const isUnderLimit = Number(totalIncome) < Number(incomeLimit) - if (isUnderLimit && fixedAssetsTotal === '0' && longTermDebt === '0') { - return true - } - - return false + return isUnderLimit && fixedAssetsTotal === '0' && longTermDebt === '0' } export const getYearOptions = (data: AuditConfig) => { @@ -103,226 +73,64 @@ export const possibleOperatingYears = ( return operationYears } -export const getConfigInfoForKey = (config: Config[], configKey: string) => { - return config?.filter((config: Config) => config.key === configKey)[0].value -} - -export const formatCurrency = (answer?: string) => { - if (!answer) return '0. kr' - return answer.replace(/\B(?=(\d{3})+(?!\d))/g, '.') + ' kr.' -} - -export const isPositiveNumberInString = (input: string) => { - return Number(input) > 0 -} - -export const sumIncome = (answers: FormValue) => { - const careIncome = - getValueViaPath(answers, CEMETERYOPERATIONIDS.careIncome) || '0' - const burialRevenue = - getValueViaPath(answers, CEMETERYOPERATIONIDS.burialRevenue) || '0' - const grantFromTheCemeteryFund = - getValueViaPath( - answers, - CEMETERYOPERATIONIDS.grantFromTheCemeteryFund, - ) || '0' - const otherIncome = - getValueViaPath(answers, CEMETERYOPERATIONIDS.otherIncome) || '0' - - return `${ - Number(careIncome) + - Number(burialRevenue) + - Number(grantFromTheCemeteryFund) + - Number(otherIncome) - }` -} - -export const sumExpenses = (answers: FormValue) => { - const payroll = getValueViaPath(answers, CEMETERYOPERATIONIDS.payroll) - const funeralCost = - getValueViaPath(answers, CEMETERYOPERATIONIDS.funeralCost) || '0' - const chapelExpense = - getValueViaPath(answers, CEMETERYOPERATIONIDS.chapelExpense) || '0' - const donationsToCemeteryFund = - getValueViaPath( - answers, - CEMETERYOPERATIONIDS.donationsToCemeteryFund, - ) || '0' - const donationsToOther = - getValueViaPath(answers, CEMETERYOPERATIONIDS.donationsToOther) || - '0' - const otherOperationCost = - getValueViaPath(answers, CEMETERYOPERATIONIDS.otherOperationCost) || - '0' - const depreciation = - getValueViaPath(answers, CEMETERYOPERATIONIDS.depreciation) || '0' - - return `${ - Number(payroll) + - Number(funeralCost) + - Number(chapelExpense) + - Number(donationsToCemeteryFund) + - Number(donationsToOther) + - Number(otherOperationCost) + - Number(depreciation) - }` -} - -export const sumOperatingResults = (answers: FormValue) => { - const income = - getValueViaPath(answers, CEMETERYOPERATIONIDS.totalIncome) || '0' - const expenses = - getValueViaPath(answers, CEMETERYOPERATIONIDS.totalExpense) || '0' - - return `${Number(income) - Number(expenses)}` -} - -export const sumCapitalNumbers = (answers: FormValue) => { - const capitalIncome = - getValueViaPath(answers, CAPITALNUMBERS.capitalIncome) || '0' - const capitalCost = - getValueViaPath(answers, CAPITALNUMBERS.capitalCost) || '0' - return `${Number(capitalIncome) - Number(capitalCost)}` -} - -export const sumAssets = (answers: FormValue) => { - const fixedAssetsTotal = - getValueViaPath( - answers, - CEMETERYEQUITIESANDLIABILITIESIDS.fixedAssetsTotal, - ) || '0' - const currentAssets = - getValueViaPath( - answers, - CEMETERYEQUITIESANDLIABILITIESIDS.currentAssets, - ) || '0' - return `${Number(fixedAssetsTotal) + Number(currentAssets)}` -} - -export const sumLiabilities = (answers: FormValue) => { - const longTerm = - getValueViaPath( - answers, - CEMETERYEQUITIESANDLIABILITIESIDS.longTerm, - ) || '0' - const shortTerm = - getValueViaPath( - answers, - CEMETERYEQUITIESANDLIABILITIESIDS.shortTerm, - ) || '0' - return `${Number(longTerm) + Number(shortTerm)}` -} - -export const operationResult = (answers: FormValue) => { - const operatingTotalCost = - getValueViaPath(answers, OPERATINGCOST.total) || '0' - const capitalTotal = - getValueViaPath(answers, CAPITALNUMBERS.total) || '0' - return `${Number(operatingTotalCost) + Number(capitalTotal)}` -} - -export const sumTotalEquity = (answers: FormValue) => { - const equityAtTheBeginningOfTheYear = - getValueViaPath( - answers, - CEMETERYEQUITIESANDLIABILITIESIDS.equityAtTheBeginningOfTheYear, - ) || '0' - const revaluationDueToPriceChanges = - getValueViaPath( - answers, - CEMETERYEQUITIESANDLIABILITIESIDS.revaluationDueToPriceChanges, - ) || '0' - const reevaluateOther = - getValueViaPath( - answers, - CEMETERYEQUITIESANDLIABILITIESIDS.reevaluateOther, - ) || '0' - const operationResult = - getValueViaPath( - answers, - CEMETERYEQUITIESANDLIABILITIESIDS.operationResult, - ) || '0' - - return `${ - Number(equityAtTheBeginningOfTheYear) + - Number(revaluationDueToPriceChanges) + - Number(reevaluateOther) + - Number(operationResult) - }` -} - -export const sumTotalEquityAndLiabilities = (answers: FormValue) => { - const liabilityTotal = - getValueViaPath( - answers, - EQUITYANDLIABILITIESTOTALS.liabilitiesTotal, - ) || '0' - const totalEquity = - getValueViaPath( - answers, - CEMETERYEQUITIESANDLIABILITIESIDS.equityTotal, - ) || '0' +export const getCareIncomeAndBurialRevenueAndGrant = ( + taxInfo?: Array, +) => { + if (!taxInfo) { + return { + careIncome: undefined, + burialRevenue: undefined, + grantFromTheCemeteryFund: undefined, + } + } - return `${Number(totalEquity) + Number(liabilityTotal)}` + const careIncome = taxInfo.find( + (item) => item.key === TaxInfoTypes.CARE_INCOME, + ) + const burialRevenue = taxInfo.find( + (item) => item.key === TaxInfoTypes.BURIAL_REVENUE, + ) + const grantFromTheCemeteryFund = taxInfo.find( + (item) => item.key === TaxInfoTypes.GRANT_FROM_THE_CEMETERY_FUND, + ) + const donationsToCemeteryFund = taxInfo.find( + (item) => item.key === TaxInfoTypes.DONATIONS_TO_CEMETERYFUND, + ) + + return { + careIncome: careIncome ? careIncome.value : undefined, + burialRevenue: burialRevenue ? burialRevenue.value : undefined, + grantFromTheCemeteryFund: grantFromTheCemeteryFund + ? grantFromTheCemeteryFund.value + : undefined, + donationsToCemeteryFund: donationsToCemeteryFund + ? donationsToCemeteryFund.value + : undefined, + } } -export const showEquitiesAndLiabilitiesAlert = (answers: FormValue) => { - const fixedAssetsTotal = - getValueViaPath( - answers, - CEMETERYEQUITIESANDLIABILITIESIDS.fixedAssetsTotal, - ) || '0' - const currentAssets = - getValueViaPath( - answers, - CEMETERYEQUITIESANDLIABILITIESIDS.currentAssets, - ) || '0' - const longTerm = - getValueViaPath( - answers, - CEMETERYEQUITIESANDLIABILITIESIDS.longTerm, - ) || '0' - const shortTerm = - getValueViaPath( - answers, - CEMETERYEQUITIESANDLIABILITIESIDS.shortTerm, - ) || '0' - const equityAtTheBeginningOfTheYear = - getValueViaPath( - answers, - CEMETERYEQUITIESANDLIABILITIESIDS.equityAtTheBeginningOfTheYear, - ) || '0' - const revaluationDueToPriceChanges = - getValueViaPath( - answers, - CEMETERYEQUITIESANDLIABILITIESIDS.revaluationDueToPriceChanges, - ) || '0' - const reevaluateOther = - getValueViaPath( - answers, - CEMETERYEQUITIESANDLIABILITIESIDS.reevaluateOther, - ) || '0' - - const totalAssets = - getValueViaPath(answers, EQUITYANDLIABILITIESTOTALS.assetsTotal) || - '0' - const totalEquityAndLiabilities = - getValueViaPath( - answers, - EQUITYANDLIABILITIESTOTALS.equityAndLiabilitiesTotal, - ) || '0' - - if ( - !fixedAssetsTotal || - !currentAssets || - !longTerm || - !shortTerm || - !equityAtTheBeginningOfTheYear || - !revaluationDueToPriceChanges || - !reevaluateOther || - !operationResult - ) { - return false +export const getTaxInfoFromAnswers = (answers: FormValue) => { + const careIncome = getValueViaPath( + answers, + CEMETERYOPERATIONIDS.careIncome, + ) + const burialRevenue = getValueViaPath( + answers, + CEMETERYOPERATIONIDS.burialRevenue, + ) + const grantFromTheCemeteryFund = getValueViaPath( + answers, + CEMETERYOPERATIONIDS.grantFromTheCemeteryFund, + ) + const donationsToCemeteryFund = getValueViaPath( + answers, + CEMETERYOPERATIONIDS.donationsToCemeteryFund, + ) + + return { + careIncomeFromAnswers: careIncome, + burialRevenueFromAnswers: burialRevenue, + grantFromTheCemeteryFundFromAnswers: grantFromTheCemeteryFund, + donationsToCemeteryFundFromAnswers: donationsToCemeteryFund, } - return totalAssets !== totalEquityAndLiabilities } diff --git a/libs/application/templates/inao/financial-statement-cemetery/src/utils/overviewUtils.ts b/libs/application/templates/inao/financial-statement-cemetery/src/utils/overviewUtils.ts new file mode 100644 index 000000000000..f27cb0ef6f96 --- /dev/null +++ b/libs/application/templates/inao/financial-statement-cemetery/src/utils/overviewUtils.ts @@ -0,0 +1,189 @@ +import { FormValue } from '@island.is/application/types' +import { getValueViaPath } from '@island.is/application/core' +import { CareTaker } from '../types/types' +import { formatPhoneNumber } from '@island.is/application/ui-components' +import { format as formatNationalId } from 'kennitala' +import { formatCurrency } from './currency' + +export const getOverviewNumbers = (answers: FormValue) => { + const file = getValueViaPath>(answers, 'attachments.file') + const fileName = file?.[0]?.name + const incomeLimit = + getValueViaPath(answers, 'cemeteryOperations.incomeLimit') ?? '0' + const email = getValueViaPath(answers, 'about.email') + const careIncome = getValueViaPath( + answers, + 'cemeteryIncome.careIncome', + ) + const cemeteryCaretakers = getValueViaPath>( + answers, + 'cemeteryCaretaker', + ) + const burialRevenue = getValueViaPath( + answers, + 'cemeteryIncome.burialRevenue', + ) + const grantFromTheCemeteryFund = getValueViaPath( + answers, + 'cemeteryIncome.grantFromTheCemeteryFund', + ) + const otherIncome = getValueViaPath( + answers, + 'cemeteryIncome.otherIncome', + ) + const totalIncome = getValueViaPath(answers, 'cemeteryIncome.total') + + const payroll = getValueViaPath(answers, 'cemeteryExpense.payroll') + const funeralCost = getValueViaPath( + answers, + 'cemeteryExpense.funeralCost', + ) + const chapelExpense = getValueViaPath( + answers, + 'cemeteryExpense.chapelExpense', + ) + const donationsToCemeteryFund = getValueViaPath( + answers, + 'cemeteryExpense.cemeteryFundExpense', + ) + const donationsToOther = getValueViaPath( + answers, + 'cemeteryExpense.donationsToOther', + ) + const otherOperationCost = getValueViaPath( + answers, + 'cemeteryExpense.otherOperationCost', + ) + const depreciation = getValueViaPath( + answers, + 'cemeteryExpense.depreciation', + ) + const totalExpenses = getValueViaPath( + answers, + 'cemeteryExpense.total', + ) + + const fixedAssetsTotal = getValueViaPath( + answers, + 'cemeteryAsset.fixedAssetsTotal', + ) + const currentAssets = getValueViaPath( + answers, + 'cemeteryAsset.currentAssets', + ) + const totalAssets = getValueViaPath(answers, 'assetsTotal') + + const longTerm = getValueViaPath( + answers, + 'cemeteryLiability.longTerm', + ) + const shortTerm = getValueViaPath( + answers, + 'cemeteryLiability.shortTerm', + ) + const totalLiabilities = getValueViaPath( + answers, + 'equityAndLiabilitiesTotals.liabilitiesTotal', + ) + + const equityAtTheBeginningOfTheYear = getValueViaPath( + answers, + 'cemeteryEquity.equityAtTheBeginningOfTheYear', + ) + const revaluationDueToPriceChanges = getValueViaPath( + answers, + 'cemeteryEquity.revaluationDueToPriceChanges', + ) + const reevaluateOther = getValueViaPath( + answers, + 'cemeteryEquity.reevaluateOther', + ) + const operationResult = getValueViaPath( + answers, + 'cemeteryEquity.operationResult', + ) + const totalEquity = getValueViaPath(answers, 'cemeteryEquity.total') + + const debtsAndCash = getValueViaPath( + answers, + 'equityAndLiabilitiesTotals.equityAndLiabilitiesTotal', + ) + + return { + file, + fileName, + incomeLimit, + email, + cemeteryCaretakers, + careIncome, + burialRevenue, + grantFromTheCemeteryFund, + otherIncome, + totalIncome, + payroll, + funeralCost, + chapelExpense, + donationsToCemeteryFund, + donationsToOther, + otherOperationCost, + depreciation, + totalExpenses, + fixedAssetsTotal, + currentAssets, + totalAssets, + longTerm, + shortTerm, + totalLiabilities, + equityAtTheBeginningOfTheYear, + revaluationDueToPriceChanges, + reevaluateOther, + operationResult, + totalEquity, + debtsAndCash, + } +} + +export const getAboutOverviewNumbers = (answers: FormValue) => { + const fullName = getValueViaPath(answers, 'about.fullName') + const nationalId = formatNationalId( + getValueViaPath(answers, 'about.nationalId') ?? '', + ) + const powerOfAttorneyName = getValueViaPath( + answers, + 'about.powerOfAttorneyName', + ) + const powerOfAttorneyNationalId = formatNationalId( + getValueViaPath(answers, 'about.powerOfAttorneyNationalId') ?? '', + ) + const email = getValueViaPath(answers, 'about.email') + const phoneNumber = formatPhoneNumber( + getValueViaPath(answers, 'about.phoneNumber') ?? '', + ) + + return { + fullName, + nationalId, + powerOfAttorneyName, + powerOfAttorneyNationalId, + email, + phoneNumber, + } +} + +export const getCapitalNumbersOverviewNumbers = (answers: FormValue) => { + const capitalIncome = formatCurrency( + getValueViaPath(answers, 'capitalNumbers.capitalIncome'), + ) + const capitalCost = formatCurrency( + getValueViaPath(answers, 'capitalNumbers.capitalCost'), + ) + const totalCapital = formatCurrency( + getValueViaPath(answers, 'capitalNumbers.total'), + ) + + return { + capitalIncome, + capitalCost, + totalCapital, + } +} diff --git a/libs/application/templates/inao/financial-statement-cemetery/src/utils/sums.ts b/libs/application/templates/inao/financial-statement-cemetery/src/utils/sums.ts new file mode 100644 index 000000000000..4b8e6c2e1738 --- /dev/null +++ b/libs/application/templates/inao/financial-statement-cemetery/src/utils/sums.ts @@ -0,0 +1,225 @@ +import { FormValue } from '@island.is/application/types' +import { getValueViaPath } from '@island.is/application/core' +import { + CAPITALNUMBERS, + CEMETERYEQUITIESANDLIABILITIESIDS, + CEMETERYOPERATIONIDS, + EQUITYANDLIABILITIESTOTALS, + OPERATINGCOST, +} from './constants' + +export const sumIncome = (answers: FormValue) => { + const careIncome = + getValueViaPath(answers, CEMETERYOPERATIONIDS.careIncome) || '0' + const burialRevenue = + getValueViaPath(answers, CEMETERYOPERATIONIDS.burialRevenue) || '0' + const grantFromTheCemeteryFund = + getValueViaPath( + answers, + CEMETERYOPERATIONIDS.grantFromTheCemeteryFund, + ) || '0' + const otherIncome = + getValueViaPath(answers, CEMETERYOPERATIONIDS.otherIncome) || '0' + + return `${ + Number(careIncome) + + Number(burialRevenue) + + Number(grantFromTheCemeteryFund) + + Number(otherIncome) + }` +} + +export const sumExpenses = (answers: FormValue) => { + const payroll = getValueViaPath(answers, CEMETERYOPERATIONIDS.payroll) + const funeralCost = + getValueViaPath(answers, CEMETERYOPERATIONIDS.funeralCost) || '0' + const chapelExpense = + getValueViaPath(answers, CEMETERYOPERATIONIDS.chapelExpense) || '0' + const donationsToCemeteryFund = + getValueViaPath( + answers, + CEMETERYOPERATIONIDS.donationsToCemeteryFund, + ) || '0' + const donationsToOther = + getValueViaPath(answers, CEMETERYOPERATIONIDS.donationsToOther) || + '0' + const otherOperationCost = + getValueViaPath(answers, CEMETERYOPERATIONIDS.otherOperationCost) || + '0' + const depreciation = + getValueViaPath(answers, CEMETERYOPERATIONIDS.depreciation) || '0' + + return `${ + Number(payroll) + + Number(funeralCost) + + Number(chapelExpense) + + Number(donationsToCemeteryFund) + + Number(donationsToOther) + + Number(otherOperationCost) + + Number(depreciation) + }` +} + +export const sumOperatingResults = (answers: FormValue) => { + const income = + getValueViaPath(answers, CEMETERYOPERATIONIDS.totalIncome) || '0' + const expenses = + getValueViaPath(answers, CEMETERYOPERATIONIDS.totalExpense) || '0' + + return `${Number(income) - Number(expenses)}` +} + +export const sumCapitalNumbers = (answers: FormValue) => { + const capitalIncome = + getValueViaPath(answers, CAPITALNUMBERS.capitalIncome) || '0' + const capitalCost = + getValueViaPath(answers, CAPITALNUMBERS.capitalCost) || '0' + return `${Number(capitalIncome) - Number(capitalCost)}` +} + +export const sumAssets = (answers: FormValue) => { + const fixedAssetsTotal = + getValueViaPath( + answers, + CEMETERYEQUITIESANDLIABILITIESIDS.fixedAssetsTotal, + ) || '0' + const currentAssets = + getValueViaPath( + answers, + CEMETERYEQUITIESANDLIABILITIESIDS.currentAssets, + ) || '0' + return `${Number(fixedAssetsTotal) + Number(currentAssets)}` +} + +export const sumLiabilities = (answers: FormValue) => { + const longTerm = + getValueViaPath( + answers, + CEMETERYEQUITIESANDLIABILITIESIDS.longTerm, + ) || '0' + const shortTerm = + getValueViaPath( + answers, + CEMETERYEQUITIESANDLIABILITIESIDS.shortTerm, + ) || '0' + return `${Number(longTerm) + Number(shortTerm)}` +} + +export const operationResult = (answers: FormValue) => { + const operatingTotalCost = + getValueViaPath(answers, OPERATINGCOST.total) || '0' + const capitalTotal = + getValueViaPath(answers, CAPITALNUMBERS.total) || '0' + return `${Number(operatingTotalCost) + Number(capitalTotal)}` +} + +export const sumTotalEquity = (answers: FormValue) => { + const equityAtTheBeginningOfTheYear = + getValueViaPath( + answers, + CEMETERYEQUITIESANDLIABILITIESIDS.equityAtTheBeginningOfTheYear, + ) || '0' + const revaluationDueToPriceChanges = + getValueViaPath( + answers, + CEMETERYEQUITIESANDLIABILITIESIDS.revaluationDueToPriceChanges, + ) || '0' + const reevaluateOther = + getValueViaPath( + answers, + CEMETERYEQUITIESANDLIABILITIESIDS.reevaluateOther, + ) || '0' + const operationResult = + getValueViaPath( + answers, + CEMETERYEQUITIESANDLIABILITIESIDS.operationResult, + ) || '0' + + return `${ + Number(equityAtTheBeginningOfTheYear) + + Number(revaluationDueToPriceChanges) + + Number(reevaluateOther) + + Number(operationResult) + }` +} + +export const sumTotalEquityAndLiabilities = (answers: FormValue) => { + const liabilityTotal = + getValueViaPath( + answers, + EQUITYANDLIABILITIESTOTALS.liabilitiesTotal, + ) || '0' + const totalEquity = + getValueViaPath( + answers, + CEMETERYEQUITIESANDLIABILITIESIDS.equityTotal, + ) || '0' + + return `${Number(totalEquity) + Number(liabilityTotal)}` +} + +export const showEquitiesAndLiabilitiesAlert = (answers: FormValue) => { + const fixedAssetsTotal = + getValueViaPath( + answers, + CEMETERYEQUITIESANDLIABILITIESIDS.fixedAssetsTotal, + ) || '0' + const currentAssets = + getValueViaPath( + answers, + CEMETERYEQUITIESANDLIABILITIESIDS.currentAssets, + ) || '0' + const longTerm = + getValueViaPath( + answers, + CEMETERYEQUITIESANDLIABILITIESIDS.longTerm, + ) || '0' + const shortTerm = + getValueViaPath( + answers, + CEMETERYEQUITIESANDLIABILITIESIDS.shortTerm, + ) || '0' + const equityAtTheBeginningOfTheYear = + getValueViaPath( + answers, + CEMETERYEQUITIESANDLIABILITIESIDS.equityAtTheBeginningOfTheYear, + ) || '0' + const revaluationDueToPriceChanges = + getValueViaPath( + answers, + CEMETERYEQUITIESANDLIABILITIESIDS.revaluationDueToPriceChanges, + ) || '0' + const reevaluateOther = + getValueViaPath( + answers, + CEMETERYEQUITIESANDLIABILITIESIDS.reevaluateOther, + ) || '0' + + const totalAssets = + getValueViaPath(answers, EQUITYANDLIABILITIESTOTALS.assetsTotal) || + '0' + const totalEquityAndLiabilities = + getValueViaPath( + answers, + EQUITYANDLIABILITIESTOTALS.equityAndLiabilitiesTotal, + ) || '0' + const operationResult = + getValueViaPath( + answers, + CEMETERYEQUITIESANDLIABILITIESIDS.operationResult, + ) || '0' + + if ( + !fixedAssetsTotal || + !currentAssets || + !longTerm || + !shortTerm || + !equityAtTheBeginningOfTheYear || + !revaluationDueToPriceChanges || + !reevaluateOther || + !operationResult + ) { + return false + } + return totalAssets !== totalEquityAndLiabilities +} From 04563fd4d14e94693b0ef6edba5c1bde1ccf13d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=8Dvar=20Oddsson?= Date: Thu, 12 Dec 2024 22:43:52 +0000 Subject: [PATCH 06/14] feat(j-s): Add court name abbr. to prison cases table (#17171) Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> --- .../src/routes/Shared/Cases/PrisonCases.tsx | 31 ++++++++++++++----- .../routes/Shared/Cases/prisonCases.graphql | 4 +++ 2 files changed, 27 insertions(+), 8 deletions(-) diff --git a/apps/judicial-system/web/src/routes/Shared/Cases/PrisonCases.tsx b/apps/judicial-system/web/src/routes/Shared/Cases/PrisonCases.tsx index ad91229428cb..3027b2e998f6 100644 --- a/apps/judicial-system/web/src/routes/Shared/Cases/PrisonCases.tsx +++ b/apps/judicial-system/web/src/routes/Shared/Cases/PrisonCases.tsx @@ -3,7 +3,10 @@ import { useIntl } from 'react-intl' import partition from 'lodash/partition' import { AlertMessage, Box, Tag, Text } from '@island.is/island-ui/core' -import { capitalize } from '@island.is/judicial-system/formatters' +import { + capitalize, + districtCourtAbbreviation, +} from '@island.is/judicial-system/formatters' import { core, errors, @@ -166,6 +169,10 @@ export const PrisonCases: FC = () => { thead={[ { title: formatMessage(tables.caseNumber), + sortable: { + isSortable: true, + key: 'courtCaseNumber', + }, }, { title: capitalize(formatMessage(core.defendant, { suffix: 'i' })), @@ -182,13 +189,21 @@ export const PrisonCases: FC = () => { data={cases} columns={[ { - cell: (row) => ( - - ), + cell: (row) => { + const courtAbbreviation = districtCourtAbbreviation( + row.court?.name, + ) + + return ( + + ) + }, }, { cell: (row) => , diff --git a/apps/judicial-system/web/src/routes/Shared/Cases/prisonCases.graphql b/apps/judicial-system/web/src/routes/Shared/Cases/prisonCases.graphql index 23b25b22538c..04f635815e1e 100644 --- a/apps/judicial-system/web/src/routes/Shared/Cases/prisonCases.graphql +++ b/apps/judicial-system/web/src/routes/Shared/Cases/prisonCases.graphql @@ -44,6 +44,10 @@ query PrisonCases { role active } + court { + id + name + } prosecutor { id created From 4241fe5d49e70332323c2f27eb40f13ae7bd2b0c Mon Sep 17 00:00:00 2001 From: HjorturJ <34068269+HjorturJ@users.noreply.github.com> Date: Thu, 12 Dec 2024 22:54:01 +0000 Subject: [PATCH 07/14] fix(application-system): Possible to go back to hidden screens (#17162) * Early investigation * chore: nx format:write update dirty files * More investigation and testing * Cleaning up a bit * chore: nx format:write update dirty files * Changing into a 1 liner change * chore: nx format:write update dirty files * Reverting test changes * Going another route to avoid bugs * Removing whitespace --------- Co-authored-by: andes-it Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> --- .../ui-shell/src/components/Screen.tsx | 3 +++ .../ui-shell/src/components/ScreenFooter.tsx | 5 +++-- .../ui-shell/src/lib/FormShell.tsx | 2 ++ .../ui-shell/src/reducer/reducerUtils.ts | 19 +++++++++++++++++++ 4 files changed, 27 insertions(+), 2 deletions(-) diff --git a/libs/application/ui-shell/src/components/Screen.tsx b/libs/application/ui-shell/src/components/Screen.tsx index 52bcbcce6625..907a34d76624 100644 --- a/libs/application/ui-shell/src/components/Screen.tsx +++ b/libs/application/ui-shell/src/components/Screen.tsx @@ -76,6 +76,7 @@ type ScreenProps = { renderLastScreenBackButton?: boolean goToScreen: (id: string) => void setUpdateForbidden: (value: boolean) => void + canGoBack: boolean } const getServerValidationErrors = (error: ApolloError | undefined) => { @@ -107,6 +108,7 @@ const Screen: FC> = ({ renderLastScreenBackButton, screen, sections, + canGoBack, }) => { const { answers: formValue, externalData, id: applicationId } = application const { lang: locale, formatMessage } = useLocale() @@ -416,6 +418,7 @@ const Screen: FC> = ({ numberOfScreens={numberOfScreens} mode={mode} goBack={goBack} + canGoBack={canGoBack} submitField={submitField} loading={loading} canProceed={!isLoadingOrPending} diff --git a/libs/application/ui-shell/src/components/ScreenFooter.tsx b/libs/application/ui-shell/src/components/ScreenFooter.tsx index 253e4665c354..2c6b653dada9 100644 --- a/libs/application/ui-shell/src/components/ScreenFooter.tsx +++ b/libs/application/ui-shell/src/components/ScreenFooter.tsx @@ -27,6 +27,7 @@ interface FooterProps { renderLastScreenBackButton?: boolean submitButtonDisabled?: boolean nextButtonText?: FormText + canGoBack: boolean } type SubmitButton = Omit & { @@ -68,13 +69,13 @@ export const ScreenFooter: FC> = ({ renderLastScreenBackButton, submitButtonDisabled, nextButtonText, + canGoBack, }) => { const { formatMessage } = useLocale() const user = useUserInfo() const hasSubmitField = submitField !== undefined const isLastScreen = activeScreenIndex === numberOfScreens - 1 - const showGoBack = - activeScreenIndex > 0 && (!isLastScreen || renderLastScreenBackButton) + const showGoBack = canGoBack && (!isLastScreen || renderLastScreenBackButton) if ( (isLastScreen && !renderLastScreenButton) || diff --git a/libs/application/ui-shell/src/lib/FormShell.tsx b/libs/application/ui-shell/src/lib/FormShell.tsx index d3be0a1e4747..8e1beef1c9ee 100644 --- a/libs/application/ui-shell/src/lib/FormShell.tsx +++ b/libs/application/ui-shell/src/lib/FormShell.tsx @@ -25,6 +25,7 @@ import { } from '../reducer/ApplicationFormReducer' import { ActionTypes } from '../reducer/ReducerTypes' import * as styles from './FormShell.css' +import { canGoBack } from '../reducer/reducerUtils' export const FormShell: FC< React.PropsWithChildren<{ @@ -142,6 +143,7 @@ export const FormShell: FC< payload, }) }} + canGoBack={canGoBack(screens, activeScreen)} prevScreen={() => dispatch({ type: ActionTypes.PREV_SCREEN })} activeScreenIndex={activeScreen} numberOfScreens={screens.length} diff --git a/libs/application/ui-shell/src/reducer/reducerUtils.ts b/libs/application/ui-shell/src/reducer/reducerUtils.ts index 72c76a0f9c92..8b3a0b6f38ed 100644 --- a/libs/application/ui-shell/src/reducer/reducerUtils.ts +++ b/libs/application/ui-shell/src/reducer/reducerUtils.ts @@ -181,6 +181,25 @@ export const moveToScreen = ( return screenIndex } +export const canGoBack = ( + screens: FormScreen[], + screenIndex: number, +): boolean => { + // Check if we're already at the start + if (screenIndex <= 0) { + return false + } + + // Look for any navigable screen behind where we are + for (let i = screenIndex - 1; i >= 0; i--) { + if (screens[i].isNavigable) { + return true + } + } + + return false +} + const convertFieldToScreen = ( field: Field, answers: FormValue, From 920eb26f9a2623282f59c066d49760907289a40d Mon Sep 17 00:00:00 2001 From: unakb Date: Thu, 12 Dec 2024 23:29:47 +0000 Subject: [PATCH 08/14] fix(j-s): Police case number in robot e-mail (#17218) Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> --- .../backend/src/app/modules/court/court.service.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/judicial-system/backend/src/app/modules/court/court.service.ts b/apps/judicial-system/backend/src/app/modules/court/court.service.ts index df13b35a90be..33f9c74c7c83 100644 --- a/apps/judicial-system/backend/src/app/modules/court/court.service.ts +++ b/apps/judicial-system/backend/src/app/modules/court/court.service.ts @@ -577,12 +577,12 @@ export class CourtService { try { const subject = `${courtName} - ${courtCaseNumber} - upplýsingar` - const sanitizedPoliceCaseNumber = policeCaseNumber?.replace(/-/g, '') + policeCaseNumber = policeCaseNumber?.replace(/-/g, '') const content = JSON.stringify({ receivedByCourtDate, indictmentDate, - sanitizedPoliceCaseNumber, + policeCaseNumber, subtypes, defendants, prosecutor, From 09111419376a00eab84eeddea3bbc363840ab01f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafn=20=C3=81rnason?= Date: Fri, 13 Dec 2024 00:09:41 +0000 Subject: [PATCH 09/14] feat(user-notification): Firebase Credentials Setup for Local Development (#17199) * fix get-secrets and env cleanup * chore: nx format:write update dirty files * string cleaner for local * chore: nx format:write update dirty files * update get-secrets * cleanup * cleanup * move logic to render-secrets --------- Co-authored-by: andes-it Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> --- infra/src/cli/render-secrets.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/infra/src/cli/render-secrets.ts b/infra/src/cli/render-secrets.ts index 9c859e2afba8..0ba1ba705b36 100644 --- a/infra/src/cli/render-secrets.ts +++ b/infra/src/cli/render-secrets.ts @@ -68,9 +68,7 @@ export const renderSecrets = async (service: string) => { logger.debug('env when rendering', { envMap }) Object.entries(envMap).forEach(([key, value]) => { - const escapedValue = (value ?? '') - .replace(/\n/g, '\\n') - .replace(/"/g, '\\"') + const escapedValue = (value ?? '').replace(/'/g, "\\'") console.log(`export ${key}='${escapedValue}'`) }) return envMap From 1e607631e6e0c35f89b044cc2a6bd553598aa872 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=9E=C3=B3rey=20J=C3=B3na?= Date: Fri, 13 Dec 2024 00:17:25 +0000 Subject: [PATCH 10/14] feat(native-app): Update passkey information link (#17221) * chore: update podfile.lock * feat: update link address for further info about passkeys --------- Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> --- apps/native/app/ios/Podfile.lock | 70 ++++++++++++++++++- .../app/src/screens/passkey/passkey.tsx | 5 +- 2 files changed, 72 insertions(+), 3 deletions(-) diff --git a/apps/native/app/ios/Podfile.lock b/apps/native/app/ios/Podfile.lock index 4a489728f683..8223c8bef141 100644 --- a/apps/native/app/ios/Podfile.lock +++ b/apps/native/app/ios/Podfile.lock @@ -1531,7 +1531,73 @@ PODS: - React-Core - RNQuickAction (0.3.13): - React - - RNReanimated (3.12.1): + - RNReanimated (3.16.5): + - DoubleConversion + - glog + - hermes-engine + - RCT-Folly (= 2024.01.01.00) + - RCTRequired + - RCTTypeSafety + - React-Codegen + - React-Core + - React-debug + - React-Fabric + - React-featureflags + - React-graphics + - React-ImageManager + - React-NativeModulesApple + - React-RCTFabric + - React-rendererdebug + - React-utils + - ReactCommon/turbomodule/bridging + - ReactCommon/turbomodule/core + - RNReanimated/reanimated (= 3.16.5) + - RNReanimated/worklets (= 3.16.5) + - Yoga + - RNReanimated/reanimated (3.16.5): + - DoubleConversion + - glog + - hermes-engine + - RCT-Folly (= 2024.01.01.00) + - RCTRequired + - RCTTypeSafety + - React-Codegen + - React-Core + - React-debug + - React-Fabric + - React-featureflags + - React-graphics + - React-ImageManager + - React-NativeModulesApple + - React-RCTFabric + - React-rendererdebug + - React-utils + - ReactCommon/turbomodule/bridging + - ReactCommon/turbomodule/core + - RNReanimated/reanimated/apple (= 3.16.5) + - Yoga + - RNReanimated/reanimated/apple (3.16.5): + - DoubleConversion + - glog + - hermes-engine + - RCT-Folly (= 2024.01.01.00) + - RCTRequired + - RCTTypeSafety + - React-Codegen + - React-Core + - React-debug + - React-Fabric + - React-featureflags + - React-graphics + - React-ImageManager + - React-NativeModulesApple + - React-RCTFabric + - React-rendererdebug + - React-utils + - ReactCommon/turbomodule/bridging + - ReactCommon/turbomodule/core + - Yoga + - RNReanimated/worklets (3.16.5): - DoubleConversion - glog - hermes-engine @@ -2030,7 +2096,7 @@ SPEC CHECKSUMS: RNInAppBrowser: e36d6935517101ccba0e875bac8ad7b0cb655364 RNKeychain: ff836453cba46938e0e9e4c22e43d43fa2c90333 RNQuickAction: 6d404a869dc872cde841ad3147416a670d13fa93 - RNReanimated: d093daf3973a7ee9f77c10a9337e10390b2969e2 + RNReanimated: 73acffa7201bc9caee34b6f26878342cc9d8ab47 RNShare: 0fad69ae2d71de9d1f7b9a43acf876886a6cb99c RNSVG: 43b64ed39c14ce830d840903774154ca0c1f27ec SocketRocket: abac6f5de4d4d62d24e11868d7a2f427e0ef940d diff --git a/apps/native/app/src/screens/passkey/passkey.tsx b/apps/native/app/src/screens/passkey/passkey.tsx index a6ba79951324..ead1271ebc47 100644 --- a/apps/native/app/src/screens/passkey/passkey.tsx +++ b/apps/native/app/src/screens/passkey/passkey.tsx @@ -150,7 +150,10 @@ export const PasskeyScreen: NavigationFunctionComponent<{ - openBrowser('https://island.is/adgangslyklar', componentId) + openBrowser( + 'https://island.is/innskraning-umbod-og-adgangsstyring-a-island-is#innskraning-med-adgangslykli-i-island-is-appinu', + componentId, + ) } > From 2523e39cb434d95322738b4fe2078b2552cbee98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=BAnar=20Vestmann?= <43557895+RunarVestmann@users.noreply.github.com> Date: Fri, 13 Dec 2024 00:29:39 +0000 Subject: [PATCH 11/14] =?UTF-8?q?feat(web):=20Service=20web=20contact=20fo?= =?UTF-8?q?rm=20-=20Add=20custom=20fields=20for=20'Vinnueftirliti=C3=B0'?= =?UTF-8?q?=20(#17202)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> --- .../Forms/StandardForm/StandardForm.tsx | 172 +++++++++++++++++- .../ServiceWeb/Forms/StandardForm/types.ts | 2 + apps/web/screens/ServiceWeb/Forms/utils.ts | 15 ++ 3 files changed, 187 insertions(+), 2 deletions(-) diff --git a/apps/web/components/ServiceWeb/Forms/StandardForm/StandardForm.tsx b/apps/web/components/ServiceWeb/Forms/StandardForm/StandardForm.tsx index 3f469edd3828..3054bbc88e70 100644 --- a/apps/web/components/ServiceWeb/Forms/StandardForm/StandardForm.tsx +++ b/apps/web/components/ServiceWeb/Forms/StandardForm/StandardForm.tsx @@ -26,7 +26,10 @@ import { Stack, Text, } from '@island.is/island-ui/core' -import { InputController } from '@island.is/shared/form-fields' +import { + CheckboxController, + InputController, +} from '@island.is/shared/form-fields' import { sortAlpha } from '@island.is/shared/utils' import { ContentLanguage, @@ -42,6 +45,7 @@ import { GET_SUPPORT_SEARCH_RESULTS_QUERY } from '@island.is/web/screens/queries import { FiskistofaCategories, SjukratryggingarCategories, + VinnueftirlitidCategories, } from '@island.is/web/screens/ServiceWeb/Forms/utils' import { getServiceWebSearchTagQuery } from '@island.is/web/screens/ServiceWeb/utils' @@ -93,6 +97,14 @@ const labels: Record = { malsnumer_ef_til_stadar: 'Málsnúmer (ef til staðar)', faedingardagur_eda_kennitala_malsadila: 'Fæðingardagur/Kennitala málsaðila', skipaskrarnumer: 'Skipaskrárnúmer', + vinnuvelanumer_kaupanda: 'Vinnuvélanúmer kaupanda', + vinnuvelanumer_seljanda: 'Vinnuvélanúmer seljanda', + vinnuvelanumer_vegna_skodunar: 'Vinnuvélanúmer vegna skoðunar', + stadsetning_taekis: 'Staðsetning tækis', + stadsetning_verkstadar: 'Staðsetning verkstaðar', + nafn_fyrirtaekis: 'Nafn fyrirtækis', + starfsstod: 'Starfsstöð', + oska_eftir_vernd_uppljostrara: 'Óska eftir vernd uppljóstrara', } // these should be skipped in the message itself @@ -154,6 +166,35 @@ const BasicInput = ({ ) } +interface BasicCheckboxProps { + name: keyof typeof labels + label: string +} + +const BasicCheckbox = ({ name, label }: BasicCheckboxProps) => { + const { + formState: { errors }, + register, + } = useFormContext() + + return ( + + ) +} + const MIN_SEARCH_QUERY_LENGTH = 1 export const StandardForm = ({ @@ -482,6 +523,129 @@ export const StandardForm = ({ ) break + case VinnueftirlitidCategories.NAMSKEID: + case VinnueftirlitidCategories.VINNUSLYS: + case VinnueftirlitidCategories.VINNUVELARETTINDI: + case VinnueftirlitidCategories.VINNUVERND: + case VinnueftirlitidCategories.MARKADSEFTIRLIT: + case VinnueftirlitidCategories.EKKO_OG_SAMSKIPTI: + case VinnueftirlitidCategories.LOG_OG_REGLUGERDIR: + case VinnueftirlitidCategories.LEYFI_OG_UMSAGNIR: + case VinnueftirlitidCategories.ONNUR_THJONUSTA: + fields = ( + + + + ) + break + case VinnueftirlitidCategories.SKRANING_OG_SKODUN_VINNUVELA: + fields = ( + <> + + + + + + + + + + + + + + + + + ) + break + case VinnueftirlitidCategories.MANNVIRKJAGERD: + fields = ( + <> + + + + + + + + ) + break + case VinnueftirlitidCategories.VINNUADSTADA: + fields = ( + <> + + + + + + + + ) + break default: break } @@ -571,7 +735,11 @@ export const StandardForm = ({ const label = labels[k] const value = values[k] - if (label && value) { + if ( + label && + ((Array.isArray(value) && value.length > 0) || + (!Array.isArray(value) && Boolean(value))) + ) { message += `${label}:\n${value}\n\n` } diff --git a/apps/web/components/ServiceWeb/Forms/StandardForm/types.ts b/apps/web/components/ServiceWeb/Forms/StandardForm/types.ts index 26ca5c2e89a1..0934e1dc2baf 100644 --- a/apps/web/components/ServiceWeb/Forms/StandardForm/types.ts +++ b/apps/web/components/ServiceWeb/Forms/StandardForm/types.ts @@ -1,12 +1,14 @@ import type { FiskistofaCategories, SjukratryggingarCategories, + VinnueftirlitidCategories, } from '@island.is/web/screens/ServiceWeb/Forms/utils' export type CategoryId = | SyslumennCategories | SjukratryggingarCategories | FiskistofaCategories + | VinnueftirlitidCategories export enum SyslumennCategories { FJOLSKYLDUMAL = '4vQ4htPOAZvzcXBcjx06SH', diff --git a/apps/web/screens/ServiceWeb/Forms/utils.ts b/apps/web/screens/ServiceWeb/Forms/utils.ts index e84d8a93ed75..4a0b84c7c836 100644 --- a/apps/web/screens/ServiceWeb/Forms/utils.ts +++ b/apps/web/screens/ServiceWeb/Forms/utils.ts @@ -97,6 +97,21 @@ export enum FiskistofaCategories { VEIDIHEIMILDIR = '1agbWJCHTDVfVR4yQZPaEK', } +export enum VinnueftirlitidCategories { + NAMSKEID = '41SeTRazu0qKIixRhWpDLA', + SKRANING_OG_SKODUN_VINNUVELA = '1ulMblBQwDkfSNgh2NyKpw', + VINNUSLYS = '3VY4skpcXo7XyniStyxrVc', + VINNUVELARETTINDI = '1AkjZQc1CO6hMPXYaLSqTw', + VINNUVERND = '4Wmxb25h9R7L0kuYsz19jG', + MARKADSEFTIRLIT = '61OI7gY23wC80mRRA4yrbA', + MANNVIRKJAGERD = '7fLoJqpyojUHgdDofIpqlU', + EKKO_OG_SAMSKIPTI = '3SAlg8Xt7AKBQFrGUCTkG1', + VINNUADSTADA = '7FPsjPxRHA2aIOUXY3Xr3V', + LOG_OG_REGLUGERDIR = '7vb5yId3HMigcXEDMYN9uN', + LEYFI_OG_UMSAGNIR = '7nLIjBeO5EovoPYwINWoyv', + ONNUR_THJONUSTA = 'fdkCIdREoNlYmgkr37DTl', +} + export const filterSupportCategories = ( supportCategories: SupportCategory[] | undefined, slug: string, From c4977d1f3acb9289177800da42c99b9bac3a5d78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gunnlaugur=20Gu=C3=B0mundsson?= <34029342+GunnlaugurG@users.noreply.github.com> Date: Fri, 13 Dec 2024 08:59:52 +0000 Subject: [PATCH 12/14] feat(user-notification): Change action button text (#17194) Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> --- .../src/assets/images/en-button-open.png | Bin 3396 -> 4123 bytes .../src/assets/images/is-button-open.png | Bin 3690 -> 4493 bytes 2 files changed, 0 insertions(+), 0 deletions(-) diff --git a/apps/services/user-notification/src/assets/images/en-button-open.png b/apps/services/user-notification/src/assets/images/en-button-open.png index ab0144dc9ec9bdbc9db4597ffb0d2ba0e99efaee..b5ce25afbdbcbac88cf42c25b859aef33f2de2ca 100644 GIT binary patch literal 4123 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 xxs1oy3 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 Bkg@;( diff --git a/apps/services/user-notification/src/assets/images/is-button-open.png b/apps/services/user-notification/src/assets/images/is-button-open.png index 5d2a07e9db641a2781aabfb954ba30de9f9a1917..0d800da8faf6555a5c8ffe0e96699c112ff92ae9 100644 GIT binary patch literal 4493 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 JsAtwe{{vPZ!jb?0 literal 3690 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 Date: Fri, 13 Dec 2024 09:23:18 +0000 Subject: [PATCH 13/14] feat(ids-api): Enable getting fake users in v3 client. Configure for ids-api envs. (#17201) * Enable getting fake users in v3 client. Configure for ids-api envs. * Remove configmodule import. * Declare property in constructor, use optional chaining. * Fix optional decorator. * Move declaration. --------- Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> --- apps/services/auth/ids-api/infra/ids-api.ts | 5 +++ .../auth/ids-api/src/app/app.module.ts | 2 +- .../app/user-profile/user-profile.service.ts | 12 +++++-- charts/identity-server/values.dev.yaml | 1 + charts/identity-server/values.prod.yaml | 1 + charts/identity-server/values.staging.yaml | 1 + .../services-auth-ids-api/values.dev.yaml | 1 + .../services-auth-ids-api/values.prod.yaml | 1 + .../services-auth-ids-api/values.staging.yaml | 1 + .../lib/delegations/alive-status.service.ts | 18 ++++++++-- .../v3/src/lib/nationalRegistryV3.service.ts | 35 +++++++++++++------ 11 files changed, 62 insertions(+), 16 deletions(-) diff --git a/apps/services/auth/ids-api/infra/ids-api.ts b/apps/services/auth/ids-api/infra/ids-api.ts index 1afda547b717..b4f06d72ee64 100644 --- a/apps/services/auth/ids-api/infra/ids-api.ts +++ b/apps/services/auth/ids-api/infra/ids-api.ts @@ -100,6 +100,11 @@ export const serviceSetup = (): ServiceBuilder<'services-auth-ids-api'> => { staging: 'digitaliceland', dev: 'digitaliceland', }, + ALSO_USE_FAKE_USER_API: { + dev: 'true', + staging: 'false', + prod: 'false', + }, }) .secrets({ ZENDESK_CONTACT_FORM_EMAIL: '/k8s/api/ZENDESK_CONTACT_FORM_EMAIL', diff --git a/apps/services/auth/ids-api/src/app/app.module.ts b/apps/services/auth/ids-api/src/app/app.module.ts index b1cfb1b1506c..16198e21f08d 100644 --- a/apps/services/auth/ids-api/src/app/app.module.ts +++ b/apps/services/auth/ids-api/src/app/app.module.ts @@ -13,6 +13,7 @@ import { NationalRegistryV3ClientConfig } from '@island.is/clients/national-regi import { CompanyRegistryConfig } from '@island.is/clients/rsk/company-registry' import { SyslumennClientConfig } from '@island.is/clients/syslumenn' import { UserProfileClientConfig } from '@island.is/clients/user-profile' +import { ZendeskServiceConfig } from '@island.is/clients/zendesk' import { AuditModule } from '@island.is/nest/audit' import { ConfigModule, @@ -35,7 +36,6 @@ import { ResourcesModule } from './resources/resources.module' import { TranslationModule } from './translation/translation.module' import { UserProfileModule } from './user-profile/user-profile.module' import { UsersModule } from './users/users.module' -import { ZendeskServiceConfig } from '@island.is/clients/zendesk' @Module({ imports: [ diff --git a/apps/services/auth/ids-api/src/app/user-profile/user-profile.service.ts b/apps/services/auth/ids-api/src/app/user-profile/user-profile.service.ts index 626b782bb437..9479bd021332 100644 --- a/apps/services/auth/ids-api/src/app/user-profile/user-profile.service.ts +++ b/apps/services/auth/ids-api/src/app/user-profile/user-profile.service.ts @@ -1,4 +1,5 @@ -import { Inject, Injectable } from '@nestjs/common' +import { Inject, Injectable, Optional } from '@nestjs/common' +import { ConfigService } from '@nestjs/config' import { AuthMiddleware } from '@island.is/auth-nest-tools' import { FetchError } from '@island.is/clients/middlewares' @@ -30,6 +31,7 @@ type CountryFormatter = { of: (countryCode: string) => string } @Injectable() export class UserProfileService { + alsoUseFakeApi: boolean // REMOVE these ignores after upgrading to TypeScript 4.5 // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore @@ -45,7 +47,12 @@ export class UserProfileService { private companyRegistryApi: CompanyRegistryClientService, @Inject(LOGGER_PROVIDER) private logger: Logger, - ) {} + @Optional() + readonly configService?: ConfigService, + ) { + this.alsoUseFakeApi = + configService?.get('ALSO_USE_FAKE_USER_API') ?? false + } userProfileApiWithAuth(auth: Auth) { return this.userProfileApi.withMiddleware(new AuthMiddleware(auth)) @@ -123,6 +130,7 @@ export class UserProfileService { const individual = await this.nationalRegistryV3.getAllDataIndividual( auth.nationalId, false, + this.alsoUseFakeApi, ) if (!individual) { diff --git a/charts/identity-server/values.dev.yaml b/charts/identity-server/values.dev.yaml index a5d5ce51e239..47834b587715 100644 --- a/charts/identity-server/values.dev.yaml +++ b/charts/identity-server/values.dev.yaml @@ -414,6 +414,7 @@ services-auth-delegation-api: services-auth-ids-api: enabled: true env: + ALSO_USE_FAKE_USER_API: 'true' CODE_OWNER: 'aranja' COMPANY_REGISTRY_REDIS_NODES: '["clustercfg.general-redis-cluster-group.5fzau3.euw1.cache.amazonaws.com:6379"]' COMPANY_REGISTRY_XROAD_PROVIDER_ID: 'IS-DEV/GOV/10006/Skatturinn/ft-v1' diff --git a/charts/identity-server/values.prod.yaml b/charts/identity-server/values.prod.yaml index 2f51a29e6326..a350ead4e04b 100644 --- a/charts/identity-server/values.prod.yaml +++ b/charts/identity-server/values.prod.yaml @@ -411,6 +411,7 @@ services-auth-delegation-api: services-auth-ids-api: enabled: true env: + ALSO_USE_FAKE_USER_API: 'false' CODE_OWNER: 'aranja' COMPANY_REGISTRY_REDIS_NODES: '["clustercfg.general-redis-cluster-group.dnugi2.euw1.cache.amazonaws.com:6379"]' COMPANY_REGISTRY_XROAD_PROVIDER_ID: 'IS/GOV/5402696029/Skatturinn/ft-v1' diff --git a/charts/identity-server/values.staging.yaml b/charts/identity-server/values.staging.yaml index 00cbc00e4a90..b02c94cd26d5 100644 --- a/charts/identity-server/values.staging.yaml +++ b/charts/identity-server/values.staging.yaml @@ -414,6 +414,7 @@ services-auth-delegation-api: services-auth-ids-api: enabled: true env: + ALSO_USE_FAKE_USER_API: 'false' CODE_OWNER: 'aranja' COMPANY_REGISTRY_REDIS_NODES: '["clustercfg.general-redis-cluster-group.ab9ckb.euw1.cache.amazonaws.com:6379"]' COMPANY_REGISTRY_XROAD_PROVIDER_ID: 'IS-TEST/GOV/5402696029/Skatturinn/ft-v1' diff --git a/charts/services/services-auth-ids-api/values.dev.yaml b/charts/services/services-auth-ids-api/values.dev.yaml index e1461ecdd4a9..12367bce8312 100644 --- a/charts/services/services-auth-ids-api/values.dev.yaml +++ b/charts/services/services-auth-ids-api/values.dev.yaml @@ -19,6 +19,7 @@ global: name: 'services-auth-ids-api' enabled: true env: + ALSO_USE_FAKE_USER_API: 'true' CODE_OWNER: 'aranja' COMPANY_REGISTRY_REDIS_NODES: '["clustercfg.general-redis-cluster-group.5fzau3.euw1.cache.amazonaws.com:6379"]' COMPANY_REGISTRY_XROAD_PROVIDER_ID: 'IS-DEV/GOV/10006/Skatturinn/ft-v1' diff --git a/charts/services/services-auth-ids-api/values.prod.yaml b/charts/services/services-auth-ids-api/values.prod.yaml index 48b414b22bb9..8f72bda2431f 100644 --- a/charts/services/services-auth-ids-api/values.prod.yaml +++ b/charts/services/services-auth-ids-api/values.prod.yaml @@ -19,6 +19,7 @@ global: name: 'services-auth-ids-api' enabled: true env: + ALSO_USE_FAKE_USER_API: 'false' CODE_OWNER: 'aranja' COMPANY_REGISTRY_REDIS_NODES: '["clustercfg.general-redis-cluster-group.dnugi2.euw1.cache.amazonaws.com:6379"]' COMPANY_REGISTRY_XROAD_PROVIDER_ID: 'IS/GOV/5402696029/Skatturinn/ft-v1' diff --git a/charts/services/services-auth-ids-api/values.staging.yaml b/charts/services/services-auth-ids-api/values.staging.yaml index 5b620fa22960..1e1e45950161 100644 --- a/charts/services/services-auth-ids-api/values.staging.yaml +++ b/charts/services/services-auth-ids-api/values.staging.yaml @@ -19,6 +19,7 @@ global: name: 'services-auth-ids-api' enabled: true env: + ALSO_USE_FAKE_USER_API: 'false' CODE_OWNER: 'aranja' COMPANY_REGISTRY_REDIS_NODES: '["clustercfg.general-redis-cluster-group.ab9ckb.euw1.cache.amazonaws.com:6379"]' COMPANY_REGISTRY_XROAD_PROVIDER_ID: 'IS-TEST/GOV/5402696029/Skatturinn/ft-v1' diff --git a/libs/auth-api-lib/src/lib/delegations/alive-status.service.ts b/libs/auth-api-lib/src/lib/delegations/alive-status.service.ts index e1e4aeceb170..c960148f83a9 100644 --- a/libs/auth-api-lib/src/lib/delegations/alive-status.service.ts +++ b/libs/auth-api-lib/src/lib/delegations/alive-status.service.ts @@ -1,4 +1,5 @@ -import { Inject, Injectable, Logger } from '@nestjs/common' +import { Inject, Injectable, Logger, Optional } from '@nestjs/common' +import { ConfigService } from '@nestjs/config' import * as kennitala from 'kennitala' import { NationalRegistryClientService } from '@island.is/clients/national-registry-v2' @@ -20,13 +21,20 @@ const decesead = 'LÉST' @Injectable() export class AliveStatusService { + alsoUseFakeApi: boolean + constructor( private readonly nationalRegistryClient: NationalRegistryClientService, private readonly nationalRegistryV3Client: NationalRegistryV3ClientService, private readonly companyRegistryClient: CompanyRegistryClientService, @Inject(LOGGER_PROVIDER) private logger: Logger, - ) {} + @Optional() + readonly configService?: ConfigService, + ) { + this.alsoUseFakeApi = + configService?.get('ALSO_USE_FAKE_USER_API') ?? false + } /** * Divides nationalIds into alive and deceased @@ -134,7 +142,11 @@ export class AliveStatusService { ): Promise { if (useNationalRegistryV3) { return await this.nationalRegistryV3Client - .getAllDataIndividual(individualInfo.nationalId) + .getAllDataIndividual( + individualInfo.nationalId, + false, + this.alsoUseFakeApi, + ) .then((individual) => { if ( individual && diff --git a/libs/clients/national-registry/v3/src/lib/nationalRegistryV3.service.ts b/libs/clients/national-registry/v3/src/lib/nationalRegistryV3.service.ts index 1f8e09ec369e..fec86cce0731 100644 --- a/libs/clients/national-registry/v3/src/lib/nationalRegistryV3.service.ts +++ b/libs/clients/national-registry/v3/src/lib/nationalRegistryV3.service.ts @@ -34,19 +34,34 @@ export class NationalRegistryV3ClientService { ) } - getAllDataIndividual( + async getAllDataIndividual( nationalId: string, - useFakeApi?: boolean, + useFakeApiOnly?: boolean, + alsoTryFakeApiWhenNotFound?: boolean, ): Promise { - return useFakeApi - ? this.fakeApi.midlunV1GerviEinstaklingarNationalIdGet({ + if (useFakeApiOnly) { + return handle204( + this.fakeApi.midlunV1GerviEinstaklingarNationalIdGetRaw({ nationalId, - }) - : handle204( - this.individualApi.midlunV1EinstaklingarNationalIdGetRaw({ - nationalId, - }), - ) + }), + ) + } + + const result = await handle204( + this.individualApi.midlunV1EinstaklingarNationalIdGetRaw({ + nationalId, + }), + ) + + if (!result && alsoTryFakeApiWhenNotFound) { + return handle204( + this.fakeApi.midlunV1GerviEinstaklingarNationalIdGetRaw({ + nationalId, + }), + ) + } + + return result } getBiologicalFamily( From 5a13f96b72351a9a62df896561eaff3052d7cb38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=BAnar=20Vestmann?= <43557895+RunarVestmann@users.noreply.github.com> Date: Fri, 13 Dec 2024 11:57:40 +0000 Subject: [PATCH 14/14] fix(web): Sort by title for generic list and team list (#17226) * Add title.sort again * No need to have _score type --- libs/cms/src/lib/cms.elasticsearch.service.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libs/cms/src/lib/cms.elasticsearch.service.ts b/libs/cms/src/lib/cms.elasticsearch.service.ts index 0a20025d9ed0..2d1945a91db4 100644 --- a/libs/cms/src/lib/cms.elasticsearch.service.ts +++ b/libs/cms/src/lib/cms.elasticsearch.service.ts @@ -525,12 +525,14 @@ export class CmsElasticsearchService { const size = input.size ?? 10 - const sort: ('_score' | sortRule)[] = [ + const sort: sortRule[] = [ { [SortField.RELEASE_DATE]: { order: SortDirection.DESC, }, }, + // Sort items with equal values by ascending title order + { 'title.sort': { order: SortDirection.ASC } }, ] if (input.tags && input.tags.length > 0 && input.tagGroups) {