Skip to content

Commit

Permalink
Merge pull request #2999 from bitzesty/role-col
Browse files Browse the repository at this point in the history
Remove 'Role' filter from Users table, make it a static heading
  • Loading branch information
DaniBitZesty committed Jul 11, 2024
2 parents a67aeba + 1174682 commit 8820c79
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 32 deletions.
7 changes: 1 addition & 6 deletions app/search/user_search.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
class UserSearch < Search
DEFAULT_SEARCH = {
sort: "full_name",
search_filter: {
role: User.role.values,
},
}
DEFAULT_SEARCH = { sort: "full_name" }

include FullNameSort
end
28 changes: 2 additions & 26 deletions app/views/admin/users/_list.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -9,32 +9,8 @@
= sort_link f, 'Email', @search, :email
th.sortable
= sort_link f, 'Company', @search, :company_name
th.filter
- role_names = { "account_admin" => "Admin and collaborator", "regular" => "Collaborator only" }
= f.simple_fields_for [:filters, @search.filters] do |f|
- role_collection = User.role.options.map{ |role| [role_names[role[1]], role[1]] }
= f.input :role, collection: role_collection, label: false, input_html: {multiple: true, class: 'if-js-hide', aria: { label: "Search applications" } }
= f.submit "Filter", class: "if-js-hide"
label.if-js-hide Ctrl + left click for multi select
.dropdown.if-no-js-hide
button.btn.btn-default.dropdown-toggle type="button" data-toggle="dropdown" aria-expanded="true"
' Role:
span.text-filter
' All
span.caret
ul.dropdown-menu role="menu"
li.checkbox role="menuitem"
label data-value="select_all"
input type="checkbox"
span.label-contents
em Select all
li.divider
- User.role.options.each do |role|
li.checkbox role="menuitem"
label data-value=role[1]
input type="checkbox"
span.label-contents
= role_names[role[1]]
th
' Role
th.sortable
= sort_link f, 'Signed in on', @search, :last_sign_in_at
th.sortable
Expand Down

0 comments on commit 8820c79

Please sign in to comment.