-
Notifications
You must be signed in to change notification settings - Fork 6
Libraries changes and cleanup (#245) #246
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
Open
jagankumar-egov
wants to merge
1
commit into
develop-webpack
Choose a base branch
from
dev-lib
base: develop-webpack
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -64,7 +64,7 @@ const initRequestBody = (tenantId) => ({ | |
}, | ||
}); | ||
|
||
const getCriteria = (tenantId, moduleDetails) => { | ||
const getCriteria = (tenantId="mz", moduleDetails) => { | ||
return { | ||
MdmsCriteria: { | ||
tenantId, | ||
|
@@ -1471,7 +1471,7 @@ const debouncedCall = ({ serviceName, url, data, useCache, params }, resolve, re | |
}; | ||
|
||
export const MdmsService = { | ||
init: (stateCode) => | ||
init: (stateCode="mz") => | ||
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. same here as well |
||
ServiceRequest({ | ||
serviceName: "mdmsInit", | ||
url: Urls.MDMS, | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -89,7 +89,7 @@ export const StoreService = { | |
uiHomePage: uiHomePage, | ||
}; | ||
}, | ||
digitInitData: async (stateCode, enabledModules, modulePrefix) => { | ||
digitInitData: async (stateCode="mz", enabledModules, modulePrefix) => { | ||
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. we cant have hardcoded @purepiyush |
||
const { MdmsRes } = await MdmsService.init(stateCode); | ||
const stateInfo = MdmsRes["common-masters"]?.StateInfo?.[0] || {}; | ||
const uiHomePage = MdmsRes["common-masters"]?.uiHomePage?.[0] || {}; | ||
|
@@ -135,6 +135,7 @@ export const StoreService = { | |
uiHomePage: uiHomePage, | ||
}; | ||
}; | ||
|
||
const initData = tenantConfigFetch | ||
? await fetchTenantConfig() | ||
: { | ||
|
@@ -176,12 +177,16 @@ export const StoreService = { | |
} | ||
// .filter((item) => !!moduleTenants.find((mt) => mt.code === item.code)) | ||
// .map((tenant) => ({ i18nKey: `TENANT_TENANTS_${tenant.code.replace(".", "_").toUpperCase()}`, ...tenant })); | ||
try { | ||
await LocalizationService.getLocale({ | ||
modules: [`${modulePrefix}-common`, `digit-ui`, `digit-tenants`, `${modulePrefix}-${stateCode.toLowerCase()}`], | ||
locale: initData.selectedLanguage, | ||
tenantId: stateCode, | ||
}); | ||
} catch (error) { | ||
console.error("LocalizationService.getLocale failed:", error); | ||
} | ||
|
||
await LocalizationService.getLocale({ | ||
modules: [`${modulePrefix}-common`, `digit-ui`, `digit-tenants`, `${modulePrefix}-${stateCode.toLowerCase()}`], | ||
locale: initData.selectedLanguage, | ||
tenantId: stateCode, | ||
}); | ||
Storage.set("initData", initData); | ||
initData.revenue_localities = revenue_localities; | ||
initData.localities = localities; | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Hooks setup disabled
The Hooks setup has been commented out, which seems to be part of the architectural change moving to StoreService. Ensure that all functionality previously handled by Hooks is now properly handled by StoreService or document this change as a potential breaking change.
Recommended checks:
🏁 Script executed:
Length of output: 188
I'll generate new shell scripts that explicitly add file types for JSX/TSX so we can verify if any components still import or reference the Hooks module. Please run the following scripts and share the output to confirm if any references remain:
Once you run these commands, please verify whether any output is returned. If no references are found, it likely indicates that the Hooks module is indeed no longer in use. If there are references, you'll need to ensure that either those components are updated to use StoreService or the change is documented properly as a potential breaking change.
🏁 Script executed:
Length of output: 25779
Action: Address Incomplete Hooks Migration
The Hooks setup in
webpack/libraries/src/index.js
is now disabled (see the commented out code), but our repository search reveals that many components continue to import and actively useDigit.Hooks
(e.g.,useCustomAPIHook
,useQueryParams
,useCustomMDMS
, etc.) across various modules. This indicates that the architectural migration toStoreService
may be incomplete.Please ensure one of the following:
Digit.Hooks
to useStoreService
where applicable.Key Points:
webpack/libraries/src/index.js
(Line 82) contains the disabled setup:// setupLibraries("Hooks", Hooks);
Digit.Hooks.*
.Please review all Hooks usage to confirm coverage by
StoreService
and update or document accordingly.