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(driving-license): minor text changes #16186

Merged
merged 7 commits into from
Sep 27, 2024
Merged

Conversation

stjanilofts
Copy link
Member

@stjanilofts stjanilofts commented Sep 27, 2024

Screenshot 2024-09-27 at 10 37 02

Text in red will be removed from contentful once this PR is out

Summary by CodeRabbit

  • New Features

    • Introduced a new description field in the digital license information form for additional user guidance.
    • Added a constant for mail delivery pricing to enhance pricing calculations based on pickup methods.
  • Bug Fixes

    • Updated logic for price calculations to ensure accurate pricing based on user selections.
  • Documentation

    • Revised default messages for health declarations to provide clearer instructions in Icelandic, including new guidance for digital driving licenses.

@stjanilofts stjanilofts requested a review from a team as a code owner September 27, 2024 10:38
Copy link
Contributor

coderabbitai bot commented Sep 27, 2024

Walkthrough

The changes involve updates to the driving license application, specifically enhancing the logic for price calculations in the subSectionSummary function, adding a new description field in the digital license information section, introducing a new constant for mail delivery pricing, and modifying messages related to health declarations and digital licenses. These updates aim to improve the user interface and functionality of the application.

Changes

File Change Summary
libs/application/templates/driving-license/src/forms/draft/subSectionSummary.ts Updated price calculation logic to include MAIL_DELIVERY_PRICE based on pickup method.
libs/application/templates/driving-license/src/forms/prerequisites/sectionDigitalLicenseInfo.ts Added a new description field with ID extraInfo to provide additional information related to digital licenses.
libs/application/templates/driving-license/src/lib/constants.ts Introduced a new constant MAIL_DELIVERY_PRICE with a value of 290.
libs/application/templates/driving-license/src/lib/messages.ts Updated several health declaration messages and added a new message for digital license information.

Possibly related PRs

Suggested reviewers

  • kksteini
  • albinagu

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 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.

@stjanilofts stjanilofts added the automerge Merge this PR as soon as all checks pass label Sep 27, 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: 1

🧹 Outside diff range and nitpick comments (4)
libs/application/templates/driving-license/src/forms/prerequisites/sectionDigitalLicenseInfo.ts (1)

28-33: LGTM: New description field added correctly.

The addition of the new buildDescriptionField is well-structured and aligns with the PR objectives to provide extra information about digital licenses. It follows the existing code patterns and uses proper internationalization.

Consider adding a comment explaining the purpose of this extra information field, especially since it doesn't have a title. This would improve code readability and maintainability.

+        // Additional information about digital licenses
         buildDescriptionField({
           id: 'extraInfo',
           title: '',
           marginTop: 2,
           description: m.digitalLicenseInfoAlertMessageExtraInfo,
         }),
libs/application/templates/driving-license/src/forms/draft/subSectionSummary.ts (2)

185-191: Consider removing commented out console.log statement.

While debugging statements can be useful during development, it's generally a good practice to remove them before merging to production. If this console.log is intentionally left for future debugging, consider adding a comment explaining why it's kept or move it to a dedicated debugging function that can be easily enabled/disabled.


193-200: LGTM! Good improvements to price calculation logic.

The new price calculation logic is more robust and correctly implements the additional charge for mail delivery. It aligns well with TypeScript best practices and improves the overall reliability of the code.

For even better clarity, consider using a descriptive variable name instead of price. For example:

let totalPrice = typeof item?.priceAmount === 'number' ? item.priceAmount : 0

if (answers.pickup === Pickup.POST) {
  totalPrice += MAIL_DELIVERY_PRICE
}

This minor change would make the purpose of the variable more explicit.

libs/application/templates/driving-license/src/lib/messages.ts (1)

489-494: LGTM: Informative addition for digital driving licenses.

The new digitalLicenseInfoAlertMessageExtraInfo message provides valuable information about digital driving licenses, including a link for more details. The use of markdown formatting for the URL is appropriate.

Consider using a more descriptive link text instead of the full URL:

-      'Upplýsingar um stafrænt ökuskírteini, hvernig þú sækir það og hleður því í símannn þinn eru aðgengilegar hér [https://island.is/okuskirteini](https://island.is/okuskirteini)',
+      'Upplýsingar um stafrænt ökuskírteini, hvernig þú sækir það og hleður því í símannn þinn eru aðgengilegar [hér](https://island.is/okuskirteini)',

This change would improve readability while maintaining the link functionality.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 3a56c8c and 42153b5.

📒 Files selected for processing (4)
  • libs/application/templates/driving-license/src/forms/draft/subSectionSummary.ts (2 hunks)
  • libs/application/templates/driving-license/src/forms/prerequisites/sectionDigitalLicenseInfo.ts (2 hunks)
  • libs/application/templates/driving-license/src/lib/constants.ts (1 hunks)
  • libs/application/templates/driving-license/src/lib/messages.ts (2 hunks)
🧰 Additional context used
📓 Path-based instructions (4)
libs/application/templates/driving-license/src/forms/draft/subSectionSummary.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/driving-license/src/forms/prerequisites/sectionDigitalLicenseInfo.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/driving-license/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/driving-license/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 (7)
libs/application/templates/driving-license/src/forms/prerequisites/sectionDigitalLicenseInfo.ts (2)

