diff options
Diffstat (limited to 'server/sonar-web/src/main/coffee')
5 files changed, 42 insertions, 8 deletions
diff --git a/server/sonar-web/src/main/coffee/dashboard/app.coffee b/server/sonar-web/src/main/coffee/dashboard/app.coffee index 9968cb1b73d..cac23d15268 100644 --- a/server/sonar-web/src/main/coffee/dashboard/app.coffee +++ b/server/sonar-web/src/main/coffee/dashboard/app.coffee @@ -53,7 +53,7 @@ requirejs [ requestDetails = -> - $.get "#{baseUrl}/api/dashboards/details", key: App.dashboard, (data) -> + $.get "#{baseUrl}/api/dashboards/show", key: App.dashboard, (data) -> App.dashboard = new Backbone.Model _.omit data, 'widgets' App.widgets = new Widgets data.widgets diff --git a/server/sonar-web/src/main/coffee/dashboard/collections/widgets.coffee b/server/sonar-web/src/main/coffee/dashboard/collections/widgets.coffee index 08c6384f30d..da60c3e7d0d 100644 --- a/server/sonar-web/src/main/coffee/dashboard/collections/widgets.coffee +++ b/server/sonar-web/src/main/coffee/dashboard/collections/widgets.coffee @@ -11,5 +11,5 @@ define [ comparator: (model) -> - model.get('layout').row + model.get('row') diff --git a/server/sonar-web/src/main/coffee/dashboard/mockjax.coffee b/server/sonar-web/src/main/coffee/dashboard/mockjax.coffee index 9ddbf901b10..403118ad769 100644 --- a/server/sonar-web/src/main/coffee/dashboard/mockjax.coffee +++ b/server/sonar-web/src/main/coffee/dashboard/mockjax.coffee @@ -62,15 +62,50 @@ define ['third-party/jquery.mockjax'], -> ] jQuery.mockjax - url: "#{baseUrl}/api/dashboards/available_widgets" + url: "#{baseUrl}/api/dashboards/widgets" responseText: JSON.stringify widgets: [ { + key: 'action_plans' + name: 'Action Plans' + description: 'Shows all the open action plans of the project.' + category: '' + } + { + key: '' + name: '' + description: '' + category: '' + } + { + key: '' + name: '' + description: '' + category: '' + } + { + key: '' + name: '' + description: '' + category: '' + } + { + key: '' + name: '' + description: '' + category: '' + } + { + key: '' + name: '' + description: '' + category: '' + } + { key: '' name: '' description: '' category: '' - props: [] } ] diff --git a/server/sonar-web/src/main/coffee/dashboard/views/widget-view.coffee b/server/sonar-web/src/main/coffee/dashboard/views/widget-view.coffee index be34011106a..1f1b7889c7b 100644 --- a/server/sonar-web/src/main/coffee/dashboard/views/widget-view.coffee +++ b/server/sonar-web/src/main/coffee/dashboard/views/widget-view.coffee @@ -42,10 +42,10 @@ define [ getWidgetProps: -> - properties = @model.get 'properties' + properties = @model.get 'props' r = {} properties.forEach (prop) -> - r[prop.key] = prop.value if prop.value? + r[prop.key] = prop.val if prop.val? r diff --git a/server/sonar-web/src/main/coffee/dashboard/views/widgets-view.coffee b/server/sonar-web/src/main/coffee/dashboard/views/widgets-view.coffee index 84191e4601b..f2723bb5b3a 100644 --- a/server/sonar-web/src/main/coffee/dashboard/views/widgets-view.coffee +++ b/server/sonar-web/src/main/coffee/dashboard/views/widgets-view.coffee @@ -31,8 +31,7 @@ define [ appendHtml: (compositeView, itemView) -> - layout = itemView.model.get 'layout' - column = layout.column - 1 + column = itemView.model.get('col') - 1 $container = @getItemViewContainer compositeView $container.eq(column).append itemView.el |