maglevcms 1.6.0 → 1.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/concerns/maglev/services_concern.rb +6 -2
- data/app/services/maglev/fetch_site.rb +5 -1
- data/lib/generators/maglev/templates/install/config/initializers/maglev.rb +1 -1
- data/lib/maglev/preview_constraint.rb +1 -1
- data/lib/maglev/reserved_paths.rb +13 -0
- data/lib/maglev/version.rb +1 -1
- data/lib/maglev.rb +10 -2
- data/yarn.lock +421 -626
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2a35a72786acd44915a401d53a74083908efa9c65d444095b644c2c90f1fb845
|
4
|
+
data.tar.gz: 9dc69364e99fb0ea74ee46d4c4b838072ea559fa183a624874e1af9bcd4e447f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2b0c05384244019fe6b8e816d1be6361eddbe10a87681c15bf4ea0fe15dffa938cc07520ef03def22a3ea338aa69165c898b10a1667d0583f1338a9ff5c9057b
|
7
|
+
data.tar.gz: c451bc95b1405150fafb5c80c12604263c26a00ce87080adb82f513df99d46dc367956d0a827ca41c59385fbc53340c74ec1de803fd8ceaa32a5182ed083bbb4
|
@@ -16,9 +16,13 @@ module Maglev
|
|
16
16
|
end
|
17
17
|
|
18
18
|
def maglev_services
|
19
|
-
@maglev_services ||= ::Maglev.services(
|
19
|
+
@maglev_services ||= ::Maglev.services(maglev_services_overrides)
|
20
|
+
end
|
21
|
+
|
22
|
+
def maglev_services_overrides
|
23
|
+
{
|
20
24
|
context: build_maglev_service_context
|
21
|
-
|
25
|
+
}
|
22
26
|
end
|
23
27
|
|
24
28
|
def build_maglev_service_context
|
@@ -6,13 +6,17 @@ module Maglev
|
|
6
6
|
include Injectable
|
7
7
|
|
8
8
|
def call
|
9
|
-
|
9
|
+
site.tap do |site|
|
10
10
|
change_default_locales(site)
|
11
11
|
end
|
12
12
|
end
|
13
13
|
|
14
14
|
private
|
15
15
|
|
16
|
+
def site
|
17
|
+
@site ||= Maglev::Site.first
|
18
|
+
end
|
19
|
+
|
16
20
|
def change_default_locales(site)
|
17
21
|
Maglev::I18n.available_locales = site.locale_prefixes
|
18
22
|
end
|
@@ -79,5 +79,5 @@ Maglev.configure do |config|
|
|
79
79
|
|
80
80
|
# Prevent the content editors to create pages sharing the same path with other
|
81
81
|
# existing pages of the application.
|
82
|
-
# config.reserved_paths = %w(products sign-in search)
|
82
|
+
# config.reserved_paths = %w(products sign-in search posts/*)
|
83
83
|
end
|
data/lib/maglev/version.rb
CHANGED
data/lib/maglev.rb
CHANGED
@@ -6,6 +6,7 @@ require_relative 'maglev/config'
|
|
6
6
|
require_relative 'maglev/errors'
|
7
7
|
require_relative 'maglev/i18n'
|
8
8
|
require_relative 'maglev/preview_constraint'
|
9
|
+
require_relative 'maglev/reserved_paths'
|
9
10
|
|
10
11
|
require 'injectable'
|
11
12
|
require 'jbuilder'
|
@@ -20,7 +21,7 @@ module Maglev
|
|
20
21
|
|
21
22
|
# rubocop:disable Metrics/MethodLength, Metrics/AbcSize
|
22
23
|
def config
|
23
|
-
@config ||=
|
24
|
+
@config ||= config_klass.new.tap do |c|
|
24
25
|
c.title = 'Maglev - EDITOR'
|
25
26
|
c.favicon = nil
|
26
27
|
c.logo = nil
|
@@ -43,7 +44,10 @@ module Maglev
|
|
43
44
|
# rubocop:enable Metrics/MethodLength, Metrics/AbcSize
|
44
45
|
|
45
46
|
def configure
|
46
|
-
|
47
|
+
config.tap do
|
48
|
+
yield(config)
|
49
|
+
config.reserved_paths = Maglev::ReservedPaths.new(config.reserved_paths)
|
50
|
+
end
|
47
51
|
end
|
48
52
|
|
49
53
|
def uploader
|
@@ -61,5 +65,9 @@ module Maglev
|
|
61
65
|
config = Rails.configuration.generators
|
62
66
|
@uuid_as_primary_key = config.options[config.orm][:primary_key_type] == :uuid
|
63
67
|
end
|
68
|
+
|
69
|
+
def config_klass
|
70
|
+
::Maglev::Config
|
71
|
+
end
|
64
72
|
end
|
65
73
|
end
|