summaryrefslogtreecommitdiff
path: root/lib/gitlab/slash_commands/incident_management/incident_new.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitlab/slash_commands/incident_management/incident_new.rb')
-rw-r--r--lib/gitlab/slash_commands/incident_management/incident_new.rb29
1 files changed, 29 insertions, 0 deletions
diff --git a/lib/gitlab/slash_commands/incident_management/incident_new.rb b/lib/gitlab/slash_commands/incident_management/incident_new.rb
new file mode 100644
index 00000000000..722fcff151d
--- /dev/null
+++ b/lib/gitlab/slash_commands/incident_management/incident_new.rb
@@ -0,0 +1,29 @@
+# frozen_string_literal: true
+
+module Gitlab
+ module SlashCommands
+ module IncidentManagement
+ class IncidentNew < IncidentCommand
+ def self.help_message
+ 'incident declare'
+ end
+
+ def self.allowed?(project, user)
+ Feature.enabled?(:incident_declare_slash_command, user) && can?(user, :create_incident, project)
+ end
+
+ def self.match(text)
+ text == 'incident declare'
+ end
+
+ private
+
+ def presenter
+ Gitlab::SlashCommands::Presenters::IncidentManagement::IncidentNew.new
+ end
+ end
+ end
+ end
+end
+
+Gitlab::SlashCommands::IncidentManagement::IncidentNew.prepend_mod