avo 3.0.0.pre8 → 3.0.0.pre9

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 (54) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/app/assets/stylesheets/avo.base.css +0 -1
  4. data/app/assets/svgs/map-empty-state.svg +35 -0
  5. data/app/assets/svgs/map-view-type.svg +3 -0
  6. data/app/components/avo/field_wrapper_component.html.erb +2 -2
  7. data/app/components/avo/fields/area_field/edit_component.html.erb +7 -0
  8. data/app/components/avo/fields/area_field/edit_component.rb +4 -0
  9. data/app/components/avo/fields/area_field/show_component.html.erb +8 -0
  10. data/app/components/avo/fields/area_field/show_component.rb +4 -0
  11. data/app/components/avo/fields/common/files/controls_component.html.erb +29 -0
  12. data/app/components/avo/fields/common/files/controls_component.rb +19 -0
  13. data/app/components/avo/fields/common/files/list_viewer_component.html.erb +20 -0
  14. data/app/components/avo/fields/common/files/list_viewer_component.rb +41 -0
  15. data/app/components/avo/fields/common/files/view_type/grid_component.html.erb +27 -0
  16. data/app/components/avo/fields/common/{single_file_viewer_component.rb → files/view_type/grid_component.rb} +2 -9
  17. data/app/components/avo/fields/common/files/view_type/list_component.html.erb +22 -0
  18. data/app/components/avo/fields/common/files/view_type/list_component.rb +15 -0
  19. data/app/components/avo/fields/country_field/edit_component.html.erb +2 -1
  20. data/app/components/avo/fields/file_field/edit_component.html.erb +1 -1
  21. data/app/components/avo/fields/file_field/show_component.html.erb +1 -1
  22. data/app/components/avo/fields/files_field/edit_component.html.erb +1 -1
  23. data/app/components/avo/fields/files_field/show_component.html.erb +1 -1
  24. data/app/components/avo/fields/location_field/show_component.html.erb +1 -1
  25. data/app/components/avo/fields/number_field/edit_component.html.erb +2 -1
  26. data/app/components/avo/fields/password_field/edit_component.html.erb +2 -1
  27. data/app/components/avo/fields/select_field/edit_component.html.erb +2 -1
  28. data/app/components/avo/fields/text_field/edit_component.html.erb +2 -1
  29. data/app/components/avo/index/resource_map_component.html.erb +16 -0
  30. data/app/components/avo/index/resource_map_component.rb +109 -0
  31. data/app/components/avo/views/resource_index_component.html.erb +10 -1
  32. data/app/controllers/avo/application_controller.rb +5 -1
  33. data/app/controllers/avo/attachments_controller.rb +15 -8
  34. data/app/views/avo/attachments/destroy.turbo_stream.erb +7 -0
  35. data/app/views/avo/partials/_view_toggle_button.html.erb +9 -0
  36. data/db/factories.rb +15 -0
  37. data/lib/avo/app.rb +12 -6
  38. data/lib/avo/base_action.rb +4 -4
  39. data/lib/avo/base_resource.rb +2 -0
  40. data/lib/avo/fields/area_field.rb +39 -0
  41. data/lib/avo/fields/base_field.rb +6 -2
  42. data/lib/avo/fields/files_field.rb +4 -0
  43. data/lib/avo/fields/location_field.rb +0 -1
  44. data/lib/avo/resources/resource_manager.rb +7 -11
  45. data/lib/avo/services/debug_service.rb +1 -0
  46. data/lib/avo/services/telemetry_service.rb +1 -0
  47. data/lib/avo/version.rb +1 -1
  48. data/lib/generators/avo/tailwindcss/install_generator.rb +4 -1
  49. data/lib/generators/avo/templates/tailwindcss/Procfile.dev +1 -1
  50. data/public/avo-assets/avo.base.css +1395 -1349
  51. metadata +20 -6
  52. data/app/components/avo/fields/common/files_list_viewer_component.html.erb +0 -5
  53. data/app/components/avo/fields/common/files_list_viewer_component.rb +0 -8
  54. data/app/components/avo/fields/common/single_file_viewer_component.html.erb +0 -57
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: avo
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0.pre8
4
+ version: 3.0.0.pre9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adrian Marin
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2023-05-10 00:00:00.000000000 Z
12
+ date: 2023-05-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activerecord
@@ -1292,6 +1292,8 @@ files:
1292
1292
  - app/assets/svgs/information-circle.svg
