From b71e69182ebad90e052180654b6b9e564983e704 Mon Sep 17 00:00:00 2001 From: RachelElysia <71795832+RachelElysia@users.noreply.github.com> Date: Thu, 4 Sep 2025 14:18:11 -0400 Subject: [PATCH] Fleet UI: Add last opened tooltip (#32592) --- .../details/cards/Software/HostSoftware.tsx | 3 ++- .../Software/HostSoftwareTableConfig.tsx | 20 ++++++++++++++++++- .../InventoryVersions/InventoryVersions.tsx | 20 ++++++++++++++++++- 3 files changed, 40 insertions(+), 3 deletions(-) diff --git a/frontend/pages/hosts/details/cards/Software/HostSoftware.tsx b/frontend/pages/hosts/details/cards/Software/HostSoftware.tsx index 1570c80b1f..5211b0233b 100644 --- a/frontend/pages/hosts/details/cards/Software/HostSoftware.tsx +++ b/frontend/pages/hosts/details/cards/Software/HostSoftware.tsx @@ -258,8 +258,9 @@ const HostSoftware = ({ router, teamId: hostTeamId, onShowInventoryVersions, + platform, }); - }, [isMyDevicePage, router, hostTeamId, onShowInventoryVersions]); + }, [isMyDevicePage, router, hostTeamId, onShowInventoryVersions, platform]); const isLoading = isMyDevicePage ? deviceSoftwareLoading diff --git a/frontend/pages/hosts/details/cards/Software/HostSoftwareTableConfig.tsx b/frontend/pages/hosts/details/cards/Software/HostSoftwareTableConfig.tsx index 55ae5e6c95..4dbb2dd766 100644 --- a/frontend/pages/hosts/details/cards/Software/HostSoftwareTableConfig.tsx +++ b/frontend/pages/hosts/details/cards/Software/HostSoftwareTableConfig.tsx @@ -8,6 +8,7 @@ import { isIpadOrIphoneSoftwareSource, SoftwareSource, } from "interfaces/software"; +import { HostPlatform, isLinuxLike } from "interfaces/platform"; import { IHeaderProps, IStringCellProps } from "interfaces/datatable_config"; import PATHS from "router/paths"; @@ -18,6 +19,7 @@ import TextCell from "components/TableContainer/DataTable/TextCell"; import SoftwareNameCell from "components/TableContainer/DataTable/SoftwareNameCell"; import InstalledPathCell from "pages/SoftwarePage/components/tables/InstalledPathCell"; import HashCell from "pages/SoftwarePage/components/tables/HashCell/HashCell"; +import TooltipWrapper from "components/TooltipWrapper"; import { HumanTimeDiffWithDateTip } from "components/HumanTimeDiffWithDateTip"; import VulnerabilitiesCell from "pages/SoftwarePage/components/tables/VulnerabilitiesCell"; @@ -40,6 +42,7 @@ interface ISoftwareTableHeadersProps { router: InjectedRouter; teamId: number; onShowInventoryVersions: (software: IHostSoftware) => void; + platform: HostPlatform; } // NOTE: cellProps come from react-table @@ -48,6 +51,7 @@ export const generateSoftwareTableHeaders = ({ router, teamId, onShowInventoryVersions, + platform, }: ISoftwareTableHeadersProps): ISoftwareTableConfig[] => { const tableHeaders: ISoftwareTableConfig[] = [ { @@ -121,7 +125,21 @@ export const generateSoftwareTableHeaders = ({ }, { Header: (): JSX.Element => { - return ; + const lastOpenedHeader = isLinuxLike(platform) ? ( + + The last time the package was opened by the end user
+ or accessed by any process on the host. + + } + > + Last opened +
+ ) : ( + "Last opened" + ); + return ; }, id: "Last opened", disableSortBy: true, diff --git a/frontend/pages/hosts/details/components/InventoryVersions/InventoryVersions.tsx b/frontend/pages/hosts/details/components/InventoryVersions/InventoryVersions.tsx index c3907f28e0..cc28f46372 100644 --- a/frontend/pages/hosts/details/components/InventoryVersions/InventoryVersions.tsx +++ b/frontend/pages/hosts/details/components/InventoryVersions/InventoryVersions.tsx @@ -4,6 +4,7 @@ import { dateAgo } from "utilities/date_format"; import { formatSoftwareType, + INSTALLABLE_SOURCE_PLATFORM_CONVERSION, IHostSoftware, ISoftwareInstallVersion, SoftwareSource, @@ -11,6 +12,7 @@ import { import Card from "components/Card"; import DataSet from "components/DataSet"; +import TooltipWrapper from "components/TooltipWrapper"; export const sourcesWithLastOpenedTime = new Set([ "programs", @@ -52,6 +54,22 @@ const InventoryVersion = ({ signature_information: signatureInformation, } = version; + const lastOpenedTitle = + INSTALLABLE_SOURCE_PLATFORM_CONVERSION[source] === "linux" ? ( + + The last time the package was opened by the end user
+ or accessed by any process on the host. + + } + > + Last opened +
+ ) : ( + "Last opened" + ); + return (