pg_rails 7.6.5 → 7.6.6
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/helpers/pg_associable/form_builder_methods.rb +1 -1
- data/pg_associable/app/helpers/pg_associable/helpers.rb +2 -1
- data/pg_engine/app/assets/stylesheets/pg_rails_b5.scss +0 -15
- data/pg_engine/app/components/modal_content_component.rb +3 -2
- data/pg_engine/app/policies/account_policy.rb +5 -0
- data/pg_engine/app/policies/pg_engine/base_policy.rb +4 -0
- data/pg_engine/app/policies/user_policy.rb +4 -0
- data/pg_engine/app/views/pg_engine/base/index.html.slim +2 -2
- data/pg_engine/spec/system/modal_windows_spec.rb +2 -1
- data/pg_rails/lib/version.rb +1 -1
- data/pg_rails/scss/pg_rails.scss +5 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 365f1740542a5fbba1bce8e40441e42581235cd67e68a7890292f512a63535d7
|
4
|
+
data.tar.gz: dfc9376def176892e05dc733c8a0df12a97f4b3da8c2fd0a31b1f7f5fc9b77a5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 94fc43c2038e908511860200282138fc7fa4ca95d8536abbbaa1530e5a975ffcdc8e6d64243669511c7c8a9abe6dfea0922f27fc23eea91f71c455d92295851f
|
7
|
+
data.tar.gz: 9020921857f2ec5e1d7af48321a9655b2f34557c0496a55b92bebd557772e9873e921bb7f1a9b8133093759c2f388c9ccc395949b13c5ad06ee68d52ae1eee86
|
@@ -39,7 +39,7 @@ module PgAssociable
|
|
39
39
|
def collection_pc(atributo, _options)
|
40
40
|
klass = clase_asociacion(atributo)
|
41
41
|
user = Current.user
|
42
|
-
puede_crear =
|
42
|
+
puede_crear = Pundit::PolicyFinder.new(klass).policy.new(user, klass).new_from_associable?
|
43
43
|
collection = Pundit::PolicyFinder.new(klass).scope.new(user, klass).resolve
|
44
44
|
collection = collection.kept if collection.respond_to?(:kept)
|
45
45
|
[collection, puede_crear]
|
@@ -4,7 +4,8 @@ module PgAssociable
|
|
4
4
|
|
5
5
|
def pg_respond_abrir_modal
|
6
6
|
src = clase_modelo.new.decorate.new_object_url
|
7
|
-
|
7
|
+
turbo_frame_id = "modal_content_#{params[:id]}"
|
8
|
+
content = ModalContentComponent.new(src:, turbo_frame_id:).render_in(view_context)
|
8
9
|
modal = AsociableModalComponent.new(modal_id: params[:id]).with_content(content)
|
9
10
|
render turbo_stream: turbo_stream.append_all('body', modal)
|
10
11
|
end
|
@@ -250,18 +250,3 @@ input[type=datetime-local], input[type=datetime] {
|
|
250
250
|
width: initial;
|
251
251
|
}
|
252
252
|
}
|
253
|
-
|
254
|
-
// WIP, inline rich text en listados
|
255
|
-
.listado {
|
256
|
-
.inline-edit {
|
257
|
-
display: flex!important;
|
258
|
-
align-items: center;
|
259
|
-
gap: 0.25em;
|
260
|
-
|
261
|
-
&:has(.trix-content) .edit-link {
|
262
|
-
margin-bottom: 0;
|
263
|
-
display: inline;
|
264
|
-
border-bottom: none;
|
265
|
-
}
|
266
|
-
}
|
267
|
-
}
|
@@ -1,5 +1,6 @@
|
|
1
1
|
class ModalContentComponent < ViewComponent::Base
|
2
|
-
def initialize(src: nil)
|
2
|
+
def initialize(src: nil, turbo_frame_id: :modal_content)
|
3
|
+
@turbo_frame_id = turbo_frame_id
|
3
4
|
@src = src
|
4
5
|
with_content(loading_html) if @src.present?
|
5
6
|
|
@@ -20,7 +21,7 @@ class ModalContentComponent < ViewComponent::Base
|
|
20
21
|
<div class="flash position-relative w-100 d-flex justify-content-center">
|
21
22
|
</div>
|
22
23
|
</div>
|
23
|
-
<%= helpers.turbo_frame_tag
|
24
|
+
<%= helpers.turbo_frame_tag @turbo_frame_id,
|
24
25
|
**{ src: @src, refresh: :morph }.compact do %>
|
25
26
|
<%= content %>
|
26
27
|
<% end %>
|
@@ -28,6 +28,11 @@ class AccountPolicy < ApplicationPolicy
|
|
28
28
|
# def acceso_total?
|
29
29
|
# user.developer?
|
30
30
|
# end
|
31
|
+
|
32
|
+
def new_from_associable?
|
33
|
+
false
|
34
|
+
end
|
35
|
+
|
31
36
|
def base_access_to_record?
|
32
37
|
ActsAsTenant.unscoped? ||
|
33
38
|
record.user_accounts.pluck(:user_id).include?(user.id)
|
@@ -14,9 +14,9 @@
|
|
14
14
|
- if @filtros.present?
|
15
15
|
= render SearchBarComponent.new(@q, @filtros)
|
16
16
|
|
17
|
-
|
17
|
+
.table-responsive style="padding-bottom: 15em"
|
18
18
|
- if @collection.any?
|
19
|
-
.
|
19
|
+
.xtable-responsive
|
20
20
|
table.table.table-sm.listado.xpg-revert-width.xborder-end
|
21
21
|
caption.ps-3 = page_entries_info @collection
|
22
22
|
thead.table-light
|
@@ -24,7 +24,8 @@ describe 'Modal windows' do
|
|
24
24
|
visitar
|
25
25
|
click_on 'Cargar coso'
|
26
26
|
select 'Completar', from: 'cosa_tipo'
|
27
|
-
|
27
|
+
find("input[placeholder='el placeholder'").click
|
28
|
+
click_on categoria_de_cosa.to_s
|
28
29
|
find('.modal input[type=submit]').click
|
29
30
|
expect(page).to have_text 'Por favor, revisá los campos obligatorios'
|
30
31
|
fill_in 'cosa_nombre', with: 'bla'
|
data/pg_rails/lib/version.rb
CHANGED
data/pg_rails/scss/pg_rails.scss
CHANGED
@@ -76,6 +76,11 @@ $values: 0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100;
|
|
76
76
|
text-overflow: ellipsis;
|
77
77
|
white-space: nowrap;
|
78
78
|
min-width: 30em * $value * 0.01;
|
79
|
+
|
80
|
+
// TODO: con css grid esto se debería poder hacer mejor
|
81
|
+
&:has(form) {
|
82
|
+
min-width: 28em;
|
83
|
+
}
|
79
84
|
}
|
80
85
|
}
|
81
86
|
|