diff options
author | Simon Brandhof <simon.brandhof@gmail.com> | 2012-05-25 14:28:29 +0200 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@gmail.com> | 2012-05-25 14:28:39 +0200 |
commit | 6403c46e979f627f0fd7fae00005bea5a02d9c38 (patch) | |
tree | 19300ec67b9d4a1488450dee720687ca54a039e0 /sonar-server | |
parent | d5ff32e910b970f464b1fadd70fd65809f07e4e2 (diff) | |
download | sonarqube-6403c46e979f627f0fd7fae00005bea5a02d9c38.tar.gz sonarqube-6403c46e979f627f0fd7fae00005bea5a02d9c38.zip |
SONAR-3083 allow to display children of developers
Diffstat (limited to 'sonar-server')
3 files changed, 17 insertions, 23 deletions
diff --git a/sonar-server/src/main/java/org/sonar/server/filters/Filter.java b/sonar-server/src/main/java/org/sonar/server/filters/Filter.java index 46afb84f1a1..12ed8983d86 100644 --- a/sonar-server/src/main/java/org/sonar/server/filters/Filter.java +++ b/sonar-server/src/main/java/org/sonar/server/filters/Filter.java @@ -91,14 +91,6 @@ public class Filter { return baseSnapshotPath; } - public boolean isViewContext() { - return isViewContext; - } - - public void setViewContext(boolean b) { - isViewContext = b; - } - public Set<String> getScopes() { return scopes; } diff --git a/sonar-server/src/main/java/org/sonar/server/filters/FilterExecutor.java b/sonar-server/src/main/java/org/sonar/server/filters/FilterExecutor.java index 4fe443510e8..c3d0f26e2fb 100644 --- a/sonar-server/src/main/java/org/sonar/server/filters/FilterExecutor.java +++ b/sonar-server/src/main/java/org/sonar/server/filters/FilterExecutor.java @@ -207,7 +207,7 @@ public class FilterExecutor implements ServerComponent { if (StringUtils.isNotBlank(filter.getNameRegexp())) { sql.append(" AND UPPER(p.long_name) LIKE :name"); } - if (!filter.isViewContext()) { + if (!filter.hasBaseSnapshot()) { sql.append(" AND p.copy_resource_id IS NULL "); } sql.append(" GROUP BY s.id"); diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/filters_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/filters_controller.rb index e011675d7c5..cfe629a88d8 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/filters_controller.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/filters_controller.rb @@ -33,7 +33,7 @@ class FiltersController < ApplicationController else @filters = ::Filter.find(:all, :conditions => {:user_id => current_user.id}) end - @filters.sort! { |a,b| a.name.downcase <=> b.name.downcase } + @filters.sort! { |a, b| a.name.downcase <=> b.name.downcase } end def list @@ -112,7 +112,7 @@ class FiltersController < ApplicationController access_denied unless @filter.authorized_to_edit?(self) if @filter - if WidgetProperty.find(:first, :conditions => { :kee => 'filter', :text_value => @filter.kee}) + if WidgetProperty.find(:first, :conditions => {:kee => 'filter', :text_value => @filter.kee}) flash[:error]='The filter is used in at least one dashboard. It cannot be deleted' else @filter.destroy @@ -263,7 +263,7 @@ class FiltersController < ApplicationController else snapshots=Snapshot.find(:all, :include => [:project, {:root_snapshot => :project}, {:parent_snapshot => :project}], - :conditions => ['snapshots.status=? AND snapshots.islast=? AND snapshots.scope=? AND projects.person_id IS NULL AND projects.scope=? AND UPPER(projects.long_name) LIKE ?', 'P', true, 'PRJ', 'PRJ', "%#{params[:search].upcase}%"]) + :conditions => ['snapshots.status=? AND snapshots.islast=? AND snapshots.scope=? AND projects.person_id IS NULL AND projects.scope=? AND UPPER(projects.long_name) LIKE ?', 'P', true, 'PRJ', 'PRJ', "%#{params[:search].upcase}%"]) snapshots=select_authorized(:user, snapshots) @snapshots_by_qualifier = {} @@ -299,9 +299,9 @@ class FiltersController < ApplicationController @height=(params[:height]||'500').to_i @treemap = Sonar::Treemap.new(@filter.id, @size_metric, @width, @height, { - :color_metric => @color_metric, - :period_index => @filter_context.period_index, - :measures_by_snapshot => @filter_context.measures_by_snapshot + :color_metric => @color_metric, + :period_index => @filter_context.period_index, + :measures_by_snapshot => @filter_context.measures_by_snapshot }) render :action => "treemap", :layout => false @@ -330,14 +330,16 @@ class FiltersController < ApplicationController filter.criteria<<Criterion.new(:family => 'language', :operator => '=', :text_value => params['languages'].join(',')) if params['languages'] filter.criteria<<Criterion.new(:family => 'direct-children', :operator => '=', :text_value => 'true') if params['direct-children'].present? - if params[:criteria]['0']['metric_id'].present? - filter.criteria<<Criterion.new_for_metric(params[:criteria]['0']) - end - if params[:criteria]['1']['metric_id'].present? - filter.criteria<<Criterion.new_for_metric(params[:criteria]['1']) - end - if params[:criteria]['2']['metric_id'].present? - filter.criteria<<Criterion.new_for_metric(params[:criteria]['2']) + if params[:criteria] + if params[:criteria]['0']['metric_id'].present? + filter.criteria<<Criterion.new_for_metric(params[:criteria]['0']) + end + if params[:criteria]['1']['metric_id'].present? + filter.criteria<<Criterion.new_for_metric(params[:criteria]['1']) + end + if params[:criteria]['2']['metric_id'].present? + filter.criteria<<Criterion.new_for_metric(params[:criteria]['2']) + end end end end |