diff --git a/micro-ui/web/micro-ui-internals/packages/libraries/src/services/molecules/Ulb/index.js b/micro-ui/web/micro-ui-internals/packages/libraries/src/services/molecules/Ulb/index.js index 2737c329cf2..b5e98b99b40 100644 --- a/micro-ui/web/micro-ui-internals/packages/libraries/src/services/molecules/Ulb/index.js +++ b/micro-ui/web/micro-ui-internals/packages/libraries/src/services/molecules/Ulb/index.js @@ -31,14 +31,6 @@ export const ULBService = { // TODO: change when setter is done. const user = UserService.getUser(); - const isMultiRootTenant = window?.globalConfigs?.getConfig("MULTI_ROOT_TENANT") || false; - const pathname = window.location.pathname; - const context = window?.globalConfigs?.getConfig("CONTEXT_PATH"); - const start = pathname.indexOf(context) + context.length + 1; - const employeeIndex = pathname.indexOf("employee"); - const citizenIndex = pathname.indexOf("citizen"); - const end = (employeeIndex !== -1) ? employeeIndex : (citizenIndex !== -1) ? citizenIndex : -1; - const tenant = end > start ? pathname.substring(start, end).replace(/\/$/, "") : ""; if (user?.extraRoleInfo) { const isDsoRoute = Digit.Utils.detectDsoRoute(window.location.pathname); if (isDsoRoute) { @@ -47,8 +39,7 @@ export const ULBService = { } //TODO: fix tenant id from userinfo - const tenantId = user?.info?.type !== "EMPLOYEE" && isMultiRootTenant && tenant ? tenant : - user?.info?.type === "EMPLOYEE" && user?.info?.tenantId ? user?.info?.tenantId : window?.globalConfigs.getConfig("STATE_LEVEL_TENANT_ID"); + const tenantId = user?.info?.type === "EMPLOYEE" && user?.info?.tenantId ? user?.info?.tenantId : window?.globalConfigs.getConfig("STATE_LEVEL_TENANT_ID"); return tenantId; }, /** diff --git a/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/Home.js b/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/Home.js index 3cad29da039..6a4c5ca55dc 100644 --- a/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/Home.js +++ b/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/Home.js @@ -16,8 +16,8 @@ export const processLinkData = (newData, code, t) => { const obj = newData?.[`${code}`]; if (obj) { obj.map((link) => { - if (window.globalPath === "sandbox-ui") { - link["navigationURL"] = link["navigationURL"].replace("/sandbox-ui/citizen", `/sandbox-ui/${Digit.ULBService.getCurrentTenantId()}/citizen`); + if (Digit.Utils.getMultiRootTenant()) { + link["navigationURL"] = link["navigationURL"].replace("/sandbox-ui/citizen", `/sandbox-ui/${Digit.ULBService.getStateId()}/citizen`); } link.link = link["navigationURL"]; link.i18nKey = t(link["name"]); diff --git a/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/TopBarSideBar/TopBar.js b/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/TopBarSideBar/TopBar.js index f3f02e4e8f8..1a36ef1179b 100644 --- a/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/TopBarSideBar/TopBar.js +++ b/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/TopBarSideBar/TopBar.js @@ -24,7 +24,8 @@ const TopBar = ({ const [profilePic, setProfilePic] = React.useState(null); React.useEffect(async () => { - const tenant = Digit.ULBService.getCurrentTenantId(); + + const tenant = Digit.Utils.getMultiRootTenant() ? Digit.ULBService.getStateId(): Digit.ULBService.getCurrentTenantId(); const uuid = userDetails?.info?.uuid; if (uuid) { const usersResponse = await Digit.UserService.userSearch(tenant, { uuid: [uuid] }, {}); diff --git a/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/citizen/Home/LocationSelection.js b/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/citizen/Home/LocationSelection.js index b86feca27e5..963cb4607d5 100644 --- a/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/citizen/Home/LocationSelection.js +++ b/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/citizen/Home/LocationSelection.js @@ -26,7 +26,7 @@ if (window?.globalPath === 'sandbox-ui') { requestCriteria = { url: "/tenant-management/tenant/_search", params: { - code: Digit.ULBService.getCurrentTenantId(), + code: Digit.ULBService.getStateId(), includeSubTenants: true }, body: { diff --git a/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/pages/citizen/Create/Steps/SelectAddress.js b/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/pages/citizen/Create/Steps/SelectAddress.js index 8d8c8cece8b..acf46d921df 100644 --- a/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/pages/citizen/Create/Steps/SelectAddress.js +++ b/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/pages/citizen/Create/Steps/SelectAddress.js @@ -13,7 +13,7 @@ if (window.globalPath === 'sandbox-ui') { requestCriteria = { url: "/tenant-management/tenant/_search", params: { - code: Digit.ULBService.getCurrentTenantId(), + code: Digit.ULBService.getStateId(), includeSubTenants: true }, body: {