Skip to content

Add UserVisits component - #179

Open
jessicavers wants to merge 4 commits into
mainfrom
visit-component
Open

jessicavers wants to merge 4 commits into
mainfrom
visit-component

Conversation

@jessicavers

Copy link
Copy Markdown
Collaborator

Makes use of OptionSelect and a query to retrieve the current users five most recent visits

} from "./__generated__/UserVisits.generated";
import type { Option } from "../../types/workflowFields";

const GET_USER_VISITS: TypedDocumentNode<

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The query here currently returns all instrument sessions for the active user. If the number of sessions is a certain length, this could lengthen the response time and be returning unneeded session information. Pagination or an alternative could be used to prevent that.

The list is later sorted by start date in data/utils, and the most recent five items are presented in the UI component.

Using instrumentSessions(first: 5) would be a possibility, however, it appears to only take into account the first instrumentSessionNumber.

@yousefmoazzam yousefmoazzam left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks!

Only the snake case to camel case suggestion I think is necessary to address, the other two comments I made are less important, feel free to leave them if desired.

Comment thread frontend/i14/src/components/workflows/UserVisits.tsx Outdated
Comment thread frontend/i14/src/components/workflows/UserVisits.tsx
Comment thread frontend/i14/src/components/workflows/UserVisits.tsx Outdated

@yousefmoazzam yousefmoazzam left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, thanks for sorting out the casing of the variable name!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants