avo 2.48.0 → 2.49.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 63a1e190de1ea81343c769a8896e64c91aab1024084dc04d3b8ed1ce96e55233
4
- data.tar.gz: cd447a81f2d123f536fe500ee57c6cd1396df2e5615ae4b8f1d3dfa944ff8214
3
+ metadata.gz: 90b4bd0f7e6b9826427c149aa77090a5c5a3ed37818c9c53c55b36eed32500cd
4
+ data.tar.gz: b65a1cd540a5e130cca20d19fe6d064dba6788b95789551f5f12487c466504b9
5
5
  SHA512:
6
- metadata.gz: 83f2e5618a4fd689d5619d0c390bf41bae93e73b74b75d30b2cfddc2091eb7770a76704df7a251897910c886d25fefd97e5c4e0de179cb2ac2b93f3a3886855c
7
- data.tar.gz: 30ed29798e3563143acf57eb594c915fdaac080b082bf02fb5a72c4073b3eed53256773b17987f17e0cb0a26bc3e257ee77ea45aaed92ac9d3c5e2b10843b8ca
6
+ metadata.gz: b362eb0a92f9be0d53e2ba6cb8117b56726cce1495346793c26ea1ac05f2db65a7e1fee842316f9608c20113dcb9e5eaba40d7899c8e86f0fe9d3f18d7cadd2f
7
+ data.tar.gz: 5fa3e7fb6e9ff428cdac5250b6ecb31e459a297b007be70c7614bd67c9fcd725fbb56d4715d1b63e788b845a261eb48b4f89f8d55f3612895c4746c4f50d983b
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- avo (2.48.0)
4
+ avo (2.49.0)
5
5
  actionview (>= 6.0)
6
6
  active_link_to
7
7
  activerecord (>= 6.0)
@@ -2,7 +2,7 @@
2
2
  <% if file.present? %>
3
3
  <div class="flex flex-col h-full">
4
4
  <% if file.representable? && is_image? %>
5
- <%= image_tag helpers.main_app.url_for(file), class: "rounded-lg max-w-full #{@extra_classes}" %>
5
+ <%= image_tag helpers.main_app.url_for(file), class: "rounded-lg max-w-full self-start #{@extra_classes}" %>
6
6
  <% elsif is_audio? %>
7
7
  <%= audio_tag(helpers.main_app.url_for(file), controls: true, preload: false, class: 'w-full') %>
8
8
  <% elsif is_video? %>
@@ -204,18 +204,22 @@ export default class extends Controller {
204
204
  return
205
205
  }
206
206
 
207
+ const timezonedDate = DateTime.fromISO(selectedDates[0].toISOString())
208
+ .setZone(this.displayTimezone, { keepLocalTime: true })
209
+ .setZone('UTC', { keepLocalTime: !this.relativeValue })
210
+
207
211
  let value
208
212
  switch (this.fieldTypeValue) {
209
213
  case 'time':
210
214
  // For time values, we should maintain the real value and format it to a time-friendly format.
211
- value = DateTime.fromISO(selectedDates[0].toISOString()).setZone('UTC', { keepLocalTime: !this.relativeValue }).toFormat(RAW_TIME_FORMAT)
215
+ value = timezonedDate.toFormat(RAW_TIME_FORMAT)
212
216
  break
213
217
  case 'date':
214
- value = DateTime.fromISO(selectedDates[0].toISOString()).setZone('UTC', { keepLocalTime: true }).toFormat(RAW_DATE_FORMAT)
218
+ value = timezonedDate.toFormat(RAW_DATE_FORMAT)
215
219
  break
216
220
  default:
217
221
  case 'dateTime':
218
- value = DateTime.fromISO(selectedDates[0].toISOString()).setZone('UTC', { keepLocalTime: !this.relativeValue }).toISO()
222
+ value = timezonedDate.toISO()
219
223
  break
220
224
  }
221
225
 
data/avo.gemspec CHANGED
@@ -7,12 +7,13 @@ require "avo/version"
7
7
  Gem::Specification.new do |spec|
8
8
  spec.name = "avo"
9
9
  spec.version = Avo::VERSION
10
- spec.authors = ["Adrian Marin", "Mihai Marin"]
10
+ spec.authors = ["Adrian Marin", "Mihai Marin", "Paul Bob"]
11
11
  spec.email = ["avo@avohq.io"]
12
12
  spec.homepage = "https://avohq.io"
13
- spec.summary = "Configuration-based, no-maintenance, extendable Ruby on Rails admin panel framework."
14
- spec.description = "Avo abstracts away the common parts of building apps, letting your engineers work on your app's essential components. The result is a full-featured admin panel that works out of the box, ready to give to your end-users."
15
- spec.license = "Commercial"
13
+ spec.summary = "Admin panel framework and Content Management System for Ruby on Rails."
14
+ spec.description = "Avo is a very custom Content Management System for Ruby on Rails that saves engineers and teams months of development time by building user interfaces and logic using configuration rather than traditional coding; When configuration is not enough, you can fallback to familiar Ruby on Rails code."
15
+ spec.license = "LGPL-3.0"
16
+ spec.licenses = ["LGPL-3.0", "Commercial"]
16
17
 
17
18
  # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
18
19
  # to allow pushing to a single host or delete this section to allow pushing to any host.
@@ -43,19 +43,26 @@ module Avo
43
43
  end
44
44
 
45
45
  def utc_time(value)
46
- if timezone.present?
47
- ActiveSupport::TimeZone.new(timezone).local_to_utc(Time.parse(value))
46
+ time = Time.parse(value)
47
+
48
+ if timezone.present? && !time.utc?
49
+ ActiveSupport::TimeZone.new(timezone).local_to_utc(time)
48
50
  else
49
51
  value
50
52
  end
51
53
  end
52
54
 
53
55
  def timezone
54
- if @timezone.respond_to?(:call)
56
+ timezone = if @timezone.respond_to?(:call)
55
57
  return Avo::Hosts::ResourceViewRecordHost.new(block: @timezone, record: resource.model, resource: resource, view: view).handle
58
+ else
59
+ @timezone
56
60
  end
57
61
 
58
- @timezone
62
+ # Fix for https://github.com/moment/luxon/issues/1358#issuecomment-2017477897
63
+ return "Etc/UTC" if timezone&.downcase == "utc" && view.in?([:new, :create, :edit, :update])
64
+
65
+ timezone
59
66
  end
60
67
  end
61
68
  end
data/lib/avo/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Avo
2
- VERSION = "2.48.0" unless const_defined?(:VERSION)
2
+ VERSION = "2.49.0" unless const_defined?(:VERSION)
3
3
  end