From aee0a117a889461ce8ced6fcf73207fe017f1d99 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Mon, 20 Dec 2021 13:37:47 +0000 Subject: Add latest changes from gitlab-org/gitlab@14-6-stable-ee --- app/graphql/mutations/issues/set_crm_contacts.rb | 18 +++++++++--------- app/graphql/mutations/jira_import/start.rb | 6 +++--- app/graphql/mutations/merge_requests/accept.rb | 6 +++--- app/graphql/mutations/user_callouts/create.rb | 2 +- 4 files changed, 16 insertions(+), 16 deletions(-) (limited to 'app/graphql/mutations') diff --git a/app/graphql/mutations/issues/set_crm_contacts.rb b/app/graphql/mutations/issues/set_crm_contacts.rb index 7a9e6237eaa..4e49a45d52a 100644 --- a/app/graphql/mutations/issues/set_crm_contacts.rb +++ b/app/graphql/mutations/issues/set_crm_contacts.rb @@ -5,7 +5,7 @@ module Mutations class SetCrmContacts < Base graphql_name 'IssueSetCrmContacts' - argument :crm_contact_ids, + argument :contact_ids, [::Types::GlobalIDType[::CustomerRelations::Contact]], required: true, description: 'Customer relations contact IDs to set. Replaces existing contacts by default.' @@ -15,27 +15,27 @@ module Mutations required: false, description: 'Changes the operation mode. Defaults to REPLACE.' - def resolve(project_path:, iid:, crm_contact_ids:, operation_mode: Types::MutationOperationModeEnum.enum[:replace]) + def resolve(project_path:, iid:, contact_ids:, operation_mode: Types::MutationOperationModeEnum.enum[:replace]) issue = authorized_find!(project_path: project_path, iid: iid) project = issue.project raise Gitlab::Graphql::Errors::ResourceNotAvailable, 'Feature disabled' unless Feature.enabled?(:customer_relations, project.group, default_enabled: :yaml) - crm_contact_ids = crm_contact_ids.compact.map do |crm_contact_id| - raise Gitlab::Graphql::Errors::ArgumentError, "Contact #{crm_contact_id} is invalid." unless crm_contact_id.respond_to?(:model_id) + contact_ids = contact_ids.compact.map do |contact_id| + raise Gitlab::Graphql::Errors::ArgumentError, "Contact #{contact_id} is invalid." unless contact_id.respond_to?(:model_id) - crm_contact_id.model_id.to_i + contact_id.model_id.to_i end attribute_name = case operation_mode when Types::MutationOperationModeEnum.enum[:append] - :add_crm_contact_ids + :add_ids when Types::MutationOperationModeEnum.enum[:remove] - :remove_crm_contact_ids + :remove_ids else - :crm_contact_ids + :replace_ids end - response = ::Issues::SetCrmContactsService.new(project: project, current_user: current_user, params: { attribute_name => crm_contact_ids }) + response = ::Issues::SetCrmContactsService.new(project: project, current_user: current_user, params: { attribute_name => contact_ids }) .execute(issue) { diff --git a/app/graphql/mutations/jira_import/start.rb b/app/graphql/mutations/jira_import/start.rb index 143a9558e38..4929d6f394a 100644 --- a/app/graphql/mutations/jira_import/start.rb +++ b/app/graphql/mutations/jira_import/start.rb @@ -14,15 +14,15 @@ module Mutations null: true, description: 'Jira import data after mutation.' - argument :project_path, GraphQL::Types::ID, - required: true, - description: 'Project to import the Jira project into.' argument :jira_project_key, GraphQL::Types::String, required: true, description: 'Project key of the importer Jira project.' argument :jira_project_name, GraphQL::Types::String, required: false, description: 'Project name of the importer Jira project.' + argument :project_path, GraphQL::Types::ID, + required: true, + description: 'Project to import the Jira project into.' argument :users_mapping, [Types::JiraUsersMappingInputType], required: false, diff --git a/app/graphql/mutations/merge_requests/accept.rb b/app/graphql/mutations/merge_requests/accept.rb index d16b2327f2d..7ce850901af 100644 --- a/app/graphql/mutations/merge_requests/accept.rb +++ b/app/graphql/mutations/merge_requests/accept.rb @@ -26,12 +26,12 @@ module Mutations argument :commit_message, ::GraphQL::Types::String, required: false, description: 'Custom merge commit message.' - argument :squash_commit_message, ::GraphQL::Types::String, - required: false, - description: 'Custom squash commit message (if squash is true).' argument :sha, ::GraphQL::Types::String, required: true, description: 'HEAD SHA at the time when this merge was requested.' + argument :squash_commit_message, ::GraphQL::Types::String, + required: false, + description: 'Custom squash commit message (if squash is true).' argument :should_remove_source_branch, ::GraphQL::Types::Boolean, required: false, diff --git a/app/graphql/mutations/user_callouts/create.rb b/app/graphql/mutations/user_callouts/create.rb index ff6e5cd28dd..1be99ea0ecd 100644 --- a/app/graphql/mutations/user_callouts/create.rb +++ b/app/graphql/mutations/user_callouts/create.rb @@ -15,7 +15,7 @@ module Mutations description: 'User callout dismissed.' def resolve(feature_name:) - callout = Users::DismissUserCalloutService.new( + callout = Users::DismissCalloutService.new( container: nil, current_user: current_user, params: { feature_name: feature_name } ).execute errors = errors_on_object(callout) -- cgit v1.2.3