aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/coffee/dashboard/mockjax.coffee
blob: db00287aa6477550db8b7392d48580dd8cd86b2e (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
define ['third-party/jquery.mockjax'], ->

  jQuery.mockjaxSettings.contentType = 'text/json';
  jQuery.mockjaxSettings.responseTime = 250;

  jQuery.mockjax
    url: "#{baseUrl}/api/dashboards/details"
    responseText: JSON.stringify
      name: 'Helicopter View'
      description: ''
      shared: true
      layout: '50%-50%'

      canManageDashboards: true
      canManageWidgets: true

      widgets: [
        {
          key: 'measure_filter_list'
          props: [
            {
              key: 'filter'
              value: '48'
            }
          ]
          layout: {
            column: 1
            row: 1
          }
        }
        {
          key: 'my_reviews'
          props: []
          layout: {
            column: 1,
            row: 2
          }
        },
        {
          key: 'hotspot_most_violated_rules',
          props: [],
          layout: {
            column: 2
            row: 1
          }
        }
      ]

  jQuery.mockjax
    url: "#{baseUrl}/api/dashboards/available_widgets"
    responseText: JSON.stringify
      widgets: [
        {
          key: ''
          name: ''
          description: ''
          category: ''
          props: []
        }
      ]