Commit d3c2022
authored
Render flash messages with UI::Alerts::FlashMessage (#4020)
The four layouts that rendered flash through `/layouts/revised_messages`
now render the component instead, the way admin already did. The partial
stays behind for `@page_errors` and the mustache template
`BikeIndexAlerts` renders client-side alerts into, so the JS alerts on
the bike-edit and payments pages keep working.
- **`flash[:info]` becomes `flash[:notice]`.** `info` isn't one of
`KINDS` — 24 call sites across 14 controllers set it directly, four more
reach it by passing `flash_type: :info` to `authenticate_user`, and four
views passed it as a kind, where it silently fell back. Renamed rather
than aliased in the component, so the flash type and the kind it renders
stay the same word. `KINDS` now derives from `TEXT_CLASSES`.
- **The unknown-kind guard raises in dev and test, falls back to notice
elsewhere.** Rails sweeps the flash after the layout renders, so a raise
from the layout leaves the offending key in the session and raises again
on the next request, and the next.
- **Every flash value is a string now.** Six sites set an Array
(`errors.full_messages`) or a `flash[:errors]` key; the component
renders neither, and the old bootstrap partial rendered the Array's
`inspect`. Five get `to_sentence`, and the theft alert plan forms get
`UI::Alerts::ObjectError` above the form like the other admin forms.
- **The impound multi-update's turbo_stream replaces `#flash-messages`**
alongside the results frame, rather than rendering a second copy of the
flash inside the frame. The component renders its container even when
empty so there's something to target, and the replace only fires when
there's a flash — otherwise every filter and sort would wipe an alert
the rider hadn't dismissed.
- **`UI::Alert` moves to `UI::Alerts::Base`**, so all three alert
components share the namespace. The three `MARKUP_DIGEST` bumps are that
rename reaching templates inside fragment caches.
Flash now sits bottom-center instead of top, and success messages no
longer auto-fade after 10s — the component's behavior, already what
admin gets.1 parent 2dd89f8 commit d3c2022
106 files changed
Lines changed: 357 additions & 327 deletions
File tree
- app
- components
- admin
- badges
- marketplace_listing
- bike_cell
- bikes_table
- current_header
- organization_cell
- strava_requests_rate_limit_details
- user_cell
- users_table
- messages/thread_show
- org
- graduated_notification_table
- impound_record_update_form
- search/form
- register
- step1
- step2
- registrations/show
- current_alerts
- prompt_chrome
- scanned_sticker
- sent_to_new_owner
- legacy_view_link
- toggle_view
- wrapper
- search_results/frame
- search/form
- ui
- alerts
- base
- flash_message
- object_error
- alert
- controllers
- admin
- organizations
- bikes
- concerns
- organized
- helpers
- views
- admin
- bikes
- dashboard
- mail_snippets
- strava_activities
- strava_integrations
- theft_alert_plans
- bikes
- doorkeeper/applications
- layouts
- organized
- emails
- exports
- impound_records
- search
- marketplace
- registrations
- users
- spec
- components/ui/alerts
- base
- flash_message
- controllers
- helpers
- integration
- organized
- registration
- requests
- admin
- bikes
- organized
- support
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
| 50 | + | |
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | | - | |
| 54 | + | |
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| |||
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
33 | | - | |
34 | | - | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
| 56 | + | |
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | | - | |
| 68 | + | |
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
88 | | - | |
| 88 | + | |
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
| |||
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
107 | | - | |
| 107 | + | |
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
108 | | - | |
| 108 | + | |
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
| 43 | + | |
44 | 44 | | |
45 | 45 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| |||
0 commit comments