From c5b2f66d31d8374bebd0c320f0b22380d6893d18 Mon Sep 17 00:00:00 2001 From: Shivang Mishra Date: Fri, 8 Aug 2025 16:47:07 +0530 Subject: [PATCH] add support for signature concept --- package.json | 1 + src/dataEntryApp/components/FormElement.jsx | 2 + src/dataEntryApp/components/Observations.jsx | 14 ++ .../components/SignatureFormElement.jsx | 181 ++++++++++++++++++ src/formDesigner/common/constants.js | 3 +- 5 files changed, 200 insertions(+), 1 deletion(-) create mode 100644 src/dataEntryApp/components/SignatureFormElement.jsx diff --git a/package.json b/package.json index 320066916..9c99d6d29 100644 --- a/package.json +++ b/package.json @@ -63,6 +63,7 @@ "react-router-dom": "^7.7.0", "react-select": "^5.10.2", "react-show-more-text": "^1.5.2", + "react-signature-canvas": "^1.1.0-alpha.2", "react-simple-code-editor": "^0.14.1", "react-tagsinput": "^3.19.0", "redux": "^4.0.1", diff --git a/src/dataEntryApp/components/FormElement.jsx b/src/dataEntryApp/components/FormElement.jsx index 6edff5237..bfdcb5d8e 100644 --- a/src/dataEntryApp/components/FormElement.jsx +++ b/src/dataEntryApp/components/FormElement.jsx @@ -15,6 +15,7 @@ import LocationFormElement from "./LocationFormElement"; import LandingSubjectFormElement from "./LandingSubjectFormElement"; import QuestionGroupFormElement from "./QuestionGroupFormElement"; import { RepeatableQuestionGroupElement } from "./RepeatableQuestionGroupElement"; +import SignatureFormElement from "./SignatureFormElement"; const StyledContainer = styled("div")(({ isGrid }) => ({ ...(isGrid && { @@ -42,6 +43,7 @@ const elements = { Video: MediaFormElement, Audio: MediaFormElement, File: MediaFormElement, + Signature: SignatureFormElement, Id: TextFormElement, PhoneNumber: PhoneNumberFormElement, Subject: LandingSubjectFormElement, diff --git a/src/dataEntryApp/components/Observations.jsx b/src/dataEntryApp/components/Observations.jsx index addc66a7d..159184270 100644 --- a/src/dataEntryApp/components/Observations.jsx +++ b/src/dataEntryApp/components/Observations.jsx @@ -343,6 +343,19 @@ const Observations = ({ }} /> ), + [Concept.dataType.Signature]: ( + {MediaData.MissingSignedMediaMessage} { + event.preventDefault(); + showMediaOverlay(signedMediaUrl); + }} + /> + ), [Concept.dataType.Video]: (