Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fleet UI: Calendar settings page #17593

Merged
merged 17 commits into from
Mar 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 2 additions & 10 deletions frontend/components/AddHostsModal/PlatformWrapper/_styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,7 @@
}

&__copy-message {
font-weight: $regular;
vertical-align: top;
background-color: $ui-light-grey;
border: solid 1px #e2e4ea;
border-radius: 10px;
padding: 2px 6px;
@include copy-message;
RachelElysia marked this conversation as resolved.
Show resolved Hide resolved
}

.buttons {
Expand Down Expand Up @@ -122,9 +117,6 @@
}

&__copy-message {
background-color: $ui-light-grey;
border: solid 1px #e2e4ea;
border-radius: 10px;
padding: 2px 6px;
@include copy-message;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,7 @@
}

&__copy-message {
background-color: $ui-light-grey;
border: solid 1px #e2e4ea;
border-radius: 10px;
padding: 2px 6px;
@include copy-message;
RachelElysia marked this conversation as resolved.
Show resolved Hide resolved
}

&__action-overlay {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@
}

&__copy-message {
background-color: $ui-light-grey;
border: solid 1px #e2e4ea;
border-radius: 10px;
padding: 2px 6px;
@include copy-message;
RachelElysia marked this conversation as resolved.
Show resolved Hide resolved
}
}
3 changes: 1 addition & 2 deletions frontend/interfaces/integration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,8 @@ export interface IIntegrationFormErrors {
}

export interface IGlobalCalendarIntegration {
email: string;
private_key: string;
domain: string;
api_key_json: string;
}

interface ITeamCalendarSettings {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,7 @@
}

&__copy-message {
font-weight: $regular;
vertical-align: top;
background-color: $ui-light-grey;
border: solid 1px #e2e4ea;
border-radius: 10px;
padding: 2px 6px;
@include copy-message;
RachelElysia marked this conversation as resolved.
Show resolved Hide resolved
}

&__secret-download-icon {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
IJiraIntegration,
IZendeskIntegration,
IIntegration,
IIntegrations,
IGlobalIntegrations,
IIntegrationType,
} from "interfaces/integration";
import {
Expand Down Expand Up @@ -124,7 +124,7 @@ const ManageAutomationsModal = ({
}
}, [destinationUrl]);

const { data: integrations } = useQuery<IConfig, Error, IIntegrations>(
const { data: integrations } = useQuery<IConfig, Error, IGlobalIntegrations>(
["integrations"],
() => configAPI.loadAll(),
{
Expand Down
56 changes: 29 additions & 27 deletions frontend/pages/admin/IntegrationsPage/IntegrationNavItems.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,34 @@ import { ISideNavItem } from "../components/SideNav/SideNav";
import Integrations from "./cards/Integrations";
import Mdm from "./cards/MdmSettings/MdmSettings";
import AutomaticEnrollment from "./cards/AutomaticEnrollment/AutomaticEnrollment";
import Calendars from "./cards/Calendars/Calendars";

const getFilteredIntegrationSettingsNavItems = (
isSandboxMode = false
): ISideNavItem<any>[] => {
return [
// TODO: types
{
title: "Ticket destinations",
urlSection: "ticket-destinations",
path: PATHS.ADMIN_INTEGRATIONS_TICKET_DESTINATIONS,
Card: Integrations,
},
{
title: "Mobile device management (MDM)",
urlSection: "mdm",
path: PATHS.ADMIN_INTEGRATIONS_MDM,
Card: Mdm,
exclude: isSandboxMode,
},
{
title: "Automatic enrollment",
urlSection: "automatic-enrollment",
path: PATHS.ADMIN_INTEGRATIONS_AUTOMATIC_ENROLLMENT,
Card: AutomaticEnrollment,
},
].filter((navItem) => !navItem.exclude);
};
const integrationSettingsNavItems: ISideNavItem<any>[] = [
// TODO: types
{
title: "Ticket destinations",
urlSection: "ticket-destinations",
path: PATHS.ADMIN_INTEGRATIONS_TICKET_DESTINATIONS,
Card: Integrations,
},
{
title: "Mobile device management (MDM)",
urlSection: "mdm",
path: PATHS.ADMIN_INTEGRATIONS_MDM,
Card: Mdm,
},
{
title: "Automatic enrollment",
urlSection: "automatic-enrollment",
path: PATHS.ADMIN_INTEGRATIONS_AUTOMATIC_ENROLLMENT,
Card: AutomaticEnrollment,
},
{
title: "Calendars",
urlSection: "calendars",
path: PATHS.ADMIN_INTEGRATIONS_CALENDARS,
Card: Calendars,
},
];

export default getFilteredIntegrationSettingsNavItems;
export default integrationSettingsNavItems;
8 changes: 3 additions & 5 deletions frontend/pages/admin/IntegrationsPage/IntegrationsPage.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { AppContext } from "context/app";
import React, { useContext } from "react";
import React from "react";
import { InjectedRouter, Params } from "react-router/lib/Router";

import SideNav from "../components/SideNav";
import getFilteredIntegrationSettingsNavItems from "./IntegrationNavItems";
import integrationSettingsNavItems from "./IntegrationNavItems";

const baseClass = "integrations";

Expand All @@ -16,9 +15,8 @@ const IntegrationsPage = ({
router,
params,
}: IIntegrationSettingsPageProps) => {
const { isSandboxMode } = useContext(AppContext);
const { section } = params;
const navItems = getFilteredIntegrationSettingsNavItems(isSandboxMode);
const navItems = integrationSettingsNavItems;
const DEFAULT_SETTINGS_SECTION = navItems[0];
const currentSection =
navItems.find((item) => item.urlSection === section) ??
Expand Down
Loading
Loading