summaryrefslogtreecommitdiff
path: root/app/helpers/integrations_helper.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/helpers/integrations_helper.rb')
-rw-r--r--app/helpers/integrations_helper.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/app/helpers/integrations_helper.rb b/app/helpers/integrations_helper.rb
index 0650af33e37..5471109e6d5 100644
--- a/app/helpers/integrations_helper.rb
+++ b/app/helpers/integrations_helper.rb
@@ -1,6 +1,7 @@
# frozen_string_literal: true
module IntegrationsHelper
+ # rubocop:disable Metrics/CyclomaticComplexity
def integration_event_title(event)
case event
when "push", "push_events"
@@ -27,8 +28,11 @@ module IntegrationsHelper
_("Deployment")
when "alert"
_("Alert")
+ when "incident"
+ _("Incident")
end
end
+ # rubocop:enable Metrics/CyclomaticComplexity
def integration_event_description(integration, event)
case integration
@@ -230,6 +234,7 @@ module IntegrationsHelper
end
end
+ # rubocop:disable Metrics/CyclomaticComplexity
def default_integration_event_description(event)
case event
when "push", "push_events"
@@ -256,8 +261,11 @@ module IntegrationsHelper
s_("ProjectService|Trigger event when a deployment starts or finishes.")
when "alert"
s_("ProjectService|Trigger event when a new, unique alert is recorded.")
+ when "incident"
+ s_("ProjectService|Trigger event when an incident is created.")
end
end
+ # rubocop:enable Metrics/CyclomaticComplexity
def trigger_events_for_integration(integration)
Integrations::EventSerializer.new(integration: integration).represent(integration.configurable_events).to_json