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 #520 from rakesh-wt-egov/develop
Browse files Browse the repository at this point in the history
UI issue fixed
  • Loading branch information
pradeepkumarcm-egov authored Sep 1, 2023
2 parents 088f9e7 + 5d96af9 commit 653350e
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 51 deletions.
42 changes: 21 additions & 21 deletions frontend/micro-ui/web/micro-ui-internals/example/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,16 @@ const enabledModules = [
"NDSS",
"Bills",
"SW",
"BillAmendment"
"BillAmendment",
];

const initTokens = (stateCode) => {
const userType = window.sessionStorage.getItem("userType") || process.env.REACT_APP_USER_TYPE || "CITIZEN";

const token = window.localStorage.getItem("token")|| process.env[`REACT_APP_${userType}_TOKEN`];
const citizenInfo = window.localStorage.getItem("Citizen.user-info")
const token = window.localStorage.getItem("token") || process.env[`REACT_APP_${userType}_TOKEN`];

const citizenInfo = window.localStorage.getItem("Citizen.user-info");

const citizenTenantId = window.localStorage.getItem("Citizen.tenant-id") || stateCode;

const employeeInfo = window.localStorage.getItem("Employee.user-info");
Expand All @@ -94,33 +94,33 @@ const initDigitUI = () => {
PaymentModule,
...paymentConfigs,
PaymentLinks,
PTModule,
PTLinks,
...PTComponents,
MCollectLinks,
MCollectModule,
// PTModule,
// PTLinks,
// ...PTComponents,
// MCollectLinks,
// MCollectModule,
HRMSModule,
ReceiptsModule,
BillsModule,
// ReceiptsModule,
// BillsModule,

// TLModule,
// TLLinks,
});

initFSMComponents();
// initFSMComponents();
initPGRComponents();
initDSSComponents();
initMCollectComponents();
// initMCollectComponents();
initHRMSComponents();
initTLComponents();
// initTLComponents();
initReceiptsComponents();
// initReportsComponents();
initOBPSComponents();
initEngagementComponents();
initNOCComponents();
initWSComponents();
initCommonPTComponents();
initBillsComponents();
// initOBPSComponents();
// initEngagementComponents();
// initNOCComponents();
// initWSComponents();
// initCommonPTComponents();
// initBillsComponents();

// initCustomisationComponents();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import * as locale from "./locale";
import * as obps from "./obps";
import * as pt from "./pt";
import * as privacy from "./privacy";
import PDFUtil, { downloadReceipt ,downloadPDFFromLink,downloadBill ,getFileUrl} from "./pdf";
import PDFUtil, { downloadReceipt, downloadPDFFromLink, downloadBill, getFileUrl } from "./pdf";
import getFileTypeFromFileStoreURL from "./fileType";

