diff options
author | Julien Lancelot <julien.lancelot@gmail.com> | 2013-03-13 09:04:59 +0100 |
---|---|---|
committer | Julien Lancelot <julien.lancelot@gmail.com> | 2013-03-13 09:04:59 +0100 |
commit | 811703bcc5e5237bf808a35a1eb8998c0bb85aaf (patch) | |
tree | 04559da43b805d6296d0ee79111389de410a8548 | |
parent | 82e31da87bd5438f1782f3a591b9833e9467341e (diff) | |
download | sonarqube-811703bcc5e5237bf808a35a1eb8998c0bb85aaf.tar.gz sonarqube-811703bcc5e5237bf808a35a1eb8998c0bb85aaf.zip |
Fix sort bey removal date when selected removed status
-rw-r--r-- | sonar-server/src/main/webapp/WEB-INF/app/controllers/rules_configuration_controller.rb | 5 | ||||
-rw-r--r-- | sonar-server/src/main/webapp/WEB-INF/app/views/rules_configuration/index.html.erb | 7 |
2 files changed, 8 insertions, 4 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/rules_configuration_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/rules_configuration_controller.rb index 0788842bb38..cbc15398fc6 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/rules_configuration_controller.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/rules_configuration_controller.rb @@ -380,10 +380,9 @@ class RulesConfigurationController < ApplicationController @activation = params[:rule_activation] || STATUS_ACTIVE @inheritance = params[:inheritance] || 'any' @status = params[:status] - @sort_by = params[:sort_by] + @sort_by = !params[:sort_by].blank? ? params[:sort_by] : nil # Force sort by removal date when status contains REMOVED - @sort_by = Rule::SORT_BY_REMOVAL_DATE if status_include_removed? - @sort_by = Rule::SORT_BY_RULE_NAME if !status_include_removed? and @sort_by == Rule::SORT_BY_REMOVAL_DATE + @sort_by ||= Rule::SORT_BY_REMOVAL_DATE if status_include_removed? @sort_by ||= Rule::SORT_BY_RULE_NAME @searchtext = params[:searchtext] end diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/rules_configuration/index.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/rules_configuration/index.html.erb index a147a73ba35..b909bb50c6a 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/rules_configuration/index.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/rules_configuration/index.html.erb @@ -39,6 +39,11 @@ $(span_id).replace(text_area); } + function submitSearch() { + $j('#sort_by').val(""); + $j("#rules-search-form").submit(); + } + function submitSortBy(){ $j('#sort_by').val($j('#select-rules-sort-by').val()); $j("#rules-search-form").submit(); @@ -97,7 +102,7 @@ <% end %> <div class="rule-search"> <br/> - <%= submit_tag message('search_verb'), :id => 'submit_search' %> + <%= submit_tag message('search_verb'), :id => 'submit_search', :onclick => 'submitSearch();' %> </div> </div> |