pg_rails 7.6.24 → 7.6.25

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: 5202df927d12827a79e5c89d668cc344dfbd434a266b39810d5585ffdc3ac932
4
- data.tar.gz: d74570bcf0eeb4a5d9f11fb5baf720585458a2026bb0683966a37556d7f2bf69
3
+ metadata.gz: 18003c61fd4e38fc6e7a70402aa0eaba4f335390e50061b1569bbea56c604a83
4
+ data.tar.gz: f2732b2e071e3672cc8e4b6d16e2e577f7b6bf3590a8a6c3d76ef45215bdb67f
5
5
  SHA512:
6
- metadata.gz: d83f4adfce2d2ad3b22996b88dd61df4818e5ee824f66a3b0ac8d5817063e653b4bcbe5c60d98363040ae72886437b4a4a752f2a41bcd36d692e51eca1374b49
7
- data.tar.gz: 45adb571a8d819d11d23a66ef49882496119e3e97e0741e63b59c5f0091d7686189564eabb60ee1c78d6da7fa57139d28340bbcc4a5d41bf7ceb396a28624567
6
+ metadata.gz: 9953c023fe35b70091a3ddc70b4a49f8cc7975476388835f1a0c7b286132afa68c4f5eaf35b6b1e80345fb2ff20251c35b9e238293b43cb217e445e226080598
7
+ data.tar.gz: 39911c247bdd17a3828a378478d03bb4027326b9c9b72d9ad5c0db1dc1b0e4d491dc6b2e37d899a02043a3446818feb304969c4a828b91dc3f7bf9a0adcf89c6
@@ -16,6 +16,12 @@ nav[aria-label=breadcrumb] a {
16
16
  display: inline-block;
17
17
  }
18
18
 
19
+ // Signup
20
+
21
+ #form-signup .form-inputs abbr {
22
+ display: none;
23
+ }
24
+
19
25
  // FORMS
20
26
 
21
27
  // Radio buttons
@@ -1,6 +1,8 @@
1
1
  class FlashContainerComponent < ViewComponent::Base
2
+ # z-1 es para que no se superponga con el dropdown de la navbar,
3
+ # ya que sticky-top setea un z-index de 1020 y el del dropdown es de 1000
2
4
  erb_template <<~HTML
3
- <div id="flash-container" class="d-flex justify-content-around sticky-top">
5
+ <div id="flash-container" class="d-flex justify-content-around sticky-top z-1">
4
6
  <div id="flash" class="flash position-relative w-100 d-flex justify-content-center">
5
7
  <%= content || render(partial: 'pg_layout/flash') %>
6
8
  </div>
@@ -6,6 +6,7 @@ module Users
6
6
  yield resource if block_given?
7
7
 
8
8
  if resource.errors.empty?
9
+ sign_in(resource)
9
10
  set_flash_message!(:notice, :confirmed)
10
11
  respond_with_navigational(resource) { redirect_to after_confirmation_path_for(resource_name, resource) }
11
12
  else
@@ -4,6 +4,13 @@ module Users
4
4
  authorize resource, nil, policy_class: UserRegistrationPolicy
5
5
  end
6
6
 
7
+ # GET /resource/sign_up
8
+ def new
9
+ build_resource(accept_terms: true)
10
+ yield resource if block_given?
11
+ respond_with resource
12
+ end
13
+
7
14
  def create
8
15
  build_resource(sign_up_params)
9
16
 
@@ -23,6 +23,12 @@ class PgFormBuilder < SimpleForm::FormBuilder
23
23
  def input(attribute_name, options = {}, &)
24
24
  options[:error_prefix] ||= default_prefix(attribute_name)
25
25
 
26
+ # Bootstraps's floating labels require an empty placeholder attribute
27
+ merged_wrapper = self.options[:wrapper].to_s + options[:wrapper].to_s
28
+ if merged_wrapper.include?('floating')
29
+ options[:placeholder] = ''
30
+ end
31
+
26
32
  super
27
33
  end
28
34
 
@@ -66,7 +66,7 @@ class User < ApplicationRecord
66
66
 
67
67
  has_many :notifications, as: :recipient, class_name: 'Noticed::Notification'
68
68
 
69
- validates :nombre, :apellido, presence: true
69
+ # validates :nombre, :apellido, presence: true
70
70
 
71
71
  has_one_attached :avatar do |attachable|
72
72
  attachable.variant :thumb, resize_to_fill: [80, 80]
@@ -43,7 +43,7 @@ es:
43
43
  confirmed_at: Fecha de confirmación
44
44
  actualizado_por: Actualizado por
45
45
  creado_por: Creado por
46
- accept_terms: Acepto los <a href="/terminos_y_condiciones" target="_blank">Términos y condiciones</a> y la <a href="/privacidad" target="_blank">Política de privacidad</a>
46
+ accept_terms: Acepto los <a href="/terminos_y_condiciones" target="_blank">términos y condiciones</a>
47
47
  enumerize:
48
48
  user_account:
49
49
  membership_status:
@@ -117,7 +117,7 @@ es:
117
117
  header: "Aceptar invitación"
118
118
  submit_button: "Aceptar"
119
119
  confirmations:
120
- confirmed: ¡Tu cuenta está confirmada! Ya podés iniciar sesión
120
+ confirmed: ¡Bien! Ahora tu cuenta está confirmada
121
121
  sessions:
122
122
  signed_in: ''
123
123
  signed_out: ''
@@ -128,7 +128,7 @@ es:
128
128
  unauthenticated: ''
129
129
  invited: "Tenés una invitación pendiente en tu correo electrónico"
130
130
  registrations:
131
- signed_up_but_unconfirmed: Te enviamos un correo electrónico con instrucciones para confirmar tu cuenta.
131
+ signed_up_but_unconfirmed: Por favor, revisá en tu bandeja de entrada las instrucciones para confirmar tu cuenta.
132
132
  new:
133
133
  sign_up: Crear una cuenta
134
134
  passwords:
@@ -35,6 +35,9 @@ Rails.application.routes.draw do
35
35
  root to: 'accounts#index'
36
36
  end
37
37
 
38
+ # User root for devise's signed_in_root_path
39
+ get '/u', to: 'accounts#index', as: :user_root
40
+
38
41
  namespace :tenant, path: 'u/t(/:tid)' do
39
42
  pg_resource(:user_accounts, only: [:index, :show, :edit, :update, :destroy])
40
43
  scope controller: 'inline_edit', path: 'inline', as: :inline do
@@ -18,10 +18,7 @@ describe 'Al Registrarse' do
18
18
  perform_enqueued_jobs do
19
19
  visit '/users/sign_up'
20
20
  fill_in 'user_email', with: Faker::Internet.email
21
- fill_in 'user_nombre', with: Faker::Name.name
22
- fill_in 'user_apellido', with: Faker::Name.name
23
21
  fill_in 'user_password', with: 'admin123'
24
- fill_in 'user_password_confirmation', with: 'admin123'
25
22
 
26
23
  accept_terms
27
24
 
@@ -31,7 +28,7 @@ describe 'Al Registrarse' do
31
28
 
32
29
  context 'cuando acepta los términos' do
33
30
  let(:accept_terms) do
34
- check 'user_accept_terms'
31
+ nil
35
32
  end
36
33
 
37
34
  it 'guarda el user' do
@@ -39,13 +36,13 @@ describe 'Al Registrarse' do
39
36
  ActsAsTenant.without_tenant do
40
37
  expect(Account.last.owner).to eq User.last
41
38
  end
42
- expect(page).to have_text('Te enviamos un correo electrónico con instrucciones')
39
+ expect(page).to have_text('las instrucciones para confirmar')
43
40
  end
44
41
  end
45
42
 
46
43
  context 'si no acepta los terms' do
47
44
  let(:accept_terms) do
48
- nil
45
+ uncheck 'user_accept_terms'
49
46
  end
50
47
 
51
48
  it do
@@ -77,12 +74,6 @@ describe 'Al Registrarse' do
77
74
  end
78
75
  end
79
76
 
80
- # drivers = %i[
81
- # selenium_headless
82
- # selenium_chrome_headless
83
- # selenium_chrome_headless_notebook
84
- # selenium_chrome_headless_iphone
85
- # ]
86
77
  drivers = %i[selenium_chrome_headless_iphone]
87
78
  drivers = [ENV['DRIVER'].to_sym] if ENV['DRIVER'].present?
88
79
 
@@ -0,0 +1 @@
1
+ p Creá tu cuenta!
@@ -1,27 +1,29 @@
1
- <h2><%= t(".sign_up") %></h2>
2
- <div id="form-signup" data-controller="pg_form">
3
- <%= pg_form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %>
4
- <div class="form-inputs">
5
- <%= f.input :nombre, required: true, autofocus: true %>
6
- <%= f.input :apellido, required: true %>
7
- <%= f.input :email,
8
- required: true,
9
- input_html: { autocomplete: "email" }%>
10
- <%= f.input :password,
11
- required: true,
12
- hint: (t('devise.shared.minimum_password_length', count: @minimum_password_length) if @minimum_password_length),
13
- input_html: { autocomplete: "new-password" } %>
14
- <%= f.input :password_confirmation,
15
- required: true,
16
- input_html: { autocomplete: "new-password" } %>
17
- <%= f.input :accept_terms, as: :boolean, label: t('attributes.accept_terms').html_safe, error_prefix: '' %>
1
+ <div class="container mt-5" style="max-width: 80em">
2
+ <div class="row flex-wrap-reverse">
3
+ <div class="col-sm">
4
+ <%= render partial: 'signup_info' %>
18
5
  </div>
6
+ <div class="col-sm">
7
+ <div class="position-sticky z-1" style="top: 0.5em">
8
+ <h1 class="mb-4">Creá tu cuenta</h1>
9
+ <%# #form-signup se reemplaza por el mensaje de revisar la bandeja de entrada %>
10
+ <div class="text-center" id="form-signup" data-controller="pg_form">
11
+ <%= pg_form_for(resource, as: resource_name, url: registration_path(resource_name), wrapper: :floating_labels_form) do |f| %>
12
+ <div class="form-inputs m-auto d-inline-block" style="max-width: 20em">
13
+ <%= f.input :email, label: 'Tu email', input_html: { class: 'form-control-lg', autocomplete: "email" }%>
14
+ <%= f.input :password, label: 'Elegí una contraseña',
15
+ input_html: { class: 'form-control-lg', autocomplete: "new-password" } %>
16
+ <%= f.input :accept_terms, as: :boolean, label: t('attributes.accept_terms').html_safe, error_prefix: '', wrapper_html: { class: 'justify-content-center' } %>
17
+ </div>
19
18
 
20
- <div class="form-actions">
21
- <%= f.button :submit, t(".sign_up") %>
22
- </div>
23
- <% end %>
19
+ <div class="form-actions">
20
+ <%= f.button :submit, 'Registrarme' %>
21
+ </div>
22
+ <% end %>
24
23
 
25
- <%= render "devise/shared/links" %>
24
+ <%= render "devise/shared/links" %>
25
+ </div>
26
+ </div>
27
+ </div>
28
+ </div>
26
29
  </div>
27
-
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PgRails
4
- VERSION = '7.6.24'
4
+ VERSION = '7.6.25'
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.6.24
4
+ version: 7.6.25
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: 2025-01-07 00:00:00.000000000 Z
11
+ date: 2025-01-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -1020,6 +1020,7 @@ files:
1020
1020
  - pg_layout/app/views/devise/mailer/unlock_instructions.html.erb
1021
1021
  - pg_layout/app/views/devise/passwords/edit.html.erb
1022
1022
  - pg_layout/app/views/devise/passwords/new.html.erb
1023
+ - pg_layout/app/views/devise/registrations/_signup_info.html.slim
1023
1024
  - pg_layout/app/views/devise/registrations/edit.html.erb
1024
1025
  - pg_layout/app/views/devise/registrations/new.html.erb
1025
1026
  - pg_layout/app/views/devise/sessions/new.html.erb