1293
1293
  - app/assets/svgs/library.svg
1294
1294
  - app/assets/svgs/logout.svg
1295
+ - app/assets/svgs/map-empty-state.svg
1296
+ - app/assets/svgs/map-view-type.svg
1295
1297
  - app/assets/svgs/menu-back.svg
1296
1298
  - app/assets/svgs/menu.svg
1297
1299
  - app/assets/svgs/photograph.svg
@@ -1338,6 +1340,10 @@ files:
1338
1340
  - app/components/avo/empty_state_component.rb
1339
1341
  - app/components/avo/field_wrapper_component.html.erb
1340
1342
  - app/components/avo/field_wrapper_component.rb
1343
+ - app/components/avo/fields/area_field/edit_component.html.erb
1344
+ - app/components/avo/fields/area_field/edit_component.rb
1345
+ - app/components/avo/fields/area_field/show_component.html.erb
1346
+ - app/components/avo/fields/area_field/show_component.rb
1341
1347
  - app/components/avo/fields/badge_field/index_component.html.erb
1342
1348
  - app/components/avo/fields/badge_field/index_component.rb
1343
1349
  - app/components/avo/fields/badge_field/show_component.html.erb
@@ -1370,8 +1376,14 @@ files:
1370
1376
  - app/components/avo/fields/common/boolean_check_component.rb
1371
1377
  - app/components/avo/fields/common/boolean_group_component.html.erb
1372
1378
  - app/components/avo/fields/common/boolean_group_component.rb
1373
- - app/components/avo/fields/common/files_list_viewer_component.html.erb
1374
- - app/components/avo/fields/common/files_list_viewer_component.rb
1379
+ - app/components/avo/fields/common/files/controls_component.html.erb
1380
+ - app/components/avo/fields/common/files/controls_component.rb
1381
+ - app/components/avo/fields/common/files/list_viewer_component.html.erb
1382
+ - app/components/avo/fields/common/files/list_viewer_component.rb
1383
+ - app/components/avo/fields/common/files/view_type/grid_component.html.erb
1384
+ - app/components/avo/fields/common/files/view_type/grid_component.rb
1385
+ - app/components/avo/fields/common/files/view_type/list_component.html.erb
1386
+ - app/components/avo/fields/common/files/view_type/list_component.rb
1375
1387
  - app/components/avo/fields/common/gravatar_viewer_component.html.erb
1376
1388
  - app/components/avo/fields/common/gravatar_viewer_component.rb
1377
1389
  - app/components/avo/fields/common/heading_component.html.erb
@@ -1380,8 +1392,6 @@ files:
1380
1392
  - app/components/avo/fields/common/key_value_component.rb
1381
1393
  - app/components/avo/fields/common/progress_bar_component.html.erb
1382
1394
  - app/components/avo/fields/common/progress_bar_component.rb
1383
- - app/components/avo/fields/common/single_file_viewer_component.html.erb
1384
- - app/components/avo/fields/common/single_file_viewer_component.rb
1385
1395
  - app/components/avo/fields/common/status_viewer_component.html.erb
1386
1396
  - app/components/avo/fields/common/status_viewer_component.rb
1387
1397
  - app/components/avo/fields/concerns/item_labels.rb
@@ -1520,6 +1530,8 @@ files:
1520
1530
  - app/components/avo/index/resource_controls_component.rb
1521
1531
  - app/components/avo/index/resource_grid_component.html.erb
1522
1532
  - app/components/avo/index/resource_grid_component.rb
1533
+ - app/components/avo/index/resource_map_component.html.erb
1534
+ - app/components/avo/index/resource_map_component.rb
1523
1535
  - app/components/avo/index/resource_table_component.html.erb
1524
1536
  - app/components/avo/index/resource_table_component.rb
1525
1537
  - app/components/avo/index/table_row_component.html.erb
