Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/graphql/resolvers/concerns/board_item_filterable.rb')
-rw-r--r--app/graphql/resolvers/concerns/board_item_filterable.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/app/graphql/resolvers/concerns/board_item_filterable.rb b/app/graphql/resolvers/concerns/board_item_filterable.rb
index 1457a02e44f..9c0ada4f72c 100644
--- a/app/graphql/resolvers/concerns/board_item_filterable.rb
+++ b/app/graphql/resolvers/concerns/board_item_filterable.rb
@@ -14,6 +14,16 @@ module BoardItemFilterable
set_filter_values(filters[:not])
end
+ if filters[:or]
+ if ::Feature.disabled?(:or_issuable_queries, resource_parent)
+ raise ::Gitlab::Graphql::Errors::ArgumentError,
+ "'or' arguments are only allowed when the `or_issuable_queries` feature flag is enabled."
+ end
+
+ rewrite_param_name(filters[:or], :author_usernames, :author_username)
+ rewrite_param_name(filters[:or], :assignee_usernames, :assignee_username)
+ end
+
filters
end
@@ -30,6 +40,14 @@ module BoardItemFilterable
filters[:assignee_id] = filters.delete(:assignee_wildcard_id)
end
end
+
+ def rewrite_param_name(filters, old_name, new_name)
+ filters[new_name] = filters.delete(old_name) if filters[old_name].present?
+ end
+
+ def resource_parent
+ respond_to?(:board) ? board.resource_parent : list.board.resource_parent
+ end
end
::BoardItemFilterable.prepend_mod_with('Resolvers::BoardItemFilterable')