maglevcms 1.7.2 → 1.7.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.yarn/install-state.gz +0 -0
- data/app/controllers/maglev/api_controller.rb +2 -0
- data/app/frontend/editor/services/__tests__/section.spec.js +1 -0
- data/app/frontend/editor/services/section.js +1 -1
- data/app/frontend/editor/services/theme.js +1 -1
- data/app/frontend/editor/spec/__mocks__/services.js +1 -1
- data/app/frontend/editor/store/getters.js +2 -1
- data/app/frontend/editor/store/index.js +1 -1
- data/app/models/maglev/setting_types/link.rb +1 -1
- data/app/services/maglev/get_page_sections.rb +19 -2
- data/lib/maglev/version.rb +1 -1
- data/package.json +3 -3
- data/yarn.lock +23 -12
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7a5b69c183e753d7c6e87e9904d992bbe039901a35d5b0c2cc2c779bb1546469
|
4
|
+
data.tar.gz: '09c9e5973720db3a1038855d0e0e9417f8f9f5d678a7c89651941aa08afff560'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c56abbaa2a811d82eeb9894de80a708f640f8c38689c06ffac91a4eb806484f42dfa28123daab5d5651bbc86ab934f68525f00763a339f2395030ae2454311e2
|
7
|
+
data.tar.gz: b08119217e120672a3da43bd56aab08399940521f0052bffe25407e4b7a99eb17fe6b23d2aac72767b02785566acd8105728c7ef21fe5cc2b6aae74a7f94e2ef
|
data/.yarn/install-state.gz
CHANGED
Binary file
|
@@ -14,6 +14,8 @@ module Maglev
|
|
14
14
|
rescue_from ActiveRecord::RecordInvalid, with: :record_errors
|
15
15
|
rescue_from ActiveRecord::RecordNotFound, with: :not_found
|
16
16
|
rescue_from ActiveRecord::StaleObjectError, with: :stale_record
|
17
|
+
rescue_from Maglev::Errors::UnknownSection, with: :exception_message
|
18
|
+
rescue_from Maglev::Errors::UnknownSetting, with: :exception_message
|
17
19
|
rescue_from Maglev::Errors::NotAuthorized, with: :unauthorized
|
18
20
|
|
19
21
|
helper_method :maglev_site, :maglev_theme
|
@@ -33,6 +33,7 @@ export default (services) => ({
|
|
33
33
|
sections,
|
34
34
|
blocks: sectionBlocks,
|
35
35
|
})
|
36
|
+
|
36
37
|
const siteSections = pageContent.sections.filter(
|
37
38
|
(sectionContent) => getSectiondefinition(sectionContent).siteScoped,
|
38
39
|
)
|
@@ -58,7 +59,7 @@ export default (services) => ({
|
|
58
59
|
({ theme }) =>
|
59
60
|
(sectionContent) => {
|
60
61
|
return theme.sections.find(
|
61
|
-
(definition) => definition['id'] === sectionContent['type']
|
62
|
+
(definition) => definition['id'] === sectionContent['type']
|
62
63
|
)
|
63
64
|
},
|
64
65
|
sectionSettings:
|
@@ -19,8 +19,8 @@ const store = new Vuex.Store({
|
|
19
19
|
|
20
20
|
store.dispatch('fetchEditorSettings')
|
21
21
|
store.dispatch('fetchSite', true)
|
22
|
-
store.dispatch('setPage', window.page)
|
23
22
|
store.dispatch('setTheme', window.theme)
|
23
|
+
store.dispatch('setPage', window.page)
|
24
24
|
store.dispatch('setLocale', window.locale)
|
25
25
|
|
26
26
|
if (store.state.editorSettings.sitePublishable)
|
@@ -6,7 +6,7 @@ class Maglev::SettingTypes::Link < Maglev::SettingTypes::Base
|
|
6
6
|
if value.is_a?(String)
|
7
7
|
{ text: 'Link', link_type: 'url', href: value }
|
8
8
|
else
|
9
|
-
{ text: 'Link', link_type: 'url', href: '#' }.merge(value)
|
9
|
+
{ text: 'Link', link_type: 'url', href: '#' }.merge(value.symbolize_keys)
|
10
10
|
end
|
11
11
|
end
|
12
12
|
end
|
@@ -23,7 +23,7 @@ module Maglev
|
|
23
23
|
def call
|
24
24
|
(page_sections || page.sections || []).map do |section|
|
25
25
|
transform_section(section.dup)
|
26
|
-
end
|
26
|
+
end.compact
|
27
27
|
end
|
28
28
|
|
29
29
|
protected
|
@@ -39,7 +39,7 @@ module Maglev
|
|
39
39
|
def transform_section(section)
|
40
40
|
definition = theme.sections.find(section['type'])
|
41
41
|
|
42
|
-
|
42
|
+
raise_unknown_section_error(section['type']) unless definition
|
43
43
|
|
44
44
|
transform_if_site_scoped(section, definition)
|
45
45
|
transform_section_blocks(section['blocks'], definition)
|
@@ -76,8 +76,11 @@ module Maglev
|
|
76
76
|
end
|
77
77
|
|
78
78
|
def transform_section_settings(section, definition)
|
79
|
+
remove_unused_settings(section, definition)
|
80
|
+
|
79
81
|
definition.settings.each do |setting|
|
80
82
|
section_setting = find_section_setting(section, setting.id)
|
83
|
+
|
81
84
|
next unless section_setting
|
82
85
|
|
83
86
|
transform_content_setting(section_setting, setting)
|
@@ -95,9 +98,23 @@ module Maglev
|
|
95
98
|
end
|
96
99
|
end
|
97
100
|
|
101
|
+
def remove_unused_settings(section, definition)
|
102
|
+
section['settings'].select! do |setting|
|
103
|
+
definition.settings.any? do |definition_setting|
|
104
|
+
definition_setting.id == setting['id']
|
105
|
+
end
|
106
|
+
end
|
107
|
+
end
|
108
|
+
|
98
109
|
def find_section_setting(section, setting_id)
|
99
110
|
# NOTE: works for both sections and blocks
|
100
111
|
section['settings'].find { |setting| setting['id'] == setting_id }
|
101
112
|
end
|
113
|
+
|
114
|
+
def raise_unknown_section_error(type)
|
115
|
+
raise ::Maglev::Errors::UnknownSection, "Unknown Maglev section type (#{type})" unless Rails.env.production?
|
116
|
+
|
117
|
+
Rails.logger.warn "[#{theme.id}] unknown Maglev section type (#{type})"
|
118
|
+
end
|
102
119
|
end
|
103
120
|
end
|
data/lib/maglev/version.rb
CHANGED
data/package.json
CHANGED
@@ -37,8 +37,8 @@
|
|
37
37
|
"prettier": "^3.1.0",
|
38
38
|
"sass": "^1.69.5",
|
39
39
|
"tailwindcss": "^3.4.1",
|
40
|
-
"vite": "^5.
|
41
|
-
"vite-plugin-ruby": "^5.
|
40
|
+
"vite": "^5.4.5",
|
41
|
+
"vite-plugin-ruby": "^5.1.0",
|
42
42
|
"vite-plugin-vue2-svg": "^0.4.0",
|
43
43
|
"vitest": "^0.34.6",
|
44
44
|
"vue-template-compiler": "^2.7.16"
|
@@ -52,7 +52,7 @@
|
|
52
52
|
"minimist": "^1.2.6",
|
53
53
|
"eventsource": "^1.1.1",
|
54
54
|
"async": "^2.6.4",
|
55
|
-
"vite": "^5.
|
55
|
+
"vite": "^5.4.5"
|
56
56
|
},
|
57
57
|
"packageManager": "yarn@4.4.0"
|
58
58
|
}
|
data/yarn.lock
CHANGED
@@ -2570,8 +2570,8 @@ __metadata:
|
|
2570
2570
|
tiptap-extensions: "npm:^1.34.0"
|
2571
2571
|
turbolinks: "npm:^5.2.0"
|
2572
2572
|
v-tooltip: "npm:^2.1.3"
|
2573
|
-
vite: "npm:^5.
|
2574
|
-
vite-plugin-ruby: "npm:^5.
|
2573
|
+
vite: "npm:^5.4.5"
|
2574
|
+
vite-plugin-ruby: "npm:^5.1.0"
|
2575
2575
|
vite-plugin-vue2-svg: "npm:^0.4.0"
|
2576
2576
|
vitest: "npm:^0.34.6"
|
2577
2577
|
vue: "npm:^2.7.15"
|
@@ -3235,7 +3235,7 @@ __metadata:
|
|
3235
3235
|
languageName: node
|
3236
3236
|
linkType: hard
|
3237
3237
|
|
3238
|
-
"postcss@npm:^8.4.14, postcss@npm:^8.4.23, postcss@npm:^8.4.40
|
3238
|
+
"postcss@npm:^8.4.14, postcss@npm:^8.4.23, postcss@npm:^8.4.40":
|
3239
3239
|
version: 8.4.41
|
3240
3240
|
resolution: "postcss@npm:8.4.41"
|
3241
3241
|
dependencies:
|
@@ -3246,6 +3246,17 @@ __metadata:
|
|
3246
3246
|
languageName: node
|
3247
3247
|
linkType: hard
|
3248
3248
|
|
3249
|
+
"postcss@npm:^8.4.43":
|
3250
|
+
version: 8.4.45
|
3251
|
+
resolution: "postcss@npm:8.4.45"
|
3252
|
+
dependencies:
|
3253
|
+
nanoid: "npm:^3.3.7"
|
3254
|
+
picocolors: "npm:^1.0.1"
|
3255
|
+
source-map-js: "npm:^1.2.0"
|
3256
|
+
checksum: 10c0/ad6f8b9b1157d678560373696109745ab97a947d449f8a997acac41c7f1e4c0f3ca4b092d6df1387f430f2c9a319987b1780dbdc27e35800a88cde9b606c1e8f
|
3257
|
+
languageName: node
|
3258
|
+
linkType: hard
|
3259
|
+
|
3249
3260
|
"prelude-ls@npm:^1.2.1":
|
3250
3261
|
version: 1.2.1
|
3251
3262
|
resolution: "prelude-ls@npm:1.2.1"
|
@@ -4320,15 +4331,15 @@ __metadata:
|
|
4320
4331
|
languageName: node
|
4321
4332
|
linkType: hard
|
4322
4333
|
|
4323
|
-
"vite-plugin-ruby@npm:^5.
|
4324
|
-
version: 5.
|
4325
|
-
resolution: "vite-plugin-ruby@npm:5.
|
4334
|
+
"vite-plugin-ruby@npm:^5.1.0":
|
4335
|
+
version: 5.1.0
|
4336
|
+
resolution: "vite-plugin-ruby@npm:5.1.0"
|
4326
4337
|
dependencies:
|
4327
4338
|
debug: "npm:^4.3.4"
|
4328
4339
|
fast-glob: "npm:^3.3.2"
|
4329
4340
|
peerDependencies:
|
4330
4341
|
vite: ">=5.0.0"
|
4331
|
-
checksum: 10c0/
|
4342
|
+
checksum: 10c0/4c4b3193ee506a5054adbf9c08d38519b04522f88603f80c7822d2073b53bf1e3f3a3ec9459b76cb613b4eafce0991baa781fdeb297ea4acb68a7c1e2eeea0de
|
4332
4343
|
languageName: node
|
4333
4344
|
linkType: hard
|
4334
4345
|
|
@@ -4344,13 +4355,13 @@ __metadata:
|
|
4344
4355
|
languageName: node
|
4345
4356
|
linkType: hard
|
4346
4357
|
|
4347
|
-
"vite@npm:^5.
|
4348
|
-
version: 5.4.
|
4349
|
-
resolution: "vite@npm:5.4.
|
4358
|
+
"vite@npm:^5.4.5":
|
4359
|
+
version: 5.4.5
|
4360
|
+
resolution: "vite@npm:5.4.5"
|
4350
4361
|
dependencies:
|
4351
4362
|
esbuild: "npm:^0.21.3"
|
4352
4363
|
fsevents: "npm:~2.3.3"
|
4353
|
-
postcss: "npm:^8.4.
|
4364
|
+
postcss: "npm:^8.4.43"
|
4354
4365
|
rollup: "npm:^4.20.0"
|
4355
4366
|
peerDependencies:
|
4356
4367
|
"@types/node": ^18.0.0 || >=20.0.0
|
@@ -4383,7 +4394,7 @@ __metadata:
|
|
4383
4394
|
optional: true
|
4384
4395
|
bin:
|
4385
4396
|
vite: bin/vite.js
|
4386
|
-
checksum: 10c0/
|
4397
|
+
checksum: 10c0/89c6459452fc238cdf8e99681b30996af171c9c557af476f96408a18a639fb5a0a6ee2d2257e005b21dc284edceb604595c34920cd4a007ad18f7ebafb654c76
|
4387
4398
|
languageName: node
|
4388
4399
|
linkType: hard
|
4389
4400
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: maglevcms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.7.
|
4
|
+
version: 1.7.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Didier Lafforgue
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-09-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jbuilder
|