diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-10-17 16:22:04 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-10-17 16:22:04 +0300 |
commit | 6dce4e9bb103a3dd14df7eca5c00a3f37565fc32 (patch) | |
tree | 07058855ed3e14a5401c81b14ea95c30b78e761e /app/graphql | |
parent | ef309cf1466c3d2a9297d735c7127fcaf0c08d48 (diff) |
Add latest changes from gitlab-org/gitlab@15-4-stable-ee
Diffstat (limited to 'app/graphql')
-rw-r--r-- | app/graphql/resolvers/work_items_resolver.rb | 3 | ||||
-rw-r--r-- | app/graphql/types/todo_target_enum.rb | 1 | ||||
-rw-r--r-- | app/graphql/types/todoable_interface.rb | 2 | ||||
-rw-r--r-- | app/graphql/types/work_item_type.rb | 6 |
4 files changed, 11 insertions, 1 deletions
diff --git a/app/graphql/resolvers/work_items_resolver.rb b/app/graphql/resolvers/work_items_resolver.rb index 9c7931a4edb..a8c0d363325 100644 --- a/app/graphql/resolvers/work_items_resolver.rb +++ b/app/graphql/resolvers/work_items_resolver.rb @@ -37,7 +37,8 @@ module Resolvers def preloads { - last_edited_by: :last_edited_by + last_edited_by: :last_edited_by, + web_url: { project: { namespace: :route } } } end diff --git a/app/graphql/types/todo_target_enum.rb b/app/graphql/types/todo_target_enum.rb index dbf7b42ffcc..d2527ef5267 100644 --- a/app/graphql/types/todo_target_enum.rb +++ b/app/graphql/types/todo_target_enum.rb @@ -4,6 +4,7 @@ module Types class TodoTargetEnum < BaseEnum value 'COMMIT', value: 'Commit', description: 'Commit.' value 'ISSUE', value: 'Issue', description: 'Issue.' + value 'WORKITEM', value: 'WorkItem', description: 'Work item.' value 'MERGEREQUEST', value: 'MergeRequest', description: 'Merge request.' value 'DESIGN', value: 'DesignManagement::Design', description: 'Design.' value 'ALERT', value: 'AlertManagement::Alert', description: 'Alert.' diff --git a/app/graphql/types/todoable_interface.rb b/app/graphql/types/todoable_interface.rb index 7d437973c12..063c1edfb5b 100644 --- a/app/graphql/types/todoable_interface.rb +++ b/app/graphql/types/todoable_interface.rb @@ -10,6 +10,8 @@ module Types def self.resolve_type(object, context) case object + when WorkItem + Types::WorkItemType when Issue Types::IssueType when MergeRequest diff --git a/app/graphql/types/work_item_type.rb b/app/graphql/types/work_item_type.rb index 7904841863b..6a1a4f158be 100644 --- a/app/graphql/types/work_item_type.rb +++ b/app/graphql/types/work_item_type.rb @@ -4,6 +4,8 @@ module Types class WorkItemType < BaseObject graphql_name 'WorkItem' + implements(Types::TodoableInterface) + authorize :read_work_item field :closed_at, Types::TimeType, null: true, @@ -42,5 +44,9 @@ module Types markdown_field :description_html, null: true expose_permissions Types::PermissionTypes::WorkItem + + def web_url + Gitlab::UrlBuilder.build(object) + end end end |