💭

Redmineのフィルタ選択のリストボックス内に新たなグループ "User" を追加するパッチ

2023/04/06に公開
diff --git a/app/helpers/queries_helper.rb b/app/helpers/queries_helper.rb
index d6c6b59f4..b454d2448 100644
--- a/app/helpers/queries_helper.rb
+++ b/app/helpers/queries_helper.rb
@@ -24,7 +24,7 @@ module QueriesHelper
 
   def filters_options_for_select(query)
     ungrouped = []
-    grouped = {label_string: [], label_date: [], label_time_tracking: [], label_attachment: []}
+    grouped = {label_user: [], label_string: [], label_date: [], label_time_tracking: [], label_attachment: []}
     query.available_filters.map do |field, field_options|
       if field_options[:type] == :relation
         group = :label_relations
@@ -45,6 +45,8 @@ module QueriesHelper
         group = :label_attachment
       elsif [:string, :text, :search].include?(field_options[:type])
         group = :label_string
+      elsif  %w(author_id assigned_to_id watcher_id updated_by last_updated_by).include?(field)
+        group = :label_user
       end
       if group
         (grouped[group] ||= []) << [field_options[:name], field]

Discussion