avo 2.18.1 → 2.19.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 (79) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +4 -5
  3. data/Gemfile.lock +75 -76
  4. data/app/components/avo/actions_component.html.erb +1 -1
  5. data/app/components/avo/actions_component.rb +4 -4
  6. data/app/components/avo/base_component.rb +17 -0
  7. data/app/components/avo/field_wrapper_component.rb +7 -1
  8. data/app/components/avo/fields/has_one_field/show_component.rb +1 -2
  9. data/app/components/avo/fields/index_component.rb +4 -3
  10. data/app/components/avo/filters_component.html.erb +1 -1
  11. data/app/components/avo/filters_component.rb +2 -2
  12. data/app/components/avo/index/grid_item_component.rb +2 -2
  13. data/app/components/avo/index/resource_controls_component.rb +2 -2
  14. data/app/components/avo/index/table_row_component.html.erb +1 -1
  15. data/app/components/avo/item_switcher_component.html.erb +1 -1
  16. data/app/components/avo/resource_component.rb +1 -1
  17. data/app/components/avo/resource_sidebar_component.rb +1 -6
  18. data/app/components/avo/sidebar_profile_component.rb +3 -1
  19. data/app/components/avo/tab_group_component.rb +1 -1
  20. data/app/components/avo/views/resource_show_component.html.erb +1 -1
  21. data/app/controllers/avo/application_controller.rb +6 -0
  22. data/app/controllers/avo/base_controller.rb +14 -7
  23. data/app/controllers/avo/dashboards/cards_controller.rb +37 -0
  24. data/app/helpers/avo/application_helper.rb +5 -1
  25. data/app/javascript/js/controllers/search_controller.js +11 -2
  26. data/app/views/avo/{cards → dashboards/cards}/_chartkick_card.html.erb +0 -0
  27. data/app/views/avo/{cards → dashboards/cards}/_metric_card.html.erb +0 -0
  28. data/app/views/avo/{cards → dashboards/cards}/chartkick_missing.html.erb +0 -0
  29. data/app/views/avo/{cards → dashboards/cards}/show.html.erb +0 -0
  30. data/app/views/avo/partials/_branding.html.erb +1 -0
  31. data/avo.gemspec +1 -1
  32. data/bin/init +11 -1
  33. data/bin/test +1 -0
  34. data/config/routes.rb +2 -2
  35. data/db/factories.rb +10 -0
  36. data/lib/avo/app.rb +11 -1
  37. data/lib/avo/base_action.rb +19 -9
  38. data/lib/avo/base_resource.rb +3 -6
  39. data/lib/avo/concerns/filters_session_handler.rb +43 -0
  40. data/lib/avo/concerns/has_fields.rb +2 -0
  41. data/lib/avo/concerns/visible_items.rb +44 -0
  42. data/lib/avo/configuration/branding.rb +10 -2
  43. data/lib/avo/configuration.rb +3 -0
  44. data/lib/avo/dynamic_router.rb +16 -15
  45. data/lib/avo/engine.rb +6 -9
  46. data/lib/avo/fields/base_field.rb +21 -12
  47. data/lib/avo/fields/concerns/has_default.rb +17 -0
  48. data/lib/avo/fields/concerns/is_readonly.rb +1 -1
  49. data/lib/avo/fields/concerns/is_required.rb +2 -2
  50. data/lib/avo/fields/has_base_field.rb +2 -0
  51. data/lib/avo/fields/key_value_field.rb +1 -1
  52. data/lib/avo/filters/base_filter.rb +17 -2
  53. data/lib/avo/hosts/resource_view_record_host.rb +7 -0
  54. data/lib/avo/hosts/visibility_host.rb +11 -0
  55. data/lib/avo/panel.rb +4 -1
  56. data/lib/avo/resources/controls/action.rb +1 -3
  57. data/lib/avo/sidebar.rb +1 -31
  58. data/lib/avo/tab.rb +5 -22
  59. data/lib/avo/version.rb +1 -1
  60. data/lib/avo.rb +9 -0
  61. data/lib/generators/avo/resource_generator.rb +281 -0
  62. data/lib/generators/avo/templates/action.tt +3 -0
  63. data/lib/generators/avo/templates/filters/boolean_filter.tt +3 -0
  64. data/lib/generators/avo/templates/filters/multiple_select_filter.tt +3 -0
  65. data/lib/generators/avo/templates/filters/select_filter.tt +3 -0
  66. data/lib/generators/avo/templates/filters/text_filter.tt +3 -0
  67. data/lib/generators/avo/templates/initializer/avo.tt +4 -0
  68. data/lib/generators/avo/templates/resource/controller.tt +1 -1
  69. data/lib/generators/avo/templates/resource/resource.tt +2 -2
  70. data/lib/generators/model_generator.rb +10 -0
  71. data/lib/generators/rails/avo_resource_generator.rb +11 -0
  72. data/public/avo-assets/avo.base.css +10 -10
  73. data/public/avo-assets/avo.base.js +1 -1
  74. data/public/avo-assets/avo.base.js.map +2 -2
  75. data/public/avo-assets/favicon.ico +0 -0
  76. data/{app/assets/svgs → public/avo-assets}/placeholder.svg +0 -0
  77. metadata +18 -11
  78. data/app/controllers/avo/cards_controller.rb +0 -35
  79. data/config/master.key +0 -1
