Consolidate rolling linux version possibilities (#34467)
<!-- Add the related story/sub-task/bug number, like Resolves #123, or remove if NA --> **Related issue:** Resolves #34214 - [x] manual QA by @sgress454
This commit is contained in:
@@ -713,3 +713,15 @@ export interface IFleetMaintainedAppDetails {
|
||||
software_title_id?: number; // null unless the team already has the software added (as a Fleet-maintained app, App Store (app), or custom package)
|
||||
categories: SoftwareCategory[];
|
||||
}
|
||||
|
||||
export const ROLLING_ARCH_LINUX_NAMES = [
|
||||
"Arch Linux",
|
||||
"Arch Linux ARM",
|
||||
"Manjaro Linux",
|
||||
"Manjaro Linux ARM",
|
||||
"Manjaro ARM Linux",
|
||||
];
|
||||
|
||||
export const ROLLING_ARCH_LINUX_VERSIONS = ROLLING_ARCH_LINUX_NAMES.map(
|
||||
(name) => `${name} rolling`
|
||||
);
|
||||
|
||||
@@ -13,7 +13,10 @@ import {
|
||||
formatOperatingSystemDisplayName,
|
||||
IOperatingSystemVersion,
|
||||
} from "interfaces/operating_system";
|
||||
import { ISoftwareVulnerability } from "interfaces/software";
|
||||
import {
|
||||
ISoftwareVulnerability,
|
||||
ROLLING_ARCH_LINUX_NAMES,
|
||||
} from "interfaces/software";
|
||||
|
||||
import TextCell from "components/TableContainer/DataTable/TextCell";
|
||||
import HeaderCell from "components/TableContainer/DataTable/HeaderCell";
|
||||
@@ -99,12 +102,7 @@ const generateDefaultTableHeaders = (
|
||||
Cell: (cellProps: IVersionCellProps) => {
|
||||
const { version, name_only } = cellProps.row.original;
|
||||
if (
|
||||
[
|
||||
"Arch Linux",
|
||||
"Arch Linux ARM",
|
||||
"Manjaro Linux",
|
||||
"Manjaro Linux ARM",
|
||||
].includes(name_only) &&
|
||||
ROLLING_ARCH_LINUX_NAMES.includes(name_only) &&
|
||||
version === "rolling"
|
||||
) {
|
||||
return (
|
||||
|
||||
+9
-8
@@ -8,7 +8,10 @@ import React from "react";
|
||||
|
||||
import { getPathWithQueryParams, QueryParams } from "utilities/url";
|
||||
import paths from "router/paths";
|
||||
import { NO_VERSION_OR_HOST_DATA_SOURCES } from "interfaces/software";
|
||||
import {
|
||||
NO_VERSION_OR_HOST_DATA_SOURCES,
|
||||
ROLLING_ARCH_LINUX_VERSIONS,
|
||||
} from "interfaces/software";
|
||||
|
||||
import DataSet from "components/DataSet";
|
||||
import LastUpdatedHostCount from "components/LastUpdatedHostCount";
|
||||
@@ -106,14 +109,12 @@ const SoftwareDetailsSummary = ({
|
||||
)}
|
||||
<dl className={`${baseClass}__info`}>
|
||||
<h1>
|
||||
{title === "Arch Linux rolling" ||
|
||||
title === "Arch Linux ARM rolling" ||
|
||||
title === "Manjaro Linux rolling" ||
|
||||
title === "Manjaro Linux ARM rolling" ? (
|
||||
<span>
|
||||
{title.slice(0, -7 /* removing lowercase rolling suffix */)}
|
||||
{ROLLING_ARCH_LINUX_VERSIONS.includes(title) ? (
|
||||
// wrap a tooltip around the "rolling" suffix
|
||||
<>
|
||||
{title.slice(0, -8)}
|
||||
<TooltipWrapperArchLinuxRolling />
|
||||
</span>
|
||||
</>
|
||||
) : (
|
||||
title
|
||||
)}
|
||||
|
||||
@@ -12,6 +12,7 @@ import {
|
||||
isMobilePlatform,
|
||||
} from "interfaces/platform";
|
||||
import { isBYODAccountDrivenUserEnrollment } from "interfaces/mdm";
|
||||
import { ROLLING_ARCH_LINUX_VERSIONS } from "interfaces/software";
|
||||
|
||||
import TooltipWrapperArchLinuxRolling from "components/TooltipWrapperArchLinuxRolling";
|
||||
import Checkbox from "components/forms/fields/Checkbox";
|
||||
@@ -320,25 +321,19 @@ const allHostTableHeaders: IHostTableColumnConfig[] = [
|
||||
id: "os_version",
|
||||
// TODO(android): is Android supported? what about the os versions endpoint and dashboard card?
|
||||
Cell: (cellProps: IHostTableStringCellProps) => {
|
||||
const value = cellProps.cell.value;
|
||||
if (
|
||||
value === "Arch Linux rolling" ||
|
||||
value === "Arch Linux ARM rolling" ||
|
||||
value === "Manjaro Linux rolling" ||
|
||||
value === "Manjaro Linux ARM rolling"
|
||||
) {
|
||||
return (
|
||||
<TooltipTruncatedTextCell
|
||||
value={
|
||||
<span>
|
||||
{value.slice(0, -7 /* removing lowercase rolling suffix */)}
|
||||
<TooltipWrapperArchLinuxRolling />
|
||||
</span>
|
||||
}
|
||||
/>
|
||||
);
|
||||
}
|
||||
return <TooltipTruncatedTextCell value={value} />;
|
||||
const os_version = cellProps.cell.value;
|
||||
const versionForRender = ROLLING_ARCH_LINUX_VERSIONS.includes(
|
||||
os_version
|
||||
) ? (
|
||||
// wrap a tooltip around the "rolling" suffix
|
||||
<>
|
||||
{os_version.slice(0, -8)}
|
||||
<TooltipWrapperArchLinuxRolling />
|
||||
</>
|
||||
) : (
|
||||
os_version
|
||||
);
|
||||
return <TooltipTruncatedTextCell value={versionForRender} />;
|
||||
},
|
||||
},
|
||||
{
|
||||
|
||||
@@ -16,6 +16,7 @@ import {
|
||||
isOsSettingsDisplayPlatform,
|
||||
platformSupportsDiskEncryption,
|
||||
} from "interfaces/platform";
|
||||
import { ROLLING_ARCH_LINUX_VERSIONS } from "interfaces/software";
|
||||
|
||||
import getHostStatusTooltipText from "pages/hosts/helpers";
|
||||
|
||||
@@ -255,13 +256,8 @@ const HostSummary = ({
|
||||
// No tooltip if minimum version is not set, including all Windows, Linux, ChromeOS, Android operating systems
|
||||
if (!osVersionRequirement?.minimum_version) {
|
||||
const version = summaryData.os_version;
|
||||
const versionForRender = [
|
||||
"Arch Linux rolling",
|
||||
"Arch Linux ARM rolling",
|
||||
"Manjaro Linux rolling",
|
||||
"Manjaro Linux ARM rolling",
|
||||
].includes(version) ? (
|
||||
// wrap a tooltip aroun the "rolling" suffix
|
||||
const versionForRender = ROLLING_ARCH_LINUX_VERSIONS.includes(version) ? (
|
||||
// wrap a tooltip around the "rolling" suffix
|
||||
<>
|
||||
{version.slice(0, -8)}
|
||||
<TooltipWrapperArchLinuxRolling />
|
||||
|
||||
Reference in New Issue
Block a user