aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStas Vilchik <vilchiks@gmail.com>2014-09-29 18:05:30 +0600
committerStas Vilchik <vilchiks@gmail.com>2014-09-29 18:05:36 +0600
commitbcd7543bb76b9ef0963131f547405365959290fe (patch)
tree4fbbfdb0898932fd023d8090dbc52d4e98a787f3
parentc0b5f6b3a21d1314cda82a2e944d39a19728b0c7 (diff)
downloadsonarqube-bcd7543bb76b9ef0963131f547405365959290fe.tar.gz
sonarqube-bcd7543bb76b9ef0963131f547405365959290fe.zip
SONAR-5646 Support of real show WS
-rw-r--r--plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/measures/measure_filter_cloud.html.erb2
-rw-r--r--plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/measures/measure_filter_histogram.html.erb2
-rw-r--r--server/sonar-web/src/main/coffee/dashboard/app.coffee2
-rw-r--r--server/sonar-web/src/main/coffee/dashboard/collections/widgets.coffee2
-rw-r--r--server/sonar-web/src/main/coffee/dashboard/mockjax.coffee39
-rw-r--r--server/sonar-web/src/main/coffee/dashboard/views/widget-view.coffee4
-rw-r--r--server/sonar-web/src/main/coffee/dashboard/views/widgets-view.coffee3
-rw-r--r--server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard/_header.html.erb6
8 files changed, 50 insertions, 10 deletions
diff --git a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/measures/measure_filter_cloud.html.erb b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/measures/measure_filter_cloud.html.erb
index d7de32d63c3..bada1681bd4 100644
--- a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/measures/measure_filter_cloud.html.erb
+++ b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/measures/measure_filter_cloud.html.erb
@@ -1,5 +1,5 @@
<%
- containerId = 'pie-chart-widget' + widget.id.to_s
+ containerId = 'word-cloud' + widget.id.to_s
chartTitle = widget_properties['chartTitle']
filterId = widget_properties['filter'].to_i
maxItems = widget_properties['maxItems'].to_i
diff --git a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/measures/measure_filter_histogram.html.erb b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/measures/measure_filter_histogram.html.erb
index c18ce87276a..0c4d8caf692 100644
--- a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/measures/measure_filter_histogram.html.erb
+++ b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/measures/measure_filter_histogram.html.erb
@@ -1,5 +1,5 @@
<%
- containerId = 'pie-chart-widget' + widget.id.to_s
+ containerId = 'histogram-widget' + widget.id.to_s
chartTitle = widget_properties["chartTitle"]
filterId = widget_properties["filter"].to_i
maxItems = widget_properties["maxItems"].to_i
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
diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard/_header.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard/_header.html.erb
index 900075c19f0..71d5a3bcb07 100644
--- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard/_header.html.erb
+++ b/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard/_header.html.erb
@@ -1,3 +1,9 @@
+<% if @snapshot %>
+ <a href="<%= url_for :controller => :dashboard2, :action => :index, :did => @dashboard.id, :id => @resource.id -%>">New Version</a>
+<% else %>
+ <a href="<%= url_for :controller => :dashboard2, :action => :index, :did => @dashboard.id -%>">New Version</a>
+<% end %>
+
<% if logged_in? || @snapshot %>
<div class="line-block">