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) ->
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) ->
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
@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()
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
'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
<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}}
});
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';
}
}
.component-viewer-header-expanded-bar-section-list {
+ max-height: 120px; // 5 items
+ overflow: auto;
+ .webkit-scrollbar;
& > li > .item {
position: relative;