pg_rails 7.6.11 → 7.6.13

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: 94ce6725dc3bda0f243cac15789f9b1e8bae483a2c7a27a03b90be4c574605cb
4
- data.tar.gz: 1ddac002f2e007ab5a86bb66a3eb387a576fa3cedb7c177e9acd61e1d19136bd
3
+ metadata.gz: 1a6345fa67885d94755da1e6580568551967375c593ee249893c8f1a7e5a5daf
4
+ data.tar.gz: fed8f1f29879be46bdb5e11d1a5fbcad6ce2106e0db2c693c61f0b34f3494357
5
5
  SHA512:
6
- metadata.gz: 57f79bbcb61c6b7ece9205bf9518c4c955796d209672882fdd337c54af8741cd07b7d1cca667537bd3271adddcedd94bb8acf1e9da25f13b2d5cb5c99b06ea3c
7
- data.tar.gz: c8fba7e89d87b571085f923130bf5a081aaac7c345c910b47024317a06d9d84be18d887a6e526bd769fac1b4513cf1cb7fb9b23b61cafa3a847c53dde70bf6b4
6
+ metadata.gz: fb9a2f91d0fc73ecbb721f91bfe73b856d3e0b2325f80721e0915a21e9cba9d6cf9d0162c7eb7d753e8ee775b54e1cfbbb6e9bf65d128885fea8ce9fd571a90b
7
+ data.tar.gz: d5b71bc1b0954484fe5fc8cf40244d90c461f0063f58e9eb0d5ef50e3507b88510a1d762f777d0374bb3decba7c8463f005db332a93dbfb23335233a957ef003
@@ -37,7 +37,12 @@ export default class extends Controller {
37
37
  })
38
38
 
39
39
  this.element.addEventListener('pg:record-updated', (ev) => {
40
- this.back(ev)
40
+ if (ev.data.dataset.inline) {
41
+ this.reloadTop()
42
+ ev.stopPropagation()
43
+ } else {
44
+ this.back(ev)
45
+ }
41
46
  })
42
47
 
43
48
  this.element.addEventListener('pg:record-destroyed', (ev) => {
@@ -1,6 +1,6 @@
1
1
  / TODO: usar ModalComponent?
2
2
  .modal[class="#{@klass} modal-#{@modal_id}" tabindex="-1" data-controller="modal"
3
- data-auto-show="true" data-remove-on-hide="false"
3
+ data-auto-show="true" data-remove-on-hide="true"
4
4
  data-modal-asociable-outlet=".asociable-#{@modal_id}"
5
5
  data-turbo-temporary="true"]
6
6
  .modal-dialog
@@ -1,5 +1,8 @@
1
1
  - if @model.class.inline_editable?(@unsuffixed_attribute) && helpers.policy(@model).edit?
2
2
  = helpers.turbo_frame_tag(@frame_id, class: 'inline-edit')
3
+ - if @record_updated
4
+ pg-event[data-event-name="pg:record-updated" data-inline="true" data-turbo-temporary=""
5
+ data-response='#{@model.decorate.to_json}']
3
6
  = link_to users_inline_edit_path(model: @model.to_gid, attribute: @attribute),
4
7
  data: { \
5
8
  controller: :tooltip,
@@ -1,2 +1,7 @@
1
1
  class InlineShowComponent < InlineComponent
2
+ def initialize(model, attribute, record_updated: false)
3
+ @record_updated = record_updated
4
+
5
+ super(model, attribute)
6
+ end
2
7
  end
@@ -258,7 +258,8 @@ module PgEngine
258
258
  respond_to do |format|
259
259
  format.html do
260
260
  if params[:inline_attribute].present?
261
- render InlineShowComponent.new(object, params[:inline_attribute]), layout: false
261
+ render InlineShowComponent.new(object, params[:inline_attribute], record_updated: true),
262
+ layout: false
262
263
  elsif in_modal?
263
264
  body = <<~HTML.html_safe
264
265
  <pg-event data-event-name="pg:record-updated" data-turbo-temporary
@@ -23,7 +23,8 @@ module PgEngine
23
23
  end
24
24
 
25
25
  def modal_targeted?
26
- current_turbo_frame == 'modal_content'
26
+ current_turbo_frame.present? &&
27
+ current_turbo_frame.start_with?('modal_content')
27
28
  end
28
29
 
29
30
  def frame_embedded?
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PgRails
4
- VERSION = '7.6.11'
4
+ VERSION = '7.6.13'
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.6.11
4
+ version: 7.6.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martín Rosso