From d9cedcba8d39d10d3f7cd437af542ec5ff1ddd35 Mon Sep 17 00:00:00 2001 From: jacobshandling <61553566+jacobshandling@users.noreply.github.com> Date: Fri, 17 Oct 2025 14:01:03 -0700 Subject: [PATCH] Consolidate rolling linux version possibilities (#34467) **Related issue:** Resolves #34214 - [x] manual QA by @sgress454 --- frontend/interfaces/software.ts | 12 +++++++ .../cards/OperatingSystems/OSTableConfig.tsx | 12 +++---- .../SoftwareDetailsSummary.tsx | 17 +++++----- .../hosts/ManageHostsPage/HostTableConfig.tsx | 33 ++++++++----------- .../details/cards/HostSummary/HostSummary.tsx | 10 ++---- 5 files changed, 43 insertions(+), 41 deletions(-) diff --git a/frontend/interfaces/software.ts b/frontend/interfaces/software.ts index 91709fa51b..51e0ce5e69 100644 --- a/frontend/interfaces/software.ts +++ b/frontend/interfaces/software.ts @@ -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` +); diff --git a/frontend/pages/DashboardPage/cards/OperatingSystems/OSTableConfig.tsx b/frontend/pages/DashboardPage/cards/OperatingSystems/OSTableConfig.tsx index af6900474f..b85a17efa4 100644 --- a/frontend/pages/DashboardPage/cards/OperatingSystems/OSTableConfig.tsx +++ b/frontend/pages/DashboardPage/cards/OperatingSystems/OSTableConfig.tsx @@ -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 ( diff --git a/frontend/pages/SoftwarePage/components/cards/SoftwareDetailsSummary/SoftwareDetailsSummary.tsx b/frontend/pages/SoftwarePage/components/cards/SoftwareDetailsSummary/SoftwareDetailsSummary.tsx index b5fdf0dbbb..a6feb85f0c 100644 --- a/frontend/pages/SoftwarePage/components/cards/SoftwareDetailsSummary/SoftwareDetailsSummary.tsx +++ b/frontend/pages/SoftwarePage/components/cards/SoftwareDetailsSummary/SoftwareDetailsSummary.tsx @@ -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 = ({ )}

- {title === "Arch Linux rolling" || - title === "Arch Linux ARM rolling" || - title === "Manjaro Linux rolling" || - title === "Manjaro Linux ARM rolling" ? ( - - {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)} - + ) : ( title )} diff --git a/frontend/pages/hosts/ManageHostsPage/HostTableConfig.tsx b/frontend/pages/hosts/ManageHostsPage/HostTableConfig.tsx index 5eab71f850..91071d29d0 100644 --- a/frontend/pages/hosts/ManageHostsPage/HostTableConfig.tsx +++ b/frontend/pages/hosts/ManageHostsPage/HostTableConfig.tsx @@ -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 ( - - {value.slice(0, -7 /* removing lowercase rolling suffix */)} - - - } - /> - ); - } - return ; + 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)}  + + + ) : ( + os_version + ); + return ; }, }, { diff --git a/frontend/pages/hosts/details/cards/HostSummary/HostSummary.tsx b/frontend/pages/hosts/details/cards/HostSummary/HostSummary.tsx index 751c62010c..72d190a1ef 100644 --- a/frontend/pages/hosts/details/cards/HostSummary/HostSummary.tsx +++ b/frontend/pages/hosts/details/cards/HostSummary/HostSummary.tsx @@ -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)}