Skip to content

Commit

Permalink
Updated hrms path (#1979)
Browse files Browse the repository at this point in the history
updated hrms path

Co-authored-by: rachana-egov <rachana.singh@egovernment.org>
  • Loading branch information
rachana-egov and rachana-egov authored Dec 5, 2024
1 parent 81c1c5c commit 6b6d101
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
export const UserManagementConfig = {
export const UserManagementConfig =() =>{

const hrms_context_path = window?.globalConfigs?.getConfig("HRMS_CONTEXT_PATH") || 'health-hrms';

return {
"tenantId": "mz",
"moduleName": "UserManagementConfig",
"UserManagementConfig": [
{
"label": "USER_MANAGEMENT",
"type": "inbox",
"apiDetails": {
"serviceName": "/health-hrms/employees/_search",
"serviceName": `/${hrms_context_path}/employees/_search`,
"requestParam": {},
"requestBody": {

Expand Down Expand Up @@ -181,4 +185,5 @@ export const UserManagementConfig = {
"showAsRemovableTagsInMobile":true
}
]
};
}
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [];
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 6b6d101

Please sign in to comment.