motor-admin 0.2.66 → 0.2.69
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 +16 -15
- data/app/controllers/motor/data_controller.rb +1 -1
- data/config/locales/el.yml +4 -0
- data/config/locales/en.yml +4 -0
- data/config/locales/es.yml +4 -0
- data/config/locales/pt.yml +4 -0
- data/lib/motor/build_schema/load_from_rails.rb +1 -0
- data/lib/motor/build_schema.rb +2 -1
- data/lib/motor/resources.rb +1 -1
- data/lib/motor/version.rb +1 -1
- data/ui/dist/{main-1ebc4feb7f2b4c056ad8.css.gz → main-193823ff82e028dd5887.css.gz} +0 -0
- data/ui/dist/main-193823ff82e028dd5887.js.gz +0 -0
- data/ui/dist/manifest.json +5 -5
- metadata +5 -5
- data/ui/dist/main-1ebc4feb7f2b4c056ad8.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: ecd151cc5a37089827f85405b84aefc194a57dc95000ea8c5e9372ed5cdfc00b
|
4
|
+
data.tar.gz: 283a02208d984f0ec91201774944bbf80b0eb3b8a4c61ced9d5f585e40931982
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3df0bd92070c470e9e7100c0fb16975c4f08aa936b2d52b1411a5f9c070397bbf4a4f070a5ad7f8808a015f631733f28f827a0ad698ceb29e883d160cf008bee
|
7
|
+
data.tar.gz: ce24ce1a1499f5d4899aeda240cd1769e21a19e53f92882fd60a903eb659d0ec9d88aed412536ac87303aed45833d88fe94033df5561ae9613eecced11038645
|
@@ -9,29 +9,30 @@ module Motor
|
|
9
9
|
load_and_authorize_resource :attachment, class: 'ActiveStorage::Attachment', parent: false
|
10
10
|
|
11
11
|
def create
|
12
|
-
|
13
|
-
|
12
|
+
@attachment.assign_attributes(blob: ActiveStorage::Blob.create_and_upload!(file_params), record: record)
|
13
|
+
@attachment.assign_attributes(record_type: '', record_id: 0) unless record
|
14
14
|
|
15
|
-
|
15
|
+
if @attachment.save(validate: false)
|
16
|
+
render json: { data: Motor::ApiQuery::BuildJson.call(@attachment, params, current_ability) }
|
16
17
|
else
|
17
|
-
|
18
|
+
render json: { errors: @attachment.errors }, status: :unprocessable_entity
|
18
19
|
end
|
19
20
|
end
|
20
21
|
|
21
22
|
private
|
22
23
|
|
23
24
|
def record
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
25
|
+
@record ||=
|
26
|
+
if @attachment.record
|
27
|
+
record_pk = @attachment.record.class.primary_key
|
28
|
+
|
29
|
+
Motor::Resources::FetchConfiguredModel.call(
|
30
|
+
@attachment.record.class,
|
31
|
+
cache_key: Motor::Resource.maximum(:updated_at)
|
32
|
+
).find_by(record_pk => @attachment.record[record_pk])
|
33
|
+
else
|
34
|
+
current_user
|
35
|
+
end
|
35
36
|
end
|
36
37
|
|
37
38
|
def file_params
|
@@ -31,7 +31,7 @@ module Motor
|
|
31
31
|
|
32
32
|
@resource = @associated_resource
|
33
33
|
else
|
34
|
-
@resource.public_send(params[:association].to_sym).create!(
|
34
|
+
@resource.public_send(params[:association].to_sym).create!(resource_params) do |resource|
|
35
35
|
@resource = resource
|
36
36
|
end
|
37
37
|
end
|
data/config/locales/el.yml
CHANGED
@@ -302,6 +302,10 @@ el:
|
|
302
302
|
on_collection: Κατά τη συλλογή
|
303
303
|
association: Σύνδεση
|
304
304
|
action_has_been_removed: Η ενέργεια αυτή έχει καταργηθεί
|
305
|
+
html: HTML
|
306
|
+
edit_html: Edit HTML
|
307
|
+
there_are_unsaved_changes_close_form: "There are unsaved changes. Close form?"
|
308
|
+
send_file_url: Send file URL
|
305
309
|
i:
|
306
310
|
locale: el
|
307
311
|
select:
|
data/config/locales/en.yml
CHANGED
@@ -307,3 +307,7 @@ en:
|
|
307
307
|
every_minute: Every minute
|
308
308
|
every_5_minutes: Every 5 minutes
|
309
309
|
do_not_refresh: Do not refresh
|
310
|
+
html: HTML
|
311
|
+
edit_html: Edit HTML
|
312
|
+
there_are_unsaved_changes_close_form: "There are unsaved changes. Close form?"
|
313
|
+
send_file_url: Send file URL
|
data/config/locales/es.yml
CHANGED
@@ -302,6 +302,10 @@ es:
|
|
302
302
|
on_collection: En la colección
|
303
303
|
association: Asociación
|
304
304
|
action_has_been_removed: Esta acción ha sido eliminada
|
305
|
+
html: HTML
|
306
|
+
edit_html: Edit HTML
|
307
|
+
there_are_unsaved_changes_close_form: "There are unsaved changes. Close form?"
|
308
|
+
send_file_url: Send file URL
|
305
309
|
i:
|
306
310
|
locale: es
|
307
311
|
select:
|
data/config/locales/pt.yml
CHANGED
@@ -298,6 +298,10 @@ pt:
|
|
298
298
|
on_collection: Na coleção
|
299
299
|
association: Associação
|
300
300
|
action_has_been_removed: Esta ação foi removida
|
301
|
+
html: HTML
|
302
|
+
edit_html: Edit HTML
|
303
|
+
there_are_unsaved_changes_close_form: "There are unsaved changes. Close form?"
|
304
|
+
send_file_url: Send file URL
|
301
305
|
i:
|
302
306
|
locale: pt
|
303
307
|
select:
|
data/lib/motor/build_schema.rb
CHANGED
data/lib/motor/resources.rb
CHANGED
@@ -5,7 +5,7 @@ module Motor
|
|
5
5
|
RESOURCE_ATTRS = %w[display_name display_column icon custom_sql visible display_primary_key
|
6
6
|
searchable_columns].freeze
|
7
7
|
COLUMN_ATTRS = %w[name display_name column_type access_type default_value reference virtual format
|
8
|
-
validators].freeze
|
8
|
+
validators description].freeze
|
9
9
|
ASSOCIATION_ATTRS = %w[name display_name model_name icon visible foreign_key primary_key options virtual
|
10
10
|
polymorphic slug].freeze
|
11
11
|
SCOPE_ATTRS = %w[name display_name scope_type preferences visible].freeze
|
data/lib/motor/version.rb
CHANGED
Binary file
|
Binary file
|
data/ui/dist/manifest.json
CHANGED
@@ -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-
|
2605
|
-
"main-
|
2606
|
-
"main-
|
2607
|
-
"main.css": "main-
|
2608
|
-
"main.js": "main-
|
2604
|
+
"main-193823ff82e028dd5887.css.gz": "main-193823ff82e028dd5887.css.gz",
|
2605
|
+
"main-193823ff82e028dd5887.js.LICENSE.txt": "main-193823ff82e028dd5887.js.LICENSE.txt",
|
2606
|
+
"main-193823ff82e028dd5887.js.gz": "main-193823ff82e028dd5887.js.gz",
|
2607
|
+
"main.css": "main-193823ff82e028dd5887.css",
|
2608
|
+
"main.js": "main-193823ff82e028dd5887.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.
|
4
|
+
version: 0.2.69
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pete Matsyburka
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-05-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord-filter
|
@@ -1534,8 +1534,8 @@ files:
|
|
1534
1534
|
- ui/dist/icons/zoom-money.svg.gz
|
1535
1535
|
- ui/dist/icons/zoom-out.svg.gz
|
1536
1536
|
- ui/dist/icons/zoom-question.svg.gz
|
1537
|
-
- ui/dist/main-
|
1538
|
-
- ui/dist/main-
|
1537
|
+
- ui/dist/main-193823ff82e028dd5887.css.gz
|
1538
|
+
- ui/dist/main-193823ff82e028dd5887.js.gz
|
1539
1539
|
- ui/dist/manifest.json
|
1540
1540
|
homepage:
|
1541
1541
|
licenses:
|
@@ -1558,7 +1558,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
1558
1558
|
- !ruby/object:Gem::Version
|
1559
1559
|
version: '0'
|
1560
1560
|
requirements: []
|
1561
|
-
rubygems_version: 3.
|
1561
|
+
rubygems_version: 3.3.3
|
1562
1562
|
signing_key:
|
1563
1563
|
specification_version: 4
|
1564
1564
|
summary: Low-code Admin panel and Business intelligence
|
Binary file
|