avo 2.13.3.pre.2 → 2.13.4.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d34394e93a3febeaf9ebc872f0282434b064d5a864e44f508674ff8e02ef3039
4
- data.tar.gz: a0aaf952887563612ae4918081ca77a547cd7d47f683db0280154a3850675445
3
+ metadata.gz: 6cfce3adc5884d591b4c562245c6111e3844f3b71ba028015b9fb02f2890b77b
4
+ data.tar.gz: 02e2bb8248bf0232c68a596388d4f8be956be9b97c5c114cab27c6f9c5b85d56
5
5
  SHA512:
6
- metadata.gz: b8a8f86f81575cc8fe3a0a6066608b886dc3d809525e41fc785ea2ef95a7a8ce3f38be558779c5f45824c4791fcedd77ea7959b5513c8bfd71e95206f8bb422e
7
- data.tar.gz: 29a4cf34342c519d9b1d84f5c373b9f4a59e962ac558f2d0f1d98f0e716c0376b55fda6766c2a24ed9f03e5913ef32991fd3dd5cd62b3af7bc5e85210120967c
6
+ metadata.gz: d073957e4ffe0426fbc7583b0a19f1ac2c140ee20c4a2bc418e50a51c6e677a3550d6b4011e4d502f3be564bc4b5f41d742077e145c4ce8bc2700291b402be3b
7
+ data.tar.gz: 2041ac955eecbe269a27fd3edd515e09d45d21351d59697d30629d24eebdc18fac02467d5b91dcf2157994e46dd0a4e561cba4191696e0ca0c6950ac6d6733fe
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- avo (2.13.3.pre.2)
4
+ avo (2.13.4.pre.1)
5
5
  active_link_to
6
6
  addressable
7
7
  breadcrumbs_on_rails
@@ -256,6 +256,8 @@ GEM
256
256
  nokogiri (1.13.7)
257
257
  mini_portile2 (~> 2.8.0)
258
258
  racc (~> 1.4)
259
+ nokogiri (1.13.7-x86_64-linux)
260
+ racc (~> 1.4)
259
261
  orm_adapter (0.5.0)
260
262
  pagy (5.10.1)
261
263
  activesupport
@@ -64,9 +64,15 @@ module Avo
64
64
  classes
65
65
  end
66
66
 
67
- # Just use inline_svg gem.
67
+ # Use inline_svg gem but with our own finder implementation.
68
68
  def svg(file_name, **args)
69
- inline_svg_tag file_name, **args
69
+ return if file_name.blank?
70
+
71
+ file_name = "#{file_name}.svg" unless file_name.end_with? ".svg"
72
+
73
+ with_asset_finder(::Avo::SvgFinder) do
74
+ inline_svg file_name, **args
75
+ end
70
76
  end
71
77
 
72
78
  def input_classes(extra_classes = "", has_error: false)
@@ -96,5 +102,17 @@ module Avo
96
102
  rescue
97
103
  Avo.configuration.root_path
98
104
  end
105
+
106
+ private
107
+
108
+ # Taken from the original library
109
+ # https://github.com/jamesmartin/inline_svg/blob/main/lib/inline_svg/action_view/helpers.rb#L76
110
+ def with_asset_finder(asset_finder)
111
+ Thread.current[:inline_svg_asset_finder] = asset_finder
112
+ output = yield
113
+ Thread.current[:inline_svg_asset_finder] = nil
114
+
115
+ output
116
+ end
99
117
  end
100
118
  end
@@ -117,7 +117,11 @@ export default class extends Controller {
117
117
 
118
118
  flatpickr(this.fakeInputTarget, options)
119
119
 
120
- this.updateRealInput(this.parsedValue.setZone(this.displayTimezone).toISO())
120
+ if (this.enableTimeValue) {
121
+ this.updateRealInput(this.parsedValue.setZone(this.displayTimezone).toISO())
122
+ } else {
123
+ this.updateRealInput(universalTimestamp(this.initialValue))
124
+ }
121
125
  }
122
126
 
123
127
  onChange(selectedDates) {
@@ -33,7 +33,6 @@
33
33
  <div class="content p-4 lg:p-6 flex-1 flex flex-col justify-between items-stretch <%= @container_classes %>">
34
34
  <%= render partial: "avo/partials/custom_tools_alert" %>
35
35
  <div class="flex flex-1 flex-col justify-between items-stretch space-y-8">
36
- <!-- <%= ::Rails.application.assets_manifest.inspect %> -->
37
36
  <%= yield %>
38
37
  <%= render partial: "avo/partials/footer" %>
39
38
  </div>
data/lib/avo/engine.rb CHANGED
@@ -53,9 +53,6 @@ module Avo
53
53
  # app.config.logger = ::Logger.new(STDOUT)
54
54
  end
55
55
 
56
- # Add the outline heroicons to the path
57
- config.assets.paths << Avo::Engine.root.join("app", "assets", "svgs", "heroicons", "outline")
58
-
59
56
  config.app_middleware.use(
60
57
  Rack::Static,
61
58
  urls: ["/avo-assets"],
@@ -0,0 +1,45 @@
1
+ class Avo::SvgFinder
2
+ def self.find_asset(filename)
3
+ new(filename)
4
+ end
5
+
6
+ def initialize(filename)
7
+ @filename = filename
8
+ end
9
+
10
+ # Use the default static finder logic. If that doesn't find anything, search according to our pattern:
11
+ def pathname
12
+ found_asset = default_strategy
13
+
14
+ # Use the found asset
15
+ return found_asset if found_asset.present?
16
+
17
+ paths = [
18
+ Rails.root.join("app", "assets", "svgs", @filename).to_s,
19
+ Rails.root.join(@filename).to_s,
20
+ Avo::Engine.root.join("app", "assets", "svgs", @filename).to_s,
21
+ Avo::Engine.root.join("app", "assets", "svgs", "heroicons", "outline", @filename).to_s,
22
+ Avo::Engine.root.join(@filename).to_s,
23
+ ]
24
+
25
+ path = paths.find do |path|
26
+ File.exist? path
27
+ end
28
+
29
+ path
30
+ end
31
+
32
+ def default_strategy
33
+ if ::Rails.application.config.assets.compile
34
+ asset = ::Rails.application.assets[@filename]
35
+ Pathname.new(asset.filename) if asset.present?
36
+ else
37
+ manifest = ::Rails.application.assets_manifest
38
+ asset_path = manifest.assets[@filename]
39
+ unless asset_path.nil?
40
+ ::Rails.root.join(manifest.directory, asset_path)
41
+ end
42
+ end
43
+ end
44
+ end
45
+
data/lib/avo/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Avo
2
- VERSION = "2.13.3.pre.2" unless const_defined?(:VERSION)
2
+ VERSION = "2.13.4.pre.1" unless const_defined?(:VERSION)
3
3
  end