thecore_ui_rails_admin 3.3.2 → 3.4.0
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 +4 -4
- data/app/views/rails_admin/main/import_users_from_ldap.html.erb +0 -0
- data/app/views/rails_admin/main/test_ldap_server.html.erb +10 -0
- data/config/initializers/after_initialize.rb +2 -0
- data/config/locales/en.thecore_ui_ra.yml +6 -0
- data/config/locales/it.thecore_ui_ra.yml +6 -0
- data/lib/member_actions/import_users_from_ldap.rb +21 -0
- data/lib/member_actions/test_ldap_server.rb +30 -0
- data/lib/thecore_ui_rails_admin/version.rb +1 -1
- metadata +5 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a073c777f562484f3aa818f57c12006b3e99142a2eecaa46780f2fa602831bb8
|
4
|
+
data.tar.gz: f485bceec0d8bd9ed88a103dab4489e5af6d878a5dc56b979e55c3de507fc212
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ec31012d3d4e1d9886a093b9dd138285ddde778bbc31404c520e3233e5fdfa07665f86990c152b79ae47d50675d53127f7ceadc7b1374e0887a5af3c1290f25c
|
7
|
+
data.tar.gz: bd9e19ca43ec411586e7403abc927a5d9bfa49cb3725c75619c08d2a45f72c4af10155e8d029c59b244fd9e35594c8a4f851463101bbed7ca9a66c67673da08c
|
File without changes
|
@@ -47,6 +47,8 @@ Rails.application.configure do
|
|
47
47
|
|
48
48
|
require 'root_actions/active_job_monitor'
|
49
49
|
require 'member_actions/change_password'
|
50
|
+
require 'member_actions/test_ldap_server'
|
51
|
+
require 'member_actions/import_users_from_ldap'
|
50
52
|
require 'collection_actions/save_filters'
|
51
53
|
require 'collection_actions/load_filters'
|
52
54
|
end
|
@@ -17,6 +17,12 @@ en:
|
|
17
17
|
root_navigation: Operations
|
18
18
|
reset_filters: Remove Filters
|
19
19
|
actions:
|
20
|
+
test_ldap_server:
|
21
|
+
title: Test LDAP Server
|
22
|
+
success: "The LDAP server is reachable"
|
23
|
+
error: "The LDAP server is not reachable"
|
24
|
+
menu: Test LDAP Server
|
25
|
+
breadcrumb: Test LDAP Server
|
20
26
|
thecore_blazer_bi:
|
21
27
|
menu: Business Intelligence
|
22
28
|
breadcrumb: Business Intelligence
|
@@ -17,6 +17,12 @@ it:
|
|
17
17
|
root_navigation: Operazioni
|
18
18
|
reset_filters: Rimuovi i Filtri
|
19
19
|
actions:
|
20
|
+
test_ldap_server:
|
21
|
+
title: Testa il Server LDAP
|
22
|
+
success: "Il server LDAP è raggiungibile"
|
23
|
+
error: "Il server LDAP non è raggiungibile"
|
24
|
+
menu: Testa il Server LDAP
|
25
|
+
breadcrumb: Testa il Server LDAP
|
20
26
|
thecore_blazer_bi:
|
21
27
|
menu: Business Intelligence
|
22
28
|
breadcrumb: Business Intelligence
|
@@ -0,0 +1,21 @@
|
|
1
|
+
RailsAdmin::Config::Actions.add_action "import_users_from_ldap", :base, :member do
|
2
|
+
|
3
|
+
link_icon 'fas fa-file-import'
|
4
|
+
|
5
|
+
http_methods [:get]
|
6
|
+
|
7
|
+
# Visible only for the User model
|
8
|
+
visible do
|
9
|
+
bindings[:object].is_a?(::LdapServer)
|
10
|
+
end
|
11
|
+
# Adding the controller which is needed to compute calls from the ui
|
12
|
+
controller do
|
13
|
+
proc do
|
14
|
+
# call the background job
|
15
|
+
BackgroundLdapImportJob.perform_later
|
16
|
+
# flash message
|
17
|
+
flash[:success] = "✅ Avviato l'import in background degli utenti da #{@object.host}"
|
18
|
+
redirect_to back_or_index
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
RailsAdmin::Config::Actions.add_action "test_ldap_server", :base, :member do
|
2
|
+
|
3
|
+
link_icon 'fas fa-circle-check'
|
4
|
+
|
5
|
+
http_methods [:get]
|
6
|
+
|
7
|
+
# Visible only for the User model
|
8
|
+
visible do
|
9
|
+
bindings[:object].is_a?(::LdapServer)
|
10
|
+
end
|
11
|
+
# Adding the controller which is needed to compute calls from the ui
|
12
|
+
controller do
|
13
|
+
proc do
|
14
|
+
# From the UI the user can test if the ldap server is reachable and receive a response
|
15
|
+
if request.get?
|
16
|
+
ldap = ::LdapServer.find(@object.id)
|
17
|
+
begin
|
18
|
+
ldap.test_connection
|
19
|
+
|
20
|
+
flash[:success] = @message = I18n.t("admin.actions.test_ldap_server.success")
|
21
|
+
rescue => e
|
22
|
+
flash[:error] = @message = I18n.t("admin.actions.test_ldap_server.error", error: e.message)
|
23
|
+
end
|
24
|
+
# Redirect to the object
|
25
|
+
redirect_to index_path(model_name: @abstract_model.to_param)
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: thecore_ui_rails_admin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gabriele Tassoni
|
@@ -85,8 +85,10 @@ files:
|
|
85
85
|
- app/views/rails_admin/main/active_job_monitor.html.erb
|
86
86
|
- app/views/rails_admin/main/change_password.html.erb
|
87
87
|
- app/views/rails_admin/main/dashboard.html.erb
|
88
|
+
- app/views/rails_admin/main/import_users_from_ldap.html.erb
|
88
89
|
- app/views/rails_admin/main/load_filters.html.erb
|
89
90
|
- app/views/rails_admin/main/save_filter.html.erb
|
91
|
+
- app/views/rails_admin/main/test_ldap_server.html.erb
|
90
92
|
- config/initializers/abilities.rb
|
91
93
|
- config/initializers/add_to_db_migrations.rb
|
92
94
|
- config/initializers/after_initialize.rb
|
@@ -113,6 +115,8 @@ files:
|
|
113
115
|
- lib/collection_actions/load_filters.rb
|
114
116
|
- lib/collection_actions/save_filters.rb
|
115
117
|
- lib/member_actions/change_password.rb
|
118
|
+
- lib/member_actions/import_users_from_ldap.rb
|
119
|
+
- lib/member_actions/test_ldap_server.rb
|
116
120
|
- lib/rails_admin_abstract_controller.rb
|
117
121
|
- lib/rails_admin_filter_controller_helper.rb
|
118
122
|
- lib/root_actions/active_job_monitor.rb
|