Binary file
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: 2.18.1
4
+ version: 2.19.0
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: 2022-11-02 00:00:00.000000000 Z
12
+ date: 2022-11-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activerecord
@@ -59,14 +59,14 @@ dependencies:
59
59
  requirements:
60
60
  - - ">="
61
61
  - !ruby/object:Gem::Version
62
- version: '0'
62
+ version: 2.6.2
63
63
  type: :runtime
64
64
  prerelease: false
65
65
  version_requirements: !ruby/object:Gem::Requirement
66
66
  requirements:
67
67
  - - ">="
68
68
  - !ruby/object:Gem::Version
69
- version: '0'
69
+ version: 2.6.2
70
70
  - !ruby/object:Gem::Dependency
71
71
  name: httparty
72
72
  requirement: !ruby/object:Gem::Requirement
@@ -1309,7 +1309,6 @@ files:
1309
1309
  - app/assets/svgs/menu-back.svg
1310
1310
  - app/assets/svgs/menu.svg
1311
1311
  - app/assets/svgs/photograph.svg
1312
- - app/assets/svgs/placeholder.svg
1313
1312
  - app/assets/svgs/play.svg
1314
1313
  - app/assets/svgs/plus-circle.svg
1315
1314
  - app/assets/svgs/plus.svg
@@ -1596,7 +1595,7 @@ files:
1596
1595
  - app/controllers/avo/associations_controller.rb
1597
1596
  - app/controllers/avo/attachments_controller.rb
1598
1597
  - app/controllers/avo/base_controller.rb
1599
- - app/controllers/avo/cards_controller.rb
1598
+ - app/controllers/avo/dashboards/cards_controller.rb
1600
1599
  - app/controllers/avo/dashboards_controller.rb
1601
1600
  - app/controllers/avo/debug_controller.rb
1602
1601
  - app/controllers/avo/home_controller.rb
@@ -1659,10 +1658,10 @@ files:
1659
1658
  - app/views/avo/base/index.html.erb
1660
1659
  - app/views/avo/base/new.html.erb
1661
1660
  - app/views/avo/base/show.html.erb
1662
- - app/views/avo/cards/_chartkick_card.html.erb
1663
- - app/views/avo/cards/_metric_card.html.erb
1664
- - app/views/avo/cards/chartkick_missing.html.erb
1665
- - app/views/avo/cards/show.html.erb
1661
+ - app/views/avo/dashboards/cards/_chartkick_card.html.erb
1662
+ - app/views/avo/dashboards/cards/_metric_card.html.erb
1663
+ - app/views/avo/dashboards/cards/chartkick_missing.html.erb
1664
+ - app/views/avo/dashboards/cards/show.html.erb
1666
1665
  - app/views/avo/dashboards/show.html.erb
1667
1666
  - app/views/avo/debug/index.html.erb
1668
1667
  - app/views/avo/debug/report.html.erb
@@ -1708,7 +1707,6 @@ files:
1708
1707
  - config/credentials.yml.enc
1709
1708
  - config/i18n-tasks.yml
1710
1709
  - config/initializers/pagy.rb
1711
- - config/master.key
1712
1710
  - config/routes.rb
1713
1711
  - config/spring.rb
1714
1712
  - db/factories.rb
@@ -1721,6 +1719,7 @@ files:
1721
1719
  - lib/avo/base_resource_tool.rb
1722
1720
  - lib/avo/concerns/can_replace_fields.rb
1723
1721
  - lib/avo/concerns/fetches_things.rb
1722
+ - lib/avo/concerns/filters_session_handler.rb
1724
1723
  - lib/avo/concerns/handles_field_args.rb
