activityFeed.ts 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. import {EventFixture} from 'sentry-fixture/event';
  2. import {ProjectFixture} from 'sentry-fixture/project';
  3. import {UserFixture} from 'sentry-fixture/user';
  4. import {EventOrGroupType} from 'sentry/types/event';
  5. import type {Activity} from 'sentry/types/group';
  6. import {GroupActivityType, IssueCategory, IssueType} from 'sentry/types/group';
  7. export function ActivityFeedFixture(params: Partial<Activity> = {}): Activity {
  8. return {
  9. data: {text: 'Very interesting comment'},
  10. dateCreated: '2019-04-29T21:43:32.280Z',
  11. project: ProjectFixture({
  12. features: [
  13. 'releases',
  14. 'sample-events',
  15. 'minidump',
  16. 'rate-limits',
  17. 'similarity-indexing',
  18. 'similarity-view',
  19. 'data-forwarding',
  20. ],
  21. isInternal: true,
  22. dateCreated: '2019-03-09T06:52:19.832Z',
  23. id: '1',
  24. slug: 'internal',
  25. name: 'Internal',
  26. hasAccess: true,
  27. isBookmarked: false,
  28. platform: undefined,
  29. firstEvent: '2019-03-09T06:56:15Z',
  30. isMember: true,
  31. }),
  32. user: UserFixture({
  33. username: 'billy@sentry.io',
  34. lastLogin: '2019-04-23T00:10:19.787Z',
  35. isSuperuser: true,
  36. emails: [{is_verified: false, id: '1', email: 'billy@sentry.io'}],
  37. isManaged: false,
  38. lastActive: '2019-04-30T01:39:05.659Z',
  39. identities: [],
  40. id: '1',
  41. isActive: true,
  42. has2fa: false,
  43. name: 'billy@sentry.io',
  44. avatarUrl:
  45. 'https://secure.gravatar.com/avatar/7b544e8eb9d08ed777be5aa82121155a?s=32&d=mm',
  46. dateJoined: '2019-03-09T06:52:42.836Z',
  47. options: {
  48. theme: 'system',
  49. avatarType: 'letter_avatar',
  50. clock24Hours: false,
  51. defaultIssueEvent: 'recommended',
  52. language: 'en',
  53. stacktraceOrder: -1,
  54. timezone: 'America/Los_Angeles',
  55. prefersIssueDetailsStreamlinedUI: false,
  56. prefersStackedNavigation: false,
  57. quickStartDisplay: {},
  58. },
  59. flags: {newsletter_consent_prompt: false},
  60. avatar: {avatarUuid: null, avatarType: 'letter_avatar'},
  61. hasPasswordAuth: true,
  62. email: 'billy@sentry.io',
  63. }),
  64. type: GroupActivityType.NOTE,
  65. issue: {
  66. platform: 'javascript',
  67. lastSeen: '2019-04-26T16:34:12.288Z',
  68. numComments: 3,
  69. userCount: 1,
  70. culprit: '/organizations/:orgId/issues/:groupId/feedback/',
  71. title: 'Error: user efedback',
  72. id: '524',
  73. assignedTo: {
  74. id: '1',
  75. name: 'actor',
  76. type: 'user',
  77. },
  78. issueCategory: IssueCategory.ERROR,
  79. issueType: IssueType.ERROR,
  80. participants: [],
  81. latestEvent: EventFixture(),
  82. isUnhandled: true,
  83. pluginActions: [],
  84. pluginContexts: [],
  85. seenBy: [],
  86. filtered: null,
  87. pluginIssues: [],
  88. // there is a nasty type issue here where "reprocessing" cannot be assigned to
  89. // resolution status | "reprocessing" and "reprocessing" cannot be assigned to resolution
  90. // status (fails even if I as const it).
  91. // @ts-expect-error
  92. status: 'reprocessing',
  93. activity: [],
  94. logger: 'critical',
  95. type: EventOrGroupType.ERROR,
  96. annotations: [],
  97. metadata: {type: 'Error', value: 'user feedback', filename: '<anonymous>'},
  98. subscriptionDetails: {reason: 'commented'},
  99. isPublic: false,
  100. hasSeen: true,
  101. shortId: 'INTERNAL-DW',
  102. shareId: '99',
  103. firstSeen: '2019-04-26T16:34:12.288Z',
  104. count: '1',
  105. permalink: 'http://localhost:8000/organizations/sentry/issues/524/?project=1',
  106. level: 'error',
  107. isSubscribed: true,
  108. isBookmarked: false,
  109. project: ProjectFixture({
  110. platform: undefined,
  111. slug: 'internal',
  112. id: '1',
  113. name: 'Internal',
  114. }),
  115. },
  116. id: '48',
  117. ...params,
  118. };
  119. }