Skip to content
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

Merged
merged 13 commits into from
Mar 4, 2025
Merged

Conversation

austenem
Copy link
Collaborator

@austenem austenem commented Mar 4, 2025

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

Screenshot 2025-03-04 at 11 37 09 AM

Checklist

  • Code follows the project's coding standards
    • Lint checks pass locally
    • New CHANGELOG-your-feature-name-here.md is present in the root directory, describing the change(s) in full sentences.
  • Unit tests covering the new feature have been added
  • All existing tests pass
  • Any relevant documentation in JIRA/Confluence has been updated to reflect the new feature
  • Any new functionalities have appropriate analytics functionalities added

Copy link
Collaborator

@john-conroy john-conroy left a 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.

Comment on lines 44 to 51
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: '' },
Copy link
Collaborator

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.

Copy link
Collaborator

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?

Copy link
Collaborator Author

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.

Comment on lines 317 to 319
if (name.toLowerCase() === 'none') {
return '';
}
Copy link
Collaborator

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?

Copy link
Collaborator Author

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.

Copy link
Collaborator

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.

Comment on lines 166 to 173
const { data } = useSWR<OrganDataProducts[]>(
dataProductsUrl,
(url: string) =>
fetcher({
url,
}),
{ fallbackData: [] },
);
Copy link
Collaborator

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?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good idea!

@austenem austenem requested a review from john-conroy March 4, 2025 23:04
@austenem austenem merged commit 12b527f into main Mar 4, 2025
8 checks passed
@austenem austenem deleted the austenem/cat-1176-add-data-products branch March 4, 2025 23:28
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