Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(financial-aid): refactor custom components out #15549

Merged
merged 34 commits into from
Oct 17, 2024

Conversation

jonnigs
Copy link
Member

@jonnigs jonnigs commented Jul 26, 2024

What

  • Refactor out custom components
  • Reorganize code in forms folder into one file per screen
  • Reorganize remaining custom components in the fields folder
  • Move svg files into the new folder assets
  • Make folder components with tsx components that are used by the custom components
  • New form components: buildAccordionField and BuildBankAccountField
  • Option to have a dynamic logo on applications

Why

  • Minimize the use of custom components, making applications more uniform and maintainable
  • Organize code to be more similar to other applications
  • Add new shared components so other applications can use them

Checklist:

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • Formatting passes locally with my changes
  • I have rebased against main before asking for a review

Summary by CodeRabbit

  • New Features

    • Enhanced the spouse financial information section by simplifying data extraction and rendering logic.
    • Introduced new utility functions for structured data retrieval related to spouse and summary information.
    • Added a multi-field component for a confirmation section in the financial aid application.
    • Introduced a section for managing spouse tax return file uploads.
    • Added new types and field builder functions for accordion and bank account fields.
  • Bug Fixes

    • Updated the MissingFilesConfirmation component to improve prop handling and output clarity.
  • Refactor

    • Refactored multiple components for improved structure and readability, including the SummaryForm and SpouseSummaryForm.
    • Streamlined export statements to enhance component usability.

This comment was marked as spam.

@datadog-island-is
Copy link

datadog-island-is bot commented Jul 26, 2024

Datadog Report

All test runs c92a267 🔗

27 Total Test Services: 0 Failed, 25 Passed
🔻 Test Sessions change in coverage: 5 decreased, 12 increased, 93 no change

Test Services
This report shows up to 10 services
Service Name Failed Known Flaky New Flaky Passed Skipped Total Time Code Coverage Change Test Service View
air-discount-scheme-web 0 0 0 2 0 9.39s 1 no change Link
api 0 0 0 4 0 3.31s 1 no change Link
application-api-files 0 0 0 12 0 7.22s 1 increased (+0.11%) Link
application-core 0 0 0 92 0 22.69s 1 no change Link
application-system-api 0 0 0 131 2 3m 11.8s 1 no change Link
application-template-api-modules 0 0 0 123 0 2m 40.57s 1 no change Link
application-templates-accident-notification 0 0 0 148 0 19.99s 1 decreased (-0.01%) Link
application-templates-criminal-record 0 0 0 2 0 12.17s 1 no change Link
application-templates-driving-license 0 0 0 13 0 17.05s 1 increased (+0.05%) Link
application-templates-example-payment 0 0 0 2 0 13.5s 1 increased (+0.01%) Link

🔻 Code Coverage Decreases vs Default Branch (5)

  • financial-aid-shared - jest 16.56% (-0.1%) - Details
  • application-types - jest 5.48% (-0.06%) - Details
  • financial-aid-backend - jest 59.72% (-0.04%) - Details
  • application-templates-accident-notification - jest 34.91% (-0.01%) - Details
  • application-ui-shell - jest 28% (-0.01%) - Details

Copy link

codecov bot commented Jul 26, 2024

Codecov Report

Attention: Patch coverage is 8.96057% with 508 lines in your changes missing coverage. Please review.

Project coverage is 36.52%. Comparing base (61171c2) to head (0ca4f15).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
...s/templates/financial-aid/financial-aid.service.ts 2.17% 45 Missing ⚠️
...plication/templates/financial-aid/src/lib/utils.ts 19.14% 38 Missing ⚠️
...emplates/financial-aid/src/fields/Summary/utils.ts 0.00% 34 Missing ⚠️
...tion/templates/financial-aid/src/lib/dataSchema.ts 39.02% 25 Missing ⚠️
...s/financial-aid/src/fields/Summary/SummaryForm.tsx 0.00% 20 Missing ⚠️
...Form/confirmationSection/confirmationMultiField.ts 0.00% 19 Missing ⚠️
...ates/financial-aid/src/lib/FinancialAidTemplate.ts 0.00% 19 Missing ⚠️
...ncial-aid/src/fields/ChildrenForm/ChildrenForm.tsx 0.00% 17 Missing ⚠️
.../src/lib/AccordionFormField/AccordionFormField.tsx 5.88% 16 Missing ⚠️
...c/components/Status/Estimation/VeitaEstimation.tsx 0.00% 14 Missing ⚠️
... and 64 more
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #15549      +/-   ##
==========================================
- Coverage   36.73%   36.52%   -0.21%     
==========================================
  Files        6810     6821      +11     
  Lines      141284   142437    +1153     
  Branches    40272    41332    +1060     
==========================================
+ Hits        51896    52027     +131     
- Misses      89388    90410    +1022     
Flag Coverage Δ
air-discount-scheme-backend 54.06% <ø> (ø)
air-discount-scheme-web 0.00% <ø> (ø)
api 3.37% <ø> (ø)
api-catalogue-services 77.85% <ø> (ø)
api-domains-air-discount-scheme 36.93% <ø> (ø)
api-domains-assets 26.71% <ø> (ø)
api-domains-auth-admin 48.48% <ø> (ø)
api-domains-communications 39.89% <ø> (ø)
api-domains-criminal-record 48.00% <ø> (ø)
api-domains-education 31.51% <ø> (ø)
api-domains-health-insurance 34.77% <ø> (ø)
api-domains-mortgage-certificate 34.95% <ø> (ø)
api-domains-payment-schedule 41.16% <ø> (ø)
application-api-files 56.81% <100.00%> (+0.10%) ⬆️
application-core 71.64% <50.00%> (+0.11%) ⬆️
application-system-api 41.37% <21.38%> (+<0.01%) ⬆️
application-template-api-modules 27.85% <10.34%> (-0.01%) ⬇️
application-templates-accident-notification 29.27% <25.00%> (-0.03%) ⬇️
application-templates-car-recycling 3.12% <ø> (ø)
application-templates-criminal-record 26.34% <25.00%> (-0.02%) ⬇️
application-templates-driving-license 18.32% <25.00%> (+0.03%) ⬆️
application-templates-estate 12.32% <25.00%> (+0.01%) ⬆️
application-templates-example-payment 25.14% <25.00%> (-0.01%) ⬇️
application-templates-financial-aid 15.50% <5.89%> (+1.22%) ⬆️
application-templates-general-petition 23.44% <25.00%> (+0.01%) ⬆️
application-templates-inheritance-report 6.49% <25.00%> (+0.05%) ⬆️
application-templates-marriage-conditions 15.17% <25.00%> (+0.08%) ⬆️
application-templates-mortgage-certificate 43.82% <50.00%> (+0.03%) ⬆️
application-templates-parental-leave 29.96% <25.00%> (-0.01%) ⬇️
application-types 6.63% <0.00%> (-0.07%) ⬇️
application-ui-components 1.28% <ø> (ø)
application-ui-shell 21.37% <25.49%> (+0.01%) ⬆️
auth-admin-web 2.43% <ø> (ø)
auth-nest-tools 29.84% <ø> (ø)
auth-react 22.77% <ø> (ø)
auth-shared 75.00% <ø> (ø)
clients-charge-fjs-v2 24.11% <ø> (ø)
clients-driving-license 40.67% <ø> (ø)
clients-driving-license-book 43.80% <ø> (ø)
clients-financial-statements-inao 49.32% <ø> (ø)
clients-license-client 1.83% <ø> (ø)
clients-middlewares 73.05% <ø> (-0.09%) ⬇️
clients-regulations 42.80% <ø> (ø)
clients-rsk-company-registry 29.76% <ø> (ø)
clients-rsk-personal-tax-return 38.00% <ø> (ø)
clients-smartsolutions 12.77% <ø> (ø)
clients-syslumenn 49.44% <ø> (ø)
clients-zendesk 54.61% <ø> (ø)
cms 0.42% <ø> (ø)
cms-translations 39.02% <ø> (ø)
content-search-index-manager 95.65% <ø> (ø)
content-search-toolkit 8.16% <ø> (ø)
contentful-apps 5.44% <ø> (ø)
dokobit-signing 63.38% <ø> (ø)
download-service 44.19% <ø> (ø)
email-service 61.13% <ø> (ø)
feature-flags 91.11% <ø> (ø)
file-storage 53.71% <ø> (ø)
financial-aid-backend 56.37% <0.00%> (-0.04%) ⬇️
financial-aid-shared 18.94% <0.00%> (-0.09%) ⬇️
icelandic-names-registry-backend 53.97% <ø> (ø)
infra-nest-server 48.17% <ø> (ø)
infra-tracing 43.24% <ø> (ø)
island-ui-core 28.39% <ø> (ø)
judicial-system-api 18.36% <ø> (ø)
judicial-system-audit-trail 69.35% <ø> (ø)
judicial-system-backend 55.15% <ø> (ø)
judicial-system-formatters 79.25% <ø> (ø)
judicial-system-message 67.24% <ø> (ø)
judicial-system-message-handler 48.35% <ø> (ø)
judicial-system-scheduler 69.54% <ø> (ø)
judicial-system-types 47.12% <ø> (ø)
judicial-system-web 27.91% <ø> (ø)
license-api 42.73% <ø> (+0.07%) ⬆️
localization 10.15% <ø> (ø)
logging 48.43% <ø> (ø)
message-queue 68.58% <ø> (+0.78%) ⬆️
nest-audit 68.20% <ø> (ø)
nest-aws 60.29% <ø> (ø)
nest-config 78.44% <ø> (ø)
nest-feature-flags 50.89% <ø> (-0.64%) ⬇️
nest-problem 45.85% <ø> (ø)
nest-sequelize 94.44% <ø> (ø)
nest-swagger 51.71% <ø> (ø)
nova-sms 62.74% <ø> (ø)
portals-admin-regulations-admin 1.85% <ø> (ø)
portals-core 16.15% <ø> (ø)
reference-backend 49.79% <ø> (ø)
regulations 16.78% <ø> (ø)
residence-history 85.00% <ø> (ø)
services-auth-admin-api 51.89% <ø> (ø)
services-auth-delegation-api 57.38% <ø> (ø)
services-auth-ids-api 51.42% <ø> (-0.01%) ⬇️
services-auth-personal-representative 45.15% <0.00%> (+0.01%) ⬆️
services-auth-personal-representative-public 41.28% <ø> (+<0.01%) ⬆️
services-auth-public-api 48.91% <ø> (ø)
services-documents 60.58% <ø> (ø)
services-endorsements-api 53.63% <ø> (ø)
services-search-indexer ?
services-sessions 65.37% <ø> (+0.04%) ⬆️
services-university-gateway 48.31% <ø> (+0.02%) ⬆️
services-user-notification 47.01% <ø> (+0.03%) ⬆️
services-user-profile 62.18% <ø> (ø)
shared-components 27.65% <ø> (ø)
shared-form-fields 31.59% <ø> (ø)
shared-mocking 64.62% <ø> (ø)
shared-pii 92.85% <ø> (ø)
shared-problem 87.50% <ø> (ø)
shared-utils 27.90% <ø> (ø)
skilavottord-ws 24.24% <ø> (ø)
testing-e2e 66.66% <ø> (ø)
web 1.82% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
libs/application/core/src/lib/messages.ts 100.00% <ø> (ø)
...tes/financial-aid/src/assets/ConfirmationImage.tsx 0.00% <ø> (ø)
...nancial-aid/src/components/Breakdown/Breakdown.tsx 0.00% <ø> (ø)
...src/components/DescriptionText/DescriptionText.tsx 0.00% <ø> (ø)
...s/DirectTaxPaymentsModal/DirectTaxPaymentModal.tsx 0.00% <ø> (ø)
...-aid/src/components/Status/AidAmount/AidAmount.tsx 0.00% <ø> (ø)
.../components/Status/ApprovedAlert/ApprovedAlert.tsx 0.00% <ø> (ø)
...ancial-aid/src/components/Status/Header/Header.tsx 0.00% <ø> (ø)
...nents/Status/MissingFilesCard/MissingFilesCard.tsx 0.00% <ø> (ø)
.../src/components/Status/MoreActions/MoreActions.tsx 0.00% <ø> (ø)
... and 103 more

... and 91 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 06c7054...0ca4f15. Read the comment docs.

@jonnigs jonnigs marked this pull request as ready for review July 29, 2024 09:39
@jonnigs jonnigs requested review from a team as code owners July 29, 2024 09:39
@jonnigs jonnigs changed the title chore: refactor custom components out chore(financial-aid): refactor custom components out Jul 30, 2024
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 19

Outside diff range, codebase verification and nitpick comments (8)
libs/application/templates/financial-aid/src/forms/ApplicationForm/index.ts (1)

12-27: Well-structured form definition.

The form is defined using the buildForm function, which is a good practice for modularity and maintainability. The inclusion of various sections like personal interest, finances, and contact info ensures that the form is comprehensive.

However, ensure that the dynamic creation of the logo component in line 16-18 does not lead to performance issues or unnecessary re-renders. Consider memoizing the logo component if it does not depend on frequently changing props.

libs/application/templates/financial-aid/src/forms/SpouseForm/spouseIncomeFilesSection.ts (1)

24-29: Suggestion: Add a title to the file upload field.

The file upload field currently has an empty title. Providing a descriptive title can improve the user interface and make the form more accessible.

-          title: '',
+          title: 'Upload Income Proof',
libs/application/templates/financial-aid/src/forms/ApplicationForm/personalInterstSection/inARelationshipSubSection.ts (1)

11-49: Well-structured form subsection, but consider adding error handling.

The inARelationshipSubSection function is well-constructed with a clear and logical setup for form fields. The use of imported components and messages enhances maintainability and readability.

However, consider adding error handling for the externalData in the condition function to ensure robustness, especially in cases where externalData might be incomplete or incorrectly formatted.

libs/application/templates/financial-aid/src/forms/PrerequisitesForm/externalDataSection.ts (1)

16-66: Well-structured external data section.

The externalDataSection is well-defined with appropriate use of data providers and localized messages. The structure adheres to the application's architectural standards.

However, ensure that the multiple external data calls are optimized to avoid performance bottlenecks.

libs/application/templates/financial-aid/src/fields/ChildrenForm/ChildrenForm.tsx (1)

Line range hint 12-94: Consider removing unnecessary logging.

The ChildrenForm component is well-structured and uses modern React practices effectively. However, consider removing the console.log(childrenExternalData) statement at line 22 unless it is necessary for debugging purposes.

libs/application/templates/financial-aid/src/fields/Summary/SummaryForm.tsx (2)

Line range hint 95-175: Approve logic changes and suggest adding tests.

The updates to the logic for accessing properties from the answers object and the introduction of a fallback for answers.childrenFiles enhance the robustness of the component. These changes help prevent runtime errors and improve the maintainability of the code.

It is recommended to add unit tests to cover these new logic paths to ensure they work as expected under various conditions.

Would you like me to help in writing these unit tests or should I open a GitHub issue to track this task?


21-30: Inconsistent Component Renaming Detected

The component DirectTaxPaymentsModal has not been fully renamed to DirectTaxPaymentModal across the codebase. The following files still contain references to the old component name:

  • apps/financial-aid/web-osk/src/routes/application/SummaryForm/summaryForm.tsx
  • apps/financial-aid/web-osk/src/routes/application/SummaryForm/spouseSummary.tsx

Please review these files and update all references to ensure consistency with the new component name DirectTaxPaymentModal. This will help avoid potential errors and maintain code consistency.

Analysis chain

Verify import restructuring and component renaming.

The restructuring of imports and renaming of components like DirectTaxPaymentModal to DirectTaxPaymentModal should be verified for consistency across the project. This change can potentially improve tree-shaking and reduce bundle sizes, but it requires thorough testing to ensure that all references to these components have been updated accordingly.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify that all references to `DirectTaxPaymentsModal` have been updated to `DirectTaxPaymentModal`.

# Test: Search for the old component name. Expect: No occurrences.
rg --type tsx 'DirectTaxPaymentsModal'

Length of output: 66


Script:

#!/bin/bash
# Description: Verify that all references to `DirectTaxPaymentsModal` have been updated to `DirectTaxPaymentModal`.

# Corrected Test: Search for the old component name. Expect: No occurrences.
rg --glob '*.tsx' 'DirectTaxPaymentsModal'

# Additional Test: Search for the new component name to ensure it is used.
rg --glob '*.tsx' 'DirectTaxPaymentModal'

Length of output: 2282

libs/application/template-api-modules/src/lib/modules/templates/financial-aid/financial-aid.service.ts (1)

179-180: Incomplete Update: bankNumber and ledger References Persist

The update to replace bankNumber and ledger with accountNumber has not been consistently applied across the codebase. Multiple files still reference bankNumber and ledger, which could lead to inconsistencies and potential issues. Please conduct a thorough review to ensure all instances are updated to maintain data consistency.

  • Files with bankNumber and ledger references:
    • libs/financial-aid/shared/src/lib/interfaces.ts
    • libs/api/domains/municipalities-financial-aid/src/lib/models/application.model.ts
    • apps/financial-aid/web-veita/src/utils/applicationHelper.ts
    • apps/financial-aid/backend/src/app/modules/application/models/application.model.ts
    • And others as listed in the search results.
Analysis chain

Correction: Updated property references in bankInfo.

