motor-admin 0.2.47 → 0.2.51

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7c12ad8020cd49c64760d1e544167c237863738b495b0be60aa070f93191bf8d
4
- data.tar.gz: 0b6386ecef9c7b689c52d67f2ebfc8b87057c0b3373cf0ca6aaed944054ff140
3
+ metadata.gz: 8f96f929aa91537536fb2bf7600c5910fa8c573a8bc39d735a4a1987ed04a8b6
4
+ data.tar.gz: 2ca104e7ea56a378edcd24f56d4d36e98dbd34df54f12df2d26eec1bdee31b91
5
5
  SHA512:
6
- metadata.gz: 408c8d3f7995518d226f91e7db296f32618bf8015a0dd999c3725c5252594822ae3c6b2053f9c54e3c0d07a7564b5c56ecc26a127b045242a4b5697f711fde8c
7
- data.tar.gz: 23358591d492b92bd02f34de7a6ca495f148ee68709af54a5b35ccebc9e4f0bb94226857ed92ce86a4ca4a0070c0c6eecef200d7c198a3fdcf2a767d2d7e49d9
6
+ metadata.gz: 7ded34bfb1ead6be8fbbfdce823cbc5d015bc54c5665b300c5e168ac93bb48e125589a6b5da4d2df6c65c3efb7a6581fa37e7263645e4cac306ffb6657c8dd96
7
+ data.tar.gz: 494738f22d78e71d28d90753ff1e7a72a9dc7e9362e7aa1d037f076506cbe2316e1fc597778a4070059e232a4d9d8b796070318abe9796998a3031711d2cff52
@@ -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
@@ -299,3 +299,5 @@ en:
299
299
  url: URL
300
300
  expand: Expand
301
301
  add_api: Add API
302
+ on_collection: On collection
303
+ association: Association
@@ -299,6 +299,8 @@ es:
299
299
  url: URL
300
300
  expand: Expandir
301
301
  add_api: De API
302
+ on_collection: En la colección
303
+ association: Asociación
302
304
  i:
303
305
  locale: es
304
306
  select:
@@ -295,6 +295,8 @@ pt:
295
295
  url: URL
296
296
  expand: Expandir
297
297
  add_api: De API
298
+ on_collection: Na coleção
299
+ association: Associação
298
300
  i:
299
301
  locale: pt
300
302
  select:
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
@@ -70,6 +70,7 @@ module Motor
70
70
 
71
71
  ACTION_DEFAULTS = {
72
72
  visible: true,
73
+ apply_on: 'member',
73
74
  preferences: {}
74
75
  }.with_indifferent_access
75
76
 
@@ -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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Motor
4
- VERSION = '0.2.47'
4
+ VERSION = '0.2.51'
5
5
  end
@@ -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-23b7a609795ee39bc4f9.css.gz": "main-23b7a609795ee39bc4f9.css.gz",
2605
- "main-23b7a609795ee39bc4f9.js.LICENSE.txt": "main-23b7a609795ee39bc4f9.js.LICENSE.txt",
2606
- "main-23b7a609795ee39bc4f9.js.gz": "main-23b7a609795ee39bc4f9.js.gz",
2607
- "main.css": "main-23b7a609795ee39bc4f9.css",
2608
- "main.js": "main-23b7a609795ee39bc4f9.js"
2604
+ "main-2f07e682c44815a0eb71.css.gz": "main-2f07e682c44815a0eb71.css.gz",
2605
+ "main-2f07e682c44815a0eb71.js.LICENSE.txt": "main-2f07e682c44815a0eb71.js.LICENSE.txt",
2606
+ "main-2f07e682c44815a0eb71.js.gz": "main-2f07e682c44815a0eb71.js.gz",
2607
+ "main.css": "main-2f07e682c44815a0eb71.css",
2608
+ "main.js": "main-2f07e682c44815a0eb71.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.47
4
+ version: 0.2.51
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pete Matsyburka
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-12-29 00:00:00.000000000 Z
11
+ date: 2022-01-06 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-23b7a609795ee39bc4f9.css.gz
1536
- - ui/dist/main-23b7a609795ee39bc4f9.js.gz
1535
+ - ui/dist/main-2f07e682c44815a0eb71.css.gz
1536
+ - ui/dist/main-2f07e682c44815a0eb71.js.gz
1537
1537
  - ui/dist/manifest.json
1538
1538
  homepage:
1539
1539
  licenses: