From 94585fd2cb1576ce88293a7c3ecb7e1fd4bd6c4b Mon Sep 17 00:00:00 2001 From: JavidSumra <112365664+JavidSumra@users.noreply.github.com> Date: Sun, 29 Dec 2024 15:46:31 +0530 Subject: [PATCH 1/2] Integrates useInfiniteQuery for data fetching and resolves Infinite Load issue in Notes. (#9190) * Fix Inifinite Load issue in notes * Add useInfiniteQWuery Hook * Fix useInfiniteQuery hook on thread change * Fix Notes duplication by hashMap * Added hashmap in hook itself * Implemented useInfiniteQuery hook * Remove Comments * Remove Unnecessary Export * Add Requested Changes * simplify generic types * Simplified useInfiniteQuery Implementation * Removed Unnecessary types and state * Remove unnecessary state updates * Mandate duplicate function * Fix Note add issue on side notes * Remove reload state * Fix Message Add * Fix Notes Add Issue * Fix Notes Add Issue * Move over to useInfiniteQuery * Fix Direct Use of inbuilt hook * Fix Deduplication of notes * Add Support of useMutation * Add Changes * Add Util hook for reusability * Fix type of thread * Remove error throw line * remove console * Fix Mutation function * Move towards using callAppi * Add Requested Changes * Add Requested Changes * Fix Test According to changes * Add Requested Changes * Re-run Test Suit * Remove queryParam * Fix Path Name * Fix queryKey * Re-run Test Suit --------- Co-authored-by: rithviknishad --- .../e2e/patient_spec/PatientDoctorNotes.cy.ts | 3 - .../ConsultationDoctorNotes/index.tsx | 73 +++++++------- src/components/Facility/DoctorNote.tsx | 6 +- .../Facility/PatientConsultationNotesList.tsx | 95 ++++++++----------- src/components/Facility/PatientNoteCard.tsx | 48 ++++++---- src/components/Facility/PatientNotesList.tsx | 82 ++++++++-------- .../Facility/PatientNotesSlideover.tsx | 42 ++++---- src/components/Facility/models.tsx | 2 - .../Patient/PatientDetailsTab/Notes.tsx | 51 +++++----- src/components/Patient/PatientNotes.tsx | 41 ++++---- src/components/Patient/Utils.ts | 27 ++++++ 11 files changed, 242 insertions(+), 228 deletions(-) diff --git a/cypress/e2e/patient_spec/PatientDoctorNotes.cy.ts b/cypress/e2e/patient_spec/PatientDoctorNotes.cy.ts index 9420a675963..35e985012d1 100644 --- a/cypress/e2e/patient_spec/PatientDoctorNotes.cy.ts +++ b/cypress/e2e/patient_spec/PatientDoctorNotes.cy.ts @@ -11,7 +11,6 @@ describe("Patient Discussion notes in the consultation page", () => { const patientNurseReplyNote = "Test nurse reply Notes"; const discussionNotesSubscribeWarning = "Please subscribe to notifications to get live updates on discussion notes."; - const discussionNotesSuccessMessage = "Note added successfully"; before(() => { loginPage.loginByRole("districtAdmin"); @@ -34,7 +33,6 @@ describe("Patient Discussion notes in the consultation page", () => { patientDoctorNotes.selectNurseDiscussion(); patientDoctorNotes.addDiscussionNotes(patientNurseNote); patientDoctorNotes.postDiscussionNotes(); - cy.verifyNotification(discussionNotesSuccessMessage); // verify the auto-switching of tab to nurse notes if the user is a nurse patientDoctorNotes.signout(); loginPage.loginManuallyAsNurse(); @@ -49,7 +47,6 @@ describe("Patient Discussion notes in the consultation page", () => { // Post a reply comment to the message patientDoctorNotes.addDiscussionNotes(patientNurseReplyNote); patientDoctorNotes.postDiscussionNotes(); - cy.verifyNotification(discussionNotesSuccessMessage); patientDoctorNotes.verifyDiscussionMessage(patientNurseReplyNote); }); diff --git a/src/components/Facility/ConsultationDoctorNotes/index.tsx b/src/components/Facility/ConsultationDoctorNotes/index.tsx index c1f3dc43072..00ca268a569 100644 --- a/src/components/Facility/ConsultationDoctorNotes/index.tsx +++ b/src/components/Facility/ConsultationDoctorNotes/index.tsx @@ -1,5 +1,6 @@ +import { useQuery } from "@tanstack/react-query"; import { t } from "i18next"; -import { useState } from "react"; +import { useEffect, useState } from "react"; import useKeyboardShortcut from "use-keyboard-shortcut"; import CareIcon from "@/CAREUI/icons/CareIcon"; @@ -13,6 +14,7 @@ import { PatientNoteStateType, } from "@/components/Facility/models"; import AutoExpandingTextInputFormField from "@/components/Form/FormFields/AutoExpandingTextInputFormField"; +import { useAddPatientNote } from "@/components/Patient/Utils"; import useAuthUser from "@/hooks/useAuthUser"; import { useMessageListener } from "@/hooks/useMessageListener"; @@ -22,8 +24,7 @@ import { PATIENT_NOTES_THREADS } from "@/common/constants"; import { NonReadOnlyUsers } from "@/Utils/AuthorizeFor"; import * as Notification from "@/Utils/Notifications"; import routes from "@/Utils/request/api"; -import request from "@/Utils/request/request"; -import useTanStackQueryInstead from "@/Utils/request/useQuery"; +import query from "@/Utils/request/query"; import { classNames, isAppleDevice, keysOf } from "@/Utils/utils"; interface ConsultationDoctorNotesProps { @@ -54,53 +55,47 @@ const ConsultationDoctorNotes = (props: ConsultationDoctorNotesProps) => { const initialData: PatientNoteStateType = { notes: [], - cPage: 1, - totalPages: 1, facilityId: facilityId, patientId: patientId, }; const [state, setState] = useState(initialData); - const onAddNote = async () => { + const { mutate: addNote } = useAddPatientNote({ + patientId, + thread, + consultationId, + }); + + const onAddNote = () => { if (!/\S+/.test(noteField)) { Notification.Error({ msg: "Note Should Contain At Least 1 Character", }); return; } - - const { res } = await request(routes.addPatientNote, { - pathParams: { - patientId: patientId, - }, - body: { - note: noteField, - thread, - consultation: consultationId, - reply_to: reply_to?.id, - }, + setReplyTo(undefined); + setNoteField(""); + addNote({ + note: noteField, + reply_to: reply_to?.id, + thread, + consultation: consultationId, }); - - if (res?.status === 201) { - Notification.Success({ msg: "Note added successfully" }); - setState({ ...state, cPage: 1 }); - setNoteField(""); - setReload(true); - setReplyTo(undefined); - } }; - useTanStackQueryInstead(routes.getPatient, { - pathParams: { id: patientId }, - onResponse: ({ data }) => { - if (data) { - setPatientActive(data.is_active ?? true); - setPatientName(data.name ?? ""); - setFacilityName(data.facility_object?.name ?? ""); - } - }, + const { data } = useQuery({ + queryKey: ["patient", patientId], + queryFn: query(routes.getPatient, { + pathParams: { patientId }, + }), }); + useEffect(() => { + setPatientActive(data?.is_active ?? true); + setPatientName(data?.name ?? ""); + setFacilityName(data?.facility_object?.name ?? ""); + }, [data]); + useMessageListener((data) => { const message = data?.message; if ( @@ -147,13 +142,21 @@ const ConsultationDoctorNotes = (props: ConsultationDoctorNotesProps) => { ? "border-primary-500 font-bold text-secondary-800" : "border-secondary-300 text-secondary-800", )} - onClick={() => setThread(PATIENT_NOTES_THREADS[current])} + onClick={() => { + if (thread !== PATIENT_NOTES_THREADS[current]) { + setThread(PATIENT_NOTES_THREADS[current]); + setState(initialData); + setReplyTo(undefined); + setNoteField(""); + } + }} > {t(`patient_notes_thread__${current}`)} ))} void; disableEdit?: boolean; setReplyTo?: (reply_to: PatientNotesModel | undefined) => void; + hasMore: boolean; } const DoctorNote = (props: DoctorNoteProps) => { - const { state, handleNext, setReload, disableEdit, setReplyTo } = props; + const { state, handleNext, setReload, disableEdit, setReplyTo, hasMore } = + props; return (
{ {state.notes.length ? ( diff --git a/src/components/Facility/PatientConsultationNotesList.tsx b/src/components/Facility/PatientConsultationNotesList.tsx index 243821b7d6d..adf922ad265 100644 --- a/src/components/Facility/PatientConsultationNotesList.tsx +++ b/src/components/Facility/PatientConsultationNotesList.tsx @@ -1,4 +1,5 @@ -import { Dispatch, SetStateAction, useEffect, useState } from "react"; +import { useInfiniteQuery } from "@tanstack/react-query"; +import { Dispatch, SetStateAction, useEffect } from "react"; import CircularProgress from "@/components/Common/CircularProgress"; import DoctorNote from "@/components/Facility/DoctorNote"; @@ -12,7 +13,7 @@ import useSlug from "@/hooks/useSlug"; import { RESULTS_PER_PAGE_LIMIT } from "@/common/constants"; import routes from "@/Utils/request/api"; -import request from "@/Utils/request/request"; +import { callApi } from "@/Utils/request/query"; interface PatientNotesProps { state: PatientNoteStateType; @@ -24,80 +25,63 @@ interface PatientNotesProps { setReplyTo?: (value: PatientNotesModel | undefined) => void; } -const pageSize = RESULTS_PER_PAGE_LIMIT; - const PatientConsultationNotesList = (props: PatientNotesProps) => { const { state, setState, - reload, setReload, disableEdit, thread, setReplyTo, + reload, } = props; - const consultationId = useSlug("consultation") ?? ""; - - const [isLoading, setIsLoading] = useState(true); - - const fetchNotes = async () => { - setIsLoading(true); - const { data } = await request(routes.getPatientNotes, { - pathParams: { - patientId: props.state.patientId || "", - }, - query: { - consultation: consultationId, - thread, - offset: (state.cPage - 1) * RESULTS_PER_PAGE_LIMIT, - }, - }); + const consultationId = useSlug("consultation") ?? ""; - if (data) { - if (state.cPage === 1) { - setState((prevState) => ({ - ...prevState, - notes: data.results, - totalPages: Math.ceil(data.count / pageSize), - })); - } else { - setState((prevState) => ({ - ...prevState, - notes: [...prevState.notes, ...data.results], - totalPages: Math.ceil(data.count / pageSize), - })); + const { data, isLoading, fetchNextPage, hasNextPage } = useInfiniteQuery({ + queryKey: ["notes", state.patientId, thread, consultationId], + queryFn: async ({ pageParam = 0, signal }) => { + const response = await callApi(routes.getPatientNotes, { + pathParams: { patientId: state.patientId! }, + queryParams: { + thread, + offset: pageParam, + consultation: consultationId, + }, + signal, + }); + return { + results: response?.results ?? [], + nextPage: pageParam + RESULTS_PER_PAGE_LIMIT, + totalResults: response?.count ?? 0, + }; + }, + getNextPageParam: (lastPage, allPages) => { + const currentResults = allPages.flatMap((page) => page.results).length; + if (currentResults < lastPage.totalResults) { + return lastPage.nextPage; } - } - setIsLoading(false); - setReload?.(false); - }; + return undefined; + }, + initialPageParam: 0, + }); useEffect(() => { - if (reload) { - fetchNotes(); - } - }, [reload]); + if (data?.pages) { + const allNotes = data.pages.flatMap((page) => page.results); - useEffect(() => { - fetchNotes(); - }, [thread]); + const notesMap = new Map(allNotes.map((note) => [note.id, note])); - useEffect(() => { - setReload?.(true); - }, []); + const deduplicatedNotes = Array.from(notesMap.values()); - const handleNext = () => { - if (state.cPage < state.totalPages) { setState((prevState) => ({ ...prevState, - cPage: prevState.cPage + 1, + notes: deduplicatedNotes, })); - setReload?.(true); } - }; + }, [data]); - if (isLoading) { + if (isLoading || reload) { return (
@@ -108,10 +92,11 @@ const PatientConsultationNotesList = (props: PatientNotesProps) => { return ( ); }; diff --git a/src/components/Facility/PatientNoteCard.tsx b/src/components/Facility/PatientNoteCard.tsx index 7896cbada4d..4d5a9ffa89c 100644 --- a/src/components/Facility/PatientNoteCard.tsx +++ b/src/components/Facility/PatientNoteCard.tsx @@ -1,6 +1,7 @@ +import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query"; import dayjs from "dayjs"; import { t } from "i18next"; -import { useState } from "react"; +import { useEffect, useState } from "react"; import CareIcon from "@/CAREUI/icons/CareIcon"; @@ -19,7 +20,8 @@ import { USER_TYPES_MAP } from "@/common/constants"; import { Error, Success } from "@/Utils/Notifications"; import routes from "@/Utils/request/api"; -import request from "@/Utils/request/request"; +import mutate from "@/Utils/request/mutate"; +import query from "@/Utils/request/query"; import { classNames, formatDateTime, @@ -29,7 +31,6 @@ import { const PatientNoteCard = ({ note, - setReload, disableEdit, setReplyTo, }: { @@ -44,15 +45,25 @@ const PatientNoteCard = ({ const [showEditHistory, setShowEditHistory] = useState(false); const [editHistory, setEditHistory] = useState([]); const authUser = useAuthUser(); + const queryClient = useQueryClient(); - const fetchEditHistory = async () => { - const { res, data } = await request(routes.getPatientNoteEditHistory, { + const { data, refetch } = useQuery({ + queryKey: [patientId, note.id], + queryFn: query(routes.getPatientNoteEditHistory, { pathParams: { patientId, noteId: note.id }, - }); - if (res?.status === 200) { - setEditHistory(data?.results ?? []); - } - }; + }), + }); + + const { mutate: updateNote } = useMutation({ + mutationFn: mutate(routes.updatePatientNote, { + pathParams: { patientId, noteId: note.id }, + }), + onSuccess: () => { + Success({ msg: "Note updated successfully" }); + queryClient.invalidateQueries({ queryKey: ["notes", patientId] }); + setIsEditing(false); + }, + }); const onUpdateNote = async () => { if (noteField === note.note) { @@ -69,20 +80,15 @@ const PatientNoteCard = ({ return; } - const { res } = await request(routes.updatePatientNote, { - pathParams: { patientId, noteId: note.id }, - body: payload, - }); - if (res?.status === 200) { - Success({ msg: "Note updated successfully" }); - setIsEditing(false); - setReload(true); - } + updateNote(payload); }; + useEffect(() => { + setEditHistory(data?.results ?? []); + }, [data]); + return ( <> - {" "}
{ - fetchEditHistory(); + refetch(); setShowEditHistory(true); }} > diff --git a/src/components/Facility/PatientNotesList.tsx b/src/components/Facility/PatientNotesList.tsx index 8db68395744..d4de60512d1 100644 --- a/src/components/Facility/PatientNotesList.tsx +++ b/src/components/Facility/PatientNotesList.tsx @@ -1,4 +1,5 @@ -import { useEffect, useState } from "react"; +import { useInfiniteQuery } from "@tanstack/react-query"; +import { useEffect } from "react"; import CircularProgress from "@/components/Common/CircularProgress"; import DoctorNote from "@/components/Facility/DoctorNote"; @@ -10,7 +11,7 @@ import { import { RESULTS_PER_PAGE_LIMIT } from "@/common/constants"; import routes from "@/Utils/request/api"; -import request from "@/Utils/request/request"; +import { callApi } from "@/Utils/request/query"; interface PatientNotesProps { state: PatientNoteStateType; @@ -23,57 +24,51 @@ interface PatientNotesProps { setReplyTo?: (reply_to: PatientNotesModel | undefined) => void; } -const pageSize = RESULTS_PER_PAGE_LIMIT; - const PatientNotesList = (props: PatientNotesProps) => { - const { state, setState, reload, setReload, thread, setReplyTo } = props; - - const [isLoading, setIsLoading] = useState(true); + const { state, setState, thread, setReplyTo, setReload, patientId, reload } = + props; - const fetchNotes = async () => { - setIsLoading(true); - const { data }: any = await request(routes.getPatientNotes, { - pathParams: { patientId: props.patientId }, - query: { - offset: (state.cPage - 1) * RESULTS_PER_PAGE_LIMIT, - thread, - }, - }); + const { data, isLoading, fetchNextPage, hasNextPage } = useInfiniteQuery({ + queryKey: ["notes", patientId, thread], + queryFn: async ({ pageParam = 0, signal }) => { + const response = await callApi(routes.getPatientNotes, { + pathParams: { patientId }, + queryParams: { thread, offset: pageParam }, + signal, + }); - if (state.cPage === 1) { - setState((prevState: any) => ({ - ...prevState, - notes: data.results, - totalPages: Math.ceil(data.count / pageSize), - })); - } else { - setState((prevState: any) => ({ - ...prevState, - notes: [...prevState.notes, ...data.results], - totalPages: Math.ceil(data.count / pageSize), - })); - } - setIsLoading(false); - setReload(false); - }; + return { + results: response?.results ?? [], + nextPage: pageParam + RESULTS_PER_PAGE_LIMIT, + totalResults: response?.count ?? 0, + }; + }, + getNextPageParam: (lastPage, allPages) => { + const currentResults = allPages.flatMap((page) => page.results).length; + if (currentResults < lastPage.totalResults) { + return lastPage.nextPage; + } + return undefined; + }, + initialPageParam: 0, + }); useEffect(() => { - if (reload || thread) { - fetchNotes(); - } - }, [reload, thread]); + if (data?.pages) { + const allNotes = data.pages.flatMap((page) => page.results); + + const notesMap = new Map(allNotes.map((note) => [note.id, note])); + + const deduplicatedNotes = Array.from(notesMap.values()); - const handleNext = () => { - if (state.cPage < state.totalPages) { setState((prevState: any) => ({ ...prevState, - cPage: prevState.cPage + 1, + notes: deduplicatedNotes, })); - setReload(true); } - }; + }, [data]); - if (isLoading) { + if (isLoading || reload) { return (
@@ -84,9 +79,10 @@ const PatientNotesList = (props: PatientNotesProps) => { return ( ); }; diff --git a/src/components/Facility/PatientNotesSlideover.tsx b/src/components/Facility/PatientNotesSlideover.tsx index 89d38a5f168..5de161ad228 100644 --- a/src/components/Facility/PatientNotesSlideover.tsx +++ b/src/components/Facility/PatientNotesSlideover.tsx @@ -13,6 +13,7 @@ import { PatientNoteStateType, } from "@/components/Facility/models"; import AutoExpandingTextInputFormField from "@/components/Form/FormFields/AutoExpandingTextInputFormField"; +import { useAddPatientNote } from "@/components/Patient/Utils"; import useAuthUser from "@/hooks/useAuthUser"; import { useMessageListener } from "@/hooks/useMessageListener"; @@ -63,8 +64,6 @@ export default function PatientNotesSlideover(props: PatientNotesProps) { const initialData: PatientNoteStateType = { notes: [], - cPage: 1, - totalPages: 1, patientId: props.patientId, facilityId: props.facilityId, }; @@ -77,30 +76,27 @@ export default function PatientNotesSlideover(props: PatientNotesProps) { const [noteField, setNoteField] = useState( localStorage.getItem(localStorageKey) || "", ); + const { mutate: addNote } = useAddPatientNote({ + patientId, + thread, + consultationId, + }); - const onAddNote = async () => { + const onAddNote = () => { if (!/\S+/.test(noteField)) { Notification.Error({ msg: "Note Should Contain At Least 1 Character", }); return; } - const { res } = await request(routes.addPatientNote, { - pathParams: { patientId: patientId }, - body: { - note: noteField, - consultation: consultationId, - thread, - reply_to: reply_to?.id, - }, + setReplyTo(undefined); + setNoteField(""); + addNote({ + note: noteField, + reply_to: reply_to?.id, + thread, + consultation: consultationId, }); - if (res?.status === 201) { - Notification.Success({ msg: "Note added successfully" }); - setNoteField(""); - setState({ ...state, cPage: 1 }); - setReload(true); - setReplyTo(undefined); - } }; useMessageListener((data) => { @@ -235,13 +231,21 @@ export default function PatientNotesSlideover(props: PatientNotesProps) { ? "border-primary-500 font-medium text-white" : "border-primary-800 text-white/70", )} - onClick={() => setThread(PATIENT_NOTES_THREADS[current])} + onClick={() => { + if (thread !== PATIENT_NOTES_THREADS[current]) { + setThread(PATIENT_NOTES_THREADS[current]); + setState(initialData); + setReplyTo(undefined); + setNoteField(""); + } + }} > {t(`patient_notes_thread__${current}`)} ))}
{ @@ -39,43 +38,29 @@ const PatientNotes = (props: PatientProps) => { const [reply_to, setReplyTo] = useState( undefined, ); - + const { mutate: addNote } = useAddPatientNote({ + patientId, + thread, + }); const initialData: PatientNoteStateType = { notes: [], - cPage: 1, - totalPages: 1, }; const [state, setState] = useState(initialData); - const onAddNote = async () => { + const onAddNote = () => { if (!/\S+/.test(noteField)) { Notification.Error({ msg: "Note Should Contain At Least 1 Character", }); return; } - - try { - const { res } = await request(routes.addPatientNote, { - pathParams: { patientId: patientId }, - body: { - note: noteField, - thread, - reply_to: reply_to?.id, - }, - }); - if (res?.status === 201) { - setNoteField(""); - setReload(!reload); - setState({ ...state, cPage: 1 }); - setReplyTo(undefined); - Notification.Success({ msg: "Note added successfully" }); - } - } catch (error) { - Notification.Error({ - msg: "Failed to add note. Please try again.", - }); - } + addNote({ + note: noteField, + reply_to: reply_to?.id, + thread, + }); + setReplyTo(undefined); + setNoteField(""); }; useMessageListener((data) => { @@ -104,13 +89,21 @@ const PatientNotes = (props: PatientProps) => { ? "border-primary-500 font-bold text-secondary-800" : "border-secondary-300 text-secondary-800", )} - onClick={() => setThread(PATIENT_NOTES_THREADS[current])} + onClick={() => { + if (thread !== PATIENT_NOTES_THREADS[current]) { + setThread(PATIENT_NOTES_THREADS[current]); + setState(initialData); + setReplyTo(undefined); + setNoteField(""); + } + }} > {t(`patient_notes_thread__${current}`)} ))}
{ const initialData: PatientNoteStateType = { notes: [], - cPage: 1, - totalPages: 1, }; const [state, setState] = useState(initialData); - const onAddNote = async () => { + const { mutate: addNote } = useAddPatientNote({ + patientId, + thread, + }); + + const onAddNote = () => { if (!/\S+/.test(noteField)) { Notification.Error({ msg: "Note Should Contain At Least 1 Character", }); return; } - - const { res } = await request(routes.addPatientNote, { - pathParams: { patientId: patientId }, - body: { - note: noteField, - thread, - reply_to: reply_to?.id, - }, + addNote({ + note: noteField, + reply_to: reply_to?.id, + thread, }); - if (res?.status === 201) { - Notification.Success({ msg: "Note added successfully" }); - setNoteField(""); - setReload(!reload); - setState({ ...state, cPage: 1 }); - setReplyTo(undefined); - } + setReplyTo(undefined); + setNoteField(""); }; useEffect(() => { @@ -130,13 +125,21 @@ const PatientNotes = (props: PatientNotesProps) => { ? "border-primary-500 font-bold text-secondary-800" : "border-secondary-300 text-secondary-800", )} - onClick={() => setThread(PATIENT_NOTES_THREADS[current])} + onClick={() => { + if (thread !== PATIENT_NOTES_THREADS[current]) { + setThread(PATIENT_NOTES_THREADS[current]); + setState(initialData); + setReplyTo(undefined); + setNoteField(""); + } + }} > {t(`patient_notes_thread__${current}`)} ))}
{ + const queryClient = useQueryClient(); + const { patientId, thread, consultationId } = options; + + return useMutation({ + mutationFn: mutate(routes.addPatientNote, { + pathParams: { patientId }, + }), + onSuccess: (data) => { + queryClient.invalidateQueries({ + queryKey: ["notes", patientId, thread, consultationId], + }); + return data; + }, + }); +}; From 709d8667b6ba6dc7a23ff93bb3c8772de1ea48b6 Mon Sep 17 00:00:00 2001 From: Rithvik Nishad Date: Mon, 30 Dec 2024 04:20:11 +0000 Subject: [PATCH 2/2] fixes address and patient note card multi-line issue (#9607) --- src/components/Facility/PatientNoteCard.tsx | 4 +++- src/components/Form/Form.tsx | 5 ----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/components/Facility/PatientNoteCard.tsx b/src/components/Facility/PatientNoteCard.tsx index 4d5a9ffa89c..49c8cf4204b 100644 --- a/src/components/Facility/PatientNoteCard.tsx +++ b/src/components/Facility/PatientNoteCard.tsx @@ -213,7 +213,9 @@ const PatientNoteCard = ({
) : ( -
{noteField}
+
+ {noteField} +
)} } diff --git a/src/components/Form/Form.tsx b/src/components/Form/Form.tsx index 18f190ccc3c..5a3bf552b26 100644 --- a/src/components/Form/Form.tsx +++ b/src/components/Form/Form.tsx @@ -98,11 +98,6 @@ const Form = ({ return (
{ - if (e.key === "Enter") { - handleSubmit(e); - } - }} className={classNames( "mx-auto w-full", !props.noPadding && "px-8 py-5 md:px-16 md:py-11",