inline_forms 8.1.60 → 8.1.64

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: d65f5d0ad495091211688c0db04b4466e240ea578b1349523e97a1ce66d3cd00
4
+ data.tar.gz: 9aca4b16c7481547715c240283ff8bac4de6d1d19caa57e3bc239aa51ed2899c
5
5
  SHA512:
6
- metadata.gz: 0b674c30e72e0ac91aebe7cbe9c619cece169be0098faa9a1e50693831eb937ae4f572b363beb26678f9caa3d6c4ceb7f368aa9127ebd310f22a996b6d36fc4a
7
- data.tar.gz: e08e0398a885ca964e6403f379e4d293da09d02b204728f709aaf728ed2ee873666899f87d1408843152d3e089aa8ff3c12a9fb028246194a0df8f0b64400b0e
6
+ metadata.gz: 05afb1bc303bfdda7506735a166f1f69f0ee5f8a79efa2279a4d928e308c69047037bfd00383a260a3e547f5540bdd7f36d8aff476da0c54c9c7b92df21a39b2
7
+ data.tar.gz: c059604b46b459595cc34fb574704a1e0203aab6eb40083825df0763c0e9ae48489765515529efa30561f0b2bed44ec39944566750b7e6fc14b7da2c4d209033
data/CHANGELOG.md CHANGED
@@ -4,6 +4,62 @@ All notable changes to this project are documented in this file.
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [8.1.64] - 2026-10-31
8
+
9
+ ### Changed
10
+
11
+ - **`pdf_link`'s labels are translated.** `inline_forms.files.preview` and `inline_forms.files.download_pdf`, in English ("preview | download pdf") and Dutch ("voorbeeld | pdf downloaden"), with the English texts as defaults for other locales. An app in Dutch now shows the Dutch labels: a test that finds the link by its text needs the new text.
12
+
13
+ ### Tests
14
+
15
+ - `locale_test`: `pdf_link` in Dutch.
16
+
17
+ ### Lockstep
18
+
19
+ - validation_hints 8.1.64, inline_forms_installer 8.1.64, inline_forms_schema_edit 8.1.64.
20
+
21
+ ## [8.1.63] - 2026-10-31
22
+
23
+ ### Changed
24
+
25
+ - **`pdf_link` reads "preview | download pdf".** "preview pdf" read as one label. The second link's text is now `download pdf` and a ` | ` separates the links; hrefs, classes, `data-turbo` and `target` are unchanged.
26
+
27
+ ### Tests
28
+
29
+ - `legacy_elements_test` and `example_app_showcase_pdf_link_test`: the link texts and the separator.
30
+
31
+ ### Lockstep
32
+
33
+ - validation_hints 8.1.63, inline_forms_installer 8.1.63, inline_forms_schema_edit 8.1.63.
34
+
35
+ ## [8.1.62] - 2026-10-30
36
+
37
+ ### Added
38
+
39
+ - **The example app has a `pdf_link`.** `FormElementShowcase` gets a `report` row, with `ShowcaseReportsController` behind `/report/:id` (preview) and `/report/:id.pdf` (a sample PDF, as a download).
40
+
41
+ ### Tests
42
+
43
+ - `example_app_showcase_pdf_link_test`: the links, the new form, the preview, the download and guests.
44
+
45
+ ### Lockstep
46
+
47
+ - validation_hints 8.1.62, inline_forms_installer 8.1.62, inline_forms_schema_edit 8.1.62.
48
+
49
+ ## [8.1.61] - 2026-10-30
50
+
51
+ ### Fixed
52
+
53
+ - **`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.
54
+
55
+ ### Tests
56
+
57
+ - `legacy_elements_test`: both `pdf_link` links carry `data-turbo="false"`, and only the preview has `target="_blank"`.
58
+
59
+ ### Lockstep
60
+
61
+ - validation_hints 8.1.61, inline_forms_installer 8.1.61, inline_forms_schema_edit 8.1.61.
62
+
7
63
  ## [8.1.60] - 2026-10-28
8
64
 
9
65
  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 t("inline_forms.files.preview", :default => "preview"), "/#{attribute}/#{object.id}", :class => "pdf_preview", :target => "_blank", :data => { :turbo => false }} | #{link_to t("inline_forms.files.download_pdf", :default => "download 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.64"
5
5
  end
@@ -49,6 +49,8 @@ en:
49
49
  destroy: destroy
50
50
  files:
51
51
  download: download
52
+ download_pdf: download pdf
53
+ preview: preview
52
54
  replace: replace file
53
55
  remove: remove file
54
56
  restore: restore
@@ -49,6 +49,8 @@ nl:
49
49
  destroy: verwijderd
50
50
  files:
51
51
  download: downloaden
52
+ download_pdf: pdf downloaden
53
+ preview: voorbeeld
52
54
  replace: bestand vervangen
53
55
  remove: bestand verwijderen
54
56
  restore: terugzetten
@@ -51,4 +51,32 @@ 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 reads preview | download pdf" 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}"]), text: "preview"
61
+ assert_select %(a[href="/report/#{@widget.id}.pdf"]), text: "download pdf"
62
+ assert_match %r{>preview</a> \| <a[^>]*>download pdf</a>}, response.body
63
+ end
64
+
65
+ test "pdf_link links leave the field's turbo frame" do
66
+ frame = "widget_#{@widget.id}"
67
+ get widget_path(@widget, update: frame), headers: frame_headers(frame)
68
+
69
+ assert_response :success
70
+ assert_select %(a[href="/report/#{@widget.id}"][data-turbo="false"])
71
+ assert_select %(a[href="/report/#{@widget.id}.pdf"][data-turbo="false"])
72
+ end
73
+
74
+ test "pdf_link preview opens in a new tab, the pdf link does not" do
75
+ frame = "widget_#{@widget.id}"
76
+ get widget_path(@widget, update: frame), headers: frame_headers(frame)
77
+
78
+ assert_response :success
79
+ assert_select %(a[href="/report/#{@widget.id}"][target="_blank"])
80
+ assert_select %(a[href="/report/#{@widget.id}.pdf"][target]), false
81
+ end
54
82
  end
@@ -18,6 +18,7 @@ class LocaleTest < InlineFormsIntegrationTestCase
18
18
  inline_forms.view.versions_rich_text inline_forms.view.version_events.create
19
19
  inline_forms.view.version_events.update inline_forms.view.version_events.destroy
20
20
  inline_forms.devise.login common.more common.logout inline_forms.view.create_failed
21
+ inline_forms.files.preview inline_forms.files.download_pdf
21
22
  ].freeze
22
23
 
23
24
  setup do
@@ -121,6 +122,23 @@ class LocaleTest < InlineFormsIntegrationTestCase
121
122
  assert_includes response.body, "old value"
122
123
  end
123
124
 
125
+ test "pdf_link reads Dutch" do
126
+ widget = Widget.create!(name: "Rapport")
127
+ frame = "widget_#{widget.id}"
128
+
129
+ # Not strictly: the dummy's dropdown values have no nl texts.
130
+ original_default = I18n.default_locale
131
+ I18n.with_locale(:nl) do
132
+ I18n.default_locale = :nl
133
+ get widget_path(widget, update: frame), headers: frame_headers(frame)
134
+ end
135
+
136
+ assert_response :success
137
+ assert_match %r{>voorbeeld</a> \| <a[^>]*>pdf downloaden</a>}, response.body
138
+ ensure
139
+ I18n.default_locale = original_default
140
+ end
141
+
124
142
  test "the devise and application layouts declare the page language" do
125
143
  get widgets_path
126
144
  I18n.with_locale(:nl) 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.60
4
+ version: 8.1.64
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ace Suares