pg_rails 7.3.2 → 7.3.4

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: a98b2f93e0db541d062b9a3197d0cc308ed4abcbe274626253b222f62364eb96
4
- data.tar.gz: 4f345c9ed13c0ae1fa6ff0b21a3f1f3474db7f21337c621fa568000fc97950c7
3
+ metadata.gz: 7b6625d4eea069719a53935223e89933c45ea8193b707a0a601646cf1c7d4d28
4
+ data.tar.gz: 8fc921c742a0dd8c2d361b8844a36d04f92ca03617cec64dd178bf043ae11781
5
5
  SHA512:
6
- metadata.gz: ad1f3664f46f4a708723338dfbb37a5de55f8ec57f77dce723c7a96c6782d04e081a0d61cbe0b5be7df675dfe9164c3ee2ccaeea33ab7ddf070a19f95e4d2f97
7
- data.tar.gz: b2cf238051be29ec1525b8f1c7189977e5f2f85532591898b89591754f1015288465a383f823afec225e3e898b07e82e5a3e2d555691501e6f79a5f33a8c692d
6
+ metadata.gz: 42908b6091fa4b5d36cc10bcdc19c6665171c107f73c0dd7b2457355550e931e8bec5d212de311a8bb667090531506b2aab8ce30c101829566e8acd20b8f260f
7
+ data.tar.gz: deba07fbf28846fb3a536ebc4d0002965cc131c4ad6bb626d4242c49ba9a45d303ccd85ccebec6f75cbd8eab6c3dea58159588541db785f4320e4fbdff0f5c7e
@@ -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
@@ -1,6 +1,9 @@
1
1
  module PgEngine
2
2
  class DeviseController < ApplicationController
3
3
  before_action :configure_permitted_parameters
4
+ before_action do
5
+ @no_main_frame = true
6
+ end
4
7
 
5
8
  layout :layout_by_user
6
9
 
@@ -59,9 +59,7 @@ html
59
59
  div
60
60
  = render partial: 'pg_layout/navbar' if @navbar.present?
61
61
  div
62
- / FIXME: rename to main, use a constant
63
- = turbo_frame_tag current_turbo_frame || 'top',
64
- **{ 'data-turbo-action': (turbo_frame? ? nil : :advance) }.compact do
62
+ - captured_content = capture do
65
63
  - if user_signed_in? && breadcrumbs.any?
66
64
  .d-flex.d-print-none
67
65
  .d-flex.flex-grow-1.px-3.py-1[
@@ -103,6 +101,13 @@ html
103
101
  hacer un container con position absolute para los toasts
104
102
  = yield(:filtros)
105
103
  = content
104
+ - if @no_main_frame
105
+ = captured_content
106
+ - else
107
+ / FIXME: rename to main, use a constant
108
+ = turbo_frame_tag current_turbo_frame || 'top',
109
+ **{ 'data-turbo-action': (turbo_frame? ? nil : :advance) }.compact do
110
+ = captured_content
106
111
 
107
112
  div style="width:100%; height: 10em"
108
113
  .d-flex.gap-1.justify-content-center.opacity-50 data-controller="theme"
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PgRails
4
- VERSION = '7.3.2'
4
+ VERSION = '7.3.4'
5
5
  end
@@ -170,6 +170,7 @@ RSpec.describe <%= controller_class_name %>Controller do
170
170
  <% else -%>
171
171
  post :create, params: { <%= nombre_tabla_completo_singular %>: valid_attributes }
172
172
  <% end -%>
173
+ # FIXME: redirect to target object
173
174
  expect(response).to redirect_to([:<%= ns_prefix.first %>, <%= class_name %>.last])
174
175
  end
175
176
  end
@@ -218,6 +219,7 @@ RSpec.describe <%= controller_class_name %>Controller do
218
219
  <% else -%>
219
220
  put :update, params: { id: <%= file_name %>.to_param, <%= nombre_tabla_completo_singular %>: valid_attributes }
220
221
  <% end -%>
222
+ # FIXME: redirect to target object
221
223
  expect(response).to redirect_to([:<%= ns_prefix.first %>, <%= file_name %>])
222
224
  end
223
225
  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.2
4
+ version: 7.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martín Rosso