thecore_ui_rails_admin 2.5.3 → 2.5.7

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: 9b2c06d8d6ad6f84f30b12fbde0e9fd793b8045bc17d5b6de623e24653e03bc7
4
- data.tar.gz: c4dbca8120c81a7d86e9f7f5276d89cef683a1f2a00412b800c98e6292746ea3
3
+ metadata.gz: 87070eb831cb6062f1b0a8d1fe47b2c00a60eb3ac130f66eb0910035af3a41b9
4
+ data.tar.gz: 464aea6a18a0717275dd05423730fc3541fe85cff66c5dd162dde07c7ae19073
5
5
  SHA512:
6
- metadata.gz: 719cc4578dd092e024bd7b481b3513f6cff79fc10a9d1694a174fd1a85532ff6d62cc934cf5d2d4577eabdd5e6479e5248032fca7cbee0c05147eccc1314504a
7
- data.tar.gz: 22ba5800dc837aff5484668e63519c5ea267928ecb47c948d6b2943fb7f5072dd22972623b8d907f4ee415e26aa9f80341b4ace526cb361e1ef9fd4ce7d74cc0
6
+ metadata.gz: 60e2044879c5650c6818d711af48b67561fcef2eba3b8b129e3a55359e0aa35c39293eb5cf486dfcc67b00ca60be53a61a4f7ff34745c403d2becc52320dfba9
7
+ data.tar.gz: fb516cfbd40af7d8bddda2a66cc56fa0f4acc87b02096843026d84cd4c576a58e1c8683c92d6e1f0e340b04c1b04d17e20d9b935ab83d7cf0213bdedb58769db
@@ -4,7 +4,7 @@ require 'nested_form/builder_mixin'
4
4
  RailsAdmin.config do |config|
5
5
  config.main_app_name = Proc.new { |controller| [ ((ENV["APP_NAME"].presence || Settings.app_name.presence) rescue "Thecore"), "" ] }
6
6
  # Link for background Job
7
- (config.navigation_static_links ||= {}).merge! "Background Monitor" => "#{ENV['RAILS_RELATIVE_URL_ROOT']}/sidekiq"
7
+ (config.navigation_static_links ||= {}).merge! "Background Monitor" => "#{ENV["BACKEND_URL"].presence || "http://localhost:3000"}/sidekiq"
8
8
 
9
9
  ### Popular gems integration
10
10
  config.model "RoleUser" do
@@ -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}"
@@ -11,7 +11,7 @@ Rails.application.configure do
11
11
  RailsAdmin::Config::Actions::BulkDelete.send(:include, BulkDeleteConcern)
12
12
  ThecoreSettings::Setting.send(:include, ThecoreSettings::RailsAdminExtensionConfig)
13
13
  User.send(:include, ThecoreUiRailsAdminUser)
14
- UsedToken.send(:include, ThecoreUiRailsAdminUsedToken)
14
+ UsedToken.send(:include, ThecoreUiRailsAdminUsedToken) rescue puts "No UsedToken Model it could be normal: maybe model_driven_api is not installed"
15
15
  Role.send(:include, ThecoreUiRailsAdminRole)
16
16
  Permission.send(:include, ThecoreUiRailsAdminPermission)
17
17
  end
@@ -24,6 +24,8 @@ it:
24
24
  label: "Impostazioni"
25
25
  advanced:
26
26
  label: Avanzate
27
+ logging:
28
+ label: Logging
27
29
  registries:
28
30
  label: Anagrafiche
29
31
  operations:
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.3
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-09-14 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