-
Notifications
You must be signed in to change notification settings - Fork 234
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(fix) O3-4353: Fix pagination on ward allocation and ward summary #1445
(fix) O3-4353: Fix pagination on ward allocation and ward summary #1445
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @Muppasanipraneeth! I haven't tested this out yet, but minor typo fix:
@@ -67,14 +67,12 @@ const BedAdministrationTable: React.FC = () => { | |||
|
|||
const handleBedStatusChange = ({ selectedItem }: { selectedItem: string }) => | |||
setFilterOption(selectedItem.trim().toUpperCase()); | |||
|
|||
const filteredData = useMemo(() => { | |||
const flatendData = Array.isArray(bedsGroupedByLocation) ? bedsGroupedByLocation.flat() : []; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const flatendData = Array.isArray(bedsGroupedByLocation) ? bedsGroupedByLocation.flat() : []; | |
const flattenedData = Array.isArray(bedsGroupedByLocation) ? bedsGroupedByLocation.flat() : []; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated changes
|
||
const filteredData = useMemo(() => { | ||
const flatendData = Array.isArray(bedsGroupedByLocation) ? bedsGroupedByLocation.flat() : []; | ||
return filterOption === 'ALL' ? flatendData : flatendData.filter((bed) => bed.status === filterOption); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return filterOption === 'ALL' ? flatendData : flatendData.filter((bed) => bed.status === filterOption); | |
return filterOption === 'ALL' ? flattenedData : flattenedData.filter((bed) => bed.status === filterOption); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @Muppasanipraneeth! LGTM!
Requirements
Summary
problem
1 Even though the items per page is set to 10 the page automatically shows all items available. It should show only 10 and allow the user to change the pages
2 Even though there are more than 10 beds for a ward, the pagination does not allow you to go to the next page and shows only the first ten items. You have to manually change the number of items to a larger number to see all the items.
solution
passed the filtereddata correctly to hook usePagination() and
it returns data correctly
Screenshots
Before for Inpatient ward
After for Inpatient ward
Before ward allocation
after ward allocation
Related Issue
Other