]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-5209 Integration feedback
authorStas Vilchik <vilchiks@gmail.com>
Wed, 18 Jun 2014 07:05:57 +0000 (13:05 +0600)
committerStas Vilchik <vilchiks@gmail.com>
Wed, 18 Jun 2014 07:06:05 +0000 (13:06 +0600)
sonar-server/src/main/coffee/component-viewer/mixins/main-coverage.coffee
sonar-server/src/main/coffee/component-viewer/mixins/main-duplications.coffee
sonar-server/src/main/coffee/component-viewer/mixins/main-issues.coffee
sonar-server/src/main/coffee/component-viewer/mixins/main-scm.coffee
sonar-server/src/main/coffee/dashboard/file-app.coffee
sonar-server/src/main/coffee/drilldown/app.coffee
sonar-server/src/main/coffee/drilldown/conf.coffee
sonar-server/src/main/webapp/WEB-INF/app/controllers/dashboard_controller.rb
sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/no_dashboard.html.erb

index 607cc1e42bf0c2f6b704fc0bf0916b4fbf546c1a..0c1fe45ac015aa7379851cbab50a985443578961 100644 (file)
@@ -51,7 +51,6 @@ define [], () ->
       if @settings.get('issues') && !@state.get('hasIssues')
         requests.push @requestIssues @key
       $.when.apply($, requests).done =>
-        @filterByUnresolvedIssues()
         @_filterByCoverage(predicate)
 
 
@@ -60,7 +59,6 @@ define [], () ->
       if @settings.get('issues') && !@state.get('hasIssues')
         requests.push @requestIssues @key
       $.when.apply($, requests).done =>
-        @filterByUnresolvedIssues()
         @_filterByCoverage(predicate)
 
 
index 4a2986e80a8d7103d080d8a91e3c9cb7e2d8f168..15c651fc44d7cfd727109bc7a85b033e01a3ea35 100644 (file)
@@ -53,7 +53,6 @@ define [], () ->
       if @settings.get('issues') && !@state.get('hasIssues')
         requests.push @requestIssues @key
       $.when.apply($, requests).done =>
-        @filterByUnresolvedIssues()
         @_filterByDuplications()
 
 
