inline_forms 8.1.61 → 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: 1c2157f464ca5f6e0a7f42dfbf783dfdbcd606942f8c40be8385479237889794
4
- data.tar.gz: aa502e01d242a09fc6989b5f7f865c9fbbde33a98592273116daf07d96a8821d
3
+ metadata.gz: d65f5d0ad495091211688c0db04b4466e240ea578b1349523e97a1ce66d3cd00
4
+ data.tar.gz: 9aca4b16c7481547715c240283ff8bac4de6d1d19caa57e3bc239aa51ed2899c
5
5
  SHA512:
6
- metadata.gz: 9ca4f57a7ae8c58b68b63103553b6de3f59f187b9fa9cef64fdaa9e5dcdfb494a69dfbce24f3207b0c6198c08dd03d79de84d6c542283115959edd3b7518e776
7
- data.tar.gz: 651bf78a377bebbdb9fbf1a17f6ad995e00c5de0b399c90377f2680db8d816d592ebf394a8d49a963a244798a890e04c9a09554486767e7c59487e2cbe3da69c
6
+ metadata.gz: 05afb1bc303bfdda7506735a166f1f69f0ee5f8a79efa2279a4d928e308c69047037bfd00383a260a3e547f5540bdd7f36d8aff476da0c54c9c7b92df21a39b2
7
+ data.tar.gz: c059604b46b459595cc34fb574704a1e0203aab6eb40083825df0763c0e9ae48489765515529efa30561f0b2bed44ec39944566750b7e6fc14b7da2c4d209033
data/CHANGELOG.md CHANGED
@@ -4,6 +4,48 @@ 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
+
7
49
  ## [8.1.61] - 2026-10-30
8
50
 
9
51
  ### Fixed
@@ -8,7 +8,7 @@ module InlineForms
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
+ "#{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
12
12
  end
13
13
 
14
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.61"
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
@@ -52,6 +52,16 @@ class LegacyElementsTest < InlineFormsIntegrationTestCase
52
52
  assert_includes response.body, %(href="/report/#{@widget.id}.pdf")
53
53
  end
54
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
+
55
65
  test "pdf_link links leave the field's turbo frame" do
56
66
  frame = "widget_#{@widget.id}"
57
67
  get widget_path(@widget, update: frame), headers: frame_headers(frame)
@@ -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.61
4
+ version: 8.1.64
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ace Suares