Welcome to mirror list, hosted at ThFree Co, Russian Federation.

mock_data.js « embeds « components « monitoring « frontend « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: e32e1a08cdb060a57ac0c47fe2bebc9e75749c3d (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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
import { TEST_HOST } from 'helpers/test_constants';

export const metricsWithData = ['15_metric_a', '16_metric_b'];

export const groups = [
  {
    panels: [
      {
        title: 'Memory Usage (Total)',
        type: 'area-chart',
        y_label: 'Total Memory Used',
        metrics: null,
      },
    ],
  },
];

const result = [
  {
    values: [
      ['Mon', 1220],
      ['Tue', 932],
      ['Wed', 901],
      ['Thu', 934],
      ['Fri', 1290],
      ['Sat', 1330],
      ['Sun', 1320],
    ],
  },
];

export const metricsData = [
  {
    metrics: [
      {
        metricId: '15_metric_a',
        result,
      },
    ],
  },
  {
    metrics: [
      {
        metricId: '16_metric_b',
        result,
      },
    ],
  },
];

export const initialState = () => ({
  dashboard: {
    panel_groups: [],
  },
});

export const initialEmbedGroupState = () => ({
  modules: [],
});

export const singleEmbedProps = () => ({
  dashboardUrl: TEST_HOST,
  containerClass: 'col-lg-12',
  namespace: 'monitoringDashboard/0',
});

export const dashboardEmbedProps = () => ({
  dashboardUrl: TEST_HOST,
  containerClass: 'col-lg-6',
  namespace: 'monitoringDashboard/0',
});

export const multipleEmbedProps = () => [
  {
    dashboardUrl: TEST_HOST,
    containerClass: 'col-lg-6',
    namespace: 'monitoringDashboard/0',
  },
  {
    dashboardUrl: TEST_HOST,
    containerClass: 'col-lg-6',
    namespace: 'monitoringDashboard/1',
  },
];

export const addModuleAction = 'embedGroup/addModule';