From 9c834358db5dc7e944aa23f04ed50304a2913928 Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Tue, 27 Mar 2012 13:39:25 +0200 Subject: [PATCH] SONAR-3323 slight improvements of snapshot#metric_keys --- .../app/controllers/dashboard_controller.rb | 2 +- .../app/controllers/drilldown_controller.rb | 2 +- .../app/controllers/resource_controller.rb | 2 +- .../webapp/WEB-INF/app/models/snapshot.rb | 32 ++++++++----------- .../app/views/layouts/_layout.html.erb | 2 +- 5 files changed, 17 insertions(+), 23 deletions(-) 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()) %>
  • -- 2.39.5