avo 2.3.1.pre.4 → 2.3.1.pre.5

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: 829e497897bd13502cbdbf0901e7f109f27000e98ee3cb6b666f5bca5c31ffec
4
- data.tar.gz: 614c37aa1f1bba1961aa60a3da9039d25f9eb75e36b23c7feed009369658b934
3
+ metadata.gz: 6256e502b9bb22a7d924ea43f8d0f6d7dbe6a28f9ad58877515f8d0a6954d481
4
+ data.tar.gz: 17956bd16b76b1f7017b20cbff9f841e8a7b942d7ad5d73c3442658e8bcfb7f1
5
5
  SHA512:
6
- metadata.gz: a44907a9fd7be8de74edc5ce1e88f48972fdb3ed4c0280fbfb9de23f6aee56c28b26c3a84689f2b62d99e52eede7461dd334c6beb7fd42781a123dd193c98b08
7
- data.tar.gz: 1a74d23d69ed8b71356d6b2e7934b7a928d0962f451023808567eb9255224892d49896d5282b59bd97b67ebb694dcbc4a925e768e08739fb2b8f742200658c66
6
+ metadata.gz: cfea2ebe1abcbfcea4dfaf340791f44c7691a1b9b41ccfea534218aab32c0c4ec283a5494cb0369025690a0e4c73da42b04c3351aa9a5acf81bc30cf47d5af88
7
+ data.tar.gz: 6078470d3fe8efdb049f4bc49735589b6db7fb55bafe1417bd0130d5046a4b60a20246cff2c65464b72c6977ecea8b4bf4d141c53b95129c8be816056f552c58
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- avo (2.3.1.pre.4)
4
+ avo (2.3.1.pre.5)
5
5
  active_link_to
6
6
  addressable
7
7
  breadcrumbs_on_rails
@@ -248,6 +248,8 @@ GEM
248
248
  nokogiri (1.13.4)
249
249
  mini_portile2 (~> 2.8.0)
250
250
  racc (~> 1.4)
251
+ nokogiri (1.13.4-x86_64-linux)
252
+ racc (~> 1.4)
251
253
  orm_adapter (0.5.0)
252
254
  pagy (5.10.1)
253
255
  activesupport
@@ -8526,6 +8526,12 @@ trix-editor {
8526
8526
  padding-top:1rem
8527
8527
  }
8528
8528
 
8529
+ @media print{
8530
+ .print\:hidden{
8531
+ display:none
8532
+ }
8533
+ }
8534
+
8529
8535
  @media (min-width: 495px){
8530
8536
  .xs\:grid-cols-2{
8531
8537
  grid-template-columns:repeat(2, minmax(0, 1fr))
data/lib/avo/app.rb CHANGED
@@ -105,13 +105,15 @@ module Avo
105
105
  end
106
106
 
107
107
  def main_menu
108
- return nil if Avo::App.license.lacks_with_trial(:menu_builder)
108
+ return [] if Avo::App.license.lacks_with_trial(:menu_builder)
109
+ return [] if Avo.configuration.main_menu.nil?
109
110
 
110
111
  Avo::Menu::Builder.parse_menu(&Avo.configuration.main_menu)
111
112
  end
112
113
 
113
114
  def profile_menu
114
- return nil if Avo::App.license.lacks_with_trial(:menu_builder)
115
+ return [] if Avo::App.license.lacks_with_trial(:menu_builder)
116
+ return [] if Avo.configuration.profile_menu.nil?
115
117
 
116
118
  Avo::Menu::Builder.parse_menu(&Avo.configuration.profile_menu)
117
119
  end
@@ -6,6 +6,7 @@ module Avo
6
6
  ENDPOINT = "https://avohq.io/api/v1/licenses/check".freeze unless const_defined?(:ENDPOINT)
7
7
  CACHE_KEY = "avo.hq.response".freeze unless const_defined?(:CACHE_KEY)
8
8
  REQUEST_TIMEOUT = 5 unless const_defined?(:REQUEST_TIMEOUT) # seconds
9
+ CACHE_TIME = 3600 unless const_defined?(:CACHE_TIME) # seconds
9
10
 
10
11
  def initialize(current_request)
11
12
  @current_request = current_request
@@ -60,8 +61,8 @@ module Avo
60
61
  field_types: field_types,
61
62
  **other_metadata(:actions),
62
63
  **other_metadata(:filters),
63
- main_menu_present: Avo::App.main_menu.present?,
64
- profile_menu_present: Avo::App.profile_menu.present?,
64
+ main_menu_present: Avo.configuration.main_menu.present?,
65
+ profile_menu_present: Avo.configuration.profile_menu.present?,
65
66
  }
66
67
  end
67
68
 
@@ -94,10 +95,12 @@ module Avo
94
95
 
95
96
  return cache_and_return_error "Avo HQ Internal server error.", hq_response.body if hq_response.code == 500
96
97
 
97
- cache_response 1.hour.to_i, hq_response.parsed_response if hq_response.code == 200
98
+ if hq_response.code == 200
99
+ cache_response response: hq_response.parsed_response
100
+ end
98
101
  end
99
102
 
100
- def cache_response(time, response)
103
+ def cache_response(response: nil, time: CACHE_TIME)
101
104
  response.merge!(
102
105
  expiry: time,
103
106
  fetched_at: Time.now,
@@ -135,7 +138,7 @@ module Avo
135
138
  end
136
139
 
137
140
  def cache_and_return_error(error, exception_message = "")
138
- cache_response 5.minutes.to_i, {error: error, exception_message: exception_message}.stringify_keys
141
+ cache_response response: {error: error, exception_message: exception_message}.stringify_keys, time: 5.minutes.to_i
139
142
  end
140
143
 
141
144
  def has_cached_response
data/lib/avo/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Avo
2
- VERSION = "2.3.1.pre.4" unless const_defined?(:VERSION)
2
+ VERSION = "2.3.1.pre.5" unless const_defined?(:VERSION)
3
3
  end
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.3.1.pre.4
4
+ version: 2.3.1.pre.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adrian Marin