From 5b82fc0d65ceb8c93d394dd633ce7d6e63fd1668 Mon Sep 17 00:00:00 2001 From: Stephen Nelson Date: Wed, 21 Feb 2024 21:10:26 +1030 Subject: [PATCH] Turbo 8 compatibility --- Gemfile.lock | 12 ++++---- .../katalyst/content/items_controller.rb | 4 +-- .../katalyst/content/items/edit.html.erb | 6 ++-- katalyst-content.gemspec | 2 +- lib/katalyst/content/config.rb | 2 ++ .../app/views/layouts/application.html.erb | 2 +- yarn.lock | 30 +++++++++---------- 7 files changed, 28 insertions(+), 30 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index a7ed0cc..2a36e42 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - katalyst-content (2.1.4) + katalyst-content (2.2.0) active_storage_validations katalyst-html-attributes katalyst-kpop @@ -168,9 +168,9 @@ GEM katalyst-html-attributes (1.0.1) activesupport html-attributes-utils - katalyst-kpop (3.0.2) + katalyst-kpop (3.1.1) katalyst-html-attributes - turbo-rails (< 2.0) + turbo-rails view_component katalyst-tables (2.5.0) katalyst-html-attributes @@ -327,9 +327,9 @@ GEM ruby-vips (2.2.0) ffi (~> 1.12) ruby2_keywords (0.0.5) - sass-embedded (1.71.0-arm64-darwin) + sass-embedded (1.71.1-arm64-darwin) google-protobuf (~> 3.25) - sass-embedded (1.71.0-x86_64-linux-gnu) + sass-embedded (1.71.1-x86_64-linux-gnu) google-protobuf (~> 3.25) shoulda-matchers (6.1.0) activesupport (>= 5.2.0) @@ -341,7 +341,7 @@ GEM stringio (3.1.0) thor (1.3.0) timeout (0.4.1) - turbo-rails (1.5.0) + turbo-rails (2.0.3) actionpack (>= 6.0.0) activejob (>= 6.0.0) railties (>= 6.0.0) diff --git a/app/controllers/katalyst/content/items_controller.rb b/app/controllers/katalyst/content/items_controller.rb index 62420ee..be67939 100644 --- a/app/controllers/katalyst/content/items_controller.rb +++ b/app/controllers/katalyst/content/items_controller.rb @@ -2,7 +2,7 @@ module Katalyst module Content - class ItemsController < ApplicationController + class ItemsController < Katalyst::Content.config.base_controller.constantize before_action :set_container, only: %i[new create] before_action :set_item, except: %i[new create] before_action :set_editor_variant @@ -11,8 +11,6 @@ class ItemsController < ApplicationController helper EditorHelper - layout nil - def new render_editor end diff --git a/app/views/katalyst/content/items/edit.html.erb b/app/views/katalyst/content/items/edit.html.erb index baeb631..3182859 100644 --- a/app/views/katalyst/content/items/edit.html.erb +++ b/app/views/katalyst/content/items/edit.html.erb @@ -1,5 +1,3 @@ -<%= render Kpop::FrameComponent.new do %> - <%= render Kpop::ModalComponent.new(title: item_editor.title, layout: "side-panel") do %> - <%= render item_editor %> - <% end %> +<%= render Kpop::ModalComponent.new(title: item_editor.title, layout: "side-panel") do %> + <%= render item_editor %> <% end %> diff --git a/katalyst-content.gemspec b/katalyst-content.gemspec index d806b30..331887a 100644 --- a/katalyst-content.gemspec +++ b/katalyst-content.gemspec @@ -2,7 +2,7 @@ Gem::Specification.new do |spec| spec.name = "katalyst-content" - spec.version = "2.1.4" + spec.version = "2.2.0" spec.authors = ["Katalyst Interactive"] spec.email = ["developers@katalyst.com.au"] diff --git a/lib/katalyst/content/config.rb b/lib/katalyst/content/config.rb index 53124a8..fae1c9a 100644 --- a/lib/katalyst/content/config.rb +++ b/lib/katalyst/content/config.rb @@ -24,6 +24,8 @@ class Config # Components config_accessor(:errors_component) { "Katalyst::Content::Editor::ErrorsComponent" } + + config_accessor(:base_controller) { "ApplicationController" } end end end diff --git a/spec/dummy/app/views/layouts/application.html.erb b/spec/dummy/app/views/layouts/application.html.erb index 368193d..85a4b7e 100644 --- a/spec/dummy/app/views/layouts/application.html.erb +++ b/spec/dummy/app/views/layouts/application.html.erb @@ -7,7 +7,7 @@ <%= csp_meta_tag %> - <%= stylesheet_link_tag "application" %> + <%= stylesheet_link_tag "application", "data-turbo-track": "reload" %> <%= javascript_importmap_tags %> diff --git a/yarn.lock b/yarn.lock index 5b2906a..7510cc6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12,9 +12,9 @@ "@jridgewell/trace-mapping" "^0.3.9" "@jridgewell/resolve-uri@^3.1.0": - version "3.1.1" - resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz#c08679063f279615a3326583ba3a90d1d82cc721" - integrity sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA== + version "3.1.2" + resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz#7a0ee601f60f99a20c7c7c5ff0c80388c1189bd6" + integrity sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw== "@jridgewell/set-array@^1.0.1": version "1.1.2" @@ -35,9 +35,9 @@ integrity sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg== "@jridgewell/trace-mapping@^0.3.9": - version "0.3.20" - resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.20.tgz#72e45707cf240fa6b081d0366f8265b0cd10197f" - integrity sha512-R8LcPeWZol2zR8mmH3JeKQ6QRCFb7XgUhV9ZlGhHLGyg4wpPiPZNQOOWhFZhxKw8u//yTbNGI42Bx/3paXEQ+Q== + version "0.3.22" + resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.22.tgz#72a621e5de59f5f1ef792d0793a82ee20f645e4c" + integrity sha512-Wf963MzWtA2sjrNt+g18IAln9lKnlRp+K2eH4jjIoF1wYeq3aMREpG09xhlhdzS0EjwU7qmUJYangWa+151vZw== dependencies: "@jridgewell/resolve-uri" "^3.1.0" "@jridgewell/sourcemap-codec" "^1.4.14" @@ -188,9 +188,9 @@ function-bind@^1.1.2: integrity sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA== hasown@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/hasown/-/hasown-2.0.0.tgz#f4c513d454a57b7c7e1650778de226b11700546c" - integrity sha512-vUptKVTpIJhcczKBbgnS+RtcuYMB8+oNzPK2/Hp3hanz8JmpATdmmgLgSaadVREkDm+e2giHwY3ZRkyjSIDDFA== + version "2.0.1" + resolved "https://registry.yarnpkg.com/hasown/-/hasown-2.0.1.tgz#26f48f039de2c0f8d3356c223fb8d50253519faa" + integrity sha512-1/th4MHjnwncwXsIW6QMzlvYL9kG5e/CpVvLRZe4XPa8TOUNbCELqmvhDmnkNsAjwaG4+I8gJJL0JBvTTLO9qA== dependencies: function-bind "^1.1.2" @@ -272,9 +272,9 @@ safe-buffer@^5.1.0: integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== serialize-javascript@^6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-6.0.1.tgz#b206efb27c3da0b0ab6b52f48d170b7996458e5c" - integrity sha512-owoXEFjWRllis8/M1Q+Cw5k8ZH40e3zhp/ovX+Xr/vi1qj6QesbyXXViFbpNvWvPNAD62SutwEXavefrLJWj7w== + version "6.0.2" + resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-6.0.2.tgz#defa1e055c83bf6d59ea805d8da862254eb6a6c2" + integrity sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g== dependencies: randombytes "^2.1.0" @@ -302,9 +302,9 @@ supports-preserve-symlinks-flag@^1.0.0: integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w== terser@^5.17.4: - version "5.26.0" - resolved "https://registry.yarnpkg.com/terser/-/terser-5.26.0.tgz#ee9f05d929f4189a9c28a0feb889d96d50126fe1" - integrity sha512-dytTGoE2oHgbNV9nTzgBEPaqAWvcJNl66VZ0BkJqlvp71IjO8CxdBx/ykCNb47cLnCmCvRZ6ZR0tLkqvZCdVBQ== + version "5.27.2" + resolved "https://registry.yarnpkg.com/terser/-/terser-5.27.2.tgz#577a362515ff5635f98ba149643793a3973ba77e" + integrity sha512-sHXmLSkImesJ4p5apTeT63DsV4Obe1s37qT8qvwHRmVxKTBH7Rv9Wr26VcAMmLbmk9UliiwK8z+657NyJHHy/w== dependencies: "@jridgewell/source-map" "^0.3.3" acorn "^8.8.2"