motor-admin 0.2.14 → 0.2.18

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: 83d142a47680bf5eed1aea0f1fccb5b90de231d8105036a5d284cf79d43d586e
4
- data.tar.gz: 2a9dfd66258c1c446aabc2e1367fad73f1df56867b61d79d47142eefea71622a
3
+ metadata.gz: dc4b3959711130ff5e711c91a8a3ae30f996dcbbf83c98a6d2bb108ffed665e6
4
+ data.tar.gz: c5090823346eb41d62bb400cce5b7c4c4c17b9a9261017aa374a31fa33ca3630
5
5
  SHA512:
6
- metadata.gz: fdbfad1a4edd14c987c1f956e525044176ef445125a3e43ae4284618cc0721343a2a28a3c03dcb1d470fd9f746e699cff209911597c71b320540cc11655774b8
7
- data.tar.gz: d2c662baf663b0cb76edc3ced65c1b331bbf452aaa1a6fa75d4a73cfcd72d7ad0018a4529536a33fe91d6825aa553ad867289895d79398cc73b86ebd1bc0116f
6
+ metadata.gz: c46b67ac2fe96276806252c3c56e0472b32b6f91aa2351dd7d8ae76485de59260e2079dd42336c61beb1d28de9f6c0177e32e60d9a5e35c9b7dd8b9e770ff0bf
7
+ data.tar.gz: d49105316054eab5561cfbbad123cf4e106d7d837446cab63f91149f225022466c7ef3e10442e20789c4c920e9a222dbf27ad552a253cd23267e71356d34fa68
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Low-code Admin panel and Business intelligence Rails engine **(no DSL - configurable from the UI)**.
4
4
 
5
- 🤓 [Demo App](https://motor-admin.herokuapp.com/demo) | 👀 [Features overview](https://www.youtube.com/watch?v=ngVoci8Hll4&list=PLu7llEMh0KcOkR3Uy_RJT0cXPZQKAYVsq&index=1) | ⭐ [Stargathers](https://github.com/omohokcoj/motor-admin/stargazers)
5
+ 🤓 [Demo App](https://motor-admin.herokuapp.com/demo) | 👀 [Features overview](https://www.youtube.com/watch?v=ngVoci8Hll4&list=PLu7llEMh0KcOkR3Uy_RJT0cXPZQKAYVsq&index=1) | ⭐ [Pro](https://www.getmotoradmin.com/pro)
6
6
 
7
7
  [![Admin Panel](https://user-images.githubusercontent.com/5418788/119318538-1f30e300-bc82-11eb-94a4-107c31c93b13.png)](https://motor-admin.herokuapp.com/demo)
8
8
 
@@ -62,7 +62,7 @@ Everything in the admin panel can be configured using the intuitive settings UI,
62
62
 
63
63
  Data displayed on the resource page can be completely customized via [SQL queries](#sql-queries) and [dashboards](#dashboards) attached to the resource as a tab. Usually, queries used to display resource data should contain `{{resource_name_id}}` [variable](#sql-queries).
64
64
 
65
- [Learn more about resource customizations](https://github.com/omohokcoj/motor-admin/blob/master/guides/customizing_resource_table.md)
65
+ [Learn more about resource customizations](https://github.com/motor-admin/motor-admin-rails/blob/master/guides/customizing_resource_table.md)
66
66
 
67
67
  ### Custom Actions
68
68
 
@@ -92,7 +92,7 @@ end
92
92
 
93
93
  Values from the form fields can be used in API path via `{field_name}` syntax: `/api/some-endpoint/{resource_id}/apply`.
94
94
 
95
- [Learn more about custom forms builder](https://github.com/omohokcoj/motor-admin/blob/master/guides/building_custom_forms.md)
95
+ [Learn more about custom forms builder](https://github.com/motor-admin/motor-admin-rails/blob/master/guides/building_custom_forms.md)
96
96
 
97
97
  ### SQL Queries
98
98
 
@@ -128,7 +128,7 @@ Intelligence search can be opened via the top right corner button or using <kbd>
128
128
 
129
129
  ### Authorization
130
130
 
131
- Motor Admin allows to set row-level and column-level permissions via [cancan](https://github.com/CanCanCommunity/cancancan) gem. Admin UI permissions should be defined in `app/models/motor/ability.rb` file in `Motor::Ability` class. See [Motor Admin guide](https://github.com/omohokcoj/motor-admin/blob/master/guides/defining_permissions.md) and [CanCan documentation](https://github.com/CanCanCommunity/cancancan/blob/develop/docs/Defining-Abilities.md) to learn how to define user permissions.
131
+ Motor Admin allows to set row-level and column-level permissions via [cancan](https://github.com/CanCanCommunity/cancancan) gem. Admin UI permissions should be defined in `app/models/motor/ability.rb` file in `Motor::Ability` class. See [Motor Admin guide](https://github.com/motor-admin/motor-admin-rails/blob/master/guides/defining_permissions.md) and [CanCan documentation](https://github.com/CanCanCommunity/cancancan/blob/develop/docs/Defining-Abilities.md) to learn how to define user permissions.
132
132
 
133
133
  ### I18n
134
134
 
@@ -199,4 +199,4 @@ MOTOR_DEVELOPMENT=true rails s
199
199
 
200
200
  ## License
201
201
 
202
- The gem is available as open source under the terms of the [MIT License](https://github.com/omohokcoj/motor-admin/blob/master/LICENSE).
202
+ The gem is available as open source under the terms of the [MIT License](https://github.com/motor-admin/motor-admin-rails/blob/master/LICENSE).
@@ -274,3 +274,5 @@ en:
274
274
  sign_out: Sign out
275
275
  header: Header
276
276
  user_dropdown: User dropdown
277
+ upload: Upload
278
+ there_is_nothing_here_yet: There is nothing here yet 🤷‍♂️
@@ -271,9 +271,11 @@ es:
271
271
  downloading: Descargando
272
272
  display_id: Visualizar ID
273
273
  display_settings: Configuración de la pantalla
274
- sign_out: Sign out
275
- header: Header
276
- user_dropdown: User dropdown
274
+ sign_out: Firmar la salida
275
+ header: Cabecera
276
+ user_dropdown: Despliegue del usuario
277
+ upload: Subir a
278
+ there_is_nothing_here_yet: Todavía no hay nada aquí 🤷‍♂️
277
279
  i:
278
280
  locale: es
279
281
  select:
@@ -267,9 +267,11 @@ pt:
267
267
  downloading: Descarregamento
268
268
  display_id: Mostrar ID
269
269
  display_settings: Definições de visualização
270
- sign_out: Sign out
271
- header: Header
272
- user_dropdown: User dropdown
270
+ sign_out: Sair
271
+ header: Cabeçalho
272
+ user_dropdown: Desistência do utilizador
273
+ upload: Carregar
274
+ there_is_nothing_here_yet: Ainda não há nada aqui 🤷‍♂️
273
275
  i:
274
276
  locale: pt
275
277
  select:
@@ -150,7 +150,7 @@ class <%= migration_class_name %> < ActiveRecord::Migration[<%= ActiveRecord::Mi
150
150
 
151
151
  model.create!(key: 'header.links', value: [{
152
152
  name: '⭐ Star on GitHub',
153
- path: 'https://github.com/omohokcoj/motor-admin'
153
+ path: 'https://github.com/motor-admin/motor-admin-rails'
154
154
  }].to_json)
155
155
  end
156
156
 
@@ -16,6 +16,7 @@ module Motor
16
16
  'numeric' => 'float',
17
17
  'decimal' => 'float',
18
18
  'float4' => 'float',
19
+ 'bpchar' => 'string',
19
20
  'float8' => 'float',
20
21
  'float16' => 'float',
21
22
  'text' => 'string',
@@ -43,11 +44,13 @@ module Motor
43
44
 
44
45
  return UNIFIED_TYPES.fetch(name, name) if name
45
46
 
46
- DEFAULT_TYPE
47
+ nil
47
48
  end
48
49
 
49
50
  def build_types_hash
50
- type_map = ActiveRecord::Base.connection.send(:type_map)
51
+ connection_class = defined?(::ResourceRecord) ? ::ResourceRecord : ActiveRecord::Base
52
+
53
+ type_map = connection_class.connection.send(:type_map)
51
54
 
52
55
  type_map.instance_variable_get('@mapping').map do |name, type|
53
56
  next unless name.is_a?(String)
@@ -12,7 +12,7 @@ module Motor
12
12
  {
13
13
  name: model.name.underscore,
14
14
  slug: Utils.slugify(model),
15
- class_name: model.class.name,
15
+ class_name: model.name,
16
16
  table_name: model.table_name,
17
17
  primary_key: model.primary_key,
18
18
  display_name: model.model_name.human(count: 2, default: 'Attachments'),
@@ -86,10 +86,10 @@ module Motor
86
86
  result.columns.map.with_index do |column_name, index|
87
87
  column_type_class = result.column_types[column_name]
88
88
 
89
- column_type =
90
- if column_type_class
91
- ActiveRecordUtils::Types.find_name_for_type(column_type_class)
92
- else
89
+ column_type = ActiveRecordUtils::Types.find_name_for_type(column_type_class) if column_type_class
90
+
91
+ column_type ||=
92
+ begin
93
93
  not_nil_value = result.rows.reduce(nil) do |acc, row|
94
94
  column = row[index]
95
95
 
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.14'
4
+ VERSION = '0.2.18'
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-6568183ef6647799a421.css.gz": "main-6568183ef6647799a421.css.gz",
2605
- "main-6568183ef6647799a421.js.LICENSE.txt": "main-6568183ef6647799a421.js.LICENSE.txt",
2606
- "main-6568183ef6647799a421.js.gz": "main-6568183ef6647799a421.js.gz",
2607
- "main.css": "main-6568183ef6647799a421.css",
2608
- "main.js": "main-6568183ef6647799a421.js"
2604
+ "main-25e14f5ae8855e7368e7.css.gz": "main-25e14f5ae8855e7368e7.css.gz",
2605
+ "main-25e14f5ae8855e7368e7.js.LICENSE.txt": "main-25e14f5ae8855e7368e7.js.LICENSE.txt",
2606
+ "main-25e14f5ae8855e7368e7.js.gz": "main-25e14f5ae8855e7368e7.js.gz",
2607
+ "main.css": "main-25e14f5ae8855e7368e7.css",
2608
+ "main.js": "main-25e14f5ae8855e7368e7.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.14
4
+ version: 0.2.18
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-10-27 00:00:00.000000000 Z
11
+ date: 2021-11-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord-filter
@@ -1525,8 +1525,8 @@ files:
1525
1525
  - ui/dist/icons/zoom-money.svg.gz
1526
1526
  - ui/dist/icons/zoom-out.svg.gz
1527
1527
  - ui/dist/icons/zoom-question.svg.gz
1528
- - ui/dist/main-6568183ef6647799a421.css.gz
1529
- - ui/dist/main-6568183ef6647799a421.js.gz
1528
+ - ui/dist/main-25e14f5ae8855e7368e7.css.gz
1529
+ - ui/dist/main-25e14f5ae8855e7368e7.js.gz
1530
1530
  - ui/dist/manifest.json
1531
1531
  homepage:
1532
1532
  licenses: