mirror of
https://github.com/fleetdm/fleet
synced 2026-05-23 00:49:03 +00:00
[unreleased bug 19090] Fleet UI: Fix where platform causes incorrect count (#19787)
This commit is contained in:
parent
cc96b3372a
commit
11a1c58094
2 changed files with 9 additions and 9 deletions
|
|
@ -14,7 +14,7 @@ import { QueryContext } from "context/query";
|
|||
import { TableContext } from "context/table";
|
||||
import { NotificationContext } from "context/notification";
|
||||
import { getPerformanceImpactDescription } from "utilities/helpers";
|
||||
import { SupportedPlatform } from "interfaces/platform";
|
||||
import { SupportedPlatform, SelectedPlatform } from "interfaces/platform";
|
||||
import {
|
||||
IEnhancedQuery,
|
||||
IQueryKeyQueriesLoadAll,
|
||||
|
|
@ -43,7 +43,7 @@ interface IManageQueriesPageProps {
|
|||
location: {
|
||||
pathname: string;
|
||||
query: {
|
||||
platform?: SupportedPlatform;
|
||||
platform?: SelectedPlatform;
|
||||
page?: string;
|
||||
query?: string;
|
||||
order_key?: string;
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ import { InjectedRouter } from "react-router";
|
|||
|
||||
import { AppContext } from "context/app";
|
||||
import { IEmptyTableProps } from "interfaces/empty_table";
|
||||
import { SupportedPlatform } from "interfaces/platform";
|
||||
import { SelectedPlatform } from "interfaces/platform";
|
||||
import { IEnhancedQuery } from "interfaces/schedulable_query";
|
||||
import { ITableQueryData } from "components/TableContainer/TableContainer";
|
||||
import { IActionButtonProps } from "components/TableContainer/DataTable/ActionButton/ActionButton";
|
||||
|
|
@ -38,7 +38,7 @@ export interface IQueriesTableProps {
|
|||
isAnyTeamObserverPlus: boolean;
|
||||
router?: InjectedRouter;
|
||||
queryParams?: {
|
||||
platform?: SupportedPlatform;
|
||||
platform?: SelectedPlatform;
|
||||
page?: string;
|
||||
query?: string;
|
||||
order_key?: string;
|
||||
|
|
@ -118,20 +118,20 @@ const QueriesTable = ({
|
|||
.toLowerCase()
|
||||
.includes(queryParams?.query.toLowerCase())
|
||||
: true;
|
||||
|
||||
const compatiblePlatforms =
|
||||
checkPlatformCompatibility(query.query).platforms || [];
|
||||
|
||||
const filterCompatiblePlatform = queryParams?.platform
|
||||
? compatiblePlatforms.includes(queryParams?.platform)
|
||||
: true;
|
||||
const filterCompatiblePlatform =
|
||||
queryParams?.platform && queryParams?.platform !== "all"
|
||||
? compatiblePlatforms.includes(queryParams?.platform)
|
||||
: true;
|
||||
|
||||
return filterSearchQuery && filterCompatiblePlatform;
|
||||
}) || []
|
||||
);
|
||||
}
|
||||
setIsQueriesStateLoading(false);
|
||||
}, [queriesList, queryParams?.query]);
|
||||
}, [queriesList, queryParams]);
|
||||
|
||||
// Functions to avoid race conditions
|
||||
const initialSearchQuery = (() => queryParams?.query ?? "")();
|
||||
|
|
|
|||
Loading…
Reference in a new issue