pg_rails 7.1.12 → 7.1.14

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: dfa6040427b2819258e1afc08b32b84c8e91c834752369678619c6d4fa8db024
4
- data.tar.gz: '07198f45eabdf38b2e0d6990b82298eda1da31391973aa8190a223cbb4995e23'
3
+ metadata.gz: a86bbc28d3c58f60700af25390dc43d051e14c2c9b493005554ddd3407380351
4
+ data.tar.gz: 061c9da5f9ddf70bf5b878f5a7ecc21d4916bcd6bba702d652213a80e8f085f2
5
5
  SHA512:
6
- metadata.gz: 80054255f87043cae6ca876997a4acbb0bfc5eeb0418991826c3fab5862389543f5916870b61063a6a0d88327c97a96c58ed454075559691f79f81fb4fbd3cd6
7
- data.tar.gz: 78068cb66d350fed57c7fc3369caee7295070b0fe66c6e691792ad5ae3b5cbfbb1c36ab19316f11610e8e9f88a06a3e4d12427df339064f1250a398ad4368fe1
6
+ metadata.gz: 9da11c05db885cdf43976ff3114e4c1971a1dc27909d529b4447bcd31bf750957b84701663ae1003c7e6d993493922270a61f4512e13d67eef83f92f73ddead3
7
+ data.tar.gz: 4e66d31c2819f903c9a8dc30654e3b4522662c310fe931f98f49d3bd9ee1815017515f28dede35bc018433a531fe25ed70081333a89cdf26795852ca6c602653
@@ -12,10 +12,6 @@ export default class extends Controller {
12
12
  if (this.element.dataset.removeOnHide) {
13
13
  this.element.addEventListener('hidden.bs.modal', (e) => {
14
14
  this.element.remove()
15
- // FIXME: handlear mejor
16
- window.Stimulus.controllers.map((c) => { return c.calendar })
17
- .filter((e) => { return e })
18
- .forEach((c) => { c.refetchEvents() })
19
15
  })
20
16
  }
21
17
  this.modalPuntero.show()
@@ -36,6 +32,7 @@ export default class extends Controller {
36
32
 
37
33
  disconnect (e) {
38
34
  this.modalPuntero.hide()
35
+ this.element.dispatchEvent(new Event('hidden.bs.modal'))
39
36
  this.modalPuntero.dispose()
40
37
  }
41
38
  }
@@ -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
@@ -7,4 +7,8 @@ class SearchBarComponent < ViewComponent::Base
7
7
 
8
8
  super
9
9
  end
10
+
11
+ def extra_fields(&)
12
+ @extra_fields = capture(&)
13
+ end
10
14
  end
@@ -22,7 +22,8 @@ module Admin
22
22
  def create
23
23
  saved = false
24
24
  ActiveRecord::Base.transaction do
25
- # FIXME: acá la transaction jode porque el ActiveJob no puede deserializar el Email
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
- render turbo_stream: turbo_stream.append_all(
166
- 'body', partial: 'pg_layout/modal_show', locals: { object: }
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 }
@@ -61,8 +61,7 @@ module PgEngine
61
61
  return unless Pundit.policy!(Current.user, object).edit?
62
62
 
63
63
  helpers.content_tag :span, rel: :tooltip, title: 'Modificar' do
64
- helpers.link_to edit_object_url, data: { turbo_frame: :main },
65
- class: "btn btn-sm #{klass}" do
64
+ helpers.link_to edit_object_url, class: "btn btn-sm #{klass}" do
66
65
  helpers.content_tag(:span, nil, class: clase_icono('pencil')) + text
67
66
  end
68
67
  end
@@ -72,8 +71,7 @@ module PgEngine
72
71
  return unless Pundit.policy!(Current.user, object).show?
73
72
 
74
73
  helpers.content_tag :span, rel: :tooltip, title: 'Ver' do
75
- helpers.link_to object_url, data: { turbo_frame: :main },
76
- class: "btn btn-sm #{klass}" do
74
+ helpers.link_to object_url, class: "btn btn-sm #{klass}" do
77
75
  helpers.content_tag(:span, nil, class: clase_icono('eye-fill')) + text
78
76
  end
79
77
  end
@@ -1 +1 @@
1
- span#tooltip data-bs-toggle="tooltip" data-bs-title="El tooltip" las cosas
1
+ span#tooltip data-controller="tooltip" data-bs-title="El tooltip" las cosas
@@ -4,6 +4,7 @@ html, body {
4
4
 
5
5
  /* Style & Colors */
6
6
  $text-color: $gray-300;
7
+ // TODO: set text-color-dark, y tiene que ir en overrides, no acá
7
8
  $text-hover-color: $gray-100;
8
9
  $chevron-color: 200,200,200,.5;
9
10
 
@@ -1,13 +1,13 @@
1
1
  import * as bootstrap from 'bootstrap'
2
2
 
3
- document.addEventListener('turbo:load', bindTooltips)
4
- document.addEventListener('turbo:render', bindTooltips)
5
-
6
- function bindTooltips () {
7
- const tooltipsQuery = '[data-bs-toggle="tooltip"]'
3
+ const tooltipsQuery = '[data-controller="tooltip"]'
8
4
 
5
+ document.addEventListener('show.bs.tooltip', (ev) => {
9
6
  const toastElList = document.querySelectorAll(tooltipsQuery)
10
- Array.from(toastElList).map(tooltipEl => {
11
- return new bootstrap.Tooltip(tooltipEl)
7
+ Array.from(toastElList).forEach(tooltipEl => {
8
+ const tooltip = bootstrap.Tooltip.getInstance(tooltipEl)
9
+ if (tooltip) {
10
+ tooltip.hide()
11
+ }
12
12
  })
13
- }
13
+ })
@@ -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,14 @@
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
+ this.tooltip = new bootstrap.Tooltip(this.element)
9
+ }
10
+
11
+ disconnect () {
12
+ this.tooltip.dispose()
13
+ }
14
+ }
@@ -7,7 +7,7 @@
7
7
  | Ir al #{object.class.nombre_singular.downcase}
8
8
  a.btn-close[type="button" data-bs-dismiss="modal" aria-label="Close"]
9
9
  .modal-body
10
- = turbo_frame_tag :modal_generic, target: :_top do
10
+ = turbo_frame_tag :modal_generic do
11
11
  .float-end
12
12
  = object.edit_link
13
13
  = object.destroy_link
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PgRails
4
- VERSION = '7.1.12'
4
+ VERSION = '7.1.14'
5
5
  end
@@ -21,6 +21,10 @@ $info: #87accc;
21
21
  $warning-text-emphasis: $orange;
22
22
  $danger-text-emphasis: #910303;
23
23
 
24
+ $tooltip-opacity: 1;
25
+ $tooltip-bg: var(--bs-primary) !default;
26
+ $tooltip-color: var(--bs-light) !default;
27
+
24
28
  $font-size-base: 0.9rem;
25
29
  $enable-validation-icons: false;
26
30
  $focus-ring-width: .05rem;
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.12
4
+ version: 7.1.14
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-08 00:00:00.000000000 Z
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