inline_forms 8.1.82 → 8.1.83
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: 3532bd1d698fa7928f3815b0ff11768480c683e5027b5da39370ba838a5cc4fe
|
|
4
|
+
data.tar.gz: 628c9cdd6dd4a1d9dff64de4fa1d3ca29df787cce9328a226c1b5d709fd5aa8f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e1cdaa160a5c5768328dc85a87efadbac34ad64fa57926c03caef798bbace22ddc573684fed74dccd6c93dd821e213862db86ca6a215a7a501cb7033a5e31a78
|
|
7
|
+
data.tar.gz: db9338b05cec3cd75d2d17b4a1286091c451d57ccbea02263571a0d6f674bbbb4352083f762b5b212381c29974caefdcf0bc2327447a909f7036a7cc786b301f
|
data/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,16 @@ All notable changes to this project are documented in this file.
|
|
|
8
8
|
|
|
9
9
|
- Known issues, parked (local note `stuff/2026-10-31-dropdown-rule-3-parked.md`) with dropdown order rule 3: `includes`, `group` or `select` in `inline_forms_list` make `dropdown` and `dropdown_with_other` raise while `/index` works, so 8.1.65's fix for a list order on a joined table holds only for `joins`, `left_joins` and `eager_load`; a has_many join gives duplicate options. Present since 8.1.60. No host's list scope has these today. Parked; not changed.
|
|
10
10
|
|
|
11
|
+
## [8.1.83] - 2026-11-24
|
|
12
|
+
|
|
13
|
+
From items 13-18 of the RACVS / yavetracker ladder prompt (`ladder/inline_forms-PROMPT-2026-11-24.md`).
|
|
14
|
+
|
|
15
|
+
### Fixed
|
|
16
|
+
|
|
17
|
+
- **The form-element helpers are no longer actions.** `InlineFormsController` includes every form-element helper (`text_field_show`, `…_edit`, `…_update`, …) for `assign_field`, and they were public, so they counted as actions (122 of the 177 in RACVS's `ClientsController.action_methods`). They are private in the controller now; views still get them, public, from `InlineFormsHelper`.
|
|
18
|
+
- **Restore stays in the versions panel when the versions table has no `object_changes` column.** Every changeset is empty there, and 7.13's rule "an update that changed nothing gets no Restore link" hid every Restore link (yavetracker kept an app copy of the partial for this). The rule now applies only when the column exists (`inline_forms_empty_changeset?`).
|
|
19
|
+
- **A value without a translation shows as itself.** `attribute_values` ran each label of a values list through `t()`, which in a view gives a `<span class="translation_missing">` for an untranslated value: shown with a tooltip and a capital in a row, and escaped into raw markup in a dropdown's options (`Ja">Ja</Span>` in yavetracker). An untranslated label is now the value itself (`inline_forms_value_label`); a translated one is unchanged, and numbers (a Range) are shown as they are. **Visible change:** an untranslated `"mid"` reads `mid`, no longer `Mid`.
|
|
20
|
+
|
|
11
21
|
## [8.1.82] - 2026-11-24
|
|
12
22
|
|
|
13
23
|
From a review of 8.1.78 to 8.1.81.
|
|
@@ -24,6 +24,10 @@
|
|
|
24
24
|
#
|
|
25
25
|
class InlineFormsController < ApplicationController
|
|
26
26
|
include InlineForms::FormElements::HelperIncludes
|
|
27
|
+
# The form-element helpers are here for assign_field (`send("#{element}_update")`),
|
|
28
|
+
# not as actions: private, so they stay out of action_methods (RACVS's
|
|
29
|
+
# ClientsController counted 122 of them). Views get them from InlineFormsHelper.
|
|
30
|
+
private(*InlineForms::FormElements.helper_modules.flat_map(&:public_instance_methods).uniq)
|
|
27
31
|
include CancanConcern
|
|
28
32
|
include VersionsConcern
|
|
29
33
|
include FileSlotsConcern
|
|
@@ -354,6 +354,17 @@ module InlineFormsHelper
|
|
|
354
354
|
#
|
|
355
355
|
# or a Range
|
|
356
356
|
#
|
|
357
|
+
# A value of a values list as the user sees it: its translation, or the
|
|
358
|
+
# value itself when there is none. A bare t(value) gave the view helper's
|
|
359
|
+
# <span class="translation_missing"> for an untranslated value ("Ja" in
|
|
360
|
+
# yavetracker), which a select option or a link escaped into raw markup.
|
|
361
|
+
# Numbers (a Range's values) are shown as they are.
|
|
362
|
+
def inline_forms_value_label(value)
|
|
363
|
+
return value unless value.is_a?(String) || value.is_a?(Symbol)
|
|
364
|
+
|
|
365
|
+
t(value, default: value.to_s)
|
|
366
|
+
end
|
|
367
|
+
|
|
357
368
|
def attribute_values(object, attribute)
|
|
358
369
|
# if we have a range 1..6 will result in [[0,1],[1,2],[2,3],...,[5,6]]
|
|
359
370
|
# or range -3..3 will result in [[0,-3],[1,-2],[2,-1],...,[6,3]]
|
|
@@ -391,13 +402,13 @@ module InlineFormsHelper
|
|
|
391
402
|
if values.is_a?(Hash)
|
|
392
403
|
temp = Array.new
|
|
393
404
|
values.to_a.each do |k, v|
|
|
394
|
-
temp << [ k,
|
|
405
|
+
temp << [ k, inline_forms_value_label(v) ]
|
|
395
406
|
end
|
|
396
407
|
values = temp.sort { |a, b| a[0]<=>b[0] }
|
|
397
408
|
else
|
|
398
409
|
temp = Array.new
|
|
399
410
|
values.to_a.each_index do |i|
|
|
400
|
-
temp << [ i,
|
|
411
|
+
temp << [ i, inline_forms_value_label(values.to_a[i]) ]
|
|
401
412
|
end
|
|
402
413
|
values = temp.sort { |a, b| a[1]<=>b[1] }
|
|
403
414
|
end
|
|
@@ -436,6 +447,17 @@ module InlineFormsHelper
|
|
|
436
447
|
InlineForms.application_title
|
|
437
448
|
end
|
|
438
449
|
|
|
450
|
+
# An update version that changed nothing (a `touch`, a callback): the
|
|
451
|
+
# versions panel hides its Restore link. Only when the versions table
|
|
452
|
+
# records changes at all: without an object_changes column every changeset
|
|
453
|
+
# is empty, and Restore (which reifies `object`) must stay.
|
|
454
|
+
def inline_forms_empty_changeset?(version)
|
|
455
|
+
columns = version.class.try(:column_names)
|
|
456
|
+
return false if columns && !columns.include?("object_changes")
|
|
457
|
+
|
|
458
|
+
version.changeset.nil? || version.changeset.except("updated_at").empty?
|
|
459
|
+
end
|
|
460
|
+
|
|
439
461
|
def version_modified_by(id)
|
|
440
462
|
return "Unknown" if id.blank?
|
|
441
463
|
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
link is hidden here so the action is never offered. -%>
|
|
83
83
|
<% if version.event == "create" && entry[:kind] != :rich_text %>
|
|
84
84
|
|
|
85
|
-
<% elsif
|
|
85
|
+
<% elsif inline_forms_empty_changeset?(version) %>
|
|
86
86
|
|
|
87
87
|
<% else %>
|
|
88
88
|
<% row_id = inline_forms_row_turbo_frame_id(@object) %>
|
data/lib/inline_forms/version.rb
CHANGED