Skip to content

Commit

Permalink
Update Module.js
Browse files Browse the repository at this point in the history
  • Loading branch information
nipunarora-eGov committed Mar 2, 2024
1 parent 3f0a507 commit 01615a5
Showing 1 changed file with 52 additions and 42 deletions.
94 changes: 52 additions & 42 deletions micro-ui/web/packages/core/src/Module.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ const DigitUIWrapper = ({ stateCode="pg", enabledModules, moduleReducers,default
if (isLoading) {
return <Loader page={true} />;
}


const i18n = getI18n();
return (
<Provider store={getStore(initData, moduleReducers(initData))}>
<Router>
Expand All @@ -48,54 +46,66 @@ export const DigitUI = ({ registry, enabledModules, moduleReducers ,defaultLandi
const PrivacyProvider = Digit.Contexts.PrivacyProvider;


return (
<div>
// return (
// <div>
// <ErrorBoundary>
// <QueryClientProvider client={queryClient}>
// <ComponentProvider.Provider value={registry}>
// <PrivacyProvider.Provider
// value={{
// privacy: privacy?.[window.location.pathname],
// resetPrivacy: (_data) => {
// Digit.Utils.setPrivacyObject({});
// setPrivacy({});
// },
// getPrivacy: () => {
// const privacyObj = Digit.Utils.getPrivacyObject();
// setPrivacy(privacyObj);
// return privacyObj;
// },
// /* Descoped method to update privacy object */
// updatePrivacyDescoped: (_data) => {
// const privacyObj = Digit.Utils.getAllPrivacyObject();
// const newObj = { ...privacyObj, [window.location.pathname]: _data };
// Digit.Utils.setPrivacyObject({ ...newObj });
// setPrivacy(privacyObj?.[window.location.pathname] || {});
// },
// /**
// * Main Method to update the privacy object anywhere in the application
// *
// * @author jagankumar-egov
// *
// * Feature :: Privacy
// *
// * @example
// * const { privacy , updatePrivacy } = Digit.Hooks.usePrivacyContext();
// */
// updatePrivacy: (uuid, fieldName) => {
// setPrivacy(Digit.Utils.updatePrivacy(uuid, fieldName) || {});
// },
// }}
// >
// <DigitUIWrapper stateCode={"pg"} enabledModules={enabledModules} moduleReducers={moduleReducers} defaultLanding={defaultLanding} queryClient={queryClient}/>
// {/* <div>Core Module Dummy</div> */}
// {/* <ReactQueryDevtools initialIsOpen={false} /> */}
// </PrivacyProvider.Provider>
// </ComponentProvider.Provider>
// </QueryClientProvider>
// </ErrorBoundary>
// </div>
// );

<div>
<ErrorBoundary>
<QueryClientProvider client={queryClient}>
<ComponentProvider.Provider value={registry}>
<PrivacyProvider.Provider
value={{
privacy: privacy?.[window.location.pathname],
resetPrivacy: (_data) => {
Digit.Utils.setPrivacyObject({});
setPrivacy({});
},
getPrivacy: () => {
const privacyObj = Digit.Utils.getPrivacyObject();
setPrivacy(privacyObj);
return privacyObj;
},
/* Descoped method to update privacy object */
updatePrivacyDescoped: (_data) => {
const privacyObj = Digit.Utils.getAllPrivacyObject();
const newObj = { ...privacyObj, [window.location.pathname]: _data };
Digit.Utils.setPrivacyObject({ ...newObj });
setPrivacy(privacyObj?.[window.location.pathname] || {});
},
/**
* Main Method to update the privacy object anywhere in the application
*
* @author jagankumar-egov
*
* Feature :: Privacy
*
* @example
* const { privacy , updatePrivacy } = Digit.Hooks.usePrivacyContext();
*/
updatePrivacy: (uuid, fieldName) => {
setPrivacy(Digit.Utils.updatePrivacy(uuid, fieldName) || {});
},
}}
>
{/* <DigitUIWrapper stateCode={"pg"} enabledModules={enabledModules} moduleReducers={moduleReducers} defaultLanding={defaultLanding} queryClient={queryClient}/> */}
<div>Core Module Dummy</div>
<DigitUIWrapper stateCode={"pg"} enabledModules={enabledModules} moduleReducers={moduleReducers} defaultLanding={defaultLanding} queryClient={queryClient}/>
{/* <div>Core Module Dummy</div> */}
{/* <ReactQueryDevtools initialIsOpen={false} /> */}
</PrivacyProvider.Provider>
</ComponentProvider.Provider>
</QueryClientProvider>
</ErrorBoundary>
</div>
);
};

const componentsToRegister = {
Expand Down

0 comments on commit 01615a5

Please sign in to comment.