Commit 63b83e8f authored by Jacopo's avatar Jacopo

Add an helper to check if a notification_event is enabled

Introduce event_disabled?(event) helper to check if a specific
notification event is disabled.
parent 0be43dbe
......@@ -120,4 +120,8 @@ module NotificationsHelper
def can_read_project?(project)
can?(current_user, :read_project, project)
end
def notification_event_disabled?(event)
event == :fixed_pipeline && Feature.disabled?(:ci_pipeline_fixed_notifications)
end
end
......@@ -23,7 +23,7 @@
#{ paragraph.html_safe }
.col-lg-8
- notification_setting.email_events.each_with_index do |event, index|
- next if event == :fixed_pipeline && Feature.disabled?(:ci_pipeline_fixed_notifications)
- next if notification_event_disabled?(event)
- field_id = "#{notifications_menu_identifier("modal", notification_setting)}_notification_setting[#{event}]"
.form-group
.form-check{ class: ("prepend-top-0" if index == 0) }
......
---
title: Add an helper to check if a notification_event is enabled
merge_request: 27880
author: Jacopo Beschi @jacopo-beschi
type: changed
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment