-
Notifications
You must be signed in to change notification settings - Fork 61
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(application-passport): Allow 9 months instead of 6 #17397
base: main
Are you sure you want to change the base?
Conversation
WalkthroughThe pull request modifies the Changes
Sequence DiagramsequenceDiagram
participant Component as PassportSelection
participant DateLogic as Expiration Date Logic
Component->>DateLogic: Calculate todayPlus9Months
DateLogic-->>Component: Return 9-month threshold date
Component->>Component: Check passport expiration
alt Passport expires within 9 months
Component->>Component: Set tagObject
Component->>Component: Set isDisabled flag
else Passport valid
Component->>Component: Clear tagObject
Component->>Component: Enable passport
end
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? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
Documentation and Community
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #17397 +/- ##
=======================================
Coverage 35.68% 35.68%
=======================================
Files 6931 6931
Lines 148792 148792
Branches 42511 42511
=======================================
Hits 53098 53098
Misses 95694 95694
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report in Codecov by Sentry.
|
Datadog ReportAll test runs ✅ 4 Total Test Services: 0 Failed, 4 Passed Test Services
|
There was a problem hiding this 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 (2)
libs/application/templates/passport/src/fields/PassportSelection/index.tsx (2)
54-55
: Consider using a date library for adding months.While this logic to add 9 months works, using a utility function such as
addMonths
fromdate-fns
would improve readability and consistency with other date operations. It also helps handle edge cases around months with varying days.
82-82
: Success path logic for valid passports.The new threshold aligns with the updated requirements. Consider adding a quick comment or docstring clarifying the usage of
isDisabled
and how it correlates with the 9-month check for maintainability.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
libs/application/templates/passport/src/fields/PassportSelection/index.tsx
(3 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
libs/application/templates/passport/src/fields/PassportSelection/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."
🔇 Additional comments (1)
libs/application/templates/passport/src/fields/PassportSelection/index.tsx (1)
73-73
: Expiration threshold updated from 6 to 9 months.This is correct per the PR objective. Ensure that test cases are updated to reflect the 9-month threshold, especially for borderline scenarios where the expiration date is close to this cutoff.
...
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:
Summary by CodeRabbit
New Features
Bug Fixes