pg_rails 7.0.8.pre.alpha.91 → 7.0.8.pre.alpha.93

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: 0add80789e228fa1d0540ec0cd76fa458a6bce695d171813b43047608a930980
4
- data.tar.gz: 114d7d400e5f6d5f42a99454e365f6bd9cffe5d190d982be1d1aff66957ce646
3
+ metadata.gz: bdf7d3d8c84262ae3dbb580c76a11f33d9cb91a6168ec187dfd0f760a080fde6
4
+ data.tar.gz: ebb7a5b8d8680a82f71574c04efe8f517b04134c628e6cd10103828d34d78727
5
5
  SHA512:
6
- metadata.gz: 6e5bad46380cec016f7a567a6ccef77f16ca32c364b1f09f0fb753c03afc6d4bc0d42b8823ded44f46c5300c487b33e7863724e8b7775c51efbf26862517a8ad
7
- data.tar.gz: 632abbaea6dbed4429648148125c65985a99a2648b1f97dd971d089794363bbd522000d170d2eae07bc5d6f023027d31748dd3bdeee359a076d7efa96055cfe0
6
+ metadata.gz: 82cc777c32238b7c5430a95c6ebf701b188cb94b885373e43d1b20976e4081f3c6fa7ce0366cd8c5ed455cd9375fac70b2e7c5fdff3ea1d258f6cb546f6709ec
7
+ data.tar.gz: 84c40fd802a3681eeb76c11e0de4e5280bc41d9e97cf88a5a74a71b396c02dd7e68af0985a541325a1be9b26e692d0d35e893c37d16849b53a114fc4cebdf522
@@ -0,0 +1,42 @@
1
+ module PgEngine
2
+ class HealthController < ApplicationController
3
+ rescue_from(Exception) do |error|
4
+ pg_err error
5
+ render_down
6
+ end
7
+
8
+ def show
9
+ check_redis
10
+ check_postgres
11
+ render_up
12
+ end
13
+
14
+ private
15
+
16
+ def check_postgres
17
+ return if User.count.is_a? Integer
18
+
19
+ raise PgEngine::Error, 'postgres is down'
20
+ end
21
+
22
+ def check_redis
23
+ return if Kredis.counter('healthcheck').increment.is_a? Integer
24
+
25
+ raise PgEngine::Error, 'redis is down'
26
+ end
27
+
28
+ def render_up
29
+ render html: html_status(color: '#005500')
30
+ end
31
+
32
+ def render_down
33
+ render html: html_status(color: '#990000'), status: :internal_server_error
34
+ end
35
+
36
+ def html_status(color:)
37
+ # rubocop:disable Rails/OutputSafety
38
+ %(<!DOCTYPE html><html><body style="background-color: #{color}"></body></html>).html_safe
39
+ # rubocop:enable Rails/OutputSafety
40
+ end
41
+ end
42
+ end
@@ -28,7 +28,6 @@ module PgEngine
28
28
  protected
29
29
 
30
30
  def mail(*args)
31
- @footer_href = root_url(m: @email_object&.hashid)
32
31
  super(*args).tap do |message|
33
32
  # message.mailgun_options = {
34
33
  # 'tag' => email.tags,
@@ -1,6 +1,7 @@
1
1
  include PgEngine::RouteHelpers
2
2
 
3
3
  Rails.application.routes.draw do
4
+ get "pg_engine/health" => "pg_engine/health#show", as: :pg_engine_health_check
4
5
  namespace :public, path: '' do
5
6
  pg_resource(:mensaje_contactos, only: [:new, :create], path: 'contacto')
6
7
  post 'webhook/mailgun', to: 'webhooks#mailgun'
@@ -0,0 +1,3 @@
1
+ - %w[danger warning info success].each do |status|
2
+ h1 class="text-#{status}" = status
3
+ h1 class="text-#{status}-emphasis" = "#{status} emphasis"
@@ -5,4 +5,6 @@ class AlertComponentPreview < ViewComponent::Preview
5
5
  def default; end
6
6
 
7
7
  def dismisible; end
8
+
9
+ def colours; end
8
10
  end
