From ed9c647e9fce86eae1df8d8df52a6f9cbd21030a Mon Sep 17 00:00:00 2001 From: forresttanaka Date: Mon, 1 Aug 2022 09:31:08 -0700 Subject: [PATCH] # This is a combination of 4 commits. # This is the 1st commit message: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Commit Log * Use the collection components common to all other collection pages on the users collection page. We still need to wait for the collection report page ticket to get merged before we finish this. * Update the individual user page to show more data. # This is the commit message #2: IGVF-28-users Use the rename “lib” directory instead of “libs.” Remove reminder note from app.spec.js. Add table view to users collection page. # This is the commit message #3: IGVF-28-users The user object while not signed in has a lot of missing properties. Make these conditional on the user object page. # This is the commit message #4: IGVF-28-users Add the new testid property in call to CollectionItem on user collection page. --- cypress/integration/app.spec.js | 2 +- pages/users/[uuid].js | 28 ++++++++++++++++++++++------ pages/users/index.js | 1 + 3 files changed, 24 insertions(+), 7 deletions(-) diff --git a/cypress/integration/app.spec.js b/cypress/integration/app.spec.js index 44f6ff160..796e9f8dc 100644 --- a/cypress/integration/app.spec.js +++ b/cypress/integration/app.spec.js @@ -75,10 +75,10 @@ describe("Navigation", () => { cy.url().should("include", "/treatments"); cy.get("[data-testid=collection-view-switch]").should("exist"); - // Add a collection-view switch test once the user page has one. cy.get("[data-testid=users]").click(); cy.url().should("include", "/users"); cy.get("[data-testid=collection-view-switch]").should("exist"); + cy.get("[data-testid=profiles]").click(); cy.url().should("include", "/profiles"); }); diff --git a/pages/users/[uuid].js b/pages/users/[uuid].js index 85f76c839..6f7c41c39 100644 --- a/pages/users/[uuid].js +++ b/pages/users/[uuid].js @@ -25,18 +25,34 @@ const User = ({ lab, user }) => { - Status - - - - Job Title - {user.job_title} + {user.status && ( + <> + Status + + + + + )} + {user.job_title && ( + <> + Job Title + {user.job_title} + + )} Lab {lab.title} + {user.email && ( + <> + Email + + {user.email} + + + )} diff --git a/pages/users/index.js b/pages/users/index.js index cb8200ee2..b0d34dda0 100644 --- a/pages/users/index.js +++ b/pages/users/index.js @@ -30,6 +30,7 @@ const UserList = ({ users }) => { {users.map((user) => (