avo 1.13.0 → 1.14.0

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.

Files changed (35) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +1 -1
  3. data/Gemfile.lock +9 -9
  4. data/app/components/avo/fields/common/multiple_file_viewer_component.html.erb +14 -7
  5. data/app/components/avo/fields/common/single_file_viewer_component.html.erb +15 -7
  6. data/app/components/avo/fields/file_field/edit_component.html.erb +3 -1
  7. data/app/components/avo/fields/files_field/edit_component.html.erb +3 -1
  8. data/app/packs/js/controllers/search_controller.js +4 -1
  9. data/app/views/avo/base/_filters.html.erb +1 -1
  10. data/app/views/avo/partials/_global_search.html.erb +1 -1
  11. data/app/views/avo/sidebar/_sidebar.html.erb +1 -1
  12. data/lib/avo/fields_collector.rb +1 -0
  13. data/lib/avo/version.rb +1 -1
  14. data/lib/generators/avo/templates/locales/avo.en.yml +3 -0
  15. data/lib/generators/avo/templates/locales/avo.nb-NO.yml +2 -0
  16. data/lib/generators/avo/templates/locales/avo.pt-BR.yml +3 -0
  17. data/lib/generators/avo/templates/locales/avo.ro.yml +3 -0
  18. data/public/avo-packs/css/application-2b4685ca.css.map +1 -1
  19. data/public/avo-packs/css/application-2b4685ca.css.map.br +0 -0
  20. data/public/avo-packs/css/application-2b4685ca.css.map.gz +0 -0
  21. data/public/avo-packs/js/application-6dbb940fca2e811fb7d5.js +26 -0
  22. data/public/avo-packs/js/{application-24899bdd53fce059b07e.js.LICENSE.txt → application-6dbb940fca2e811fb7d5.js.LICENSE.txt} +0 -0
  23. data/public/avo-packs/js/application-6dbb940fca2e811fb7d5.js.br +0 -0
  24. data/public/avo-packs/js/application-6dbb940fca2e811fb7d5.js.gz +0 -0
  25. data/public/avo-packs/js/application-6dbb940fca2e811fb7d5.js.map +1 -0
  26. data/public/avo-packs/js/application-6dbb940fca2e811fb7d5.js.map.br +0 -0
  27. data/public/avo-packs/js/application-6dbb940fca2e811fb7d5.js.map.gz +0 -0
  28. data/public/avo-packs/manifest.json +8 -8
  29. metadata +9 -9
  30. data/public/avo-packs/js/application-24899bdd53fce059b07e.js +0 -26
  31. data/public/avo-packs/js/application-24899bdd53fce059b07e.js.br +0 -0
  32. data/public/avo-packs/js/application-24899bdd53fce059b07e.js.gz +0 -0
  33. data/public/avo-packs/js/application-24899bdd53fce059b07e.js.map +0 -1
  34. data/public/avo-packs/js/application-24899bdd53fce059b07e.js.map.br +0 -0
  35. data/public/avo-packs/js/application-24899bdd53fce059b07e.js.map.gz +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6fac5e283c3aabd29efc905f3bab4df83be334032184a2ffab8dc0adbfde06b1
4
- data.tar.gz: b1d05fd4b2a0653c45c6706c73501cc4dc0abe4234afdea079c4933f992ef8ba
3
+ metadata.gz: 629b21141b1ec354e7438f5e18cc8c5da295d255efecf5ecbdd8a01ab49bae69
4
+ data.tar.gz: 0dcf8a16ea1875213f781205ce06ef960b6cedf0eb1db2a18c1aa1725de42980
5
5
  SHA512:
