Skip to content
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

Add filtering and pagination to OOS bed list for a given premises #1963

Merged
merged 8 commits into from
Jul 5, 2024

Conversation

patrickjfl
Copy link
Contributor

Context

Jira ticket: https://dsdmoj.atlassian.net/browse/APS-887

Changes in this PR

Adds filtering by temporality to the OOS beds page for a single premises. Also adds pagination, which is set to 50 per page by default. This is to all but ensure that all currently OOS beds will appear on a single page for any given AP.

Screenshots of UI changes

Before

OutOfServiceBeds -- managing out of service beds -- should allow me to update an out of service bed

After

OutOfServiceBeds -- list all OOS beds for a given AP -- supports pagination

@patrickjfl patrickjfl requested review from edavey and richpjames July 3, 2024 14:06
Copy link
Contributor

@richpjames richpjames left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, some minor comments

server/paths/manage.ts Show resolved Hide resolved
server/utils/outOfServiceBedUtils.ts Outdated Show resolved Hide resolved
integration_tests/mockApis/outOfServiceBed.ts Show resolved Hide resolved
@patrickjfl patrickjfl force-pushed the APS-887-update-premises-OOS-bed-list branch 2 times, most recently from 4f75600 to 55358a0 Compare July 5, 2024 09:21
Also corrects the path being extended to be the v2 premises path.
We don’t need default values for sortBy and sortDirection as distinct from what the API defaults to. But we do need to specify a perPage value so that we can ensure that we will render all currently OOS beds for an AP on a single page, by specifying 50 results per page.
This ensures that the page will display the results for all three temporalities, with pagination. We specify 50 results per page to ensure that all currently OOS beds for a given AP will display on a single page.
This includes making the API stub and the API request verification stub generic to cover fetching all OOS beds for all APs, and fetching all OOS beds for a single AP, which use the same endpoint with different query parameters.
@patrickjfl patrickjfl force-pushed the APS-887-update-premises-OOS-bed-list branch from 55358a0 to 1c94673 Compare July 5, 2024 09:38
@patrickjfl patrickjfl merged commit 909a4a2 into main Jul 5, 2024
7 checks passed
@patrickjfl patrickjfl deleted the APS-887-update-premises-OOS-bed-list branch July 5, 2024 11:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants