inline_forms 8.1.45 → 8.1.46

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: e972af3c243b856d22f2d070a2b2499250aee36a480f2a91747748849588c040
4
- data.tar.gz: 154f76c200bb124fb4db651c720e23db9170ee9c0dd9c809256be33d3401526c
3
+ metadata.gz: 01deab33ac621116f150d6b9cb8b8fed5fe2ee6118a53699c383c08751d9c041
4
+ data.tar.gz: 433f57953fa315079be2d5c2c8900885b6010478f360719e8aebd319c025cc90
5
5
  SHA512:
6
- metadata.gz: 1a0a82d1235c438a8e6bc14eab60086b86ced441f6bd8ced137cd9c5a85d76fbf6cf49b60ace8beabac928c223c4128122fbaf159bd9e3847f91d9620b0d9a1f
7
- data.tar.gz: 0f83cf85fb2f8e25109d1e9197222bad148c85f91e074b570082c8605d8f6541d95d304ed5c72c49c9a9d053d76e4abb37e61b8bb2325019cbd1dc1cb6cfc198
6
+ metadata.gz: 3366ebb49776ef4307ab2b64b6eb5b43c6d7f1cf8d2986bf5e5c747b6c67b8e7065bdc40ffa446241a56d8f3bdc845d6f79f49f9cab911e3e952a7d14fdda6e6
7
+ data.tar.gz: f9d4ee91abb242c4ebbf8b13048922cc0da3641c4cf8610b6a48aefeca5071474a605295f4605bce9ce9cbd9d5140434cc8dfa35396e170c636b491fa6f19e32
data/CHANGELOG.md CHANGED
@@ -4,6 +4,16 @@ All notable changes to this project are documented in this file.
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [8.1.46] - 2026-07-24
8
+
9
+ ### Fixed
10
+
11
+ - **Model top bar no longer crashes when `@Klass` is nil.** Bespoke admin pages that render `layouts/inline_forms` from a non-`InlineFormsController` (e.g. a Stats/report controller) now show title-only chrome instead of raising on `new__path` / `link_to_new_record`. The new-record link is guarded with `<% if @Klass %>` as the per-app header did before 8.1.45.
12
+
13
+ ### Lockstep
14
+
15
+ - validation_hints 8.1.46, inline_forms_installer 8.1.46, inline_forms_schema_edit 8.1.46.
16
+
7
17
  ## [8.1.45] - 2026-07-24
8
18
 
9
19
  ### Added
@@ -28,9 +28,11 @@
28
28
  <%= render "inline_forms/generic_search" %>
29
29
  </li>
30
30
  <% end %>
31
- <li>
32
- <%= link_to_new_record(@Klass, "new_#{@Klass.to_s.singularize.underscore}_path", @Klass.to_s.pluralize.downcase + "_list") %>
33
- </li>
31
+ <% if @Klass %>
32
+ <li>
33
+ <%= link_to_new_record(@Klass, "new_#{@Klass.to_s.singularize.underscore}_path", @Klass.to_s.pluralize.downcase + "_list") %>
34
+ </li>
35
+ <% end %>
34
36
  </ul>
35
37
  </div>
36
38
  </nav>
@@ -1,5 +1,5 @@
1
1
  # -*- encoding : utf-8 -*-
2
2
 
3
3
  module InlineForms
4
- VERSION = "8.1.45"
4
+ VERSION = "8.1.46"
5
5
  end
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Bespoke report page: uses the inline_forms admin layout but is not an
4
+ # InlineFormsController, so @Klass is never set (mirrors StProject Stats).
5
+ class StatsController < ApplicationController
6
+ layout "inline_forms"
7
+
8
+ def show
9
+ end
10
+ end
@@ -0,0 +1 @@
1
+ <p id="stats_report">Stats report</p>
@@ -25,6 +25,8 @@ Rails.application.routes.draw do
25
25
  get "list_versions", on: :member
26
26
  end
27
27
 
28
+ get "stats", to: "stats#show"
29
+
28
30
  # Schema-change GUI (opt-in in real installs; routed here for the engine's
29
31
  # fast test suite). One line, so gem upgrades can add routes freely.
30
32
  InlineFormsSchemaEdit.draw_routes(self)
@@ -43,4 +43,14 @@ class ModelTopBarTest < InlineFormsIntegrationTestCase
43
43
  assert_includes response.body, "Alpha"
44
44
  refute_includes response.body, "Beta"
45
45
  end
46
+
47
+ test "non-model page with no @Klass renders title only, no new-record link" do
48
+ get stats_path
49
+
50
+ assert_response :success
51
+ assert_includes response.body, %(id="inline_forms_model_top_bar")
52
+ assert_includes response.body, %(id="stats_report")
53
+ refute_includes response.body, "new_button"
54
+ refute_includes response.body, %(id="input_search")
55
+ end
46
56
  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: 8.1.45
4
+ version: 8.1.46
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ace Suares
@@ -272,6 +272,7 @@ files:
272
272
  - test/dummy/app/controllers/gizmos_controller.rb
273
273
  - test/dummy/app/controllers/machines_controller.rb
274
274
  - test/dummy/app/controllers/parts_controller.rb
275
+ - test/dummy/app/controllers/stats_controller.rb
275
276
  - test/dummy/app/controllers/widgets_controller.rb
276
277
  - test/dummy/app/helpers/application_helper.rb
277
278
  - test/dummy/app/models/application_record.rb
@@ -281,6 +282,7 @@ files:
281
282
  - test/dummy/app/models/part.rb
282
283
  - test/dummy/app/models/widget.rb
283
284
  - test/dummy/app/views/_gizmos_search.html.erb
285
+ - test/dummy/app/views/stats/show.html.erb
284
286
  - test/dummy/config/application.rb
285
287
  - test/dummy/config/database.yml
286
288
  - test/dummy/config/environment.rb
@@ -341,6 +343,7 @@ test_files:
341
343
  - test/dummy/app/controllers/gizmos_controller.rb
342
344
  - test/dummy/app/controllers/machines_controller.rb
343
345
  - test/dummy/app/controllers/parts_controller.rb
346
+ - test/dummy/app/controllers/stats_controller.rb
344
347
  - test/dummy/app/controllers/widgets_controller.rb
345
348
  - test/dummy/app/helpers/application_helper.rb
346
349
  - test/dummy/app/models/application_record.rb
@@ -350,6 +353,7 @@ test_files:
350
353
  - test/dummy/app/models/part.rb
351
354
  - test/dummy/app/models/widget.rb
352
355
  - test/dummy/app/views/_gizmos_search.html.erb
356
+ - test/dummy/app/views/stats/show.html.erb
353
357
  - test/dummy/config/application.rb
354
358
  - test/dummy/config/database.yml
355
359
  - test/dummy/config/environment.rb