Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix phantom alert messages with empty body #140

Merged
merged 2 commits into from
Aug 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions app/views/layouts/signed_in_application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@

<body>

<%#= yield :exceptions %>

<div class="flex h-screen overflow-hidden">
<%= render partial: 'shared/sidebar', locals: { active_apps: current_organization.apps.with_trains } %>
<div class="relative flex flex-col flex-1 overflow-y-auto overflow-x-hidden">
Expand Down
4 changes: 2 additions & 2 deletions app/views/shared/_flash.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div data-controller="alert">
<% flash.each do |name, msg| %>
<% flash.select { |_, msg| msg.is_a?(String) }.each do |name, msg| %>
<div class="inline-flex min-w-80 px-4 py-2 mb-6 rounded-sm text-sm bg-indigo-100 border border-indigo-200 text-indigo-500"
data-alert-target="alert">
<div class="flex w-full justify-between items-start">
Expand All @@ -8,7 +8,7 @@
<path d="M8 0C3.6 0 0 3.6 0 8s3.6 8 8 8 8-3.6 8-8-3.6-8-8-8zm1 12H7V7h2v5zM8 6c-.6 0-1-.4-1-1s.4-1 1-1 1 .4 1 1-.4 1-1 1z"/>
</svg>

<%= content_tag :div, msg, :id => "flash_#{name}" if msg.is_a?(String) %>
<%= content_tag :div, msg, :id => "flash_#{name}" %>
</div>

<button class="opacity-70 hover:opacity-80 ml-3 mt-[3px]" data-action="alert#close">
Expand Down