Skip to content

Commit

Permalink
updated tenant to mz
Browse files Browse the repository at this point in the history
  • Loading branch information
nipunarora-eGov committed Jun 21, 2024
1 parent 5afd335 commit a73312b
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 22 deletions.
4 changes: 2 additions & 2 deletions micro-ui/web/packages/campaign/src/CampaignWrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ import { QueryClientProvider } from 'react-query';
import { Switch, useLocation, BrowserRouter as Router } from 'react-router-dom';
import { initCampaignComponents, CampaignModule } from './Module';

const App = ({ queryClient }) => {
const App = ({ queryClient,userType }) => {
initCampaignComponents();

return (
<QueryClientProvider client={queryClient}>
<Router>
<CampaignModule path={`/${window.contextPath ? window.contextPath : "core-digit-ui"}/employee/engagement`} userType={userType} stateCode={"pg"} tenants={["pg.citya","pg.cityb","pg.cityc"]} />
<CampaignModule path={`/${window.contextPath ? window.contextPath : "core-digit-ui"}/employee/campaign`} userType={userType} stateCode={"mz"} />
</Router>
</QueryClientProvider>
);
Expand Down
24 changes: 12 additions & 12 deletions micro-ui/web/packages/campaign/src/Module.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,25 +32,25 @@ export const BOUNDARY_HIERARCHY_TYPE="ADMIN";
* @returns The CampaignModule component returns either a Loader component if data is still loading, or
* a TourProvider component wrapping an EmployeeApp component with specific props passed to it.
*/
export const CampaignModule = ({ stateCode, userType, tenants }) => {
export const CampaignModule = ({ stateCode, userType,path }) => {

const moduleCode = ["campaign", "workbench", "mdms", "schema","hcm-admin-schemas",`boundary-${BOUNDARY_HIERARCHY_TYPE}`];
const { path, url } = useRouteMatch();
const language = Digit.StoreData.getCurrentLanguage();
const { isLoading, data: store } = Digit.Services.useStore({
stateCode,
moduleCode,
language,
});
// const { path, url } = useRouteMatch();
// const language = Digit.StoreData.getCurrentLanguage();
// const { isLoading, data: store } = Digit.Services.useStore({
// stateCode,
// moduleCode,
// language,
// });

if (isLoading) {
return <Loader />;
}
// if (isLoading) {
// return <Loader />;
// }

return (
<ErrorBoundary moduleName="CAMPAIGN">
<TourProvider>
<EmployeeApp path={path} stateCode={stateCode} url={url} userType={userType} />
<EmployeeApp path={path} stateCode={stateCode} userType={userType} />
</TourProvider>
</ErrorBoundary>
);
Expand Down
17 changes: 16 additions & 1 deletion micro-ui/web/packages/campaign/src/pages/employee/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Switch, useLocation } from "react-router-dom";
import { useTranslation } from "react-i18next";
//import { PrivateRoute, AppContainer, BreadCrumb } from "@digit-ui/digit-ui-react-components";
// import CampaignHeader from "../../components/CampaignHeader";
import {PrivateRoute,AppContainer,BreadCrumb} from "@digit-ui/digit-ui-react-components";
import {PrivateRoute,AppContainer,BreadCrumb,Loader} from "@digit-ui/digit-ui-react-components";
import SetupCampaign from "./SetupCampaign";
import SelectingBoundaries from "../../components/SelectingBoundaries";

Expand Down Expand Up @@ -58,6 +58,17 @@ const App = ({ path }) => {
const Response = Digit?.ComponentRegistryService?.getComponent("Response");
const AddProduct = Digit?.ComponentRegistryService?.getComponent("AddProduct");

const {t,i18n} = useTranslation()
const { isLoading } = Digit.Hooks.core.useLocalization({
params:{
tenantId: Digit.ULBService.getStateId(),
module: 'rainmaker-campaign,rainmaker-campaign,rainmaker-workbench,rainmaker-mdms,rainmaker-schema,rainmaker-hcm-admin-schemas,ranmaker-boundary-ADMIN',
locale:i18n.language,
},
i18n,
})


useEffect(() => {
if (window.location.pathname !== "/workbench-ui/employee/campaign/setup-campaign") {
window.Digit.SessionStorage.del("HCM_CAMPAIGN_MANAGER_FORM_DATA");
Expand All @@ -74,6 +85,10 @@ const App = ({ path }) => {
}
};
}, []);

if(isLoading){
return <Loader />
}
return (
<React.Fragment>
<div className="wbh-header-container">
Expand Down
6 changes: 5 additions & 1 deletion micro-ui/web/packages/core/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@
<head>
<title>Core Page</title>
<link rel="preconnect" href="https://fonts.gstatic.com" />
<script src="https://s3.ap-south-1.amazonaws.com/egov-dev-assets/globalConfigsWorkbench.js"></script>
<!-- this is for pg -->
<!-- <script src="https://s3.ap-south-1.amazonaws.com/egov-dev-assets/globalConfigsWorkbench.js"></script> -->
<!-- added for mz tenant -->
<script src="https://egov-dev-assets.s3.ap-south-1.amazonaws.com/globalConfigsMicroplan.js"></script>

<script type="systemjs-importmap">
{
"imports": {
Expand Down
12 changes: 6 additions & 6 deletions micro-ui/web/packages/core/webpack.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ module.exports = () => {
new ModuleFederationPlugin({
name: "core-digit-ui",
remotes: {
// hrms: `hrms@${domain}/hrms-ui/remoteEntry.js`,
// common: `common@${domain}/common-ui/remoteEntry.js`,
//pgr: `pgr@${domain}/pgr-ui/remoteEntry.js`,
//workbench : `workbench@${domain}/workbench-mfe/remoteEntry.js`,
//dss : `dss@${domain}/dss-ui/remoteEntry.js`,
//engagement : `engagement@${domain}/engagement-ui/remoteEntry.js`,
hrms: `hrms@${domain}/hrms-ui/remoteEntry.js`,
common: `common@${domain}/common-ui/remoteEntry.js`,
pgr: `pgr@${domain}/pgr-ui/remoteEntry.js`,
workbench : `workbench@${domain}/workbench-mfe/remoteEntry.js`,
dss : `dss@${domain}/dss-ui/remoteEntry.js`,
engagement : `engagement@${domain}/engagement-ui/remoteEntry.js`,
microplan : `microplan@${domain}/microplan-mfe/remoteEntry.js`,
// tqm : `tqm@${domain}/tqm-ui/remoteEntry.js`,
campaign : `campaign@${domain}/campaign-mfe/remoteEntry.js`
Expand Down

0 comments on commit a73312b

Please sign in to comment.