mirror of
https://github.com/fleetdm/fleet
synced 2026-05-22 16:39:01 +00:00
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
56 lines
1.3 KiB
TypeScript
56 lines
1.3 KiB
TypeScript
import React, { useContext } from "react";
|
|
import PATHS from "router/paths";
|
|
|
|
import { AppContext } from "context/app";
|
|
import EmptyTable from "components/EmptyTable";
|
|
import Button from "components/buttons/Button";
|
|
import { InjectedRouter } from "react-router";
|
|
|
|
const baseClass = "turn-on-mdm-message";
|
|
|
|
interface ITurnOnMdmMessageProps {
|
|
router: InjectedRouter;
|
|
/** Default: Manage your hosts */
|
|
header?: string;
|
|
/** Default: MDM must be turned on to change settings on your hosts. */
|
|
info?: string;
|
|
buttonText?: string;
|
|
}
|
|
|
|
const TurnOnMdmMessage = ({
|
|
router,
|
|
header,
|
|
info,
|
|
buttonText = "Turn on",
|
|
}: ITurnOnMdmMessageProps) => {
|
|
const { isGlobalAdmin } = useContext(AppContext);
|
|
|
|
const onConnectClick = () => {
|
|
router.push(PATHS.ADMIN_INTEGRATIONS_MDM);
|
|
};
|
|
|
|
const renderConnectButton = () => {
|
|
return isGlobalAdmin ? (
|
|
<Button
|
|
variant="brand"
|
|
onClick={onConnectClick}
|
|
className={`${baseClass}__connectAPC-button`}
|
|
>
|
|
{buttonText}
|
|
</Button>
|
|
) : (
|
|
<></>
|
|
);
|
|
};
|
|
|
|
return (
|
|
<EmptyTable
|
|
className={baseClass}
|
|
header={header || "Manage your hosts"}
|
|
info={info || "MDM must be turned on to change settings on your hosts."}
|
|
primaryButton={renderConnectButton()}
|
|
/>
|
|
);
|
|
};
|
|
|
|
export default TurnOnMdmMessage;
|