motor-admin 0.2.44 → 0.2.50
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/motor/api_config.rb +0 -6
- data/config/locales/en.yml +1 -0
- data/config/locales/es.yml +1 -0
- data/config/locales/pt.yml +1 -0
- data/lib/generators/motor/templates/install_api_configs.rb +8 -2
- data/lib/motor/admin.rb +19 -0
- data/lib/motor/build_schema/defaults.rb +3 -0
- data/lib/motor/build_schema.rb +1 -0
- data/lib/motor/resources.rb +1 -1
- data/lib/motor/version.rb +1 -1
- data/ui/dist/{main-23b7a609795ee39bc4f9.css.gz → main-405235dcc7061ef18101.css.gz} +0 -0
- data/ui/dist/main-405235dcc7061ef18101.js.gz +0 -0
- data/ui/dist/manifest.json +5 -5
- metadata +4 -4
- data/ui/dist/main-23b7a609795ee39bc4f9.js.gz +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 82568bb1425dd8933aac6e4b078f1f78a60a35b70975faff1831de47b15bed2e
|
4
|
+
data.tar.gz: 24a81d7e8dbc48f296dd25ea14dde2c4e098344a4c9c045583d26c2a60f9f93b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0a9c5be33a42752471c5092c8f55378f644351834b698876c54ad72f36d5334cc59fdced63c3b612012db969f728e9e13bb90a92b5baf60d049a5b078698f8a5
|
7
|
+
data.tar.gz: 4ac397d5f06f10076fce6697866770b4ee0e32aac9aa9ad1eb2e71f03b3aedd0badbae5b5f64baba408d545040d11b1291889dced3ade375536b74b42df89f27
|
@@ -2,12 +2,6 @@
|
|
2
2
|
|
3
3
|
module Motor
|
4
4
|
class ApiConfig < ::Motor::ApplicationRecord
|
5
|
-
unless table_exists?
|
6
|
-
puts
|
7
|
-
puts ' => Run `rails g motor:upgrade && rake db:migrate` to perform data migration and enable the latest features'
|
8
|
-
puts
|
9
|
-
end
|
10
|
-
|
11
5
|
encrypts :credentials if defined?(::Motor::EncryptedConfig)
|
12
6
|
|
13
7
|
serialize :credentials, Motor::HashSerializer
|
data/config/locales/en.yml
CHANGED
data/config/locales/es.yml
CHANGED
data/config/locales/pt.yml
CHANGED
@@ -40,13 +40,19 @@ class <%= migration_class_name %> < ActiveRecord::Migration[<%= ActiveRecord::Mi
|
|
40
40
|
|
41
41
|
add_column :motor_forms, :api_config_name, :string
|
42
42
|
|
43
|
+
MotorForm.reset_column_information
|
44
|
+
|
43
45
|
MotorForm.all.each do |form|
|
44
46
|
if form.api_path.starts_with?('http')
|
45
47
|
url = form.api_path[%r{\Ahttps?://[^/]+}]
|
46
48
|
|
47
|
-
form.preferences[:default_values_api_path]
|
49
|
+
if form.preferences[:default_values_api_path].present?
|
50
|
+
form.preferences[:default_values_api_path] =
|
51
|
+
form.preferences[:default_values_api_path].delete_prefix(url).sub(/\A\/?/, '/')
|
52
|
+
end
|
53
|
+
|
48
54
|
form.update!(api_config_name: MotorApiConfig.find_or_create_by!(name: url, url: url).name,
|
49
|
-
api_path: form.api_path.
|
55
|
+
api_path: form.api_path.delete_prefix(url).sub(/\A\/?/, '/'))
|
50
56
|
else
|
51
57
|
form.update!(api_config_name: MotorApiConfig.find_or_create_by!(name: 'origin', url: '/').name)
|
52
58
|
end
|
data/lib/motor/admin.rb
CHANGED
@@ -94,5 +94,24 @@ module Motor
|
|
94
94
|
ActiveStorage::Blob.singleton_class.prepend(Motor::ActiveRecordUtils::ActiveStorageBlobPatch)
|
95
95
|
end
|
96
96
|
end
|
97
|
+
|
98
|
+
initializer 'motor.upgrade' do
|
99
|
+
config.after_initialize do
|
100
|
+
unless Motor::Query.table_exists?
|
101
|
+
puts
|
102
|
+
puts ' => Run `rails g motor:install && rake db:migrate` in order to create Motor Admin configuration tables'
|
103
|
+
puts
|
104
|
+
end
|
105
|
+
|
106
|
+
unless Motor::ApiConfig.table_exists?
|
107
|
+
puts
|
108
|
+
puts ' => Run `rails g motor:upgrade && rake db:migrate`' \
|
109
|
+
' to perform data migration and enable the latest features'
|
110
|
+
puts
|
111
|
+
end
|
112
|
+
rescue ActiveRecord::NoDatabaseError
|
113
|
+
nil
|
114
|
+
end
|
115
|
+
end
|
97
116
|
end
|
98
117
|
end
|
@@ -13,6 +13,7 @@ module Motor
|
|
13
13
|
display_name: I18n.t('motor.create'),
|
14
14
|
action_type: BuildSchema::DEFAULT_TYPE,
|
15
15
|
preferences: {},
|
16
|
+
apply_on: 'collection',
|
16
17
|
visible: true
|
17
18
|
},
|
18
19
|
{
|
@@ -20,6 +21,7 @@ module Motor
|
|
20
21
|
display_name: I18n.t('motor.edit'),
|
21
22
|
action_type: BuildSchema::DEFAULT_TYPE,
|
22
23
|
preferences: {},
|
24
|
+
apply_on: 'member',
|
23
25
|
visible: true
|
24
26
|
},
|
25
27
|
{
|
@@ -27,6 +29,7 @@ module Motor
|
|
27
29
|
display_name: I18n.t('motor.remove'),
|
28
30
|
action_type: BuildSchema::DEFAULT_TYPE,
|
29
31
|
preferences: {},
|
32
|
+
apply_on: 'member',
|
30
33
|
visible: true
|
31
34
|
}
|
32
35
|
].freeze
|
data/lib/motor/build_schema.rb
CHANGED
data/lib/motor/resources.rb
CHANGED
@@ -9,7 +9,7 @@ module Motor
|
|
9
9
|
ASSOCIATION_ATTRS = %w[name display_name model_name icon visible foreign_key primary_key options virtual
|
10
10
|
polymorphic slug].freeze
|
11
11
|
SCOPE_ATTRS = %w[name display_name scope_type preferences visible].freeze
|
12
|
-
ACTION_ATTRS = %w[name display_name action_type preferences visible].freeze
|
12
|
+
ACTION_ATTRS = %w[name display_name action_type preferences apply_on visible].freeze
|
13
13
|
TAB_ATTRS = %w[name display_name tab_type preferences visible].freeze
|
14
14
|
end
|
15
15
|
end
|
data/lib/motor/version.rb
CHANGED
Binary file
|
Binary file
|
data/ui/dist/manifest.json
CHANGED
@@ -2601,9 +2601,9 @@
|
|
2601
2601
|
"icons/zoom-out.svg.gz": "icons/zoom-out.svg.gz",
|
2602
2602
|
"icons/zoom-question.svg": "icons/zoom-question.svg",
|
2603
2603
|
"icons/zoom-question.svg.gz": "icons/zoom-question.svg.gz",
|
2604
|
-
"main-
|
2605
|
-
"main-
|
2606
|
-
"main-
|
2607
|
-
"main.css": "main-
|
2608
|
-
"main.js": "main-
|
2604
|
+
"main-405235dcc7061ef18101.css.gz": "main-405235dcc7061ef18101.css.gz",
|
2605
|
+
"main-405235dcc7061ef18101.js.LICENSE.txt": "main-405235dcc7061ef18101.js.LICENSE.txt",
|
2606
|
+
"main-405235dcc7061ef18101.js.gz": "main-405235dcc7061ef18101.js.gz",
|
2607
|
+
"main.css": "main-405235dcc7061ef18101.css",
|
2608
|
+
"main.js": "main-405235dcc7061ef18101.js"
|
2609
2609
|
}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: motor-admin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.50
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pete Matsyburka
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-01-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord-filter
|
@@ -1532,8 +1532,8 @@ files:
|
|
1532
1532
|
- ui/dist/icons/zoom-money.svg.gz
|
1533
1533
|
- ui/dist/icons/zoom-out.svg.gz
|
1534
1534
|
- ui/dist/icons/zoom-question.svg.gz
|
1535
|
-
- ui/dist/main-
|
1536
|
-
- ui/dist/main-
|
1535
|
+
- ui/dist/main-405235dcc7061ef18101.css.gz
|
1536
|
+
- ui/dist/main-405235dcc7061ef18101.js.gz
|
1537
1537
|
- ui/dist/manifest.json
|
1538
1538
|
homepage:
|
1539
1539
|
licenses:
|
Binary file
|