@@ -1629,6 +1641,7 @@ files:
1629
1641
  - app/views/avo/actions/keep_modal_open.turbo_stream.erb
1630
1642
  - app/views/avo/actions/show.html.erb
1631
1643
  - app/views/avo/associations/new.html.erb
1644
+ - app/views/avo/attachments/destroy.turbo_stream.erb
1632
1645
  - app/views/avo/base/_boolean_filter.html.erb
1633
1646
  - app/views/avo/base/_multiple_select_filter.html.erb
1634
1647
  - app/views/avo/base/_select_filter.html.erb
@@ -1713,6 +1726,7 @@ files:
1713
1726
  - lib/avo/engine.rb
1714
1727
  - lib/avo/error_manager.rb
1715
1728
  - lib/avo/execution_context.rb
1729
+ - lib/avo/fields/area_field.rb
1716
1730
  - lib/avo/fields/badge_field.rb
1717
1731
  - lib/avo/fields/base_field.rb
1718
1732
  - lib/avo/fields/belongs_to_field.rb
@@ -1,5 +0,0 @@
1
- <div class="relative py-3 grid xs:grid-cols-2 sm:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4 gap-3 rounded-xl">
2
- <% @field.value.attachments.each do |file| %>
3
- <%= render Avo::Fields::Common::SingleFileViewerComponent.new field: @field, resource: @resource, file: file %>
4
- <% end %>
5
- </div>
@@ -1,8 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- class Avo::Fields::Common::FilesListViewerComponent < ViewComponent::Base
4
- def initialize(field:, resource:)
5
- @field = field
6
- @resource = resource
7
- end
8
- end
@@ -1,57 +0,0 @@
1
- <div class="relative min-h-full max-w-full flex-1 flex flex-col justify-between space-y-3">
2
- <% if file.present? %>
3
- <div class="flex flex-col justify-between h-full">
4
- <% if file.representable? && is_image? %>
5
- <div class="max-h-[42rem] h-full flex">
6
- <%= image_tag helpers.main_app.url_for(file), class: 'rounded-lg object-cover' %>
7
- </div>
8
- <% elsif is_audio? %>
9
- <%= audio_tag(helpers.main_app.url_for(file), controls: true, preload: false, class: 'w-full') %>
10
- <% elsif is_video? %>
11
- <%= video_tag(helpers.main_app.url_for(file), controls: true, preload: false, class: 'w-full') %>
12
- <% else %>
13
- <div class="relative flex flex-col justify-evenly items-center px-2 rounded-lg border bg-white border-gray-500 min-h-24">
14
- <div class="flex flex-col justify-center items-center w-full">
15
- <%= helpers.svg 'document-text', class: 'h-10 text-gray-600 mb-2' %>
16
- </div>
17
- </div>
18
- <% end %>
19
- <% if field.display_filename %>
20
- <span class="text-gray-500 mt-2 text-sm truncate" title="<%= file.filename %>"><%= file.filename %></span>
21
- <% end %>
22
- </div>
23
- <div class="flex space-x-2">
24
- <div class="flex">
25
- <% if can_download_file? %>
26
- <%= a_link Rails.application.routes.url_helpers.rails_blob_path(file, only_path: true, disposition: :attachment),
27
- icon: 'heroicons/outline/download',
28
- color: :primary,
29
- download: true,
30
- class: 'text-center',
31
- title: t('avo.download_file'),
32
- data: { tippy: :tooltip },
33
- compact: true,
34
- size: :xs %>
35
- <% end %>
36
- </div>
37
- <div>
38
- <% if can_delete_file? %>
39
- <%= a_link destroy_path,
40
- icon: 'heroicons/outline/trash',
41
- color: :red,
42
- compact: true,
43
- size: :xs,
44
- class: 'text-center',
45
- title: t('avo.delete_file', item: file.filename),
46
- data: {
47
- turbo_method: :delete,
48
- turbo_confirm: t('avo.are_you_sure'),
49
- tippy: :tooltip
50
- } %>
51
- <% end %>
52
- </div>
53
- </div>
54
- <% else %>
55
-
56
- <% end %>
57
- </div>