motor-admin 0.1.82 → 0.1.86

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: d5a2886041082ec536236049f725dcca9b0393030a345fa8d199e8d5da6e9af5
4
- data.tar.gz: 7ba731ec0edb6da8896652f226faf608c9631e9b80662c4fbe5fc5905646fab4
3
+ metadata.gz: 2bb133839954641be455cc1b9420ca0d27b42255b6debe02411d6c31585462b5
4
+ data.tar.gz: acd52a05f79ccfafd795f760ed218e89876db186c717965f02a4deb08aafc8a6
5
5
  SHA512:
6
- metadata.gz: 942be3d54a799b14dda1b92b9b47f95b7ba05afa8ea27d97bd64fe1da5a39dc83844ac98b1b3dde98c416fb1ffd2ac0567d4ce52a69f815d7916a3e563e04c13
7
- data.tar.gz: de9221acc6e7c670e2be17f91d8a955ae377dcce615cf735a39e0010a6e691ad651e55a189b694596c4c8a597ab663e6f75dcf7b29393bbba7bc5f9e613a4793
6
+ metadata.gz: c41b2f7e07342533c2e78c364d44721c53796f18b16c86aedeb85e32c733a4530f8a8c92f07a69b378c734488b2f98603c6f8ca03ca8e03a2fd546b4dfc3395b
7
+ data.tar.gz: a02597bcd00819a6b954df98105b6e075af4c1bb2945639a9fbcdef5b0ac4914d30490ab9629bcf90009c198863c1260079d417b3ef636fc3a436f1633b4213a
@@ -228,3 +228,12 @@ en:
228
228
  color: Color
229
229
  link_text: Link text
230
230
  copied_to_the_clipboard: Copied to the clipboard
231
+ queries_can_contain_variable_via_syntax_html: "Queries can contain embed variables using <code>{{variable}}</code> syntax:"
232
+ syntax_is_used_for_if_and_if_not_conditions_html: "<code>{{#variable}} ... {{/variable}}</code> and <code>{{^variable}} ... {{variable}}</code> syntax is used for <code>if</code> and <code>if not</code> conditions respectively:"
233
+ current_user_variables_are_always_passed_explicitly_and_can_he_used_html: "<code>{{current_user_id}}</code> and <code>{{current_user_email}}</code> variables are always passed explicitly, and can be used to decide which data should be displayed for certain user:"
234
+ create_new: Create New
235
+ conditional: Conditional
236
+ condition: Condition
237
+ field: Field
238
+ empty: Empty
239
+ not_empty: Not empty
@@ -228,6 +228,15 @@ es:
228
228
  color: Color
229
229
  link_text: Texto del enlace
230
230
  copied_to_the_clipboard: Copiado al portapapeles
231
+ queries_can_contain_variable_via_syntax_html: "Queries can contain embed variables using <code>{{variable}}</code> syntax:"
232
+ syntax_is_used_for_if_and_if_not_conditions_html: "<code>{{#variable}} ... {{/variable}}</code> and <code>{{^variable}} ... {{variable}}</code> syntax is used for <code>if</code> and <code>if not</code> conditions respectively:"
233
+ current_user_variables_are_always_passed_explicitly_and_can_he_used_html: "<code>{{current_user_id}}</code> and <code>{{current_user_email}}</code> variables are always passed explicitly, and can be used to decide which data should be displayed for certain user:"
234
+ create_new: Crear nuevo
235
+ conditional: Condicional
236
+ condition: Condicion
237
+ field: Campo
238
+ empty: Vacío
239
+ not_empty: No vacío
231
240
  i:
232
241
  locale: es
233
242
  select:
@@ -132,8 +132,13 @@ module Motor
132
132
  return DEFAULT_CURRENCY_FORMAT_HASH if column.name == 'price'
133
133
 
134
134
  inclusion_validator, = model.validators_on(column.name).grep(ActiveModel::Validations::InclusionValidator)
135
+
135
136
  return { select_options: inclusion_validator.send(:delimiter) } if inclusion_validator
136
137
 
138
+ enum = model.defined_enums[column.name]
139
+
140
+ return { select_options: enum.keys } if enum
141
+
137
142
  {}
138
143
  end
139
144
 
@@ -25,6 +25,8 @@ module Motor
25
25
 
