inline_forms 8.1.43 → 8.1.44
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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e8208cb1ccfd70968b65e5a5245b30586ab35034059749a20b4dc27ffde59bbe
|
|
4
|
+
data.tar.gz: 91f66242ff63e1d1c7ff22aa744939b05140f8b95cb8ac009956a1e70a2c9ca9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6c7060b4c597512ab705c0eb8f104dbdb754ca4aa121e9214906e15e8ba3c64a942159e1a2d6312509465c02ab72f5299973742f317746d6f5ee99399283460f
|
|
7
|
+
data.tar.gz: 4411cae2c459f7de8b46651abe65a12360854d7434232b6a283c29a9fae4647cc5b49b548ab87fced3847f4e155975de8cf44d5b6d9ff5c610e83248b197edb8
|
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.44] - 2026-07-24
|
|
8
|
+
|
|
9
|
+
### Fixed
|
|
10
|
+
|
|
11
|
+
- **`simple_file_field` download link bypasses Turbo and uses the correct route segment.** When a file is present, the show link now carries `data-turbo="false"` so the browser handles the host controller's `send_data` response natively instead of Turbo loading binary content into the frame. The href route method is read from the raw values hash entry (e.g. `{ 0 => "download" }`) instead of through `attribute_values`, which translated the segment via `t()` and produced broken URLs. Integration test in `legacy_elements_test.rb`.
|
|
12
|
+
|
|
13
|
+
### Lockstep
|
|
14
|
+
|
|
15
|
+
- validation_hints 8.1.44, inline_forms_installer 8.1.44, inline_forms_schema_edit 8.1.44.
|
|
16
|
+
|
|
7
17
|
## [8.1.43] - 2026-07-22
|
|
8
18
|
|
|
9
19
|
### Fixed
|
|
@@ -7,11 +7,14 @@ module InlineForms
|
|
|
7
7
|
|
|
8
8
|
def simple_file_field_show(object, attribute)
|
|
9
9
|
o = object.send(attribute)
|
|
10
|
-
|
|
10
|
+
attributes = @inline_forms_attribute_list || object.inline_forms_attribute_list
|
|
11
|
+
values = attributes.assoc(attribute.to_sym)[2]
|
|
12
|
+
raise "inline_forms: no values defined in #{object.class} for #{attribute} (add a values hash to the inline_forms_attribute_list row)" if values.nil?
|
|
13
|
+
method = values.is_a?(Hash) ? values.sort_by { |k, _| k }.first[1] : values.first
|
|
11
14
|
if o.send(:present?)
|
|
12
15
|
filename = o.to_s
|
|
13
16
|
model = object.class.to_s.pluralize.underscore
|
|
14
|
-
link_to filename, "/#{model}/#{method}/#{object.id}" # route must exist!!
|
|
17
|
+
link_to filename, "/#{model}/#{method}/#{object.id}", data: { turbo: false } # route must exist!! turbo:false so the browser downloads send_data natively instead of Turbo loading it into the frame
|
|
15
18
|
else
|
|
16
19
|
link_to_inline_edit object, attribute, "<i class='fi-plus'></i>".html_safe, from_callee: __callee__
|
|
17
20
|
end
|
data/lib/inline_forms/version.rb
CHANGED
|
@@ -20,6 +20,18 @@ class LegacyElementsTest < InlineFormsIntegrationTestCase
|
|
|
20
20
|
assert_includes response.body, "fi-plus"
|
|
21
21
|
end
|
|
22
22
|
|
|
23
|
+
test "simple_file_field present state download link bypasses Turbo" do
|
|
24
|
+
@widget.update!(manual: "Lida.png")
|
|
25
|
+
frame = "widget_#{@widget.id}"
|
|
26
|
+
get widget_path(@widget, update: frame), headers: frame_headers(frame)
|
|
27
|
+
|
|
28
|
+
assert_response :success
|
|
29
|
+
# The download link must carry data-turbo="false" so the browser handles
|
|
30
|
+
# the send_data response natively instead of Turbo loading the binary into
|
|
31
|
+
# the frame (a no-op). The route method comes from the values entry.
|
|
32
|
+
assert_match %r{<a[^>]*data-turbo="false"[^>]*href="/widgets/download/#{@widget.id}"}, response.body
|
|
33
|
+
end
|
|
34
|
+
|
|
23
35
|
test "simple_file_field edit renders a file input" do
|
|
24
36
|
frame = "widget_#{@widget.id}_manual"
|
|
25
37
|
get edit_widget_path(@widget, attribute: "manual",
|