pg_rails 7.0.8.pre.alpha.70 → 7.0.8.pre.alpha.72
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/pg_associable/app/assets/stylesheets/pg_associable.scss +2 -2
- data/pg_associable/app/javascript/asociable_controller.tsx +6 -0
- data/pg_engine/app/assets/stylesheets/pg_rails_b5.scss +0 -1
- data/pg_engine/app/controllers/pg_engine/base_controller.rb +4 -3
- data/pg_engine/app/lib/pg_form_builder.rb +1 -1
- data/pg_engine/app/views/public/mensaje_contactos/_gracias.html.slim +1 -1
- data/pg_engine/app/views/public/mensaje_contactos/new.html.slim +1 -1
- data/pg_engine/config/locales/es.yml +1 -1
- data/pg_engine/spec/controllers/pg_engine/base_controller_spec.rb +3 -3
- data/pg_layout/app/views/pg_layout/_error.html.erb +1 -1
- data/pg_layout/app/views/pg_layout/_flash_container.html.slim +2 -1
- data/pg_rails/dist/types/pg_associable/app/javascript/asociable_controller.d.ts +17 -0
- data/pg_rails/dist/types/pg_layout/app/javascript/utils/utils.d.ts +7 -0
- data/pg_rails/lib/version.rb +1 -1
- data/pg_rails/scss/bootstrap_overrides.scss +2 -0
- data/pg_scaffold/lib/generators/pg_rspec/scaffold/templates/controller_spec.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: adf65a3ea20e9eedfa39e8e9a2b97ae48c773b5031d5dcffa4df98f8aa3f236f
|
4
|
+
data.tar.gz: f966e9b52d9ac7f7021ff6f51f0a051397f3dc07dffd641c7cd75949c8d198a0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b0d877134bf17b9b0653104475e5af6471850f805eaf5822e703ec17dc544fabf939dfdb3c74044969ebb1de635283d8872ee24fb324670bba5411480b0a605a
|
7
|
+
data.tar.gz: 61af835abe1cde9a9edeab6565a6f61f6df641e2f6a3df8f4fedf869d252a7382ce6c8488bff4c080319a7eaa30c6ac40a3917f4e00bc3c77530b4920e8d11a3
|
@@ -31,7 +31,7 @@
|
|
31
31
|
display: none;
|
32
32
|
}
|
33
33
|
input[type=text] {
|
34
|
-
background-color:
|
34
|
+
background-color: #{$body-bg};
|
35
35
|
padding-right: 2em;
|
36
36
|
}
|
37
37
|
&.filled {
|
@@ -84,7 +84,7 @@
|
|
84
84
|
box-shadow: 0px 9px 13px -3px rgba(0, 0, 0, 0.5);
|
85
85
|
// position: absolute;
|
86
86
|
// z-index: 1;
|
87
|
-
background-color:
|
87
|
+
background-color: #{$body-bg};
|
88
88
|
border: 1px solid #a7b7bb;
|
89
89
|
border-top: none;
|
90
90
|
border-radius: 4px;
|
@@ -55,6 +55,12 @@ export default class extends Controller {
|
|
55
55
|
|
56
56
|
this.input.addEventListener('blur', () => {
|
57
57
|
this.input.placeholder = ''
|
58
|
+
setTimeout(() => {
|
59
|
+
if (!this.element.classList.contains('filled')) {
|
60
|
+
this.input.value = ''
|
61
|
+
this.resetResultados()
|
62
|
+
}
|
63
|
+
}, 200)
|
58
64
|
})
|
59
65
|
this.input.onfocus = () => {
|
60
66
|
this.input.select()
|
@@ -33,11 +33,12 @@ module PgEngine
|
|
33
33
|
|
34
34
|
respond_to do |format|
|
35
35
|
format.html do
|
36
|
-
render 'pg_layout/error', layout: 'pg_layout/containerized'
|
36
|
+
render 'pg_layout/error', layout: 'pg_layout/containerized', status: :internal_server_error
|
37
37
|
end
|
38
38
|
format.turbo_stream do
|
39
39
|
flash.now[:critical] = self.class.render(partial: 'pg_layout/default_error_message')
|
40
|
-
render turbo_stream: (turbo_stream.remove_all('.modal') + render_turbo_stream_flash_messages)
|
40
|
+
render turbo_stream: (turbo_stream.remove_all('.modal') + render_turbo_stream_flash_messages),
|
41
|
+
status: :internal_server_error
|
41
42
|
end
|
42
43
|
end
|
43
44
|
end
|
@@ -101,7 +102,7 @@ module PgEngine
|
|
101
102
|
if request.path == root_path
|
102
103
|
# TODO!: renderear un 500.html y pg_err
|
103
104
|
sign_out(Current.user) if Current.user.present?
|
104
|
-
render plain: 'Acceso no autorizado'
|
105
|
+
render plain: 'Acceso no autorizado', status: :unprocessable_entity
|
105
106
|
else
|
106
107
|
go_back('Acceso no autorizado')
|
107
108
|
end
|
@@ -5,7 +5,7 @@ class PgFormBuilder < SimpleForm::FormBuilder
|
|
5
5
|
include PgEngine::ErrorHelper
|
6
6
|
|
7
7
|
def default_prefix(attribute_name)
|
8
|
-
attribute_name = attribute_name.to_s.sub
|
8
|
+
attribute_name = attribute_name.to_s.sub(/_id\z/, '')
|
9
9
|
at_name_human = object.class.human_attribute_name(attribute_name).downcase
|
10
10
|
"#{articulo(attribute_name)} #{at_name_human}"
|
11
11
|
end
|
@@ -47,7 +47,7 @@ describe DummyBaseController do
|
|
47
47
|
|
48
48
|
it do
|
49
49
|
subject
|
50
|
-
expect(response).to have_http_status(:
|
50
|
+
expect(response).to have_http_status(:internal_server_error)
|
51
51
|
expect(response.body).to include 'Ocurrió algo inesperado'
|
52
52
|
expect(response.body).to include '<html'
|
53
53
|
expect(response.content_type).to include 'text/html'
|
@@ -60,7 +60,7 @@ describe DummyBaseController do
|
|
60
60
|
|
61
61
|
it do
|
62
62
|
subject
|
63
|
-
expect(response).to have_http_status(:
|
63
|
+
expect(response).to have_http_status(:internal_server_error)
|
64
64
|
expect(response.content_type).to include 'text/vnd.turbo-stream.html'
|
65
65
|
expect(response.body).to include 'Ocurrió algo inesperado'
|
66
66
|
expect(response.body).to include '<turbo-stream action="remove" targets=".modal">'
|
@@ -93,7 +93,7 @@ describe DummyBaseController do
|
|
93
93
|
|
94
94
|
it do
|
95
95
|
subject
|
96
|
-
expect(response).to have_http_status(:
|
96
|
+
expect(response).to have_http_status(:unprocessable_entity)
|
97
97
|
expect(response.body).to eq 'Acceso no autorizado'
|
98
98
|
expect(controller).not_to be_user_signed_in
|
99
99
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<%# locals: (error_msg: nil) %>
|
2
2
|
|
3
|
-
<div class="d-flex justify-content-around mt-2">
|
3
|
+
<div class="d-flex justify-content-around mt-2" data-turbo-temporary="true">
|
4
4
|
<div class="alert alert-danger d-flex align-items-center">
|
5
5
|
<div>
|
6
6
|
<span class="bi bi-emoji-dizzy fs-1 me-3"></span>
|
@@ -1,4 +1,5 @@
|
|
1
1
|
#flash-wrapper.d-flex.justify-content-around
|
2
2
|
#flash.flash.position-relative.w-100.d-flex.justify-content-center
|
3
3
|
= render partial: 'pg_layout/flash'
|
4
|
-
/ TODO: si hay varios flashes toast, se superponen. habría que hacer un container
|
4
|
+
/ TODO: si hay varios flashes toast, se superponen. habría que hacer un container
|
5
|
+
con position absolute para los toasts
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import { Controller } from '@hotwired/stimulus'
|
2
|
+
export default class extends Controller {
|
3
|
+
static outlets: string[]
|
4
|
+
lastValue: any
|
5
|
+
subWrapper: any
|
6
|
+
elemId: any
|
7
|
+
input: any
|
8
|
+
connect(): void;
|
9
|
+
resetResultados(): void;
|
10
|
+
setMaxHeight(): void;
|
11
|
+
crearItem(): void;
|
12
|
+
escribiAlgo(): void;
|
13
|
+
buscando(): void;
|
14
|
+
selectItem(e: any): void;
|
15
|
+
doSearch(force?: boolean): void;
|
16
|
+
completarCampo(object: any): void;
|
17
|
+
}
|
@@ -0,0 +1,7 @@
|
|
1
|
+
export declare function round(value: any): number;
|
2
|
+
export declare function printCurrency(value: any, simboloMoneda?: string): string;
|
3
|
+
export declare function showPercentage(value: any): string;
|
4
|
+
export declare function numberWithDots(x: any): any;
|
5
|
+
export declare function flashMessage(message: any, flashType?: string, toast?: boolean): void;
|
6
|
+
export declare function fadeOut(e: any): void;
|
7
|
+
export declare function fadeIn(e: any): void;
|
data/pg_rails/lib/version.rb
CHANGED
@@ -218,7 +218,7 @@ RSpec.describe <%= controller_class_name %>Controller do
|
|
218
218
|
<% else -%>
|
219
219
|
put :update, params: { id: <%= file_name %>.to_param, <%= nombre_tabla_completo_singular %>: valid_attributes }
|
220
220
|
<% end -%>
|
221
|
-
expect(response).to redirect_to([:<%= ns_prefix.first %>, <%= file_name
|
221
|
+
expect(response).to redirect_to([:<%= ns_prefix.first %>, <%= file_name %>])
|
222
222
|
end
|
223
223
|
end
|
224
224
|
<% if attributes.any? { |at| at.required? } -%>
|
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.
|
4
|
+
version: 7.0.8.pre.alpha.72
|
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-05-
|
11
|
+
date: 2024-05-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -1102,6 +1102,8 @@ files:
|
|
1102
1102
|
- pg_layout/lib/pg_layout.rb
|
1103
1103
|
- pg_layout/lib/pg_layout/engine.rb
|
1104
1104
|
- pg_layout/spec/lib/navbar_spec.rb
|
1105
|
+
- pg_rails/dist/types/pg_associable/app/javascript/asociable_controller.d.ts
|
1106
|
+
- pg_rails/dist/types/pg_layout/app/javascript/utils/utils.d.ts
|
1105
1107
|
- pg_rails/js/index.js
|
1106
1108
|
- pg_rails/lib/pg_rails.rb
|
1107
1109
|
- pg_rails/lib/pg_rails/capybara_support.rb
|