Skip to content

Commit

Permalink
chore: upgrade findable-ui to 15.0.0 (#4262) (#4277)
Browse files Browse the repository at this point in the history
Co-authored-by: Fran McDade <[email protected]>
  • Loading branch information
frano-m and Fran McDade authored Nov 19, 2024
1 parent cc780a5 commit bea4af2
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 28 deletions.
9 changes: 0 additions & 9 deletions app/apis/azul/anvil-cmg/common/transformers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
@@ -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 = ({
Expand All @@ -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 (
<>
<FileManifestDownload filters={filters} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ import {
getFileFormat,
getFileName,
getFileSize,
getFileUrl,
getLibraryId,
getOrganismType,
getPhenotypicSex,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -679,8 +678,12 @@ export const buildFileDataModality = (
export const buildFileDownload = (
response: FilesResponse
): React.ComponentProps<typeof C.AzulFileDownload> => {
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),
};
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -1128,7 +1128,11 @@ export const buildFileDownload = (
): React.ComponentProps<typeof C.AzulFileDownload> => {
// 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),
};
};
Expand Down
26 changes: 13 additions & 13 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit bea4af2

Please sign in to comment.