inline_forms 8.1.46 → 8.1.47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +10 -0
- data/app/assets/stylesheets/inline_forms/inline_forms.scss +15 -0
- data/app/views/inline_forms/field_edit.html.erb +6 -0
- data/lib/inline_forms/version.rb +1 -1
- data/test/dummy/app/models/widget.rb +1 -0
- data/test/integration/inline_forms_crud_test.rb +24 -0
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a4f5d1ebb432475fd4db2c7eb7e92962b408b30a602c387f06af0b64a338cc4b
|
|
4
|
+
data.tar.gz: ac8c2e604daa44def24c578fced85d308c2ab7fe1b4f8f023af11e470ed97a50
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9717b909093e9b6c48db6a9325093bfbfc738b18f25d495a28095109b54e51e1671fa97df157570a85e55ef6f4ca278f340fbb7d1d58f6e73a05bf8cb7009f65
|
|
7
|
+
data.tar.gz: 3559bac6657e4ca87d33dc952d9031305db0682d6b1538e373c8193bc4e546f58d470949117d54a261676292f4fd48adb92f915cc096e76b4d69768e7de8fa92
|
data/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,16 @@ All notable changes to this project are documented in this file.
|
|
|
4
4
|
|
|
5
5
|
## [Unreleased]
|
|
6
6
|
|
|
7
|
+
## [8.1.47] - 2026-07-25
|
|
8
|
+
|
|
9
|
+
### Fixed
|
|
10
|
+
|
|
11
|
+
- **Inline-edit save failures now show validation errors in the editor.** `InlineFormsController#update` already set `flash.now[:error]` on a failed save, but `field_edit` never rendered it (and `_edit` deliberately skips flash to avoid session notices leaking into the field). `field_edit` now displays `:error` only, inside the turbo-frame, with compact `.inline_forms_field_error` styling.
|
|
12
|
+
|
|
13
|
+
### Lockstep
|
|
14
|
+
|
|
15
|
+
- validation_hints 8.1.47, inline_forms_installer 8.1.47, inline_forms_schema_edit 8.1.47.
|
|
16
|
+
|
|
7
17
|
## [8.1.46] - 2026-07-24
|
|
8
18
|
|
|
9
19
|
### Fixed
|
|
@@ -468,6 +468,21 @@ turbo-frame {
|
|
|
468
468
|
padding: 0.3em;
|
|
469
469
|
margin-bottom: 0.5em;
|
|
470
470
|
}
|
|
471
|
+
|
|
472
|
+
// Inline-edit validation feedback (flash.now[:error] on failed field save).
|
|
473
|
+
// Shown in field_edit only; _edit deliberately skips flash to avoid session notices.
|
|
474
|
+
.inline_forms_field_error {
|
|
475
|
+
font-size: 100%;
|
|
476
|
+
font-weight: normal;
|
|
477
|
+
line-height: 1.3;
|
|
478
|
+
margin: 0 0 0.4em;
|
|
479
|
+
padding: 0.35em 0.5em;
|
|
480
|
+
|
|
481
|
+
ul {
|
|
482
|
+
margin: 0;
|
|
483
|
+
padding-left: 1.2em;
|
|
484
|
+
}
|
|
485
|
+
}
|
|
471
486
|
.success {
|
|
472
487
|
color: var(--if-color-on-dark);
|
|
473
488
|
font-weight: bold;
|
|
@@ -1,3 +1,9 @@
|
|
|
1
1
|
<turbo-frame id="<%= @update_span %>">
|
|
2
|
+
<% field_errors = flash[:error] %>
|
|
3
|
+
<% if field_errors.present? %>
|
|
4
|
+
<div class="flash error inline_forms_field_error" role="alert">
|
|
5
|
+
<ul><% Array(field_errors).each do |m| %><li><%= m %></li><% end %></ul>
|
|
6
|
+
</div>
|
|
7
|
+
<% end %>
|
|
2
8
|
<%= render partial: "inline_forms/edit" %>
|
|
3
9
|
</turbo-frame>
|
data/lib/inline_forms/version.rb
CHANGED
|
@@ -71,6 +71,30 @@ class InlineFormsCrudTest < InlineFormsIntegrationTestCase
|
|
|
71
71
|
assert_equal "Alpha", @widget.reload.name, "blank name must not persist"
|
|
72
72
|
assert_includes response.body, %(name="name"),
|
|
73
73
|
"expected the edit input to be re-rendered after a failed save"
|
|
74
|
+
assert_includes response.body, "inline_forms_field_error"
|
|
75
|
+
assert_includes response.body, "can't be blank"
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
test "failed save with invalid value shows validation errors in the editor" do
|
|
79
|
+
frame = "widget_#{@widget.id}_notes"
|
|
80
|
+
put widget_path(@widget, attribute: "notes", form_element: "plain_text_area",
|
|
81
|
+
update: frame),
|
|
82
|
+
params: { notes: "short" }, headers: frame_headers(frame)
|
|
83
|
+
|
|
84
|
+
assert_response :success
|
|
85
|
+
assert_nil @widget.reload.notes
|
|
86
|
+
assert_includes response.body, "inline_forms_field_error"
|
|
87
|
+
assert_includes response.body, "is too short"
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
test "edit render shows no field error when flash is empty" do
|
|
91
|
+
frame = "widget_#{@widget.id}_name"
|
|
92
|
+
get edit_widget_path(@widget, attribute: "name", form_element: "text_field",
|
|
93
|
+
update: frame),
|
|
94
|
+
headers: frame_headers(frame)
|
|
95
|
+
|
|
96
|
+
assert_response :success
|
|
97
|
+
refute_includes response.body, "inline_forms_field_error"
|
|
74
98
|
end
|
|
75
99
|
|
|
76
100
|
test "destroy responds with the destroyed-row state and an undo pointing at the destroy version" do
|