Skip to content

Commit

Permalink
O3-2381 Patient Queue filter(drop-down) on service queues doesn't fil…
Browse files Browse the repository at this point in the history
…ter the table based on the service selected
  • Loading branch information
CynthiaKamau committed Aug 31, 2023
1 parent dc68fe9 commit 7ebf1b7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -332,9 +332,10 @@ function ActiveVisitsTable() {
rows={tableRows}
size="xs"
useZebraStyles>
{({ rows, headers, getHeaderProps, getTableProps, getRowProps, onInputChange }) => (
{({ rows, headers, getHeaderProps, getTableProps, getRowProps, getToolbarProps, onInputChange }) => (
<TableContainer className={styles.tableContainer}>
<TableToolbar
{...getToolbarProps()}
style={{ position: 'static', height: '3rem', overflow: 'visible', backgroundColor: 'color' }}>
<TableToolbarContent className={styles.toolbarContent}>
<div className={styles.filterContainer}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -254,11 +254,11 @@ export function useVisitQueueEntries(currServiceName: string, locationUuid: stri
let mappedVisitQueueEntries;

if (!currServiceName || currServiceName == t('all', 'All')) {
mappedVisitQueueEntries = data?.data?.results?.map(mapVisitQueueEntryProperties);
} else {
mappedVisitQueueEntries = data?.data?.results
?.map(mapVisitQueueEntryProperties)
.filter((data) => dayjs(data.visitStartDateTime).isToday());
} else {
mappedVisitQueueEntries = data?.data?.results?.map(mapVisitQueueEntryProperties);
.filter((data) => data.service == currServiceName);
}

return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function ClinicMetrics() {
const { allServices } = useServices(currentQueueLocation ?? queueLocations?.[0]?.id);
const currentServiceUuid = useSelectedServiceUuid();
const currentServiceName = useSelectedServiceName();
const { serviceCount } = useServiceMetricsCount(currentServiceName, currentQueueLocation);
const { serviceCount } = useServiceMetricsCount(currentServiceName, currentQueueLocation ?? queueLocations?.[0]?.id);
const [initialSelectedItem, setInitialSelectItem] = useState(() => {
if (currentServiceName && currentServiceUuid) {
return false;
Expand Down

0 comments on commit 7ebf1b7

Please sign in to comment.