The update to reference accountNumber instead of bankNumber in bankInfo reflects a change in the data structure and ensures consistency in the usage of the accountNumber. Confirm that this change is reflected throughout the application to maintain data consistency.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all references to `bankNumber` and `ledger` are updated to `accountNumber`.

# Test: Search for the property usage. Expect: Only occurrences of `accountNumber`.
rg --type typescript -A 5 $'bankNumber|ledger'

Length of output: 82


Script:

#!/bin/bash
# Description: Verify all references to `bankNumber`, `ledger`, and `accountNumber` in TypeScript files.

# Search for occurrences of `bankNumber`, `ledger`, and `accountNumber` in TypeScript files.
rg --type ts -A 5 'bankNumber|ledger|accountNumber'

Length of output: 75258

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 965382d and 7c5b276.

Files ignored due to path filters (69)
  • libs/application/templates/financial-aid/src/assets/svg/akrahreppur.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/akranes.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/akureyri.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/arborg.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/arneshreppur.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/asahreppur.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/blaskogabyggd.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/blonduosbaer.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/bolungarvik.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/borgarbyggd.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/dalabyggd.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/dalvikurbyggd.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/eyja-og-miklaholtshreppur.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/eyjafjardarsveit.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/fjallabyggd.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/fjardabyggd.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/fljotsdalshreppur.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/floahreppur.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/gardabaer.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/grimsnes-og-grafningshreppur.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/grindavikurbaer.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/grundafjardarbaer.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/grytubakkahreppur.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/hafnarfjordur.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/helgafellssveit.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/horgarsveit.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/hornafjordur.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/hrunamannahreppur.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/hunathing-vestra.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/hunavatnshreppur.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/hvalfjardarsveit.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/hveragerdisbaer.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/isafjardarbaer.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/kaldrananeshreppur.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/kjosarhreppur.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/kopavogur.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/langanesbyggd.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/mosfellsbaer.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/mulathing.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/myrdalshreppur.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/nordurthing.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/olfus.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/rangarthing-ytra.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/rangarthing_eystra.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/reykholahreppur.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/reykjanesbaer.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/sambandid.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/seltjarnarnes.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/skaftarhreppur.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/skagabyggd.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/skagafjordur.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/skagastrond.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/skeida-og-gnupverjahreppur.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/skorradalur.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/skutustadahreppur.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/snaefellsbaer.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/strandabyggd.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/stykkisholmsbaer.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/sudavikurhreppur.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/sudurnesjabaer.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/svalbardshreppur.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/svalbardsstrandarhreppur.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/talknafjardarhreppur.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/thingeyjarsveit.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/tjorneshreppur.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/vestmannaeyjabaer.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/vesturbyggd.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/vogar.svg is excluded by !**/*.svg
  • libs/application/templates/financial-aid/src/assets/svg/vopnafjardarhreppur.svg is excluded by !**/*.svg
Files selected for processing (80)
  • apps/financial-aid/web-veita/src/components/AidAmountModal/AidAmountModal.tsx (1 hunks)
  • libs/application/core/src/lib/fieldBuilders.ts (2 hunks)
  • libs/application/core/src/lib/messages.ts (1 hunks)
  • libs/application/core/src/validation/validators.ts (1 hunks)
  • libs/application/template-api-modules/src/lib/modules/templates/financial-aid/financial-aid.service.ts (2 hunks)
  • libs/application/templates/accident-notification/src/lib/AccidentNotificationTemplate.ts (1 hunks)
  • libs/application/templates/accident-notification/src/lib/dataSchema.ts (1 hunks)
  • libs/application/templates/financial-aid/src/components/DirectTaxPaymentsModal/DirectTaxPaymentModal.tsx (1 hunks)
  • libs/application/templates/financial-aid/src/components/Logo/Logo.tsx (1 hunks)
  • libs/application/templates/financial-aid/src/components/Status/AidAmount/AidAmount.tsx (1 hunks)
  • libs/application/templates/financial-aid/src/components/Status/ApprovedAlert/ApprovedAlert.tsx (1 hunks)
  • libs/application/templates/financial-aid/src/components/Status/Estimation/Estimation.tsx (2 hunks)
  • libs/application/templates/financial-aid/src/components/Status/Header/Header.tsx (1 hunks)
  • libs/application/templates/financial-aid/src/components/Status/MissingFilesCard/MissingFilesCard.tsx (1 hunks)
  • libs/application/templates/financial-aid/src/components/Status/MoreActions/MoreActions.tsx (1 hunks)
  • libs/application/templates/financial-aid/src/components/Status/RejectionMessage/RejectionMessage.tsx (1 hunks)
  • libs/application/templates/financial-aid/src/components/Status/SpouseAlert/SpouseAlert.tsx (1 hunks)
  • libs/application/templates/financial-aid/src/components/Status/SpouseApproved/SpouseApproved.tsx (1 hunks)
  • libs/application/templates/financial-aid/src/components/Status/Timeline/Timeline.tsx (2 hunks)
  • libs/application/templates/financial-aid/src/components/Summary/Files.css.ts (1 hunks)
  • libs/application/templates/financial-aid/src/components/Summary/Files.tsx (1 hunks)
  • libs/application/templates/financial-aid/src/components/Summary/SummaryBlock.css.ts (1 hunks)
  • libs/application/templates/financial-aid/src/components/Summary/SummaryBlock.tsx (1 hunks)
  • libs/application/templates/financial-aid/src/fields/ChildrenForm/ChildInput.tsx (1 hunks)
  • libs/application/templates/financial-aid/src/fields/ChildrenForm/ChildrenForm.tsx (3 hunks)
  • libs/application/templates/financial-aid/src/fields/Status/ApplicantStatus.tsx (2 hunks)
  • libs/application/templates/financial-aid/src/fields/Status/SpouseStatus.tsx (1 hunks)
  • libs/application/templates/financial-aid/src/fields/Summary/SpouseSummaryForm.tsx (5 hunks)
  • libs/application/templates/financial-aid/src/fields/Summary/SummaryForm.tsx (6 hunks)
  • libs/application/templates/financial-aid/src/fields/index.ts (1 hunks)
  • libs/application/templates/financial-aid/src/forms/ApplicationForm/confirmationSection/confirmationMultiField.ts (1 hunks)
  • libs/application/templates/financial-aid/src/forms/ApplicationForm/confirmationSection/index.ts (1 hunks)
  • libs/application/templates/financial-aid/src/forms/ApplicationForm/contactInfoSection/contactInfoMultiField.ts (1 hunks)
  • libs/application/templates/financial-aid/src/forms/ApplicationForm/contactInfoSection/index.ts (1 hunks)
  • libs/application/templates/financial-aid/src/forms/ApplicationForm/financesSection/bankInfoSubSection.ts (1 hunks)
  • libs/application/templates/financial-aid/src/forms/ApplicationForm/financesSection/incomeFileSubSection.ts (1 hunks)
  • libs/application/templates/financial-aid/src/forms/ApplicationForm/financesSection/incomeSubSection.ts (1 hunks)
  • libs/application/templates/financial-aid/src/forms/ApplicationForm/financesSection/index.ts (1 hunks)
  • libs/application/templates/financial-aid/src/forms/ApplicationForm/financesSection/personalTaxCreditSubSection.ts (1 hunks)
  • libs/application/templates/financial-aid/src/forms/ApplicationForm/financesSection/taxReturnFilesSubSection.ts (1 hunks)
  • libs/application/templates/financial-aid/src/forms/ApplicationForm/index.ts (1 hunks)
  • libs/application/templates/financial-aid/src/forms/ApplicationForm/personalInterstSection/childrenFilesSubSection.ts (1 hunks)
  • libs/application/templates/financial-aid/src/forms/ApplicationForm/personalInterstSection/childrenSubSection.ts (1 hunks)
  • libs/application/templates/financial-aid/src/forms/ApplicationForm/personalInterstSection/employmentSubSection.ts (1 hunks)
  • libs/application/templates/financial-aid/src/forms/ApplicationForm/personalInterstSection/homeCircumstancesSubSection.ts (1 hunks)
  • libs/application/templates/financial-aid/src/forms/ApplicationForm/personalInterstSection/inARelationshipSubSection.ts (1 hunks)
  • libs/application/templates/financial-aid/src/forms/ApplicationForm/personalInterstSection/index.ts (1 hunks)
  • libs/application/templates/financial-aid/src/forms/ApplicationForm/personalInterstSection/studentSubSection.ts (1 hunks)
  • libs/application/templates/financial-aid/src/forms/ApplicationForm/personalInterstSection/unknownRelationshipSubSection.ts (1 hunks)
  • libs/application/templates/financial-aid/src/forms/ApplicationForm/summarySection/index.ts (1 hunks)
  • libs/application/templates/financial-aid/src/forms/ApplicationForm/summarySection/summaryMultiField.ts (1 hunks)
  • libs/application/templates/financial-aid/src/forms/MunicipalityNotRegisteredForm/MuncipalityNotRegistered.ts (1 hunks)
  • libs/application/templates/financial-aid/src/forms/PrerequisitesForm/externalDataSection.ts (1 hunks)
  • libs/application/templates/financial-aid/src/forms/PrerequisitesForm/index.ts (1 hunks)
  • libs/application/templates/financial-aid/src/forms/PrerequisitesForm/informationSection.ts (1 hunks)
  • libs/application/templates/financial-aid/src/forms/PrerequisitesSpouseForm/index.ts (1 hunks)
  • libs/application/templates/financial-aid/src/forms/PrerequisitesSpouseForm/informationSection.ts (1 hunks)
  • libs/application/templates/financial-aid/src/forms/PrerequisitesSpouseForm/prerequisitesSection.ts (1 hunks)
  • libs/application/templates/financial-aid/src/forms/SpouseForm/index.ts (1 hunks)
  • libs/application/templates/financial-aid/src/forms/SpouseForm/spouseConfirmationSection.ts (1 hunks)
  • libs/application/templates/financial-aid/src/forms/SpouseForm/spouseContactInfoSection.ts (1 hunks)
  • libs/application/templates/financial-aid/src/forms/SpouseForm/spouseIncomeFilesSection.ts (1 hunks)
  • libs/application/templates/financial-aid/src/forms/SpouseForm/spouseIncomeSection.ts (1 hunks)
  • libs/application/templates/financial-aid/src/forms/SpouseForm/spouseSumarySection.ts (1 hunks)
  • libs/application/templates/financial-aid/src/forms/SpouseForm/spouseTaxReturnFilesSection.ts (1 hunks)
  • libs/application/templates/financial-aid/src/forms/SubmittedForms/ApplicantSubmitted.ts (1 hunks)
  • libs/application/templates/financial-aid/src/forms/SubmittedForms/SpouseSubmitted.ts (1 hunks)
  • libs/application/templates/financial-aid/src/lib/FinancialAidTemplate.ts (7 hunks)
  • libs/application/templates/financial-aid/src/lib/constants.ts (2 hunks)
  • libs/application/templates/financial-aid/src/lib/dataSchema.ts (4 hunks)
  • libs/application/templates/financial-aid/src/lib/formatters.ts (4 hunks)
  • libs/application/templates/financial-aid/src/lib/messages/aboutForm.ts (1 hunks)
  • libs/application/templates/financial-aid/src/lib/messages/aboutSpouseForm.ts (1 hunks)
  • libs/application/templates/financial-aid/src/lib/messages/error.ts (1 hunks)
  • libs/application/templates/financial-aid/src/lib/messages/incomeForm.ts (1 hunks)
  • libs/application/templates/financial-aid/src/lib/messages/privacyPolicyAccordion.ts (1 hunks)
  • libs/application/templates/financial-aid/src/lib/messages/unknownRelationship.ts (1 hunks)
  • libs/application/templates/financial-aid/src/lib/types.ts (4 hunks)
  • libs/application/templates/financial-aid/src/lib/utils.ts (4 hunks)
  • libs/application/templates/financial-aid/src/lib/utils/getAplicantsServiceCenter.ts (1 hunks)
Files not processed due to max files limit (14)
  • libs/application/templates/financial-aid/src/lib/utils/getEmploymentOptions.ts
  • libs/application/templates/financial-aid/src/lib/utils/getHomeCircumstancesOptions.ts
  • libs/application/templates/financial-aid/src/lib/utils/getIncomeOptions.ts
  • libs/application/templates/financial-aid/src/lib/utils/getPersonalTaxCreditOptions.ts
  • libs/application/templates/financial-aid/src/lib/utils/getStudentOptions.ts
  • libs/application/templates/financial-aid/src/lib/utils/getUnknownRelationshipOptions.tsx
  • libs/application/types/src/lib/Fields.ts
  • libs/application/types/src/lib/Form.ts
  • libs/application/ui-fields/src/lib/AccordionFormField/AccordionFormField.tsx
  • libs/application/ui-fields/src/lib/BankAccountFormField/BankAccountFormField.tsx
  • libs/application/ui-fields/src/lib/index.ts
  • libs/application/ui-shell/src/lib/FormShell.tsx
  • libs/application/ui-shell/src/utils.ts
  • libs/shared/components/src/Markdown/markdownOptions.tsx
Files skipped from review due to trivial changes (21)
  • apps/financial-aid/web-veita/src/components/AidAmountModal/AidAmountModal.tsx
  • libs/application/core/src/validation/validators.ts
  • libs/application/templates/accident-notification/src/lib/AccidentNotificationTemplate.ts
  • libs/application/templates/accident-notification/src/lib/dataSchema.ts
  • libs/application/templates/financial-aid/src/components/Status/AidAmount/AidAmount.tsx
  • libs/application/templates/financial-aid/src/components/Status/ApprovedAlert/ApprovedAlert.tsx
  • libs/application/templates/financial-aid/src/components/Status/Header/Header.tsx
  • libs/application/templates/financial-aid/src/components/Status/MissingFilesCard/MissingFilesCard.tsx
  • libs/application/templates/financial-aid/src/components/Status/MoreActions/MoreActions.tsx
  • libs/application/templates/financial-aid/src/components/Status/RejectionMessage/RejectionMessage.tsx
  • libs/application/templates/financial-aid/src/components/Status/SpouseAlert/SpouseAlert.tsx
  • libs/application/templates/financial-aid/src/components/Status/SpouseApproved/SpouseApproved.tsx
  • libs/application/templates/financial-aid/src/components/Status/Timeline/Timeline.tsx
  • libs/application/templates/financial-aid/src/components/Summary/Files.tsx
  • libs/application/templates/financial-aid/src/components/Summary/SummaryBlock.css.ts
  • libs/application/templates/financial-aid/src/components/Summary/SummaryBlock.tsx
  • libs/application/templates/financial-aid/src/fields/ChildrenForm/ChildInput.tsx
  • libs/application/templates/financial-aid/src/fields/Status/SpouseStatus.tsx
  • libs/application/templates/financial-aid/src/fields/index.ts
  • libs/application/templates/financial-aid/src/lib/messages/aboutSpouseForm.ts
  • libs/application/templates/financial-aid/src/lib/messages/unknownRelationship.ts
