From: Julien Lancelot Date: Wed, 18 Jun 2014 08:11:16 +0000 (+0200) Subject: Add formatted values on differential measures on /api/resources/index X-Git-Tag: 4.4-RC1~365 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=3b00bfe50b62711c7396c0ac18eb78879c78f113;p=sonarqube.git Add formatted values on differential measures on /api/resources/index --- diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/api/resources_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/api/resources_controller.rb index 92ff867d2ba..1bca9a153f1 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/api/resources_controller.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/api/resources_controller.rb @@ -442,10 +442,15 @@ class Api::ResourcesController < Api::ApiController json_measure[:var]=measure.tendency end json_measure[:var1]=measure.variation_value_1.to_f if measure.variation_value_1 + json_measure[:fvar1]=measure.format_numeric_value(measure.variation_value_1.to_f) if measure.variation_value_1 json_measure[:var2]=measure.variation_value_2.to_f if measure.variation_value_2 + json_measure[:fvar2]=measure.format_numeric_value(measure.variation_value_2.to_f) if measure.variation_value_2 json_measure[:var3]=measure.variation_value_3.to_f if measure.variation_value_3 + json_measure[:fvar3]=measure.format_numeric_value(measure.variation_value_3.to_f) if measure.variation_value_3 json_measure[:var4]=measure.variation_value_4.to_f if measure.variation_value_4 + json_measure[:fvar4]=measure.format_numeric_value(measure.variation_value_4.to_f) if measure.variation_value_4 json_measure[:var5]=measure.variation_value_5.to_f if measure.variation_value_5 + json_measure[:fvar5]=measure.format_numeric_value(measure.variation_value_5.to_f) if measure.variation_value_5 end if measure.rule_id rule = rules_by_id[measure.rule_id] @@ -528,10 +533,15 @@ class Api::ResourcesController < Api::ApiController xml.var(measure.tendency) end xml.var1(measure.variation_value_1.to_f) if measure.variation_value_1 + xml.fvar1(measure.format_numeric_value(measure.variation_value_1.to_f)) if measure.variation_value_1 xml.var2(measure.variation_value_2.to_f) if measure.variation_value_2 + xml.fvar2(measure.format_numeric_value(measure.variation_value_2.to_f)) if measure.variation_value_2 xml.var3(measure.variation_value_3.to_f) if measure.variation_value_3 + xml.fvar3(measure.format_numeric_value(measure.variation_value_3.to_f)) if measure.variation_value_3 xml.var4(measure.variation_value_4.to_f) if measure.variation_value_4 + xml.fvar4(measure.format_numeric_value(measure.variation_value_4.to_f)) if measure.variation_value_4 xml.var5(measure.variation_value_5.to_f) if measure.variation_value_5 + xml.fvar5(measure.format_numeric_value(measure.variation_value_5.to_f)) if measure.variation_value_5 end if measure.rule_id rule = rules_by_id[measure.rule_id]