From 691748d4d3a419e9cc7eda26a97b900275e441e7 Mon Sep 17 00:00:00 2001 From: Jacobjohnjeevan Date: Tue, 31 Dec 2024 16:19:27 +0530 Subject: [PATCH 1/5] minor styling changes/mobile responsiveness --- src/components/Common/UserSelector.tsx | 14 +++++++++++--- .../components/LinkFacilityUserSheet.tsx | 10 ++++++++-- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/src/components/Common/UserSelector.tsx b/src/components/Common/UserSelector.tsx index b181c212022..6a756864f2a 100644 --- a/src/components/Common/UserSelector.tsx +++ b/src/components/Common/UserSelector.tsx @@ -56,7 +56,7 @@ export default function UserSelector({ return ( - + - + 1}> - + { + e.stopPropagation(); + }} + > {isFetching ? t("searching") diff --git a/src/pages/FacilityOrganization/components/LinkFacilityUserSheet.tsx b/src/pages/FacilityOrganization/components/LinkFacilityUserSheet.tsx index 29ea4b7db3b..7e4fcfbdea2 100644 --- a/src/pages/FacilityOrganization/components/LinkFacilityUserSheet.tsx +++ b/src/pages/FacilityOrganization/components/LinkFacilityUserSheet.tsx @@ -117,7 +117,7 @@ export default function LinkFacilityUserSheet({ Link User - + Link User to Facility @@ -172,7 +172,13 @@ export default function LinkFacilityUserSheet({ - + {roles?.results?.map((role) => (
From 80fe44f7d158667112719c6db378a324efb17639 Mon Sep 17 00:00:00 2001 From: Jacobjohnjeevan Date: Tue, 31 Dec 2024 19:06:37 +0530 Subject: [PATCH 2/5] minor fixes --- src/pages/Encounters/EncounterList.tsx | 2 +- src/pages/Encounters/tabs/EncounterFilesTab.tsx | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/pages/Encounters/EncounterList.tsx b/src/pages/Encounters/EncounterList.tsx index 39bc5537a1b..9bbce649f38 100644 --- a/src/pages/Encounters/EncounterList.tsx +++ b/src/pages/Encounters/EncounterList.tsx @@ -184,7 +184,7 @@ export function EncounterList({ queryParams: { ...buildQueryParams(status, facilityId, encounterClass, priority), name, - encounter_id, + id: encounter_id, external_identifier, limit: resultsPerPage, offset: ((qParams.page || 1) - 1) * resultsPerPage, diff --git a/src/pages/Encounters/tabs/EncounterFilesTab.tsx b/src/pages/Encounters/tabs/EncounterFilesTab.tsx index 9b89fe926e4..053637b75d8 100644 --- a/src/pages/Encounters/tabs/EncounterFilesTab.tsx +++ b/src/pages/Encounters/tabs/EncounterFilesTab.tsx @@ -28,7 +28,7 @@ import { TableHeader, TableRow, } from "@/components/ui/table"; -import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"; +import { Tabs, TabsContent } from "@/components/ui/tabs"; import { Tooltip, TooltipContent, @@ -490,7 +490,7 @@ export const EncounterFilesTab = (props: EncounterTabProps) => { >
- + {/* {fileCategories.map((category) => ( { {category.label} ))} - + */}
From b00fbbfcc52ecfc1e357b4b6c586e51547987aac Mon Sep 17 00:00:00 2001 From: Jacobjohnjeevan Date: Tue, 31 Dec 2024 20:30:33 +0530 Subject: [PATCH 3/5] support for encounterId search --- src/pages/Encounters/EncounterList.tsx | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/src/pages/Encounters/EncounterList.tsx b/src/pages/Encounters/EncounterList.tsx index 9bbce649f38..a1fb5da391c 100644 --- a/src/pages/Encounters/EncounterList.tsx +++ b/src/pages/Encounters/EncounterList.tsx @@ -184,13 +184,23 @@ export function EncounterList({ queryParams: { ...buildQueryParams(status, facilityId, encounterClass, priority), name, - id: encounter_id, external_identifier, limit: resultsPerPage, offset: ((qParams.page || 1) - 1) * resultsPerPage, }, }), - enabled: !propEncounters, + enabled: !propEncounters && !encounter_id, + }); + + const { data: queryEncounter } = useQuery({ + queryKey: ["encounter", encounter_id], + queryFn: query(routes.encounter.get, { + pathParams: { id: encounter_id }, + queryParams: { + facility: facilityId, + }, + }), + enabled: !!encounter_id, }); const searchOptions = [ @@ -220,7 +230,10 @@ export function EncounterList({ }, ]; - const encounters = propEncounters || queryEncounters?.results || []; + const encounters = + propEncounters || + queryEncounters?.results || + (queryEncounter ? [queryEncounter] : []); const { t } = useTranslation(); From 658428262b2146f5a632eddc28f5b35edb687899 Mon Sep 17 00:00:00 2001 From: Jacobjohnjeevan Date: Tue, 31 Dec 2024 20:34:50 +0530 Subject: [PATCH 4/5] suggestion edit --- src/components/Common/UserSelector.tsx | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/components/Common/UserSelector.tsx b/src/components/Common/UserSelector.tsx index 6a756864f2a..7598b1eb477 100644 --- a/src/components/Common/UserSelector.tsx +++ b/src/components/Common/UserSelector.tsx @@ -55,7 +55,7 @@ export default function UserSelector({ const users = data?.results || []; return ( - +