thecore_ui_rails_admin 3.2.1 → 3.2.3

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: 96c9347e99012db26dc415185e7817f487667788ff191be2bf93abbf919aa0be
4
- data.tar.gz: 6454e875e9a20d559d0ac40deb90efdf30eb72b767815b3630e535048b31207f
3
+ metadata.gz: 5ad379bd22ef6436935e1f5a2d33b202710f1fbf966e3c04e09d87602631dfa1
4
+ data.tar.gz: 74c6bacb910380a38fcf1c27cb5acd662b75a697e0aff27ccc07c8fc67b4f20c
5
5
  SHA512:
6
- metadata.gz: f39f555471d24bf9816dfad0801b7bfa9af5ddc027640dd700750b336dd8756048cdcefbcefdd9b32a8f033852734bf38f27ebaf31608c54b1bbb968b79dc2c5
7
- data.tar.gz: 6fe692c6e591f22d3e89b0aeaa4985e6c651aef2fc678225e1b0a3a354a11a7078faa6c6b0f83d02b397e1d6f796d7b41becc9eb2df959b8d9e7630aab228962
6
+ metadata.gz: f1ba6c3ae16f5b75c4fda3a083c4243397c615c7479c68f6cef0a868c4a4ffd518a50969de222e4b8ebf68b964fe452aa9c24fe10b4b12196f0dc1d7800117cf
7
+ data.tar.gz: f220d61752b9a4ac312593622cf8b41dd8012a81ba3e17e1ddd0c238f6bb5704b7b59624cf38fdebe52d04e67eddf8c82bbe9880e4eaa9a14c5e6e9c5bb28cbc
@@ -29,6 +29,8 @@ Rails.application.configure do
29
29
 
30
30
  RailsAdmin::Config::Actions::Export.send(:include, ExportConcern)
31
31
  RailsAdmin::Config::Actions::BulkDelete.send(:include, BulkDeleteConcern)
32
+ RailsAdmin::ApplicationController.send(:include, ConcernRAApplicationController)
33
+
32
34
  Role.send :include, ThecoreUiRailsAdminRoleConcern
33
35
  User.send :include, ThecoreUiRailsAdminUserConcern
34
36
  RoleUser.send :include, ThecoreUiRailsAdminRoleUserConcern
@@ -0,0 +1,42 @@
1
+ Rails.logger.debug "ApplicationController Concern from ThecoreUiCommons"
2
+ require 'active_support/concern'
3
+
4
+ module ConcernRAApplicationController
5
+ extend ActiveSupport::Concern
6
+
7
+ included do
8
+ # Redirects on successful sign in
9
+ def after_sign_in_path_for resource
10
+ root_actions = RailsAdmin::Config::Actions.all(:root).select {|action| can? :read, action.action_name }.collect(&:action_name)
11
+
12
+ # Default root action as landing page: the first to which I have authorization to read
13
+ action = root_actions.first
14
+ Rails.logger.debug "after_sign_in_path_for action: #{action}"
15
+ # Otherwise, if I set a Manual override for landing actions in config, I can test if I'm authorized to see it
16
+ override_landing_page = Settings.ns(:main).after_sign_in_redirect_to_root_action
17
+ action = override_landing_page.to_sym if !override_landing_page.blank? && root_actions.include?(override_landing_page.to_sym)
18
+
19
+ # If I ask for a specific page, Let's try to go back there if I need to login or re-login
20
+ # This takes precedence on automatic computed action
21
+ stored_location = stored_location_for(resource)
22
+ Rails.logger.debug "after_sign_in_path_for stored_location: #{stored_location}"
23
+ if !stored_location.blank? && can?(resource, :all)
24
+ # Go to the latest navigated page
25
+ Rails.logger.debug "after_sign_in_path_for Redirect to stored_location"
26
+ return stored_location
27
+ elsif action
28
+ path = rails_admin.send("#{action}_path").sub("#{ENV['RAILS_RELATIVE_URL_ROOT']}#{ENV['RAILS_RELATIVE_URL_ROOT']}", "#{ENV['RAILS_RELATIVE_URL_ROOT']}")
29
+ Rails.logger.debug "after_sign_in_path_for Redirect to action #{path}"
30
+ return path
31
+ else
32
+ Rails.logger.debug "after_sign_in_path_for ERROR! Signing out user :-("
33
+ sign_out current_user
34
+ user_session = nil
35
+ current_user = nil
36
+ flash[:alert] = "Your user is not authorized to access any page."
37
+ flash[:notice] = nil
38
+ return root_path
39
+ end
40
+ end
41
+ end
42
+ end
@@ -28,8 +28,8 @@ en:
28
28
  label: Settings
29
29
  advanced:
30
30
  label: Advanced
31
- logging:
32
- label: Logging
31
+ logs:
32
+ label: Logs
33
33
  registries:
34
34
  label: Registries
35
35
  operations:
@@ -28,8 +28,8 @@ it:
28
28
  label: "Impostazioni"
29
29
  advanced:
30
30
  label: Avanzate
31
- logging:
32
- label: Logging
31
+ logs:
32
+ label: Logs
33
33
  registries:
34
34
  label: Anagrafiche
35
35
  operations:
@@ -1,3 +1,3 @@
1
1
  module ThecoreUiRailsAdmin
2
- VERSION = "3.2.1".freeze
2
+ VERSION = "3.2.3".freeze
3
3
  end
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: 3.2.1
4
+ version: 3.2.3
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-01-10 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_ui_commons
@@ -90,6 +90,7 @@ files:
90
90
  - config/initializers/after_initialize.rb
91
91
  - config/initializers/assets.rb
92
92
  - config/initializers/concern_action.rb
93
+ - config/initializers/concern_application_controller.rb
93
94
  - config/initializers/concern_bulk_delete.rb
94
95
  - config/initializers/concern_export.rb
95
96
  - config/initializers/concern_permission.rb
@@ -135,7 +136,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
135
136
  - !ruby/object:Gem::Version
136
137
  version: '0'
137
138
  requirements: []
138
- rubygems_version: 3.5.3
139
+ rubygems_version: 3.5.11
139
140
  signing_key:
140
141
  specification_version: 4
141
142
  summary: Thecore Backend UI based on Rails Admin.