summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/reports/store/state.js
blob: 25f9f70d0951a02f3c138509703b9de2b4cb2d03 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
import { s__ } from '~/locale';
import { fieldTypes } from '../constants';

export default () => ({
  endpoint: null,

  isLoading: false,
  hasError: false,

  status: null,

  summary: {
    total: 0,
    resolved: 0,
    failed: 0,
  },

  /**
   * Each report will have the following format:
   * {
   *   name: {String},
   *   summary: {
   *     total: {Number},
   *     resolved: {Number},
   *     failed: {Number},
   *   },
   *   new_failures: {Array.<Object>},
   *   resolved_failures: {Array.<Object>},
   *   existing_failures: {Array.<Object>},
   * }
   */
  reports: [],

  modal: {
    title: null,

    data: {
      class: {
        value: null,
        text: s__('Reports|Class'),
        type: fieldTypes.link,
      },
      classname: {
        value: null,
        text: s__('Reports|Classname'),
        type: fieldTypes.text,
      },
      execution_time: {
        value: null,
        text: s__('Reports|Execution time'),
        type: fieldTypes.miliseconds,
      },
      failure: {
        value: null,
        text: s__('Reports|Failure'),
        type: fieldTypes.codeBock,
      },
      system_output: {
        value: null,
        text: s__('Reports|System output'),
        type: fieldTypes.codeBock,
      },
    },
  },
});