avo 2.5.1 → 2.5.2.pre.1
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 +4 -4
- data/Gemfile.lock +3 -1
- data/app/assets/builds/avo.css +8851 -0
- data/app/assets/builds/avo.js +423 -0
- data/app/assets/builds/avo.js.map +7 -0
- data/app/components/avo/card_component.rb +12 -0
- data/app/views/avo/dashboards/_chartkick_card.html.erb +1 -1
- data/app/views/avo/dashboards/_metric_card.html.erb +1 -1
- data/lib/avo/version.rb +1 -1
- data/lib/generators/avo/templates/cards/chartkick_card.tt +1 -1
- data/lib/generators/avo/templates/cards/chartkick_card_sample.tt +1 -1
- data/lib/generators/avo/templates/cards/metric_card.tt +1 -1
- data/lib/generators/avo/templates/cards/metric_card_sample.tt +1 -1
- metadata +6 -3
@@ -3,9 +3,21 @@
|
|
3
3
|
class Avo::CardComponent < ViewComponent::Base
|
4
4
|
def initialize(card: nil)
|
5
5
|
@card = card
|
6
|
+
|
7
|
+
init_card
|
6
8
|
end
|
7
9
|
|
8
10
|
def render?
|
9
11
|
!@card.nil?
|
10
12
|
end
|
13
|
+
|
14
|
+
# Initializing the card byt running the query method.
|
15
|
+
# We'll still keep the query block around for compatibility reasons.
|
16
|
+
def init_card
|
17
|
+
if @card.respond_to? :query
|
18
|
+
@card.query
|
19
|
+
elsif @card.query_block.present?
|
20
|
+
@card.compute_result
|
21
|
+
end
|
22
|
+
end
|
11
23
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<div class="flex mt-4 items-end">
|
2
2
|
<span class="text-3xl"><%= @card.prefix %></span>
|
3
|
-
<span class="text-5xl"><%= @card.
|
3
|
+
<span class="text-5xl"><%= @card.result_data %></span>
|
4
4
|
<span class="text-3xl"><%= @card.suffix %></span>
|
5
5
|
</div>
|
data/lib/avo/version.rb
CHANGED
@@ -9,7 +9,7 @@ class <%= class_name.camelize %> < Avo::Dashboards::ChartkickCard
|
|
9
9
|
# self.chart_options = { library: { plugins: { legend: { display: true } } } }
|
10
10
|
# self.flush = true
|
11
11
|
|
12
|
-
query
|
12
|
+
def query
|
13
13
|
points = 16
|
14
14
|
i = Time.new.year.to_i - points
|
15
15
|
base_data = Array.new(points).map do
|
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.5.1
|
4
|
+
version: 2.5.2.pre.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adrian Marin
|
@@ -248,6 +248,9 @@ files:
|
|
248
248
|
- Gemfile.lock
|
249
249
|
- README.md
|
250
250
|
- Rakefile
|
251
|
+
- app/assets/builds/avo.css
|
252
|
+
- app/assets/builds/avo.js
|
253
|
+
- app/assets/builds/avo.js.map
|
251
254
|
- app/assets/config/avo_manifest.js
|
252
255
|
- app/assets/stylesheets/avo.css
|
253
256
|
- app/assets/stylesheets/css/active-storage.css
|
@@ -1320,9 +1323,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
1320
1323
|
version: 2.4.0
|
1321
1324
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
1322
1325
|
requirements:
|
1323
|
-
- - "
|
1326
|
+
- - ">"
|
1324
1327
|
- !ruby/object:Gem::Version
|
1325
|
-
version:
|
1328
|
+
version: 1.3.1
|
1326
1329
|
requirements: []
|
1327
1330
|
rubygems_version: 3.3.3
|
1328
1331
|
signing_key:
|