-
Notifications
You must be signed in to change notification settings - Fork 46
Hcmpre 3049 #3183
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
Hcmpre 3049 #3183
Changes from all commits
4bbf716
c65b2ee
57383fa
0eefbb1
ab6da34
dc896d1
a029f71
97900d5
8c8e9ca
0d4ff6a
6c42a32
f123474
4884c43
be4bc7d
1246f82
0f597bb
2697ffb
e7f2100
7c06320
37dd6ec
afdfb77
c401a98
efaaba0
267d49e
81e9337
418aa25
050c8aa
9aef441
cceb7ac
9d6d3c4
199a9e5
d70bc7b
3e27877
3f9126a
dc54d7f
43236d9
ce1e7a5
1359ccd
85641f3
843271a
fad6773
5e0a345
ddfe94c
5a02468
f062f8e
a49d420
a62ae24
a38e386
a00835f
a42e623
2cc6721
45aa7cd
856733b
d8c1b7e
361439d
c1cc1da
3aa4602
df1eb2f
43d69ef
9d30480
f7b7ee0
ee4a13d
65aceea
f5a2b4c
d0d85a5
4def1d7
dcbdcaf
4bdb200
67edb4d
435f47f
44f8d8a
f17b433
506d9bc
84c87bd
08db216
407d1d5
42d5a65
165d1ef
80a1fd9
cc3c42d
2e3a081
349273f
ad2872c
70e0beb
5acd6d8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -5,6 +5,7 @@ import { DigitUI } from "@egovernments/digit-ui-module-core"; | |||||||||||||||||
|
|
||||||||||||||||||
| import { UICustomizations } from "./Customisations/UICustomizations"; | ||||||||||||||||||
| import { initPaymentComponents } from "@egovernments/digit-ui-module-health-payments"; | ||||||||||||||||||
| import { initHRMSComponents } from "@egovernments/digit-ui-module-health-hrms"; | ||||||||||||||||||
|
|
||||||||||||||||||
|
|
||||||||||||||||||
| const enabledModules = [ | ||||||||||||||||||
|
|
@@ -13,7 +14,8 @@ const enabledModules = [ | |||||||||||||||||
| "Utilities", | ||||||||||||||||||
| "Engagement", | ||||||||||||||||||
| "Workbench", | ||||||||||||||||||
| "Payments" | ||||||||||||||||||
| "Payments", | ||||||||||||||||||
| "HRMS" | ||||||||||||||||||
| ]; | ||||||||||||||||||
|
Comment on lines
+17
to
19
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick (assertive) Gate “HRMS” in enabledModules via config and confirm registry key matches Avoid exposing HRMS where not intended. Also ensure the module key matches what Apply this diff to conditionally include HRMS: "Workbench",
- "Payments",
- "HRMS"
-];
+ "Payments",
+].concat(window.globalConfigs?.getConfig("ENABLE_HRMS") === "true" ? ["HRMS"] : []);Quick checks:
📝 Committable suggestion
Suggested change
|
||||||||||||||||||
|
|
||||||||||||||||||
| const moduleReducers = (initData) => ({ | ||||||||||||||||||
|
|
@@ -24,6 +26,7 @@ const initDigitUI = () => { | |||||||||||||||||
| window.Digit.ComponentRegistryService.setupRegistry({ | ||||||||||||||||||
| }); | ||||||||||||||||||
| initPaymentComponents(); | ||||||||||||||||||
| initHRMSComponents(); | ||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick (assertive) Defensive init for HRMS (if you keep static import) If you keep the static import, at least guard and catch init errors to avoid white‑screen on partial deployments. - initHRMSComponents();
+ if (window.globalConfigs?.getConfig("ENABLE_HRMS") === "true") {
+ try {
+ initHRMSComponents();
+ } catch (e) {
+ console.error("Failed to initialize HRMS module:", e);
+ }
+ }📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||
|
|
||||||||||||||||||
| window.Digit.Customizations = { | ||||||||||||||||||
| PGR: {}, | ||||||||||||||||||
|
|
||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,7 +3,8 @@ | |
| "version": "1.0.0", | ||
| "main": "index.js", | ||
| "workspaces": [ | ||
| "packages/modules/health-payments" | ||
| "packages/modules/health-payments", | ||
| "packages/modules/health-hrms" | ||
| ], | ||
| "author": "JaganKumar <[email protected]>", | ||
| "license": "MIT", | ||
|
|
@@ -21,12 +22,14 @@ | |
| "dev:example": "cd example && yarn start", | ||
| "dev:hcm-microplanning": "cd packages/modules/hcm-microplanning && yarn start", | ||
| "dev:health-payments": "cd packages/modules/health-payments && yarn start", | ||
| "dev:health-hrms": "cd packages/modules/health-hrms && yarn start", | ||
| "dev:microplan": "cd packages/modules/microplan && yarn start", | ||
| "dev:campaign": "cd packages/modules/campaign-manager && yarn start", | ||
| "build": "run-p build:**", | ||
| "build:campaign": "cd packages/modules/campaign-manager && yarn build", | ||
| "buildD:hcm-microplanning": "cd packages/modules/hcm-microplanning && yarn build", | ||
| "build:health-payments": "cd packages/modules/health-payments && yarn build", | ||
| "build:health-hrms": "cd packages/modules/health-hrms && yarn build", | ||
| "build:microplan": "cd packages/modules/microplan && yarn build", | ||
| "deploy:jenkins": "./scripts/jenkins.sh", | ||
| "clean": "rm -rf node_modules" | ||
|
|
||
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.
💡 Verification agent
🧩 Analysis chain
Lazy‑load and feature‑gate HRMS to prevent bundle bloat and startup breakage
Static importing HRMS makes it mandatory at build time and increases initial bundle. Prefer dynamic import behind a config flag.
Apply this diff to drop the static import:
-import { initHRMSComponents } from "@egovernments/digit-ui-module-health-hrms";Then, initialize HRMS dynamically inside
initDigitUI:Verification script to ensure dependency and registrations exist:
🏁 Script executed:
Length of output: 88
🏁 Script executed:
Length of output: 116
🏁 Script executed:
Length of output: 2561
Lazy‑load and feature‑gate HRMS to prevent bundle bloat and startup breakage
health/micro-ui/web/health-payments/App.js statically imports and calls initHRMSComponents during startup — change to a dynamic import behind a config flag so HRMS isn't bundled/initialized unless enabled.
Apply this diff to drop the static import:
-import { initHRMSComponents } from "@egovernments/digit-ui-module-health-hrms";Then, initialize HRMS dynamically inside
initDigitUI()(afterinitPaymentComponents()):🤖 Prompt for AI Agents