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

feat(new-primary-school): Implement allergies and intolerances page #17477

Merged

Conversation

veronikasif
Copy link
Member

@veronikasif veronikasif commented Jan 13, 2025

[TS-950] Implement allergies and intolerances page

What

Specify what you're trying to achieve

Why

Specify why you need to achieve this

Screenshots / Gifs

Attach Screenshots / Gifs to help reviewers understand the scope of the pull request

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

    • Added comprehensive allergies and intolerances section to the primary school application form.
    • Introduced detailed tracking of food allergies, other allergies, and medical conditions.
    • Enhanced form with options for EpiPen usage and medication assistance.
    • Included a new component to display allergies and intolerances within the review context.
  • Bug Fixes

    • Improved data validation for allergy-related information.
  • Documentation

    • Added localized messages for allergies and intolerances section.
    • Created clear guidance for reporting medical conditions and allergies.

@veronikasif veronikasif requested a review from a team as a code owner January 13, 2025 13:55
Copy link
Contributor

coderabbitai bot commented Jan 13, 2025

Walkthrough

This pull request introduces enhancements to the new primary school application template, focusing on managing allergies and intolerances. The changes span multiple files, including updates to Jest configuration, form structures, data schemas, message definitions, and review components. A new subsection for capturing detailed health-related information has been added, alongside a new component for displaying allergies and intolerances. These modifications ensure comprehensive data collection regarding food allergies, other allergies, medical conditions, and medication requirements.

Changes

File Change Summary
libs/application/templates/new-primary-school/jest.config.ts Updated coverage directory and display name for new primary school template
libs/application/templates/new-primary-school/src/fields/FriggOptionsAsyncSelectField/index.tsx Added marginBottom property to field object
libs/application/templates/new-primary-school/src/fields/Review/index.tsx Added AllergiesAndIntolerances component, removed School component import
libs/application/templates/new-primary-school/src/fields/Review/review-groups/AllergiesAndIntolerances.tsx New component for displaying allergies and intolerances information
libs/application/templates/new-primary-school/src/forms/NewPrimarySchoolForm/differentNeedsSection/allergiesAndIntolerancesSubSection.ts New subsection for allergies and intolerances in form
libs/application/templates/new-primary-school/src/forms/NewPrimarySchoolForm/differentNeedsSection/index.ts Updated section children to include allergies subsection
libs/application/templates/new-primary-school/src/lib/NewPrimarySchoolTemplate.ts Added clearAllergiesAndIntolerances action
libs/application/templates/new-primary-school/src/lib/dataSchema.ts Added allergiesAndIntolerances schema with validation rules
libs/application/templates/new-primary-school/src/lib/messages.ts Added new message descriptors for allergies and intolerances
libs/application/templates/new-primary-school/src/lib/newPrimarySchoolUtils.ts Enhanced getApplicationAnswers with new allergy-related variables

Sequence Diagram

sequenceDiagram
    participant User
    participant Form
    participant AllergiesSection
    participant DataValidation
    participant Review

    User->>Form: Starts application
    Form->>AllergiesSection: Presents allergies questions
    User->>AllergiesSection: Provides allergy details
    AllergiesSection->>DataValidation: Validate inputs
    DataValidation-->>AllergiesSection: Validate success
    AllergiesSection->>Form: Save allergy information
    Form->>Review: Display review section
    Review->>Review: Render AllergiesAndIntolerances component
Loading

Possibly related PRs

Suggested Labels

deploy-feature

Suggested Reviewers

  • Toti91

📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 448078d and 4b84a70.

