avo 2.2.2 → 2.3.1.pre.2

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 (34) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +2 -0
  3. data/Gemfile.lock +7 -1
  4. data/app/assets/builds/avo.css +8840 -0
  5. data/app/assets/builds/avo.js +423 -0
  6. data/app/assets/builds/avo.js.map +7 -0
  7. data/app/components/avo/sidebar/base_item_component.rb +1 -1
  8. data/app/components/avo/sidebar/group_component.html.erb +17 -15
  9. data/app/components/avo/sidebar/heading_component.html.erb +1 -1
  10. data/app/components/avo/sidebar/heading_component.rb +3 -1
  11. data/app/components/avo/sidebar/section_component.html.erb +4 -4
  12. data/app/components/avo/sidebar_component.html.erb +1 -1
  13. data/app/components/avo/views/resource_index_component.html.erb +19 -21
  14. data/app/controllers/avo/actions_controller.rb +1 -1
  15. data/app/controllers/avo/application_controller.rb +5 -1
  16. data/app/controllers/avo/base_controller.rb +9 -1
  17. data/app/controllers/avo/debug_controller.rb +24 -0
  18. data/app/javascript/avo.js +13 -0
  19. data/app/javascript/js/controllers/copy_to_clipboard_controller.js +37 -0
  20. data/app/javascript/js/controllers/menu_controller.js +23 -18
  21. data/app/javascript/js/controllers.js +2 -0
  22. data/app/views/avo/debug/index.html.erb +87 -0
  23. data/config/routes.rb +4 -1
  24. data/lib/avo/app.rb +18 -0
  25. data/lib/avo/licensing/h_q.rb +53 -48
  26. data/lib/avo/licensing/license.rb +8 -0
  27. data/lib/avo/licensing/license_manager.rb +4 -0
  28. data/lib/avo/services/authorization_service.rb +8 -2
  29. data/lib/avo/version.rb +1 -1
  30. data/lib/generators/avo/templates/initializer/avo.tt +23 -3
  31. data/public/avo-assets/avo.css +18 -5
  32. data/public/avo-assets/avo.js +58 -58
  33. data/public/avo-assets/avo.js.map +3 -3
  34. metadata +10 -4
@@ -15,6 +15,10 @@ module Avo
15
15
  NullLicense.new @hq_response
16
16
  end
17
17
  end
18
+
19
+ def self.refresh_license(request)
20
+ self.new(Licensing::HQ.new(request).fresh_response).license
21
+ end
18
22
  end
19
23
  end
20
24
  end
@@ -68,11 +68,17 @@ module Avo
68
68
  def authorize_action(user, record, action, **args)
69
69
  action = Avo.configuration.authorization_methods.stringify_keys[action.to_s] || action
70
70
 
71
+ # If no action passed we should raise error if the user wants that.
72
+ # If not, just allow it.
73
+ if action.nil?
74
+ raise Pundit::NotDefinedError.new 'Policy method is missing' if Avo.configuration.raise_error_on_missing_policy
75
+
76
+ return true
77
+ end
78
+
71
79
  # Add the question mark if it's missing
72
80
  action = "#{action}?" unless action.end_with? '?'
73
81
 
74
- return true if action.nil?
75
-
76
82
  authorize user, record, action, **args
77
83
  end
78
84
 
data/lib/avo/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Avo
2
- VERSION = "2.2.2"
2
+ VERSION = "2.3.1.pre.2" unless const_defined?(:VERSION)
3
3
  end
@@ -3,6 +3,9 @@ Avo.configure do |config|
3
3
  ## == Routing ==
4
4
  config.root_path = '/<%= options[:path] %>'
5
5
 
6
+ # Where should the user be redirected when he hits the `/<%= options[:path] %>` url
7
+ # config.home_path = nil
8
+
6
9
  ## == Licensing ==
7
10
  config.license = 'community' # change this to 'pro' when you add the license key
8
11
  # config.license_key = ENV['AVO_LICENSE_KEY']
@@ -26,6 +29,7 @@ Avo.configure do |config|
26
29
  # create: 'create?',
27
30
  # destroy: 'destroy?',
28
31
  # }
32
+ # config.raise_error_on_missing_policy = false
29
33
 
30
34
  ## == Localization ==
31
35
  # config.locale = 'en-US'
@@ -45,14 +49,30 @@ Avo.configure do |config|
45
49
  # config.search_debounce = 300
46
50
  # config.view_component_path = "app/components"
47
51
  # config.display_license_request_timeout_error = true
52
+ # config.disabled_features = []
48
53
 
49
54
 
50
- # Where should the user be redirected when he hits the `/<%= options[:path] %>` url
51
- # config.home_path = nil
52
-
53
55
  ## == Breadcrumbs ==
54
56
  # config.display_breadcrumbs = true
55
57
  # config.set_initial_breadcrumbs do
56
58
  # add_breadcrumb "Home", '/<%= options[:path] %>'
57
59
  # end
60
+
61
+ ## == Menus ==
62
+ # config.main_menu = -> {
63
+ # section "Dashboards", icon: "dashboards" do
64
+ # all_dashboards
65
+ # end
66
+
67
+ # section "Resources", icon: "resources" do
68
+ # all_resources
69
+ # end
70
+
71
+ # section "Tools", icon: "tools" do
72
+ # all_tools
73
+ # end
74
+ # }
75
+ # config.profile_menu = -> {
76
+ # link "Profile", path: "/<%= options[:path] %>/profile", icon: "user-circle"
77
+ # }
58
78
  end
@@ -6280,6 +6280,14 @@ progress[value]::-moz-progress-bar{
6280
6280
  z-index:60
6281
6281
  }
6282
6282
 
6283
+ .col-span-1{
6284
+ grid-column:span 1 / span 1
6285
+ }
6286
+
6287
+ .col-span-2{
6288
+ grid-column:span 2 / span 2
6289
+ }
6290
+
6283
6291
  .col-span-full{
6284
6292
  grid-column:1 / -1
6285
6293
  }
@@ -7476,6 +7484,11 @@ progress[value]::-moz-progress-bar{
7476
7484
  line-height:1
7477
7485
  }
7478
7486
 
7487
+ .text-xl{
7488
+ font-size:1.25rem;
7489
+ line-height:1.75rem
7490
+ }
7491
+
7479
7492
  .text-2xl{
7480
7493
  font-size:1.5rem;
7481
7494
  line-height:2rem
@@ -7669,6 +7682,11 @@ progress[value]::-moz-progress-bar{
7669
7682
  color:rgb(30 41 59 / var(--tw-text-opacity))
7670
7683
  }
7671
7684
 
7685
+ .text-red-600{
7686
+ --tw-text-opacity:1;
7687
+ color:rgb(220 38 38 / var(--tw-text-opacity))
7688
+ }
7689
+
7672
7690
  .text-gray-300{
7673
7691
  --tw-text-opacity:1;
7674
7692
  color:rgb(183 187 194 / var(--tw-text-opacity))
@@ -7684,11 +7702,6 @@ progress[value]::-moz-progress-bar{
7684
7702
  color:rgb(0 0 0 / var(--tw-text-opacity))
7685
7703
  }
7686
7704
 
7687
- .text-red-600{
7688
- --tw-text-opacity:1;
7689
- color:rgb(220 38 38 / var(--tw-text-opacity))
7690
- }
7691
-
7692
7705
  .text-slate-600{
7693
7706
  --tw-text-opacity:1;
7694
7707
  color:rgb(71 85 105 / var(--tw-text-opacity))