Fleet UI: Fix clearing filters on manage host page (#7466)

This commit is contained in:
RachelElysia 2022-08-31 08:31:21 -07:00 committed by GitHub
parent b1fcc11b48
commit 2f10e53082
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 28 additions and 3 deletions

View file

@ -0,0 +1 @@
* Clearing filter pill on host detail page only clears that single filter

View file

@ -681,18 +681,42 @@ const ManageHostsPage = ({
const handleClearSoftwareFilter = () => {
handleResetPageIndex();
router.replace(PATHS.MANAGE_HOSTS);
router.replace(
getNextLocationPath({
pathPrefix: PATHS.MANAGE_HOSTS,
routeTemplate,
routeParams,
queryParams: omit(queryParams, ["software_id"]),
})
);
setSoftwareDetails(null);
};
const handleClearMDMSolutionFilter = () => {
handleResetPageIndex();
router.replace(PATHS.MANAGE_HOSTS);
router.replace(
getNextLocationPath({
pathPrefix: PATHS.MANAGE_HOSTS,
routeTemplate,
routeParams,
queryParams: omit(queryParams, ["mdm_id"]),
})
);
setMDMSolutionDetails(null);
};
const handleClearMDMEnrollmentFilter = () => {
router.replace(PATHS.MANAGE_HOSTS);
handleResetPageIndex();
router.replace(
getNextLocationPath({
pathPrefix: PATHS.MANAGE_HOSTS,
routeTemplate,
routeParams,
queryParams: omit(queryParams, ["mdm_enrollment_status"]),
})
);
};
const handleTeamSelect = (teamId: number) => {