pg_rails 7.1.13 → 7.1.15
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 +1 -1
- data/pg_engine/app/components/search_bar_component.html.slim +2 -1
- data/pg_engine/app/components/search_bar_component.rb +4 -0
- data/pg_engine/app/controllers/admin/emails_controller.rb +2 -1
- data/pg_engine/app/controllers/concerns/pg_engine/resource.rb +8 -3
- data/pg_engine/app/controllers/pg_engine/base_controller.rb +3 -2
- data/pg_engine/spec/components/previews/alert_component_preview/tooltips.html.slim +1 -1
- data/pg_layout/app/javascript/config/tooltips.js +1 -11
- data/pg_layout/app/javascript/controllers/index.js +2 -0
- data/pg_layout/app/javascript/controllers/tooltip_controller.js +28 -0
- data/pg_rails/lib/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 266cfada8ad43cc522e6208107c12715f29ac0393c93154046d377f0ca434598
|
4
|
+
data.tar.gz: 1fec4b327371b492aa75ec6640b7c9a85f93afceb7d89074aec369f67f85cb11
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a985cde74ba0a65f4f234d0b5648cf7465291dfcd16da6d92ea9d3a1b62c1bb8a9a0c70a4936dcf7bbf679b2f8b6d8ba56b3a9e8bdf8133e3d81b8e5d28a9941
|
7
|
+
data.tar.gz: 9213cd8758d1f4ea9a9ead1c5f0aa8ba26e67cb83ec2a643e7635a0e6ce37caa02e722f174b5b5b10ecfac6f65eb386d0356e8f54bb12c9e34bc91552fb8bed9
|
@@ -3,11 +3,12 @@
|
|
3
3
|
.d-flex.align-items-center.px-3.py-2
|
4
4
|
.px-2.d-none.d-sm-inline-block
|
5
5
|
span.bi.bi-funnel-fill
|
6
|
-
= helpers.search_form_for @q, url: url_for do |f|
|
6
|
+
= helpers.search_form_for @q, url: url_for, html: { 'data-turbo-action': :advance } do |f|
|
7
7
|
.row.g-1
|
8
8
|
.col
|
9
9
|
.row.g-1
|
10
10
|
= @builder.filtros_html(form: f)
|
11
|
+
= @extra_fields
|
11
12
|
.col-auto.gap-1.d-flex.align-items-start
|
12
13
|
= helpers.button_tag class: 'btn btn-sm btn-primary col-auto' do
|
13
14
|
span.bi.bi-search
|
@@ -22,7 +22,8 @@ module Admin
|
|
22
22
|
def create
|
23
23
|
saved = false
|
24
24
|
ActiveRecord::Base.transaction do
|
25
|
-
#
|
25
|
+
# TODO: acá la transaction jode porque el ActiveJob no puede deserializar el Email
|
26
|
+
# Con rails 7.2 esto se debería arreglar
|
26
27
|
if (saved = @email.save)
|
27
28
|
PgEngine::AdminMailer.with(email_object: @email).admin_mail.deliver_later
|
28
29
|
end
|
@@ -162,9 +162,14 @@ module PgEngine
|
|
162
162
|
def pg_respond_show(object = nil)
|
163
163
|
object ||= instancia_modelo
|
164
164
|
if params[:modal].present?
|
165
|
-
|
166
|
-
|
167
|
-
|
165
|
+
respond_to do |format|
|
166
|
+
format.html
|
167
|
+
format.turbo_stream do
|
168
|
+
render turbo_stream: turbo_stream.append_all(
|
169
|
+
'body', partial: 'pg_layout/modal_show', locals: { object: }
|
170
|
+
)
|
171
|
+
end
|
172
|
+
end
|
168
173
|
else
|
169
174
|
respond_to do |format|
|
170
175
|
format.json { render json: object }
|
@@ -91,11 +91,12 @@ module PgEngine
|
|
91
91
|
end
|
92
92
|
|
93
93
|
if Current.user.present?
|
94
|
+
# TODO: quitar el limit 3, discard en events
|
94
95
|
@notifications = Current.user.notifications.order(id: :desc).includes(:event)
|
95
96
|
.where(type: 'SimpleUserNotifier::Notification')
|
97
|
+
.limit(3)
|
96
98
|
unseen = @notifications.unseen.any?
|
97
|
-
|
98
|
-
tooltip = @notifications.unseen.map(&:tooltip).first
|
99
|
+
tooltip = @notifications.unseen.map(&:tooltip).select(&:presence).first
|
99
100
|
@notifications_bell = NotificationsBellComponent.new(
|
100
101
|
unseen:,
|
101
102
|
tooltip:
|
@@ -1 +1 @@
|
|
1
|
-
span#tooltip data-
|
1
|
+
span#tooltip data-controller="tooltip" data-bs-title="El tooltip" las cosas
|
@@ -1,16 +1,6 @@
|
|
1
1
|
import * as bootstrap from 'bootstrap'
|
2
2
|
|
3
|
-
|
4
|
-
document.addEventListener('turbo:render', bindTooltips)
|
5
|
-
|
6
|
-
const tooltipsQuery = '[data-bs-toggle="tooltip"]'
|
7
|
-
|
8
|
-
function bindTooltips () {
|
9
|
-
const toastElList = document.querySelectorAll(tooltipsQuery)
|
10
|
-
Array.from(toastElList).map(tooltipEl => {
|
11
|
-
return new bootstrap.Tooltip(tooltipEl)
|
12
|
-
})
|
13
|
-
}
|
3
|
+
const tooltipsQuery = '[data-controller="tooltip"]'
|
14
4
|
|
15
5
|
document.addEventListener('show.bs.tooltip', (ev) => {
|
16
6
|
const toastElList = document.querySelectorAll(tooltipsQuery)
|
@@ -10,6 +10,7 @@ import FiltrosController from './filtros_controller'
|
|
10
10
|
import NotificationsController from './notifications_controller'
|
11
11
|
import SelectizeController from './selectize_controller'
|
12
12
|
import ThemeController from './theme_controller'
|
13
|
+
import TooltipController from './tooltip_controller'
|
13
14
|
|
14
15
|
application.register('navbar', NavbarController)
|
15
16
|
application.register('nested', NestedController)
|
@@ -21,5 +22,6 @@ application.register('filtros', FiltrosController)
|
|
21
22
|
application.register('notifications', NotificationsController)
|
22
23
|
application.register('selectize', SelectizeController)
|
23
24
|
application.register('theme', ThemeController)
|
25
|
+
application.register('tooltip', TooltipController)
|
24
26
|
|
25
27
|
// TODO: testear con capybara todo lo que se pueda
|
@@ -0,0 +1,28 @@
|
|
1
|
+
import { Controller } from '@hotwired/stimulus'
|
2
|
+
import * as bootstrap from 'bootstrap'
|
3
|
+
|
4
|
+
export default class extends Controller {
|
5
|
+
tooltip = null
|
6
|
+
|
7
|
+
connect () {
|
8
|
+
if (this.element.dataset.bsTrigger === 'contextmenu') {
|
9
|
+
this.element.addEventListener('contextmenu', (ev) => {
|
10
|
+
ev.preventDefault()
|
11
|
+
if (!this.tooltip) {
|
12
|
+
this.tooltip = new bootstrap.Tooltip(this.element, {
|
13
|
+
trigger: 'focus'
|
14
|
+
})
|
15
|
+
this.tooltip.show()
|
16
|
+
}
|
17
|
+
})
|
18
|
+
} else {
|
19
|
+
this.tooltip = new bootstrap.Tooltip(this.element)
|
20
|
+
}
|
21
|
+
}
|
22
|
+
|
23
|
+
disconnect () {
|
24
|
+
if (this.tooltip) {
|
25
|
+
this.tooltip.dispose()
|
26
|
+
}
|
27
|
+
}
|
28
|
+
}
|
data/pg_rails/lib/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pg_rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 7.1.
|
4
|
+
version: 7.1.15
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Martín Rosso
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-08-
|
11
|
+
date: 2024-08-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -839,6 +839,7 @@ files:
|
|
839
839
|
- pg_layout/app/javascript/controllers/selectize_controller.js
|
840
840
|
- pg_layout/app/javascript/controllers/switcher_controller.js
|
841
841
|
- pg_layout/app/javascript/controllers/theme_controller.js
|
842
|
+
- pg_layout/app/javascript/controllers/tooltip_controller.js
|
842
843
|
- pg_layout/app/javascript/utils/cookies.js
|
843
844
|
- pg_layout/app/javascript/utils/utils.ts
|
844
845
|
- pg_layout/app/lib/navbar.rb
|