-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Austenem/CAT-1176 Add data products #3703
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, a couple of comments, but nothing major. If you agree they are worth addressing, we could file issues to tackle them later.
headerCells={[ | ||
{ headerId: 'organ', label: 'Organ' }, | ||
{ headerId: 'assay-type', label: 'Assay Type' }, | ||
{ headerId: 'raw-download', label: 'Raw Download' }, | ||
{ headerId: 'processed-download', label: 'Processed Download' }, | ||
{ headerId: 'shiny-app', label: 'Shiny App' }, | ||
{ headerId: 'creation-date', label: 'Creation Date' }, | ||
{ headerId: '', label: '' }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could pull the header cells definition outside of the component since it doesn't depend on other state/prop variables.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, do we need a something to identify the last cell for accessibility?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good point - I think adding a distinct ID and an aria-label
would help contextualize the column.
if (name.toLowerCase() === 'none') { | ||
return ''; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this logic specific to the data products or do we expect "None" elsewhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is specific to the data products as that's the placeholder they use. This could potentially be expanded into an array of placeholders to check against (like ['none', 'na', ...]
), if this helper is used in other places that expect something different.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because this is in the top level utils, you would expect it to be generalized for use throughout the application. You could either handle cases via additional params or just add a function located closer to the data products which calls this function then handles the case.
const { data } = useSWR<OrganDataProducts[]>( | ||
dataProductsUrl, | ||
(url: string) => | ||
fetcher({ | ||
url, | ||
}), | ||
{ fallbackData: [] }, | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to return isLoading
to handle loading state and avoid layout shift?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea!
Summary
Adds a data products section to Organ pages, incorporating the CMU data products API into the portal ui.
Design Documentation/Original Tickets
CAT-1176 Jira ticket
Screenshots/Video
Checklist
CHANGELOG-your-feature-name-here.md
is present in the root directory, describing the change(s) in full sentences.