aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsimonbrandhof <simon.brandhof@gmail.com>2011-12-04 22:44:17 +0100
committersimonbrandhof <simon.brandhof@gmail.com>2011-12-04 23:24:33 +0100
commit524677d6bdb4b9810583c7f2fe8b20de0d070ffe (patch)
tree0d1800b3d095ec0d69e25bd01f3c9312db033db3
parent20dd0320424a11d674f7e17569f2b816bc877985 (diff)
downloadsonarqube-524677d6bdb4b9810583c7f2fe8b20de0d070ffe.tar.gz
sonarqube-524677d6bdb4b9810583c7f2fe8b20de0d070ffe.zip
Fix drilldown page in order to accept the parameter period=0
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/controllers/drilldown_controller.rb8
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/models/api/dashboard_configuration.rb4
2 files changed, 6 insertions, 6 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/drilldown_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/drilldown_controller.rb
index ca66a93d92d..b35c5378c16 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/drilldown_controller.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/drilldown_controller.rb
@@ -70,12 +70,12 @@ class DrilldownController < ApplicationController
@rule=Rule.by_key_or_id(params[:rule])
# variation measures
- if params[:period].blank?
- @period=nil
- metric_prefix = ''
- else
+ if params[:period].present? && params[:period].to_i>0
@period=params[:period].to_i
metric_prefix = 'new_'
+ else
+ @period=nil
+ metric_prefix = ''
end
@severity = params[:severity] || params[:priority]
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/models/api/dashboard_configuration.rb b/sonar-server/src/main/webapp/WEB-INF/app/models/api/dashboard_configuration.rb
index 3ae393f9d9e..372a44bd4de 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/models/api/dashboard_configuration.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/models/api/dashboard_configuration.rb
@@ -23,8 +23,8 @@ class Api::DashboardConfiguration
def initialize(dashboard, options={})
@dashboard=dashboard
- @period_index=options[:period_index].to_i
- @selected_period=(@period_index>0)
+ @period_index=(options[:period_index].to_i>0 ? options[:period_index].to_i : nil)
+ @selected_period=(@period_index != nil)
@snapshot=options[:snapshot]
end