diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-04-20 13:00:54 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-04-20 13:00:54 +0300 |
commit | 3cccd102ba543e02725d247893729e5c73b38295 (patch) | |
tree | f36a04ec38517f5deaaacb5acc7d949688d1e187 /app/graphql/resolvers/work_items/types_resolver.rb | |
parent | 205943281328046ef7b4528031b90fbda70c75ac (diff) |
Add latest changes from gitlab-org/gitlab@14-10-stable-eev14.10.0-rc42
Diffstat (limited to 'app/graphql/resolvers/work_items/types_resolver.rb')
-rw-r--r-- | app/graphql/resolvers/work_items/types_resolver.rb | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/app/graphql/resolvers/work_items/types_resolver.rb b/app/graphql/resolvers/work_items/types_resolver.rb index 67a9d57d42f..5f9f8ab5572 100644 --- a/app/graphql/resolvers/work_items/types_resolver.rb +++ b/app/graphql/resolvers/work_items/types_resolver.rb @@ -11,7 +11,7 @@ module Resolvers ' Argument is experimental and can be removed in the future without notice.' def resolve(taskable: nil) - return unless Feature.enabled?(:work_items, object, default_enabled: :yaml) + return unless feature_flag_enabled_for_parent?(object) # This will require a finder in the future when groups/projects get their work item types # All groups/projects use the default types for now @@ -20,6 +20,14 @@ module Resolvers base_scope.order_by_name_asc end + + private + + def feature_flag_enabled_for_parent?(parent) + return false unless parent.is_a?(::Project) || parent.is_a?(::Group) + + parent.work_items_feature_flag_enabled? + end end end end |