pg_rails 7.6.0 → 7.6.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/pg_engine/app/controllers/pg_engine/base_users_controller.rb +0 -4
- data/pg_engine/app/controllers/pg_engine/health_controller.rb +30 -0
- data/pg_engine/app/controllers/users/dashboard_controller.rb +9 -0
- data/pg_engine/app/controllers/users/registrations_controller.rb +1 -1
- data/pg_engine/app/views/users/dashboard/dashboard.html.slim +1 -0
- data/pg_engine/config/locales/es.yml +5 -0
- data/pg_engine/config/routes.rb +2 -1
- data/pg_engine/lib/pg_engine.rb +2 -0
- data/pg_engine/spec/requests/users/dashboard_spec.rb +19 -0
- data/pg_engine/spec/requests/users/registrations_spec.rb +19 -0
- data/pg_engine/spec/system/noticed_spec.rb +0 -1
- data/pg_rails/lib/pg_rails/capybara_support.rb +1 -1
- data/pg_rails/lib/version.rb +1 -1
- metadata +19 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 49f9abe4c2e4521dd99abe5a9220e3bece6ceb0e182c1a7d1fe252d836977bbf
|
4
|
+
data.tar.gz: 105da76663a6b29c338c45cb0e46d2663b99c7463a91beb734771f34dd668319
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 344c3c89251c75d50c9ace0a1dac02d69ecb1d04e1392d330225c4496e7bfc5c24718cfb98c0c6843c24e5402d22b399d203cdbd6c3826c6f2cb9b8271b7da9e
|
7
|
+
data.tar.gz: bb74de3073bb722ee4444a726306db6759c21e3ddc61e3f2a36e988b4ff688d72e31611d6168c2e936366d79c503924056da03ebd8f23dc7e07750cfb0ec2231
|
@@ -8,6 +8,7 @@ module PgEngine
|
|
8
8
|
def show
|
9
9
|
check_redis
|
10
10
|
check_postgres
|
11
|
+
check_websocket
|
11
12
|
render_up
|
12
13
|
end
|
13
14
|
|
@@ -25,6 +26,35 @@ module PgEngine
|
|
25
26
|
raise PgEngine::Error, 'redis is down'
|
26
27
|
end
|
27
28
|
|
29
|
+
# rubocop:disable Metrics/MethodLength
|
30
|
+
def check_websocket
|
31
|
+
result = nil
|
32
|
+
begin
|
33
|
+
Timeout.timeout(5) do
|
34
|
+
EM.run do
|
35
|
+
url = Rails.application.config.action_cable.url
|
36
|
+
ws = Faye::WebSocket::Client.new(url)
|
37
|
+
|
38
|
+
ws.on :message do |event|
|
39
|
+
type = JSON.parse(event.data)['type']
|
40
|
+
if type == 'welcome'
|
41
|
+
result = :success
|
42
|
+
ws.close
|
43
|
+
EM.stop
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
rescue Timeout::Error
|
49
|
+
raise PgEngine::Error, 'websocket server is down'
|
50
|
+
end
|
51
|
+
|
52
|
+
return if result == :success
|
53
|
+
|
54
|
+
raise PgEngine::Error, 'websocket server is down'
|
55
|
+
end
|
56
|
+
# rubocop:enable Metrics/MethodLength
|
57
|
+
|
28
58
|
def render_up
|
29
59
|
render html: html_status(color: '#005500')
|
30
60
|
end
|
@@ -0,0 +1 @@
|
|
1
|
+
h1 Dashboard
|
@@ -16,6 +16,11 @@ es:
|
|
16
16
|
index:
|
17
17
|
empty: 'No hay %{model} que mostrar'
|
18
18
|
empty_but_filtered: 'No hay %{model} para los filtros aplicados'
|
19
|
+
gender:
|
20
|
+
reset_password_token: m
|
21
|
+
confirmation_token: m
|
22
|
+
unlock_token: m
|
23
|
+
current_password: f
|
19
24
|
attributes:
|
20
25
|
external_labels: Etiquetas externas
|
21
26
|
external_source: Fuente externa
|
data/pg_engine/config/routes.rb
CHANGED
@@ -21,6 +21,7 @@ Rails.application.routes.draw do
|
|
21
21
|
registrations: 'users/registrations'
|
22
22
|
}, failure_app: PgEngine::DeviseFailureApp
|
23
23
|
namespace :users, path: 'u' do
|
24
|
+
get 'dashboard', to: 'dashboard#dashboard'
|
24
25
|
post 'notifications/mark_as_seen', to: 'notifications#mark_as_seen'
|
25
26
|
post 'notifications/mark_as_unseen', to: 'notifications#mark_as_unseen'
|
26
27
|
get 'date_jumper/jump'
|
@@ -33,7 +34,7 @@ Rails.application.routes.draw do
|
|
33
34
|
# get 'account', to: 'accounts#show'
|
34
35
|
end
|
35
36
|
|
36
|
-
get '/u', to: 'users#
|
37
|
+
get '/u', to: 'users/dashboard#dashboard', as: :users_root
|
37
38
|
|
38
39
|
namespace :admin, path: 'a' do
|
39
40
|
pg_resource(:emails)
|
data/pg_engine/lib/pg_engine.rb
CHANGED
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'rails_helper'
|
2
|
+
|
3
|
+
describe 'DASHBOARD' do
|
4
|
+
let(:logged_user) { create :user }
|
5
|
+
|
6
|
+
before do
|
7
|
+
sign_in logged_user
|
8
|
+
end
|
9
|
+
|
10
|
+
it 'when requesting /u' do
|
11
|
+
get '/u'
|
12
|
+
expect(response.body).to include '<h1>Dashboard</h1>'
|
13
|
+
end
|
14
|
+
|
15
|
+
it 'when requesting /u/dashboard' do
|
16
|
+
get '/u/dashboard'
|
17
|
+
expect(response.body).to include '<h1>Dashboard</h1>'
|
18
|
+
end
|
19
|
+
end
|
@@ -69,6 +69,25 @@ describe 'registrations controller' do
|
|
69
69
|
expect { subject }.not_to change(Account, :count)
|
70
70
|
end
|
71
71
|
end
|
72
|
+
|
73
|
+
context 'cuando hay tenant' do
|
74
|
+
before do
|
75
|
+
host! 'bien.localhost.com'
|
76
|
+
create :account, subdomain: 'bien'
|
77
|
+
end
|
78
|
+
|
79
|
+
it do
|
80
|
+
expect { subject }.to change(User, :count).by(1)
|
81
|
+
end
|
82
|
+
|
83
|
+
it do
|
84
|
+
expect { subject }.to change(UserAccount, :count).by(1)
|
85
|
+
end
|
86
|
+
|
87
|
+
it do
|
88
|
+
expect { subject }.not_to change(Account, :count)
|
89
|
+
end
|
90
|
+
end
|
72
91
|
end
|
73
92
|
|
74
93
|
describe '#edit' do
|
@@ -49,4 +49,4 @@ Capybara.register_driver :selenium_chrome_headless_iphone,
|
|
49
49
|
&chrome_driver_gen(headless: true, emulate_device: 'iPhone 6')
|
50
50
|
Capybara.register_driver :selenium_chrome_debugger, &chrome_driver_gen(headless: false, debugger: true)
|
51
51
|
|
52
|
-
Capybara.javascript_driver = ENV.fetch('
|
52
|
+
Capybara.javascript_driver = ENV.fetch('DRIVER') { 'selenium_chrome_notebook' }.to_sym
|
data/pg_rails/lib/version.rb
CHANGED
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.
|
4
|
+
version: 7.6.2
|
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-09-
|
11
|
+
date: 2024-09-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -80,6 +80,20 @@ dependencies:
|
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '5.0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: faye-websocket
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0.11'
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0.11'
|
83
97
|
- !ruby/object:Gem::Dependency
|
84
98
|
name: acts_as_tenant
|
85
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -691,6 +705,7 @@ files:
|
|
691
705
|
- pg_engine/app/controllers/users/account_switcher_controller.rb
|
692
706
|
- pg_engine/app/controllers/users/accounts_controller.rb
|
693
707
|
- pg_engine/app/controllers/users/confirmations_controller.rb
|
708
|
+
- pg_engine/app/controllers/users/dashboard_controller.rb
|
694
709
|
- pg_engine/app/controllers/users/date_jumper_controller.rb
|
695
710
|
- pg_engine/app/controllers/users/notifications_controller.rb
|
696
711
|
- pg_engine/app/controllers/users/registrations_controller.rb
|
@@ -779,6 +794,7 @@ files:
|
|
779
794
|
- pg_engine/app/views/public/mensaje_contactos/new.html.slim
|
780
795
|
- pg_engine/app/views/users/account_switcher/list.html.slim
|
781
796
|
- pg_engine/app/views/users/accounts/show.html.slim
|
797
|
+
- pg_engine/app/views/users/dashboard/dashboard.html.slim
|
782
798
|
- pg_engine/config/initializers/action_controller.rb
|
783
799
|
- pg_engine/config/initializers/action_mailer.rb
|
784
800
|
- pg_engine/config/initializers/active_admin.rb
|
@@ -884,6 +900,7 @@ files:
|
|
884
900
|
- pg_engine/spec/requests/public/webhooks_spec.rb
|
885
901
|
- pg_engine/spec/requests/users/accounts_spec.rb
|
886
902
|
- pg_engine/spec/requests/users/base_controller_spec.rb
|
903
|
+
- pg_engine/spec/requests/users/dashboard_spec.rb
|
887
904
|
- pg_engine/spec/requests/users/date_jumper_spec.rb
|
888
905
|
- pg_engine/spec/requests/users/registrations_spec.rb
|
889
906
|
- pg_engine/spec/requests/users/switcher_spec.rb
|