-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add redmine patch to fix custom field filter group names
- Loading branch information
1 parent
46d9172
commit 0fb150f
Showing
2 changed files
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
diff --git a/app/helpers/queries_helper.rb b/app/helpers/queries_helper.rb | ||
index b90f86457..d2505ff6f 100644 | ||
--- a/app/helpers/queries_helper.rb | ||
+++ b/app/helpers/queries_helper.rb | ||
@@ -26,15 +26,15 @@ module QueriesHelper | ||
ungrouped = [] | ||
grouped = {label_string: [], label_date: [], label_time_tracking: [], label_attachment: []} | ||
query.available_filters.map do |field, field_options| | ||
- if field =~ /^(.+)\./ | ||
+ if /^cf_\d+\./.match?(field) | ||
+ group = (field_options[:through] || field_options[:field]).try(:name) | ||
+ elsif field =~ /^(.+)\./ | ||
# association filters | ||
group = "field_#{$1}".to_sym | ||
elsif field_options[:type] == :relation | ||
group = :label_relations | ||
elsif field_options[:type] == :tree | ||
group = query.is_a?(IssueQuery) ? :label_relations : nil | ||
- elsif /^cf_\d+\./.match?(field) | ||
- group = (field_options[:through] || field_options[:field]).try(:name) | ||
elsif %w(member_of_group assigned_to_role).include?(field) | ||
group = :field_assigned_to | ||
elsif field_options[:type] == :date_past || field_options[:type] == :date |