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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 51bf71fc0e838244f70a9a53db6cfe0a3515cda9e43086bfded9a08c9b56b144
4
- data.tar.gz: 85796e1ea1d4dcc5d1afb094e67e045279ba862590e7bb25472e496eadd628ae
3
+ metadata.gz: 1c2157f464ca5f6e0a7f42dfbf783dfdbcd606942f8c40be8385479237889794
4
+ data.tar.gz: aa502e01d242a09fc6989b5f7f865c9fbbde33a98592273116daf07d96a8821d
5
5
  SHA512:
6
- metadata.gz: 0b674c30e72e0ac91aebe7cbe9c619cece169be0098faa9a1e50693831eb937ae4f572b363beb26678f9caa3d6c4ceb7f368aa9127ebd310f22a996b6d36fc4a
7
- data.tar.gz: e08e0398a885ca964e6403f379e4d293da09d02b204728f709aaf728ed2ee873666899f87d1408843152d3e089aa8ff3c12a9fb028246194a0df8f0b64400b0e
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
- "#{link_to 'preview', "/#{attribute}/#{object.id}", :class => "pdf_preview"} #{link_to 'pdf', "/#{attribute}/#{object.id}.pdf", :class => "pdf_open"}".html_safe
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)
@@ -1,5 +1,5 @@
1
1
  # -*- encoding : utf-8 -*-
2
2
 
3
3
  module InlineForms
4
- VERSION = "8.1.60"
4
+ VERSION = "8.1.61"
5
5
  end
@@ -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
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.60
4
+ version: 8.1.61
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ace Suares