1725
1724
  - lib/avo/concerns/has_editable_controls.rb
1726
1725
  - lib/avo/concerns/has_fields.rb
@@ -1728,6 +1727,7 @@ files:
1728
1727
  - lib/avo/concerns/has_stimulus_controllers.rb
1729
1728
  - lib/avo/concerns/is_resource_item.rb
1730
1729
  - lib/avo/concerns/model_class_constantized.rb
1730
+ - lib/avo/concerns/visible_items.rb
1731
1731
  - lib/avo/configuration.rb
1732
1732
  - lib/avo/configuration/branding.rb
1733
1733
  - lib/avo/configuration/resource_configuration.rb
@@ -1746,6 +1746,7 @@ files:
1746
1746
  - lib/avo/fields/boolean_field.rb
1747
1747
  - lib/avo/fields/boolean_group_field.rb
1748
1748
  - lib/avo/fields/code_field.rb
1749
+ - lib/avo/fields/concerns/has_default.rb
1749
1750
  - lib/avo/fields/concerns/is_readonly.rb
1750
1751
  - lib/avo/fields/concerns/is_required.rb
1751
1752
  - lib/avo/fields/country_field.rb
@@ -1793,8 +1794,10 @@ files:
1793
1794
  - lib/avo/hosts/dashboard_visibility.rb
1794
1795
  - lib/avo/hosts/ordering.rb
1795
1796
  - lib/avo/hosts/record_host.rb
1797
+ - lib/avo/hosts/resource_view_record_host.rb
1796
1798
  - lib/avo/hosts/search_scope_host.rb
1797
1799
  - lib/avo/hosts/view_record_host.rb
1800
+ - lib/avo/hosts/visibility_host.rb
1798
1801
  - lib/avo/html/builder.rb
1799
1802
  - lib/avo/items_holder.rb
1800
1803
  - lib/avo/licensing/community_license.rb
@@ -1901,11 +1904,14 @@ files:
1901
1904
  - lib/generators/avo/templates/tool/view.tt
1902
1905
  - lib/generators/avo/tool_generator.rb
1903
1906
  - lib/generators/avo/version_generator.rb
1907
+ - lib/generators/model_generator.rb
1908
+ - lib/generators/rails/avo_resource_generator.rb
1904
1909
  - lib/tasks/avo_tasks.rake
1905
1910
  - lib/tasks/tailwindcss_rails.rake
1906
1911
  - public/avo-assets/avo.base.css
1907
1912
  - public/avo-assets/avo.base.js
1908
1913
  - public/avo-assets/avo.base.js.map
1914
+ - public/avo-assets/favicon.ico
1909
1915
  - public/avo-assets/fonts/inter-v7-latin-500.eot
1910
1916
  - public/avo-assets/fonts/inter-v7-latin-500.svg
1911
1917
  - public/avo-assets/fonts/inter-v7-latin-500.ttf
@@ -1929,6 +1935,7 @@ files:
1929
1935
  - public/avo-assets/logo-on-white.png
1930
1936
  - public/avo-assets/logo.png
1931
1937
  - public/avo-assets/logomark.png
1938
+ - public/avo-assets/placeholder.svg
1932
1939
  homepage: https://avohq.io
1933
1940
  licenses:
1934
1941
  - Commercial
@@ -1,35 +0,0 @@
1
- require_dependency "avo/application_controller"
2
-
3
- module Avo
4
- class CardsController < ApplicationController
5
- before_action :set_dashboard
6
- before_action :set_card
7
- before_action :detect_chartkick
8
-
9
- def show
10
- render(:chartkick_missing) unless @chartkick_installed
11
- end
12
-
13
- private
14
-
15
- def set_dashboard
16
- @dashboard = Avo::App.get_dashboard_by_id params[:dashboard_id]
17
-
18
- raise ActionController::RoutingError.new("Not Found") if @dashboard.nil? || @dashboard.is_hidden?
19
- end
20
-
21
- def set_card
22
- @card = @dashboard.item_at_index(params[:index].to_i).tap do |card|
23
- card.hydrate(dashboard: @dashboard, params: params)
24
- end
25
- end
26
-
27
- def detect_chartkick
28
- @chartkick_installed = if @card.class.ancestors.map(&:to_s).include?("Avo::Dashboards::ChartkickCard")
29
- defined?(Chartkick)
30
- else
31
- true
32
- end
33
- end
34
- end
35
- end
data/config/master.key DELETED
@@ -1 +0,0 @@
1
- 2aeb23d82b909d9c6b5abb62f7058c2a