Fleet UI: Nuances between platform and last opened time (#35857)

This commit is contained in:
RachelElysia 2025-11-18 09:27:43 -05:00 committed by GitHub
parent 55a7c4b63f
commit 6f18b2339d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 24 additions and 10 deletions

View file

@ -146,6 +146,9 @@ export const isAppleDevice = (platform = "") => {
);
};
export const isWindows = (platform: string | HostPlatform) =>
platform === "windows";
export const isMacOS = (platform: string | HostPlatform) =>
platform === "darwin";

View file

@ -7,7 +7,13 @@ import {
IHostSoftware,
isIpadOrIphoneSoftwareSource,
} from "interfaces/software";
import { HostPlatform, isLinuxLike } from "interfaces/platform";
import {
HostPlatform,
isIPadOrIPhone,
isLinuxLike,
isMacOS,
isWindows,
} from "interfaces/platform";
import { IHeaderProps, IStringCellProps } from "interfaces/datatable_config";
import PATHS from "router/paths";
@ -125,15 +131,20 @@ export const generateSoftwareTableHeaders = ({
},
{
Header: (): JSX.Element => {
const lastOpenedHeader = isLinuxLike(platform) ? (
<TooltipWrapper
tipContent={
<>
The last time the package was opened by the end user <br />
or accessed by any process on the host.
</>
}
>
let tooltipContent = <></>;
if (isMacOS(platform)) {
tooltipContent = (
<>When the version installed most recently was last opened.</>
);
} else if (isLinuxLike(platform) || isWindows(platform)) {
tooltipContent = <>When any version was last opened.</>;
} else if (isIPadOrIPhone(platform)) {
tooltipContent = <>Date and time of last opened.</>;
}
const lastOpenedHeader = tooltipContent ? (
<TooltipWrapper tipContent={tooltipContent}>
Last opened
</TooltipWrapper>
) : (