diff options
author | Peter Leitzen <pleitzen@gitlab.com> | 2019-09-02 16:59:04 +0200 |
---|---|---|
committer | Peter Leitzen <pleitzen@gitlab.com> | 2019-09-02 16:59:04 +0200 |
commit | 7340436492abf0cb38fea6d29d5faa9863e02bbb (patch) | |
tree | cdb589645de101b85428c2e84d59188f2e1a07f6 | |
parent | 1a060f7dca85cf5bb9950f3ce944f0b5a287ac2a (diff) | |
download | gitlab-ce-66360-zoom-for-incident-management-quickactions.tar.gz |
Implement `/zoom` and `/remove_zoom` quick actions66360-zoom-for-incident-management-quickactions
-rw-r--r-- | lib/gitlab/quick_actions/issue_actions.rb | 47 | ||||
-rw-r--r-- | locale/gitlab.pot | 27 |
2 files changed, 74 insertions, 0 deletions
diff --git a/lib/gitlab/quick_actions/issue_actions.rb b/lib/gitlab/quick_actions/issue_actions.rb index da28fbf5be0..964df4505e0 100644 --- a/lib/gitlab/quick_actions/issue_actions.rb +++ b/lib/gitlab/quick_actions/issue_actions.rb @@ -163,6 +163,53 @@ module Gitlab issue_iid: quick_action_target.iid } end + + desc _('Add Zoom meeting') + explanation _('Adds a Zoom meeting') + params '<URL>' # TODO support meeting ID? + types Issue + condition do + !Gitlab::ZoomLinkExtractor.new(quick_action_target.description).match? + end + parse_params do |url| + Gitlab::ZoomLinkExtractor.new(url).links.last + end + command :zoom do |url| + existing = Gitlab::ZoomLinkExtractor.new(quick_action_target.description).match? + + case + when existing + message = _('A Zoom Meeting already exists on this issue.') + when url + message = _('Added Zoom meeting %{url}') % { url: url } + @updates[:description] = "#{quick_action_target.description} #{url}" + else + message = _('Failed to add unrecognized Zoom URL') + end + + @execution_message[:zoom] = message + end + + desc _('Remove Zoom meeting') + explanation _('Remove Zoom meeting') + execution_message _('Zoom meeting removed') + types Issue + condition do + Gitlab::ZoomLinkExtractor.new(quick_action_target.description).match? + end + command :remove_zoom do + url = Gitlab::ZoomLinkExtractor.new(quick_action_target.description).links.last + + case + when url + message = _('Zoom meeting %{url} removed') % { url: url } + @updates[:description] = quick_action_target.description.sub(url, '') + else + message = _('Failed to remove a Zoom meeting') + end + + @execution_message[:remove_zoom] = message + end end end end diff --git a/locale/gitlab.pot b/locale/gitlab.pot index e91061e74c2..76c9a980c23 100644 --- a/locale/gitlab.pot +++ b/locale/gitlab.pot @@ -484,6 +484,9 @@ msgstr "" msgid "A Let's Encrypt account will be configured for this GitLab installation using your email address. You will receive emails to warn of expiring certificates." msgstr "" +msgid "A Zoom Meeting already exists on this issue." +msgstr "" + msgid "A default branch cannot be chosen for an empty project." msgstr "" @@ -651,6 +654,9 @@ msgstr "" msgid "Add README" msgstr "" +msgid "Add Zoom meeting" +msgstr "" + msgid "Add a %{type} token" msgstr "" @@ -762,6 +768,9 @@ msgstr "" msgid "Added %{label_references} %{label_text}." msgstr "" +msgid "Added Zoom meeting %{url}" +msgstr "" + msgid "Added a To Do." msgstr "" @@ -780,6 +789,9 @@ msgstr "" msgid "Adds a To Do." msgstr "" +msgid "Adds a Zoom meeting" +msgstr "" + msgid "Admin Area" msgstr "" @@ -4903,6 +4915,9 @@ msgstr "" msgid "Failed create wiki" msgstr "" +msgid "Failed to add unrecognized Zoom URL" +msgstr "" + msgid "Failed to apply commands." msgstr "" @@ -4966,6 +4981,9 @@ msgstr "" msgid "Failed to promote label due to internal error. Please contact administrators." msgstr "" +msgid "Failed to remove a Zoom meeting" +msgstr "" + msgid "Failed to remove issue from board, please try again." msgstr "" @@ -9504,6 +9522,9 @@ msgstr "" msgid "Remove Runner" msgstr "" +msgid "Remove Zoom meeting" +msgstr "" + msgid "Remove all or specific assignee(s)" msgstr "" @@ -13632,6 +13653,12 @@ msgstr "" msgid "Your request for access has been queued for review." msgstr "" +msgid "Zoom meeting %{url} removed" +msgstr "" + +msgid "Zoom meeting removed" +msgstr "" + msgid "a deleted user" msgstr "" |