pg_rails 7.3.3 → 7.3.5

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: 0fed6890bca7d59c4f1050a017f8268a137520f41464181a4b2ea56b2e44c5ae
4
- data.tar.gz: f87ebe6627025fb2759466ba0539ce7b5b7ecf683fb2e56c49a29a69cb18d4ca
3
+ metadata.gz: 78a7c2d3d7277352e4c78b167e2d106a0d6fe1be83a1f5f27d3eacd00c0fb6f7
4
+ data.tar.gz: a066552a098bf72375cb3957a53b3f4db473d640ceeeaee833942e181ff057d5
5
5
  SHA512:
6
- metadata.gz: 7674b3fe89df77f6435356ef54cc181e20163b036c4ede84812aa056605071fd2bc0d2293fa03ec5a2fbda29b9b5bb42da9cd00109843579eb7f158a7cc4bc19
7
- data.tar.gz: b8070967ee5b9f6ac03861a78c85313dd65ad42f5675851efc0b9742d1449820925c5cb1416e8f69257a4db2a04ec2df5977a30bb8d0ab9c8dd1aedbe8f7ada0
6
+ metadata.gz: edd3474ce84d32bddd24aa4b010c77c909534874eb8e8101468c7e5ebdf83b9b3db43c245049fae39ca716b79cc582315c81c14b5cdde6117d474b5c2aafeec3
7
+ data.tar.gz: cf514c46e8737deaac130cef0049b9e2fec7852948e946cff30b94a97134dbb8dd938b1be95a2e86a140152ad20c396508776a0e86c3bac8f21db5272435b0d1
@@ -9,12 +9,14 @@ export default class extends Controller {
9
9
 
10
10
  connect (e) {
11
11
  this.modalPuntero = new bootstrap.Modal(this.element)
12
- if (this.element.dataset.removeOnHide) {
12
+ if (this.element.dataset.removeOnHide === 'true') {
13
13
  this.element.addEventListener('hidden.bs.modal', (e) => {
14
14
  this.element.remove()
15
15
  })
16
16
  }
17
- this.modalPuntero.show()
17
+ if (this.element.dataset.autoShow === 'true') {
18
+ this.modalPuntero.show()
19
+ }
18
20
 
19
21
  this.element.addEventListener('turbo:frame-render', (ev) => {
20
22
  if (ev.detail.fetchResponse.response.ok && ev.target.id === 'modal_content') {
@@ -1,4 +1,5 @@
1
1
  .modal[class="#{@klass} modal-#{@modal_id}" tabindex="-1" data-controller="modal"
2
+ data-auto-show="true" data-remove-on-hide="false"
2
3
  data-modal-asociable-outlet=".asociable-#{@modal_id}"
3
4
  data-turbo-temporary="true"]
4
5
  .modal-dialog
@@ -1,5 +1,6 @@
1
- .modal[class="#{@klass}" tabindex="-1" data-controller="modal"
2
- data-remove-on-hide="true" data-turbo-temporary="true"]
1
+ .modal[id="#{@id}" class="#{@klass}" tabindex="-1" data-controller="modal"
2
+ data-remove-on-hide="#{@remove_on_hide}" data-turbo-temporary="true"
3
+ data-auto-show="#{@auto_show}"]
3
4
  .modal-dialog
4
5
  .modal-content
5
6
  = content
@@ -1,11 +1,16 @@
1
1
  class ModalComponent < ViewComponent::Base
2
- def initialize(klass: 'modal-xl')
2
+ def initialize(klass: 'modal-xl', id: nil, auto_show: true)
3
3
  @klass = klass
4
+ @auto_show = auto_show
5
+ @id = id
6
+ @remove_on_hide = @auto_show
4
7
 
5
8
  super
6
9
  end
7
10
 
8
11
  def before_render
12
+ return unless @auto_show
13
+
9
14
  controller.instance_variable_set(:@using_modal, true)
10
15
  end
11
16
  end
@@ -31,7 +31,7 @@ document.addEventListener('turbo:before-fetch-request', (ev) => {
31
31
  // on successful redirect no haya posibilidad de que se abra un modal
32
32
  // FIXME: buscar una manera mejor de hacerlo porque es para problemas
33
33
  // quizás, con la movida de abrir modales desde JS
34
- if (ev.detail.fetchOptions.method === 'post') {
34
+ if (ev.detail.fetchOptions.method.toLowerCase() === 'post') {
35
35
  ev.detail.fetchOptions.headers.Accept = 'text/html, application/xhtml+xml'
36
36
  }
37
37
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PgRails
4
- VERSION = '7.3.3'
4
+ VERSION = '7.3.5'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pg_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.3.3
4
+ version: 7.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martín Rosso