@@ -240,26 +223,27 @@ const PopInbox = () => {
/>
)}
- {villagesSlected !== 0 &&
-
-
-
-
{`${villagesSlected} ${t("MICROPLAN_VILLAGES_SELECTED")}`}
-
-
-
- {actionsMain?.map((action, index) => (
-
}
+ )}
@@ -268,4 +252,4 @@ const PopInbox = () => {
);
};
-export default PopInbox;
\ No newline at end of file
+export default PopInbox;
diff --git a/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/index.js b/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/index.js
index 4ba5321f37d..2db026acd2a 100644
--- a/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/index.js
+++ b/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/index.js
@@ -19,6 +19,7 @@ import ChooseActivity from "./ChooseActivity";
import Response from "../../components/Response";
import FacilityCatchmentMapping from "./FacilityCatchmentMapping";
+import PlanInbox from "./PlanInbox";
@@ -186,6 +187,7 @@ const App = ({ path, stateCode, userType, tenants, BOUNDARY_HIERARCHY_TYPE, hier
} />
} />
} />
+ } />
} />
} />
} />
From 45944530711707ecc828251edd8ec1b599779318 Mon Sep 17 00:00:00 2001
From: rachana-egov <137176770+rachana-egov@users.noreply.github.com>
Date: Mon, 21 Oct 2024 16:31:52 +0530
Subject: [PATCH 3/3] Added updated api for census and workflow integration
(#1598)
* added updated api for census and workflow integration
* updated approve popup to workflow popup
* updated workflow action
* resolved coderabbit comments
---------
Co-authored-by: rachana-egov
Co-authored-by: Nipun Arora
---
.../example/public/index.html | 2 +-
.../packages/css/package.json | 2 +-
.../css/src/pages/employee/index.scss | 2 +-
.../css/src/pages/employee/villageView.scss | 16 +
.../microplan/src/components/WorkflowPopUp.js | 104 +++
.../components/editVillagePopulationPopUP.js | 56 +-
.../microplan/src/components/securityPopUp.js | 8 +-
.../src/components/timelinePopUpWrapper.js | 753 +-----------------
.../src/pages/employee/viewVillage.js | 15 +-
health/micro-ui/web/public/index.html | 2 +-
10 files changed, 203 insertions(+), 757 deletions(-)
create mode 100644 health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/WorkflowPopUp.js
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 9ed9ac3fe67..53afaafba1c 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
@@ -16,7 +16,7 @@
/> -->
-
+
diff --git a/health/micro-ui/web/micro-ui-internals/packages/css/package.json b/health/micro-ui/web/micro-ui-internals/packages/css/package.json
index 2e0739dde41..da0398fe077 100644
--- a/health/micro-ui/web/micro-ui-internals/packages/css/package.json
+++ b/health/micro-ui/web/micro-ui-internals/packages/css/package.json
@@ -1,6 +1,6 @@
{
"name": "@egovernments/digit-ui-health-css",
- "version": "0.1.3",
+ "version": "0.1.4",
"license": "MIT",
"main": "dist/index.css",
"author": "Jagankumar ",
diff --git a/health/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/index.scss b/health/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/index.scss
index a1a54d026fe..54f1db47c7d 100644
--- a/health/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/index.scss
+++ b/health/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/index.scss
@@ -1146,5 +1146,5 @@ tbody {
}
.digit-action-bar-wrap div {
- width: 100%;
+ width: unset;
}
\ No newline at end of file
diff --git a/health/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/villageView.scss b/health/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/villageView.scss
index b2be946938f..fb71b5622e1 100644
--- a/health/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/villageView.scss
+++ b/health/micro-ui/web/micro-ui-internals/packages/css/src/pages/employee/villageView.scss
@@ -56,4 +56,20 @@
.middle-child {
margin-bottom: 1.5rem;
+}
+
+.comment-label {
+ margin-bottom: .25rem;
+ @extend .typography.label;
+ color: theme(digitv2.lightTheme.text-primary);
+}
+
+.comment-label .required {
+ color: theme(digitv2.alert.error);
+}
+
+.security-question-label {
+ margin-bottom: 1rem;
+ @extend .typography.heading-m;
+ color: theme(digitv2.lightTheme.text-primary);
}
\ No newline at end of file
diff --git a/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/WorkflowPopUp.js b/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/WorkflowPopUp.js
new file mode 100644
index 00000000000..85c1ee88c8c
--- /dev/null
+++ b/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/WorkflowPopUp.js
@@ -0,0 +1,104 @@
+import React, { useState } from "react";
+import { useTranslation } from "react-i18next";
+import { PopUp, Button, TextArea, ErrorMessage } from "@egovernments/digit-ui-components";
+import { useMyContext } from "../utils/context"; // Ensure that the translation function `t` is handled here
+
+
+{/* use this component for comment like this
+ setShowPopup(false)}
+ onSubmit={(comment) => console.log("Submitted comment:", comment)}
+ census={censusData}
+/> */}
+
+const WorkflowPopUp = ({ onClose, onSubmit, heading }) => {
+ const { state } = useMyContext(); // Extract state from context
+ const { t } = useTranslation();
+
+ const [comment, setComment] = useState(""); // Track TextArea input
+ const [error, setError] = useState(false); // Track error state
+
+ // Handle TextArea input change
+ const handleTextAreaChange = (e) => {
+ setComment(e.target.value);
+ if (e.target.value.trim()) {
+ setError(false); // Reset error when input is not empty
+ }
+ };
+
+ // Handle keypress "Enter" to submit the form
+ const handleKeyPress = (e) => {
+ if (e.key === "Enter") {
+ handleSave();
+ }
+ };
+
+ // Handle Save
+ const handleSave = () => {
+ if (!comment.trim()) {
+ setError(true); // Show error if TextArea is empty
+ return; // Do not proceed further
+ }
+
+ // Send the comment to the parent component or handle it here
+ if (onSubmit) {
+ onSubmit(comment); // Pass the comment via onSubmit prop
+ }
+
+ // Close the popup after submitting the comment
+ onClose();
+ };
+
+ return (
+
+
+ {t(`HCM_MICROPLAN_ADD_COMMENT_LABEL`)}{" "}
+ *
+
+
+ {error && (
+
+ )}
+
+ ]}
+ onOverlayClick={onClose}
+ footerChildren={[
+
,
+
,
+ ]}
+ />
+ );
+};
+
+export default WorkflowPopUp;
diff --git a/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/editVillagePopulationPopUP.js b/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/editVillagePopulationPopUP.js
index 5e1760ada31..84ab8fb4d90 100644
--- a/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/editVillagePopulationPopUP.js
+++ b/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/components/editVillagePopulationPopUP.js
@@ -4,6 +4,8 @@ import { PopUp, Button, Card, Divider, TextInput } from '@egovernments/digit-ui-
const EditVillagePopulationPopUp = ({ onClose, census }) => {
const { t } = useTranslation();
+ const userInfo = Digit.UserService.getUser();
+ const userRoles = userInfo?.info?.roles?.map((roleData) => roleData?.code);
// State to manage confirmed population and target population
const [confirmedTotalPopulation, setConfirmedTotalPopulation] = useState("");
@@ -17,24 +19,50 @@ const EditVillagePopulationPopUp = ({ onClose, census }) => {
}
}, [census]);
- const handleSave = () => {
- // Prepare the updated census data with new population values
- const updatedCensus = {
- ...census,
- additionalDetails: {
- ...census.additionalDetails,
- confirmedTotalPopulation,
- confirmedTargetPopulation,
- },
- };
- // Log the updated data or trigger a save function with it
- console.log("Updated Census Data: ", updatedCensus);
+ // Define the mutation configuration
+ const mutation = Digit.Hooks.useCustomAPIMutationHook({
+ url: "/census-service/_update", // Replace with the appropriate API endpoint
+ });
- // Close the popup after saving
- onClose();
+ const handleSave = async () => {
+ // Determine workflow action based on user roles
+ let workflowAction = ""; // Default action
+
+ // Check user roles and set workflow action accordingly
+ if (userRoles && userRoles.includes('POPULATION_DATA_APPROVER')) {
+ workflowAction = "EDIT_AND_SEND_FOR_APPROVAL";
+ } else if (userRoles && userRoles.includes('ROOT_POPULATION_DATA_APPROVER')) {
+ workflowAction = "EDIT_AND_VALIDATE";
+ }
+
+ await mutation.mutate(
+ {
+ body: {
+ Census: {
+ ...census,
+ additionalDetails: {
+ ...census.additionalDetails,
+ confirmedTotalPopulation,
+ confirmedTargetPopulation,
+ },
+ workflow: {
+ action: workflowAction,
+ },
+ },
+ }
+
+ }
+ );
};
+ // Close the popup when the mutation is successful
+ useEffect(() => {
+ if (!mutation.isLoading && mutation.data) {
+ onClose(); // Close popup after saving
+ }
+ }, [mutation.data, mutation.isLoading, onClose]);
+
return (
{
key={q.id}
style={{
marginBottom: index !== questions.length - 1 ? "1rem" : "0", // No margin after the last question
- marginTop: "1rem"
+ //marginTop: "1rem"
}}
>
-
+
+ {q.question}
+
{/* Add margin for space between label and options */}
{
const { state } = useMyContext();
const { t } = useTranslation();
- // Assume tenantId and boundaryCode are derived from the context or another prop
- const tenantId = state?.tenantId;
- const boundaryCode = state?.boundaryCode;
- const { isLoading: isUserLoading, data: workflowData, revalidate } = Digit.Hooks.useCustomAPIHook({
+ const tenantId = Digit.ULBService.getCurrentTenantId();
+
+ const { isLoading, data: workflowData, revalidate } = Digit.Hooks.useCustomAPIHook({
url: "/egov-workflow-v2/egov-wf/process/_search",
params: {
tenantId: tenantId,
history: true,
- businessIds: [businessId],
+ businessIds: businessId,
+ },
+ config: {
+ enabled: true,
},
}
);
- const hardCodeData = {
- "ResponseInfo": null,
- "ProcessInstances": [
- {
- "id": "5d07020a-b70a-4c01-b2b5-f2886b0fae7f",
- "tenantId": "mz",
- "businessService": "PLAN_ESTIMATION",
- "businessId": "cba20335-ffb0-4fc2-94d8-cfe698c8ddb0",
- "action": "EDIT_AND_SEND_FOR_APPROVAL",
- "moduleName": "plan-service",
- "state": {
- "auditDetails": null,
- "uuid": "e03a38de-fd09-416a-aafc-2a67e6c31ec7",
- "tenantId": "mz",
- "businessServiceId": "14f4fa84-5c50-42b9-afa5-45f155d61013",
- "sla": null,
- "state": "PENDING_FOR_APPROVAL",
- "applicationStatus": "PENDING_FOR_APPROVAL",
- "docUploadRequired": false,
- "isStartState": false,
- "isTerminateState": false,
- "isStateUpdatable": null,
- "actions": [
- {
- "auditDetails": null,
- "uuid": "8f2f27fe-48ee-412c-a1a0-84f72668f6f9",
- "tenantId": "mz",
- "currentState": "e03a38de-fd09-416a-aafc-2a67e6c31ec7",
- "action": "SEND_BACK_FOR_CORRECTION",
- "nextState": "4d5ede81-b988-40b1-9d9e-ad501c4981b8",
- "roles": [
- "PLAN_ESTIMATION_APPROVER",
- "ROOT_PLAN_ESTIMATION_APPROVER"
- ],
- "active": null
- },
- {
- "auditDetails": null,
- "uuid": "d6c47c25-35a9-4c54-9b9a-090422c24fa6",
- "tenantId": "mz",
- "currentState": "e03a38de-fd09-416a-aafc-2a67e6c31ec7",
- "action": "ROOT_APPROVE",
- "nextState": "1b94c7e8-c7d1-4419-be00-0faf7872e8af",
- "roles": [
- "ROOT_PLAN_ESTIMATION_APPROVER"
- ],
- "active": null
- },
- {
- "auditDetails": null,
- "uuid": "f226cddf-cd73-4bd3-b726-3f1b9899b32a",
- "tenantId": "mz",
- "currentState": "e03a38de-fd09-416a-aafc-2a67e6c31ec7",
- "action": "APPROVE",
- "nextState": "4d5ede81-b988-40b1-9d9e-ad501c4981b8",
- "roles": [
- "PLAN_ESTIMATION_APPROVER"
- ],
- "active": null
- }
- ]
- },
- "comment": "EDIT_AND_SEND_FOR_APPROVAL",
- "documents": null,
- "assigner": {
- "id": 10065,
- "userName": "ESTIMATION_APPROVER1",
- "name": "Root resource estimation approver",
- "type": "EMPLOYEE",
- "mobileNumber": "9898989301",
- "emailId": "rohit@gmail.com",
- "roles": [
- {
- "id": null,
- "name": "Super User",
- "code": "SUPERUSER",
- "tenantId": "mz"
- },
- {
- "id": null,
- "name": "plan estimation approver",
- "code": "PLAN_ESTIMATION_APPROVER",
- "tenantId": "mz"
- }
- ],
- "tenantId": "mz",
- "uuid": "47a08ceb-462a-44d2-a378-2311b948b8d5"
- },
- "assignes": [
- {
- "id": 10064,
- "userName": "ROOT_ESTIMATION_APPROVER2",
- "name": "Root resource estimation approver",
- "type": "EMPLOYEE",
- "mobileNumber": "9898989300",
- "emailId": "rohit@gmail.com",
- "roles": [
- {
- "id": null,
- "name": "Super User",
- "code": "SUPERUSER",
- "tenantId": "mz"
- },
- {
- "id": null,
- "name": "Root plan estimation approver",
- "code": "ROOT_PLAN_ESTIMATION_APPROVER",
- "tenantId": "mz"
- }
- ],
- "tenantId": "mz",
- "uuid": "b3340d94-239e-45e7-a1bc-2a8f7582091c"
- }
- ],
- "nextActions": [],
- "stateSla": null,
- "businesssServiceSla": 334756941,
- "previousStatus": null,
- "entity": null,
- "auditDetails": {
- "createdBy": "47a08ceb-462a-44d2-a378-2311b948b8d5",
- "lastModifiedBy": "47a08ceb-462a-44d2-a378-2311b948b8d5",
- "createdTime": 1729155386404,
- "lastModifiedTime": 1729155386404
- },
- "rating": 0,
- "escalated": false
- },
- {
- "id": "44de7fd4-f5d7-4a44-a12b-25108b77c42e",
- "tenantId": "mz",
- "businessService": "PLAN_ESTIMATION",
- "businessId": "cba20335-ffb0-4fc2-94d8-cfe698c8ddb0",
- "action": "SEND_BACK_FOR_CORRECTION",
- "moduleName": "plan-service",
- "state": {
- "auditDetails": null,
- "uuid": "4d5ede81-b988-40b1-9d9e-ad501c4981b8",
- "tenantId": "mz",
- "businessServiceId": "14f4fa84-5c50-42b9-afa5-45f155d61013",
- "sla": null,
- "state": "PENDING_FOR_VALIDATION",
- "applicationStatus": "PENDING_FOR_VALIDATION",
- "docUploadRequired": false,
- "isStartState": false,
- "isTerminateState": false,
- "isStateUpdatable": null,
- "actions": [
- {
- "auditDetails": null,
- "uuid": "45bd9163-de55-4158-bdec-0e077aecc621",
- "tenantId": "mz",
- "currentState": "4d5ede81-b988-40b1-9d9e-ad501c4981b8",
- "action": "EDIT_AND_SEND_FOR_APPROVAL",
- "nextState": "e03a38de-fd09-416a-aafc-2a67e6c31ec7",
- "roles": [
- "PLAN_ESTIMATION_APPROVER"
- ],
- "active": null
- },
- {
- "auditDetails": null,
- "uuid": "082b5870-d3e3-4aa3-ab17-34ba4935acde",
- "tenantId": "mz",
- "currentState": "4d5ede81-b988-40b1-9d9e-ad501c4981b8",
- "action": "EDIT_AND_VALIDATE",
- "nextState": "1b94c7e8-c7d1-4419-be00-0faf7872e8af",
- "roles": [
- "ROOT_PLAN_ESTIMATION_APPROVER"
- ],
- "active": null
- },
- {
- "auditDetails": null,
- "uuid": "8ee5c123-73cc-4f97-8654-5031fc2c1b20",
- "tenantId": "mz",
- "currentState": "4d5ede81-b988-40b1-9d9e-ad501c4981b8",
- "action": "VALIDATE",
- "nextState": "1b94c7e8-c7d1-4419-be00-0faf7872e8af",
- "roles": [
- "PLAN_ESTIMATION_APPROVER",
- "ROOT_PLAN_ESTIMATION_APPROVER"
- ],
- "active": null
- }
- ]
- },
- "comment": "SEND_BACK_FOR_CORRECTION",
- "documents": null,
- "assigner": {
- "id": 10065,
- "userName": "ESTIMATION_APPROVER1",
- "name": "Root resource estimation approver",
- "type": "EMPLOYEE",
- "mobileNumber": "9898989301",
- "emailId": "rohit@gmail.com",
- "roles": [
- {
- "id": null,
- "name": "Super User",
- "code": "SUPERUSER",
- "tenantId": "mz"
- },
- {
- "id": null,
- "name": "plan estimation approver",
- "code": "PLAN_ESTIMATION_APPROVER",
- "tenantId": "mz"
- }
- ],
- "tenantId": "mz",
- "uuid": "47a08ceb-462a-44d2-a378-2311b948b8d5"
- },
- "assignes": [
- {
- "id": 10065,
- "userName": "ESTIMATION_APPROVER1",
- "name": "Root resource estimation approver",
- "type": "EMPLOYEE",
- "mobileNumber": "9898989301",
- "emailId": "rohit@gmail.com",
- "roles": [
- {
- "id": null,
- "name": "Super User",
- "code": "SUPERUSER",
- "tenantId": "mz"
- },
- {
- "id": null,
- "name": "plan estimation approver",
- "code": "PLAN_ESTIMATION_APPROVER",
- "tenantId": "mz"
- }
- ],
- "tenantId": "mz",
- "uuid": "47a08ceb-462a-44d2-a378-2311b948b8d5"
- }
- ],
- "nextActions": [],
- "stateSla": null,
- "businesssServiceSla": 334756941,
- "previousStatus": null,
- "entity": null,
- "auditDetails": {
- "createdBy": "47a08ceb-462a-44d2-a378-2311b948b8d5",
- "lastModifiedBy": "47a08ceb-462a-44d2-a378-2311b948b8d5",
- "createdTime": 1729154693183,
- "lastModifiedTime": 1729154693183
- },
- "rating": 0,
- "escalated": false
- },
- {
- "id": "1e0b23f7-7058-49b4-aabd-caa8feaea0a1",
- "tenantId": "mz",
- "businessService": "PLAN_ESTIMATION",
- "businessId": "cba20335-ffb0-4fc2-94d8-cfe698c8ddb0",
- "action": "VALIDATE",
- "moduleName": "plan-service",
- "state": {
- "auditDetails": null,
- "uuid": "1b94c7e8-c7d1-4419-be00-0faf7872e8af",
- "tenantId": "mz",
- "businessServiceId": "14f4fa84-5c50-42b9-afa5-45f155d61013",
- "sla": null,
- "state": "VALIDATED",
- "applicationStatus": "VALIDATED",
- "docUploadRequired": false,
- "isStartState": false,
- "isTerminateState": false,
- "isStateUpdatable": null,
- "actions": [
- {
- "auditDetails": null,
- "uuid": "35257967-ed3a-4cb9-9bbb-1fcecbf5c775",
- "tenantId": "mz",
- "currentState": "1b94c7e8-c7d1-4419-be00-0faf7872e8af",
- "action": "SEND_BACK_FOR_CORRECTION",
- "nextState": "4d5ede81-b988-40b1-9d9e-ad501c4981b8",
- "roles": [
- "PLAN_ESTIMATION_APPROVER",
- "ROOT_PLAN_ESTIMATION_APPROVER"
- ],
- "active": null
- }
- ]
- },
- "comment": "VALIDATE",
- "documents": null,
- "assigner": {
- "id": 10064,
- "userName": "ROOT_ESTIMATION_APPROVER2",
- "name": "Root resource estimation approver",
- "type": "EMPLOYEE",
- "mobileNumber": "9898989300",
- "emailId": "rohit@gmail.com",
- "roles": [
- {
- "id": null,
- "name": "Super User",
- "code": "SUPERUSER",
- "tenantId": "mz"
- },
- {
- "id": null,
- "name": "Root plan estimation approver",
- "code": "ROOT_PLAN_ESTIMATION_APPROVER",
- "tenantId": "mz"
- }
- ],
- "tenantId": "mz",
- "uuid": "b3340d94-239e-45e7-a1bc-2a8f7582091c"
- },
- "assignes": null,
- "nextActions": [],
- "stateSla": null,
- "businesssServiceSla": 334756941,
- "previousStatus": null,
- "entity": null,
- "auditDetails": {
- "createdBy": "b3340d94-239e-45e7-a1bc-2a8f7582091c",
- "lastModifiedBy": "b3340d94-239e-45e7-a1bc-2a8f7582091c",
- "createdTime": 1729154444333,
- "lastModifiedTime": 1729154444333
- },
- "rating": 0,
- "escalated": false
- },
- {
- "id": "98d6b21e-39c5-46b1-901b-5ba3b15a0e35",
- "tenantId": "mz",
- "businessService": "PLAN_ESTIMATION",
- "businessId": "cba20335-ffb0-4fc2-94d8-cfe698c8ddb0",
- "action": "APPROVE",
- "moduleName": "plan-service",
- "state": {
- "auditDetails": null,
- "uuid": "4d5ede81-b988-40b1-9d9e-ad501c4981b8",
- "tenantId": "mz",
- "businessServiceId": "14f4fa84-5c50-42b9-afa5-45f155d61013",
- "sla": null,
- "state": "PENDING_FOR_VALIDATION",
- "applicationStatus": "PENDING_FOR_VALIDATION",
- "docUploadRequired": false,
- "isStartState": false,
- "isTerminateState": false,
- "isStateUpdatable": null,
- "actions": [
- {
- "auditDetails": null,
- "uuid": "082b5870-d3e3-4aa3-ab17-34ba4935acde",
- "tenantId": "mz",
- "currentState": "4d5ede81-b988-40b1-9d9e-ad501c4981b8",
- "action": "EDIT_AND_VALIDATE",
- "nextState": "1b94c7e8-c7d1-4419-be00-0faf7872e8af",
- "roles": [
- "ROOT_PLAN_ESTIMATION_APPROVER"
- ],
- "active": null
- },
- {
- "auditDetails": null,
- "uuid": "8ee5c123-73cc-4f97-8654-5031fc2c1b20",
- "tenantId": "mz",
- "currentState": "4d5ede81-b988-40b1-9d9e-ad501c4981b8",
- "action": "VALIDATE",
- "nextState": "1b94c7e8-c7d1-4419-be00-0faf7872e8af",
- "roles": [
- "PLAN_ESTIMATION_APPROVER",
- "ROOT_PLAN_ESTIMATION_APPROVER"
- ],
- "active": null
- },
- {
- "auditDetails": null,
- "uuid": "45bd9163-de55-4158-bdec-0e077aecc621",
- "tenantId": "mz",
- "currentState": "4d5ede81-b988-40b1-9d9e-ad501c4981b8",
- "action": "EDIT_AND_SEND_FOR_APPROVAL",
- "nextState": "e03a38de-fd09-416a-aafc-2a67e6c31ec7",
- "roles": [
- "PLAN_ESTIMATION_APPROVER"
- ],
- "active": null
- }
- ]
- },
- "comment": "APPROVE",
- "documents": null,
- "assigner": {
- "id": 10065,
- "userName": "ESTIMATION_APPROVER1",
- "name": "Root resource estimation approver",
- "type": "EMPLOYEE",
- "mobileNumber": "9898989301",
- "emailId": "rohit@gmail.com",
- "roles": [
- {
- "id": null,
- "name": "Super User",
- "code": "SUPERUSER",
- "tenantId": "mz"
- },
- {
- "id": null,
- "name": "plan estimation approver",
- "code": "PLAN_ESTIMATION_APPROVER",
- "tenantId": "mz"
- }
- ],
- "tenantId": "mz",
- "uuid": "47a08ceb-462a-44d2-a378-2311b948b8d5"
- },
- "assignes": [
- {
- "id": 10064,
- "userName": "ROOT_ESTIMATION_APPROVER2",
- "name": "Root resource estimation approver",
- "type": "EMPLOYEE",
- "mobileNumber": "9898989300",
- "emailId": "rohit@gmail.com",
- "roles": [
- {
- "id": null,
- "name": "Super User",
- "code": "SUPERUSER",
- "tenantId": "mz"
- },
- {
- "id": null,
- "name": "Root plan estimation approver",
- "code": "ROOT_PLAN_ESTIMATION_APPROVER",
- "tenantId": "mz"
- }
- ],
- "tenantId": "mz",
- "uuid": "b3340d94-239e-45e7-a1bc-2a8f7582091c"
- }
- ],
- "nextActions": [],
- "stateSla": null,
- "businesssServiceSla": 334756941,
- "previousStatus": null,
- "entity": null,
- "auditDetails": {
- "createdBy": "47a08ceb-462a-44d2-a378-2311b948b8d5",
- "lastModifiedBy": "47a08ceb-462a-44d2-a378-2311b948b8d5",
- "createdTime": 1729154203789,
- "lastModifiedTime": 1729154203789
- },
- "rating": 0,
- "escalated": false
- },
- {
- "id": "a0fb045a-bbc2-48c2-be43-a5403912892f",
- "tenantId": "mz",
- "businessService": "PLAN_ESTIMATION",
- "businessId": "cba20335-ffb0-4fc2-94d8-cfe698c8ddb0",
- "action": "EDIT_AND_SEND_FOR_APPROVAL",
- "moduleName": "plan-service",
- "state": {
- "auditDetails": null,
- "uuid": "e03a38de-fd09-416a-aafc-2a67e6c31ec7",
- "tenantId": "mz",
- "businessServiceId": "14f4fa84-5c50-42b9-afa5-45f155d61013",
- "sla": null,
- "state": "PENDING_FOR_APPROVAL",
- "applicationStatus": "PENDING_FOR_APPROVAL",
- "docUploadRequired": false,
- "isStartState": false,
- "isTerminateState": false,
- "isStateUpdatable": null,
- "actions": [
- {
- "auditDetails": null,
- "uuid": "f226cddf-cd73-4bd3-b726-3f1b9899b32a",
- "tenantId": "mz",
- "currentState": "e03a38de-fd09-416a-aafc-2a67e6c31ec7",
- "action": "APPROVE",
- "nextState": "4d5ede81-b988-40b1-9d9e-ad501c4981b8",
- "roles": [
- "PLAN_ESTIMATION_APPROVER"
- ],
- "active": null
- },
- {
- "auditDetails": null,
- "uuid": "d6c47c25-35a9-4c54-9b9a-090422c24fa6",
- "tenantId": "mz",
- "currentState": "e03a38de-fd09-416a-aafc-2a67e6c31ec7",
- "action": "ROOT_APPROVE",
- "nextState": "1b94c7e8-c7d1-4419-be00-0faf7872e8af",
- "roles": [
- "ROOT_PLAN_ESTIMATION_APPROVER"
- ],
- "active": null
- },
- {
- "auditDetails": null,
- "uuid": "8f2f27fe-48ee-412c-a1a0-84f72668f6f9",
- "tenantId": "mz",
- "currentState": "e03a38de-fd09-416a-aafc-2a67e6c31ec7",
- "action": "SEND_BACK_FOR_CORRECTION",
- "nextState": "4d5ede81-b988-40b1-9d9e-ad501c4981b8",
- "roles": [
- "PLAN_ESTIMATION_APPROVER",
- "ROOT_PLAN_ESTIMATION_APPROVER"
- ],
- "active": null
- }
- ]
- },
- "comment": "EDIT_AND_SEND_FOR_APPROVAL",
- "documents": null,
- "assigner": {
- "id": 10066,
- "userName": "ESTIMATION_APPROVER2",
- "name": "Root resource estimation approver",
- "type": "EMPLOYEE",
- "mobileNumber": "9898989302",
- "emailId": "rohit@gmail.com",
- "roles": [
- {
- "id": null,
- "name": "Super User",
- "code": "SUPERUSER",
- "tenantId": "mz"
- },
- {
- "id": null,
- "name": "plan estimation approver",
- "code": "PLAN_ESTIMATION_APPROVER",
- "tenantId": "mz"
- }
- ],
- "tenantId": "mz",
- "uuid": "48eeee5d-2484-4b3e-a22e-e1e7e5f7e857"
- },
- "assignes": [
- {
- "id": 10065,
- "userName": "ESTIMATION_APPROVER1",
- "name": "Root resource estimation approver",
- "type": "EMPLOYEE",
- "mobileNumber": "9898989301",
- "emailId": "rohit@gmail.com",
- "roles": [
- {
- "id": null,
- "name": "Super User",
- "code": "SUPERUSER",
- "tenantId": "mz"
- },
- {
- "id": null,
- "name": "plan estimation approver",
- "code": "PLAN_ESTIMATION_APPROVER",
- "tenantId": "mz"
- }
- ],
- "tenantId": "mz",
- "uuid": "47a08ceb-462a-44d2-a378-2311b948b8d5"
- }
- ],
- "nextActions": [],
- "stateSla": null,
- "businesssServiceSla": 334756941,
- "previousStatus": null,
- "entity": null,
- "auditDetails": {
- "createdBy": "48eeee5d-2484-4b3e-a22e-e1e7e5f7e857",
- "lastModifiedBy": "48eeee5d-2484-4b3e-a22e-e1e7e5f7e857",
- "createdTime": 1729154081826,
- "lastModifiedTime": 1729154081826
- },
- "rating": 0,
- "escalated": false
- },
- {
- "id": "fd3bba78-896b-4de4-80f7-1bd3c0440c5a",
- "tenantId": "mz",
- "businessService": "PLAN_ESTIMATION",
- "businessId": "cba20335-ffb0-4fc2-94d8-cfe698c8ddb0",
- "action": "INITIATE",
- "moduleName": "plan-service",
- "state": {
- "auditDetails": null,
- "uuid": "4d5ede81-b988-40b1-9d9e-ad501c4981b8",
- "tenantId": "mz",
- "businessServiceId": "14f4fa84-5c50-42b9-afa5-45f155d61013",
- "sla": null,
- "state": "PENDING_FOR_VALIDATION",
- "applicationStatus": "PENDING_FOR_VALIDATION",
- "docUploadRequired": false,
- "isStartState": false,
- "isTerminateState": false,
- "isStateUpdatable": null,
- "actions": [
- {
- "auditDetails": null,
- "uuid": "8ee5c123-73cc-4f97-8654-5031fc2c1b20",
- "tenantId": "mz",
- "currentState": "4d5ede81-b988-40b1-9d9e-ad501c4981b8",
- "action": "VALIDATE",
- "nextState": "1b94c7e8-c7d1-4419-be00-0faf7872e8af",
- "roles": [
- "PLAN_ESTIMATION_APPROVER",
- "ROOT_PLAN_ESTIMATION_APPROVER"
- ],
- "active": null
- },
- {
- "auditDetails": null,
- "uuid": "082b5870-d3e3-4aa3-ab17-34ba4935acde",
- "tenantId": "mz",
- "currentState": "4d5ede81-b988-40b1-9d9e-ad501c4981b8",
- "action": "EDIT_AND_VALIDATE",
- "nextState": "1b94c7e8-c7d1-4419-be00-0faf7872e8af",
- "roles": [
- "ROOT_PLAN_ESTIMATION_APPROVER"
- ],
- "active": null
- },
- {
- "auditDetails": null,
- "uuid": "45bd9163-de55-4158-bdec-0e077aecc621",
- "tenantId": "mz",
- "currentState": "4d5ede81-b988-40b1-9d9e-ad501c4981b8",
- "action": "EDIT_AND_SEND_FOR_APPROVAL",
- "nextState": "e03a38de-fd09-416a-aafc-2a67e6c31ec7",
- "roles": [
- "PLAN_ESTIMATION_APPROVER"
- ],
- "active": null
- }
- ]
- },
- "comment": "initiate",
- "documents": null,
- "assigner": {
- "id": 1289,
- "userName": "MICROPLAN_ADMIN1",
- "name": "Microplan Admin Rahul",
- "type": "EMPLOYEE",
- "mobileNumber": "9898989176",
- "emailId": "rahul@gmail.com",
- "roles": [
- {
- "id": null,
- "name": "Super User",
- "code": "SUPERUSER",
- "tenantId": "mz"
- },
- {
- "id": null,
- "name": "Microplan Admin",
- "code": "MICROPLAN_ADMIN",
- "tenantId": "mz"
- }
- ],
- "tenantId": "mz",
- "uuid": "2825cb90-e304-4d75-a300-6430d71e6055"
- },
- "assignes": [
- {
- "id": 10066,
- "userName": "ESTIMATION_APPROVER2",
- "name": "Root resource estimation approver",
- "type": "EMPLOYEE",
- "mobileNumber": "9898989302",
- "emailId": "rohit@gmail.com",
- "roles": [
- {
- "id": null,
- "name": "Super User",
- "code": "SUPERUSER",
- "tenantId": "mz"
- },
- {
- "id": null,
- "name": "plan estimation approver",
- "code": "PLAN_ESTIMATION_APPROVER",
- "tenantId": "mz"
- }
- ],
- "tenantId": "mz",
- "uuid": "48eeee5d-2484-4b3e-a22e-e1e7e5f7e857"
- }
- ],
- "nextActions": [],
- "stateSla": null,
- "businesssServiceSla": 334756941,
- "previousStatus": null,
- "entity": null,
- "auditDetails": {
- "createdBy": "2825cb90-e304-4d75-a300-6430d71e6055",
- "lastModifiedBy": "2825cb90-e304-4d75-a300-6430d71e6055",
- "createdTime": 1729151349626,
- "lastModifiedTime": 1729151349626
- },
- "rating": 0,
- "escalated": false
- }
- ],
- "totalCount": 0
- }
// Manage timeline data
const [timelineSteps, setTimelineSteps] = useState([]);
useEffect(() => {
- if (hardCodeData && hardCodeData.ProcessInstances) {
+ if (workflowData && workflowData.ProcessInstances) {
// Map API response to timeline steps
- const steps = hardCodeData.ProcessInstances.map((instance, index) => ({
+ const steps = workflowData.ProcessInstances.map((instance, index) => ({
label: instance.state.applicationStatus,
variant: 'completed',
subElements: [Digit.Utils.microplanv1.epochToDateTime(instance?.auditDetails?.lastModifiedTime),
@@ -751,7 +43,7 @@ const TimelinePopUpWrapper = ({ onClose, businessId, heading }) => {
}));
setTimelineSteps(steps);
}
- }, []);
+ }, [workflowData]);
return (
{
heading={t(heading)}
onOverlayClick={onClose}
children={[
-
- {timelineSteps.map((step, index) => (
-
- ))}
-
+ isLoading ? :
+
+ {timelineSteps.map((step, index) => (
+
+ ))}
+
]}
/>
);
diff --git a/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/viewVillage.js b/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/viewVillage.js
index 327af48352b..40052c9802c 100644
--- a/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/viewVillage.js
+++ b/health/micro-ui/web/micro-ui-internals/packages/modules/microplan/src/pages/employee/viewVillage.js
@@ -11,9 +11,12 @@ import TimelinePopUpWrapper from '../../components/timelinePopUpWrapper';
const VillageView = () => {
const location = useLocation();
const { t } = useTranslation();
- const { campaignId, microplanId,boundaryCode } = Digit.Hooks.useQueryParams();
+ const { campaignId, microplanId, boundaryCode } = Digit.Hooks.useQueryParams();
const tenantId = Digit.ULBService.getCurrentTenantId();
+ const userInfo = Digit.UserService.getUser();
+ const userRoles = userInfo?.info?.roles?.map((roleData) => roleData?.code);
+
// Custom hook to fetch census data based on microplanId and boundaryCode
const reqCriteriaResource = {
url: `/census-service/_search`,
@@ -79,6 +82,8 @@ const VillageView = () => {
return ;
}
+
+
return (
@@ -232,16 +237,16 @@ const VillageView = () => {
{/* commenting becuase some css is not working inside the component*/}
- {/* ,
+ ,
]}
className=""
maxActionFieldsAllowed={5}
- setactionFieldsToRight={true}
+ setactionFieldsToRight
sortActionFields
style={{}}
- /> */}
+ />
diff --git a/health/micro-ui/web/public/index.html b/health/micro-ui/web/public/index.html
index b5aa3640beb..58094d279f4 100644
--- a/health/micro-ui/web/public/index.html
+++ b/health/micro-ui/web/public/index.html
@@ -11,7 +11,7 @@
-
+
DIGIT HCM