-
Notifications
You must be signed in to change notification settings - Fork 19
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
updated code #1861
updated code #1861
Conversation
📝 WalkthroughWalkthroughThe changes in this pull request involve multiple updates to the Changes
Possibly related PRs
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
CodeRabbit Configuration File (
|
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
🧹 Outside diff range comments (1)
health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/configs/UICustomizations.js (1)
Line range hint
502-527
: Add error handling and null checksThe new facility search request implementation has a few areas for improvement:
- Add error handling for API failures
- Add null checks in the select function
- Remove empty params object if not needed
Consider this implementation:
getFacilitySearchRequest: (prop) => { const tenantId = Digit.ULBService.getCurrentTenantId(); const {campaignId} = Digit.Hooks.useQueryParams(); return { url: `/project-factory/v1/project-type/search`, - params: { }, body: { CampaignDetails: { "tenantId": tenantId, "ids": [ campaignId ] } }, changeQueryName: `boundarySearchForPlanFacility`, config: { enabled: true, select: (data) => { + if (!data?.CampaignDetails?.length) { + return []; + } const result = data?.CampaignDetails?.[0]?.boundaries?.filter((item) => item.type == prop.lowestHierarchy) || []; return result }, + onError: (error) => { + console.error('Facility search failed:', error); + return []; + } }, }; },
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
📒 Files selected for processing (2)
health/micro-ui/web/micro-ui-internals/example/src/UICustomizations.js
(2 hunks)health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/configs/UICustomizations.js
(2 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
health/micro-ui/web/micro-ui-internals/example/src/UICustomizations.js (1)
Pattern **/*.js
: check
health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/configs/UICustomizations.js (1)
Pattern **/*.js
: check
🔇 Additional comments (5)
health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/configs/UICustomizations.js (3)
102-102
: LGTM! Button label standardization
The label change to "WBH_DOWNLOAD_MICROPLAN" improves consistency across the UI.
277-277
: LGTM! Consistent button labeling
The label change maintains consistency with MicroplanSearchConfig implementation.
Line range hint 445-458
: LGTM! Robust mobile number validation
The validation implementation is well-structured:
- Properly validates 10-digit numbers
- Correctly handles empty values as valid
- Returns clear error messages
health/micro-ui/web/micro-ui-internals/example/src/UICustomizations.js (2)
818-818
: Consistent button label update.
The button label has been updated from "WBH_DOWNLOAD" to "WBH_DOWNLOAD_MICROPLAN" for better clarity and consistency.
993-993
: Consistent button label update.
The button label has been updated from "WBH_DOWNLOAD" to "WBH_DOWNLOAD_MICROPLAN" to maintain consistency with the same change in MicroplanSearchConfig.
Let's verify if this label key exists in the translation files:
Choose the appropriate template for your PR:
Summary by CodeRabbit
New Features
Improvements