pg_rails 7.0.8.pre.alpha.27 → 7.0.8.pre.alpha.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 985cc55b4ff43af3479e08cd3d7ae868a065d42cc6f6aae0493609bda38d9fda
4
- data.tar.gz: 335191165185260bc86fcc0adfec689470dd3abe5a88ad153187977f4b16b5de
3
+ metadata.gz: 693564c63bb61c878087db5c4acd52851378ba6a839004e97bd099291988f7e6
4
+ data.tar.gz: a709a829417768f1ab6c27e840396395920186e872f28a25063b13dd81027bd0
5
5
  SHA512:
6
- metadata.gz: 9ff8d46bc53fa905b023a2cce88a24555129e7ee4cc146c0c58038c2a35046744be61750e8ef2d73b5d606f3dbb7396cecbbf218ba947bd327991073ae01c788
7
- data.tar.gz: 032aa328bfc8a622cadb3f5cd2c914cf9a870c35c2d2aabf8c1d8fcb8f501b0d0561e123d63364c897856392507bb001d155a0e7a00b0cd7916fb6b49f3fc64a
6
+ metadata.gz: '029e2473f5247d57ac72824aa2c95823dc5862b27e8341fc9e7f0e3124a3bc22634b6ad7ee6f5ebdb340643c8fc8c4f7a905ed92f3bb2502e2eb1c4b68233fd6'
7
+ data.tar.gz: 5bedfa1c3883599c2b67f99ed727804d0d9f97b852e4e8aa92c0e9778555e79e79aa6e0049e1e41dfb1ab0148fd10fc29a5c9182983caf75d735ebacdf5fa327
@@ -34,7 +34,7 @@ class PgFormBuilder < SimpleForm::FormBuilder
34
34
 
35
35
  all_errors_tag = build_all_errors_tag unless base_tag
36
36
 
37
- "#{title}#{base_tag}#{all_errors_tag}"
37
+ "#{title}#{base_tag}#{all_errors_tag}".html_safe # rubocop:disable Rails/OutputSafety
38
38
  end
39
39
 
40
40
  def build_all_errors_tag
@@ -47,9 +47,7 @@ class PgFormBuilder < SimpleForm::FormBuilder
47
47
  # TODO!: poder pasar un block para que no se ejecute si no se va a loguear por el log level
48
48
  pg_warn "Not base errors en pg_form: #{object.errors.details}. Record: #{object.inspect}", :debug
49
49
 
50
- # rubocop:disable Rails/OutputSafety
51
- "<span class='not_base_errors' data-errors='#{object.errors.details.to_json}'></span>".html_safe
52
- # rubocop:enable Rails/OutputSafety
50
+ "<span class='not_base_errors' data-errors='#{object.errors.details.to_json}'></span>"
53
51
  end
54
52
 
55
53
  def mensaje
@@ -4,10 +4,7 @@ Rollbar.configure do |config|
4
4
 
5
5
  config.access_token = Rails.application.credentials.rollbar&.access_token_server
6
6
 
7
- # Here we'll disable in 'test':
8
- if Rails.env.local?
9
- config.enabled = false
10
- end
7
+ config.enabled = Rails.env.production? || ENV.fetch('FORCE_ROLLBAR', false)
11
8
 
12
9
  # By default, Rollbar will try to call the `current_user` controller method
13
10
  # to fetch the logged-in user object, and then call that object's `id`
@@ -75,4 +72,20 @@ Rollbar.configure do |config|
75
72
  # setup for Heroku. See:
76
73
  # https://devcenter.heroku.com/articles/deploying-to-a-custom-rails-environment
77
74
  config.environment = ENV['ROLLBAR_ENV'].presence || Rails.env
75
+
76
+ # Este parámetro rollbar lo usa para los log files, pero yo lo uso también para filtrar
77
+ # el error reporting en before_process
78
+ config.logger_level = ENV.fetch('ROLLBAR_LOGGER_LEVEL', 'info').to_sym
79
+
80
+ config.before_process << Proc.new do |item|
81
+ acceptable_levels = begin
82
+ levels = [:debug, :info, :warn, :error]
83
+ if Rollbar.configuration.logger_level
84
+ levels[levels.find_index(Rollbar.configuration.logger_level)..-1]
85
+ else
86
+ []
87
+ end
88
+ end
89
+ acceptable_levels.include?(item[:level].to_sym) ? 'gogoogogooo' : 'ignored'
90
+ end
78
91
  end
@@ -9,29 +9,29 @@ import * as bootstrap from 'bootstrap'
9
9
 
10
10
  let rollbarToken = document.head.querySelector('meta[name=rollbar-token]')
11
11
  rollbarToken = rollbarToken && rollbarToken.content
12
- if (rollbarToken) {
13
- let rollbarEnv = document.head.querySelector('meta[name=rollbar-env]')
14
- rollbarEnv = rollbarEnv && rollbarEnv.content
15
- rollbarEnv = rollbarEnv || 'unknown'
16
12
 
17
- window.Rollbar = Rollbar
13
+ let rollbarEnv = document.head.querySelector('meta[name=rollbar-env]')
14
+ rollbarEnv = rollbarEnv && rollbarEnv.content
15
+ rollbarEnv = rollbarEnv || 'unknown'
18
16
 
19
- Rollbar.init()
17
+ window.Rollbar = Rollbar
20
18
 
21
- Rollbar.global({
22
- itemsPerMinute: 2,
23
- maxItems: 5
24
- })
25
- Rollbar.configure({
26
- accessToken: rollbarToken,
27
- captureUncaught: true,
28
- captureUnhandledRejections: true,
29
- reportLevel: 'warning',
30
- payload: {
31
- environment: rollbarEnv
32
- }
33
- })
34
- }
19
+ Rollbar.init()
20
+
21
+ Rollbar.global({
22
+ itemsPerMinute: 2,
23
+ maxItems: 5
24
+ })
25
+ Rollbar.configure({
26
+ enabled: !!rollbarToken,
27
+ accessToken: rollbarToken,
28
+ captureUncaught: true,
29
+ captureUnhandledRejections: true,
30
+ reportLevel: 'warning',
31
+ payload: {
32
+ environment: rollbarEnv
33
+ }
34
+ })
35
35
 
36
36
  document.addEventListener('turbo:load', bindToasts)
37
37
  document.addEventListener('turbo:render', bindToasts)
@@ -18,7 +18,8 @@ export default class extends Controller {
18
18
  console.error(notBaseErrors.dataset.errors)
19
19
  Rollbar.error(notBaseErrors.dataset.errors)
20
20
  const errorTitle = this.element.querySelector('.error-title')
21
- errorTitle.innerText = 'Lo lamentamos mucho pero ocurrió algo inesperado'
21
+ errorTitle.innerText = 'Lo lamentamos mucho pero ocurrió algo inesperado. Por favor, intentá nuevamente o ponete en contacto con nosotros.'
22
+ // FIXME: link a contacto
22
23
  }
23
24
  }
24
25
  }
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PgRails
4
- VERSION = '7.0.8-alpha.27'
4
+ VERSION = '7.0.8-alpha.29'
5
5
  end
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.27
4
+ version: 7.0.8.pre.alpha.29
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martín Rosso