Fix flash messages on sign-in [SCI-5386]

This commit is contained in:
Oleksii Kriuchykhin 2021-01-12 15:26:45 +01:00
parent 5f506b7459
commit cf3b0916f6
2 changed files with 6 additions and 0 deletions

View file

@ -40,6 +40,10 @@ module ApplicationHelper
controller_name == 'my_modules' && !@repository.nil?
end
def displayable_flash_type?(type)
%w(success warning error notice).include?(type)
end
def flash_alert_class(type)
case type
when 'success'

View file

@ -1,5 +1,7 @@
<div id="notifications">
<% flash.each do |type, message| %>
<% next unless displayable_flash_type?(type) %>
<div id="alert-flash" class="alert <%= flash_alert_class(type) %> alert-dismissable alert-floating">
<span class="fas <%= flash_icon_class(type) %>"></span>
<span class="message"><%= sanitize_input(message) %></span>