];
+const HIGHLIGHT_MAPPING = {
+ 'coverage': 'uncovered_lines',
+ 'line_coverage': 'uncovered_lines',
+ 'branch_coverage': 'uncovered_conditions',
+
+ 'new_coverage': 'new_uncovered_lines',
+ 'new_line_coverage': 'new_uncovered_lines',
+ 'new_branch_coverage': 'new_uncovered_conditions',
+
+ 'it_coverage': 'it_uncovered_lines',
+ 'it_line_coverage': 'it_uncovered_lines',
+ 'it_branch_coverage': 'it_uncovered_conditions',
+
+ 'new_it_coverage': 'new_it_uncovered_lines',
+ 'new_it_line_coverage': 'new_it_uncovered_lines',
+ 'new_it_branch_coverage': 'new_it_uncovered_conditions',
+
+ 'overall_coverage': 'overall_uncovered_lines',
+ 'overall_line_coverage': 'overall_uncovered_lines',
+ 'overall_branch_coverage': 'overall_uncovered_conditions',
+
+ 'new_overall_coverage': 'new_overall_uncovered_lines',
+ 'new_overall_line_coverage': 'new_overall_uncovered_lines',
+ 'new_overall_branch_coverage': 'new_overall_uncovered_conditions'
+};
+
+
export const DrilldownLink = React.createClass({
isIssueMeasure() {
return ISSUE_MEASURES.indexOf(this.props.metric) !== -1;
return this.renderIssuesLink();
}
- let url = getComponentDrilldownUrl(this.props.component, this.props.metric, this.props.period);
+ let highlightedMetric = HIGHLIGHT_MAPPING[this.props.metric];
+ let url = highlightedMetric ?
+ getComponentDrilldownUrl(this.props.component, highlightedMetric, this.props.period, this.props.metric) :
+ getComponentDrilldownUrl(this.props.component, this.props.metric, this.props.period);
return <a className={this.props.className} href={url}>{this.props.children}</a>;
}
});
* @param {string} componentKey
* @param {string} metric
* @param {string|number} [period]
+ * @param {string} [highlightedMetric]
* @returns {string}
*/
-export function getComponentDrilldownUrl (componentKey, metric, period) {
+export function getComponentDrilldownUrl (componentKey, metric, period, highlightedMetric) {
let url = window.baseUrl + '/drilldown/measures?id=' + encodeURIComponent(componentKey) +
'&metric=' + encodeURIComponent(metric);
if (period) {
url += '&period=' + period;
}
+ if (highlightedMetric) {
+ url += '&highlight=' + encodeURIComponent(highlightedMetric);
+ }
return url;
}