pg_rails 7.0.8.pre.alpha.54 → 7.0.8.pre.alpha.55

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: c3988a9c0d903ba20bb3cd83e2c5cacce2b4be38e630ebadc216bf55953bf349
4
+ data.tar.gz: 491bdc7eea79682ac8d34e2f04619c6f5a69be94fccc4d27de4874b0d42c5035
5
5
  SHA512:
6
- metadata.gz: 534f5411925466cd4db3a5a0cb908c36f5212faceafd4a523e94f939d036f53b4db4ff5d52abed8675f4edc9eb783e2a17c900760a2f0ad6947ad9c01da7e87e
7
- data.tar.gz: a116bda2dfc46a994cf7218364444d1488a8d4f4b285f74224766c82893dc545207f88a79dde19794662f27c9b79685ae63cd98974a099680a10b86e20f45a13
6
+ metadata.gz: 94e6f9f80d69ca2de0a80f4d2684fd0aea928cb4c9bc93d168c9e6eb1e2ce37ec8982cfffbf8a0c74e0aecef8a23c0f32ab63deb98977e6033df0e35481c8047
7
+ data.tar.gz: af872ab696c047befe1000bf53c5c493390ca449fdb904d5507c7239fac28eb1de6b3a40be031926daf9fe3de5dafcfa9c3aea10c7fdab2f2367a75d3d0cf21a
@@ -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,11 @@
1
+ <%# locals: (error_msg: nil) %>
2
+
3
+ <div>
4
+ <%= error_msg || 'Ocurrió algo inesperado' %>
5
+ <br>
6
+ Por favor, intentá nuevamente
7
+ <br>
8
+ o <a class="text-decoration-underline" href="<%= new_public_mensaje_contacto_path %>">dejanos un mensaje</a>
9
+ <br>
10
+ y te avisaremos cuando el problema esté resuelto.
11
+ </div>
@@ -0,0 +1,13 @@
1
+ <%# locals: (error_msg: nil) %>
2
+
3
+ <div class="d-flex justify-content-around">
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.55'
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.55
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