block self service on personal enrollments (#41054)

<!-- Add the related story/sub-task/bug number, like Resolves #123, or
remove if NA -->
**Related issue:** Resolves #38593 

<img width="375" height="667" alt="My device Fleet 2"
src="https://github.com/user-attachments/assets/e5db8607-761f-40e8-befb-59a0fbdd7aac"
/>

_There was no figma, so wasn't sure if the boldness and spacing is
correct, but just used default values._

# Checklist for submitter

If some of the following don't apply, delete the relevant line.

- [x] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/changes`.
See [Changes
files](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/guides/committing-changes.md#changes-files)
for more information.

## Testing

- [x] Added/updated automated tests
- [x] QA'd all new/changed functionality manually
This commit is contained in:
Magnus Jensen
2026-03-06 10:23:15 -05:00
committed by GitHub
parent d8461dbca5
commit 56e03337bd
5 changed files with 56 additions and 1 deletions
@@ -0,0 +1 @@
* Fixed an issue where personal iOS and iPadOS enrollments could see software in the self-service webclip.
@@ -667,6 +667,7 @@ const DeviceUserPage = ({
hostSoftwareUpdatedAt={host.software_updated_at}
hostDisplayName={host?.hostname || ""}
isMobileView={shouldShowMobileUI}
mdmEnrollmentStatus={host.mdm.enrollment_status || "Off"}
/>
</div>
</div>
@@ -747,6 +748,7 @@ const DeviceUserPage = ({
isHostDetailsPolling={showRefetchSpinner}
hostSoftwareUpdatedAt={host.software_updated_at}
hostDisplayName={host?.hostname || ""}
mdmEnrollmentStatus={host.mdm.enrollment_status || "Off"}
/>
</TabPanel>
)}
@@ -46,6 +46,7 @@ const TEST_PROPS: ISoftwareSelfServiceProps = {
refetchHostDetails: noop,
isHostDetailsPolling: false,
hostDisplayName: DEFAULT_HOST_HOSTNAME,
mdmEnrollmentStatus: "Off",
};
describe("SelfService", () => {
@@ -274,4 +275,25 @@ describe("SelfService", () => {
const moreDropdown = getMoreDropdown();
expect(moreDropdown).toBeDisabled();
});
it("renders self service unsupported message for BYOD Account-Driven User Enrollment on mobile view", () => {
const render = createCustomRenderer({ withBackendMock: true });
render(
<SelfService
{...TEST_PROPS}
isMobileView
mdmEnrollmentStatus="On (personal)"
/>
);
expect(
screen.getByText(/Self-service isn't supported/i)
).toBeInTheDocument();
expect(
screen.getByText(
/Self-service is currently not supported on personal iOS and iPadOS devices/i
)
).toBeInTheDocument();
});
});
@@ -17,7 +17,6 @@ import {
IHostSoftware,
IDeviceSoftwareWithUiStatus,
IVPPHostSoftware,
NO_VERSION_OR_HOST_DATA_SOURCES,
} from "interfaces/software";
import deviceApi, {
@@ -36,6 +35,10 @@ import SoftwareIpaInstallDetailsModal from "components/ActivityDetails/InstallDe
import SoftwareScriptDetailsModal from "components/ActivityDetails/InstallDetails/SoftwareScriptDetailsModal";
import { VppInstallDetailsModal } from "components/ActivityDetails/InstallDetails/VppInstallDetailsModal/VppInstallDetailsModal";
import { getDisplayedSoftwareName } from "pages/SoftwarePage/helpers";
import {
isBYODAccountDrivenUserEnrollment,
MdmEnrollmentStatus,
} from "interfaces/mdm";
import UpdatesCard from "./components/UpdatesCard/UpdatesCard";
import SelfServiceCard from "./SelfServiceCard/SelfServiceCard";
@@ -86,6 +89,7 @@ export interface ISoftwareSelfServiceProps {
hostSoftwareUpdatedAt?: string | null;
hostDisplayName: string;
isMobileView?: boolean;
mdmEnrollmentStatus: MdmEnrollmentStatus;
}
export const parseSelfServiceQueryParams = (queryParams: {
@@ -142,6 +146,7 @@ const SoftwareSelfService = ({
hostSoftwareUpdatedAt,
hostDisplayName,
isMobileView = false,
mdmEnrollmentStatus,
}: ISoftwareSelfServiceProps) => {
const { renderFlash, renderMultiFlash } = useContext(NotificationContext);
@@ -666,6 +671,18 @@ const SoftwareSelfService = ({
onClickOpenInstructionsAction,
]);
if (isMobileView && isBYODAccountDrivenUserEnrollment(mdmEnrollmentStatus)) {
return (
<div className="unsupported-self-service">
<p className="header">Self-service isn&apos;t supported</p>
<p>
Self-service is currently not supported on personal iOS and iPadOS
devices (enrolled with Managed Apple Account).
</p>
</div>
);
}
if (isMobileView)
return (
<SelfServiceCard
@@ -114,3 +114,16 @@
}
}
}
.unsupported-self-service {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
min-height: 100vh;
text-align: center;
.header {
font-weight: $bold;
}
}