mirror of
https://github.com/fleetdm/fleet
synced 2026-05-23 17:08:53 +00:00
Fleet UI: Nuances between platform and last opened time (#35857)
This commit is contained in:
parent
55a7c4b63f
commit
6f18b2339d
2 changed files with 24 additions and 10 deletions
|
|
@ -146,6 +146,9 @@ export const isAppleDevice = (platform = "") => {
|
|||
);
|
||||
};
|
||||
|
||||
export const isWindows = (platform: string | HostPlatform) =>
|
||||
platform === "windows";
|
||||
|
||||
export const isMacOS = (platform: string | HostPlatform) =>
|
||||
platform === "darwin";
|
||||
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
) : (
|
||||
|
|
|
|||
Loading…
Reference in a new issue