From b7555709cf2e71c76749b5d7780c98c1ac7d1d5d Mon Sep 17 00:00:00 2001 From: Stas Vilchik Date: Wed, 2 Dec 2015 10:19:58 +0100 Subject: [PATCH] SONAR-7078 Open drilldown on "Technical Debt on New code" when failed condition is "Technical Debt Ratio on New Code" --- .../src/main/js/components/shared/drilldown-link.js | 4 +++- .../main/webapp/WEB-INF/app/helpers/application_helper.rb | 6 +++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/server/sonar-web/src/main/js/components/shared/drilldown-link.js b/server/sonar-web/src/main/js/components/shared/drilldown-link.js index 7623209e8a5..6431b846100 100644 --- a/server/sonar-web/src/main/js/components/shared/drilldown-link.js +++ b/server/sonar-web/src/main/js/components/shared/drilldown-link.js @@ -49,7 +49,9 @@ const HIGHLIGHT_MAPPING = { 'new_overall_coverage': 'new_overall_uncovered_lines', 'new_overall_line_coverage': 'new_overall_uncovered_lines', - 'new_overall_branch_coverage': 'new_overall_uncovered_conditions' + 'new_overall_branch_coverage': 'new_overall_uncovered_conditions', + + 'new_sqale_debt_ratio': 'new_technical_debt' }; diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/helpers/application_helper.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/helpers/application_helper.rb index f0c82f2c13b..da06341aa5a 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/helpers/application_helper.rb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/helpers/application_helper.rb @@ -235,7 +235,11 @@ module ApplicationHelper url += 'resolved=false' end else - url = url_for(options.merge({:controller => 'drilldown', :action => 'measures', :metric => metric_key, :id => options[:resource]||@resource.id})) + if metric_key == 'new_sqale_debt_ratio' + url = url_for(options.merge({:controller => 'drilldown', :action => 'measures', :metric => 'new_technical_debt', :highlight => 'new_sqale_debt_ratio', :id => options[:resource]||@resource.id})) + else + url = url_for(options.merge({:controller => 'drilldown', :action => 'measures', :metric => metric_key, :id => options[:resource]||@resource.id})) + end end url -- 2.39.5