From b10ce310766b6b463d82b5ed675328b411a28a14 Mon Sep 17 00:00:00 2001 From: Michael Johnson Date: Mon, 13 Mar 2023 11:01:39 -0400 Subject: [PATCH] fix(ESSNTL-4404): global filters and tags (#1788) Before, if you applied a global filter (workloads, sids, tags), the inventory table did not reflect the filter. Now global filters are applied to the table and work together with table filters. Co-authored-by: Michael Johnson --- src/api/api.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/api/api.js b/src/api/api.js index 63c97f217..64ff7f9b0 100644 --- a/src/api/api.js +++ b/src/api/api.js @@ -182,8 +182,8 @@ export async function getEntities(items, { orderDirection, filters.staleFilter, [ - ...constructTags(filters.tagFilters), - ...options.tags || [] + ...constructTags(filters?.tagFilters), + ...options?.globalFilter?.tags || [] ], filters?.registeredWithFilter, undefined, @@ -191,6 +191,7 @@ export async function getEntities(items, { { cancelToken: controller && controller.token, query: { + ...(options?.globalFilter?.filter && generateFilter(options.globalFilter.filter)), ...(options.filter && Object.keys(options.filter).length && generateFilter(options.filter)), ...(calculateSystemProfile(filters)), ...(fields && Object.keys(fields).length && generateFilter(fields, 'fields')),