thecore_ui_commons 3.1.5 → 3.1.6

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: c7c120eedf4dca232e5d22b6b87d71f7eddad81af8e1611dd5f190f6339be78d
4
- data.tar.gz: d567304745fff1ad9f6387104b0d74693eb6364ed55dd54d65085ecc49e835eb
3
+ metadata.gz: 17becbd7643a00bc0b677088ef7a5d04e6a56b2648be95541236c8496c12e73a
4
+ data.tar.gz: f521be59ee4be146f8c27ff318ede3db9476b37d27716ef19dc5b3d4dbdb6054
5
5
  SHA512:
6
- metadata.gz: b1c795e77b22556c32f79aba53590601a0863ec37006c3f1e96ae82a57585f078bd26980c033ed93252005824cdc885044ebba44882dbd1ae9e679d2ac58bcff
7
- data.tar.gz: 8b5ea7538e46a1103157149e6f48c62e7c58cae08e8ff230da8f575dbcaf8b0c4499c57e74037bb29520163421de0cbdb363c4f93bdeee56fa8b9652083efd16
6
+ metadata.gz: ccf8b726e8e78b02f5c5b438ba2ec187777c8942eaaff07afe3ac495c066c5e57a68c8a7777e3bc7b0035ff224aec41653f1157009298c51a608be3bdd405fa4
7
+ data.tar.gz: 824474d33a95711a0ebbf1dccc61d971d06f2ef0f41b852354158cd76e86d60b45949701042fe98e9e5a4cab6b69529344ee9454b2cb6b84d359953dd4f42b8d
@@ -1,8 +1,8 @@
1
1
  Rails.application.configure do
2
2
  config.after_initialize do
3
3
  # Controllers
4
- ApplicationController.send :include, ConcernApplicationController
5
- RailsAdmin::ApplicationController.send :include, ConcernApplicationController
4
+ ApplicationController.send(:include, ConcernCommonApplicationController)
6
5
  User.send(:include, ThecoreUiCommonsUserConcern)
6
+ RailsAdmin::ApplicationController.send(:include, ConcernCommonApplicationController)
7
7
  end
8
8
  end
@@ -1,7 +1,7 @@
1
- puts "ApplicationController Concern from ThecoreUiCommons"
1
+ Rails.logger.debug "ApplicationController Concern from ThecoreUiCommons"
2
2
  require 'active_support/concern'
3
3
 
4
- module ConcernApplicationController
4
+ module ConcernCommonApplicationController
5
5
  extend ActiveSupport::Concern
6
6
 
7
7
  included do
@@ -15,44 +15,10 @@ module ConcernApplicationController
15
15
  before_action :store_user_location!, if: :storable_location?
16
16
  before_action :reject_locked!, if: :devise_controller?
17
17
 
18
- # Redirects on successful sign in
19
- def after_sign_in_path_for resource
20
- root_actions = RailsAdmin::Config::Actions.all(:root).select {|action| can? action.action_name, :all }.collect(&:action_name)
21
-
22
- # Default root action as landing page: the first to which I have authorization to read
23
- action = root_actions.first
24
- puts "after_sign_in_path_for action: #{action}"
25
- # Otherwise, if I set a Manual override for landing actions in config, I can test if I'm authorized to see it
26
- override_landing_page = Settings.ns(:main).after_sign_in_redirect_to_root_action
27
- action = override_landing_page.to_sym if !override_landing_page.blank? && root_actions.include?(override_landing_page.to_sym)
28
-
29
- # If I ask for a specific page, Let's try to go back there if I need to login or re-login
30
- # This takes precedence on automatic computed action
31
- stored_location = stored_location_for(resource)
32
- puts "after_sign_in_path_for stored_location: #{stored_location}"
33
- if !stored_location.blank? && can?(resource, :all)
34
- # Go to the latest navigated page
35
- puts "after_sign_in_path_for Redirect to stored_location"
36
- return stored_location
37
- elsif action
38
- path = rails_admin.send("#{action}_path").sub("#{ENV['RAILS_RELATIVE_URL_ROOT']}#{ENV['RAILS_RELATIVE_URL_ROOT']}", "#{ENV['RAILS_RELATIVE_URL_ROOT']}")
39
- puts "after_sign_in_path_for Redirect to action #{path}"
40
- return path
41
- else
42
- puts "after_sign_in_path_for ERROR! Signing out user :-("
43
- sign_out current_user
44
- user_session = nil
45
- current_user = nil
46
- flash[:alert] = "Your user is not authorized to access any page."
47
- flash[:notice] = nil
48
- return root_path
49
- end
50
- end
51
-
52
18
  # Auto-sign out locked users
53
19
  def reject_locked!
54
20
  if !current_user.blank? && current_user.locked?
55
- puts " - Cleaning session"
21
+ Rails.logger.debug " - Cleaning session"
56
22
  sign_out current_user
57
23
  user_session = nil
58
24
  current_user = nil
@@ -1,3 +1,3 @@
1
1
  module ThecoreUiCommons
2
- VERSION = "3.1.5".freeze
2
+ VERSION = "3.1.6".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: thecore_ui_commons
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.5
4
+ version: 3.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gabriele Tassoni
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-07-02 00:00:00.000000000 Z
11
+ date: 2024-07-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thecore_backend_commons