diff --git a/frontend/pages/ManageControlsPage/SetupExperience/cards/SetupAssistant/SetupAssistant.tsx b/frontend/pages/ManageControlsPage/SetupExperience/cards/SetupAssistant/SetupAssistant.tsx index 44117f07686c..59fe7878a186 100644 --- a/frontend/pages/ManageControlsPage/SetupExperience/cards/SetupAssistant/SetupAssistant.tsx +++ b/frontend/pages/ManageControlsPage/SetupExperience/cards/SetupAssistant/SetupAssistant.tsx @@ -2,7 +2,7 @@ import React, { useState } from "react"; import { useQuery } from "react-query"; import { IConfig } from "interfaces/config"; -import { API_NO_TEAM_ID, ITeamConfig } from "interfaces/team"; +import team, { API_NO_TEAM_ID, ITeam, ITeamConfig } from "interfaces/team"; import configAPI from "services/entities/config"; import teamsAPI, { ILoadTeamResponse } from "services/entities/teams"; @@ -45,6 +45,15 @@ const StartupAssistant = ({ currentTeamId }: ISetupAssistantProps) => { select: (res) => res.team, }); + const getReleaseDeviceSetting = () => { + if (currentTeamId === API_NO_TEAM_ID) { + return ( + globalConfig?.mdm.macos_setup.enable_release_device_manually || false + ); + } + return teamConfig?.mdm?.macos_setup.enable_release_device_manually || false; + }; + const isLoading = false; const noPackageUploaded = true; @@ -53,6 +62,8 @@ const StartupAssistant = ({ currentTeamId }: ISetupAssistantProps) => { const onDelete = () => {}; + const defaultReleaseDeviceSetting = getReleaseDeviceSetting(); + return (
@@ -82,7 +93,11 @@ const StartupAssistant = ({ currentTeamId }: ISetupAssistantProps) => { onDelete={() => setShowDeleteProfileModal(true)} /> )} - +
diff --git a/frontend/pages/ManageControlsPage/SetupExperience/cards/SetupAssistant/components/AdvancedOptionsForm/AdvancedOptionsForm.tsx b/frontend/pages/ManageControlsPage/SetupExperience/cards/SetupAssistant/components/AdvancedOptionsForm/AdvancedOptionsForm.tsx index 9d615b236d6d..0075b8e64bb9 100644 --- a/frontend/pages/ManageControlsPage/SetupExperience/cards/SetupAssistant/components/AdvancedOptionsForm/AdvancedOptionsForm.tsx +++ b/frontend/pages/ManageControlsPage/SetupExperience/cards/SetupAssistant/components/AdvancedOptionsForm/AdvancedOptionsForm.tsx @@ -12,11 +12,15 @@ const baseClass = "advanced-options-form"; interface IAdvancedOptionsFormProps { currentTeamId: number; + defaultReleaseDevice: boolean; } -const AdvancedOptionsForm = ({ currentTeamId }: IAdvancedOptionsFormProps) => { +const AdvancedOptionsForm = ({ + currentTeamId, + defaultReleaseDevice, +}: IAdvancedOptionsFormProps) => { const [showAdvancedOptions, setShowAdvancedOptions] = useState(false); - const [releaseDevice, setReleaseDevice] = useState(false); + const [releaseDevice, setReleaseDevice] = useState(defaultReleaseDevice); const { renderFlash } = useContext(NotificationContext); const accordionText = showAdvancedOptions ? "Hide" : "Show";