diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-19 21:12:50 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-19 21:12:50 +0300 |
commit | 78f7d2e7266a80502f91d5c3aeb5689c72f156a2 (patch) | |
tree | bd7dca46bb745b27d30ff9e0fab2c5aa92b37c69 /lib/gitlab/quick_actions | |
parent | 03a3b1a4caac4c04e81ee592fdb3b9c47dbb9623 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/quick_actions')
-rw-r--r-- | lib/gitlab/quick_actions/issue_actions.rb | 46 |
1 files changed, 43 insertions, 3 deletions
diff --git a/lib/gitlab/quick_actions/issue_actions.rb b/lib/gitlab/quick_actions/issue_actions.rb index a55ead519e2..5afcb386152 100644 --- a/lib/gitlab/quick_actions/issue_actions.rb +++ b/lib/gitlab/quick_actions/issue_actions.rb @@ -206,7 +206,7 @@ module Gitlab end desc _('Add Zoom meeting') - explanation _('Adds a Zoom meeting') + explanation _('Adds a Zoom meeting.') params '<Zoom URL>' types Issue condition do @@ -223,7 +223,7 @@ module Gitlab end desc _('Remove Zoom meeting') - explanation _('Remove Zoom meeting') + explanation _('Remove Zoom meeting.') execution_message _('Zoom meeting removed') types Issue condition do @@ -236,7 +236,7 @@ module Gitlab end desc _('Add email participant(s)') - explanation _('Adds email participant(s)') + explanation _('Adds email participant(s).') params 'email1@example.com email2@example.com (up to 6 emails)' types Issue condition do @@ -285,6 +285,46 @@ module Gitlab end end + desc _('Add customer relation contacts') + explanation _('Add customer relation contact(s).') + params 'contact@example.com person@example.org' + types Issue + condition do + current_user.can?(:set_issue_crm_contacts, quick_action_target) + end + command :add_contacts do |contact_emails| + result = ::Issues::SetCrmContactsService + .new(project: project, current_user: current_user, params: { add_emails: contact_emails.split(' ') }) + .execute(quick_action_target) + + @execution_message[:add_contacts] = + if result.success? + _('One or more contacts were successfully added.') + else + result.message + end + end + + desc _('Remove customer relation contacts') + explanation _('Remove customer relation contact(s).') + params 'contact@example.com person@example.org' + types Issue + condition do + current_user.can?(:set_issue_crm_contacts, quick_action_target) + end + command :remove_contacts do |contact_emails| + result = ::Issues::SetCrmContactsService + .new(project: project, current_user: current_user, params: { remove_emails: contact_emails.split(' ') }) + .execute(quick_action_target) + + @execution_message[:remove_contacts] = + if result.success? + _('One or more contacts were successfully removed.') + else + result.message + end + end + private def zoom_link_service |