diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-08-18 11:17:02 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-08-18 11:17:02 +0300 |
commit | b39512ed755239198a9c294b6a45e65c05900235 (patch) | |
tree | d234a3efade1de67c46b9e5a38ce813627726aa7 /app/graphql/types/work_items/widget_interface.rb | |
parent | d31474cf3b17ece37939d20082b07f6657cc79a9 (diff) |
Add latest changes from gitlab-org/gitlab@15-3-stable-eev15.3.0-rc42
Diffstat (limited to 'app/graphql/types/work_items/widget_interface.rb')
-rw-r--r-- | app/graphql/types/work_items/widget_interface.rb | 30 |
1 files changed, 22 insertions, 8 deletions
diff --git a/app/graphql/types/work_items/widget_interface.rb b/app/graphql/types/work_items/widget_interface.rb index 1b752393296..eca8c8d845a 100644 --- a/app/graphql/types/work_items/widget_interface.rb +++ b/app/graphql/types/work_items/widget_interface.rb @@ -7,8 +7,21 @@ module Types graphql_name 'WorkItemWidget' - field :type, ::Types::WorkItems::WidgetTypeEnum, null: true, - description: 'Widget type.' + field :type, ::Types::WorkItems::WidgetTypeEnum, + null: true, + description: 'Widget type.' + + ORPHAN_TYPES = [ + ::Types::WorkItems::Widgets::DescriptionType, + ::Types::WorkItems::Widgets::HierarchyType, + ::Types::WorkItems::Widgets::LabelsType, + ::Types::WorkItems::Widgets::AssigneesType, + ::Types::WorkItems::Widgets::StartAndDueDateType + ].freeze + + def self.ce_orphan_types + ORPHAN_TYPES + end def self.resolve_type(object, context) case object @@ -18,17 +31,18 @@ module Types ::Types::WorkItems::Widgets::HierarchyType when ::WorkItems::Widgets::Assignees ::Types::WorkItems::Widgets::AssigneesType - when ::WorkItems::Widgets::Weight - ::Types::WorkItems::Widgets::WeightType + when ::WorkItems::Widgets::Labels + ::Types::WorkItems::Widgets::LabelsType + when ::WorkItems::Widgets::StartAndDueDate + ::Types::WorkItems::Widgets::StartAndDueDateType else raise "Unknown GraphQL type for widget #{object}" end end - orphan_types ::Types::WorkItems::Widgets::DescriptionType, - ::Types::WorkItems::Widgets::HierarchyType, - ::Types::WorkItems::Widgets::AssigneesType, - ::Types::WorkItems::Widgets::WeightType + orphan_types(*ORPHAN_TYPES) end end end + +Types::WorkItems::WidgetInterface.prepend_mod |