Skip to content

Commit

Permalink
Bugfix/filter paging (#222)
Browse files Browse the repository at this point in the history
* Followed recipients query fix

* lint fix

* lint fix

* reset paging when filtering patient list, e.g. by recipients or test
patients

---------

Co-authored-by: Amy Chen <[email protected]>
  • Loading branch information
achen2401 and Amy Chen authored Aug 7, 2024
1 parent 2de95dc commit 55e152c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
9 changes: 0 additions & 9 deletions patientsearch/src/js/components/patientList/RefreshButton.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { makeStyles } from "@material-ui/core/styles";
import { Button, Tooltip } from "@material-ui/core";
import RefreshIcon from "@material-ui/icons/Refresh";
import { usePatientListContext } from "../../context/PatientListContextProvider";

const useStyles = makeStyles((theme) => ({
refreshButtonContainer: {
Expand All @@ -14,10 +13,6 @@ const useStyles = makeStyles((theme) => ({

export default function RefreshButton() {
const classes = useStyles();
const {
//consts
filterRowRef,
} = usePatientListContext();
return (
<div className={classes.refreshButtonContainer}>
<Tooltip title="Refresh the list">
Expand All @@ -26,10 +21,6 @@ export default function RefreshButton() {
size="small"
startIcon={<RefreshIcon />}
onClick={() => {
if (filterRowRef.current) {
filterRowRef.current.clear();
return;
}
location.reload();
}}
>
Expand Down
2 changes: 2 additions & 0 deletions patientsearch/src/js/context/PatientListContextProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -338,10 +338,12 @@ export default function PatientListContextProvider({ children }) {
);
};
const onTestPatientsCheckboxChange = (event) => {
_resetPaging();
setFilterByTestPatients(event.target.checked);
if (tableRef.current) tableRef.current.onQueryChange();
};
const onMyPatientsCheckboxChange = (event, changeEvent) => {
_resetPaging();
if (event && event.target && !event.target.checked) {
setPatientIdsByCareTeamParticipant(null);
if (tableRef.current) tableRef.current.onQueryChange();
Expand Down

0 comments on commit 55e152c

Please sign in to comment.