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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 01deab33ac621116f150d6b9cb8b8fed5fe2ee6118a53699c383c08751d9c041
4
- data.tar.gz: 433f57953fa315079be2d5c2c8900885b6010478f360719e8aebd319c025cc90
3
+ metadata.gz: a4f5d1ebb432475fd4db2c7eb7e92962b408b30a602c387f06af0b64a338cc4b
4
+ data.tar.gz: ac8c2e604daa44def24c578fced85d308c2ab7fe1b4f8f023af11e470ed97a50
5
5
  SHA512:
6
- metadata.gz: 3366ebb49776ef4307ab2b64b6eb5b43c6d7f1cf8d2986bf5e5c747b6c67b8e7065bdc40ffa446241a56d8f3bdc845d6f79f49f9cab911e3e952a7d14fdda6e6
7
- data.tar.gz: f9d4ee91abb242c4ebbf8b13048922cc0da3641c4cf8610b6a48aefeca5071474a605295f4605bce9ce9cbd9d5140434cc8dfa35396e170c636b491fa6f19e32
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>
@@ -1,5 +1,5 @@
1
1
  # -*- encoding : utf-8 -*-
2
2
 
3
3
  module InlineForms
4
- VERSION = "8.1.46"
4
+ VERSION = "8.1.47"
5
5
  end
@@ -6,6 +6,7 @@ class Widget < ApplicationRecord
6
6
  belongs_to :kind, optional: true
7
7
 
8
8
  validates :name, presence: true
9
+ validates :notes, length: { minimum: 10 }, allow_blank: true
9
10
 
10
11
  scope :inline_forms_list, -> { order(:name, :id) }
11
12
  inline_forms_search_on :name
@@ -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&#39;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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: inline_forms
3
3
  version: !ruby/object:Gem::Version
4
- version: 8.1.46
4
+ version: 8.1.47
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ace Suares