activityFeed.tsx 3.6 KB

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