From 3cabefc1f160def7a531746e0832c8e9f98d59d1 Mon Sep 17 00:00:00 2001 From: RachelElysia <71795832+RachelElysia@users.noreply.github.com> Date: Thu, 29 Aug 2024 09:24:37 -0400 Subject: [PATCH] [19857 bug fix] Fleet UI: Update empty state of OS to show info line (#21647) --- frontend/pages/DashboardPage/DashboardPage.tsx | 8 -------- .../cards/Software/DashboardSoftware.tests.tsx | 2 -- .../pages/DashboardPage/cards/Software/Software.tsx | 13 ++----------- .../SoftwareTitles/SoftwareTable/SoftwareTable.tsx | 1 - .../EmptySoftwareTable/EmptySoftwareTable.tsx | 13 ++++--------- 5 files changed, 6 insertions(+), 31 deletions(-) diff --git a/frontend/pages/DashboardPage/DashboardPage.tsx b/frontend/pages/DashboardPage/DashboardPage.tsx index ae5eb5b5fd..1816ab4cee 100644 --- a/frontend/pages/DashboardPage/DashboardPage.tsx +++ b/frontend/pages/DashboardPage/DashboardPage.tsx @@ -521,13 +521,6 @@ const DashboardPage = ({ router, location }: IDashboardProps): JSX.Element => { renderFlash, ] ); - // TODO: Rework after backend is adjusted to differentiate empty search/filter results from - // collecting inventory - const isCollectingInventory = - !isAnyTeamSelected && - !softwarePageIndex && - !software?.software && - software?.counts_updated_at === null; const HostsSummaryCard = useInfoCard({ title: "Hosts", @@ -640,7 +633,6 @@ const DashboardPage = ({ router, location }: IDashboardProps): JSX.Element => { children: ( { render( { render( ( - - )} + emptyComponent={() => } showMarkAllPages={false} isAllPagesSelected={false} disableCount @@ -122,10 +116,7 @@ const Software = ({ defaultSortDirection={SOFTWARE_DEFAULT_SORT_DIRECTION} resultsTitle="software" emptyComponent={() => ( - + )} showMarkAllPages={false} isAllPagesSelected={false} diff --git a/frontend/pages/SoftwarePage/SoftwareTitles/SoftwareTable/SoftwareTable.tsx b/frontend/pages/SoftwarePage/SoftwareTitles/SoftwareTable/SoftwareTable.tsx index a8deb326ee..4985990537 100644 --- a/frontend/pages/SoftwarePage/SoftwareTitles/SoftwareTable/SoftwareTable.tsx +++ b/frontend/pages/SoftwarePage/SoftwareTitles/SoftwareTable/SoftwareTable.tsx @@ -356,7 +356,6 @@ const SoftwareTable = ({ vulnFilters={vulnFilters} isSoftwareDisabled={!isSoftwareEnabled} noSearchQuery={query === ""} - isCollectingSoftware={data?.counts_updated_at === null} installableSoftwareExists={installableSoftwareExists} /> )} diff --git a/frontend/pages/SoftwarePage/components/EmptySoftwareTable/EmptySoftwareTable.tsx b/frontend/pages/SoftwarePage/components/EmptySoftwareTable/EmptySoftwareTable.tsx index 3d7eba0130..829b4ff136 100644 --- a/frontend/pages/SoftwarePage/components/EmptySoftwareTable/EmptySoftwareTable.tsx +++ b/frontend/pages/SoftwarePage/components/EmptySoftwareTable/EmptySoftwareTable.tsx @@ -14,7 +14,6 @@ export interface IEmptySoftwareTableProps { tableName?: string; isSoftwareDisabled?: boolean; noSearchQuery?: boolean; - isCollectingSoftware?: boolean; installableSoftwareExists?: boolean; } @@ -38,7 +37,6 @@ const EmptySoftwareTable = ({ tableName = "software", isSoftwareDisabled, noSearchQuery, - isCollectingSoftware, installableSoftwareExists, }: IEmptySoftwareTableProps): JSX.Element => { const softwareTypeText = generateTypeText( @@ -80,13 +78,10 @@ const EmptySoftwareTable = ({ info: "Install software on your hosts to see versions.", }; } - if (isCollectingSoftware) { - return { - header: `No ${tableName} detected`, - info: `Expecting to see ${softwareTypeText}? Check back later.`, - }; - } - return { header: `No ${tableName} detected`, info: "" }; + return { + header: `No ${tableName} detected`, + info: `Expecting to see ${softwareTypeText}? Check back later.`, + }; } }