Commit 30f7c7a
committed
Support flash[:alert] = <String>
Passing strings as messages to `flash[]` is more common than using other
primitives, and users deciding to set flash[:alert] might not be aware
of the Hash structure that is required to correctly construct and
display a UI alert from flash[:alert]. So instead of letting it fail
because of the type mismatch (when calling #slice on a string instead
of a hash), we can add a fallback option to treat given string as a body
of the alert message and construct a `danger` type alert with default
title.1 parent 4329459 commit 30f7c7a
File tree
2 files changed
+12
-4
lines changed- admin/app
- components/solidus_admin/layout/flashes/alerts
- helpers/solidus_admin
2 files changed
+12
-4
lines changedLines changed: 11 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
6 | 12 | | |
7 | | - | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
8 | 18 | | |
9 | 19 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | | - | |
12 | 10 | | |
13 | | - | |
| 11 | + | |
14 | 12 | | |
15 | 13 | | |
16 | 14 | | |
0 commit comments