ucb_rails_user 4.0.3 → 4.0.7

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: c9eb42cd87a9e36ca72c3cd6b781205f7a4854acd673b00b784d8a58c2136ea6
4
- data.tar.gz: 75af2810f84a6ab8fc2af39ac6b633de8bf2d746d4cd94a9f77d7808ec92a141
3
+ metadata.gz: 3a8118f9d0b261b1ad04181b2fa0211c30535bedb47b75b1438275b6ef7c5af0
4
+ data.tar.gz: 7eee880cef304680125f21beaffeab8a6c95525beda0bfdb750920ab4c996f2e
5
5
  SHA512:
6
- metadata.gz: 0c8e290178f63d2d1764d6bcc25d1fa2110fbe26cb2c78e8435225e54d757432619542e246cff58232f53926403ea783834d6ff5fe82df5c2fcf67e1f93847aa
7
- data.tar.gz: 38dec97a527ac71b2142e252d42d69a4452a973881011cc090af264d7d27176e731316c01b5ccfc4b17cda1ab699900942a3d0925f591b7b316e4c89442cbf9e
6
+ metadata.gz: 9567b7aa7b943fd70cfe138345d191a84d36a92455e1eb0b6d1d472eb1bc17d09beea6c854804a7e8facea817ed8e2616ece9e27df6dda10bf95fc51e88911b8
7
+ data.tar.gz: 7e074a6ae931a175285882810cede02a0e83d0322d1c50302d2139df7e9230af1891e8015df91e59132cb27071e4e479b30bc1b0cacb1786b93452c2612e4e30
data/README.md CHANGED
@@ -16,7 +16,7 @@ This engine also includes the [Datatables](https://datatables.net/) JQuery plug-
16
16
 
17
17
  Version 2.0 and greater of this gem sets a user's `employee_id` to the new UCPath employee id, rather than the legacy HCM employee id. If you need to use the older ID, use version 1.1.3 of this gem, or lower.
18
18
 
19
- ## Upgrading to version 3.0 from version 2.x
19
+ ## Upgrading to version 3.0+ from version 2.x
20
20
 
21
21
  See [this wiki page](https://github.com/ucb-ist-eas/ucb_rails_user/wiki/Upgrading-to-version-3.0) for details.
22
22
 
@@ -18,11 +18,16 @@ var addDatatablesToSearchResults = function () {
18
18
  }
19
19
 
20
20
  var addDatatablesToUsersTable = function () {
21
+ var unsorted_columns = $('.ucb-rails-users-table th.unsorted').map((i, e) => $(e).index()).toArray()
22
+ if (unsorted_columns === []) {
23
+ var unsorted_columns = $(".ucb-rails-users-table th:contains('Edit'),.ucb-rails-users-table th:contains('Delete')").map((i, e) => $(e).index()).toArray()
24
+ }
25
+
21
26
  $('.ucb-rails-users-table').dataTable({
22
27
  searching: true,
23
28
  order: [[ 3, "asc" ]],
24
29
  columnDefs: [ {
25
- targets: [8, 9],
30
+ targets: unsorted_columns,
26
31
  orderable: false
27
32
  }],
28
33
  })
@@ -2,7 +2,7 @@ module UcbRailsUser::Concerns::HomeController
2
2
  extend ActiveSupport::Concern
3
3
 
4
4
  included do
5
- skip_before_action :ensure_authenticated_user
5
+ skip_before_action :ensure_authenticated_user, raise: false
6
6
  end
7
7
 
8
8
  def index
@@ -2,7 +2,7 @@ module UcbRailsUser::Concerns::SessionsController
2
2
  extend ActiveSupport::Concern
3
3
 
4
4
  included do
5
- skip_before_action :ensure_authenticated_user, :log_request
5
+ skip_before_action :ensure_authenticated_user, :log_request, raise: false
6
6
  end
7
7
 
8
8
  # Redirects to authentication provider
@@ -4,7 +4,7 @@ module UcbRailsUser::Concerns::UsersController
4
4
  included do
5
5
  before_action :find_user, :only => [:edit, :update, :destroy]
6
6
  before_action :ensure_admin_user
7
- skip_before_action :ensure_admin_user, if: ->{ action_name == "toggle_superuser" && Rails.env.development? }
7
+ skip_before_action :ensure_admin_user, if: ->{ action_name == "toggle_superuser" && Rails.env.development? }, raise: false
8
8
  end
9
9
 
10
10
  def index
@@ -76,7 +76,7 @@ module UcbRailsUser::Concerns::UsersController
76
76
  def ldap_search
77
77
  # FIXME: this was retrofitted to support typeahead ajax json queries
78
78
  if(query = params[:query])
79
- @lps_entries = UcbRails::OmniUserTypeahead.new.ldap_results(query)
79
+ @lps_entries = UcbRailsUser::OmniUserTypeahead.new.ldap_results(query)
80
80
  @lps_entries.map!{|entry|
81
81
  attrs = entry.attributes.tap{|attrs| attrs["first_last_name"] = "#{attrs['first_name']} #{attrs['last_name']}" }
82
82
  attrs.as_json
@@ -85,13 +85,14 @@ module UcbRailsUser::Concerns::UsersController
85
85
  render json: @lps_entries
86
86
 
87
87
  else
88
- @lps_entries = UcbRails::LdapPerson::Finder.find_by_first_last(
88
+ @lps_entries = UcbRailsUser::LdapPerson::Finder.find_by_first_last(
89
89
  params.fetch(:first_name),
90
90
  params.fetch(:last_name),
91
91
  :sort => :last_first_downcase
92
92
  )
93
- @lps_existing_uids = User.where(ldap_uid: @lps_entries.map(&:uid)).pluck(:uid)
94
- render 'lps/search'
93
+ uid_strings = @lps_entries.map { |entry| entry.uid&.to_s }.compact
94
+ @lps_existing_uids = User.where(ldap_uid: uid_strings).pluck(:uid)
95
+ render 'ucb_rails_user/lps/search'
95
96
  end
96
97
 
97
98
  end
@@ -14,8 +14,8 @@
14
14
  %th.dt Last Login
15
15
  %th UID
16
16
  %th Employee ID
17
- %th.min Edit
18
- %th.min Delete
17
+ %th.min.unsorted Edit
18
+ %th.min.unsorted Delete
19
19
  %tbody.highlight
20
20
  = render partial: "ucb_rails_user/users/user", collection: @users
21
21
 
data/config/routes.rb CHANGED
@@ -17,6 +17,8 @@ Rails.application.routes.draw do
17
17
  as: "admin_user_search", via: [:get]
18
18
  match "/admin/users/impersonate_search", to: UcbRailsUser::UsersController.action(:impersonate_search),
19
19
  as: "admin_user_impersonate_search", via: [:get]
20
+ match "/admin/users/ldap_search", to: UcbRailsUser::UsersController.action(:ldap_search),
21
+ as: "admin_user_ldap_search", via: [:get]
20
22
  resources :users, controller: "ucb_rails_user/users", path: "admin/users", as: :admin_users
21
23
 
22
24
  resources :impersonations, controller: "ucb_rails_user/impersonations", path: "admin/impersonations", as: :admin_impersonations
@@ -1,3 +1,3 @@
1
1
  module UcbRailsUser
2
- VERSION = '4.0.3'
2
+ VERSION = '4.0.7'
3
3
  end
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: 4.0.3
4
+ version: 4.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steve Downey
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2020-07-09 00:00:00.000000000 Z
14
+ date: 2021-07-14 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: rails