Skip to content
This repository has been archived by the owner on Apr 10, 2023. It is now read-only.

Added 'match all' value to filter #167

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions config/locales/bg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ bg:
issues_sort_order_desc: Намаляване

auto_complete_new_tag: Добавяне на нов...
match_all: match all
1 change: 1 addition & 0 deletions config/locales/de.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ de:

auto_complete_new_tag: Hinzufügen...
issue_tags_label_add_tag: + Tag hinzufügen
match_all: match all
1 change: 1 addition & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,4 @@ en:
issue_tags_tag: Tag
issue_tags_button_merge: Merge
issue_tags_label_merge: Merge selected tags
match_all: match all
1 change: 1 addition & 0 deletions config/locales/fr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ fr:
issues_sort_order_desc: (en) Descending

auto_complete_new_tag: Nouveau...
match_all: match all
1 change: 1 addition & 0 deletions config/locales/it.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ it:
issues_sort_order_desc: Discendente

auto_complete_new_tag: Aggiungi nuovo...
match_all: match all
1 change: 1 addition & 0 deletions config/locales/pt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ pt:
issues_sort_order_desc: Descendente

auto_complete_new_tag: Adicionar nova...
match_all: match all
1 change: 1 addition & 0 deletions config/locales/ru.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ ru:

auto_complete_new_tag: Добавить...
issue_tags_label_add_tag: + добавить метку
match_all: match all
1 change: 1 addition & 0 deletions config/locales/tr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,4 @@ tr:
issue_tags_tag: Etiket
issue_tags_button_merge: Birleştir
issue_tags_label_merge: Seçili etiketleri birleştir
match_all: match all
1 change: 1 addition & 0 deletions config/locales/zh-TW.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,4 @@ zh-TW:
issue_tags_tag: 標籤
issue_tags_button_merge: 合併
issue_tags_label_merge: 合併選擇的標籤
match_all: match all
1 change: 1 addition & 0 deletions config/locales/zh.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ zh:
issues_sort_order_desc: 倒序

auto_complete_new_tag: 添加新标签 ... ...
match_all: match all
4 changes: 4 additions & 0 deletions lib/redmine_tags/patches/issue_patch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ def self.included(base)
project = Project.find(project) unless project.is_a? Project
where("#{project.project_condition(Setting.display_subprojects_issues?)}")
}

Query.operators = Query.operators.merge("&" => :match_all)
Query.operators_by_filter_type[:list_optional] << "&"

end
end

Expand Down
2 changes: 2 additions & 0 deletions lib/redmine_tags/patches/issue_query_patch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ def statement_extended
case op
when '=', '!'
issues = Issue.tagged_with(values_for('tags'), any: true)
when '&'
issues = Issue.tagged_with(values_for('tags'), match_all: true)
when '!*'
issues = Issue.tagged_with ActsAsTaggableOn::Tag.all.map(&:to_s), exclude: true
else
Expand Down