avo 2.40.0 → 2.41.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.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2935789c3103001a7d5343604f30ff038dcf422fb19d43dce8920dc47e8d00ec
4
- data.tar.gz: 7a85085fb748a296e03677cf52b640f029da373ed2763d8cff3e33c30db58608
3
+ metadata.gz: 51cdcebc4079db0bc531fbec4a0e9d3872a7270bd7f2e0f1b5e88111af6b9700
4
+ data.tar.gz: e0520aa64343da6381a016b0b08b471a6b37389e42a8d01f7676f237d37b7525
5
5
  SHA512:
6
- metadata.gz: 936d25a1817837a8192dca5db6a1b11b1a473023c367ea66ac5bcb48b47a715eb64d1e69ae499866b1364327abfb33dc04d7bd977d2bd6a7b6562890f1b51138
7
- data.tar.gz: 90fd512c9a60ef5c58be02884a476dd3bbcc970837920e46cfd51fc7ae3f6db580296d71478f3bb39bd43d68fe3dc1917aa30733a5d98577d600c9176560a80c
6
+ metadata.gz: a1b077a1cac9372943eec04cc718c6f7a0eabbdd457cf38c5355cbefd3ea3d9908a4713322ad9d24c1ea5a6bcfab509647a3b7f979d3de000ce6dd24e2427f21
7
+ data.tar.gz: 73aae293a9b3e50178e15fe9e4a2d131928704e64c70822183ac974eefd5efc8209a5862ec61d33d08e76e0f56c7d29f8e16d5376730ba3a819352b72e165455
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- avo (2.40.0)
4
+ avo (2.41.0)
5
5
  actionview (>= 6.0)
6
6
  active_link_to
7
7
  activerecord (>= 6.0)
@@ -1,25 +1 @@
1
- <%
2
- backgrounds = {
3
- info: 'bg-blue-500',
4
- success: 'bg-green-500',
5
- danger: 'bg-red-500',
6
- warning: 'bg-yellow-500',
7
- secondary: 'bg-gray-500',
8
- }
9
-
10
- label = @value
11
- background = :info
12
-
13
- @options.invert.each do |values, type|
14
- if [values].flatten.map { |value| value }.include? @value
15
- label = @value
16
- background = type.to_sym
17
- next
18
- end
19
- end
20
-
21
- classes = 'whitespace-nowrap rounded-md uppercase px-2 py-1 text-xs font-bold block text-center truncate '
22
-
23
- classes += "#{backgrounds[background]} text-white" if backgrounds[background].present?
24
- %>
25
- <span class="<%= classes %>" style="max-width: 120px;"><%= label %></span>
1
+ <span class="<%= classes %>" style="max-width: 120px;"><%= @value %></span>
@@ -4,5 +4,29 @@ class Avo::Fields::Common::BadgeViewerComponent < ViewComponent::Base
4
4
  def initialize(value:, options:)
5
5
  @value = value
6
6
  @options = options
7
+ @backgrounds = {
8
+ info: "bg-blue-500",
9
+ success: "bg-green-500",
10
+ danger: "bg-red-500",
11
+ warning: "bg-yellow-500",
12
+ neutral: "bg-gray-500"
13
+ }
14
+ end
15
+
16
+ def classes
17
+ background = :info
18
+
19
+ @options.invert.each do |values, type|
20
+ if [values].flatten.map { |value| value }.include? @value
21
+ background = type.to_sym
22
+ next
23
+ end
24
+ end
25
+
26
+ classes = "whitespace-nowrap rounded-md uppercase px-2 py-1 text-xs font-bold block text-center truncate "
27
+
28
+ classes += "#{@backgrounds[background]} text-white" if @backgrounds[background].present?
29
+
30
+ classes
7
31
  end
8
32
  end
@@ -51,14 +51,14 @@ module Avo
51
51
  scope: resource.class.scope
52
52
  ).handle
53
53
 
54
+ query = apply_scope(query) if should_apply_any_scope?
55
+
54
56
  # Get the count
55
57
  results_count = query.reselect(resource.model_class.primary_key).count
56
58
 
57
59
  # Get the results
58
60
  query = query.limit(8)
59
61
 
60
- query = apply_scope(query) if should_apply_any_scope?
61
-
62
62
  results = apply_search_metadata(query, resource)
63
63
 
64
64
  header = resource.plural_name
@@ -8,7 +8,7 @@ module Avo
8
8
 
9
9
  hide_on [:edit, :new]
10
10
 
11
- default_options = {info: :info, success: :success, danger: :danger, warning: :warning, secondary: :secondary}
11
+ default_options = {info: :info, success: :success, danger: :danger, warning: :warning, neutral: :neutral}
12
12
  @options = args[:options].present? ? default_options.merge(args[:options]) : default_options
13
13
  end
14
14
  end
data/lib/avo/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Avo
2
- VERSION = "2.40.0" unless const_defined?(:VERSION)
2
+ VERSION = "2.41.0" unless const_defined?(:VERSION)
3
3
  end
@@ -7997,10 +7997,6 @@ trix-toolbar .trix-button-group:not(:first-child){
7997
7997
  text-transform:capitalize
7998
7998
  }
7999
7999
 
8000
- .italic{
8001
- font-style:italic
8002
- }
8003
-
8004
8000
  .leading-6{
8005
8001
  line-height:1.5rem
8006
8002
  }
@@ -8199,16 +8195,6 @@ trix-toolbar .trix-button-group:not(:first-child){
8199
8195
  color:rgb(22 163 74 / var(--tw-text-opacity))
8200
8196
  }
8201
8197
 
8202
- .\!text-pink-600{
8203
- --tw-text-opacity:1 !important;
8204
- color:rgb(219 39 119 / var(--tw-text-opacity)) !important
8205
- }
8206
-
8207
- .underline{
8208
- -webkit-text-decoration-line:underline;
8209
- text-decoration-line:underline
8210
- }
8211
-
8212
8198
  .no-underline{
8213
8199
  -webkit-text-decoration-line:none;
8214
8200
  text-decoration-line:none
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.40.0
4
+ version: 2.41.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: 2023-08-29 00:00:00.000000000 Z
12
+ date: 2023-09-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activerecord