Skip to content

Commit

Permalink
# This is a combination of 4 commits.
Browse files Browse the repository at this point in the history
# This is the 1st commit message:

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.
  • Loading branch information
forresttanaka committed Aug 1, 2022
1 parent 8885aca commit ed9c647
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 7 deletions.
2 changes: 1 addition & 1 deletion cypress/integration/app.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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");
});
Expand Down
28 changes: 22 additions & 6 deletions pages/users/[uuid].js
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,34 @@ const User = ({ lab, user }) => {
<PagePreamble />
<DataPanel>
<DataArea>
<DataItemLabel>Status</DataItemLabel>
<DataItemValue>
<Status status={user.status} />
</DataItemValue>
<DataItemLabel>Job Title</DataItemLabel>
<DataItemValue>{user.job_title}</DataItemValue>
{user.status && (
<>
<DataItemLabel>Status</DataItemLabel>
<DataItemValue>
<Status status={user.status} />
</DataItemValue>
</>
)}
{user.job_title && (
<>
<DataItemLabel>Job Title</DataItemLabel>
<DataItemValue>{user.job_title}</DataItemValue>
</>
)}
<DataItemLabel>Lab</DataItemLabel>
<DataItemValue>
<Link href={lab["@id"]}>
<a>{lab.title}</a>
</Link>
</DataItemValue>
{user.email && (
<>
<DataItemLabel>Email</DataItemLabel>
<DataItemValue>
<a href={`mailto:${user.email}`}>{user.email}</a>
</DataItemValue>
</>
)}
</DataArea>
</DataPanel>
</EditableItem>
Expand Down
1 change: 1 addition & 0 deletions pages/users/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ const UserList = ({ users }) => {
{users.map((user) => (
<CollectionItem
key={user.uuid}
testid={user.uuid}
href={user["@id"]}
label={`User ${user.name}`}
status={user.status}
Expand Down

0 comments on commit ed9c647

Please sign in to comment.