incident.ts 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. import type {Incident as TIncident} from 'sentry/views/alerts/types';
  2. import {IncidentStatus, IncidentStatusMethod} from 'sentry/views/alerts/types';
  3. import {MetricRule} from './metricRule';
  4. export function Incident(params: Partial<TIncident> = {}): TIncident {
  5. return {
  6. id: '321',
  7. identifier: '123',
  8. organizationId: '3',
  9. dateClosed: '2016-04-19T19:44:05.963Z',
  10. dateStarted: '2016-04-05T19:44:05.963Z',
  11. dateDetected: '2016-04-05T19:44:05.963Z',
  12. dateCreated: '2016-04-05T19:44:05.963Z',
  13. title: 'Too many Chrome errors',
  14. status: IncidentStatus.CLOSED,
  15. projects: [],
  16. isSubscribed: true,
  17. alertRule: MetricRule(params.alertRule),
  18. activities: [
  19. {
  20. id: '78',
  21. incidentIdentifier: '50729',
  22. user: null,
  23. type: 2,
  24. value: '2',
  25. previousValue: '20',
  26. comment: null,
  27. dateCreated: '2022-03-27T00:38:00Z',
  28. },
  29. {
  30. id: '33',
  31. incidentIdentifier: '50729',
  32. user: null,
  33. type: 2,
  34. value: '20',
  35. previousValue: '1',
  36. comment: null,
  37. dateCreated: '2022-03-26T13:03:00Z',
  38. },
  39. {
  40. id: '32',
  41. incidentIdentifier: '50729',
  42. user: null,
  43. type: 1,
  44. value: null,
  45. previousValue: null,
  46. comment: null,
  47. dateCreated: '2022-03-26T13:02:00Z',
  48. },
  49. {
  50. id: '31',
  51. incidentIdentifier: '50729',
  52. user: null,
  53. type: 4,
  54. value: null,
  55. previousValue: null,
  56. comment: null,
  57. dateCreated: '2022-03-26T12:00:00Z',
  58. },
  59. ],
  60. discoverQuery: '',
  61. groups: [],
  62. hasSeen: false,
  63. seenBy: [],
  64. statusMethod: IncidentStatusMethod.MANUAL,
  65. ...params,
  66. };
  67. }