Skip to content

Commit d9d4175

Browse files
frano-mclaude
andauthored
feat: optionally add logos on exports list (#4741) (#4752)
* feat: optionally add logos on exports list (#4741) * fix: viewbuilder types to include icon in component props (#4741) * fix: rename icon component to export icon (#4741) * fix: update e2e card locator to use MuiPaper ancestor and CardActionArea (#4741) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Fran McDade <18710366+frano-m@users.noreply.github.com> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent ec6aae6 commit d9d4175

File tree

13 files changed

+41
-11
lines changed

13 files changed

+41
-11
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { StaticImage } from "@databiosphere/findable-ui/lib/components/common/StaticImage/staticImage";
2+
import type { ComponentProps, JSX } from "react";
3+
4+
/**
5+
* Icon component that wraps the StaticImage component.
6+
* @param props - Component props.
7+
* @returns JSX element representing the icon.
8+
*/
9+
export const ExportIcon = (
10+
props: ComponentProps<typeof StaticImage>
11+
): JSX.Element => {
12+
return <StaticImage {...props} />;
13+
};

app/viewModelBuilders/azul/anvil-cmg/common/viewModelBuilders.tsx

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ import {
3939
FadeProps as MFadeProps,
4040
Tooltip,
4141
} from "@mui/material";
42-
import { ExportEntity } from "app/components/Export/components/AnVILExplorer/components/ExportEntity/exportEntity";
4342
import React, { ComponentProps, ReactNode } from "react";
4443
import {
4544
ANVIL_CMG_CATEGORY_KEY,
@@ -104,6 +103,8 @@ import * as C from "../../../../components";
104103
import * as MDX from "../../../../components/common/MDXContent/anvil-cmg";
105104
import { RequestAccess } from "../../../../components/Detail/components/AnVILCMG/components/RequestAccess/requestAccess";
106105
import { Description } from "../../../../components/Detail/components/MDX/components/Description/description";
106+
import { ExportEntity } from "../../../../components/Export/components/AnVILExplorer/components/ExportEntity/exportEntity";
107+
import { ExportIcon } from "../../../../components/Export/components/AnVILExplorer/components/ExportMethod/components/ExportIcon/exportIcon";
107108
import { METADATA_KEY } from "../../../../components/Index/common/entities";
108109
import { getPluralizedMetadataLabel } from "../../../../components/Index/common/indexTransformer";
109110
import { SUMMARY_DISPLAY_TEXT } from "./summaryMapper/constants";
@@ -472,6 +473,7 @@ export const buildDatasetExportMethodManifestDownload = (
472473
return {
473474
description:
474475
"Download a TSV manifest containing metadata for all data files in the dataset.",
476+
icon: <ExportIcon alt="Manifest" src="/export/manifest.webp" width={24} />,
475477
route: `${datasetPath}${ROUTES.MANIFEST_DOWNLOAD}`,
476478
title: "Download TSV Manifest",
477479
};
@@ -505,6 +507,7 @@ export const buildDatasetExportMethodTerra = (
505507
return {
506508
description:
507509
"Terra is a biomedical research platform to analyze data using workflows, Jupyter Notebooks, RStudio, and Galaxy.",
510+
icon: <ExportIcon alt="Terra" src="/export/terra.webp" width={24} />,
508511
route: `${datasetPath}${ROUTES.TERRA}`,
509512
title: "Export to Terra",
510513
};
@@ -534,6 +537,7 @@ export const buildDatasetExportMethodCurlCommand = (
534537
return {
535538
description:
536539
"Generate a curl command to download all files in this open-access dataset.",
540+
icon: <ExportIcon alt="curl" src="/export/curl.webp" width={24} />,
537541
route: `${datasetPath}${ROUTES.CURL_DOWNLOAD}`,
538542
title: "Download Open-Access Data Files (No Data Transfer Fees)",
539543
};
@@ -620,7 +624,7 @@ export const buildDatasetExportToPlatformMethod = ({
620624
...props
621625
}: Pick<
622626
ComponentProps<typeof ExportMethod>,
623-
"description" | "route" | "title"
627+
"description" | "icon" | "route" | "title"
624628
>): ((
625629
response: DatasetsResponse,
626630
viewContext: ViewContext<unknown>
@@ -887,6 +891,7 @@ export const buildExportMethodManifestDownload = (
887891
...getExportMethodAccessibility(viewContext),
888892
description:
889893
"Download a TSV manifest containing metadata for all data files in the current selection, including managed-access files.",
894+
icon: <ExportIcon alt="Manifest" src="/export/manifest.webp" width={24} />,
890895
route: ROUTES.MANIFEST_DOWNLOAD,
891896
title: "Download TSV Manifest for All Selected Data Files",
892897
};
@@ -906,6 +911,7 @@ export const buildExportMethodTerra = (
906911
...getExportMethodAccessibility(viewContext),
907912
description:
908913
"Terra is a biomedical research platform to analyze data using workflows, Jupyter Notebooks, RStudio, and Galaxy.",
914+
icon: <ExportIcon alt="Terra" src="/export/terra.webp" width={24} />,
909915
route: ROUTES.TERRA,
910916
title: "Export to Terra",
911917
};
@@ -956,6 +962,7 @@ export const buildExportMethodBulkDownload = (
956962
files in the current selection.
957963
</div>
958964
),
965+
icon: <ExportIcon alt="curl" src="/export/curl.webp" width={24} />,
959966
route: ROUTES.CURL_DOWNLOAD,
960967
title: "Download Open-Access Data Files (No Data Transfer Fees)",
961968
};
@@ -1059,7 +1066,7 @@ export const buildExportToPlatformHero = (
10591066
export const buildExportToPlatformMethod = (
10601067
props: Pick<
10611068
ComponentProps<typeof ExportMethod>,
1062-
"description" | "route" | "title"
1069+
"description" | "icon" | "route" | "title"
10631070
>
10641071
): ((
10651072
_: unknown,

e2e/anvil/anvil-dataset.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,8 @@ describe("Dataset", () => {
176176
*/
177177
async function clickCard(page: Page, headingText: string): Promise<void> {
178178
await getHeadingWithText(page, headingText)
179-
.locator("xpath=ancestor::a")
179+
.locator("xpath=ancestor::*[contains(@class,'MuiPaper-root')]")
180+
.locator(".MuiCardActionArea-root")
180181
.click();
181182
}
182183

e2e/testFunctions.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1199,7 +1199,9 @@ export async function testPaginationContent(
11991199
* @returns - Playwright locator object for the card with the given heading text.
12001200
*/
12011201
function getCard(page: Page, headingText: string): Locator {
1202-
return getHeadingWithText(page, headingText).locator("xpath=ancestor::a");
1202+
return getHeadingWithText(page, headingText)
1203+
.locator("xpath=ancestor::*[contains(@class,'MuiPaper-root')]")
1204+
.locator(".MuiCardActionArea-root");
12031205
}
12041206

12051207
/**

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"check-system-status:anvil-cmg": "esrun e2e/anvil/anvil-check-system-status.ts"
3333
},
3434
"dependencies": {
35-
"@databiosphere/findable-ui": "^50.4.0",
35+
"@databiosphere/findable-ui": "^50.5.0",
3636
"@emotion/react": "^11",
3737
"@emotion/styled": "^11",
3838
"@mdx-js/loader": "^3",

public/export/bdc.webp

690 Bytes
Loading

public/export/cavatica.webp

5.34 KB
Loading

public/export/cgc.webp

2.27 KB
Loading

public/export/curl.webp

528 Bytes
Loading

0 commit comments

Comments
 (0)