summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/reports/constants.js
blob: 36306f331535715b0e633536ab1fc13b93faafe7 (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
import { s__ } from '~/locale';

export const fieldTypes = {
  codeBock: 'codeBlock',
  link: 'link',
  miliseconds: 'miliseconds',
  text: 'text',
};

/**
 * Map of data show in modalbox
 *
 * Each key will only be rendered if `value` is present.
 *
 * Keys in this map have the same format as the backend json response.
 *
 * When the user clicks on the issue name, in modal_open_name,
 * the store will set the modal data based on this map
 * and the keys available in the store.
 */
export const modalData = {
  class: {
    value: null,
    text: s__('Reports|Class'),
    type: fieldTypes.link,
  },
  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,
  },
};

export const modalActions = [
  {
    title: s__('Reports|Cancel'),
    attributes: {
      type: 'button',
      class: 'btn btn-default',
      'data-dismiss': 'modal',
    },
  },
  {
    title: s__('Reports|Create Issue'),
    attributes: {
      type: 'button',
      class: 'btn btn-success btn-inverted',
    },
  }
];