@@ -2,8 +2,8 @@ html
2
2
  body style="font-family: sans-serif"
3
3
  = yield
4
4
 
5
- footer style="margin-top: 2em;"
6
- - if @footer_href.present?
5
+ - if @footer_href.present?
6
+ footer style="margin-top: 2em;"
7
7
  = link_to @footer_href, rel: 'noreferrer', target: :_blank do
8
8
  - if @footer_image_src.present?
9
9
  = image_tag @footer_image_src, alt: @footer_image_alt
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PgRails
4
- VERSION = '7.0.8-alpha.91'
4
+ VERSION = '7.0.8-alpha.93'
5
5
  end
@@ -9,5 +9,3 @@ $warning-border-subtle: tint-color($warning, 20%);
9
9
  // $danger-border-subtle: tint-color($danger, 60%);
10
10
 
11
11
  $btn-close-focus-shadow: none;
12
-
13
- $body-bg: $light;
@@ -1,9 +1,25 @@
1
- $red: #a70101;
2
- $yellow: #f4a815;
3
- $font-size-base: 0.9rem;
1
+ // Default bootstrap colours
2
+ $blue: #0d6efd !default;
3
+ $indigo: #6610f2 !default;
4
+ $purple: #6f42c1 !default;
5
+ $pink: #d63384 !default;
6
+ $red: #dc3545 !default;
7
+ $orange: #fd7e14 !default;
8
+ $yellow: #ffc107 !default;
9
+ $green: #198754 !default;
10
+ $teal: #20c997 !default;
11
+ $cyan: #0dcaf0 !default;
12
+
13
+ // Overriding some of the default colours
14
+ $orange: #e35b17;
15
+ $red: #a70101;
4
16
 
5
- $enable-validation-icons: false;
6
- $focus-ring-width: .05rem;
17
+ $warning: $orange;
18
+ $info: #87accc;
19
+
20
+ $font-size-base: 0.9rem;
21
+ $enable-validation-icons: false;
22
+ $focus-ring-width: .05rem;
7
23
  $alert-padding-y: 0.5rem;
8
24
  $alert-margin-bottom: 0.5rem;
9
25
 
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.91
4
+ version: 7.0.8.pre.alpha.93
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-06-06 00:00:00.000000000 Z
11
+ date: 2024-06-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -983,6 +983,7 @@ files:
983
983
  - pg_engine/app/controllers/concerns/pg_engine/resource.rb
984
984
  - pg_engine/app/controllers/pg_engine/base_controller.rb
985
985
  - pg_engine/app/controllers/pg_engine/devise_controller.rb
986
+ - pg_engine/app/controllers/pg_engine/health_controller.rb
986
987
  - pg_engine/app/controllers/pg_engine/require_sign_in.rb
987
988
  - pg_engine/app/controllers/public/mensaje_contactos_controller.rb
988
989
  - pg_engine/app/controllers/public/webhooks_controller.rb
@@ -1096,6 +1097,7 @@ files:
1096
1097
  - pg_engine/spec/components/alert_component_spec.rb
1097
1098
  - pg_engine/spec/components/internal_error_component_spec.rb
1098
1099
  - pg_engine/spec/components/previews/alert_component_preview.rb
1100
+ - pg_engine/spec/components/previews/alert_component_preview/colours.html.slim
1099
1101
  - pg_engine/spec/components/previews/alert_component_preview/default.html.slim
1100
1102
  - pg_engine/spec/components/previews/alert_component_preview/dismisible.html.slim
1101
1103
  - pg_engine/spec/components/previews/internal_error_preview.rb
@@ -1278,11 +1280,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
1278
1280
  version: '3.0'
1279
1281
  required_rubygems_version: !ruby/object:Gem::Requirement
1280
1282
  requirements:
1281
- - - ">"
1283
+ - - ">="
1282
1284
  - !ruby/object:Gem::Version
1283
- version: 1.3.1
1285
+ version: '0'
1284
1286
  requirements: []
1285
- rubygems_version: 3.3.22
1287
+ rubygems_version: 3.5.11
1286
1288
  signing_key:
1287
1289
  specification_version: 4
1288
1290
  summary: Rails goodies