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

[ENH] Made dataset name hyperlink to dataset PortalURI #411

Merged
merged 7 commits into from
Dec 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions cypress/component/ResultCard.cy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const props = {
nodeName: 'some node name',
datasetUUID: 'some uuid',
datasetName: 'some dataset name',
datasetPortalURI: 'some portal uri',
datasetTotalSubjects: 10,
numMatchingSubjects: 5,
imageModals: [
Expand All @@ -27,6 +28,7 @@ describe('ResultCard', () => {
nodeName={props.nodeName}
datasetUUID={props.datasetUUID}
datasetName={props.datasetName}
datasetPortalURI={props.datasetPortalURI}
datasetTotalSubjects={props.datasetTotalSubjects}
numMatchingSubjects={props.numMatchingSubjects}
imageModals={props.imageModals}
Expand Down Expand Up @@ -61,6 +63,7 @@ describe('ResultCard', () => {
nodeName={props.nodeName}
datasetUUID={props.datasetUUID}
datasetName={props.datasetName}
datasetPortalURI={props.datasetPortalURI}
datasetTotalSubjects={props.datasetTotalSubjects}
numMatchingSubjects={props.numMatchingSubjects}
imageModals={props.imageModals}
Expand All @@ -78,6 +81,7 @@ describe('ResultCard', () => {
nodeName={props.nodeName}
datasetUUID={props.datasetUUID}
datasetName={props.datasetName}
datasetPortalURI={props.datasetPortalURI}
datasetTotalSubjects={props.datasetTotalSubjects}
numMatchingSubjects={props.numMatchingSubjects}
imageModals={props.imageModals}
Expand Down
23 changes: 22 additions & 1 deletion src/components/ResultCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const ResultCard = memo(
nodeName,
datasetUUID,
datasetName,
datasetPortalURI,
datasetTotalSubjects,
numMatchingSubjects,
imageModals,
Expand All @@ -24,6 +25,7 @@ const ResultCard = memo(
nodeName: string;
datasetName: string;
datasetUUID: string;
datasetPortalURI: string;
datasetTotalSubjects: number;
numMatchingSubjects: number;
imageModals: string[];
Expand All @@ -45,7 +47,26 @@ const ResultCard = memo(
/>
</div>
<div>
<Typography variant="h5">{datasetName}</Typography>
{datasetPortalURI ? (
<a
href={datasetPortalURI}
target="_blank"
rel="noopener noreferrer"
style={{ textDecoration: 'none' }}
>
<Typography
variant="h5"
sx={{
color: 'primary.main',
}}
>
{datasetName}
</Typography>
</a>
) : (
<Typography variant="h5">{datasetName}</Typography>
)}

<Typography variant="subtitle1">from {nodeName}</Typography>
<Typography variant="subtitle2">
{numMatchingSubjects} subjects match / {datasetTotalSubjects} total subjects
Expand Down
1 change: 1 addition & 0 deletions src/components/ResultContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,7 @@ function ResultContainer({
nodeName={item.node_name}
datasetUUID={item.dataset_uuid}
datasetName={item.dataset_name}
datasetPortalURI={item.dataset_portal_uri}
datasetTotalSubjects={item.dataset_total_subjects}
numMatchingSubjects={item.num_matching_subjects}
imageModals={item.image_modals}
Expand Down
Loading