Additional context used
Path-based instructions (59)
libs/application/templates/financial-aid/src/components/Summary/Files.css.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/forms/ApplicationForm/summarySection/index.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/forms/ApplicationForm/contactInfoSection/index.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/forms/ApplicationForm/confirmationSection/index.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/lib/utils/getAplicantsServiceCenter.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/forms/PrerequisitesForm/index.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/forms/ApplicationForm/financesSection/index.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/forms/PrerequisitesSpouseForm/index.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/forms/ApplicationForm/contactInfoSection/contactInfoMultiField.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/forms/ApplicationForm/summarySection/summaryMultiField.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/components/Logo/Logo.tsx (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/forms/ApplicationForm/personalInterstSection/childrenSubSection.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/forms/SubmittedForms/ApplicantSubmitted.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/forms/SubmittedForms/SpouseSubmitted.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/forms/ApplicationForm/financesSection/bankInfoSubSection.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/forms/ApplicationForm/index.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/forms/SpouseForm/spouseContactInfoSection.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/forms/ApplicationForm/personalInterstSection/index.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/forms/SpouseForm/spouseIncomeFilesSection.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/forms/ApplicationForm/financesSection/incomeSubSection.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/forms/SpouseForm/spouseIncomeSection.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/forms/ApplicationForm/financesSection/incomeFileSubSection.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/forms/SpouseForm/spouseSumarySection.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/forms/SpouseForm/index.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/forms/ApplicationForm/personalInterstSection/childrenFilesSubSection.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/forms/ApplicationForm/personalInterstSection/employmentSubSection.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/forms/ApplicationForm/financesSection/personalTaxCreditSubSection.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/forms/PrerequisitesSpouseForm/prerequisitesSection.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/forms/ApplicationForm/personalInterstSection/studentSubSection.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/forms/ApplicationForm/personalInterstSection/homeCircumstancesSubSection.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/forms/ApplicationForm/personalInterstSection/inARelationshipSubSection.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/lib/messages/error.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/components/DirectTaxPaymentsModal/DirectTaxPaymentModal.tsx (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/lib/constants.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/forms/ApplicationForm/financesSection/taxReturnFilesSubSection.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/lib/messages/aboutForm.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/forms/PrerequisitesForm/externalDataSection.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/forms/SpouseForm/spouseTaxReturnFilesSection.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/lib/messages/incomeForm.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/forms/MunicipalityNotRegisteredForm/MuncipalityNotRegistered.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/forms/PrerequisitesForm/informationSection.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/lib/types.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/forms/PrerequisitesSpouseForm/informationSection.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/forms/ApplicationForm/personalInterstSection/unknownRelationshipSubSection.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/fields/ChildrenForm/ChildrenForm.tsx (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/forms/SpouseForm/spouseConfirmationSection.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/fields/Status/ApplicantStatus.tsx (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/components/Status/Estimation/Estimation.tsx (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/forms/ApplicationForm/confirmationSection/confirmationMultiField.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/fields/Summary/SpouseSummaryForm.tsx (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/lib/messages/privacyPolicyAccordion.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/lib/dataSchema.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/lib/formatters.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/lib/utils.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/fields/Summary/SummaryForm.tsx (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/lib/FinancialAidTemplate.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/template-api-modules/src/lib/modules/templates/financial-aid/financial-aid.service.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/core/src/lib/fieldBuilders.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/core/src/lib/messages.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
Additional comments not posted (77)
libs/application/templates/financial-aid/src/components/Summary/Files.css.ts (1)

1-9: CSS style definition looks good.

The use of @vanilla-extract/css for defining styles is appropriate and promotes modularity. The hover effect on file buttons is a standard UI practice and is implemented correctly here.

Ensure that the CSS style is scoped correctly and does not affect other elements unintentionally.

libs/application/templates/financial-aid/src/forms/ApplicationForm/summarySection/index.ts (1)

1-10: Form section structure is well-defined.

The modular approach using buildSection to define form sections is clear and maintainable. The use of centralized routes and messages enhances readability and consistency across the application.

Verify that the summaryMultiField component is properly tested and integrates well within this section.

libs/application/templates/financial-aid/src/forms/ApplicationForm/contactInfoSection/index.ts (1)

1-10: Contact info section structure is well-defined.

The consistent use of buildSection for defining sections is commendable. It ensures that the application's form sections are modular and easy to manage. The centralized handling of routes and messages is also a good practice.

Verify that the contactInfoMultiField component is properly tested and integrates well within this section.

libs/application/templates/financial-aid/src/forms/ApplicationForm/confirmationSection/index.ts (1)

1-10: Well-structured section definition.

This file introduces a new section for the application form, using well-structured imports and centralized messages and routes. The use of buildSection to define the confirmationSection with its children is clear and maintainable. This aligns well with the PR's objective to enhance structure and maintainability.

libs/application/templates/financial-aid/src/forms/ApplicationForm/financesSection/index.ts (1)

1-20: Well-structured and modular code for financial section.

The use of buildSection along with clearly defined sub-sections enhances the maintainability and clarity of the module. The modular approach aligns well with the PR's objectives to refactor custom components for better reusability and maintainability.

libs/application/templates/financial-aid/src/forms/PrerequisitesSpouseForm/index.ts (1)

1-19: Dynamic and modular form setup for spouse prerequisites.

The implementation of a dynamic logo and the clear separation of form sections enhance the form's usability and maintainability. The use of buildForm and modular components aligns with the PR's objectives.

Consider verifying the form's state management (FormModes.IN_PROGRESS) to ensure it aligns with the application's requirements and user expectations.

libs/application/templates/financial-aid/src/forms/ApplicationForm/summarySection/summaryMultiField.ts (1)

19-21: Clarify the intention behind the empty title in the submit field.

The title property of the buildSubmitField is set to an empty string. If this is intentional to create a minimalistic button, it's acceptable. However, if it was an oversight, consider adding a descriptive title to improve accessibility and user understanding.

libs/application/templates/financial-aid/src/forms/ApplicationForm/personalInterstSection/childrenSubSection.ts (1)

10-29: Verify the condition function and approve the overall structure.

The childrenSubSection uses a condition function to determine its visibility based on the presence of children's custody information. Ensure that this function handles all edge cases, such as null or undefined values, correctly. The overall structure of the component is well-organized and follows best practices for modular form construction.

libs/application/templates/financial-aid/src/forms/SubmittedForms/ApplicantSubmitted.ts (2)

1-10: Well-organized import statements.

The import statements are clear and correctly organized, ensuring that all necessary modules are included for the form's functionality.


12-32: Dynamic logo functionality is innovative but requires thorough testing.

The form configuration is well-structured and uses a dynamic approach for the logo, which enhances flexibility. Ensure that this dynamic logo functionality is tested across different application states to confirm its robustness and consistency.

libs/application/templates/financial-aid/src/forms/SubmittedForms/SpouseSubmitted.ts (2)

1-11: Well-organized import statements.

The import statements are clear and correctly organized, ensuring that all necessary modules are included for the form's functionality.


13-33: Dynamic logo functionality is innovative but requires thorough testing.

The form configuration is well-structured and uses a dynamic approach for the logo, which enhances flexibility. Ensure that this dynamic logo functionality is tested across different application states to confirm its robustness and consistency.

libs/application/templates/financial-aid/src/forms/ApplicationForm/financesSection/bankInfoSubSection.ts (2)

1-9: Well-organized import statements.

The import statements are clear and correctly organized, ensuring that all necessary modules are included for the form's functionality.


10-33: Well-structured subsection for bank information.

The subsection configuration is well-structured and uses custom fields effectively to collect detailed bank information. This setup ensures that all necessary data points are captured in a user-friendly manner.

libs/application/templates/financial-aid/src/forms/SpouseForm/spouseIncomeFilesSection.ts (2)

1-6: Approved: Import structure and organization.

The imports are well-organized and correctly utilize destructuring for clarity and maintainability.


11-33: Approved: Section configuration and logic.

The section is well-configured with a clear conditional rendering logic based on the spouse's income type. This setup enhances the form's dynamic behavior and user experience.

libs/application/templates/financial-aid/src/forms/ApplicationForm/financesSection/incomeSubSection.ts (2)

1-6: Approved: Import structure and organization.

The imports are well-organized and correctly utilize destructuring for clarity and maintainability.


11-35: Approved: Subsection configuration and logic.

The subsection is well-configured with dynamic options for income types and a clear layout. The use of utility functions for options enhances modularity and reusability.

libs/application/templates/financial-aid/src/forms/SpouseForm/spouseIncomeSection.ts (2)

1-6: Approved: Import structure and organization.

The imports are well-organized and correctly utilize destructuring for clarity and maintainability.


11-35: Approved: Section configuration and logic.

The section is well-configured with dynamic options for spouse's income types and a clear layout. The use of utility functions for options enhances modularity and reusability.

libs/application/templates/financial-aid/src/forms/ApplicationForm/financesSection/incomeFileSubSection.ts (2)

1-6: Approved import statements and utility usage.

The import statements and the utilities used are appropriate for the functionality of the file upload subsection. The modular approach enhances maintainability.


11-35: Verify the use of constants and localized messages.

The use of constants like FILE_SIZE_LIMIT and UPLOAD_ACCEPT, and localized messages from m.incomeFilesForm are crucial for maintainability and should be verified across the application to ensure consistency.

libs/application/templates/financial-aid/src/forms/SpouseForm/spouseSumarySection.ts (2)

1-6: Approved import statements and utility usage.

The import statements and the utilities used are appropriate for the functionality of the spouse summary section. The modular approach enhances maintainability.


11-38: Verify the implementation of the custom component SpouseSummaryForm.

The use of the custom component SpouseSummaryForm is crucial for the functionality of this section. Verify that it is implemented correctly and integrates well with the rest of the application.

Verification successful

The SpouseSummaryForm component is correctly implemented and integrated.

The SpouseSummaryForm component is implemented in SpouseSummaryForm.tsx and integrates well with the application's form handling system using react-hook-form. It processes application data and manages state effectively, indicating proper functionality within the application.

  • Implementation file: libs/application/templates/financial-aid/src/fields/Summary/SpouseSummaryForm.tsx
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the implementation and usage of the custom component `SpouseSummaryForm`.

# Test: Search for the component implementation and usage. Expect: Correct implementation and consistent usage.
rg --type typescript "SpouseSummaryForm"

Length of output: 75


Script:

#!/bin/bash
# Description: Verify the implementation and usage of the custom component `SpouseSummaryForm`.

# Test: Search for the component implementation and usage. Expect: Correct implementation and consistent usage.
rg --type ts "SpouseSummaryForm"

Length of output: 571


Script:

#!/bin/bash
# Description: Extract the implementation details of the `SpouseSummaryForm` component.

# Test: Retrieve the content of the `SpouseSummaryForm.tsx` file to verify its implementation.
rg --type ts --context 10 "const SpouseSummaryForm" libs/application/templates/financial-aid/src/fields/Summary/SpouseSummaryForm.tsx

Length of output: 1167

libs/application/templates/financial-aid/src/forms/SpouseForm/index.ts (3)

1-12: Approved import statements and utility usage.

The import statements and the utilities used are appropriate for defining the spouse form structure. The modular approach enhances maintainability.


13-29: Verify the performance of the dynamic logo implementation.

The dynamic logo implementation using createElement is innovative. However, ensure that it does not introduce any performance issues, especially in client-side rendering scenarios.


13-29: Verify the integration of form sections.

The form includes multiple sections, which are crucial for the functionality of the spouse form. Verify that these sections integrate well and function seamlessly together.

libs/application/templates/financial-aid/src/forms/PrerequisitesSpouseForm/prerequisitesSection.ts (1)

1-39: Confirm the use of undefined types and empty strings.

The file is well-structured and follows best practices for modularity and reusability. However, the use of undefined for the type in line 32 and empty strings for titles in lines 27 and 33 might be intentional but could potentially lead to confusion or errors. Please confirm if these are placeholders or if they should be replaced with more descriptive values to enhance clarity and maintainability.

libs/application/templates/financial-aid/src/lib/messages/error.ts (1)

35-39: New error message addition is clear and well-documented.

The addition of the missingFiles error message is well-implemented. The use of defineMessages for internationalization is appropriate, and the message details are clear and informative, enhancing the user experience by providing specific feedback on missing files.

libs/application/templates/financial-aid/src/components/DirectTaxPaymentsModal/DirectTaxPaymentModal.tsx (1)

7-7: Import change approved, verify impact on other components.

The change to a default import for TaxBreakdown is noted. Please ensure that this change is reflected across all files that use this component to avoid import errors. Verifying this can prevent potential runtime issues due to the import mismatch.

Run the following script to verify the usage of TaxBreakdown across the project:

libs/application/templates/financial-aid/src/lib/constants.ts (2)

59-59: Change in UPLOAD_ACCEPT constant format.

The modification of UPLOAD_ACCEPT from an array to a single string is approved. However, verify that this change does not affect the file upload handling, especially if the consuming code expects an array format.

Run the following script to verify the impact of the change on file upload handling:

Verification successful

Verification of UPLOAD_ACCEPT constant format change.

The change of UPLOAD_ACCEPT from an array to a string format is consistent with its usage across the codebase. The constant is used in contexts where a string is expected, confirming that the modification does not negatively impact the file upload handling.

  • Instances of UPLOAD_ACCEPT usage confirm that the consuming code expects a string format.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the impact of the `UPLOAD_ACCEPT` constant format change on file upload handling.

# Test: Search for the usage of `UPLOAD_ACCEPT`. Expect: Proper handling of the new string format.
rg --type typescript -A 5 $'UPLOAD_ACCEPT'

Length of output: 76


Script:

#!/bin/bash
# Description: Verify the impact of the `UPLOAD_ACCEPT` constant format change on file upload handling.

# Test: Search for the usage of `UPLOAD_ACCEPT`. Expect: Proper handling of the new string format.
rg --type ts -A 5 $'UPLOAD_ACCEPT'

Length of output: 37701


19-19: New routes added to the Routes enum.

The addition of PERSONALINTEREST and FINANCES to the Routes enum is approved. Ensure that these new routes are integrated properly throughout the application and that their usage is consistent with the application's flow.

Run the following script to verify the usage of the new routes:

Also applies to: 26-26

Verification successful

New routes PERSONALINTEREST and FINANCES are integrated into the application.

The new routes have been successfully integrated into the application's form sections, as evidenced by their usage in the ApplicationForm components. Ensure that these routes are functioning as expected within the application's flow.

  • PERSONALINTEREST is used in libs/application/templates/financial-aid/src/forms/ApplicationForm/personalInterstSection/index.ts.
  • FINANCES is used in libs/application/templates/financial-aid/src/forms/ApplicationForm/financesSection/index.ts.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of new routes in the application.

# Test: Search for the usage of new routes. Expect: References to these routes in navigation or routing logic.
rg --type typescript -A 5 $'PERSONALINTEREST|FINANCES'

Length of output: 90


Script:

#!/bin/bash
# Description: Verify the usage of new routes in the application.

# Test: Search for the usage of new routes. Expect: References to these routes in navigation or routing logic.
rg --type ts -A 5 $'PERSONALINTEREST|FINANCES'

Length of output: 6206

libs/application/templates/financial-aid/src/forms/ApplicationForm/financesSection/taxReturnFilesSubSection.ts (1)

1-49: New file for tax return files subsection.

This new file introduces a subsection for handling tax return files within the financial aid application form. The structure and imports are consistent with the application's standards. The use of FILE_SIZE_LIMIT, Routes, and UPLOAD_ACCEPT from the constants file is appropriate and ensures consistency across the application.

Ensure that the conditions and logic within the buildSubSection are correctly implemented and tested, especially the conditions in lines 14-18 which handle the display logic based on external data.

libs/application/templates/financial-aid/src/lib/messages/aboutForm.ts (1)

16-16: Modification to id property in aboutForm.description.

The change to include #markdown in the id of the description object is approved. This change suggests that the description will now support markdown formatting. Verify that the rendering engines or components that use this id are capable of processing markdown to ensure that the description is displayed correctly.

Run the following script to verify the rendering of markdown in descriptions:

libs/application/templates/financial-aid/src/forms/SpouseForm/spouseTaxReturnFilesSection.ts (1)

11-54: Well-structured tax return files section.

The spouseTaxReturnFilesSection is well-defined with appropriate use of fields and localized messages. The structure adheres to the application's architectural standards.

However, verify the condition logic to ensure it accurately handles all edge cases related to tax data retrieval.

libs/application/templates/financial-aid/src/lib/messages/incomeForm.ts (1)

24-28: Simplified income examples list.

The consolidation of income examples into a single incomeExampleList simplifies the structure and enhances clarity. This change is likely to improve both maintainability and the user experience.

However, verify that the new list format renders correctly in the UI.

libs/application/templates/financial-aid/src/forms/MunicipalityNotRegisteredForm/MuncipalityNotRegistered.ts (1)

1-6: Imports are correctly structured.

The imports are appropriately structured and used within the file.

libs/application/templates/financial-aid/src/forms/PrerequisitesForm/informationSection.ts (2)

1-8: Imports are correctly structured.

The imports are appropriately structured and used within the file.


14-72: Approve the section structure and highlight the good use of dynamic content.

The section structure is well-organized and uses dynamic content effectively, enhancing the user experience by providing context-specific information. The use of getValueViaPath to dynamically fetch URL data is a good practice and should be maintained.

libs/application/templates/financial-aid/src/lib/types.ts (2)

Line range hint 1-12: Imports are correctly structured.

The imports are appropriately structured and used within the file.


Line range hint 13-77: Approve the type changes and highlight the improvements in clarity and maintainability.

The renaming of types to follow a consistent naming convention and the removal of unused types simplify the codebase and enhance clarity. The changes are well-executed and improve the maintainability of the code.

libs/application/templates/financial-aid/src/forms/PrerequisitesSpouseForm/informationSection.ts (1)

1-15: Well-organized imports and constants.

The imports are appropriately organized and the use of shared libraries for date functions is a good practice.

libs/application/templates/financial-aid/src/forms/ApplicationForm/personalInterstSection/unknownRelationshipSubSection.ts (2)

1-14: Well-organized imports and constants.

The imports are appropriately organized and the use of shared libraries for utility functions is a good practice.


16-70: Well-implemented subsection with dynamic content.

The unknownRelationshipSubSection is well-constructed with appropriate use of dynamic content based on application data.

libs/application/templates/financial-aid/src/fields/ChildrenForm/ChildrenForm.tsx (1)

1-12: Updated import paths enhance clarity.

The import of DescriptionText from its new path improves maintainability and clarity of the component structure.

libs/application/templates/financial-aid/src/forms/SpouseForm/spouseConfirmationSection.ts (1)

18-88: Well-implemented form section for spouse confirmation.

The spouseConfirmationSection function is well-structured and effectively uses conditional rendering and dynamic content. It adheres to best practices in form organization and state handling.

libs/application/templates/financial-aid/src/fields/Status/ApplicantStatus.tsx (1)

9-16: Improved clarity with explicit component imports.

The restructuring of import statements enhances modularity and maintainability. Ensure that all paths are correct and that the components are properly exported from their new locations.

libs/application/templates/financial-aid/src/components/Status/Estimation/Estimation.tsx (1)

13-14: Refined imports and updated logic for tax credit evaluation.

The new direct import paths for Breakdown and DescriptionText enhance clarity. The change in accessing personalTaxCredit should be verified to ensure it aligns with the updated data model and is consistently implemented across the application.

Also applies to: 64-64

Verification successful

Consistent usage of personalTaxCredit.type across the application.

The new data access pattern for personalTaxCredit.type is consistently used across various files, including service files, formatters, and components. This confirms that the logic change aligns with the updated data model. The import changes and logic updates in Estimation.tsx are correct and consistent with the rest of the application.

  • Files with consistent usage:
    • financial-aid.service.ts
    • formatters.ts
    • Estimation.tsx
    • SummaryForm.tsx
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the new data access pattern for `personalTaxCredit`.

# Test: Search for usage of `personalTaxCredit.type`. Expect: Consistent usage across the application.
rg --type typescript -A 5 $'personalTaxCredit.type'

Length of output: 85


Script:

#!/bin/bash
# Description: Verify the new data access pattern for `personalTaxCredit`.

# Test: Search for usage of `personalTaxCredit.type`. Expect: Consistent usage across the application.
rg --type ts -A 5 $'personalTaxCredit.type'

Length of output: 2733

libs/application/templates/financial-aid/src/forms/ApplicationForm/confirmationSection/confirmationMultiField.ts (1)

67-100: Remove debug statements and verify external data handling.

The use of console.log for debugging (lines 93 and 95) should be removed in production code to avoid exposing potentially sensitive information. Additionally, ensure that the external data accessed in these functions is handled securely and conforms to privacy standards.

libs/application/templates/financial-aid/src/fields/Summary/SpouseSummaryForm.tsx (2)

75-75: Approve the updated condition with a verification suggestion.

The update to check the type property within spouseIncome reflects a more detailed data model. Ensure that all references to spouseIncome in the application have been updated accordingly.


84-85: Approve the use of optional chaining for robustness.

The use of optional chaining (?? []) for accessing spouseTaxReturnFiles and spouseIncomeFiles enhances the robustness of the component by safely handling potentially undefined properties. This is a best practice worth maintaining.

libs/application/templates/financial-aid/src/lib/messages/privacyPolicyAccordion.ts (1)

20-20: Approve the updated privacy policy message with a suggestion for legal review.

The revised defaultMessage provides a clearer and more structured explanation of personal data processing. It is recommended to review this update for legal compliance and clarity to ensure it meets all necessary standards.

libs/application/templates/financial-aid/src/lib/dataSchema.ts (7)

10-14: FileSchema is well-defined.

The schema correctly defines the necessary fields for file information, including optional URL validation.


16-22: childSchoolInfoSchema is comprehensive.

The schema effectively captures all necessary details about a child's school information, ensuring thorough validation.


24-28: bankInfoSchema is appropriately flexible.

The schema allows for optional fields, accommodating different levels of available banking information.


30-55: relationshipStatusSchema effectively uses conditional validation.

The schema uses refine to enforce additional validation rules based on the unregisteredCohabitation status, ensuring accurate data capture for relationship statuses.


57-69: studentSchema correctly implements conditional validation.

The schema ensures that additional information is provided when the student status is 'Yes', using refine effectively.


70-81: homeCircumstancesSchema is well-designed for conditional inputs.

The schema requires additional information when the type is 'OTHER', ensuring detailed data capture for various home circumstances.


82-92: employmentSchema effectively handles conditional inputs.

The schema ensures that additional information is provided for the employment type 'OTHER', using conditional validation appropriately.

libs/application/templates/financial-aid/src/lib/formatters.ts (2)

Line range hint 89-130: Updated formItems function to use AnswersSchema enhances data handling.

The function now uses the updated AnswersSchema, ensuring consistency and type safety across the application. The logic within the function is well-structured and correctly accesses nested properties.


139-143: Updated spouseFormItems function to use AnswersSchema ensures type safety.

The function now correctly uses the updated AnswersSchema, aligning with the application's data handling improvements. The logic is appropriate for spouse-related data processing.

libs/application/templates/financial-aid/src/lib/utils.ts (4)

105-106: Updated hasFiles function to use AnswersSchema aligns with data schema changes.

The function now uses the updated AnswersSchema, ensuring consistency and type safety when checking for file presence.


128-137: New hasSpouse2 function is well-implemented.

The function effectively checks for the presence of a spouse using updated data structures and provides clear logic, enhancing the application's functionality.


140-158: New getNextStepsDescription function enhances user guidance.

The function logically determines the appropriate next steps based on the spouse status and the presence of income files, effectively enhancing user guidance.


174-185: New hasIncomeFiles and hasSpouseIncomeFiles functions are correctly implemented.

These functions effectively check for the presence of income files for both the applicant and their spouse, using the updated data schema to ensure consistency.

libs/application/core/src/lib/fieldBuilders.ts (2)

444-467: Well-implemented function for creating accordion fields.

The buildAccordionField function is correctly implemented using TypeScript best practices. It simplifies the creation of accordion fields by predefining certain properties, which enhances consistency and maintainability.

Please ensure that this function is integrated correctly with the rest of the application and that all instances where accordion fields are created have been updated to use this new builder function.


470-484: Well-implemented function for creating bank account fields.

The buildBankAccountField function is correctly implemented and follows TypeScript best practices similar to other field builders in this module. It ensures that bank account fields are created with consistent properties, enhancing maintainability.

Please ensure that this function is integrated correctly with the rest of the application and that all instances where bank account fields are created have been updated to use this new builder function.

libs/application/core/src/lib/messages.ts (3)

294-298: Clear and descriptive message for bank account number.

The message definition for defaultBankAccountBankNumber is well-implemented. It is clear, descriptive, and follows internationalization best practices.


299-303: Well-defined message for bank account ledger.

The message definition for defaultBankAccountLedger is clear and follows internationalization best practices. It provides specific information that enhances user understanding in the context of bank account management.


304-308: Clear and descriptive message for bank account number.

The message definition for defaultBankAccountAccountNumber is well-implemented. It is clear, descriptive, and follows internationalization best practices.

libs/application/templates/financial-aid/src/lib/FinancialAidTemplate.ts (5)

68-69: Refactor: Updated import path for PrerequisitesForm.

The change in the import path to PrerequisitesForm aligns with the PR's goal of improving clarity and maintainability by standardizing naming conventions. Ensure that the new path is correctly set up in the project's structure and that all references to this module are updated accordingly.


185-186: Refactor: Updated import path for SpouseForm.

The change in the import path for SpouseForm is in line with the PR's objectives to improve code organization. Confirm that the new path is correctly set up and that all references to this module are updated accordingly.


112-113: Refactor: Updated import path for ApplicationForm.

The renaming and restructuring of the import path for ApplicationForm are consistent with the PR's objectives. Verify that the new path is correctly integrated and that all dependent modules reflect this change.

Verification successful

Verification Successful: Import Path for ApplicationForm is Correctly Integrated

The import path for ApplicationForm in libs/application/templates/financial-aid/src/lib/FinancialAidTemplate.ts is correctly updated and integrated as per the refactoring objectives. No conflicting imports were found in the codebase.

  • libs/application/templates/financial-aid/src/lib/FinancialAidTemplate.ts: Correctly uses the new import path ../forms/ApplicationForm.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `ApplicationForm` match the new path.

# Test: Search for the function usage. Expect: Only occurrences of the new path.
rg --type typescript -A 5 $'ApplicationForm'

Length of output: 78


Script:

#!/bin/bash
# Description: Verify all function calls to `ApplicationForm` match the new path.

# Test: Search for the function usage. Expect: Only occurrences of the new path.
rg --type ts -A 5 $'ApplicationForm'

Length of output: 18594


155-156: Refactor: Consolidated import paths for SubmittedForms.

The restructuring of ApplicantSubmitted and SpouseSubmitted into a SubmittedForms directory is a good practice for organizing related forms. Ensure that all references to these forms are updated across the project to reflect this change.

Also applies to: 194-195, 219-220

Verification successful

Verification Successful: Consolidated import paths for SubmittedForms are correctly updated.

The import paths for ApplicantSubmitted and SpouseSubmitted have been successfully updated to reflect their new locations in the SubmittedForms directory. All references in the codebase are consistent with this change.

  • ApplicantSubmitted and SpouseSubmitted are correctly imported from ../forms/SubmittedForms/ in FinancialAidTemplate.ts.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `ApplicantSubmitted` and `SpouseSubmitted` match the new paths.

# Test: Search for the function usage. Expect: Only occurrences of the new paths.
rg --type typescript -A 5 $'ApplicantSubmitted|SpouseSubmitted'

Length of output: 99


Script:

#!/bin/bash
# Description: Verify all function calls to `ApplicantSubmitted` and `SpouseSubmitted` match the new paths.

# Test: Search for the function usage. Expect: Only occurrences of the new paths.
rg --type ts -A 5 $'ApplicantSubmitted|SpouseSubmitted'

Length of output: 4615


228-229: Refactor: Updated import path for SpouseSubmitted.

The restructuring of the import path for SpouseSubmitted into the SubmittedForms directory helps in organizing related forms better. Verify that the new path is correctly integrated and that all dependent modules reflect this change.

Verification successful

Verification Successful: Import Path for SpouseSubmitted is Correctly Integrated

The import path for SpouseSubmitted has been updated to reflect its location in the SubmittedForms directory, and this change is correctly integrated in the codebase. No further issues were found regarding this update.

  • FinancialAidTemplate.ts correctly imports SpouseSubmitted from ../forms/SubmittedForms/SpouseSubmitted.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `SpouseSubmitted` match the new path.

# Test: Search for the function usage. Expect: Only occurrences of the new path.
rg --type typescript -A 5 $'SpouseSubmitted'

Length of output: 78


Script:

#!/bin/bash
# Description: Verify all function calls to `SpouseSubmitted` match the new path.

# Test: Search for the function usage in TypeScript files. Expect: Only occurrences of the new path.
rg 'SpouseSubmitted' --glob '*.ts' -A 5

Length of output: 1538

libs/application/template-api-modules/src/lib/modules/templates/financial-aid/financial-aid.service.ts (2)

154-164: Enhancement: Improved handling of optional properties with nullish coalescing.

The use of the nullish coalescing operator (??) to provide default empty arrays for various file types is a robust enhancement. This change ensures that the formatFiles function is always called with an array, preventing potential errors when accessing these properties.


175-177: Refinement: Updated logic for determining hasIncome and usePersonalTaxCredit.

The changes to use the type property for checking conditions in hasIncome and usePersonalTaxCredit likely align better with the intended data structure and improve the accuracy of these flags. This is a good practice for ensuring that the logic matches the data model.

@jonnigs jonnigs added the deploy-feature Deploys features to dev label Sep 11, 2024
Copy link
Contributor

github-actions bot commented Sep 11, 2024

Affected services are: api,application-system-api,financial-aid-api,financial-aid-backend,financial-aid-open-api,services-auth-personal-representative,air-discount-scheme-web,financial-aid-web-osk,financial-aid-web-veita,skilavottord-web,web,application-system-form,island-ui-storybook,portals-admin,service-portal,system-e2e,
Feature deployment of your services will begin shortly. Your feature will be accessible here:
https://featcustom-components-financial-aid-api-catalogue.dev01.devland.is/api
https://featcustom-components-financial-aid-application-callback-xrd.internal.dev01.devland.is/application-payment
https://featcustom-components-financial-aid-application-callback-xrd.internal.dev01.devland.is/applications
https://featcustom-components-financial-aid-application-payment-callback-xrd.internal.dev01.devland.is/application-payment
https://featcustom-components-financial-aid-application-payment-callback-xrd.internal.dev01.devland.is/applications
https://featcustom-components-financial-aid-beta.dev01.devland.is/
https://featcustom-components-financial-aid-beta.dev01.devland.is/api
https://featcustom-components-financial-aid-beta.dev01.devland.is/app/skilavottord/
https://featcustom-components-financial-aid-beta.dev01.devland.is/minarsidur
https://featcustom-components-financial-aid-beta.dev01.devland.is/samradsgatt
https://featcustom-components-financial-aid-beta.dev01.devland.is/stjornbord
https://featcustom-components-financial-aid-beta.dev01.devland.is/umsoknir
https://featcustom-components-financial-aid-loftbru-cf.dev01.devland.is/
https://featcustom-components-financial-aid-loftbru.dev01.devland.is/
https://featcustom-components-financial-aid-ui.dev01.devland.is/

Deployed services: application-system-api,application-system-form,service-portal,portals-admin,api,web,skilavottord-web,island-ui-storybook,air-discount-scheme-web,application-system-api-worker,consultation-portal.
Excluded services: ``

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Outside diff range and nitpick comments (3)
libs/application/templates/financial-aid/src/forms/ApplicationForm/personalInterestSection/index.ts (1)

1-24: LGTM! The code adheres to the modular structure and effectively organizes the sub-sections.

The code changes are approved for the following reasons:

  • The file adheres to the modular structure by importing sub-sections and building the section using the buildSection function from @island.is/application/core.
  • The file uses TypeScript for importing types and defining the section.
  • The file effectively organizes the sub-sections as children of the main section.

A few additional suggestions:

  • Consider adding JSDoc comments to document the purpose and structure of the section and its sub-sections. This can enhance the maintainability and readability of the code.
  • Ensure that the imported sub-sections are reusable across different NextJS apps. If not, consider refactoring them to be more generic and reusable.
  • Verify that the imported sub-sections are effectively tree-shaken and bundled to optimize the application's performance.
libs/application/templates/financial-aid/src/forms/ApplicationForm/personalInterestSection/homeCircumstancesSubSection.ts (1)

1-40: LGTM! The code changes are approved.

The homeCircumstancesSubSection function is well-structured and effectively uses the utility functions to build the form subsection. The use of constants and types from other files improves the readability and maintainability of the code. The conditional rendering of the text field based on the radio field value is a good practice to show relevant fields based on user input.

The code adheres to the reusability and TypeScript usage guidelines mentioned in the additional instructions.

Here are a few additional suggestions for improvement:

  1. Consider adding a brief comment above the function to describe its purpose and the structure of the form subsection it builds. This can help other developers quickly understand the purpose of the function without having to read through the entire code.

  2. Consider destructuring the Routes and HomeCircumstances imports to avoid using the full namespace when referencing them in the code. This can improve the readability of the code.

-import { Routes } from '../../../lib/constants'
+import { Routes } from '../../../lib/constants'
+const { HOMECIRCUMSTANCES } = Routes

-import { HomeCircumstances } from '@island.is/financial-aid/shared/lib'
+import { HomeCircumstances } from '@island.is/financial-aid/shared/lib'
+const { OTHER } = HomeCircumstances
  1. Consider adding a test file for this function to ensure that it builds the form subsection correctly and handles the conditional rendering of the text field based on the radio field value. This can help catch any regressions introduced by future changes to the code.
libs/application/templates/financial-aid/src/forms/MunicipalityNotRegisteredForm/MunicipalityNotRegistered.ts (1)

14-61: LGTM! The form definition is well-structured and follows the guidelines.

The MunicipalityNotRegistered form definition is properly constructed using the buildForm function and includes the necessary fields and components.

A few additional suggestions:

  • Consider extracting the getApplicantsServiceCenter function call into a separate variable to avoid duplicate calls (lines 26, 41-42, 52-53).
  • If the Logo component is specific to this form, consider moving it to the same directory as the form definition for better organization.

Overall, the form definition adheres to the reusability and TypeScript usage guidelines, making it suitable for use across different NextJS apps.

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between bb83ac1 and 4e47867.

Files selected for processing (19)
  • libs/application/templates/financial-aid/src/components/Logo/Logo.tsx (1 hunks)
  • libs/application/templates/financial-aid/src/forms/ApplicationForm/confirmationSection/confirmationMultiField.ts (1 hunks)
  • libs/application/templates/financial-aid/src/forms/ApplicationForm/contactInfoSection/contactInfoMultiField.ts (1 hunks)
  • libs/application/templates/financial-aid/src/forms/ApplicationForm/index.ts (1 hunks)
  • libs/application/templates/financial-aid/src/forms/ApplicationForm/personalInterestSection/childrenFilesSubSection.ts (1 hunks)
  • libs/application/templates/financial-aid/src/forms/ApplicationForm/personalInterestSection/childrenSubSection.ts (1 hunks)
  • libs/application/templates/financial-aid/src/forms/ApplicationForm/personalInterestSection/employmentSubSection.ts (1 hunks)
  • libs/application/templates/financial-aid/src/forms/ApplicationForm/personalInterestSection/homeCircumstancesSubSection.ts (1 hunks)
  • libs/application/templates/financial-aid/src/forms/ApplicationForm/personalInterestSection/inARelationshipSubSection.ts (1 hunks)
  • libs/application/templates/financial-aid/src/forms/ApplicationForm/personalInterestSection/index.ts (1 hunks)
  • libs/application/templates/financial-aid/src/forms/ApplicationForm/personalInterestSection/studentSubSection.ts (1 hunks)
  • libs/application/templates/financial-aid/src/forms/ApplicationForm/personalInterestSection/unknownRelationshipSubSection.ts (1 hunks)
  • libs/application/templates/financial-aid/src/forms/MunicipalityNotRegisteredForm/MunicipalityNotRegistered.ts (1 hunks)
  • libs/application/templates/financial-aid/src/forms/PrerequisitesSpouseForm/index.ts (1 hunks)
  • libs/application/templates/financial-aid/src/forms/PrerequisitesSpouseForm/informationSection.ts (1 hunks)
  • libs/application/templates/financial-aid/src/lib/FinancialAidTemplate.ts (11 hunks)
  • libs/application/templates/financial-aid/src/lib/constants.ts (4 hunks)
  • libs/application/templates/financial-aid/src/lib/utils.ts (5 hunks)
  • libs/application/templates/financial-aid/src/lib/utils/getApplicantsServiceCenter.ts (1 hunks)
Files skipped from review due to trivial changes (1)
  • libs/application/templates/financial-aid/src/lib/FinancialAidTemplate.ts
Files skipped from review as they are similar to previous changes (7)
  • libs/application/templates/financial-aid/src/components/Logo/Logo.tsx
  • libs/application/templates/financial-aid/src/forms/ApplicationForm/confirmationSection/confirmationMultiField.ts
  • libs/application/templates/financial-aid/src/forms/ApplicationForm/contactInfoSection/contactInfoMultiField.ts
  • libs/application/templates/financial-aid/src/forms/ApplicationForm/index.ts
  • libs/application/templates/financial-aid/src/forms/PrerequisitesSpouseForm/index.ts
  • libs/application/templates/financial-aid/src/forms/PrerequisitesSpouseForm/informationSection.ts
  • libs/application/templates/financial-aid/src/lib/constants.ts
Additional context used
Path-based instructions (11)
libs/application/templates/financial-aid/src/lib/utils/getApplicantsServiceCenter.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/forms/ApplicationForm/personalInterestSection/childrenSubSection.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/forms/ApplicationForm/personalInterestSection/index.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/forms/ApplicationForm/personalInterestSection/childrenFilesSubSection.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/forms/ApplicationForm/personalInterestSection/employmentSubSection.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/forms/ApplicationForm/personalInterestSection/studentSubSection.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/forms/ApplicationForm/personalInterestSection/homeCircumstancesSubSection.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/forms/ApplicationForm/personalInterestSection/inARelationshipSubSection.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/forms/MunicipalityNotRegisteredForm/MunicipalityNotRegistered.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/forms/ApplicationForm/personalInterestSection/unknownRelationshipSubSection.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/lib/utils.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
Additional comments not posted (19)
libs/application/templates/financial-aid/src/lib/utils/getApplicantsServiceCenter.ts (1)

1-19: LGTM!

The getApplicantsServiceCenter function is well-implemented and follows good practices:

  • It correctly types the input parameter and return value.
  • It safely accesses the nested properties of the externalData object using optional chaining and type assertion.
  • It effectively utilizes the shared serviceCenters data to find the matching service center based on the municipality code.

The code changes are approved.

libs/application/templates/financial-aid/src/forms/ApplicationForm/personalInterestSection/childrenSubSection.ts (2)

10-29: LGTM!

The code changes are approved.


10-29: Verify the reusability of the component.

Ensure that the childrenSubSection component is reusable across different NextJS apps.

Run the following script to verify the reusability:

libs/application/templates/financial-aid/src/forms/ApplicationForm/personalInterestSection/childrenFilesSubSection.ts (1)

1-39: LGTM!

The code changes adhere to the reusability, TypeScript usage, and effective tree-shaking and bundling practices. The code is well-structured and uses constants and localized messages for maintainability.

libs/application/templates/financial-aid/src/forms/ApplicationForm/personalInterestSection/employmentSubSection.ts (2)

1-12: LGTM!

The imports adhere to the reusability principle by using shared functions from @island.is/application/core. They also utilize TypeScript types like FormValue and Employment. The imports are well-organized and follow best practices.


13-39: Excellent code structure and adherence to best practices!

The code follows a modular and reusable structure by utilizing the build functions from @island.is/application/core. The use of buildMultiField, buildRadioField, and buildTextField promotes consistency and reusability across the application.

The conditional rendering of buildTextField based on the selected employment type enhances the user experience by dynamically adapting the form based on the user's input.

The code effectively utilizes TypeScript by specifying types like FormValue and Employment, ensuring type safety and improving code maintainability.

Overall, the code adheres to the principles of reusability, TypeScript usage, and follows best practices for building modular and maintainable forms.

libs/application/templates/financial-aid/src/forms/ApplicationForm/personalInterestSection/studentSubSection.ts (1)

1-40: Code adheres to the specified guidelines.

The code follows the guidelines for reusability, TypeScript usage, and bundling practices:

  • It uses reusable builder functions from @island.is/application/core to create the form subsection, promoting consistency across NextJS apps.
  • It leverages TypeScript for defining types and interfaces, enhancing type safety.
  • The modular structure and focused imports should enable effective tree-shaking and bundling.
libs/application/templates/financial-aid/src/forms/ApplicationForm/personalInterestSection/inARelationshipSubSection.ts (4)

17-47: LGTM!

The code changes are approved.


21-25: LGTM!

The code changes are approved.


26-33: LGTM!

The code changes are approved.


34-45: LGTM!

The code changes are approved.

libs/application/templates/financial-aid/src/forms/ApplicationForm/personalInterestSection/unknownRelationshipSubSection.ts (2)

1-15: LGTM!

The imports are well-organized, reusable across different NextJS apps, and properly tree-shaken and bundled.


16-70: LGTM!

The code follows best practices for building reusable and maintainable form components:

  • It uses reusable build*Field functions to build form fields.
  • It uses TypeScript for defining props and exporting types, which improves type safety.
  • It uses messages from the m module for internationalization.
  • It conditionally renders form fields based on the user's answers, which improves the user experience.
  • It is well-organized and easy to read, which makes it easier to maintain and extend.
libs/application/templates/financial-aid/src/lib/utils.ts (6)

101-102: The existing comment is still valid:

coderabbitai[bot]: Ensure to revert hasActiveCurrentApplication before deployment.

The function currently returns a hardcoded false for testing purposes. Make sure to revert this change to restore its original functionality before final deployment.

Would you like me to open a GitHub issue to track this task?


105-106: LGTM!

The code changes are approved.


128-138: LGTM!

The code changes are approved.


140-158: LGTM!

The code changes are approved.


174-179: LGTM!

The code changes are approved.


181-185: LGTM!

The code changes are approved.

Copy link
Member

@Toti91 Toti91 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple of things. Im mainly worried about if we are removing important functionality or not

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Outside diff range and nitpick comments (1)
apps/financial-aid/web-veita/src/components/Profile/ApplicationProfile.tsx (1)

Line range hint 1-324: Consider component decomposition for improved maintainability.

The ApplicationProfile component adheres to NextJS best practices and makes good use of TypeScript for type safety. However, its size and complexity suggest that it might benefit from further decomposition into smaller, more focused components. This could improve maintainability and readability.

Consider breaking down the ApplicationProfile component into smaller, reusable components. For example:

  • Create separate components for each section (e.g., ApplicantInfo, SpouseInfo, ChildrenInfo).
  • Extract the modal logic into custom hooks or separate components.

This refactoring would align with the PR's goal of improving maintainability and could potentially increase the reusability of these components across the application.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 4e47867 and ec65cb8.

📒 Files selected for processing (1)
  • apps/financial-aid/web-veita/src/components/Profile/ApplicationProfile.tsx (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
apps/financial-aid/web-veita/src/components/Profile/ApplicationProfile.tsx (1)

Pattern apps/**/*: "Confirm that the code adheres to the following:

  • NextJS best practices, including file structure, API routes, and static generation methods.
  • Efficient state management and server-side rendering techniques.
  • Optimal use of TypeScript for component and utility type safety."
🔇 Additional comments (1)
apps/financial-aid/web-veita/src/components/Profile/ApplicationProfile.tsx (1)

1-1: LGTM! Verify context usage removal.

The removal of useContext from the import statement is appropriate as it's no longer used in the component. This change aligns with the PR objective of reducing dependency on custom components.

To ensure that context is no longer used in this file or its dependencies, run the following command:

✅ Verification successful
# No useContext usage found in ApplicationProfile.tsx

useContext Removal Verified Successfully

The useContext import has been successfully removed and is no longer used in the ApplicationProfile.tsx component. This change aligns with the PR objective of reducing dependency on custom components.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for any remaining useContext usage in this file and its imports
rg --type typescript "useContext|React\.useContext" apps/financial-aid/web-veita/src/components/Profile/ApplicationProfile.tsx

Length of output: 163


Script:

# Incorrect file type specified. Using '*.ts' to target TypeScript files instead.
rg "useContext|React\.useContext" apps/financial-aid/web-veita/src/components/Profile/ApplicationProfile.tsx --type-add 'ts:*.ts' --type ts

Length of output: 141

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 19

🧹 Outside diff range and nitpick comments (16)
libs/application/templates/financial-aid/src/forms/SpouseForm/spouseIncomeFilesSection.ts (2)

11-15: LGTM: Section definition and condition look good.

The section is well-defined using buildSection, and the condition for rendering is clear and type-safe.

Consider extracting the condition into a separate function for improved readability:

const shouldShowSpouseIncomeFiles = (answers: any): boolean => {
  const income = getValueViaPath<ApproveOptions>(answers, 'spouseIncome.type')
  return income === ApproveOptions.Yes
}

export const spouseIncomeFilesSection = buildSection({
  condition: shouldShowSpouseIncomeFiles,
  // ... rest of the section configuration
})

16-33: LGTM: Section configuration is well-structured and reusable.

The section configuration is clear, using appropriate utility functions and constants. It's structured in a way that promotes reusability across different NextJS apps.

Consider adding explicit type annotations to improve type safety:

export const spouseIncomeFilesSection: Section = buildSection({
  // ... existing configuration
})

interface Section {
  // Define the structure of the section object
}

This will make the exported type more explicit and improve type checking in consuming code.

libs/application/templates/financial-aid/src/fields/Status/util.ts (1)

4-7: Consider adding an explicit return type.

While the function signature is clear, adding an explicit return type would enhance type safety and serve as self-documentation. Consider defining an interface for the return type and using it in the function signature.

Here's a suggested implementation:

interface ApplicantStatusConstants {
  currentApplicationId: string | undefined;
  showCopyUrl: boolean | undefined;
  rulesPage: string | undefined;
  homepage: string | undefined;
  email: string | undefined;
  rulesHomepage: string | undefined;
}

export const getApplicantStatusConstants = (
  answers: FormValue,
  externalData: ExternalData
): ApplicantStatusConstants => {
  // ... function body ...
}
libs/application/templates/financial-aid/src/forms/ApplicationForm/financesSection/incomeFileSubSection.ts (1)

1-35: Overall, excellent implementation with minor improvement suggested.

The incomeFileSubSection.ts file is well-implemented, adhering to the coding guidelines for the libs directory:

  • It uses reusable components and hooks, promoting consistency across NextJS apps.
  • TypeScript is effectively used for type safety and exported types.
  • The structure facilitates effective tree-shaking and bundling.

To further improve the file:

  1. Consider adding a title to the file upload field as suggested earlier.
  2. You might want to add a brief comment at the top of the file explaining its purpose and how it fits into the larger application structure.

Great job on creating a maintainable and reusable component!

libs/application/templates/financial-aid/src/forms/ApplicationForm/personalInterestSection/childrenFilesSubSection.ts (1)

11-36: LGTM: Well-structured subsection with good use of core components.

The childrenFilesSubSection is well-defined using buildSubSection, which aligns with the coding guidelines for reusability across NextJS apps. The structure promotes consistency by using route constants and localized messages.

However, to further improve type safety:

Consider explicitly typing the externalData parameter in the condition function:

condition: (_, externalData: { childrenCustodyInformation?: { data: Array<ApplicantChildCustodyInformation> } }) => {
  // ... existing code ...
}

This will ensure better type checking and documentation of the expected external data structure.

libs/application/templates/financial-aid/src/fields/Summary/MissingFilesConfirmation.tsx (1)

16-22: LGTM: Improved logic for determining fileType

The new logic for determining fileType based on the isSpouse property enhances the component's flexibility and reusability. The use of getValueViaPath is a good approach for accessing nested properties safely.

Consider using a const assertion for the fileType to improve type inference:

const fileType = (isSpouse
  ? 'missingFilesSpouse'
  : 'missingFiles') as const;

This will ensure that fileType is inferred as a union type of literal strings, which can be beneficial for type checking in other parts of the code.

libs/application/templates/financial-aid/src/forms/ApplicationForm/financesSection/taxReturnFilesSubSection.ts (2)

11-24: Well-structured subsection with type-safe condition.

The subsection is well-defined with a clear structure and a type-safe condition function. The use of getValueViaPath enhances type safety when accessing nested properties of the external data.

For improved type safety, consider defining an interface for the expected structure of externalData:

interface ExternalData {
  taxData: {
    data: {
      municipalitiesDirectTaxPayments: {
        success: boolean;
      };
      municipalitiesPersonalTaxReturn: {
        personalTaxReturn: unknown;
      };
    };
  };
}

Then, update the condition function signature:

condition: (_, externalData: ExternalData) => {
  // ... existing code ...
}

This change will provide better type checking and autocompletion for the externalData object.


25-55: Well-structured and reusable component composition with room for accessibility improvement.

The children components are well-structured using reusable utility functions from the core library. The file upload field and description fields are logically organized and provide necessary user guidance.

To enhance accessibility, consider adding an aria-label to the file upload field:

 buildFileUploadField({
   id: Routes.TAXRETURNFILES,
   title: '',
   uploadMultiple: true,
   maxSize: FILE_SIZE_LIMIT,
   uploadAccept: UPLOAD_ACCEPT,
+  ariaLabel: m.taxReturnForm.general.uploadAriaLabel, // Add this line
 }),

Ensure to add the corresponding message in your messages file:

// In your messages file
export const taxReturnForm = {
  // ... existing messages
  general: {
    // ... existing messages
    uploadAriaLabel: 'Upload tax return files',
  },
}

This change will improve the experience for users relying on screen readers.

libs/application/templates/financial-aid/src/fields/Status/ApplicantStatus.tsx (2)

6-14: Improved import structure and standardized prop types.

The reorganization of imports and the use of FieldBaseProps from a shared types package align well with the goal of improving reusability across different NextJS apps. This change enhances the overall structure and maintainability of the codebase.

Consider grouping the imports by their source (e.g., external libraries, internal components) for even better readability. For example:

import React from 'react'
import { Box, LoadingDots } from '@island.is/island-ui/core'
import { FieldBaseProps } from '@island.is/application/types'
import { ApplicationState } from '@island.is/financial-aid/shared/lib'

import { hasSpouse, waitingForSpouse } from '../../lib/utils'
import useApplication from '../../lib/hooks/useApplication'
import Header from '../../components/Status/Header/Header'
// ... other internal component imports
import { getApplicantStatusConstants } from './util'

18-26: Improved code organization with utility function.

The introduction of getApplicantStatusConstants is a great refactoring that enhances code readability and maintainability. It centralizes the logic for extracting constants from the application object, which aligns well with the reusability guideline.

Consider adding a type annotation for the destructured object to improve type safety:

const {
  currentApplicationId,
  showCopyUrl,
  rulesPage,
  homepage,
  email,
  rulesHomepage,
}: {
  currentApplicationId: string;
  showCopyUrl: boolean;
  rulesPage: string;
  homepage: string;
  email: string;
  rulesHomepage: string;
} = getApplicantStatusConstants(answers, externalData)

This would make the component more robust and easier to maintain in the long run.

libs/application/templates/financial-aid/src/fields/Summary/utils.ts (2)

19-95: LGTM: Well-structured function with a minor improvement suggestion.

The getSpouseSummaryConstants function is well-implemented, adhering to TypeScript best practices and ensuring type safety. It effectively extracts spouse-related information from the provided data structures.

Suggestion for improvement:
Consider creating a type for the return value of this function. This would enhance type safety and make the function's output more predictable for consumers.

Example:

type SpouseSummaryConstants = {
  nationalId: string | undefined;
  data: NationalRegistryIndividual | undefined;
  // ... other properties
};

export const getSpouseSummaryConstants = (
  answers: FormValue,
  externalData: ExternalData
): SpouseSummaryConstants => {
  // ... existing implementation
}

This change would align even more closely with the coding guidelines for TypeScript usage and improve reusability across different NextJS apps.


97-175: LGTM: Well-implemented function with a suggestion for enhanced type safety.

The getSummaryConstants function is well-structured and follows TypeScript best practices. It effectively extracts various pieces of information related to the financial aid application.

Suggestion for improvement:
Similar to the previous function, consider creating a type for the return value of this function. This would further enhance type safety and improve the function's usability across different NextJS apps.

Example:

type SummaryConstants = {
  homeCircumstances: HomeCircumstances | undefined;
  individualAid: Aid | undefined;
  // ... other properties
};

export const getSummaryConstants = (
  answers: FormValue,
  externalData: ExternalData
): SummaryConstants => {
  // ... existing implementation
}

This change would align even more closely with the coding guidelines for TypeScript usage and improve reusability.

libs/application/templates/financial-aid/src/fields/Status/SpouseStatus.tsx (1)

49-50: Align prop names with MoreActions component expectations

The props municipalityRulesPage and municipalityEmail passed to <MoreActions> may need to match the expected prop names for consistency and clarity.

Consider renaming the props if necessary to align with the MoreActions component's interface.

libs/application/templates/financial-aid/src/forms/SpouseForm/spouseTaxReturnFilesSection.ts (1)

13-16: Inconsistent Type Annotations in getValueViaPath

On line 13, getValueViaPath<boolean> includes a type parameter specifying the expected return type. However, on line 17, getValueViaPath is used without a type parameter. For consistency and better type safety, consider specifying the expected type on line 17 as well.

Consider updating line 17 as follows:

- const spouseTaxReturn = getValueViaPath(
+ const spouseTaxReturn = getValueViaPath<ExpectedType>(

Replace ExpectedType with the appropriate type for spouseTaxReturn.

libs/application/templates/financial-aid/src/forms/ApplicationForm/confirmationSection/confirmationMultiField.ts (1)

11-15: Consider renaming hasSpouse2 for better readability

The function hasSpouse2 imported on line 14 may be confusing due to the numerical suffix. Using numbers in function names can reduce code readability and maintainability.

Consider renaming hasSpouse2 to a more descriptive name, such as applicationHasSpouse or checkIfHasSpouse, to improve code clarity.

libs/application/templates/financial-aid/src/lib/utils.ts (1)

183-187: Rename variable for clarity in 'hasSpouseIncomeFiles' function.

In the hasSpouseIncomeFiles function, the variable income represents spouseIncomeFiles. Renaming it to spouseIncomeFiles improves readability.

Apply this diff to rename the variable:

export const hasSpouseIncomeFiles = (formValue: FormValue) => {
-  const income = formValue.spouseIncomeFiles as Array<File>
-  return income && income.length > 0
+  const spouseIncomeFiles = formValue.spouseIncomeFiles as Array<File>
+  return spouseIncomeFiles && spouseIncomeFiles.length > 0
}
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between ec65cb8 and 24769cc.

📒 Files selected for processing (17)
  • libs/application/templates/financial-aid/src/fields/Status/ApplicantStatus.tsx (3 hunks)
  • libs/application/templates/financial-aid/src/fields/Status/SpouseStatus.tsx (2 hunks)
  • libs/application/templates/financial-aid/src/fields/Status/util.ts (1 hunks)
  • libs/application/templates/financial-aid/src/fields/Summary/MissingFilesConfirmation.tsx (1 hunks)
  • libs/application/templates/financial-aid/src/fields/Summary/SummaryForm.tsx (5 hunks)
  • libs/application/templates/financial-aid/src/fields/Summary/utils.ts (1 hunks)
  • libs/application/templates/financial-aid/src/forms/ApplicationForm/confirmationSection/confirmationMultiField.ts (1 hunks)
  • libs/application/templates/financial-aid/src/forms/ApplicationForm/financesSection/incomeFileSubSection.ts (1 hunks)
  • libs/application/templates/financial-aid/src/forms/ApplicationForm/financesSection/taxReturnFilesSubSection.ts (1 hunks)
  • libs/application/templates/financial-aid/src/forms/ApplicationForm/personalInterestSection/childrenFilesSubSection.ts (1 hunks)
  • libs/application/templates/financial-aid/src/forms/ApplicationForm/personalInterestSection/childrenSubSection.ts (1 hunks)
  • libs/application/templates/financial-aid/src/forms/PrerequisitesForm/informationSection.ts (1 hunks)
  • libs/application/templates/financial-aid/src/forms/PrerequisitesSpouseForm/informationSection.ts (1 hunks)
  • libs/application/templates/financial-aid/src/forms/SpouseForm/spouseIncomeFilesSection.ts (1 hunks)
  • libs/application/templates/financial-aid/src/forms/SpouseForm/spouseTaxReturnFilesSection.ts (1 hunks)
  • libs/application/templates/financial-aid/src/lib/formatters.ts (2 hunks)
  • libs/application/templates/financial-aid/src/lib/utils.ts (3 hunks)
🧰 Additional context used
📓 Path-based instructions (17)
libs/application/templates/financial-aid/src/fields/Status/ApplicantStatus.tsx (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/fields/Status/SpouseStatus.tsx (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/fields/Status/util.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/fields/Summary/MissingFilesConfirmation.tsx (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/fields/Summary/SummaryForm.tsx (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/fields/Summary/utils.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/forms/ApplicationForm/confirmationSection/confirmationMultiField.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/forms/ApplicationForm/financesSection/incomeFileSubSection.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/forms/ApplicationForm/financesSection/taxReturnFilesSubSection.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/forms/ApplicationForm/personalInterestSection/childrenFilesSubSection.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/forms/ApplicationForm/personalInterestSection/childrenSubSection.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/forms/PrerequisitesForm/informationSection.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/forms/PrerequisitesSpouseForm/informationSection.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/forms/SpouseForm/spouseIncomeFilesSection.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/forms/SpouseForm/spouseTaxReturnFilesSection.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/lib/formatters.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/lib/utils.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
📓 Learnings (1)
libs/application/templates/financial-aid/src/forms/ApplicationForm/personalInterestSection/childrenSubSection.ts (2)
Learnt from: birkirkristmunds
PR: island-is/island.is#16096
File: libs/application/templates/new-primary-school/src/forms/NewPrimarySchoolForm/childrenNParentsSection/index.ts:10-10
Timestamp: 2024-10-03T15:59:05.224Z
Learning: The `childrenSubSection` code has been moved and is now used in the `Prerequisites` section.
Learnt from: birkirkristmunds
PR: island-is/island.is#16096
File: libs/application/templates/new-primary-school/src/forms/NewPrimarySchoolForm/childrenNParentsSection/index.ts:10-10
Timestamp: 2024-10-08T15:39:04.351Z
Learning: The `childrenSubSection` code has been moved and is now used in the `Prerequisites` section.
🔇 Additional comments (34)
libs/application/templates/financial-aid/src/forms/SpouseForm/spouseIncomeFilesSection.ts (2)

1-9: LGTM: Import statements are clean and support tree-shaking.

The import statements are well-organized, importing only the necessary functions and constants. This approach supports effective tree-shaking and bundling practices.


1-33: Overall assessment: Well-implemented and adheres to coding guidelines.

This new file introduces a reusable component for spouse income file uploads, adhering to the coding guidelines for the libs directory. It effectively uses TypeScript for type safety, supports tree-shaking, and is structured for reusability across different NextJS apps. The implementation is clean and well-organized.

A few minor suggestions have been made to further improve readability and type safety, but overall, this is a solid addition to the codebase.

libs/application/templates/financial-aid/src/fields/Status/util.ts (2)

1-2: LGTM: Imports are appropriate and concise.

The import statements are well-structured, importing only the necessary function and types required for this utility.


8-37: LGTM: Well-structured implementation with safe value extraction.

The function body is well-implemented, using getValueViaPath consistently for safe value extraction. The extracted values seem relevant to the applicant's status, and the implementation adheres to the principle of reusability across different NextJS apps.

libs/application/templates/financial-aid/src/forms/ApplicationForm/financesSection/incomeFileSubSection.ts (3)

1-9: LGTM: Import statements are well-organized and follow best practices.

The import statements are clear, concise, and follow best practices:

  • Reusable components from '@island.is/application/core' are imported, promoting code reuse across NextJS apps.
  • Local imports use relative paths consistently.
  • Named imports are used, facilitating effective tree-shaking.

11-35: LGTM: Well-structured and type-safe implementation of the income files subsection.

The implementation of incomeFilesSubSection is well-organized and follows best practices:

  • It uses reusable components from the core library, promoting consistency across applications.
  • TypeScript is used effectively for type safety (e.g., ApproveOptions enum).
  • The condition logic is clear and correctly implemented.
  • Constants are used for file size limits and accepted file types, enhancing maintainability.

The structure allows for easy reuse and maintenance, aligning with the coding guidelines for the libs directory.


26-27: Consider adding a title to the file upload field.

The file upload field currently has an empty title (title: ''). As mentioned in a previous review, it's a good practice to provide a descriptive title for form fields to improve user experience and accessibility.

Consider adding a meaningful title to the file upload field. For example:

- title: '',
+ title: m.incomeFilesForm.general.uploadTitle,

Ensure that uploadTitle is defined in your messages file.

libs/application/templates/financial-aid/src/forms/ApplicationForm/personalInterestSection/childrenFilesSubSection.ts (2)

1-9: LGTM: Import statements are well-structured and follow best practices.

The imports are properly organized, using destructuring for specific imports from '@island.is/application/core' and local modules. This approach aligns with the coding guidelines for reusability across NextJS apps and supports effective tree-shaking.


1-36: Overall, excellent implementation of the childrenFilesSubSection.

This new file adheres well to the coding guidelines for the libs directory. It demonstrates good practices in terms of:

  1. Reusability of components across NextJS apps
  2. Effective use of TypeScript for type safety
  3. Proper structuring for efficient tree-shaking and bundling

The code is well-organized, uses core components appropriately, and follows a consistent style. The suggested improvements are minor and aimed at further enhancing type safety and potentially improving user experience.

libs/application/templates/financial-aid/src/fields/Summary/MissingFilesConfirmation.tsx (3)

4-10: LGTM: Import changes improve reusability and type safety

The updated imports align well with the PR objectives and coding guidelines. By importing from shared libraries (@island.is/shared/types and @island.is/application/core), you're improving reusability across different NextJS apps. The addition of RecordObject and FieldBaseProps types enhances type safety, which is great.


12-12: LGTM: Props update enhances component flexibility

The addition of the field prop of type FieldBaseProps improves the component's flexibility and type safety. This change aligns well with the coding guidelines for TypeScript usage in defining props and contributes to better maintainability of the codebase.


Line range hint 25-50: LGTM: Simplified component structure

The removal of the header Text component and Button component aligns with the PR objective of simplifying custom components. This change is consistent with the previous review comment about moving text out of the custom component.

To ensure this change doesn't negatively impact the user experience, please confirm:

  1. Is the removed header text now handled at a higher level in the component tree?
  2. Is the functionality of the removed "Reload page" button still accessible to users when needed?

You can use the following script to check for any remaining usage of the removed elements:

✅ Verification successful

LGTM: Verified removal of JSX elements

The "Reload page" button has been successfully removed from all relevant files, ensuring that there are no lingering references. The remaining references to missingFiles.confirmation.subtitle are related to message identifiers and do not impact the removed JSX elements.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for potential usages of removed elements
rg --type typescript --type tsx "Reload page" libs/application/templates/financial-aid/src
rg --type typescript --type tsx "missingFiles\.confirmation\.subtitle" libs/application/templates/financial-aid/src

Length of output: 280


Script:

#!/bin/bash
# Search for potential usages of removed elements with corrected file types
rg --type ts --type tsx "Reload page" libs/application/templates/financial-aid/src
rg --type ts --type tsx "missingFiles\.confirmation\.subtitle" libs/application/templates/financial-aid/src

Length of output: 250


Script:

#!/bin/bash
# Search for potential usages of removed elements using file patterns
rg "Reload page" -g "*.ts" -g "*.tsx" libs/application/templates/financial-aid/src
rg "missingFiles\.confirmation\.subtitle" -g "*.ts" -g "*.tsx" libs/application/templates/financial-aid/src

Length of output: 654

libs/application/templates/financial-aid/src/forms/ApplicationForm/personalInterestSection/childrenSubSection.ts (5)

1-13: LGTM: Well-organized imports supporting tree-shaking

The import statements are well-structured, importing only the necessary functions and types. This approach supports effective tree-shaking and bundling practices, which aligns with the coding guidelines for reusable components.


15-25: LGTM: Well-structured section definition

The childrenSubSection is defined using the buildSubSection utility, which promotes reusability and consistency. The use of Routes constant for the ID and message library for the title enhances maintainability. This structure aligns well with the coding guidelines for reusable components in NextJS apps.


16-22: LGTM: Robust conditional rendering logic

The condition function for rendering the section is well-implemented. It uses TypeScript for type safety and the getValueViaPath utility to safely access nested properties. The function correctly handles potential undefined values, returning a boolean based on the presence of child custody information. This approach enhances the robustness of the component.


1-57: Overall: Excellent implementation of a reusable form section

This file demonstrates a high-quality implementation of a form section for a financial aid application. It adheres to the coding guidelines for libs/**/*, promoting reusability across different NextJS apps. The use of TypeScript for type safety, utility functions from the core library, and message libraries for internationalization all contribute to a maintainable and robust codebase.

The structure is well-organized, with clear separation of concerns and appropriate use of conditional rendering. The use of utility functions from @island.is/application/core ensures consistency with other parts of the application.

One area for potential follow-up is the ChildrenForm custom component, which should be verified for proper implementation and reusability.


26-56: LGTM: Well-structured form with appropriate field types

The section's structure is well-organized, using appropriate field types for different kinds of information. The use of message libraries for titles and descriptions promotes internationalization and maintainability.

However, there's a custom component ChildrenForm being used. While this likely adheres to the project's standards, it would be beneficial to verify its implementation and reusability.

To verify the ChildrenForm component:

libs/application/templates/financial-aid/src/forms/ApplicationForm/financesSection/taxReturnFilesSubSection.ts (2)

1-9: Well-structured imports for better maintainability and tree-shaking.

The import statements are well-organized, using named imports from both external and local modules. This approach enhances code readability and supports effective tree-shaking, aligning with the coding guidelines for reusability and bundling practices.


1-55: Overall excellent implementation with minor suggestions for improvement.

This file demonstrates a high-quality implementation of a tax return files subsection for the financial aid application. It adheres to the coding guidelines for the 'libs' directory, showcasing:

  1. Reusability: Utilizes core utility functions for building form components.
  2. TypeScript usage: Employs TypeScript for improved type safety.
  3. Effective bundling practices: Uses named imports to support tree-shaking.

The structure is clear, logical, and maintainable. The minor suggestions provided for improving type safety and accessibility will further enhance the overall quality of the code.

Great job on this implementation!

libs/application/templates/financial-aid/src/fields/Status/ApplicantStatus.tsx (3)

17-17: Improved prop type definition.

The change from FAFieldBaseProps to FieldBaseProps is a positive step towards standardizing prop types across the application. This aligns well with the TypeScript usage guideline and enhances the reusability of the component.


Line range hint 42-80: Improved JSX structure with better prop management.

The changes in the JSX structure, particularly the use of extracted constants for prop values, enhance the component's maintainability and readability. This refactoring aligns well with best practices for React components and supports effective tree-shaking and bundling.

The consistent use of extracted constants (showCopyUrl, rulesPage, homepage, email, rulesHomepage) throughout the JSX improves the overall code quality and reduces the likelihood of errors. Good job on maintaining the component's functionality while improving its structure.


Line range hint 1-86: Overall assessment: Excellent refactoring and adherence to guidelines.

The changes made to the ApplicantStatus component demonstrate a strong commitment to code quality and adherence to the provided guidelines for library files. Key improvements include:

  1. Better organization of imports and components.
  2. Standardization of prop types for improved reusability.
  3. Introduction of a utility function for better code organization.
  4. Improved JSX structure with better prop management.

These changes collectively enhance the component's reusability, maintainability, and alignment with TypeScript best practices. The refactoring also supports effective tree-shaking and bundling, which is crucial for library files.

Great job on this refactoring! The code is now more robust, easier to maintain, and better aligned with the project's coding standards.

libs/application/templates/financial-aid/src/fields/Summary/utils.ts (1)

1-17: LGTM: Import statements are well-organized and relevant.

The import statements are concise, relevant to the file's functionality, and follow TypeScript best practices for type imports. This adheres to the coding guidelines for effective tree-shaking and bundling practices.

libs/application/templates/financial-aid/src/fields/Status/SpouseStatus.tsx (3)

13-13: Verify 'FieldBaseProps' includes all necessary properties

By replacing FAFieldBaseProps with FieldBaseProps in the component's props, please ensure that all required properties are still available. This change might affect how the component receives its data.


19-22: Ensure correct path in getValueViaPath for rulesHomepage

Please verify that the path 'municipality.data.rulesHomepage' accurately reflects the structure of externalData. This ensures that rulesHomepage is retrieved correctly.


23-23: Confirm the path for email in getValueViaPath

Double-check that 'municipality.data.email' is the correct path in externalData to obtain the email value. This prevents potential undefined errors.

libs/application/templates/financial-aid/src/forms/SpouseForm/spouseTaxReturnFilesSection.ts (1)

1-60: Adherence to Coding Guidelines

The code effectively adheres to the coding guidelines specified for files in the libs/**/* path:

  • Reusability: Components and utilities are structured for reuse across different NextJS applications.
  • TypeScript Usage: Types are properly defined, enhancing type safety and clarity.
  • Tree-shaking and Bundling: Imports are organized to support effective tree-shaking and efficient bundling practices.
libs/application/templates/financial-aid/src/forms/PrerequisitesSpouseForm/informationSection.ts (1)

17-84: Well-structured and reusable components

The informationSection is well-organized, utilizing reusable components and hooks effectively. The use of TypeScript for type definitions enhances type safety, and the code adheres to effective tree-shaking and bundling practices. Great job aligning with the coding guidelines.

libs/application/templates/financial-aid/src/lib/utils.ts (1)

99-102: Ensure 'hasActiveCurrentApplication' function is properly implemented before deployment.

Previously, there was a concern that hasActiveCurrentApplication returns a hardcoded value. Verify that this function now correctly determines if there is an active current application.

libs/application/templates/financial-aid/src/lib/formatters.ts (2)

93-145: Refactoring enhances type safety and reusability

Updating the formItems function to accept FormValue and casting to AnswersSchema within the function improves flexibility. This change aligns with the coding guidelines by promoting TypeScript usage for defining props and exporting types, enhancing reusability across different NextJS applications.


147-156: Consistent use of FormValue and getValueViaPath improves maintainability

In the spouseFormItems function, switching to FormValue and utilizing getValueViaPath for accessing nested properties enhances consistency and readability. This approach adheres to best practices in TypeScript and supports effective tree-shaking and bundling.

libs/application/templates/financial-aid/src/fields/Summary/SummaryForm.tsx (3)

30-34: Updated to use shared 'FieldBaseProps' for consistency

Replacing FAFieldBaseProps with FieldBaseProps from @island.is/application/types enhances reusability across different NextJS applications and aligns with shared type definitions.


31-39: Casting 'answers' to 'AnswersSchema' improves type safety

By casting answers to AnswersSchema, the code ensures that the data conforms to the expected schema, enhancing type safety and preventing potential runtime errors.


214-214: Verify the impact of removing the 'withLogo' Higher-Order Component

Removing withLogo from the export might affect the display of the logo in the SummaryForm. Please ensure that the form renders as expected without the withLogo HOC, and confirm that consistent branding is maintained.

Run the following script to check for other usages of withLogo in the codebase:

✅ Verification successful

Verified: Removing withLogo does not impact other exported components. The SummaryForm should render correctly without the withLogo HOC, maintaining consistent branding.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Find all instances where `withLogo` is used in exported components.

# Test: Search for components exported with `withLogo`. Expect: Verify if other components still use `withLogo` and assess the impact of its removal here.
rg --type tsx 'export\s+default\s+withLogo\('

Length of output: 75


Script:

#!/bin/bash
# Description: Find all instances where `withLogo` is used in exported components within .tsx files.

# Search for components exported with `withLogo` in .tsx files.
rg 'export\s+default\s+withLogo\(' --glob '*.tsx'

Length of output: 51


Script:

#!/bin/bash
# Description: Find all instances where `withLogo` is used in exported components within .tsx files using grep.

# Locate all .tsx files and search for the export statement with withLogo.
fd --type f --extension tsx | xargs grep -H 'export\s\+default\s\+withLogo('

Length of output: 78

coderabbitai[bot]
coderabbitai bot previously requested changes Oct 16, 2024
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🧹 Outside diff range and nitpick comments (2)
libs/application/templates/financial-aid/src/fields/Summary/utils.ts (2)

19-95: LGTM: Well-structured function with robust data extraction.

The getSpouseSummaryConstants function effectively extracts and organizes spouse-related data using TypeScript best practices. The use of getValueViaPath with type assertions ensures type safety when accessing nested properties.

Consider adding JSDoc comments to describe the function's purpose and parameters for improved documentation.


97-175: LGTM: Comprehensive data extraction with good type safety.

The getSummaryConstants function effectively collects a wide range of data points relevant to the financial aid application. The consistent use of getValueViaPath with TypeScript generics ensures type safety when accessing nested properties.

Suggestions for improvement:

  1. Consider adding JSDoc comments to describe the function's purpose and parameters.
  2. The function is quite long. Consider breaking it down into smaller, more focused functions for better maintainability.
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 24769cc and 8488a51.

📒 Files selected for processing (2)
  • libs/application/templates/financial-aid/src/fields/Summary/SpouseSummaryForm.tsx (4 hunks)
  • libs/application/templates/financial-aid/src/fields/Summary/utils.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
libs/application/templates/financial-aid/src/fields/Summary/SpouseSummaryForm.tsx (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/fields/Summary/utils.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
🔇 Additional comments (4)
libs/application/templates/financial-aid/src/fields/Summary/utils.ts (2)

1-17: LGTM: Import statements are well-organized and follow best practices.

The import statements are correctly structured, using named imports which promote better tree-shaking. The use of explicit type imports from '@island.is/application/types' and other modules adheres to TypeScript best practices.


1-175: Great job: File adheres to coding guidelines and best practices.

This utility file demonstrates excellent adherence to the coding guidelines for libs/**/* files:

  1. Reusability: The functions are designed to be reusable across different NextJS apps, extracting common data patterns for financial aid applications.
  2. TypeScript usage: The code makes effective use of TypeScript, including explicit type imports, type assertions, and generics for improved type safety.
  3. Tree-shaking and bundling: The use of named imports and explicit type declarations supports effective tree-shaking and bundling practices.

The overall structure and implementation of the utility functions promote maintainability and type safety. Great work on creating a robust and reusable module for financial aid applications.

libs/application/templates/financial-aid/src/fields/Summary/SpouseSummaryForm.tsx (2)

17-20: Updated props type to improve reusability

Changing the props type from FAFieldBaseProps to FieldBaseProps enhances component reusability across different NextJS apps, in line with the coding guidelines. This promotes consistency and maintainability.


110-110: Removal of 'withLogo' higher-order component

The withLogo HOC has been removed from the export statement. Verify that the logo is now handled appropriately elsewhere, ensuring that this change doesn't negatively affect the user interface.

If the logo display is now managed differently due to the refactoring outlined in the PR objectives, then this change is acceptable.

Copy link
Member

@baering baering left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Core file LGTM.

@jonnigs jonnigs dismissed coderabbitai[bot]’s stale review October 16, 2024 13:27

Allready fixed what made sense

Copy link
Member

@Toti91 Toti91 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@MargretFinnboga MargretFinnboga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good ✨
would recommend breaking this into smaller pr's in the future 👩🏼‍🚀

@jonnigs
Copy link
Member Author

jonnigs commented Oct 16, 2024

👩🏼‍🚀

Totally agree, got a bit carried away!

@jonnigs jonnigs added the automerge Merge this PR as soon as all checks pass label Oct 17, 2024
coderabbitai[bot]
coderabbitai bot previously requested changes Oct 17, 2024
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 6

🧹 Outside diff range and nitpick comments (16)
libs/application/templates/financial-aid/src/fields/index.ts (1)

1-7: Excellent refactoring to named exports!

The changes to named exports for all components are a significant improvement:

  1. Enhanced reusability: Named exports allow for more selective imports, which is beneficial for reuse across different NextJS apps.
  2. Improved tree-shaking: This change facilitates more effective tree-shaking and bundling practices.
  3. Better TypeScript support: While not visible here, named exports typically work well with TypeScript for defining props and exporting types.

The organization of components into subdirectories (ChildrenForm, Summary, Status) also suggests a logical structure that could enhance maintainability.

Consider documenting this export pattern and folder structure in your project guidelines to ensure consistency across the codebase.

libs/application/templates/financial-aid/src/lib/utils/getApplicantsServiceCenter.ts (1)

5-16: LGTM: Well-implemented utility function with a minor suggestion.

The getApplicantsServiceCenter function is well-structured and follows good practices:

  • It uses TypeScript for type safety.
  • It leverages existing utilities like getValueViaPath for data extraction.
  • The function is pure, enhancing testability and predictability.

Consider explicitly handling the case when no service center is found. This could improve clarity and error handling:

export const getApplicantsServiceCenter = (application: Application) => {
  const { externalData } = application
  const municipalityCode = getValueViaPath<string>(
    externalData,
    'nationalRegistry.data.address.municipalityCode',
  )

  const applicantsCenter = serviceCenters.find(
    (serviceCenter) => serviceCenter.number === Number(municipalityCode),
  )
  
  if (!applicantsCenter) {
    console.warn(`No service center found for municipality code: ${municipalityCode}`)
  }
  
  return applicantsCenter
}

This change adds explicit logging when no service center is found, which could be helpful for debugging and monitoring.

libs/application/templates/financial-aid/src/forms/SpouseSubmittedForm/index.ts (1)

11-19: Approved: Form structure looks good with a minor suggestion for improvement

The form structure is well-defined and follows the expected pattern for buildForm. The use of a dynamic logo and the inclusion of child components demonstrate good practices for flexibility and modularity.

To enhance type safety, consider explicitly typing the application parameter in the logo function:

logo: (application: Application) => {
  const logo = createElement(Logo, { application })
  return () => logo
},

This change ensures that the application object conforms to the Application type, reducing the potential for type-related errors.

libs/application/templates/financial-aid/src/fields/CopyUrl/CopyUrl.tsx (4)

Line range hint 4-9: Consider exporting the Props interface.

To improve type safety and reusability when using this component in other parts of the application, consider exporting the Props interface. This would allow other components or files to import and use this type definition if needed.

Apply this change:

-interface Props {
+export interface Props {
   inputLabel: string
   buttonLabel: string
   successMessage: string
 }

Line range hint 3-3: Optimize style imports for better tree-shaking.

Consider using named imports for styles instead of import * as styles. This can potentially improve tree-shaking and reduce bundle size.

Replace the current import with named imports:

-import * as styles from './CopyUrl.css'
+import { buttonWrapper } from './CopyUrl.css'

Then update the usage in the component:

-className={styles.buttonWrapper}
+className={buttonWrapper}

Line range hint 14-27: Consider using the Clipboard API for better compatibility.

The current copyToClipboard function uses document.execCommand('copy'), which is deprecated. Consider using the modern Clipboard API for better compatibility and simplicity. This would also avoid potential issues with server-side rendering.

Here's a suggested implementation:

const copyToClipboard = async (val: string) => {
  try {
    await navigator.clipboard.writeText(val);
    buttonRef.current?.focus();
    toast.success(successMessage);
  } catch (err) {
    console.error('Failed to copy: ', err);
    toast.error('Failed to copy to clipboard');
  }
}

Note: This change requires error handling and might need a fallback for browsers that don't support the Clipboard API.


Line range hint 29-31: Use useEffect with caution in server-side rendering.

The useEffect hook accesses window.location.href, which is not available during server-side rendering. Consider using NextJS's useRouter hook or wrapping this logic in a check for the window object.

Here's a suggested implementation using NextJS's useRouter:

import { useRouter } from 'next/router';

// ...

const router = useRouter();

useEffect(() => {
  if (typeof window !== 'undefined') {
    setCurrentUrl(`${window.location.origin}${router.asPath}`);
  }
}, [router.asPath]);
libs/application/templates/financial-aid/src/fields/Status/ApplicantStatus.tsx (3)

17-23: Improved type safety and code organization

The use of FieldBaseProps and the introduction of getApplicantStatusConstants improve type safety and code organization. This aligns well with our TypeScript usage guidelines.

Consider adding type annotations to the destructured answers and externalData for even better type safety:

const { answers, externalData }: { answers: Answers; externalData: ExternalData } = application;

Replace Answers and ExternalData with the actual types used in your application.


48-50: Improved data access for RejectionMessage

The centralized access to rulesPage, homepage, and email through getApplicantStatusConstants enhances maintainability and reusability. This is a good practice.

Consider defining prop types for the RejectionMessage component to ensure type safety:

type RejectionMessageProps = {
  rejectionComment: string | undefined;
  rulesPage: string;
  homepage: string;
  email: string;
};

This will help catch any potential type mismatches early in the development process.


71-72: Improved spouse step logic in Timeline

The updated condition for showSpouseStep using the hasSpouse function with answers and externalData is a good improvement. It makes the logic more explicit and potentially more accurate.

To further improve readability, consider extracting this logic into a separate variable:

const showSpouseStep = isWaitingForSpouse
  ? hasSpouse(answers, externalData)
  : currentApplication?.spouseNationalId != null;

This would make the JSX cleaner and the logic easier to understand at a glance.

libs/application/templates/financial-aid/src/fields/Summary/SpouseSummaryForm.tsx (1)

Line range hint 1-108: Overall assessment: Significant improvements with one remaining issue

The refactoring of SpouseSummaryForm.tsx has greatly improved code organization, readability, and adherence to coding guidelines. The introduction of getSpouseSummaryConstants and the consistent use of its output throughout the component demonstrate better data management and separation of concerns.

The changes align well with our guidelines for reusability, TypeScript usage, and effective bundling practices. However, there's still one important issue to address:

  • The useEffect hook's dependency array should include userInfo to prevent potential bugs related to stale closures.

Once this issue is resolved, the component will be in excellent shape, showcasing improved maintainability and adherence to best practices.

libs/application/templates/financial-aid/src/fields/Summary/SummaryForm.tsx (2)

39-56: LGTM: Improved state management and data extraction

The introduction of 'answersSchema' with proper typing and the use of 'getSummaryConstants' function significantly improve code organization and type safety. This aligns well with the PR objectives of enhancing maintainability.

Consider adding a brief comment explaining the purpose of 'getSummaryConstants' for better code documentation:

// Extract and process summary-related data from answers and externalData
const {
  homeCircumstances,
  individualAid,
  // ... other extracted values
} = getSummaryConstants(answers, externalData)

59-65: LGTM: Improved aidAmount calculation logic

The updated 'aidAmount' calculation using destructured variables enhances code readability and maintainability. This change aligns well with the PR objectives of improving code organization.

Consider extracting the family status check into a separate variable for better readability:

const isNotCohabitation = findFamilyStatus(answers, externalData) === FamilyStatus.NOT_COHABITATION
return aidCalculator(
  homeCircumstances,
  isNotCohabitation ? individualAid : cohabitationAid
)
libs/application/templates/financial-aid/src/lib/FinancialAidTemplate.ts (2)

19-19: Consider specifying a more precise import path.

The addition of type imports for FinancialAidAnswers and FinancialAidExternalData improves type safety, which is great. However, the import path '..' is vague and could potentially lead to circular dependencies.

Consider updating the import statement to use a more specific path:

import { FinancialAidAnswers, FinancialAidExternalData } from '../types'

Replace '../types' with the actual path to the file containing these type definitions.


265-271: LGTM: Type safety improvements in assignToSpouse action.

The addition of type assertions for 'answers' and 'externalData' enhances type safety. The updated property access using optional chaining improves the robustness of the code. These changes align well with TypeScript best practices.

For improved readability, consider using type assertions with the as keyword instead of unknown:

const answersSchema = answers as FinancialAidAnswers;
const externalDataSchema = externalData as FinancialAidExternalData;

This makes the type assertions more explicit and easier to understand at a glance.

libs/application/templates/financial-aid/src/fields/ChildrenForm/ChildrenForm.tsx (1)

Line range hint 28-45: Avoid calling 'setValue' inside the render function to prevent side effects

Calling setValue within the render loop can cause unexpected side effects and may lead to infinite re-renders. It's recommended to move these calls into a useEffect hook to ensure they're executed appropriately.

Apply this diff to fix the issue:

+ import { useEffect } from 'react'
  
  export const ChildrenForm = ({
    application,
    field,
    errors,
  }: FieldBaseProps) => {
    const { setValue, clearErrors } = useFormContext()
    const { formatMessage } = useLocale()

    const { externalData } = application
    const childrenExternalData = (externalData.childrenCustodyInformation?.data ?? []) as ApplicantChildCustodyInformation[]
    const childrenInfo = sortChildrenUnderAgeByAge(childrenExternalData)

+   useEffect(() => {
+     childrenInfo?.forEach((child, index) => {
+       const fieldIndex = `${field.id}[${index}]`
+       setValue(`${fieldIndex}.livesWithApplicant`, child.livesWithApplicant)
+       setValue(`${fieldIndex}.livesWithBothParents`, child.livesWithBothParents)
+       const nameField = `${fieldIndex}.fullName`
+       const nationalIdField = `${fieldIndex}.nationalId`
+       setValue(nameField, child.fullName)
+       setValue(nationalIdField, child.nationalId)
+     })
+   }, [childrenInfo, field.id, setValue])

    return (
      <>
        {childrenInfo?.map((child, index) => {
          const fieldIndex = `${field.id}[${index}]`

-         setValue(`${fieldIndex}.livesWithApplicant`, child.livesWithApplicant)
-         setValue(
-           `${fieldIndex}.livesWithBothParents`,
-           child.livesWithBothParents,
-         )

          const schoolField = `${fieldIndex}.school`
          const nameField = `${fieldIndex}.fullName`
          const nationalIdField = `${fieldIndex}.nationalId`

-         setValue(nameField, child.fullName)
-         setValue(nationalIdField, child.nationalId)

          const kennitalaInfo = kennitala.info(child.nationalId)
          const birthday = new Date(kennitalaInfo?.birthday)

          return (
            <Box marginBottom={5} key={child.nationalId}>
              {/* ... */}
            </Box>
          )
        })}
      </>
    )
  }
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 8488a51 and 3afe31f.

📒 Files selected for processing (16)
  • libs/application/templates/financial-aid/src/fields/ChildrenForm/ChildrenForm.tsx (2 hunks)
  • libs/application/templates/financial-aid/src/fields/CopyUrl/CopyUrl.tsx (1 hunks)
  • libs/application/templates/financial-aid/src/fields/Status/ApplicantStatus.tsx (3 hunks)
  • libs/application/templates/financial-aid/src/fields/Status/SpouseStatus.tsx (2 hunks)
  • libs/application/templates/financial-aid/src/fields/Status/util.ts (1 hunks)
  • libs/application/templates/financial-aid/src/fields/Summary/MissingFilesConfirmation.tsx (1 hunks)
  • libs/application/templates/financial-aid/src/fields/Summary/SpouseSummaryForm.tsx (3 hunks)
  • libs/application/templates/financial-aid/src/fields/Summary/SummaryForm.tsx (4 hunks)
  • libs/application/templates/financial-aid/src/fields/Summary/utils.ts (1 hunks)
  • libs/application/templates/financial-aid/src/fields/index.ts (1 hunks)
  • libs/application/templates/financial-aid/src/forms/ApplicationForm/confirmationSection/confirmationMultiField.ts (1 hunks)
  • libs/application/templates/financial-aid/src/forms/SpouseForm/spouseTaxReturnFilesSection.ts (1 hunks)
  • libs/application/templates/financial-aid/src/forms/SpouseSubmittedForm/index.ts (1 hunks)
  • libs/application/templates/financial-aid/src/lib/FinancialAidTemplate.ts (12 hunks)
  • libs/application/templates/financial-aid/src/lib/utils.ts (3 hunks)
  • libs/application/templates/financial-aid/src/lib/utils/getApplicantsServiceCenter.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (5)
  • libs/application/templates/financial-aid/src/fields/Status/util.ts
  • libs/application/templates/financial-aid/src/fields/Summary/MissingFilesConfirmation.tsx
  • libs/application/templates/financial-aid/src/fields/Summary/utils.ts
  • libs/application/templates/financial-aid/src/forms/ApplicationForm/confirmationSection/confirmationMultiField.ts
  • libs/application/templates/financial-aid/src/forms/SpouseForm/spouseTaxReturnFilesSection.ts
🧰 Additional context used
📓 Path-based instructions (11)
libs/application/templates/financial-aid/src/fields/ChildrenForm/ChildrenForm.tsx (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/fields/CopyUrl/CopyUrl.tsx (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/fields/Status/ApplicantStatus.tsx (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/fields/Status/SpouseStatus.tsx (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/fields/Summary/SpouseSummaryForm.tsx (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/fields/Summary/SummaryForm.tsx (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/fields/index.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/forms/SpouseSubmittedForm/index.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/lib/FinancialAidTemplate.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/lib/utils.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/templates/financial-aid/src/lib/utils/getApplicantsServiceCenter.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
🔇 Additional comments (35)
libs/application/templates/financial-aid/src/lib/utils/getApplicantsServiceCenter.ts (2)

1-3: LGTM: Imports are well-organized and follow best practices.

The imports are appropriately chosen for the function's requirements. The use of absolute imports enhances readability and maintainability. The separation of concerns is evident, with utilities, types, and data being imported from distinct modules.


1-16: Overall assessment: Well-structured and reusable utility function.

This new utility function getApplicantsServiceCenter is a valuable addition to the codebase:

  • It adheres to the coding guidelines for the libs directory.
  • The function is reusable across different NextJS apps.
  • It effectively uses TypeScript for type safety.
  • The implementation promotes good practices like modularity and separation of concerns.

The function serves its purpose well and integrates smoothly with the existing codebase. The minor suggestion for explicit error handling would further enhance its robustness.

libs/application/templates/financial-aid/src/forms/SpouseSubmittedForm/index.ts (1)

1-19: Overall: Well-structured and compliant with coding guidelines

This file demonstrates good practices in terms of:

  1. Reusability: The form structure allows for easy integration in different NextJS apps.
  2. TypeScript usage: Props and types are well-defined.
  3. Modularity: The form is composed of smaller, focused components.
  4. Adherence to project structure: The file is correctly placed within the libs directory.

The code is clean, well-organized, and follows the expected patterns for the project. It supports effective tree-shaking and bundling practices.

libs/application/templates/financial-aid/src/fields/Status/SpouseStatus.tsx (5)

5-11: Improved modularity and reusability in imports

The changes in import statements reflect a more modular approach, which aligns with our coding guidelines for reusability across different NextJS apps. The components are now imported from more specific paths, enhancing the overall organization of the codebase.


13-13: Enhanced type safety and tree-shaking

The change from FAFieldBaseProps to FieldBaseProps improves type safety and potentially increases reusability. The direct export of the component (export const SpouseStatus) aligns with effective tree-shaking practices, which is in line with our coding guidelines.


14-23: Improved data retrieval with type safety

The use of getValueViaPath for retrieving currentApplicationId, rulesHomepage, and email from externalData enhances type safety and consistency in data access. This change also addresses the previous review comment about the incorrect path for currentApplicationId.


49-50: Enhanced modularity in MoreActions component

The MoreActions component now receives rulesHomepage and email as props instead of accessing the municipality object directly. This change improves modularity and reduces coupling, aligning with our guidelines for creating reusable components.


Line range hint 1-53: Overall improvements in modularity and reusability

The changes in this file significantly enhance the component's modularity, type safety, and reusability. The refactoring aligns well with our coding guidelines for library components, including:

  1. Improved reusability across different NextJS apps
  2. Better TypeScript usage for props and data access
  3. Enhanced tree-shaking practices

These improvements contribute to a more maintainable and efficient codebase.

libs/application/templates/financial-aid/src/fields/CopyUrl/CopyUrl.tsx (2)

11-11: Approve the export change to named export.

The modification from default export to named export is a positive change. It improves consistency with modern JavaScript/TypeScript practices, enhances tree-shaking capabilities, and makes imports more explicit, potentially reducing errors.


Line range hint 2-2: Verify accessibility of Island UI components.

The component uses Island UI components. To ensure reusability across different NextJS apps, please confirm that these components are accessible in other projects where this component might be used.

✅ Verification successful

Island UI components are widely accessible and reusable.

The verification process has confirmed that the Island UI components imported from '@island.is/island-ui/core' are extensively used across various parts of the project. These components appear in numerous files, spanning different applications, templates, and modules within the codebase. This widespread usage indicates that the components are indeed accessible and reusable in other projects where this component might be used, addressing the initial concern about reusability.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check if Island UI components are imported from a shared location

# Test: Search for Island UI import statements
rg --type typescript "from '@island.is/island-ui/core'"

Length of output: 98


Script:

#!/bin/bash
# Description: Check if Island UI components are imported from a shared location

# Test: Search for Island UI import statements in TypeScript and TSX files
rg "from '@island.is/island-ui/core'" --type ts --type tsx

Length of output: 94


Script:

#!/bin/bash
# Description: Check if Island UI components are imported from a shared location

# Test: Search for Island UI import statements in .ts and .tsx files using glob patterns
rg "from '@island.is/island-ui/core'" --glob "*.ts" --glob "*.tsx"

Length of output: 295542

libs/application/templates/financial-aid/src/fields/Status/ApplicantStatus.tsx (3)

6-14: Improved import organization and type usage

The reorganization of imports and the use of FieldBaseProps from @island.is/application/types are positive changes. This structure enhances the reusability of components across different NextJS apps and improves the overall organization of the codebase.


41-41: Improved prop handling for SpouseAlert

The use of showCopyUrl ?? false is a good practice. It provides a default value and handles potential undefined cases, improving the robustness of the component.


Line range hint 1-80: Overall assessment: Improved component structure and reusability

The refactoring of the ApplicantStatus component has significantly improved its structure, maintainability, and potential for reuse across different NextJS apps. Key improvements include:

  1. Better organization of imports and component structure.
  2. Improved type safety with the use of FieldBaseProps and consistent TypeScript usage.
  3. Enhanced data access and prop handling through the getApplicantStatusConstants utility function.
  4. More explicit and potentially more accurate logic for spouse-related functionality.

These changes align well with the coding guidelines for library files, particularly in terms of reusability, TypeScript usage, and maintainability. The component now presents a cleaner, more modular structure that should facilitate easier maintenance and potential future enhancements.

libs/application/templates/financial-aid/src/fields/Summary/SpouseSummaryForm.tsx (8)

5-5: LGTM: Improved imports and type usage

The updated imports demonstrate better organization and separation of concerns. The use of FieldBaseProps from '@island.is/application/types' aligns with our TypeScript usage guidelines, enhancing type safety and potential reusability across different NextJS apps.

Also applies to: 9-17


20-23: LGTM: Improved component declaration

The direct export of the component and the use of FieldBaseProps enhance tree-shaking capabilities and type safety, respectively. These changes align well with our coding guidelines for effective bundling practices and TypeScript usage.


31-34: Include 'userInfo' in the 'useEffect' dependency array

This issue was previously identified and still needs to be addressed. The useEffect hook depends on userInfo, but it's not included in the dependency array. This could cause issues if userInfo changes after the initial render.

Apply the following diff to include userInfo in the dependency array:

 useEffect(() => {
     setValue('spouseName', userInfo?.profile.name)
-}, [])
+}, [userInfo])

36-49: LGTM: Improved data extraction

The use of getSpouseSummaryConstants to extract multiple constants is a good refactoring. It centralizes the logic for data extraction, improving code organization and readability. This change enhances the maintainability of the component.


60-60: LGTM: Simplified address prop

The change to use data directly for the address prop aligns well with the new data structure provided by getSpouseSummaryConstants. This simplification improves readability and maintains consistency with the refactored data extraction.


69-69: LGTM: Improved prop passing for DirectTaxPaymentCell

The use of taxData instead of externalData.taxDataSpouse for the DirectTaxPaymentCell props aligns well with the new data structure. This change simplifies prop passing and improves code readability, consistent with the overall refactoring approach.

Also applies to: 72-72


79-80: LGTM: Corrected variable names for ContactInfo props

The typo in variable names for email and phone props has been corrected as previously suggested. The use of spouseEmail and spousePhone aligns with the new data structure and naming conventions, resolving the potential reference errors.


85-89: LGTM: Improved prop passing for Files and SummaryComment

The changes to the Files and SummaryComment components demonstrate improved prop passing. The use of more specific props from the extracted constants for the Files component and the direct use of spouseFormComment for the SummaryComment component align well with the new data structure. These changes enhance code readability and maintain consistency with the overall refactoring approach.

Also applies to: 96-96

libs/application/templates/financial-aid/src/fields/Summary/SummaryForm.tsx (6)

20-32: LGTM: Import statements reorganized for better modularity

The changes to the import statements align well with the PR objectives of reorganizing custom components and improving modularity. The use of TypeScript for importing types (FieldBaseProps, AnswersSchema) adheres to the coding guidelines and supports better type safety.


34-34: LGTM: Component signature updated for consistency and better tree-shaking

The change from 'FAFieldBaseProps' to 'FieldBaseProps' aligns with the project's goal of reducing dependency on custom components. Using a named export instead of a default export can improve tree-shaking, which is in line with the coding guidelines for effective bundling practices.


71-73: LGTM: Simplified condition for children aid alert

The simplified condition for showing the alert message about children aid improves code readability and maintainability. The use of destructured variables 'childrenCustodyData' and 'childrenAid' aligns well with the overall code structure improvements mentioned in the PR objectives.


151-153: LGTM: Improved null safety for UserInfo props

The use of optional chaining with 'nationalRegistryData' improves null safety when passing props to the UserInfo component. This change aligns well with TypeScript best practices.

Note: There's an existing comment about potential undefined 'nationalRegistryData' in 'formatAddress'. Please address that comment to ensure full null safety.


156-160: LGTM: Improved ChildrenInfo rendering logic and props

The updated condition for rendering ChildrenInfo and the addition of the 'childrenComment' prop improve the component's flexibility and type safety. The use of optional chaining with 'answersSchema?.childrenComment' enhances null safety, aligning well with TypeScript best practices.


183-193: LGTM: Improved Files component props with better null safety

The updates to the Files component props, including the use of 'findFilesRouteFrom' function and the addition of optional chaining and nullish coalescing operators, significantly improve null safety and align well with TypeScript best practices.

Note: There's an existing comment about ensuring 'income.type' is defined. Please address that comment to prevent potential runtime errors.

libs/application/templates/financial-aid/src/lib/FinancialAidTemplate.ts (5)

15-15: LGTM: Typo correction in function name.

The function name has been correctly updated from isMuncipalityNotRegistered to isMunicipalityNotRegistered. This change improves code consistency and prevents potential runtime errors.


65-66: LGTM: Import path and module name updated.

The import path and module name have been updated to reflect the new file structure and naming convention. This change improves code organization and clarity, supporting better reusability across different NextJS apps.


84-85: LGTM: State name and condition function corrected.

The state name has been properly updated from 'MUNCIPALITYNOTREGISTERED' to 'MUNICIPALITYNOTREGISTERED', and the condition function name has been corrected to 'isMunicipalityNotRegistered'. These changes improve consistency and prevent potential runtime errors.


109-110: LGTM: Import path and module name updated for ApplicationForm.

The import path and module name have been updated to reflect the new file structure and naming convention. This change improves code organization and clarity, supporting better reusability across different NextJS apps.


250-253: LGTM: Import path updated for MunicipalityNotRegistered.

The import path for the MunicipalityNotRegistered component has been correctly updated to reflect the new file structure. This change improves code organization and supports better reusability across different NextJS apps. The typo mentioned in the past review comment has been successfully addressed.

libs/application/templates/financial-aid/src/lib/utils.ts (3)

33-33: Improved type safety in hasSpouseCheck

The casting of context.application has been removed, enhancing type safety and code clarity.


91-92: Resolved type safety issue in hasFiles function

The hasFiles function now accepts AnswersSchema directly, eliminating the need for unsafe type casting and improving type safety.


114-126: Refactored hasSpouse function for clarity and type safety

The hasSpouse function now accepts FormValue and ExternalData directly, improving readability and ensuring proper type usage. The logic correctly determines if the applicant has a spouse.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Outside diff range and nitpick comments (2)
libs/application/core/src/lib/fieldBuilders.ts (2)

454-478: LGTM! Consider using extractCommonFields for consistency.

The buildAccordionField function is well-implemented and follows the established pattern for field builders. It properly uses TypeScript for type safety and is exported for reusability across different NextJS apps.

For consistency with other field builders, consider using the extractCommonFields helper function. This would handle common properties like id, title, condition, etc. Here's a suggested refactor:

 export const buildAccordionField = (
   data: Omit<AccordionField, 'type' | 'component' | 'children'>,
 ): AccordionField => {
-  const {
-    accordionItems,
-    title,
-    titleVariant,
-    id,
-    marginTop,
-    marginBottom,
-    condition,
-  } = data
+  const { accordionItems, titleVariant } = data
   return {
+    ...extractCommonFields(data),
     children: undefined,
-    id,
-    title,
     titleVariant,
-    marginTop,
-    marginBottom,
     accordionItems,
-    condition,
     type: FieldTypes.ACCORDION,
     component: FieldComponents.ACCORDION,
   }
 }

This change would make the function more consistent with other field builders and reduce the risk of missing common fields in future updates.


480-495: Refactor to use extractCommonFields for consistency

The buildBankAccountField function is well-implemented and follows the established pattern for field builders. It properly uses TypeScript for type safety and is exported for reusability across different NextJS apps.

To maintain consistency with other field builders and ensure all common fields are handled, refactor the function to use the extractCommonFields helper function. Here's a suggested implementation:

 export const buildBankAccountField = (
   data: Omit<BankAccountField, 'type' | 'component' | 'children'>,
 ): BankAccountField => {
-  const { title, id, marginBottom, marginTop, titleVariant } = data
+  const { titleVariant } = data
 
   return {
+    ...extractCommonFields(data),
     children: undefined,
-    id,
-    title,
-    marginBottom,
-    marginTop,
     titleVariant,
     type: FieldTypes.BANK_ACCOUNT,
     component: FieldComponents.BANK_ACCOUNT,
   }
 }

This refactoring ensures that all common fields (such as id, title, condition, etc.) are consistently handled across all field builders, reducing the risk of missing important properties in future updates.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 3afe31f and 0ca4f15.

📒 Files selected for processing (2)
  • libs/application/core/src/lib/fieldBuilders.ts (2 hunks)
  • libs/application/types/src/lib/Fields.ts (4 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
libs/application/core/src/lib/fieldBuilders.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
libs/application/types/src/lib/Fields.ts (1)

Pattern libs/**/*: "Confirm that the code adheres to the following:

  • Reusability of components and hooks across different NextJS apps.
  • TypeScript usage for defining props and exporting types.
  • Effective tree-shaking and bundling practices."
🔇 Additional comments (6)
libs/application/types/src/lib/Fields.ts (6)

235-236: FieldTypes enum updated with new field types.

The addition of ACCORDION and BANK_ACCOUNT to FieldTypes aligns with the existing enum structure and maintains consistency.


269-270: FieldComponents enum updated with new components.

Adding ACCORDION and BANK_ACCOUNT to FieldComponents follows the established naming conventions and ensures the new components are correctly referenced.


521-524: AccordionItem type definition is appropriate.

The AccordionItem type correctly defines the structure for accordion items with itemTitle and itemContent as FormText, promoting consistency and reusability.


526-535: AccordionField interface is well-defined.

The AccordionField interface extends BaseField, correctly specifies the type and component, and includes the required accordionItems property along with optional styling properties. This adheres to the TypeScript usage guidelines and enhances component reusability.


537-543: BankAccountField interface properly extends BaseField.

The BankAccountField interface appropriately specifies the type and component, and includes optional styling properties. This definition supports the creation of a bank account input field and aligns with the codebase conventions.


755-756: Field union type updated with new field interfaces.

Including AccordionField and BankAccountField in the Field union type ensures that these new fields are recognized throughout the application, maintaining type safety and consistency.

@kodiakhq kodiakhq bot merged commit 18b87eb into main Oct 17, 2024
330 of 335 checks passed
@kodiakhq kodiakhq bot deleted the feat/custom-components-financial-aid branch October 17, 2024 11:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge Merge this PR as soon as all checks pass deploy-feature Deploys features to dev
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants