Skip to content

Commit

Permalink
RELEASE/HCMPRE-1923 : Microplanning 0.2 release (#2134)
Browse files Browse the repository at this point in the history
* BUGFIX/HCMPRE-1634: fix for versions (#2024)

* Revert "Bugfix/hcmpre 1583 (#2021)"

This reverts commit 201a0ce.

* BUGFIX/HCMPRE-1634 Revert ing"updated core version (#2020)"

* BUGFIX/HCMPRE-1583 fixes

---------

Co-authored-by: Swathi-eGov <swathi.chatrathi@egovernments.org>

* FEATURE/HCMPRE-1634:Fixed all the version updates (#2026)

FEATURE/HCMPRE-1634: Fixed all the version updates

* BUGFIX/HCMPRE-1505 : Updated Core Version To Fix Validation Issue on … (#2047)

BUGFIX/HCMPRE-1505 : Updated Core Version To Fix Validation Issue on Profile Update

* BUGFIX/HCMPRE-15830 : Fixed checkbox click area (#2064)

Css changes

* FEATURE/HCMPRE-1789 : Draft Flow (#2093)

* changes to createUpdatePlan

* Changes to UI, createUpdatePlan

* Putting the Hierarchy near the name

* Loc change

* Resolved comments

* Null check for Hierarchy level

* Changes

* Indirectly Mutating planObject

* changes

* changes

---------

Co-authored-by: Abishek <abishek.t@egovernments.org>

* FEATURE/HCMPRE-1787 : Untagging all the current users if boundary is  (#2092)

* FEATURE/HCMPRE-1787 : Untagging all the current users if boundary is changed during setup

* FEATUTE/HCMPRE-1787 : Added different error cases

* FEATURE/HCMPRE-1710: Accessibility dropdown for planInbox with plan integration and apply filter (#2091)

* Adding filters

* Working Filter Search

* InboxFilter Changes

* removing console.log

* Css package update

* changes

* changes

* changes

* changes

* changes

* A lot of changes

* changes

* changes

* changes

* uniform payload structure

* FEATURE/HCMPRE-1712: Facility Dropdown for plan Inbox (#2096)

* Adding filters

* Working Filter Search

* InboxFilter Changes

* removing console.log

* Css package update

* changes

* changes

* changes

* changes

* changes

* A lot of changes

* changes

* changes

* changes

* uniform payload structure

* Adding Facility Dropdown

* code replacing name attribute

* Loader changes

* comments resolved

* Loader change

* Id to id

* BUGFIX/HCMPRE-1810: Fix issue for next page in user tagging (#2104)

* for clickng on save and next

* remove console

* FEATURE/HCMPRE-1706: Plan Inbox updates and draft flow changes (#2109)

* updated plan inbox

* Update createUpdatePlanProject.js

* formatted createupdateplanproject

* FEATURE/HCMPRE-1681: Handled the case where capacity is 0 and tested full flow (#2111)

handled the case where capacity is 0 and tested full flow

* FEATURE/HCMPRE-1713: PopInbox and filtering integration (#2108)

* PopInbox and facilityId search in planInbox

* Localization

* Chages to CSS and removing filter

* Changes to facility filter and security Question

* css package update

* facilityId removed

* Resolved comments, made payload to facilityId

* component package update

* FEATURE/HCMPRE-1704 : Removing current validation from assumptions an… (#2122)

* FEATURE/HCMPRE-1704 : Removing current validation from assumptions and making sure the flow works as expected( for mixed strat, regis and dist can be same)

* FEATURE/HCMPRE-1704 : Review updates

* BUGFIX/HCMPRE-1584: Disable planSearch for popInbox and CSS for dropdown (#2123)

* BUGFIX/HCMPRE-1866 : Updated versions (#2128)

* FEATURE/HCMPRE-0000 : Fix for serach query in user tagging screen (#2132)

* BUGFIX/HCMPRE-1944: TotalCount UI issue in planIbox (#2138)

* useEffect updated

* CountAssignToAll issue in planInbox

* BUGFIX/HCMPRE-2212 : Updated Facility Filter as a Multiselect dropdown

* Fixed facility filter issue

* FEATURE/HCMPRE-0000 : Fixed Css Issue (#2178)

---------

Co-authored-by: Jagankumar <53823168+jagankumar-egov@users.noreply.github.com>
Co-authored-by: Swathi-eGov <swathi.chatrathi@egovernments.org>
Co-authored-by: Swathi-eGov <137176788+Swathi-eGov@users.noreply.github.com>
Co-authored-by: abishekTa-egov <abishek.t@egovernments.org>
  • Loading branch information
5 people authored Feb 3, 2025
1 parent d42d12e commit bcb3a79
Show file tree
Hide file tree
Showing 20 changed files with 715 additions and 331 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@
<meta name="theme-color" content="#00bcd1" />
<title>DIGIT</title>
<link rel="stylesheet" href="https://unpkg.com/@egovernments/digit-ui-css@1.8.12/dist/index.css" />
<link rel="stylesheet" href="https://unpkg.com/@egovernments/digit-ui-components-css@0.0.2-beta.43/dist/index.css" />
<link rel="stylesheet" href="https://unpkg.com/@egovernments/digit-ui-health-css@0.2.6/dist/index.css" />

<link rel="stylesheet" href="https://unpkg.com/@egovernments/digit-ui-components-css@0.0.2-beta.44/dist/index.css" />
<link rel="stylesheet" href="https://unpkg.com/@egovernments/digit-ui-health-css@0.2.44/dist/index.css" />

<!-- added below css for hcm-workbench module inclusion-->
<!-- <link rel="stylesheet" href="https://unpkg.com/@egovernments/digit-ui-css@1.5.41/dist/index.css" /> -->
Expand Down
334 changes: 170 additions & 164 deletions health/micro-ui/web/micro-ui-internals/example/src/UICustomizations.js
Original file line number Diff line number Diff line change
Expand Up @@ -765,176 +765,177 @@ export const UICustomizations = {
}
},
},
MicroplanSearchConfig: {
preProcess: (data, additionalDetails) => {
const { name, status } = data?.state?.searchForm || {};
data.body.PlanConfigurationSearchCriteria = {};
data.body.PlanConfigurationSearchCriteria.limit = data?.state?.tableForm?.limit;
// data.body.PlanConfigurationSearchCriteria.limit = 10
data.body.PlanConfigurationSearchCriteria.offset = data?.state?.tableForm?.offset;
data.body.PlanConfigurationSearchCriteria.name = name;
data.body.PlanConfigurationSearchCriteria.tenantId = Digit.ULBService.getCurrentTenantId();
data.body.PlanConfigurationSearchCriteria.userUuid = Digit.UserService.getUser().info.uuid;
// delete data.body.PlanConfigurationSearchCriteria.pagination
data.body.PlanConfigurationSearchCriteria.status = status?.status;
data.body.PlanConfigurationSearchCriteria.name = data?.state?.searchForm?.microplanName;
cleanObject(data.body.PlanConfigurationSearchCriteria);

const dic = {
0: null,
1: ["DRAFT"],
2: ["EXECUTION_TO_BE_DONE"],
3: ["CENSUS_DATA_APPROVAL_IN_PROGRESS", "CENSUS_DATA_APPROVED", "RESOURCE_ESTIMATION_IN_PROGRESS"],
4: ["RESOURCE_ESTIMATIONS_APPROVED"],
};
const url = Digit.Hooks.useQueryParams();

const tabId = url.tabId || "0"; // Default to '0' if tabId is undefined
data.body.PlanConfigurationSearchCriteria.status = dic[String(tabId)];
cleanObject(data.body.PlanConfigurationSearchCriteria);
return data;
},
additionalCustomizations: (row, key, column, value, t, searchResult) => {

switch (key) {
case "ACTIONS":
// TODO : Replace dummy file id with real file id when API is ready
const dummyFile = "c22a7676-d5d7-49b6-bcdb-83e9519f58df"
const microplanFileId = row?.campaignDetails?.additionalDetails?.microplanFileId || dummyFile;
let options = [];

if (row?.status == "DRAFT") {
options = [{ code: "1", name: "MP_ACTIONS_EDIT_SETUP" }];
} else {
options = [{ code: "1", name: "MP_ACTIONS_VIEW_SUMMARY" }];
}

const handleDownload = () => {
const files = row?.files;
const file = files.find((item) => item.templateIdentifier === "Population");
const fileId = file?.filestoreId;
const campaignName = row?.name || "";
if (!fileId) {
console.error("Population template file not found");
return;
}
Digit.Utils.campaign.downloadExcelWithCustomName({
fileStoreId: fileId,
customName: campaignName
});
};

const onActionSelect = (e) => {
if (e.name == "MP_ACTIONS_EDIT_SETUP") {
window.location.href = `/${window.contextPath}/employee/microplan/setup-microplan?key=${1}&microplanId=${row.id}&campaignId=${
row.campaignDetails.id
}`;
}
if (e.name == "MP_ACTIONS_VIEW_SUMMARY") {
window.location.href = `/${window.contextPath}/employee/microplan/setup-microplan?key=${10}&microplanId=${row.id}&campaignId=${
row.campaignDetails.id
}&setup-completed=true`;
MicroplanSearchConfig: {
preProcess: (data, additionalDetails) => {
const { name, status } = data?.state?.searchForm || {};
data.body.PlanConfigurationSearchCriteria = {};
data.body.PlanConfigurationSearchCriteria.limit = data?.state?.tableForm?.limit;
// data.body.PlanConfigurationSearchCriteria.limit = 10
data.body.PlanConfigurationSearchCriteria.offset = data?.state?.tableForm?.offset;
data.body.PlanConfigurationSearchCriteria.name = name;
data.body.PlanConfigurationSearchCriteria.tenantId = Digit.ULBService.getCurrentTenantId();
data.body.PlanConfigurationSearchCriteria.userUuid = Digit.UserService.getUser().info.uuid;
// delete data.body.PlanConfigurationSearchCriteria.pagination
data.body.PlanConfigurationSearchCriteria.status = status?.status;
data.body.PlanConfigurationSearchCriteria.name = data?.state?.searchForm?.microplanName;
cleanObject(data.body.PlanConfigurationSearchCriteria);

const dic = {
0: null,
1: ["DRAFT"],
2: ["EXECUTION_TO_BE_DONE"],
3: ["CENSUS_DATA_APPROVAL_IN_PROGRESS", "CENSUS_DATA_APPROVED", "RESOURCE_ESTIMATION_IN_PROGRESS"],
4: ["RESOURCE_ESTIMATIONS_APPROVED"],
};
const url = Digit.Hooks.useQueryParams();

const tabId = url.tabId || "0"; // Default to '0' if tabId is undefined
data.body.PlanConfigurationSearchCriteria.status = dic[String(tabId)];
cleanObject(data.body.PlanConfigurationSearchCriteria);
return data;
},
additionalCustomizations: (row, key, column, value, t, searchResult) => {

switch (key) {
case "ACTIONS":
// TODO : Replace dummy file id with real file id when API is ready
const dummyFile = "c22a7676-d5d7-49b6-bcdb-83e9519f58df"
const microplanFileId = row?.campaignDetails?.additionalDetails?.microplanFileId || dummyFile;
let options = [];

if (row?.status == "DRAFT") {
options = [{ code: "1", name: "MP_ACTIONS_EDIT_SETUP" }];
} else {
options = [{ code: "1", name: "MP_ACTIONS_VIEW_SUMMARY" }];
}
};

return (
<div>
{microplanFileId && row?.status == "RESOURCE_ESTIMATIONS_APPROVED" ? (
<div>
<ButtonNew style={{ width: "20rem" }} onClick={handleDownload} icon="DownloadIcon" label={t("WBH_DOWNLOAD_MICROPLAN")} title={t("WBH_DOWNLOAD_MICROPLAN")} />
</div>
) : (
<div className={"action-button-open-microplan"}>
<div style={{ position: "relative" }}>
<ButtonNew
type="actionButton"
variation="secondary"
label={t("MP_ACTIONS_FOR_MICROPLAN_SEARCH")}
title={t("MP_ACTIONS_FOR_MICROPLAN_SEARCH")}
options={options}
style={{ width: "20rem" }}
optionsKey="name"
showBottom={true}
isSearchable={false}
onOptionSelect={(item) => onActionSelect(item)}
/>
</div>
</div>
)}
</div>
);

case "NAME_OF_MICROPLAN":
if (value && value !== "NA") {
return (
<div
style={{
maxWidth: "15rem", // Set the desired maximum width
wordWrap: "break-word", // Allows breaking within words
whiteSpace: "normal", // Ensures text wraps normally
overflowWrap: "break-word", // Break long words at the edge
}}
>
<p>{t(value)}</p>
</div>
);
} else {

const handleDownload = () => {
const files = row?.files;
const file = files.find((item) => item.templateIdentifier === "Population");
const fileId = file?.filestoreId;
if (!fileId) {
console.error("Population template file not found");
return;
}
const campaignName = row?.name || "";
Digit.Utils.campaign.downloadExcelWithCustomName({
fileStoreId: fileId,
customName: campaignName
});
};

const onActionSelect = (e) => {
if (e.name === "MP_ACTIONS_EDIT_SETUP") {
const key = parseInt(row?.additionalDetails?.key);
const resolvedKey = key === 8 ? 7 : key === 9 ? 10 : key || 2;
const url = `/${window.contextPath}/employee/microplan/setup-microplan?key=${resolvedKey}&microplanId=${row.id}&campaignId=${row.campaignDetails.id}`;
window.location.href = url;
}
if (e.name == "MP_ACTIONS_VIEW_SUMMARY") {
window.location.href = `/${window.contextPath}/employee/microplan/setup-microplan?key=${10}&microplanId=${row.id}&campaignId=${
row.campaignDetails.id
}&setup-completed=true`;
}
};

return (
<div>
<p>{t("NA")}</p>
</div>
);
}

case "MICROPLAN_STATUS":
if (value && value != "NA") {
return <p>{t(Digit.Utils.locale.getTransformedLocale("MICROPLAN_STATUS_" + value))}</p>;
} else {
return (
<div>
<p>{t("NA")}</p>
</div>
);
}

case "CAMPAIGN_DISEASE":
if (value && value != "NA") {
return <p>{t(Digit.Utils.locale.getTransformedLocale("MICROPLAN_DISEASE_" + value))}</p>;
} else {
return (
<div>
<p>{t("NA")}</p>
</div>
);
}

case "CAMPAIGN_TYPE":
if (value && value != "NA") {
return <p>{t(Digit.Utils.locale.getTransformedLocale("MICROPLAN_TYPE_" + value))}</p>;
} else {
return (
<div>
<p>{t("NA")}</p>
</div>
);
}

case "DISTIRBUTION_STRATEGY":
if (value && value != "NA") {
return <p>{t(Digit.Utils.locale.getTransformedLocale("MICROPLAN_DISTRIBUTION_" + value))}</p>;
} else {
return (
<div>
<p>{t("NA")}</p>
{microplanFileId && row?.status == "RESOURCE_ESTIMATIONS_APPROVED" ? (
<div>
<ButtonNew style={{ width: "20rem" }} icon="DownloadIcon" onClick={handleDownload} label={t("WBH_DOWNLOAD_MICROPLAN")} title={t("WBH_DOWNLOAD_MICROPLAN")} />
</div>
) : (
<div className={"action-button-open-microplan"}>
<div style={{ position: "relative" }}>
<ButtonNew
type="actionButton"
variation="secondary"
label={t("MP_ACTIONS_FOR_MICROPLAN_SEARCH")}
title={t("MP_ACTIONS_FOR_MICROPLAN_SEARCH")}
options={options}
style={{ width: "20rem" }}
optionsKey="name"
showBottom={true}
isSearchable={false}
onOptionSelect={(item) => onActionSelect(item)}
/>
</div>
</div>
)}
</div>
);
}

default:
return null; // Handle any unexpected keys here if needed
}

case "NAME_OF_MICROPLAN":
if (value && value !== "NA") {
return (
<div
style={{
maxWidth: "15rem", // Set the desired maximum width
wordWrap: "break-word", // Allows breaking within words
whiteSpace: "normal", // Ensures text wraps normally
overflowWrap: "break-word", // Break long words at the edge
}}
>
<p>{t(value)}</p>
</div>
);
} else {
return (
<div>
<p>{t("NA")}</p>
</div>
);
}

case "MICROPLAN_STATUS":
if (value && value != "NA") {
return <p>{t(Digit.Utils.locale.getTransformedLocale("MICROPLAN_STATUS_" + value))}</p>;
} else {
return (
<div>
<p>{t("NA")}</p>
</div>
);
}

case "CAMPAIGN_DISEASE":
if (value && value != "NA") {
return <p>{t(Digit.Utils.locale.getTransformedLocale("MICROPLAN_DISEASE_" + value))}</p>;
} else {
return (
<div>
<p>{t("NA")}</p>
</div>
);
}

case "CAMPAIGN_TYPE":
if (value && value != "NA") {
return <p>{t(Digit.Utils.locale.getTransformedLocale("MICROPLAN_TYPE_" + value))}</p>;
} else {
return (
<div>
<p>{t("NA")}</p>
</div>
);
}

case "DISTIRBUTION_STRATEGY":
if (value && value != "NA") {
return <p>{t(Digit.Utils.locale.getTransformedLocale("MICROPLAN_DISTRIBUTION_" + value))}</p>;
} else {
return (
<div>
<p>{t("NA")}</p>
</div>
);
}

default:
return null; // Handle any unexpected keys here if needed
}
},
},
},
MyMicroplanSearchConfig: {
preProcess: (data, additionalDetails) => {
const { name, status } = data?.state?.searchForm || {};
Expand Down Expand Up @@ -1299,6 +1300,11 @@ export const UICustomizations = {
const VillageHierarchyTooltipWrapper = Digit.ComponentRegistryService.getComponent("VillageHierarchyTooltipWrapper");

switch (key) {
case `MICROPLAN_FACILITY_${column?.projectType}_CAPACITY`:
if (row?.additionalDetails?.capacity || row?.additionalDetails?.capacity === 0) {
return row?.additionalDetails?.capacity;
}
return t("NA");
case "MICROPLAN_FACILITY_SERVINGPOPULATION":
return row?.additionalDetails?.servingPopulation;
case "MICROPLAN_FACILITY_RESIDINGVILLAGE":
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@egovernments/digit-ui-health-css",
"version": "0.2.6",
"version": "0.2.44",
"license": "MIT",
"main": "dist/index.css",
"author": "Jagankumar <jagan.kumar@egov.org.in>",
Expand Down
Loading

0 comments on commit bcb3a79

Please sign in to comment.