avo 3.0.1.beta4 → 3.0.1.beta6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of avo might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/app/components/avo/fields/common/status_viewer_component.html.erb +3 -0
- data/lib/avo/base_action.rb +1 -1
- data/lib/avo/base_resource.rb +1 -1
- data/lib/avo/configuration.rb +18 -2
- data/lib/avo/current.rb +0 -6
- data/lib/avo/fields/status_field.rb +3 -1
- data/lib/avo/filters/base_filter.rb +1 -1
- data/lib/avo/html/builder.rb +1 -1
- data/lib/avo/licensing/license_manager.rb +1 -4
- data/lib/avo/version.rb +1 -1
- data/lib/generators/avo/templates/initializer/avo.tt +0 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e19747c9140b19ceca5cd7cecbbe40e42bc6409f98631b0ccaa0b47c0366657d
|
4
|
+
data.tar.gz: 9611006c73ee0c1e59710a4071b6ad6878c6eca4a3c83053f4d4f4c455404041
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 21af73f9bb522c0247ba3229203dcf5ecb8e026256a267a4f8226d618bf2bb28b20dc1a799d49c3d695651d3070fb6171f1a5f0c7169b3dc59b4403bf42c3e99
|
7
|
+
data.tar.gz: a29427283f5435e805f9cfc5d94f198eefca0d49b493366e32003cfc84cde58faff54d56c0ca74862155eb26fe06f5f4c671902abb20024d45d79ae100777ab4
|
data/Gemfile.lock
CHANGED
@@ -2,12 +2,15 @@
|
|
2
2
|
classes = "inline-block"
|
3
3
|
classes += " text-red-600" if @status == 'failed'
|
4
4
|
classes += " text-green-600" if @status == 'success'
|
5
|
+
classes += " text-gray-600" if @status == 'neutral'
|
5
6
|
%>
|
6
7
|
<div class="flex flex-shrink-0 <%= classes %> items-center">
|
7
8
|
<% if @status == 'success' %>
|
8
9
|
<%= helpers.svg 'heroicons/solid/check-circle', class: 'h-4' %>
|
9
10
|
<% elsif @status == 'failed' %>
|
10
11
|
<%= helpers.svg 'heroicons/solid/x-circle', class: 'h-4' %>
|
12
|
+
<% elsif @status == 'neutral' %>
|
13
|
+
<%= helpers.svg 'heroicons/solid/minus-circle', class: 'h-4' %>
|
11
14
|
<% elsif @status == 'loading' %>
|
12
15
|
<div class="spinner">
|
13
16
|
<div class="double-bounce1 bg-gray-600"></div>
|
data/lib/avo/base_action.rb
CHANGED
@@ -25,7 +25,7 @@ module Avo
|
|
25
25
|
delegate :view, to: :class
|
26
26
|
# TODO: find a differnet way to delegate this to the uninitialized Current variable
|
27
27
|
delegate :context, to: Avo::Current
|
28
|
-
def
|
28
|
+
def current_user
|
29
29
|
Avo::Current.user
|
30
30
|
end
|
31
31
|
delegate :params, to: Avo::Current
|
data/lib/avo/base_resource.rb
CHANGED
data/lib/avo/configuration.rb
CHANGED
@@ -12,7 +12,6 @@ module Avo
|
|
12
12
|
attr_accessor :locale
|
13
13
|
attr_accessor :currency
|
14
14
|
attr_accessor :default_view_type
|
15
|
-
attr_accessor :license
|
16
15
|
attr_accessor :license_key
|
17
16
|
attr_accessor :authorization_methods
|
18
17
|
attr_accessor :authenticate
|
@@ -55,7 +54,6 @@ module Avo
|
|
55
54
|
@locale = nil
|
56
55
|
@currency = "USD"
|
57
56
|
@default_view_type = :table
|
58
|
-
@license = "community"
|
59
57
|
@license_key = nil
|
60
58
|
@current_user = proc {}
|
61
59
|
@authenticate = proc {}
|
@@ -142,6 +140,24 @@ module Avo
|
|
142
140
|
def app_name
|
143
141
|
Avo::ExecutionContext.new(target: @app_name).handle
|
144
142
|
end
|
143
|
+
|
144
|
+
def license=(value)
|
145
|
+
if Rails.env.development?
|
146
|
+
puts "[Avo DEPRECATION WARNING]: The `config.license` configuration option is no longer supported and will be removed in future versions. Please discontinue its use and solely utilize the `license_key` instead."
|
147
|
+
end
|
148
|
+
end
|
149
|
+
|
150
|
+
def license
|
151
|
+
gems = Gem::Specification.map {|gem| gem.name}
|
152
|
+
|
153
|
+
@license ||= if gems.include?("avo-advanced")
|
154
|
+
"advanced"
|
155
|
+
elsif gems.include?("avo-pro")
|
156
|
+
"pro"
|
157
|
+
elsif gems.include?("avo")
|
158
|
+
"community"
|
159
|
+
end
|
160
|
+
end
|
145
161
|
end
|
146
162
|
|
147
163
|
def self.configuration
|
data/lib/avo/current.rb
CHANGED
@@ -30,10 +30,4 @@ class Avo::Current < ActiveSupport::CurrentAttributes
|
|
30
30
|
def request
|
31
31
|
view_context.request || ActionDispatch::Request.empty
|
32
32
|
end
|
33
|
-
|
34
|
-
def current_user
|
35
|
-
Rails.logger.warn "DEPRECATION WARNING: Avo::Current.current_user become deprecated and will become obsolete on futhure versions. Please use Avo::Current.user instead."
|
36
|
-
|
37
|
-
user
|
38
|
-
end
|
39
33
|
end
|
@@ -6,13 +6,15 @@ module Avo
|
|
6
6
|
|
7
7
|
@loading_when = args[:loading_when].present? ? [args[:loading_when]].flatten.map(&:to_sym) : [:waiting, :running]
|
8
8
|
@failed_when = args[:failed_when].present? ? [args[:failed_when]].flatten.map(&:to_sym) : [:failed]
|
9
|
+
@success_when = args[:success_when].present? ? [args[:success_when]].flatten.map(&:to_sym) : []
|
9
10
|
end
|
10
11
|
|
11
12
|
def status
|
12
|
-
status = "
|
13
|
+
status = "neutral"
|
13
14
|
if value.present?
|
14
15
|
status = "failed" if @failed_when.include? value.to_sym
|
15
16
|
status = "loading" if @loading_when.include? value.to_sym
|
17
|
+
status = "success" if @success_when.include? value.to_sym
|
16
18
|
end
|
17
19
|
|
18
20
|
status
|
data/lib/avo/html/builder.rb
CHANGED
@@ -9,10 +9,7 @@ module Avo
|
|
9
9
|
case @hq_response["id"]
|
10
10
|
when "community"
|
11
11
|
CommunityLicense.new @hq_response
|
12
|
-
when "pro"
|
13
|
-
ProLicense.new @hq_response
|
14
|
-
# temporary fix
|
15
|
-
when "advanced"
|
12
|
+
when "pro", "advanced"
|
16
13
|
ProLicense.new @hq_response
|
17
14
|
else
|
18
15
|
NilLicense.new @hq_response
|
data/lib/avo/version.rb
CHANGED
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.1.
|
4
|
+
version: 3.0.1.beta6
|
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-08-
|
12
|
+
date: 2023-08-17 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activerecord
|