-
Notifications
You must be signed in to change notification settings - Fork 49
Dummy loader change css upgrade checklist change mdms rename #3598 #3599
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: console
Are you sure you want to change the base?
Conversation
- Added ReactDOM import to AppHelpTutorial component - Wrapped AppHelpDrawer JSX with ReactDOM.createPortal to render the tutorial overlay directly to document.body - This prevents z-index and stacking context issues when the component is nested inside other elements 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
…ing delivery rules (#3515) GIT-3473:: Delivery rules fixes during update flow and refetching delivery rules
* Added boundary-management api integration * updated button variation
…aign fix, checkist issue fix
📝 WalkthroughWalkthroughThis PR updates CSS dependency versions across multiple HTML files, refactors MDMS schema references throughout the campaign manager module (renaming schema codes), enhances the MobileChecklist component to support multiple field types, renames the DummyLoader component to AppConfigInitializer, removes unused Redux logic, and adjusts CSS spacing and navigation paths. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes
Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (2 warnings, 2 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: 4
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (3)
health/micro-ui/web/packages/modules/campaign-manager/src/pages/employee/NewAppConfiguration/AppConfigSaveLoader.js (2)
56-58: Add validation before data transformation.The code calls
transformMdmsToAppConfigbefore verifying thatappConfigResponse.mdmsexists (checked later on line 60). This can lead to:
- Line 56: Potential TypeError if
response.mdmsis null/undefined rather than an array- Line 58: Undefined version passed to
transformMdmsToAppConfigwhen no existing config existsApply this diff to add validation:
- const fullData = response?.mdms && response?.mdms?.map((item) => item.data); - - const transformedData = transformMdmsToAppConfig(fullData, appConfigResponse.mdms?.[0].data?.version); - // Step 3: Update the existing config's mdms property with transformedData if (appConfigResponse?.mdms && appConfigResponse.mdms.length > 0) { + if (!response?.mdms || !Array.isArray(response.mdms)) { + console.error("No TransformedFormConfig data found"); + setShowToast({ key: "error", label: "APP_CONFIG_UPDATE_FAILED" }); + setTimeout(() => navigate(-1), 3000); + return; + } + + const fullData = response.mdms.map((item) => item.data); + const transformedData = transformMdmsToAppConfig(fullData, appConfigResponse.mdms[0].data?.version); + const existingConfig = appConfigResponse.mdms?.[0].data;
85-87: Consider state-based navigation instead of setTimeout.The current pattern uses
setTimeoutfor navigation, which can be fragile if the component unmounts during the delay or if the user expects immediate feedback.Consider these alternatives:
- Navigate immediately after showing the toast and let the next screen handle the message display
- Add a button to the toast for user-controlled navigation
- Store navigation intent in state and use it in a cleanup-safe way
Example for immediate navigation with toast on next screen:
- setLoaderText("APP_CONFIG_SUBMITTED_REDIRECTING"); - setTimeout(() => { - navigate(`/${window?.contextPath}/employee/campaign/new-app-modules?campaignNumber=${campaignNumber}&tenantId=${tenantId}`); - }, 3000); + navigate( + `/${window?.contextPath}/employee/campaign/new-app-modules?campaignNumber=${campaignNumber}&tenantId=${tenantId}`, + { state: { successMessage: "APP_CONFIG_SUBMITTED" } } + );Also applies to: 92-94, 100-102
health/micro-ui/web/packages/modules/campaign-manager/src/pages/employee/NewCampaignCreate/AppConfigInitializer.js (1)
36-122: Improve error handling for better user experience.The error handling in the
useEffectonly logs errors to the console (line 116), which means users could be stuck on a loading screen indefinitely if API calls fail. Consider adding user-facing error feedback.Apply this diff to add error state and user feedback:
+import { Toast } from "@egovernments/digit-ui-components"; + const AppConfigInitializer = () => { const { t } = useTranslation(); const navigate = useNavigate(); + const [error, setError] = useState(null); const searchParams = new URLSearchParams(location.search); // ... rest of code useEffect(() => { if (mdmsData && mdmsData.length > 0) { const processData = async () => { try { + setError(null); // ... existing code } catch (error) { console.error("Error processing MDMS data:", error); + setError(t("ERROR_PROCESSING_CONFIG")); } }; processData(); } }, [mdmsData, campaignNumber, flow, navigate, tenantId]); + if (error) { + return ( + <div style={{ display: "flex", flexDirection: "column", alignItems: "center", marginTop: "2rem" }}> + <Toast type="error" label={error} onClose={() => setError(null)} /> + <Button + label={t("GO_BACK")} + onClick={() => navigate(-1)} + variation="secondary" + style={{ marginTop: "1rem" }} + /> + </div> + ); + } + return <Loader page={true} variant={"OverlayLoader"} loaderText={t("LOADING_MODULE", { module: flow, campaign: campaignNumber })} />; };
♻️ Duplicate comments (3)
health/micro-ui/web/builds/console/public/index.html (1)
13-13: Same CSS version update as core-ui build.This CSS version update is consistent with the change in
health/micro-ui/web/builds/core-ui/public/index.html. Refer to the verification request in that file.health/micro-ui/web/public/index.html (1)
13-13: CSS version update consistent with other builds.The CSS version update to 0.1.19-rc19 is consistent across all build artifacts. Refer to the verification request in
health/micro-ui/web/builds/core-ui/public/index.html.health/micro-ui/web/builds/workbench-ui/public/index.html (1)
13-13: CSS version update consistent with other builds.The CSS version update to 0.1.19-rc19 matches the coordinated change across all build artifacts. Refer to the verification request in
health/micro-ui/web/builds/core-ui/public/index.html.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
⛔ Files ignored due to path filters (7)
health/configs/Schemas/HCM-ADMIN-CONSOLE.FieldPropertiesPanelConfig.jsonis excluded by!**/*.jsonhealth/configs/Schemas/HCM-ADMIN-CONSOLE.FieldTypeConfig.jsonis excluded by!**/*.jsonhealth/configs/Schemas/HCM-ADMIN-CONSOLE.FormConfig.jsonis excluded by!**/*.jsonhealth/configs/Schemas/HCM-ADMIN-CONSOLE.FormConfigTemplate.jsonis excluded by!**/*.jsonhealth/configs/Schemas/HCM-ADMIN-CONSOLE.TransformedFormConfig.jsonis excluded by!**/*.jsonhealth/micro-ui/web/packages/css/package.jsonis excluded by!**/*.jsonhealth/micro-ui/web/packages/modules/campaign-manager/package.jsonis excluded by!**/*.json
📒 Files selected for processing (17)
health/micro-ui/web/builds/console/public/index.html(1 hunks)health/micro-ui/web/builds/core-ui/public/index.html(1 hunks)health/micro-ui/web/builds/workbench-ui/public/index.html(1 hunks)health/micro-ui/web/packages/css/src/pages/employee/campaign.scss(1 hunks)health/micro-ui/web/packages/css/src/pages/employee/checklist.scss(2 hunks)health/micro-ui/web/packages/modules/campaign-manager/src/components/MobileChecklist.js(3 hunks)health/micro-ui/web/packages/modules/campaign-manager/src/pages/employee/NewAppConfiguration/AppConfigSaveLoader.js(3 hunks)health/micro-ui/web/packages/modules/campaign-manager/src/pages/employee/NewAppConfiguration/AppConfigurationWrapper.js(5 hunks)health/micro-ui/web/packages/modules/campaign-manager/src/pages/employee/NewAppConfiguration/NewDrawerFieldComposer.js(2 hunks)health/micro-ui/web/packages/modules/campaign-manager/src/pages/employee/NewAppConfiguration/redux/localizationSlice.js(0 hunks)health/micro-ui/web/packages/modules/campaign-manager/src/pages/employee/NewAppConfiguration/redux/pageFieldsSlice.js(1 hunks)health/micro-ui/web/packages/modules/campaign-manager/src/pages/employee/NewCampaignCreate/AppConfigInitializer.js(6 hunks)health/micro-ui/web/packages/modules/campaign-manager/src/pages/employee/NewCampaignCreate/AppFeatures.js(2 hunks)health/micro-ui/web/packages/modules/campaign-manager/src/pages/employee/NewCampaignCreate/CampaignHome.js(1 hunks)health/micro-ui/web/packages/modules/campaign-manager/src/pages/employee/NewCampaignCreate/NewAppModule.js(2 hunks)health/micro-ui/web/packages/modules/campaign-manager/src/pages/employee/index.js(2 hunks)health/micro-ui/web/public/index.html(1 hunks)
💤 Files with no reviewable changes (1)
- health/micro-ui/web/packages/modules/campaign-manager/src/pages/employee/NewAppConfiguration/redux/localizationSlice.js
🧰 Additional context used
📓 Path-based instructions (1)
**/*.js
⚙️ CodeRabbit configuration file
check
Files:
health/micro-ui/web/packages/modules/campaign-manager/src/pages/employee/NewAppConfiguration/AppConfigSaveLoader.jshealth/micro-ui/web/packages/modules/campaign-manager/src/pages/employee/NewCampaignCreate/NewAppModule.jshealth/micro-ui/web/packages/modules/campaign-manager/src/pages/employee/NewCampaignCreate/CampaignHome.jshealth/micro-ui/web/packages/modules/campaign-manager/src/pages/employee/index.jshealth/micro-ui/web/packages/modules/campaign-manager/src/pages/employee/NewAppConfiguration/AppConfigurationWrapper.jshealth/micro-ui/web/packages/modules/campaign-manager/src/pages/employee/NewCampaignCreate/AppConfigInitializer.jshealth/micro-ui/web/packages/modules/campaign-manager/src/pages/employee/NewAppConfiguration/redux/pageFieldsSlice.jshealth/micro-ui/web/packages/modules/campaign-manager/src/pages/employee/NewCampaignCreate/AppFeatures.jshealth/micro-ui/web/packages/modules/campaign-manager/src/components/MobileChecklist.jshealth/micro-ui/web/packages/modules/campaign-manager/src/pages/employee/NewAppConfiguration/NewDrawerFieldComposer.js
🧠 Learnings (18)
📓 Common learnings
Learnt from: siddhant-nawale-egov
Repo: egovernments/DIGIT-Frontend PR: 741
File: micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/Module.js:15-15
Timestamp: 2024-10-08T20:11:12.539Z
Learning: When adding a new module code like "campaignmanager" to `moduleCode`, ensure that it is properly handled in all relevant conditional checks and function parameters across the codebase.
📚 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/builds/core-ui/public/index.htmlhealth/micro-ui/web/builds/console/public/index.htmlhealth/micro-ui/web/builds/workbench-ui/public/index.htmlhealth/micro-ui/web/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/packages/modules/campaign-manager/src/pages/employee/NewAppConfiguration/AppConfigSaveLoader.jshealth/micro-ui/web/packages/modules/campaign-manager/src/pages/employee/NewCampaignCreate/NewAppModule.jshealth/micro-ui/web/packages/modules/campaign-manager/src/pages/employee/index.jshealth/micro-ui/web/packages/modules/campaign-manager/src/pages/employee/NewAppConfiguration/AppConfigurationWrapper.jshealth/micro-ui/web/packages/modules/campaign-manager/src/pages/employee/NewAppConfiguration/redux/pageFieldsSlice.jshealth/micro-ui/web/packages/modules/campaign-manager/src/pages/employee/NewCampaignCreate/AppFeatures.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/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:
health/micro-ui/web/packages/modules/campaign-manager/src/pages/employee/NewAppConfiguration/AppConfigSaveLoader.jshealth/micro-ui/web/builds/console/public/index.htmlhealth/micro-ui/web/packages/modules/campaign-manager/src/components/MobileChecklist.js
📚 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:
health/micro-ui/web/packages/modules/campaign-manager/src/pages/employee/NewAppConfiguration/AppConfigSaveLoader.jshealth/micro-ui/web/packages/modules/campaign-manager/src/pages/employee/NewCampaignCreate/NewAppModule.jshealth/micro-ui/web/packages/modules/campaign-manager/src/pages/employee/NewCampaignCreate/AppConfigInitializer.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/packages/modules/campaign-manager/src/pages/employee/NewAppConfiguration/AppConfigSaveLoader.js
📚 Learning: 2024-10-08T20:11:12.539Z
Learnt from: siddhant-nawale-egov
Repo: egovernments/DIGIT-Frontend PR: 741
File: micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/Module.js:15-15
Timestamp: 2024-10-08T20:11:12.539Z
Learning: When adding a new module code like "campaignmanager" to `moduleCode`, ensure that it is properly handled in all relevant conditional checks and function parameters across the codebase.
Applied to files:
health/micro-ui/web/packages/modules/campaign-manager/src/pages/employee/NewCampaignCreate/NewAppModule.jshealth/micro-ui/web/packages/modules/campaign-manager/src/pages/employee/NewCampaignCreate/AppFeatures.js
📚 Learning: 2024-11-07T07:17:27.636Z
Learnt from: jagankumar-egov
Repo: egovernments/DIGIT-Frontend PR: 1763
File: health/micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/src/pages/employee/MyCampaign.js:65-75
Timestamp: 2024-11-07T07:17:27.636Z
Learning: In `MyCampaign.js`, when suggesting code improvements for the `onClickRow` function, keep suggestions simple and avoid unnecessary complexity.
Applied to files:
health/micro-ui/web/packages/modules/campaign-manager/src/pages/employee/NewCampaignCreate/NewAppModule.jshealth/micro-ui/web/packages/modules/campaign-manager/src/pages/employee/NewCampaignCreate/CampaignHome.jshealth/micro-ui/web/packages/modules/campaign-manager/src/components/MobileChecklist.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/packages/modules/campaign-manager/src/pages/employee/NewCampaignCreate/NewAppModule.jshealth/micro-ui/web/packages/modules/campaign-manager/src/pages/employee/NewCampaignCreate/CampaignHome.jshealth/micro-ui/web/packages/modules/campaign-manager/src/pages/employee/index.jshealth/micro-ui/web/packages/modules/campaign-manager/src/pages/employee/NewAppConfiguration/redux/pageFieldsSlice.jshealth/micro-ui/web/packages/modules/campaign-manager/src/pages/employee/NewCampaignCreate/AppFeatures.jshealth/micro-ui/web/packages/modules/campaign-manager/src/pages/employee/NewAppConfiguration/NewDrawerFieldComposer.js
📚 Learning: 2024-06-10T19:25:42.992Z
Learnt from: siddhant-nawale-egov
Repo: egovernments/DIGIT-Frontend PR: 0
File: :0-0
Timestamp: 2024-06-10T19:25:42.992Z
Learning: The `onStepClick` logic in `CreateMicroplan.js` is intentionally commented out to allow developers to navigate between screens during development, even though not all screens are made yet.
Applied to files:
health/micro-ui/web/packages/modules/campaign-manager/src/pages/employee/NewCampaignCreate/NewAppModule.jshealth/micro-ui/web/packages/modules/campaign-manager/src/pages/employee/NewCampaignCreate/CampaignHome.js
📚 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/packages/css/src/pages/employee/checklist.scss
📚 Learning: 2024-10-11T10:00:29.720Z
Learnt from: siddhant-nawale-egov
Repo: egovernments/DIGIT-Frontend PR: 675
File: micro-ui/web/micro-ui-internals/packages/css/src/components/microplanning.scss:649-652
Timestamp: 2024-10-11T10:00:29.720Z
Learning: The use of `!important` in the `.excel-wrapper` CSS class is necessary to prevent the styles from being overridden in certain contexts.
Applied to files:
health/micro-ui/web/packages/css/src/pages/employee/checklist.scss
📚 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/packages/modules/campaign-manager/src/pages/employee/NewAppConfiguration/AppConfigurationWrapper.jshealth/micro-ui/web/packages/modules/campaign-manager/src/components/MobileChecklist.jshealth/micro-ui/web/public/index.html
📚 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/packages/css/src/pages/employee/campaign.scss
📚 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/packages/modules/campaign-manager/src/pages/employee/NewCampaignCreate/AppConfigInitializer.jshealth/micro-ui/web/public/index.html
📚 Learning: 2024-10-08T20:11:12.539Z
Learnt from: siddhant-nawale-egov
Repo: egovernments/DIGIT-Frontend PR: 691
File: micro-ui/web/micro-ui-internals/packages/modules/hcm-microplanning/src/components/Upload.js:16-17
Timestamp: 2024-10-08T20:11:12.539Z
Learning: The components `Loader`, `Toast`, and `Modal` are from different libraries in the DIGIT-Frontend project, as clarified by the user.
Applied to files:
health/micro-ui/web/packages/modules/campaign-manager/src/pages/employee/NewCampaignCreate/AppConfigInitializer.js
📚 Learning: 2024-06-14T14:10:38.086Z
Learnt from: siddhant-nawale-egov
Repo: egovernments/DIGIT-Frontend PR: 876
File: micro-ui/web/micro-ui-internals/packages/css/src/components/microplanning.scss:1940-2392
Timestamp: 2024-06-14T14:10:38.086Z
Learning: Classes related to interactive elements in the microplan preview section are mostly passed to Higher Order Components (HOCs), and ARIA attributes for non-HOC elements will be managed directly by adding them where necessary.
Applied to files:
health/micro-ui/web/packages/modules/campaign-manager/src/components/MobileChecklist.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/packages/modules/campaign-manager/src/pages/employee/NewAppConfiguration/NewDrawerFieldComposer.js
🧬 Code graph analysis (5)
health/micro-ui/web/packages/modules/campaign-manager/src/pages/employee/NewAppConfiguration/AppConfigSaveLoader.js (5)
health/micro-ui/web/packages/modules/campaign-manager/src/pages/employee/NewAppConfiguration/redux/pageFieldsSlice.js (2)
response(15-30)mdmsContext(3-3)health/micro-ui/web/packages/modules/campaign-manager/src/pages/employee/NewAppConfiguration/redux/localizationSlice.js (2)
response(12-16)response(36-36)health/micro-ui/web/packages/modules/campaign-manager/src/pages/employee/NewAppConfiguration/redux/flowPagesSlice.js (2)
response(10-24)mdmsContext(3-3)health/micro-ui/web/packages/modules/campaign-manager/src/pages/employee/NewAppConfiguration/AppConfigurationWrapper.js (2)
mdmsContext(18-18)tenantId(16-16)health/micro-ui/web/packages/modules/campaign-manager/src/pages/employee/NewAppConfiguration/FullConfigWrapper.js (2)
mdmsContext(15-15)tenantId(24-24)
health/micro-ui/web/packages/modules/campaign-manager/src/pages/employee/NewCampaignCreate/NewAppModule.js (1)
health/micro-ui/web/packages/modules/campaign-manager/src/pages/employee/NewCampaignCreate/AppModule.js (1)
schemaCode(30-30)
health/micro-ui/web/packages/modules/campaign-manager/src/pages/employee/index.js (1)
health/micro-ui/web/packages/modules/campaign-manager/src/pages/employee/NewCampaignCreate/AppConfigInitializer.js (1)
AppConfigInitializer(9-125)
health/micro-ui/web/packages/modules/campaign-manager/src/pages/employee/NewAppConfiguration/AppConfigurationWrapper.js (6)
health/micro-ui/web/packages/modules/campaign-manager/src/pages/employee/NewAppConfiguration/AppConfigSaveLoader.js (1)
mdmsContext(7-7)health/micro-ui/web/packages/modules/campaign-manager/src/pages/employee/NewAppConfiguration/redux/pageFieldsSlice.js (1)
mdmsContext(3-3)health/micro-ui/web/packages/modules/campaign-manager/src/pages/employee/NewAppConfiguration/FullConfigWrapper.js (1)
mdmsContext(15-15)health/micro-ui/web/packages/modules/campaign-manager/src/pages/employee/NewAppConfiguration/redux/flowPagesSlice.js (1)
mdmsContext(3-3)health/micro-ui/web/packages/modules/campaign-manager/src/pages/employee/NewAppConfiguration/redux/labelFieldPairSlice.js (1)
mdmsContext(7-7)health/micro-ui/web/packages/modules/campaign-manager/src/pages/employee/NewAppConfiguration/redux/localizationSlice.js (1)
MODULE_CONSTANTS(3-3)
health/micro-ui/web/packages/modules/campaign-manager/src/pages/employee/NewAppConfiguration/redux/pageFieldsSlice.js (4)
health/micro-ui/web/packages/modules/campaign-manager/src/Module.js (1)
moduleName(131-131)health/micro-ui/web/packages/modules/campaign-manager/src/pages/employee/NewCampaignCreate/CampaignDetails.js (1)
moduleName(154-154)health/micro-ui/web/packages/modules/campaign-manager/src/pages/employee/NewCampaignCreate/transformMdmsConfig.js (1)
moduleName(16-16)health/micro-ui/web/packages/modules/campaign-manager/src/pages/employee/NewAppConfiguration/NewDependentFieldWrapper.js (1)
moduleName(83-83)
🪛 Biome (2.1.2)
health/micro-ui/web/packages/modules/campaign-manager/src/components/MobileChecklist.js
[error] 53-53: A form label must be associated with an input.
Consider adding a for or htmlFor attribute to the label element or moving the input element to inside the label element.
(lint/a11y/noLabelWithoutControl)
🔇 Additional comments (17)
health/micro-ui/web/packages/modules/campaign-manager/src/pages/employee/NewAppConfiguration/AppConfigSaveLoader.js (2)
22-37: LGTM: schemaCode update aligns with MDMS rename.The update from
NewFormConfigtoTransformedFormConfigis consistent with the broader MDMS schema renaming across the campaign-manager module.
39-54: LGTM: schemaCode update aligns with MDMS rename.The update from
NewApkConfigtoFormConfigis consistent with the broader MDMS schema renaming across the campaign-manager module.health/micro-ui/web/public/index.html (1)
21-21: Verify the global config script change is correct for the target environment.The global config script was changed from
globalConfigsWorkbenchHCMMZ.jstoglobalConfigsWorkbenchDev.js. The "Dev" suffix suggests this is a development environment configuration.Confirm that this is the intended configuration for the deployment target and not an accidental environment mismatch.
health/micro-ui/web/builds/core-ui/public/index.html (1)
13-13: Verify the CSS package version exists and flag security concerns.The package
@egovernments/[email protected]should be verified for availability on unpkg and checked for security vulnerabilities. Confirm the package exists on the CDN and review npm security advisories for this specific version.health/micro-ui/web/packages/modules/campaign-manager/src/pages/employee/NewAppConfiguration/redux/pageFieldsSlice.js (1)
20-20: Schema rename is complete and consistently applied.All references to the old schema have been updated to
TransformedFormConfigacross the campaign manager module. The change follows the established pattern used in other related files (AppFeatures.js, AppConfigInitializer.js, AppConfigurationWrapper.js, AppConfigSaveLoader.js).health/micro-ui/web/packages/modules/campaign-manager/src/pages/employee/NewCampaignCreate/AppFeatures.js (1)
103-103: MDMS schema references updated consistently for cache operations.The MDMS schema references have been updated from
AppConfigCachetoTransformedFormConfigin both:
- The cache data fetch criteria (line 103)
- The cache clearing mutation (line 231)
This maintains consistency between read and write operations and aligns with the broader MDMS schema migration across the campaign-manager module.
Also applies to: 231-231
health/micro-ui/web/packages/modules/campaign-manager/src/pages/employee/NewCampaignCreate/AppConfigInitializer.js (2)
9-9: Component rename completed consistently.The component has been renamed from
DummyLoadertoAppConfigInitializerthroughout the file:
- Component declaration (line 9)
- Default export (line 127)
This aligns with the updated import in
index.jsand the new route pathapp-config-init.Also applies to: 18-18, 127-127
18-18: MDMS schema references are correctly documented.The MDMS schema codes match the code implementation:
- Initial fetch:
FormConfig(line 18)- Existence check:
TransformedFormConfig(line 46)- Creation payload and endpoint:
TransformedFormConfig(lines 74, 80)- Flow config:
AppFlowConfig(line 101)health/micro-ui/web/packages/modules/campaign-manager/src/pages/employee/NewCampaignCreate/NewAppModule.js (1)
15-15: MDMS schema and navigation updates are verified as consistent.The FormConfig schema is properly defined in the MDMS backend as part of HCM-ADMIN-CONSOLE. The changes align with the broader refactoring:
- MDMS schemaCode correctly updated from
NewApkConfigtoFormConfig- Navigation path correctly updated from
dummy-loadertoapp-config-init, matching the component rename (DummyLoader → AppConfigInitializer)- No remaining references to the old
NewApkConfigschema- Both changes are consistent with the related updates in
index.js(route definition) andAppConfigInitializer.js(component rename)health/micro-ui/web/packages/modules/campaign-manager/src/pages/employee/index.js (1)
12-12: Component rename and route update are consistent.The import, route path, and element have been updated consistently:
- Import:
DummyLoader→AppConfigInitializer- Route path:
dummy-loader→app-config-init- Element:
<DummyLoader />→<AppConfigInitializer />Navigation calls throughout the codebase have been updated to use the new
app-config-initroute, and no remaining references to the olddummy-loaderroute exist.health/micro-ui/web/packages/modules/campaign-manager/src/pages/employee/NewAppConfiguration/AppConfigurationWrapper.js (1)
7-7: Removal of fetchAppScreenConfig is safe and verified as complete.The import has been completely removed from this file. A comprehensive search of the entire codebase confirms there are no remaining references to
fetchAppScreenConfig, indicating the cleanup was intentional and thorough. No other parts of the application depend on this function.health/micro-ui/web/packages/css/src/pages/employee/campaign.scss (1)
1026-1029: LGTM!The wrapper simplification aligns with the card-level styling changes. The transparent background and no box-shadow is appropriate for a wrapper container.
health/micro-ui/web/packages/css/src/pages/employee/checklist.scss (1)
453-469: LGTM!The new mobile field wrapper styles properly support the
FieldV1component integration in MobileChecklist. Thewidth: 100%rule ensures proper mobile responsiveness, and themargin-bottom: 0reset on.digit-field-wrapperprevents unwanted spacing accumulation.health/micro-ui/web/packages/modules/campaign-manager/src/pages/employee/NewAppConfiguration/NewDrawerFieldComposer.js (2)
1143-1146: LGTM!The
disablePortalandoptionsCustomStyleproperties are correctly configured for the dropdown within the drawer context.
1065-1084: Remove the unusedcase "textArea":handler in ConditionalField switch statement—it's dead code never reached from current configuration.The conditional fields rendered by this component (lines 104–111) are filtered from
panelItem.conditionalField, which only includes types:text,number,options,dropdown,filters,radioOptions, anddependencyFieldWrapper. No configuration defines a conditional field with type"textArea", so thecase "textArea":at line 1068 is unreachable. Either remove it, or add a conditional field type definition infieldPanelPropertiesSlice.jsif this was intended for future use.Likely an incorrect or invalid review comment.
health/micro-ui/web/packages/modules/campaign-manager/src/components/MobileChecklist.js (2)
1-6: LGTM!The
FieldV1import and filter syntax updates are clean. The component integration properly supports the expanded field type rendering in the mobile checklist preview.
59-93: Consider normalizing type code comparisons for maintainability.The type code checks use various string literals with inconsistent casing (e.g.,
"text"vs"Text","number"vs"Number","numeric"vs"Numeric"). While this likely handles different data sources, it could be brittle if new type codes are added.Consider extracting type codes to constants or using case-insensitive comparison:
const TEXT_INPUT_TYPES = ["Short Answer", "String", "text"]; const TEXTAREA_TYPES = ["Long Answer", "Paragraph", "textarea"]; const NUMBER_TYPES = ["Number", "Integer", "number"]; const NUMERIC_STEPPER_TYPES = ["Numeric", "numeric"]; // Usage: {TEXT_INPUT_TYPES.includes(question.type.code) && ( // render text input )}This improves maintainability when type codes are added or changed.
⛔ Skipped due to learnings
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.
| .digit-campaign-home-card { | ||
| display: flex; | ||
| justify-content: flex-start; | ||
| min-width: 31.25rem; | ||
| max-width: 100%; | ||
| flex: 1; | ||
| width: 31.25rem; |
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
Consider responsive width handling for campaign cards.
The fixed width of 31.25rem (500px) may cause horizontal overflow on smaller screens or narrow viewports. The previous flex-based sizing likely provided better responsiveness.
Consider adding a max-width constraint with responsive fallback:
.digit-campaign-home-card {
display: flex;
justify-content: flex-start;
- width: 31.25rem;
+ width: 31.25rem;
+ max-width: 100%;Alternatively, if the design explicitly requires this fixed width on all screen sizes, ensure the parent container handles overflow appropriately.
📝 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.
| .digit-campaign-home-card { | |
| display: flex; | |
| justify-content: flex-start; | |
| min-width: 31.25rem; | |
| max-width: 100%; | |
| flex: 1; | |
| width: 31.25rem; | |
| .digit-campaign-home-card { | |
| display: flex; | |
| justify-content: flex-start; | |
| width: 31.25rem; | |
| max-width: 100%; |
🤖 Prompt for AI Agents
In health/micro-ui/web/packages/css/src/pages/employee/campaign.scss around
lines 931-934, the .digit-campaign-home-card uses a fixed width: 31.25rem which
can cause horizontal overflow on small viewports; replace the hard width with a
responsive approach such as using max-width: 31.25rem combined with width: 100%
(or a flex-basis-based sizing) so the card shrinks on narrow screens, and
optionally add a media query to enforce the fixed width at larger breakpoints;
if the design truly requires a constant 31.25rem, instead keep the fixed width
but ensure the parent container handles overflow (overflow-x: auto or wrapping)
to avoid layout breakage.
| {question.options.map((option, index) => ( | ||
| <div key={index} className="mobile-option-item"> | ||
| {/* Conditionally render radio or checkbox based on question.type.code */} | ||
| {question.type.code === "SingleValueList" ? ( | ||
| <input | ||
| type="radio" | ||
| name={`question-${question.id}`} | ||
| onClick={(e) => e.preventDefault()} // Prevents interaction | ||
| /> | ||
| ) : ( | ||
| <input | ||
| type="checkbox" | ||
| onClick={(e) => e.preventDefault()} // Prevents interaction | ||
| /> | ||
| )} | ||
| <label className="mobile-answer">{option.label}</label> | ||
| </div> | ||
| ))} | ||
| <div style={{ height: "0.5rem" }}></div> | ||
| </div> | ||
| )} |
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.
Fix accessibility: Associate label with input control.
The static analysis correctly identifies that the <label> on line 53 is not associated with its corresponding input. This breaks screen reader navigation.
Apply this diff to fix the accessibility issue:
{question.type.code === "SingleValueList" ? (
<input
type="radio"
name={`question-${question.id}`}
+ id={`option-${question.id}-${index}`}
onClick={(e) => e.preventDefault()} // Prevents interaction
/>
) : (
<input
type="checkbox"
+ id={`option-${question.id}-${index}`}
onClick={(e) => e.preventDefault()} // Prevents interaction
/>
)}
- <label className="mobile-answer">{option.label}</label>
+ <label htmlFor={`option-${question.id}-${index}`} className="mobile-answer">{option.label}</label>📝 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.
| {question.options.map((option, index) => ( | |
| <div key={index} className="mobile-option-item"> | |
| {/* Conditionally render radio or checkbox based on question.type.code */} | |
| {question.type.code === "SingleValueList" ? ( | |
| <input | |
| type="radio" | |
| name={`question-${question.id}`} | |
| onClick={(e) => e.preventDefault()} // Prevents interaction | |
| /> | |
| ) : ( | |
| <input | |
| type="checkbox" | |
| onClick={(e) => e.preventDefault()} // Prevents interaction | |
| /> | |
| )} | |
| <label className="mobile-answer">{option.label}</label> | |
| </div> | |
| ))} | |
| <div style={{ height: "0.5rem" }}></div> | |
| </div> | |
| )} | |
| {question.options.map((option, index) => ( | |
| <div key={index} className="mobile-option-item"> | |
| {/* Conditionally render radio or checkbox based on question.type.code */} | |
| {question.type.code === "SingleValueList" ? ( | |
| <input | |
| type="radio" | |
| name={`question-${question.id}`} | |
| id={`option-${question.id}-${index}`} | |
| onClick={(e) => e.preventDefault()} // Prevents interaction | |
| /> | |
| ) : ( | |
| <input | |
| type="checkbox" | |
| id={`option-${question.id}-${index}`} | |
| onClick={(e) => e.preventDefault()} // Prevents interaction | |
| /> | |
| )} | |
| <label htmlFor={`option-${question.id}-${index}`} className="mobile-answer">{option.label}</label> | |
| </div> | |
| ))} | |
| <div style={{ height: "0.5rem" }}></div> | |
| </div> | |
| )} |
🧰 Tools
🪛 Biome (2.1.2)
[error] 53-53: A form label must be associated with an input.
Consider adding a for or htmlFor attribute to the label element or moving the input element to inside the label element.
(lint/a11y/noLabelWithoutControl)
🤖 Prompt for AI Agents
In
health/micro-ui/web/packages/modules/campaign-manager/src/components/MobileChecklist.js
around lines 38 to 58, the <label> is not associated with its input which breaks
screen reader navigation; assign each input a stable unique id (e.g.
`question-${question.id}-option-${index}`) and set the corresponding label's
htmlFor to that id so the label is properly linked to the control; keep the
conditional input types and existing attributes (name/type) and ensure keys
remain unique.
| // Make the update call | ||
| const response = await Digit.CustomService.getResponse({ | ||
| url: `/${mdmsContext}/v2/_update/${MODULE_CONSTANTS}.AppConfigCache`, | ||
| url: `/${mdmsContext}/v2/_update/${MODULE_CONSTANTS}.TransformedFormConfig`, |
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
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# First, locate and examine the target file
FILE_PATH="health/micro-ui/web/packages/modules/campaign-manager/src/pages/employee/NewAppConfiguration/AppConfigurationWrapper.js"
# Check if file exists
if [ -f "$FILE_PATH" ]; then
# Display file info and line count
echo "File found. Total lines: $(wc -l < "$FILE_PATH")"
echo ""
echo "=== Lines 95-105 (around line 99) ==="
sed -n '95,105p' "$FILE_PATH"
echo ""
echo "=== Lines 160-170 (around line 163) ==="
sed -n '160,170p' "$FILE_PATH"
echo ""
echo "=== Lines 198-208 (around line 201) ==="
sed -n '198,208p' "$FILE_PATH"
echo ""
echo "=== Lines 209-219 (around line 212) ==="
sed -n '209,219p' "$FILE_PATH"
else
echo "File not found at path: $FILE_PATH"
# Try to find it with fd
echo "Searching for AppConfigurationWrapper.js..."
fd "AppConfigurationWrapper.js" -type f
fiRepository: egovernments/DIGIT-Frontend
Length of output: 1562
🏁 Script executed:
#!/bin/bash
# Search for old schema names in the entire codebase
echo "=== Searching for OLD schema names ==="
echo ""
echo "--- Searching for 'AppConfigCache' ---"
rg -i "AppConfigCache" --type js --type json -A 2 -B 2 || echo "Not found"
echo ""
echo "--- Searching for 'NewFormConfig' ---"
rg -i "NewFormConfig" --type js --type json -A 2 -B 2 || echo "Not found"
echo ""
echo "--- Searching for 'NewFieldType' ---"
rg -i "NewFieldType" --type js --type json -A 2 -B 2 || echo "Not found"
echo ""
echo "--- Searching for 'NewDrawerPanelConfig' ---"
rg -i "NewDrawerPanelConfig" --type js --type json -A 2 -B 2 || echo "Not found"
echo ""
echo "=== Searching for NEW schema names ==="
echo ""
echo "--- Searching for 'TransformedFormConfig' ---"
rg "TransformedFormConfig" --type js --type json | head -20
echo ""
echo "--- Searching for 'FieldTypeMappingConfig' ---"
rg "FieldTypeMappingConfig" --type js --type json | head -20
echo ""
echo "--- Searching for 'FieldPropertiesPanelConfig' ---"
rg "FieldPropertiesPanelConfig" --type js --type json | head -20Repository: egovernments/DIGIT-Frontend
Length of output: 19656
MDMS schema references updated consistently in new implementation.
The MDMS schema references have been correctly updated in AppConfigurationWrapper.js:
- Line 99:
TransformedFormConfigin update URL ✓ - Line 163:
TransformedFormConfigin schemaCode ✓ - Line 201:
FieldTypeMappingConfig✓ - Line 212:
FieldPropertiesPanelConfig✓
These changes are part of a new implementation in health/micro-ui/web/packages/modules/campaign-manager/. Note that AppConfigCache remains in use in a parallel older implementation at micro-ui/web/micro-ui-internals/packages/modules/campaign-manager/, suggesting either a staged rollout or coexisting implementations. Verify that backend MDMS schemas supporting the new schema codes are deployed when this new implementation becomes active.
| onClick={() => { | ||
| navigate( | ||
| `/${window.contextPath}/employee/campaign/campaign-templates?from=home` | ||
| `/${window.contextPath}/employee/campaign/campaign-templates` |
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:
#!/bin/bash
# Description: Find all references to the 'from' query parameter in navigation and breadcrumb logic
# Search for usage of 'from' query parameter
rg -n --type=js -C3 '\bfrom\s*[=:]\s*["\']home["\']' health/micro-ui/web/packages/modules/campaign-manager/
# Search for query parameter parsing of 'from'
rg -n --type=js -C3 'searchParams\.get\(["\']from["\']|\burl\?\.from\b' health/micro-ui/web/packages/modules/campaign-manager/Repository: egovernments/DIGIT-Frontend
Length of output: 139
🏁 Script executed:
#!/bin/bash
# Description: Find all references to the 'from' query parameter in navigation and breadcrumb logic
# Search for usage of 'from' query parameter
rg -n --type=js -C3 'from.*home' health/micro-ui/web/packages/modules/campaign-manager/
# Search for query parameter parsing of 'from'
rg -n --type=js -C3 'url\?\.from' health/micro-ui/web/packages/modules/campaign-manager/
# Search for searchParams.get with 'from'
rg -n --type=js -C3 'searchParams\.get.*from' health/micro-ui/web/packages/modules/campaign-manager/Repository: egovernments/DIGIT-Frontend
Length of output: 5585
🏁 Script executed:
#!/bin/bash
# Get context around line 175 in CampaignHome.js
sed -n '170,180p' health/micro-ui/web/packages/modules/campaign-manager/src/pages/employee/NewCampaignCreate/CampaignHome.jsRepository: egovernments/DIGIT-Frontend
Length of output: 439
Breadcrumb will not display on campaign-templates page after removing the query parameter.
Removing the ?from=home query parameter breaks breadcrumb visibility. The breadcrumb logic in index.js (line 157) requires url?.from === "home" to display the "CREATE_CAMPAIGN_HOME" breadcrumb when on the campaign-templates page. Without this parameter, the breadcrumb will not appear when users navigate from CampaignHome to campaign-templates.
Either restore the ?from=home parameter in the navigation URL at line 175, or update the breadcrumb logic in index.js to display correctly without depending on the query parameter.
🤖 Prompt for AI Agents
In
health/micro-ui/web/packages/modules/campaign-manager/src/pages/employee/NewCampaignCreate/CampaignHome.js
around line 175, the navigation URL to campaign-templates was changed to remove
the ?from=home query param which breaks breadcrumb visibility; to fix either
restore the query param by changing the URL back to
`/${window.contextPath}/employee/campaign/campaign-templates?from=home` so the
existing breadcrumb logic continues to work, or (preferred) update the
breadcrumb logic in index.js (around line ~157) to not rely on url?.from ===
"home" and instead detect the campaign-templates route by pathname or route name
(e.g., check location.pathname or route id equals the campaign-templates path)
so the CREATE_CAMPAIGN_HOME breadcrumb displays even without the query param.
Choose the appropriate template for your PR:
Feature/Bugfix Request
JIRA ID
Module
Description
Summary by CodeRabbit
New Features
Bug Fixes
Style
✏️ Tip: You can customize this high-level summary in your review settings.