Remove Android feature flag from frontend (#29890)
Fixes #26519 - Removed Android feature flag from the frontend - Added custom error message when Android enterprise already exists, per https://fleetdm.slack.com/archives/C084F4MKYSJ/p1748981589180829?thread_ts=1748638333.353069&cid=C084F4MKYSJ # Checklist for submitter - [x] Manual QA for all new/changed functionality
This commit is contained in:
@@ -59,7 +59,6 @@
|
||||
"source_arn": "some-ses-arn"
|
||||
}
|
||||
},
|
||||
"android_enabled": true,
|
||||
"org_info": {
|
||||
"org_name": "Fleet",
|
||||
"org_logo_url": "http://some-org-logo-url.com",
|
||||
|
||||
@@ -68,7 +68,6 @@ export const DEFAULT_LICENSE_MOCK: ILicense = {
|
||||
};
|
||||
|
||||
const DEFAULT_CONFIG_MOCK: IConfig = {
|
||||
android_enabled: false, // TODO: feature flag, remove when feature releases.
|
||||
org_info: {
|
||||
org_name: "fleet",
|
||||
org_logo_url: "",
|
||||
|
||||
@@ -101,8 +101,7 @@ const App = ({ children, location }: IAppProps): JSX.Element => {
|
||||
enabled:
|
||||
false && // TODO: reenable when the BE is completed
|
||||
!!isGlobalAdmin &&
|
||||
!!config?.mdm.android_enabled_and_configured &&
|
||||
config?.android_enabled, // TODO: remove android feature flag
|
||||
!!config?.mdm.android_enabled_and_configured,
|
||||
onSuccess: () => {
|
||||
setAndroidEnterpriseDeleted(false);
|
||||
},
|
||||
|
||||
@@ -112,7 +112,6 @@ export interface IConfigServerSettings {
|
||||
}
|
||||
|
||||
export interface IConfig {
|
||||
android_enabled: boolean; // TODO: feature flag, remove when feature releases.
|
||||
org_info: {
|
||||
org_name: string;
|
||||
org_logo_url: string;
|
||||
|
||||
@@ -193,14 +193,6 @@ const DashboardPage = ({ router, location }: IDashboardProps): JSX.Element => {
|
||||
IConfig
|
||||
>(["config"], () => configAPI.loadAll(), { ...DEFAULT_USE_QUERY_OPTIONS });
|
||||
|
||||
// TODO(android): remove this when the feature flag is removed
|
||||
const platformOptions = useMemo(() => {
|
||||
if (!config?.android_enabled) {
|
||||
return PLATFORM_DROPDOWN_OPTIONS.filter((o) => o.value !== "android");
|
||||
}
|
||||
return [...PLATFORM_DROPDOWN_OPTIONS];
|
||||
}, [config?.android_enabled]);
|
||||
|
||||
const { data: teams, isLoading: isLoadingTeams } = useQuery<
|
||||
ILoadTeamsResponse,
|
||||
Error,
|
||||
@@ -566,7 +558,6 @@ const DashboardPage = ({ router, location }: IDashboardProps): JSX.Element => {
|
||||
) : (
|
||||
<>
|
||||
<PlatformHostCounts
|
||||
androidDevEnabled={!!config?.android_enabled}
|
||||
currentTeamId={teamIdForApi}
|
||||
macCount={macCount}
|
||||
windowsCount={windowsCount}
|
||||
@@ -896,7 +887,7 @@ const DashboardPage = ({ router, location }: IDashboardProps): JSX.Element => {
|
||||
name="platform-filter"
|
||||
value={selectedPlatform || ""}
|
||||
className={`${baseClass}__platform-filter`}
|
||||
options={platformOptions}
|
||||
options={[...PLATFORM_DROPDOWN_OPTIONS]}
|
||||
onChange={(option: SingleValue<CustomOptionType>) => {
|
||||
const selectedPlatformOption = PLATFORM_DROPDOWN_OPTIONS.find(
|
||||
(platform) => platform.value === option?.value
|
||||
|
||||
@@ -14,7 +14,6 @@ import HostCountCard from "../../cards/HostCountCard";
|
||||
const baseClass = "platform-host-counts";
|
||||
|
||||
interface IPlatformHostCountsProps {
|
||||
androidDevEnabled: boolean; // TODO(android): remove when feature flag is removed
|
||||
currentTeamId: number | undefined;
|
||||
macCount: number;
|
||||
windowsCount: number;
|
||||
@@ -29,7 +28,6 @@ interface IPlatformHostCountsProps {
|
||||
}
|
||||
|
||||
const PlatformHostCounts = ({
|
||||
androidDevEnabled,
|
||||
currentTeamId,
|
||||
macCount,
|
||||
windowsCount,
|
||||
@@ -192,11 +190,6 @@ const PlatformHostCounts = ({
|
||||
};
|
||||
|
||||
const renderAndroidCount = (teamId?: number) => {
|
||||
if (!androidDevEnabled) {
|
||||
// TODO(android): remove when feature flag is removed
|
||||
return null;
|
||||
}
|
||||
|
||||
const androidLabelId = getBuiltinLabelId("android");
|
||||
|
||||
if (hidePlatformCard(androidCount)) {
|
||||
|
||||
+22
-3
@@ -12,7 +12,7 @@ import PATHS from "router/paths";
|
||||
import { AppContext } from "context/app";
|
||||
import { NotificationContext } from "context/notification";
|
||||
import mdmAndroidAPI from "services/entities/mdm_android";
|
||||
import { DEFAULT_USE_QUERY_OPTIONS } from "utilities/constants";
|
||||
import { DEFAULT_USE_QUERY_OPTIONS, SUPPORT_LINK } from "utilities/constants";
|
||||
|
||||
import MainContent from "components/MainContent";
|
||||
import BackLink from "components/BackLink";
|
||||
@@ -89,8 +89,27 @@ const TurnOnAndroidMdm = ({ router }: ITurnOnAndroidMdmProps) => {
|
||||
`width=${POPUP_WIDTH},height=${POPUP_HEIGHT},top=${top},left=${left}`
|
||||
);
|
||||
setSetupSse(true);
|
||||
} catch (e) {
|
||||
renderFlash("error", "Couldn't connect. Please try again");
|
||||
} catch (e: any) {
|
||||
if (
|
||||
e.data?.errors &&
|
||||
e.data.errors[0].reason?.includes("android enterprise already exists")
|
||||
) {
|
||||
renderFlash(
|
||||
"error",
|
||||
<>
|
||||
Couldn't connect. Android enterprise already exists for this
|
||||
Fleet server. For help, please contact{" "}
|
||||
<CustomLink
|
||||
text="Fleet support"
|
||||
url={SUPPORT_LINK}
|
||||
newTab
|
||||
variant="flash-message-link"
|
||||
/>
|
||||
</>
|
||||
);
|
||||
} else {
|
||||
renderFlash("error", "Couldn't connect. Please try again");
|
||||
}
|
||||
}
|
||||
setFetchingSignupUrl(false);
|
||||
};
|
||||
|
||||
+4
-7
@@ -67,13 +67,10 @@ const MdmSettingsSection = ({
|
||||
turnOnWindowsMdm={navigateToWindowsMdm}
|
||||
editWindowsMdm={navigateToWindowsMdm}
|
||||
/>
|
||||
{/* TODO: feature flag check, remove when feature releases */}
|
||||
{config?.android_enabled && (
|
||||
<AndroidMdmCard
|
||||
turnOffAndroidMdm={navigateToAndroidMdm}
|
||||
editAndroidMdm={navigateToAndroidMdm}
|
||||
/>
|
||||
)}
|
||||
<AndroidMdmCard
|
||||
turnOffAndroidMdm={navigateToAndroidMdm}
|
||||
editAndroidMdm={navigateToAndroidMdm}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -260,8 +260,6 @@
|
||||
// using string comparison to satisfy the linter.
|
||||
const ANDROID_MDM_ENABLED = "{{.AndroidMDMEnabled}}" === "true";
|
||||
const MAC_MDM_ENABLED = "{{.MacMDMEnabled}}" == "true";
|
||||
// TODO: remove android feature flag
|
||||
const ANDROID_FEATURE_ENABLED = "{{.AndroidFeatureEnabled}}" === "true";
|
||||
|
||||
const getPlatform = () => {
|
||||
const userAgent = navigator.userAgent;
|
||||
@@ -376,8 +374,7 @@
|
||||
|
||||
// quick exit if platform is unsupported
|
||||
if (
|
||||
platform === "unsupported" ||
|
||||
(!ANDROID_FEATURE_ENABLED && platform === "android") // TODO: remove android feature flag
|
||||
platform === "unsupported"
|
||||
) {
|
||||
renderContent("unsupported-template");
|
||||
return;
|
||||
|
||||
@@ -77,7 +77,8 @@ func (p *ProxyClient) SignupURLsCreate(ctx context.Context, serverURL, callbackU
|
||||
signupURL, err := call.Do()
|
||||
switch {
|
||||
case isErrorCode(err, http.StatusConflict):
|
||||
return nil, android.NewConflictError(fmt.Errorf("android enterprise already exists. Contact Fleet support for help: %w", err))
|
||||
// The frontend looks for the text in this error. Please update the frontend code if modifying this error.
|
||||
return nil, android.NewConflictError(fmt.Errorf("android enterprise already exists. For help, please contact Fleet support https://fleetdm.com/support: %w", err))
|
||||
case err != nil:
|
||||
return nil, fmt.Errorf("creating signup url: %w", err)
|
||||
}
|
||||
|
||||
@@ -53,7 +53,6 @@ type appConfigResponseFields struct {
|
||||
// SandboxEnabled is true if fleet serve was ran with server.sandbox_enabled=true
|
||||
SandboxEnabled bool `json:"sandbox_enabled,omitempty"`
|
||||
Err error `json:"error,omitempty"`
|
||||
AndroidEnabled bool `json:"android_enabled,omitempty"`
|
||||
Partnerships *fleet.Partnerships `json:"partnerships,omitempty"`
|
||||
// ConditionalAccess holds the Microsoft conditional access configuration.
|
||||
ConditionalAccess *fleet.ConditionalAccessSettings `json:"conditional_access,omitempty"`
|
||||
@@ -215,7 +214,6 @@ func getAppConfigEndpoint(ctx context.Context, request interface{}, svc fleet.Se
|
||||
Logging: loggingConfig,
|
||||
Email: emailConfig,
|
||||
SandboxEnabled: svc.SandboxEnabled(),
|
||||
AndroidEnabled: true, // Temporary feature flag that will be removed.
|
||||
Partnerships: partnerships,
|
||||
ConditionalAccess: conditionalAccessSettings,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user