avo 3.0.1.beta4 → 3.0.1.beta6

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.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 737f7485e4fbc1d44c4241c0f39010b74d078f58e0cc06279223bb81e9878079
4
- data.tar.gz: b19cc62af7812c430274e0f0b002843a7601ef16e81fa32b0dfc2ae8d96ca304
3
+ metadata.gz: e19747c9140b19ceca5cd7cecbbe40e42bc6409f98631b0ccaa0b47c0366657d
4
+ data.tar.gz: 9611006c73ee0c1e59710a4071b6ad6878c6eca4a3c83053f4d4f4c455404041
5
5
  SHA512:
6
- metadata.gz: 995a9e1a12c9bce7368abdc7fb6b5cae46dff35603f3d7b51e4942a730d4f314f52fbfd04ee38948b3c919d3bf25440131559b5bed3a5af7331b608c50ef69d0
7
- data.tar.gz: 8491c4c0b5a55144ee300574788591c45596b9b97e193e26688f01e8b319f0895eff3b3b55e9c7dca74bf18021f0cb00180f7d624bf22d4e7690daae1456c096
6
+ metadata.gz: 21af73f9bb522c0247ba3229203dcf5ecb8e026256a267a4f8226d618bf2bb28b20dc1a799d49c3d695651d3070fb6171f1a5f0c7169b3dc59b4403bf42c3e99
7
+ data.tar.gz: a29427283f5435e805f9cfc5d94f198eefca0d49b493366e32003cfc84cde58faff54d56c0ca74862155eb26fe06f5f4c671902abb20024d45d79ae100777ab4
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- avo (3.0.1.beta4)
4
+ avo (3.0.1.beta6)
5
5
  actionview (>= 6.1)
6
6
  active_link_to
7
7
  activerecord (>= 6.1)
@@ -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>
@@ -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 curent_user
28
+ def current_user
29
29
  Avo::Current.user
30
30
  end
31
31
  delegate :params, to: Avo::Current
@@ -12,7 +12,7 @@ module Avo
12
12
 
13
13
  # Avo::Current methods
14
14
  delegate :context, to: Avo::Current
15
- def curent_user
15
+ def current_user
16
16
  Avo::Current.user
17
17
  end
18
18
  delegate :params, to: Avo::Current
@@ -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 = "success"
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
@@ -15,7 +15,7 @@ module Avo
15
15
  delegate :params, to: Avo::Current
16
16
  delegate :request, to: Avo::Current
17
17
  delegate :view_context, to: Avo::Current
18
- def curent_user
18
+ def current_user
19
19
  Avo::Current.user
20
20
  end
21
21
 
@@ -22,7 +22,7 @@ class Avo::HTML::Builder
22
22
  delegate :app, to: Avo::Current
23
23
  delegate :root_path, to: :app
24
24
  delegate :params, to: Avo::Current
25
- def curent_user
25
+ def current_user
26
26
  Avo::Current.user
27
27
  end
28
28
 
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Avo
2
- VERSION = "3.0.1.beta4" unless const_defined?(:VERSION)
2
+ VERSION = "3.0.1.beta6" unless const_defined?(:VERSION)
3
3
  end
@@ -9,7 +9,6 @@ Avo.configure do |config|
9
9
  # config.home_path = nil
10
10
 
11
11
  ## == Licensing ==
12
- config.license = 'community' # change this to 'pro' when you add the license key
13
12
  # config.license_key = ENV['AVO_LICENSE_KEY']
14
13
 
15
14
  ## == Set the context ==
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.beta4
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-11 00:00:00.000000000 Z
12
+ date: 2023-08-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activerecord