Skip to content

Commit ef92ca2

Browse files
Fran McDadeFran McDade
authored andcommitted
feat: download search results via curl (#3243)
1 parent f092661 commit ef92ca2

File tree

10 files changed

+125
-9
lines changed

10 files changed

+125
-9
lines changed

explorer/app/components/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ export { ExportSummary } from "@clevercanary/data-explorer-ui/lib/components/Exp
3434
export { ExportToTerraForm } from "@clevercanary/data-explorer-ui/lib/components/Export/components/ExportToTerra/components/ExportToTerraForm/exportToTerraForm";
3535
export { TerraSetUpForm } from "@clevercanary/data-explorer-ui/lib/components/Export/components/ExportToTerra/components/TerraSetUpForm/terraSetUpForm";
3636
export { ExportToTerra } from "@clevercanary/data-explorer-ui/lib/components/Export/components/ExportToTerra/exportToTerra";
37+
export { ManifestDownloadForm } from "@clevercanary/data-explorer-ui/lib/components/Export/components/ManifestDownload/components/ManifestDownloadForm/manifestDownloadForm";
38+
export { ManifestDownload } from "@clevercanary/data-explorer-ui/lib/components/Export/components/ManifestDownload/manifestDownload";
3739
export { AzulFileDownload } from "@clevercanary/data-explorer-ui/lib/components/Index/components/AzulFileDownload/azulFileDownload";
3840
export { Cell } from "@clevercanary/data-explorer-ui/lib/components/Index/components/Cell/cell";
3941
export { Summaries } from "@clevercanary/data-explorer-ui/lib/components/Index/components/Hero/components/Summaries/summaries";

explorer/app/content/hca-dcp/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,6 @@ export { default as DownloadCurlCommandStart } from "./downloadCurlCommandStart.
1313
export { default as DownloadCurlCommandSuccess } from "./downloadCurlCommandSuccess.mdx";
1414
export { default as ExportToTerraStart } from "./exportToTerraStart.mdx";
1515
export { default as ExportToTerraSuccessWithWarning } from "./exportToTerraSuccessWithWarning.mdx";
16+
export { default as ManifestDownloadStart } from "./manifestDownloadStart.mdx";
17+
export { default as ManifestDownloadSuccess } from "./manifestDownloadSuccess.mdx";
1618
export { default as MatrixQuestionnaire } from "./matrixQuestionnaire.mdx";
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
### Confirm Species Selection and Select Manifest File Types
2+
3+
Please explicitly select at least one species and file type for inclusion in the manifest.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { BatchCorrectionWarning } from "../../components/Export/components/BatchCorrectionWarning/batchCorrectionWarning";
2+
3+
### Your File Manifest is Ready
4+
5+
<BatchCorrectionWarning
6+
label={"Matrix Normalization and Batch Correction"}
7+
url={
8+
"https://data.humancellatlas.org/guides/consumer-vignettes/matrices#matrix-normalization-and-batch-correction"
9+
}
10+
/>
11+
12+
This link expires in 7 days.

explorer/app/viewModelBuilders/azul/hca-dcp/common/viewModelBuilders.ts

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ import { PROJECTS_URL } from "../../../../../site-config/hca-dcp/dev/config";
5252
import {
5353
ROUTE_BULK_DOWNLOAD,
5454
ROUTE_EXPORT_TO_TERRA,
55+
ROUTE_MANIFEST_DOWNLOAD,
5556
} from "../../../../../site-config/hca-dcp/dev/export/constants";
5657
import {
5758
processAggregatedOrArrayValue,
@@ -562,6 +563,23 @@ export const buildExportMethodHeroCurlCommand = (
562563
return getExportMethodHero(tabValue, title);
563564
};
564565

566+
/**
567+
* Build props for manifest download Hero component.
568+
* @param _ - Unused.
569+
* @param viewContext - View context.
570+
* @returns model to be used as props for the Hero component.
571+
*/
572+
export const buildExportMethodHeroManifestDownload = (
573+
_: Unused,
574+
viewContext: ViewContext
575+
): React.ComponentProps<typeof C.BackPageHero> => {
576+
const title = "Request File Manifest";
577+
const {
578+
exploreState: { tabValue },
579+
} = viewContext;
580+
return getExportMethodHero(tabValue, title);
581+
};
582+
565583
/**
566584
* Build props for export to terra Hero component.
567585
* @param _ - Unused.
@@ -579,6 +597,21 @@ export const buildExportMethodHeroTerra = (
579597
return getExportMethodHero(tabValue, title);
580598
};
581599

600+
/**
601+
* Build props for ExportMethod component for display of the manifest download section.
602+
* @returns model to be used as props for the ExportMethod component.
603+
*/
604+
export const buildExportMethodManifestDownload = (): React.ComponentProps<
605+
typeof C.ExportMethod
606+
> => ({
607+
buttonLabel: "Request File Manifest",
608+
description:
609+
"Request a file manifest for the current query containing the full list of selected files and the metadata for each file.",
610+
disabled: false,
611+
route: ROUTE_MANIFEST_DOWNLOAD,
612+
title: "Download a File Manifest with Metadata for the Selected Data",
613+
});
614+
582615
/**
583616
* Build props for ExportMethod component for display of the export to terra section.
584617
* @returns model to be used as props for the ExportMethod component.
@@ -797,6 +830,34 @@ export const buildLibraryConstructionApproach = (
797830
};
798831
};
799832

833+
/**
834+
* Build props for ManifestDownload component.
835+
* @param _ - Unused.
836+
* @param viewContext - View context.
837+
* @returns model to be used as props for the ManifestDownload component.
838+
*/
839+
export const buildManifestDownload = (
840+
_: Unused,
841+
viewContext: ViewContext
842+
): React.ComponentProps<typeof C.ManifestDownload> => {
843+
const {
844+
exploreState: { filterState },
845+
fileManifestState,
846+
} = viewContext;
847+
// Get the form facets.
848+
const formFacet = getFormFacets(fileManifestState);
849+
return {
850+
ManifestDownloadForm: C.ManifestDownloadForm,
851+
ManifestDownloadStart: MDX.ManifestDownloadStart,
852+
ManifestDownloadSuccess: MDX.ManifestDownloadSuccess,
853+
fileManifestState,
854+
fileManifestType: FILE_MANIFEST_TYPE.DOWNLOAD_MANIFEST,
855+
fileSummaryFacetName: HCA_DCP_CATEGORY_KEY.FILE_FORMAT,
856+
filters: filterState,
857+
formFacet,
858+
};
859+
};
860+
800861
/**
801862
* Build props for the project title Link component from the given entity response.
802863
* @param projectsResponse - Response model return from the entity response API.

explorer/package-lock.json

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

explorer/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"test:anvil-catalog": "playwright test -c playwright_anvil-catalog.config.ts"
3434
},
3535
"dependencies": {
36-
"@clevercanary/data-explorer-ui": "0.42.0",
36+
"@clevercanary/data-explorer-ui": "0.43.0",
3737
"@emotion/react": "11.11.1",
3838
"@emotion/styled": "11.11.0",
3939
"@mdx-js/loader": "^2.3.0",
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { ExportMethodView } from "@clevercanary/data-explorer-ui/lib/views/ExportMethodView/exportMethodView";
2+
import React from "react";
3+
4+
/**
5+
* Export method page.
6+
* @returns export method view component.
7+
*/
8+
const ExportMethodPage = (): JSX.Element => {
9+
return <ExportMethodView />;
10+
};
11+
12+
export default ExportMethodPage;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
export const ROUTE_BULK_DOWNLOAD = "/export/get-curl-command";
22
export const ROUTE_EXPORT_TO_TERRA = "/export/export-to-terra";
3+
export const ROUTE_MANIFEST_DOWNLOAD = "/export/download-manifest";

explorer/site-config/hca-dcp/dev/export/export.ts

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@ import {
55
import * as C from "app/components";
66
import * as MDX from "../../../../app/content/hca-dcp";
77
import * as V from "../../../../app/viewModelBuilders/azul/hca-dcp/common/viewModelBuilders";
8-
import { ROUTE_BULK_DOWNLOAD, ROUTE_EXPORT_TO_TERRA } from "./constants";
8+
import {
9+
ROUTE_BULK_DOWNLOAD,
10+
ROUTE_EXPORT_TO_TERRA,
11+
ROUTE_MANIFEST_DOWNLOAD,
12+
} from "./constants";
913

1014
export const exportConfig: ExportConfig = {
1115
exportMethods: [
@@ -24,6 +28,21 @@ export const exportConfig: ExportConfig = {
2428
} as ComponentConfig<typeof C.BackPageHero>,
2529
],
2630
},
31+
{
32+
mainColumn: [
33+
{
34+
component: C.ManifestDownload,
35+
viewBuilder: V.buildManifestDownload,
36+
} as ComponentConfig<typeof C.ManifestDownload>,
37+
],
38+
route: ROUTE_MANIFEST_DOWNLOAD,
39+
top: [
40+
{
41+
component: C.BackPageHero,
42+
viewBuilder: V.buildExportMethodHeroManifestDownload,
43+
} as ComponentConfig<typeof C.BackPageHero>,
44+
],
45+
},
2746
{
2847
mainColumn: [
2948
{
@@ -49,6 +68,10 @@ export const exportConfig: ExportConfig = {
4968
component: C.ExportMethod,
5069
viewBuilder: V.buildExportMethodBulkDownload,
5170
} as ComponentConfig<typeof C.ExportMethod>,
71+
{
72+
component: C.ExportMethod,
73+
viewBuilder: V.buildExportMethodManifestDownload,
74+
} as ComponentConfig<typeof C.ExportMethod>,
5275
{
5376
component: C.ExportMethod,
5477
viewBuilder: V.buildExportMethodTerra,

0 commit comments

Comments
 (0)