Merge pull request #3077 from okriuchykhin/ok_SCI_5386

Fix flash messages on sign-in [SCI-5386]
This commit is contained in:
Alex Kriuchykhin 2021-01-12 15:44:24 +01:00 committed by GitHub
commit 62b1aaf033
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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>