diff options
author | simonbrandhof <simon.brandhof@gmail.com> | 2010-12-15 14:35:33 +0000 |
---|---|---|
committer | simonbrandhof <simon.brandhof@gmail.com> | 2010-12-15 14:35:33 +0000 |
commit | 9e75d602fcaf9975d945224ec1548a143c77c5b3 (patch) | |
tree | c105fa4d23614bfdfd7ec9594ea88d8764b212e2 /sonar-server/src/main/webapp/WEB-INF/app/helpers | |
parent | dfbfcb1f08d1c8ab26e786f508f98958f178aee3 (diff) | |
download | sonarqube-9e75d602fcaf9975d945224ec1548a143c77c5b3.tar.gz sonarqube-9e75d602fcaf9975d945224ec1548a143c77c5b3.zip |
SONAR-249 rename FILTERS.VARIATION_INDEX to FILTERS.PERIOD_INDEX + support variations in the resources web service + add IT
Diffstat (limited to 'sonar-server/src/main/webapp/WEB-INF/app/helpers')
4 files changed, 11 insertions, 11 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/helpers/application_helper.rb b/sonar-server/src/main/webapp/WEB-INF/app/helpers/application_helper.rb index d240996c7c0..242be6bc1f5 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/helpers/application_helper.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/helpers/application_helper.rb @@ -440,8 +440,8 @@ module ApplicationHelper end index=options[:index] - if index.nil? && defined?(@dashboard_configuration) && @dashboard_configuration.variation? - index = @dashboard_configuration.variation_index + if index.nil? && defined?(@dashboard_configuration) && @dashboard_configuration.selected_period? + index = @dashboard_configuration.period_index end m.variation(index) diff --git a/sonar-server/src/main/webapp/WEB-INF/app/helpers/dashboard_helper.rb b/sonar-server/src/main/webapp/WEB-INF/app/helpers/dashboard_helper.rb index 0cebecfe02a..f49827b46cb 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/helpers/dashboard_helper.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/helpers/dashboard_helper.rb @@ -28,7 +28,7 @@ module DashboardHelper @snapshot.measure(metric_key) end - def variation_select_option(snapshot, index) + def period_select_options(snapshot, index) return nil if snapshot.nil? || snapshot.project_snapshot.nil? mode=snapshot.project_snapshot.send "period#{index}_mode" mode_param=snapshot.project_snapshot.send "period#{index}_param" @@ -44,7 +44,7 @@ module DashboardHelper label = "Compare to #{localize(Date.parse(mode_param))}" end if label - selected=(params[:var]==index.to_s ? 'selected' : '') + selected=(params[:period]==index.to_s ? 'selected' : '') "<option value='#{index}' #{selected}>#{label}</option>" end else diff --git a/sonar-server/src/main/webapp/WEB-INF/app/helpers/drilldown_helper.rb b/sonar-server/src/main/webapp/WEB-INF/app/helpers/drilldown_helper.rb index 1959e5709ae..0016d5e7919 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/helpers/drilldown_helper.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/helpers/drilldown_helper.rb @@ -19,7 +19,7 @@ # module DrilldownHelper - def variation_select_option(snapshot, index) + def period_select_options(snapshot, index) return nil if snapshot.nil? || snapshot.project_snapshot.nil? mode=snapshot.project_snapshot.send "period#{index}_mode" mode_param=snapshot.project_snapshot.send "period#{index}_param" @@ -35,7 +35,7 @@ module DrilldownHelper label = "New violations since #{localize(Date.parse(mode_param))}" end if label - selected=(params[:var]==index.to_s ? 'selected' : '') + selected=(params[:period]==index.to_s ? 'selected' : '') "<option value='#{index}' #{selected}>#{label}</option>" end else @@ -46,7 +46,7 @@ module DrilldownHelper def measure_or_variation_value(measure) if measure - @variation_index ? measure.variation(@variation_index) : measure.value + @period_index ? measure.variation(@period_index) : measure.value else nil end diff --git a/sonar-server/src/main/webapp/WEB-INF/app/helpers/filters_helper.rb b/sonar-server/src/main/webapp/WEB-INF/app/helpers/filters_helper.rb index 159341710d1..b6a2b77c04b 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/helpers/filters_helper.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/helpers/filters_helper.rb @@ -98,7 +98,7 @@ module FiltersHelper #----- VARIATION - java_filter.setSortedVariationIndex(filter_context.variation_index) + java_filter.setSortedVariationIndex(filter_context.period_index) #----- EXECUTION java_result=java_facade.execute_filter(java_filter) @@ -160,9 +160,9 @@ module FiltersHelper end def period_names - p1=Property.value('sonar.timemachine.variation1', nil, 'previous_analysis') - p2=Property.value('sonar.timemachine.variation2', nil, '5') - p3=Property.value('sonar.timemachine.variation3', nil, '30') + p1=Property.value('sonar.timemachine.period1', nil, 'previous_analysis') + p2=Property.value('sonar.timemachine.period2', nil, '5') + p3=Property.value('sonar.timemachine.period3', nil, '30') [period_name(p1), period_name(p2), period_name(p3)] end |