Просмотр исходного кода

ref(types): Fix PlatformKey type (#56920)

Create an explicit type for `PlatformKey`.

Closes https://github.com/getsentry/sentry/issues/55906
ArthurKnaus 1 год назад
Родитель
Сommit
f6813de883

+ 1 - 2
static/app/actionCreators/projects.tsx

@@ -8,12 +8,11 @@ import {
   addSuccessMessage,
 } from 'sentry/actionCreators/indicator';
 import {Client} from 'sentry/api';
-import {PlatformKey} from 'sentry/data/platformCategories';
 import {t, tct} from 'sentry/locale';
 import LatestContextStore from 'sentry/stores/latestContextStore';
 import ProjectsStatsStore from 'sentry/stores/projectsStatsStore';
 import ProjectsStore from 'sentry/stores/projectsStore';
-import {Project, Team} from 'sentry/types';
+import {PlatformKey, Project, Team} from 'sentry/types';
 
 type UpdateParams = {
   orgId: string;

+ 1 - 1
static/app/components/events/interfaces/frame/stacktraceLink.tsx

@@ -14,7 +14,6 @@ import HookOrDefault from 'sentry/components/hookOrDefault';
 import ExternalLink from 'sentry/components/links/externalLink';
 import Link from 'sentry/components/links/link';
 import Placeholder from 'sentry/components/placeholder';
-import type {PlatformKey} from 'sentry/data/platformCategories';
 import {IconClose, IconWarning} from 'sentry/icons';
 import {t} from 'sentry/locale';
 import {space} from 'sentry/styles/space';
@@ -23,6 +22,7 @@ import {
   Event,
   Frame,
   Organization,
+  PlatformKey,
   Project,
   StacktraceLinkResult,
 } from 'sentry/types';

+ 1 - 1
static/app/components/events/interfaces/spans/inlineDocs.tsx

@@ -6,8 +6,8 @@ import {loadDocs} from 'sentry/actionCreators/projects';
 import {Client} from 'sentry/api';
 import ExternalLink from 'sentry/components/links/externalLink';
 import LoadingIndicator from 'sentry/components/loadingIndicator';
-import {PlatformKey} from 'sentry/data/platformCategories';
 import {t, tct} from 'sentry/locale';
+import type {PlatformKey} from 'sentry/types';
 import withApi from 'sentry/utils/withApi';
 
 type Props = {

+ 1 - 1
static/app/components/onboarding/gettingStartedDoc/layout.tsx

@@ -9,9 +9,9 @@ import {AuthTokenGeneratorProvider} from 'sentry/components/onboarding/gettingSt
 import {Step, StepProps} from 'sentry/components/onboarding/gettingStartedDoc/step';
 import {PlatformOptionsControl} from 'sentry/components/onboarding/platformOptionsControl';
 import {ProductSelection} from 'sentry/components/onboarding/productSelection';
-import {PlatformKey} from 'sentry/data/platformCategories';
 import {t} from 'sentry/locale';
 import {space} from 'sentry/styles/space';
+import type {PlatformKey} from 'sentry/types';
 import useOrganization from 'sentry/utils/useOrganization';
 
 const ProductSelectionAvailabilityHook = HookOrDefault({

+ 7 - 2
static/app/components/onboarding/gettingStartedDoc/sdkDocumentation.tsx

@@ -3,8 +3,13 @@ import {useEffect, useState} from 'react';
 import LoadingIndicator from 'sentry/components/loadingIndicator';
 import {useSourcePackageRegistries} from 'sentry/components/onboarding/gettingStartedDoc/useSourcePackageRegistries';
 import {ProductSolution} from 'sentry/components/onboarding/productSelection';
-import {PlatformKey} from 'sentry/data/platformCategories';
-import type {Organization, PlatformIntegration, Project, ProjectKey} from 'sentry/types';
+import type {
+  Organization,
+  PlatformIntegration,
+  PlatformKey,
+  Project,
+  ProjectKey,
+} from 'sentry/types';
 import {useApiQuery} from 'sentry/utils/queryClient';
 
 type SdkDocumentationProps = {

+ 1 - 2
static/app/components/onboarding/gettingStartedDoc/utils.tsx

@@ -1,7 +1,6 @@
 import ExternalLink from 'sentry/components/links/externalLink';
-import {PlatformKey} from 'sentry/data/platformCategories';
 import {t, tct} from 'sentry/locale';
-import type {Organization} from 'sentry/types';
+import type {Organization, PlatformKey} from 'sentry/types';
 import {trackAnalytics} from 'sentry/utils/analytics';
 
 export function getUploadSourceMapsStep({

+ 1 - 1
static/app/components/onboarding/missingExampleWarning.tsx

@@ -1,8 +1,8 @@
 import {Alert} from 'sentry/components/alert';
 import ExternalLink from 'sentry/components/links/externalLink';
-import {PlatformKey} from 'sentry/data/platformCategories';
 import platforms from 'sentry/data/platforms';
 import {tct} from 'sentry/locale';
+import type {PlatformKey} from 'sentry/types';
 import {OnboardingPlatformDoc} from 'sentry/types/onboarding';
 
 /**

+ 1 - 1
static/app/components/onboarding/productSelection.tsx

@@ -9,10 +9,10 @@ import {Button} from 'sentry/components/button';
 import Checkbox from 'sentry/components/checkbox';
 import ExternalLink from 'sentry/components/links/externalLink';
 import {Tooltip} from 'sentry/components/tooltip';
-import {PlatformKey} from 'sentry/data/platformCategories';
 import {IconQuestion} from 'sentry/icons';
 import {t, tct} from 'sentry/locale';
 import {space} from 'sentry/styles/space';
+import type {PlatformKey} from 'sentry/types';
 import {Organization} from 'sentry/types';
 import {decodeList} from 'sentry/utils/queryString';
 import useRouter from 'sentry/utils/useRouter';

+ 1 - 2
static/app/components/performanceOnboarding/utils.tsx

@@ -1,9 +1,8 @@
 import {
-  PlatformKey,
   withoutPerformanceSupport,
   withPerformanceOnboarding,
 } from 'sentry/data/platformCategories';
-import {PlatformIntegration, Project} from 'sentry/types';
+import {PlatformIntegration, PlatformKey, Project} from 'sentry/types';
 
 export function filterProjects(rawProjects: Project[]) {
   // filter on projects that have not sent a first transaction event

+ 1 - 1
static/app/components/platformList.spec.tsx

@@ -1,7 +1,7 @@
 import {render, screen, userEvent} from 'sentry-test/reactTestingLibrary';
 
 import PlatformList from 'sentry/components/platformList';
-import {PlatformKey} from 'sentry/data/platformCategories';
+import type {PlatformKey} from 'sentry/types';
 
 describe('PlatformList', function () {
   const platforms: PlatformKey[] = ['java', 'php', 'javascript', 'cocoa-swift', 'ruby'];

Некоторые файлы не были показаны из-за большого количества измененных файлов