From b993da7967abd33c7325024ca5e6bbbff17a429c Mon Sep 17 00:00:00 2001
From: Steven Palmesano <3100993+spalmesano0@users.noreply.github.com>
Date: Mon, 1 Jun 2026 13:16:56 -0500
Subject: [PATCH] Use new MDM status on hosts page and show tooltip; show "Not
supported" for Linux (#46377)
**Related issue:** Resolves #46066
# Checklist for submitter
- [x] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/changes`.
## Testing
- [x] QA'd all new/changed functionality manually
## Summary by CodeRabbit
* **Bug Fixes**
* Corrected MDM status label in the hosts table so enrollment states
display accurately.
* Fixed platform handling so "Not supported" appears appropriately for
Chrome and Linux hosts.
* **New Features**
* Added a hover tooltip on the MDM status in the hosts table to show
additional context.
* **Style**
* Improved tooltip text wrapping to keep status names on a single line.
---
.../46066-fix-on-automatic-mdm-status-display | 2 +
.../HostMdmStatusCell.tests.tsx | 60 +++++++++++++++++++
.../HostMdmStatusCell/HostMdmStatusCell.tsx | 28 +++++++--
.../DataTable/HostMdmStatusCell/_styles.scss | 5 ++
4 files changed, 91 insertions(+), 4 deletions(-)
create mode 100644 changes/46066-fix-on-automatic-mdm-status-display
create mode 100644 frontend/components/TableContainer/DataTable/HostMdmStatusCell/HostMdmStatusCell.tests.tsx
diff --git a/changes/46066-fix-on-automatic-mdm-status-display b/changes/46066-fix-on-automatic-mdm-status-display
new file mode 100644
index 0000000000..4a72d7c275
--- /dev/null
+++ b/changes/46066-fix-on-automatic-mdm-status-display
@@ -0,0 +1,2 @@
+* Fixed MDM status column in the host table showing "On (automatic)" instead of "On (company-owned)".
+* Added hosts page tooltip to MDM status on hover.
diff --git a/frontend/components/TableContainer/DataTable/HostMdmStatusCell/HostMdmStatusCell.tests.tsx b/frontend/components/TableContainer/DataTable/HostMdmStatusCell/HostMdmStatusCell.tests.tsx
new file mode 100644
index 0000000000..2917951b49
--- /dev/null
+++ b/frontend/components/TableContainer/DataTable/HostMdmStatusCell/HostMdmStatusCell.tests.tsx
@@ -0,0 +1,60 @@
+import React from "react";
+import { render, screen } from "@testing-library/react";
+
+import createMockHost from "__mocks__/hostMock";
+import { MdmEnrollmentStatus } from "interfaces/mdm";
+import HostMdmStatusCell from "./HostMdmStatusCell";
+
+const renderCell = (platform: string, value?: MdmEnrollmentStatus) => {
+ const host = createMockHost({ platform } as any);
+ return render(
+
+ );
+};
+
+describe("HostMdmStatusCell", () => {
+ it("renders 'Not supported' for Chrome hosts", () => {
+ renderCell("chrome");
+ expect(screen.getByText("Not supported")).toBeInTheDocument();
+ });
+
+ it("renders 'Not supported' for Linux hosts", () => {
+ renderCell("ubuntu");
+ expect(screen.getByText("Not supported")).toBeInTheDocument();
+ });
+
+ it("renders 'On (manual)' for Apple hosts with manual enrollment", () => {
+ renderCell("darwin", "On (manual)");
+ expect(screen.getByText("On (manual)")).toBeInTheDocument();
+ });
+
+ it("renders 'On (company-owned)' for Apple hosts with automatic enrollment", () => {
+ renderCell("darwin", "On (automatic)");
+ expect(screen.getByText("On (company-owned)")).toBeInTheDocument();
+ });
+
+ it("renders 'On (personal)' for iOS hosts with personal enrollment", () => {
+ renderCell("ios", "On (personal)");
+ expect(screen.getByText("On (personal)")).toBeInTheDocument();
+ });
+
+ it("renders 'Pending' for macOS hosts with pending enrollment", () => {
+ renderCell("darwin", "Pending");
+ expect(screen.getByText("Pending")).toBeInTheDocument();
+ });
+
+ it("renders the MDM status for Android hosts", () => {
+ renderCell("android", "On (personal)");
+ expect(screen.getByText("On (personal)")).toBeInTheDocument();
+ });
+
+ it("renders the MDM status for Windows hosts", () => {
+ renderCell("windows", "On (manual)");
+ expect(screen.getByText("On (manual)")).toBeInTheDocument();
+ });
+
+ it("renders 'Off' for Windows hosts with no MDM enrollment", () => {
+ renderCell("windows", "Off");
+ expect(screen.getByText("Off")).toBeInTheDocument();
+ });
+});
diff --git a/frontend/components/TableContainer/DataTable/HostMdmStatusCell/HostMdmStatusCell.tsx b/frontend/components/TableContainer/DataTable/HostMdmStatusCell/HostMdmStatusCell.tsx
index bbd8755825..efe9dcb2fe 100644
--- a/frontend/components/TableContainer/DataTable/HostMdmStatusCell/HostMdmStatusCell.tsx
+++ b/frontend/components/TableContainer/DataTable/HostMdmStatusCell/HostMdmStatusCell.tsx
@@ -1,11 +1,19 @@
import React from "react";
-import { DEFAULT_EMPTY_CELL_VALUE } from "utilities/constants";
+import {
+ DEFAULT_EMPTY_CELL_VALUE,
+ MDM_STATUS_TOOLTIP,
+} from "utilities/constants";
import paths from "router/paths";
import Icon from "components/Icon";
import CustomLink from "components/CustomLink";
import NotSupported from "components/NotSupported";
import TooltipWrapper from "components/TooltipWrapper";
import { IHost } from "interfaces/host";
+import {
+ MDM_ENROLLMENT_STATUS_UI_MAP,
+ MdmEnrollmentStatus,
+} from "interfaces/mdm";
+import { isChrome, isLinuxLike } from "interfaces/platform";
const baseClass = "host-mdm-status-cell";
@@ -16,9 +24,9 @@ const HostMdmStatusCell = ({
cell: { value },
}: {
row: { original: IHost };
- cell: { value: string };
+ cell: { value: MdmEnrollmentStatus };
}): JSX.Element => {
- if (platform === "chrome") {
+ if (isChrome(platform) || isLinuxLike(platform)) {
return NotSupported;
}
@@ -26,9 +34,21 @@ const HostMdmStatusCell = ({
return {DEFAULT_EMPTY_CELL_VALUE};
}
+ const displayValue =
+ MDM_ENROLLMENT_STATUS_UI_MAP[value]?.displayName ?? value;
+
return (
- {value}
+ {!MDM_STATUS_TOOLTIP[value] ? (
+ displayValue
+ ) : (
+
+ {displayValue}
+
+ )}
{mdm?.dep_profile_error && (