Files
openfoodnetwork/app/views/admin/shared/_flashes.html.haml
David Cook 7d299affd3 Move hiding logic to stimulus controller
This ensures morphed flashes hide like other flashes (eg in bulk order actions). I wanted to write a spec to prove it, but Capybara doesn't support mocking setTimeout and I didn't want to use sleep.

I've made it optional because this controller is shared with the shop frontend ([supposedly](5ef34347a3), although angular seems to override it).
2023-12-06 10:11:19 +11:00

7 lines
225 B
Plaintext

#flashes
- if defined? flashes
- flashes.each do |type, msg|
.animate-show{"data-controller": "flash", "data-flash-auto-close-value": "true"}
.flash{type: "#{type}", class: "#{type}"}
%span= msg