From: Simon Brandhof Date: Tue, 27 Mar 2012 11:39:25 +0000 (+0200) Subject: SONAR-3323 slight improvements of snapshot#metric_keys X-Git-Tag: 3.0~117 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=9c834358db5dc7e944aa23f04ed50304a2913928;p=sonarqube.git SONAR-3323 slight improvements of snapshot#metric_keys --- diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/dashboard_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/dashboard_controller.rb index 674d6509076..6b27afd7a08 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/dashboard_controller.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/dashboard_controller.rb @@ -186,7 +186,7 @@ class DashboardController < ApplicationController def load_authorized_widget_definitions if @resource - @authorized_widget_definitions = java_facade.getWidgets(@resource.scope, @resource.qualifier, @resource.language, @snapshot.available_measures) + @authorized_widget_definitions = java_facade.getWidgets(@resource.scope, @resource.qualifier, @resource.language, @snapshot.metric_keys.to_java(:string)) @authorized_widget_definitions=@authorized_widget_definitions.select do |widget| authorized=widget.getUserRoles().size==0 unless authorized 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 feb4f8e64eb..b7500f6999a 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 @@ -173,7 +173,7 @@ class DrilldownController < ApplicationController def display_metric_viewers?(resource, metric_key) return true if resource.file? - java_facade.getResourceTabsForMetric(resource.scope, resource.qualifier, resource.language, resource.last_snapshot.available_measures, metric_key).each do |tab| + java_facade.getResourceTabsForMetric(resource.scope, resource.qualifier, resource.language, resource.last_snapshot.metric_keys.to_java(:string), metric_key).each do |tab| tab.getUserRoles().each do |role| if has_role?(role, resource) return true diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/resource_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/resource_controller.rb index bf970cf2a96..631ca73e1a2 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/resource_controller.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/resource_controller.rb @@ -113,7 +113,7 @@ class ResourceController < ApplicationController def load_extensions @extensions=[] - java_facade.getResourceTabs(@resource.scope, @resource.qualifier, @resource.language, @snapshot.available_measures).each do |tab| + java_facade.getResourceTabs(@resource.scope, @resource.qualifier, @resource.language, @snapshot.metric_keys.to_java(:string)).each do |tab| if tab.getUserRoles().empty? @extensions<"><%= message('violations_drilldown.page') -%>
  • <%= message('clouds.page') -%>
  • - <% controller.java_facade.getPages(Navigation::SECTION_RESOURCE, @project.scope, @project.qualifier, @project.language, @project.last_snapshot.available_measures).each do |page| %> + <% controller.java_facade.getPages(Navigation::SECTION_RESOURCE, @project.scope, @project.qualifier, @project.language, @project.last_snapshot.metric_keys.to_java(:string)).each do |page| %>
  • "> <%= message(page.getId() + '.page', :default => page.getTitle()) %>