From 38a9ac41f7465a4b72172046a0ec7cb490045c13 Mon Sep 17 00:00:00 2001 From: Suzanne Aitchison Date: Wed, 30 Mar 2022 16:59:39 +0100 Subject: [PATCH] Admin member index: initial small screen skeleton layout (#17046) * initial skeleton * tweaks * tweaks to header * Update cypress spec for small screens * nudge Travis --- app/assets/stylesheets/admin.scss | 4 ++ app/views/admin/users/_member_index.html.erb | 45 ++++++++++++++++++- .../adminFlows/users/userIndexView.spec.js | 11 +++-- 3 files changed, 54 insertions(+), 6 deletions(-) diff --git a/app/assets/stylesheets/admin.scss b/app/assets/stylesheets/admin.scss index 7ea6acbd6..cc7305528 100644 --- a/app/assets/stylesheets/admin.scss +++ b/app/assets/stylesheets/admin.scss @@ -35,6 +35,10 @@ label { } } +.member-data-heading { + box-shadow: 0 2px 4px var(--header-shadow); +} + // Member index view search and filter indicators .indicator-btn { .search-indicator { diff --git a/app/views/admin/users/_member_index.html.erb b/app/views/admin/users/_member_index.html.erb index c47a9a8f6..b0fb1cb8d 100644 --- a/app/views/admin/users/_member_index.html.erb +++ b/app/views/admin/users/_member_index.html.erb @@ -1,10 +1,50 @@
-

Members

+

Members

<%= render "admin/users/index/tabs" %>
<%= render "admin/users/index/controls" %> - + + +
+

Members

+
    + <% @users.each do |user| %> +
  • +
    +
    + +
    +

    <%= link_to user.name, admin_user_path(user) %>

    + @<%= user.username %> +
    +
    +
    +
    standing info
    +
    role info
    +
    +
    +
    +
    +
    Last activity
    +
    placeholder
    +
    +
    +
    Joined on
    +
    <%= user.registered_at.strftime("%d %b, %Y") %>
    +
    +
    +
    Orgs info
    +
    +
    +
  • + <% end %> +
+
+ + + +
@@ -21,6 +61,7 @@ <% end %> +
<%= paginate @users, theme: "admin", scope: @users, label: "Paginate users" %> diff --git a/cypress/integration/seededFlows/adminFlows/users/userIndexView.spec.js b/cypress/integration/seededFlows/adminFlows/users/userIndexView.spec.js index 24925a7dc..726a580c6 100644 --- a/cypress/integration/seededFlows/adminFlows/users/userIndexView.spec.js +++ b/cypress/integration/seededFlows/adminFlows/users/userIndexView.spec.js @@ -28,8 +28,8 @@ describe('User index view', () => { cy.findByRole('button', { name: 'Search' }).click(); - // The table headers consistitute a row, plus one result - cy.findAllByRole('row').should('have.length', 2); + // Coreect search result should appear + cy.findByRole('heading', { name: 'Admin McAdmin' }).should('exist'); }); it('Filters for a user', () => { @@ -41,8 +41,11 @@ describe('User index view', () => { cy.findByRole('combobox', { name: 'User role' }).select('super_admin'); cy.findByRole('button', { name: 'Filter' }).click(); - // Table header, 'normal' admin and apple auth admin - cy.findAllByRole('row').should('have.length', 3); + // Search results should include these two results + cy.findByRole('heading', { name: 'Admin McAdmin' }).should('exist'); + cy.findByRole('heading', { name: 'Apple Auth Admin User' }).should( + 'exist', + ); }); it('Prevents both search and filter widgets being visible at the same time', () => {