Member index: Show applied org filters (#17977)
* show applied org filters * correct casing
This commit is contained in:
parent
2f029fe896
commit
213fcb956d
2 changed files with 18 additions and 2 deletions
|
|
@ -11,7 +11,19 @@
|
|||
<%= crayons_icon_tag("x.svg", class: "c-pill__action-icon", aria_hidden: true) %>
|
||||
</button>
|
||||
<% end %>
|
||||
<% if params[:roles] %>
|
||||
<% params[:organizations]&.each do |org_id| %>
|
||||
<% org = @organizations.find_by(id: org_id) %>
|
||||
<button
|
||||
data-filter-key="organizations[]"
|
||||
data-filter-value="<%= org_id %>"
|
||||
aria-label="Remove filter: <%= org.name %>"
|
||||
class="c-pill c-pill--action-icon c-pill--action-icon--destructive"
|
||||
type="button">
|
||||
<%= org.name %>
|
||||
<%= crayons_icon_tag("x.svg", class: "c-pill__action-icon", aria_hidden: true) %>
|
||||
</button>
|
||||
<% end %>
|
||||
<% if params[:roles] || params[:organizations] %>
|
||||
<button class="js-clear-filters-btn c-btn" aria-label="Clear all filters">Clear all</button>
|
||||
<% end %>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -33,7 +33,11 @@ describe('Filter user index', () => {
|
|||
|
||||
cy.findByRole('checkbox', { name: 'Admin' }).check();
|
||||
cy.findByRole('checkbox', { name: 'Super Admin' }).check();
|
||||
cy.findByRole('checkbox', { name: 'Tech Admin' }).check();
|
||||
|
||||
cy.findAllByText('Organizations').first().click();
|
||||
cy.findByRole('group', { name: 'Organizations' }).should('be.visible');
|
||||
cy.findByRole('checkbox', { name: 'Bachmanity' }).check();
|
||||
|
||||
cy.findByRole('button', { name: 'Apply filters' }).click();
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue