Skip to content

Commit 4e539e5

Browse files
fix copy for company owned unenrollment modal (#34026) (#34160)
See #34026 **Related issue:** Resolves #33807 Cherry pick PR: This is a quick fix to show the copy correctly for company enrolled unenrollment modal. We also improve the naming of the enrollment status checks <!-- Add the related story/sub-task/bug number, like Resolves #123, or remove if NA --> **Related issue:** Resolves #
1 parent 05825ee commit 4e539e5

File tree

6 files changed

+24
-17
lines changed

6 files changed

+24
-17
lines changed

frontend/interfaces/mdm.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -297,14 +297,22 @@ export const isBYODManualEnrollment = (
297297
return enrollmentStatus === "On (manual)";
298298
};
299299

300-
export const isBYODAccountDrivenEnrollment = (
300+
/** This checks if the device is enrolled via an Apple ID user enrollment.
301+
* We refer to that as "account driven user enrollment" */
302+
export const isBYODAccountDrivenUserEnrollment = (
301303
enrollmentStatus: MdmEnrollmentStatus | null
302304
) => {
303305
return enrollmentStatus === "On (personal)";
304306
};
305307

306-
export const isCompanyOwnedEnrollment = (
308+
/** This check is the device is enrolled via Automated Device Enrollment (ADE, also known as DEP)
309+
* This was previously known as automatic enrollment but was updatd to company owned. Here we check
310+
* for both to current and legacy enrollment status */
311+
export const isAutomaticDeviceEnrollment = (
307312
enrollmentStatus: MdmEnrollmentStatus | null
308313
) => {
309-
return enrollmentStatus === "On (company-owned)";
314+
return (
315+
enrollmentStatus === "On (company-owned)" ||
316+
enrollmentStatus === "On (automatic)"
317+
);
310318
};

frontend/pages/hosts/ManageHostsPage/HostTableConfig.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
isAppleDevice,
1212
isMobilePlatform,
1313
} from "interfaces/platform";
14-
import { isBYODAccountDrivenEnrollment } from "interfaces/mdm";
14+
import { isBYODAccountDrivenUserEnrollment } from "interfaces/mdm";
1515

1616
import TooltipWrapperArchLinuxRolling from "components/TooltipWrapperArchLinuxRolling";
1717
import Checkbox from "components/forms/fields/Checkbox";
@@ -67,6 +67,7 @@ const condenseDeviceUsers = (users: IDeviceUser[]): string[] => {
6767
users.length === 4
6868
? users
6969
.slice(-4)
70+
7071
.map((u) => u.email)
7172
.reverse()
7273
: users
@@ -644,7 +645,7 @@ const allHostTableHeaders: IHostTableColumnConfig[] = [
644645
// TODO(android): is iOS/iPadOS supported?
645646
if (
646647
isAndroid(cellProps.row.original.platform) ||
647-
isBYODAccountDrivenEnrollment(
648+
isBYODAccountDrivenUserEnrollment(
648649
cellProps.row.original.mdm.enrollment_status
649650
)
650651
) {

frontend/pages/hosts/details/HostDetailsPage/HostActionsDropdown/helpers.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
} from "interfaces/platform";
1212
import { isScriptSupportedPlatform } from "interfaces/script";
1313
import {
14-
isBYODAccountDrivenEnrollment,
14+
isBYODAccountDrivenUserEnrollment,
1515
MdmEnrollmentStatus,
1616
} from "interfaces/mdm";
1717

@@ -184,7 +184,7 @@ const canWipeHost = ({
184184
// in MDM. These hosts cannot be wiped.
185185
const isAccountDrivenEnrolledIosOrIpadosDevice =
186186
isIPadOrIPhone(hostPlatform) &&
187-
isBYODAccountDrivenEnrollment(hostMdmEnrollmentStatus);
187+
isBYODAccountDrivenUserEnrollment(hostMdmEnrollmentStatus);
188188

189189
return (
190190
isPremiumTier &&

frontend/pages/hosts/details/HostDetailsPage/HostDetailsPage.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ import {
4242
IHostCertificate,
4343
CERTIFICATES_DEFAULT_SORT,
4444
} from "interfaces/certificates";
45-
import { isBYODAccountDrivenEnrollment } from "interfaces/mdm";
45+
import { isBYODAccountDrivenUserEnrollment } from "interfaces/mdm";
4646

4747
import { normalizeEmptyValues, wrapFleetHelper } from "utilities/helpers";
4848
import permissions from "utilities/permissions";
@@ -66,7 +66,6 @@ import TabNav from "components/TabNav";
6666
import TabText from "components/TabText";
6767
import MainContent, { IMainContentConfig } from "components/MainContent";
6868
import BackButton from "components/BackButton";
69-
import Card from "components/Card";
7069
import CustomLink from "components/CustomLink/CustomLink";
7170
import EmptyTable from "components/EmptyTable";
7271

@@ -1024,7 +1023,7 @@ const HostDetailsPage = ({
10241023
{/* There is a special case for BYOD account driven enrolled mdm hosts where we are not
10251024
currently supporting software installs. This check should be removed
10261025
when we add that feature. */}
1027-
{isBYODAccountDrivenEnrollment(host.mdm.enrollment_status) ? (
1026+
{isBYODAccountDrivenUserEnrollment(host.mdm.enrollment_status) ? (
10281027
<EmptyTable
10291028
header="Software library is currently not supported on this host."
10301029
info={

frontend/pages/hosts/details/HostDetailsPage/modals/UnenrollMdmModal/UnenrollMdmModal.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,13 @@ import DataError from "components/DataError";
44
import Button from "components/buttons/Button";
55
import Modal from "components/Modal";
66
import { NotificationContext } from "context/notification";
7-
import CustomLink from "components/CustomLink";
87

98
import mdmAPI from "services/entities/mdm";
109
import { isAndroid, isIPadOrIPhone } from "interfaces/platform";
1110
import {
12-
isBYODAccountDrivenEnrollment,
11+
isAutomaticDeviceEnrollment,
12+
isBYODAccountDrivenUserEnrollment,
1313
isBYODManualEnrollment,
14-
isCompanyOwnedEnrollment,
1514
MdmEnrollmentStatus,
1615
} from "interfaces/mdm";
1716

@@ -81,7 +80,7 @@ const UnenrollMdmModal = ({
8180
share the link with end user.
8281
</p>
8382
);
84-
} else if (isBYODAccountDrivenEnrollment(enrollmentStatus)) {
83+
} else if (isBYODAccountDrivenUserEnrollment(enrollmentStatus)) {
8584
return (
8685
<p>
8786
To re-enroll, ask your end user to navigate to{" "}
@@ -92,7 +91,7 @@ const UnenrollMdmModal = ({
9291
on their host and to log in with their work email.
9392
</p>
9493
);
95-
} else if (isCompanyOwnedEnrollment(enrollmentStatus)) {
94+
} else if (isAutomaticDeviceEnrollment(enrollmentStatus)) {
9695
return (
9796
<p>
9897
To re-enroll, make sure that the host is still in Apple Business

frontend/pages/hosts/details/cards/About/About.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import classnames from "classnames";
44
import { IHostMdmData, IMunkiData } from "interfaces/host";
55
import { isAndroid, isIPadOrIPhone } from "interfaces/platform";
66
import {
7-
isBYODAccountDrivenEnrollment,
7+
isBYODAccountDrivenUserEnrollment,
88
MDM_ENROLLMENT_STATUS_UI_MAP,
99
} from "interfaces/mdm";
1010
import {
@@ -55,7 +55,7 @@ const About = ({ aboutData, munki, mdm, className }: IAboutProps) => {
5555
// for all host types, we show the Enrollment ID dataset if the host
5656
// is enrolled in MDM personally. Personal (BYOD) devices do not report
5757
// their serial numbers, so we show the Enrollment ID instead.
58-
if (mdm && isBYODAccountDrivenEnrollment(mdm.enrollment_status)) {
58+
if (mdm && isBYODAccountDrivenUserEnrollment(mdm.enrollment_status)) {
5959
deviceIdDataSet = (
6060
<DataSet
6161
title={

0 commit comments

Comments
 (0)