From df61e6b7f5cf48cbea8159569cf1f507d48bc89e Mon Sep 17 00:00:00 2001 From: RachelElysia <71795832+RachelElysia@users.noreply.github.com> Date: Mon, 7 Apr 2025 09:45:45 -0400 Subject: [PATCH] Fleet UI: Fix platform resetting on pagination of OS table (#27896) --- changes/27326-os-platform-reset-bug | 1 + .../SoftwareOS/SoftwareOSTable/SoftwareOSTable.tsx | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 changes/27326-os-platform-reset-bug diff --git a/changes/27326-os-platform-reset-bug b/changes/27326-os-platform-reset-bug new file mode 100644 index 0000000000..e3c623ba51 --- /dev/null +++ b/changes/27326-os-platform-reset-bug @@ -0,0 +1 @@ +* Fleet UI: Fixed pagination resetting the platform filter on the Operating System UI table \ No newline at end of file diff --git a/frontend/pages/SoftwarePage/SoftwareOS/SoftwareOSTable/SoftwareOSTable.tsx b/frontend/pages/SoftwarePage/SoftwareOS/SoftwareOSTable/SoftwareOSTable.tsx index bb820dc04f..5eb263b2c4 100644 --- a/frontend/pages/SoftwarePage/SoftwareOS/SoftwareOSTable/SoftwareOSTable.tsx +++ b/frontend/pages/SoftwarePage/SoftwareOS/SoftwareOSTable/SoftwareOSTable.tsx @@ -124,9 +124,10 @@ const SoftwareOSTable = ({ order_direction: newTableQuery.sortDirection, order_key: newTableQuery.sortHeader, page: changedParam === "pageIndex" ? newTableQuery.pageIndex : 0, + platform, }; }, - [teamId] + [teamId, platform] ); const onQueryChange = useCallback( @@ -134,7 +135,6 @@ const SoftwareOSTable = ({ // we want to determine which query param has changed in order to // reset the page index to 0 if any other param has changed. const changedParam = determineQueryParamChange(newTableQuery); - // if nothing has changed, don't update the route. this can happen when // this handler is called on the initial render. if (changedParam === "") return;