trusty-cms 8.0 → 8.1.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 +4 -4
- data/Gemfile +2 -2
- data/Gemfile.lock +76 -72
- data/app/helpers/admin/pages_helper.rb +16 -5
- data/config/application.rb +0 -4
- data/lib/trusty_cms/available_locales.rb +1 -1
- data/lib/trusty_cms/setup.rb +1 -1
- data/lib/trusty_cms/task_support.rb +2 -2
- data/lib/trusty_cms/version.rb +1 -1
- data/spec/controllers/admin/pages_controller_spec.rb +21 -16
- data/spec/dummy/config/application.rb +6 -2
- data/spec/helpers/admin/pages_helper_spec.rb +30 -0
- data/spec/spec_helper.rb +3 -3
- data/trusty_cms.gemspec +4 -4
- data/yarn.lock +3 -3
- metadata +24 -12
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: '09a975dbfdff3498fab3bcc60a600da1b0da0a5f0129f0d70df7b9db6bb1b1cc'
|
|
4
|
+
data.tar.gz: f6be37f3b4528ec731cf84640a125b7ef01bc9ab62e075f0f4a2c6a049723fd1
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 023a11dd1d3377191a5f4bdb80490b452a8c789f89a637c90f96163e11a2a5b9f283b59e08cbd7fea89a656fd1523194a2dd85a08e41b757bfbd1e06aca96181
|
|
7
|
+
data.tar.gz: 3f0bd848d25abc30b4dffc21f3d504ff187710bf460e7fd902071f1fe81100a905689f2ad6eacd7135313052ac0d3265d9ee5835a6db10eed4024a2c7db140bb
|
data/Gemfile
CHANGED
|
@@ -19,9 +19,9 @@ group :development, :test do
|
|
|
19
19
|
gem 'factory_bot_rails', '6.5.1'
|
|
20
20
|
gem 'file_validators'
|
|
21
21
|
gem 'jsbundling-rails', '~> 1.3'
|
|
22
|
-
gem 'launchy', '~> 3.
|
|
22
|
+
gem 'launchy', '~> 3.1.1'
|
|
23
23
|
gem 'mysql2'
|
|
24
|
-
gem 'paper_trail', '~>
|
|
24
|
+
gem 'paper_trail', '~> 17.0.0'
|
|
25
25
|
gem 'paper_trail-association_tracking', '~> 2.3.0'
|
|
26
26
|
gem 'poltergeist', '~> 1.18.1'
|
|
27
27
|
gem 'pry-byebug'
|
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
trusty-cms (8.0)
|
|
4
|
+
trusty-cms (8.1.0)
|
|
5
5
|
RedCloth (= 4.3.4)
|
|
6
6
|
activestorage-validator
|
|
7
7
|
acts_as_list (>= 0.9.5, < 1.3.0)
|
|
@@ -15,8 +15,8 @@ PATH
|
|
|
15
15
|
diffy
|
|
16
16
|
drb
|
|
17
17
|
execjs (~> 2.7)
|
|
18
|
-
haml (
|
|
19
|
-
haml-rails (
|
|
18
|
+
haml (>= 6.3, < 7.4)
|
|
19
|
+
haml-rails (>= 2.1, < 4.0)
|
|
20
20
|
highline (>= 1.7.8, < 3.2.0)
|
|
21
21
|
image_processing
|
|
22
22
|
kraken-io
|
|
@@ -24,13 +24,13 @@ PATH
|
|
|
24
24
|
mini_racer
|
|
25
25
|
mutex_m
|
|
26
26
|
mysql2
|
|
27
|
-
paper_trail (~>
|
|
27
|
+
paper_trail (~> 17.0.0)
|
|
28
28
|
paper_trail-association_tracking (>= 2.2.1, < 2.4.0)
|
|
29
29
|
psych (= 5.4.0)
|
|
30
30
|
rack (>= 2.0.1, < 3.2.0)
|
|
31
31
|
rack-cache (~> 1.7)
|
|
32
32
|
radius (~> 0.8)
|
|
33
|
-
rails (~> 8.
|
|
33
|
+
rails (~> 8.1.0)
|
|
34
34
|
rake (< 14.0)
|
|
35
35
|
ransack (~> 4.2.1)
|
|
36
36
|
rdoc (>= 5.1, < 9.0)
|
|
@@ -47,29 +47,31 @@ GEM
|
|
|
47
47
|
remote: https://rubygems.org/
|
|
48
48
|
specs:
|
|
49
49
|
RedCloth (4.3.4)
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
50
|
+
action_text-trix (2.1.19)
|
|
51
|
+
railties
|
|
52
|
+
actioncable (8.1.3.1)
|
|
53
|
+
actionpack (= 8.1.3.1)
|
|
54
|
+
activesupport (= 8.1.3.1)
|
|
53
55
|
nio4r (~> 2.0)
|
|
54
56
|
websocket-driver (>= 0.6.1)
|
|
55
57
|
zeitwerk (~> 2.6)
|
|
56
|
-
actionmailbox (8.
|
|
57
|
-
actionpack (= 8.
|
|
58
|
-
activejob (= 8.
|
|
59
|
-
activerecord (= 8.
|
|
60
|
-
activestorage (= 8.
|
|
61
|
-
activesupport (= 8.
|
|
58
|
+
actionmailbox (8.1.3.1)
|
|
59
|
+
actionpack (= 8.1.3.1)
|
|
60
|
+
activejob (= 8.1.3.1)
|
|
61
|
+
activerecord (= 8.1.3.1)
|
|
62
|
+
activestorage (= 8.1.3.1)
|
|
63
|
+
activesupport (= 8.1.3.1)
|
|
62
64
|
mail (>= 2.8.0)
|
|
63
|
-
actionmailer (8.
|
|
64
|
-
actionpack (= 8.
|
|
65
|
-
actionview (= 8.
|
|
66
|
-
activejob (= 8.
|
|
67
|
-
activesupport (= 8.
|
|
65
|
+
actionmailer (8.1.3.1)
|
|
66
|
+
actionpack (= 8.1.3.1)
|
|
67
|
+
actionview (= 8.1.3.1)
|
|
68
|
+
activejob (= 8.1.3.1)
|
|
69
|
+
activesupport (= 8.1.3.1)
|
|
68
70
|
mail (>= 2.8.0)
|
|
69
71
|
rails-dom-testing (~> 2.2)
|
|
70
|
-
actionpack (8.
|
|
71
|
-
actionview (= 8.
|
|
72
|
-
activesupport (= 8.
|
|
72
|
+
actionpack (8.1.3.1)
|
|
73
|
+
actionview (= 8.1.3.1)
|
|
74
|
+
activesupport (= 8.1.3.1)
|
|
73
75
|
nokogiri (>= 1.8.5)
|
|
74
76
|
rack (>= 2.2.4)
|
|
75
77
|
rack-session (>= 1.0.1)
|
|
@@ -77,44 +79,45 @@ GEM
|
|
|
77
79
|
rails-dom-testing (~> 2.2)
|
|
78
80
|
rails-html-sanitizer (~> 1.6)
|
|
79
81
|
useragent (~> 0.16)
|
|
80
|
-
actiontext (8.
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
82
|
+
actiontext (8.1.3.1)
|
|
83
|
+
action_text-trix (~> 2.1.15)
|
|
84
|
+
actionpack (= 8.1.3.1)
|
|
85
|
+
activerecord (= 8.1.3.1)
|
|
86
|
+
activestorage (= 8.1.3.1)
|
|
87
|
+
activesupport (= 8.1.3.1)
|
|
85
88
|
globalid (>= 0.6.0)
|
|
86
89
|
nokogiri (>= 1.8.5)
|
|
87
|
-
actionview (8.
|
|
88
|
-
activesupport (= 8.
|
|
90
|
+
actionview (8.1.3.1)
|
|
91
|
+
activesupport (= 8.1.3.1)
|
|
89
92
|
builder (~> 3.1)
|
|
90
93
|
erubi (~> 1.11)
|
|
91
94
|
rails-dom-testing (~> 2.2)
|
|
92
95
|
rails-html-sanitizer (~> 1.6)
|
|
93
|
-
activejob (8.
|
|
94
|
-
activesupport (= 8.
|
|
96
|
+
activejob (8.1.3.1)
|
|
97
|
+
activesupport (= 8.1.3.1)
|
|
95
98
|
globalid (>= 0.3.6)
|
|
96
|
-
activemodel (8.
|
|
97
|
-
activesupport (= 8.
|
|
98
|
-
activerecord (8.
|
|
99
|
-
activemodel (= 8.
|
|
100
|
-
activesupport (= 8.
|
|
99
|
+
activemodel (8.1.3.1)
|
|
100
|
+
activesupport (= 8.1.3.1)
|
|
101
|
+
activerecord (8.1.3.1)
|
|
102
|
+
activemodel (= 8.1.3.1)
|
|
103
|
+
activesupport (= 8.1.3.1)
|
|
101
104
|
timeout (>= 0.4.0)
|
|
102
|
-
activestorage (8.
|
|
103
|
-
actionpack (= 8.
|
|
104
|
-
activejob (= 8.
|
|
105
|
-
activerecord (= 8.
|
|
106
|
-
activesupport (= 8.
|
|
105
|
+
activestorage (8.1.3.1)
|
|
106
|
+
actionpack (= 8.1.3.1)
|
|
107
|
+
activejob (= 8.1.3.1)
|
|
108
|
+
activerecord (= 8.1.3.1)
|
|
109
|
+
activesupport (= 8.1.3.1)
|
|
107
110
|
marcel (~> 1.0)
|
|
108
111
|
activestorage-validator (0.8.0)
|
|
109
112
|
rails (>= 7.2.0)
|
|
110
|
-
activesupport (8.
|
|
113
|
+
activesupport (8.1.3.1)
|
|
111
114
|
base64
|
|
112
|
-
benchmark (>= 0.3)
|
|
113
115
|
bigdecimal
|
|
114
116
|
concurrent-ruby (~> 1.0, >= 1.3.1)
|
|
115
117
|
connection_pool (>= 2.2.5)
|
|
116
118
|
drb
|
|
117
119
|
i18n (>= 1.6, < 2)
|
|
120
|
+
json
|
|
118
121
|
logger (>= 1.4.2)
|
|
119
122
|
minitest (>= 5.1)
|
|
120
123
|
securerandom (>= 0.3)
|
|
@@ -129,7 +132,6 @@ GEM
|
|
|
129
132
|
public_suffix (>= 2.0.2, < 8.0)
|
|
130
133
|
base64 (0.3.0)
|
|
131
134
|
bcrypt (3.1.22)
|
|
132
|
-
benchmark (0.5.0)
|
|
133
135
|
bigdecimal (4.1.2)
|
|
134
136
|
builder (3.3.0)
|
|
135
137
|
byebug (13.0.0)
|
|
@@ -180,7 +182,7 @@ GEM
|
|
|
180
182
|
diff-lcs (1.6.2)
|
|
181
183
|
diffy (3.4.4)
|
|
182
184
|
drb (2.2.3)
|
|
183
|
-
erb (6.0.
|
|
185
|
+
erb (6.0.7)
|
|
184
186
|
erubi (1.13.1)
|
|
185
187
|
execjs (2.10.1)
|
|
186
188
|
factory_bot (6.6.0)
|
|
@@ -203,11 +205,12 @@ GEM
|
|
|
203
205
|
mime-types (>= 1.0)
|
|
204
206
|
globalid (1.4.0)
|
|
205
207
|
activesupport (>= 6.1)
|
|
206
|
-
haml (
|
|
208
|
+
haml (7.3.0)
|
|
209
|
+
prism (>= 1.1.0)
|
|
207
210
|
temple (>= 0.8.2)
|
|
208
211
|
thor
|
|
209
212
|
tilt
|
|
210
|
-
haml-rails (
|
|
213
|
+
haml-rails (3.1.0)
|
|
211
214
|
actionpack (>= 5.1)
|
|
212
215
|
activesupport (>= 5.1)
|
|
213
216
|
haml (>= 4.0.6)
|
|
@@ -221,7 +224,7 @@ GEM
|
|
|
221
224
|
i18n (1.15.2)
|
|
222
225
|
concurrent-ruby (~> 1.0)
|
|
223
226
|
image_processing (2.0.2)
|
|
224
|
-
io-console (0.
|
|
227
|
+
io-console (0.9.2)
|
|
225
228
|
irb (1.18.0)
|
|
226
229
|
pp (>= 0.6.0)
|
|
227
230
|
prism (>= 1.3.0)
|
|
@@ -235,9 +238,10 @@ GEM
|
|
|
235
238
|
httparty
|
|
236
239
|
json
|
|
237
240
|
multipart-post
|
|
238
|
-
launchy (3.
|
|
241
|
+
launchy (3.1.1)
|
|
239
242
|
addressable (~> 2.8)
|
|
240
243
|
childprocess (~> 5.0)
|
|
244
|
+
logger (~> 1.6)
|
|
241
245
|
libv8-node (24.12.0.1)
|
|
242
246
|
libv8-node (24.12.0.1-aarch64-linux)
|
|
243
247
|
libv8-node (24.12.0.1-aarch64-linux-musl)
|
|
@@ -307,8 +311,8 @@ GEM
|
|
|
307
311
|
nokogiri (1.19.4-x86_64-linux-musl)
|
|
308
312
|
racc (~> 1.4)
|
|
309
313
|
orm_adapter (0.5.0)
|
|
310
|
-
paper_trail (
|
|
311
|
-
activerecord (>=
|
|
314
|
+
paper_trail (17.0.0)
|
|
315
|
+
activerecord (>= 7.1)
|
|
312
316
|
request_store (~> 1.4)
|
|
313
317
|
paper_trail-association_tracking (2.3.0)
|
|
314
318
|
paper_trail (>= 12.0)
|
|
@@ -343,20 +347,20 @@ GEM
|
|
|
343
347
|
rackup (2.3.1)
|
|
344
348
|
rack (>= 3)
|
|
345
349
|
radius (0.8.0)
|
|
346
|
-
rails (8.
|
|
347
|
-
actioncable (= 8.
|
|
348
|
-
actionmailbox (= 8.
|
|
349
|
-
actionmailer (= 8.
|
|
350
|
-
actionpack (= 8.
|
|
351
|
-
actiontext (= 8.
|
|
352
|
-
actionview (= 8.
|
|
353
|
-
activejob (= 8.
|
|
354
|
-
activemodel (= 8.
|
|
355
|
-
activerecord (= 8.
|
|
356
|
-
activestorage (= 8.
|
|
357
|
-
activesupport (= 8.
|
|
350
|
+
rails (8.1.3.1)
|
|
351
|
+
actioncable (= 8.1.3.1)
|
|
352
|
+
actionmailbox (= 8.1.3.1)
|
|
353
|
+
actionmailer (= 8.1.3.1)
|
|
354
|
+
actionpack (= 8.1.3.1)
|
|
355
|
+
actiontext (= 8.1.3.1)
|
|
356
|
+
actionview (= 8.1.3.1)
|
|
357
|
+
activejob (= 8.1.3.1)
|
|
358
|
+
activemodel (= 8.1.3.1)
|
|
359
|
+
activerecord (= 8.1.3.1)
|
|
360
|
+
activestorage (= 8.1.3.1)
|
|
361
|
+
activesupport (= 8.1.3.1)
|
|
358
362
|
bundler (>= 1.15.0)
|
|
359
|
-
railties (= 8.
|
|
363
|
+
railties (= 8.1.3.1)
|
|
360
364
|
rails-dom-testing (2.3.0)
|
|
361
365
|
activesupport (>= 5.0.0)
|
|
362
366
|
minitest
|
|
@@ -366,9 +370,9 @@ GEM
|
|
|
366
370
|
nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
|
|
367
371
|
rails-observers (0.1.5)
|
|
368
372
|
activemodel (>= 4.0)
|
|
369
|
-
railties (8.
|
|
370
|
-
actionpack (= 8.
|
|
371
|
-
activesupport (= 8.
|
|
373
|
+
railties (8.1.3.1)
|
|
374
|
+
actionpack (= 8.1.3.1)
|
|
375
|
+
activesupport (= 8.1.3.1)
|
|
372
376
|
irb (~> 1.13)
|
|
373
377
|
rackup (>= 1.0.0)
|
|
374
378
|
rake (>= 12.2)
|
|
@@ -380,7 +384,7 @@ GEM
|
|
|
380
384
|
activerecord (>= 6.1.5)
|
|
381
385
|
activesupport (>= 6.1.5)
|
|
382
386
|
i18n
|
|
383
|
-
rbs (4.1.
|
|
387
|
+
rbs (4.1.3)
|
|
384
388
|
logger
|
|
385
389
|
prism (>= 1.6.0)
|
|
386
390
|
tsort
|
|
@@ -390,7 +394,7 @@ GEM
|
|
|
390
394
|
rbs (>= 4.0.0)
|
|
391
395
|
tsort
|
|
392
396
|
regexp_parser (2.12.0)
|
|
393
|
-
reline (0.
|
|
397
|
+
reline (0.7.0)
|
|
394
398
|
io-console (~> 0.5)
|
|
395
399
|
request_store (1.7.0)
|
|
396
400
|
rack (>= 1.4)
|
|
@@ -451,7 +455,7 @@ GEM
|
|
|
451
455
|
ssrf_filter (1.5.0)
|
|
452
456
|
stringex (2.8.6)
|
|
453
457
|
stringio (3.2.0)
|
|
454
|
-
temple (0.10.
|
|
458
|
+
temple (0.10.6)
|
|
455
459
|
thor (1.5.0)
|
|
456
460
|
tilt (2.8.0)
|
|
457
461
|
timeout (0.6.1)
|
|
@@ -495,9 +499,9 @@ DEPENDENCIES
|
|
|
495
499
|
factory_bot_rails (= 6.5.1)
|
|
496
500
|
file_validators
|
|
497
501
|
jsbundling-rails (~> 1.3)
|
|
498
|
-
launchy (~> 3.
|
|
502
|
+
launchy (~> 3.1.1)
|
|
499
503
|
mysql2
|
|
500
|
-
paper_trail (~>
|
|
504
|
+
paper_trail (~> 17.0.0)
|
|
501
505
|
paper_trail-association_tracking (~> 2.3.0)
|
|
502
506
|
poltergeist (~> 1.18.1)
|
|
503
507
|
pry-byebug
|
|
@@ -19,11 +19,22 @@ module Admin::PagesHelper
|
|
|
19
19
|
end
|
|
20
20
|
|
|
21
21
|
def parent_page_options(current_site, page)
|
|
22
|
-
parent_pages =
|
|
23
|
-
parent_pages.
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
parent_pages = Page.parent_pages(current_site.homepage_id).to_a
|
|
23
|
+
parent_pages << page.parent if page.parent && parent_pages.exclude?(page.parent)
|
|
24
|
+
# A page can never be its own parent. For a site's root page this would
|
|
25
|
+
# otherwise set parent_id to itself and create an infinite loop in the tree.
|
|
26
|
+
parent_pages.reject! { |p| p.id == page.id }
|
|
27
|
+
# The root (top) page of a site must have no parent, so give it a blank
|
|
28
|
+
# option. Without one the browser submits the first option on save, which
|
|
29
|
+
# gives the root page a parent and breaks the whole site.
|
|
30
|
+
return options_for_select([[t('select.none'), '']], '') if root_page?(current_site, page)
|
|
31
|
+
|
|
32
|
+
options = parent_pages.map { |p| [p.title, p.id] }
|
|
33
|
+
options_for_select(options, page.parent.id)
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
def root_page?(current_site, page)
|
|
37
|
+
page.id.present? && page.id == current_site.homepage_id
|
|
27
38
|
end
|
|
28
39
|
|
|
29
40
|
def revert_confirmation_message(version)
|
data/config/application.rb
CHANGED
|
@@ -19,10 +19,6 @@ module TrustyCms
|
|
|
19
19
|
include TrustyCms::Initializer
|
|
20
20
|
config.load_defaults 8.0
|
|
21
21
|
|
|
22
|
-
# Rails 8.1 will make `to_time` always preserve the receiver's timezone.
|
|
23
|
-
# Opt in now to silence the deprecation and get the new behavior.
|
|
24
|
-
config.active_support.to_time_preserves_timezone = :zone
|
|
25
|
-
|
|
26
22
|
Rails.autoloaders.log!
|
|
27
23
|
# Enable the asset pipeline
|
|
28
24
|
config.assets.enabled = true
|
|
@@ -5,7 +5,7 @@ module TrustyCms::AvailableLocales
|
|
|
5
5
|
available_locales = {}
|
|
6
6
|
TrustyCms.configuration.i18n.load_path.each do |path|
|
|
7
7
|
if File.exist?(path) && path !~ /_available_tags/
|
|
8
|
-
locale_yaml = YAML.load_file(path)
|
|
8
|
+
locale_yaml = YAML.load_file(path, aliases: true)
|
|
9
9
|
stem = File.basename(path, '.yml')
|
|
10
10
|
if locale_yaml[stem] && lang = locale_yaml[stem]['this_file_language']
|
|
11
11
|
available_locales[lang] = stem
|
data/lib/trusty_cms/setup.rb
CHANGED
|
@@ -3,7 +3,7 @@ module TrustyCms
|
|
|
3
3
|
class << self
|
|
4
4
|
def establish_connection
|
|
5
5
|
unless ActiveRecord::Base.connected?
|
|
6
|
-
connection_hash = YAML.load_file("#{Rails.root}/config/database.yml").to_hash
|
|
6
|
+
connection_hash = YAML.load_file("#{Rails.root}/config/database.yml", aliases: true).to_hash
|
|
7
7
|
env_connection = connection_hash[Rails.env]
|
|
8
8
|
ActiveRecord::Base.establish_connection(env_connection)
|
|
9
9
|
end
|
|
@@ -23,7 +23,7 @@ module TrustyCms
|
|
|
23
23
|
begin
|
|
24
24
|
TrustyCms::Config.transaction do
|
|
25
25
|
TrustyCms::Config.delete_all if clear
|
|
26
|
-
configs = YAML.load(YAML.load_file(path))
|
|
26
|
+
configs = YAML.load(YAML.load_file(path), aliases: true)
|
|
27
27
|
configs.each do |key, value|
|
|
28
28
|
c = TrustyCms::Config.find_or_initialize_by_key(key)
|
|
29
29
|
c.value = value
|
data/lib/trusty_cms/version.rb
CHANGED
|
@@ -116,18 +116,27 @@ RSpec.describe Admin::PagesController, type: :controller do
|
|
|
116
116
|
end
|
|
117
117
|
|
|
118
118
|
describe 'GET #search' do
|
|
119
|
-
|
|
120
|
-
|
|
119
|
+
# The suite-wide stub returns nil, which the real Page.current_site can't do:
|
|
120
|
+
# the multi-site extension defines it as `@current_site ||= Site.default`, and
|
|
121
|
+
# Site.default ends in a catchall it creates. #search is the one action that
|
|
122
|
+
# reads it, so stub it faithfully here and let the fallback actually run.
|
|
123
|
+
let(:site) { create(:site) }
|
|
121
124
|
|
|
122
|
-
|
|
125
|
+
before { allow(Page).to receive(:current_site).and_return(site) }
|
|
126
|
+
|
|
127
|
+
it 'falls back to the current site when no site_id is given' do
|
|
128
|
+
create(:page, title: 'Findable', slug: 'findable', parent: home, site_id: site.id)
|
|
129
|
+
|
|
130
|
+
get :search, params: { search: { query: 'Findable' } }
|
|
123
131
|
|
|
124
132
|
expect(response).to have_http_status(:ok)
|
|
133
|
+
expect(controller.instance_variable_get(:@site_id)).to eq(site.id)
|
|
125
134
|
titles = controller.instance_variable_get(:@pages).map(&:title)
|
|
126
135
|
expect(titles).to include('Findable')
|
|
127
136
|
end
|
|
128
137
|
|
|
129
138
|
it 'does not run a query when none is given' do
|
|
130
|
-
get :search
|
|
139
|
+
get :search
|
|
131
140
|
expect(controller.instance_variable_get(:@pages)).to be_nil
|
|
132
141
|
end
|
|
133
142
|
end
|
|
@@ -142,21 +151,17 @@ RSpec.describe Admin::PagesController, type: :controller do
|
|
|
142
151
|
end
|
|
143
152
|
|
|
144
153
|
describe 'PUT #restore' do
|
|
145
|
-
#
|
|
146
|
-
#
|
|
147
|
-
#
|
|
148
|
-
|
|
149
|
-
# a timestamp in its versioned state raises Psych::DisallowedClass. Page
|
|
150
|
-
# restore is effectively broken until paper_trail's serializer is configured
|
|
151
|
-
# with permitted classes (e.g. via ActiveRecord::Base.yaml_column_permitted_classes
|
|
152
|
-
# or a custom serializer). Characterizing current behavior.
|
|
153
|
-
it 'currently fails to reify a versioned page (Psych safe-load blocker)' do
|
|
154
|
+
# reify YAML-loads the stored version under Psych 4+ safe-load, which needs
|
|
155
|
+
# ActiveSupport::TimeWithZone (and friends) in
|
|
156
|
+
# ActiveRecord.yaml_column_permitted_classes — configured in the dummy app.
|
|
157
|
+
it 'reifies the prior version and redirects to edit' do
|
|
154
158
|
page = create(:page, title: 'V1', parent: home)
|
|
155
159
|
PaperTrail.request(whodunnit: admin.id.to_s) { page.update!(title: 'V2') }
|
|
156
160
|
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
161
|
+
put :restore, params: { id: page.id, version_index: 1 }
|
|
162
|
+
|
|
163
|
+
expect(response).to redirect_to(edit_admin_page_path(page))
|
|
164
|
+
expect(page.reload.title).to eq('V1')
|
|
160
165
|
end
|
|
161
166
|
end
|
|
162
167
|
end
|
|
@@ -41,8 +41,7 @@ module TrustyCms
|
|
|
41
41
|
|
|
42
42
|
config.encoding = 'utf-8'
|
|
43
43
|
config.time_zone = 'UTC'
|
|
44
|
-
|
|
45
|
-
config.active_support.to_time_preserves_timezone = :zone
|
|
44
|
+
|
|
46
45
|
# Skip frameworks you're not going to use (only works if using vendor/rails).
|
|
47
46
|
# To use Rails without a database, you must remove the Active Record framework
|
|
48
47
|
# config.frameworks -= [ :action_mailer ]
|
|
@@ -121,6 +120,11 @@ module TrustyCms
|
|
|
121
120
|
end
|
|
122
121
|
end
|
|
123
122
|
|
|
123
|
+
config.active_record.yaml_column_permitted_classes = [
|
|
124
|
+
Symbol, Date, Time, ActiveSupport::TimeWithZone, ActiveSupport::TimeZone,
|
|
125
|
+
ActiveSupport::HashWithIndifferentAccess, BigDecimal
|
|
126
|
+
]
|
|
127
|
+
|
|
124
128
|
config.to_prepare do
|
|
125
129
|
extension_loader.deactivate_extensions
|
|
126
130
|
extension_loader.load_extensions
|
|
@@ -72,6 +72,36 @@ describe Admin::PagesHelper, type: :helper do
|
|
|
72
72
|
expect(html).to include('Home')
|
|
73
73
|
expect(html).to include("value=\"#{home.id}\"")
|
|
74
74
|
end
|
|
75
|
+
|
|
76
|
+
it 'offers a blank parent option for the site root page' do
|
|
77
|
+
home = FactoryBot.create(:home, title: 'Home')
|
|
78
|
+
current_site = double('Site', homepage_id: home.id)
|
|
79
|
+
allow(Page).to receive(:parent_pages).with(home.id).and_return([home])
|
|
80
|
+
|
|
81
|
+
html = helper.parent_page_options(current_site, home)
|
|
82
|
+
expect(html).to include('<option selected="selected" value=""><none></option>')
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
it 'never lists the root page as a candidate for its own parent' do
|
|
86
|
+
home = FactoryBot.create(:home, title: 'Home')
|
|
87
|
+
current_site = double('Site', homepage_id: home.id)
|
|
88
|
+
allow(Page).to receive(:parent_pages).with(home.id).and_return([home])
|
|
89
|
+
|
|
90
|
+
html = helper.parent_page_options(current_site, home)
|
|
91
|
+
|
|
92
|
+
expect(html).not_to include("value=\"#{home.id}\"")
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
it 'does not offer a blank parent option for non-root pages' do
|
|
96
|
+
home = FactoryBot.create(:home, title: 'Home')
|
|
97
|
+
child = FactoryBot.create(:page, title: 'Child', slug: 'child', parent: home)
|
|
98
|
+
current_site = double('Site', homepage_id: home.id)
|
|
99
|
+
allow(Page).to receive(:parent_pages).with(home.id).and_return([home])
|
|
100
|
+
|
|
101
|
+
html = helper.parent_page_options(current_site, child)
|
|
102
|
+
|
|
103
|
+
expect(html).not_to include('<option value="">')
|
|
104
|
+
end
|
|
75
105
|
end
|
|
76
106
|
|
|
77
107
|
describe '#revert_confirmation_message' do
|
data/spec/spec_helper.rb
CHANGED
|
@@ -13,9 +13,9 @@ SimpleCov::Formatter::LcovFormatter.config do |config|
|
|
|
13
13
|
end
|
|
14
14
|
|
|
15
15
|
SimpleCov.configure do
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
skip %r{^/lib/generators/}
|
|
17
|
+
skip 'lib/trusty_cms/setup.rb'
|
|
18
|
+
skip %r{/templates/} # generated-app boilerplate
|
|
19
19
|
end
|
|
20
20
|
|
|
21
21
|
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new([
|
data/trusty_cms.gemspec
CHANGED
|
@@ -37,8 +37,8 @@ a general purpose content management system--not merely a blogging engine.'
|
|
|
37
37
|
s.add_dependency 'diffy'
|
|
38
38
|
s.add_dependency 'drb'
|
|
39
39
|
s.add_dependency 'execjs', '~> 2.7'
|
|
40
|
-
s.add_dependency 'haml', '
|
|
41
|
-
s.add_dependency 'haml-rails', '
|
|
40
|
+
s.add_dependency 'haml', '>= 6.3', '< 7.4'
|
|
41
|
+
s.add_dependency 'haml-rails', '>= 2.1', '< 4.0'
|
|
42
42
|
s.add_dependency 'highline', '>= 1.7.8', '< 3.2.0'
|
|
43
43
|
s.add_dependency 'image_processing'
|
|
44
44
|
s.add_dependency 'kraken-io'
|
|
@@ -46,13 +46,13 @@ a general purpose content management system--not merely a blogging engine.'
|
|
|
46
46
|
s.add_dependency 'mini_racer'
|
|
47
47
|
s.add_dependency 'mutex_m'
|
|
48
48
|
s.add_dependency 'mysql2'
|
|
49
|
-
s.add_dependency 'paper_trail', '~>
|
|
49
|
+
s.add_dependency 'paper_trail', '~> 17.0.0'
|
|
50
50
|
s.add_dependency 'paper_trail-association_tracking', '>= 2.2.1', '< 2.4.0'
|
|
51
51
|
s.add_dependency 'psych', '5.4.0'
|
|
52
52
|
s.add_dependency 'rack', '>= 2.0.1', '< 3.2.0'
|
|
53
53
|
s.add_dependency 'rack-cache', '~> 1.7'
|
|
54
54
|
s.add_dependency 'radius', '~> 0.8'
|
|
55
|
-
s.add_dependency 'rails', '~> 8.
|
|
55
|
+
s.add_dependency 'rails', '~> 8.1.0'
|
|
56
56
|
s.add_dependency 'rake', '< 14.0'
|
|
57
57
|
s.add_dependency 'ransack', '~> 4.2.1'
|
|
58
58
|
s.add_dependency 'rdoc', '>= 5.1', '< 9.0'
|
data/yarn.lock
CHANGED
|
@@ -1671,9 +1671,9 @@ fast-glob@^3.2.5, fast-glob@^3.2.9:
|
|
|
1671
1671
|
micromatch "^4.0.8"
|
|
1672
1672
|
|
|
1673
1673
|
fast-uri@^3.0.1:
|
|
1674
|
-
version "3.1.
|
|
1675
|
-
resolved "https://registry.yarnpkg.com/fast-uri/-/fast-uri-3.1.
|
|
1676
|
-
integrity sha512-
|
|
1674
|
+
version "3.1.5"
|
|
1675
|
+
resolved "https://registry.yarnpkg.com/fast-uri/-/fast-uri-3.1.5.tgz#610f37419a030270430cecd68d74e3d4d96725d0"
|
|
1676
|
+
integrity sha512-gHwA1O9LDIcKunMKhObS/HimwtehO1nPUECKAu5TpKgaO19fcWEl4bliWe1jWxVFvIXztJjjQ4L8XQ1EU9f7Jw==
|
|
1677
1677
|
|
|
1678
1678
|
fastest-levenshtein@^1.0.12:
|
|
1679
1679
|
version "1.0.16"
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: trusty-cms
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 8.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- TrustyCms CMS dev team
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-09-16 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activestorage-validator
|
|
@@ -194,30 +194,42 @@ dependencies:
|
|
|
194
194
|
name: haml
|
|
195
195
|
requirement: !ruby/object:Gem::Requirement
|
|
196
196
|
requirements:
|
|
197
|
-
- - "
|
|
197
|
+
- - ">="
|
|
198
|
+
- !ruby/object:Gem::Version
|
|
199
|
+
version: '6.3'
|
|
200
|
+
- - "<"
|
|
198
201
|
- !ruby/object:Gem::Version
|
|
199
|
-
version:
|
|
202
|
+
version: '7.4'
|
|
200
203
|
type: :runtime
|
|
201
204
|
prerelease: false
|
|
202
205
|
version_requirements: !ruby/object:Gem::Requirement
|
|
203
206
|
requirements:
|
|
204
|
-
- - "
|
|
207
|
+
- - ">="
|
|
208
|
+
- !ruby/object:Gem::Version
|
|
209
|
+
version: '6.3'
|
|
210
|
+
- - "<"
|
|
205
211
|
- !ruby/object:Gem::Version
|
|
206
|
-
version:
|
|
212
|
+
version: '7.4'
|
|
207
213
|
- !ruby/object:Gem::Dependency
|
|
208
214
|
name: haml-rails
|
|
209
215
|
requirement: !ruby/object:Gem::Requirement
|
|
210
216
|
requirements:
|
|
211
|
-
- - "
|
|
217
|
+
- - ">="
|
|
212
218
|
- !ruby/object:Gem::Version
|
|
213
219
|
version: '2.1'
|
|
220
|
+
- - "<"
|
|
221
|
+
- !ruby/object:Gem::Version
|
|
222
|
+
version: '4.0'
|
|
214
223
|
type: :runtime
|
|
215
224
|
prerelease: false
|
|
216
225
|
version_requirements: !ruby/object:Gem::Requirement
|
|
217
226
|
requirements:
|
|
218
|
-
- - "
|
|
227
|
+
- - ">="
|
|
219
228
|
- !ruby/object:Gem::Version
|
|
220
229
|
version: '2.1'
|
|
230
|
+
- - "<"
|
|
231
|
+
- !ruby/object:Gem::Version
|
|
232
|
+
version: '4.0'
|
|
221
233
|
- !ruby/object:Gem::Dependency
|
|
222
234
|
name: highline
|
|
223
235
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -328,14 +340,14 @@ dependencies:
|
|
|
328
340
|
requirements:
|
|
329
341
|
- - "~>"
|
|
330
342
|
- !ruby/object:Gem::Version
|
|
331
|
-
version:
|
|
343
|
+
version: 17.0.0
|
|
332
344
|
type: :runtime
|
|
333
345
|
prerelease: false
|
|
334
346
|
version_requirements: !ruby/object:Gem::Requirement
|
|
335
347
|
requirements:
|
|
336
348
|
- - "~>"
|
|
337
349
|
- !ruby/object:Gem::Version
|
|
338
|
-
version:
|
|
350
|
+
version: 17.0.0
|
|
339
351
|
- !ruby/object:Gem::Dependency
|
|
340
352
|
name: paper_trail-association_tracking
|
|
341
353
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -424,14 +436,14 @@ dependencies:
|
|
|
424
436
|
requirements:
|
|
425
437
|
- - "~>"
|
|
426
438
|
- !ruby/object:Gem::Version
|
|
427
|
-
version: 8.
|
|
439
|
+
version: 8.1.0
|
|
428
440
|
type: :runtime
|
|
429
441
|
prerelease: false
|
|
430
442
|
version_requirements: !ruby/object:Gem::Requirement
|
|
431
443
|
requirements:
|
|
432
444
|
- - "~>"
|
|
433
445
|
- !ruby/object:Gem::Version
|
|
434
|
-
version: 8.
|
|
446
|
+
version: 8.1.0
|
|
435
447
|
- !ruby/object:Gem::Dependency
|
|
436
448
|
name: rake
|
|
437
449
|
requirement: !ruby/object:Gem::Requirement
|