Skip to content

Commit

Permalink
Reset location filter on checkbox change
Browse files Browse the repository at this point in the history
- translations
  • Loading branch information
Jacobjeevan committed Oct 21, 2024
1 parent 5f0e0a8 commit 5204f71
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
25 changes: 13 additions & 12 deletions src/Components/Facility/CentralNursingStation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,13 @@ export default function CentralNursingStation({ facilityId }: Props) {
collapseSidebar
options={
<div className="flex flex-row-reverse items-center gap-4 md:flex-row">
<Pagination
className=""
cPage={qParams.page}
defaultPerPage={PER_PAGE_LIMIT}
data={{ totalCount }}
onChange={(page) => updatePage(page)}
/>
<Popover className="relative">
<PopoverButton>
<ButtonV2
Expand Down Expand Up @@ -109,8 +116,8 @@ export default function CentralNursingStation({ facilityId }: Props) {
<div className="rounded-t-lg bg-secondary-100 px-6 py-4">
<div className="flow-root rounded-md">
<span className="block text-sm text-secondary-800">
<span className="font-bold">{totalCount}</span> Vitals
Monitor present
<span className="font-bold">{totalCount}</span>{" "}
{t("vitals_present")}
</span>
</div>
</div>
Expand Down Expand Up @@ -168,7 +175,9 @@ export default function CentralNursingStation({ facilityId }: Props) {
value={JSON.parse(
qParams.monitors_without_patient ?? "false",
)}
onChange={(e) => updateQuery({ [e.name]: `${e.value}` })}
onChange={(e) =>
updateQuery({ [e.name]: `${e.value}`, location: "" })
}
labelClassName="text-sm"
errorClassName="hidden"
/>
Expand All @@ -193,22 +202,14 @@ export default function CentralNursingStation({ facilityId }: Props) {
</PopoverPanel>
</Transition>
</Popover>

<Pagination
className=""
cPage={qParams.page}
defaultPerPage={PER_PAGE_LIMIT}
data={{ totalCount }}
onChange={(page) => updatePage(page)}
/>
</div>
}
>
{data === undefined || query.loading ? (
<Loading />
) : data.length === 0 ? (
<div className="flex h-[80vh] w-full items-center justify-center text-center text-black">
No Vitals Monitor present in this location or facility.
{t("no_vitals_present")}
</div>
) : (
<div className="3xl:grid-cols-3 mt-1 grid grid-cols-1 gap-1 lg:grid-cols-2">
Expand Down
4 changes: 3 additions & 1 deletion src/Locale/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1054,5 +1054,7 @@
"length": "Length ({{unit}})",
"expand_sidebar": "Expand Sidebar",
"collapse_sidebar": "Collapse Sidebar",
"linked_skills": "Linked Skills"
"linked_skills": "Linked Skills",
"no_vitals_present": "No Vitals Monitor present in this location or facility",
"vitals_present": "Vitals Monitor present"
}

0 comments on commit 5204f71

Please sign in to comment.