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

fix(id-card): fixing texts #16620

Merged
merged 5 commits into from
Oct 29, 2024
Merged

fix(id-card): fixing texts #16620

merged 5 commits into from
Oct 29, 2024

Conversation

berglindoma13
Copy link
Member

@berglindoma13 berglindoma13 commented Oct 29, 2024

...

Attach a link to issue if relevant

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

Release Notes

  • New Features

    • Enhanced dynamic content in the ParentB form with a new description function.
  • Improvements

    • Access permissions updated to allow applicants and assignees to read completed application details.
    • Improved user feedback with a success message upon application completion.
  • Bug Fixes

    • Corrected variable name in the parentBIntroText message for accurate rendering.
  • UI Changes

    • Visibility of last screen buttons in the ParentB form has been adjusted.

@berglindoma13 berglindoma13 requested a review from a team as a code owner October 29, 2024 13:31
Copy link
Contributor

coderabbitai bot commented Oct 29, 2024

Walkthrough

The changes in this pull request involve modifications across several files related to the ID card application forms. Key updates include the removal of unused imports and properties in the Approved form, adjustments to button visibility and the addition of a dynamic description function in the ParentB form, enhancements to role permissions in the IdCardTemplate, and a correction in the message template for the externalData. Overall, these changes refine the forms' functionality and improve user feedback mechanisms.

Changes

File Path Change Summary
libs/application/templates/id-card/src/forms/Approved.ts Removed unused import IdentityDocumentChild; commented out logo property.
libs/application/templates/id-card/src/forms/ParentB.ts Updated renderLastScreenButton and renderLastScreenBackButton to false; added dynamic description function.
libs/application/templates/id-card/src/lib/IdCardTemplate.ts Added read permission for APPLICANT and ASSIGNEE roles in States.COMPLETED; defined pendingAction message.
libs/application/templates/id-card/src/lib/messages/externalData.ts Updated defaultMessage for parentBIntroText to correct variable name from {childsName} to {childName}.

Possibly related PRs

Suggested reviewers

  • sigruntg
  • Toti91
  • birkirkristmunds

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.

@berglindoma13 berglindoma13 added the automerge Merge this PR as soon as all checks pass label Oct 29, 2024
Copy link

codecov bot commented Oct 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 36.78%. Comparing base (1e828d2) to head (bb53def).
Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main   #16620   +/-   ##
=======================================
  Coverage   36.78%   36.78%           
=======================================
  Files        6855     6855           
  Lines      142310   142310           
  Branches    40579    40579           
