diff options
author | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2019-11-07 03:41:50 +0000 |
---|---|---|
committer | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2019-11-07 03:41:50 +0000 |
commit | d4ec592f67593acd6598ef4947481aa89b6b85c5 (patch) | |
tree | 5fa7ae7b794f11aea6381bb59c5dc61ce04fadcf /app/models/issue_query.rb | |
parent | 28047659fca9e1602c7e9a5f6a9d6dc61efc82d0 (diff) | |
download | redmine-d4ec592f67593acd6598ef4947481aa89b6b85c5.tar.gz redmine-d4ec592f67593acd6598ef4947481aa89b6b85c5.zip |
cleanup: rubocop: fix Layout/AlignArguments in IssueQuery#initialize_available_filters
git-svn-id: http://svn.redmine.org/redmine/trunk@18930 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/issue_query.rb')
-rw-r--r-- | app/models/issue_query.rb | 87 |
1 files changed, 50 insertions, 37 deletions
diff --git a/app/models/issue_query.rb b/app/models/issue_query.rb index b2d219f4c..cd11da343 100644 --- a/app/models/issue_query.rb +++ b/app/models/issue_query.rb @@ -96,51 +96,58 @@ class IssueQuery < Query end def initialize_available_filters - add_available_filter "status_id", + add_available_filter( + "status_id", :type => :list_status, :values => lambda { issue_statuses_values } - - add_available_filter("project_id", + ) + add_available_filter( + "project_id", :type => :list, :values => lambda { project_values } ) if project.nil? - - add_available_filter "tracker_id", + add_available_filter( + "tracker_id", :type => :list, :values => trackers.collect{|s| [s.name, s.id.to_s] } - - add_available_filter "priority_id", + ) + add_available_filter( + "priority_id", :type => :list, :values => IssuePriority.all.collect{|s| [s.name, s.id.to_s] } - - add_available_filter("author_id", + ) + add_available_filter( + "author_id", :type => :list, :values => lambda { author_values } ) - - add_available_filter("assigned_to_id", + add_available_filter( + "assigned_to_id", :type => :list_optional, :values => lambda { assigned_to_values } ) - - add_available_filter("member_of_group", + add_available_filter( + "member_of_group", :type => :list_optional, :values => lambda { Group.givable.visible.collect {|g| [g.name, g.id.to_s] } } ) - - add_available_filter("assigned_to_role", + add_available_filter( + "assigned_to_role", :type => :list_optional, :values => lambda { Role.givable.collect {|r| [r.name, r.id.to_s] } } ) - - add_available_filter "fixed_version_id", + add_available_filter( + "fixed_version_id", :type => :list_optional, :values => lambda { fixed_version_values } - - add_available_filter "fixed_version.due_date", + ) + add_available_filter( + "fixed_version.due_date", :type => :date, :name => l(:label_attribute_of_fixed_version, :name => l(:field_effective_date)) - - add_available_filter "fixed_version.status", + ) + add_available_filter( + "fixed_version.status", :type => :list, :name => l(:label_attribute_of_fixed_version, :name => l(:field_status)), :values => Version::VERSION_STATUSES.map{|s| [l("version_status_#{s}"), s] } - - add_available_filter "category_id", + ) + add_available_filter( + "category_id", :type => :list_optional, - :values => lambda { project.issue_categories.collect{|s| [s.name, s.id.to_s] } } if project - + :values => lambda { project.issue_categories.collect{|s| [s.name, s.id.to_s] } } + ) if project add_available_filter "subject", :type => :text add_available_filter "description", :type => :text add_available_filter "created_on", :type => :date_past @@ -158,34 +165,40 @@ class IssueQuery < Query if User.current.allowed_to?(:set_issues_private, nil, :global => true) || User.current.allowed_to?(:set_own_issues_private, nil, :global => true) - add_available_filter "is_private", + add_available_filter( + "is_private", :type => :list, :values => [[l(:general_text_yes), "1"], [l(:general_text_no), "0"]] + ) end - - add_available_filter "attachment", + add_available_filter( + "attachment", :type => :text, :name => l(:label_attachment) - + ) if User.current.logged? - add_available_filter "watcher_id", + add_available_filter( + "watcher_id", :type => :list, :values => lambda { watcher_values } + ) end - - add_available_filter("updated_by", + add_available_filter( + "updated_by", :type => :list, :values => lambda { author_values } ) - - add_available_filter("last_updated_by", + add_available_filter( + "last_updated_by", :type => :list, :values => lambda { author_values } ) - if project && !project.leaf? - add_available_filter "subproject_id", + add_available_filter( + "subproject_id", :type => :list_subprojects, :values => lambda { subproject_values } + ) end - add_available_filter("project.status", + add_available_filter( + "project.status", :type => :list, :name => l(:label_attribute_of_project, :name => l(:field_status)), :values => lambda { project_statuses_values } |