diff --git a/frontend/interfaces/activity.ts b/frontend/interfaces/activity.ts index 1fa7adc032..50d851c8c3 100644 --- a/frontend/interfaces/activity.ts +++ b/frontend/interfaces/activity.ts @@ -182,6 +182,7 @@ export interface IActivityDetails { deadline_days?: number; deadline?: string; email?: string; + enrollment_id?: string; global?: boolean; grace_period_days?: number; host_display_name?: string; @@ -201,6 +202,7 @@ export interface IActivityDetails { name?: string; pack_id?: number; pack_name?: string; + personal_host?: boolean; platform?: Platform; // software platform policy_id?: number; policy_name?: string; diff --git a/frontend/pages/DashboardPage/cards/ActivityFeed/GlobalActivityItem/GlobalActivityItem.tests.tsx b/frontend/pages/DashboardPage/cards/ActivityFeed/GlobalActivityItem/GlobalActivityItem.tests.tsx index 760539a36f..d2510c41c3 100644 --- a/frontend/pages/DashboardPage/cards/ActivityFeed/GlobalActivityItem/GlobalActivityItem.tests.tsx +++ b/frontend/pages/DashboardPage/cards/ActivityFeed/GlobalActivityItem/GlobalActivityItem.tests.tsx @@ -1001,7 +1001,7 @@ describe("Activity Feed", () => { ).toBeInTheDocument(); }); - it("renders a 'mdm_enrolled' type for apple with all details provided", () => { + it("renders a 'mdm_enrolled' type for apple with host serial provided and automatic enrollment provided", () => { const activity = createMockActivity({ type: ActivityType.MdmEnrolled, details: { @@ -1022,6 +1022,27 @@ describe("Activity Feed", () => { ).toBeInTheDocument(); }); + it("renders a 'mdm_enrolled' type for apple with host display name and personal enrollment provided", () => { + const activity = createMockActivity({ + type: ActivityType.MdmEnrolled, + details: { + host_display_name: "Test Host", + personal_host: true, + mdm_platform: "apple", + }, + }); + render(); + + expect( + screen.getByText((content, node) => { + return ( + node?.innerHTML === + "Test User An end user turned on MDM features for Test Host (personal)." + ); + }) + ).toBeInTheDocument(); + }); + it("renders a 'mdm_enrolled' type activity for windows hosts.", () => { const activity = createMockActivity({ type: ActivityType.MdmEnrolled, diff --git a/frontend/pages/DashboardPage/cards/ActivityFeed/GlobalActivityItem/GlobalActivityItem.tsx b/frontend/pages/DashboardPage/cards/ActivityFeed/GlobalActivityItem/GlobalActivityItem.tsx index 86a11b45bd..63fc289a7a 100644 --- a/frontend/pages/DashboardPage/cards/ActivityFeed/GlobalActivityItem/GlobalActivityItem.tsx +++ b/frontend/pages/DashboardPage/cards/ActivityFeed/GlobalActivityItem/GlobalActivityItem.tsx @@ -273,12 +273,27 @@ const TAGGED_TEMPLATES = { // note: if mdm_platform is missing, we assume this is Apple MDM for backwards // compatibility + let enrollmentTypeText = ""; + if (activity.details?.personal_host) { + enrollmentTypeText = "personal"; + } else if (activity.details?.installed_from_dep) { + enrollmentTypeText = "automatic"; + } else { + enrollmentTypeText = "manual"; + } + + const hostDisplayText = + activity.details?.host_display_name || activity.details?.host_serial; + + const hostDisplayPrefixText = activity.details?.host_display_name + ? "" + : "a host with serial number "; + return ( <> - An end user turned on MDM features for a host with serial number{" "} + An end user turned on MDM features for {hostDisplayPrefixText} - {activity.details?.host_serial} ( - {activity.details?.installed_from_dep ? "automatic" : "manual"}) + {hostDisplayText} ({enrollmentTypeText}) . diff --git a/frontend/pages/admin/IntegrationsPage/cards/MdmSettings/AppleBusinessManagerPage/components/AppleBusinessManagerTable/AppleBusinessManagerTableConfig.tsx b/frontend/pages/admin/IntegrationsPage/cards/MdmSettings/AppleBusinessManagerPage/components/AppleBusinessManagerTable/AppleBusinessManagerTableConfig.tsx index 03a633b599..1d2a988d81 100644 --- a/frontend/pages/admin/IntegrationsPage/cards/MdmSettings/AppleBusinessManagerPage/components/AppleBusinessManagerTable/AppleBusinessManagerTableConfig.tsx +++ b/frontend/pages/admin/IntegrationsPage/cards/MdmSettings/AppleBusinessManagerPage/components/AppleBusinessManagerTable/AppleBusinessManagerTableConfig.tsx @@ -9,6 +9,7 @@ import HeaderCell from "components/TableContainer/DataTable/HeaderCell"; import ActionsDropdown from "components/ActionsDropdown"; import TextCell from "components/TableContainer/DataTable/TextCell"; import TooltipWrapper from "components/TooltipWrapper"; +import GitOpsModeTooltipWrapper from "components/GitOpsModeTooltipWrapper"; import RenewDateCell from "../../../components/RenewDateCell"; import OrgNameCell from "./OrgNameCell"; @@ -163,12 +164,20 @@ export const generateTableConfig = ( // but we don't use it. accessor: "id", Cell: (cellProps) => ( - - actionSelectHandler(value, cellProps.row.original) - } - placeholder="Actions" + ( +
+ + actionSelectHandler(value, cellProps.row.original) + } + placeholder="Actions" + disabled={disableChildren} + /> +
+ )} /> ), }, diff --git a/frontend/pages/admin/IntegrationsPage/cards/MdmSettings/AppleBusinessManagerPage/components/AppleBusinessManagerTable/_styles.scss b/frontend/pages/admin/IntegrationsPage/cards/MdmSettings/AppleBusinessManagerPage/components/AppleBusinessManagerTable/_styles.scss index db84ef005b..d264477469 100644 --- a/frontend/pages/admin/IntegrationsPage/cards/MdmSettings/AppleBusinessManagerPage/components/AppleBusinessManagerTable/_styles.scss +++ b/frontend/pages/admin/IntegrationsPage/cards/MdmSettings/AppleBusinessManagerPage/components/AppleBusinessManagerTable/_styles.scss @@ -41,4 +41,13 @@ width: 140px; } } + + .disabled-by-gitops-mode { + @include disabled; + + .actions-dropdown-select__control--is-disabled { + min-height: 0; + padding: 0; + } + } } diff --git a/frontend/utilities/helpers.tsx b/frontend/utilities/helpers.tsx index 268c440e7c..f6ae5e9765 100644 --- a/frontend/utilities/helpers.tsx +++ b/frontend/utilities/helpers.tsx @@ -903,7 +903,7 @@ export const getGitOpsModeTipContent = (repoURL: string) => (
- GitOps mode enabled + (GitOps mode enabled) );