activityFeed.ts 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  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. },
  57. flags: {newsletter_consent_prompt: false},
  58. avatar: {avatarUuid: null, avatarType: 'letter_avatar'},
  59. hasPasswordAuth: true,
  60. email: 'billy@sentry.io',
  61. }),
  62. type: GroupActivityType.NOTE,
  63. issue: {
  64. platform: 'javascript',
  65. lastSeen: '2019-04-26T16:34:12.288Z',
  66. numComments: 3,
  67. userCount: 1,
  68. culprit: '/organizations/:orgId/issues/:groupId/feedback/',
  69. title: 'Error: user efedback',
  70. id: '524',
  71. assignedTo: {
  72. id: '1',
  73. name: 'actor',
  74. type: 'user',
  75. },
  76. issueCategory: IssueCategory.ERROR,
  77. issueType: IssueType.ERROR,
  78. participants: [],
  79. latestEvent: EventFixture(),
  80. isUnhandled: true,
  81. pluginActions: [],
  82. pluginContexts: [],
  83. seenBy: [],
  84. filtered: null,
  85. pluginIssues: [],
  86. // there is a nasty type issue here where "reprocessing" cannot be assigned to
  87. // resolution status | "reprocessing" and "reprocessing" cannot be assigned to resolution
  88. // status (fails even if I as const it).
  89. // @ts-expect-error
  90. status: 'reprocessing',
  91. activity: [],
  92. logger: 'critical',
  93. type: EventOrGroupType.ERROR,
  94. annotations: [],
  95. metadata: {type: 'Error', value: 'user feedback', filename: '<anonymous>'},
  96. subscriptionDetails: {reason: 'commented'},
  97. isPublic: false,
  98. hasSeen: true,
  99. shortId: 'INTERNAL-DW',
  100. shareId: '99',
  101. firstSeen: '2019-04-26T16:34:12.288Z',
  102. count: '1',
  103. permalink: 'http://localhost:8000/organizations/sentry/issues/524/?project=1',
  104. level: 'error',
  105. isSubscribed: true,
  106. isBookmarked: false,
  107. project: ProjectFixture({
  108. platform: undefined,
  109. slug: 'internal',
  110. id: '1',
  111. name: 'Internal',
  112. }),
  113. },
  114. id: '48',
  115. ...params,
  116. };
  117. }