aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@gmail.com>2012-03-27 22:25:04 +0200
committerSimon Brandhof <simon.brandhof@gmail.com>2012-03-27 22:25:04 +0200
commitffcfb653091c0e2b148e51630d194b5e113131e2 (patch)
treed3e4c6b73d0f269f7b8e84089db7efc3e00fdcea
parentac3d2512aef6b6266a95a4ebb47d06212d3a325a (diff)
downloadsonarqube-ffcfb653091c0e2b148e51630d194b5e113131e2.tar.gz
sonarqube-ffcfb653091c0e2b148e51630d194b5e113131e2.zip
SONAR-1569 Case sensitive sorting of components on the Dependencies page
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/controllers/dependencies_controller.rb6
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/dependencies/index.html.erb2
2 files changed, 5 insertions, 3 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/dependencies_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/dependencies_controller.rb
index 904ce38b069..a3c03b63086 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/dependencies_controller.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/dependencies_controller.rb
@@ -42,13 +42,15 @@ class DependenciesController < ApplicationController
# load all the resources (first column)
#
@resources=Project.find(:all,
- :conditions => ["scope=? AND qualifier IN (?) AND enabled=? AND (UPPER(name) like ? OR kee like ?)", 'PRJ', QUALIFIERS, true, "%#{@search.upcase}%", "%#{@search}%"], :order => 'name')
+ :conditions => ["scope=? AND qualifier IN (?) AND enabled=? AND (UPPER(name) like ? OR kee like ?)", 'PRJ', QUALIFIERS, true, "%#{@search.upcase}%", "%#{@search}%"])
+ Api::Utils.insensitive_sort!(@resources){|r| r.name}
if params[:resource]
@resource=@resources.select{|r| r.kee==params[:resource]}.first
elsif @resources.size==1
@resource=@resources.first
end
+
end
if @resource
@@ -85,7 +87,7 @@ class DependenciesController < ApplicationController
project_sids=deps.map{|dep| dep.project_snapshot_id}.compact.uniq[0..950] # oracle issue with more than 1000 IN elements. Not annoying to truncate hundreds of results...
if project_sids.size>0
@project_snapshots=Snapshot.find(:all, :include => 'project', :conditions => ['id IN (?) AND islast=? AND status=?', project_sids, true, 'P'])
- @project_snapshots.sort! {|x,y| x.project.name <=> y.project.name }
+ Api::Utils.insensitive_sort!(@project_snapshots) {|s| s.project.name}
else
@project_snapshots=[]
end
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/dependencies/index.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/dependencies/index.html.erb
index 286578434ae..0535341e2ca 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/views/dependencies/index.html.erb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/dependencies/index.html.erb
@@ -1,7 +1,7 @@
<style>
.drilldown_col {
float: left;
- margin: 10px 15px 15px 0;
+ margin: 10px 5px 15px 0;
}
.drilldown_col div.col {
max-height: 35em;