pg_rails 7.2.3 → 7.3.0
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/helpers/pg_associable/form_builder_methods.rb +1 -2
- data/pg_associable/app/helpers/pg_associable/helpers.rb +4 -5
- data/pg_associable/app/javascript/modal_controller.js +19 -7
- data/pg_associable/spec/system/associable_spec.rb +2 -2
- data/pg_engine/app/components/actions_component.rb +14 -0
- data/pg_engine/app/components/asociable_modal_component.html.slim +6 -0
- data/pg_engine/app/components/asociable_modal_component.rb +7 -0
- data/pg_engine/app/components/form_modal_component.html.slim +15 -0
- data/pg_engine/app/components/form_modal_component.rb +6 -0
- data/pg_engine/app/components/modal_component.html.slim +5 -0
- data/pg_engine/app/components/modal_component.rb +11 -0
- data/pg_engine/app/components/modal_content_component.rb +28 -0
- data/pg_engine/app/components/show_modal_component.html.slim +10 -0
- data/pg_engine/app/components/show_modal_component.rb +7 -0
- data/pg_engine/app/controllers/admin/emails_controller.rb +3 -20
- data/pg_engine/app/controllers/concerns/pg_engine/resource.rb +134 -102
- data/pg_engine/app/decorators/pg_engine/base_record_decorator.rb +29 -8
- data/pg_engine/app/helpers/pg_engine/flash_helper.rb +6 -2
- data/pg_engine/app/helpers/pg_engine/form_helper.rb +20 -2
- data/pg_engine/app/models/email.rb +2 -0
- data/pg_engine/app/models/pg_engine/base_record.rb +11 -0
- data/pg_engine/app/views/admin/accounts/_form.html.slim +1 -4
- data/pg_engine/app/views/admin/email_logs/_form.html.slim +2 -5
- data/pg_engine/app/views/admin/emails/_form.html.slim +13 -13
- data/pg_engine/app/views/admin/emails/_send.html.slim +0 -1
- data/pg_engine/app/views/admin/emails/show.html.slim +19 -20
- data/pg_engine/app/views/admin/eventos/new.html.slim +0 -2
- data/pg_engine/app/views/admin/user_accounts/_form.html.slim +1 -4
- data/pg_engine/app/views/admin/users/_form.html.slim +1 -4
- data/pg_engine/app/views/pg_engine/base/index.html.slim +4 -0
- data/pg_engine/app/views/pg_engine/base/new.html.slim +1 -2
- data/pg_engine/app/views/public/mensaje_contactos/new.html.slim +2 -5
- data/pg_engine/config/initializers/kaminari.rb +3 -0
- data/pg_engine/lib/pg_engine/utils/pg_logger.rb +10 -10
- data/pg_engine/spec/controllers/admin/accounts_controller_spec.rb +2 -2
- data/pg_engine/spec/controllers/admin/email_logs_controller_spec.rb +2 -2
- data/pg_engine/spec/controllers/admin/emails_controller_spec.rb +2 -2
- data/pg_engine/spec/controllers/admin/user_accounts_controller_spec.rb +2 -2
- data/pg_engine/spec/controllers/admin/users_controller_spec.rb +2 -2
- data/pg_engine/spec/lib/pg_engine/form_helper_spec.rb +53 -0
- data/pg_engine/spec/system/modal_windows_spec.rb +89 -0
- data/pg_engine/spec/system/send_mail_spec.rb +1 -1
- data/pg_layout/app/javascript/application.js +24 -0
- data/pg_layout/app/javascript/controllers/popover_toggler_controller.js +3 -2
- data/pg_layout/app/javascript/elements/index.js +1 -0
- data/pg_layout/app/javascript/elements/pg_event.js +12 -0
- data/pg_layout/app/views/devise/confirmations/new.html.erb +0 -1
- data/pg_layout/app/views/devise/passwords/edit.html.erb +0 -2
- data/pg_layout/app/views/devise/passwords/new.html.erb +0 -2
- data/pg_layout/app/views/devise/registrations/edit.html.erb +0 -2
- data/pg_layout/app/views/devise/registrations/new.html.erb +0 -2
- data/pg_layout/app/views/devise/unlocks/new.html.erb +0 -1
- data/pg_rails/lib/version.rb +1 -1
- data/pg_scaffold/lib/generators/pg_rspec/scaffold/templates/controller_spec.rb +2 -2
- data/pg_scaffold/lib/generators/pg_slim/templates/_form.html.slim +2 -5
- data/pg_scaffold/lib/generators/pg_slim/templates/show.html.slim +1 -1
- metadata +17 -4
- data/pg_associable/app/views/pg_engine/base/_pg_associable_modal.html.slim +0 -14
- data/pg_layout/app/views/pg_layout/_modal_show.html.slim +0 -14
@@ -265,9 +265,9 @@ RSpec.describe <%= controller_class_name %>Controller do
|
|
265
265
|
end
|
266
266
|
|
267
267
|
<% end -%>
|
268
|
-
it '
|
268
|
+
it 'envía el pg-event' do
|
269
269
|
subject
|
270
|
-
expect(response.body).to include('
|
270
|
+
expect(response.body).to include('<pg-event data-event-name="pg:record-destroyed"')
|
271
271
|
end
|
272
272
|
|
273
273
|
context 'si hay redirect_to' do
|
@@ -1,10 +1,7 @@
|
|
1
|
-
/ # locals: (object: nil
|
1
|
+
/ # locals: (object: nil)
|
2
2
|
|
3
3
|
div style="max-width: 22em" data-controller="pg_form"
|
4
|
-
= pg_form_for(@<%= singular_name %> || object
|
5
|
-
= f.mensajes_de_error
|
6
|
-
|
7
|
-
= hidden_field_tag :asociable, true if asociable
|
4
|
+
= pg_form_for(@<%= singular_name %> || object) do |f|
|
8
5
|
<%- attributes.each do |attribute| -%>
|
9
6
|
= f.<%= attribute.reference? ? :pg_associable : :input %> :<%= attribute.name %>
|
10
7
|
<%- end -%>
|
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.
|
4
|
+
version: 7.3.0
|
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-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -614,7 +614,6 @@ files:
|
|
614
614
|
- pg_associable/app/javascript/asociable_controller.tsx
|
615
615
|
- pg_associable/app/javascript/modal_controller.js
|
616
616
|
- pg_associable/app/views/pg_associable/_resultados_inline.html.slim
|
617
|
-
- pg_associable/app/views/pg_engine/base/_pg_associable_modal.html.slim
|
618
617
|
- pg_associable/index.js
|
619
618
|
- pg_associable/lib/pg_associable.rb
|
620
619
|
- pg_associable/lib/pg_associable/engine.rb
|
@@ -636,15 +635,23 @@ files:
|
|
636
635
|
- pg_engine/app/assets/stylesheets/active_admin.scss
|
637
636
|
- pg_engine/app/assets/stylesheets/notifications.scss
|
638
637
|
- pg_engine/app/assets/stylesheets/pg_rails_b5.scss
|
638
|
+
- pg_engine/app/components/actions_component.rb
|
639
639
|
- pg_engine/app/components/alert_component.html.slim
|
640
640
|
- pg_engine/app/components/alert_component.rb
|
641
|
+
- pg_engine/app/components/asociable_modal_component.html.slim
|
642
|
+
- pg_engine/app/components/asociable_modal_component.rb
|
641
643
|
- pg_engine/app/components/bad_request_component.rb
|
642
644
|
- pg_engine/app/components/bad_user_input_component.rb
|
643
645
|
- pg_engine/app/components/base_component.rb
|
644
646
|
- pg_engine/app/components/date_selector_component.html.slim
|
645
647
|
- pg_engine/app/components/date_selector_component.rb
|
646
648
|
- pg_engine/app/components/flash_container_component.rb
|
649
|
+
- pg_engine/app/components/form_modal_component.html.slim
|
650
|
+
- pg_engine/app/components/form_modal_component.rb
|
647
651
|
- pg_engine/app/components/internal_error_component.rb
|
652
|
+
- pg_engine/app/components/modal_component.html.slim
|
653
|
+
- pg_engine/app/components/modal_component.rb
|
654
|
+
- pg_engine/app/components/modal_content_component.rb
|
648
655
|
- pg_engine/app/components/notification_component.rb
|
649
656
|
- pg_engine/app/components/notifications_bell_component.rb
|
650
657
|
- pg_engine/app/components/page_not_found_component.rb
|
@@ -652,6 +659,8 @@ files:
|
|
652
659
|
- pg_engine/app/components/search_bar_component.rb
|
653
660
|
- pg_engine/app/components/search_bar_toggler_component.html.slim
|
654
661
|
- pg_engine/app/components/search_bar_toggler_component.rb
|
662
|
+
- pg_engine/app/components/show_modal_component.html.slim
|
663
|
+
- pg_engine/app/components/show_modal_component.rb
|
655
664
|
- pg_engine/app/controllers/admin/accounts_controller.rb
|
656
665
|
- pg_engine/app/controllers/admin/email_logs_controller.rb
|
657
666
|
- pg_engine/app/controllers/admin/emails_controller.rb
|
@@ -754,6 +763,7 @@ files:
|
|
754
763
|
- pg_engine/config/initializers/anycable.rb
|
755
764
|
- pg_engine/config/initializers/cable_ready.rb
|
756
765
|
- pg_engine/config/initializers/devise.rb
|
766
|
+
- pg_engine/config/initializers/kaminari.rb
|
757
767
|
- pg_engine/config/initializers/ransack.rb
|
758
768
|
- pg_engine/config/initializers/ransack_memory.rb
|
759
769
|
- pg_engine/config/initializers/rollbar.rb
|
@@ -828,6 +838,7 @@ files:
|
|
828
838
|
- pg_engine/spec/helpers/pg_engine/print_helper_spec.rb
|
829
839
|
- pg_engine/spec/lib/pg_engine/date_jumper_spec.rb
|
830
840
|
- pg_engine/spec/lib/pg_engine/error_helper_spec.rb
|
841
|
+
- pg_engine/spec/lib/pg_engine/form_helper_spec.rb
|
831
842
|
- pg_engine/spec/lib/pg_engine/mailgun/log_sync_spec.rb
|
832
843
|
- pg_engine/spec/lib/pg_engine/utils/pg_engine/pg_logger_spec.rb
|
833
844
|
- pg_engine/spec/lib/pg_form_builder_spec.rb
|
@@ -847,6 +858,7 @@ files:
|
|
847
858
|
- pg_engine/spec/system/date_selector_spec.rb
|
848
859
|
- pg_engine/spec/system/destroy_spec.rb
|
849
860
|
- pg_engine/spec/system/login_spec.rb
|
861
|
+
- pg_engine/spec/system/modal_windows_spec.rb
|
850
862
|
- pg_engine/spec/system/noticed_spec.rb
|
851
863
|
- pg_engine/spec/system/page_sizes_spec.rb
|
852
864
|
- pg_engine/spec/system/send_mail_spec.rb
|
@@ -881,6 +893,8 @@ files:
|
|
881
893
|
- pg_layout/app/javascript/controllers/switcher_controller.js
|
882
894
|
- pg_layout/app/javascript/controllers/theme_controller.js
|
883
895
|
- pg_layout/app/javascript/controllers/tooltip_controller.js
|
896
|
+
- pg_layout/app/javascript/elements/index.js
|
897
|
+
- pg_layout/app/javascript/elements/pg_event.js
|
884
898
|
- pg_layout/app/javascript/utils/cookies.js
|
885
899
|
- pg_layout/app/javascript/utils/utils.ts
|
886
900
|
- pg_layout/app/lib/navbar.rb
|
@@ -914,7 +928,6 @@ files:
|
|
914
928
|
- pg_layout/app/views/layouts/pg_layout/mailer.html.slim
|
915
929
|
- pg_layout/app/views/layouts/pg_layout/mailer.text.erb
|
916
930
|
- pg_layout/app/views/pg_layout/_flash.html.slim
|
917
|
-
- pg_layout/app/views/pg_layout/_modal_show.html.slim
|
918
931
|
- pg_layout/app/views/pg_layout/_navbar.html.erb
|
919
932
|
- pg_layout/app/views/pg_layout/_sidebar.html.erb
|
920
933
|
- pg_layout/app/views/pg_layout/_sidebar_mobile.html.erb
|
@@ -1,14 +0,0 @@
|
|
1
|
-
.modal.modal-asociable[class="modal-#{params[:id]}"
|
2
|
-
tabindex="-1" data-controller="modal"
|
3
|
-
data-modal-asociable-outlet=".asociable-#{params[:id]}"]
|
4
|
-
.modal-dialog
|
5
|
-
/ TODO: pg_associable no va
|
6
|
-
.modal-content.pg_associable
|
7
|
-
.modal-header
|
8
|
-
.modal-title
|
9
|
-
/ TODO: género "Nuevo/a"
|
10
|
-
h3 Nuevo #{@clase_modelo.nombre_singular.downcase}
|
11
|
-
a.btn-close[type="button" data-bs-dismiss="modal" aria-label="Close"]
|
12
|
-
.modal-body
|
13
|
-
.pg-associable-form
|
14
|
-
= render partial: 'form', locals: { object: @clase_modelo.new, asociable: true }
|
@@ -1,14 +0,0 @@
|
|
1
|
-
.modal.modal-lg.modal-asociable[tabindex="-1" data-controller="modal"
|
2
|
-
data-remove-on-hide="true" data-turbo-temporary="true"]
|
3
|
-
.modal-dialog
|
4
|
-
.modal-content
|
5
|
-
.modal-header
|
6
|
-
= link_to object.target_object do
|
7
|
-
| Ir al #{object.class.nombre_singular.downcase}
|
8
|
-
a.btn-close[type="button" data-bs-dismiss="modal" aria-label="Close"]
|
9
|
-
.modal-body
|
10
|
-
= turbo_frame_tag :modal_generic do
|
11
|
-
.float-end
|
12
|
-
= object.edit_link
|
13
|
-
= object.destroy_link
|
14
|
-
= render object
|