pg_rails 7.6.12 → 7.6.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/pg_associable/app/javascript/modal_controller.js +6 -1
- data/pg_engine/app/components/inline_edit/inline_edit_component.rb +1 -1
- data/pg_engine/app/components/inline_edit/inline_show_component.html.slim +3 -0
- data/pg_engine/app/components/inline_edit/inline_show_component.rb +5 -0
- data/pg_engine/app/controllers/concerns/pg_engine/resource.rb +2 -1
- data/pg_layout/app/javascript/application.js +9 -0
- data/pg_rails/lib/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aa1826517f886fd0a5fd3ea458411cd600181118fd4494563f6fbe78e32d65c9
|
4
|
+
data.tar.gz: d0d832af6e4c1912a3edf1f3a65fefcb36541773e65d681a1697e75d96ad85a7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 672e3fe48b7a305c61ab0e2eb5cbf218dc0e56fcfbd23a0faec4c5dc655a08b01170a98ce280781b14e1a3547538afc69d48d95756090348c4544dd69835364c
|
7
|
+
data.tar.gz: a648588c54f6e1f72265c511164b2109120f8813423f9c9d9d428f87441e90aaf8835953e906ab041a20378d744ef9b7651d7dde30087cd630c87a45561f3d18
|
@@ -37,7 +37,12 @@ export default class extends Controller {
|
|
37
37
|
})
|
38
38
|
|
39
39
|
this.element.addEventListener('pg:record-updated', (ev) => {
|
40
|
-
|
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) => {
|
@@ -3,7 +3,7 @@ class InlineEditComponent < InlineComponent
|
|
3
3
|
@wrapper_mappings = {
|
4
4
|
string: :inline_form_grow,
|
5
5
|
pg_associable: :inline_form_control,
|
6
|
-
date: :
|
6
|
+
date: :inline_form_control,
|
7
7
|
datetime: :inline_form_control,
|
8
8
|
time: :inline_multi_select,
|
9
9
|
select: :inline_form_select
|
@@ -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,
|
@@ -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]
|
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
|
@@ -2,6 +2,7 @@ import './config'
|
|
2
2
|
import './channels'
|
3
3
|
import './controllers'
|
4
4
|
import './elements'
|
5
|
+
import { flashMessage } from './utils/utils'
|
5
6
|
|
6
7
|
import { Turbo } from '@hotwired/turbo-rails'
|
7
8
|
|
@@ -31,6 +32,14 @@ document.addEventListener('trix-before-initialize', (ev) => {
|
|
31
32
|
Trix.config.lang.urlPlaceholder = 'Ingresá una URL'
|
32
33
|
})
|
33
34
|
|
35
|
+
window.addEventListener('trix-file-accept', function (event) {
|
36
|
+
const maxFileSize = 1024 * 1024 * 10 // 10MB
|
37
|
+
if (event.file.size > maxFileSize) {
|
38
|
+
event.preventDefault()
|
39
|
+
flashMessage('Lo siento mucho pero el tamaño máximo por archivo es de 10MB', 'warning')
|
40
|
+
}
|
41
|
+
})
|
42
|
+
|
34
43
|
document.addEventListener('pg:record-created', (ev) => {
|
35
44
|
Turbo.visit(window.location)
|
36
45
|
setTimeout(() => {
|
data/pg_rails/lib/version.rb
CHANGED