pg_rails 7.0.8.pre.alpha.19 → 7.0.8.pre.alpha.20

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: a72200e2e6949c04a272d651064a3a69130d65844bda01f62e61e90765d7df1a
4
- data.tar.gz: fbd00f4f53a6b637e79314ffc7cf1cd1aab2bc8ca0637aa80720e56d2115334e
3
+ metadata.gz: 698a6639bf79f6c5eccde6ea5d5aacc18040b4eceb3cbeff00b9110929da210d
4
+ data.tar.gz: e4f98c5c84dd09a63c6b1e179ca3f3450f376eb62fd291eb4a363de821367fb4
5
5
  SHA512:
6
- metadata.gz: e0275e61f1134103afad1ba6ca86f2c6e03bdc5342affe492b582cc6dca3f520e6a9fe37666849248dda4bbac703c26d72ac3cbb6462417dc171360bc811e73e
7
- data.tar.gz: 50f2e304328af6da2894eca1c8767f82e355228812fea38ebcff0ccfba09a422d08eebf43a9f8c231663fc95441296d6fbd1d29a08e92f42c038aca52ec507bb
6
+ metadata.gz: 9493d7e1d3bc2b64e14bdf079a87433f416dc60983735f2456d4c1f7b58c38cb313fcf6372f96b2f57e838df544d9d7ed5cc6282bddcb8f2855029cac21403aa
7
+ data.tar.gz: 666f14a5b5aae6934ebea4afbf0de0e496c45d9c22042d2cdb7f813fff59bc74ab4efb84c0ed72c582883d39279e81d8f053119fc4664107bc9afe3ee9fa3c6f
@@ -0,0 +1,8 @@
1
+ module Users
2
+ class RegistrationsController < Devise::RegistrationsController
3
+ def after_inactive_sign_up_path_for(resource)
4
+ flash[:toast] = false
5
+ super(resource)
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,21 @@
1
+ class MailDeliveryTemporalError < StandardError; end
2
+
3
+ ActionMailer::MailDeliveryJob.rescue_from EOFError,
4
+ IOError,
5
+ # TimeoutError,
6
+ Errno::ENETUNREACH,
7
+ Errno::EHOSTUNREACH,
8
+ Errno::ECONNRESET,
9
+ Errno::ECONNABORTED,
10
+ Errno::ECONNREFUSED,
11
+ Errno::EPIPE,
12
+ Errno::ETIMEDOUT,
13
+ Net::SMTPAuthenticationError,
14
+ Net::SMTPServerBusy,
15
+ Net::SMTPSyntaxError,
16
+ Net::SMTPUnknownError,
17
+ Net::OpenTimeout,
18
+ Net::ReadTimeout,
19
+ OpenSSL::SSL::SSLError do |e|
20
+ raise MailDeliveryTemporalError, e
21
+ end
@@ -24,7 +24,7 @@ Devise.setup do |config|
24
24
  # Configure the e-mail address which will be shown in Devise::Mailer,
25
25
  # note that it will be overwritten if you use your own mailer class
26
26
  # with default "from" parameter.
27
- config.mailer_sender = 'please-change-me-at-config-initializers-devise@example.com'
27
+ config.mailer_sender = ENV.fetch('DEFAULT_MAIL_FROM', 'please-change-me-at-config-initializers-devise@example.com')
28
28
 
29
29
  # Configure the class responsible to send e-mails.
30
30
  # config.mailer = 'Devise::Mailer'
@@ -1,7 +1,7 @@
1
1
  include PgEngine::RouteHelpers
2
2
 
3
3
  Rails.application.routes.draw do
4
- devise_for :users
4
+ devise_for :users, controllers: { registrations: 'users/registrations' }
5
5
  namespace :admin, path: 'a' do
6
6
  pg_resource(:users)
7
7
  pg_resource(:accounts)
@@ -1,6 +1,6 @@
1
1
  require 'rails_helper'
2
2
 
3
- describe Devise::RegistrationsController do
3
+ describe Users::RegistrationsController do
4
4
  before do
5
5
  # rubocop:disable RSpec/InstanceVariable
6
6
  @request.env['devise.mapping'] = Devise.mappings[:user]
@@ -36,6 +36,7 @@ html
36
36
  .btn-toolbar
37
37
  = yield(:actions)
38
38
  hr.my-0
39
+ = render partial: 'pg_layout/flash_alert'
39
40
  = yield
40
41
  div style="width:100%; height: 10em"
41
42
  = render_turbo_stream_title
@@ -2,12 +2,12 @@
2
2
  / slim-lint:disable LineLength
3
3
  - flash_to_show = flash.select { |flash_message| flash_message[0].to_sym.in? ApplicationController._flash_types }
4
4
  / slim-lint:enable LineLength
