katalyst-navigation 1.6.0 → 1.8.0

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: 9d105afa8b02f8a188defa654988532ea041cbb437245e53ac3f2a049b0ef9d3
4
- data.tar.gz: c561645ff7f288164f62356d2c9cd847b1a25d73fc44c8950b3e629db318dc42
3
+ metadata.gz: 278f751a767203cf16a943556ace5d93f89e82f08130e87c4d6f668a5803ee52
4
+ data.tar.gz: ee91d52ee9dc9d5a48b1b484c52c21707aa812e885037eaa27ffe013d0ad887b
5
5
  SHA512:
6
- metadata.gz: 85d9f6b9cb21ab50299a5c8940627424643f905a08a1ad77b8a8f380eae2a85872b8fa8ce43cbd55ea31e14068d0184f1fa16c509e9625c3a1bc1709a0d66f74
7
- data.tar.gz: 4cb2f1cdaec86b3399c5723a26a184cb1832a3d3e0dd1c8207c1335a0cc19f0ac32fab8307b2d4bf5681c6a30b8f49f00730e8088c46142a8fdbcdbf756bafe4
6
+ metadata.gz: c0a96defd73f0517aa4f94e9d982804b7b72f623720e51449d6d1760b6a1b21d2e9b06b527398690438afc73e25e0cf0fefc8afa7d309ff615da7ac0e2e19af4
7
+ data.tar.gz: 12bf4e7e378968ba31299ecaa76ada1bb07becfdf54699f771193c7f34e555d93f2baa83a01b121aa639adf09f92bf0bdbb0ed4736b64120a9bdccc4e83b61dd
@@ -4,8 +4,6 @@ module Katalyst
4
4
  module Navigation
5
5
  module Editor
6
6
  class ErrorsComponent < BaseComponent
7
- include Katalyst::Tables::TurboReplaceable
8
-
9
7
  def id
10
8
  dom_id(menu, :errors)
11
9
  end
@@ -11,7 +11,7 @@ module Katalyst
11
11
  with_collection_parameter :item
12
12
 
13
13
  def initialize(item:, menu: item.menu)
14
- super(item:, menu:)
14
+ super
15
15
  end
16
16
 
17
17
  def item_component(**)
@@ -3,19 +3,12 @@
3
3
  module Katalyst
4
4
  module Navigation
5
5
  class MenusController < Katalyst::Navigation.config.base_controller.constantize
6
- include Katalyst::Tables::Backend
6
+ helper Katalyst::Tables::Frontend
7
7
 
8
8
  def index
9
9
  collection = Katalyst::Tables::Collection::Base.new(sorting: :title).with_params(params).apply(Menu.all)
10
- table = Katalyst::Turbo::TableComponent.new(collection:,
11
- id: "index-table",
12
- class: "index-table",
13
- caption: true)
14
-
15
- respond_to do |format|
16
- format.turbo_stream { render(table) } if self_referred?
17
- format.html { render :index, locals: { table: } }
18
- end
10
+
11
+ render locals: { collection: }
19
12
  end
20
13
 
21
14
  def show
@@ -40,7 +33,7 @@ module Katalyst
40
33
  end
41
34
 
42
35
  def create
43
- @menu = Menu.new(menu_params)
36
+ @menu = Menu.new(menu_params)
44
37
  editor = Katalyst::Navigation::EditorComponent.new(menu: @menu)
45
38
 
46
39
  if @menu.save
@@ -54,7 +47,7 @@ module Katalyst
54
47
 
55
48
  # PATCH /admins/navigation_menus/:slug
56
49
  def update
57
- menu = Menu.find(params[:id])
50
+ menu = Menu.find(params[:id])
58
51
  editor = Katalyst::Navigation::EditorComponent.new(menu:)
59
52
 
60
53
  menu.attributes = menu_params
@@ -6,4 +6,9 @@
6
6
  </div>
7
7
  </nav>
8
8
 
9
- <%= render(table) %>
9
+ <%= table_with(collection:) do |row, menu| %>
10
+ <%= row.text :title do |cell| %>
11
+ <%= link_to cell, menu %>
12
+ <% end %>
13
+ <%= row.text :slug %>
14
+ <% end %>
data/config/importmap.rb CHANGED
@@ -1,2 +1,3 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  pin "@katalyst/navigation", to: "katalyst/navigation.js"
@@ -10,7 +10,7 @@ class CreateKatalystNavigationItems < ActiveRecord::Migration[7.0]
10
10
  t.string :url
11
11
  t.string :http_method
12
12
  t.string :target
13
- t.boolean :visible, default: true
13
+ t.boolean :visible, default: true, null: false
14
14
 
15
15
  t.timestamps
16
16
  end
@@ -2,10 +2,12 @@
2
2
 
3
3
  # Ensures that all navigation items have a valid target and http_method.
4
4
  class UpdateTargetSyntax < ActiveRecord::Migration[7.0]
5
+ # rubocop:disable Rails/SkipsModelValidations
5
6
  def change
6
7
  Katalyst::Navigation::Item.where(http_method: nil).update_all(http_method: "get")
7
8
  Katalyst::Navigation::Item.where(target: nil).update_all(target: "self")
8
9
  Katalyst::Navigation::Item.where(target: "_blank").update_all(target: "blank")
9
10
  Katalyst::Navigation::Item.where(target: "_top").update_all(target: "top")
10
11
  end
12
+ # rubocop:enable Rails/SkipsModelValidations
11
13
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: katalyst-navigation
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.0
4
+ version: 1.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Katalyst Interactive
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-02-21 00:00:00.000000000 Z
11
+ date: 2024-06-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: katalyst-html-attributes
@@ -66,7 +66,7 @@ dependencies:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
- description:
69
+ description:
70
70
  email:
71
71
  - developers@katalyst.com.au
72
72
  executables: []
@@ -135,7 +135,6 @@ files:
135
135
  - app/views/katalyst/navigation/items/edit.html.erb
136
136
  - app/views/katalyst/navigation/items/edit.turbo_stream.erb
137
137
  - app/views/katalyst/navigation/items/update.turbo_stream.erb
138
- - app/views/katalyst/navigation/menus/_menu.html+row.erb
139
138
  - app/views/katalyst/navigation/menus/edit.html.erb
140
139
  - app/views/katalyst/navigation/menus/index.html.erb
141
140
  - app/views/katalyst/navigation/menus/new.html.erb
@@ -157,7 +156,7 @@ licenses:
157
156
  - MIT
158
157
  metadata:
159
158
  rubygems_mfa_required: 'true'
160
- post_install_message:
159
+ post_install_message:
161
160
  rdoc_options: []
162
161
  require_paths:
163
162
  - lib
@@ -165,15 +164,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
165
164
  requirements:
166
165
  - - ">="
167
166
  - !ruby/object:Gem::Version
168
- version: 3.2.0
167
+ version: 3.3.0
169
168
  required_rubygems_version: !ruby/object:Gem::Requirement
170
169
  requirements:
171
170
  - - ">="
172
171
  - !ruby/object:Gem::Version
173
172
  version: '0'
174
173
  requirements: []
175
- rubygems_version: 3.4.19
176
- signing_key:
174
+ rubygems_version: 3.5.11
175
+ signing_key:
177
176
  specification_version: 4
178
177
  summary: Navigation generator and editor
179
178
  test_files: []
@@ -1,4 +0,0 @@
1
- <%= row.cell :title do |cell| %>
2
- <%= link_to cell.value, menu %>
3
- <% end %>
4
- <%= row.cell :slug %>