📒 Files selected for processing (2)
  • libs/application/templates/new-primary-school/src/lib/NewPrimarySchoolTemplate.ts (3 hunks)
  • libs/application/templates/new-primary-school/src/lib/messages.ts (3 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
libs/application/templates/new-primary-school/src/lib/NewPrimarySchoolTemplate.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/new-primary-school/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 (4)
libs/application/templates/new-primary-school/src/lib/NewPrimarySchoolTemplate.ts (2)

96-96: LGTM!

The clearAllergiesAndIntolerances action is correctly added to the exit array of the States.DRAFT state to ensure proper cleanup of allergy-related answers when leaving the draft state.


228-249: LGTM!

The clearAllergiesAndIntolerances action is well-implemented with:

  • Proper handling of undefined values using optional chaining.
  • Correct cleanup logic for food allergies, other allergies, and epi-pen usage based on user responses.
libs/application/templates/new-primary-school/src/lib/messages.ts (2)

467-551: LGTM!

The allergies and intolerances messages are well-structured with:

  • Comprehensive coverage of all allergy-related aspects.
  • Clear and descriptive message content.
  • Consistent naming conventions.
  • Unique message IDs.

759-768: LGTM!

The error messages for allergies and intolerances are well-defined with:

  • Clear validation error messages.
  • Consistent naming conventions.
  • Unique message IDs.

Finishing Touches

  • 📝 Generate Docstrings (Beta)

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

codecov bot commented Jan 13, 2025

Codecov Report

Attention: Patch coverage is 24.05063% with 60 lines in your changes missing coverage. Please review.

Project coverage is 35.62%. Comparing base (b7a971d) to head (cab802e).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
.../Review/review-groups/AllergiesAndIntolerances.tsx 0.00% 26 Missing ⚠️
...NeedsSection/allergiesAndIntolerancesSubSection.ts 0.00% 22 Missing ⚠️
...templates/new-primary-school/src/lib/dataSchema.ts 0.00% 11 Missing ⚠️
.../src/fields/FriggOptionsAsyncSelectField/index.tsx 0.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #17477      +/-   ##
==========================================
- Coverage   35.65%   35.62%   -0.04%     
==========================================
  Files        6979     7011      +32     
  Lines      149841   150204     +363     
  Branches    42836    42953     +117     
==========================================
+ Hits        53427    53510      +83     
- Misses      96414    96694     +280     
Flag Coverage Δ
api 3.33% <ø> (ø)
application-system-api 38.71% <0.00%> (-0.03%) ⬇️
application-template-api-modules 27.54% <ø> (-0.02%) ⬇️
application-templates-new-primary-school 21.07% <24.05%> (?)
application-ui-shell 22.19% <ø> (ø)

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

Files with missing lines Coverage Δ
...tes/new-primary-school/src/fields/Review/index.tsx 0.00% <ø> (ø)
...ewPrimarySchoolForm/differentNeedsSection/index.ts 0.00% <ø> (ø)
...primary-school/src/lib/NewPrimarySchoolTemplate.ts 71.42% <100.00%> (+47.42%) ⬆️
...n/templates/new-primary-school/src/lib/messages.ts 100.00% <ø> (ø)
...ew-primary-school/src/lib/newPrimarySchoolUtils.ts 70.65% <100.00%> (+55.35%) ⬆️
.../src/fields/FriggOptionsAsyncSelectField/index.tsx 0.00% <0.00%> (ø)
...templates/new-primary-school/src/lib/dataSchema.ts 18.75% <0.00%> (-5.58%) ⬇️
...NeedsSection/allergiesAndIntolerancesSubSection.ts 0.00% <0.00%> (ø)
.../Review/review-groups/AllergiesAndIntolerances.tsx 0.00% <0.00%> (ø)

... and 45 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 b7a971d...cab802e. Read the comment docs.

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: 8

🔭 Outside diff range comments (1)
libs/application/templates/new-primary-school/src/fields/FriggOptionsAsyncSelectField/index.tsx (1)

Line range hint 16-23: Add type definition for marginBottom prop.

The marginBottom prop is used but not defined in the FriggOptionsAsyncSelectFieldProps interface.

Apply this diff:

 type FriggOptionsAsyncSelectFieldProps = {
   field: {
     props: {
       optionsType: OptionsType
       placeholder: FormText
       isMulti?: boolean
-    }
+    }
+    marginBottom?: number | string
   }
 }
