ucb_rails_user 7.0.0 → 8.0.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.
Files changed (52) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +18 -1
  3. data/app/assets/config/ucb_rails_user_manifest.js +1 -0
  4. data/app/assets/stylesheets/ucb_rails_user/components/impersonations.css +12 -0
  5. data/app/assets/stylesheets/ucb_rails_user/components/loader.css +41 -0
  6. data/app/assets/stylesheets/ucb_rails_user/components/users_table.css +54 -0
  7. data/app/assets/stylesheets/ucb_rails_user/main.css +1 -0
  8. data/app/assets/stylesheets/ucb_rails_user/pagy_tailwind.css +21 -0
  9. data/app/assets/stylesheets/ucb_rails_user/user.css +29 -0
  10. data/app/controllers/concerns/ucb_rails_user/auth_concerns.rb +1 -0
  11. data/app/controllers/concerns/ucb_rails_user/users_controller_concerns.rb +2 -5
  12. data/app/helpers/ucb_rails_user/users_helper.rb +1 -0
  13. data/app/helpers/ucb_rails_user_helper.rb +0 -15
  14. data/app/views/ucb_rails_user/home/logged_in.html.erb +6 -0
  15. data/app/views/ucb_rails_user/home/not_logged_in.html.erb +5 -0
  16. data/app/views/ucb_rails_user/impersonations/index.html.erb +32 -0
  17. data/app/views/ucb_rails_user/lps/_form.html.erb +20 -0
  18. data/app/views/ucb_rails_user/lps/_modal.html.erb +15 -0
  19. data/app/views/ucb_rails_user/lps/_results.html.erb +44 -0
  20. data/app/views/ucb_rails_user/lps/search.js.erb +5 -0
  21. data/app/views/ucb_rails_user/users/_form.html.erb +15 -0
  22. data/app/views/ucb_rails_user/users/_search_results.html.erb +33 -0
  23. data/app/views/ucb_rails_user/users/_user.html.erb +18 -0
  24. data/app/views/ucb_rails_user/users/edit.html.erb +3 -0
  25. data/app/views/ucb_rails_user/users/index.html.erb +34 -0
  26. data/app/views/ucb_rails_user/users/new.html.erb +19 -0
  27. data/app/views/ucb_rails_user/users/search.js.erb +4 -0
  28. data/lib/ucb_rails_user/configuration/email.rb +2 -58
  29. data/lib/ucb_rails_user/engine.rb +14 -0
  30. data/lib/ucb_rails_user/version.rb +1 -1
  31. data/lib/ucb_rails_user.rb +0 -2
  32. metadata +77 -50
  33. data/app/assets/stylesheets/ucb_rails_user/components/_impersonations.sass +0 -13
  34. data/app/assets/stylesheets/ucb_rails_user/components/_loader.sass +0 -46
  35. data/app/assets/stylesheets/ucb_rails_user/components/_users_table.sass +0 -10
  36. data/app/assets/stylesheets/ucb_rails_user/components/index.sass +0 -3
  37. data/app/assets/stylesheets/ucb_rails_user/main.sass +0 -6
  38. data/app/views/ucb_rails_user/home/logged_in.html.haml +0 -5
  39. data/app/views/ucb_rails_user/home/not_logged_in.html.haml +0 -5
  40. data/app/views/ucb_rails_user/impersonations/index.html.haml +0 -20
  41. data/app/views/ucb_rails_user/lps/_form.html.haml +0 -19
  42. data/app/views/ucb_rails_user/lps/_modal.html.haml +0 -9
  43. data/app/views/ucb_rails_user/lps/_results.html.haml +0 -34
  44. data/app/views/ucb_rails_user/lps/search.js.haml +0 -3
  45. data/app/views/ucb_rails_user/users/_form.html.haml +0 -14
  46. data/app/views/ucb_rails_user/users/_search_results.html.haml +0 -24
  47. data/app/views/ucb_rails_user/users/_user.html.haml +0 -11
  48. data/app/views/ucb_rails_user/users/edit.html.haml +0 -3
  49. data/app/views/ucb_rails_user/users/index.html.haml +0 -22
  50. data/app/views/ucb_rails_user/users/new.html.haml +0 -16
  51. data/app/views/ucb_rails_user/users/search.js.haml +0 -4
  52. data/lib/ucb_rails_user/configuration/exception_notification.rb +0 -21
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0f97d4eaed1cb2f5c9ae47c6938e06759a824c6547bbe99a0a89e7b449e6ffef
4
- data.tar.gz: 561f091975109dc34b87ec421c9b158c61f405b57cf67b172c4570d365d499d5
3
+ metadata.gz: 3a52f47b67f3941ef82192caf5fd352e71e9d85074d366da8a6a44897fbafd82
4
+ data.tar.gz: 64fa7bda12ce85ba806ebc4000131d700a8317ef5d95e2f49079f099d1f33ea9
5
5
  SHA512:
