Skip to content
This repository has been archived by the owner on Nov 26, 2024. It is now read-only.

Commit

Permalink
Merge pull request #515 from rakesh-wt-egov/pgr-develop
Browse files Browse the repository at this point in the history
Pgr develop
  • Loading branch information
rahuldevgarg authored Sep 1, 2023
2 parents 03e92de + 5d6f867 commit 827075b
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 43 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ export const StoreService = {
},
digitInitData: async (stateCode, enabledModules) => {
const { MdmsRes } = await MdmsService.init(stateCode);
const stateInfo = MdmsRes["common-masters"]?.StateInfo?.[0]||{};
const uiHomePage = MdmsRes["common-masters"]?.uiHomePage?.[0]||{};
const stateInfo = MdmsRes["common-masters"]?.StateInfo?.[0] || {};
const uiHomePage = MdmsRes["common-masters"]?.uiHomePage?.[0] || {};
const localities = {};
const revenue_localities = {};
const initData = {
Expand All @@ -71,11 +71,12 @@ export const StoreService = {
bannerUrl: stateInfo.bannerUrl,
},
localizationModules: stateInfo.localizationModules,
modules: MdmsRes?.tenant?.citymodule.filter((module) => module?.active).filter((module) => enabledModules?.includes(module?.code))?.sort((x,y)=>x?.order-y?.order),
uiHomePage: uiHomePage
modules: MdmsRes?.tenant?.citymodule
.filter((module) => module?.active)
.filter((module) => enabledModules?.includes(module?.code))
?.sort((x, y) => x?.order - y?.order),
uiHomePage: uiHomePage,
};


initData.selectedLanguage = Digit.SessionStorage.get("locale") || initData.languages[0].value;

ApiCacheService.saveSetting(MdmsRes["DIGIT-UI"]?.ApiCachingSettings);
Expand All @@ -85,15 +86,13 @@ export const StoreService = {
.flat()
.reduce((unique, ele) => (unique.find((item) => item.code === ele.code) ? unique : [...unique, ele]), []);
initData.tenants = MdmsRes?.tenant?.tenants
.map((tenant) => ({ i18nKey: `TENANT_TENANTS_${tenant.code.replace(".", "_").toUpperCase()}`, ...tenant }));
// .filter((item) => !!moduleTenants.find((mt) => mt.code === item.code))
// .map((tenant) => ({ i18nKey: `TENANT_TENANTS_${tenant.code.replace(".", "_").toUpperCase()}`, ...tenant }));
?.filter((x) => x.pgrEnabled)
.map((tenant) => ({ i18nKey: `TENANT_TENANTS_${tenant.code.replace(".", "_").toUpperCase()}`, ...tenant }));
// .filter((item) => !!moduleTenants.find((mt) => mt.code === item.code))
// .map((tenant) => ({ i18nKey: `TENANT_TENANTS_${tenant.code.replace(".", "_").toUpperCase()}`, ...tenant }));

await LocalizationService.getLocale({
modules: [
`rainmaker-common`,
`rainmaker-${stateCode.toLowerCase()}`,
],
modules: [`rainmaker-common`, `rainmaker-${stateCode.toLowerCase()}`],
locale: initData.selectedLanguage,
tenantId: stateCode,
});
Expand All @@ -107,7 +106,10 @@ export const StoreService = {
},
defaultData: async (stateCode, moduleCode, language) => {
let moduleCodes = [];
if(typeof moduleCode !== "string") moduleCode.forEach(code => { moduleCodes.push(`rainmaker-${code.toLowerCase()}`) });
if (typeof moduleCode !== "string")
moduleCode.forEach((code) => {
moduleCodes.push(`rainmaker-${code.toLowerCase()}`);
});
const LocalePromise = LocalizationService.getLocale({
modules: typeof moduleCode == "string" ? [`rainmaker-${moduleCode.toLowerCase()}`] : moduleCodes,
locale: language,
Expand Down
65 changes: 36 additions & 29 deletions frontend/micro-ui/web/public/index.html
Original file line number Diff line number Diff line change
@@ -1,25 +1,30 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<link rel="icon" href="https://cdn.jsdelivr.net/npm/@egovernments/digit-ui-css/img/browser-icon.png"/>
<link href="https://fonts.googleapis.com/css2?family=Roboto+Condensed:wght@400;500;700&family=Roboto:wght@400;500;700&display=swap" rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="https://unpkg.com/@egovernments/[email protected]/dist/index.css"/>
<!-- <link rel="stylesheet" href="https://unpkg.com/@egovernments/digit-ui-css/dist/index.css"/> -->
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<meta name="theme-color" content="#00bcd1"/>
<title>mSeva</title>
<!-- <script src="https://s3.ap-south-1.amazonaws.com/egov-dev-assets/globalConfigs.js"></script> -->
<script>
var globalConfigs = (function () {

<head>
<meta charset="utf-8" />
<link rel="icon" href="https://cdn.jsdelivr.net/npm/@egovernments/digit-ui-css/img/browser-icon.png" />
<link
href="https://fonts.googleapis.com/css2?family=Roboto+Condensed:wght@400;500;700&family=Roboto:wght@400;500;700&display=swap"
rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="https://unpkg.com/@egovernments/[email protected]/dist/index.css" />
<!-- <link rel="stylesheet" href="https://unpkg.com/@egovernments/digit-ui-css/dist/index.css"/> -->
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#00bcd1" />
<title>mSeva</title>
<!-- <script src="https://s3.ap-south-1.amazonaws.com/egov-dev-assets/globalConfigs.js"></script> -->
<script>
var globalConfigs = (function () {
var stateTenantId = 'pb'
var gmaps_api_key = 'AIzaSyAQOd09-vjmk1sXFb_ZQYDz2nlfhXq7Wf8'
var finEnv = 'uat'
var gmaps_api_key = 'AIzaSyAQOd09-vjmk1sXFb_ZQYDz2nlfhXq7Wf8';
var finEnv = 'dev';
var centralInstanceEnabled = false;
var footerBWLogoURL = 'https://s3.ap-south-1.amazonaws.com/egov-uat-assets/digit-footer-bw.png'
var footerLogoURL = 'https://s3.ap-south-1.amazonaws.com/egov-uat-assets/digit-footer.png'
var digitHomeURL = 'https://www.digit.org/'
var assetS3Bucket = 'egov-qa-assets';
var footerBWLogoURL = 'https://s3.ap-south-1.amazonaws.com/egov-dev-assets/digit-footer-bw.png';
var footerLogoURL = 'https://s3.ap-south-1.amazonaws.com/egov-dev-assets/digit-footer.png';
var digitHomeURL = 'https://www.digit.org/';
var xstateWebchatServices = 'wss://dev.digit.org/xstate-webchat/';
var assetS3Bucket = 'egov-dev-assets';

var getConfig = function (key) {
if (key === 'STATE_LEVEL_TENANT_ID') {
return stateTenantId;
Expand All @@ -37,22 +42,23 @@
return footerLogoURL;
} else if (key === 'DIGIT_HOME_URL') {
return digitHomeURL;
} else if (key === 'xstate-webchat-services') {
return xstateWebchatServices;
} else if (key === 'S3BUCKET') {
return assetS3Bucket;
} else if (key === "JWT_TOKEN"){
return "ZWdvdi11c2VyLWNsaWVudDplZ292LXVzZXItc2VjcmV0";
}
};
return {
getConfig
};
}());
</script>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!--
}());
</script>
</head>

<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
Expand All @@ -62,5 +68,6 @@
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
</html>
</body>

</html>

0 comments on commit 827075b

Please sign in to comment.