index 32aabd46c0ae891b4e5df2d8bd76eda5752f8570..b60f4ca27be152bbc5ab45f32f19816ec3399e80 100644 (file)
@@ -19,7 +19,9 @@ define [
         extra_fields: 'actions,transitions,assigneeName,actionPlanName'
       $.get API_ISSUES, options, (data) =>
         @state.set 'hasIssues', true
-        @source.set issues: data.issues, activeIssues: data.issues
+        @source.set
+          issues: data.issues
+          activeIssues: data.issues.filter (issue) -> !issue.resolution
 
 
     showIssues: (store = false, issue) ->
index 48def232547f3b7a11e27c1d01959eb41b5bde4f..23c899f185fda465fac3aaade1326a23c01e9fce 100644 (file)
@@ -52,7 +52,6 @@ define [], () ->
       if @settings.get('issues') && !@state.get('hasIssues')
         requests.push @requestIssues @key
       $.when.apply($, requests).done =>
-        @filterByUnresolvedIssues()
         @_filterBySCM()
 
 
index e7354ccbaef3c88808937476186823af003faffa..c005663cd5ca713f4179a42112ec062943e4b6fd 100644 (file)
@@ -20,12 +20,15 @@ requirejs.config
 requirejs [
   'backbone.marionette'
   'component-viewer/main'
+  'drilldown/conf'
 ], (
   Marionette
   ComponentViewer
+  MetricConf
 ) ->
 
   $ = jQuery
+
   App = new Marionette.Application()
 
 
@@ -43,7 +46,17 @@ requirejs [
 
   App.addInitializer ->
     viewer = App.requestComponentViewer()
-    viewer.open(window.fileKey).done -> viewer.showAllLines()
+    if window.metric?
+      metricConf = MetricConf[window.metric]
+      if metricConf?
+        activeHeaderTab = metricConf.tab
+        activeHeaderItem = metricConf.item
+    viewer.open(window.fileKey).done ->
+      if activeHeaderTab? && activeHeaderItem?
+        viewer.state.set activeHeaderTab: activeHeaderTab, activeHeaderItem: activeHeaderItem
+        viewer.headerView.render()
+      else
+        viewer.showAllLines()
 
 
   # Message bundles
index e95c2c2136b3328f2ea55ca9bfc37e31449d07de..cc7ab15b194603464228109ad5de2591e17b85d5 100644 (file)
@@ -71,6 +71,11 @@ requirejs [
       viewer.open(key).done ->
         if activeHeaderTab? && activeHeaderItem?
           viewer.state.set activeHeaderTab: activeHeaderTab, activeHeaderItem: activeHeaderItem
+          viewer.render()
+        else if activeHeaderTab?
+          viewer.state.set activeHeaderTab: activeHeaderTab
+          viewer.headerView.render()
+          viewer.showAllLines()
         else if drilldown.period?
           viewer.enablePeriod drilldown.period, 'issues'
         else
index d85ec989fde12c27bbdda4a2dc372ae39b40d468..730ebb88a0f34038811a9be89a6e412fe824b564 100644 (file)
@@ -73,4 +73,12 @@ define
   'duplicated_lines':                 { tab: 'duplications', item: '.js-filter-duplications' }
   'duplicated_blocks':                { tab: 'duplications', item: '.js-filter-duplications' }
   'duplicated_files':                 { tab: 'duplications', item: '.js-filter-duplications' }
-  'duplicated_lines_density':         { tab: 'duplications', item: '.js-filter-duplications' }
\ No newline at end of file
+  'duplicated_lines_density':         { tab: 'duplications', item: '.js-filter-duplications' }
+
+
+  # Tests
+  'test_success_density':             { tab: 'tests', item: null }
+  'skipped_tests':                    { tab: 'tests', item: null }
+  'test_failures':                    { tab: 'tests', item: null }
+  'test_errors':                      { tab: 'tests', item: null }
+  'test_execution_time':              { tab: 'tests', item: null }
\ No newline at end of file
index a65dc801b75303390f698546853e95127a2a584a..5d4a6cf741ec7388abc506110bf0090e097102d7 100644 (file)
@@ -34,6 +34,7 @@ class DashboardController < ApplicationController
       @hide_sidebar = true
       @file = @resource
       @project = @snapshot.parent.project
+      @metric=params[:metric]
       render :action => 'no_dashboard'
     end
   end
index c588a50d1e0b97d6b19a61f1c39ba0408869d546..8802eb19301c7d6bb2cf086e1da1ff402ea3605f 100644 (file)
@@ -2,26 +2,11 @@
   <script data-main="<%= ApplicationController.root_context -%>/js/dashboard/file-app" src="<%= ApplicationController.root_context -%>/js/require.js"></script>
 <% end %>
 
-<%= render :partial => 'gwt/base', :locals => {:resource => nil, :popup => false, :metric => nil} -%>
-<%= render :partial => 'gwt/resource_viewers' -%>
-
 <div class="marginbottom10"></div>
 <div id="accordion-panel"></div>
 
 <script type="text/javascript">
-
-  // see if an anchor has been passed
-  var anchor;
-  var stripped_url = document.location.toString().split("#");
-  if (stripped_url.length > 1) {
-    anchor = stripped_url[1];
-  }
-
   window.fileKey = '<%= @file.key -%>';
-
-  // refresh page after issues bulk change
-  function onBulkIssues(){
-    resourceViewerOnBulkIssues();
-  }
-
+  window.metric = '<%= @metric -%>';
+  document.getElementById('crumbs').remove();
 </script>