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`)}{" "} + * +
+