avo 0.5.0.beta12 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of avo might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/Gemfile +1 -5
- data/Gemfile.lock +6 -17
- data/app/components/avo/common/multiple_file_viewer_component.html.erb +1 -1
- data/app/components/avo/common/single_file_viewer_component.html.erb +1 -1
- data/app/components/avo/index/fields/gravatar_field_component.html.erb +1 -1
- data/app/components/avo/index/fields/id_field_component.html.erb +1 -1
- data/app/components/avo/index/resource_controls_component.html.erb +6 -6
- data/app/components/avo/show/fields/has_one_field_component.html.erb +1 -1
- data/app/components/avo/views/resource_index_component.html.erb +3 -3
- data/app/components/avo/views/resource_show_component.html.erb +3 -3
- data/app/packs/images/logo.png +0 -0
- data/app/views/avo/partials/_empty_state.html.erb +1 -1
- data/app/views/avo/partials/_view_toggle_button.html.erb +2 -2
- data/app/views/avo/relations/new.html.erb +1 -1
- data/avo.gemspec +0 -1
- data/config/webpacker.yml +30 -9
- data/config/webpacker_packed.yml +79 -0
- data/lib/avo/base_resource.rb +2 -2
- data/lib/avo/engine.rb +11 -3
- data/lib/avo/fields/date_time_field.rb +6 -0
- data/lib/avo/version.rb +1 -1
- data/lib/generators/avo/install_generator.rb +1 -1
- data/public/avo-packs/css/{application-4e16d6a6.css → application-9d115b7e.css} +41 -144
- data/public/avo-packs/css/application-9d115b7e.css.br +0 -0
- data/public/avo-packs/css/application-9d115b7e.css.gz +0 -0
- data/public/avo-packs/css/application-9d115b7e.css.map +1 -0
- data/public/avo-packs/css/application-9d115b7e.css.map.br +0 -0
- data/public/avo-packs/css/application-9d115b7e.css.map.gz +0 -0
- data/public/avo-packs/js/application-e351ef988a3cb9687542.js +26 -0
- data/public/avo-packs/js/{application-8eb130a4688f2c667703.js.LICENSE.txt → application-e351ef988a3cb9687542.js.LICENSE.txt} +0 -0
- data/public/avo-packs/js/application-e351ef988a3cb9687542.js.br +0 -0
- data/public/avo-packs/js/application-e351ef988a3cb9687542.js.gz +0 -0
- data/public/avo-packs/js/application-e351ef988a3cb9687542.js.map +1 -0
- data/public/avo-packs/js/application-e351ef988a3cb9687542.js.map.br +0 -0
- data/public/avo-packs/js/application-e351ef988a3cb9687542.js.map.gz +0 -0
- data/public/avo-packs/manifest.json +16 -16
- data/public/avo-packs/media/images/dadf2db36589607d107d.png +0 -0
- metadata +19 -33
- data/config/initializers/inline_svg.rb +0 -33
- data/public/avo-packs/css/application-4e16d6a6.css.br +0 -0
- data/public/avo-packs/css/application-4e16d6a6.css.gz +0 -0
- data/public/avo-packs/css/application-4e16d6a6.css.map +0 -1
- data/public/avo-packs/css/application-4e16d6a6.css.map.br +0 -0
- data/public/avo-packs/css/application-4e16d6a6.css.map.gz +0 -0
- data/public/avo-packs/js/application-8eb130a4688f2c667703.js +0 -26
- data/public/avo-packs/js/application-8eb130a4688f2c667703.js.br +0 -0
- data/public/avo-packs/js/application-8eb130a4688f2c667703.js.gz +0 -0
- data/public/avo-packs/js/application-8eb130a4688f2c667703.js.map +0 -1
- data/public/avo-packs/js/application-8eb130a4688f2c667703.js.map.br +0 -0
- data/public/avo-packs/js/application-8eb130a4688f2c667703.js.map.gz +0 -0
- data/public/avo-packs/media/images/f1b4befac91a3336db9a.png +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9fdcf5553b07360ef48d362721aabb8ee87e9e1d4289e30a8f141851445ebde3
|
4
|
+
data.tar.gz: c3121bdfbbeeeca0f06d059824ed9d6405dfca16f71b443433e697dea7a8d5ff
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8bcd1bea917df6700908215c57766c1c071ce1398e75681cdaef9f751feefbe3941fba5539ff4d52bdacd964993dd2579d1d63920cf8a6dbee4f9ffeb28fbab8
|
7
|
+
data.tar.gz: 1d3ee22e3f143294bc477b7a8c0e0070f63f5846a707272bd14d71cbad5722c3f3c3e24b917b8564e3585ad684a1aed702ba687d88463d2908c351d1731cf99b
|
data/Gemfile
CHANGED
@@ -17,9 +17,6 @@ gemspec
|
|
17
17
|
# Transpile app-like JavaScript. Read more: https://github.com/rails/webpacker
|
18
18
|
gem "webpacker", "6.0.0.beta.6"
|
19
19
|
|
20
|
-
# SVGs
|
21
|
-
gem "inline_svg"
|
22
|
-
|
23
20
|
gem "countries"
|
24
21
|
|
25
22
|
# Authorization
|
@@ -55,7 +52,7 @@ gem "byebug", platforms: [:mri, :mingw, :x64_mingw]
|
|
55
52
|
gem "dotenv-rails"
|
56
53
|
# Access an interactive console on exception pages or by calling 'console' anywhere in the code.
|
57
54
|
gem "web-console", ">= 3.3.0"
|
58
|
-
gem "listen", ">= 3.
|
55
|
+
gem "listen", ">= 3.3.0"
|
59
56
|
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
|
60
57
|
gem "spring"
|
61
58
|
|
@@ -67,7 +64,6 @@ gem "devise"
|
|
67
64
|
gem "database_cleaner"
|
68
65
|
|
69
66
|
gem "ruby-debug-ide", require: false
|
70
|
-
gem "debase"
|
71
67
|
#
|
72
68
|
# END Dependencies for dummy_app
|
73
69
|
#
|
data/Gemfile.lock
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
avo (
|
4
|
+
avo (1.0.1)
|
5
5
|
active_link_to
|
6
6
|
addressable
|
7
7
|
countries
|
8
8
|
hotwire-rails
|
9
9
|
httparty
|
10
10
|
image_processing
|
11
|
-
inline_svg
|
12
11
|
pagy
|
13
12
|
pundit
|
14
13
|
rails (>= 6.0)
|
@@ -104,9 +103,6 @@ GEM
|
|
104
103
|
crack (0.4.4)
|
105
104
|
crass (1.0.6)
|
106
105
|
database_cleaner (1.8.5)
|
107
|
-
debase (0.2.4.1)
|
108
|
-
debase-ruby_core_source (>= 0.10.2)
|
109
|
-
debase-ruby_core_source (0.10.11)
|
110
106
|
devise (4.7.3)
|
111
107
|
bcrypt (~> 3.0)
|
112
108
|
orm_adapter (~> 0.1)
|
@@ -148,17 +144,13 @@ GEM
|
|
148
144
|
image_processing (1.12.1)
|
149
145
|
mini_magick (>= 4.9.5, < 5)
|
150
146
|
ruby-vips (>= 2.0.17, < 3)
|
151
|
-
inline_svg (1.7.2)
|
152
|
-
activesupport (>= 3.0)
|
153
|
-
nokogiri (>= 1.6)
|
154
147
|
iso (0.3.0)
|
155
148
|
i18n
|
156
149
|
jbuilder (2.10.1)
|
157
150
|
activesupport (>= 5.0.0)
|
158
|
-
listen (3.1
|
159
|
-
rb-fsevent (~> 0.
|
160
|
-
rb-inotify (~> 0.9, >= 0.9.
|
161
|
-
ruby_dep (~> 1.2)
|
151
|
+
listen (3.5.1)
|
152
|
+
rb-fsevent (~> 0.10, >= 0.10.3)
|
153
|
+
rb-inotify (~> 0.9, >= 0.9.10)
|
162
154
|
loofah (2.9.0)
|
163
155
|
crass (~> 1.0.2)
|
164
156
|
nokogiri (>= 1.5.9)
|
@@ -276,7 +268,6 @@ GEM
|
|
276
268
|
ruby-progressbar (1.10.1)
|
277
269
|
ruby-vips (2.0.17)
|
278
270
|
ffi (~> 1.9)
|
279
|
-
ruby_dep (1.5.0)
|
280
271
|
rubyzip (2.3.0)
|
281
272
|
sass-rails (6.0.0)
|
282
273
|
sassc-rails (~> 2.1, >= 2.1.1)
|
@@ -366,7 +357,6 @@ DEPENDENCIES
|
|
366
357
|
capybara (>= 2.15)
|
367
358
|
countries
|
368
359
|
database_cleaner
|
369
|
-
debase
|
370
360
|
devise
|
371
361
|
dotenv-rails
|
372
362
|
factory_bot_rails
|
@@ -376,10 +366,9 @@ DEPENDENCIES
|
|
376
366
|
hotwire-rails
|
377
367
|
httparty
|
378
368
|
image_processing (~> 1.2)
|
379
|
-
inline_svg
|
380
369
|
iso
|
381
370
|
jbuilder (~> 2.7)
|
382
|
-
listen (>= 3.
|
371
|
+
listen (>= 3.3.0)
|
383
372
|
pagy
|
384
373
|
pg (>= 0.18, < 2.0)
|
385
374
|
puma (~> 4.3.5)
|
@@ -405,4 +394,4 @@ DEPENDENCIES
|
|
405
394
|
zeitwerk (~> 2.3)
|
406
395
|
|
407
396
|
BUNDLED WITH
|
408
|
-
2.2.
|
397
|
+
2.2.15
|
@@ -19,7 +19,7 @@
|
|
19
19
|
<% end %>
|
20
20
|
<%= a_link "/avo/resources/#{@resource.model.model_name.route_key}/#{@resource.model.id
|
21
21
|
}/active_storage_attachments/#{@id}/#{@file.id}", color: :red, variant: :outlined, size: :xs, class: 'text-center', 'data-turbo-frame': 'destroy_attachment_form', data: { confirm: t('avo.are_you_sure')} do %>
|
22
|
-
<%= helpers.svg 'trash' %> <span class="hidden lg:block lg:flex-1"><%= t
|
22
|
+
<%= helpers.svg 'trash' %> <span class="hidden lg:block lg:flex-1"><%= t 'avo.delete_file', item: @file.filename %></span>
|
23
23
|
<% end %>
|
24
24
|
</div>
|
25
25
|
<% end %>
|
@@ -19,7 +19,7 @@
|
|
19
19
|
<% end %>
|
20
20
|
<%= a_link "/avo/resources/#{@resource.model.model_name.route_key}/#{@resource.model.id
|
21
21
|
}/active_storage_attachments/#{@id}/#{@file.id}", color: :red, variant: :outlined, size: :md, class: '', 'data-turbo-frame': 'destroy_attachment_form', data: { confirm: t('avo.are_you_sure')} do %>
|
22
|
-
<%= helpers.svg 'trash' %> <%= t
|
22
|
+
<%= helpers.svg 'trash' %> <%= t 'avo.delete_file', item: @file.filename %>
|
23
23
|
<% end %>
|
24
24
|
</div>
|
25
25
|
<% else %>
|
@@ -6,5 +6,5 @@
|
|
6
6
|
path = helpers.resource_path(@resource.model)
|
7
7
|
end
|
8
8
|
%>
|
9
|
-
<% link_to_if (@field.link_to_resource or Avo.configuration.id_links_to_resource), @field.value, path, title: t('avo.view_item',
|
9
|
+
<% link_to_if (@field.link_to_resource or Avo.configuration.id_links_to_resource), @field.value, path, title: t('avo.view_item', item: @resource.name).humanize %>
|
10
10
|
<% end %>
|
@@ -2,7 +2,7 @@
|
|
2
2
|
<% if can_view? %>
|
3
3
|
<%= link_to helpers.svg('eye', class: 'text-gray-400 h-6 hover:text-gray-600'),
|
4
4
|
show_path,
|
5
|
-
title: t('avo.view_item',
|
5
|
+
title: t('avo.view_item', item: @resource.model.model_name.name.downcase ).capitalize,
|
6
6
|
data: {
|
7
7
|
control: :show,
|
8
8
|
'tippy': 'tooltip',
|
@@ -13,7 +13,7 @@
|
|
13
13
|
<% if can_edit? %>
|
14
14
|
<%= link_to helpers.svg('edit', class: 'text-gray-400 h-6 hover:text-gray-600'),
|
15
15
|
edit_path,
|
16
|
-
title: t('avo.edit_item',
|
16
|
+
title: t('avo.edit_item', item: @resource.model.model_name.name.downcase ).capitalize,
|
17
17
|
data: {
|
18
18
|
control: :edit,
|
19
19
|
'resource-id': @resource.model.id,
|
@@ -27,10 +27,10 @@
|
|
27
27
|
'data-turbo-frame': params[:turbo_frame]
|
28
28
|
} do |form| %>
|
29
29
|
<%= form.button helpers.svg('trash-sm', class: 'text-gray-400 h-6 hover:text-gray-600'),
|
30
|
-
title: t('avo.detach_item',
|
30
|
+
title: t('avo.detach_item', item: @resource.model.model_name.name.downcase).capitalize,
|
31
31
|
type: :submit,
|
32
32
|
data: {
|
33
|
-
confirm: t('avo.are_you_sure_detach_item',
|
33
|
+
confirm: t('avo.are_you_sure_detach_item', item: @resource.model.model_name.name.downcase),
|
34
34
|
control: :detach,
|
35
35
|
'resource-id': @resource.model.id,
|
36
36
|
'tippy': 'tooltip',
|
@@ -47,10 +47,10 @@
|
|
47
47
|
'data-turbo-frame': params[:turbo_frame]
|
48
48
|
} do |form| %>
|
49
49
|
<%= form.button helpers.svg('trash', class: 'text-gray-400 h-6 hover:text-gray-600'),
|
50
|
-
title: t('avo.delete_item',
|
50
|
+
title: t('avo.delete_item', item: @resource.model.model_name.name.downcase ).capitalize,
|
51
51
|
type: :submit,
|
52
52
|
data: {
|
53
|
-
confirm: t('avo.are_you_sure',
|
53
|
+
confirm: t('avo.are_you_sure', item: @resource.model.model_name.name.downcase ),
|
54
54
|
control: :destroy,
|
55
55
|
'resource-id': @resource.model.id,
|
56
56
|
'tippy': 'tooltip',
|
@@ -6,7 +6,7 @@
|
|
6
6
|
<%= panel(title: @field.id.capitalize) do |c| %>
|
7
7
|
<% c.with :tools do %>
|
8
8
|
<%= a_link helpers.resource_attach_path(@resource.model.model_name.route_key, @resource.model.id, @field.id), color: 'indigo', 'data-turbo-frame': 'attach_modal' do %>
|
9
|
-
<%= svg 'view-grid-add' %> <%= t('avo.attach_item',
|
9
|
+
<%= svg 'view-grid-add' %> <%= t('avo.attach_item', item: @field.id).capitalize %>
|
10
10
|
<% end %>
|
11
11
|
<% end %>
|
12
12
|
|
@@ -4,19 +4,19 @@
|
|
4
4
|
|
5
5
|
<% if can_create? %>
|
6
6
|
<%= a_link create_path do %>
|
7
|
-
<%= svg 'plus' %> <%= t('avo.create_new_item',
|
7
|
+
<%= svg 'plus' %> <%= t('avo.create_new_item', item: @resource.model_class.model_name.human.downcase ) %>
|
8
8
|
<% end %>
|
9
9
|
<% end %>
|
10
10
|
|
11
11
|
<% if can_detach? %>
|
12
12
|
<%= a_link detach_path, color: 'indigo', method: :delete, data: { confirm: "Are you sure you want to detach this #{@resource.singular_name}." } do %>
|
13
|
-
<%= svg 'trash' %> <%= t('avo.detach_item',
|
13
|
+
<%= svg 'trash' %> <%= t('avo.detach_item', item: @resource.singular_name).capitalize %>
|
14
14
|
<% end %>
|
15
15
|
<% end %>
|
16
16
|
|
17
17
|
<% if can_attach? %>
|
18
18
|
<%= a_link attach_path, color: 'indigo', 'data-turbo-frame': 'attach_modal' do %>
|
19
|
-
<%= svg 'view-grid-add' %> <%= t('avo.attach_item',
|
19
|
+
<%= svg 'view-grid-add' %> <%= t('avo.attach_item', item: @resource.singular_name).capitalize %>
|
20
20
|
<% end %>
|
21
21
|
<% end %>
|
22
22
|
<% end %>
|
@@ -10,7 +10,7 @@
|
|
10
10
|
|
11
11
|
<% if @reflection.present? && @resource.model.present? %>
|
12
12
|
<%= a_link detach_path, color: 'indigo', method: :delete, data: { confirm: "Are you sure you want to detach this #{@resource.singular_name}." } do %>
|
13
|
-
<%= svg 'trash' %> <%= t('avo.detach_item',
|
13
|
+
<%= svg 'trash' %> <%= t('avo.detach_item', item: @resource.singular_name).capitalize %>
|
14
14
|
<% end %>
|
15
15
|
<% else %>
|
16
16
|
<%= a_link back_path do %>
|
@@ -19,12 +19,12 @@
|
|
19
19
|
|
20
20
|
<% if @resource.authorization.authorize_action(:destroy, raise_exception: false) %>
|
21
21
|
<%= form_with url: helpers.resource_path(@resource.model), method: :delete, html: { 'data-turbo-frame': params[:turbo_frame] } do |form| %>
|
22
|
-
<%= a_button title: t('avo.delete_item',
|
22
|
+
<%= a_button title: t('avo.delete_item', item: @resource.model.model_name.name.downcase).capitalize,
|
23
23
|
color: 'red',
|
24
24
|
variant: 'outlined',
|
25
25
|
type: :submit,
|
26
26
|
data: {
|
27
|
-
confirm: t('avo.are_you_sure',
|
27
|
+
confirm: t('avo.are_you_sure', item: @resource.model.model_name.name.downcase),
|
28
28
|
control: :destroy,
|
29
29
|
'resource-id': @resource.model.id,
|
30
30
|
'tippy': 'tooltip',
|
data/app/packs/images/logo.png
CHANGED
Binary file
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<%
|
2
2
|
classes = 'absolute inset-auto left-1/2 top-1/2 transform -translate-x-1/2 -translate-y-1/2'
|
3
3
|
translation_tag = params[:related_name].present? ? 'avo.no_related_item_found' : 'avo.no_item_found'
|
4
|
-
label = t translation_tag,
|
4
|
+
label = t translation_tag, item: resource_name
|
5
5
|
%>
|
6
6
|
<div class="relative flex-1 py-12">
|
7
7
|
<div class="relative block text-gray-300 h-64 w-full">
|
@@ -11,7 +11,7 @@
|
|
11
11
|
translation_key = 'avo.table_view'
|
12
12
|
end
|
13
13
|
%>
|
14
|
-
<%= a_link params.permit!.merge(view_type: new_view_type), color: :blue, 'data-turbo-frame': turbo_frame, title: t('avo.switch_to_view',
|
15
|
-
<%= svg new_icon %> <%= t
|
14
|
+
<%= a_link params.permit!.merge(view_type: new_view_type), color: :blue, 'data-turbo-frame': turbo_frame, title: t('avo.switch_to_view', view_type: new_view_type), 'data-tippy': 'tooltip' do %>
|
15
|
+
<%= svg new_icon %> <%= t translation_key, item: @resource.model_class.model_name.human.downcase %>
|
16
16
|
<% end %>
|
17
17
|
<% end %>
|
@@ -6,7 +6,7 @@
|
|
6
6
|
} do |form| %>
|
7
7
|
<%= render Avo::ModalComponent.new do |c| %>
|
8
8
|
<% c.with :heading do %>
|
9
|
-
<%= t
|
9
|
+
<%= t 'avo.choose_item', item: params[:related_name].downcase %>
|
10
10
|
<% end %>
|
11
11
|
|
12
12
|
<div class="flex-1 flex items-center justify-center px-8 text-lg mt-8 mb-12">
|
data/avo.gemspec
CHANGED
@@ -34,7 +34,6 @@ Gem::Specification.new do |spec|
|
|
34
34
|
spec.add_dependency "rails", ">= 6.0"
|
35
35
|
spec.add_dependency "pagy"
|
36
36
|
spec.add_dependency "zeitwerk"
|
37
|
-
spec.add_dependency "inline_svg"
|
38
37
|
spec.add_dependency "webpacker"
|
39
38
|
spec.add_dependency "countries"
|
40
39
|
spec.add_dependency "pundit"
|
data/config/webpacker.yml
CHANGED
@@ -5,29 +5,50 @@ default: &default
|
|
5
5
|
source_entry_path: entrypoints
|
6
6
|
public_root_path: public
|
7
7
|
cache_path: tmp/cache/webpacker
|
8
|
-
check_yarn_integrity: false
|
9
8
|
# use a different sub-folder name
|
10
9
|
public_output_path: avo-packs
|
11
10
|
webpack_compile_output: true
|
12
|
-
extract_css: true
|
13
11
|
|
14
12
|
# Additional paths webpack should lookup modules
|
15
13
|
# ['app/assets', 'engine/foo/app/assets']
|
16
|
-
|
14
|
+
additional_paths: []
|
17
15
|
|
18
16
|
# Reload manifest.json on all requests so we reload latest compiled packs
|
19
17
|
cache_manifest: false
|
20
18
|
|
21
|
-
# We override the development env. when packed.
|
22
|
-
# Avo needs to be packed and compiled for when the dev uses it in his development env.
|
23
19
|
development:
|
24
20
|
<<: *default
|
25
|
-
|
26
|
-
# Production depends on precompilation of packs prior to booting for performance.
|
27
21
|
compile: true
|
28
22
|
|
29
|
-
#
|
30
|
-
|
23
|
+
# Reference: https://webpack.js.org/configuration/dev-server/
|
24
|
+
dev_server:
|
25
|
+
https: false
|
26
|
+
host: localhost
|
27
|
+
port: 3039
|
28
|
+
public: localhost:3039
|
29
|
+
# Inject browserside javascript that required by both HMR and Live(full) reload
|
30
|
+
inject_client: true
|
31
|
+
# Hot Module Replacement updates modules while the application is running without a full reload
|
32
|
+
hmr: true
|
33
|
+
# Inline should be set to true if using HMR; it inserts a script to take care of live reloading
|
34
|
+
inline: true
|
35
|
+
# Should we show a full-screen overlay in the browser when there are compiler errors or warnings?
|
36
|
+
overlay: true
|
37
|
+
# Should we use gzip compression?
|
38
|
+
compress: true
|
39
|
+
# Note that apps that do not check the host are vulnerable to DNS rebinding attacks
|
40
|
+
disable_host_check: true
|
41
|
+
# This option lets the browser open with your local IP
|
42
|
+
use_local_ip: false
|
43
|
+
# When enabled, nothing except the initial startup information will be written to the console.
|
44
|
+
# This also means that errors or warnings from webpack are not visible.
|
45
|
+
quiet: false
|
46
|
+
pretty: true
|
47
|
+
headers:
|
48
|
+
'Access-Control-Allow-Origin': '*'
|
49
|
+
watch_options:
|
50
|
+
ignored: '**/node_modules/**'
|
51
|
+
env_prefix: "AVO_WEBPACKER_DEV_SERVER"
|
31
52
|
|
32
53
|
test:
|
33
54
|
<<: *default
|
@@ -0,0 +1,79 @@
|
|
1
|
+
# Note: You must restart bin/webpack-dev-server for changes to take effect
|
2
|
+
|
3
|
+
default: &default
|
4
|
+
source_path: app/packs
|
5
|
+
source_entry_path: entrypoints
|
6
|
+
public_root_path: public
|
7
|
+
cache_path: tmp/cache/webpacker
|
8
|
+
check_yarn_integrity: false
|
9
|
+
# use a different sub-folder name
|
10
|
+
public_output_path: avo-packs
|
11
|
+
webpack_compile_output: true
|
12
|
+
extract_css: true
|
13
|
+
|
14
|
+
# Additional paths webpack should lookup modules
|
15
|
+
# ['app/assets', 'engine/foo/app/assets']
|
16
|
+
additional_paths_paths: []
|
17
|
+
|
18
|
+
# Reload manifest.json on all requests so we reload latest compiled packs
|
19
|
+
cache_manifest: false
|
20
|
+
|
21
|
+
# We override the development env. when packed.
|
22
|
+
# Avo needs to be packed and compiled for when the dev uses it in his development env.
|
23
|
+
development:
|
24
|
+
<<: *default
|
25
|
+
|
26
|
+
# Production depends on precompilation of packs prior to booting for performance.
|
27
|
+
compile: true
|
28
|
+
|
29
|
+
# Cache manifest.json for performance
|
30
|
+
cache_manifest: true
|
31
|
+
|
32
|
+
# Even though Avo does not use the dev_server when packed we still need to add the info here.
|
33
|
+
# The packed version of Avo will pick up the parent's app information.
|
34
|
+
# Reference: https://webpack.js.org/configuration/dev-server/
|
35
|
+
dev_server:
|
36
|
+
https: false
|
37
|
+
host: localhost
|
38
|
+
port: 3039
|
39
|
+
public: localhost:3039
|
40
|
+
# Inject browserside javascript that required by both HMR and Live(full) reload
|
41
|
+
inject_client: true
|
42
|
+
# Hot Module Replacement updates modules while the application is running without a full reload
|
43
|
+
hmr: true
|
44
|
+
# Inline should be set to true if using HMR; it inserts a script to take care of live reloading
|
45
|
+
inline: true
|
46
|
+
# Should we show a full-screen overlay in the browser when there are compiler errors or warnings?
|
47
|
+
overlay: true
|
48
|
+
# Should we use gzip compression?
|
49
|
+
compress: true
|
50
|
+
# Note that apps that do not check the host are vulnerable to DNS rebinding attacks
|
51
|
+
disable_host_check: true
|
52
|
+
# This option lets the browser open with your local IP
|
53
|
+
use_local_ip: false
|
54
|
+
# When enabled, nothing except the initial startup information will be written to the console.
|
55
|
+
# This also means that errors or warnings from webpack are not visible.
|
56
|
+
quiet: false
|
57
|
+
pretty: true
|
58
|
+
headers:
|
59
|
+
'Access-Control-Allow-Origin': '*'
|
60
|
+
watch_options:
|
61
|
+
ignored: '**/node_modules/**'
|
62
|
+
env_prefix: "AVO_WEBPACKER_DEV_SERVER"
|
63
|
+
|
64
|
+
test:
|
65
|
+
<<: *default
|
66
|
+
compile: true
|
67
|
+
|
68
|
+
# Compile test packs to a separate directory
|
69
|
+
public_output_path: packs-test
|
70
|
+
public_root_path: spec/dummy/public
|
71
|
+
|
72
|
+
production:
|
73
|
+
<<: *default
|
74
|
+
|
75
|
+
# Production depends on precompilation of packs prior to booting for performance.
|
76
|
+
compile: false
|
77
|
+
|
78
|
+
# Cache manifest.json for performance
|
79
|
+
cache_manifest: true
|
data/lib/avo/base_resource.rb
CHANGED
@@ -222,7 +222,7 @@ module Avo
|
|
222
222
|
params.each do |key, value|
|
223
223
|
field = fields_by_database_id[key]
|
224
224
|
|
225
|
-
next unless field
|
225
|
+
next unless field.present?
|
226
226
|
|
227
227
|
model = field.fill_field model, key, value
|
228
228
|
end
|
@@ -238,7 +238,7 @@ module Avo
|
|
238
238
|
content_to_be_hashed = ""
|
239
239
|
|
240
240
|
# resource file hash
|
241
|
-
resource_path = Rails.root.join("app", "avo", "resources", "#{self.class.name.underscore}
|
241
|
+
resource_path = Rails.root.join("app", "avo", "resources", "#{self.class.name.underscore}.rb").to_s
|
242
242
|
if File.file? resource_path
|
243
243
|
content_to_be_hashed += File.read(resource_path)
|
244
244
|
end
|