activityFeed.tsx 3.5 KB

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