]> source.dussan.org Git - sonarqube.git/commitdiff
Do not display to anonymous the measure filters that have the criteria "Favourites...
authorSimon Brandhof <simon.brandhof@gmail.com>
Mon, 10 Dec 2012 10:46:36 +0000 (11:46 +0100)
committerSimon Brandhof <simon.brandhof@gmail.com>
Mon, 10 Dec 2012 13:04:11 +0000 (14:04 +0100)
plugins/sonar-core-plugin/src/main/resources/org/sonar/l10n/core.properties
plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/measure_filter_list.html.erb
plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/measure_filter_treemap.html.erb

index 89ac6e6ba43d440cf8427a10037720a6d194b346..deb28d0431214c8172cfdf485192315df9f89889 100644 (file)
@@ -409,6 +409,7 @@ measure_filter.col.language=Language
 measure_filter.col.links=Links
 measure_filter.col.name=Name
 measure_filter.col.short_name=Short Name
+measure_filter.col.version=Version
 measure_filter.abbr.date=Date
 measure_filter.abbr.description=Description
 measure_filter.abbr.key=Key
@@ -416,7 +417,7 @@ measure_filter.abbr.language=Lang.
 measure_filter.abbr.links=Links
 measure_filter.abbr.name=Name
 measure_filter.abbr.short_name=Name
-measure_filter.col.version=Version
+measure_filter.abbr.version=Version
 measure_filter.missing_name=Name is missing
 measure_filter.name_too_long=Name is too long
 measure_filter.sharing=Sharing
index 910e1ad2132b99de61025c72945c198312ecf1d7..dbfaacd82e9b798385caf8d32616be1605170030 100644 (file)
@@ -2,12 +2,16 @@
    filter_id = widget_properties['filter']
    page_size = widget_properties['pageSize']
    filter = MeasureFilter.find_by_id(filter_id.to_i) if filter_id
-   if filter && (!filter.require_authentication? || logged_in?)
+   if filter
      filter.load_criteria_from_data
-     filter.set_criteria_value('display', 'list')
-     filter.set_criteria_value('pageSize', page_size)
-     filter.execute(self, :user => current_user)
-     @widget_title = link_to h(filter.name), {:controller => 'measures', :action => 'filter', :id => filter.id, :display => 'list'}
+     if !filter.require_authentication? || logged_in?
+       filter.set_criteria_value('display', 'list')
+       filter.set_criteria_value('pageSize', page_size)
+       filter.execute(self, :user => current_user)
+       @widget_title = link_to h(filter.name), {:controller => 'measures', :action => 'filter', :id => filter.id, :display => 'list'}
 %>
-  <%= render :partial => "measures/display_#{filter.display.key}", :locals => {:edit_mode => false, :widget => widget, :filter => filter} %>
-<% end %>
\ No newline at end of file
+    <%= render :partial => "measures/display_#{filter.display.key}", :locals => {:edit_mode => false, :widget => widget, :filter => filter} %>
+  <%
+     end
+     end
+  %>
\ No newline at end of file
index 22dcc59b78fdfd6a61b654b92210f2e353d52caa..599d802ae84b6738787a18e602380160bc14b2d7 100644 (file)
@@ -3,21 +3,26 @@
    size_metric = widget_properties['sizeMetric']
    color_metric = widget_properties['colorMetric']
    filter = MeasureFilter.find_by_id(filter_id.to_i) if filter_id
-   if filter && (!filter.require_authentication? || logged_in?)
+   if filter
      url_options = {:controller => 'measures', :action => 'filter', :id => filter.id, :display => 'treemap'}
      filter.load_criteria_from_data
      filter.set_criteria_value('display', 'treemap')
      if size_metric
-      filter.set_criteria_value('tmSize', size_metric.key)
-      url_options['tmSize']=size_metric.key
+       filter.set_criteria_value('tmSize', size_metric.key)
+       url_options['tmSize']=size_metric.key
      end
      if color_metric
-      filter.set_criteria_value('tmColor', color_metric.key)
-      url_options['tmColor']=color_metric.key
+       filter.set_criteria_value('tmColor', color_metric.key)
+       url_options['tmColor']=color_metric.key
      end
-     filter.execute(self, :user => current_user)
 
-     @widget_title = link_to h(filter.name), url_options
+     if !filter.require_authentication? || logged_in?
+       filter.execute(self, :user => current_user)
+
+       @widget_title = link_to h(filter.name), url_options
 %>
-  <%= render :partial => "measures/display_#{filter.display.key}", :locals => {:edit_mode => false, :widget => widget, :filter => filter} %>
-<% end %>
\ No newline at end of file
+    <%= render :partial => "measures/display_#{filter.display.key}", :locals => {:edit_mode => false, :widget => widget, :filter => filter} %>
+  <%
+     end
+     end
+  %>
\ No newline at end of file