6
- metadata.gz: b466215e44a1ba26631b8538a6905d497139c86125d8b153b8fcc30c739cfd5b2d2074ab0250140e8bc9a817296b264cbe346133f275c5c7d3cd12b03631b8bc
7
- data.tar.gz: 6107b7bc878e2a4ea6789c1090ac70ba9ebc90b86128427a83386876682bba8788e80daa54e5468479a3aaff5a4983a6fc90e9c13efa81d8cab38b10c14f343f
6
+ metadata.gz: 4c0288fd05fee9438c59fd518bbb143721b43c8109aec25248ba162f8a8e3ce2abd70ab96b228caa37dbdc111288d9be1c3ccb804deb191afce17e683bb07de3
7
+ data.tar.gz: ee2fb735c92576d9cd596721ed3c6f3d4f30e2899725ce522c99121c3c05d3e77385d4b32b1c2aef80a13d27a5901ec3192de3b6990e751c4f7d77d4f09ed5c3
data/README.md CHANGED
@@ -27,7 +27,7 @@ See [this wiki page](https://github.com/ucb-ist-eas/ucb_rails_user/wiki/Upgradin
27
27
  ## Prerequisites
28
28
 
29
29
  * Ruby >= 3.0
30
- * Rails >= 6.0
30
+ * Rails >= 8.0
31
31
 
32
32
  Older versions may work as well, but they haven't been tested.
33
33
 
@@ -273,3 +273,20 @@ If you're using the `HomeController` provided by this engine for your home page,
273
273
  * `not_logged_in.html.haml`
274
274
 
275
275
  One of those two views will render when the user hits the home page, depending on whether or not they're currently logged in.
276
+
277
+ ## Session Timeouts
278
+
279
+ While we would want to have session timeouts be the same across apps, we have noticed that some apps use cookies for sessions, some ActiveRecord and some not explicitly stated at all (Cookies). This is the general pattern that we are trying to follow. The major part is the `expire_after` and trying to keep that as close to the `30.miutees` as we can with the apps that we support. Obviously, some apps may need to have a different timeout.
280
+
281
+ ```ruby
282
+ # cookie_key generates the session key in the form _app_name_session.
283
+ cookie_key = '_' + Rails.application.class.module_parent.name.underscore + '_session'
284
+
285
+ # Set user sessions to expire after 30 minutes of inactivity.
286
+ Rails.application.config.session_store :cookie_store, key: cookie_key, expire_after: 30.minutes
287
+
288
+ There is a new session timeout gem that can be used as well. It has a nice Javascript popup to let the user know that their session has expired. It can be found at: https://gitlab.com/ucb-bit/cad/aa/ucb_rails_session_timeout
289
+
290
+ ## Version 8+
291
+
292
+ This version removes both the emailing setup functionality as well as the error reporting functionality. Those are both in the [UcbRailsDefaults] (https://gitlab.com/ucb-bit/cad/aa/ucb_rails_defaults) gem. This gem's dependencies have been slimmed down so that only the basics to run the gem are required. This makes it easier to upgrade the including apps.
@@ -0,0 +1 @@
1
+ //= link_tree ../javascripts/ucb_rails_user .js
@@ -0,0 +1,12 @@
1
+ @media screen and (min-width: 768px) {
2
+ .impersonation-form {
3
+ width: 300px; } }
4
+
5
+ .recent-impersonations {
6
+ margin-top: 24px;
7
+ padding-bottom: 200px; }
8
+ .recent-impersonations ul {
9
+ padding-left: 0px; }
10
+ .recent-impersonations li {
11
+ list-style-type: none;
12
+ font-size: 110%; }
@@ -0,0 +1,41 @@
1
+ .ucb-rails-user-loader,
2
+ .ucb-rails-user-loader:after {
3
+ border-radius: 50%;
4
+ width: 6em;
5
+ height: 6em; }
6
+
7
+ .ucb-rails-user-loader {
8
+ display: none;
9
+ margin: 60px auto;
10
+ font-size: 10px;
11
+ position: relative;
12
+ text-indent: -9999em;
13
+ border-top: 0.8em solid rgba(0, 50, 97, 0.2);
14
+ border-right: 0.8em solid rgba(0, 50, 97, 0.2);
15
+ border-bottom: 0.8em solid rgba(0, 50, 97, 0.2);
16
+ border-left: .8em solid #003261;
17
+ -webkit-transform: translateZ(0);
18
+ -ms-transform: translateZ(0);
19
+ transform: translateZ(0);
20
+ -webkit-animation: load8 1.1s infinite linear;
21
+ animation: load8 1.1s infinite linear; }
22
+
23
+ @-webkit-keyframes load8 {
24
+ 0% {
25
+ -webkit-transform: rotate(0deg);
26
+ transform: rotate(0deg); }
27
+ 100% {
28
+ -webkit-transform: rotate(360deg);
29
+ transform: rotate(360deg); } }
30
+
31
+ @keyframes load8 {
32
+ 0% {
33
+ -webkit-transform: rotate(0deg);
34
+ transform: rotate(0deg); }
35
+ 100% {
36
+ -webkit-transform: rotate(360deg);
37
+ transform: rotate(360deg); } }
38
+
39
+ .ucb-rails-user-loader-small {
40
+ margin: 16px;
41
+ font-size: 6px; }
@@ -0,0 +1,54 @@
1
+ .ucb-rails-users-table-header {
2
+ margin-top: 16px;
3
+ margin-bottom: 16px; }
4
+
5
+ .ucb-rails-users-table-header a {
6
+ margin-top: 16px; }
7
+
8
+ table.ucb-rails-users-table {
9
+ border-spacing: 0px;
10
+ margin-top: 16px;
11
+ }
12
+
13
+ table.ucb-rails-users-table th {
14
+ border: 1px solid #dee2e6;
15
+ padding: 10px;
16
+ margin: 0px;
17
+ }
18
+
19
+ table.ucb-rails-users-table td {
20
+ text-align: center;
21
+ padding: 10px;
22
+ }
23
+
24
+ table.ucb-rails-users-table tr:nth-child(even) {
25
+ background-color: #00000011;
26
+ }
27
+
28
+
29
+ h1 {
30
+ font-size: 2.5rem;
31
+ }
32
+
33
+ .btn {
34
+ @apply font-bold py-2 px-4 rounded;
35
+ }
36
+ .btn-blue {
37
+ @apply bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 border border-blue-700 rounded text-white;
38
+ }
39
+
40
+ .btn-danger {
41
+ @apply bg-blue-500 text-white;
42
+ }
43
+
44
+ .ucb-rails-user > nav.pagy {
45
+ margin-top: 10px;
46
+ padding: 5px;
47
+ }
48
+
49
+ .ucb-rails-user > nav.pagy a {
50
+ padding: 5px;
51
+ border: 1px solid #99b;
52
+ padding-left: 10px;
53
+ padding-right: 10px;
54
+ }
@@ -0,0 +1 @@
1
+ @import "/user.css"
@@ -0,0 +1,21 @@
1
+ .pagy {
2
+ @apply flex space-x-1 font-semibold text-sm text-gray-500;
3
+ a:not(.gap) {
4
+ @apply block rounded-lg px-3 py-1 bg-gray-200;
5
+ &:hover {
6
+ @apply bg-gray-300;
7
+ }
8
+ &:not([href]) { /* disabled links */
9
+ @apply text-gray-300 bg-gray-100 cursor-default;
10
+ }
11
+ &.current {
12
+ @apply text-white bg-gray-400;
13
+ }
14
+ }
15
+ label {
16
+ @apply inline-block whitespace-nowrap bg-gray-200 rounded-lg px-3 py-0.5;
17
+ input {
18
+ @apply bg-gray-100 border-none rounded-md;
19
+ }
20
+ }
21
+ }
@@ -0,0 +1,29 @@
1
+ .table {
2
+ display: table;
3
+ width: 100%;
4
+ }
5
+ .table-header {
6
+ display: table-header-group;
7
+ width: auto;
8
+ }
9
+
10
+ .cell {
11
+ display: table-cell;
12
+ width: auto;
13
+ clear: both;
14
+ padding: 10px;
15
+ padding-right: 10px;
16
+ font-weight: bold;
17
+ }
18
+
19
+ .table-header > .cell {
20
+ border: 1px solid #aaa;
21
+ }
22
+
23
+ .cell:nth-of-type(even) {
24
+ background-color: #00000080;
25
+ }
26
+
27
+ .cell:nth-of-type(od) {
28
+ background-color: #fff;
29
+ }
@@ -77,6 +77,7 @@ module UcbRailsUser::AuthConcerns
77
77
  @user_session_manager ||= begin
78
78
  logger.debug "creating new user_session_manager"
79
79
  klass = UcbRailsUser[:user_session_manager] || UcbRailsUser::UserSessionManager::ActiveInUserTable
80
+ logger.debug klass.inspect
80
81
  klass.to_s.classify.constantize.new
81
82
  end
82
83
  rescue NameError
@@ -1,5 +1,6 @@
1
1
  module UcbRailsUser::UsersControllerConcerns
2
2
  extend ActiveSupport::Concern
3
+ include Pagy::Backend
3
4
 
4
5
  included do
5
6
  before_action :find_user, :only => [:edit, :update, :destroy]
@@ -8,11 +9,7 @@ module UcbRailsUser::UsersControllerConcerns
8
9
  end
9
10
 
10
11
  def index
11
- @users = UcbRailsUser.user_class.all
12
- respond_to do |format|
13
- format.html { @users = UcbRailsUser.user_class.all }
14
- format.json { render json: UcbRails::UsersDatatable.new(view_context).as_json }
15
- end
12
+ @pagy, @users = pagy(UcbRailsUser.user_class.all, limit: params[:count])
16
13
  end
17
14
 
18
15
  def search
@@ -1,5 +1,6 @@
1
1
  module UcbRailsUser
2
2
  module UsersHelper
3
+ include Pagy::Frontend
3
4
 
4
5
  def link_to_new_user
5
6
  text = 'New User'
@@ -1,17 +1,2 @@
1
- # These methods should be extracted into own gem.
2
1
  module UcbRailsUserHelper
3
-
4
- def ucbr_table_tag(*args)
5
- options = canonicalize_options(args.extract_options!)
6
-
7
- ar_class = args.first
8
- if ar_class.respond_to?(:haml_attributes)
9
- options[:id] ||= ar_class.haml_attributes["id"]
10
- options = ensure_class(options, ar_class.haml_attributes["class"])
11
- end
12
-
13
- bs_table_tag(options) do
14
- yield
15
- end
16
- end
17
2
  end
@@ -0,0 +1,6 @@
1
+ <h1>Home</h1>
2
+
3
+ <p>You are logged in as <%= current_user.full_name %></p>
4
+
5
+ <p><%= link_to "Logout", logout_path %></p>
6
+
@@ -0,0 +1,5 @@
1
+ <h1>Home</h1>
2
+
3
+ <p>You are not logged in</p>
4
+
5
+ <p><%= link_to "Login", login_path() %></p>
@@ -0,0 +1,32 @@
1
+ <h1>Impersonate user</h1>
2
+
3
+ <% if current_user.impersonating? %>
4
+ <div class="clear-impersonation">
5
+ <%= link_to "Stop impersonating #{current_user.impersonation_target.full_name}", admin_stop_impersonation_path, class: "btn btn-primary" %>
6
+ </div>
7
+ <% else %>
8
+ <div class="impersonation-form">
9
+ <%= simple_form_for UcbRailsUser::Impersonation.new, url: admin_impersonations_path, method: :post do |f| %>
10
+ <%= f.input :target, label: "User", input_html: { class: "typeahead" } %>
11
+ <%= f.input :target_id, as: :hidden %>
12
+ <%= f.button :submit, value: "Impersonate", class: "btn btn-primary", disabled: true, data: { impersonate_button: true } %>
13
+ <% end %>
14
+ </div>
15
+ <% end %>
16
+
17
+ <div class="recent-impersonations">
18
+ <% if current_user.recent_impersonations.present? %>
19
+ <h3>Recent impersonations</h3>
20
+ <ul>
21
+ <% current_user.recent_impersonations.each do |imp| %>
22
+ <li>
23
+ <%= link_to full_name_with_uid(imp.target), "#{admin_impersonations_path}?ucb_rails_user_impersonation[target_id]=#{imp.target.id}", method: :post %>
24
+ </li>
25
+ <% end %>
26
+ </ul>
27
+ <% else %>
28
+ <h4>No recent impersonations</h4>
29
+ <% end %>
30
+ </div>
31
+
32
+
@@ -0,0 +1,20 @@
1
+ <%= form_tag('/ucb_rails/ldap_person_search', class: "well form-inline", id: 'lps-form', method: :get, remote: true) do %>
2
+ <%= hidden_field_tag 'search-field-name' %>
3
+ <%= hidden_field_tag 'result-link-http-method' %>
4
+ <%= hidden_field_tag 'result-link-text' %>
5
+ <%= hidden_field_tag 'result-link-class' %>
6
+ <%= hidden_field_tag 'result-link-url' %>
7
+
8
+ <div class="form-group">
9
+ <%= label_tag 'first_name', 'First Name' %>
10
+ <%= text_field_tag 'first_name', nil, class: "form-control" %>
11
+ </div>
12
+
13
+ <div class="form-group">
14
+ <%= label_tag 'last_name', 'Last Name' %>
15
+ <%= text_field_tag 'last_name', nil, class: "form-control" %>
16
+ </div>
17
+
18
+ <%= submit_tag 'Search', id: 'lps-search' %>
19
+ <%= button_to "Clear", "#", id: 'lps-clear', method: :get %>
20
+ <% end %>
@@ -0,0 +1,15 @@
1
+ <%= modal(id: "lps-modal") do %>
2
+ <%= modal_header do %>
3
+ <h3 class="title">Search For Person</h3>
4
+ <%= render partial: "ucb_rails_user/lps/form" %>
5
+ <% end %>
6
+
7
+ <%= modal_body do %>
8
+ <div id="lps-results"></div>
9
+ <% end %>
10
+
11
+ <%= modal_footer do %>
12
+ <div id="matches" class="pull-left"></div>
13
+ <%= modal_footer_close_button %>
14
+ <% end %>
15
+ <% end %>
@@ -0,0 +1,44 @@
1
+ <div class="table-responsive ucb-rails-users-table-wrapper">
2
+ <table class="table table-striped table-bordered table-hover ucb-rails-users-table">
3
+ <thead>
4
+ <tr>
5
+ <th style="width:1%"></th>
6
+ <th>First Name</th>
7
+ <th>Last Name</th>
8
+ <th>Email</th>
9
+ <th>Department</th>
10
+ </tr>
11
+ </thead>
12
+ <tbody>
13
+ <% @lps_entries.each do |entry| %>
14
+ <% entry_id = "ldap_uid_#{entry.uid}" %>
15
+ <tr id="<%= entry_id %>" class="<%= ldap_entry_class(entry) %>">
16
+ <td><%= link_to_ldap_person_entry(entry) %></td>
17
+ <td><%= entry.first_name %></td>
18
+ <td><%= entry.last_name %></td>
19
+ <td><%= entry.email %></td>
20
+ <td><%= entry.departments %></td>
21
+ </tr>
22
+ <% end %>
23
+ </tbody>
24
+ </<table>
25
+ </div>
26
+ <% end %>
27
+
28
+ <script>
29
+ $('#lps-modal table').dataTable({
30
+ "bPaginate": false,
31
+ "bFilter": false,
32
+ "bInfo": false,
33
+ "oLanguage": {
34
+ "sEmptyTable": "No matches for your search."
35
+ },
36
+ "aaSorting": [ [1, "asc"], [2, "asc"] ],
37
+ "aoColumnDefs": [
38
+ { "bSortable": false, "aTargets": [ 0 ] }, // selection link
39
+ { "aDataSort": [ 1, 2 ], "aTargets": [ 1 ] }, // first name
40
+ { "aDataSort": [ 2, 1 ], "aTargets": [ 2 ] }, // last name
41
+ { "aDataSort": [ 3, 1, 2 ], "aTargets": [ 3 ] }, // department
42
+ ]
43
+ });
44
+ </script>
@@ -0,0 +1,5 @@
1
+ <% results = render partial: 'ucb_rails_user/lps/results' %>
2
+ <script>
3
+ $('#lps-results').html('<%= j results %>');
4
+ $('#matches').html('<%= lps_matches %>');
5
+ </script>
@@ -0,0 +1,15 @@
1
+ <%= simple_form_for(@user, url: url, method: method, html: { class: 'form-horizontal' }, wrapper: :horizontal_form) do |f| %>
2
+ <%= f.input :ldap_uid, input_html: { disabled: 'disabled' } %>
3
+ <%= f.input :first_name, input_html: { disabled: 'disabled' } %>
4
+ <%= f.input :last_name, input_html: { disabled: 'disabled' } %>
5
+ <%= f.input :email, input_html: { disabled: 'disabled' } %>
6
+ <%= f.input :alternate_email %>
7
+ <%= f.input :last_login_at, as: :string, input_html: { disabled: 'disabled', value: @user.last_login_at&.strftime("%m/%d/%Y %H:%M:%S") } %>
8
+ <%= f.input :superuser_flag, as: :boolean, label: "Superuser?", wrapper: :horizontal_boolean %>
9
+ <%= f.input :inactive_flag, as: :boolean, label: "Inactive User?", wrapper: :horizontal_boolean %>
10
+
11
+ <div class="form-actions">
12
+ <button type="submit" class="btn btn-primary">Submit</button>
13
+ <%= link_to "Cancel", admin_users_path %>
14
+ </div>
15
+ <% end %>
@@ -0,0 +1,33 @@
1
+ <h3>Search Results</h3>
2
+ <% if @results.empty? %>
3
+ <p>No results matched your search</p>
4
+ <% else %>
5
+ <table class="table table-striped add-user-search-results-table">
6
+ <thead>
7
+ <tr>
8
+ <th>UID</th>
9
+ <th>Employee ID</th>
10
+ <th>First Name</th>
11
+ <th>Last Name</th>
12
+ <th></th>
13
+ </tr>
14
+ </thead>
15
+ <tbody>
16
+ <% @results.each do |person| %>
17
+ <tr>
18
+ <td><%= person.uid %></td>
19
+ <td><%= person.employee_id %></td>
20
+ <td><%= person.first_name %></td>
21
+ <td><%= person.last_name %></td>
22
+ <td>
23
+ <%= form_tag admin_users_path, method: :post do %>
24
+ <%= hidden_field_tag :ldap_uid, person.uid %>
25
+ <%= submit_tag "Add", class: "btn btn-primary" %>
26
+ <% end %>
27
+ </td>
28
+ </tr>
29
+ <% end %>
30
+ </tbody>
31
+ </table>
32
+ <% end %>
33
+
@@ -0,0 +1,18 @@
1
+ <%= turbo_frame_tag "users" do %>
2
+ <tr id="user_<%=user.id%>" class="user">
3
+ <td><%= checkmark(user.superuser?) %></td>
4
+ <td><%= checkmark(user.inactive?) %></td>
5
+ <td><%= user.first_name %></td>
6
+ <td><%= user.last_name %></td>
7
+ <td><%= mail_to(user.email) %></td>
8
+ <td class="dt"><%= user.last_login_at&.strftime("%m/%d/%Y %H:%M:%S") %></td>
9
+ <td class="min"><%= user.ldap_uid %></td>
10
+ <td class="min"><%= user.employee_id %></td>
11
+ <td>
12
+ <%= link_to 'edit', edit_admin_user_path(user), class: 'btn btn-blue', id: dom_id(user, 'edit') %>
13
+ </td>
14
+ <td>
15
+ <%= button_to 'delete', admin_user_path(user), method: :delete, data: { confirm: "Are you sure?" }, class: "btn btn-danger" %>
16
+ </td>
17
+ </tr>
18
+ <% end %>
@@ -0,0 +1,3 @@
1
+ <h1>Edit User</h1>
2
+
3
+ <%= render partial: 'form', locals: { url: admin_user_path(@user), method: :put } %>
@@ -0,0 +1,34 @@
1
+ <div class="ucb-rails-users-table-header clearfix">
2
+ <h1>Users</h1>
3
+ </div>
4
+
5
+ <%= form_with url: "", method: :get, data: { turbo_frame: "users", turbo_action: "advance" } do |form| %>
6
+ Show <%= form.select :count, options_for_select([10, 25, 50, 100], selected: params[:count]), {}, { onchange: "this.form.requestSubmit()" } %>
7
+
8
+ Search <%= form.search_field :query, value: params[:query], oninput: "this.form.requestSubmit()" %>
9
+ <% end %>
10
+
11
+ <div class="table-responsive ucb-rails-users-table-wrapper">
12
+ <table class="table table-striped table-bordered table-hover ucb-rails-users-table">
13
+ <thead>
14
+ <tr>
15
+ <th class="min">Superuser?</th>
16
+ <th class="min">Inactive?</th>
17
+ <th>First Name</th>
18
+ <th>Last Name</th>
19
+ <th>Email</th>
20
+ <th class="dt">Last Login</th>
21
+ <th>UID</th>
22
+ <th>Employee ID</th>
23
+ <th class="min unsorted">Edit</th>
24
+ <th class="min unsorted">Delete</th>
25
+ </tr>
26
+ </thead>
27
+ <tbody class="highlight">
28
+ <%= render partial: "ucb_rails_user/users/user", collection: @users %>
29
+ </tbody>
30
+ </table>
31
+ <div class="ucb-rails-user">
32
+ <%= pagy_nav(@pagy).html_safe %>
33
+ </div>
34
+ </div>
@@ -0,0 +1,19 @@
1
+ <h2>Add New User</h2>
2
+
3
+ <%= form_tag admin_user_search_path, method: :get, remote: true, class: "form-inline user-search-form" do %>
4
+ <%= text_field_tag :first_name, "", placeholder: "First name", class: "form-control" %>
5
+ <%= text_field_tag :last_name, "", placeholder: "Last name", class: "form-control" %>
6
+ <%= text_field_tag :employee_id, "", placeholder: "Employee ID", class: "form-control" %>
7
+ <%= submit_tag "Search", class: "btn btn-primary" %>
8
+ <%= link_to "Cancel", admin_users_path, class: "btn btn-default" %>
9
+ <% end %>
10
+
11
+ <div class="ucb-rails-user-loader">
12
+ Loading...
13
+ </div>
14
+
15
+ <div class="search-results">
16
+ <% if @results %>
17
+ <%= render "results" %>
18
+ <% end %>
19
+ </div>
@@ -0,0 +1,4 @@
1
+ $('.ucb-rails-user-loader').hide();
2
+ $('.search-results').html("<%= j render(partial: 'search_results') %>");
3
+ addDatatablesToNewUserSearchResults();
4
+ $('.search-results').show();
@@ -9,65 +9,9 @@ module UcbRailsUser
9
9
  new(config)
10
10
  end
11
11
 
12
- def initialize(configuration_hash)
13
- return if configuration_hash.nil?
14
- raise(ArgumentError, "expected a Hash, got: #{configuration_hash.inspect}") unless configuration_hash.is_a?(Hash)
15
-
16
- self.hash = configuration_hash
17
- process_configuration
18
- end
19
-
20
- private
21
-
22
- def process_configuration
23
- process_default
24
- process_delivery_method
25
- process_default_url_options
26
- process_raise_delivery_errors
27
- process_sendmail_settings
28
- process_smtp_settings
29
- process_subject_prefix
30
- end
31
-
32
- # This merges values with existing values
33
- def process_default
34
- if hash.has_key?('default')
35
- ActionMailer::Base.default hash['default']
36
- end
37
- end
38
-
39
- def process_delivery_method
40
- ActionMailer::Base.delivery_method = hash.fetch('delivery_method', :smtp).to_sym
41
- end
42
-
43
- def process_default_url_options
44
- if hash.has_key?('default_url_options')
45
- ActionMailer::Base.default_url_options = hash.fetch('default_url_options').symbolize_keys
46
- end
47
- end
48
-
49
- def process_raise_delivery_errors
50
- ActionMailer::Base.raise_delivery_errors = hash.fetch('raise_delivery_errors', true)
51
- end
52
-
53
- def process_sendmail_settings
54
- if hash.has_key?('sendmail_settings')
55
- ActionMailer::Base.sendmail_settings = hash.fetch('sendmail_settings').symbolize_keys
56
- end
57
- end
58
-
59
- def process_smtp_settings
60
- if hash.has_key?('smtp_settings')
61
- ActionMailer::Base.smtp_settings = hash.fetch('smtp_settings').symbolize_keys
62
- end
63
- end
64
-
65
- def process_subject_prefix
66
- prefix = hash.fetch('subject_prefix', '')
67
- prefix = prefix.gsub("{env}", Rails.env)
68
- UcbRailsUser.config.email_subject_prefix = prefix
12
+ def initialize(_configuration_hash)
13
+ puts '***** This is not used anymore. Please use UcbRailsDefaults::Configuration::Email. Configuration will be ignored *****'
69
14
  end
70
15
  end
71
-
72
16
  end
73
17
  end
@@ -1,3 +1,8 @@
1
+ require 'propshaft'
2
+ require 'pagy'
3
+ require 'importmap-rails'
4
+ require 'turbo-rails'
5
+
1
6
  module UcbRailsUser
2
7
  class Engine < ::Rails::Engine
3
8
  config.generators do |g|
@@ -6,6 +11,15 @@ module UcbRailsUser
6
11
  g.fixture_replacement :factory_bot
7
12
  g.factory_bot dir: "spec/factories"
8
13
  end
14
+ initializer "ucb_rails_user.importmap", before: "importmap" do |app|
15
+ # NOTE: this will add pins from this engine to the main app
16
+ # https://github.com/rails/importmap-rails#composing-import-maps
17
+ app.config.importmap.paths << root.join("config/importmap.rb")
18
+
19
+ # NOTE: something about cache; I did not look into it.
20
+ # https://github.com/rails/importmap-rails#sweeping-the-cache-in-development-and-test
21
+ app.config.importmap.cache_sweepers << root.join("app/assets/javascripts")
22
+ end
9
23
  end
10
24
 
11
25
  def self.config(&block)
@@ -1,3 +1,3 @@
1
1
  module UcbRailsUser
2
- VERSION = '7.0.0'
2
+ VERSION = '8.0.0'
3
3
  end
@@ -1,7 +1,5 @@
1
1
  require "ucb_rails_user/engine"
2
2
 
3
- require "haml"
4
- require "haml-rails"
5
3
  require "omniauth"
6
4
  require "omniauth-cas"
7
5
  require "ucb_ldap"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ucb_rails_user
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.0.0
4
+ version: 8.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steve Downey
@@ -9,10 +9,11 @@ authors:
9
9
  - Tyler Minard
10
10
  - Darin Wilson
11
11
  - Brandon Zylstra
12
+ - Chris Chernesky
12
13
  autorequire:
13
14
  bindir: bin
14
15
  cert_chain: []
15
- date: 2024-11-22 00:00:00.000000000 Z
16
+ date: 2025-03-04 00:00:00.000000000 Z
16
17
  dependencies:
17
18
  - !ruby/object:Gem::Dependency
18
19
  name: rails
@@ -20,7 +21,7 @@ dependencies:
20
21
  requirements:
21
22
  - - ">="
22
23
  - !ruby/object:Gem::Version
23
- version: '6.0'
24
+ version: '8.0'
24
25
  - - "<"
25
26
  - !ruby/object:Gem::Version
26
27
  version: '9.0'
@@ -30,44 +31,70 @@ dependencies:
30
31
  requirements:
31
32
  - - ">="
32
33
  - !ruby/object:Gem::Version
33
- version: '6.0'
34
+ version: '8.0'
34
35
  - - "<"
35
36
  - !ruby/object:Gem::Version
36
37
  version: '9.0'
37
38
  - !ruby/object:Gem::Dependency
38
- name: haml
39
+ name: propshaft
39
40
  requirement: !ruby/object:Gem::Requirement
40
41
  requirements:
41
42
  - - ">="
42
43
  - !ruby/object:Gem::Version
43
- version: '5.0'
44
+ version: 1.1.0
44
45
  - - "<"
45
46
  - !ruby/object:Gem::Version
46
- version: '7.0'
47
+ version: '2.0'
47
48
  type: :runtime
48
49
  prerelease: false
49
50
  version_requirements: !ruby/object:Gem::Requirement
50
51
  requirements:
51
52
  - - ">="
52
53
  - !ruby/object:Gem::Version
53
- version: '5.0'
54
+ version: 1.1.0
54
55
  - - "<"
55
56
  - !ruby/object:Gem::Version
56
- version: '7.0'
57
+ version: '2.0'
57
58
  - !ruby/object:Gem::Dependency
58
- name: haml-rails
59
+ name: turbo-rails
59
60
  requirement: !ruby/object:Gem::Requirement
60
61
  requirements:
61
- - - "~>"
62
+ - - ">="
62
63
  - !ruby/object:Gem::Version
63
- version: '2.0'
64
+ version: 2.0.11
65
+ - - "<"
66
+ - !ruby/object:Gem::Version
67
+ version: '3.0'
64
68
  type: :runtime
65
69
  prerelease: false
66
70
  version_requirements: !ruby/object:Gem::Requirement
67
71
  requirements:
68
- - - "~>"
72
+ - - ">="
69
73
  - !ruby/object:Gem::Version
70
- version: '2.0'
74
+ version: 2.0.11
75
+ - - "<"
76
+ - !ruby/object:Gem::Version
77
+ version: '3.0'
78
+ - !ruby/object:Gem::Dependency
79
+ name: importmap-rails
80
+ requirement: !ruby/object:Gem::Requirement
81
+ requirements:
82
+ - - ">="
83
+ - !ruby/object:Gem::Version
84
+ version: 2.0.3
85
+ - - "<"
86
+ - !ruby/object:Gem::Version
87
+ version: '3.0'
88
+ type: :runtime
89
+ prerelease: false
90
+ version_requirements: !ruby/object:Gem::Requirement
91
+ requirements:
92
+ - - ">="
93
+ - !ruby/object:Gem::Version
94
+ version: 2.0.3
95
+ - - "<"
96
+ - !ruby/object:Gem::Version
97
+ version: '3.0'
71
98
  - !ruby/object:Gem::Dependency
72
99
  name: active_attr
73
100
  requirement: !ruby/object:Gem::Requirement
@@ -96,6 +123,20 @@ dependencies:
96
123
  - - ">="
97
124
  - !ruby/object:Gem::Version
98
125
  version: '0'
126
+ - !ruby/object:Gem::Dependency
127
+ name: pagy
128
+ requirement: !ruby/object:Gem::Requirement
129
+ requirements:
130
+ - - "~>"
131
+ - !ruby/object:Gem::Version
132
+ version: 9.3.3
133
+ type: :runtime
134
+ prerelease: false
135
+ version_requirements: !ruby/object:Gem::Requirement
136
+ requirements:
137
+ - - "~>"
138
+ - !ruby/object:Gem::Version
139
+ version: 9.3.3
99
140
  - !ruby/object:Gem::Dependency
100
141
  name: omniauth
101
142
  requirement: !ruby/object:Gem::Requirement
@@ -150,14 +191,14 @@ dependencies:
150
191
  requirements:
151
192
  - - "~>"
152
193
  - !ruby/object:Gem::Version
153
- version: '1.0'
194
+ version: 2.12.1
154
195
  type: :runtime
155
196
  prerelease: false
156
197
  version_requirements: !ruby/object:Gem::Requirement
157
198
  requirements:
158
199
  - - "~>"
159
200
  - !ruby/object:Gem::Version
160
- version: '1.0'
201
+ version: 2.12.1
161
202
  - !ruby/object:Gem::Dependency
162
203
  name: puma
163
204
  requirement: !ruby/object:Gem::Requirement
@@ -228,20 +269,6 @@ dependencies:
228
269
  - - ">="
229
270
  - !ruby/object:Gem::Version
230
271
  version: '0'
231
- - !ruby/object:Gem::Dependency
232
- name: sprockets-rails
233
- requirement: !ruby/object:Gem::Requirement
234
- requirements:
235
- - - ">="
236
- - !ruby/object:Gem::Version
237
- version: '0'
238
- type: :development
239
- prerelease: false
240
- version_requirements: !ruby/object:Gem::Requirement
241
- requirements:
242
- - - ">="
243
- - !ruby/object:Gem::Version
244
- version: '0'
245
272
  - !ruby/object:Gem::Dependency
246
273
  name: capybara
247
274
  requirement: !ruby/object:Gem::Requirement
@@ -317,15 +344,16 @@ files:
317
344
  - app/assets/javascripts/ucb_rails_user/scripts.js
318
345
  - app/assets/javascripts/ucb_rails_user/typeahead.bundle.js
319
346
  - app/assets/javascripts/ucb_rails_user/ucb_rails_user.js
320
- - app/assets/stylesheets/ucb_rails_user/components/_impersonations.sass
321
- - app/assets/stylesheets/ucb_rails_user/components/_loader.sass
322
- - app/assets/stylesheets/ucb_rails_user/components/_users_table.sass
323
- - app/assets/stylesheets/ucb_rails_user/components/index.sass
347
+ - app/assets/stylesheets/ucb_rails_user/components/impersonations.css
348
+ - app/assets/stylesheets/ucb_rails_user/components/loader.css
349
+ - app/assets/stylesheets/ucb_rails_user/components/users_table.css
324
350
  - app/assets/stylesheets/ucb_rails_user/datatables.css
325
351
  - app/assets/stylesheets/ucb_rails_user/index.sass
326
- - app/assets/stylesheets/ucb_rails_user/main.sass
352
+ - app/assets/stylesheets/ucb_rails_user/main.css
353
+ - app/assets/stylesheets/ucb_rails_user/pagy_tailwind.css
327
354
  - app/assets/stylesheets/ucb_rails_user/styles.css
328
355
  - app/assets/stylesheets/ucb_rails_user/typeahead_tweaks.sass
356
+ - app/assets/stylesheets/ucb_rails_user/user.css
329
357
  - app/controllers/concerns/ucb_rails_user/auth_concerns.rb
330
358
  - app/controllers/concerns/ucb_rails_user/home_controller_concerns.rb
331
359
  - app/controllers/concerns/ucb_rails_user/impersonations_controller_concerns.rb
@@ -355,20 +383,20 @@ files:
355
383
  - app/models/ucb_rails_user/user_session_manager/ldap_person_user_wrapper.rb
356
384
  - app/models/ucb_rails_user/user_session_manager/test_session_manager.rb
357
385
  - app/models/ucb_rails_user/user_uc_path_service.rb
358
- - app/views/ucb_rails_user/home/logged_in.html.haml
359
- - app/views/ucb_rails_user/home/not_logged_in.html.haml
360
- - app/views/ucb_rails_user/impersonations/index.html.haml
361
- - app/views/ucb_rails_user/lps/_form.html.haml
362
- - app/views/ucb_rails_user/lps/_modal.html.haml
363
- - app/views/ucb_rails_user/lps/_results.html.haml
364
- - app/views/ucb_rails_user/lps/search.js.haml
365
- - app/views/ucb_rails_user/users/_form.html.haml
366
- - app/views/ucb_rails_user/users/_search_results.html.haml
367
- - app/views/ucb_rails_user/users/_user.html.haml
368
- - app/views/ucb_rails_user/users/edit.html.haml
369
- - app/views/ucb_rails_user/users/index.html.haml
370
- - app/views/ucb_rails_user/users/new.html.haml
371
- - app/views/ucb_rails_user/users/search.js.haml
386
+ - app/views/ucb_rails_user/home/logged_in.html.erb
387
+ - app/views/ucb_rails_user/home/not_logged_in.html.erb
388
+ - app/views/ucb_rails_user/impersonations/index.html.erb
389
+ - app/views/ucb_rails_user/lps/_form.html.erb
390
+ - app/views/ucb_rails_user/lps/_modal.html.erb
391
+ - app/views/ucb_rails_user/lps/_results.html.erb
392
+ - app/views/ucb_rails_user/lps/search.js.erb
393
+ - app/views/ucb_rails_user/users/_form.html.erb
394
+ - app/views/ucb_rails_user/users/_search_results.html.erb
395
+ - app/views/ucb_rails_user/users/_user.html.erb
396
+ - app/views/ucb_rails_user/users/edit.html.erb
397
+ - app/views/ucb_rails_user/users/index.html.erb
398
+ - app/views/ucb_rails_user/users/new.html.erb
399
+ - app/views/ucb_rails_user/users/search.js.erb
372
400
  - config/initializers/simple_form.rb
373
401
  - config/initializers/simple_form_bootstrap.rb
374
402
  - config/locales/simple_form.en.yml
@@ -381,7 +409,6 @@ files:
381
409
  - lib/ucb_rails_user/configuration/cas.rb
382
410
  - lib/ucb_rails_user/configuration/configuration.rb
383
411
  - lib/ucb_rails_user/configuration/email.rb
384
- - lib/ucb_rails_user/configuration/exception_notification.rb
385
412
  - lib/ucb_rails_user/configuration/ldap.rb
386
413
  - lib/ucb_rails_user/engine.rb
387
414
  - lib/ucb_rails_user/spec_helpers.rb
@@ -1,13 +0,0 @@
1
- @media screen and (min-width: 768px)
2
- .impersonation-form
3
- width: 300px
4
-
5
- .recent-impersonations
6
- margin-top: 24px
7
- padding-bottom: 200px
8
-
9
- ul
10
- padding-left: 0px
11
- li
12
- list-style-type: none
13
- font-size: 110%
@@ -1,46 +0,0 @@
1
- .ucb-rails-user-loader,
2
- .ucb-rails-user-loader:after
3
- border-radius: 50%
4
- width: 6em
5
- height: 6em
6
-
7
- .ucb-rails-user-loader
8
- display: none
9
- margin: 60px auto
10
- font-size: 10px
11
- position: relative
12
- text-indent: -9999em
13
- border-top: .8em solid rgba(0,50,97, 0.2)
14
- border-right: .8em solid rgba(0,50,97, 0.2)
15
- border-bottom: .8em solid rgba(0,50,97, 0.2)
16
- border-left: .8em solid #003261
17
- -webkit-transform: translateZ(0)
18
- -ms-transform: translateZ(0)
19
- transform: translateZ(0)
20
- -webkit-animation: load8 1.1s infinite linear
21
- animation: load8 1.1s infinite linear
22
-
23
- @-webkit-keyframes load8
24
- 0%
25
- -webkit-transform: rotate(0deg)
26
- transform: rotate(0deg)
27
-
28
- 100%
29
- -webkit-transform: rotate(360deg)
30
- transform: rotate(360deg)
31
-
32
-
33
- @keyframes load8
34
- 0%
35
- -webkit-transform: rotate(0deg)
36
- transform: rotate(0deg)
37
-
38
- 100%
39
- -webkit-transform: rotate(360deg)
40
- transform: rotate(360deg)
41
-
42
- .ucb-rails-user-loader-small
43
- margin: 16px
44
- font-size: 6px
45
-
46
-
@@ -1,10 +0,0 @@
1
- .ucb-rails-users-table-header
2
- margin-top: 16px
3
- margin-bottom: 16px
4
-
5
- a
6
- margin-top: 16px
7
-
8
- table.ucb-rails-users-table
9
- margin-top: 16px
10
-
@@ -1,3 +0,0 @@
1
- @use "impersonations"
2
- @use "loader"
3
- @use "users_table"
@@ -1,6 +0,0 @@
1
- /* this is here for backwards compatibility - it should be removed in the future */
2
- @import "datatables"
3
- @import "typeahead_tweaks"
4
- @import "components/impersonations"
5
- @import "components/loader"
6
- @import "components/users_table"
@@ -1,5 +0,0 @@
1
- %h1 Home
2
-
3
- %p You are logged in as #{current_user.full_name}
4
-
5
- %p= link_to "Logout", logout_path()
@@ -1,5 +0,0 @@
1
- %h1 Home
2
-
3
- %p You are not logged in.
4
-
5
- %p= link_to "Login", login_path()
@@ -1,20 +0,0 @@
1
- %h1 Impersonate user
2
-
3
- - if current_user.impersonating?
4
- .clear-impersonation
5
- = link_to "Stop impersonating #{current_user.impersonation_target.full_name}", admin_stop_impersonation_path(), class: "btn btn-primary"
6
- - else
7
- .impersonation-form
8
- = simple_form_for UcbRailsUser::Impersonation.new, url: admin_impersonations_path(), method: :post do |f|
9
- = f.input :target, label: "User", input_html: { class: "typeahead" }
10
- = f.input :target_id, as: :hidden
11
- = f.button :submit, value: "Impersonate", class: "btn btn-primary", disabled: true, data: { impersonate_button: true }
12
-
13
- .recent-impersonations
14
- - if current_user.recent_impersonations.present?
15
- %h3 Recent impersonations
16
- %ul
17
- - current_user.recent_impersonations.each do |imp|
18
- %li= link_to full_name_with_uid(imp.target), admin_impersonations_path() + "?ucb_rails_user_impersonation[target_id]=#{imp.target.id}", method: :post
19
- - else
20
- %h4 No recent impersonations
@@ -1,19 +0,0 @@
1
- = form_tag('/ucb_rails/ldap_person_search', :class => "well form-inline", :id => 'lps-form', :method => :get, :remote => true) do
2
-
3
- = hidden_field_tag('search-field-name')
4
- = hidden_field_tag('result-link-http-method')
5
- = hidden_field_tag('result-link-text')
6
- = hidden_field_tag('result-link-class')
7
- = hidden_field_tag('result-link-url')
8
-
9
- .form-group
10
- = label_tag 'first_name', 'First Name'
11
- = text_field_tag("first_name", nil, class: "form-control")
12
-
13
- .form-group
14
- = label_tag 'last_name', 'Last Name'
15
- = text_field_tag("last_name", nil, class: "form-control")
16
-
17
- = submit_button_tag('Search', id: 'lps-search')
18
- = button("Clear", url: "#", :id => 'lps-clear')
19
-
@@ -1,9 +0,0 @@
1
- = modal(id: "lps-modal") do
2
- = modal_header do
3
- %h3.title Search For Person
4
- = render partial: "ucb_rails_user/lps/form"
5
- = modal_body do
6
- #lps-results
7
- = modal_footer do
8
- #matches.pull-left
9
- = modal_footer_close_button
@@ -1,34 +0,0 @@
1
- = ucbr_table_tag(class: 'table-condensed') do
2
- %thead
3
- %tr
4
- %th{style: 'width="1%"'}
5
- %th First Name
6
- %th Last Name
7
- %th Email
8
- %th Department
9
- %tbody
10
- - @lps_entries.each do |entry|
11
- - entry_id = "ldap_uid_#{entry.uid}"
12
- %tr{id: entry_id, class: ldap_entry_class(entry)}
13
- %td= link_to_ldap_person_entry(entry)
14
- %td= entry.first_name
15
- %td= entry.last_name
16
- %td= entry.email
17
- %td= entry.departments
18
-
19
- :javascript
20
- $('#lps-modal table').dataTable({
21
- "bPaginate": false,
22
- "bFilter": false,
23
- "bInfo": false,
24
- "oLanguage": {
25
- "sEmptyTable": "No matches for your search."
26
- },
27
- "aaSorting": [ [1, "asc"], [2, "asc"] ],
28
- "aoColumnDefs": [
29
- { "bSortable": false, "aTargets": [ 0 ] }, // selection link
30
- { "aDataSort": [ 1, 2 ], "aTargets": [ 1 ] }, // first name
31
- { "aDataSort": [ 2, 1 ], "aTargets": [ 2 ] }, // last name
32
- { "aDataSort": [ 3, 1, 2 ], "aTargets": [ 3 ] }, // department
33
- ]
34
- });
@@ -1,3 +0,0 @@
1
- - results = render :partial => 'ucb_rails_user/lps/results'
2
- $('#lps-results').html('#{j results}');
3
- $('#matches').html('#{lps_matches}');
@@ -1,14 +0,0 @@
1
- = simple_form_for(@user, url: url, method: method, :html => {:class => 'form-horizontal'}, wrapper: :horizontal_form) do |f|
2
- = f.input :ldap_uid, :input_html => {disabled: 'disabled'}
3
- = f.input :first_name, :input_html => {disabled: 'disabled'}
4
- = f.input :last_name, :input_html => {disabled: 'disabled'}
5
- = f.input :email, :input_html => {disabled: 'disabled'}
6
- = f.input :alternate_email
7
- = f.input :last_login_at, as: :string, :input_html => {disabled: 'disabled', value: @user.last_login_at&.strftime("%m/%d/%Y %H:%M:%S")}
8
- = f.input :superuser_flag, :as => :boolean, label: "Superuser?", wrapper: :horizontal_boolean
9
- = f.input :inactive_flag, :as => :boolean, :label => "Inactive User?", wrapper: :horizontal_boolean
10
-
11
- .form-actions
12
- %button{type: "submit", class: "btn btn-primary"} Submit
13
- = link_to "Cancel", admin_users_path
14
-
@@ -1,24 +0,0 @@
1
- %h3 Search Results
2
- - if @results.empty?
3
- %p No results matched your search
4
- - else
5
- %table.table.table-striped.add-user-search-results-table
6
- %thead
7
- %tr
8
- %th UID
9
- %th Employee ID
10
- %th First Name
11
- %th Last Name
12
- %th
13
- %tbody
14
- - @results.each do |person|
15
- %tr
16
- %td= person.uid
17
- %td= person.employee_id
18
- %td= person.first_name
19
- %td= person.last_name
20
- %td
21
- = form_tag admin_users_path(), method: :post do
22
- = hidden_field_tag :ldap_uid, person.uid
23
- = submit_tag "Add", class: "btn btn-primary"
24
-
@@ -1,11 +0,0 @@
1
- %tr[user]
2
- %td= checkmark(user.superuser?)
3
- %td= checkmark(user.inactive?)
4
- %td= user.first_name
5
- %td= user.last_name
6
- %td= mail_to(user.email)
7
- %td.dt= user.last_login_at&.strftime("%m/%d/%Y %H:%M:%S")
8
- %td.min= user.ldap_uid
9
- %td.min= user.employee_id
10
- %td= link_to('edit', edit_admin_user_path(user), :class => 'btn btn-info btn-xs', :id => dom_id(user, 'edit'))
11
- %td= button_to 'delete', admin_user_path(user), method: :delete, data: {confirm: "Are you sure?"}, class: "btn btn-danger btn-xs"
@@ -1,3 +0,0 @@
1
- %h1 Edit User
2
-
3
- = render partial: 'form', locals: { url: admin_user_path(@user), method: :put }
@@ -1,22 +0,0 @@
1
- .ucb-rails-users-table-header.clearfix
2
- %h1
3
- Users
4
-
5
- .table-responsive.ucb-rails-users-table-wrapper
6
- %table.table.table-striped.table-bordered.table-hover.ucb-rails-users-table
7
- %thead
8
- %tr
9
- %th.min Superuser?
10
- %th.min Inactive?
11
- %th First Name
12
- %th Last Name
13
- %th Email
14
- %th.dt Last Login
15
- %th UID
16
- %th Employee ID
17
- %th.min.unsorted Edit
18
- %th.min.unsorted Delete
19
- %tbody.highlight
20
- = render partial: "ucb_rails_user/users/user", collection: @users
21
-
22
-
@@ -1,16 +0,0 @@
1
- %h2 Add New User
2
-
3
- = form_tag admin_user_search_path(), method: :get, remote: true, class: "form-inline user-search-form" do
4
- = text_field_tag :first_name, "", placeholder: "First name", class: "form-control"
5
- = text_field_tag :last_name, "", placeholder: "Last name", class: "form-control"
6
- = text_field_tag :employee_id, "", placeholder: "Employee ID", class: "form-control"
7
- = submit_tag "Search", class: "btn btn-primary"
8
- = link_to "Cancel", admin_users_path(), class: "btn btn-default"
9
-
10
- .ucb-rails-user-loader
11
- Loading...
12
-
13
- .search-results
14
- - if @results
15
- = render "results"
16
-
@@ -1,4 +0,0 @@
1
- $('.ucb-rails-user-loader').hide()
2
- $('.search-results').html("#{ j render(partial: "search_results") }")
3
- addDatatablesToNewUserSearchResults()
4
- $('.search-results').show()
@@ -1,21 +0,0 @@
1
- module UcbRailsUser
2
- module Configuration
3
-
4
- class ExceptionNotification
5
-
6
- class << self
7
-
8
- def configure(config)
9
- return if config.blank?
10
-
11
- config = config.symbolize_keys
12
- config[:email].symbolize_keys!
13
- config[:email][:email_prefix] = config[:email][:email_prefix].gsub("{env}", RailsEnvironment.short)
14
-
15
- Rails.application.config.middleware.use ::ExceptionNotification::Rack, config
16
- end
17
- end
18
- end
19
-
20
- end
21
- end