-
Notifications
You must be signed in to change notification settings - Fork 46
FEATURE/HCMPRE-1022: PGR revamp changes #3355
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
Conversation
…ile size and update complaint config validation
…PGR components with new styles and configurations
📝 WalkthroughWalkthroughBumped health CSS CDN; made date tag rendering stricter with explicit validation/formatting; made upload max size MDMS-driven with improved corruption detection; allowed spaces in complainant names; added date-range search and changed assignee path; switched displayed status source to service.applicationStatus; added localization loading; small styling/header tweaks. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant UI as PGR UI
participant MDMS as MDMS
participant Backend as Backend
participant Formatter as Formatter
rect rgb(245,255,245)
Note over MDMS,UI: Dynamic max file size resolution
MDMS->>UI: MaxFileSize (or null)
UI->>UI: set maxFileSize (fallback 5 MB)
UI->>UI: validate file type → validate size using maxFileSize
UI->>UI: show error using maxFileSizeMB if violated
end
rect rgb(235,245,255)
Note over Backend,Formatter: Epoch → Tag rendering
Backend->>UI: provide epochTime
UI->>Formatter: validate & format epochTime
Formatter->>UI: "day Month yy" (success) or "NA" (error)
UI->>UI: render Tag with appropriate type
end
rect rgb(255,250,230)
Note over Backend,UI: Status resolution change
Backend->>UI: provide ServiceWrappers
UI->>UI: derive status from service.applicationStatus or fallback
UI->>UI: render status label
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes
Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (2 warnings, 1 inconclusive)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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: 3
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/configs/PGRSearchInboxConfig.js (1)
73-81: Consider adding validation for the date range field.The new date range search field lacks validation constraints. Consider adding validation to ensure:
- Start date is before end date
- Date range is within reasonable limits
- Proper error messaging for invalid ranges
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
⛔ Files ignored due to path filters (1)
health/micro-ui/web/micro-ui-internals/packages/css/package.jsonis excluded by!**/*.json
📒 Files selected for processing (10)
health/micro-ui/web/micro-ui-internals/example/public/index.html(1 hunks)health/micro-ui/web/micro-ui-internals/example/src/UICustomizations.js(1 hunks)health/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/index.scss(1 hunks)health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/components/UploadFileComponent.js(3 hunks)health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/configs/CreateComplaintConfig.js(1 hunks)health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/configs/PGRSearchInboxConfig.js(3 hunks)health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/configs/UIcustomizations.js(1 hunks)health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/pages/employee/PGRDetails.js(2 hunks)health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/pages/employee/PGRInbox.js(1 hunks)health/micro-ui/web/public/index.html(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.js
⚙️ CodeRabbit configuration file
check
Files:
health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/pages/employee/PGRInbox.jshealth/micro-ui/web/micro-ui-internals/example/src/UICustomizations.jshealth/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/configs/CreateComplaintConfig.jshealth/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/components/UploadFileComponent.jshealth/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/configs/PGRSearchInboxConfig.jshealth/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/configs/UIcustomizations.jshealth/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/pages/employee/PGRDetails.js
🧠 Learnings (18)
📚 Learning: 2024-11-07T11:02:33.520Z
Learnt from: rachana-egov
Repo: egovernments/DIGIT-Frontend PR: 1770
File: health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/viewVillage.js:320-322
Timestamp: 2024-11-07T11:02:33.520Z
Learning: In `health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/viewVillage.js`, the `data?.additionalFields` object is guaranteed to be defined, so checking for its existence before accessing its keys is unnecessary.
Applied to files:
health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/pages/employee/PGRInbox.jshealth/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/pages/employee/PGRDetails.js
📚 Learning: 2025-08-19T07:07:45.217Z
Learnt from: syedkaifegov
Repo: egovernments/DIGIT-Frontend PR: 3012
File: micro-ui/web/micro-ui-internals/packages/css/src/index.scss:692-696
Timestamp: 2025-08-19T07:07:45.217Z
Learning: CSS changes for .employee-app-wrapper.sandbox are specific to Urban repo's sandbox branch implementation, not related to sandbox-login-page components found in the main codebase.
Applied to files:
health/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/index.scss
📚 Learning: 2025-06-26T10:24:08.628Z
Learnt from: Hari-egov
Repo: egovernments/DIGIT-Frontend PR: 2644
File: micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/sandbox.scss:1642-1662
Timestamp: 2025-06-26T10:24:08.628Z
Learning: In the sandbox SCSS file, tab styling with margin-bottom and border changes that cause layout shifts are intentional design requirements per updated UI specifications, not bugs to be fixed.
Applied to files:
health/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/index.scss
📚 Learning: 2025-06-26T10:17:02.717Z
Learnt from: Hari-egov
Repo: egovernments/DIGIT-Frontend PR: 2644
File: micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/employee/Otp/index.js:0-0
Timestamp: 2025-06-26T10:17:02.717Z
Learning: In the DIGIT Frontend project, banner images and similar configuration data should be managed through MDMS (Master Data Management Service) rather than hardcoded arrays or separate config files, as indicated by the user Hari-egov.
Applied to files:
health/micro-ui/web/public/index.html
📚 Learning: 2025-02-05T10:26:52.452Z
Learnt from: Tulika-eGov
Repo: egovernments/DIGIT-Frontend PR: 2188
File: micro-ui/web/micro-ui-internals/packages/modules/pgr/src/configs/UICustomizations.js:22-130
Timestamp: 2025-02-05T10:26:52.452Z
Learning: UI customizations in DIGIT-Frontend should not be restructured at this time as a new methodology for formcomposer will be implemented in the future.
Applied to files:
health/micro-ui/web/public/index.htmlhealth/micro-ui/web/micro-ui-internals/example/public/index.html
📚 Learning: 2024-11-08T07:49:53.969Z
Learnt from: rachana-egov
Repo: egovernments/DIGIT-Frontend PR: 1779
File: health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/FileComponent.js:19-28
Timestamp: 2024-11-08T07:49:53.969Z
Learning: In `FileComponent.js`, the `formatDate` function receives a date string that is always a valid date entity, so additional input validation and error handling are unnecessary.
Applied to files:
health/micro-ui/web/micro-ui-internals/example/src/UICustomizations.js
📚 Learning: 2024-10-26T15:11:49.938Z
Learnt from: nabeelmd-eGov
Repo: egovernments/DIGIT-Frontend PR: 1680
File: health/micro-ui/web/micro-ui-internals/example/src/UICustomizations.js:1032-1094
Timestamp: 2024-10-26T15:11:49.938Z
Learning: In the DIGIT-Frontend project, when reviewing the `UICustomizations.js` file, avoid suggesting refactoring of repetitive rendering logic in switch cases into helper functions, unless explicitly requested.
Applied to files:
health/micro-ui/web/micro-ui-internals/example/src/UICustomizations.js
📚 Learning: 2024-10-08T20:11:07.772Z
Learnt from: siddhant-nawale-egov
Repo: egovernments/DIGIT-Frontend PR: 606
File: micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/utils/index.js:276-276
Timestamp: 2024-10-08T20:11:07.772Z
Learning: The `addResourcesToFilteredDataToShow` function in `micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/utils/index.js` now includes checks for data integrity, such as validation of `previewData`, the common column, and `resources`, along with error logging for invalid data formats.
Applied to files:
health/micro-ui/web/micro-ui-internals/example/src/UICustomizations.jshealth/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/components/UploadFileComponent.jshealth/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/configs/UIcustomizations.jshealth/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/pages/employee/PGRDetails.js
📚 Learning: 2025-02-05T10:01:29.668Z
Learnt from: Tulika-eGov
Repo: egovernments/DIGIT-Frontend PR: 2188
File: micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/employee/Login/login.js:72-78
Timestamp: 2025-02-05T10:01:29.668Z
Learning: In the employee login form, defaultValues are dynamically generated from config[0].body based on populators.defaultValue, so spreading the entire defaultValues object is required rather than cherry-picking specific fields.
Applied to files:
health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/configs/CreateComplaintConfig.js
📚 Learning: 2024-06-10T19:25:42.992Z
Learnt from: siddhant-nawale-egov
Repo: egovernments/DIGIT-Frontend PR: 204
File: micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/pages/employee/Upload.js:468-481
Timestamp: 2024-06-10T19:25:42.992Z
Learning: The error message in the `checkForErrorInUploadedFile` function within `Upload.js` is being localized and improved for better user experience, as clarified by the user.
Applied to files:
health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/components/UploadFileComponent.js
📚 Learning: 2024-10-08T20:11:12.539Z
Learnt from: siddhant-nawale-egov
Repo: egovernments/DIGIT-Frontend PR: 204
File: micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/pages/employee/Upload.js:0-0
Timestamp: 2024-10-08T20:11:12.539Z
Learning: A more detailed message for file parsing errors in the `Upload.js` file is displayed elsewhere in the code, as clarified by the user.
Applied to files:
health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/components/UploadFileComponent.js
📚 Learning: 2024-11-28T11:34:27.480Z
Learnt from: rachana-egov
Repo: egovernments/DIGIT-Frontend PR: 1925
File: health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/UserUpload.js:267-269
Timestamp: 2024-11-28T11:34:27.480Z
Learning: In the `downloadTemplate` function of `health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/UserUpload.js`, the scenario where `state?.hierarchyType` is undefined will not occur.
Applied to files:
health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/components/UploadFileComponent.js
📚 Learning: 2024-06-14T14:10:20.359Z
Learnt from: siddhant-nawale-egov
Repo: egovernments/DIGIT-Frontend PR: 876
File: micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/components/CustomScaleControl.js:3-39
Timestamp: 2024-06-14T14:10:20.359Z
Learning: The `CustomScaleControl` component in the `micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/components/CustomScaleControl.js` file should not include a "loading map" message as there is another component handling this functionality to avoid redundancy.
Applied to files:
health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/components/UploadFileComponent.js
📚 Learning: 2024-06-15T11:05:03.278Z
Learnt from: siddhant-nawale-egov
Repo: egovernments/DIGIT-Frontend PR: 876
File: micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/Module.js:13-40
Timestamp: 2024-06-15T11:05:03.278Z
Learning: Error handling for the `Digit.Services.useStore` method is managed internally and does not require explicit external error checks.
Applied to files:
health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/components/UploadFileComponent.js
📚 Learning: 2025-06-26T10:16:36.004Z
Learnt from: Hari-egov
Repo: egovernments/DIGIT-Frontend PR: 2644
File: micro-ui/web/micro-ui-internals/packages/css/src/components/Carousel.scss:0-0
Timestamp: 2025-06-26T10:16:36.004Z
Learning: In the DIGIT-Frontend codebase, signup-container CSS classes cannot be namespaced under parent classes due to existing style constraints and requirements.
Applied to files:
health/micro-ui/web/micro-ui-internals/example/public/index.html
📚 Learning: 2025-01-02T04:41:15.957Z
Learnt from: jagankumar-egov
Repo: egovernments/DIGIT-Frontend PR: 2089
File: micro-ui/web/micro-ui-internals/packages/modules/workbench/src/pages/employee/MDMSAddV2.js:111-111
Timestamp: 2025-01-02T04:41:15.957Z
Learning: In micro-ui/web/micro-ui-internals/packages/modules/workbench/src/pages/employee/MDMSAddV2.js, always use "mdms[0].uniqueIdentifier" for the jsonPath instead of differentiating between "SOR" and other masters.
Applied to files:
health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/pages/employee/PGRDetails.js
📚 Learning: 2025-07-15T06:49:28.898Z
Learnt from: Hari-egov
Repo: egovernments/DIGIT-Frontend PR: 2788
File: micro-ui/web/micro-ui-internals/packages/modules/hrms/src/components/pageComponents/jurisdiction.js:43-74
Timestamp: 2025-07-15T06:49:28.898Z
Learning: In the HRMS module (micro-ui/web/micro-ui-internals/packages/modules/hrms/src/components/pageComponents/jurisdiction.js), the current error handling approach in the `fetchDetailsForSelectedOption` function is considered sufficient by the team. Enhanced error handling with user notifications and fallback behavior is not required for the boundary service API call.
Applied to files:
health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/pages/employee/PGRDetails.js
📚 Learning: 2024-10-17T11:59:00.327Z
Learnt from: Ramkrishna-egov
Repo: egovernments/DIGIT-Frontend PR: 1545
File: health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/ActivityCard.js:1-1
Timestamp: 2024-10-17T11:59:00.327Z
Learning: In `ActivityCard.js`, `React.Fragment` is used in the code.
Applied to files:
health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/pages/employee/PGRDetails.js
🧬 Code graph analysis (3)
health/micro-ui/web/micro-ui-internals/example/src/UICustomizations.js (1)
health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/configs/UIcustomizations.js (2)
formatDate(122-143)dateLabel(144-144)
health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/components/UploadFileComponent.js (3)
health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/hooks/boundary/useFetchAllHierarchies.js (1)
Digit(21-30)health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/Module.js (1)
tenantId(20-20)micro-ui/web/micro-ui-internals/packages/modules/pgr/src/pages/employee/ComplaintDetails.js (2)
tenantId(226-226)file(94-94)
health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/configs/UIcustomizations.js (1)
health/micro-ui/web/micro-ui-internals/example/src/UICustomizations.js (6)
formatDate(1778-1799)date(125-125)day(155-155)month(154-154)year(153-153)dateLabel(1800-1800)
🪛 Biome (2.1.2)
health/micro-ui/web/micro-ui-internals/example/src/UICustomizations.js
[error] 1778-1800: Other switch clauses can erroneously access this declaration.
Wrap the declaration in a block to restrict its access to the switch clause.
The declaration is defined in this switch clause:
Safe fix: Wrap the declaration in a block.
(lint/correctness/noSwitchDeclarations)
[error] 1800-1801: Other switch clauses can erroneously access this declaration.
Wrap the declaration in a block to restrict its access to the switch clause.
The declaration is defined in this switch clause:
Safe fix: Wrap the declaration in a block.
(lint/correctness/noSwitchDeclarations)
health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/configs/UIcustomizations.js
[error] 122-143: Other switch clauses can erroneously access this declaration.
Wrap the declaration in a block to restrict its access to the switch clause.
The declaration is defined in this switch clause:
Safe fix: Wrap the declaration in a block.
(lint/correctness/noSwitchDeclarations)
[error] 144-144: Other switch clauses can erroneously access this declaration.
Wrap the declaration in a block to restrict its access to the switch clause.
The declaration is defined in this switch clause:
Safe fix: Wrap the declaration in a block.
(lint/correctness/noSwitchDeclarations)
🔇 Additional comments (13)
health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/components/UploadFileComponent.js (3)
18-37: Verify MDMS data type and consider showing loading state.The
parseInton line 26 could returnNaNifmaxFileSizeis not a numeric string. While the fallback logic on line 36 will handleNaNcorrectly (sinceNaN || 5242880evaluates to5242880), it's safer to add explicit validation.Additionally,
isMaxFileSizeLoadingis extracted but never used. While the current behavior (allowing uploads with a 5MB default during MDMS load) is acceptable, consider whether you want to disable uploads or show a loading indicator until the actual limit is fetched.select: (data) => { const maxFileSize = data?.PGR?.MaxFileSize?.[0]?.maxFileSize; const parsed = parseInt(maxFileSize); // Add validation to ensure parsed value is a valid number return (parsed && !isNaN(parsed) && parsed > 0) ? parsed : 5242880; },
39-86: LGTM! Dynamic file size validation implemented correctly.The validation logic properly uses the dynamic
maxFileSizefor size checks and displays the appropriate limit in error messages. The addition ofmaxFileSizeto the dependencies array ensures the effect re-runs when the MDMS-fetched limit changes. The enhanced error handling for corrupted files (lines 77-81) with specific error messages improves user experience.
93-130: LGTM! Enhanced corruption detection improves error handling.The consistent use of the
"corrupt:"prefix in error messages (lines 117, 122, 127) allows theuseEffectto differentiate between file corruption and generic upload failures, providing users with more specific feedback through localized error messages.health/micro-ui/web/micro-ui-internals/example/public/index.html (1)
15-15: LGTM: CSS version update.The health CSS CDN version bump from 0.3.19 to 0.3.20 is consistent with the PR's styling updates.
health/micro-ui/web/public/index.html (1)
13-13: LGTM: Consistent CSS version update.The health CSS version is correctly updated to 0.3.20, matching the version in the example environment.
health/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/index.scss (2)
1397-1400: Verify if multiple header positioning adjustments indicate a deeper layout issue.The
.pgr-inbox-wrapper .digit-inbox-search-links-headerrule appliesright: 2.3rem, whilePGRInbox.jsline 147 appliesright: "0.5rem"inline. Multiple positioning adjustments in different places may indicate the root cause of misalignment hasn't been addressed.Consider consolidating positioning logic in one place or investigating whether the layout structure needs refactoring.
1386-1394: LGTM: UI refinements for PGR components.The flexbox centering for
.selector-button-borderand cursor change for tag text are appropriate UI improvements.health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/pages/employee/PGRInbox.js (1)
147-147: Header positioning adjustment—ensure consistency with CSS rules.The inline
right: "0.5rem"is added here, while the SCSS file at line 1397-1400 appliesright: 2.3remto.pgr-inbox-wrapper .digit-inbox-search-links-header. Ensure these adjustments work together and don't conflict.health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/configs/PGRSearchInboxConfig.js (2)
47-48: LGTM: Date range field addition and link simplification.The date range search field with corresponding defaultValue is a good UX enhancement. Removing the logoIcon simplifies the link configuration.
Also applies to: 138-138
110-110: No changes required; review comment is based on incorrect assumptions.The review comment assumes a breaking change from
ProcessInstance.assigner.nametoProcessInstance, but the actual codebase consistently usesassignes(a plural array property). The consuming code in UIcustomizations.js line 119 correctly accessesvalue?.assignes?.[0]?.name, which aligns with how ProcessInstance objects are structured throughout the codebase (Workflow.js, TimeLineWrapper.js, PGRDetails.js, and utils/index.js). Theassignerproperty (singular) exists separately for different contexts. The jsonPath change to pass the entire ProcessInstance object enables proper extraction of assignee information via the existing property chain.Likely an incorrect or invalid review comment.
health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/configs/UIcustomizations.js (2)
119-119: LGTM: Simplified assignee display logic.The updated logic
value?.assignes?.[0]?.name || t("NA")correctly handles the new ProcessInstance object structure from the config change and is more concise than the previous implementation.
122-143: Excellent date formatting implementation.The
formatDatehelper validates epoch timestamps (numeric and positive), formats dates as "day Month yy", and gracefully handles invalid values by returning "ES_COMMON_NA". This provides consistent, user-friendly date display.health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/pages/employee/PGRDetails.js (1)
372-373: LGTM: Cleaner status derivation logic.The updated approach uses
service.applicationStatusdirectly instead of inferring status from the assignees array. This is more straightforward and aligns with the status handling improvements inUIcustomizations.js.
health/micro-ui/web/micro-ui-internals/example/src/UICustomizations.js
Outdated
Show resolved
Hide resolved
...th/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/configs/CreateComplaintConfig.js
Show resolved
Hide resolved
health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/configs/UIcustomizations.js
Outdated
Show resolved
Hide resolved
… readability and maintainability
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: 1
♻️ Duplicate comments (2)
health/micro-ui/web/micro-ui-internals/example/src/UICustomizations.js (2)
1777-1802: Block scope is correctly implemented.The switch case declarations are now properly wrapped in a block, preventing variable leakage to other cases. This addresses the previous static analysis issue.
1778-1799: Duplicated formatDate function (see UIcustomizations.js review).This
formatDatefunction is identical to the one inhealth/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/configs/UIcustomizations.js(lines 122-143). Please refer to the review comment on that file for the recommended refactoring to extract this into a shared utility module.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (2)
health/micro-ui/web/micro-ui-internals/example/src/UICustomizations.js(1 hunks)health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/configs/UIcustomizations.js(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.js
⚙️ CodeRabbit configuration file
check
Files:
health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/configs/UIcustomizations.jshealth/micro-ui/web/micro-ui-internals/example/src/UICustomizations.js
🧠 Learnings (4)
📚 Learning: 2024-10-08T20:11:07.772Z
Learnt from: siddhant-nawale-egov
Repo: egovernments/DIGIT-Frontend PR: 606
File: micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/utils/index.js:276-276
Timestamp: 2024-10-08T20:11:07.772Z
Learning: The `addResourcesToFilteredDataToShow` function in `micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/utils/index.js` now includes checks for data integrity, such as validation of `previewData`, the common column, and `resources`, along with error logging for invalid data formats.
Applied to files:
health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/configs/UIcustomizations.jshealth/micro-ui/web/micro-ui-internals/example/src/UICustomizations.js
📚 Learning: 2024-10-26T15:11:49.938Z
Learnt from: nabeelmd-eGov
Repo: egovernments/DIGIT-Frontend PR: 1680
File: health/micro-ui/web/micro-ui-internals/example/src/UICustomizations.js:1032-1094
Timestamp: 2024-10-26T15:11:49.938Z
Learning: In the DIGIT-Frontend project, when reviewing the `UICustomizations.js` file, avoid suggesting refactoring of repetitive rendering logic in switch cases into helper functions, unless explicitly requested.
Applied to files:
health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/configs/UIcustomizations.jshealth/micro-ui/web/micro-ui-internals/example/src/UICustomizations.js
📚 Learning: 2024-11-08T07:49:53.969Z
Learnt from: rachana-egov
Repo: egovernments/DIGIT-Frontend PR: 1779
File: health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/FileComponent.js:19-28
Timestamp: 2024-11-08T07:49:53.969Z
Learning: In `FileComponent.js`, the `formatDate` function receives a date string that is always a valid date entity, so additional input validation and error handling are unnecessary.
Applied to files:
health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/configs/UIcustomizations.jshealth/micro-ui/web/micro-ui-internals/example/src/UICustomizations.js
📚 Learning: 2024-11-07T11:02:33.520Z
Learnt from: rachana-egov
Repo: egovernments/DIGIT-Frontend PR: 1770
File: health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/viewVillage.js:320-322
Timestamp: 2024-11-07T11:02:33.520Z
Learning: In `health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/viewVillage.js`, the `data?.additionalFields` object is guaranteed to be defined, so checking for its existence before accessing its keys is unnecessary.
Applied to files:
health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/configs/UIcustomizations.js
🧬 Code graph analysis (2)
health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/configs/UIcustomizations.js (1)
health/micro-ui/web/micro-ui-internals/example/src/UICustomizations.js (6)
formatDate(1778-1799)date(125-125)day(155-155)month(154-154)year(153-153)dateLabel(1800-1800)
health/micro-ui/web/micro-ui-internals/example/src/UICustomizations.js (1)
health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/configs/UIcustomizations.js (2)
formatDate(122-143)dateLabel(144-144)
⏰ Context from checks skipped due to timeout of 10000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: Build application arm64
- GitHub Check: Build application amd64
🔇 Additional comments (4)
health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/configs/UIcustomizations.js (4)
116-116: Minor formatting improvement approved.The spacing adjustment improves readability without altering functionality.
121-146: Block scope is correctly implemented.The switch case declarations are now properly wrapped in a block, preventing variable leakage to other cases. This addresses the previous static analysis issue.
118-119: Review comment is incorrect.The property
assignesis not a typo. The codebase consistently usesassignesas the actual field name in theProcessInstancedata structure, as confirmed by the jsonPath configuration ("ProcessInstance.assignes") and usage throughout multiple files (WorkflowTimeline, useInboxData, ApplicationDetailsContent, TimeLineWrapper, etc.). The code change is correct.Likely an incorrect or invalid review comment.
122-143: Extract the duplicated formatDate function into a shared utility.The
formatDatefunction is duplicated inhealth/micro-ui/web/micro-ui-internals/example/src/UICustomizations.js(lines 1778-1799). This violates the DRY principle and makes maintenance harder.Consider extracting this function into a shared utility module, e.g.,
utils/dateFormatters.js:// utils/dateFormatters.js export const formatDate = (epochTime, t) => { if (!Number.isFinite(epochTime) || epochTime <= 0) return t("ES_COMMON_NA"); const date = new Date(epochTime); const day = date.getDate(); const monthNames = [ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", ]; const month = monthNames[date.getMonth()]; const year = date.getFullYear().toString().slice(-2); return `${day} ${month} ${year}`; };Then import and use it in both files:
+import { formatDate } from '../utils/dateFormatters'; ... case "WF_INBOX_HEADER_CREATED_DATE": { - const formatDate = (epochTime) => { - if (!Number.isFinite(epochTime) || epochTime <= 0) return t("ES_COMMON_NA"); - const date = new Date(epochTime); - const day = date.getDate(); - const monthNames = [ - "January", "February", "March", "April", "May", "June", - "July", "August", "September", "October", "November", "December", - ]; - const month = monthNames[date.getMonth()]; - const year = date.getFullYear().toString().slice(-2); - return `${day} ${month} ${year}`; - }; - const dateLabel = formatDate(value); + const dateLabel = formatDate(value, t); return <Tag label={dateLabel} showIcon={false} type={dateLabel === t("ES_COMMON_NA") ? "error" : "success"} />; }⛔ Skipped due to learnings
Learnt from: rachana-egov Repo: egovernments/DIGIT-Frontend PR: 1779 File: health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/FileComponent.js:19-28 Timestamp: 2024-11-08T07:49:53.969Z Learning: In `FileComponent.js`, the `formatDate` function receives a date string that is always a valid date entity, so additional input validation and error handling are unnecessary.Learnt from: jagankumar-egov Repo: egovernments/DIGIT-Frontend PR: 2488 File: micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/employee/Login/login.js:152-152 Timestamp: 2025-06-04T04:08:48.234Z Learning: In the employee login component (micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/employee/Login/login.js), prefer using a `defaultTenant` variable to store `Digit.ULBService.getStateId()` instead of calling the function multiple times inline in the `defaultValue` object. This improves code readability and avoids function call duplication.
health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/configs/UIcustomizations.js
Outdated
Show resolved
Hide resolved
…orm and reload assignment status in PGRDetails
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: 3
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (2)
health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/pages/employee/CreateComplaint/createComplaintForm.js(1 hunks)health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/pages/employee/PGRDetails.js(3 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.js
⚙️ CodeRabbit configuration file
check
Files:
health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/pages/employee/CreateComplaint/createComplaintForm.jshealth/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/pages/employee/PGRDetails.js
🧠 Learnings (9)
📚 Learning: 2025-02-05T10:05:37.433Z
Learnt from: Tulika-eGov
Repo: egovernments/DIGIT-Frontend PR: 2188
File: micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/pgr/useComplaintSubType.js:14-14
Timestamp: 2025-02-05T10:05:37.433Z
Learning: In PGR's useComplaintSubType hook, the translation function 't' must be included in the useEffect dependency array to ensure complaint types are updated when the language changes.
Applied to files:
health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/pages/employee/CreateComplaint/createComplaintForm.js
📚 Learning: 2025-07-15T06:50:54.535Z
Learnt from: Hari-egov
Repo: egovernments/DIGIT-Frontend PR: 2788
File: micro-ui/web/micro-ui-internals/packages/modules/hrms/src/components/pageComponents/jurisdiction.js:157-162
Timestamp: 2025-07-15T06:50:54.535Z
Learning: In the HRMS module (micro-ui/web/micro-ui-internals/packages/modules/hrms/src/components/pageComponents/jurisdiction.js), localization is already working correctly when using `ele.hierarchyType` directly in the `gethierarchylistdata()` function. The suggested locale conversion using `Digit.Utils.locale.convertToLocale(ele.hierarchyType, 'EGOV_LOCATION_BOUNDARYTYPE')` is not needed as the current implementation already provides proper localization.
Applied to files:
health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/pages/employee/CreateComplaint/createComplaintForm.js
📚 Learning: 2024-10-08T20:11:07.772Z
Learnt from: siddhant-nawale-egov
Repo: egovernments/DIGIT-Frontend PR: 606
File: micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/utils/index.js:276-276
Timestamp: 2024-10-08T20:11:07.772Z
Learning: The `addResourcesToFilteredDataToShow` function in `micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/utils/index.js` now includes checks for data integrity, such as validation of `previewData`, the common column, and `resources`, along with error logging for invalid data formats.
Applied to files:
health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/pages/employee/CreateComplaint/createComplaintForm.jshealth/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/pages/employee/PGRDetails.js
📚 Learning: 2024-06-14T14:10:20.359Z
Learnt from: siddhant-nawale-egov
Repo: egovernments/DIGIT-Frontend PR: 876
File: micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/components/CustomScaleControl.js:3-39
Timestamp: 2024-06-14T14:10:20.359Z
Learning: The `CustomScaleControl` component in the `micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/components/CustomScaleControl.js` file should not include a "loading map" message as there is another component handling this functionality to avoid redundancy.
Applied to files:
health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/pages/employee/CreateComplaint/createComplaintForm.js
📚 Learning: 2025-06-04T04:08:48.234Z
Learnt from: jagankumar-egov
Repo: egovernments/DIGIT-Frontend PR: 2488
File: micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/employee/Login/login.js:152-152
Timestamp: 2025-06-04T04:08:48.234Z
Learning: In the employee login component (micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/employee/Login/login.js), prefer using a `defaultTenant` variable to store `Digit.ULBService.getStateId()` instead of calling the function multiple times inline in the `defaultValue` object. This improves code readability and avoids function call duplication.
Applied to files:
health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/pages/employee/CreateComplaint/createComplaintForm.js
📚 Learning: 2024-06-15T11:05:03.278Z
Learnt from: siddhant-nawale-egov
Repo: egovernments/DIGIT-Frontend PR: 876
File: micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/Module.js:13-40
Timestamp: 2024-06-15T11:05:03.278Z
Learning: Error handling for the `Digit.Services.useStore` method is managed internally and does not require explicit external error checks.
Applied to files:
health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/pages/employee/CreateComplaint/createComplaintForm.js
📚 Learning: 2025-02-05T10:18:29.947Z
Learnt from: Tulika-eGov
Repo: egovernments/DIGIT-Frontend PR: 2188
File: micro-ui/web/micro-ui-internals/packages/modules/pgr/src/pages/employee/new-inbox.js:34-47
Timestamp: 2025-02-05T10:18:29.947Z
Learning: In the DIGIT-Frontend codebase, translations within FormComposer are handled internally by the component itself, so the translation function 't' does not need to be added to useMemo dependency arrays even when used within the memoized function that generates form configurations.
Applied to files:
health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/pages/employee/CreateComplaint/createComplaintForm.js
📚 Learning: 2024-11-07T11:02:33.520Z
Learnt from: rachana-egov
Repo: egovernments/DIGIT-Frontend PR: 1770
File: health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/viewVillage.js:320-322
Timestamp: 2024-11-07T11:02:33.520Z
Learning: In `health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/viewVillage.js`, the `data?.additionalFields` object is guaranteed to be defined, so checking for its existence before accessing its keys is unnecessary.
Applied to files:
health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/pages/employee/PGRDetails.js
📚 Learning: 2025-01-02T04:41:15.957Z
Learnt from: jagankumar-egov
Repo: egovernments/DIGIT-Frontend PR: 2089
File: micro-ui/web/micro-ui-internals/packages/modules/workbench/src/pages/employee/MDMSAddV2.js:111-111
Timestamp: 2025-01-02T04:41:15.957Z
Learning: In micro-ui/web/micro-ui-internals/packages/modules/workbench/src/pages/employee/MDMSAddV2.js, always use "mdms[0].uniqueIdentifier" for the jsonPath instead of differentiating between "SOR" and other masters.
Applied to files:
health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/pages/employee/PGRDetails.js
🧬 Code graph analysis (2)
health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/pages/employee/CreateComplaint/createComplaintForm.js (2)
health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/pages/employee/PGRInbox.js (5)
stateTenantId(40-40)language(43-43)selectedHierarchy(53-55)moduleCode(58-60)isLocalizationLoading(64-70)health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/components/HierarchySelection.js (3)
language(18-18)selectedHierarchy(24-26)moduleCode(41-43)
health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/pages/employee/PGRDetails.js (1)
health/micro-ui/web/micro-ui-internals/packages/modules/health-hrms/src/pages/employee/employeeDetails.js (1)
openModal(14-14)
⏰ Context from checks skipped due to timeout of 10000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (2)
health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/pages/employee/PGRDetails.js (2)
335-335: Formatting-only change.This blank line has no functional impact.
379-380: No issues found withapplicationStatusfield availability.The field is part of the service object schema, initialized with "CREATED" status when complaints are created (confirmed in mock data at utils/index.js:175), and referenced consistently in search configurations. The code defensively handles missing values with optional chaining and a fallback to "WF_INBOX_PENDING_ASSIGNMENT", which is appropriate. The field comes directly from the backend API response and does not require frontend transformation.
...-ui-internals/packages/modules/pgr/src/pages/employee/CreateComplaint/createComplaintForm.js
Show resolved
Hide resolved
...-ui-internals/packages/modules/pgr/src/pages/employee/CreateComplaint/createComplaintForm.js
Show resolved
Hide resolved
health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/pages/employee/PGRDetails.js
Show resolved
Hide resolved
…rmatting to use localization keys
…rmatting to use localization keys
…rmatting to use localization keys
…rmatting to use localization keys
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: 1
♻️ Duplicate comments (1)
health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/configs/UIcustomizations.js (1)
121-132: Wrap switch case declarations in a block to prevent scope leakage.The declarations (
createdDate,createdDay,createdMonthKeys,createdMonth,createdYear,createdDateLabel) are not wrapped in a block, allowing other switch cases to erroneously access them. This is a code correctness issue flagged by static analysis.Apply this fix:
case "WF_INBOX_HEADER_CREATED_DATE": + { if (!value || value <= 0) { return <Tag label={t("ES_COMMON_NA")} showIcon={false} type="error" />; } const createdDate = new Date(value); const createdDay = createdDate.getDate(); const createdMonthKeys = ["JANUARY", "FEBRUARY", "MARCH", "APRIL", "MAY", "JUNE", "JULY", "AUGUST", "SEPTEMBER", "OCTOBER", "NOVEMBER", "DECEMBER"]; const createdMonth = t(`PGR_INBOX_${createdMonthKeys[createdDate.getMonth()]}`); const createdYear = createdDate.getFullYear().toString().slice(-2); const createdDateLabel = `${createdDay} ${createdMonth} ${createdYear}`; return <Tag label={createdDateLabel} showIcon={false} type="success" />; + } default:
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (1)
health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/configs/UIcustomizations.js(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.js
⚙️ CodeRabbit configuration file
check
Files:
health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/configs/UIcustomizations.js
🧠 Learnings (7)
📚 Learning: 2024-10-08T20:11:07.772Z
Learnt from: siddhant-nawale-egov
Repo: egovernments/DIGIT-Frontend PR: 606
File: micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/utils/index.js:276-276
Timestamp: 2024-10-08T20:11:07.772Z
Learning: The `addResourcesToFilteredDataToShow` function in `micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/utils/index.js` now includes checks for data integrity, such as validation of `previewData`, the common column, and `resources`, along with error logging for invalid data formats.
Applied to files:
health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/configs/UIcustomizations.js
📚 Learning: 2024-06-14T14:10:20.359Z
Learnt from: siddhant-nawale-egov
Repo: egovernments/DIGIT-Frontend PR: 876
File: micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/components/CustomScaleControl.js:3-39
Timestamp: 2024-06-14T14:10:20.359Z
Learning: The `CustomScaleControl` component in the `micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/components/CustomScaleControl.js` file should not include a "loading map" message as there is another component handling this functionality to avoid redundancy.
Applied to files:
health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/configs/UIcustomizations.js
📚 Learning: 2025-02-05T10:26:52.452Z
Learnt from: Tulika-eGov
Repo: egovernments/DIGIT-Frontend PR: 2188
File: micro-ui/web/micro-ui-internals/packages/modules/pgr/src/configs/UICustomizations.js:22-130
Timestamp: 2025-02-05T10:26:52.452Z
Learning: UI customizations in DIGIT-Frontend should not be restructured at this time as a new methodology for formcomposer will be implemented in the future.
Applied to files:
health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/configs/UIcustomizations.js
📚 Learning: 2024-11-07T11:02:33.520Z
Learnt from: rachana-egov
Repo: egovernments/DIGIT-Frontend PR: 1770
File: health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/viewVillage.js:320-322
Timestamp: 2024-11-07T11:02:33.520Z
Learning: In `health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/viewVillage.js`, the `data?.additionalFields` object is guaranteed to be defined, so checking for its existence before accessing its keys is unnecessary.
Applied to files:
health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/configs/UIcustomizations.js
📚 Learning: 2024-10-26T15:11:49.938Z
Learnt from: nabeelmd-eGov
Repo: egovernments/DIGIT-Frontend PR: 1680
File: health/micro-ui/web/micro-ui-internals/example/src/UICustomizations.js:1032-1094
Timestamp: 2024-10-26T15:11:49.938Z
Learning: In the DIGIT-Frontend project, when reviewing the `UICustomizations.js` file, avoid suggesting refactoring of repetitive rendering logic in switch cases into helper functions, unless explicitly requested.
Applied to files:
health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/configs/UIcustomizations.js
📚 Learning: 2024-11-08T07:49:53.969Z
Learnt from: rachana-egov
Repo: egovernments/DIGIT-Frontend PR: 1779
File: health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/FileComponent.js:19-28
Timestamp: 2024-11-08T07:49:53.969Z
Learning: In `FileComponent.js`, the `formatDate` function receives a date string that is always a valid date entity, so additional input validation and error handling are unnecessary.
Applied to files:
health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/configs/UIcustomizations.js
📚 Learning: 2025-06-26T10:21:42.619Z
Learnt from: Hari-egov
Repo: egovernments/DIGIT-Frontend PR: 2644
File: micro-ui/web/micro-ui-internals/packages/modules/sandbox/src/pages/employee/ProductDetails/ProductDetailsComponentUpdated.js:279-280
Timestamp: 2025-06-26T10:21:42.619Z
Learning: In the sandbox ProductDetailsComponentUpdated.js component, string concatenation is intentionally used for translation keys (e.g., `t(`${module}` + "_SECTION1_ROLE_1")`) instead of template literals for easier config identification and to make the key structure more explicit.
Applied to files:
health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/configs/UIcustomizations.js
🧬 Code graph analysis (1)
health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/configs/UIcustomizations.js (1)
health/micro-ui/web/micro-ui-internals/example/src/UICustomizations.js (6)
createdDate(1781-1781)createdDay(1782-1782)createdMonthKeys(1783-1783)createdMonth(1784-1784)createdYear(1785-1785)createdDateLabel(1786-1786)
🪛 Biome (2.1.2)
health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/configs/UIcustomizations.js
[error] 125-125: Other switch clauses can erroneously access this declaration.
Wrap the declaration in a block to restrict its access to the switch clause.
The declaration is defined in this switch clause:
Safe fix: Wrap the declaration in a block.
(lint/correctness/noSwitchDeclarations)
[error] 126-126: Other switch clauses can erroneously access this declaration.
Wrap the declaration in a block to restrict its access to the switch clause.
The declaration is defined in this switch clause:
Safe fix: Wrap the declaration in a block.
(lint/correctness/noSwitchDeclarations)
[error] 127-127: Other switch clauses can erroneously access this declaration.
Wrap the declaration in a block to restrict its access to the switch clause.
The declaration is defined in this switch clause:
Safe fix: Wrap the declaration in a block.
(lint/correctness/noSwitchDeclarations)
[error] 128-128: Other switch clauses can erroneously access this declaration.
Wrap the declaration in a block to restrict its access to the switch clause.
The declaration is defined in this switch clause:
Safe fix: Wrap the declaration in a block.
(lint/correctness/noSwitchDeclarations)
[error] 129-129: Other switch clauses can erroneously access this declaration.
Wrap the declaration in a block to restrict its access to the switch clause.
The declaration is defined in this switch clause:
Safe fix: Wrap the declaration in a block.
(lint/correctness/noSwitchDeclarations)
[error] 130-130: Other switch clauses can erroneously access this declaration.
Wrap the declaration in a block to restrict its access to the switch clause.
The declaration is defined in this switch clause:
Safe fix: Wrap the declaration in a block.
(lint/correctness/noSwitchDeclarations)
⏰ Context from checks skipped due to timeout of 10000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: Build application amd64
- GitHub Check: Build application arm64
- GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (2)
health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/configs/UIcustomizations.js (2)
115-116: LGTM! Proper null/empty check added.The tightened condition correctly validates that the value exists and has content before rendering the status label.
118-119: LGTM! Clean optional chaining for assignee access.The simplified logic safely accesses the first assignee's name with proper fallback.
health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/configs/UIcustomizations.js
Show resolved
Hide resolved
…rmatting to use localization keys
…rmatting to use localization keys
…lized month names and improve error handling
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: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (1)
health/micro-ui/web/micro-ui-internals/example/src/UICustomizations.js(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.js
⚙️ CodeRabbit configuration file
check
Files:
health/micro-ui/web/micro-ui-internals/example/src/UICustomizations.js
🧠 Learnings (5)
📚 Learning: 2024-10-08T20:11:07.772Z
Learnt from: siddhant-nawale-egov
Repo: egovernments/DIGIT-Frontend PR: 606
File: micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/utils/index.js:276-276
Timestamp: 2024-10-08T20:11:07.772Z
Learning: The `addResourcesToFilteredDataToShow` function in `micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/utils/index.js` now includes checks for data integrity, such as validation of `previewData`, the common column, and `resources`, along with error logging for invalid data formats.
Applied to files:
health/micro-ui/web/micro-ui-internals/example/src/UICustomizations.js
📚 Learning: 2024-10-26T15:11:49.938Z
Learnt from: nabeelmd-eGov
Repo: egovernments/DIGIT-Frontend PR: 1680
File: health/micro-ui/web/micro-ui-internals/example/src/UICustomizations.js:1032-1094
Timestamp: 2024-10-26T15:11:49.938Z
Learning: In the DIGIT-Frontend project, when reviewing the `UICustomizations.js` file, avoid suggesting refactoring of repetitive rendering logic in switch cases into helper functions, unless explicitly requested.
Applied to files:
health/micro-ui/web/micro-ui-internals/example/src/UICustomizations.js
📚 Learning: 2024-11-07T11:02:33.520Z
Learnt from: rachana-egov
Repo: egovernments/DIGIT-Frontend PR: 1770
File: health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/viewVillage.js:320-322
Timestamp: 2024-11-07T11:02:33.520Z
Learning: In `health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/viewVillage.js`, the `data?.additionalFields` object is guaranteed to be defined, so checking for its existence before accessing its keys is unnecessary.
Applied to files:
health/micro-ui/web/micro-ui-internals/example/src/UICustomizations.js
📚 Learning: 2024-11-08T07:49:53.969Z
Learnt from: rachana-egov
Repo: egovernments/DIGIT-Frontend PR: 1779
File: health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/FileComponent.js:19-28
Timestamp: 2024-11-08T07:49:53.969Z
Learning: In `FileComponent.js`, the `formatDate` function receives a date string that is always a valid date entity, so additional input validation and error handling are unnecessary.
Applied to files:
health/micro-ui/web/micro-ui-internals/example/src/UICustomizations.js
📚 Learning: 2025-06-26T10:21:42.619Z
Learnt from: Hari-egov
Repo: egovernments/DIGIT-Frontend PR: 2644
File: micro-ui/web/micro-ui-internals/packages/modules/sandbox/src/pages/employee/ProductDetails/ProductDetailsComponentUpdated.js:279-280
Timestamp: 2025-06-26T10:21:42.619Z
Learning: In the sandbox ProductDetailsComponentUpdated.js component, string concatenation is intentionally used for translation keys (e.g., `t(`${module}` + "_SECTION1_ROLE_1")`) instead of template literals for easier config identification and to make the key structure more explicit.
Applied to files:
health/micro-ui/web/micro-ui-internals/example/src/UICustomizations.js
🪛 Biome (2.1.2)
health/micro-ui/web/micro-ui-internals/example/src/UICustomizations.js
[error] 1780-1781: Other switch clauses can erroneously access this declaration.
Wrap the declaration in a block to restrict its access to the switch clause.
The declaration is defined in this switch clause:
Safe fix: Wrap the declaration in a block.
(lint/correctness/noSwitchDeclarations)
[error] 1781-1782: Other switch clauses can erroneously access this declaration.
Wrap the declaration in a block to restrict its access to the switch clause.
The declaration is defined in this switch clause:
Safe fix: Wrap the declaration in a block.
(lint/correctness/noSwitchDeclarations)
[error] 1782-1783: Other switch clauses can erroneously access this declaration.
Wrap the declaration in a block to restrict its access to the switch clause.
The declaration is defined in this switch clause:
Safe fix: Wrap the declaration in a block.
(lint/correctness/noSwitchDeclarations)
[error] 1783-1784: Other switch clauses can erroneously access this declaration.
Wrap the declaration in a block to restrict its access to the switch clause.
The declaration is defined in this switch clause:
Safe fix: Wrap the declaration in a block.
(lint/correctness/noSwitchDeclarations)
[error] 1784-1785: Other switch clauses can erroneously access this declaration.
Wrap the declaration in a block to restrict its access to the switch clause.
The declaration is defined in this switch clause:
Safe fix: Wrap the declaration in a block.
(lint/correctness/noSwitchDeclarations)
[error] 1785-1786: Other switch clauses can erroneously access this declaration.
Wrap the declaration in a block to restrict its access to the switch clause.
The declaration is defined in this switch clause:
Safe fix: Wrap the declaration in a block.
(lint/correctness/noSwitchDeclarations)
⏰ Context from checks skipped due to timeout of 10000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: Build application amd64
- GitHub Check: Build application arm64
- GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (1)
health/micro-ui/web/micro-ui-internals/example/src/UICustomizations.js (1)
1770-1774: Improved null-safety and simplified logic.The changes to both cases are good improvements:
- Line 1771: The simplified condition
value && value?.length > 0is cleaner and maintains the same intent- Line 1774: Using optional chaining
value?.assignes?.[0]?.nameis more defensive and prevents potential runtime errors if the data structure is missing
PGR revamp changes
Summary by CodeRabbit
New Features
Bug Fixes
Style