Skip to content

Commit

Permalink
Merge pull request #689 from odisha-muktasoft/UCEM-765-UI
Browse files Browse the repository at this point in the history
UCEM-765: Updating boundary service and mdms-v2 url as well as other …
  • Loading branch information
Tulika-eGov authored Oct 7, 2024
2 parents 8893c51 + 8389a7e commit 8ccc3c5
Show file tree
Hide file tree
Showing 19 changed files with 53 additions and 53 deletions.
6 changes: 3 additions & 3 deletions frontend/micro-ui/web/micro-ui-internals/example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
"@egovernments/digit-ui-module-attendencemgmt": "0.4.9",
"@egovernments/digit-ui-module-contracts": "0.4.8",
"@egovernments/digit-ui-module-measurement":"0.2.8",
"@egovernments/digit-ui-module-estimate": "0.4.13",
"@egovernments/digit-ui-module-masters": "0.4.12",
"@egovernments/digit-ui-module-project": "0.4.8",
"@egovernments/digit-ui-module-estimate": "0.4.14",
"@egovernments/digit-ui-module-masters": "0.4.13",
"@egovernments/digit-ui-module-project": "0.4.9",
"@egovernments/digit-ui-module-expenditure": "0.4.6",
"@egovernments/digit-ui-customisation-mukta": "0.2.6",
"@egovernments/digit-ui-module-rate-analysis": "0.4.6",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { useQuery } from 'react-query';
import { LocationService } from "../services/elements/Location";

const useLocation = (tenantId, locationType, config = {}) => {
const useLocation = (tenantId, locationType, config = {},includeChildren) => {
switch(locationType) {
case 'Locality':
return useQuery(["LOCALITY_DETAILS", tenantId ], () => LocationService.getLocalities(tenantId), config);
case 'Ward':
return useQuery(["WARD_DETAILS", tenantId ], () => LocationService.getWards(tenantId), config);
return useQuery(["WARD_DETAILS", tenantId ], () => LocationService.getWards(tenantId,includeChildren), config);
default:
break
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
const Urls = {
MDMS: `/egov-mdms-service/v1/_search`,
MDMS: `/mdms-v2/v1/_search`,
WorkFlow: `/egov-workflow-v2/egov-wf/businessservice/_search`,
WorkFlowProcessSearch: `/egov-workflow-v2/egov-wf/process/_search`,
localization: `/localization/messages/v1/_search`,
location: {
localities: `/egov-location/location/v11/boundarys/_search?hierarchyTypeCode=ADMIN&boundaryType=Locality`,
wards: `/egov-location/location/v11/boundarys/_search?hierarchyTypeCode=ADMIN&boundaryType=Ward`,
revenue_localities: `/egov-location/location/v11/boundarys/_search?hierarchyTypeCode=REVENUE&boundaryType=Locality`,
localities: `/boundary-service/boundary-relationships/_search?hierarchyType=ADMIN&boundaryType=locality`,
wards: `/boundary-service/boundary-relationships/_search?hierarchyType=ADMIN&boundaryType=Ward`,
revenue_localities: `/boundary-service/boundary-relationships/_search?hierarchyType=REVENUE&boundaryType=locality`,
},

pgr_search: `/pgr-services/v2/request/_search`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ export const LocationService = {
});
return response;
},
getWards: (tenantId) => {
getWards: (tenantId,includeChildren) => {
return ServiceRequest({
serviceName: "getWards",
url: Urls.location.wards,
params: { tenantId: tenantId },
params: { tenantId: tenantId, includeChildren: includeChildren },
useCache: true,
});
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@egovernments/digit-ui-module-estimate",
"version": "0.4.13",
"version": "0.4.14",
"description": "Estimate Module UI",
"main": "dist/index.js",
"module": "dist/index.modern.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ const NonSORTable = ({ control, watch,config, ...props }) => {
render={(props) =>
getDropDownDataFromMDMS(t, row, "uom", props, register, "name", {
mdmsConfig: {
masterName: "uom",
masterName: "UOM",
moduleName: "common-masters",
localePrefix: "ES_COMMON_UOM",
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ const CreateEstimate = ({ props }) => {

actionMB =
actionMB && (isEdit || isEditRevisionEstimate) && estimate && estimate?.wfStatus === "PENDINGFORCORRECTION"
? actionMB?.filter((ob) => ob?.name !== "DRAFT")
? actionMB?.filter((ob) => ob?.name !== "WF_DRAFT")
: actionMB;

const searchParams = {
Expand Down Expand Up @@ -196,12 +196,12 @@ const CreateEstimate = ({ props }) => {
"common-masters",
[
{
name: "uom",
name: "UOM",
},
],
{
select: (data) => {
return data?.["common-masters"]?.uom;
return data?.["common-masters"]?.UOM;
},
}
);
Expand Down Expand Up @@ -445,7 +445,7 @@ const CreateEstimate = ({ props }) => {
parseInt(getLabourMaterialAnalysisCost(_data, ["MHA"])) ||
_data?.labourMaterialAnalysis?.labour + _data?.labourMaterialAnalysis?.material + _data?.labourMaterialAnalysis?.machinery;
//here check totalEst amount should be less than material+labour
if (_data.totalEstimateAmount < totalLabourAndMaterial && action !== "DRAFT") {
if (_data.totalEstimateAmount < totalLabourAndMaterial && action !== "WF_DRAFT") {
setShowToast({ type: "warning", label: "ERR_ESTIMATE_AMOUNT_MISMATCH" });
setIsButtonDisabled(false);
closeToast();
Expand All @@ -461,7 +461,7 @@ const CreateEstimate = ({ props }) => {
setInputFormData((prevState) => _data);
//first do whatever processing you want on form data then pass it over to modal's onSubmit function

if (action === "DRAFT") onModalSubmit(_data, action);
if (action === "WF_DRAFT") onModalSubmit(_data, action);
else setShowModal(true);
};

Expand Down Expand Up @@ -498,7 +498,7 @@ const CreateEstimate = ({ props }) => {
};

removeNonsortableObjectWithoutRequiredParams(completeFormData);
let validated = action !== "DRAFT" ? validateData(completeFormData) : true;
let validated = action !== "WF_DRAFT" ? validateData(completeFormData) : true;
if(validated){
const payload = createEstimatePayload(completeFormData, projectData, isEdit, currentEstimate, isCreateRevisionEstimate, isEditRevisionEstimate);
setShowModal(false);
Expand Down Expand Up @@ -541,7 +541,7 @@ const CreateEstimate = ({ props }) => {
},
],
};
if(action === "DRAFT")
if(action === "WF_DRAFT")
{
setShowToast({ label: t("WORKS_ESTIMATE_APPLICATION_DRAFTED") });
if(isCreateRevisionEstimate || isEditRevisionEstimate)
Expand Down Expand Up @@ -582,7 +582,7 @@ const CreateEstimate = ({ props }) => {
},
],
};
if(action === "DRAFT")
if(action === "WF_DRAFT")
{
setShowToast({ label: t("WORKS_ESTIMATE_APPLICATION_DRAFTED") });
if(isCreateRevisionEstimate || isEditRevisionEstimate)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,9 +247,9 @@ export const createEstimatePayload = (data, projectData, isEdit, estimate, isCre
},
},
workflow: {
action: (estimate?.wfStatus === "PENDINGFORCORRECTION" && (data?.wfAction === "SUBMIT" || data?.workflowAction === "SUBMIT")) ? "RE-SUBMIT" : data?.workflowAction,
action: (estimate?.wfStatus === "PENDINGFORCORRECTION" && (data?.wfAction === "WF_SUBMIT" || data?.workflowAction === "WF_SUBMIT")) ? "RE-SUBMIT" : data?.workflowAction?.split("_")?.[1],
comment: filteredFormData?.comments,
assignees: [data?.workflowAction === "DRAFT" ? Digit.UserService.getUser()?.info?.uuid : (filteredFormData?.selectedApprover?.uuid ? filteredFormData?.selectedApprover?.uuid : undefined)],
assignees: [data?.workflowAction === "WF_DRAFT" ? Digit.UserService.getUser()?.info?.uuid : (filteredFormData?.selectedApprover?.uuid ? filteredFormData?.selectedApprover?.uuid : undefined)],
},
};

Expand Down Expand Up @@ -302,9 +302,9 @@ export const createEstimatePayload = (data, projectData, isEdit, estimate, isCre
},
},
workflow: {
action: data?.workflowAction,
action: data?.workflowAction?.includes("WF")? data?.workflowAction?.split("_")?.[1] : data?.workflowAction,
comment: filteredFormData?.comments,
assignees: [data?.workflowAction === "DRAFT" ? Digit.UserService.getUser()?.info?.uuid : (filteredFormData?.selectedApprover?.uuid ? filteredFormData?.selectedApprover?.uuid : undefined)],
assignees: [data?.workflowAction === "WF_DRAFT" ? Digit.UserService.getUser()?.info?.uuid : (filteredFormData?.selectedApprover?.uuid ? filteredFormData?.selectedApprover?.uuid : undefined)],
},
};

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@egovernments/digit-ui-module-masters",
"version": "0.4.12",
"version": "0.4.13",
"description": "Masters Module UI",
"main": "dist/index.js",
"module": "dist/index.modern.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ const CreateOrganizationForm = ({setCreateOrgStatus, sessionFormData, setSession
const wards = []
const localities = {}
data?.TenantBoundary[0]?.boundary.forEach((item) => {
localities[item?.code] = item?.children.map(item => ({ code: item.code, name: item.name, i18nKey: `${headerLocale}_ADMIN_${item?.code}` }))
wards.push({ code: item.code, name: item.name, i18nKey: `${headerLocale}_ADMIN_${item?.code}` })
localities[item?.code] = item?.children.map(item => ({ code: item.code, name: t(`${headerLocale}_ADMIN_${item?.code}`), i18nKey: `${headerLocale}_ADMIN_${item?.code}` }))
wards.push({ code: item.code, name: t(`${headerLocale}_ADMIN_${item?.code}`), i18nKey: `${headerLocale}_ADMIN_${item?.code}` })
});
return {
wards, localities
}
},
})
},includeChildren = true)

const filteredLocalities = isLoading ? [] : wardsAndLocalities?.localities[selectedWard]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ const ConfigWageSeekerRegistrationForm = ({selectFile, uploadedFile, setUploade
tenantId, 'Locality',
{
select: (data) => {
return data?.TenantBoundary[0]?.boundary.map((item) => ({ code: item.code, name: item.name, i18nKey: `${headerLocale}_ADMIN_${item?.code}` }));
return data?.TenantBoundary[0]?.boundary.map((item) => ({ code: item.code, name: t(`${headerLocale}_ADMIN_${item?.code}`), i18nKey: `${headerLocale}_ADMIN_${item?.code}` }));
},
})

const {data: wardOptions } = Digit.Hooks.useLocation(
tenantId, 'Ward',
{
select: (data) => {
return data?.TenantBoundary[0]?.boundary.map((item) => ({ code: item.code, name: item.name, i18nKey: `${headerLocale}_ADMIN_${item?.code}` }));
return data?.TenantBoundary[0]?.boundary.map((item) => ({ code: item.code, name: t(`${headerLocale}_ADMIN_${item?.code}`), i18nKey: `${headerLocale}_ADMIN_${item?.code}` }));
},
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,14 @@ const CreateOrganizationForm = ({ createOrganizationConfig, sessionFormData, set
const wards = []
const localities = {}
data?.TenantBoundary[0]?.boundary.forEach((item) => {
localities[item?.code] = item?.children.map(item => ({ code: item.code, name: item.name, i18nKey: `${headerLocale}_ADMIN_${item?.code}`, label : item?.label }))
wards.push({ code: item.code, name: item.name, i18nKey: `${headerLocale}_ADMIN_${item?.code}` })
localities[item?.code] = item?.children.map(item => ({ code: item.code, name: t(`${headerLocale}_ADMIN_${item?.code}`), i18nKey: `${headerLocale}_ADMIN_${item?.code}`, label : item?.label }))
wards.push({ code: item.code, name: t(`${headerLocale}_ADMIN_${item?.code}`), i18nKey: `${headerLocale}_ADMIN_${item?.code}` })
});
return {
wards, localities
}
}
});
},includeChildren = true);
const filteredLocalities = wardsAndLocalities?.localities[selectedWard];

//org data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,14 @@ const requestCriteria = {
const wards = []
const localities = {}
data?.TenantBoundary[0]?.boundary.forEach((item) => {
localities[item?.code] = item?.children.map(item => ({ code: item.code, name: item.name, i18nKey: `${headerLocale}_ADMIN_${item?.code}`, label : item?.label }))
wards.push({ code: item.code, name: item.name, i18nKey: `${headerLocale}_ADMIN_${item?.code}` })
localities[item?.code] = item?.children.map(item => ({ code: item.code, name: t(`${headerLocale}_ADMIN_${item?.code}`), i18nKey: `${headerLocale}_ADMIN_${item?.code}`, label : item?.label }))
wards.push({ code: item.code, name: t(`${headerLocale}_ADMIN_${item?.code}`), i18nKey: `${headerLocale}_ADMIN_${item?.code}` })
});
return {
wards, localities
}
}
});
},includeChildren = true);
const filteredLocalities = wardsAndLocalities?.localities[selectedWard];

//wage seeker form config
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@egovernments/digit-ui-module-project",
"version": "0.4.8",
"version": "0.4.9",
"description": "Project Module UI",
"main": "dist/index.js",
"module": "dist/index.modern.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,14 @@ const SubProjectDetailsTable = ({t, register, control, setValue, onChange, error
const wards = []
const localities = {}
data?.TenantBoundary[0]?.boundary.forEach((item) => {
localities[item?.code] = item?.children.map(item => ({ code: item.code, name: item.name, i18nKey: `${headerLocale}_ADMIN_${item?.code}`, label : item?.label }))
wards.push({ code: item.code, name: item.name, i18nKey: `${headerLocale}_ADMIN_${item?.code}` })
localities[item?.code] = item?.children.map(item => ({ code: item.code, name: t(`${headerLocale}_ADMIN_${item?.code}`), i18nKey: `${headerLocale}_ADMIN_${item?.code}`, label : item?.label }))
wards.push({ code: item.code, name: t(`${headerLocale}_ADMIN_${item?.code}`), i18nKey: `${headerLocale}_ADMIN_${item?.code}` })
});
return {
wards, localities
}
}
});
},includeChildren = true);

useEffect(()=>{
let filteredSubTypeOfProject = ( subProjectTypeOfProjectOptions && subProjectTypeOfProjectOptions?.projectSubType ) ? (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,9 +252,9 @@ export const createProjectConfigMUKTA = {
"name": "noSubProject_locality",
"optionsKey": "i18nKey",
"allowMultiSelect": false,
"url": "/egov-location/location/v11/boundarys/_search",
"params": { "hierarchyTypeCode" : "ADMIN", "boundaryType": "locality" },
"selectFun": "return data?.TenantBoundary[0]?.boundary?.map(item => ({ code: item.code, name: item.name, i18nKey: `${headerLocale}_ADMIN_${item?.code}` }))"
"url": "/boundary-service/boundary-relationships/_search?",
"params": { "hierarchyType" : "ADMIN", "boundaryType": "LOCALITY" },
"selectFun": "return data?.boundary?.map(item => ({ code: item.code, i18nKey: `${headerLocale}_ADMIN_${item?.code}` }))"
}
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,14 @@ const CreateProjectForm = ({t, sessionFormData, setSessionFormData, clearSession
const wards = []
const localities = {}
data?.TenantBoundary[0]?.boundary.forEach((item) => {
localities[item?.code] = item?.children.map(item => ({ code: item.code, name: item.name, i18nKey: `${headerLocale}_ADMIN_${item?.code}`, label : item?.label }))
wards.push({ code: item.code, name: item.name, i18nKey: `${headerLocale}_ADMIN_${item?.code}` })
localities[item?.code] = item?.children.map(item => ({ code: item.code, name: t(`${headerLocale}_ADMIN_${item?.code}`), i18nKey: `${headerLocale}_ADMIN_${item?.code}`, label : item?.label }))
wards.push({ code: item.code, name: t(`${headerLocale}_ADMIN_${item?.code}`), i18nKey: `${headerLocale}_ADMIN_${item?.code}` })
});
return {
wards, localities
}
}
});
},true);
const filteredLocalities = wardsAndLocalities?.localities[selectedWard];
const config = useMemo(
() => Digit.Utils.preProcessMDMSConfig(t, createProjectConfig, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ const LocationDropdownWrapper = ({populators,formData,props,inputRef,errors,setV
const wards = []
const localities = {}
data?.TenantBoundary[0]?.boundary.forEach((item) => {
localities[item?.code] = item?.children.map(item => ({ code: item.code, name: item.name, i18nKey: `${headerLocale}_ADMIN_${item?.code}`, label: item?.label }))
wards.push({ code: item.code, name: item.name, i18nKey: `${headerLocale}_ADMIN_${item?.code}` })
localities[item?.code] = item?.children.map(item => ({ code: item.code, name: t(`${headerLocale}_ADMIN_${item?.code}`), i18nKey: `${headerLocale}_ADMIN_${item?.code}`, label: item?.label }))
wards.push({ code: item.code, name: t(`${headerLocale}_ADMIN_${item?.code}`), i18nKey: `${headerLocale}_ADMIN_${item?.code}` })
});

return {
wards, localities
}
}
});
},true);


useEffect(() => {
Expand Down
6 changes: 3 additions & 3 deletions frontend/micro-ui/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
"@egovernments/digit-ui-module-attendencemgmt": "0.4.9",
"@egovernments/digit-ui-module-contracts": "0.4.8",
"@egovernments/digit-ui-module-measurement":"0.2.8",
"@egovernments/digit-ui-module-estimate": "0.4.13",
"@egovernments/digit-ui-module-masters": "0.4.12",
"@egovernments/digit-ui-module-project": "0.4.8",
"@egovernments/digit-ui-module-estimate": "0.4.14",
"@egovernments/digit-ui-module-masters": "0.4.13",
"@egovernments/digit-ui-module-project": "0.4.9",
"@egovernments/digit-ui-module-expenditure": "0.4.6",
"@egovernments/digit-ui-customisation-mukta": "0.2.6",
"@egovernments/digit-ui-module-rate-analysis": "0.4.6",
Expand Down

0 comments on commit 8ccc3c5

Please sign in to comment.