26
26
  # @return [Hash]
27
27
  def build_data(cache_keys = {}, current_user = nil, current_ability = nil)
28
+ configs_cache_key = cache_keys[:configs]
29
+
28
30
  {
29
31
  current_user: current_user&.as_json(only: %i[id email]),
30
32
  current_rules: current_ability.serialized_rules,
@@ -32,7 +34,8 @@ module Motor
32
34
  i18n: i18n_data,
33
35
  base_path: Motor::Admin.routes.url_helpers.motor_path,
34
36
  schema: Motor::BuildSchema.call(cache_keys, current_ability),
35
- header_links: header_links_data_hash(cache_keys[:configs]),
37
+ header_links: header_links_data_hash(configs_cache_key),
38
+ homepage_layout: homepage_layout_data_hash(configs_cache_key),
36
39
  queries: queries_data_hash(build_cache_key(cache_keys, :queries, current_user, current_ability),
37
40
  current_ability),
38
41
  dashboards: dashboards_data_hash(build_cache_key(cache_keys, :dashboards, current_user, current_ability),
@@ -58,6 +61,12 @@ module Motor
58
61
  configs.find { |c| c.key == 'header.links' }&.value || []
59
62
  end
60
63
 
64
+ def homepage_layout_data_hash(cache_key = nil)
65
+ configs = Motor::Configs::LoadFromCache.load_configs(cache_key: cache_key)
66
+
67
+ configs.find { |c| c.key == 'homepage.layout' }&.value || []
68
+ end
69
+
61
70
  def queries_data_hash(cache_key = nil, current_ability = nil)
62
71
  Motor::Configs::LoadFromCache.load_queries(cache_key: cache_key, current_ability: current_ability)
63
72
  .as_json(only: %i[id name updated_at],
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.1.82'
4
+ VERSION = '0.1.86'
5
5
  end
@@ -2068,11 +2068,11 @@
2068
2068
  "mail-opened.svg": "icons/mail-opened.svg",
2069
2069
  "mail.svg": "icons/mail.svg",
2070
2070
  "mailbox.svg": "icons/mailbox.svg",
2071
- "main-9378ea27f0f70bb79a6c.css.gz": "main-9378ea27f0f70bb79a6c.css.gz",
2072
- "main-9378ea27f0f70bb79a6c.js.LICENSE.txt": "main-9378ea27f0f70bb79a6c.js.LICENSE.txt",
2073
- "main-9378ea27f0f70bb79a6c.js.gz": "main-9378ea27f0f70bb79a6c.js.gz",
2074
- "main.css": "main-9378ea27f0f70bb79a6c.css",
2075
- "main.js": "main-9378ea27f0f70bb79a6c.js",
2071
+ "main-a06af18f26d72a62680f.css.gz": "main-a06af18f26d72a62680f.css.gz",
2072
+ "main-a06af18f26d72a62680f.js.LICENSE.txt": "main-a06af18f26d72a62680f.js.LICENSE.txt",
2073
+ "main-a06af18f26d72a62680f.js.gz": "main-a06af18f26d72a62680f.js.gz",
2074
+ "main.css": "main-a06af18f26d72a62680f.css",
2075
+ "main.js": "main-a06af18f26d72a62680f.js",
2076
2076
  "man.svg": "icons/man.svg",
2077
2077
  "manual-gearbox.svg": "icons/manual-gearbox.svg",
2078
2078
  "map-2.svg": "icons/map-2.svg",
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.1.82
4
+ version: 0.1.86
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-07-08 00:00:00.000000000 Z
11
+ date: 2021-07-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord-filter
@@ -1495,8 +1495,8 @@ files:
1495
1495
  - ui/dist/icons/zoom-money.svg.gz
1496
1496
  - ui/dist/icons/zoom-out.svg.gz
1497
1497
  - ui/dist/icons/zoom-question.svg.gz
1498
- - ui/dist/main-9378ea27f0f70bb79a6c.css.gz
1499
- - ui/dist/main-9378ea27f0f70bb79a6c.js.gz
1498
+ - ui/dist/main-a06af18f26d72a62680f.css.gz
1499
+ - ui/dist/main-a06af18f26d72a62680f.js.gz
1500
1500
  - ui/dist/manifest.json
1501
1501
  homepage:
1502
1502
  licenses: