Welcome to mirror list, hosted at ThFree Co, Russian Federation.

incident_new.rb « incident_management « slash_commands « gitlab « lib - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: b5c438733557ffff0b0bce8baa8fd86fc6850fca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# frozen_string_literal: true

module Gitlab
  module SlashCommands
    module IncidentManagement
      class IncidentNew < IncidentCommand
        def self.help_message
          'incident declare *(Beta)*'
        end

        def self.allowed?(_project, _user)
          Feature.enabled?(:incident_declare_slash_command)
        end

        def self.match(text)
          text == 'incident declare'
        end

        def execute(_match)
          response = ::Integrations::SlackInteractions::IncidentManagement::IncidentModalOpenedService
          .new(slack_installation, current_user, params)
          .execute

          presenter.present(response.message)
        end

        private

        def presenter
          Gitlab::SlashCommands::Presenters::IncidentManagement::IncidentNew.new
        end
      end
    end
  end
end

Gitlab::SlashCommands::IncidentManagement::IncidentNew.prepend_mod