Feat UI byod landing page (#26592)
For #26211 and #26210 Add Android to byod enrollment landing page. this includes: **new android section in add hosts modal:**  **messaging when visiting from non android, ios, ipad device:**  **enroll into android mdm UI:**  **various error states (secret is invalid, android or mac os mdm not enabled):**    - [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
This commit is contained in:
@@ -0,0 +1,55 @@
|
||||
import React, { useContext } from "react";
|
||||
import { Link } from "react-router";
|
||||
|
||||
import PATHS from "router/paths";
|
||||
import { AppContext } from "context/app";
|
||||
|
||||
// @ts-ignore
|
||||
import InputField from "components/forms/fields/InputField";
|
||||
|
||||
const generateUrl = (serverUrl: string, enrollSecret: string) => {
|
||||
return `${serverUrl}/enroll?enroll_secret=${encodeURIComponent(
|
||||
enrollSecret
|
||||
)}`;
|
||||
};
|
||||
|
||||
const baseClass = "android-panel";
|
||||
|
||||
interface IAndroidPanelProps {
|
||||
enrollSecret: string;
|
||||
}
|
||||
|
||||
const AndroidPanel = ({ enrollSecret }: IAndroidPanelProps) => {
|
||||
const { config, isAndroidMdmEnabledAndConfigured } = useContext(AppContext);
|
||||
|
||||
if (!config) return null;
|
||||
|
||||
if (!isAndroidMdmEnabledAndConfigured) {
|
||||
return (
|
||||
<p>
|
||||
<Link to={PATHS.ADMIN_INTEGRATIONS_MDM_ANDROID}>
|
||||
Turn on Android MDM
|
||||
</Link>{" "}
|
||||
to enroll Android hosts.
|
||||
</p>
|
||||
);
|
||||
}
|
||||
|
||||
const url = generateUrl(config.server_settings.server_url, enrollSecret);
|
||||
|
||||
return (
|
||||
<div className={baseClass}>
|
||||
<InputField
|
||||
label="Send this to your end users:"
|
||||
enableCopy
|
||||
copyButtonPosition="inside"
|
||||
readOnly
|
||||
inputWrapperClass
|
||||
name="enroll-link"
|
||||
value={url}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default AndroidPanel;
|
||||
Reference in New Issue
Block a user