motor-admin 0.4.6 → 0.4.8

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: 84e7e23b0861f5ec93e07aac64e0ce3a3dbdc5c4f3e99594b5e43c337865dccd
4
- data.tar.gz: 578e34d82e6fe3ebb770917701cfdbcc5378446dfb0e731cedabafb6c69a384c
3
+ metadata.gz: eb74b992dde31247e56dcc35bee9224c3cba25200323faf4db0b02410cbf437d
4
+ data.tar.gz: 9733123c5b466032c9f6b26cfb18a35c1d3fd06fc0f76a0c7944bb3be16b6f4a
5
5
  SHA512:
6
- metadata.gz: 3216d3ff78046f3c32b8d3eb6a58be101d7fde2b5b3625a04c4677da404ecc53d8024ff36841f59b53c3ccad6898a7f366c4b95a42be9eeb8b324cc379d2543d
7
- data.tar.gz: 57ae307c7c831101a6a363c657f709b963fff4e2f97cc83867d7ec6b4b56c3393e3e52bf6a873562af541abceb8575fbe4f47b5273fcb7aae35c887b604547f9
6
+ metadata.gz: ac85f4cebdb8d749e3c8d6c44b0210bf3854f6d7ba3d8d44b9d5666634a4d2c5c6a364cc8f17fd9292e2e18ae8dc896db1094cdfa9031e2bd4253e55d1efac75
7
+ data.tar.gz: 817d1d53dd185c83e2c3bd5bb19a2d5593b2bc6a88951346226c5504091638548fa6d88062bd37508b044e43d93d99e3db8905362612ebe4197efe66d5d7b0b8
@@ -4,6 +4,8 @@ module Motor
4
4
  module LoadAndAuthorizeDynamicResource
5
5
  extend ActiveSupport::Concern
6
6
 
7
+ MUTEX = Mutex.new
8
+
7
9
  INSTANCE_VARIABLE_NAME = 'resource'
8
10
  ASSOCIATION_INSTANCE_VARIABLE_NAME = 'associated_resource'
9
11
 
@@ -13,11 +15,12 @@ module Motor
13
15
  end
14
16
 
15
17
  def resource_class
16
- @resource_class ||=
18
+ @resource_class ||= MUTEX.synchronize do
17
19
  Motor::Resources::FetchConfiguredModel.call(
18
20
  Motor::BuildSchema::Utils.classify_slug(resource_name_prefix + params[:resource]),
19
21
  cache_key: Motor::Resource.maximum(:updated_at)
20
22
  )
23
+ end
21
24
  end
22
25
 
23
26
  def resource_name_prefix
@@ -29,7 +29,6 @@ el:
29
29
  all: Όλα
30
30
  all_resources: Όλοι οι πόροι
31
31
  and: Και
32
- api: API
33
32
  api_path: Διαδρομή API
34
33
  api_request: Αίτημα API
35
34
  apply: Εφαρμογή
@@ -317,8 +316,6 @@ el:
317
316
  updated: ενημερωμένο
318
317
  created: δημιουργήθηκε
319
318
  deleted: διαγράφηκε
320
- sign_out: Αποσυνδεθείτε
321
- user_dropdown: Χρήστης dropdown
322
319
  add_condition: Προσθήκη συνθήκης
323
320
  remove_condition: Αφαίρεση συνθήκης
324
321
  unable_to_send_alert: Αδυναμία αποστολής ειδοποίησης
@@ -29,7 +29,6 @@ en:
29
29
  all: All
30
30
  all_resources: All Resources
31
31
  and: And
32
- api: API
33
32
  api_path: API path
34
33
  api_request: API request
35
34
  apply: Apply
@@ -266,14 +265,6 @@ en:
266
265
  video: Video
267
266
  display_column: Display column
268
267
  not_authorized_to_perform_action: You are not authorized to perform this action.
269
- download: Download
270
- alert: Alert
271
- downloading: Downloading
272
- display_id: Display ID
273
- display_settings: Display settings
274
- sign_out: Sign out
275
- header: Header
276
- user_dropdown: User dropdown
277
268
  upload: Upload
278
269
  there_is_nothing_here_yet: There is nothing here yet 🤷‍♂️
279
270
  is_null: Is null
@@ -315,20 +315,11 @@ es:
315
315
  updated: updated
316
316
  created: created
317
317
  deleted: deleted
318
- sign_out: Sign out
319
- header: Header
320
- user_dropdown: User dropdown
321
318
  add_condition: Add Condition
322
319
  remove_condition: Remove Condition
323
320
  unable_to_send_alert: Unable to send alert
324
321
  send_via: Send via
325
- download: Descargar
326
- alert: Alerta
327
- downloading: Descargando
328
- display_id: Visualizar ID
329
- display_settings: Configuración de la pantalla
330
322
  sql: SQL
331
- api: API
332
323
  variable_name: Nombre de la variable
333
324
  add_variable: Añadir variable
334
325
  notes: Notes
