Skip to content

Commit

Permalink
Changes regarding facility catchment popup (#1741)
Browse files Browse the repository at this point in the history
  • Loading branch information
ashish-egov authored Nov 5, 2024
1 parent 8563ea1 commit 95e9b41
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import AccessibilityPopUp from "./accessbilityPopUP";
import SecurityPopUp from "./securityPopUp";
import { tableCustomStyle } from "./tableCustomStyle";

const FacilityPopUp = ({ details, onClose }) => {
const FacilityPopUp = ({ details, onClose , updateDetails}) => {
const { t } = useTranslation();
const currentUserUuid = Digit.UserService.getUser().info.uuid;
const tenantId = Digit.ULBService.getCurrentTenantId();
Expand Down Expand Up @@ -254,10 +254,6 @@ const FacilityPopUp = ({ details, onClose }) => {
return !boundarySet.has(boundary)
})
newDetails.serviceBoundaries = filteredBoundaries
// TODO : remove this logic
// newDetails.serviceBoundaries = Array.from(new Set(newDetails.serviceBoundaries.map(boundary => boundary[0] === " " ? boundary.slice(1) : boundary)));


}
else {
const boundarySet = new Set(selectedRowData.map((row) => {
Expand All @@ -267,9 +263,6 @@ const FacilityPopUp = ({ details, onClose }) => {
!newDetails.serviceBoundaries.includes(boundary)
);
newDetails.serviceBoundaries = newDetails?.serviceBoundaries?.concat(filteredBoundaries);
// TODO : remove this logic
// newDetails.serviceBoundaries = Array.from(new Set(newDetails.serviceBoundaries.map(boundary => boundary[0] === " " ? boundary.slice(1) : boundary)));

}
await mutationForPlanFacilityUpdate.mutate(
{
Expand All @@ -281,6 +274,7 @@ const FacilityPopUp = ({ details, onClose }) => {
onSuccess: async (result) => {
setSelectedRows([]);
setIsAllSelected(false);
updateDetails(newDetails);
},
onError: async (result) => {
// setDownloadError(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ const FacilityCatchmentMapping = () => {
const userRoles = user?.info?.roles?.map((roleData) => roleData?.code);
const [showPopup, setShowPopup] = useState(false);
const FacilityPopUp = Digit.ComponentRegistryService.getComponent("FacilityPopup");
const [currentRow,setCurrentRow] = useState(null)
const [currentRow,setCurrentRow] = useState(null);
const [censusQueryName, setCensusQueryName] = useState("censusData");
// Check if the user has the 'rootfacilitycatchmentmapper' role
const isRootApprover = userRoles?.includes("ROOT_FACILITY_CATCHMENT_MAPPER");

Expand Down Expand Up @@ -56,6 +57,7 @@ const FacilityCatchmentMapping = () => {
config: {
enabled: planEmployee?.planData?.[0]?.jurisdiction ? true : false,
},
changeQueryName: censusQueryName
};

const { isLoading, data, isFetching, refetch } = Digit.Hooks.useCustomAPIHook(reqCriteriaResource);
Expand Down Expand Up @@ -134,7 +136,9 @@ const FacilityCatchmentMapping = () => {
onClose={() => {
setShowPopup(false);
setCurrentRow(null);
setCensusQueryName(`censusData${Date.now()}`);
}}
updateDetails={setCurrentRow}
/>
)}

Expand Down
5 changes: 3 additions & 2 deletions health/micro-ui/web/microplan/inter-package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"version": "1.0.0",
"main": "index.js",
"workspaces": [
"packages/modules/microplan"
"packages/modules/microplan",
"packages/modules/campaign-manager"
],
"author": "JaganKumar <jagan.kumar@egov.org.in>",
"license": "MIT",
Expand All @@ -23,7 +24,7 @@
"dev:microplan": "cd packages/modules/microplan && yarn start",
"dev:campaign": "cd packages/modules/campaign-manager && yarn start",
"build": "run-p build:**",
"buildD:campaign": "cd packages/modules/campaign-manager && yarn build",
"build:campaign": "cd packages/modules/campaign-manager && yarn build",
"buildD:hcm-microplanning": "cd packages/modules/hcm-microplanning && yarn build",
"build:microplan": "cd packages/modules/microplan && yarn build",
"deploy:jenkins": "./scripts/jenkins.sh",
Expand Down
3 changes: 2 additions & 1 deletion health/micro-ui/web/microplan/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"node": ">=14"
},
"workspaces": [
"micro-ui-internals/packages/modules/microplan"
"micro-ui-internals/packages/modules/microplan",
"micro-ui-internals/packages/modules/campaign-manager"
],
"homepage": "/microplan-ui",
"dependencies": {
Expand Down

0 comments on commit 95e9b41

Please sign in to comment.