Skip to content

Commit

Permalink
fixes (#1869)
Browse files Browse the repository at this point in the history
* added serving facility

* form composer action bar fix

* plan inbox assignee fix

* formula and assumption refresh issue

* action bar hidden fixes, session fixes

* fixes

* Update health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/FormulaConfiguration.js

---------

Co-authored-by: NabeelAyubee <[email protected]>
  • Loading branch information
nabeelmd-eGov and NabeelAyubee authored Nov 21, 2024
1 parent 427f95f commit fd7b142
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ const FormulaConfigWrapper = ({ onSelect, props: customProps }) => {

<div className="card-container" style={{ width: "77vw", marginBottom: "2.5rem" }}>
<FormulaConfiguration
category={`FORMULA_${ruleConfigurationCategories[formulaInternalKey - 1]?.category}`}
category={ruleConfigurationCategories[formulaInternalKey - 1]?.category}
formulas={[...filteredFormulas?.filter((item) => !deletedFormulas?.includes(item.output)), ...customFormula]}
onSelect={onSelect}
customProps={customProps}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ const FormulaConfiguration = ({ onSelect, category, customProps, formulas: initi
return (
<>
<Card className="middle-child">
<Header className="uploader-sub-heading">{t(category)}</Header>
<Header className="uploader-sub-heading">{t(`FORMULA_HEADER_${category}`)}</Header>
{(category==="FORMULA_CAMPAIGN_VEHICLES")? <p className="mp-description">{t(`FORMULA_VEHICLE_DESCRIPTION`)}</p>:
<p className="mp-description">{t(`FORMULA_CONFIGURATION_DESCRIPTION`)}</p>
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ import FacilityCatchmentMapping from "./FacilityCatchmentMapping";
import PlanInbox from "./PlanInbox";
import MapViewComponent from "../../components/MapViewComponent";




// const bredCrumbStyle = { maxWidth: "min-content" };
const ProjectBreadCrumb = ({ location }) => {
const { t } = useTranslation();
Expand All @@ -38,8 +35,9 @@ const ProjectBreadCrumb = ({ location }) => {
{
internalLink: `/${window?.contextPath}/employee/microplan/user-management`,
content: t("USER_MANAGEMENT"),
show: Digit.Utils.locale.getTransformedLocale(location.pathname.split("/").pop()) === "UPLOAD_USER" || Digit.Utils.locale.getTransformedLocale(location.pathname.split("/").pop()) === "USER_DOWNLOAD"

show:
Digit.Utils.locale.getTransformedLocale(location.pathname.split("/").pop()) === "UPLOAD_USER" ||
Digit.Utils.locale.getTransformedLocale(location.pathname.split("/").pop()) === "USER_DOWNLOAD",
},
{
internalLink: `/${window?.contextPath}/employee`,
Expand Down Expand Up @@ -73,14 +71,13 @@ const App = ({ path, stateCode, userType, tenants, BOUNDARY_HIERARCHY_TYPE, hier
}
return () => {
if (window.location.pathname !== `/${window.contextPath}/employee/microplan/setup-microplan`) {
window.Digit.SessionStorage.del("MICROPLAN_DATA");
window.Digit.SessionStorage.del("HYPOTHESIS_DATA");
window.Digit.SessionStorage.del("FORMULA_DATA");
window.Digit.SessionStorage.del("MICROPLAN_DATA");
window.Digit.SessionStorage.del("HYPOTHESIS_DATA");
window.Digit.SessionStorage.del("FORMULA_DATA");
}
};
}, []);


const { isLoading: isLoadingMdmsMicroplanData, data: MicroplanMdmsData } = Digit.Hooks.useCustomMDMS(
Digit.ULBService.getCurrentTenantId(),
"hcm-microplanning",
Expand All @@ -102,7 +99,7 @@ const App = ({ path, stateCode, userType, tenants, BOUNDARY_HIERARCHY_TYPE, hier
{ name: "facilityType" },
{ name: "facilityStatus" },
{ name: "VehicleDetails" },
{ name: "ContextPathForUser" }
{ name: "ContextPathForUser" },
],
{
cacheTime: Infinity,
Expand All @@ -113,18 +110,15 @@ const App = ({ path, stateCode, userType, tenants, BOUNDARY_HIERARCHY_TYPE, hier
...data?.["hcm-microplanning"],
},
});
}
},
},
{ schemaCode: "BASE_MASTER_DATA" } //mdmsv2
);

const { isLoading: isLoadingMdmsAdditionalData, data: AdditionalMdmsData } = Digit.Hooks.useCustomMDMS(
Digit.ULBService.getCurrentTenantId(),
"HCM-ADMIN-CONSOLE",
[
{ name: "hierarchyConfig" },

],
[{ name: "hierarchyConfig" }],
{
cacheTime: Infinity,
select: (data) => {
Expand Down Expand Up @@ -159,9 +153,8 @@ const App = ({ path, stateCode, userType, tenants, BOUNDARY_HIERARCHY_TYPE, hier
// ],
// ...data?.["HCM-ADMIN-CONSOLE"],
// },

// });
}
},
},
{ schemaCode: "ADDITIONAL_MASTER_DATA" } //mdmsv2
);
Expand All @@ -186,7 +179,7 @@ const App = ({ path, stateCode, userType, tenants, BOUNDARY_HIERARCHY_TYPE, hier
state: {
boundaryHierarchy: data?.BoundaryHierarchy?.[0]?.boundaryHierarchy,
hierarchyType: BOUNDARY_HIERARCHY_TYPE,
lowestHierarchy
lowestHierarchy,
},
});
return data?.BoundaryHierarchy?.[0];
Expand All @@ -195,24 +188,24 @@ const App = ({ path, stateCode, userType, tenants, BOUNDARY_HIERARCHY_TYPE, hier
};
const { data: hierarchyDefinition, isLoading: isBoundaryHierarchyLoading } = Digit.Hooks.useCustomAPIHook(reqCriteria);



if (isLoadingMdmsMicroplanData || isLoadingMdmsAdditionalData || isBoundaryHierarchyLoading) {
return <Loader />
return <Loader />;
}

//TODO: Hardcode jurisdiction in state for now, need a microplan with complete setup done with all selected boundaries(in campaign), need superviser users with jurisdiction and tagging


return (
<Switch>
<AppContainer className="ground-container">
<React.Fragment>
<ProjectBreadCrumb location={location} />
</React.Fragment>
<PrivateRoute path={`${path}/setup-microplan`} component={() => <SetupMicroplan hierarchyType={BOUNDARY_HIERARCHY_TYPE} hierarchyData={hierarchyData} />} />
<PrivateRoute
path={`${path}/setup-microplan`}
component={() => <SetupMicroplan hierarchyType={BOUNDARY_HIERARCHY_TYPE} hierarchyData={hierarchyData} />}
/>
<PrivateRoute path={`${path}/microplan-search`} component={() => <MicroplanSearch></MicroplanSearch>} />
<PrivateRoute path={`${path}/user-management`} component={() => <UserManagement ></UserManagement>} />
<PrivateRoute path={`${path}/user-management`} component={() => <UserManagement></UserManagement>} />
<PrivateRoute path={`${path}/user-download`} component={() => <UserDownload />} />
<PrivateRoute path={`${path}/select-activity`} component={() => <ChooseActivity />} />
<PrivateRoute path={`${path}/campaign-boundary`} component={() => <CampaignBoundary />} />
Expand All @@ -230,10 +223,6 @@ const App = ({ path, stateCode, userType, tenants, BOUNDARY_HIERARCHY_TYPE, hier
<PrivateRoute path={`${path}/village-finalise-success`} component={() => <Response />} />
<PrivateRoute path={`${path}/microplan-success`} component={() => <Response />} />
<PrivateRoute path={`${path}/map-view`} component={() => <MapViewComponent />} />




</AppContainer>
</Switch>
);
Expand Down

0 comments on commit fd7b142

Please sign in to comment.