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

ref(types): add typing to Group (#63888)

adding some typing for `Group`
Michelle Zhang 1 год назад
Родитель
Сommit
fd13152c7c

+ 1 - 1
static/app/components/group/pluginActions.tsx

@@ -19,7 +19,7 @@ type PluginIssue = {
   url: string;
 };
 
-type TitledPlugin = Plugin & {
+export type TitledPlugin = Plugin & {
   // issue serializer adds more fields
   // TODO: should be able to use name instead of title
   title: string;

+ 7 - 9
static/app/types/group.tsx

@@ -1,9 +1,10 @@
+import {TitledPlugin} from 'sentry/components/group/pluginActions';
 import type {SearchGroup} from 'sentry/components/smartSearchBar/types';
 import type {FieldKind} from 'sentry/utils/fields';
 
 import type {Actor, TimeseriesValue} from './core';
 import type {Event, EventMetadata, EventOrGroupType, Level} from './event';
-import type {Commit, PullRequest, Repository} from './integrations';
+import type {Commit, ExternalIssue, PullRequest, Repository} from './integrations';
 import type {Team} from './organization';
 import type {PlatformKey, Project} from './project';
 import type {AvatarUser, User} from './user';
@@ -715,12 +716,9 @@ export interface BaseGroup {
   participants: Array<UserParticipant | TeamParticipant>;
   permalink: string;
   platform: PlatformKey;
-  pluginActions: any[];
-  // TODO(ts)
-  pluginContexts: any[];
-  // TODO(ts)
-  pluginIssues: any[];
-  // TODO(ts)
+  pluginActions: TitledPlugin[];
+  pluginContexts: any[]; // TODO(ts)
+  pluginIssues: TitledPlugin[];
   project: Project;
   seenBy: User[];
   shareId: string;
@@ -732,7 +730,7 @@ export interface BaseGroup {
   type: EventOrGroupType;
   userReportCount: number;
   inbox?: InboxDetails | null | false;
-  integrationIssues?: any[];
+  integrationIssues?: ExternalIssue[];
   latestEvent?: Event;
   owners?: SuggestedOwner[] | null;
   substatus?: GroupSubstatus | null;
@@ -824,7 +822,7 @@ export type ChunkType = {
 };
 
 /**
- * User Feedback
+ * Old User Feedback
  */
 export type UserReport = {
   comments: string;

+ 1 - 1
static/app/types/integrations.tsx

@@ -473,7 +473,6 @@ export type PluginNoProject = {
   name: string;
   shortName: string;
   slug: string;
-  // TODO(ts)
   status: string;
   type: string;
   altIsSentryApp?: boolean;
@@ -481,6 +480,7 @@ export type PluginNoProject = {
   deprecationDate?: string;
   description?: string;
   firstPartyAlternative?: string;
+  issue?: any; // TODO (ts)
   resourceLinks?: Array<{title: string; url: string}>;
   version?: string;
 };