pg_rails 7.1.1.pre.4 → 7.1.1.pre.5

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: 34465452a5982269db6136a0000c16c78bb9576b57f7d4f3476940a76d28cae7
4
- data.tar.gz: 77ecad87cb6e8ae5f99b5d73a40bbf60efb8f94a56782d253294904382b8ac3b
3
+ metadata.gz: 8ed654c2ed0008b0a029aafcf59fbf1fb11d681b091852cdf91075eb59027b4e
4
+ data.tar.gz: 8c5030277d34251d6e214697475c1e79121a40b1c5c9b757eb9ca95d04261bfb
5
5
  SHA512:
6
- metadata.gz: 7b790cb222b1a4ed7acae49253e7a55700584e612750ad763449d68089dc294f66822a8eb9db4dc89303dcf3a3d20e2360944a222191fa53413ba3182806e8a8
7
- data.tar.gz: cea1c5777acd0791fc8d32c3e28815881334e753f43e3608542e1d1181b03bfa980c154cfd2662d3c9927b30dab3a4acf0d3d2efeb3d2af0bb5b5a875d1d2bb3
6
+ metadata.gz: f2a334fbf6cf1e62e629bb231ab9ecca2300b30db6f04e1fb6360e7d9d2688a9399398d860cc0930418889b5960dfe900eb6e7bd8a7be8ff0e32d8e48513244b
7
+ data.tar.gz: f3686b6c215d38d54147e1506d7645b36ccf29ed2fde0dae04574662a649550d952deb5bce503a6ff3403dc98c77235364485e04e3dc4171f39af7ee4db672cf
@@ -160,7 +160,9 @@ module PgEngine
160
160
  end
161
161
  else
162
162
  format.turbo_stream do
163
- render turbo_stream: turbo_stream.remove(model)
163
+ # Esto no es totalmente limpio pero funciona tanto en los listados como en los
164
+ # modal show
165
+ render turbo_stream: turbo_stream.remove(model) + turbo_stream.remove_all('.modal')
164
166
  end
165
167
  format.html do
166
168
  redirect_back(fallback_location: root_path, notice: msg, status: 303)
@@ -112,8 +112,13 @@ module PgEngine
112
112
 
113
113
  protected
114
114
 
115
- # rubocop:disable Metrics/AbcSize
116
115
  def render_my_component(component, status)
116
+ # Esto es para que saltee los turbo frames y genere
117
+ # un full reload. El turbo_no_cache no es estrictamente necesario
118
+ # pero lo dejo por las dudas
119
+ @turbo_page_requires_reload = true
120
+ @turbo_no_cache = true
121
+
117
122
  respond_to do |format|
118
123
  format.html do
119
124
  render component.alert_wrapped(view_context),
@@ -139,7 +144,6 @@ module PgEngine
139
144
  end
140
145
  end
141
146
  end
142
- # rubocop:enable Metrics/AbcSize
143
147
 
144
148
  def not_authorized(_arg_required_for_active_admin)
145
149
  respond_to do |format|
@@ -1,7 +1,7 @@
1
1
  module Users
2
2
  class ConfirmationsController < Devise::ConfirmationsController
3
3
  # GET /resource/confirmation?confirmation_token=abcdef
4
- def show # rubocop:disable Metrics/AbcSize
4
+ def show
5
5
  self.resource = resource_class.confirm_by_token(params[:confirmation_token])
6
6
  yield resource if block_given?
7
7
 
@@ -6,7 +6,7 @@
6
6
  = f.input :message, as: :text
7
7
  - else
8
8
  = f.rich_text_area :message
9
- = f.input :message_text, as: :text
9
+ = f.input :message_text, as: :text, hint: 'Solo para emails, para la plain/text part'
10
10
  = f.input :tooltip
11
11
  = f.input :subject
12
12
  = f.input :record_type
@@ -1,8 +1,6 @@
1
1
  DatabaseCleaner.clean_with(:truncation, except: %w(ar_internal_metadata))
2
2
 
3
- MAIL = 'mrosso10@gmail.com'
3
+ FactoryBot.create :user, email: 'mrosso10@gmail.com', nombre: 'Martín', apellido: 'Rosso', password: 'admin123',
4
+ confirmed_at: Time.now, developer: true
4
5
 
5
- unless User.where(email: MAIL).exists?
6
- FactoryBot.create :user, email: MAIL, nombre: 'Martín', apellido: 'Rosso', password: 'admin123',
7
- confirmed_at: Time.now, developer: true
8
- end
6
+ Account.first.users << FactoryBot.create(:user, orphan: true)
@@ -2,7 +2,7 @@
2
2
 
3
3
  module PgEngine
4
4
  class EmailObserver
5
- def self.delivered_email(message) # rubocop:disable Metrics/AbcSize
5
+ def self.delivered_email(message)
6
6
  message_id = message.message_id
7
7
  mailer = message.delivery_handler.to_s
8
8
  status = get_status(message)
@@ -37,8 +37,8 @@
37
37
 
38
38
  FactoryBot.define do
39
39
  factory :user, class: 'User' do
40
- nombre { Faker::Name.name }
41
- apellido { Faker::Name.name }
40
+ nombre { Faker::Name.first_name }
41
+ apellido { Faker::Name.last_name }
42
42
  email { Faker::Internet.email }
43
43
  password { "password#{rand(99_999)}" }
44
44
  confirmed_at { Faker::Date.backward }
@@ -5,6 +5,9 @@ html
5
5
  meta charset="UTF-8"
6
6
  meta http-equiv="X-UA-Compatible" content="IE=edge"
7
7
  meta name="viewport" content="width=device-width,initial-scale=1"
8
+ - if @turbo_page_requires_reload
9
+ meta name="turbo-visit-control" content="reload"
10
+
8
11
  - cache :title_icon
9
12
  title = t('app_name')
10
13
  - begin
@@ -1,9 +1,14 @@
1
- .modal.modal-lg.modal-asociable[tabindex="-1" data-controller="modal" data-remove-on-hide="true"]
1
+ .modal.modal-lg.modal-asociable[tabindex="-1" data-controller="modal"
2
+ data-remove-on-hide="true" data-turbo-temporary="true"]
2
3
  .modal-dialog
3
4
  .modal-content
4
5
  .modal-header
5
- .modal-title
6
- h3 Item
6
+ = link_to object.target_object do
7
+ | Ir al #{object.class.nombre_singular.downcase}
7
8
  a.btn-close[type="button" data-bs-dismiss="modal" aria-label="Close"]
8
9
  .modal-body
9
- = render object
10
+ = turbo_frame_tag :modal_generic, target: :_top do
11
+ .float-end
12
+ = object.edit_link
13
+ = object.destroy_link
14
+ = render object
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PgRails
4
- VERSION = '7.1.1-4'
4
+ VERSION = '7.1.1-5'
5
5
  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.1.1.pre.4
4
+ version: 7.1.1.pre.5
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-07-21 00:00:00.000000000 Z
11
+ date: 2024-07-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails