Add workflow column filtering to cards (#2787)
This commit is contained in:
@@ -35,6 +35,7 @@ class Filter < ApplicationRecord
|
||||
result = terms.reduce(result) do |result, term|
|
||||
result.mentioning(term, user: creator)
|
||||
end
|
||||
result = result.where(column_id: column_ids) if column_ids.present?
|
||||
|
||||
result.distinct
|
||||
end
|
||||
|
||||
@@ -31,7 +31,7 @@ module Filter::Fields
|
||||
|
||||
included do
|
||||
store_accessor :fields, :assignment_status, :indexed_by, :sorted_by, :terms,
|
||||
:card_ids, :creation, :closure
|
||||
:card_ids, :creation, :closure, :column_ids
|
||||
|
||||
def assignment_status
|
||||
super.to_s.inquiry
|
||||
@@ -60,6 +60,14 @@ module Filter::Fields
|
||||
def terms=(value)
|
||||
super(Array(value).filter(&:present?))
|
||||
end
|
||||
|
||||
def column_ids
|
||||
Array(super).filter(&:present?).uniq
|
||||
end
|
||||
|
||||
def column_ids=(value)
|
||||
super(Array(value).filter(&:present?).uniq)
|
||||
end
|
||||
end
|
||||
|
||||
def with(**fields)
|
||||
|
||||
@@ -8,6 +8,7 @@ module Filter::Params
|
||||
:creation,
|
||||
:closure,
|
||||
card_ids: [],
|
||||
column_ids: [],
|
||||
assignee_ids: [],
|
||||
creator_ids: [],
|
||||
closer_ids: [],
|
||||
|
||||
Reference in New Issue
Block a user