3-3: LGTM: Import statement addition is appropriate.

The addition of buildDescriptionField to the import statement is consistent with the existing code style and supports the new field being added. This change promotes reusability across different NextJS apps, which aligns with our coding guidelines.


Line range hint 1-33: Coding guidelines compliance confirmed.

The changes in this file adhere to the coding guidelines for libs/**/*:

  1. Reusability: The code uses shared components (buildDescriptionField) and internationalization (m.digitalLicenseInfoAlertMessageExtraInfo), promoting reusability across different NextJS apps.
  2. TypeScript usage: The code utilizes TypeScript for defining props and types.
  3. Tree-shaking and bundling: The structure of the code, using individual build functions, supports effective tree-shaking and bundling practices.
libs/application/templates/driving-license/src/lib/constants.ts (1)

Line range hint 1-61: The changes adhere to coding guidelines and support good practices.

The addition of the MAIL_DELIVERY_PRICE constant aligns well with the coding guidelines for files in the libs directory:

  1. Reusability: The constant is exported, allowing for reuse across different NextJS apps that deal with driving license applications.

  2. TypeScript usage: The file consistently uses TypeScript for defining types and interfaces, which is maintained with this addition.

  3. Tree-shaking: The constant is individually exported, which supports effective tree-shaking and bundling practices. Unused exports can be easily eliminated by bundlers.

The change has a minimal impact on the existing code structure while extending the available constants for driving license-related functionality. This approach maintains the file's organization and purpose.

libs/application/templates/driving-license/src/forms/draft/subSectionSummary.ts (1)

16-23: LGTM! Good use of constants for improved maintainability.

The addition of specific imports from the constants file is a good practice. It enhances code readability, maintainability, and supports effective tree-shaking. This approach aligns well with the coding guidelines for reusability and effective bundling practices.

libs/application/templates/driving-license/src/lib/messages.ts (3)

125-125: LGTM: Consistent terminology update.

The change from 'Heilbrigðisyfirlýsing' (Health Declaration) to 'Læknisvottorð' (Medical Certificate) is consistent across both healthDeclarationSectionTitle and healthDeclarationMultiFieldTitle. This update likely improves clarity or accuracy in the application process.

Also applies to: 130-130


136-137: LGTM: Improved user guidance for medical certificate submission.

The healthDeclarationMultiField65Description has been significantly updated with detailed instructions in Icelandic. The new text provides specific guidance on submitting a medical certificate for renewing a driving license, including the requirement for a certificate from a general practitioner and the process for submitting it to the chosen district commissioner's office. The use of markdown formatting (bold text) helps emphasize key points.


Line range hint 1-494: LGTM: Changes consistent with existing patterns and improve user information.

The modifications and additions to this file are consistent with the existing code style and message definition patterns. The changes primarily focus on updating terminology, providing more detailed information about health declarations and digital licenses, and improving user guidance. The use of markdown formatting for certain messages is appropriately indicated in the message IDs.

Copy link

codecov bot commented Sep 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 36.70%. Comparing base (3df11fa) to head (24540fb).
Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #16186      +/-   ##
==========================================
- Coverage   36.70%   36.70%   -0.01%     
==========================================
  Files        6776     6776              
  Lines      139609   139596      -13     
  Branches    39694    39689       -5     
==========================================
- Hits        51242    51237       -5     
+ Misses      88367    88359       -8     
Flag Coverage Δ
api 3.39% <ø> (ø)
api-domains-auth-admin 48.77% <ø> (ø)
api-domains-communications 39.96% <ø> (ø)
application-system-api 41.62% <ø> (ø)
application-template-api-modules 23.72% <ø> (+0.01%) ⬆️
application-templates-driving-license 18.63% <ø> (ø)
application-ui-shell 21.29% <ø> (ø)
cms 0.43% <ø> (ø)
cms-translations 39.08% <ø> (ø)
content-search-toolkit 8.50% <ø> (ø)
judicial-system-api 18.46% <ø> (ø)
judicial-system-backend 54.82% <ø> (-0.01%) ⬇️
services-user-notification 47.13% <ø> (ø)

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

Files with missing lines Coverage Δ
...c/forms/prerequisites/sectionDigitalLicenseInfo.ts 0.00% <ø> (ø)
...tion/templates/driving-license/src/lib/messages.ts 100.00% <ø> (ø)

... and 5 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 3df11fa...24540fb. Read the comment docs.

@datadog-island-is
Copy link

datadog-island-is bot commented Sep 27, 2024

Datadog Report

All test runs 50ccabc 🔗

5 Total Test Services: 0 Failed, 5 Passed
➡️ Test Sessions change in coverage: 8 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.58s 1 no change Link
application-system-api 0 0 0 111 2 2m 50.62s 1 no change Link
application-template-api-modules 0 0 0 109 0 1m 41.19s 1 no change Link
application-templates-driving-license 0 0 0 13 0 14.78s 1 no change Link
application-ui-shell 0 0 0 74 0 31.2s 1 no change Link

@kodiakhq kodiakhq bot merged commit 8fb3ddf into main Sep 27, 2024
58 checks passed
@kodiakhq kodiakhq bot deleted the chore/dl-smallchanges branch September 27, 2024 16:13
thoreyjona pushed a commit that referenced this pull request Oct 2, 2024
* wip

* wip

* revert

* revert

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants