motor-admin-pz 0.4.14 → 0.4.21
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/motor/active_storage_attachments_controller.rb +17 -3
- data/app/controllers/motor/run_api_requests_controller.rb +2 -0
- data/app/controllers/motor/run_graphql_requests_controller.rb +2 -0
- data/lib/generators/motor/templates/install.rb +3 -0
- data/lib/motor/admin.rb +1 -1
- data/lib/motor/version.rb +1 -1
- data/ui/dist/{main-f13bee99553647ee67f8.css.gz → main-ff9162d64f6a9764f3a2.css.gz} +0 -0
- data/ui/dist/main-ff9162d64f6a9764f3a2.js.gz +0 -0
- data/ui/dist/manifest.json +5 -5
- metadata +4 -4
- data/ui/dist/main-f13bee99553647ee67f8.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: 01224f114847f19ba5c8e9e07a27727513054bf72b47202df20f705f1cf77078
|
4
|
+
data.tar.gz: 3485e39fab2541a58048658ffa471148063854c666a27cdcb5023cdaac566ce6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4759c92b2dc52ffffdf8420be7639bb3ef42eb2fad5d9b259505dcb6f3b8fe2453780070602da33156a42663555465c40b9db81926251f5ea3a868c472cfa8ef
|
7
|
+
data.tar.gz: 67cfb0fb8d5e52297d0aaabca6b89ffccfd336cc1ce4d60e60b658b5718d6571544ed62dee1ce2dc038e402ea81b327bd213df6bdeefd4cd69c7b604ec230480
|
@@ -9,7 +9,13 @@ module Motor
|
|
9
9
|
load_and_authorize_resource :attachment, class: 'ActiveStorage::Attachment', parent: false
|
10
10
|
|
11
11
|
def create
|
12
|
-
|
12
|
+
blob = if file_params[:key]
|
13
|
+
ActiveStorage::Blob.create!(file_params)
|
14
|
+
else
|
15
|
+
ActiveStorage::Blob.create_and_upload!(file_params)
|
16
|
+
end
|
17
|
+
|
18
|
+
@attachment.assign_attributes(blob: blob, record: record)
|
13
19
|
@attachment.assign_attributes(record_type: '', record_id: 0) unless record
|
14
20
|
|
15
21
|
if @attachment.save(validate: false)
|
@@ -36,12 +42,20 @@ module Motor
|
|
36
42
|
end
|
37
43
|
|
38
44
|
def file_params
|
39
|
-
params.require(:data).require(:file).permit(:io, :filename
|
45
|
+
attrs = params.require(:data).require(:file).permit(:io, :filename, :key,
|
46
|
+
:checksum, :byte_size,
|
47
|
+
:content_type).to_h.symbolize_keys
|
48
|
+
|
49
|
+
return attrs if params.dig(:data, :file, :base64).blank?
|
50
|
+
|
51
|
+
attrs[:io] = StringIO.new(Base64.urlsafe_decode64(params[:data][:file][:base64]))
|
52
|
+
|
53
|
+
attrs
|
40
54
|
end
|
41
55
|
|
42
56
|
def attachment_params
|
43
57
|
if params[:data].present?
|
44
|
-
params.require(:data).except(:file).permit
|
58
|
+
params.require(:data).except(:file).permit(:name, :record_type, :record_id)
|
45
59
|
else
|
46
60
|
{}
|
47
61
|
end
|
@@ -24,6 +24,8 @@ module Motor
|
|
24
24
|
params: request_params[:params],
|
25
25
|
headers: { 'Authorization' => "Bearer #{current_user_jwt}" })
|
26
26
|
|
27
|
+
response.to_hash.each { |key, (value)| headers[key] = value }
|
28
|
+
|
27
29
|
self.response_body = response.body
|
28
30
|
self.status = response.code.to_i
|
29
31
|
end
|
@@ -18,6 +18,8 @@ module Motor
|
|
18
18
|
variables: request_params[:variables],
|
19
19
|
headers: { 'Authorization' => "Bearer #{current_user_jwt}" })
|
20
20
|
|
21
|
+
response.to_hash.each { |key, (value)| headers[key] = value }
|
22
|
+
|
21
23
|
self.response_body = response.body
|
22
24
|
self.status = response.code.to_i
|
23
25
|
end
|
@@ -165,6 +165,9 @@ class <%= migration_class_name %> < ActiveRecord::Migration[<%= ActiveRecord::Mi
|
|
165
165
|
|
166
166
|
t.timestamps
|
167
167
|
|
168
|
+
t.index %i[record_id record_type],
|
169
|
+
name: 'motor_notes_record_id_record_type_index'
|
170
|
+
|
168
171
|
t.index %i[author_id author_type],
|
169
172
|
name: 'motor_notes_author_id_author_type_index'
|
170
173
|
end
|
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
|
-
if !Motor.development? &&
|
7
|
+
if !Motor.development? && Rails.env.development?
|
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__))
|
data/lib/motor/version.rb
CHANGED
Binary file
|
Binary file
|
data/ui/dist/manifest.json
CHANGED
@@ -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-
|
3968
|
-
"main-
|
3969
|
-
"main-
|
3970
|
-
"main.css": "main-
|
3971
|
-
"main.js": "main-
|
3967
|
+
"main-ff9162d64f6a9764f3a2.css.gz": "main-ff9162d64f6a9764f3a2.css.gz",
|
3968
|
+
"main-ff9162d64f6a9764f3a2.js.LICENSE.txt": "main-ff9162d64f6a9764f3a2.js.LICENSE.txt",
|
3969
|
+
"main-ff9162d64f6a9764f3a2.js.gz": "main-ff9162d64f6a9764f3a2.js.gz",
|
3970
|
+
"main.css": "main-ff9162d64f6a9764f3a2.css",
|
3971
|
+
"main.js": "main-ff9162d64f6a9764f3a2.js"
|
3972
3972
|
}
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: motor-admin-pz
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.21
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pete Matsyburka
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2023-
|
12
|
+
date: 2023-09-22 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: ar_lazy_preload
|
@@ -2239,8 +2239,8 @@ files:
|
|
2239
2239
|
- ui/dist/images/layers-2x.png
|
2240
2240
|
- ui/dist/images/layers.png
|
2241
2241
|
- ui/dist/images/marker-icon.png
|
2242
|
-
- ui/dist/main-
|
2243
|
-
- ui/dist/main-
|
2242
|
+
- ui/dist/main-ff9162d64f6a9764f3a2.css.gz
|
2243
|
+
- ui/dist/main-ff9162d64f6a9764f3a2.js.gz
|
2244
2244
|
- ui/dist/manifest.json
|
2245
2245
|
homepage:
|
2246
2246
|
licenses:
|
Binary file
|