pg_rails 7.6.21.pre.8 → 7.6.21.pre.10

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: 6a439af10284382f4f53949fdda3f7896153111579e5a82bc165173dad621e7b
4
- data.tar.gz: a8eb2dc72770f60c14a71181f6134882106f5f8031c623c1820d9614beb15002
3
+ metadata.gz: 61d8d262ef0d2d85da44e8c6580a6e52b07edf7e42ebd67043b2fab25a353734
4
+ data.tar.gz: 789617b6cd87d217773dde9556485e3352e1209c28f9ca3458544c251873bb84
5
5
  SHA512:
6
- metadata.gz: 7346846582bd45180a3f34327364f4ce153d5e16f4716e84bc12fef3d9b5bb7b9ae7557abeecf67b05c61b37aa94ec1481298cad705e1d9d1093ba7aa5271831
7
- data.tar.gz: 2a0541a2a7c51e4e2a0205f8e8270f60f2bc7e08b038d3b9bfee92f4fed22da9b323709b3b81d3018eae80f726f7f8071bdda249b550e4f724cc9b0c2cffa466
6
+ metadata.gz: 6cc7e58e50a5a168d317afda86b9cd7e024b990fef11469574b49ea42568729854baa2658f7d3d0da058fac667db93e2d35805d0d19fd0a92ae9f88a5a5479cb
7
+ data.tar.gz: d0ab03c2862046efbde505013c57296032b7d1ccd21d6daa08cd7b5b31288de68bb548b1b81c0b1c918cba906bbed986af30ddaf25212fc33fb40b728b626889
@@ -80,15 +80,17 @@ module PgEngine
80
80
  end
81
81
 
82
82
  def no_tenant_set(error)
83
- pg_debug(error)
84
83
  return internal_error(error) if Current.user.blank?
85
84
 
86
85
  active_user_accounts = ActsAsTenant.without_tenant do
87
86
  Current.user.user_accounts.ua_active.to_a
88
87
  end
89
88
  if active_user_accounts.length == 1 && params[:tid].blank?
90
- redirect_to url_for(tid: active_user_accounts.first.to_param)
89
+ url = url_for(tid: active_user_accounts.first.to_param)
90
+ pg_warn(error, "redirected to #{url}")
91
+ redirect_to url
91
92
  else
93
+ pg_warn(error, 'redirected to users_accounts_path')
92
94
  redirect_to users_accounts_path
93
95
  end
94
96
  end
@@ -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
@@ -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
@@ -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-8'
4
+ VERSION = '7.6.21-10'
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.8
4
+ version: 7.6.21.pre.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martín Rosso