const GetParamFromUrl = (key, fallback, search) => {
Expand Down Expand Up @@ -120,10 +120,10 @@ const didEmployeeHasRole = (role) => {

const pgrAccess = () => {
const userInfo = Digit.UserService.getUser();
const userRoles = userInfo?.info?.roles?.map((roleData) => roleData?.code);
const userRoles = userInfo && userInfo?.info?.roles?.length > 0 && userInfo?.info?.roles?.map((roleData) => roleData?.code);
const pgrRoles = ["PGR_LME", "PGR-ADMIN", "CSR", "CEMP", "FEMP", "DGRO", "ULB Operator", "GRO", "GO", "RO", "GA"];

const PGR_ACCESS = userRoles?.filter((role) => pgrRoles.includes(role));
const PGR_ACCESS = userRoles && userRoles?.length > 0 && userRoles?.filter((role) => pgrRoles.includes(role));

return PGR_ACCESS?.length > 0;
};
Expand Down Expand Up @@ -153,9 +153,7 @@ const NOCAccess = () => {
const userInfo = Digit.UserService.getUser();
const userRoles = userInfo?.info?.roles?.map((roleData) => roleData?.code);

const NOC_ROLES = [
"FIRE_NOC_APPROVER"
]
const NOC_ROLES = ["FIRE_NOC_APPROVER"];

const NOC_ACCESS = userRoles?.filter((role) => NOC_ROLES?.includes(role));

Expand Down Expand Up @@ -249,7 +247,7 @@ const hrmsAccess = () => {
const wsAccess = () => {
const userInfo = Digit.UserService.getUser();
const userRoles = userInfo?.info?.roles?.map((roleData) => roleData?.code);
const waterRoles = ["WS_CEMP", "WS_APPROVER", "WS_FIELD_INSPECTOR", "WS_DOC_VERIFIER","WS_CLERK"];
const waterRoles = ["WS_CEMP", "WS_APPROVER", "WS_FIELD_INSPECTOR", "WS_DOC_VERIFIER", "WS_CLERK"];

const WS_ACCESS = userRoles?.filter((role) => waterRoles?.includes(role));

Expand All @@ -259,14 +257,13 @@ const wsAccess = () => {
const swAccess = () => {
const userInfo = Digit.UserService.getUser();
const userRoles = userInfo?.info?.roles?.map((roleData) => roleData?.code);
const sewerageRoles = ["SW_CEMP", "SW_APPROVER", "SW_FIELD_INSPECTOR", "SW_DOC_VERIFIER","SW_CLERK"];
const sewerageRoles = ["SW_CEMP", "SW_APPROVER", "SW_FIELD_INSPECTOR", "SW_DOC_VERIFIER", "SW_CLERK"];

const SW_ACCESS = userRoles?.filter((role) => sewerageRoles?.includes(role));

return SW_ACCESS?.length > 0;
};


export default {
pdf: PDFUtil,
downloadReceipt,
Expand Down Expand Up @@ -302,5 +299,5 @@ export default {
wsAccess,
swAccess,

...privacy
...privacy,
};
47 changes: 27 additions & 20 deletions frontend/micro-ui/web/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ import {
PTLinks,
PTComponents,
} from "@egovernments/digit-ui-module-pt";
import { MCollectModule, MCollectLinks, initMCollectComponents } from "@egovernments/digit-ui-module-mcollect";
import {
MCollectModule,
MCollectLinks,
initMCollectComponents,
} from "@egovernments/digit-ui-module-mcollect";
import { initDSSComponents } from "@egovernments/digit-ui-module-dss";
import {
PaymentModule,
Expand All @@ -28,7 +32,10 @@ import {
TLLinks,
initTLComponents,
} from "@egovernments/digit-ui-module-tl";
import { initReceiptsComponents, ReceiptsModule } from "@egovernments/digit-ui-module-receipts";
import {
initReceiptsComponents,
ReceiptsModule,
} from "@egovernments/digit-ui-module-receipts";
import { initOBPSComponents } from "@egovernments/digit-ui-module-obps";
import { initNOCComponents } from "@egovernments/digit-ui-module-noc";
import { initEngagementComponents } from "@egovernments/digit-ui-module-engagement";
Expand Down Expand Up @@ -60,36 +67,36 @@ const enabledModules = [
"Reports",
"Bills",
"SW",
"BillAmendment"
"BillAmendment",
];
window.Digit.ComponentRegistryService.setupRegistry({
...paymentConfigs,
PTModule,
PTLinks,
// PTModule,
// PTLinks,
PaymentModule,
PaymentLinks,
...PTComponents,
MCollectLinks,
MCollectModule,
// ...PTComponents,
// MCollectLinks,
// MCollectModule,
HRMSModule,
TLModule,
TLLinks,
// TLModule,
// TLLinks,
// ReceiptsModule
});

initPGRComponents();
initFSMComponents();
// initFSMComponents();
initDSSComponents();
initMCollectComponents();
initHRMSComponents();
initTLComponents();
// initMCollectComponents();
// initHRMSComponents();
// initTLComponents();
// initReceiptsComponents();
initOBPSComponents();
initNOCComponents();
initEngagementComponents();
initWSComponents();
initCommonPTComponents();
initBillsComponents();
// initOBPSComponents();
// initNOCComponents();
// initEngagementComponents();
// initWSComponents();
// initCommonPTComponents();
// initBillsComponents();
// initReportsComponents();
initCustomisationComponents();

Expand Down

0 comments on commit 653350e

Please sign in to comment.