inline_forms 8.1.60 → 8.1.61
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 +14 -0
- data/lib/inline_forms/form_elements/pdf_link_helper.rb +2 -1
- data/lib/inline_forms/version.rb +1 -1
- data/test/integration/legacy_elements_test.rb +18 -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: 1c2157f464ca5f6e0a7f42dfbf783dfdbcd606942f8c40be8385479237889794
|
|
4
|
+
data.tar.gz: aa502e01d242a09fc6989b5f7f865c9fbbde33a98592273116daf07d96a8821d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9ca4f57a7ae8c58b68b63103553b6de3f59f187b9fa9cef64fdaa9e5dcdfb494a69dfbce24f3207b0c6198c08dd03d79de84d6c542283115959edd3b7518e776
|
|
7
|
+
data.tar.gz: 651bf78a377bebbdb9fbf1a17f6ad995e00c5de0b399c90377f2680db8d816d592ebf394a8d49a963a244798a890e04c9a09554486767e7c59487e2cbe3da69c
|
data/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,20 @@ All notable changes to this project are documented in this file.
|
|
|
4
4
|
|
|
5
5
|
## [Unreleased]
|
|
6
6
|
|
|
7
|
+
## [8.1.61] - 2026-10-30
|
|
8
|
+
|
|
9
|
+
### Fixed
|
|
10
|
+
|
|
11
|
+
- **`pdf_link`: the `preview` and `pdf` links work again under Turbo.** They sit inside the field's `<turbo-frame>`, so a click loaded the response into that frame: the preview showed Turbo's "Content missing", and the PDF, which is not HTML, went to the same frame. Both links now carry `data-turbo="false"`, as `simple_file_field`'s download link does, and the preview opens in a new tab so the record stays open. An app that worked around this can drop its override.
|
|
12
|
+
|
|
13
|
+
### Tests
|
|
14
|
+
|
|
15
|
+
- `legacy_elements_test`: both `pdf_link` links carry `data-turbo="false"`, and only the preview has `target="_blank"`.
|
|
16
|
+
|
|
17
|
+
### Lockstep
|
|
18
|
+
|
|
19
|
+
- validation_hints 8.1.61, inline_forms_installer 8.1.61, inline_forms_schema_edit 8.1.61.
|
|
20
|
+
|
|
7
21
|
## [8.1.60] - 2026-10-28
|
|
8
22
|
|
|
9
23
|
Fixes from a review of 8.1.58 and 8.1.59.
|
|
@@ -7,7 +7,8 @@ module InlineForms
|
|
|
7
7
|
|
|
8
8
|
def pdf_link_show(object, attribute)
|
|
9
9
|
# the attribute is the action
|
|
10
|
-
|
|
10
|
+
# turbo:false so the links leave the field's turbo-frame: the preview has no matching frame ("Content missing") and the PDF is not HTML; the preview gets its own tab so the record stays open
|
|
11
|
+
"#{link_to 'preview', "/#{attribute}/#{object.id}", :class => "pdf_preview", :target => "_blank", :data => { :turbo => false }} #{link_to 'pdf', "/#{attribute}/#{object.id}.pdf", :class => "pdf_open", :data => { :turbo => false }}".html_safe
|
|
11
12
|
end
|
|
12
13
|
|
|
13
14
|
def pdf_link_edit(object, attribute)
|
data/lib/inline_forms/version.rb
CHANGED
|
@@ -51,4 +51,22 @@ class LegacyElementsTest < InlineFormsIntegrationTestCase
|
|
|
51
51
|
assert_includes response.body, %(href="/report/#{@widget.id}")
|
|
52
52
|
assert_includes response.body, %(href="/report/#{@widget.id}.pdf")
|
|
53
53
|
end
|
|
54
|
+
|
|
55
|
+
test "pdf_link links leave the field's turbo frame" do
|
|
56
|
+
frame = "widget_#{@widget.id}"
|
|
57
|
+
get widget_path(@widget, update: frame), headers: frame_headers(frame)
|
|
58
|
+
|
|
59
|
+
assert_response :success
|
|
60
|
+
assert_select %(a[href="/report/#{@widget.id}"][data-turbo="false"])
|
|
61
|
+
assert_select %(a[href="/report/#{@widget.id}.pdf"][data-turbo="false"])
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
test "pdf_link preview opens in a new tab, the pdf link does not" do
|
|
65
|
+
frame = "widget_#{@widget.id}"
|
|
66
|
+
get widget_path(@widget, update: frame), headers: frame_headers(frame)
|
|
67
|
+
|
|
68
|
+
assert_response :success
|
|
69
|
+
assert_select %(a[href="/report/#{@widget.id}"][target="_blank"])
|
|
70
|
+
assert_select %(a[href="/report/#{@widget.id}.pdf"][target]), false
|
|
71
|
+
end
|
|
54
72
|
end
|