]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-5209 Integration feedback
authorStas Vilchik <vilchiks@gmail.com>
Thu, 19 Jun 2014 08:16:07 +0000 (14:16 +0600)
committerStas Vilchik <vilchiks@gmail.com>
Thu, 19 Jun 2014 08:16:07 +0000 (14:16 +0600)
sonar-server/src/main/coffee/component-viewer/header/coverage-header.coffee
sonar-server/src/main/coffee/component-viewer/header/issues-header.coffee
sonar-server/src/main/coffee/component-viewer/main.coffee
sonar-server/src/main/coffee/drilldown/app.coffee
sonar-server/src/main/coffee/drilldown/conf.coffee
sonar-server/src/main/hbs/component-viewer/header.hbs
sonar-server/src/main/js/common/handlebars-extensions.js
sonar-server/src/main/less/component-viewer.less

index 1c426b35379f9b6d8655903898fe24c5bd089795..03c408fa8889c43f0948e73756cee846a9214df8 100644 (file)
@@ -38,7 +38,7 @@ define [
         main: @options.main
         bottom: true
       popup.render()
-      popup.on 'change', (period) => @main.enablePeriod period, 'coverage'
+      popup.on 'change', (period) => @main.enablePeriod period, '.js-filter-lines-to-cover'
 
 
     filterByLinesToCover: (e) ->
index fa066fe02989df0f67a38ce6426989910f442e51..633425ad3e4f5dcf38c6fac7b192a8a2c1d583f0 100644 (file)
@@ -50,7 +50,7 @@ define [
         bottom: true
         prefix: t 'component_viewer.added'
       popup.render()
-      popup.on 'change', (period) => @main.enablePeriod period, 'issues'
+      popup.on 'change', (period) => @main.enablePeriod period, '.js-filter-unresolved-issues'
 
 
     filterByCurrentIssue: (e) ->
index 8dd9ad705e11c6625d560ba544bf6eca2b2788a7..45764200a454e60f93faa16b8e73e0f02a44333d 100644 (file)
@@ -124,7 +124,8 @@ define [
 
     requestComponent: (key, clear = false, full = true) ->
       STATE_FIELDS = ['canBulkChange', 'canMarkAsFavourite', 'canCreateManualIssue', 'tabs', 'manual_rules']
-      COMPONENT_FIELDS = ['key', 'name', 'path', 'q', 'projectName', 'subProjectName', 'measures', 'fav']
+      COMPONENT_FIELDS = ['key', 'name', 'path', 'q', 'project', 'projectName', 'subProject', 'subProjectName',
+                          'measures', 'fav']
 
       $.get API_COMPONENT, key: key, (data) =>
         # Component
@@ -256,15 +257,12 @@ define [
       @sourceView.render()
 
 
-    enablePeriod: (periodKey, scope = 'scm') ->
+    enablePeriod: (periodKey, activeHeaderItem) ->
       period = if periodKey == '' then null else @periods.findWhere key: periodKey
       @state.set 'period', period
       $.when(@requestMeasures(@key, period?.get('key')), @requestIssuesPeriod(@key, period?.get('key')), @requestSCM(@key)).done =>
-        if scope == 'issues'
-          @state.set 'activeHeaderItem', '.js-filter-unresolved-issues'
-          @headerView.render()
-        else if scope == 'coverage'
-          @state.set 'activeHeaderItem', '.js-filter-lines-to-cover'
+        if activeHeaderItem?
+          @state.set 'activeHeaderItem', activeHeaderItem
           @headerView.render()
         else @filterBySCM()
 
index cc7ab15b194603464228109ad5de2591e17b85d5..f7704f39cc8a54b305ac09cd272d1dfdc6f0056e 100644 (file)
@@ -68,18 +68,19 @@ requirejs [
       e.preventDefault()
       key = $(e.currentTarget).data 'key'
       viewer = App.requestComponentViewer()
-      viewer.open(key).done ->
-        if activeHeaderTab? && activeHeaderItem?
+
+      f = ->
+        if drilldown.period?
+          viewer.enablePeriod drilldown.period, activeHeaderItem
+        else
           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
-          viewer.showAllLines()
+
+      viewer.open(key).done ->
+        if activeHeaderTab?
+          viewer.headerView.enableBar(activeHeaderTab).done -> f()
+        else f()
+
 
 
   # Message bundles
index 730ebb88a0f34038811a9be89a6e412fe824b564..ffe6c7877369980a5a12e941f38d54783887ad90 100644 (file)
@@ -67,6 +67,9 @@ define
   'false_positive_issues':            { tab: 'issues', item: '.js-filter-false-positive-issues' }
   'sqale_index':                      { tab: 'issues', item: '.js-filter-unresolved-issues' }
   'new_technical_debt':               { tab: 'issues', item: '.js-filter-unresolved-issues' }
+  'open_issues':                      { tab: 'issues', item: '.js-filter-unresolved-issues' }
+  'reopened_issues':                  { tab: 'issues', item: '.js-filter-unresolved-issues' }
+  'confirmed_issues':                 { tab: 'issues', item: '.js-filter-unresolved-issues' }
 
 
   # Duplications
index c20b5896ed8b6164e1535d22d3c9a8ac6d561f8e..2810306f7b749b05f126c3950c3698c387b6a880 100644 (file)
@@ -2,9 +2,9 @@
   <div class="component-viewer-header-component">
     {{#if component.projectName}}
       <div class="component-viewer-header-component-project">
-        {{qualifierIcon 'TRK'}} {{component.projectName}}
+        {{qualifierIcon 'TRK'}} <a href="{{dashboardUrl component.project}}">{{component.projectName}}</a>
         {{#if component.subProjectName}}
-          / {{component.subProjectName}}
+          / <a href="{{dashboardUrl component.subProject}}">{{component.subProjectName}}</a>
         {{/if}}
       </div>
     {{/if}}
index b0fc9ccb818c9e76d46bb90dd411852e5e7ca6db..93dcc343076b54df3faef65dcfe26764992011cd 100644 (file)
@@ -181,7 +181,7 @@ define(['handlebars', 'moment'], function (Handlebars, moment) {
   });
 
   Handlebars.registerHelper('dashboardUrl', function(componentKey, componentQualifier) {
-    var url = '/dashboard/index/' + decodeURIComponent(componentKey);
+    var url = baseUrl + '/dashboard/index/' + decodeURIComponent(componentKey);
     if (componentQualifier === 'FIL' || componentQualifier === 'CLA') {
       url += '?metric=sqale_index';
     }
index b732a31004e03cc88635bb0fa88f99b17c947308..027e70f7b22ceff7cdc5a08e89deb4f2bd0ac8f8 100644 (file)
 }
 
 .component-viewer-header-expanded-bar-section-list {
+  max-height: 120px; // 5 items
+  overflow: auto;
+  .webkit-scrollbar;
 
   & > li > .item {
     position: relative;