From 28098a9ffab25205bb913edabf4a16bf9dd6d359 Mon Sep 17 00:00:00 2001 From: linglp Date: Fri, 7 Jul 2023 11:26:43 -0400 Subject: [PATCH 1/2] set version number as optional --- .../src/components/DownloadCart/DownloadListTable.tsx | 7 ++++++- .../src/DownloadListV2/DownloadListItemResult.ts | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/synapse-react-client/src/components/DownloadCart/DownloadListTable.tsx b/packages/synapse-react-client/src/components/DownloadCart/DownloadListTable.tsx index 8c9c91467f..920d2bf17a 100644 --- a/packages/synapse-react-client/src/components/DownloadCart/DownloadListTable.tsx +++ b/packages/synapse-react-client/src/components/DownloadCart/DownloadListTable.tsx @@ -322,7 +322,12 @@ export default function DownloadListTable(props: DownloadListTableProps) { associatedObjectType={ FileHandleAssociateType.FileEntity } - entityVersionNumber={item.versionNumber.toString()} + {...(item.versionNumber !== null + ? { + entityVersionNumber: + item.versionNumber.toString(), + } + : {})} displayFileName={false} onClickCallback={(isExternalLink: boolean) => { // SWC-5944: remove the item from the download list, unless it's an external link. diff --git a/packages/synapse-types/src/DownloadListV2/DownloadListItemResult.ts b/packages/synapse-types/src/DownloadListV2/DownloadListItemResult.ts index 344ef300f3..1437c2a92d 100644 --- a/packages/synapse-types/src/DownloadListV2/DownloadListItemResult.ts +++ b/packages/synapse-types/src/DownloadListV2/DownloadListItemResult.ts @@ -9,6 +9,6 @@ export type DownloadListItemResult = { createdOn: string //The date-time when this file was created. fileSizeBytes: number //The size of the file in bytes. fileEntityId: string //The 'syn' identifier of a file entity. - versionNumber: number //When included, indicates that a specific version of a files was added to the user's download list. When excluded, the current version was added. + versionNumber?: number //When included, indicates that a specific version of a files was added to the user's download list. When excluded, the current version was added. isEligibleForPackaging: boolean //Only files that are managed by Synapse storage are eligible for packaging into a zip file. If true, then the file is eligible for packaging into a zip file. } From d8ece93b7cc7f6fc213994623756d66a62bb1c71 Mon Sep 17 00:00:00 2001 From: Lingling <55448354+linglp@users.noreply.github.com> Date: Fri, 7 Jul 2023 12:11:42 -0400 Subject: [PATCH 2/2] simplify code Co-authored-by: Nick Grosenbacher --- .../src/components/DownloadCart/DownloadListTable.tsx | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/packages/synapse-react-client/src/components/DownloadCart/DownloadListTable.tsx b/packages/synapse-react-client/src/components/DownloadCart/DownloadListTable.tsx index 920d2bf17a..ea2bf7878a 100644 --- a/packages/synapse-react-client/src/components/DownloadCart/DownloadListTable.tsx +++ b/packages/synapse-react-client/src/components/DownloadCart/DownloadListTable.tsx @@ -322,12 +322,7 @@ export default function DownloadListTable(props: DownloadListTableProps) { associatedObjectType={ FileHandleAssociateType.FileEntity } - {...(item.versionNumber !== null - ? { - entityVersionNumber: - item.versionNumber.toString(), - } - : {})} + entityVersionNumber={item.versionNumber?.toString()} displayFileName={false} onClickCallback={(isExternalLink: boolean) => { // SWC-5944: remove the item from the download list, unless it's an external link.