thecore_ui_rails_admin 2.5.6 → 2.5.7

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: 5dbbb4fc0003479cf43ec5f3744e176f8105193f45d232c9cde53e54fa4d3f85
4
- data.tar.gz: 3c8f44879ee7f337f0db4695edbdce186ac63553156f0b813878af6ef27c5834
3
+ metadata.gz: 87070eb831cb6062f1b0a8d1fe47b2c00a60eb3ac130f66eb0910035af3a41b9
4
+ data.tar.gz: 464aea6a18a0717275dd05423730fc3541fe85cff66c5dd162dde07c7ae19073
5
5
  SHA512:
6
- metadata.gz: 448cef53ac6f81b5671a948f5c5a6c9bd89365067708e1501b489100f380a986e7c2a2d28ab409a04b6d81747fe4cbeae01b529f4229e3a22d8902b41e5047fb
7
- data.tar.gz: bec954a41ad1dd8dfbf570a0c8de939e30ad0c0b590fc714582026ee1ccfb309cb489f6874a7e8ea620516c7c71d8be475f45211a848d977a65ad82c5569a6af
6
+ metadata.gz: 60e2044879c5650c6818d711af48b67561fcef2eba3b8b129e3a55359e0aa35c39293eb5cf486dfcc67b00ca60be53a61a4f7ff34745c403d2becc52320dfba9
7
+ data.tar.gz: fb516cfbd40af7d8bddda2a66cc56fa0f4acc87b02096843026d84cd4c576a58e1c8683c92d6e1f0e340b04c1b04d17e20d9b935ab83d7cf0213bdedb58769db
@@ -24,16 +24,16 @@ module ThecoreConcern
24
24
 
25
25
  # Redirects on successful sign in
26
26
  def after_sign_in_path_for resource
27
- # Rails.logger.debug("SUCCESFULL SIGNIN, USER IS ADMIN? #{current_user.admin?}")
28
- #if current_user.admin?
29
- # GETTING JUST THE ROOT ACTIONS I (CURRENT_USER) CAN MANAGE
30
- root_actions = RailsAdmin::Config::Actions.all(:root).select {|action| can? action.action_name, :all }
31
- # Rails.logger.debug "ROOT ACTIONS: #{root_actions.inspect}"
32
- # GETTING THE FIRST ACTION I CAN MANAGE
33
- action = root_actions.collect(&:action_name).first
34
- # REDIRECT TO THAT ACTION
27
+ root_actions = RailsAdmin::Config::Actions.all(:root).select {|action| can? action.action_name, :all }.collect(&:action_name)
35
28
 
36
- # Rails.logger.info "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA: Checking redirect path"
29
+ # Default root action as landing page: the first to which I have authorization to read
30
+ action = root_actions.first
31
+ # Otherwise, if I set a Manual override for landing actions in config, I can test if I'm authorized to see it
32
+ override_landing_page = Settings.ns(:main).after_sign_in_redirect_to_root_action
33
+ action = override_landing_page.to_sym if !override_landing_page.blank? && root_actions.include?(override_landing_page.to_sym)
34
+
35
+ # If I ask for a specific page, Let's try to go back there if I need to login or re-login
36
+ # This takes precedence on automatic computed action
37
37
  stored_location = stored_location_for(resource)
38
38
  if !stored_location.blank? && can?(resource, :all)
39
39
  # Rails.logger.info "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA: Checking redirect path: I'm in the IF stored_location_for(resource): #{stored_location}"
data/db/seeds.rb ADDED
@@ -0,0 +1 @@
1
+ Thecore::Seed.save_setting :main, :after_sign_in_redirect_to_root_action, ""
@@ -1,6 +1,7 @@
1
1
  module ThecoreUiRailsAdmin
2
2
  class Engine < ::Rails::Engine
3
3
  initializer 'thecore_ui_rails_admin.add_to_migrations' do |app|
4
+ Thecore::Base.thecore_engines << self.class
4
5
  unless app.root.to_s.match root.to_s
5
6
  # APPEND TO MAIN APP MIGRATIONS FROM THIS GEM
6
7
  config.paths['db/migrate'].expanded.each do |expanded_path|
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: thecore_ui_rails_admin
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.6
4
+ version: 2.5.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gabriele Tassoni
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-11-29 00:00:00.000000000 Z
11
+ date: 2021-11-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thecore_ui_commons
@@ -183,6 +183,7 @@ files:
183
183
  - config/locales/it.rails_admin.yml
184
184
  - config/locales/it.rollincode.yml
185
185
  - config/routes.rb
186
+ - db/seeds.rb
186
187
  - lib/abilities/thecore_ui_rails_admin.rb
187
188
  - lib/concerns/rails_admin_requirements.rb
188
189
  - lib/concerns/thecore_rails_admin_bulk_delete_concern.rb