🧹 Nitpick comments (8)
libs/application/templates/new-primary-school/src/fields/FriggOptionsAsyncSelectField/index.tsx (1)

Line range hint 25-89: Consider memoizing the component for better performance.

Since this component handles async operations and potentially frequent re-renders due to form updates, consider using React.memo to prevent unnecessary re-renders.

Apply this diff:

-const FriggOptionsAsyncSelectField: FC<
+const FriggOptionsAsyncSelectField: FC<
   React.PropsWithChildren<FieldBaseProps & FriggOptionsAsyncSelectFieldProps>
 > = ({ error, field, application }) => {
   // ... component implementation
 }

-export default FriggOptionsAsyncSelectField
+export default React.memo(FriggOptionsAsyncSelectField)
libs/application/templates/new-primary-school/src/fields/Review/review-groups/AllergiesAndIntolerances.tsx (2)

58-62: Simplify loading state condition.

The loading state check can be simplified for better readability.

Apply this diff:

-        {(hasFoodAllergiesOrIntolerances.includes(YES) ||
-          hasOtherAllergies.includes(YES)) &&
-        (foodAllergiesOrIntolerancesLoading || otherAllergiesLoading) ? (
+        {((hasFoodAllergiesOrIntolerances.includes(YES) && foodAllergiesOrIntolerancesLoading) ||
+          (hasOtherAllergies.includes(YES) && otherAllergiesLoading)) ? (

80-84: Enhance error messages with specific details.

The error messages could be more specific about which data provider failed.

Apply this diff:

                     error={
                       foodAllergiesOrIntolerancesError
-                        ? formatMessage(coreErrorMessages.failedDataProvider)
+                        ? formatMessage(
+                            { id: coreErrorMessages.failedDataProvider.id },
+                            { provider: 'food allergies' }
+                          )
                         : undefined
                     }

And similarly for otherAllergiesError:

                     error={
                       otherAllergiesError
-                        ? formatMessage(coreErrorMessages.failedDataProvider)
+                        ? formatMessage(
+                            { id: coreErrorMessages.failedDataProvider.id },
+                            { provider: 'other allergies' }
+                          )
                         : undefined
                     }

Also applies to: 104-108

libs/application/templates/new-primary-school/src/lib/dataSchema.ts (1)

157-195: Add type safety for allergy-related data.

Consider adding TypeScript types for the allergy-related values to improve type safety and developer experience.

+ export type AllergiesAndIntolerances = {
+   hasFoodAllergiesOrIntolerances: string[]
+   foodAllergiesOrIntolerances?: string[]
+   hasOtherAllergies: string[]
+   otherAllergies?: string[]
+   usesEpiPen?: string
+   hasConfirmedMedicalDiagnoses: 'YES' | 'NO'
+   requestMedicationAssistance: 'YES' | 'NO'
+ }
libs/application/templates/new-primary-school/src/forms/NewPrimarySchoolForm/differentNeedsSection/allergiesAndIntolerancesSubSection.ts (2)

48-49: Consider adding aria-label for accessibility.

The FriggOptionsAsyncSelectField should include an aria-label for better accessibility.

   component: 'FriggOptionsAsyncSelectField',
   marginBottom: 3,
+  ariaLabel: newPrimarySchoolMessages.differentNeeds.typeOfFoodAllergiesOrIntolerancesAriaLabel,

95-113: Enhance alert message visibility conditions.

The alert message visibility condition could be simplified for better maintainability.

-  condition: (answers) => {
-    const { hasFoodAllergiesOrIntolerances, hasOtherAllergies } =
-      getApplicationAnswers(answers)
-
-    return (
-      hasFoodAllergiesOrIntolerances?.includes(YES) ||
-      hasOtherAllergies?.includes(YES)
-    )
-  },
+  condition: (answers) => {
+    const { hasFoodAllergiesOrIntolerances, hasOtherAllergies } =
+      getApplicationAnswers(answers)
+    return [hasFoodAllergiesOrIntolerances, hasOtherAllergies]
+      .some(arr => arr?.includes(YES))
+  },
libs/application/templates/new-primary-school/src/lib/newPrimarySchoolUtils.ts (1)

165-171: Group related properties in the return object.

Consider grouping allergy-related properties into a nested object for better organization.

   return {
     // ... other properties
-    hasFoodAllergiesOrIntolerances,
-    foodAllergiesOrIntolerances,
-    hasOtherAllergies,
-    otherAllergies,
-    usesEpiPen,
-    hasConfirmedMedicalDiagnoses,
-    requestMedicationAssistance,
+    allergies: {
+      hasFoodAllergiesOrIntolerances,
+      foodAllergiesOrIntolerances,
+      hasOtherAllergies,
+      otherAllergies,
+      usesEpiPen,
+      hasConfirmedMedicalDiagnoses,
+      requestMedicationAssistance,
+    },
     // ... rest of the properties
   }
libs/application/templates/new-primary-school/src/lib/messages.ts (1)

467-551: Consider adding a free-text field for additional allergy details.

The allergies section is well-structured, but it might be beneficial to add messages for a free-text field where parents can provide additional important details about their child's allergies or specific instructions for handling allergic reactions.

Add these message descriptors:

+ allergyAdditionalDetails: {
+   id: 'nps.application:different.needs.allergies.and.intolerances.additional.details',
+   defaultMessage: 'Nánari upplýsingar um ofnæmi',
+   description: 'Additional details about allergies',
+ },
+ allergyAdditionalDetailsPlaceholder: {
+   id: 'nps.application:different.needs.allergies.and.intolerances.additional.details.placeholder',
+   defaultMessage: 'T.d. upplýsingar um alvarleika ofnæmis eða sérstök fyrirmæli',
+   description: 'E.g., information about allergy severity or special instructions',
+ },
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3849d14 and 448078d.

📒 Files selected for processing (10)
  • libs/application/templates/new-primary-school/jest.config.ts (1 hunks)
  • libs/application/templates/new-primary-school/src/fields/FriggOptionsAsyncSelectField/index.tsx (2 hunks)
  • libs/application/templates/new-primary-school/src/fields/Review/index.tsx (2 hunks)
  • libs/application/templates/new-primary-school/src/fields/Review/review-groups/AllergiesAndIntolerances.tsx (1 hunks)
  • libs/application/templates/new-primary-school/src/forms/NewPrimarySchoolForm/differentNeedsSection/allergiesAndIntolerancesSubSection.ts (1 hunks)
  • libs/application/templates/new-primary-school/src/forms/NewPrimarySchoolForm/differentNeedsSection/index.ts (2 hunks)
  • libs/application/templates/new-primary-school/src/lib/NewPrimarySchoolTemplate.ts (3 hunks)
  • libs/application/templates/new-primary-school/src/lib/dataSchema.ts (1 hunks)
  • libs/application/templates/new-primary-school/src/lib/messages.ts (3 hunks)
  • libs/application/templates/new-primary-school/src/lib/newPrimarySchoolUtils.ts (2 hunks)
✅ Files skipped from review due to trivial changes (1)
  • libs/application/templates/new-primary-school/jest.config.ts
🧰 Additional context used
📓 Path-based instructions (9)
libs/application/templates/new-primary-school/src/fields/FriggOptionsAsyncSelectField/index.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/new-primary-school/src/forms/NewPrimarySchoolForm/differentNeedsSection/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/new-primary-school/src/lib/newPrimarySchoolUtils.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/new-primary-school/src/lib/NewPrimarySchoolTemplate.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/new-primary-school/src/fields/Review/review-groups/AllergiesAndIntolerances.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/new-primary-school/src/forms/NewPrimarySchoolForm/differentNeedsSection/allergiesAndIntolerancesSubSection.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/new-primary-school/src/fields/Review/index.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/new-primary-school/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/new-primary-school/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."
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: build (web)
  • GitHub Check: tests (judicial-system-backend)
🔇 Additional comments (3)
libs/application/templates/new-primary-school/src/forms/NewPrimarySchoolForm/differentNeedsSection/index.ts (1)

17-21: LGTM! Well-structured section configuration.

The changes maintain modularity and follow the established pattern for section configuration.

libs/application/templates/new-primary-school/src/fields/Review/index.tsx (1)

169-171: LGTM! Proper component integration.

The AllergiesAndIntolerances component is correctly integrated with consistent props passing and conditional rendering.

libs/application/templates/new-primary-school/src/lib/messages.ts (1)

759-768: LGTM! Error messages are clear and well-structured.

The error messages for allergy-related validations are properly defined and provide clear feedback to users.

@datadog-island-is
Copy link

datadog-island-is bot commented Jan 13, 2025

Datadog Report

All test runs a0bb56b 🔗

4 Total Test Services: 0 Failed, 4 Passed
🔻 Test Sessions change in coverage: 1 decreased (-0.01%), 1 increased (+0.58%), 6 no change

Test Services
Service Name Failed Known Flaky New Flaky Passed Skipped Total Time Code Coverage Change Test Service View
api 0 0 0 4 0 2.75s 1 no change Link
application-system-api 0 0 0 46 0 2m 12.37s 1 decreased (-0.01%) Link
application-template-api-modules 0 0 0 118 0 2m 35.4s 1 no change Link
application-ui-shell 0 0 0 74 0 36.22s 1 no change Link

🔻 Code Coverage Decreases vs Default Branch (1)

  • application-system-api - jest 35.58% (-0.01%) - Details

@veronikasif veronikasif changed the title feat(new-primary-school) Implement allergies and intolerances page feat(new-primary-school): Implement allergies and intolerances page Jan 13, 2025
Copy link
Member

@helgifr helgifr left a comment

Choose a reason for hiding this comment

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

LGTM

@veronikasif veronikasif added the deprecated:automerge (Disabled) Merge this PR as soon as all checks pass label Jan 13, 2025
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

🧹 Nitpick comments (1)
libs/application/templates/new-primary-school/src/lib/messages.ts (1)

Line range hint 1-768: Consider extracting common health-related messages.

Since this is in the libs directory, consider extracting common health-related messages (allergies, medical conditions) into a shared message file. This would improve reusability across different application templates that need to collect health information.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 448078d and 4b84a70.

📒 Files selected for processing (2)
  • libs/application/templates/new-primary-school/src/lib/NewPrimarySchoolTemplate.ts (3 hunks)
  • libs/application/templates/new-primary-school/src/lib/messages.ts (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • libs/application/templates/new-primary-school/src/lib/NewPrimarySchoolTemplate.ts
🧰 Additional context used
📓 Path-based instructions (1)
libs/application/templates/new-primary-school/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 (3)
libs/application/templates/new-primary-school/src/lib/messages.ts (3)

467-551: LGTM! Well-structured messages for allergies and intolerances section.

The messages are comprehensive, well-organized, and follow consistent naming patterns. The descriptions are clear and helpful for translators.


671-675: Fix duplicate message ID for EpiPen usage.

There's a duplicate message ID 'nps.application:overview.uses.epi.pen' used for both 'usesEpiPen' and a previous message. This will cause conflicts in the internationalization system.


759-768: LGTM! Well-defined error messages.

The error messages are clear, user-friendly, and follow the established pattern for validation errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deprecated:automerge (Disabled) Merge this PR as soon as all checks pass
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants