docbrown/app/views/admin/users/index/_controls.html.erb
Ridhwana d9ca26b521
DO NOT MERGE: Remove the Member Index View Feature Flags + old code (#17388)
* feat: remove feature flag on the member index view and re-arrange some partials

* feat: remove Feature Flag for the invitations view

* feat: remove Feature Flag for the gdpr view

* feat: remove Feature Flag for the controls

* feat: remove the feature flag in the tests

* remove extra queries that we no longer use

* Update app/views/admin/invitations/index.html.erb

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

* Update app/views/admin/invitations/index.html.erb

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

* Update app/views/admin/users/index/_controls.html.erb

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

* Update app/views/admin/users/gdpr_delete_requests/index.html.erb

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

* Update cypress/integration/seededFlows/adminFlows/users/userIndexView.spec.js

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

* Update cypress/integration/seededFlows/adminFlows/users/userIndexView.spec.js

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

* Update app/views/admin/users/gdpr_delete_requests/index.html.erb

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

* feat: attempt to fix Cypress test

* fix: soem other cypress tests

* fix: search bar

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
2022-04-25 14:49:34 +02:00

44 lines
2.3 KiB
Text

<%= javascript_packs_with_chunks_tag "admin/users/controls", defer: true %>
<% if params[:controller] == "admin/users" %>
<!-- Small screen layout -->
<%= form_with url: admin_users_path, method: :get, local: true, class: "m:hidden" do |f| %>
<div class="flex justify-between align-items-center my-3">
<div>
<%= render "admin/users/controls/expand_search_button" %>
<button type="button" id="expand-filter-btn" class="c-btn c-btn--icon-alone indicator-btn" aria-label="Expand filter" aria-expanded="false" aria-controls="filter-users">
<%= crayons_icon_tag("filter", aria_hidden: true) %>
<span data-testid="search-indicator" class="search-indicator absolute top-1 right-1 c-indicator c-indicator--info <%= params[:role].blank? ? "hidden" : "" %>"></span>
</button>
</div>
<div class="flex">
<%= paginate @users, theme: "admin", scope: @users, label: "Paginate users", context: "small" %>
<%= render "admin/users/controls/export" %>
</div>
</div>
<div>
<div id="search-users" class="hidden">
<%= render "admin/users/controls/search_field", f: f, context: "small", placeholder: "Search member...", aria_label: "Search member by name, or username" %>
</div>
<div id="filter-users" class="hidden crayons-field flex-row items-center gap-2">
<%= render "admin/users/controls/filter_role_field", f: f, context: "small" %>
</div>
</div>
<% end %>
<!-- Larger screen layout -->
<div class="hidden m:flex justify-between align-items-center">
<%= form_with url: admin_users_path, method: :get, local: true, class: "flex flex-col m:flex-row gap-3 m:items-center py-3" do |f| %>
<div class="crayons-field flex-1 flex-row items-center gap-2">
<%= render "admin/users/controls/search_field", f: f, context: "medium", placeholder: "Search member...", aria_label: "Search member by name, or username" %>
</div>
<div class="crayons-field flex-row items-center gap-2">
<%= render "admin/users/controls/filter_role_field", f: f, context: "medium" %>
</div>
<% end %>
<div class="flex">
<%= paginate @users, theme: "admin", scope: @users, label: "Paginate users", context: "medium" %>
<%= render "admin/users/controls/export" %>
</div>
</div>
<% end %>