=======================================
+ Hits        52346    52349    +3     
+ Misses      89964    89961    -3     
Flag Coverage Δ
air-discount-scheme-backend 54.08% <ø> (ø)
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.91% <ø> (ø)
api-domains-criminal-record 48.00% <ø> (ø)
api-domains-driving-license 44.48% <ø> (ø)
api-domains-education 31.58% <ø> (ø)
api-domains-health-insurance 34.77% <ø> (ø)
api-domains-mortgage-certificate 34.98% <ø> (ø)
api-domains-payment-schedule 41.16% <ø> (ø)
application-api-files 56.78% <ø> (ø)
application-core 71.49% <ø> (ø)
application-system-api 41.32% <ø> (ø)
application-template-api-modules 27.77% <ø> (-0.01%) ⬇️
application-templates-accident-notification 29.24% <ø> (ø)
application-templates-car-recycling 3.12% <ø> (ø)
application-templates-criminal-record 26.30% <ø> (ø)
application-templates-driving-license 18.40% <ø> (ø)
application-templates-estate 12.25% <ø> (ø)
application-templates-example-payment 25.20% <ø> (ø)
application-templates-financial-aid 15.50% <ø> (ø)
application-templates-general-petition 23.42% <ø> (ø)
application-templates-inheritance-report 6.51% <ø> (ø)
application-templates-marriage-conditions 15.18% <ø> (ø)
application-templates-mortgage-certificate 43.55% <ø> (ø)
application-templates-parental-leave 29.94% <ø> (ø)
application-types 6.62% <ø> (ø)
application-ui-components 1.27% <ø> (ø)
application-ui-shell 21.22% <ø> (ø)
auth-admin-web 2.43% <ø> (ø)
auth-nest-tools 30.02% <ø> (ø)
auth-react 22.26% <ø> (ø)
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.20% <ø> (ø)
clients-regulations 42.80% <ø> (ø)
clients-rsk-company-registry 29.76% <ø> (ø)
clients-rsk-personal-tax-return 38.00% <ø> (ø)
clients-smartsolutions 12.77% <ø> (ø)
clients-syslumenn 49.49% <ø> (ø)
clients-zendesk 54.61% <ø> (ø)
cms 0.42% <ø> (ø)
cms-translations 39.04% <ø> (ø)
content-search-index-manager 95.65% <ø> (ø)
content-search-toolkit 8.16% <ø> (ø)
contentful-apps 5.44% <ø> (ø)
dokobit-signing 63.38% <ø> (ø)
download-service 44.22% <ø> (ø)
email-service 61.13% <ø> (ø)
feature-flags 91.11% <ø> (ø)
file-storage 53.71% <ø> (ø)
financial-aid-backend 56.25% <ø> (ø)
financial-aid-shared 18.94% <ø> (ø)
icelandic-names-registry-backend 53.97% <ø> (ø)
infra-nest-server 48.17% <ø> (ø)
infra-tracing 43.24% <ø> (ø)
island-ui-core 28.86% <ø> (ø)
judicial-system-api 19.42% <ø> (ø)
judicial-system-audit-trail 69.43% <ø> (ø)
judicial-system-backend 55.31% <ø> (ø)
judicial-system-formatters 79.82% <ø> (ø)
judicial-system-message 67.37% <ø> (ø)
judicial-system-message-handler 48.53% <ø> (ø)
judicial-system-scheduler 70.52% <ø> (ø)
judicial-system-types 44.09% <ø> (ø)
judicial-system-web 27.73% <ø> (ø)
license-api 42.53% <ø> (-0.06%) ⬇️
localization 10.15% <ø> (ø)
logging 48.43% <ø> (ø)
message-queue 68.58% <ø> (+0.78%) ⬆️
nest-audit 68.20% <ø> (ø)
nest-aws 61.15% <ø> (ø)
nest-config 78.44% <ø> (ø)
nest-core 43.54% <ø> (ø)
nest-feature-flags 51.52% <ø> (ø)
nest-problem 45.85% <ø> (ø)
nest-sequelize 94.44% <ø> (ø)
nest-swagger 51.71% <ø> (ø)
nova-sms 62.74% <ø> (ø)
portals-admin-regulations-admin 1.84% <ø> (ø)
portals-core 16.01% <ø> (ø)
reference-backend 49.79% <ø> (ø)
regulations 16.78% <ø> (ø)
residence-history 85.00% <ø> (ø)
services-auth-admin-api 51.89% <ø> (ø)
services-auth-delegation-api 57.45% <ø> (-0.07%) ⬇️
services-auth-ids-api 51.44% <ø> (-0.01%) ⬇️
services-auth-personal-representative 45.12% <ø> (ø)
services-auth-personal-representative-public 41.22% <ø> (-0.03%) ⬇️
services-auth-public-api 48.95% <ø> (ø)
services-documents 60.58% <ø> (ø)
services-endorsements-api 53.59% <ø> (ø)
services-sessions 65.34% <ø> (-0.05%) ⬇️
services-university-gateway 49.56% <ø> (+0.17%) ⬆️
services-user-notification 46.93% <ø> (+0.03%) ⬆️
services-user-profile 61.84% <ø> (ø)
shared-components 27.51% <ø> (ø)
shared-form-fields 31.22% <ø> (ø)
shared-mocking 64.62% <ø> (ø)
shared-pii 92.85% <ø> (ø)
shared-problem 87.50% <ø> (ø)
shared-utils 27.69% <ø> (ø)
skilavottord-ws 24.18% <ø> (ø)
testing-e2e 66.66% <ø> (ø)
web 1.79% <ø> (ø)

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

Files with missing lines Coverage Δ
...cation/templates/id-card/src/lib/IdCardTemplate.ts 28.84% <ø> (ø)
...templates/id-card/src/lib/messages/externalData.ts 100.00% <ø> (ø)

... and 1 file 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 1e828d2...bb53def. Read the comment docs.

@datadog-island-is
Copy link

datadog-island-is bot commented Oct 29, 2024

Datadog Report

All test runs edc9e78 🔗

