group.ts 1.7 KB

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