diff --git a/app/apis/azul/anvil-cmg/common/transformers.ts b/app/apis/azul/anvil-cmg/common/transformers.ts index 092a58669..55ffa70c0 100644 --- a/app/apis/azul/anvil-cmg/common/transformers.ts +++ b/app/apis/azul/anvil-cmg/common/transformers.ts @@ -228,15 +228,6 @@ export function getFileSize(response: FileEntityResponse): string { return humanFileSize(fileSize); } -/** - * Maps file URL from the core file value returned from the /index/files API response. - * @param response - Response model return from index/files API endpoint. - * @returns File URL. - */ -export function getFileUrl(response: FileEntityResponse): string { - return processEntityValue(response.files, "url", LABEL.EMPTY); -} - /** * Maps library ID from the core library value returned from the /index/libraries API response. * @param response - Response model return from index/libraries API endpoint. diff --git a/app/components/Export/components/AnVILExplorer/components/ManifestDownload/components/ManifestDownloadEntity/manifestDownloadEntity.tsx b/app/components/Export/components/AnVILExplorer/components/ManifestDownload/components/ManifestDownloadEntity/manifestDownloadEntity.tsx index a6a06d1fa..acd367a86 100644 --- a/app/components/Export/components/AnVILExplorer/components/ManifestDownload/components/ManifestDownloadEntity/manifestDownloadEntity.tsx +++ b/app/components/Export/components/AnVILExplorer/components/ManifestDownload/components/ManifestDownloadEntity/manifestDownloadEntity.tsx @@ -1,6 +1,7 @@ import { MANIFEST_DOWNLOAD_FORMAT } from "@databiosphere/findable-ui/lib/apis/azul/common/entities"; import { FileManifestDownload } from "@databiosphere/findable-ui/lib/components/Export/components/ManifestDownload/components/ManifestDownloadEntity/components/FileManifestDownload/fileManifestDownload"; import { ManifestDownloadEntityProps } from "@databiosphere/findable-ui/lib/components/Export/components/ManifestDownload/components/ManifestDownloadEntity/manifestDownloadEntity"; +import { FILE_MANIFEST_TYPE } from "@databiosphere/findable-ui/lib/hooks/useFileManifest/common/entities"; import { useRequestFileManifest } from "@databiosphere/findable-ui/lib/hooks/useFileManifest/useRequestFileManifest"; export const ManifestDownloadEntity = ({ @@ -9,7 +10,12 @@ export const ManifestDownloadEntity = ({ ManifestDownloadEntityProps, "fileManifestType" | "metadataFilters" >): JSX.Element => { - useRequestFileManifest(MANIFEST_DOWNLOAD_FORMAT.COMPACT, filters, undefined); + useRequestFileManifest( + FILE_MANIFEST_TYPE.ENTITY_DOWNLOAD_MANIFEST, + MANIFEST_DOWNLOAD_FORMAT.COMPACT, + filters, + undefined + ); return ( <> diff --git a/app/viewModelBuilders/azul/anvil-cmg/common/viewModelBuilders.ts b/app/viewModelBuilders/azul/anvil-cmg/common/viewModelBuilders.ts index c938aff1b..2ac8b4570 100644 --- a/app/viewModelBuilders/azul/anvil-cmg/common/viewModelBuilders.ts +++ b/app/viewModelBuilders/azul/anvil-cmg/common/viewModelBuilders.ts @@ -91,7 +91,6 @@ import { getFileFormat, getFileName, getFileSize, - getFileUrl, getLibraryId, getOrganismType, getPhenotypicSex, @@ -499,7 +498,7 @@ export const buildExportEntityToTerra = ( ExportToTerraStart: MDX.ExportToTerraStart, ExportToTerraSuccess: MDX.ExportToTerraSuccess, fileManifestState, - fileManifestType: FILE_MANIFEST_TYPE.ENITY_EXPORT_TO_TERRA, + fileManifestType: FILE_MANIFEST_TYPE.ENTITY_EXPORT_TO_TERRA, fileSummaryFacetName: ANVIL_CMG_CATEGORY_KEY.FILE_FILE_FORMAT, filters, formFacet, @@ -679,8 +678,12 @@ export const buildFileDataModality = ( export const buildFileDownload = ( response: FilesResponse ): React.ComponentProps => { + const dataset = response.datasets[0]; return { - url: getFileUrl(response), + entityName: processEntityValue(response.files, "file_name"), + relatedEntityId: dataset.dataset_id[0], + relatedEntityName: dataset.title[0], + url: processEntityValue(response.files, "url", LABEL.EMPTY), }; }; diff --git a/app/viewModelBuilders/azul/hca-dcp/common/viewModelBuilders.ts b/app/viewModelBuilders/azul/hca-dcp/common/viewModelBuilders.ts index fc4c53367..4c21d34d4 100644 --- a/app/viewModelBuilders/azul/hca-dcp/common/viewModelBuilders.ts +++ b/app/viewModelBuilders/azul/hca-dcp/common/viewModelBuilders.ts @@ -879,7 +879,7 @@ export const buildExportEntityToTerra = ( ExportToTerraStart: MDX.ExportToTerra, ExportToTerraSuccess: MDX.ExportToTerraSuccess, fileManifestState, - fileManifestType: FILE_MANIFEST_TYPE.ENITY_EXPORT_TO_TERRA, + fileManifestType: FILE_MANIFEST_TYPE.ENTITY_EXPORT_TO_TERRA, fileSummaryFacetName: HCA_DCP_CATEGORY_KEY.FILE_FORMAT, filters, formFacet, @@ -1128,7 +1128,11 @@ export const buildFileDownload = ( ): React.ComponentProps => { // Always take the first value in the files array. // This is a summary value and there should only ever be single value here. + const project = filesResponse.projects[0]; return { + entityName: processEntityValue(filesResponse.files, "name"), + relatedEntityId: project.projectId[0], + relatedEntityName: project.projectTitle[0], url: processEntityValue(filesResponse.files, "url", LABEL.EMPTY), }; }; diff --git a/package-lock.json b/package-lock.json index 9df2aa588..0a3905f3f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,7 +8,7 @@ "name": "explorer", "version": "2.1.1", "dependencies": { - "@databiosphere/findable-ui": "14.0.0", + "@databiosphere/findable-ui": "15.0.0", "@emotion/react": "^11.13.3", "@emotion/styled": "^11.13.0", "@mdx-js/loader": "^3.0.1", @@ -1107,9 +1107,9 @@ } }, "node_modules/@databiosphere/findable-ui": { - "version": "14.0.0", - "resolved": "https://registry.npmjs.org/@databiosphere/findable-ui/-/findable-ui-14.0.0.tgz", - "integrity": "sha512-TlPrOejOSFFYlTxYeyQ9zAvJQKWIXtQh6ZItd5uqSF7UcqL0Gc8VqWdMEZJSjnbNz2S2xuDIuc6WvdsvEKgwFw==", + "version": "15.0.0", + "resolved": "https://registry.npmjs.org/@databiosphere/findable-ui/-/findable-ui-15.0.0.tgz", + "integrity": "sha512-5fnEu/0kTz5KkUeRTVWmpLw8PPZVaTSl139XkoR/7eI2dic9CDp/BJGiNC4WxpTZaEXBvASwmFR5lZfpWdpLPg==", "engines": { "node": "20.10.0" }, @@ -6591,9 +6591,9 @@ "dev": true }, "node_modules/cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", "dev": true, "dependencies": { "path-key": "^3.1.0", @@ -20326,9 +20326,9 @@ } }, "@databiosphere/findable-ui": { - "version": "14.0.0", - "resolved": "https://registry.npmjs.org/@databiosphere/findable-ui/-/findable-ui-14.0.0.tgz", - "integrity": "sha512-TlPrOejOSFFYlTxYeyQ9zAvJQKWIXtQh6ZItd5uqSF7UcqL0Gc8VqWdMEZJSjnbNz2S2xuDIuc6WvdsvEKgwFw==", + "version": "15.0.0", + "resolved": "https://registry.npmjs.org/@databiosphere/findable-ui/-/findable-ui-15.0.0.tgz", + "integrity": "sha512-5fnEu/0kTz5KkUeRTVWmpLw8PPZVaTSl139XkoR/7eI2dic9CDp/BJGiNC4WxpTZaEXBvASwmFR5lZfpWdpLPg==", "requires": {} }, "@digitak/esrun": { @@ -24114,9 +24114,9 @@ "dev": true }, "cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", "dev": true, "requires": { "path-key": "^3.1.0", diff --git a/package.json b/package.json index a708db433..a1ab70d29 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,7 @@ "check-system-status:anvil-cmg": "esrun e2e/anvil/anvil-check-system-status.ts" }, "dependencies": { - "@databiosphere/findable-ui": "14.0.0", + "@databiosphere/findable-ui": "15.0.0", "@emotion/react": "^11.13.3", "@emotion/styled": "^11.13.0", "@mdx-js/loader": "^3.0.1",