inline_forms 7.9.6 → 7.10.2
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 +57 -0
- data/app/assets/javascripts/inline_forms/inline_forms.js +53 -34
- data/app/helpers/form_elements/date.rb +0 -1
- data/app/helpers/form_elements/month_year_picker.rb +1 -15
- data/app/helpers/form_elements/time.rb +0 -1
- data/bin/inline_forms_installer_core.rb +20 -8
- data/docs/jquery-widgets.md +25 -0
- data/docs/turbo-stream-audit.md +16 -0
- data/docs/ujs-to-turbo.md +15 -0
- data/inline_forms.gemspec +2 -2
- data/lib/inline_forms/version.rb +1 -1
- data/lib/installer_templates/example_app_tests/test/integration/example_app_apartment_opening_date_test.rb +49 -0
- metadata +10 -7
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9d3deca8c70ea0bc94af632a47be2164e1ebcaf2c646bcfe0a4351d5b4e31baf
|
|
4
|
+
data.tar.gz: 7c621dd7c0ef043ee84666b734b5e23107acb3c2f4c9d8c0d3eb996e1705aa67
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 16356d8135b3580c2ff7fa4f5cdaf2b4ffd50230c342fce5edddb1c0bf00a739ce7f13ad47d95490a26f49906ea7ae408d711ca69cd8086b3df478570a5d005a
|
|
7
|
+
data.tar.gz: 9544d441c64cd90ba68b286f0be7b6318a512feffcc3c38dca0ac550616e96e2451d03ab301a114c81c3b04037eccb9046a5608021782dc362e38dc6ecd60981
|
data/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,63 @@ All notable changes to this project are documented in this file.
|
|
|
4
4
|
|
|
5
5
|
## [Unreleased]
|
|
6
6
|
|
|
7
|
+
## [7.10.2] - 2026-05-18
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- **Example app:** `Apartment.opening_date` (`date` / jQuery UI datepicker) — demonstrates centralized `initInlineFormsWidgets` on show, inline edit, and new form.
|
|
12
|
+
- **Regression test:** `example_app_apartment_opening_date_test.rb`.
|
|
13
|
+
|
|
14
|
+
### Verified
|
|
15
|
+
|
|
16
|
+
- **`inline_forms create MyApp -d sqlite --example`** → **`bundle exec rails test`** — **77 runs, 427 assertions, 0 failures**.
|
|
17
|
+
- **Browser:** new Apartment form → `Opening date` input has `class="datepicker hasDatepicker"` (jQuery UI initialized); submit persists `15-03-2019`; show panel renders it; inline edit re-binds datepicker on the same field.
|
|
18
|
+
|
|
19
|
+
## [7.10.1] - 2026-05-18
|
|
20
|
+
|
|
21
|
+
### Fixed
|
|
22
|
+
|
|
23
|
+
- **`inline_forms create`:** installer installs `validation_hints` from `~/code/validation_hints/*.gem` when `~> 6.3` is not on RubyGems yet (before first `bundle install`).
|
|
24
|
+
|
|
25
|
+
## [7.10.0] - 2026-05-18
|
|
26
|
+
|
|
27
|
+
### Changed
|
|
28
|
+
|
|
29
|
+
- **Rails 7.1:** gemspec and `--example` installer Gemfile pin `rails ~> 7.1.5`, `config.load_defaults 7.1`, migrations `ActiveRecord::Migration[7.1]`.
|
|
30
|
+
- **`validation_hints`:** requires 6.3.0+ (Rails 7.1 activerecord).
|
|
31
|
+
|
|
32
|
+
### Verified
|
|
33
|
+
|
|
34
|
+
- **`bundle exec rails test`** in `--example` MyApp on Rails 7.1 — **74 runs, 412 assertions, 0 failures**.
|
|
35
|
+
- **curl:** `GET /apartments/new?update=apartments_list` with session + Turbo-Frame — validation hint source present.
|
|
36
|
+
- **Browser (headless Chromium):** login → new Apartment → hover Name — Tippy tooltip visible with **"can't be blank"**.
|
|
37
|
+
|
|
38
|
+
## [7.9.8] - 2026-05-18
|
|
39
|
+
|
|
40
|
+
### Changed
|
|
41
|
+
|
|
42
|
+
- **jQuery widget init (Phase 4):** `initInlineFormsWidgets` centralizes datepicker, month/year picker, timepicker, Trix, and validation-hint Tippy re-bind on DOM ready, `turbo:load`, and `turbo:frame-load`.
|
|
43
|
+
- **`date` / `time` / `month_year_picker` form elements:** removed inline `<script>` tags; fields use class hooks (`datepicker`, `datepicker-month-year`, `timepicker`).
|
|
44
|
+
|
|
45
|
+
### Added
|
|
46
|
+
|
|
47
|
+
- **`docs/jquery-widgets.md`** — migration status and remaining jQuery dependencies.
|
|
48
|
+
|
|
49
|
+
### Verified
|
|
50
|
+
|
|
51
|
+
- **`bundle exec rails test`** in `--example` MyApp — **74 runs, 408 assertions, 0 failures**.
|
|
52
|
+
- **curl + browser:** validation hint tooltips on new Apartment form (7.9.8).
|
|
53
|
+
|
|
54
|
+
## [7.9.7] - 2026-05-18
|
|
55
|
+
|
|
56
|
+
### Added
|
|
57
|
+
|
|
58
|
+
- **`docs/turbo-stream-audit.md`** — documents current `format.turbo_stream` usage and optional future candidates (Phase 3 hygiene).
|
|
59
|
+
|
|
60
|
+
### Changed
|
|
61
|
+
|
|
62
|
+
- **Repo hygiene:** built `*.gem` artifacts remain gitignored; remove local copies after `gem build`.
|
|
63
|
+
|
|
7
64
|
## [7.9.6] - 2026-05-17
|
|
8
65
|
|
|
9
66
|
### Fixed
|
|
@@ -14,14 +14,61 @@
|
|
|
14
14
|
// `<turbo-frame>` + HTML responses; jquery-ujs / remotipart were removed in 7.8.0.
|
|
15
15
|
|
|
16
16
|
$(function(){
|
|
17
|
+
$.datepicker.setDefaults({
|
|
18
|
+
changeMonth : true,
|
|
19
|
+
changeYear : true,
|
|
20
|
+
yearRange: '-100:+100',
|
|
21
|
+
dateFormat: 'dd-mm-yy'
|
|
22
|
+
});
|
|
17
23
|
$(document).foundation();
|
|
18
|
-
|
|
24
|
+
initInlineFormsWidgets(document);
|
|
19
25
|
});
|
|
20
26
|
|
|
21
27
|
document.addEventListener("turbo:load", function() {
|
|
22
|
-
|
|
28
|
+
initInlineFormsWidgets(document);
|
|
23
29
|
});
|
|
24
30
|
|
|
31
|
+
// jQuery UI date/time pickers: one init path for first paint and turbo:frame-load
|
|
32
|
+
// (form element helpers emit class hooks only — no inline <script> tags).
|
|
33
|
+
function initInlineFormsWidgets(root) {
|
|
34
|
+
var $root = root instanceof jQuery ? root : $(root);
|
|
35
|
+
|
|
36
|
+
initValidationHintTooltips(root);
|
|
37
|
+
|
|
38
|
+
$root.find("input.datepicker-month-year").each(function() {
|
|
39
|
+
var $el = $(this);
|
|
40
|
+
if ($el.hasClass("hasDatepicker")) { return; }
|
|
41
|
+
$el.datepicker({
|
|
42
|
+
changeMonth: true,
|
|
43
|
+
changeYear: true,
|
|
44
|
+
showButtonPanel: true,
|
|
45
|
+
dateFormat: "MM yy",
|
|
46
|
+
onClose: function() {
|
|
47
|
+
var month = $("#ui-datepicker-div .ui-datepicker-month :selected").val();
|
|
48
|
+
var year = $("#ui-datepicker-div .ui-datepicker-year :selected").val();
|
|
49
|
+
$(this).datepicker("setDate", new Date(year, month, 1));
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
$root.find("input.datepicker").not(".datepicker-month-year").each(function() {
|
|
55
|
+
var $el = $(this);
|
|
56
|
+
if (!$el.hasClass("hasDatepicker")) { $el.datepicker(); }
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
$root.find("input.timepicker").each(function() {
|
|
60
|
+
var $el = $(this);
|
|
61
|
+
if (!$el.data("timepicker")) { $el.timepicker(); }
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
$root.find("trix-editor").each(function() {
|
|
65
|
+
if (window.Trix && this.editor) { return; }
|
|
66
|
+
if (window.Trix && typeof Trix.Editor === "function") {
|
|
67
|
+
new Trix.Editor(this);
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
|
|
25
72
|
// Validation hint tooltips: HTML lists from hidden source divs, rendered via Tippy.js
|
|
26
73
|
// (Foundation Tooltip positioning breaks inside #outer_container position:absolute).
|
|
27
74
|
function initValidationHintTooltips(root) {
|
|
@@ -55,44 +102,16 @@ function initValidationHintTooltips(root) {
|
|
|
55
102
|
});
|
|
56
103
|
}
|
|
57
104
|
|
|
58
|
-
//
|
|
105
|
+
// get rid of translation_missing tooltips
|
|
59
106
|
$(document).ready(function() {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
changeYear : true,
|
|
63
|
-
yearRange: '-100:+100',
|
|
64
|
-
dateFormat: 'dd-mm-yy'
|
|
107
|
+
$(this).on('mouseover', '.translation_missing', function() {
|
|
108
|
+
$(this).attr('title', '');
|
|
65
109
|
});
|
|
66
110
|
});
|
|
67
111
|
|
|
68
|
-
// get rid of translation_missing tooltips
|
|
69
|
-
$(document).ready(function() {
|
|
70
|
-
$(this).on('mouseover', '.translation_missing', function() {
|
|
71
|
-
$(this).attr('title', '');
|
|
72
|
-
});
|
|
73
|
-
});
|
|
74
|
-
|
|
75
112
|
// Re-bind jQuery UI widgets and Trix after Turbo Frame swaps (Step 3).
|
|
76
113
|
document.addEventListener("turbo:frame-load", function(event) {
|
|
77
114
|
var root = event.target;
|
|
78
115
|
if (!root || !root.querySelectorAll) { return; }
|
|
79
|
-
|
|
80
|
-
initValidationHintTooltips(root);
|
|
81
|
-
|
|
82
|
-
$(root).find("input.datepicker").each(function() {
|
|
83
|
-
var $el = $(this);
|
|
84
|
-
if (!$el.hasClass("hasDatepicker")) { $el.datepicker(); }
|
|
85
|
-
});
|
|
86
|
-
|
|
87
|
-
$(root).find("input.timepicker").each(function() {
|
|
88
|
-
var $el = $(this);
|
|
89
|
-
if (!$el.data("timepicker")) { $el.timepicker(); }
|
|
90
|
-
});
|
|
91
|
-
|
|
92
|
-
$(root).find("trix-editor").each(function() {
|
|
93
|
-
if (window.Trix && this.editor) { return; }
|
|
94
|
-
if (window.Trix && typeof Trix.Editor === "function") {
|
|
95
|
-
new Trix.Editor(this);
|
|
96
|
-
}
|
|
97
|
-
});
|
|
116
|
+
initInlineFormsWidgets(root);
|
|
98
117
|
});
|
|
@@ -9,7 +9,6 @@ end
|
|
|
9
9
|
def date_select_edit(object, attribute)
|
|
10
10
|
css_id = 'datepicker_' + object.class.to_s.underscore + '_' + object.id.to_s + '_' + attribute.to_s
|
|
11
11
|
out = text_field_tag attribute, ( object.send(attribute).nil? ? "" : object.send(attribute).to_date.strftime("%d-%m-%Y") ), :id => css_id, :class =>'datepicker'
|
|
12
|
-
out << "<script>$('##{css_id}').datepicker();</script>".html_safe
|
|
13
12
|
end
|
|
14
13
|
|
|
15
14
|
def date_select_update(object, attribute)
|
|
@@ -8,21 +8,7 @@ end
|
|
|
8
8
|
|
|
9
9
|
def month_year_picker_edit(object, attribute)
|
|
10
10
|
css_id = 'datepicker_' + object.class.to_s.underscore + '_' + object.id.to_s + '_' + attribute.to_s
|
|
11
|
-
out = text_field_tag attribute, ( object.send(attribute).nil? ? "" : object.send(attribute).strftime("%B %Y") ), :id => css_id, :class =>'datepicker'
|
|
12
|
-
#out << (hidden_field_tag "hidden_" + attribute.to_s, ( object.send(attribute).nil? ? "" : object.send(attribute).strftime("%d-%m-%Y") ), :id => "hiddden_" + css_id)
|
|
13
|
-
# http://jsfiddle.net/bopperben/DBpJe/
|
|
14
|
-
out << "<script>$('##{css_id}').datepicker( {
|
|
15
|
-
changeMonth: true,
|
|
16
|
-
changeYear: true,
|
|
17
|
-
showButtonPanel: true,
|
|
18
|
-
dateFormat: 'MM yy',
|
|
19
|
-
regional: '',
|
|
20
|
-
onClose: function(dateText, inst) {
|
|
21
|
-
var month = $('#ui-datepicker-div .ui-datepicker-month :selected').val();
|
|
22
|
-
var year = $('#ui-datepicker-div .ui-datepicker-year :selected').val();
|
|
23
|
-
$(this).datepicker('setDate', new Date(year, month, 1));
|
|
24
|
-
}
|
|
25
|
-
});</script>".html_safe
|
|
11
|
+
out = text_field_tag attribute, ( object.send(attribute).nil? ? "" : object.send(attribute).strftime("%B %Y") ), :id => css_id, :class =>'datepicker datepicker-month-year'
|
|
26
12
|
end
|
|
27
13
|
|
|
28
14
|
def month_year_picker_update(object, attribute)
|
|
@@ -9,7 +9,6 @@
|
|
|
9
9
|
def time_select_edit(object, attribute)
|
|
10
10
|
css_id = 'timepicker_' + object.class.to_s.underscore + '_' + object.id.to_s + '_' + attribute.to_s
|
|
11
11
|
out = text_field_tag attribute, ( object.send(attribute).nil? ? "" : object.send(attribute).to_datetime.strftime("%l:%M%P") ), :id => css_id, :class =>'timepicker'
|
|
12
|
-
out << "<script>$('##{css_id}').timepicker();</script>".html_safe
|
|
13
12
|
end
|
|
14
13
|
|
|
15
14
|
def time_select_update(object, attribute)
|
|
@@ -15,7 +15,7 @@ create_file 'Gemfile', "# created by inline_forms #{ENV['inline_forms_version']}
|
|
|
15
15
|
if File.exist?('config/application.rb')
|
|
16
16
|
gsub_file 'config/application.rb',
|
|
17
17
|
/config\.load_defaults\s+\d+\.\d+/,
|
|
18
|
-
'config.load_defaults 7.
|
|
18
|
+
'config.load_defaults 7.1'
|
|
19
19
|
# Strip Rails 7.1+ `config.autoload_lib(ignore: ...)` (and any surrounding
|
|
20
20
|
# explanatory comment block). Not supported on Rails 7.0.
|
|
21
21
|
gsub_file 'config/application.rb',
|
|
@@ -55,7 +55,7 @@ gem 'mysql2'
|
|
|
55
55
|
gem 'paper_trail', '~> 16.0'
|
|
56
56
|
gem 'rails-i18n', '~> 7.0'
|
|
57
57
|
gem 'rails-jquery-autocomplete'
|
|
58
|
-
gem 'rails', '~> 7.
|
|
58
|
+
gem 'rails', '~> 7.1.5'
|
|
59
59
|
gem 'rake'
|
|
60
60
|
gem 'rvm'
|
|
61
61
|
gem 'dartsass-rails'
|
|
@@ -71,7 +71,7 @@ gem 'importmap-rails'
|
|
|
71
71
|
gem 'turbo-rails'
|
|
72
72
|
gem 'tabs_on_rails', :git => 'https://github.com/acesuares/tabs_on_rails.git', :branch => 'update_remote_before_action'
|
|
73
73
|
gem 'unicorn'
|
|
74
|
-
gem 'validation_hints', '~> 6.
|
|
74
|
+
gem 'validation_hints', '~> 6.3'
|
|
75
75
|
gem 'will_paginate' #, git: 'https://github.com/acesuares/will_paginate.git'
|
|
76
76
|
|
|
77
77
|
gem_group :test do
|
|
@@ -101,6 +101,17 @@ end
|
|
|
101
101
|
|
|
102
102
|
say "- Running bundle..."
|
|
103
103
|
run "gem install bundler"
|
|
104
|
+
vh_gem_dirs = [
|
|
105
|
+
ENV["VALIDATION_HINTS_ROOT"],
|
|
106
|
+
File.expand_path("~/validation_hints"),
|
|
107
|
+
File.expand_path("~/code/validation_hints"),
|
|
108
|
+
File.expand_path("../validation_hints", GENERATOR_PATH)
|
|
109
|
+
].compact.uniq
|
|
110
|
+
vh_gem = vh_gem_dirs.flat_map { |dir| Dir[File.join(dir, "validation_hints-*.gem")] }.sort.last
|
|
111
|
+
if vh_gem && File.file?(vh_gem)
|
|
112
|
+
say "- Installing #{File.basename(vh_gem)} (local build; not on RubyGems yet)..."
|
|
113
|
+
run "gem install #{vh_gem} --no-document"
|
|
114
|
+
end
|
|
104
115
|
run "bundle install"
|
|
105
116
|
|
|
106
117
|
say "- Dart Sass: inline_forms stylesheet entrypoints + initializer..."
|
|
@@ -216,7 +227,7 @@ create_file "db/migrate/" +
|
|
|
216
227
|
Time.now.utc.strftime("%Y%m%d%H%M%S") +
|
|
217
228
|
"_" +
|
|
218
229
|
"devise_create_users.rb", <<-DEVISE_MIGRATION.strip_heredoc
|
|
219
|
-
class DeviseCreateUsers < ActiveRecord::Migration[7.
|
|
230
|
+
class DeviseCreateUsers < ActiveRecord::Migration[7.1]
|
|
220
231
|
|
|
221
232
|
def change
|
|
222
233
|
create_table(:users) do |t|
|
|
@@ -369,7 +380,7 @@ create_file "db/migrate/" +
|
|
|
369
380
|
Time.now.utc.strftime("%Y%m%d%H%M%S") +
|
|
370
381
|
"_" +
|
|
371
382
|
"inline_forms_create_join_table_user_role.rb", <<-ROLES_MIGRATION.strip_heredoc
|
|
372
|
-
class InlineFormsCreateJoinTableUserRole < ActiveRecord::Migration[7.
|
|
383
|
+
class InlineFormsCreateJoinTableUserRole < ActiveRecord::Migration[7.1]
|
|
373
384
|
def self.up
|
|
374
385
|
create_table :roles_users, :id => false, :force => true do |t|
|
|
375
386
|
t.integer :role_id
|
|
@@ -468,7 +479,7 @@ create_file "db/migrate/" +
|
|
|
468
479
|
Time.now.utc.strftime("%Y%m%d%H%M%S") +
|
|
469
480
|
"_" +
|
|
470
481
|
"inline_forms_create_view_for_translations.rb", <<-VIEW_MIGRATION.strip_heredoc
|
|
471
|
-
class InlineFormsCreateViewForTranslations < ActiveRecord::Migration[7.
|
|
482
|
+
class InlineFormsCreateViewForTranslations < ActiveRecord::Migration[7.1]
|
|
472
483
|
def self.up
|
|
473
484
|
execute 'CREATE VIEW translations
|
|
474
485
|
AS
|
|
@@ -678,7 +689,7 @@ if ENV['install_example'] == 'true'
|
|
|
678
689
|
say "\nInstalling example application..."
|
|
679
690
|
run 'bundle exec rails g inline_forms Photo name:string caption:string image:image_field description:rich_text apartment:belongs_to _presentation:\'#{name}\''
|
|
680
691
|
run 'bundle exec rails generate uploader Image'
|
|
681
|
-
run 'bundle exec rails g inline_forms Apartment name:string title:string description:rich_text photos:has_many photos:associated _enabled:yes _presentation:\'#{name}\''
|
|
692
|
+
run 'bundle exec rails g inline_forms Apartment name:string title:string opening_date:date description:rich_text photos:has_many photos:associated _enabled:yes _presentation:\'#{name}\''
|
|
682
693
|
|
|
683
694
|
say "- Apartment name is required..."
|
|
684
695
|
inject_into_file "app/models/apartment.rb",
|
|
@@ -797,7 +808,7 @@ if ENV['install_example'] == 'true'
|
|
|
797
808
|
sleep 1 # unique migration timestamp
|
|
798
809
|
seed_ts = Time.now.utc.strftime("%Y%m%d%H%M%S")
|
|
799
810
|
create_file "db/migrate/#{seed_ts}_seed_konferensha_photos.rb", <<-SEED_MIGRATION.strip_heredoc
|
|
800
|
-
class SeedKonferenshaPhotos < ActiveRecord::Migration[7.
|
|
811
|
+
class SeedKonferenshaPhotos < ActiveRecord::Migration[7.1]
|
|
801
812
|
# Seed an Apartment with a gallery of photos so the nested
|
|
802
813
|
# has_many list (apartments -> photos) has enough rows to
|
|
803
814
|
# trigger pagination. Driven by db/seed_images/, which the
|
|
@@ -808,6 +819,7 @@ if ENV['install_example'] == 'true'
|
|
|
808
819
|
def up
|
|
809
820
|
apartment = Apartment.find_or_create_by!(name: "Konferensha") do |a|
|
|
810
821
|
a.title = "Konferensha sobre Papiamentu"
|
|
822
|
+
a.opening_date = Date.new(2020, 5, 18)
|
|
811
823
|
end
|
|
812
824
|
|
|
813
825
|
seed_dir = Rails.root.join("db", "seed_images")
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# jQuery widget migration (Phase 4)
|
|
2
|
+
|
|
3
|
+
UJS removal (7.8.0) is complete. These jQuery-based widgets remain in the Sprockets bundle:
|
|
4
|
+
|
|
5
|
+
| Widget | Asset | Status |
|
|
6
|
+
|--------|-------|--------|
|
|
7
|
+
| Datepicker | `jquery.ui.all` | **Centralized** — `initInlineFormsWidgets` in `inline_forms.js`; helpers use `class="datepicker"` only |
|
|
8
|
+
| Month/year picker | jQuery UI datepicker | **Centralized** — `class="datepicker datepicker-month-year"` |
|
|
9
|
+
| Timepicker | `jquery.timepicker.js` | **Centralized** — `class="timepicker"` |
|
|
10
|
+
| Autocomplete | `autocomplete-rails` + inline scripts in `dropdown_with_other` | Still inline / jQuery UI |
|
|
11
|
+
| Foundation | `foundation` jQuery plugin | Required for layout chrome |
|
|
12
|
+
|
|
13
|
+
## Central init (7.9.8+)
|
|
14
|
+
|
|
15
|
+
`initInlineFormsWidgets(root)` runs on:
|
|
16
|
+
|
|
17
|
+
- DOM ready (after `$.datepicker.setDefaults`)
|
|
18
|
+
- `turbo:load`
|
|
19
|
+
- `turbo:frame-load`
|
|
20
|
+
|
|
21
|
+
Form element `_edit` helpers must **not** emit per-field `<script>` tags; class hooks only.
|
|
22
|
+
|
|
23
|
+
## Future removal (not started)
|
|
24
|
+
|
|
25
|
+
Replace with Stimulus or vanilla + `turbo:frame-load` one widget at a time; keep example-app tests green after each.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Turbo Stream audit (optional)
|
|
2
|
+
|
|
3
|
+
Stock inline_forms flows use **`format.html`** inside matching `<turbo-frame>` ids. **`format.turbo_stream`** is used where a single response must update **multiple** frames (e.g. revert from the versions panel).
|
|
4
|
+
|
|
5
|
+
## Current turbo_stream usage
|
|
6
|
+
|
|
7
|
+
| Action | Response | Notes |
|
|
8
|
+
|--------|----------|-------|
|
|
9
|
+
| `revert` | `turbo_stream.replace` row + versions frames | Required when POST originates inside `*_versions` frame |
|
|
10
|
+
|
|
11
|
+
## Candidates for future streams (not migrated)
|
|
12
|
+
|
|
13
|
+
- Row destroy fade-out animation (today: HTML `row_destroyed` replaces frame)
|
|
14
|
+
- Multi-field batch updates (no stock flow today)
|
|
15
|
+
|
|
16
|
+
No change required for the example app; integration tests assert HTML frame contracts.
|
data/docs/ujs-to-turbo.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# UJS → Turbo migration checklist
|
|
2
2
|
|
|
3
|
+
> **Decommissioned.** This checklist is frozen as of 2026-05-17.
|
|
4
|
+
> **Use the combined roadmap instead:** [`stuff/roadmap.md`](../stuff/roadmap.md)
|
|
5
|
+
> Canonical copy also at: `validation_hints/stuff/roadmap.md`
|
|
6
|
+
|
|
7
|
+
**Steps 1–5 are complete** (inline_forms **7.9.6**). Remaining work (jQuery widget migration, optional `turbo_stream` audit, validation hint copy, Rails security bump) is tracked in **`roadmap.md`**.
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Historical reference (archived)
|
|
12
|
+
|
|
13
|
+
<details>
|
|
14
|
+
<summary>Original UJS → Turbo checklist (click to expand)</summary>
|
|
15
|
+
|
|
3
16
|
Track progress toward full Turbo integration and removal of jQuery UJS from inline_forms generated apps.
|
|
4
17
|
|
|
5
18
|
**Current gem version:** see `lib/inline_forms/version.rb` (**Step 5** — Turbo Drive on, jquery-ujs / remotipart removed in **7.8.0**)
|
|
@@ -190,3 +203,5 @@ None on `InlineFormsController` / `VersionsConcern` stock actions (**7.8.0**). H
|
|
|
190
203
|
Stock `_show` / `_list` are not required for inline edit. Any page can call form-element helpers (e.g. `text_field_show(apartment, :name)`) inside a container with id `apartment_<id>_name`. Edit/update still hit `ApartmentsController#edit` / `#update` via polymorphic paths.
|
|
191
204
|
|
|
192
205
|
Example app **`--example` name list** (`GET /apartments/name_list`): custom page using the **same** turbo-field contract as stock `_show` (not a separate code path). Linked from the **More** menu; regression-tested after stock field Turbo lands.
|
|
206
|
+
|
|
207
|
+
</details>
|
data/inline_forms.gemspec
CHANGED
|
@@ -33,8 +33,8 @@ Gem::Specification.new do |s|
|
|
|
33
33
|
|
|
34
34
|
s.add_dependency('rvm', '>= 1.11', '< 2.0')
|
|
35
35
|
s.add_dependency('thor', '>= 1.0', '< 2.0')
|
|
36
|
-
s.add_dependency('validation_hints', '>= 6.
|
|
37
|
-
s.add_dependency('rails', '>= 7.
|
|
36
|
+
s.add_dependency('validation_hints', '>= 6.3', '< 7.0')
|
|
37
|
+
s.add_dependency('rails', '>= 7.1.5', '< 7.2')
|
|
38
38
|
s.add_dependency('rails-i18n', '>= 7.0', '< 8.0')
|
|
39
39
|
|
|
40
40
|
s.add_development_dependency("minitest", "~> 5.0")
|
data/lib/inline_forms/version.rb
CHANGED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative "../example_app/example_integration_test_case"
|
|
4
|
+
|
|
5
|
+
# Example app includes opening_date:date on Apartment (jQuery UI datepicker).
|
|
6
|
+
class ExampleAppApartmentOpeningDateTest < ExampleAppIntegrationTestCase
|
|
7
|
+
setup do
|
|
8
|
+
@apartment = Apartment.find_or_create_by!(name: "Datepicker Apt") do |a|
|
|
9
|
+
a.title = "Has an opening date"
|
|
10
|
+
a.opening_date = Date.new(2019, 3, 15)
|
|
11
|
+
end
|
|
12
|
+
@frame_id = "apartment_#{@apartment.id}_opening_date"
|
|
13
|
+
@turbo_headers = { "Turbo-Frame" => @frame_id, "Accept" => "text/html" }
|
|
14
|
+
@list_frame = "apartments_list"
|
|
15
|
+
@list_headers = { "Turbo-Frame" => @list_frame, "Accept" => "text/html" }
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
test "show panel displays opening_date" do
|
|
19
|
+
row_frame = "apartment_#{@apartment.id}"
|
|
20
|
+
get apartment_path(@apartment, update: row_frame),
|
|
21
|
+
headers: { "Turbo-Frame" => row_frame, "Accept" => "text/html" }
|
|
22
|
+
|
|
23
|
+
assert_response :success
|
|
24
|
+
assert_includes @response.body, "15-03-2019"
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
test "inline edit opening_date uses datepicker class hook" do
|
|
28
|
+
get edit_apartment_path(
|
|
29
|
+
@apartment,
|
|
30
|
+
attribute: "opening_date",
|
|
31
|
+
form_element: "date_select",
|
|
32
|
+
update: @frame_id
|
|
33
|
+
), headers: @turbo_headers
|
|
34
|
+
|
|
35
|
+
assert_response :success
|
|
36
|
+
assert_includes @response.body, %(class="datepicker")
|
|
37
|
+
assert_includes @response.body, %(name="opening_date")
|
|
38
|
+
refute_includes @response.body, "<script",
|
|
39
|
+
"datepicker init is centralized in inline_forms.js"
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
test "new apartment form includes datepicker for opening_date" do
|
|
43
|
+
get new_apartment_path(update: @list_frame), headers: @list_headers
|
|
44
|
+
|
|
45
|
+
assert_response :success
|
|
46
|
+
assert_includes @response.body, %(name="opening_date")
|
|
47
|
+
assert_includes @response.body, %(class="datepicker")
|
|
48
|
+
end
|
|
49
|
+
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: 7.
|
|
4
|
+
version: 7.10.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ace Suares
|
|
@@ -57,7 +57,7 @@ dependencies:
|
|
|
57
57
|
requirements:
|
|
58
58
|
- - ">="
|
|
59
59
|
- !ruby/object:Gem::Version
|
|
60
|
-
version: '6.
|
|
60
|
+
version: '6.3'
|
|
61
61
|
- - "<"
|
|
62
62
|
- !ruby/object:Gem::Version
|
|
63
63
|
version: '7.0'
|
|
@@ -67,7 +67,7 @@ dependencies:
|
|
|
67
67
|
requirements:
|
|
68
68
|
- - ">="
|
|
69
69
|
- !ruby/object:Gem::Version
|
|
70
|
-
version: '6.
|
|
70
|
+
version: '6.3'
|
|
71
71
|
- - "<"
|
|
72
72
|
- !ruby/object:Gem::Version
|
|
73
73
|
version: '7.0'
|
|
@@ -77,20 +77,20 @@ dependencies:
|
|
|
77
77
|
requirements:
|
|
78
78
|
- - ">="
|
|
79
79
|
- !ruby/object:Gem::Version
|
|
80
|
-
version: 7.
|
|
80
|
+
version: 7.1.5
|
|
81
81
|
- - "<"
|
|
82
82
|
- !ruby/object:Gem::Version
|
|
83
|
-
version: '7.
|
|
83
|
+
version: '7.2'
|
|
84
84
|
type: :runtime
|
|
85
85
|
prerelease: false
|
|
86
86
|
version_requirements: !ruby/object:Gem::Requirement
|
|
87
87
|
requirements:
|
|
88
88
|
- - ">="
|
|
89
89
|
- !ruby/object:Gem::Version
|
|
90
|
-
version: 7.
|
|
90
|
+
version: 7.1.5
|
|
91
91
|
- - "<"
|
|
92
92
|
- !ruby/object:Gem::Version
|
|
93
|
-
version: '7.
|
|
93
|
+
version: '7.2'
|
|
94
94
|
- !ruby/object:Gem::Dependency
|
|
95
95
|
name: rails-i18n
|
|
96
96
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -574,8 +574,10 @@ files:
|
|
|
574
574
|
- bin/inline_forms
|
|
575
575
|
- bin/inline_forms_app_template.rb
|
|
576
576
|
- bin/inline_forms_installer_core.rb
|
|
577
|
+
- docs/jquery-widgets.md
|
|
577
578
|
- docs/prompt/.gitignore
|
|
578
579
|
- docs/prompt/test-the-example-app.md
|
|
580
|
+
- docs/turbo-stream-audit.md
|
|
579
581
|
- docs/ujs-to-turbo.md
|
|
580
582
|
- inline_forms.gemspec
|
|
581
583
|
- lib/generators/USAGE
|
|
@@ -603,6 +605,7 @@ files:
|
|
|
603
605
|
- lib/installer_templates/example_app_tests/test/integration/example_app_apartment_field_turbo_test.rb
|
|
604
606
|
- lib/installer_templates/example_app_tests/test/integration/example_app_apartment_name_list_test.rb
|
|
605
607
|
- lib/installer_templates/example_app_tests/test/integration/example_app_apartment_name_required_test.rb
|
|
608
|
+
- lib/installer_templates/example_app_tests/test/integration/example_app_apartment_opening_date_test.rb
|
|
606
609
|
- lib/installer_templates/example_app_tests/test/integration/example_app_apartment_photos_pagination_test.rb
|
|
607
610
|
- lib/installer_templates/example_app_tests/test/integration/example_app_apartment_row_turbo_test.rb
|
|
608
611
|
- lib/installer_templates/example_app_tests/test/integration/example_app_apartment_top_level_new_test.rb
|