6
- metadata.gz: 4f121808f7eafa809885e08907d0ab9eb8d65fca615557b02ac77e445e51cccce162a7eaa4c6276de47f08f0b35ac47a19482f008f7ee5d8bc0cd5d40b008e6e
7
- data.tar.gz: 9b4f1cdd7656911cde6f2140ff8395ba21e5c496cacac0f50a5edd10449c2702f9640449a93c121f146f5da2979a7fb685ebb0c3650072ab6f9d3582edf3fb30
6
+ metadata.gz: aafa9e05b6298fef31a0501a9904a81f91227f6a5c55929a606072ac627936fedb884207d613fd073d760f4e21669c88ba8f3606644629cbb20b12a500d95334
7
+ data.tar.gz: 70c2ad426664105c49ee2c83211c0778126f4f36e8e8bcb93aecc3295bd585f3b25cc248d03d0a8a9c0ed3b450748cae223facc909e79e908e871569e7b49f86
data/Gemfile CHANGED
@@ -30,7 +30,7 @@ gem "rails", "~> 6.1.0"
30
30
  # Use postgresql as the database for Active Record
31
31
  gem "pg", ">= 0.18", "< 2.0"
32
32
  # Use Puma as the app server
33
- gem "puma", "~> 5.3.1"
33
+ gem "puma", "~> 5.5.1"
34
34
  # Use SCSS for stylesheets
35
35
  gem "sass-rails", ">= 6"
36
36
  # Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- avo (1.13.0)
4
+ avo (1.14.0)
5
5
  active_link_to
6
6
  addressable
7
7
  breadcrumbs_on_rails
@@ -201,24 +201,24 @@ GEM
201
201
  mime-types-data (3.2021.0225)
202
202
  mini_magick (4.11.0)
203
203
  mini_mime (1.0.3)
204
- mini_portile2 (2.5.3)
204
+ mini_portile2 (2.6.1)
205
205
  minitest (5.14.4)
206
206
  msgpack (1.4.2)
207
207
  multi_xml (0.6.0)
208
- nio4r (2.5.7)
209
- nokogiri (1.11.7)
210
- mini_portile2 (~> 2.5.0)
208
+ nio4r (2.5.8)
209
+ nokogiri (1.12.5)
210
+ mini_portile2 (~> 2.6.1)
211
211
  racc (~> 1.4)
212
- nokogiri (1.11.7-x86_64-linux)
212
+ nokogiri (1.12.5-x86_64-linux)
213
213
  racc (~> 1.4)
214
214
  orm_adapter (0.5.0)
215
- pagy (4.10.1)
215
+ pagy (4.11.0)
216
216
  parallel (1.20.1)
217
217
  parser (3.0.0.0)
218
218
  ast (~> 2.4.1)
219
219
  pg (1.2.3)
220
220
  public_suffix (4.0.6)
221
- puma (5.3.1)
221
+ puma (5.5.1)
222
222
  nio4r (~> 2.0)
223
223
  pundit (2.1.0)
224
224
  activesupport (>= 3.0.0)
@@ -417,7 +417,7 @@ DEPENDENCIES
417
417
  manifester
418
418
  meta-tags
419
419
  pg (>= 0.18, < 2.0)
420
- puma (~> 5.3.1)
420
+ puma (~> 5.5.1)
421
421
  pundit
422
422
  rails (~> 6.1.0)
423
423
  rails-controller-testing
@@ -14,13 +14,20 @@
14
14
  <% end %>
15
15
 
16
16
  <div class="flex justify-between lg:flex-col lg:space-y-2 2xl:flex-row 2xl:space-y-0">
