thecore_ui_rails_admin 2.5.7 → 2.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/config/initializers/rails_admin.rb +3 -0
- data/config/initializers/thecore_concern.rb +6 -4
- data/lib/concerns/thecore_ui_rails_admin_permission.rb +13 -12
- data/lib/concerns/thecore_ui_rails_admin_role.rb +2 -13
- data/lib/concerns/thecore_ui_rails_admin_user.rb +6 -6
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3d9ea4f97bd820e0527837c48c1ca0a838f007cfa10041031f2324593995d86f
|
4
|
+
data.tar.gz: c6d6a9646ebdb8ecf535b3d063d79e6ef4b013e5ba32a5379840cb4a87ef48f2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c0fea64c936129bdd45e995567956e8dc7aaaa5e956e859bca603ce0fe1c88a7fbbd4e10db79c7f28e35fd3a541e4df8e57923056a02cbf5e6ca16ce3435aa14
|
7
|
+
data.tar.gz: 48d3f7282e701c1cf5ba01e2c7fb047efb0c33d7b0035533f0de12fa833ccbb48149a7c44bb76a4475f67bf912bbf0e2f090b6b4f7429ff9593617cb73f1a448
|
@@ -2,6 +2,9 @@ require 'rails_admin'
|
|
2
2
|
require 'nested_form/builder_mixin'
|
3
3
|
|
4
4
|
RailsAdmin.config do |config|
|
5
|
+
# Freeze more or fewer columns (col 1 = checkboxes, 2 = links/actions) for horizontal scrolling:
|
6
|
+
config.sidescroll = {num_frozen_columns: 2}
|
7
|
+
|
5
8
|
config.main_app_name = Proc.new { |controller| [ ((ENV["APP_NAME"].presence || Settings.app_name.presence) rescue "Thecore"), "" ] }
|
6
9
|
# Link for background Job
|
7
10
|
(config.navigation_static_links ||= {}).merge! "Background Monitor" => "#{ENV["BACKEND_URL"].presence || "http://localhost:3000"}/sidekiq"
|
@@ -36,13 +36,11 @@ module ThecoreConcern
|
|
36
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
|
+
# 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
|
@@ -136,13 +134,17 @@ module ThecoreConcern
|
|
136
134
|
# - The request is an Ajax request as this can lead to very unexpected
|
137
135
|
# behaviour.
|
138
136
|
def storable_location?
|
139
|
-
request.get? && is_navigational_format? && !devise_controller? && !request.xhr?
|
137
|
+
request.get? && is_navigational_format? && !devise_controller? && !request.xhr? && is_storable?
|
140
138
|
end
|
141
139
|
|
142
140
|
def store_user_location!
|
143
141
|
# :user is the scope we are authenticating
|
144
142
|
store_location_for(:user, request.fullpath)
|
145
143
|
end
|
144
|
+
|
145
|
+
def is_storable?
|
146
|
+
true
|
147
|
+
end
|
146
148
|
end
|
147
149
|
|
148
150
|
# include the extension
|
@@ -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,24 +12,13 @@ module ThecoreUiRailsAdminRole
|
|
12
12
|
|
13
13
|
field :name
|
14
14
|
field :permissions#, :selectize
|
15
|
+
|
15
16
|
list do
|
16
17
|
field :created_at
|
17
|
-
|
18
|
+
field :updated_at
|
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
|
33
22
|
end
|
34
23
|
end
|
35
24
|
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
|
-
|
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
|
-
|
79
|
-
end
|
77
|
+
# field :lock_version, :hidden do
|
78
|
+
# visible true
|
79
|
+
# end
|
80
80
|
# include UserRailsAdminEditConcern
|
81
81
|
|
82
82
|
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: 2.
|
4
|
+
version: 2.6.0
|
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
|
+
date: 2021-12-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thecore_ui_commons
|