Fix filter_configuration to always the `list` array

pull/6879/head
Wieland Lindenthal 6 years ago
parent c830c62177
commit bb1f09e9c5
  1. 43
      app/models/queries/work_packages/filter/search_filter.rb

@ -36,24 +36,34 @@ class Queries::WorkPackages::Filter::SearchFilter <
CONTAINS_OPERATOR = '~'.freeze
CE_FILTERS = [
Queries::WorkPackages::Filter::FilterConfiguration.new(Queries::WorkPackages::Filter::SubjectFilter,
:subject,
CONTAINS_OPERATOR),
Queries::WorkPackages::Filter::FilterConfiguration.new(Queries::WorkPackages::Filter::DescriptionFilter,
:subject,
CONTAINS_OPERATOR),
Queries::WorkPackages::Filter::FilterConfiguration.new(Queries::WorkPackages::Filter::CommentFilter,
:subject,
CONTAINS_OPERATOR),
Queries::WorkPackages::Filter::FilterConfiguration.new(
Queries::WorkPackages::Filter::SubjectFilter,
:subject,
CONTAINS_OPERATOR
),
Queries::WorkPackages::Filter::FilterConfiguration.new(
Queries::WorkPackages::Filter::DescriptionFilter,
:subject,
CONTAINS_OPERATOR
),
Queries::WorkPackages::Filter::FilterConfiguration.new(
Queries::WorkPackages::Filter::CommentFilter,
:subject,
CONTAINS_OPERATOR
)
].freeze
EE_TSV_FILTERS = [
Queries::WorkPackages::Filter::FilterConfiguration.new(Queries::WorkPackages::Filter::AttachmentContentFilter,
:subject,
CONTAINS_OPERATOR),
Queries::WorkPackages::Filter::FilterConfiguration.new(Queries::WorkPackages::Filter::AttachmentFileNameFilter,
:subject,
CONTAINS_OPERATOR)
Queries::WorkPackages::Filter::FilterConfiguration.new(
Queries::WorkPackages::Filter::AttachmentContentFilter,
:subject,
CONTAINS_OPERATOR
),
Queries::WorkPackages::Filter::FilterConfiguration.new(
Queries::WorkPackages::Filter::AttachmentFileNameFilter,
:subject,
CONTAINS_OPERATOR
)
].freeze
def self.key
@ -74,6 +84,7 @@ class Queries::WorkPackages::Filter::SearchFilter <
def filter_configurations
list = CE_FILTERS
list + EE_TSV_FILTERS if EnterpriseToken.allows_to?(:attachment_filters) && OpenProject::Database.allows_tsv?
list += EE_TSV_FILTERS if EnterpriseToken.allows_to?(:attachment_filters) && OpenProject::Database.allows_tsv?
list
end
end

Loading…
Cancel
Save