Skip to content

Commit

Permalink
Fix integrations typing
Browse files Browse the repository at this point in the history
  • Loading branch information
RachelElysia committed Mar 21, 2024
1 parent 852a72d commit 0412acd
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 14 deletions.
7 changes: 0 additions & 7 deletions frontend/interfaces/integration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,6 @@ export interface IIntegrationFormErrors {
enableSoftwareVulnerabilities?: boolean;
}

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

interface ITeamCalendarSettings {
enable_calendar_events: boolean;
webhook_url: string;
Expand All @@ -84,7 +78,6 @@ interface ITeamCalendarSettings {
export interface IIntegrations {
zendesk: IZendeskIntegration[];
jira: IJiraIntegration[];
google_calendar: IGlobalCalendarIntegration[] | null;
}

export interface IGlobalIntegrations extends IIntegrations {
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
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
IZendeskIntegration,
IIntegration,
IIntegrationTableData,
IIntegrations,
IGlobalIntegrations,
} from "interfaces/integration";
import { IApiError } from "interfaces/errors";

Expand Down Expand Up @@ -69,7 +69,7 @@ const Integrations = (): JSX.Element => {
isLoading: isLoadingIntegrations,
error: loadingIntegrationsError,
refetch: refetchIntegrations,
} = useQuery<IConfig, Error, IIntegrations>(
} = useQuery<IConfig, Error, IGlobalIntegrations>(
["integrations"],
() => configAPI.loadAll(),
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@ import { Link } from "react-router";
import { isEmpty, noop, omit } from "lodash";

import { IAutomationsConfig, IWebhookSettings } from "interfaces/config";
import { IIntegration, IIntegrations } from "interfaces/integration";
import {
IGlobalIntegrations,
IIntegration,
IIntegrations,
ITeamIntegrations,
} from "interfaces/integration";
import { IPolicy } from "interfaces/policy";
import { ITeamAutomationsConfig } from "interfaces/team";
import PATHS from "router/paths";
Expand All @@ -26,13 +31,13 @@ import ExamplePayload from "../ExamplePayload";

interface IOtherWorkflowsModalProps {
automationsConfig: IAutomationsConfig | ITeamAutomationsConfig;
availableIntegrations: IIntegrations;
availableIntegrations: IGlobalIntegrations | ITeamIntegrations;
availablePolicies: IPolicy[];
isUpdatingAutomations: boolean;
onExit: () => void;
handleSubmit: (formData: {
webhook_settings: Pick<IWebhookSettings, "failing_policies_webhook">;
integrations: IIntegrations;
integrations: IGlobalIntegrations | ITeamIntegrations;
}) => void;
}

Expand Down

0 comments on commit 0412acd

Please sign in to comment.