-
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
NickAkhmetov/CAT-1078 Fix unselectable collections tabs #3688
NickAkhmetov/CAT-1078 Fix unselectable collections tabs #3688
Conversation
This ended up being the fix 😄 |
@@ -11,6 +14,7 @@ function buildCollectionsWithDatasetQuery(datasetUUIDs: string[]): SearchRequest | |||
'datasets.uuid': datasetUUIDs, | |||
}, | |||
}, | |||
_source: ['uuid', 'title', 'hubmap_id', 'datasets'], |
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 everything in datasets
?
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.
I'll revert this, this was a leftover
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.
LGTM, just one question.
<TabPanel value={value} index={index}> | ||
<OutlinedAlert severity="info">The raw dataset is not referenced in any existing collections.</OutlinedAlert> | ||
</TabPanel> | ||
); |
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 pre-existing, but what is the case for this panel being returned? It's my understanding that if the dataset is not referenced by a collection, there shouldn't be any tab present for that dataset.
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.
I've rearranged the logic so that the collections data is fetched once for all datasets on the page, then sorted into buckets by dataset on the client side. The resulting map starts with an empty entry for the raw dataset; all other datasets with no matching collections are not included whatsoever. With this approach, it's known that the only reason why there would be a panel displayed with no collections data to show for it is because it is the primary dataset.
… request dataset uuids
Summary
This PR makes unselectable collections tabs clickable, so that the content of their tab panel changes accordingly.
Design Documentation/Original Tickets
https://hms-dbmi.atlassian.net/browse/CAT-1078
Testing
Manual testing
Screenshots/Video
Screen.Recording.2025-02-11.125752.mp4
Checklist
CHANGELOG-your-feature-name-here.md
is present in the root directory, describing the change(s) in full sentences.