thecore_ui_rails_admin 2.5.4 → 2.5.8

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: 6529c5fc30017ae9c103c5d6ab90c724b0d1c7a1c688261b1e405a31ae027109
4
- data.tar.gz: 650a840dc7e4a4939353f9e1b396fd2ba239727b50c3c713e358ff261e0f210d
3
+ metadata.gz: f1d1c9307261adf3e129bdb431d71baccc60b1f865de31e7616fc2fba4954ae5
4
+ data.tar.gz: c3bd49155e00599bfb895e6c6883d3235513d9539f81f0c6f3520d78173ff473
5
5
  SHA512:
6
- metadata.gz: 279afe79c80781f024b7e49690487ec7b04697c03b8858f35412f3f6cb8176acba2181ad739c5035a830566467aa9bcebc7cb8912454a3eb4e2370f24e0dfe49
7
- data.tar.gz: 75ebe5c6bb2abd7fc058f9361208b374d16b82f924ceced4235607fcaf1a1a564b1d39ff73a7f6873383ce7d33156642d718e1f33352c19656df4105dcc92a48
6
+ metadata.gz: a91c62050bf4fefa41175ca7b2479a7be464e429bfc0842cbbf595e88dc168c42ddd438cfbe267cb54a1154ce52b5d6073d4ee30598e6799e7e6423d48a5a7ec
7
+ data.tar.gz: e13c7cc2935816c2ee043418bc286af36b43fc1e0c748303fe21f2c9ea611677a7fb78fd6e4ecd82d9688ce513dbb5aa9198df713637dd2a9cd3391c077bc5bf
@@ -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, ""
@@ -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.4
4
+ version: 2.5.8
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