thecore_ui_rails_admin 2.5.5 → 2.5.9

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: 93c65ba345f66f5a9c7f0d4f488bb13936ce414e01bcbb4126513f840e7524a9
4
- data.tar.gz: e2f5ec2798770ee1c7387eaf6757ac8dcb46cb08aba33bef2f07f3bc29d49a19
3
+ metadata.gz: 43fa1879372767822bfaf93962c2aa910f013e8c03b74ffdc0d0776903e27753
4
+ data.tar.gz: ca849d25b6f297b340f7495d84d231a59799820255cfbb92bec2424d0820d40a
5
5
  SHA512:
6
- metadata.gz: 07510ff3cd779842bd6dcfa71b0cfe261b0cc77c20859d313ed2953507483eece0f26fd845e083fe1874ac1ee4be5910a0092704bdcc0251245693f30b1c8aa9
7
- data.tar.gz: f059cc17f6250dfa24b6e61c6cdfa047f9299c482e293dbd92347cb3b4f1bdb723201c33afccd2e1ebb34c6a45d801d2a65f73c2b89c37d4a92a61eec6f34f25
6
+ metadata.gz: b6a31cb68d41251d647816adcd8e774c156ef72877885c143aaa8884a19a5e51da29c2f2f4a9f6da1ad0652af52a01c632fbee090d44a3339a0cb084d1eb6891
7
+ data.tar.gz: a6cb795acc5c560dcabc72000727079a9fd82ce69665b8700ac9f9ab6beca0e88d5f7da8f0162435d9157a9a60aaa7af0edee39639ee7a4cfa7bd70babe2081a
@@ -24,25 +24,23 @@ 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
- # Rails.logger.info "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA: Checking redirect path: I'm in the IF stored_location_for(resource): #{stored_location}"
39
+ # Go to the latest navigated page
40
40
  return stored_location
41
41
  elsif action
42
- # Rails.logger.info "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA: Checking redirect path: I'm in the ELSIF with action name: #{action}"
43
42
  return rails_admin.send("#{action}_path").sub("#{ENV['RAILS_RELATIVE_URL_ROOT']}#{ENV['RAILS_RELATIVE_URL_ROOT']}", "#{ENV['RAILS_RELATIVE_URL_ROOT']}")
44
43
  else
45
- # Rails.logger.info "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA: Checking redirect path: I'm in the ELSE with root_path: #{root_path}"
46
44
  sign_out current_user
47
45
  user_session = nil
48
46
  current_user = nil
@@ -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, ""
@@ -9,24 +9,25 @@ module ThecoreUiRailsAdminPermission
9
9
  field :predicate
10
10
  field :action
11
11
  field :target
12
+ field :lock_version
12
13
  list do
13
14
  field :created_at
14
- exclude_fields :lock_version
15
+ # exclude_fields :lock_version
15
16
  end
16
17
  show do
17
18
  exclude_fields :id
18
- exclude_fields :lock_version
19
- end
20
- create do
21
- field :lock_version, :hidden do
22
- visible true
23
- end
24
- end
25
- edit do
26
- field :lock_version, :hidden do
27
- visible true
28
- end
19
+ # exclude_fields :lock_version
29
20
  end
21
+ # create do
22
+ # field :lock_version, :hidden do
23
+ # visible true
24
+ # end
25
+ # end
26
+ # edit do
27
+ # field :lock_version, :hidden do
28
+ # visible true
29
+ # end
30
+ # end
30
31
  end
31
32
  end
32
33
  end
@@ -12,25 +12,26 @@ module ThecoreUiRailsAdminRole
12
12
 
13
13
  field :name
14
14
  field :permissions#, :selectize
15
+
15
16
  list do
16
17
  field :created_at
17
- exclude_fields :lock_version
18
+ # exclude_fields :lock_version
18
19
  end
19
20
  show do
20
21
  exclude_fields :id
21
- exclude_fields :lock_version
22
- end
23
- create do
24
- field :lock_version, :hidden do
25
- visible true
26
- end
27
- # include UserRailsAdminCreateConcern
28
- end
29
- edit do
30
- field :lock_version, :hidden do
31
- visible true
32
- end
22
+ # exclude_fields :lock_version
33
23
  end
24
+ # create do
25
+ # field :lock_version, :hidden do
26
+ # visible true
27
+ # end
28
+ # # include UserRailsAdminCreateConcern
29
+ # end
30
+ # edit do
31
+ # field :lock_version, :hidden do
32
+ # visible true
33
+ # end
34
+ # end
34
35
  end
35
36
  end
36
37
  end
@@ -61,9 +61,9 @@ module ThecoreUiRailsAdminUser
61
61
  field :password_confirmation do
62
62
  required true
63
63
  end
64
- field :lock_version, :hidden do
65
- visible true
66
- end
64
+ # field :lock_version, :hidden do
65
+ # visible true
66
+ # end
67
67
  # include UserRailsAdminCreateConcern
68
68
  end
69
69
  edit do
@@ -74,9 +74,9 @@ module ThecoreUiRailsAdminUser
74
74
  required false
75
75
  end
76
76
 
77
- field :lock_version, :hidden do
78
- visible true
79
- end
77
+ # field :lock_version, :hidden do
78
+ # visible true
79
+ # end
80
80
  # include UserRailsAdminEditConcern
81
81
 
82
82
  end
@@ -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.5
4
+ version: 2.5.9
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-19 00:00:00.000000000 Z
11
+ date: 2021-12-06 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