-
Notifications
You must be signed in to change notification settings - Fork 47
V0.4.1 #3337
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
base: master
Are you sure you want to change the base?
V0.4.1 #3337
Conversation
…ntid override in health packages since we have a flag to override in core itself (#3288) * updated with new version for better stability * update css versions * Updated the package version for beta 2 * upgraded the package versions * versions upgraded for core * Updated the packge version of workbench * Revert "BUGFIX:: injected the custom hook to override the getStateId method (#3265)" This reverts commit 613926d.
📝 WalkthroughWalkthroughUpdates environment demo URLs and HTML CSS versions/styles, adds local id state and fallback logic in campaign update flows, passes a new prop to a deactivation popup and adjusts deactivation details handling, adds a workbench changelog, and applies minor formatting tweaks. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant UpdateCampaign
participant URLParams as URL Params
participant LocalState as Local State
participant API
User->>UpdateCampaign: mount
UpdateCampaign->>URLParams: read search param `id`
URLParams-->>UpdateCampaign: id (or null)
UpdateCampaign->>LocalState: init [id, setId]
alt id present
UpdateCampaign->>API: query CampaignDetails(id)
else
UpdateCampaign->>API: query CampaignDetails(parentId)
end
API-->>UpdateCampaign: campaign data
UpdateCampaign->>UpdateCampaign: build payload (use id if set, else parentId)
UpdateCampaign->>API: submit create/update/draft
API-->>UpdateCampaign: success (may return id)
alt response contains id
UpdateCampaign->>LocalState: setId(response.id)
UpdateCampaign->>URLParams: update `id` param
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✨ 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: 6
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
⛔ Files ignored due to path filters (9)
health/micro-ui/web/console/inter-package.jsonis excluded by!**/*.jsonhealth/micro-ui/web/console/package.jsonis excluded by!**/*.jsonhealth/micro-ui/web/core/inter-package.jsonis excluded by!**/*.jsonhealth/micro-ui/web/core/package.jsonis excluded by!**/*.jsonhealth/micro-ui/web/micro-ui-internals/example/package.jsonis excluded by!**/*.jsonhealth/micro-ui/web/micro-ui-internals/package.jsonis excluded by!**/*.jsonhealth/micro-ui/web/workbench/inter-package.jsonis excluded by!**/*.jsonhealth/micro-ui/web/workbench/package.jsonis excluded by!**/*.jsonmicro-ui/web/workbench/package.jsonis excluded by!**/*.json
📒 Files selected for processing (5)
health/micro-ui/web/micro-ui-internals/example/.env-hcm-demo(1 hunks)health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/components/AddOrEditMapping.js(1 hunks)health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/pages/employee/UpdateCampaign.js(6 hunks)health/micro-ui/web/public/index.html(1 hunks)micro-ui/web/micro-ui-internals/packages/modules/workbench/CHANGELOG.md(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.js
⚙️ CodeRabbit configuration file
check
Files:
health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/components/AddOrEditMapping.jshealth/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/pages/employee/UpdateCampaign.js
🧠 Learnings (10)
📚 Learning: 2025-10-23T10:53:42.448Z
Learnt from: jagankumar-egov
Repo: egovernments/DIGIT-Frontend PR: 3275
File: health/micro-ui/web/micro-ui-internals/packages/modules/health-hrms/src/services/urls.js:49-52
Timestamp: 2025-10-23T10:53:42.448Z
Learning: In the DIGIT-Frontend health modules (health-hrms and health-payments), service endpoint URLs should always be config-driven using window.globalConfigs.getConfig() with fallback defaults, never hardcoded. Established config keys include: HRMS_CONTEXT_PATH, ATTENDANCE_CONTEXT_PATH, INDIVIDUAL_CONTEXT_PATH, PROJECT_CONTEXT_PATH, MUSTER_ROLL_CONTEXT_PATH, EXPENSE_CONTEXT_PATH, EXPENSE_CALCULATOR_CONTEXT_PATH, and BOUNDARY_CONTEXT_PATH. The setupProxy.js file may be an exception as it's development-only.
Applied to files:
health/micro-ui/web/micro-ui-internals/example/.env-hcm-demo
📚 Learning: 2024-06-10T19:25:42.992Z
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-06-10T19:25:42.992Z
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:
micro-ui/web/micro-ui-internals/packages/modules/workbench/CHANGELOG.mdhealth/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/components/AddOrEditMapping.js
📚 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:
micro-ui/web/micro-ui-internals/packages/modules/workbench/CHANGELOG.md
📚 Learning: 2025-06-26T10:38:13.794Z
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:326-345
Timestamp: 2025-06-26T10:38:13.794Z
Learning: In the DIGIT Frontend sandbox module, configuration data comes from MDMS (Master Data Management System) which provides reliable, well-structured data for UI components, reducing the likelihood of malformed configuration data that would require extensive error handling.
Applied to files:
micro-ui/web/micro-ui-internals/packages/modules/workbench/CHANGELOG.md
📚 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/campaign-manager/src/components/AddOrEditMapping.js
📚 Learning: 2024-10-22T12:51:42.266Z
Learnt from: rachana-egov
Repo: egovernments/DIGIT-Frontend PR: 1622
File: health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/PopInboxTable.js:355-363
Timestamp: 2024-10-22T12:51:42.266Z
Learning: In `PopInboxTable.js`, the `showEditVillagePopup` state variable is initialized as an empty object.
Applied to files:
health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/components/AddOrEditMapping.js
📚 Learning: 2024-06-10T19:25:42.992Z
Learnt from: nitish-egov
Repo: egovernments/DIGIT-Frontend PR: 0
File: :0-0
Timestamp: 2024-06-10T19:25:42.992Z
Learning: The `boundaryData` null check is performed at a higher level before calling the `getDataSheetReady` function in `utilities/project-factory/src/server/utils/genericUtils.ts`.
Applied to files:
health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/components/AddOrEditMapping.js
📚 Learning: 2024-06-10T19:25:42.992Z
Learnt from: siddhant-nawale-egov
Repo: egovernments/DIGIT-Frontend PR: 698
File: micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/components/MicroplanPreview.js:1-1
Timestamp: 2024-06-10T19:25:42.992Z
Learning: The imports in `MicroplanPreview.js` are from different libraries: `egovernments/digit-ui-components` and `egovernments/digit-ui-react-components`.
Applied to files:
health/micro-ui/web/public/index.html
📚 Learning: 2024-09-30T05:45:14.549Z
Learnt from: ashish-egov
Repo: egovernments/DIGIT-Frontend PR: 1441
File: health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/hooks/useGenerateIdCampaign.js:1-1
Timestamp: 2024-09-30T05:45:14.549Z
Learning: In the `useGenerateIdCampaign` function, auto assignment of default parameter values is needed in parameter destructuring.
Applied to files:
health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/pages/employee/UpdateCampaign.js
📚 Learning: 2024-06-10T19:25:42.992Z
Learnt from: siddhant-nawale-egov
Repo: egovernments/DIGIT-Frontend PR: 606
File: micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/hooks/index.js:19-19
Timestamp: 2024-06-10T19:25:42.992Z
Learning: The `useGenerateIdCampaign` hook is planned to be used in the Upload section in the future.
Applied to files:
health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/pages/employee/UpdateCampaign.js
🧬 Code graph analysis (1)
health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/pages/employee/UpdateCampaign.js (4)
health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/components/CampaignUpdateSummary.js (3)
id(91-91)searchParams(89-89)parentId(100-100)health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/components/UpdateBoundaryWrapper.js (3)
id(14-14)searchParams(12-12)parentId(13-13)health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/components/CampaignSummary.js (3)
id(155-155)searchParams(154-154)parentId(169-169)health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/components/CreateCampaignComponents/NewUploadData.js (3)
id(39-39)searchParams(38-38)parentId(40-40)
🪛 LanguageTool
micro-ui/web/micro-ui-internals/packages/modules/workbench/CHANGELOG.md
[uncategorized] ~21-~21: If this is a compound adjective that modifies the following noun, use a hyphen.
Context: ...lipsis for long module/master names - Full text display on hover with visual feedback ...
(EN_COMPOUND_ADJECTIVE_INTERNAL)
[style] ~27-~27: ‘with success’ might be wordy. Consider a shorter alternative.
Context: ...file formats - Real-time progress bar with success/error tracking - Batch processing wit...
(EN_WORDINESS_PREMIUM_WITH_SUCCESS)
[uncategorized] ~104-~104: If this is a compound adjective that modifies the following noun, use a hyphen.
Context: ...lipsis for long module/master names - Full text display on hover with visual feedback ...
(EN_COMPOUND_ADJECTIVE_INTERNAL)
[duplication] ~148-~148: Possible typo: you repeated a word.
Context: ...f all data per schema & enable based on flag - flag name 'ENABLE_MDMS_BULK_DOWNLOAD' ## [...
(ENGLISH_WORD_REPEAT_RULE)
[uncategorized] ~183-~183: Do not mix variants of the same word (‘localisation’ and ‘localization’) within a single text.
Context: ...he workbench module patches and Updated localisation search screen, and core module #2181 - ...
(EN_WORD_COHERENCY)
[uncategorized] ~186-~186: Do not mix variants of the same word (‘localisation’ and ‘localization’) within a single text.
Context: ...aster dataa 'ENABLE_MDMS_BULK_UPLOAD' - Localisation search introduced a search bar for bett...
(EN_WORD_COHERENCY)
🪛 markdownlint-cli2 (0.18.1)
micro-ui/web/micro-ui-internals/packages/modules/workbench/CHANGELOG.md
2-2: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
2-2: First line in a file should be a top-level heading
(MD041, first-line-heading, first-line-h1)
3-3: Trailing spaces
Expected: 0 or 2; Actual: 1
(MD009, no-trailing-spaces)
9-9: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
14-14: Trailing spaces
Expected: 0 or 2; Actual: 1
(MD009, no-trailing-spaces)
19-19: Trailing spaces
Expected: 0 or 2; Actual: 1
(MD009, no-trailing-spaces)
24-24: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
36-36: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
48-48: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
49-49: Trailing spaces
Expected: 0 or 2; Actual: 1
(MD009, no-trailing-spaces)
60-60: Trailing spaces
Expected: 0 or 2; Actual: 1
(MD009, no-trailing-spaces)
66-66: Trailing spaces
Expected: 0 or 2; Actual: 1
(MD009, no-trailing-spaces)
71-71: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
77-77: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
82-82: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
85-85: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
92-92: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
97-97: Trailing spaces
Expected: 0 or 2; Actual: 1
(MD009, no-trailing-spaces)
102-102: Trailing spaces
Expected: 0 or 2; Actual: 1
(MD009, no-trailing-spaces)
111-111: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
112-112: Trailing spaces
Expected: 0 or 2; Actual: 1
(MD009, no-trailing-spaces)
116-116: Trailing spaces
Expected: 0 or 2; Actual: 1
(MD009, no-trailing-spaces)
120-120: Trailing spaces
Expected: 0 or 2; Actual: 1
(MD009, no-trailing-spaces)
125-125: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
130-130: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
135-135: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
136-136: Trailing spaces
Expected: 0 or 2; Actual: 1
(MD009, no-trailing-spaces)
137-137: Trailing spaces
Expected: 0 or 2; Actual: 1
(MD009, no-trailing-spaces)
138-138: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Above
(MD022, blanks-around-headings)
138-138: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
139-139: Trailing spaces
Expected: 0 or 2; Actual: 3
(MD009, no-trailing-spaces)
141-141: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
144-144: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
147-147: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
152-152: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
155-155: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
158-158: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
161-161: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
164-164: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
169-169: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
172-172: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
175-175: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
178-178: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
182-182: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
189-189: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
192-192: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
195-195: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
🔇 Additional comments (4)
health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/components/AddOrEditMapping.js (1)
13-13: LGTM! Formatting improvement.The added whitespace improves readability by separating state declarations.
health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/pages/employee/UpdateCampaign.js (2)
42-42: LGTM! Campaign ID state management introduced.The local
idstate properly captures the campaign ID from URL parameters and enables consistent ID propagation across create/update/draft flows.
393-396: LGTM! Campaign ID correctly persisted after creation.The newly created campaign ID is properly captured from the response and stored in both the URL parameters and local state, ensuring consistent ID tracking throughout the component lifecycle.
health/micro-ui/web/micro-ui-internals/example/.env-hcm-demo (1)
5-6: Verify endpoint configuration before deployment — API endpoint returned 503 error.Endpoint verification revealed:
https://health-demo.digit.org/healthreturned 503 (Service Unavailable)https://health-demo.digit.orgreturned 302 (Redirect)Confirm these endpoints are correctly configured and operational. The 503 error on the health endpoint suggests potential misconfiguration or service unavailability.
| CampaignDetails: { | ||
| tenantId: tenantId, | ||
| ids: [parentId], | ||
| ids: [id?id:parentId], |
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.
🧹 Nitpick | 🔵 Trivial
Fix ternary operator formatting for consistency.
The ternary operator lacks proper spacing, which is inconsistent with common JavaScript style guidelines.
Apply this diff:
- ids: [id?id:parentId],
+ ids: [id ? id : parentId],📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| ids: [id?id:parentId], | |
| ids: [id ? id : parentId], |
🤖 Prompt for AI Agents
In
health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/pages/employee/UpdateCampaign.js
around line 89, the ternary operator in the array assignment is missing spaces;
update it to use consistent spacing around the '?' and ':' (e.g., change ids:
[id?id:parentId] to ids: [id ? id : parentId]) so it conforms to project
JavaScript style guidelines.
|
|
||
| if(parentId){ | ||
| payloadData.parentId =parentId; | ||
| } | ||
|
|
||
| if(id){ | ||
| payloadData.id =id; | ||
| } |
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.
🧹 Nitpick | 🔵 Trivial
Improve formatting of conditional blocks.
The conditional assignments for parentId and id have inconsistent indentation and formatting.
Apply this diff:
-
- if(parentId){
- payloadData.parentId =parentId;
- }
-
- if(id){
- payloadData.id =id;
- }
-
+ if (parentId) {
+ payloadData.parentId = parentId;
+ }
+
+ if (id) {
+ payloadData.id = id;
+ }📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| if(parentId){ | |
| payloadData.parentId =parentId; | |
| } | |
| if(id){ | |
| payloadData.id =id; | |
| } | |
| if (parentId) { | |
| payloadData.parentId = parentId; | |
| } | |
| if (id) { | |
| payloadData.id = id; | |
| } |
🤖 Prompt for AI Agents
In
health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/pages/employee/UpdateCampaign.js
around lines 270 to 277, the if blocks assigning payloadData.parentId and
payloadData.id are inconsistently indented and spaced; reformat them to a
consistent style (either single-line conditional or properly indented multi-line
blocks). For example, ensure there is a space after `if`, parentheses directly
around the condition, a space before the block, consistent indentation for the
body, and a space after the assignment operator — e.g. convert to either `if
(parentId) { payloadData.parentId = parentId; }` and `if (id) { payloadData.id =
id; }` or to two-line blocks with matching indentation and spacing.
| payloadData.parentId = parentId; | ||
| if(id){ | ||
| payloadData.id =id; | ||
| } |
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.
🧹 Nitpick | 🔵 Trivial
Improve formatting of conditional block.
The conditional assignment for id has inconsistent indentation and spacing.
Apply this diff:
payloadData.action = "draft";
payloadData.parentId = parentId;
- if(id){
- payloadData.id =id;
- }
+ if (id) {
+ payloadData.id = id;
+ }📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| payloadData.parentId = parentId; | |
| if(id){ | |
| payloadData.id =id; | |
| } | |
| payloadData.parentId = parentId; | |
| if (id) { | |
| payloadData.id = id; | |
| } |
🤖 Prompt for AI Agents
In
health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/pages/employee/UpdateCampaign.js
around lines 348 to 351, the conditional block that assigns payloadData.id has
inconsistent indentation and spacing; reformat the if block to use consistent
indentation and spacing (e.g., place the if on its own line with a space after
it, open brace on same line, body indented, and close brace aligned) so it reads
clearly and matches surrounding style.
| if(parentId){ | ||
| payloadData.parentId =parentId; | ||
| } | ||
|
|
||
| if(id){ | ||
| payloadData.id =id; | ||
| } |
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.
🧹 Nitpick | 🔵 Trivial
Improve formatting of conditional blocks.
The conditional assignments for parentId and id have inconsistent indentation and formatting.
Apply this diff:
payloadData.campaignName = CampaignData?.CampaignDetails?.[0]?.campaignName;
- if(parentId){
- payloadData.parentId =parentId;
- }
-
- if(id){
- payloadData.id =id;
- }
-
+ if (parentId) {
+ payloadData.parentId = parentId;
+ }
+
+ if (id) {
+ payloadData.id = id;
+ }📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| if(parentId){ | |
| payloadData.parentId =parentId; | |
| } | |
| if(id){ | |
| payloadData.id =id; | |
| } | |
| if (parentId) { | |
| payloadData.parentId = parentId; | |
| } | |
| if (id) { | |
| payloadData.id = id; | |
| } |
🤖 Prompt for AI Agents
In
health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/pages/employee/UpdateCampaign.js
around lines 421 to 427, the conditional blocks assigning payloadData.parentId
and payloadData.id are mis-indented and inconsistently formatted; reformat each
if block to use consistent spacing and indentation (one space after if, space
between parentheses and braces, and properly indented payload assignment) so
both conditionals follow the same style and project lint rules.
| <link rel="stylesheet" href="https://unpkg.com/@egovernments/digit-ui-css@1.9.0/dist/index.css" /> | ||
| <link rel="stylesheet" href="https://unpkg.com/@egovernments/[email protected].3/dist/index.css" /> |
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.
🧩 Analysis chain
Verify CSS package versions for compatibility and breaking changes.
The CSS packages have been updated to newer versions. Please ensure:
- These versions are compatible with the current application code
- No breaking changes affect existing UI components
- The versions are the latest stable releases
🌐 Web query:
What are the breaking changes and release notes for @egovernments/digit-ui-css version 1.9.0?
💡 Result:
I couldn’t find any published release notes or a CHANGELOG entry specifically for @egovernments/digit-ui-css v1.9.0. The package index (jsDelivr) lists a 1.9.0 release (release date shown Oct 23, 2025) but there’s no accompanying changelog or breaking-changes notes on npm/jsDelivr pages. [1][2]
If you want, I can:
- fetch the package contents (dist/CHANGELOG.md or package.json) from the v1.9.0 tag on the GitHub repo or the npm tarball and extract the release notes/breaking changes; or
- search the repository’s Releases/Tags and CHANGELOG.md for v1.9.0 and report back with citations.
Which would you like me to do?
🌐 Web query:
What are the breaking changes and release notes for @egovernments/digit-ui-components-css version 0.2.3?
💡 Result:
I couldn't find a published 0.2.3 release for @egovernments/digit-ui-components-css. The npm package shows latest published version 0.2.0 (with its changelog) — no 0.2.3 release notes or breaking-change entry are available. [1]
If you want, I can:
- check the DIGIT GitHub changelog/branches for an unreleased 0.2.3 entry, or
- monitor npm/GitHub and notify you if 0.2.3 appears.
Sources:
[1] @egovernments/digit-ui-components-css — npm package page (version 0.2.0).
Correct CSS package version: [email protected] doesn't exist on npm.
The @egovernments/digit-ui-components-css package shows latest published version as 0.2.0, not 0.2.3. The version specified in line 11 will fail to resolve. Update to an available version (e.g., 0.2.0 or verify if 0.2.3 exists in an internal registry).
Additionally, @egovernments/digit-ui-css v1.9.0 has no published release notes or CHANGELOG entry, so ensure compatibility with the application code through testing.
🤖 Prompt for AI Agents
In health/micro-ui/web/public/index.html around lines 10 to 11, the CSS import
references @egovernments/[email protected] which is not published on
npm; update that href to a valid published version such as 0.2.0 (or point to
your internal registry if 0.2.3 is hosted there), and verify the
@egovernments/[email protected] import by running the app and smoke-testing
relevant UI pages to ensure compatibility; adjust versions or pin to
known-working releases if any style regressions appear.
|
|
||
| ## [1.1.1] [28-October-2025] | ||
| - minor patch removed console log | ||
|
|
||
| ## [1.1.0] [28-October-2025] | ||
|
|
||
| ### 🚀 Major Features & UI/UX Redesign | ||
|
|
||
| #### MDMS Interface Redesign: | ||
| - **Card-Based Navigation**: Complete redesign from dropdown to interactive card-based interface | ||
| - Module selection cards with visual hierarchy | ||
| - Master details cards for selected modules | ||
| - Responsive grid layout (mobile, tablet, desktop) | ||
| - **Real-Time Search Functionality**: | ||
| - Filter modules and masters by name/translated value | ||
| - Case-insensitive search with instant results | ||
| - Dynamic placeholders (WBH_SEARCH_MODULES/WBH_SEARCH_MASTERS) | ||
| - No results message handling | ||
| - **Text Truncation with Hover Display**: | ||
| - Smart ellipsis for long module/master names | ||
| - Full text display on hover with visual feedback | ||
| - CSS class: `employee-card-sub-header` | ||
|
|
||
| #### 📁 Bulk Upload System: | ||
| - **Excel/JSON Bulk Upload**: New BulkModal component with progress tracking | ||
| - Support for XLSX, XLS, and JSON file formats | ||
| - Real-time progress bar with success/error tracking | ||
| - Batch processing with configurable delays | ||
| - Template generation and download functionality | ||
| - **File Management**: Enhanced BulkUpload component with drag-drop interface | ||
| - Drag and drop file upload with validation | ||
| - File preview and deletion capabilities | ||
| - Error handling with toast notifications | ||
| - Submit confirmation with action bars | ||
|
|
||
| #### 🔧 Advanced Form Features: | ||
| - **Enhanced JSON Forms**: Major updates to DigitJSONForm component | ||
| - Localization support with MDMS code generation | ||
| - Custom widgets: CustomSwitch, improved CheckboxWidget | ||
| - Context-based state management with AdditionalPropertiesContext | ||
| - JSON viewer integration for data inspection | ||
| - PopUp modals for better user interaction | ||
| - **Boundary Management**: New BoundaryHierarchyTypeAdd functionality | ||
| - Administrative boundary hierarchy creation | ||
| - Form composer integration for structured data entry | ||
| - Validation and error handling for boundary types | ||
|
|
||
| #### Technical Improvements: | ||
| - **Component Architecture Overhaul**: | ||
| - New components: BulkModal, BulkUpload, CustomSwitch, LevelCards, JSONViewer | ||
| - Enhanced DigitJSONForm with context providers and advanced widgets | ||
| - Replaced Dropdown components with Card-based components (CardHeader, CardText, CardSubHeader) | ||
| - Added TextInput for real-time search functionality | ||
| - Updated imports from @egovernments/digit-ui-react-components and @egovernments/digit-ui-components | ||
| - **Module System Enhancement**: | ||
| - Added HCM admin schemas support (`hcm-admin-schemas` moduleCode) | ||
| - TourProvider integration for guided user experience | ||
| - Enhanced component registration with better logging | ||
| - Module prefix configuration with `CORE_UI_MODULE_LOCALE_PREFIX` | ||
| - **State Management Enhancement**: | ||
| - Context-based state management with AdditionalPropertiesContext | ||
| - Replaced `currentSchema`, `masterName`, `moduleName` with `selectedModule` | ||
| - Added new state variables: `searchQuery`, `showModules` | ||
| - Implemented filtered data using `filteredModules`, `filteredMasters` | ||
| - Auto-clear search functionality on navigation transitions | ||
| - **Utility Functions**: | ||
| - New BulkUploadUtils for template generation and file processing | ||
| - Enhanced localization utilities with tranformLocModuleName | ||
| - Improved parsing utilities for data transformation | ||
|
|
||
| #### Performance Improvements: | ||
| - Increased schema limit from 200 to 500 for better data handling | ||
| - Optimized filtering logic with useMemo hooks | ||
| - Reduced component re-renders through efficient state management | ||
| - Faster search response with debounced filtering | ||
|
|
||
| #### Global Config Support: | ||
| - Compatible with `OVERRIDE_ROOT_TENANT_WITH_LOGGEDIN_TENANT` flag | ||
| - Supports multi-tenant MDMS configurations | ||
| - Enhanced schema definition criteria handling | ||
|
|
||
| ## [1.1.0-rc2] [27-Oct-2025] | ||
| - Test Build for release after master merge | ||
|
|
||
| ## [1.1.0-rc1] [27-Oct-2025] | ||
| - Test Build for release | ||
|
|
||
| ## [1.0.29] [28-October-2025] | ||
|
|
||
| ### 🚀 Major UI/UX Redesign - MDMS Manage Master Interface | ||
|
|
||
| #### New Features: | ||
| - **Card-Based Navigation**: Complete redesign from dropdown to interactive card-based interface | ||
| - Module selection cards with visual hierarchy | ||
| - Master details cards for selected modules | ||
| - Responsive grid layout (mobile, tablet, desktop) | ||
| - **Real-Time Search Functionality**: | ||
| - Filter modules and masters by name/translated value | ||
| - Case-insensitive search with instant results | ||
| - Dynamic placeholders (WBH_SEARCH_MODULES/WBH_SEARCH_MASTERS) | ||
| - No results message handling | ||
| - **Text Truncation with Hover Display**: | ||
| - Smart ellipsis for long module/master names | ||
| - Full text display on hover with visual feedback | ||
| - CSS class: `employee-card-sub-header` | ||
| - **Enhanced Navigation Flow**: | ||
| - Two-step process: Modules → Masters → Management | ||
| - Back button navigation with state management | ||
| - URL parameter support for deep-linking | ||
|
|
||
| #### Technical Improvements: | ||
| - **Component Architecture**: | ||
| - Replaced Dropdown components with Card components | ||
| - Added TextInput for search functionality | ||
| - Implemented useMemo for efficient filtering | ||
| - **SCSS Integration**: | ||
| - Moved styles from MDMSCards.css to workbench.scss | ||
| - Theme variables integration (digitv2.lightTheme) | ||
| - Responsive breakpoints using theme screens | ||
| - **State Management**: | ||
| - New state: `searchQuery`, `showModules` | ||
| - Filtered data using `filteredModules`, `filteredMasters` | ||
| - Auto-clear search on navigation | ||
|
|
||
| #### Performance: | ||
| - Search response time < 100ms | ||
| - 50% reduction in clicks to reach target | ||
| - 30% faster navigation overall | ||
|
|
||
| #### Global Config Support: | ||
| - Compatible with `OVERRIDE_ROOT_TENANT_WITH_LOGGEDIN_TENANT` flag | ||
| - Supports multi-tenant configurations | ||
| - Increased schema limit from 200 to 500 | ||
|
|
||
| ## [1.0.28] [30-July-2025] | ||
| - Workbench View and edit state issues | ||
| - | ||
| ## [1.0.27] [29-Jul-2025] | ||
| - File Upload Issues Resolved & Edit MDMS view incorrect data fix | ||
|
|
||
| ## [1.0.26] [18-Jun-2025] | ||
| - Provided schema download & upload | ||
|
|
||
| ## [1.0.25] [16-Jun-2025] | ||
| - Set default download capability disabled 'ENABLE_MDMS_BULK_DOWNLOAD' | ||
|
|
||
| ## [1.0.24] [16-Jun-2025] | ||
| - provided download of all data per schema & enable based on flag | ||
| - flag name 'ENABLE_MDMS_BULK_DOWNLOAD' | ||
|
|
||
|
|
||
| ## [1.8.23] [10-Jun-2025] | ||
| - integrated with updated version | ||
|
|
||
| ## [1.0.22] [28-Apr-2025] | ||
| - Localization Bulk Upload - Updated SheetName and Column Widths | ||
|
|
||
| ## [1.0.21] [8-Apr-2025] | ||
| - Manage Sidebars | ||
|
|
||
| ## [1.0.20] [25-Mar-2025] | ||
| - Enhancements in Localization Add Screen - Bulk Upload | ||
|
|
||
| ## [1.0.19] [3-Mar-2025] | ||
| - Disabled json-edit-react & enable based on flag | ||
| - Introduced new Globalvariable to enable bulk upload of master dataa 'ENABLE_JSON_EDIT' | ||
|
|
||
|
|
||
| ## [1.0.18] [25-Feb-2025] | ||
| - Compilation issue fix | ||
|
|
||
| ## [1.0.17] [25-Feb-2025] | ||
| - Added json-edit-react to view and edit schema data | ||
|
|
||
| ## [1.0.15] [21-Feb-2025] | ||
| - Publishing a new version for more stability & as part of Components Release | ||
|
|
||
| ## [1.0.13] [3-Feb-2025] | ||
| - Updated some of the loader component | ||
| - fixed the add master data issue | ||
|
|
||
| ## [1.0.13] [1-Feb-2025] | ||
| - FEATURE/HCMPRE-1425 : Added the workbench module patches and Updated localisation search screen, and core module #2181 | ||
| - Upgraded with new Components in core, workbench screens | ||
| - Introduced new Globalvariable to enable bulk upload of master dataa 'ENABLE_MDMS_BULK_UPLOAD' | ||
| - Localisation search introduced a search bar for better usablility | ||
| - Enhanced support for Customisations | ||
|
|
||
| ## [1.0.11] | ||
| - added support for dynamic locale in workbench module with key CORE_UI_MODULE_LOCALE_PREFIX | ||
|
|
||
| ## [1.0.3] | ||
| - Fixed the module stablity & new components integrated | ||
|
|
||
| ## [1.0.0] | ||
| - Base version. |
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.
🧹 Nitpick | 🔵 Trivial
Address markdown formatting issues in the changelog.
The static analysis tool has identified several markdown formatting issues that should be addressed for better readability and standards compliance:
- Missing blank lines around headings: Add blank lines before and after heading declarations per MD022
- Trailing spaces: Remove trailing spaces at the end of lines (MD009)
- Top-level heading: Consider starting the file with a top-level heading (MD041)
- Word consistency: Use consistent spelling - either "localisation" or "localization" throughout (lines 183, 186)
- Word repetition: Line 148 appears to have a duplicated word ("flag")
These issues don't affect functionality but improving the markdown formatting will enhance documentation quality and maintainability.
🧰 Tools
🪛 LanguageTool
[uncategorized] ~21-~21: If this is a compound adjective that modifies the following noun, use a hyphen.
Context: ...lipsis for long module/master names - Full text display on hover with visual feedback ...
(EN_COMPOUND_ADJECTIVE_INTERNAL)
[style] ~27-~27: ‘with success’ might be wordy. Consider a shorter alternative.
Context: ...file formats - Real-time progress bar with success/error tracking - Batch processing wit...
(EN_WORDINESS_PREMIUM_WITH_SUCCESS)
[uncategorized] ~104-~104: If this is a compound adjective that modifies the following noun, use a hyphen.
Context: ...lipsis for long module/master names - Full text display on hover with visual feedback ...
(EN_COMPOUND_ADJECTIVE_INTERNAL)
[duplication] ~148-~148: Possible typo: you repeated a word.
Context: ...f all data per schema & enable based on flag - flag name 'ENABLE_MDMS_BULK_DOWNLOAD' ## [...
(ENGLISH_WORD_REPEAT_RULE)
[uncategorized] ~183-~183: Do not mix variants of the same word (‘localisation’ and ‘localization’) within a single text.
Context: ...he workbench module patches and Updated localisation search screen, and core module #2181 - ...
(EN_WORD_COHERENCY)
[uncategorized] ~186-~186: Do not mix variants of the same word (‘localisation’ and ‘localization’) within a single text.
Context: ...aster dataa 'ENABLE_MDMS_BULK_UPLOAD' - Localisation search introduced a search bar for bett...
(EN_WORD_COHERENCY)
🪛 markdownlint-cli2 (0.18.1)
2-2: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
2-2: First line in a file should be a top-level heading
(MD041, first-line-heading, first-line-h1)
3-3: Trailing spaces
Expected: 0 or 2; Actual: 1
(MD009, no-trailing-spaces)
9-9: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
14-14: Trailing spaces
Expected: 0 or 2; Actual: 1
(MD009, no-trailing-spaces)
19-19: Trailing spaces
Expected: 0 or 2; Actual: 1
(MD009, no-trailing-spaces)
24-24: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
36-36: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
48-48: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
49-49: Trailing spaces
Expected: 0 or 2; Actual: 1
(MD009, no-trailing-spaces)
60-60: Trailing spaces
Expected: 0 or 2; Actual: 1
(MD009, no-trailing-spaces)
66-66: Trailing spaces
Expected: 0 or 2; Actual: 1
(MD009, no-trailing-spaces)
71-71: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
77-77: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
82-82: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
85-85: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
92-92: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
97-97: Trailing spaces
Expected: 0 or 2; Actual: 1
(MD009, no-trailing-spaces)
102-102: Trailing spaces
Expected: 0 or 2; Actual: 1
(MD009, no-trailing-spaces)
111-111: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
112-112: Trailing spaces
Expected: 0 or 2; Actual: 1
(MD009, no-trailing-spaces)
116-116: Trailing spaces
Expected: 0 or 2; Actual: 1
(MD009, no-trailing-spaces)
120-120: Trailing spaces
Expected: 0 or 2; Actual: 1
(MD009, no-trailing-spaces)
125-125: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
130-130: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
135-135: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
136-136: Trailing spaces
Expected: 0 or 2; Actual: 1
(MD009, no-trailing-spaces)
137-137: Trailing spaces
Expected: 0 or 2; Actual: 1
(MD009, no-trailing-spaces)
138-138: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Above
(MD022, blanks-around-headings)
138-138: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
139-139: Trailing spaces
Expected: 0 or 2; Actual: 3
(MD009, no-trailing-spaces)
141-141: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
144-144: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
147-147: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
152-152: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
155-155: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
158-158: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
161-161: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
164-164: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
169-169: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
172-172: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
175-175: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
178-178: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
182-182: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
189-189: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
192-192: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
195-195: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
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
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
health/micro-ui/web/micro-ui-internals/packages/modules/health-hrms/src/pages/employee/employeeDetails.js (1)
519-545:reasonMsgwiring is consistent but could be more expressivePassing
reasonMsg={false}for deactivation andreasonMsg={true}for activation correctly matches the conditional label logic inDeactivatePopUp. For readability, consider renaming the prop to something boolean-descriptive (e.g.isActivationFlow) so the call sites self-document the intent without needing to inspect the child component.health/micro-ui/web/micro-ui-internals/packages/modules/health-hrms/src/components/pageComponents/DeactivatePopUp.js (1)
6-69: ClarifyreasonMsgprop name and harden MDMS option access
- The
reasonMsgprop is a boolean flag controlling activation vs. deactivation labels, but its name suggests it should contain a message string. Rename toisActivationReasonoractivationModeto prevent future confusion and accidental non-boolean values being passed.- Line 59:
data?.["egov-hrms"]?.DeactivationReason.map(...)will crash ifDeactivationReasonis undefined. Use(data?.["egov-hrms"]?.DeactivationReason ?? []).map(...)ordata?.["egov-hrms"]?.DeactivationReason?.map(...)to safely handle missing MDMS data.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
⛔ Files ignored due to path filters (3)
health/micro-ui/web/micro-ui-internals/example/package.jsonis excluded by!**/*.jsonhealth/micro-ui/web/workbench/package.jsonis excluded by!**/*.jsonmicro-ui/web/workbench/package.jsonis excluded by!**/*.json
📒 Files selected for processing (2)
health/micro-ui/web/micro-ui-internals/packages/modules/health-hrms/src/components/pageComponents/DeactivatePopUp.js(2 hunks)health/micro-ui/web/micro-ui-internals/packages/modules/health-hrms/src/pages/employee/employeeDetails.js(5 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.js
⚙️ CodeRabbit configuration file
check
Files:
health/micro-ui/web/micro-ui-internals/packages/modules/health-hrms/src/pages/employee/employeeDetails.jshealth/micro-ui/web/micro-ui-internals/packages/modules/health-hrms/src/components/pageComponents/DeactivatePopUp.js
🧠 Learnings (3)
📚 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/health-hrms/src/pages/employee/employeeDetails.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/health-hrms/src/pages/employee/employeeDetails.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/health-hrms/src/pages/employee/employeeDetails.js
🧬 Code graph analysis (1)
health/micro-ui/web/micro-ui-internals/packages/modules/health-hrms/src/pages/employee/employeeDetails.js (3)
health/micro-ui/web/micro-ui-internals/packages/modules/health-hrms/src/components/pageComponents/DeactivatePopUp.js (3)
reason(15-15)order(16-16)comment(12-12)health/micro-ui/web/micro-ui-internals/packages/modules/health-hrms/src/services/boundary/BoundarySearch.js (1)
order(2-2)health/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/services/boundary/BoundaryService.js (1)
order(2-2)
⏰ 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/health-hrms/src/pages/employee/employeeDetails.js (2)
203-216: Centered Loader wrapper looks correctWrapping
<Loader />in a full-viewport flex container cleanly centers the spinner and keeps the loading state constrained to a single return path for bothisLoadingandisMDMSLoading.
444-445: NoResultsFound JSX tweak is benignThe change to
<NoResultsFound />is purely formatting and preserves behavior; no issues here.
| const deActivateUser = async (comment, date, reason, order) => { | ||
| let employeeData = { | ||
| ...data?.Employees[0], // Keep existing data | ||
| isActive: false, // Update isActive to false | ||
| deactivationDetails: [ | ||
| let updatedDeactivationDetails = []; | ||
|
|
||
| const existingEmployee = data?.Employees[0]; | ||
|
|
||
| if (existingEmployee.deactivationDetails && existingEmployee.deactivationDetails.length > 0) { | ||
| // Update the first object | ||
| updatedDeactivationDetails = existingEmployee.deactivationDetails.map((item, index) => | ||
| index === 0 | ||
| ? { | ||
| ...item, | ||
| effectiveFrom: Date.now(), | ||
| reasonForDeactivation: reason, | ||
| remarks: order, | ||
| orderNo: comment, | ||
| } | ||
| : item | ||
| ); | ||
| } else { | ||
| // Create a new object if no existing objects | ||
| updatedDeactivationDetails = [ | ||
| { | ||
| effectiveFrom: Date.now(), // Use the current timestamp | ||
| effectiveFrom: Date.now(), | ||
| reasonForDeactivation: reason, | ||
| remarks: order, | ||
| orderNo: comment, | ||
| }, | ||
| ], | ||
| ]; | ||
| } | ||
|
|
||
| let employeeData = { | ||
| ...data?.Employees[0], // Keep existing data | ||
| isActive: false, // Update isActive to false | ||
| deactivationDetails: updatedDeactivationDetails, | ||
| }; | ||
|
|
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.
🧩 Analysis chain
🏁 Script executed:
find . -type f -name "employeeDetails.js" | grep -E "health-hrms|health/micro-ui"Repository: egovernments/DIGIT-Frontend
Length of output: 178
🏁 Script executed:
wc -l ./health/micro-ui/web/micro-ui-internals/packages/modules/health-hrms/src/pages/employee/employeeDetails.jsRepository: egovernments/DIGIT-Frontend
Length of output: 182
🏁 Script executed:
sed -n '60,130p' ./health/micro-ui/web/micro-ui-internals/packages/modules/health-hrms/src/pages/employee/employeeDetails.js | cat -nRepository: egovernments/DIGIT-Frontend
Length of output: 3007
🏁 Script executed:
sed -n '1,60p' ./health/micro-ui/web/micro-ui-internals/packages/modules/health-hrms/src/pages/employee/employeeDetails.js | cat -nRepository: egovernments/DIGIT-Frontend
Length of output: 2988
🏁 Script executed:
grep -n "deActivateUser" ./health/micro-ui/web/micro-ui-internals/packages/modules/health-hrms/src/pages/employee/employeeDetails.jsRepository: egovernments/DIGIT-Frontend
Length of output: 202
🏁 Script executed:
sed -n '500,545p' ./health/micro-ui/web/micro-ui-internals/packages/modules/health-hrms/src/pages/employee/employeeDetails.js | cat -nRepository: egovernments/DIGIT-Frontend
Length of output: 1705
🏁 Script executed:
grep -n "setOpenModal(true)" ./health/micro-ui/web/micro-ui-internals/packages/modules/health-hrms/src/pages/employee/employeeDetails.jsRepository: egovernments/DIGIT-Frontend
Length of output: 114
🏁 Script executed:
sed -n '450,500p' ./health/micro-ui/web/micro-ui-internals/packages/modules/health-hrms/src/pages/employee/employeeDetails.js | cat -nRepository: egovernments/DIGIT-Frontend
Length of output: 2073
🏁 Script executed:
sed -n '200,250p' ./health/micro-ui/web/micro-ui-internals/packages/modules/health-hrms/src/pages/employee/employeeDetails.js | cat -nRepository: egovernments/DIGIT-Frontend
Length of output: 1850
🏁 Script executed:
sed -n '215,225p' ./health/micro-ui/web/micro-ui-internals/packages/modules/health-hrms/src/pages/employee/employeeDetails.js | cat -nRepository: egovernments/DIGIT-Frontend
Length of output: 398
Add defensive null-check and reuse existingEmployee in deActivateUser
The deActivateUser function has two robustness issues:
const existingEmployee = data?.Employees[0];will yieldundefinedifEmployeesis empty or missing; accessingexistingEmployee.deactivationDetailson line 82 will then throw. Add an explicit null check before proceeding.- When building
employeeData(line 108), you spreaddata?.Employees[0]again instead of reusing the already-derivedexistingEmployee. This repeats the unsafe access and should be simplified.
A safer version:
+ const existingEmployee = data?.Employees?.[0];
+ if (!existingEmployee) {
+ return;
+ }
+
let updatedDeactivationDetails = [];
-
- const existingEmployee = data?.Employees[0];
if (existingEmployee.deactivationDetails && existingEmployee.deactivationDetails.length > 0) {
// Update the first object
updatedDeactivationDetails = existingEmployee.deactivationDetails.map((item, index) =>
index === 0
? {
...item,
effectiveFrom: Date.now(),
reasonForDeactivation: reason,
remarks: order,
orderNo: comment,
}
: item
);
} else {
// Create a new object if no existing objects
updatedDeactivationDetails = [
{
effectiveFrom: Date.now(),
reasonForDeactivation: reason,
remarks: order,
orderNo: comment,
},
];
}
let employeeData = {
- ...data?.Employees[0],
+ ...existingEmployee,
isActive: false,
deactivationDetails: updatedDeactivationDetails,
};🤖 Prompt for AI Agents
In
health/micro-ui/web/micro-ui-internals/packages/modules/health-hrms/src/pages/employee/employeeDetails.js
around lines 80 to 115, deActivateUser assumes data?.Employees[0] exists which
can be undefined and causes a crash when accessing deactivationDetails; also the
code re-reads data?.Employees[0] instead of reusing existingEmployee. Fix by
first guarding with an explicit null check (if !existingEmployee handle
gracefully — e.g., return early, show error, or initialize a new employee
object), then use the existingEmployee variable when creating employeeData
(spread existingEmployee instead of data?.Employees[0]), and ensure
deactivationDetails is always an array (default to [] when undefined) before
mapping or pushing the new object.
Choose the appropriate template for your PR:
Feature/Bugfix Request
JIRA ID
Module
Description
Summary by CodeRabbit
New Features
Bug Fixes / UX
Documentation
Chores
✏️ Tip: You can customize this high-level summary in your review settings.