Skip to content

Commit b6f22de

Browse files
committed
fix(ts): Fix TypeScript issue in integration configuration view
Fix a TypeScript error ignored with an '@ts-ignore' statement by fixing the definition of the 'OrganizationIntegration' type and using it instead of 'IntegrationWithConfig'.
1 parent 3e90887 commit b6f22de

File tree

4 files changed

+15
-8
lines changed

4 files changed

+15
-8
lines changed

static/app/types/integrations.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ type ConfigData = {
383383
installationType?: string;
384384
};
385385

386-
export interface OrganizationIntegration extends CommonIntegration {
386+
export interface OrganizationIntegration extends Integration {
387387
configData: ConfigData | null;
388388
configOrganization: Field[];
389389
externalId: string;

static/app/views/settings/organizationIntegrations/configureIntegration.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ import {t} from 'sentry/locale';
2020
import {space} from 'sentry/styles/space';
2121
import type {
2222
IntegrationProvider,
23-
IntegrationWithConfig,
2423
Organization,
24+
OrganizationIntegration,
2525
PluginWithProjectList,
2626
} from 'sentry/types';
2727
import {singleLineRenderer} from 'sentry/utils/marked';
@@ -95,7 +95,7 @@ function ConfigureIntegration({params, router, routes, location}: Props) {
9595
isError: isErrorIntegration,
9696
refetch: refetchIntegration,
9797
remove: removeIntegration,
98-
} = useApiQuery<IntegrationWithConfig>(
98+
} = useApiQuery<OrganizationIntegration>(
9999
makeIntegrationQuery(organization, integrationId),
100100
{staleTime: 0}
101101
);
@@ -254,7 +254,6 @@ function ConfigureIntegration({params, router, routes, location}: Props) {
254254
<LinkButton
255255
aria-label={t('Open this server in the Discord app')}
256256
size="sm"
257-
// @ts-ignore - the type of integration here is weird.
258257
href={`discord://discord.com/channels/${integration.externalId}`}
259258
>
260259
{t('Open in Discord')}

static/app/views/settings/organizationIntegrations/integrationServerlessFunctions.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@ import {Fragment} from 'react';
33
import styled from '@emotion/styled';
44

55
import DeprecatedAsyncComponent from 'sentry/components/deprecatedAsyncComponent';
6-
import type {IntegrationWithConfig, Organization, ServerlessFunction} from 'sentry/types';
6+
import type {
7+
Organization,
8+
OrganizationIntegration,
9+
ServerlessFunction,
10+
} from 'sentry/types';
711
import Panel from 'sentry/components/panels/panel';
812
import PanelBody from 'sentry/components/panels/panelBody';
913
import PanelHeader from 'sentry/components/panels/panelHeader';
@@ -16,7 +20,7 @@ import {trackIntegrationAnalytics} from 'sentry/utils/integrationUtil';
1620
import IntegrationServerlessRow from './integrationServerlessRow';
1721

1822
type Props = DeprecatedAsyncComponent['props'] & {
19-
integration: IntegrationWithConfig;
23+
integration: OrganizationIntegration;
2024
organization: Organization;
2125
};
2226

static/app/views/settings/organizationIntegrations/integrationServerlessRow.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,17 @@ import {Button} from 'sentry/components/button';
1111
import Switch from 'sentry/components/switchButton';
1212
import {t} from 'sentry/locale';
1313
import {space} from 'sentry/styles/space';
14-
import type {IntegrationWithConfig, Organization, ServerlessFunction} from 'sentry/types';
14+
import type {
15+
Organization,
16+
OrganizationIntegration,
17+
ServerlessFunction,
18+
} from 'sentry/types';
1519
import {trackIntegrationAnalytics} from 'sentry/utils/integrationUtil';
1620
import withApi from 'sentry/utils/withApi';
1721

1822
type Props = {
1923
api: Client;
20-
integration: IntegrationWithConfig;
24+
integration: OrganizationIntegration;
2125
onUpdateFunction: (serverlessFunctionUpdate: Partial<ServerlessFunction>) => void;
2226
organization: Organization;
2327
serverlessFunction: ServerlessFunction;

0 commit comments

Comments
 (0)