diff --git a/health/micro-ui/web/micro-ui-internals/example/public/index.html b/health/micro-ui/web/micro-ui-internals/example/public/index.html
index 4682ab968dd..6fa3dfe4d19 100644
--- a/health/micro-ui/web/micro-ui-internals/example/public/index.html
+++ b/health/micro-ui/web/micro-ui-internals/example/public/index.html
@@ -17,7 +17,7 @@
-
+
diff --git a/health/micro-ui/web/micro-ui-internals/example/src/UICustomizations.js b/health/micro-ui/web/micro-ui-internals/example/src/UICustomizations.js
index 4af07067209..98fc947c1d4 100644
--- a/health/micro-ui/web/micro-ui-internals/example/src/UICustomizations.js
+++ b/health/micro-ui/web/micro-ui-internals/example/src/UICustomizations.js
@@ -2,6 +2,7 @@ import _ from "lodash";
import { useLocation, useHistory,Link,useParams } from "react-router-dom";
import React from "react";
import { Dropdown } from "@egovernments/digit-ui-components";
+import { DeleteIconv2, DownloadIcon, FileIcon, Button, Card, CardSubHeader,EditIcon,ArrowForward } from "@egovernments/digit-ui-react-components";
//create functions here based on module name set in mdms(eg->SearchProjectConfig)
//how to call these -> Digit?.Customizations?.[masterName]?.[moduleName]
// these functions will act as middlewares
@@ -778,21 +779,37 @@ export const UICustomizations = {
data.body.PlanConfigurationSearchCriteria.status = status?.status;
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) => {
if (key === "Actions") {
+ // `/${window.contextPath}/employee/microplan/setup-microplan?key=${9}&preview=${true}&action=${false}`
return (
{ console.log(e, "event") }}
+ select={(e) => {
+ console.log(e, "event"); // e contains the selected option
+ if (e.code === "1") {
+ // Use window.location.href to navigate
+ window.location.href = `/${window.contextPath}/employee/microplan/setup-microplan?key=${1}&preview=${true}&action=${false}µplanId=${row.id}&campaignId=${row.CampaignDetails.id}`;
+ }
+ if (e.code === "2") {
+ // Use window.location.href to navigate
+ window.location.href = `/${window.contextPath}/employee/microplan/setup-microplan?key=${9}&preview=${true}&action=${false}µplanId=${row.id}&campaignId=${row.CampaignDetails.id}`;
+ }
+ }}
optionKey={"name"}
selected={{ code: "1", name: "Actions" }}
- >
+ />
//
$${value}
);
@@ -825,31 +842,124 @@ export const UICustomizations = {
},
},
+ MyMicroplanSearchConfig: {
+ 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;
+ 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) => {
+ if (key === "Actions") {
+ // `/${window.contextPath}/employee/microplan/setup-microplan?key=${9}&preview=${true}&action=${false}`
+ return (
+
+ row.status === "DRAFT" ? (}
+ type="button"
+ className="dm-workbench-download-template-btn dm-hover"
+ onButtonClick={(e) => {
+
+ }}
+ />) : (row.status === "EXECUTION_TO_BE_DONE") ? (
+ }
+ type="button"
+ className="dm-workbench-download-template-btn dm-hover"
+ onButtonClick={(e) => {
+
+ }}
+ />
+ ) : (row.status === "RESOURCE_ESTIMATIONS_APPROVED") ? (
+ }
+ type="button"
+ className="dm-workbench-download-template-btn dm-hover"
+ onButtonClick={(e) => {
+
+ }}
+ />
+ ) : null
+
+
+ );
+ }
+
+ if (key === "Name of the Microplan") {
+ if (value && value !== "NA") {
+
+ return (
+
+ )
+ } else {
+ return (
+
+ )
+ }
+
+ }
+
+ },
+ },
UserManagementConfig: {
customValidationCheck: (data) => {
const { phone } = data;
const mobileRegex = /^[0-9]{10}$/;
-
+
// Allow empty mobile number
if (!phone || phone.trim() === "") {
- return false;
+ return false;
}
-
+
// Check if phone matches the regex
if (!mobileRegex.test(phone)) {
return { error: true, label: "INVALID_MOBILE_NUMBER" }; // Return an error message if invalid
}
-
+
return false;
},
- preProcess: (data, additionalDetails) => {
+
+ preProcess: (data, additionalDetails) => {
const { phone, name } = data?.state?.searchForm || {}
const { sortOrder } = data?.state?.filterForm || {}
let { roleschosen } = data?.state?.filterForm || []
-
+
if (!roleschosen) {
roleschosen = {}
}
@@ -865,19 +975,17 @@ export const UICustomizations = {
if (roleschosen) {
rolesString = Object.keys(roleschosen).filter(role => roleschosen[role] === true).join(',');
}
-
-
+
data.params.names = name;
data.params.phone = phone;
-
+
data.params.roles = rolesString;
data.params.tenantId = Digit.ULBService.getCurrentTenantId();
cleanObject(data.params);
delete data.params.roleschosen;
delete data.params.name;
-
return data
},
@@ -885,14 +993,13 @@ export const UICustomizations = {
rolesForFilter: (props) => {
const userInfo = Digit.UserService.getUser();
const tenantId = Digit.ULBService.getCurrentTenantId();
-
return {
params: {},
url: '/mdms-v2/v2/_search', //mdms fetch from
body: {
MdmsCriteria: {
- tenantId: Digit.ULBService.getCurrentTenantId(),
+ tenantId: Digit.ULBService.getCurrentTenantId(),
filters: {},
schemaCode: "hcm-microplanning.rolesForMicroplan",
limit: 10,
@@ -908,11 +1015,14 @@ export const UICustomizations = {
{
roleCode: item.data.roleCode,
i18nKey: Digit.Utils.locale.getTransformedLocale(`MP_ROLE_${item.data.roleCode}`)
+ // orderNumber: item.data.orderNumber
+
+ // roleCode:{labelKey:item.data.roleCode}
}
)
})
-
+
return roles
},
},
@@ -920,34 +1030,26 @@ export const UICustomizations = {
}
},
-
-
-
additionalCustomizations: (row, key, column, value, t, searchResult) => {
-
-
if (key === "Role") {
-
- if (value && value !== "NA") {
+ return (
+
+ {value.map((item, index) => (
+
+ {t(`MP_ROLE_${item.code}`)}
+ {index < value.length - 1 && ", "}
+
+ ))}
+
+ );
- return (
-
- {value.map((item, index) => (
-
- {Digit.Utils.locale.getTransformedLocale(`MP_ROLE_${item.code}`)}
- {index < value.length - 1 && ", "}
-
- ))}
-
- );
- }
- }else{
- return(
- NA
- )
}
+
+
+
+
},
}
diff --git a/health/micro-ui/web/micro-ui-internals/packages/css/src/index.scss b/health/micro-ui/web/micro-ui-internals/packages/css/src/index.scss
index 38b429723cd..16cfd2308aa 100644
--- a/health/micro-ui/web/micro-ui-internals/packages/css/src/index.scss
+++ b/health/micro-ui/web/micro-ui-internals/packages/css/src/index.scss
@@ -14,5 +14,5 @@
@import "./pages/employee/index.scss";
@import "./pages/employee/campaign.scss";
@import "./pages/employee/formulaConfig.scss";
-
+@import "./pages/employee/microplanInbox.scss";
diff --git a/health/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/microplanInbox.scss b/health/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/microplanInbox.scss
new file mode 100644
index 00000000000..03102cf71bf
--- /dev/null
+++ b/health/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/microplanInbox.scss
@@ -0,0 +1,5 @@
+.pop-inbox-wrapper {
+ display: flex;
+ flex-direction: column;
+ gap: 2rem;
+}
\ No newline at end of file
diff --git a/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/package.json b/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/package.json
index 21500482422..b3880a0cc8a 100644
--- a/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/package.json
+++ b/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/package.json
@@ -19,7 +19,7 @@
},
"dependencies": {
"@egovernments/digit-ui-react-components": "1.8.2-beta.11",
- "@egovernments/digit-ui-components": "0.0.2-beta.41",
+ "@egovernments/digit-ui-components": "0.0.2-beta.47",
"react": "17.0.2",
"react-date-range": "^1.4.0",
"react-dom": "17.0.2",
diff --git a/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/PopInboxTable.js b/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/PopInboxTable.js
new file mode 100644
index 00000000000..a4df7363496
--- /dev/null
+++ b/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/PopInboxTable.js
@@ -0,0 +1,260 @@
+import React, { useState, useEffect,useMemo } from 'react';
+import axios from 'axios';
+import DataTable from 'react-data-table-component';
+import { useTranslation } from 'react-i18next';
+import { Button } from '@egovernments/digit-ui-components';
+
+const censusResponse = {
+ "Census": [
+ {
+ "id": "676be638-6d06-448f-852c-ba0a81fc036d",
+ "tenantId": "mz",
+ "hierarchyType": "MICROPLAN",
+ "boundaryCode": "MICROPLAN_MO_05_07_JEDEPO",
+ "assignee": "xyz",
+ "status": "APPROVED",
+ "type": "people",
+ "totalPopulation": 50000,
+ "populationByDemographics": [
+ {
+ "id": "85298b0b-c618-4881-b33c-5f7c7d208d5e",
+ "demographicVariable": "age",
+ "populationDistribution": {
+ "65+": 7000,
+ "0-14": 10000,
+ "15-24": 8000,
+ "25-64": 25000
+ }
+ }
+ ],
+ "effectiveFrom": 1729065438235,
+ "effectiveTo": 1729065439379,
+ "source": "1e9b2ba5-c2cc-493c-801c-cf358143244c",
+ "additionalDetails": {
+
+ },
+ "auditDetails": {
+ "createdBy": "90345b09-f701-4df5-9d08-0c2f14474e9c",
+ "lastModifiedBy": "90345b09-f701-4df5-9d08-0c2f14474e9c",
+ "createdTime": 1729065438235,
+ "lastModifiedTime": 1729065438235
+ }
+ },
+ {
+ "id": "cfed132f-82c3-4842-a60a-13fc2c9ac0ac",
+ "tenantId": "mz",
+ "hierarchyType": "MICROPLAN",
+ "boundaryCode": "MICROPLAN_MO_05_07_IMOLA",
+ "assignee": "xyz",
+ "status": "APPROVED",
+ "type": "people",
+ "totalPopulation": 50000,
+ "populationByDemographics": [
+ {
+ "id": "188c9033-0ae3-4aa5-8bd0-3d873695457f",
+ "demographicVariable": "age",
+ "populationDistribution": {
+ "65+": 7000,
+ "0-14": 10000,
+ "15-24": 8000,
+ "25-64": 25000
+ }
+ }
+ ],
+ "effectiveFrom": 1729065437311,
+ "effectiveTo": 1729065438235,
+ "source": "1e9b2ba5-c2cc-493c-801c-cf358143244c",
+ "additionalDetails": {},
+ "auditDetails": {
+ "createdBy": "90345b09-f701-4df5-9d08-0c2f14474e9c",
+ "lastModifiedBy": "90345b09-f701-4df5-9d08-0c2f14474e9c",
+ "createdTime": 1729065437311,
+ "lastModifiedTime": 1729065437311
+ }
+ },
+ {
+ "id": "6f621335-ef14-45e4-81c2-b539066dcf46",
+ "tenantId": "mz",
+ "hierarchyType": "MICROPLAN",
+ "boundaryCode": "MICROPLAN_MO_05_07_JEDEPO",
+ "assignee": "xyz",
+ "status": "APPROVED",
+ "type": "people",
+ "totalPopulation": 50000,
+ "populationByDemographics": [
+ {
+ "id": "f1a59f21-710e-43f6-a268-dbe077c362af",
+ "demographicVariable": "age",
+ "populationDistribution": {
+ "65+": 7000,
+ "0-14": 10000,
+ "15-24": 8000,
+ "25-64": 25000
+ }
+ }
+ ],
+ "effectiveFrom": 1729065436109,
+ "effectiveTo": 1729065437311,
+ "source": "1e9b2ba5-c2cc-493c-801c-cf358143244c",
+ "additionalDetails": {},
+ "auditDetails": {
+ "createdBy": "90345b09-f701-4df5-9d08-0c2f14474e9c",
+ "lastModifiedBy": "90345b09-f701-4df5-9d08-0c2f14474e9c",
+ "createdTime": 1729065436109,
+ "lastModifiedTime": 1729065436109
+ }
+ },
+ {
+ "id": "d00180d4-50d8-465c-8444-2db90011a46f",
+ "tenantId": "mz",
+ "hierarchyType": "MICROPLAN",
+ "boundaryCode": "MICROPLAN_MO_05_07_JEDEPO",
+ "assignee": "xyz",
+ "status": "APPROVED",
+ "type": "people",
+ "totalPopulation": 50000,
+ "populationByDemographics": [
+ {
+ "id": "c319e959-a9de-444e-ab92-19556e1d3b94",
+ "demographicVariable": "age",
+ "populationDistribution": {
+ "65+": 7000,
+ "0-14": 10000,
+ "15-24": 8000,
+ "25-64": 25000
+ }
+ }
+ ],
+ "effectiveFrom": 1729065434899,
+ "effectiveTo": 1729065436109,
+ "source": "1e9b2ba5-c2cc-493c-801c-cf358143244c",
+ "additionalDetails": {},
+ "auditDetails": {
+ "createdBy": "90345b09-f701-4df5-9d08-0c2f14474e9c",
+ "lastModifiedBy": "90345b09-f701-4df5-9d08-0c2f14474e9c",
+ "createdTime": 1729065434899,
+ "lastModifiedTime": 1729065434899
+ }
+ }
+ ],
+ "TotalCount": 17,
+ "StatusCount": {
+ "PENDING_FOR_APPROVAL": 4,
+ "PENDING_FOR_VALIDATION": 4,
+ "APPROVED": 6,
+ "VALIDATED": 3
+ }
+}
+
+
+
+
+
+const customStyles = {
+ header: {
+ style: {
+ minHeight: '56px',
+ },
+ },
+ headRow: {
+ style: {
+ borderTopStyle: 'solid',
+ borderTopWidth: '1px',
+ borderTopColor: "#D6D5D4"
+ },
+ },
+ headCells: {
+ style: {
+ '&:not(:last-of-type)': {
+ borderRightStyle: 'solid',
+ borderRightWidth: '1px',
+ borderRightColor: "#D6D5D4",
+ },
+ },
+ },
+ cells: {
+ style: {
+ '&:not(:last-of-type)': {
+ borderRightStyle: 'solid',
+ borderRightWidth: '1px',
+ borderRightColor: "#D6D5D4",
+ },
+ },
+ },
+};
+
+const PopInboxTable = ({...props}) => {
+ const { t } = useTranslation()
+ const [data, setData] = useState(censusResponse?.Census);
+ const [loading, setLoading] = useState(false);
+ const [totalRows, setTotalRows] = useState(0);
+ const [perPage, setPerPage] = useState(10);
+
+
+ const columns = useMemo(() => {
+ return [
+ {
+ name: t(`INBOX_VILLAGE`),
+ cell: (row, index, column, id) =>