5
-
6
- / TODO: data-turbo-temporary, setear al activar toast?
7
- - flash_to_show.each do |flash_type, message|
8
- .toast(class="bg-#{flash_type_to_class(flash_type)}-subtle" role="alert" data-bs-autohide="true"
9
- data-xturbo-temporary="true" aria-live="assertive" aria-atomic="true")
10
- .toast-body
11
- = message
12
-
5
+ - toast = flash[:toast].nil? ? true : flash[:toast]
6
+ - if toast
7
+ / TODO: data-turbo-temporary, setear al activar toast?
8
+ - flash_to_show.each do |flash_type, message|
9
+ .toast(class="bg-#{flash_type_to_class(flash_type)}-subtle" role="alert" data-bs-autohide="true"
10
+ data-xturbo-temporary="true" aria-live="assertive" aria-atomic="true")
11
+ .toast-body
12
+ = message
13
13
  / TODO: centrar texto
@@ -0,0 +1,12 @@
1
+ / Flash messages que se muestran en el HTML
2
+ / slim-lint:disable LineLength
3
+ - flash_to_show = flash.select { |flash_message| flash_message[0].to_sym.in? ApplicationController._flash_types }
4
+ / slim-lint:enable LineLength
5
+ - toast = flash[:toast].nil? ? true : flash[:toast]
6
+ - unless toast
7
+ / TODO: data-turbo-temporary, setear al activar toast?
8
+ .text-center
9
+ - flash_to_show.each do |flash_type, message|
10
+ div(class="alert alert-#{flash_type_to_class(flash_type)}" role="alert"
11
+ data-xturbo-temporary="true" aria-live="assertive" aria-atomic="true")
12
+ = message
@@ -1 +1 @@
1
- Dotenv.load('.env.test.local', '.env.test', '.env')
1
+ Dotenv.load(".env.#{Rails.env}.local", ".env.#{Rails.env}", '.env')
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PgRails
4
- VERSION = '7.0.8-alpha.19'
4
+ VERSION = '7.0.8-alpha.20'
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.0.8.pre.alpha.19
4
+ version: 7.0.8.pre.alpha.20
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-03-30 00:00:00.000000000 Z
11
+ date: 2024-03-31 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Rails goodies.
14
14
  email:
@@ -46,6 +46,7 @@ files:
46
46
  - pg_engine/app/controllers/pg_engine/base_controller.rb
47
47
  - pg_engine/app/controllers/pg_engine/devise_controller.rb
48
48
  - pg_engine/app/controllers/pg_engine/require_sign_in.rb
49
+ - pg_engine/app/controllers/users/registrations_controller.rb
49
50
  - pg_engine/app/decorators/account_decorator.rb
50
51
  - pg_engine/app/decorators/pg_engine/base_decorator.rb
51
52
  - pg_engine/app/decorators/user_account_decorator.rb
@@ -88,6 +89,7 @@ files:
88
89
  - pg_engine/app/views/pg_engine/base/edit.html.slim
89
90
  - pg_engine/app/views/pg_engine/base/index.html.slim
90
91
  - pg_engine/app/views/pg_engine/base/new.html.slim
92
+ - pg_engine/config/initializers/action_mailer.rb
91
93
  - pg_engine/config/initializers/active_admin.rb
92
94
  - pg_engine/config/initializers/anycable.rb
93
95
  - pg_engine/config/initializers/cable_ready.rb
@@ -122,8 +124,8 @@ files:
122
124
  - pg_engine/spec/controllers/admin/user_accounts_controller_spec.rb
123
125
  - pg_engine/spec/controllers/admin/users_controller_spec.rb
124
126
  - pg_engine/spec/controllers/concerns/pg_engine/resource_helper_spec.rb
125
- - pg_engine/spec/controllers/devise/registrations_controller_spec.rb
126
127
  - pg_engine/spec/controllers/devise/sessions_controller_spec.rb
128
+ - pg_engine/spec/controllers/users/registrations_controller_spec.rb
127
129
  - pg_engine/spec/factories/accounts.rb
128
130
  - pg_engine/spec/factories/user_accounts.rb
129
131
  - pg_engine/spec/factories/users.rb
@@ -177,6 +179,7 @@ files:
177
179
  - pg_layout/app/views/layouts/pg_layout/devise.html.slim
178
180
  - pg_layout/app/views/layouts/pg_layout/layout.html.slim
179
181
  - pg_layout/app/views/pg_layout/_flash.html.slim
182
+ - pg_layout/app/views/pg_layout/_flash_alert.html.slim
180
183
  - pg_layout/app/views/pg_layout/_navbar.html.erb
181
184
  - pg_layout/app/views/pg_layout/_rollbar.html.erb
182
185
  - pg_layout/app/views/pg_layout/_sidebar.html.erb