Skip to content

Commit

Permalink
Disable subscription to RSS for Reports
Browse files Browse the repository at this point in the history
We disable the checkbox for the RSS channel for CreateReport events in the notifications configuration page.
  • Loading branch information
eduardoj authored and danidoni committed Sep 22, 2023
1 parent a031193 commit a3bbb0b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/api/app/models/event_subscription/for_channel_form.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
class EventSubscription
class ForChannelForm
DISABLE_FOR_EVENTS = ['Event::ServiceFail'].freeze
DISABLE_RSS_FOR_EVENTS = ['Event::CreateReport'].freeze

attr_reader :name, :subscription

Expand All @@ -18,7 +19,8 @@ def subscription_params(index)
end

def disabled_checkbox?
DISABLE_FOR_EVENTS.include?(@event.to_s) && (name == 'web' || name == 'rss')
(DISABLE_FOR_EVENTS.include?(@event.to_s) && (name == 'web' || name == 'rss')) ||
(DISABLE_RSS_FOR_EVENTS.include?(@event.to_s) && name == 'rss')
end

private
Expand Down

0 comments on commit a3bbb0b

Please sign in to comment.