-
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
feat(regulations-admin): Add affected regulation formatting #15857
feat(regulations-admin): Add affected regulation formatting #15857
Conversation
WalkthroughThe changes to the Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant FormatUtility
participant DateFormatter
participant ArticleExtractor
User->>FormatUtility: Request to format regulation
FormatUtility->>DateFormatter: Format date
FormatUtility->>ArticleExtractor: Extract article number
FormatUtility->>FormatUtility: Format affected impacts
FormatUtility->>FormatUtility: Construct final output
FormatUtility-->>User: Return formatted regulation
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 ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #15857 +/- ##
==========================================
+ Coverage 36.85% 36.91% +0.05%
==========================================
Files 6692 6679 -13
Lines 136964 136288 -676
Branches 38913 38697 -216
==========================================
- Hits 50481 50311 -170
+ Misses 86483 85977 -506
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 66 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
Datadog ReportBranch report: ✅ 0 Failed, 24 Passed, 0 Skipped, 14.8s Total Time 🔻 Code Coverage Decreases vs Default Branch (1)
|
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: 4
Outside diff range, codebase verification and nitpick comments (1)
libs/portals/admin/regulations-admin/src/utils/formatAmendingRegulation.ts (1)
Line range hint
142-164
: Optimization of Title Formatting informatAmendingRegTitle
The function
formatAmendingRegTitle
has been updated to format regulation titles more effectively. The use ofuniq
and array mapping is appropriate here. However, consider the following points:
- Duplication: The logic for prefixing titles seems repetitive and could be abstracted into a smaller helper function to improve code reuse.
- Performance: Using
map
andfilter
consecutively can be merged into a single iteration to enhance performance.These changes can make the function more efficient and maintainable.
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (1)
- libs/portals/admin/regulations-admin/src/utils/formatAmendingRegulation.ts (8 hunks)
Additional context used
Path-based instructions (1)
libs/portals/admin/regulations-admin/src/utils/formatAmendingRegulation.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/portals/admin/regulations-admin/src/utils/formatAmendingRegulation.ts
Show resolved
Hide resolved
libs/portals/admin/regulations-admin/src/utils/formatAmendingRegulation.ts
Show resolved
Hide resolved
libs/portals/admin/regulations-admin/src/utils/formatAmendingRegulation.ts
Show resolved
Hide resolved
libs/portals/admin/regulations-admin/src/utils/formatAmendingRegulation.ts
Show resolved
Hide resolved
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.
LGTM 🏎️
* Add affected regulation formatting * Order articles by affected article number
* Add affected regulation formatting * Order articles by affected article number
What
Add affected article text at the end of change regulation.
Order articles by affected article number.
Why
Feature request.
Screenshot
Checklist:
Summary by CodeRabbit