101 Total Test Services: 0 Failed, 98 Passed
🔻 Test Sessions change in coverage: 1 decreased (-0.19%), 3 increased, 196 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-backend 0 0 0 81 0 31.35s N/A Link
air-discount-scheme-web 0 0 0 2 0 6.93s N/A Link
api 0 0 0 4 0 2.27s N/A Link
api-catalogue-services 0 0 0 23 0 8.83s N/A Link
api-domains-air-discount-scheme 0 0 0 6 0 15.84s N/A Link
api-domains-assets 0 0 0 3 0 9.4s N/A Link
api-domains-auth-admin 0 0 0 18 0 10.01s N/A Link
api-domains-communications 0 0 0 5 0 28.79s N/A Link
api-domains-criminal-record 0 0 0 5 0 8.18s N/A Link
api-domains-driving-license 0 0 0 23 0 26.72s N/A Link

🔻 Code Coverage Decreases vs Default Branch (1)

  • services-auth-delegation-api - jest 51.35% (-0.19%) - Details

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

🧹 Outside diff range and nitpick comments (2)
libs/application/templates/id-card/src/lib/messages/externalData.ts (1)

Line range hint 1-3: Consider adding TypeScript types for message keys.

To improve type safety and maintainability, consider adding TypeScript interfaces for the message keys and their expected placeholder values.

interface PreInformationMessagePlaceholders {
  parentBIntroText: {
    guardianName: string;
    childName: string;
  };
  // Add other messages that use placeholders
}

// Usage with defineMessages
export const externalData = {
  preInformation: defineMessages<keyof PreInformationMessagePlaceholders>({
    // ... existing messages
  })
};
libs/application/templates/id-card/src/lib/IdCardTemplate.ts (1)

Line range hint 1-324: Architecture follows best practices for reusability and performance.

The template demonstrates excellent implementation of:

  • Lazy loading of form components using dynamic imports
  • Strong TypeScript typing with proper interfaces
  • Modular architecture enabling tree-shaking
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 10560f2 and cd5b73d.

📒 Files selected for processing (4)
  • libs/application/templates/id-card/src/forms/Approved.ts (0 hunks)
  • libs/application/templates/id-card/src/forms/ParentB.ts (2 hunks)
  • libs/application/templates/id-card/src/lib/IdCardTemplate.ts (1 hunks)
  • libs/application/templates/id-card/src/lib/messages/externalData.ts (1 hunks)
💤 Files with no reviewable changes (1)
  • libs/application/templates/id-card/src/forms/Approved.ts
🧰 Additional context used
📓 Path-based instructions (3)
libs/application/templates/id-card/src/forms/ParentB.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/id-card/src/lib/IdCardTemplate.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/id-card/src/lib/messages/externalData.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/id-card/src/forms/ParentB.ts (2)

8-8: LGTM: Clean import addition

The import follows proper tree-shaking practices by importing a specific named export.


21-22: Verify the impact of hiding navigation buttons

The changes hide both the forward and back buttons on the last screen. Please verify:

  1. How will users navigate away from the last screen?
  2. Is this intentional as part of the text fixes?

Let's check if these flags are consistently set across other similar forms:

libs/application/templates/id-card/src/lib/IdCardTemplate.ts (1)

277-277: LGTM: Role permissions properly configured for completed state.

The addition of read: 'all' permissions for both APPLICANT and ASSIGNEE roles in the COMPLETED state ensures proper access to the completed application details. This change aligns with typical workflow requirements where both parties need to view the final application state.

Let's verify if this permission pattern is consistent across other ID card related templates:

Also applies to: 285-285

✅ Verification successful

LGTM: Read permissions are correctly configured for completed state

The read: 'all' permission in the COMPLETED state is consistent with the application's template pattern. Both APPLICANT and ASSIGNEE roles need read access to view the completed application details. This is a common pattern across various templates in the codebase where completed applications should be viewable by all involved parties.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for similar role definitions in other templates
ast-grep --pattern 'roles: [
  {
    id: $_,
    formLoader: $_,
    read: "all"
  }
]'

Length of output: 89


Script:

#!/bin/bash
# Let's try a broader search for role definitions with read permissions
rg -A 5 "roles:\s*\[" --type ts

# Also search specifically for read: 'all' pattern
rg "read:\s*['\"](all|none)" --type ts

Length of output: 278232


Script:

#!/bin/bash
# Let's check the specific template file to understand the role permissions pattern
cat libs/application/templates/id-card/src/lib/IdCardTemplate.ts

Length of output: 9451

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