motor-admin 0.1.61 → 0.1.66
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +2 -1
- data/lib/motor/api_query/filter.rb +11 -1
- data/lib/motor/version.rb +1 -1
- data/ui/dist/{main-fd0f75f789196ce24ffd.css.gz → main-5d0776041b10faab44aa.css.gz} +0 -0
- data/ui/dist/main-5d0776041b10faab44aa.js.gz +0 -0
- data/ui/dist/manifest.json +5 -5
- metadata +4 -4
- data/ui/dist/main-fd0f75f789196ce24ffd.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: 70f6231a19facf02d98b6bfdb05cc17d9cd3a18f21f9b34b7e75a8284a36ed3c
|
4
|
+
data.tar.gz: d57084676e7c4baf5a4fb8c200a3717dcc75ac3e3081d086636193378cd8057d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 314903b5ba271f7ab9238bc561669457d55e80ce2dce28657fb3216c855e7fe2f8c045ee18b268365421f9a444c00c04fbb130756b4cf0aac7a71a2971541d42
|
7
|
+
data.tar.gz: 6e6ca476fb22039faf3f10fb3a9a911edc5234fe7fadf0a864d1e4524fb5bb026d359f0d44708af8d1553f7b47d0073c5a77a21ae3c2a74b6d8d7633bfa9c51d
|
data/README.md
CHANGED
@@ -57,7 +57,8 @@ Custom resource actions can be added via Active Record method call, API endpoint
|
|
57
57
|
|
58
58
|

|
59
59
|
|
60
|
-
Values from the form fields can be used in API path via `{field_name}` syntax: `/api/some-endpoint/{resource_id}/apply
|
60
|
+
Values from the form fields can be used in API path via `{field_name}` syntax: `/api/some-endpoint/{resource_id}/apply`.<br>
|
61
|
+
[Learn more about custom forms builder](https://github.com/omohokcoj/motor-admin/blob/master/guides/building_custom_forms.md).
|
61
62
|
|
62
63
|
### SQL Queries
|
63
64
|
|
@@ -4,6 +4,7 @@ module Motor
|
|
4
4
|
module ApiQuery
|
5
5
|
module Filter
|
6
6
|
LIKE_FILTER_VALUE_REGEXP = /\A%?(.*?)%?\z/.freeze
|
7
|
+
DISTINCT_RESTRICTED_COLUMN_TYPES = %i[json point].freeze
|
7
8
|
|
8
9
|
module_function
|
9
10
|
|
@@ -12,7 +13,10 @@ module Motor
|
|
12
13
|
|
13
14
|
normalized_params = normalize_params(Array.wrap(params))
|
14
15
|
|
15
|
-
rel.filter(normalized_params)
|
16
|
+
rel = rel.filter(normalized_params)
|
17
|
+
rel = rel.distinct if can_apply_distinct?(rel)
|
18
|
+
|
19
|
+
rel
|
16
20
|
end
|
17
21
|
|
18
22
|
def normalize_params(params)
|
@@ -47,6 +51,12 @@ module Motor
|
|
47
51
|
end
|
48
52
|
end
|
49
53
|
|
54
|
+
def can_apply_distinct?(rel)
|
55
|
+
rel.columns.none? do |column|
|
56
|
+
DISTINCT_RESTRICTED_COLUMN_TYPES.include?(column.type)
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
50
60
|
def normalize_action(action, value)
|
51
61
|
case action
|
52
62
|
when 'includes'
|
data/lib/motor/version.rb
CHANGED
Binary file
|
Binary file
|
data/ui/dist/manifest.json
CHANGED
@@ -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-
|
2072
|
-
"main-
|
2073
|
-
"main-
|
2074
|
-
"main.css": "main-
|
2075
|
-
"main.js": "main-
|
2071
|
+
"main-5d0776041b10faab44aa.css.gz": "main-5d0776041b10faab44aa.css.gz",
|
2072
|
+
"main-5d0776041b10faab44aa.js.LICENSE.txt": "main-5d0776041b10faab44aa.js.LICENSE.txt",
|
2073
|
+
"main-5d0776041b10faab44aa.js.gz": "main-5d0776041b10faab44aa.js.gz",
|
2074
|
+
"main.css": "main-5d0776041b10faab44aa.css",
|
2075
|
+
"main.js": "main-5d0776041b10faab44aa.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.
|
4
|
+
version: 0.1.66
|
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-06-
|
11
|
+
date: 2021-06-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord-filter
|
@@ -1491,8 +1491,8 @@ files:
|
|
1491
1491
|
- ui/dist/icons/zoom-money.svg.gz
|
1492
1492
|
- ui/dist/icons/zoom-out.svg.gz
|
1493
1493
|
- ui/dist/icons/zoom-question.svg.gz
|
1494
|
-
- ui/dist/main-
|
1495
|
-
- ui/dist/main-
|
1494
|
+
- ui/dist/main-5d0776041b10faab44aa.css.gz
|
1495
|
+
- ui/dist/main-5d0776041b10faab44aa.js.gz
|
1496
1496
|
- ui/dist/manifest.json
|
1497
1497
|
homepage:
|
1498
1498
|
licenses:
|
Binary file
|