From 48b513803bd5b7ef8b7c7696fb74ecc03aaa5d51 Mon Sep 17 00:00:00 2001 From: NabeelAyubee Date: Thu, 5 Sep 2024 18:47:33 +0530 Subject: [PATCH 01/23] Application Management Updated > module master added > boundary update > workbench enhance --- .../example/src/setupProxy.js | 3 +- .../css/src/pages/employee/sandbox.scss | 65 +++++- .../packages/libraries/src/hooks/store.js | 2 +- .../libraries/src/services/atoms/urls.js | 1 + .../services/elements/TenantConfigService.js | 13 ++ .../src/services/molecules/Store/service.js | 25 ++- .../packages/modules/core/src/Module.js | 2 +- .../core/src/components/ErrorBoundaries.js | 6 +- .../core/src/components/ErrorComponent.js | 14 +- .../modules/core/src/components/Home.js | 2 +- .../core/src/hooks/useTenantConfigSearch.js | 16 ++ .../core/src/pages/employee/SignUp/config.js | 2 +- .../core/src/pages/employee/ViewUrl/index.js | 25 ++- .../sandbox/src/configs/UICustomizations.js | 33 +-- .../modules/sandbox/src/hooks/index.js | 8 +- .../src/hooks/useDefaultMasterHandler.js | 26 +++ .../applicationMgmt/ApplicationHome.js | 3 +- .../applicationMgmt/ModuleMasterTable.js | 81 ++++++- .../employee/applicationMgmt/SetupMaster.js | 197 ++++++++++++++++++ .../config/setupMasterConfig.js | 77 +++++++ .../sandbox/src/pages/employee/index.js | 2 + .../workbench/src/configs/searchMDMSConfig.js | 2 +- .../src/pages/employee/MDMSSearchv2.js | 21 +- .../workbench/src/pages/employee/MDMSView.js | 16 +- .../workbench/src/pages/employee/index.js | 106 ++++++---- 25 files changed, 655 insertions(+), 93 deletions(-) create mode 100644 micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/TenantConfigService.js create mode 100644 micro-ui/web/micro-ui-internals/packages/modules/core/src/hooks/useTenantConfigSearch.js create mode 100644 micro-ui/web/micro-ui-internals/packages/modules/sandbox/src/hooks/useDefaultMasterHandler.js create mode 100644 micro-ui/web/micro-ui-internals/packages/modules/sandbox/src/pages/employee/applicationMgmt/SetupMaster.js create mode 100644 micro-ui/web/micro-ui-internals/packages/modules/sandbox/src/pages/employee/applicationMgmt/config/setupMasterConfig.js diff --git a/micro-ui/web/micro-ui-internals/example/src/setupProxy.js b/micro-ui/web/micro-ui-internals/example/src/setupProxy.js index 8b80311fdb0..e4d96aefb02 100644 --- a/micro-ui/web/micro-ui-internals/example/src/setupProxy.js +++ b/micro-ui/web/micro-ui-internals/example/src/setupProxy.js @@ -92,7 +92,8 @@ module.exports = function (app) { "/project-factory", "/project-factory/v1/data/_autoGenerateBoundaryCode", "/billing-service/bill/v2/_fetchbill", - "/tenant-management" + "/tenant-management", + "/default-data-handler" ].forEach((location) => app.use(location, createProxy)); ["/pb-egov-assets"].forEach((location) => app.use(location, assetsProxy)); ["/mdms-v2/v2/_create"].forEach((location) => app.use(location, mdmsProxy)); diff --git a/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/sandbox.scss b/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/sandbox.scss index 7345361a20d..dd9bc74070c 100644 --- a/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/sandbox.scss +++ b/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/sandbox.scss @@ -92,7 +92,7 @@ align-self: flex-start; margin-bottom: 3rem; font-size: 14px; - margin-top: -2.5rem; + margin-top: -0.5rem; color: #505a5f; font-family: "Roboto"; } @@ -240,7 +240,7 @@ margin-top: 0.5rem; } .sandbox-url-footer { - margin-top: -1.5rem; + margin-top: 0.5rem; } .digit-button-primary { width: 100%; @@ -254,3 +254,64 @@ color: #00703c !important; } } +.sandbox-url-wrapper { + display: flex; + width: 100%; + .digit-text-input-field.urlInputText { + } + .digit-button-secondary.large.copyButton { + width: 30%; + padding: 0; + } +} + +.setupMasterSetupActionBar { + margin-top: 2.5rem; + margin-bottom: -1rem; + margin-left: -1rem; + margin-right: -1rem; + z-index: 1000; + box-shadow: 0 -0.063rem 0.125rem 0 rgba(0, 0, 0, 0.14902); + padding: 1.5rem; + display: flex; + flex-direction: row-reverse; +} +.digit-employee-card.sandboxSetupMasterInfo { + .h1.headerFlex { + display: flex; + gap: 1rem; + align-items: center; + } + .digit-card-header.subHeader { + font-size: 1.5rem; + font-weight: 700; + color: unset !important; + } +} +.digit-card-header.setupMaster-subheading { + font-size: 1.5rem; + color: unset !important; + margin-left: 1.5rem; +} +.digit-popup-wrapper.masterHandlerPopup { + .digit-popup-header { + .header-close-container { + .digit-popup-close { + display: none !important; + } + } + } +} +.digit-topbar-ulb { + .state { + width: 80px; + height: 19px; + } +} +.digit-popup-footer.masterHandlerPopUpFooter { + .digit-popup-footer-buttons { + margin-left: unset; + width: 100%; + justify-content: center; + } +} diff --git a/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/store.js b/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/store.js index f9550c4d1df..bb12fab4fa6 100644 --- a/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/store.js +++ b/micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/store.js @@ -10,7 +10,7 @@ export const useStore = ({ stateCode, moduleCode, language ,modulePrefix = "rain export const useInitStore = (stateCode, enabledModules,modulePrefix = "rainmaker" ) => { const { isLoading, error, isError, data } = useQuery( ["initStore", stateCode, enabledModules,modulePrefix], - () => StoreService.digitInitData(stateCode, enabledModules ,modulePrefix), + () => StoreService.digitInitData(stateCode, enabledModules ,modulePrefix, window?.globalPath === "sandbox-ui" ? true : false), { staleTime: Infinity, } diff --git a/micro-ui/web/micro-ui-internals/packages/libraries/src/services/atoms/urls.js b/micro-ui/web/micro-ui-internals/packages/libraries/src/services/atoms/urls.js index b14bb453e3d..778ae369ac2 100644 --- a/micro-ui/web/micro-ui-internals/packages/libraries/src/services/atoms/urls.js +++ b/micro-ui/web/micro-ui-internals/packages/libraries/src/services/atoms/urls.js @@ -2,6 +2,7 @@ const mdmsV1Path = window?.globalConfigs?.getConfig("MDMS_V1_CONTEXT_PATH") || " const mdmsV2Path = window?.globalConfigs?.getConfig("MDMS_V2_CONTEXT_PATH") || "mdms-v2"; const Urls = { MDMS: `/${mdmsV1Path}/v1/_search`, + TenantConfigSearch: `/tenant-management/tenant/config/_search`, WorkFlow: `/egov-workflow-v2/egov-wf/businessservice/_search`, WorkFlowProcessSearch: `/egov-workflow-v2/egov-wf/process/_search`, localization: `/localization/messages/v1/_search`, diff --git a/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/TenantConfigService.js b/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/TenantConfigService.js new file mode 100644 index 00000000000..33e42326452 --- /dev/null +++ b/micro-ui/web/micro-ui-internals/packages/libraries/src/services/elements/TenantConfigService.js @@ -0,0 +1,13 @@ +import { ServiceRequest } from "../atoms/Utils/Request"; +import Urls from "../atoms/urls"; + +export const TenantConfigSearch = { + tenant: (stateCode) => + ServiceRequest({ + serviceName: "tenantConfigSearch", + url: Urls.TenantConfigSearch, + data: {}, + useCache: true, + params: { code: stateCode }, + }), +}; diff --git a/micro-ui/web/micro-ui-internals/packages/libraries/src/services/molecules/Store/service.js b/micro-ui/web/micro-ui-internals/packages/libraries/src/services/molecules/Store/service.js index 13016c84380..ffa862b2394 100644 --- a/micro-ui/web/micro-ui-internals/packages/libraries/src/services/molecules/Store/service.js +++ b/micro-ui/web/micro-ui-internals/packages/libraries/src/services/molecules/Store/service.js @@ -2,6 +2,7 @@ import { LocalizationService } from "../../elements/Localization/service"; import { MdmsService } from "../../elements/MDMS"; import { Storage } from "../../atoms/Utils/Storage"; import { ApiCacheService } from "../../atoms/ApiCacheService"; +import { TenantConfigSearch } from "../../elements/TenantConfigService"; const getImgUrl = (url, fallbackUrl) => { if (!url && fallbackUrl) { @@ -30,7 +31,7 @@ const addLogo = (id, url, fallbackUrl = "") => { const renderTenantLogos = (stateInfo, tenants) => { addLogo(stateInfo.code, stateInfo.logoUrl); - tenants.forEach((tenant) => { + tenants?.forEach((tenant) => { addLogo(tenant.code, tenant.logoId, stateInfo.logoUrl); }); }; @@ -54,21 +55,25 @@ export const StoreService = { }); return await Promise.all(allBoundries); }, - digitInitData: async (stateCode, enabledModules , modulePrefix) => { + digitInitData: async (stateCode, enabledModules, modulePrefix, tenantConfigFetch) => { 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 tenantConfigs = await TenantConfigSearch.tenant(stateCode); + const tenantConfigSearch = tenantConfigs?.tenantConfigs ? tenantConfigs?.tenantConfigs : null; const localities = {}; const revenue_localities = {}; const initData = { languages: stateInfo.hasLocalisation ? stateInfo.languages : [{ label: "ENGLISH", value: Digit.Utils.getDefaultLanguage() }], stateInfo: { - code: stateInfo.code, - name: stateInfo.name, - logoUrl: stateInfo.logoUrl, - statelogo: stateInfo.statelogo, - logoUrlWhite: stateInfo.logoUrlWhite, - bannerUrl: stateInfo.bannerUrl, + code: tenantConfigFetch ? tenantConfigSearch?.[0]?.code : stateInfo.code, + name: tenantConfigFetch ? tenantConfigSearch?.[0]?.name : stateInfo.name, + logoUrl: tenantConfigFetch ? tenantConfigSearch?.[0]?.documents?.find((item) => item.type === "logoUrl")?.url : stateInfo.logoUrl, + statelogo: tenantConfigFetch ? tenantConfigSearch?.[0]?.documents?.find((item) => item.type === "statelogo")?.url : stateInfo.statelogo, + logoUrlWhite: tenantConfigFetch + ? tenantConfigSearch?.[0]?.documents?.find((item) => item.type === "logoUrlWhite")?.url + : stateInfo.logoUrlWhite, + bannerUrl: tenantConfigFetch ? tenantConfigSearch?.[0]?.documents?.find((item) => item.type === "bannerUrl")?.url : 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)|| [], diff --git a/micro-ui/web/micro-ui-internals/packages/modules/core/src/Module.js b/micro-ui/web/micro-ui-internals/packages/modules/core/src/Module.js index d7beef867e3..f9374c23234 100644 --- a/micro-ui/web/micro-ui-internals/packages/modules/core/src/Module.js +++ b/micro-ui/web/micro-ui-internals/packages/modules/core/src/Module.js @@ -120,7 +120,7 @@ const componentsToRegister = { ChangeCity, ChangeLanguage, PrivacyComponent, - OtpComponent + OtpComponent, }; export const initCoreComponents = () => { diff --git a/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/ErrorBoundaries.js b/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/ErrorBoundaries.js index 42b619b3c7a..61ff0d99d61 100644 --- a/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/ErrorBoundaries.js +++ b/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/ErrorBoundaries.js @@ -18,12 +18,12 @@ const Redircter = () => { class ErrorBoundary extends React.Component { constructor(props) { super(props); - this.state = { error: null, errorStack: null, hasError: false }; + this.state = { error: null, errorStack: null, hasError: false, module: null, action: null, info: null }; } static getDerivedStateFromError(error) { // Update state so the next render will show the fallback UI. - return { error: error?.message, hasError: true, errorStack: error?.stack }; + return { error: error?.message, hasError: true, errorStack: error?.stack, module: error?.module, action: error?.action, info: error?.info }; } componentDidCatch(error, errorInfo) { @@ -40,7 +40,7 @@ class ErrorBoundary extends React.Component { return (
- + {/* Something went wrong
diff --git a/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/ErrorComponent.js b/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/ErrorComponent.js index de347f17efe..e1cbe998713 100644 --- a/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/ErrorComponent.js +++ b/micro-ui/web/micro-ui-internals/packages/modules/core/src/components/ErrorComponent.js @@ -19,11 +19,19 @@ const ErrorConfig = { }, }; +const ModuleBasedErrorConfig = { + sandbox: { + imgUrl: `https://s3.ap-south-1.amazonaws.com/egov-qa-assets/error-image.png`, + infoMessage: "WRONG_TENANT_SIGN_UP", + buttonInfo: "CREATE_TENANT_ERROR_BUTTON", + }, +}; + const ErrorComponent = (props) => { const { type = "error" } = Digit.Hooks.useQueryParams(); - const config = ErrorConfig[type]; + const module = props?.errorData?.module; const { t } = useTranslation(); - + const config = module ? ModuleBasedErrorConfig[module] : ErrorConfig[type]; const stateInfo = props.stateInfo; return ( @@ -33,7 +41,7 @@ const ErrorComponent = (props) => {

{t(config.infoMessage)}

+
{t("SANDBOX_URL_FOOT")}
diff --git a/micro-ui/web/micro-ui-internals/packages/modules/sandbox/src/configs/UICustomizations.js b/micro-ui/web/micro-ui-internals/packages/modules/sandbox/src/configs/UICustomizations.js index c42cb548851..0c1d80d5df1 100644 --- a/micro-ui/web/micro-ui-internals/packages/modules/sandbox/src/configs/UICustomizations.js +++ b/micro-ui/web/micro-ui-internals/packages/modules/sandbox/src/configs/UICustomizations.js @@ -180,7 +180,7 @@ export const UICustomizations = { preProcess: (data, additionalDetails) => { const tenantId = Digit.ULBService.getCurrentTenantId(); data.params = { - tenantId: tenantId + tenantId: tenantId, }; data.body = { RequestInfo: data.body.RequestInfo }; data.body.MdmsCriteria = { @@ -200,7 +200,7 @@ export const UICustomizations = { const temp = data?.MdmsRes?.["sandbox-ui"]?.ModuleMasterConfig?.find((item) => item?.module === additionalDetails?.moduleName); return { module: temp?.module, - master: temp?.master?.filter((item) => item.type === "module" || item.type === "common"), + master: temp?.master?.filter((item) => item.type === "module" || item.type === "common" || item.type === "boundary"), }; }; @@ -235,19 +235,28 @@ export const UICustomizations = { return value; case "SANDBOX_ACTIONS": - const handleRedirect = (value) => { - window.history.pushState( - null, - "", - `/${window.contextPath}/employee/workbench/mdms-search-v2?moduleName=${value?.split(".")?.[0]}&masterName=${value?.split(".")?.[1]}` - ); - const navEvent = new PopStateEvent("popstate"); - window.dispatchEvent(navEvent); + const handleRedirect = (value, type) => { + if (type === "boundary") { + window.history.pushState( + null, + "", + `/${window.contextPath}/employee/workbench/upload-boundary?hierarchyType=${value}&from=sandbox` + ); + const navEvent = new PopStateEvent("popstate"); + window.dispatchEvent(navEvent); + } else { + window.history.pushState( + null, + "", + `/${window.contextPath}/employee/workbench/mdms-search-v2?moduleName=${value?.split(".")?.[0]}&masterName=${value?.split(".")?.[1]}` + ); + const navEvent = new PopStateEvent("popstate"); + window.dispatchEvent(navEvent); + } }; - return (
- handleRedirect(row?.code)} /> + handleRedirect(row?.code, row?.type)} />
); default: diff --git a/micro-ui/web/micro-ui-internals/packages/modules/sandbox/src/hooks/index.js b/micro-ui/web/micro-ui-internals/packages/modules/sandbox/src/hooks/index.js index 47137510d10..f837af04ab0 100644 --- a/micro-ui/web/micro-ui-internals/packages/modules/sandbox/src/hooks/index.js +++ b/micro-ui/web/micro-ui-internals/packages/modules/sandbox/src/hooks/index.js @@ -1,16 +1,18 @@ import { useIndividualView } from "./useIndividualView"; import utils from "../utils"; +import useDefaultMasterHandler from "./useDefaultMasterHandler"; const sandbox = { - useIndividualView + useIndividualView, + useDefaultMasterHandler, }; const Hooks = { - sandbox + sandbox, }; const Utils = { browser: { - sandbox: () => { }, + sandbox: () => {}, }, sandbox: { ...utils, diff --git a/micro-ui/web/micro-ui-internals/packages/modules/sandbox/src/hooks/useDefaultMasterHandler.js b/micro-ui/web/micro-ui-internals/packages/modules/sandbox/src/hooks/useDefaultMasterHandler.js new file mode 100644 index 00000000000..72752fd020a --- /dev/null +++ b/micro-ui/web/micro-ui-internals/packages/modules/sandbox/src/hooks/useDefaultMasterHandler.js @@ -0,0 +1,26 @@ +import { useMutation } from "react-query"; + +const defaultMasterHandlerService = async (reqData, tenantId) => { + try { + const response = await Digit.CustomService.getResponse({ + url: "/default-data-handler/defaultdata/setup", + body: { + targetTenantId: tenantId, + module: reqData?.module, + onlySchemas: reqData?.onlySchemas, + }, + params: {}, + }); + return response; + } catch (error) { + throw new Error(error?.response?.data?.Errors?.[0].description); + } +}; + +const useDefaultMasterHandler = (tenantId) => { + return useMutation((reqData) => { + return defaultMasterHandlerService(reqData, tenantId); + }); +}; + +export default useDefaultMasterHandler; diff --git a/micro-ui/web/micro-ui-internals/packages/modules/sandbox/src/pages/employee/applicationMgmt/ApplicationHome.js b/micro-ui/web/micro-ui-internals/packages/modules/sandbox/src/pages/employee/applicationMgmt/ApplicationHome.js index f95257835a2..9448b85ab13 100644 --- a/micro-ui/web/micro-ui-internals/packages/modules/sandbox/src/pages/employee/applicationMgmt/ApplicationHome.js +++ b/micro-ui/web/micro-ui-internals/packages/modules/sandbox/src/pages/employee/applicationMgmt/ApplicationHome.js @@ -34,7 +34,8 @@ const ApplicationHome = () => { className="sandbox-module-card" label={t(`SANDBOX_APPLICATION_MODULE_${item?.module}`)} buttonLabel={t(`SANDBOX_VIEW`)} - onButtonClick={() => history.push(`/${window?.contextPath}/employee/sandbox/application-management/module?module=${item?.module}`)} + onButtonClick={() => history.push(`/${window?.contextPath}/employee/sandbox/application-management/setup-master?module=${item?.module}`)} + // onButtonClick={() => history.push(`/${window?.contextPath}/employee/sandbox/application-management/module?module=${item?.module}`)} /> ))} diff --git a/micro-ui/web/micro-ui-internals/packages/modules/sandbox/src/pages/employee/applicationMgmt/ModuleMasterTable.js b/micro-ui/web/micro-ui-internals/packages/modules/sandbox/src/pages/employee/applicationMgmt/ModuleMasterTable.js index 36f919334d4..e4a6ab0c1ff 100644 --- a/micro-ui/web/micro-ui-internals/packages/modules/sandbox/src/pages/employee/applicationMgmt/ModuleMasterTable.js +++ b/micro-ui/web/micro-ui-internals/packages/modules/sandbox/src/pages/employee/applicationMgmt/ModuleMasterTable.js @@ -1,6 +1,7 @@ -import React from "react"; +import React, { useState } from "react"; import { useTranslation } from "react-i18next"; import { Header, InboxSearchComposer } from "@egovernments/digit-ui-react-components"; +import { Button, PopUp, Toast } from "@egovernments/digit-ui-components"; import { useHistory, useLocation } from "react-router-dom"; import { moduleMasterConfig } from "./config/moduleMasterConfig"; @@ -11,11 +12,42 @@ const ModuleMasterTable = () => { const searchParams = new URLSearchParams(location.search); const module = searchParams.get("module"); const config = moduleMasterConfig(module); - + const tenantId = Digit.ULBService.getCurrentTenantId(); + const [showPopUp, setShowPopUp] = useState(true); + const { mutate: useDefaultMasterHandler } = Digit.Hooks.sandbox.useDefaultMasterHandler(tenantId); + const [showToast, setShowToast] = useState(null); const onClickRow = ({ original: row }) => { const value = row?.code; - history.push( - `/${window.contextPath}/employee/workbench/mdms-search-v2?moduleName=${value?.split(".")?.[0]}&masterName=${value?.split(".")?.[1]}` + const type = row?.type; + if (type === "boundary") { + history.push( + `/${window.contextPath}/employee/workbench/upload-boundary?hierarchyType=${value}&from=sandbox&module=${module}` + ); + } else { + history.push( + `/${window.contextPath}/employee/workbench/mdms-search-v2?moduleName=${value?.split(".")?.[0]}&masterName=${ + value?.split(".")?.[1] + }&from=sandbox&screen=applicationManagement&action=view` + ); + } + }; + const handleMasterData = async (check) => { + await useDefaultMasterHandler( + { + module: module, + onlySchemas: check, + }, + { + onError: (error, variables) => { + console.log(error); + setShowPopUp(false); + setShowToast({ key: "error", label: error, isError: true }); + }, + onSuccess: async (data) => { + setShowPopUp(false); + setShowToast({ key: "success", label: "SUCCESS" }); + }, + } ); }; return ( @@ -31,6 +63,47 @@ const ModuleMasterTable = () => { }} > + {showPopUp && ( + {t("ES_CAMPAIGN_UPLOAD_BOUNDARY_DATA_MODAL_TEXT")}]} + onOverlayClick={() => {}} + footerChildren={[ + + + + )} + {showMaster && ( + <> +
+ + {t(config?.header || "N/A")} +
+ {t(config?.description)} + {/* {Object.keys(moduleMasterData)?.length > 0 && + Object.keys(moduleMasterData)?.map((item, index) => ( +
  • + {t(item)} + {moduleMasterData?.[item]?.length > 0 && + moduleMasterData?.[item]?.map((subItem, subIndex) => ( +
  • + {subIndex + 1}. + {t(subItem)} + {subItem?.child?.length > 0 && + subItem.child.map((grandChild, grandIndex) => ( +
  • + {String.fromCharCode(97 + grandIndex)} . + {t(grandChild)} +
  • + ))} + + ))} + + ))} */} +
    + {Object.entries(moduleMasterData).map(([type, categories], index) => ( +
    + {type.charAt(0).toUpperCase() + type.slice(1)} + {renderHierarchy(categories)} +
    + ))} +
    +
    + +
    + + )} + + ); +}; + +export default SetupMaster; diff --git a/micro-ui/web/micro-ui-internals/packages/modules/sandbox/src/pages/employee/applicationMgmt/config/setupMasterConfig.js b/micro-ui/web/micro-ui-internals/packages/modules/sandbox/src/pages/employee/applicationMgmt/config/setupMasterConfig.js new file mode 100644 index 00000000000..cdb1ab8b1fd --- /dev/null +++ b/micro-ui/web/micro-ui-internals/packages/modules/sandbox/src/pages/employee/applicationMgmt/config/setupMasterConfig.js @@ -0,0 +1,77 @@ +export const setupMasterConfig = { + tenantId: "pg", + moduleName: "commonUiConfig", + SetupMaster: [ + { + header: "COMPLAINT_MANAGEMENT", + module: "PGR", + active: true, + description: "COMPLAINT_MANAGEMENT_DESCRIPTION", + actionText: "SETUP_NOW", + features: [ + { + id: 1, + name: "COMPLAINT_MANAGEMENT_REGISTRATION", + }, + { + id: 2, + name: "COMPLAINT_MANAGEMENT_FEATURE_LOGIN_CREATION", + }, + { + id: 3, + name: "COMPLAINT_MANAGEMENT_LODGING_FILE", + }, + { + id: 4, + name: "COMPLAINT_MANAGEMENT_ASSIGNING_COMPLAINT", + }, + { + id: 5, + name: "COMPLAINT_MANAGEMENT_RESOLVING_COMPLAINT", + }, + { + id: 6, + name: "COMPLAINT_MANAGEMENT_MANAGE_COMPLAINTS", + }, + { + id: 7, + name: "COMPLAINT_MANAGEMENT_TRACK_COMPLAINTS", + }, + { + id: 8, + name: "COMPLAINT_MANAGEMENT_DASHBOARD_REPORTS", + }, + ], + }, + { + header: "HCM", + module: "HCM", + active: true, + description: "HCM_DESCRIPTION", + actionText: "SETUP_NOW", + features: [ + { + id: 1, + name: "HCM_FEATURE_1", + }, + ], + }, + { + header: "HRMS", + module: "HRMS", + active: true, + description: "HRMS_DESCRIPTION", + actionText: "SETUP_NOW", + features: [ + { + id: 1, + name: "HRMS_REGISTRATION", + }, + { + id: 2, + name: "HRMS_LOGIN_CREATION", + }, + ], + }, + ], +}; diff --git a/micro-ui/web/micro-ui-internals/packages/modules/sandbox/src/pages/employee/index.js b/micro-ui/web/micro-ui-internals/packages/modules/sandbox/src/pages/employee/index.js index 337c874dc5f..09e5377e712 100644 --- a/micro-ui/web/micro-ui-internals/packages/modules/sandbox/src/pages/employee/index.js +++ b/micro-ui/web/micro-ui-internals/packages/modules/sandbox/src/pages/employee/index.js @@ -9,6 +9,7 @@ import TenantView from "./tenantMgmt/TenantView"; import TenantCreate from "./tenantMgmt/TenantCreate"; import ApplicationHome from "./applicationMgmt/ApplicationHome"; import ModuleMasterTable from "./applicationMgmt/ModuleMasterTable"; +import SetupMaster from "./applicationMgmt/SetupMaster"; const bredCrumbStyle = { maxWidth: "min-content" }; @@ -57,6 +58,7 @@ const App = ({ path, stateCode, userType, tenants }) => { } /> } /> } /> + } /> } /> diff --git a/micro-ui/web/micro-ui-internals/packages/modules/workbench/src/configs/searchMDMSConfig.js b/micro-ui/web/micro-ui-internals/packages/modules/workbench/src/configs/searchMDMSConfig.js index 84edeb4b8f5..2847d5793de 100644 --- a/micro-ui/web/micro-ui-internals/packages/modules/workbench/src/configs/searchMDMSConfig.js +++ b/micro-ui/web/micro-ui-internals/packages/modules/workbench/src/configs/searchMDMSConfig.js @@ -2,7 +2,7 @@ export const Config = { label: "WBH_SEARCH_MDMS", type: "search", actionLabel: "WBH_ADD_MDMS", - actionRoles: ["MDMS_ADMIN","CAMPAIGN_ADMIN"], + actionRoles: ["MDMS_ADMIN","CAMPAIGN_ADMIN","SUPERUSER"], actionLink: "workbench/mdms-add-v2", apiDetails: { serviceName: `/mdms-v2/v2/_search`, diff --git a/micro-ui/web/micro-ui-internals/packages/modules/workbench/src/pages/employee/MDMSSearchv2.js b/micro-ui/web/micro-ui-internals/packages/modules/workbench/src/pages/employee/MDMSSearchv2.js index c423e6c171a..32c1b68ec11 100644 --- a/micro-ui/web/micro-ui-internals/packages/modules/workbench/src/pages/employee/MDMSSearchv2.js +++ b/micro-ui/web/micro-ui-internals/packages/modules/workbench/src/pages/employee/MDMSSearchv2.js @@ -24,6 +24,19 @@ const MDMSSearchv2 = () => { const history = useHistory(); let {masterName:modulee,moduleName:master,tenantId} = Digit.Hooks.useQueryParams() + let {from, screen, action} = Digit.Hooks.useQueryParams() + + const additionalParams = { + from: from, + screen: screen, + action: action + } + + Object.keys(additionalParams).forEach(key => { + if (additionalParams[key] === undefined || additionalParams[key] === null) { + delete additionalParams[key]; + } + }); const [availableSchemas, setAvailableSchemas] = useState([]); const [currentSchema, setCurrentSchema] = useState(null); @@ -157,15 +170,17 @@ const MDMSSearchv2 = () => { const handleAddMasterData = () => { let actionLink=updatedConfig?.actionLink + const additionalParamString = new URLSearchParams(additionalParams).toString(); if(modulee&&master){ - actionLink= `workbench/mdms-add-v2?moduleName=${master}&masterName=${modulee}` + actionLink= `workbench/mdms-add-v2?moduleName=${master}&masterName=${modulee}${additionalParamString ? "&"+additionalParamString : ""}` } - history.push(`/${window?.contextPath}/employee/${actionLink}`); + history.push(`/${window?.contextPath}/employee/${actionLink}${additionalParamString ? "&"+additionalParamString : ""}`); } const onClickRow = ({original:row}) => { const [moduleName,masterName] = row.schemaCode.split(".") - history.push(`/${window.contextPath}/employee/workbench/mdms-view?moduleName=${moduleName}&masterName=${masterName}&uniqueIdentifier=${row.uniqueIdentifier}`) + const additionalParamString = new URLSearchParams(additionalParams).toString(); + history.push(`/${window.contextPath}/employee/workbench/mdms-view?moduleName=${moduleName}&masterName=${masterName}&uniqueIdentifier=${row.uniqueIdentifier}${additionalParamString ? "&"+additionalParamString : ""}`) } if (isLoading) return ; diff --git a/micro-ui/web/micro-ui-internals/packages/modules/workbench/src/pages/employee/MDMSView.js b/micro-ui/web/micro-ui-internals/packages/modules/workbench/src/pages/employee/MDMSView.js index 456afcb757f..597bce22a2a 100644 --- a/micro-ui/web/micro-ui-internals/packages/modules/workbench/src/pages/employee/MDMSView.js +++ b/micro-ui/web/micro-ui-internals/packages/modules/workbench/src/pages/employee/MDMSView.js @@ -10,6 +10,19 @@ const MDMSView = ({...props}) => { const { t } = useTranslation() const [showToast, setShowToast] = useState(false); let { moduleName, masterName, tenantId,uniqueIdentifier } = Digit.Hooks.useQueryParams(); + let {from, screen, action} = Digit.Hooks.useQueryParams() + + const additionalParams = { + from: from, + screen: screen, + action: action + } + + Object.keys(additionalParams).forEach(key => { + if (additionalParams[key] === undefined || additionalParams[key] === null) { + delete additionalParams[key]; + } + }); // const stateId = Digit.ULBService.getStateId(); tenantId = Digit.ULBService.getCurrentTenantId(); const fetchActionItems = (data) => { @@ -115,7 +128,8 @@ const MDMSView = ({...props}) => { const {action:actionSelected} = action //action===EDIT go to edit screen if(actionSelected==="EDIT") { - history.push(`/${window?.contextPath}/employee/workbench/mdms-edit?moduleName=${moduleName}&masterName=${masterName}&uniqueIdentifier=${uniqueIdentifier}`) + const additionalParamString = new URLSearchParams(additionalParams).toString(); + history.push(`/${window?.contextPath}/employee/workbench/mdms-edit?moduleName=${moduleName}&masterName=${masterName}&uniqueIdentifier=${uniqueIdentifier}${additionalParamString ? "&"+additionalParamString : ""}`) } //action===DISABLE || ENABLE call update api and show toast respectively else{ diff --git a/micro-ui/web/micro-ui-internals/packages/modules/workbench/src/pages/employee/index.js b/micro-ui/web/micro-ui-internals/packages/modules/workbench/src/pages/employee/index.js index 7323cd7b205..b53b255c22c 100644 --- a/micro-ui/web/micro-ui-internals/packages/modules/workbench/src/pages/employee/index.js +++ b/micro-ui/web/micro-ui-internals/packages/modules/workbench/src/pages/employee/index.js @@ -21,49 +21,73 @@ const WorkbenchBreadCrumb = ({ location, defaultPath }) => { const { t } = useTranslation(); const search = useLocation().search; const fromScreen = new URLSearchParams(search).get("from") || null; - const pathVar = location.pathname.replace(defaultPath + '/', "").split("?")?.[0]; - const { masterName, moduleName, uniqueIdentifier } = Digit.Hooks.useQueryParams() + const pathVar = location.pathname.replace(defaultPath + "/", "").split("?")?.[0]; + const { masterName, moduleName, uniqueIdentifier, from, screen, action } = Digit.Hooks.useQueryParams(); - const crumbs = [ - { - path: `/${window?.contextPath}/employee`, - content: t("WORKBENCH_HOME"), - show: true, - }, - { - path: `/${window.contextPath}/employee/workbench/manage-master-data`, - content: t(`WBH_MANAGE_MASTER_DATA`), - show: pathVar.includes("mdms-") ? true : false, - // query:`moduleName=${moduleName}&masterName=${masterName}` - }, - { - path: `/${window.contextPath}/employee/workbench/localisation-search`, - content: t(`LOCALISATION_SEARCH`), - show: pathVar.includes("localisation-") ? true : false, - isBack: pathVar.includes("localisation-search") ? true : false - // query:`moduleName=${moduleName}&masterName=${masterName}` - }, + const crumbs = from + ? [ + { + path: `/${window?.contextPath}/employee`, + content: t("WORKBENCH_HOME"), + show: true, + }, + { + path: pathVar !== "mdms-search-v2" ? `/${window.contextPath}/employee/workbench/mdms-search-v2` : "", + query: `moduleName=${moduleName}&masterName=${masterName}&from=${from}&screen=${screen}&action=${action}`, + content: t(`${Digit.Utils.workbench.getMDMSLabel(pathVar, masterName, moduleName)}`), + show: masterName && moduleName ? true : false, + }, + { + path: `/${window.contextPath}/employee/workbench/mdms-view`, + content: t(`MDMS_VIEW`), + show: pathVar.includes("mdms-edit") ? true : false, + query: `moduleName=${moduleName}&masterName=${masterName}&uniqueIdentifier=${uniqueIdentifier}&from=${from}&screen=${screen}&action=${action}`, + }, + { + path: `/${window.contextPath}/employee/masters/response`, + content: t(`${Digit.Utils.workbench.getMDMSLabel(pathVar, "", "")}`), + show: Digit.Utils.workbench.getMDMSLabel(pathVar, "", "", ["mdms-search-v2", "localisation-search"]) ? true : false, + }, + ] + : [ + { + path: `/${window?.contextPath}/employee`, + content: t("WORKBENCH_HOME"), + show: true, + }, + { + path: `/${window.contextPath}/employee/workbench/manage-master-data`, + content: t(`WBH_MANAGE_MASTER_DATA`), + show: pathVar.includes("mdms-") ? true : false, + // query:`moduleName=${moduleName}&masterName=${masterName}` + }, + { + path: `/${window.contextPath}/employee/workbench/localisation-search`, + content: t(`LOCALISATION_SEARCH`), + show: pathVar.includes("localisation-") ? true : false, + isBack: pathVar.includes("localisation-search") ? true : false, + // query:`moduleName=${moduleName}&masterName=${masterName}` + }, - { - path: `/${window.contextPath}/employee/workbench/mdms-search-v2`, - query: `moduleName=${moduleName}&masterName=${masterName}`, - content: t(`${Digit.Utils.workbench.getMDMSLabel(pathVar, masterName, moduleName)}`), - show: (masterName && moduleName) ? true : false, - isBack: pathVar.includes("mdms-search-v2") ? true : false - }, - { - path: `/${window.contextPath}/employee/workbench/mdms-view`, - content: t(`MDMS_VIEW`), - show: pathVar.includes("mdms-edit") ? true : false, - query: `moduleName=${moduleName}&masterName=${masterName}&uniqueIdentifier=${uniqueIdentifier}` - }, - { - path: `/${window.contextPath}/employee/masters/response`, - content: t(`${Digit.Utils.workbench.getMDMSLabel(pathVar, "", "")}`), - show: Digit.Utils.workbench.getMDMSLabel(pathVar, "", "", ["mdms-search-v2", "localisation-search"]) ? true : false, - }, - - ]; + { + path: `/${window.contextPath}/employee/workbench/mdms-search-v2`, + query: `moduleName=${moduleName}&masterName=${masterName}`, + content: t(`${Digit.Utils.workbench.getMDMSLabel(pathVar, masterName, moduleName)}`), + show: masterName && moduleName ? true : false, + isBack: pathVar.includes("mdms-search-v2") ? true : false, + }, + { + path: `/${window.contextPath}/employee/workbench/mdms-view`, + content: t(`MDMS_VIEW`), + show: pathVar.includes("mdms-edit") ? true : false, + query: `moduleName=${moduleName}&masterName=${masterName}&uniqueIdentifier=${uniqueIdentifier}`, + }, + { + path: `/${window.contextPath}/employee/masters/response`, + content: t(`${Digit.Utils.workbench.getMDMSLabel(pathVar, "", "")}`), + show: Digit.Utils.workbench.getMDMSLabel(pathVar, "", "", ["mdms-search-v2", "localisation-search"]) ? true : false, + }, + ]; return ; }; From fedc0cd92f009a07d4cac3f34dd6ce42589a370e Mon Sep 17 00:00:00 2001 From: aaradhya-egov <137176709+aaradhya-egov@users.noreply.github.com> Date: Thu, 5 Sep 2024 18:56:31 +0530 Subject: [PATCH 02/23] Pgr sandbox (#1360) * pgr * pgr (#1357) * fix (#1358) * Update index.html --------- Co-authored-by: nabeelmd-eGov --- .../example/public/index.html | 2 +- .../micro-ui-internals/example/src/index.js | 4 +- .../src/services/molecules/Ulb/index.js | 26 ++++-- .../packages/libraries/src/utils/index.js | 4 +- .../modules/core/src/components/Home.js | 35 +++---- .../SideBar/StaticCitizenSideBar.js | 2 +- .../pages/citizen/Home/LocationSelection.js | 57 ++++++++++-- .../core/src/pages/citizen/Home/index.js | 2 +- .../core/src/pages/citizen/Login/SelectOtp.js | 3 +- .../core/src/pages/citizen/Login/index.js | 4 +- .../modules/core/src/pages/citizen/index.js | 7 +- .../modules/pgr/src/components/PGRCard.js | 20 ++-- .../citizen/Create/Steps/SelectAddress.js | 48 +++++++++- .../pages/employee/CreateComplaint/index.js | 92 ++++++++++++++++--- .../react-components/src/atoms/UploadFile.js | 6 +- 15 files changed, 242 insertions(+), 70 deletions(-) diff --git a/micro-ui/web/micro-ui-internals/example/public/index.html b/micro-ui/web/micro-ui-internals/example/public/index.html index 54d67aa1210..44d50910291 100644 --- a/micro-ui/web/micro-ui-internals/example/public/index.html +++ b/micro-ui/web/micro-ui-internals/example/public/index.html @@ -24,4 +24,4 @@
    - \ No newline at end of file + diff --git a/micro-ui/web/micro-ui-internals/example/src/index.js b/micro-ui/web/micro-ui-internals/example/src/index.js index 2fe226ec483..abfc8a9170c 100644 --- a/micro-ui/web/micro-ui-internals/example/src/index.js +++ b/micro-ui/web/micro-ui-internals/example/src/index.js @@ -66,7 +66,9 @@ const initDigitUI = () => { const pathname = window.location.pathname; const context = window?.globalConfigs?.getConfig("CONTEXT_PATH"); const start = pathname.indexOf(context) + context.length + 1; - const end = pathname.indexOf("employee"); + 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(/\/$/, "") : ""; window.contextPath = window?.globalConfigs?.getConfig("CONTEXT_PATH") + `${tenant ? `/${tenant}` : ""}` || "digit-ui"; window.globalPath = window?.globalConfigs?.getConfig("CONTEXT_PATH") || "digit-ui"; 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 41d62051594..2737c329cf2 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 @@ -29,15 +29,25 @@ export const ULBService = { */ getCurrentTenantId: () => { // 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) { return user.extraRoleInfo?.tenantId; } } + //TODO: fix tenant id from userinfo - const tenantId = + 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"); return tenantId; }, @@ -56,7 +66,9 @@ export const ULBService = { const pathname = window.location.pathname; const context = window?.globalConfigs?.getConfig("CONTEXT_PATH"); const start = pathname.indexOf(context) + context.length + 1; - const end = pathname.indexOf("employee"); + 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(/\/$/, "") : ""; return isMultiRootTenant && tenant ? tenant : window?.globalConfigs?.getConfig("STATE_LEVEL_TENANT_ID"); @@ -74,7 +86,7 @@ export const ULBService = { getCurrentUlb: () => { const initData = StoreService.getInitData(); const tenantId = ULBService.getCurrentTenantId(); - return initData?.tenants?.find((tenant) => tenant?.code === tenantId)||ULBService.getStateId(); + return initData?.tenants?.find((tenant) => tenant?.code === tenantId) || ULBService.getStateId(); } /** * Custom method to get citizen's current selected city @@ -88,12 +100,12 @@ export const ULBService = { * * @returns {String} */, - getCitizenCurrentTenant: (selectedCity=false) => { - const homeCity=Digit.SessionStorage.get("CITIZEN.COMMON.HOME.CITY")?.code; - if(selectedCity){ + getCitizenCurrentTenant: (selectedCity = false) => { + const homeCity = Digit.SessionStorage.get("CITIZEN.COMMON.HOME.CITY")?.code; + if (selectedCity) { return homeCity; } - return homeCity|| Digit.UserService.getUser()?.info?.permanentCity || ULBService.getStateId(); + return homeCity || Digit.UserService.getUser()?.info?.permanentCity || ULBService.getStateId(); }, /** * Custom method to get all ulb's which the loggedin employee has access to diff --git a/micro-ui/web/micro-ui-internals/packages/libraries/src/utils/index.js b/micro-ui/web/micro-ui-internals/packages/libraries/src/utils/index.js index 6eef77a4731..6ecc8702939 100644 --- a/micro-ui/web/micro-ui-internals/packages/libraries/src/utils/index.js +++ b/micro-ui/web/micro-ui-internals/packages/libraries/src/utils/index.js @@ -187,7 +187,9 @@ const pgrAccess = () => { const userInfo = Digit.UserService.getUser(); const userRoles = userInfo?.info?.roles?.map((roleData) => roleData?.code); const pgrRoles = ["PGR_LME", "PGR-ADMIN", "CSR", "CEMP", "FEMP", "DGRO", "ULB Operator", "GRO", "GO", "RO", "GA"]; - + if (window.globalPath === "sandbox-ui") { + pgrRoles.push("SUPERUSER"); + } const PGR_ACCESS = userRoles?.filter((role) => pgrRoles.includes(role)); return PGR_ACCESS?.length > 0; 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 a9d05d0fb6e..7f08548bdae 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 @@ -1,12 +1,10 @@ import { - BackButton, + BackLink, CitizenHomeCard, CitizenInfoLabel, Loader, - FSMIcon, - MCollectIcon, - BillsIcon } from "@egovernments/digit-ui-components"; +import { CustomSVG } from "@egovernments/digit-ui-components"; import React, { Fragment } from "react"; import { useTranslation } from "react-i18next"; @@ -18,7 +16,12 @@ export const processLinkData = (newData, code, t) => { const obj = newData?.[`${code}`]; if (obj) { obj.map((link) => { - (link.link = link["navigationURL"]), (link.i18nKey = t(link["name"])); + if (window.globalPath === "sandbox-ui") { + link["navigationURL"] = link["navigationURL"].replace("/sandbox-ui/citizen", `/sandbox-ui/${Digit.ULBService.getCurrentTenantId()}/citizen`); + } + link.link = link["navigationURL"]; + link.i18nKey = t(link["name"]); + }); } const newObj = { @@ -56,23 +59,23 @@ export const processLinkData = (newData, code, t) => { const iconSelector = (code) => { switch (code) { case "PT": - return ; + return ; case "WS": - return ; + return ; case "FSM": - return ; + return ; case "MCollect": - return ; + return ; case "PGR": - return ; + return ; case "TL": - return ; + return ; case "OBPS": - return ; + return ; case "Bills": - return ; + return ; default: - return ; + return ; } }; const CitizenHome = ({ @@ -88,14 +91,14 @@ const CitizenHome = ({ if (isLoading) { return ; } - + return (
    {location.pathname.includes( "sanitation-ui/citizen/all-services" ) ? null : ( - + )}
    {moduleArray 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 4fe2e6d8b77..7fdb4622a42 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 @@ -18,7 +18,7 @@ import { DeathIcon, FirenocIcon, Loader -} from "@egovernments/digit-ui-components"; +} from "@egovernments/digit-ui-react-components"; import { Link, useLocation } from "react-router-dom"; import SideBarMenu from "../../../config/sidebar-menu"; import { useTranslation } from "react-i18next"; 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 a75b9391bed..26f90ec5bce 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 @@ -1,4 +1,4 @@ -import { BackButton, CardHeader, CardLabelError, PageBasedInput, SearchOnRadioButtons } from "@egovernments/digit-ui-components"; +import { BackLink, CardHeader, CardLabelError, PageBasedInput, SearchOnRadioButtons } from "@egovernments/digit-ui-components"; import React, { useMemo, useState } from "react"; import { useTranslation } from "react-i18next"; import { useHistory, useLocation } from "react-router-dom"; @@ -7,7 +7,49 @@ const LocationSelection = () => { const { t } = useTranslation(); const history = useHistory(); const location = useLocation(); - const { data: cities, isLoading } = Digit.Hooks.useTenants(); + let hookResult = { data: null, isLoading: false }; + +// Check the value of window.globalPath +if (window?.globalPath === 'sandbox-ui') { + // Call the useTenants hook only if the condition is met + hookResult = Digit.Hooks.useTenants(); +} + +// Destructure the result +const { data: cities, isLoading } = hookResult; + // Define the requestCriteria +let requestCriteria = null; + +// Check the value of window.globalPath +if (window?.globalPath === 'sandbox-ui') { + requestCriteria = { + url: "/tenant-management/tenant/_search", + params: { + code: Digit.ULBService.getCurrentTenantId(), + includeSubTenants: true + }, + body: { + "inbox": { + "limit": 10, + "offset": 0 + }, + apiOperation: "SEARCH", + }, + config: { + select: (data) => { + return data?.Tenants; + }, + }, + }; +} + +// Use the requestCriteria only if it's not null +const { data: subTenants, refetch, isLoading: isLoadingSubTenants } = requestCriteria + ? Digit.Hooks.useCustomAPIHook(requestCriteria) + : { data: null, refetch: () => {}, isLoading: false }; + +// Now you can use subTenants, refetch, and isLoadingSubTenants + const [selectedCity, setSelectedCity] = useState(() => ({ code: Digit.ULBService.getCitizenCurrentTenant(true) })); const [showError, setShowError] = useState(false); @@ -27,18 +69,21 @@ const LocationSelection = () => { const RadioButtonProps = useMemo(() => { return { - options: cities, - optionsKey: "i18nKey", + options: window?.globalPath === "sandbox-ui" ? subTenants : cities, + optionsKey: window?.globalPath === "sandbox-ui"? "name" :"i18nKey", additionalWrapperClass: "digit-reverse-radio-selection-wrapper", onSelect: selectCity, selectedOption: selectedCity, }; - }, [cities, t, selectedCity]); + }, [subTenants,cities, t, selectedCity]); function onSubmit() { if (selectedCity) { Digit.SessionStorage.set("CITIZEN.COMMON.HOME.CITY", selectedCity); const redirectBackTo = location.state?.redirectBackTo; + if(window?.globalPath === "sandbox-ui"){ + history.push(`/${window?.contextPath}/citizen/all-services`); + } if (redirectBackTo) { history.replace(redirectBackTo); } else history.push(`/${window?.contextPath}/citizen`); @@ -51,7 +96,7 @@ const LocationSelection = () => { ) : (
    - + {t("CS_COMMON_CHOOSE_LOCATION")} diff --git a/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/citizen/Home/index.js b/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/citizen/Home/index.js index 5bb709751d5..df0cc952679 100644 --- a/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/citizen/Home/index.js +++ b/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/citizen/Home/index.js @@ -58,7 +58,7 @@ const Home = () => { history.push(`/${window?.contextPath}/citizen/${redirectURL}`); } /* fix for sanitation ui */ - if (window?.location?.href?.includes?.("sanitation-ui")) { + if (window?.location?.href?.includes?.("sanitation-ui")|| window?.location?.href?.includes?.("sandbox-ui")) { history.push(`/${window?.contextPath}/citizen/all-services`); } diff --git a/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/citizen/Login/SelectOtp.js b/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/citizen/Login/SelectOtp.js index 64461b2d209..f759af0811b 100644 --- a/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/citizen/Login/SelectOtp.js +++ b/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/citizen/Login/SelectOtp.js @@ -1,6 +1,7 @@ -import { CardText, CardLabelError, FormStep, OTPInput } from "@egovernments/digit-ui-components"; +import { CardText, CardLabelError, FormStep } from "@egovernments/digit-ui-components"; import React, { Fragment, useState } from "react"; import useInterval from "../../../hooks/useInterval"; +import { OTPInput } from "@egovernments/digit-ui-react-components"; const SelectOtp = ({ config, otp, onOtpChange, onResend, onSelect, t, error, userType = "citizen", canSubmit }) => { const [timeLeft, setTimeLeft] = useState(30); 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 36f26850c3f..b4f2092a6cb 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 @@ -1,4 +1,4 @@ -import { AppContainer, BackButton ,Toast} from "@egovernments/digit-ui-components"; +import { AppContainer, BackLink ,Toast} from "@egovernments/digit-ui-components"; import React, { useEffect, useMemo, useState } from "react"; import { useTranslation } from "react-i18next"; import { Route, Switch, useHistory, useLocation, useRouteMatch } from "react-router-dom"; @@ -233,7 +233,7 @@ const Login = ({ stateCode, isUserRegistered = true }) => {
    - +
    noimagefound - +

    {t("MODULE_" + code.toUpperCase())}

    {mdmsDataObj && ( diff --git a/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/components/PGRCard.js b/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/components/PGRCard.js index 55b9b3726d5..592044da686 100644 --- a/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/components/PGRCard.js +++ b/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/components/PGRCard.js @@ -21,13 +21,19 @@ const PGRCard = () => { - let propsForCSR =[ - { - label: t("ES_PGR_NEW_COMPLAINT"), - link: `/${window?.contextPath}/employee/pgr/complaint/create`, - role: "CSR" - } - ] + let role = "CSR"; + +if (window.globalPath === "sandbox-ui") { + role = "SUPERUSER"; +} + +let propsForCSR = [ + { + label: t("ES_PGR_NEW_COMPLAINT"), + link: `/${window?.contextPath}/employee/pgr/complaint/create`, + role: role + } +]; propsForCSR = propsForCSR.filter(link => link.role && Digit.Utils.didEmployeeHasRole(link.role) ); 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 9741b1bd34b..ce56dcc9c86 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 @@ -1,9 +1,43 @@ import React, { useEffect, useState, useRef } from "react"; import { CardLabel, Dropdown, FormStep, RadioButtons } from "@egovernments/digit-ui-react-components"; +import { subtract } from "lodash"; const SelectAddress = ({ t, config, onSelect, value }) => { - const allCities = Digit.Hooks.pgr.useTenants(); + const allCities = window.globalPath === "sandbox-ui" ? Digit.Hooks.pgr.useTenants(): null; const cities = value?.pincode ? allCities.filter((city) => city?.pincode?.some((pin) => pin == value["pincode"])) : allCities; + // Define the requestCriteria +let requestCriteria = null; + +// Check the value of window.globalPath +if (window.globalPath === 'sandbox-ui') { + requestCriteria = { + url: "/tenant-management/tenant/_search", + params: { + code: Digit.ULBService.getCurrentTenantId(), + includeSubTenants: true + }, + body: { + "inbox": { + "limit": 10, + "offset": 0 + }, + apiOperation: "SEARCH", + }, + config: { + select: (data) => { + return data?.Tenants; + }, + }, + }; +} + +// Use the requestCriteria only if it's not null +const { data: subTenants, refetch, isLoading: isLoadingSubTenants } = requestCriteria + ? Digit.Hooks.useCustomAPIHook(requestCriteria) + : { data: null, refetch: () => {}, isLoading: false }; + +// Now you can use subTenants, refetch, and isLoadingSubTenants + const [selectedCity, setSelectedCity] = useState(() => { const { city_complaint } = value; @@ -11,7 +45,7 @@ const SelectAddress = ({ t, config, onSelect, value }) => { }); const { data: fetchedLocalities } = Digit.Hooks.useBoundaryLocalities( selectedCity?.code, - "admin", + window.globalPath === "sandbox-ui" ? "REVENUE" : "admin", { enabled: !!selectedCity, }, @@ -51,10 +85,14 @@ const SelectAddress = ({ t, config, onSelect, value }) => {
    {t("MYCITY_CODE_LABEL")} - {cities?.length < 5 ? ( - + {(window.globalPath === "sandbox-ui" ? subTenants?.length : cities?.length) < 5 ? ( + ) : ( - + )} {selectedCity && localities && {t("CS_CREATECOMPLAINT_MOHALLA")}} {selectedCity && localities && ( diff --git a/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/pages/employee/CreateComplaint/index.js b/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/pages/employee/CreateComplaint/index.js index a3313270966..8ea99cfbf91 100644 --- a/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/pages/employee/CreateComplaint/index.js +++ b/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/pages/employee/CreateComplaint/index.js @@ -9,25 +9,76 @@ import { FormComposer } from "../../../components/FormComposer"; import { createComplaint } from "../../../redux/actions/index"; export const CreateComplaint = ({ parentUrl }) => { - const cities = Digit.Hooks.pgr.useTenants(); + const cities = window.globalPath === "sandbox-ui" ? Digit.Hooks.pgr.useTenants() : null; + const { t } = useTranslation(); const getCities = () => cities?.filter((e) => e.code === Digit.ULBService.getCurrentTenantId()) || []; + // Define the requestCriteria +let requestCriteria = null; + +// Check the value of window.globalPath +if (window.globalPath === 'sandbox-ui') { + requestCriteria = { + url: "/tenant-management/tenant/_search", + params: { + code: Digit.ULBService.getCurrentTenantId(), + includeSubTenants: true + }, + body: { + "inbox": { + "limit": 10, + "offset": 0 + }, + apiOperation: "SEARCH", + }, + config: { + select: (data) => { + return data?.Tenants; + }, + }, + }; +} + +// Use the requestCriteria only if it's not null +const { data: subTenants, refetch, isLoading: isLoadingSubTenants } = requestCriteria + ? Digit.Hooks.useCustomAPIHook(requestCriteria) + : { data: null, refetch: () => {}, isLoading: false }; + +// Now you can use subTenants, refetch, and isLoadingSubTenants + + const getSubTenants = () => subTenants?.filter((e) => e.code === Digit.ULBService.getCurrentTenantId()) || []; + const [complaintType, setComplaintType] = useState({}); const [subTypeMenu, setSubTypeMenu] = useState([]); const [subType, setSubType] = useState({}); const [pincode, setPincode] = useState(""); - const [selectedCity, setSelectedCity] = useState(getCities()[0] ? getCities()[0] : null); + const [selectedCity, setSelectedCity] = useState( + window.globalPath === "sandbox-ui" + ? getSubTenants()[0] || null + : getCities()[0] || null + ); + + const cityData = window.globalPath === "sandbox-ui" ? getSubTenants() : getCities(); const { data: fetchedLocalities } = Digit.Hooks.useBoundaryLocalities( - getCities()[0]?.code, - "admin", - { - enabled: !!getCities()[0], - }, - t - ); + cityData[0]?.code, + window.globalPath === "sandbox-ui" ? "REVENUE" : "admin", + { + enabled: !!cityData[0], + }, + t +); + + // const { data: fetchedLocalities } = Digit.Hooks.useBoundaryLocalities( + // getCities()[0]?.code, + // "admin", + // { + // enabled: !!getCities()[0], + // }, + // t + // ); const [localities, setLocalities] = useState(fetchedLocalities); const [selectedLocality, setSelectedLocality] = useState(null); @@ -57,6 +108,7 @@ export const CreateComplaint = ({ parentUrl }) => { }, [fetchedLocalities]); useEffect(() => { + if(window.globalPath !== "sandbox-ui"){ const city = cities.find((obj) => obj.pincode?.find((item) => item == pincode)); if (city?.code&&city?.code === getCities()[0]?.code) { setPincodeNotValid(false); @@ -71,8 +123,10 @@ export const CreateComplaint = ({ parentUrl }) => { } else { setPincodeNotValid(true); } + } }, [pincode]); + async function selectedType(value) { if (value.key !== complaintType.key) { if (value.key === "Others") { @@ -111,9 +165,17 @@ export const CreateComplaint = ({ parentUrl }) => { const onSubmit = async (data) => { if (!canSubmit) return; const cityCode = selectedCity.code; - const city = selectedCity.city.name; - const district = selectedCity.city.name; - const region = selectedCity.city.name; + const city = window.globalPath === "sandbox-ui" + ? selectedCity.name + : selectedCity.city.name; + + const district = window.globalPath === "sandbox-ui" + ? selectedCity.name + : selectedCity.city.name; + + const region = window.globalPath === "sandbox-ui" + ? selectedCity.name + : selectedCity.city.name; const localityCode = selectedLocality.code; const localityName = selectedLocality.name; const landmark = data.landmark; @@ -210,10 +272,12 @@ export const CreateComplaint = ({ parentUrl }) => { isMandatory selected={selectedCity} freeze={true} - option={getCities()} + option={ + window.globalPath === "sandbox-ui" ? getSubTenants() : getCities() + } id="city" select={selectCity} - optionKey="i18nKey" + optionKey={window.globalPath === "sandbox-ui" ? "name" : "i18nKey"} t={t} /> ), diff --git a/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/UploadFile.js b/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/UploadFile.js index a251c89e3eb..cb09a145583 100644 --- a/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/UploadFile.js +++ b/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/UploadFile.js @@ -177,7 +177,7 @@ const UploadFile = (props) => { }; const handleEmpty = () => { - if(inpRef.current.files.length <= 0 && prevSate !== null) + if(inpRef?.current?.files?.length <= 0 && prevSate !== null) { inpRef.current.value = ""; props.onDelete(); } @@ -212,9 +212,9 @@ const UploadFile = (props) => { props?.removeTargetedFile(fileDetailsData, e)} />
    })} - {props?.uploadedFiles.length === 0 &&

    {props?.message}

    } + {props?.uploadedFiles?.length === 0 &&

    {props?.message}

    } {!hasFile || props.error ? ( -

    {props.message}

    +

    {props?.message}

    ) : (
    From aaae23bd3f603a262946326098ee2ec45ddaea1a Mon Sep 17 00:00:00 2001 From: mithunhegde-egov <152362871+mithunhegde-egov@users.noreply.github.com> Date: Thu, 5 Sep 2024 20:43:58 +0530 Subject: [PATCH 03/23] hrms create and search (#1361) * hrms create and search * Update index.html * review changes * Update createEmployee.js --------- Co-authored-by: nabeelmd-eGov --- micro-ui/web/micro-ui-internals/example/package.json | 2 +- micro-ui/web/micro-ui-internals/package.json | 2 +- .../micro-ui-internals/packages/libraries/src/utils/index.js | 2 +- .../web/micro-ui-internals/packages/modules/hrms/package.json | 2 +- .../micro-ui-internals/packages/modules/hrms/src/Module.js | 2 +- .../packages/modules/hrms/src/components/InboxFilter.js | 2 +- .../packages/modules/hrms/src/components/Utils/index.js | 4 ++-- .../packages/modules/hrms/src/components/hrmscard.js | 2 +- .../src/components/pageComponents/SelectEmployeeGender.js | 4 ++-- 9 files changed, 11 insertions(+), 11 deletions(-) diff --git a/micro-ui/web/micro-ui-internals/example/package.json b/micro-ui/web/micro-ui-internals/example/package.json index 0d36ca5a625..cee9f67fd32 100644 --- a/micro-ui/web/micro-ui-internals/example/package.json +++ b/micro-ui/web/micro-ui-internals/example/package.json @@ -15,7 +15,7 @@ "@egovernments/digit-ui-module-dss": "1.8.1", "@egovernments/digit-ui-module-core": "1.8.2-beta.18", "@egovernments/digit-ui-module-common": "1.8.0", - "@egovernments/digit-ui-module-hrms": "1.8.0", + "@egovernments/digit-ui-module-hrms": "1.8.1-beta.1", "@egovernments/digit-ui-module-utilities": "1.0.1-beta.39", "@egovernments/digit-ui-module-open-payment":"0.0.1", "@egovernments/digit-ui-module-engagement": "1.5.20", diff --git a/micro-ui/web/micro-ui-internals/package.json b/micro-ui/web/micro-ui-internals/package.json index 2eeabaf59ba..c6bc79cd360 100644 --- a/micro-ui/web/micro-ui-internals/package.json +++ b/micro-ui/web/micro-ui-internals/package.json @@ -28,7 +28,7 @@ "dev:example": "cd example && yarn start", "dev:core": "cd packages/modules/core && yarn start", "devD:dss": "cd packages/modules/dss && yarn start", - "devD:hrms": "cd packages/modules/hrms && yarn start", + "dev:hrms": "cd packages/modules/hrms && yarn start", "devD:common": "cd packages/modules/common && yarn start", "devD:utilities": "cd packages/modules/utilities && yarn start", "dev:workbench": "cd packages/modules/workbench && yarn start", diff --git a/micro-ui/web/micro-ui-internals/packages/libraries/src/utils/index.js b/micro-ui/web/micro-ui-internals/packages/libraries/src/utils/index.js index 6ecc8702939..4f2dfdf3c75 100644 --- a/micro-ui/web/micro-ui-internals/packages/libraries/src/utils/index.js +++ b/micro-ui/web/micro-ui-internals/packages/libraries/src/utils/index.js @@ -305,7 +305,7 @@ const receiptsAccess = () => { const RECEIPTS_ACCESS = userRoles?.filter((role) => receiptsRoles?.includes(role)); return RECEIPTS_ACCESS?.length > 0; }; -const hrmsRoles = ["HRMS_ADMIN"]; +const hrmsRoles = ["HRMS_ADMIN","SUPERUSER"]; const hrmsAccess = () => { const userInfo = Digit.UserService.getUser(); const userRoles = userInfo?.info?.roles?.map((roleData) => roleData?.code); diff --git a/micro-ui/web/micro-ui-internals/packages/modules/hrms/package.json b/micro-ui/web/micro-ui-internals/packages/modules/hrms/package.json index e9e8e2df20a..84ac61628aa 100644 --- a/micro-ui/web/micro-ui-internals/packages/modules/hrms/package.json +++ b/micro-ui/web/micro-ui-internals/packages/modules/hrms/package.json @@ -15,7 +15,7 @@ "prepublish": "yarn build" }, "dependencies": { - "@egovernments/digit-ui-react-components": "1.5.22", + "@egovernments/digit-ui-react-components": "1.8.2-beta.12", "react": "17.0.2", "react-dom": "17.0.2", "react-hook-form": "6.15.8", diff --git a/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/Module.js b/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/Module.js index 614e1ec816c..a7745f92a14 100644 --- a/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/Module.js +++ b/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/Module.js @@ -31,7 +31,7 @@ export const HRMSModule = ({ stateCode, userType, tenants }) => { const { path, url } = useRouteMatch(); if (!Digit.Utils.hrmsAccess()) { return null; - } + } if (userType === "employee") { return ; } else return null; diff --git a/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/components/InboxFilter.js b/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/components/InboxFilter.js index ded77d1672a..847fd67388d 100644 --- a/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/components/InboxFilter.js +++ b/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/components/InboxFilter.js @@ -54,7 +54,7 @@ const Filter = ({ searchParams, onFilterChange, onSearch, removeParam, ...props }); useEffect(() => { - if (tenantId.code) { + if (tenantId?.code) { setSearchParams({ ..._searchParams, tenantId: tenantId.code }); } }, [tenantId]); diff --git a/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/components/Utils/index.js b/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/components/Utils/index.js index 7f0149bf764..e2440e56001 100644 --- a/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/components/Utils/index.js +++ b/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/components/Utils/index.js @@ -63,8 +63,8 @@ export const getCityThatUserhasAccess = (cities = []) => { let roleObject = {}; userInfo?.info?.roles.map((roleData) => { roleObject[roleData?.code] = roleObject[roleData?.code] ? [...roleObject[roleData?.code], roleData?.tenantId] : [roleData?.tenantId] }); const tenant = Digit.ULBService.getCurrentTenantId(); - if (roleObject[Digit.Utils?.hrmsRoles?.[0]].includes(Digit.ULBService.getStateId())) { + if (roleObject?.[Digit.Utils?.hrmsRoles?.[0]]?.includes(Digit.ULBService.getStateId())) { return cities; } - return cities.filter(city => roleObject[Digit.Utils?.hrmsRoles?.[0]]?.includes(city?.code)); + return cities?.filter(city => roleObject?.[Digit.Utils?.hrmsRoles?.[0]]?.includes(city?.code)); } \ No newline at end of file diff --git a/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/components/hrmscard.js b/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/components/hrmscard.js index 649c5ac3c2b..48af9efcda9 100644 --- a/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/components/hrmscard.js +++ b/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/components/hrmscard.js @@ -6,7 +6,7 @@ const HRMSCard = () => { const ADMIN = Digit.Utils.hrmsAccess(); if (!ADMIN) { return null; - } + } const { t } = useTranslation(); const tenantId = Digit.ULBService.getCurrentTenantId(); const { isLoading, isError, error, data, ...rest } = Digit.Hooks.hrms.useHRMSCount(tenantId); diff --git a/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/components/pageComponents/SelectEmployeeGender.js b/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/components/pageComponents/SelectEmployeeGender.js index 9bbc1599732..96d1b317a8b 100644 --- a/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/components/pageComponents/SelectEmployeeGender.js +++ b/micro-ui/web/micro-ui-internals/packages/modules/hrms/src/components/pageComponents/SelectEmployeeGender.js @@ -47,7 +47,7 @@ const SelectEmployeeGender = ({ t, config, onSelect, formData = {}, userType, re
    Date: Thu, 5 Sep 2024 20:44:36 +0530 Subject: [PATCH 04/23] fix (#1362) Co-authored-by: nabeelmd-eGov --- .../modules/pgr/src/pages/citizen/ComplaintDetails.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/pages/citizen/ComplaintDetails.js b/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/pages/citizen/ComplaintDetails.js index c4fd9bc9b65..175aa9f3b95 100644 --- a/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/pages/citizen/ComplaintDetails.js +++ b/micro-ui/web/micro-ui-internals/packages/modules/pgr/src/pages/citizen/ComplaintDetails.js @@ -23,7 +23,7 @@ import TimeLine from "../../components/TimeLine"; const WorkflowComponent = ({ complaintDetails, id, getWorkFlow, zoomImage }) => { const tenantId = Digit.SessionStorage.get("CITIZEN.COMMON.HOME.CITY")?.code || complaintDetails.service.tenantId; let workFlowDetails = Digit.Hooks.useWorkflowDetails({ tenantId: tenantId, id, moduleCode: "PGR" }); - const { data: ComplainMaxIdleTime, isLoading: ComplainMaxIdleTimeLoading } = Digit.Hooks.pgr.useMDMS.ComplainClosingTime(tenantId?.split(".")[0]); + // const { data: ComplainMaxIdleTime, isLoading: ComplainMaxIdleTimeLoading } = Digit.Hooks.pgr.useMDMS.ComplainClosingTime(tenantId?.split(".")[0]); useEffect(() => { getWorkFlow(workFlowDetails.data); @@ -43,7 +43,7 @@ const WorkflowComponent = ({ complaintDetails, id, getWorkFlow, zoomImage }) => rating={complaintDetails.audit.rating} zoomImage={zoomImage} complaintDetails={complaintDetails} - ComplainMaxIdleTime={ComplainMaxIdleTime} + // ComplainMaxIdleTime={ComplainMaxIdleTime} /> ) ); From 28cae30fd93b7da4c6a6483c7a852be9e9e4cbbb Mon Sep 17 00:00:00 2001 From: mithunhegde-egov <152362871+mithunhegde-egov@users.noreply.github.com> Date: Thu, 5 Sep 2024 23:22:54 +0530 Subject: [PATCH 05/23] Tenant update (#1340) * update component added * update component added * tenant update component * update tenant search update * revert index.html --------- Co-authored-by: nabeelmd-eGov --- .../sandbox/src/configs/tenantSearchConfig.js | 1 - .../sandbox/src/configs/tenantUpdateConfig.js | 60 ++++++++++++ .../sandbox/src/pages/employee/index.js | 2 + .../pages/employee/tenantMgmt/TenantUpdate.js | 97 +++++++++++++++++++ .../pages/employee/tenantMgmt/TenantView.js | 5 +- .../sandbox/src/utils/TenantUpdateUtil.js | 14 +++ 6 files changed, 177 insertions(+), 2 deletions(-) create mode 100644 micro-ui/web/micro-ui-internals/packages/modules/sandbox/src/configs/tenantUpdateConfig.js create mode 100644 micro-ui/web/micro-ui-internals/packages/modules/sandbox/src/pages/employee/tenantMgmt/TenantUpdate.js create mode 100644 micro-ui/web/micro-ui-internals/packages/modules/sandbox/src/utils/TenantUpdateUtil.js diff --git a/micro-ui/web/micro-ui-internals/packages/modules/sandbox/src/configs/tenantSearchConfig.js b/micro-ui/web/micro-ui-internals/packages/modules/sandbox/src/configs/tenantSearchConfig.js index 488aa785150..81bb521fef6 100644 --- a/micro-ui/web/micro-ui-internals/packages/modules/sandbox/src/configs/tenantSearchConfig.js +++ b/micro-ui/web/micro-ui-internals/packages/modules/sandbox/src/configs/tenantSearchConfig.js @@ -18,7 +18,6 @@ export const tenantSearchConfig = () => tableFormJsonPath: "requestBody.inbox", filterFormJsonPath: "requestBody.tenant", searchFormJsonPath: "requestBody.tenant", - }, sections: { search: { diff --git a/micro-ui/web/micro-ui-internals/packages/modules/sandbox/src/configs/tenantUpdateConfig.js b/micro-ui/web/micro-ui-internals/packages/modules/sandbox/src/configs/tenantUpdateConfig.js new file mode 100644 index 00000000000..2838103587a --- /dev/null +++ b/micro-ui/web/micro-ui-internals/packages/modules/sandbox/src/configs/tenantUpdateConfig.js @@ -0,0 +1,60 @@ +export const tenantUpdateConfig = [ + { + head: null, + body: [ + { + inline: true, + label: "SANDBOX_CREATE_TENANT_NAME_LABEL", + isMandatory: true, + key: "tenantName", + type: "text", + disable: true, + populators: { name: "tenantName", error: "Required", validation: { pattern: /^[A-Za-z0-9]+$/i } }, + }, + { + inline: true, + label: "SANDBOX_CREATE_TENANT_EMAIL_LABEL", + isMandatory: true, + key: "emailId", + type: "text", + disable: true, + populators: { name: "emailId", error: "Required", validation: { pattern: /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/i } }, + }, + { + inline: true, + label: "SANDBOX_CREATE_TENANT_CODE_LABEL", + isMandatory: true, + key: "tenantCode", + type: "text", + disable: true, + populators: { name: "tenantCode", error: "Required", validation: { pattern: /^[A-Za-z0-9.]+$/i } }, + }, + { + isMandatory: false, + key: "isActive", + type: "dropdown", + label: "SANDBOX_CREATE_TENANT_ACTIVE_LABEL", + disable: false, + populators: { + name: "isActive", + optionsKey: "name", + error: " Required", + required: true, + options: [ + { + code: "true", + name: "TRUE", + active: true, + }, + { + code: "false", + name: "FALSE", + active: true, + }, + ], + }, + }, + ], + }, + ]; + \ No newline at end of file diff --git a/micro-ui/web/micro-ui-internals/packages/modules/sandbox/src/pages/employee/index.js b/micro-ui/web/micro-ui-internals/packages/modules/sandbox/src/pages/employee/index.js index 09e5377e712..f9daf343859 100644 --- a/micro-ui/web/micro-ui-internals/packages/modules/sandbox/src/pages/employee/index.js +++ b/micro-ui/web/micro-ui-internals/packages/modules/sandbox/src/pages/employee/index.js @@ -9,6 +9,7 @@ import TenantView from "./tenantMgmt/TenantView"; import TenantCreate from "./tenantMgmt/TenantCreate"; import ApplicationHome from "./applicationMgmt/ApplicationHome"; import ModuleMasterTable from "./applicationMgmt/ModuleMasterTable"; +import TenantUpdate from "./tenantMgmt/TenantUpdate"; import SetupMaster from "./applicationMgmt/SetupMaster"; const bredCrumbStyle = { maxWidth: "min-content" }; @@ -56,6 +57,7 @@ const App = ({ path, stateCode, userType, tenants }) => { } /> } /> } /> + } /> } /> } /> } /> diff --git a/micro-ui/web/micro-ui-internals/packages/modules/sandbox/src/pages/employee/tenantMgmt/TenantUpdate.js b/micro-ui/web/micro-ui-internals/packages/modules/sandbox/src/pages/employee/tenantMgmt/TenantUpdate.js new file mode 100644 index 00000000000..30703accc14 --- /dev/null +++ b/micro-ui/web/micro-ui-internals/packages/modules/sandbox/src/pages/employee/tenantMgmt/TenantUpdate.js @@ -0,0 +1,97 @@ +import React, { useState, useEffect } from "react"; +import { useTranslation } from "react-i18next"; +import { useHistory ,useLocation} from "react-router-dom"; +import { FormComposerV2, Header, Toast } from "@egovernments/digit-ui-react-components"; +import { transformCreateData } from "../../../utils/TenantUpdateUtil"; +import { tenantUpdateConfig } from "../../../configs/tenantUpdateConfig"; + +const fieldStyle = { marginRight: 0 }; + +const TenantUpdate = () => { + const location = useLocation(); + const { name,code,email} = location.state || {}; + const defaultValue = { + tenantName:name, + tenantCode:code, + emailId:email, + isActive:"" + }; + const tenantId = Digit.ULBService.getCurrentTenantId(); + const { t } = useTranslation(); + const history = useHistory(); + const [showToast, setShowToast] = useState(false); + + const closeToast = () => { + setTimeout(() => { + setShowToast(false); + }, 5000); + }; + const reqCreate = { + url: `/tenant-management/subTenant/_update`, + params: {}, + body: {}, + config: { + enable: false, + }, + }; + const mutation = Digit.Hooks.useCustomAPIMutationHook(reqCreate); + const onSubmit = async (data) => { + if(tenantId==code){ + setShowToast({ + label: t("SANDBOX_TENANT_CANNOT_UPDATE_TOAST"), + isError: true, + }); + } + else{ + await mutation.mutate( + { + url: `/tenant-management/subTenant/_update`, + body: transformCreateData(data), + config: { + enable: true, + }, + }, + { + onError: (error, variables) => { + setShowToast({ + label: error.toString(), + isError: true, + }); + setTimeout(() => { + setShowToast(false); + }, 5000); + }, + onSuccess: async (data) => { + setShowToast({ key: "success", label: t("SANDBOX_TENANT_UPDATE_SUCCESS_TOAST") }); + setTimeout(() => { + closeToast(); + history.push(`/${window?.contextPath}/employee/sandbox/tenant-management/search`); + }, 3000); + }, + } + ); + } + }; + return ( +
    +
    {t("SANDBOX_UPDATE_TENANT_HEADER")}
    + { + return { + ...config, + }; + })} + defaultValues={defaultValue} + onFormValueChange={(setValue, formData, formState, reset, setError, clearErrors, trigger, getValues) => {}} + onSubmit={(data) => onSubmit(data)} + fieldStyle={fieldStyle} + noBreakLine={true} + /> + + {showToast && setShowToast(false)} />} +
    + ); +}; + +export default TenantUpdate; diff --git a/micro-ui/web/micro-ui-internals/packages/modules/sandbox/src/pages/employee/tenantMgmt/TenantView.js b/micro-ui/web/micro-ui-internals/packages/modules/sandbox/src/pages/employee/tenantMgmt/TenantView.js index ae0d4c3aed2..c33639bb885 100644 --- a/micro-ui/web/micro-ui-internals/packages/modules/sandbox/src/pages/employee/tenantMgmt/TenantView.js +++ b/micro-ui/web/micro-ui-internals/packages/modules/sandbox/src/pages/employee/tenantMgmt/TenantView.js @@ -32,7 +32,10 @@ const TenantView = () => { }, []); const onClickRow = ({ original: row }) => { - const value = row?.code; + const code = row?.code; + const name= row?.name; + const email=row?.email; + history.push(`/${window?.contextPath}/employee/sandbox/tenant-management/update`, {name,code,email}); }; return ( diff --git a/micro-ui/web/micro-ui-internals/packages/modules/sandbox/src/utils/TenantUpdateUtil.js b/micro-ui/web/micro-ui-internals/packages/modules/sandbox/src/utils/TenantUpdateUtil.js new file mode 100644 index 00000000000..fdee7c17a72 --- /dev/null +++ b/micro-ui/web/micro-ui-internals/packages/modules/sandbox/src/utils/TenantUpdateUtil.js @@ -0,0 +1,14 @@ +export const transformCreateData = (data) => { + const tenantId = Digit.ULBService.getCurrentTenantId(); + + return { + tenant: { + name: data.tenantName, + email: data.emailId, + code: data.tenantCode, + isActive:data.isActive.code, + parentId: tenantId, + }, + }; + }; + \ No newline at end of file From 88b1d15e2ff9eb494d6d044f9dca7b0aeeb3b34a Mon Sep 17 00:00:00 2001 From: nabeelmd-eGov Date: Fri, 6 Sep 2024 14:01:09 +0530 Subject: [PATCH 06/23] adding CSS changes (#1363) Co-authored-by: NabeelAyubee --- .../micro-ui-internals/example/package.json | 2 +- micro-ui/web/micro-ui-internals/package.json | 2 +- .../packages/css/src/index.scss | 2 +- .../css/src/pages/employee/sandbox.scss | 18 +++++++++++++ .../packages/modules/core/package.json | 2 +- .../modules/core/src/components/Home.js | 8 +++--- .../SideBar/StaticCitizenSideBar.js | 14 +++++----- .../pages/citizen/Home/LocationSelection.js | 4 ++- .../core/src/pages/citizen/Home/index.js | 6 ++--- .../core/src/pages/citizen/Login/index.js | 4 +-- .../modules/core/src/pages/citizen/index.js | 2 +- .../packages/modules/dss/package.json | 2 +- .../modules/open-payment/package.json | 2 +- .../packages/modules/pgr/package.json | 2 +- .../packages/modules/sandbox/package.json | 2 +- .../packages/modules/sandbox/src/Module.js | 8 +++++- .../applicationMgmt/ModuleMasterTable.js | 8 +++--- .../config/setupMasterConfig.js | 27 ++++++++++--------- .../packages/modules/utilities/package.json | 2 +- .../packages/modules/workbench/package.json | 2 +- .../packages/react-components/package.json | 2 +- .../src/molecules/SearchOnRadioButtons.js | 11 +++++++- 22 files changed, 85 insertions(+), 47 deletions(-) diff --git a/micro-ui/web/micro-ui-internals/example/package.json b/micro-ui/web/micro-ui-internals/example/package.json index cee9f67fd32..00cd69f136b 100644 --- a/micro-ui/web/micro-ui-internals/example/package.json +++ b/micro-ui/web/micro-ui-internals/example/package.json @@ -20,7 +20,7 @@ "@egovernments/digit-ui-module-open-payment":"0.0.1", "@egovernments/digit-ui-module-engagement": "1.5.20", "@egovernments/digit-ui-components": "0.0.2-beta.31", - "@egovernments/digit-ui-react-components": "1.8.2-beta.12", + "@egovernments/digit-ui-react-components": "1.8.2-beta.13", "@egovernments/digit-ui-module-sandbox": "0.0.1", "http-proxy-middleware": "^1.0.5", "react": "17.0.2", diff --git a/micro-ui/web/micro-ui-internals/package.json b/micro-ui/web/micro-ui-internals/package.json index c6bc79cd360..b46933a7627 100644 --- a/micro-ui/web/micro-ui-internals/package.json +++ b/micro-ui/web/micro-ui-internals/package.json @@ -73,7 +73,7 @@ "lodash": "4.17.21", "microbundle-crl": "0.13.11", "@egovernments/digit-ui-components": "0.0.2-beta.31", - "@egovernments/digit-ui-react-components": "1.8.2-beta.12", + "@egovernments/digit-ui-react-components": "1.8.2-beta.13", "react": "17.0.2", "react-dom": "17.0.2", "react-hook-form": "6.15.8", diff --git a/micro-ui/web/micro-ui-internals/packages/css/src/index.scss b/micro-ui/web/micro-ui-internals/packages/css/src/index.scss index dc1b9de8341..68c86c61c4e 100644 --- a/micro-ui/web/micro-ui-internals/packages/css/src/index.scss +++ b/micro-ui/web/micro-ui-internals/packages/css/src/index.scss @@ -644,7 +644,7 @@ input[type="number"] { .citizen-form-wrapper { width: calc(100% - 219px); display: flex; - justify-content: center; + justify-content: flex-start; margin-top: 1rem; padding-left: 16px; padding-right: 16px; diff --git a/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/sandbox.scss b/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/sandbox.scss index dd9bc74070c..8c5bc4f792a 100644 --- a/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/sandbox.scss +++ b/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/sandbox.scss @@ -315,3 +315,21 @@ justify-content: center; } } +.main.center-container.citizen-home-container { + z-index: 100; + justify-content: flex-start; +} +.SideBarStatic { + z-index: 10; + height: 100vh; +} +.citizen-home-footer { + position: absolute; + bottom: 0; +} +.citizen-form-wrapper { + justify-content: flex-start; + .citizen-card-input.citizen-card-input--front { + margin-bottom: 0; + } +} diff --git a/micro-ui/web/micro-ui-internals/packages/modules/core/package.json b/micro-ui/web/micro-ui-internals/packages/modules/core/package.json index 21a99fabcfa..8951d95c4c4 100644 --- a/micro-ui/web/micro-ui-internals/packages/modules/core/package.json +++ b/micro-ui/web/micro-ui-internals/packages/modules/core/package.json @@ -15,7 +15,7 @@ }, "dependencies": { "@egovernments/digit-ui-components": "0.0.2-beta.31", - "@egovernments/digit-ui-react-components": "1.8.2-beta.12", + "@egovernments/digit-ui-react-components": "1.8.2-beta.13", "react": "17.0.2", "react-dom": "17.0.2", "react-i18next": "11.16.2", 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 7f08548bdae..3cad29da039 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 @@ -1,10 +1,10 @@ import { - BackLink, CitizenHomeCard, CitizenInfoLabel, Loader, -} from "@egovernments/digit-ui-components"; -import { CustomSVG } from "@egovernments/digit-ui-components"; +} from "@egovernments/digit-ui-react-components"; + +import { BackLink, CustomSVG } from "@egovernments/digit-ui-components"; import React, { Fragment } from "react"; import { useTranslation } from "react-i18next"; @@ -97,7 +97,7 @@ const CitizenHome = ({
    {location.pathname.includes( "sanitation-ui/citizen/all-services" - ) ? null : ( + ) || (location.pathname.includes("sandbox-ui") && location.pathname.includes("all-services")) ? null : ( )}
    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 7fdb4622a42..e5adb484541 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 @@ -183,24 +183,24 @@ const StaticCitizenSideBar = ({ linkData, islinkDataLoading }) => { {t("CS_COMMON_HELPLINE")} 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 26f90ec5bce..ba0ebe58401 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 @@ -1,4 +1,5 @@ -import { BackLink, CardHeader, CardLabelError, PageBasedInput, SearchOnRadioButtons } from "@egovernments/digit-ui-components"; +import { BackLink } from "@egovernments/digit-ui-components"; +import { CardHeader, CardLabelError, PageBasedInput, SearchOnRadioButtons } from "@egovernments/digit-ui-react-components"; import React, { useMemo, useState } from "react"; import { useTranslation } from "react-i18next"; import { useHistory, useLocation } from "react-router-dom"; @@ -83,6 +84,7 @@ const { data: subTenants, refetch, isLoading: isLoadingSubTenants } = requestCri const redirectBackTo = location.state?.redirectBackTo; if(window?.globalPath === "sandbox-ui"){ history.push(`/${window?.contextPath}/citizen/all-services`); + return; } if (redirectBackTo) { history.replace(redirectBackTo); diff --git a/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/citizen/Home/index.js b/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/citizen/Home/index.js index df0cc952679..49feca963bc 100644 --- a/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/citizen/Home/index.js +++ b/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/citizen/Home/index.js @@ -9,7 +9,7 @@ import { PTIcon, Loader, WhatsNewCard, -} from "@egovernments/digit-ui-components"; +} from "@egovernments/digit-ui-react-components"; import React from "react"; import { useTranslation } from "react-i18next"; import { useHistory } from "react-router-dom"; @@ -57,8 +57,8 @@ const Home = () => { if (redirectURL) { history.push(`/${window?.contextPath}/citizen/${redirectURL}`); } - /* fix for sanitation ui */ - if (window?.location?.href?.includes?.("sanitation-ui")|| window?.location?.href?.includes?.("sandbox-ui")) { + /* fix for sanitation ui & sandbox*/ + if (window?.location?.href?.includes?.("sanitation-ui") || window?.location?.href?.includes?.("sandbox-ui")) { history.push(`/${window?.contextPath}/citizen/all-services`); } 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 b4f2092a6cb..94976df4c7e 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 @@ -1,4 +1,4 @@ -import { AppContainer, BackLink ,Toast} from "@egovernments/digit-ui-components"; +import { AppContainer, BackLink, Toast } from "@egovernments/digit-ui-components"; import React, { useEffect, useMemo, useState } from "react"; import { useTranslation } from "react-i18next"; import { Route, Switch, useHistory, useLocation, useRouteMatch } from "react-router-dom"; @@ -233,7 +233,7 @@ const Login = ({ stateCode, isUserRegistered = true }) => {
    - + {location.pathname.includes("login") ? null : } diff --git a/micro-ui/web/micro-ui-internals/packages/modules/dss/package.json b/micro-ui/web/micro-ui-internals/packages/modules/dss/package.json index 0a0a933c14b..7dad46c7ed2 100644 --- a/micro-ui/web/micro-ui-internals/packages/modules/dss/package.json +++ b/micro-ui/web/micro-ui-internals/packages/modules/dss/package.json @@ -18,7 +18,7 @@ "react-router-dom": "5.3.0" }, "dependencies": { - "@egovernments/digit-ui-react-components": "1.8.2-beta.12", + "@egovernments/digit-ui-react-components": "1.8.2-beta.13", "@egovernments/digit-ui-module-utilities":"1.0.1-beta.39", "jsonpath": "^1.1.1", "react": "17.0.2", diff --git a/micro-ui/web/micro-ui-internals/packages/modules/open-payment/package.json b/micro-ui/web/micro-ui-internals/packages/modules/open-payment/package.json index 813872277e2..2dc71946773 100644 --- a/micro-ui/web/micro-ui-internals/packages/modules/open-payment/package.json +++ b/micro-ui/web/micro-ui-internals/packages/modules/open-payment/package.json @@ -18,7 +18,7 @@ "react-router-dom": "5.3.0" }, "dependencies": { - "@egovernments/digit-ui-react-components": "1.8.2-beta.4", + "@egovernments/digit-ui-react-components": "1.8.2-beta.13", "@egovernments/digit-ui-components": "0.0.2-beta.18", "react": "17.0.2", "react-dom": "17.0.2", diff --git a/micro-ui/web/micro-ui-internals/packages/modules/pgr/package.json b/micro-ui/web/micro-ui-internals/packages/modules/pgr/package.json index 39bea749219..a630eb76658 100644 --- a/micro-ui/web/micro-ui-internals/packages/modules/pgr/package.json +++ b/micro-ui/web/micro-ui-internals/packages/modules/pgr/package.json @@ -18,7 +18,7 @@ "react-router-dom": "5.3.0" }, "dependencies": { - "@egovernments/digit-ui-react-components": "1.8.2-beta.12", + "@egovernments/digit-ui-react-components": "1.8.2-beta.13", "lodash.merge": "^4.6.2", "react": "17.0.2", "react-dom": "17.0.2", diff --git a/micro-ui/web/micro-ui-internals/packages/modules/sandbox/package.json b/micro-ui/web/micro-ui-internals/packages/modules/sandbox/package.json index 93baad0872d..ce7db6919e3 100644 --- a/micro-ui/web/micro-ui-internals/packages/modules/sandbox/package.json +++ b/micro-ui/web/micro-ui-internals/packages/modules/sandbox/package.json @@ -18,7 +18,7 @@ "react-router-dom": "5.3.0" }, "dependencies": { - "@egovernments/digit-ui-react-components": "1.8.2-beta.12", + "@egovernments/digit-ui-react-components": "1.8.2-beta.13", "@egovernments/digit-ui-components": "0.0.2-beta.18", "react": "17.0.2", "react-date-range": "^1.4.0", diff --git a/micro-ui/web/micro-ui-internals/packages/modules/sandbox/src/Module.js b/micro-ui/web/micro-ui-internals/packages/modules/sandbox/src/Module.js index fa6f1138b58..730ba868190 100644 --- a/micro-ui/web/micro-ui-internals/packages/modules/sandbox/src/Module.js +++ b/micro-ui/web/micro-ui-internals/packages/modules/sandbox/src/Module.js @@ -10,6 +10,7 @@ export const SandboxModule = ({ stateCode, userType, tenants }) => { const { path, url } = useRouteMatch(); const tenantId = Digit.ULBService.getCurrentTenantId(); const moduleCode = ["sandbox"]; + const MDMSmoduleCode = [`rainmaker-mdms`, `rainmaker-workbench`, `rainmaker-schema`]; const language = Digit.StoreData.getCurrentLanguage(); const { isLoading, data: store } = Digit.Services.useStore({ stateCode, @@ -18,7 +19,12 @@ export const SandboxModule = ({ stateCode, userType, tenants }) => { modulePrefix: "digit", }); - if (isLoading) { + const { isLoading: isMDMSLoading, data: MDMSstore } = Digit.Services.useStore({ + stateCode, + MDMSmoduleCode, + language, + }); + if (isLoading && isMDMSLoading) { return ; } return ; diff --git a/micro-ui/web/micro-ui-internals/packages/modules/sandbox/src/pages/employee/applicationMgmt/ModuleMasterTable.js b/micro-ui/web/micro-ui-internals/packages/modules/sandbox/src/pages/employee/applicationMgmt/ModuleMasterTable.js index e4a6ab0c1ff..d9236e6b311 100644 --- a/micro-ui/web/micro-ui-internals/packages/modules/sandbox/src/pages/employee/applicationMgmt/ModuleMasterTable.js +++ b/micro-ui/web/micro-ui-internals/packages/modules/sandbox/src/pages/employee/applicationMgmt/ModuleMasterTable.js @@ -41,11 +41,11 @@ const ModuleMasterTable = () => { onError: (error, variables) => { console.log(error); setShowPopUp(false); - setShowToast({ key: "error", label: error, isError: true }); + setShowToast({ key: "error", label: check ? "MANNUAL_MASTER_SETUP_ERROR" : "DEFAULT_MASTER_SETUP_ERROR", isError: true }); }, onSuccess: async (data) => { setShowPopUp(false); - setShowToast({ key: "success", label: "SUCCESS" }); + setShowToast({ key: "success", label: check ? "MANNUAL_MASTER_SETUP_SUCCESS" : "DEFAULT_MASTER_SETUP_SUCCESS" }); }, } ); @@ -68,8 +68,8 @@ const ModuleMasterTable = () => { type={"default"} className={"masterHandlerPopup"} footerclassName={"masterHandlerPopUpFooter"} - heading={t("ES_CAMPAIGN_UPLOAD_BOUNDARY_DATA_MODAL_HEADER")} - children={[
    {t("ES_CAMPAIGN_UPLOAD_BOUNDARY_DATA_MODAL_TEXT")}
    ]} + heading={t("SANDBOX_SETUP_MASTER_MODAL_HEADER")} + children={[
    {t("SANDBOX_SETUP_MASTER_MODAL_TEXT")}
    ]} onOverlayClick={() => {}} footerChildren={[