From 05e44b11cb9cf0f3e648215f1682e2060ce8f252 Mon Sep 17 00:00:00 2001 From: mithun-hegde-egov Date: Tue, 22 Oct 2024 12:40:57 +0530 Subject: [PATCH 1/6] feedback changes --- .../packages/modules/core/src/components/DummyLoader.js | 2 +- .../components/TopBarSideBar/SideBar/StaticCitizenSideBar.js | 2 +- .../packages/modules/core/src/pages/citizen/Login/index.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/DummyLoader.js b/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/DummyLoader.js index d6debdac0ed..7b07a8bc634 100644 --- a/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/DummyLoader.js +++ b/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/DummyLoader.js @@ -25,7 +25,7 @@ const DummyLoaderScreen = () => { if (currentStep < steps.length) { setCurrentStep((prev) => prev + 1); } - }, 1000); // 1 second delay for each step + }, 2000); // 1 second delay for each step if (currentStep === steps.length) { clearInterval(stepInterval); // Clear the interval to stop further updates diff --git a/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/TopBarSideBar/SideBar/StaticCitizenSideBar.js b/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/TopBarSideBar/SideBar/StaticCitizenSideBar.js index e5adb484541..929d1c4c856 100644 --- a/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/TopBarSideBar/SideBar/StaticCitizenSideBar.js +++ b/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/TopBarSideBar/SideBar/StaticCitizenSideBar.js @@ -157,7 +157,7 @@ const StaticCitizenSideBar = ({ linkData, islinkDataLoading }) => { }; let profileItem; - if (isFetched && user && user.access_token) { + if (isFetched && user && user.access_token && user?.info?.type==="CITIZEN") { profileItem = ( ); diff --git a/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/citizen/Login/index.js b/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/citizen/Login/index.js index 604be7925a2..8b57b1f6597 100644 --- a/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/citizen/Login/index.js +++ b/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/citizen/Login/index.js @@ -72,7 +72,7 @@ const Login = ({ stateCode, isUserRegistered = true }) => { } Digit.SessionStorage.set("citizen.userRequestObject", user); Digit.UserService.setUser(user); - setCitizenDetail(user?.info, user?.access_token, stateCode); + setCitizenDetail(user?.info, user?.access_token, stateCode); const redirectPath = location.state?.from || DEFAULT_REDIRECT_URL; if (!Digit.ULBService.getCitizenCurrentTenant(true)) { history.replace(`/${window?.contextPath}/citizen/select-location`, { From 409beb68ceec16d3adc826bc7be2d34523f3fd5d Mon Sep 17 00:00:00 2001 From: mithun-hegde-egov Date: Tue, 22 Oct 2024 12:43:23 +0530 Subject: [PATCH 2/6] review changes --- .../packages/modules/core/src/pages/citizen/Login/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/citizen/Login/index.js b/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/citizen/Login/index.js index 8b57b1f6597..604be7925a2 100644 --- a/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/citizen/Login/index.js +++ b/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/citizen/Login/index.js @@ -72,7 +72,7 @@ const Login = ({ stateCode, isUserRegistered = true }) => { } Digit.SessionStorage.set("citizen.userRequestObject", user); Digit.UserService.setUser(user); - setCitizenDetail(user?.info, user?.access_token, stateCode); + setCitizenDetail(user?.info, user?.access_token, stateCode); const redirectPath = location.state?.from || DEFAULT_REDIRECT_URL; if (!Digit.ULBService.getCitizenCurrentTenant(true)) { history.replace(`/${window?.contextPath}/citizen/select-location`, { From f9c9af1cb9f13112d7138227bc484d9eeeae1fe9 Mon Sep 17 00:00:00 2001 From: mithun-hegde-egov Date: Tue, 22 Oct 2024 16:56:50 +0530 Subject: [PATCH 3/6] citizen home removed before login and hrms tenant updated --- .../TopBarSideBar/SideBar/StaticCitizenSideBar.js | 14 ++++++++++++++ .../modules/core/src/config/sidebar-menu.js | 10 ---------- .../modules/hrms/src/pages/createEmployee.js | 15 +++++++++++---- 3 files changed, 25 insertions(+), 14 deletions(-) diff --git a/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/TopBarSideBar/SideBar/StaticCitizenSideBar.js b/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/TopBarSideBar/SideBar/StaticCitizenSideBar.js index 929d1c4c856..5f39d8205d1 100644 --- a/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/TopBarSideBar/SideBar/StaticCitizenSideBar.js +++ b/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/TopBarSideBar/SideBar/StaticCitizenSideBar.js @@ -114,6 +114,10 @@ const StaticCitizenSideBar = ({ linkData, islinkDataLoading }) => { history.push(`/${window?.contextPath}/citizen/user/profile`); }; + const closeSidebar = () => { + history.push(`/${window?.contextPath}/citizen/all-services`); + }; + let menuItems = [ ...SideBarMenu(t, showProfilePage, redirectToLoginPage, isEmployee), ]; @@ -164,6 +168,16 @@ const StaticCitizenSideBar = ({ linkData, islinkDataLoading }) => { menuItems = menuItems.filter((item) => item?.id !== "login-btn"); menuItems = [ ...menuItems, + { + type: "link", + element: "HOME", + text: t("COMMON_BOTTOM_NAVIGATION_HOME"), + link: isEmployee ? `/${window?.contextPath}/employee` : `/${window?.contextPath}/citizen`, + icon: "HomeIcon", + populators: { + onClick: closeSidebar, + }, + }, { text: t("EDIT_PROFILE"), element: "PROFILE", diff --git a/micro-ui/web/micro-ui-internals/packages/modules/core/src/config/sidebar-menu.js b/micro-ui/web/micro-ui-internals/packages/modules/core/src/config/sidebar-menu.js index 06ea554fc12..6408b5f6f7f 100644 --- a/micro-ui/web/micro-ui-internals/packages/modules/core/src/config/sidebar-menu.js +++ b/micro-ui/web/micro-ui-internals/packages/modules/core/src/config/sidebar-menu.js @@ -3,16 +3,6 @@ import { LanguageIcon, LogoutIcon, AddressBookIcon, LocationIcon } from "@egover import ChangeLanguage from "../components/ChangeLanguage"; const SideBarMenu = (t, closeSidebar, redirectToLoginPage, isEmployee) => [ - { - type: "link", - element: "HOME", - text: t("COMMON_BOTTOM_NAVIGATION_HOME"), - link: isEmployee ? `/${window?.contextPath}/employee` : `/${window?.contextPath}/citizen`, - icon: "HomeIcon", - populators: { - onClick: closeSidebar, - }, - }, { type: "component", element: "LANGUAGE", diff --git a/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/pages/createEmployee.js b/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/pages/createEmployee.js index 51ea3258f37..bf90f08336f 100644 --- a/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/pages/createEmployee.js +++ b/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/pages/createEmployee.js @@ -16,6 +16,7 @@ const CreateEmployee = () => { const { t } = useTranslation(); const history = useHistory(); const isMobile = window.Digit.Utils.browser.isMobile(); + const isMultiRootTenant = Digit.Utils.getMultiRootTenant(); const { data: mdmsData,isLoading } = Digit.Hooks.useCommonMDMS(Digit.ULBService.getStateId(), "egov-hrms", ["CommonFieldsConfig"], { select: (data) => { @@ -146,12 +147,13 @@ const CreateEmployee = () => { const onSubmit = async (data) => { const hasCurrentAssignment = data?.Assignments?.some(assignment => assignment?.isCurrentAssignment === true); - let selectedCity= data?.Jurisdictions?.boundary; + let selectedCity= data?.Jurisdictions?.[0]?.boundary; + console.log("what si the sleected city", selectedCity); data.Jurisdictions = data?.Jurisdictions?.map((juris) => { return { ...juris, - boundary: tenantId, - tenantId: tenantId, + boundary: selectedCity, + tenantId: tenantId }; }); // If no current assignment, throw an error @@ -178,7 +180,12 @@ const CreateEmployee = () => { } let roles = data?.Jurisdictions?.map((ele) => { return ele.roles?.map((item) => { - item["tenantId"] = ele.boundary; + if(isMultiRootTenant){ + item["tenantId"] = tenantId; + } + else{ + item["tenantId"] = ele.boundary; + } return item; }); }); From 45dad9613f814edf8619da08d91619c13f269536 Mon Sep 17 00:00:00 2001 From: mithunhegde-egov <152362871+mithunhegde-egov@users.noreply.github.com> Date: Tue, 22 Oct 2024 17:04:50 +0530 Subject: [PATCH 4/6] removed console log --- .../packages/modules/hrms/src/pages/createEmployee.js | 1 - 1 file changed, 1 deletion(-) diff --git a/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/pages/createEmployee.js b/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/pages/createEmployee.js index bf90f08336f..5fb1a1f505c 100644 --- a/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/pages/createEmployee.js +++ b/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/pages/createEmployee.js @@ -148,7 +148,6 @@ const CreateEmployee = () => { const onSubmit = async (data) => { const hasCurrentAssignment = data?.Assignments?.some(assignment => assignment?.isCurrentAssignment === true); let selectedCity= data?.Jurisdictions?.[0]?.boundary; - console.log("what si the sleected city", selectedCity); data.Jurisdictions = data?.Jurisdictions?.map((juris) => { return { ...juris, From 7128a03d8d6c89fe7181c9f8afc6a8b0a9f6297b Mon Sep 17 00:00:00 2001 From: Jagankumar <53823168+jagankumar-egov@users.noreply.github.com> Date: Tue, 22 Oct 2024 17:34:14 +0530 Subject: [PATCH 5/6] Update micro-ui/web/micro-ui-internals/packages/modules/hrms/src/pages/createEmployee.js Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- .../packages/modules/hrms/src/pages/createEmployee.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/pages/createEmployee.js b/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/pages/createEmployee.js index 5fb1a1f505c..2f27bd098e1 100644 --- a/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/pages/createEmployee.js +++ b/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/pages/createEmployee.js @@ -147,7 +147,7 @@ const CreateEmployee = () => { const onSubmit = async (data) => { const hasCurrentAssignment = data?.Assignments?.some(assignment => assignment?.isCurrentAssignment === true); - let selectedCity= data?.Jurisdictions?.[0]?.boundary; + const selectedCity= data?.Jurisdictions?.[0]?.boundary; data.Jurisdictions = data?.Jurisdictions?.map((juris) => { return { ...juris, From b43de923bff7b7dba48398f9e92ce3288e1d1ccb Mon Sep 17 00:00:00 2001 From: Jagankumar <53823168+jagankumar-egov@users.noreply.github.com> Date: Tue, 22 Oct 2024 17:34:29 +0530 Subject: [PATCH 6/6] Update micro-ui/web/micro-ui-internals/packages/modules/core/src/components/TopBarSideBar/SideBar/StaticCitizenSideBar.js Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- .../components/TopBarSideBar/SideBar/StaticCitizenSideBar.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/TopBarSideBar/SideBar/StaticCitizenSideBar.js b/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/TopBarSideBar/SideBar/StaticCitizenSideBar.js index 5f39d8205d1..9cad3e8c00e 100644 --- a/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/TopBarSideBar/SideBar/StaticCitizenSideBar.js +++ b/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/TopBarSideBar/SideBar/StaticCitizenSideBar.js @@ -170,10 +170,10 @@ const StaticCitizenSideBar = ({ linkData, islinkDataLoading }) => { ...menuItems, { type: "link", + icon: "HomeIcon", element: "HOME", text: t("COMMON_BOTTOM_NAVIGATION_HOME"), link: isEmployee ? `/${window?.contextPath}/employee` : `/${window?.contextPath}/citizen`, - icon: "HomeIcon", populators: { onClick: closeSidebar, },