pg_rails 7.6.21.pre.9 → 7.6.21.pre.11

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: 63f1e288e7ae63d4dcbe6ad4f867e1dac603788f261936d8e4f824d8bb6f06c3
4
- data.tar.gz: 8a1d084833cb47974dd8e49afb43b6db481f02ecb5d2d4d1d824c94dba0d4c1c
3
+ metadata.gz: f442d786ae4cf36b38c87e72307bb1fe1dfd4c77fb2e697566adfb1d48bbb1b6
4
+ data.tar.gz: d1028638b9acd8817adbc33a0680f270c46b96c1b9f96d66d6ac964d46b96eaf
5
5
  SHA512:
6
- metadata.gz: f98bc54a139f85bc9129134a77738c78eb4adc347398acbe5c4d12f93bddff5ad324479d87bdfcd4861d2ffcbbefb4c162636392d8a9c91837196635ebe71c55
7
- data.tar.gz: c3089b66fba022d22c4c876344ae0360291c090464f44fc3865fc74b7f434efd202687fe54be256909e1ced1f04a4d87cf3a10c2e55d39b6b66c337b1b0393a3
6
+ metadata.gz: 184210806bdd1ed1c9c4e4e6f2e4d481751cae4375f1cf5df01b74b66ff66bc685e8cb01ad5405ad63e6e147c9eebf68a5795851040612ee1c830d4f9acc2261
7
+ data.tar.gz: 44544f1fd6549dc40ca21b0666a500538567320bbb6170e29ffc0a1773ae31e8c2c5a9faf869137465dce6c12f29a8a42d765d4d00dd3cf9e34f4f852f2f9821
@@ -37,7 +37,7 @@ class Account < ApplicationRecord
37
37
  has_many :audits, dependent: :nullify, class_name: 'Audited::Audit'
38
38
 
39
39
  has_one_attached :logo do |attachable|
40
- attachable.variant :thumb, resize_and_pad: [80, 80]
40
+ attachable.variant :thumb, resize_to_fill: [80, 80]
41
41
  end
42
42
 
43
43
  ransacker :search do |parent|
@@ -17,6 +17,10 @@ class Current < ActiveSupport::CurrentAttributes
17
17
  active_user_account.to_param
18
18
  end
19
19
 
20
+ def tid!
21
+ tid || 'current'
22
+ end
23
+
20
24
  def active_user_profiles
21
25
  if active_user_account.present?
22
26
  active_user_account.profiles
@@ -138,6 +138,10 @@ class User < ApplicationRecord
138
138
  "#{nombre} #{apellido}"
139
139
  end
140
140
 
141
+ def first_first_name
142
+ nombre.strip.split.first.presence || to_s
143
+ end
144
+
141
145
  class Error < PgEngine::Error; end
142
146
 
143
147
  # def default_account
@@ -82,7 +82,7 @@ module PgEngine
82
82
  end
83
83
 
84
84
  def puede_editar?
85
- user_has_profile?(:update)
85
+ user_has_profile?(:update) || (record.respond_to?(:creado_por) && record.creado_por == user)
86
86
  end
87
87
 
88
88
  def puede_crear?
@@ -2,6 +2,6 @@ div style="max-width: 22em"
2
2
  = pg_form_for(@account || object) do |f|
3
3
  = f.input :nombre
4
4
  / = f.input :plan
5
- = f.input :logo
5
+ = f.input :logo, hint: 'Es recomendable que la imagen sea cuadrada'
6
6
  .mt-2
7
7
  = f.button :submit
@@ -87,7 +87,9 @@ Rollbar.configure do |config|
87
87
  []
88
88
  end
89
89
  end
90
- acceptable_levels.include?(item[:level].to_sym) ? 'gogoogogooo' : 'ignored'
90
+ to_test = item[:level].to_sym
91
+ to_test = :warn if to_test == :warning
92
+ acceptable_levels.include?(to_test) ? 'gogoogogooo' : 'ignored'
91
93
  end
92
94
  end
93
95
  end
@@ -100,7 +100,7 @@ es:
100
100
  sign_up: Crear una cuenta
101
101
  invitations:
102
102
  send_instructions: "Se envió una invitación a %{email}"
103
- invitation_token_invalid: "¡La invitación no es válida!"
103
+ invitation_token_invalid: "La invitación expiró :("
104
104
  updated: ""
105
105
  updated_not_active: ""
106
106
  no_invitations_remaining: "No quedan invitaciones"
@@ -31,6 +31,12 @@ module PgEngine
31
31
  "#{key}__export": base + 80,
32
32
  "#{key}__destroy": base + 100
33
33
  )
34
+
35
+ return unless defined? UserAccount
36
+
37
+ UserAccount.class_eval do
38
+ enumerize :profiles, in: PgEngine.configuracion.user_profiles, multiple: true
39
+ end
34
40
  end
35
41
 
36
42
  def profile_groups_options
@@ -5,6 +5,7 @@ import './elements'
5
5
  import { flashMessage } from './utils/utils'
6
6
 
7
7
  import { Turbo } from '@hotwired/turbo-rails'
8
+ import { Rollbar } from 'rollbar'
8
9
 
9
10
  import Trix from 'trix'
10
11
 
@@ -74,6 +75,17 @@ document.addEventListener('turbo:before-fetch-request', (ev) => {
74
75
  ev.detail.fetchOptions.headers.Accept = 'text/html, application/xhtml+xml'
75
76
  }
76
77
 
78
+ const linksToCurrentTid = ev.detail.url.pathname.match('/u/t/current')
79
+
80
+ if (linksToCurrentTid) {
81
+ if (document.querySelector('#tid') && document.querySelector('#tid').dataset.tid) {
82
+ const tid = document.querySelector('#tid').dataset.tid
83
+ ev.detail.url.pathname = ev.detail.url.pathname.replace('/u/t/current', '/u/t/' + tid)
84
+ } else {
85
+ Rollbar.error('No hay TID')
86
+ }
87
+ }
88
+
77
89
  if (document.querySelector('.modal.show')) {
78
90
  ev.detail.fetchOptions.headers['Modal-Opened'] = true
79
91
  }
@@ -5,7 +5,7 @@
5
5
  <%= f.input :email, required: true, autofocus: true %>
6
6
  <%= f.input :nombre, required: true %>
7
7
  <%= f.input :apellido, required: true %>
8
- <%= f.input :avatar %>
8
+ <%= f.input :avatar, hint: 'Es recomendable que la imagen sea cuadrada' %>
9
9
 
10
10
  <% if devise_mapping.confirmable? && resource.pending_reconfirmation? %>
11
11
  <p><%= t(".currently_waiting_confirmation_for_email", email: resource.unconfirmed_email) %></p>
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PgRails
4
- VERSION = '7.6.21-9'
4
+ VERSION = '7.6.21-11'
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.6.21.pre.9
4
+ version: 7.6.21.pre.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martín Rosso