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/types/work_items/convert_task_input_type.rb')
-rw-r--r--app/graphql/types/work_items/convert_task_input_type.rb36
1 files changed, 36 insertions, 0 deletions
diff --git a/app/graphql/types/work_items/convert_task_input_type.rb b/app/graphql/types/work_items/convert_task_input_type.rb
new file mode 100644
index 00000000000..1f142c6815c
--- /dev/null
+++ b/app/graphql/types/work_items/convert_task_input_type.rb
@@ -0,0 +1,36 @@
+# frozen_string_literal: true
+
+module Types
+ module WorkItems
+ class ConvertTaskInputType < BaseInputObject
+ graphql_name 'WorkItemConvertTaskInput'
+
+ argument :line_number_end, GraphQL::Types::Int,
+ required: true,
+ description: 'Last line in the Markdown source that defines the list item task.'
+ argument :line_number_start, GraphQL::Types::Int,
+ required: true,
+ description: 'First line in the Markdown source that defines the list item task.'
+ argument :lock_version, GraphQL::Types::Int,
+ required: true,
+ description: 'Current lock version of the work item containing the task in the description.'
+ argument :title, GraphQL::Types::String,
+ required: true,
+ description: 'Full string of the task to be replaced. New title for the created work item.'
+ argument :work_item_type_id, ::Types::GlobalIDType[::WorkItems::Type],
+ required: true,
+ description: 'Global ID of the work item type used to create the new work item.',
+ prepare: ->(attribute, _ctx) { work_item_type_global_id(attribute) }
+
+ class << self
+ def work_item_type_global_id(global_id)
+ # TODO: remove this line when the compatibility layer is removed
+ # See: https://gitlab.com/gitlab-org/gitlab/-/issues/257883
+ global_id = ::Types::GlobalIDType[::WorkItems::Type].coerce_isolated_input(global_id)
+
+ global_id&.model_id
+ end
+ end
+ end
+ end
+end