avo 2.48.0 → 2.50.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 63a1e190de1ea81343c769a8896e64c91aab1024084dc04d3b8ed1ce96e55233
4
- data.tar.gz: cd447a81f2d123f536fe500ee57c6cd1396df2e5615ae4b8f1d3dfa944ff8214
3
+ metadata.gz: 6ec2fc0304d9fb79831bfe41b68a8ca9b4df52526e2212f2e8db9cd073837ee8
4
+ data.tar.gz: 45b6b466d8528de3f7bbf182b53ce38b1efb5c14ad6958fa58e5ce4a83070a57
5
5
  SHA512:
6
- metadata.gz: 83f2e5618a4fd689d5619d0c390bf41bae93e73b74b75d30b2cfddc2091eb7770a76704df7a251897910c886d25fefd97e5c4e0de179cb2ac2b93f3a3886855c
7
- data.tar.gz: 30ed29798e3563143acf57eb594c915fdaac080b082bf02fb5a72c4073b3eed53256773b17987f17e0cb0a26bc3e257ee77ea45aaed92ac9d3c5e2b10843b8ca
6
+ metadata.gz: 65de9dbd9c220bd8a9723f5e952db9339def09d0f4a9ec0470b3f7dca05d8c970591341cff79986167136821658ad5a400e74bdce12ea66c692108b53b82ffa4
7
+ data.tar.gz: 5732cf3b83f079b62f4eb4754114d759ad5a4ecc5673ddebe0e7da58f3ff48b294266945d2104ac70aa16681acdc3bafd09b81c2a7227851791786f19589a1f5
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.50.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/menu/menu.rb CHANGED
@@ -1,2 +1,4 @@
1
+ require "ostruct"
2
+
1
3
  class Avo::Menu::Menu < OpenStruct
2
4
  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.50.0" unless const_defined?(:VERSION)
3
3
  end