From 6b6d10158e24ae6b2bfd1dd9dffc40efb1597be7 Mon Sep 17 00:00:00 2001 From: rachana-egov <137176770+rachana-egov@users.noreply.github.com> Date: Thu, 5 Dec 2024 17:44:55 +0530 Subject: [PATCH] Updated hrms path (#1979) updated hrms path Co-authored-by: rachana-egov --- .../microplan/src/configs/UserManagementConfig.js | 9 +++++++-- .../src/hooks/services/SearchHRMSEmployeeConfig.js | 5 ++++- .../services/searchPlanEmployeeWithTaggingConfig.js | 5 ++++- .../modules/microplan/src/pages/employee/PlanInbox.js | 3 ++- .../modules/microplan/src/pages/employee/PopInbox.js | 5 ++--- .../microplan/src/pages/employee/UserManagement.js | 2 +- .../modules/microplan/src/pages/employee/viewVillage.js | 3 ++- 7 files changed, 22 insertions(+), 10 deletions(-) diff --git a/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/configs/UserManagementConfig.js b/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/configs/UserManagementConfig.js index 7cf8915ae00..8dda6d7764a 100644 --- a/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/configs/UserManagementConfig.js +++ b/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/configs/UserManagementConfig.js @@ -1,4 +1,8 @@ -export const UserManagementConfig = { +export const UserManagementConfig =() =>{ + + const hrms_context_path = window?.globalConfigs?.getConfig("HRMS_CONTEXT_PATH") || 'health-hrms'; + + return { "tenantId": "mz", "moduleName": "UserManagementConfig", "UserManagementConfig": [ @@ -6,7 +10,7 @@ export const UserManagementConfig = { "label": "USER_MANAGEMENT", "type": "inbox", "apiDetails": { - "serviceName": "/health-hrms/employees/_search", + "serviceName": `/${hrms_context_path}/employees/_search`, "requestParam": {}, "requestBody": { @@ -181,4 +185,5 @@ export const UserManagementConfig = { "showAsRemovableTagsInMobile":true } ] +}; } diff --git a/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/hooks/services/SearchHRMSEmployeeConfig.js b/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/hooks/services/SearchHRMSEmployeeConfig.js index 2542238b4e9..319ec1ea1da 100644 --- a/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/hooks/services/SearchHRMSEmployeeConfig.js +++ b/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/hooks/services/SearchHRMSEmployeeConfig.js @@ -1,7 +1,10 @@ const SearchHRMSEmployeeConfig = async ({ tenantId, body = {}, limit, microplanId, filters, offset, roles = "" }) => { + + const hrms_context_path = window?.globalConfigs?.getConfig("HRMS_CONTEXT_PATH") || 'health-hrms'; + try { const response = await Digit.CustomService.getResponse({ - url: "/health-hrms/employees/_search", + url: `/${hrms_context_path}/employees/_search`, useCache: false, method: "POST", userService: false, diff --git a/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/hooks/services/searchPlanEmployeeWithTaggingConfig.js b/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/hooks/services/searchPlanEmployeeWithTaggingConfig.js index 5a142691f58..da7e05c29a2 100644 --- a/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/hooks/services/searchPlanEmployeeWithTaggingConfig.js +++ b/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/hooks/services/searchPlanEmployeeWithTaggingConfig.js @@ -1,4 +1,7 @@ const searchPlanEmployeeWithTaggingConfig = async ({ tenantId, body, limit, offset, sortOrder = "ASC", names }) => { + + const hrms_context_path = window?.globalConfigs?.getConfig("HRMS_CONTEXT_PATH") || 'health-hrms'; + try { const response = await Digit.CustomService.getResponse({ url: "/plan-service/employee/_search", @@ -21,7 +24,7 @@ const searchPlanEmployeeWithTaggingConfig = async ({ tenantId, body, limit, offs return null; } const fetchEmployeeData = await Digit.CustomService.getResponse({ - url: "/health-hrms/employees/_search", + url: `/${hrms_context_path}/employees/_search`, useCache: false, method: "POST", userService: false, diff --git a/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/PlanInbox.js b/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/PlanInbox.js index 3fbd5b9b757..2127a816b51 100644 --- a/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/PlanInbox.js +++ b/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/PlanInbox.js @@ -63,6 +63,7 @@ const PlanInbox = () => { const [defaultHierarchy, setDefaultSelectedHierarchy] = useState(null); const [defaultBoundaries, setDefaultBoundaries] = useState([]); const userRoles = user?.info?.roles?.map((roleData) => roleData?.code); + const hrms_context_path = window?.globalConfigs?.getConfig("HRMS_CONTEXT_PATH") || 'health-hrms'; // Check if the user has the 'rootapprover' role const isRootApprover = userRoles?.includes("ROOT_PLAN_ESTIMATION_APPROVER"); @@ -433,7 +434,7 @@ const PlanInbox = () => { }, [selectedFilter, activeLink, censusJurisdiction, limitAndOffset]); const reqCri = { - url: `/health-hrms/employees/_search`, + url: `/${hrms_context_path}/employees/_search`, params: { tenantId: tenantId, userServiceUuids: assigneeUuids, diff --git a/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/PopInbox.js b/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/PopInbox.js index a564038fbf5..f6ae93aa4f3 100644 --- a/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/PopInbox.js +++ b/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/PopInbox.js @@ -52,8 +52,7 @@ const PopInbox = () => { code: "ASSIGNED_TO_ME", name: "ASSIGNED_TO_ME", }); - - + const hrms_context_path = window?.globalConfigs?.getConfig("HRMS_CONTEXT_PATH") || 'health-hrms'; const userInfo = Digit.UserService.getUser(); const userRoles = userInfo?.info?.roles?.map((roleData) => roleData?.code); @@ -369,7 +368,7 @@ const PopInbox = () => { // }, [data]); // Custom hook to fetch census data based on microplanId and boundaryCode const reqCri = { - url: `/health-hrms/employees/_search`, + url: `/${hrms_context_path}/employees/_search`, params: { tenantId: tenantId, userServiceUuids: assigneeUuids, diff --git a/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/UserManagement.js b/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/UserManagement.js index e2f6440a342..14e31aaf275 100644 --- a/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/UserManagement.js +++ b/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/UserManagement.js @@ -14,7 +14,7 @@ const UserManagement = () => { const moduleName = Digit?.Utils?.getConfigModuleName() || "commonSanitationUiConfig" const tenant = Digit.ULBService.getStateId(); - const config = UserManagementConfig?.UserManagementConfig?.[0]; + const config = UserManagementConfig()?.UserManagementConfig?.[0]; const tqmInboxSession = Digit.Hooks.useSessionStorage("TQM_INBOX_SESSION", {}); const history = useHistory(); diff --git a/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/viewVillage.js b/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/viewVillage.js index 0389231af95..4d7ad3ff4fd 100644 --- a/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/viewVillage.js +++ b/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/viewVillage.js @@ -28,6 +28,7 @@ const VillageView = () => { const [showComment, setShowComment] = useState(false); const [updatedCensus, setUpdatedCensus] = useState(null); const [disabledAction, setDisabledAction] = useState(false); + const hrms_context_path = window?.globalConfigs?.getConfig("HRMS_CONTEXT_PATH") || 'health-hrms'; const findHierarchyPath = (boundaryCode, data, maxHierarchyLevel) => { const hierarchy = []; @@ -106,7 +107,7 @@ const VillageView = () => { const { isLoading, data, isFetching, refetch } = Digit.Hooks.useCustomAPIHook(reqCriteriaResource); const reqCri = { - url: `/health-hrms/employees/_search`, + url: `/${hrms_context_path}/employees/_search`, params: { tenantId: tenantId, userServiceUuids: data?.assignee,