pg_rails 7.0.8.pre.alpha.54 → 7.0.8.pre.alpha.56

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: 8e9b803dcc4fc1155fb31efdeb33f3ab8f7b25f43db8abc04cd851c35f8f9db1
4
- data.tar.gz: c99433c397a93742e57a71736f602f8f3e3b7c093e82792bcdbb3230f79beb55
3
+ metadata.gz: f7a80ab1d7122dd57f2e7a7d22a28c8c276bcaafd69da7cbf662ce630420fde9
4
+ data.tar.gz: 7f28e94ae447b35715c01dfa3c130db7bdc5ab2972a10f30e082fc6edd0fb60d
5
5
  SHA512:
6
- metadata.gz: 534f5411925466cd4db3a5a0cb908c36f5212faceafd4a523e94f939d036f53b4db4ff5d52abed8675f4edc9eb783e2a17c900760a2f0ad6947ad9c01da7e87e
7
- data.tar.gz: a116bda2dfc46a994cf7218364444d1488a8d4f4b285f74224766c82893dc545207f88a79dde19794662f27c9b79685ae63cd98974a099680a10b86e20f45a13
6
+ metadata.gz: 17bfb418de01d503c8e66bba436a31bf0d807396336e343f3bc202aef3ecadd665227329023b9b5d5f244b6be66ba7f6cadb44cafba90e8b706ee33b1461882e
7
+ data.tar.gz: f2cc161384fb6316203459232f9ccb97b6b3c2f5832cc4a143ee5f27fb460da8247f0046ba5b470659d54beb62c463d5bfaa905c9fd7e5a4093a7e3402207943
@@ -31,22 +31,12 @@ module PgEngine
31
31
  def internal_error(error)
32
32
  pg_err error
33
33
 
34
- @error_msg = <<~HTML.html_safe # rubocop:disable Rails/OutputSafety
35
- <div>
36
- Ocurrió algo inesperado
37
- <br>
38
- Por favor, intentá nuevamente
39
- <br>
40
- o <a class="text-decoration-underline" href="#{new_public_mensaje_contacto_path}">ponete en contacto</a> y pronto lo resolveremos
41
- </div>
42
- HTML
43
-
44
34
  respond_to do |format|
45
35
  format.html do
46
36
  render 'pg_layout/error', layout: 'pg_layout/containerized'
47
37
  end
48
38
  format.turbo_stream do
49
- flash.now[:critical] = @error_msg
39
+ flash.now[:critical] = self.class.render(partial: 'pg_layout/default_error_message')
50
40
  render turbo_stream: (turbo_stream.remove_all('.modal') + render_turbo_stream_flash_messages)
51
41
  end
52
42
  end
@@ -49,6 +49,7 @@ describe DummyBaseController do
49
49
  subject
50
50
  expect(response).to have_http_status(:ok)
51
51
  expect(response.body).to include 'Ocurrió algo inesperado'
52
+ expect(response.body).to include '<html'
52
53
  expect(response.content_type).to include 'text/html'
53
54
  end
54
55
 
@@ -0,0 +1,13 @@
1
+ <%# locals: (error_msg: nil) %>
2
+
3
+ <div>
4
+ <div class="mb-1">
5
+ <%= error_msg || 'Ocurrió algo inesperado' %>
6
+ </div>
7
+ Por favor, intentá nuevamente
8
+ <br>
9
+ o <a class="text-decoration-underline" href="<%= new_public_mensaje_contacto_path %>">dejá un mensaje</a>
10
+ para que te avisemos
11
+ <br>
12
+ cuando el problema esté resuelto 🙏
13
+ </div>
@@ -0,0 +1,13 @@
1
+ <%# locals: (error_msg: nil) %>
2
+
3
+ <div class="d-flex justify-content-around mt-2">
4
+ <div class="alert alert-danger d-flex align-items-center">
5
+ <div>
6
+ <span class="bi bi-emoji-dizzy fs-1 me-3"></span>
7
+ <%# <span class="bi bi-exclamation-triangle fs-1 me-3"></span> %>
8
+ </div>
9
+ <div>
10
+ <%= render partial: 'pg_layout/default_error_message', locals: { error_msg: } %>
11
+ </div>
12
+ </div>
13
+ </div>
@@ -1,11 +1,2 @@
1
- <div class="d-flex justify-content-around">
2
- <div class="alert alert-danger d-flex align-items-center">
3
- <div>
4
- <span class="bi bi-emoji-dizzy fs-1 me-3"></span>
5
- <%# <span class="bi bi-exclamation-triangle fs-1 me-3"></span> %>
6
- </div>
7
- <div>
8
- <%= @error_msg %>
9
- </div>
10
- </div>
11
- </div>
1
+ <%# Se renderea en el rescue de base_controller %>
2
+ <%= render partial: 'pg_layout/error' %>
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PgRails
4
- VERSION = '7.0.8-alpha.54'
4
+ VERSION = '7.0.8-alpha.56'
5
5
  end
@@ -241,7 +241,7 @@ RSpec.describe <%= controller_class_name %>Controller do
241
241
 
242
242
  describe 'DELETE #destroy' do
243
243
  subject do
244
- request.headers['Accept'] = "text/vnd.turbo-stream.html,text/html"
244
+ request.headers['Accept'] = 'text/vnd.turbo-stream.html,text/html'
245
245
  delete :destroy, params: { id: <%= file_name %>.to_param, redirect_to: redirect_url }
246
246
  end
247
247
 
metadata CHANGED
@@ -1,7 +1,7 @@
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.54
4
+ version: 7.0.8.pre.alpha.56
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martín Rosso
@@ -1012,6 +1012,8 @@ files:
1012
1012
  - pg_layout/app/views/layouts/pg_layout/container_logo.html.slim
1013
1013
  - pg_layout/app/views/layouts/pg_layout/containerized.html.slim
1014
1014
  - pg_layout/app/views/layouts/pg_layout/devise.html.slim
1015
+ - pg_layout/app/views/pg_layout/_default_error_message.html.erb
1016
+ - pg_layout/app/views/pg_layout/_error.html.erb
1015
1017
  - pg_layout/app/views/pg_layout/_flash.html.slim
1016
1018
  - pg_layout/app/views/pg_layout/_flash_container.html.slim
1017
1019
  - pg_layout/app/views/pg_layout/_navbar.html.erb