From c8cbc65340a45bd4226f689c0a93949536ccff5a Mon Sep 17 00:00:00 2001 From: Jacob Shandling <61553566+jacobshandling@users.noreply.github.com> Date: Mon, 16 Jan 2023 12:51:49 -0800 Subject: [PATCH] Frontend: Fix Clicking "Back to all hosts" doesn't clear filter after filtering by software (#9307) # Addresses #8923 # Fixes When a user followed the flow ManageHosts > HostDetails > Software tab > View all hosts (aka, filter all hosts by the software this row represents), and then hit browser back, then 'Back to all hosts', the software filter remained on the ManageHosts Page. (see #8923) Now the filter clears correctly, while still maintaining the desired filters if they exist (OS, team, label) https://www.loom.com/share/a3c1d182ba5145df93d13d893833db95 # Checklist for submitter - [x] Manual QA for all new/changed functionality Co-authored-by: Jacob Shandling --- frontend/pages/hosts/ManageHostsPage/ManageHostsPage.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/frontend/pages/hosts/ManageHostsPage/ManageHostsPage.tsx b/frontend/pages/hosts/ManageHostsPage/ManageHostsPage.tsx index 1dc5fbcd9b..795a6c6bce 100644 --- a/frontend/pages/hosts/ManageHostsPage/ManageHostsPage.tsx +++ b/frontend/pages/hosts/ManageHostsPage/ManageHostsPage.tsx @@ -550,8 +550,9 @@ const ManageHostsPage = ({ retrieveHostCount(omit(options, "device_mapping")); setCurrentQueryOptions(options); } - - setFilteredHostsPath(location.pathname + location.search); + if (!location.search.includes("software_id")) { + setFilteredHostsPath(location.pathname + location.search); + } }, [availableTeams, currentTeam, location, labels]); const isLastPage =