group.ts 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. import {
  2. EventOrGroupType,
  3. type Group as GroupType,
  4. GroupStatus,
  5. GroupUnresolved,
  6. IssueCategory,
  7. IssueType,
  8. } from 'sentry/types';
  9. import {Project as MockProject} from './project';
  10. export function Group(params: Partial<GroupType> = {}): GroupType {
  11. const unresolvedGroup: GroupUnresolved = {
  12. activity: [],
  13. annotations: [],
  14. assignedTo: null,
  15. count: '327482',
  16. culprit: 'fetchData(app/components/group/suggestedOwners/suggestedOwners)',
  17. firstSeen: '2019-04-05T19:44:05.963Z',
  18. filtered: null,
  19. hasSeen: false,
  20. id: '1',
  21. isBookmarked: false,
  22. isPublic: false,
  23. isSubscribed: false,
  24. isUnhandled: false,
  25. issueCategory: IssueCategory.ERROR,
  26. issueType: IssueType.ERROR,
  27. lastSeen: '2019-04-11T01:08:59Z',
  28. level: 'warning',
  29. logger: null,
  30. metadata: {function: 'fetchData', type: 'RequestError'},
  31. numComments: 0,
  32. participants: [],
  33. permalink: 'https://foo.io/organizations/foo/issues/1234/',
  34. platform: 'javascript',
  35. pluginActions: [],
  36. pluginContexts: [],
  37. pluginIssues: [],
  38. project: MockProject({
  39. platform: 'javascript',
  40. }),
  41. seenBy: [],
  42. shareId: '',
  43. shortId: 'JAVASCRIPT-6QS',
  44. stats: {
  45. '24h': [
  46. [1517281200, 2],
  47. [1517310000, 1],
  48. ],
  49. '30d': [
  50. [1514764800, 1],
  51. [1515024000, 122],
  52. ],
  53. },
  54. status: GroupStatus.UNRESOLVED,
  55. statusDetails: {},
  56. subscriptionDetails: null,
  57. title: 'RequestError: GET /issues/ 404',
  58. type: EventOrGroupType.ERROR,
  59. userCount: 35097,
  60. userReportCount: 0,
  61. };
  62. return {...unresolvedGroup, ...params} as GroupType;
  63. }