diff --git a/changes/20604-hosts-page-pagination b/changes/20604-hosts-page-pagination new file mode 100644 index 0000000000..c1f68d5f94 --- /dev/null +++ b/changes/20604-hosts-page-pagination @@ -0,0 +1 @@ +* Fix a bug where hosts page would sometimes allow excess pagination \ No newline at end of file diff --git a/frontend/pages/hosts/ManageHostsPage/HostsPageConfig.tsx b/frontend/pages/hosts/ManageHostsPage/HostsPageConfig.tsx index 114b537d3b..910f4813f3 100644 --- a/frontend/pages/hosts/ManageHostsPage/HostsPageConfig.tsx +++ b/frontend/pages/hosts/ManageHostsPage/HostsPageConfig.tsx @@ -55,7 +55,7 @@ export const LABEL_SLUG_PREFIX = "labels/"; export const DEFAULT_SORT_HEADER = "display_name"; export const DEFAULT_SORT_DIRECTION = "asc"; -export const DEFAULT_PAGE_SIZE = 20; +export const DEFAULT_PAGE_SIZE = 50; export const DEFAULT_PAGE_INDEX = 0; export const getHostSelectStatuses = (isSandboxMode = false) => { diff --git a/frontend/pages/hosts/ManageHostsPage/ManageHostsPage.tsx b/frontend/pages/hosts/ManageHostsPage/ManageHostsPage.tsx index e5bd75fd0e..71f2386c58 100644 --- a/frontend/pages/hosts/ManageHostsPage/ManageHostsPage.tsx +++ b/frontend/pages/hosts/ManageHostsPage/ManageHostsPage.tsx @@ -405,8 +405,8 @@ const ManageHostsPage = ({ osName, osVersion, vulnerability, - page: tableQueryData ? tableQueryData.pageIndex : 0, - perPage: tableQueryData ? tableQueryData.pageSize : 50, + page: tableQueryData ? tableQueryData.pageIndex : DEFAULT_PAGE_INDEX, + perPage: tableQueryData ? tableQueryData.pageSize : DEFAULT_PAGE_SIZE, device_mapping: true, osSettings: osSettingsStatus, diskEncryptionStatus, @@ -1578,7 +1578,7 @@ const ManageHostsPage = ({ } defaultPageIndex={page || DEFAULT_PAGE_INDEX} defaultSearchQuery={searchQuery} - pageSize={50} + pageSize={DEFAULT_PAGE_SIZE} additionalQueries={JSON.stringify(selectedFilters)} inputPlaceHolder={HOSTS_SEARCH_BOX_PLACEHOLDER} actionButton={{