17
- <%= a_link helpers.main_app.url_for(@file), color: 'indigo', download: true, class: 'text-center', size: :xs do %>
18
- <%= helpers.svg 'download' %> <span class="hidden lg:block lg:flex-1"><%= t('avo.download_file') %></span>
19
- <% end %>
20
- <%= a_link "#{Avo::App.root_path}/resources/#{@resource.model.model_name.route_key}/#{@resource.model.id
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 'avo.delete_file', item: @file.filename %></span>
23
- <% end %>
17
+ <div>
18
+ <% if @resource.authorization.authorize_action(:download_attachments?, raise_exception: false) %>
19
+ <%= a_link helpers.main_app.url_for(@file), color: 'indigo', download: true, class: 'text-center', size: :xs do %>
20
+ <%= helpers.svg 'download' %> <span class="hidden lg:block lg:flex-1"><%= t('avo.download_file') %></span>
21
+ <% end %>
22
+ <% end %>
23
+ </div>
24
+ <div>
25
+ <% if @resource.authorization.authorize_action(:delete_attachments?, raise_exception: false) %>
26
+ <%= a_link "#{Avo::App.root_path}/resources/#{@resource.model.model_name.route_key}/#{@resource.model.id}/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 %>
27
+ <%= helpers.svg 'trash' %> <span class="hidden lg:block lg:flex-1"><%= t 'avo.delete_file', item: @file.filename %></span>
28
+ <% end %>
29
+ <% end %>
30
+ </div>
24
31
  </div>
25
32
  <% end %>
26
33
  </div>
@@ -14,13 +14,21 @@
14
14
  <% end %>
15
15
 
16
16
  <div class="flex justify-between">
17
- <%= a_link helpers.main_app.url_for(@file), color: 'indigo', download: true, class: '', size: :md do %>
18
- <%= helpers.svg 'download' %> <%= t('avo.download_file') %>
19
- <% end %>
20
- <%= a_link "#{Avo::App.root_path}/resources/#{@resource.model.model_name.route_key}/#{@resource.model.id
21
- }/active_storage_attachments/#{@id}/#{@file.blob_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 'avo.delete_file', item: @file.filename %>
23
- <% end %>
17
+ <div>
18
+ <% if @resource.authorization.authorize_action(:download_attachments?, raise_exception: false) %>
19
+ <%= a_link helpers.main_app.url_for(@file), color: 'indigo', download: true, class: '', size: :md do %>
20
+ <%= helpers.svg 'download' %> <%= t('avo.download_file') %>
21
+ <% end %>
22
+ <% end %>
23
+ </div>
24
+ <div>
25
+ <% if @resource.authorization.authorize_action(:delete_attachments?, raise_exception: false) %>
26
+ <%= a_link "#{Avo::App.root_path}/resources/#{@resource.model.model_name.route_key}/#{@resource.model.id
27
+ }/active_storage_attachments/#{@id}/#{@file.blob_id}", color: :red, variant: :outlined, size: :md, class: '', 'data-turbo-frame': 'destroy_attachment_form', data: { confirm: t('avo.are_you_sure')} do %>
28
+ <%= helpers.svg 'trash' %> <%= t 'avo.delete_file', item: @file.filename %>
29
+ <% end %>
30
+ <% end %>
31
+ </div>
24
32
  </div>
25
33
  <% else %>
26
34
 
@@ -5,5 +5,7 @@
5
5
  </div>
6
6
  <% end %>
7
7
 
8
- <%= @form.file_field @field.id, disabled: @field.readonly %>
8
+ <% if @resource.authorization.authorize_action(:upload_attachments?, raise_exception: false) %>
9
+ <%= @form.file_field @field.id, disabled: @field.readonly %>
10
+ <% end %>
9
11
  <% end %>
@@ -1,5 +1,7 @@
1
1
  <%= edit_field_wrapper field: @field, index: @index, form: @form, resource: @resource, displayed_in_modal: @displayed_in_modal, full_width: true do %>
2
2
  <%= render Avo::Fields::Common::FilesListViewerComponent.new(field: @field, resource: @resource) if @field.value.present? %>
3
3
 
4
- <%= @form.file_field @field.id, disabled: @field.readonly, multiple: true %>
4
+ <% if @resource.authorization.authorize_action(:upload_attachments?, raise_exception: false) %>
5
+ <%= @form.file_field @field.id, disabled: @field.readonly, multiple: true %>
6
+ <% end %>
5
7
  <% end %>
@@ -105,7 +105,10 @@ export default class extends Controller {
105
105
 
106
106
  autocomplete({
107
107
  container: this.autocompleteTarget,
108
- placeholder: 'Search',
108
+ placeholder: this.translationKeys.placeholder,
109
+ translations: {
110
+ detachedCancelButtonText: this.translationKeys.cancel_button,
111
+ },
109
112
  openOnFocus: true,
110
113
  detachedMediaQuery: '',
111
114
  getSources: ({ query }) => {
@@ -7,7 +7,7 @@
7
7
  'data-action': 'click->toggle-panel#togglePanel',
8
8
  'data-tippy': 'tooltip' do
9
9
  %>
10
- <% applied_filters = %>
10
+
11
11
  <%= svg 'filter' %> <%= t 'avo.filters' %>
12
12
  <% if params[:filters].present? %>
13
13
  <div class="ml-1">(<%=JSON.parse(Base64.decode64(params[:filters])).count%> applied)</div>
@@ -2,7 +2,7 @@
2
2
  <div class="inline-block"
3
3
  data-search-target="autocomplete"
4
4
  data-search-resource="global"
5
- data-translation-keys='{"no_item_found": "<%= I18n.translate 'avo.no_item_found' %>"}'
5
+ data-translation-keys='{"no_item_found": "<%= I18n.translate 'avo.no_item_found' %>", "placeholder": "<%= I18n.translate 'avo.search.placeholder' %>", "cancel_button": "<%= I18n.translate 'avo.search.cancel_button' %>"}'
6
6
  data-debounce-timeout='<%= Avo.configuration.search_debounce %>'
7
7
  >
8
8
  </div>
@@ -12,7 +12,7 @@
12
12
 
13
13
  <div class="w-full">
14
14
  <% Avo::App.resources_navigation(_current_user).each do |resource| %>
15
- <%= render Avo::NavigationLinkComponent.new label: resource.name.pluralize.humanize, path: resources_path(resource.model_class) %>
15
+ <%= render Avo::NavigationLinkComponent.new label: resource.plural_name.humanize, path: resources_path(resource.model_class) %>
16
16
  <% end %>
17
17
 
18
18
  <% sidebar_partials = Avo::App.get_sidebar_partials %>
@@ -40,6 +40,7 @@ module Avo
40
40
  end
41
41
 
42
42
  def heading(body, **args)
43
+ self.fields ||= []
43
44
  self.fields << Avo::Fields::HeadingField.new(body, **args)
44
45
  end
45
46
 
data/lib/avo/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Avo
2
- VERSION = "1.13.0"
2
+ VERSION = "1.14.0"
3
3
  end
@@ -80,3 +80,6 @@ en:
80
80
  other: 'users'
81
81
  reset_filters: 'Reset filters'
82
82
  not_authorized: 'You are not authorized to perform this action.'
83
+ search:
84
+ placeholder: 'Search'
85
+ cancel_button: 'Cancel'
@@ -78,3 +78,5 @@ nb-NO:
78
78
  other: 'brukere'
79
79
  reset_filters: 'Nullstill filter'
80
80
  not_authorized: 'Du er ikke autorisert til å gjøre denne handlingen.'
81
+ search_placeholder: 'Søk'
82
+ search_cancel_button: 'Avbryt'
@@ -79,3 +79,6 @@ pt-BR:
79
79
  other: 'usuários'
80
80
  reset_filters: 'Limpar filtros'
81
81
  not_authorized: 'Você não está autorizado à executar essa ação.'
82
+ search:
83
+ placeholder: 'Procurar'
84
+ cancel_button: 'Cancelar'
@@ -67,3 +67,6 @@ ro:
67
67
  zero: 'utilizatori'
68
68
  one: 'utilizator'
69
69
  other: 'utilizatori'
70
+ search:
71
+ placeholder: 'Cauta'
72
+ cancel_button: 'Anulare'