From d5e0f45a44cf77aa2863ea8649af7d0c1b5b844c Mon Sep 17 00:00:00 2001 From: Marta Girdea Date: Tue, 23 Jul 2024 13:22:54 -0400 Subject: [PATCH] [clin-portal] Added lock functionality on visit pages --- .../main/frontend/src/clinician-portal/Visit.jsx | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/modules/patient-portal/src/main/frontend/src/clinician-portal/Visit.jsx b/modules/patient-portal/src/main/frontend/src/clinician-portal/Visit.jsx index 86266ab5b2..12632d3c90 100644 --- a/modules/patient-portal/src/main/frontend/src/clinician-portal/Visit.jsx +++ b/modules/patient-portal/src/main/frontend/src/clinician-portal/Visit.jsx @@ -36,6 +36,7 @@ import { import DoneIcon from '@mui/icons-material/Done'; import WarningIcon from '@mui/icons-material/Warning'; import SurveyIcon from '@mui/icons-material/Assignment'; +import LockIcon from '@mui/icons-material/Lock'; import EventNoteIcon from '@mui/icons-material/EventNote'; import makeStyles from '@mui/styles/makeStyles'; @@ -46,6 +47,7 @@ import { DateTime } from "luxon"; import SurveyLinkButton from "./SurveyLinkButton"; import EditButton from "../dataHomepage/EditButton"; import PrintButton from "../dataHomepage/PrintButton"; +import SubjectLockAction from "../locking/SubjectLockAction"; import ResourceHeader from "../questionnaire/ResourceHeader"; import { getHierarchyAsList, getTextHierarchy } from "../questionnaire/SubjectIdentifier"; import DateQuestionUtilities from "../questionnaire/DateQuestionUtilities"; @@ -256,6 +258,7 @@ function Visit(props) { const surveyIndicator = ; const doneIndicator = ; const incompleteIndicator = ; + const lockedIndicator = ; const isFormComplete = (questionnaireId) => { return surveyData?.[questionnaireId] && !surveyData[questionnaireId].statusFlags?.includes("INCOMPLETE"); @@ -290,6 +293,9 @@ function Visit(props) { action={
+ { !visit?.statusFlags?.includes("LOCKED") && + + } } > history.push(`/content.html${surveyData?.[q]?.["@path"]}`)}> - {isFormComplete(q) ? doneIndicator : (isFormSubmitted(q) ? incompleteIndicator : surveyIndicator)} + + { isFormLocked(q) ? lockedIndicator : ( + isFormComplete(q) ? doneIndicator : ( + isFormSubmitted(q) ? incompleteIndicator : surveyIndicator + ) + ) + } +