component_viewer.details=Details
component_viewer.add_manual_issue=Add Manual Issue
component_viewer.line_actions=Line Actions
+component_viewer.no_issues=No Issues
+component_viewer.no_coverage=No Coverage
+component_viewer.time_changes=Time Changes
+component_viewer.added=Added
component_viewer.workspace=Workspace
component_viewer.workspace.tooltip=Keeps track of history of navigation
enableBarItem: (item) ->
- @$(item).click()
+ $item = @$(item)
+ if $item.length > 0
+ @$(item).click()
+ else
+ @options.main.hideAllLines()
showExpandedBar: (e) ->
main: @options.main
bottom: true
popup.render()
- popup.on 'change', (period) => @main.enablePeriod period
+ popup.on 'change', (period) => @main.enablePeriod period, 'coverage'
filterByLinesToCover: (e) ->
triggerEl: $(e.currentTarget)
main: @options.main
bottom: true
- prefix: 'Added'
+ prefix: t 'component_viewer.added'
popup.render()
popup.on 'change', (period) => @main.enablePeriod period, 'issues'
serializeData: ->
- _.extend super, period: @state.get('period')?.toJSON()
\ No newline at end of file
+ _.extend super,
+ period: @state.get('period')?.toJSON()
+ hasIssues: @state.get('severities')?.length || @state.get('rules')?.length
\ No newline at end of file
measures = @component.get 'measures'
measuresList.forEach (m) ->
key = m.key.substr(4)
- variation = "var#{period}"
+ variation = "fvar#{period}"
measures[key] = m[variation]
@component.set 'measures', measures
@sourceView.render()
+ hideAllLines: ->
+ @sourceView.resetShowBlocks()
+ @sourceView.render()
+
+
enablePeriod: (periodKey, scope = 'scm') ->
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 =>
- @headerView.render()
if scope == 'issues'
- @filterByUnresolvedIssues() unless @state.get('activeHeaderItem')
- else
- @filterBySCM()
+ @state.set 'activeHeaderItem', '.js-filter-unresolved-issues'
+ @headerView.render()
+ else if scope == 'coverage'
+ @state.set 'activeHeaderItem', '.js-filter-lines-to-cover'
+ @headerView.render()
+ else @filterBySCM()
addTransition: (transition, options) ->
<div class="component-viewer-header-time-changes">
<a class="highlighted-link js-coverage-time-changes">
- {{#if period}}Δ {{period.label}}{{else}}<i class="icon-period"></i> Time Changes{{/if}}
+ {{#if period}}Δ {{period.label}}{{else}}<i class="icon-period"></i> {{t 'component_viewer.time_changes'}}{{/if}}
</a>
</div>
{{#with component.measures}}
+ {{#any coverage line_coverage lines_to_cover covered_lines uncovered_lines branch_coverage conditions_to_cover covered_conditions uncovered_conditions it_coverage it_line_coverage it_lines_to_cover it_covered_lines it_uncovered_lines it_branch_coverage it_conditions_to_cover it_covered_conditions it_uncovered_conditions}}
+ {{else}}
+ <div class="component-viewer-header-expanded-bar-section">
+ <div class="component-viewer-header-expanded-bar-section-title">
+ {{t 'component_viewer.no_coverage'}}
+ </div>
+ {{/any}}
+
<span class="nowrap">
{{#any coverage line_coverage lines_to_cover covered_lines uncovered_lines}}
<div class="component-viewer-header-expanded-bar-section">
{{#any branch_coverage conditions_to_cover covered_conditions uncovered_conditions}}
<div class="component-viewer-header-expanded-bar-section">
- <div class="component-viewer-header-expanded-bar-section-title"> </div>
+ <div class="component-viewer-header-expanded-bar-section-title">
+ {{#any coverage line_coverage lines_to_cover covered_lines uncovered_lines}}
+
+ {{else}}
+ {{t 'component_viewer.measure_section.unit_tests'}}
+ {{/any}}
+ </div>
<ul class="component-viewer-header-expanded-bar-section-list">
- <li><span class="item"> </span></li>
+ {{#any coverage line_coverage lines_to_cover covered_lines uncovered_lines}}
+ <li><span class="item"> </span></li>
+ {{/any}}
{{{componentViewerHeaderItem branch_coverage 'branch_coverage'}}}
{{{componentViewerHeaderLink conditions_to_cover 'conditions_to_cover' 'js-filter-branches-to-cover'}}}
{{{componentViewerHeaderLink uncovered_conditions 'uncovered_conditions' 'js-filter-uncovered-branches'}}}
{{#any it_branch_coverage it_conditions_to_cover it_covered_conditions it_uncovered_conditions}}
<div class="component-viewer-header-expanded-bar-section">
- <div class="component-viewer-header-expanded-bar-section-title"> </div>
+ <div class="component-viewer-header-expanded-bar-section-title">
+ {{#any it_coverage it_line_coverage it_lines_to_cover it_covered_lines it_uncovered_lines}}
+
+ {{else}}
+ {{t 'component_viewer.measure_section.integration_tests'}}
+ {{/any}}
+ </div>
<ul class="component-viewer-header-expanded-bar-section-list">
- <li><span class="item"> </span></li>
+ {{#any it_coverage it_line_coverage it_lines_to_cover it_covered_lines it_uncovered_lines}}
+ <li><span class="item"> </span></li>
+ {{/any}}
{{{componentViewerHeaderItem it_branch_coverage 'branch_coverage'}}}
{{{componentViewerHeaderLink it_conditions_to_cover 'conditions_to_cover' 'js-filter-branches-to-cover-it'}}}
{{{componentViewerHeaderLink it_uncovered_conditions 'uncovered_conditions' 'js-filter-uncovered-branches-it'}}}
<div class="component-viewer-header-time-changes">
<a class="highlighted-link js-issues-time-changes">
- {{#if period}}Added {{period.label}}{{else}}<i class="icon-period"></i> Time Changes{{/if}}
+ {{#if period}}{{t 'component_viewer.added'}} {{period.label}}{{else}}<i class="icon-period"></i> {{t 'component_viewer.time_changes'}}{{/if}}
</a>
</div>
<div class="component-viewer-header-expanded-bar-section">
<div class="component-viewer-header-expanded-bar-section-title">
- {{t 'component_viewer.measure_section.issues'}}
+ {{#if hasIssues}} {{else}}{{t 'component_viewer.no_issues'}}{{/if}}
</div>
<ul class="component-viewer-header-expanded-bar-section-list">
{{#if currentIssue}}
</ul>
</div>
-<div class="component-viewer-header-expanded-bar-section component-viewer-header-expanded-bar-section-actions">
- <div class="component-viewer-header-expanded-bar-section-title"> </div>
- <ul class="component-viewer-header-expanded-bar-section-list">
- {{#if state.canBulkChange}}
- <li><a class="link-action js-issues-bulk-change">
- <span><i class="icon-bulk-change"></i> {{t 'bulk_change'}}</span>
- </a></li>
- {{/if}}
- </ul>
-</div>
+{{#if hasIssues}}
+ <div class="component-viewer-header-expanded-bar-section component-viewer-header-expanded-bar-section-actions">
+ <div class="component-viewer-header-expanded-bar-section-title"> </div>
+ <ul class="component-viewer-header-expanded-bar-section-list">
+ {{#if state.canBulkChange}}
+ <li><a class="link-action js-issues-bulk-change">
+ <span><i class="icon-bulk-change"></i> {{t 'bulk_change'}}</span>
+ </a></li>
+ {{/if}}
+ </ul>
+ </div>
+{{/if}}
<div class="component-viewer-header-time-changes">
<a class="highlighted-link js-scm-time-changes">
- {{#if period}}Δ {{period.label}}{{else}}<i class="icon-period"></i> Time Changes{{/if}}
+ {{#if period}}Δ {{period.label}}{{else}}<i class="icon-period"></i> {{t 'component_viewer.time_changes'}}{{/if}}
</a>
</div>
\ No newline at end of file
notEmpty = args.reduce(function(prev, current) {
return prev || (current && current.length > 0);
}, false);
- return notEmpty ? options.fn(this) : '';
+ return notEmpty ? options.fn(this) : options.inverse(this);
});
Handlebars.registerHelper('join', function(array, separator) {