Skip to content

Commit

Permalink
better messaging for setup experience when mdm is turned off (#23008)
Browse files Browse the repository at this point in the history
relates to #18508

add better messaging when apple mdm is disabled don't he setup
experience tab. This feature is currently only macos only so we have
better messaging for users about this.

<img width="841" alt="image"
src="https://github.com/user-attachments/assets/9e2c9cec-b272-4acd-8058-6d04eab055d8">

- [x] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/changes`.
- [x] Manual QA for all new/changed functionality
  • Loading branch information
ghernandez345 authored Oct 21, 2024
1 parent 5c3d324 commit dae2977
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 6 deletions.
11 changes: 9 additions & 2 deletions frontend/components/TurnOnMdmMessage/TurnOnMdmMessage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,15 @@ interface ITurnOnMdmMessageProps {
header?: string;
/** Default: MDM must be turned on to change settings on your hosts. */
info?: string;
buttonText?: string;
}

const TurnOnMdmMessage = ({ router, header, info }: ITurnOnMdmMessageProps) => {
const TurnOnMdmMessage = ({
router,
header,
info,
buttonText = "Turn on",
}: ITurnOnMdmMessageProps) => {
const { isGlobalAdmin } = useContext(AppContext);

const onConnectClick = () => {
Expand All @@ -30,7 +36,7 @@ const TurnOnMdmMessage = ({ router, header, info }: ITurnOnMdmMessageProps) => {
onClick={onConnectClick}
className={`${baseClass}__connectAPC-button`}
>
Turn on
{buttonText}
</Button>
) : (
<></>
Expand All @@ -39,6 +45,7 @@ const TurnOnMdmMessage = ({ router, header, info }: ITurnOnMdmMessageProps) => {

return (
<EmptyTable
className={baseClass}
header={header || "Manage your hosts"}
info={info || "MDM must be turned on to change settings on your hosts."}
primaryButton={renderConnectButton()}
Expand Down
3 changes: 3 additions & 0 deletions frontend/components/TurnOnMdmMessage/_styles.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.turn-on-mdm-message {
max-width: 520px;
}
2 changes: 0 additions & 2 deletions frontend/context/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -339,8 +339,6 @@ const reducer = (state: InitialStateType, action: IAction) => {
}
case ACTIONS.SET_CONFIG: {
const { config } = action;
// config.sandbox_enabled = true; // TODO: uncomment for sandbox dev

return {
...state,
config,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const SetupEmptyState = ({ router }: ISetupEmptyState) => {
interface ISetupExperienceProps {
params: Params;
location: { search: string };
router: any;
router: InjectedRouter;
teamIdForApi: number;
}

Expand All @@ -63,7 +63,14 @@ const SetupExperience = ({

// MDM is not on so show messaging for user to enable it.
if (!config?.mdm.enabled_and_configured) {
return <TurnOnMdmMessage router={router} />;
return (
<TurnOnMdmMessage
header="Manage setup experience for macOS"
info="To install software and run scripts when Macs first boot, first turn on automatic enrollment."
buttonText="Turn on"
router={router}
/>
);
}
// User has not set up Apple Business Manager.
if (!config?.mdm.apple_bm_enabled_and_configured) {
Expand Down

0 comments on commit dae2977

Please sign in to comment.