]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-5646 Support of real show WS
authorStas Vilchik <vilchiks@gmail.com>
Mon, 29 Sep 2014 12:05:30 +0000 (18:05 +0600)
committerStas Vilchik <vilchiks@gmail.com>
Mon, 29 Sep 2014 12:05:36 +0000 (18:05 +0600)
plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/measures/measure_filter_cloud.html.erb
plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/measures/measure_filter_histogram.html.erb
server/sonar-web/src/main/coffee/dashboard/app.coffee
server/sonar-web/src/main/coffee/dashboard/collections/widgets.coffee
server/sonar-web/src/main/coffee/dashboard/mockjax.coffee
server/sonar-web/src/main/coffee/dashboard/views/widget-view.coffee
server/sonar-web/src/main/coffee/dashboard/views/widgets-view.coffee
server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard/_header.html.erb

index d7de32d63c33f6bc28a1f2a8e443f7807b628f04..bada1681bd45eec564b03ac414e9eda4ef32493a 100644 (file)
@@ -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
index c18ce87276a526b863c0e578320e8c0b06757bd9..0c4d8caf692d6206d9322dc7671568f13ef2ee4e 100644 (file)
@@ -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
index 9968cb1b73d12963877265f31d442382525ef256..cac23d15268be7a93fb473dedcfdadfbfa3c4008 100644 (file)
@@ -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
 
index 08c6384f30df5645ff9cf606a4556a6b28fadb85..da60c3e7d0da0dd4cfe852eca227cead0e79a552 100644 (file)
@@ -11,5 +11,5 @@ define [
 
 
     comparator: (model) ->
-      model.get('layout').row
+      model.get('row')
 
index 9ddbf901b105c9eb8d566b72b7563152538e46e4..403118ad769f012fb22d27e89e55512d3d763c75 100644 (file)
@@ -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: []
         }
       ]
 
index be34011106a7743a3f5228200456e71fb62416c3..1f1b7889c7be5d72d7c005054d32e01a3c5ff9b7 100644 (file)
@@ -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
 
 
index 84191e4601b9f11abc7bb5500ed562d744fae351..f2723bb5b3a3683437dd3828ece9918a9c2eb4e1 100644 (file)
@@ -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
 
index 900075c19f027f58febe1d9ef04835c8464c7a94..71d5a3bcb07721bab81b706d73e4d0ac620784a9 100644 (file)
@@ -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">