From b57e25c22404c2d9c635fed2e07bb488afcca80f Mon Sep 17 00:00:00 2001 From: Jacob John Jeevan <40040905+Jacobjeevan@users.noreply.github.com> Date: Thu, 2 Jan 2025 19:45:06 +0530 Subject: [PATCH] Minor enhancements (#9631) --- src/components/Common/UserSelector.tsx | 12 +++++++++--- src/pages/Encounters/EncounterList.tsx | 19 ++++++++++++++++--- .../Encounters/tabs/EncounterFilesTab.tsx | 6 +++--- .../components/LinkFacilityUserSheet.tsx | 11 +++++++++-- .../Organization/components/LinkUserSheet.tsx | 1 + 5 files changed, 38 insertions(+), 11 deletions(-) diff --git a/src/components/Common/UserSelector.tsx b/src/components/Common/UserSelector.tsx index 986dfb5091d..b28fbeb48c9 100644 --- a/src/components/Common/UserSelector.tsx +++ b/src/components/Common/UserSelector.tsx @@ -33,6 +33,7 @@ interface Props { onChange: (user: UserBase) => void; placeholder?: string; noOptionsMessage?: string; + popoverClassName?: string; } export default function UserSelector({ @@ -40,6 +41,7 @@ export default function UserSelector({ onChange, placeholder, noOptionsMessage, + popoverClassName, }: Props) { const { t } = useTranslation(); const [open, setOpen] = useState(false); @@ -55,8 +57,8 @@ export default function UserSelector({ const users = data?.results || []; return ( - - + + - + 1}> ({ + 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(); 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} ))} - + */}
diff --git a/src/pages/FacilityOrganization/components/LinkFacilityUserSheet.tsx b/src/pages/FacilityOrganization/components/LinkFacilityUserSheet.tsx index 0c1f999d251..c0cb464b2b1 100644 --- a/src/pages/FacilityOrganization/components/LinkFacilityUserSheet.tsx +++ b/src/pages/FacilityOrganization/components/LinkFacilityUserSheet.tsx @@ -118,7 +118,7 @@ export default function LinkFacilityUserSheet({ Link User - + Link User to Facility @@ -131,6 +131,7 @@ export default function LinkFacilityUserSheet({ onChange={handleUserChange} placeholder="Search for a user" noOptionsMessage="No users found" + popoverClassName="w-full" /> {selectedUser && (
@@ -173,7 +174,13 @@ export default function LinkFacilityUserSheet({ - + {roles?.results?.map((role) => (
diff --git a/src/pages/Organization/components/LinkUserSheet.tsx b/src/pages/Organization/components/LinkUserSheet.tsx index ef31f2d475f..ea60a7bfb32 100644 --- a/src/pages/Organization/components/LinkUserSheet.tsx +++ b/src/pages/Organization/components/LinkUserSheet.tsx @@ -130,6 +130,7 @@ export default function LinkUserSheet({ onChange={handleUserChange} placeholder="Search for a user" noOptionsMessage="No users found" + popoverClassName="w-full" /> {selectedUser && (