aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-server/src
diff options
context:
space:
mode:
Diffstat (limited to 'sonar-server/src')
-rw-r--r--sonar-server/src/main/coffee/component-viewer/header/coverage-header.coffee2
-rw-r--r--sonar-server/src/main/coffee/component-viewer/header/issues-header.coffee2
-rw-r--r--sonar-server/src/main/coffee/component-viewer/main.coffee12
-rw-r--r--sonar-server/src/main/coffee/drilldown/app.coffee21
-rw-r--r--sonar-server/src/main/coffee/drilldown/conf.coffee3
-rw-r--r--sonar-server/src/main/hbs/component-viewer/header.hbs4
-rw-r--r--sonar-server/src/main/js/common/handlebars-extensions.js2
-rw-r--r--sonar-server/src/main/less/component-viewer.less3
8 files changed, 27 insertions, 22 deletions
diff --git a/sonar-server/src/main/coffee/component-viewer/header/coverage-header.coffee b/sonar-server/src/main/coffee/component-viewer/header/coverage-header.coffee
index 1c426b35379..03c408fa888 100644
--- a/sonar-server/src/main/coffee/component-viewer/header/coverage-header.coffee
+++ b/sonar-server/src/main/coffee/component-viewer/header/coverage-header.coffee
@@ -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) ->
diff --git a/sonar-server/src/main/coffee/component-viewer/header/issues-header.coffee b/sonar-server/src/main/coffee/component-viewer/header/issues-header.coffee
index fa066fe0298..633425ad3e4 100644
--- a/sonar-server/src/main/coffee/component-viewer/header/issues-header.coffee
+++ b/sonar-server/src/main/coffee/component-viewer/header/issues-header.coffee
@@ -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) ->
diff --git a/sonar-server/src/main/coffee/component-viewer/main.coffee b/sonar-server/src/main/coffee/component-viewer/main.coffee
index 8dd9ad705e1..45764200a45 100644
--- a/sonar-server/src/main/coffee/component-viewer/main.coffee
+++ b/sonar-server/src/main/coffee/component-viewer/main.coffee
@@ -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()
diff --git a/sonar-server/src/main/coffee/drilldown/app.coffee b/sonar-server/src/main/coffee/drilldown/app.coffee
index cc7ab15b194..f7704f39cc8 100644
--- a/sonar-server/src/main/coffee/drilldown/app.coffee
+++ b/sonar-server/src/main/coffee/drilldown/app.coffee
@@ -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
diff --git a/sonar-server/src/main/coffee/drilldown/conf.coffee b/sonar-server/src/main/coffee/drilldown/conf.coffee
index 730ebb88a0f..ffe6c787736 100644
--- a/sonar-server/src/main/coffee/drilldown/conf.coffee
+++ b/sonar-server/src/main/coffee/drilldown/conf.coffee
@@ -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
diff --git a/sonar-server/src/main/hbs/component-viewer/header.hbs b/sonar-server/src/main/hbs/component-viewer/header.hbs
index c20b5896ed8..2810306f7b7 100644
--- a/sonar-server/src/main/hbs/component-viewer/header.hbs
+++ b/sonar-server/src/main/hbs/component-viewer/header.hbs
@@ -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}}
diff --git a/sonar-server/src/main/js/common/handlebars-extensions.js b/sonar-server/src/main/js/common/handlebars-extensions.js
index b0fc9ccb818..93dcc343076 100644
--- a/sonar-server/src/main/js/common/handlebars-extensions.js
+++ b/sonar-server/src/main/js/common/handlebars-extensions.js
@@ -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';
}
diff --git a/sonar-server/src/main/less/component-viewer.less b/sonar-server/src/main/less/component-viewer.less
index b732a31004e..027e70f7b22 100644
--- a/sonar-server/src/main/less/component-viewer.less
+++ b/sonar-server/src/main/less/component-viewer.less
@@ -494,6 +494,9 @@
}
.component-viewer-header-expanded-bar-section-list {
+ max-height: 120px; // 5 items
+ overflow: auto;
+ .webkit-scrollbar;
& > li > .item {
position: relative;