@@ -311,20 +311,11 @@ pt:
311
311
  updated: updated
312
312
  created: created
313
313
  deleted: deleted
314
- sign_out: Sign out
315
- header: Header
316
- user_dropdown: User dropdown
317
314
  add_condition: Add Condition
318
315
  remove_condition: Remove Condition
319
316
  unable_to_send_alert: Unable to send alert
320
317
  send_via: Send via
321
- download: Descarregar
322
- alert: Alerta
323
- downloading: Descarregamento
324
- display_id: Mostrar ID
325
- display_settings: Definições de visualização
326
318
  sql: SQL
327
- api: API
328
319
  variable_name: Nome da variável
329
320
  add_variable: Adicionar variável
330
321
  notes: Notes
data/lib/motor/admin.rb CHANGED
@@ -4,7 +4,7 @@ module Motor
4
4
  class Admin < ::Rails::Engine
5
5
  config.custom_html = ''
6
6
 
7
- unless Motor.development?
7
+ if !Motor.development? && !Rails.env.production?
8
8
  config.eager_load_paths.delete(File.expand_path('../../app/controllers', __dir__))
9
9
  config.eager_load_paths.delete(File.expand_path('../../app/controllers/concerns', __dir__))
10
10
  config.eager_load_paths.delete(File.expand_path('../../app/models', __dir__))
@@ -30,7 +30,9 @@ module Motor
30
30
  arel_table = model.arel_table
31
31
 
32
32
  column_names.map do |name|
33
- column_type = model.columns_hash[name].type
33
+ column_type = model.columns_hash[name]&.type
34
+
35
+ next unless column_type
34
36
 
35
37
  if STRING_COLUMN_TYPES.include?(column_type)
36
38
  arel_table[name].matches("%#{keyword}%")
@@ -13,7 +13,7 @@ module Motor
13
13
  configs = Motor::Configs::LoadFromCache.load_resources(cache_key: cache_key)
14
14
 
15
15
  return model if model.name == 'ActiveStorage::Attachment'
16
- return model if configs.blank? || sti_model?(model)
16
+ return model if sti_model?(model)
17
17
 
18
18
  maybe_fetch_from_cache(
19
19
  model,
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.4.6'
4
+ VERSION = '0.4.8'
5
5
  end
@@ -3964,9 +3964,9 @@
3964
3964
  "images/layers-2x.png": "images/layers-2x.png",
3965
3965
  "images/layers.png": "images/layers.png",
3966
3966
  "images/marker-icon.png": "images/marker-icon.png",
3967
- "main-947a9a9c3b6ed918c60d.css.gz": "main-947a9a9c3b6ed918c60d.css.gz",
3968
- "main-947a9a9c3b6ed918c60d.js.LICENSE.txt": "main-947a9a9c3b6ed918c60d.js.LICENSE.txt",
3969
- "main-947a9a9c3b6ed918c60d.js.gz": "main-947a9a9c3b6ed918c60d.js.gz",
3970
- "main.css": "main-947a9a9c3b6ed918c60d.css",
3971
- "main.js": "main-947a9a9c3b6ed918c60d.js"
3967
+ "main-8bfc721ad2b4e3b795f8.css.gz": "main-8bfc721ad2b4e3b795f8.css.gz",
3968
+ "main-8bfc721ad2b4e3b795f8.js.LICENSE.txt": "main-8bfc721ad2b4e3b795f8.js.LICENSE.txt",
3969
+ "main-8bfc721ad2b4e3b795f8.js.gz": "main-8bfc721ad2b4e3b795f8.js.gz",
3970
+ "main.css": "main-8bfc721ad2b4e3b795f8.css",
3971
+ "main.js": "main-8bfc721ad2b4e3b795f8.js"
3972
3972
  }
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.4.6
4
+ version: 0.4.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pete Matsyburka
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-01-15 00:00:00.000000000 Z
11
+ date: 2023-03-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ar_lazy_preload
@@ -2235,8 +2235,8 @@ files:
2235
2235
  - ui/dist/images/layers-2x.png
2236
2236
  - ui/dist/images/layers.png
2237
2237
  - ui/dist/images/marker-icon.png
2238
- - ui/dist/main-947a9a9c3b6ed918c60d.css.gz
2239
- - ui/dist/main-947a9a9c3b6ed918c60d.js.gz
2238
+ - ui/dist/main-8bfc721ad2b4e3b795f8.css.gz
2239
+ - ui/dist/main-8bfc721ad2b4e3b795f8.js.gz
2240
2240
  - ui/dist/manifest.json
2241
2241
  homepage:
2242
2242
  licenses:
@@ -2265,7 +2265,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
2265
2265
  - !ruby/object:Gem::Version
2266
2266
  version: '0'
2267
2267
  requirements: []
2268
- rubygems_version: 3.4.1
2268
+ rubygems_version: 3.4.7
2269
2269
  signing_key:
2270
2270
  specification_version: 4
2271
2271
  summary: Low-code Admin panel and Business intelligence