Skip to content

Commit

Permalink
Remove any mock data, remove code bypassing and logs
Browse files Browse the repository at this point in the history
  • Loading branch information
RachelElysia committed Jul 2, 2024
1 parent 5463fd7 commit 6e6bbdf
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 341 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ const HostsSummary = ({

const renderIosCount = (teamId?: number) => {
const iosLabelId = builtInLabels?.find(
(builtin) => builtin.name === PLATFORM_NAME_TO_LABEL_NAME.chrome // TODO: change to ios
(builtin) => builtin.name === PLATFORM_NAME_TO_LABEL_NAME.ios // TODO: change to ios
)?.id;

if (isLoadingHostsSummary || iosLabelId === undefined) {
Expand All @@ -160,7 +160,7 @@ const HostsSummary = ({

const renderIpadosCount = (teamId?: number) => {
const ipadosLabelId = builtInLabels?.find(
(builtin) => builtin.name === PLATFORM_NAME_TO_LABEL_NAME.chrome // TODO: change to ipados
(builtin) => builtin.name === PLATFORM_NAME_TO_LABEL_NAME.ipados // TODO: change to ipados
)?.id;

if (isLoadingHostsSummary || ipadosLabelId === undefined) {
Expand Down
14 changes: 6 additions & 8 deletions frontend/pages/ManageControlsPage/OSSettings/OSSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,12 @@ const OSSettings = ({
);

// MDM is not on so show messaging for user to enable it.
// TODO: Reinstate when ready
// if (
// !config?.mdm.enabled_and_configured &&
// !config?.mdm.windows_enabled_and_configured
// ) {
// return <TurnOnMdmMessage router={router} />;
// }
// END TODO
if (
!config?.mdm.enabled_and_configured &&
!config?.mdm.windows_enabled_and_configured
) {
return <TurnOnMdmMessage router={router} />;
}

const DEFAULT_SETTINGS_SECTION = OS_SETTINGS_NAV_ITEMS[0];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,28 +57,8 @@ const CustomSettings = ({

const selectedProfile = useRef<IMdmProfile | null>(null);

const profilesData: IMdmProfilesResponse = {
profiles: [
{
profile_uuid: "12345",
team_id: 1,
name: "Profile name",
platform: "ios",
identifier: "1234", // null for windows profiles
created_at: "2024-03-07T14:40:00Z",
updated_at: "2024-03-07T14:40:00Z",
checksum: "1234", // null for windows profiles
labels: [{ name: "string", broken: false }],
},
],
meta: {
has_next_results: true,
has_previous_results: false,
},
};

const {
data: profilesData2,
data: profilesData,
isLoading: isLoadingProfiles,
isError: isErrorProfiles,
refetch: refetchProfiles,
Expand Down
25 changes: 9 additions & 16 deletions frontend/pages/ManageControlsPage/OSUpdates/OSUpdates.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,11 @@ const getSelectedPlatform = (
};

interface IOSUpdates {
router: InjectedRouter;
teamIdForApi: number;
}

const OSUpdates = ({ teamIdForApi }: IOSUpdates) => {
const OSUpdates = ({ router, teamIdForApi }: IOSUpdates) => {
const { isPremiumTier, config, setConfig } = useContext(AppContext);

const [
Expand Down Expand Up @@ -92,26 +93,18 @@ const OSUpdates = ({ teamIdForApi }: IOSUpdates) => {
// FIXME: Handle error states for app config and team config (need specifications for this).

// mdm is not enabled for mac or windows.
// TODO: Reinstate when ready
// if (
// !config?.mdm.enabled_and_configured &&
// !config?.mdm.windows_enabled_and_configured
// ) {
// return <TurnOnMdmMessage router={router} />;
// }
// END TODO

if (
!config?.mdm.enabled_and_configured &&
!config?.mdm.windows_enabled_and_configured
) {
return <TurnOnMdmMessage router={router} />;
}

// If the user has not selected a platform yet, we default to the platform that
// is enabled and configured.
const selectedPlatform = selectedPlatformTab || getSelectedPlatform(config);

// TODO: Remove when ready
if (!config) {
return null;
}
// END TODO

console.log("selectedPlatform", selectedPlatform);
return (
<div className={baseClass}>
<p className={`${baseClass}__description`}>
Expand Down
Loading

0 comments on commit 6e6bbdf

Please sign in to comment.