From eb09e4f95410a67170007cdb32aa2a260c06425d Mon Sep 17 00:00:00 2001 From: Kiana McCullough Date: Tue, 17 Dec 2024 16:03:45 -0800 Subject: [PATCH 1/4] padding --- .../src/components/entity/page/CreatedByModifiedBy.tsx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/synapse-react-client/src/components/entity/page/CreatedByModifiedBy.tsx b/packages/synapse-react-client/src/components/entity/page/CreatedByModifiedBy.tsx index 7d9b9c77a5..f5c45d00a7 100644 --- a/packages/synapse-react-client/src/components/entity/page/CreatedByModifiedBy.tsx +++ b/packages/synapse-react-client/src/components/entity/page/CreatedByModifiedBy.tsx @@ -103,7 +103,15 @@ export function CreatedByModifiedBy(props: CreatedByModifiedByProps) { } return ( - + ({ + bgcolor: 'grey.100', + py: '10px', + [theme.breakpoints.down('sm')]: { + p: '24px 40px', + }, + })} + > } sx={{ From 1f204a44c1625f39e31f48bdcdc27e6be114184a Mon Sep 17 00:00:00 2001 From: Nick Grosenbacher Date: Thu, 19 Dec 2024 10:01:00 -0500 Subject: [PATCH 2/4] SWC-7213 - Handle case where `projectStorageLocationUsage` is undefined --- .../src/components/EntityUpload/EntityUpload.tsx | 6 +++--- .../willUploadsExceedStorageLimit.test.ts | 9 +++++++++ .../useUploadFileEntity/willUploadsExceedStorageLimit.ts | 5 ++++- packages/synapse-types/src/File/UploadDestination.ts | 2 +- 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/packages/synapse-react-client/src/components/EntityUpload/EntityUpload.tsx b/packages/synapse-react-client/src/components/EntityUpload/EntityUpload.tsx index 31f7bb6ae7..91694100fd 100644 --- a/packages/synapse-react-client/src/components/EntityUpload/EntityUpload.tsx +++ b/packages/synapse-react-client/src/components/EntityUpload/EntityUpload.tsx @@ -111,7 +111,7 @@ export const EntityUpload = React.forwardRef(function EntityUpload( ).length function uploadFileList(fileList: ArrayLike) { - if (uploadDestination?.projectStorageLocationUsage.isOverLimit) { + if (uploadDestination?.projectStorageLocationUsage?.isOverLimit) { displayToast( 'Cannot upload files because the storage limit has been exceeded.', 'danger', @@ -137,7 +137,7 @@ export const EntityUpload = React.forwardRef(function EntityUpload( return (
- {uploadDestination && ( + {uploadDestination?.projectStorageLocationUsage && ( { ), ).toEqual(true) }) + + test('undefined usage', () => { + const usage = undefined + + const pendingUploadsInBytes = 0 + expect( + willUploadsExceedStorageLimit([], usage, pendingUploadsInBytes), + ).toEqual(false) + }) }) diff --git a/packages/synapse-react-client/src/utils/hooks/useUploadFileEntity/willUploadsExceedStorageLimit.ts b/packages/synapse-react-client/src/utils/hooks/useUploadFileEntity/willUploadsExceedStorageLimit.ts index 4badd5515f..b3705ba239 100644 --- a/packages/synapse-react-client/src/utils/hooks/useUploadFileEntity/willUploadsExceedStorageLimit.ts +++ b/packages/synapse-react-client/src/utils/hooks/useUploadFileEntity/willUploadsExceedStorageLimit.ts @@ -8,9 +8,12 @@ import { ProjectStorageLocationUsage } from '@sage-bionetworks/synapse-types' */ export function willUploadsExceedStorageLimit( files: ArrayLike, - usage: ProjectStorageLocationUsage, + usage: ProjectStorageLocationUsage | undefined, pendingUploadsInBytes: number, ): boolean { + if (usage == null) { + return false + } if (usage.isOverLimit) { return true } diff --git a/packages/synapse-types/src/File/UploadDestination.ts b/packages/synapse-types/src/File/UploadDestination.ts index 6a80270f37..d58587a326 100644 --- a/packages/synapse-types/src/File/UploadDestination.ts +++ b/packages/synapse-types/src/File/UploadDestination.ts @@ -17,7 +17,7 @@ export interface UploadDestination { uploadType: UploadType /* If set, the client should show this banner every time an upload is initiated */ banner?: string - projectStorageLocationUsage: ProjectStorageLocationUsage + projectStorageLocationUsage?: ProjectStorageLocationUsage } /** From b86d44687a1232f0ae54c0617053feebd1c2fee3 Mon Sep 17 00:00:00 2001 From: Nick Grosenbacher Date: Thu, 19 Dec 2024 13:54:56 -0500 Subject: [PATCH 3/4] Increment synapse-react-client to v3.3.33 --- packages/synapse-react-client/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/synapse-react-client/package.json b/packages/synapse-react-client/package.json index 560b7a9f80..7729af79d6 100644 --- a/packages/synapse-react-client/package.json +++ b/packages/synapse-react-client/package.json @@ -1,6 +1,6 @@ { "name": "synapse-react-client", - "version": "3.3.32", + "version": "3.3.33", "private": false, "type": "module", "main": "./dist/index.cjs", From 1745be4d3a512648850e9e1fe9d74b99470f785d Mon Sep 17 00:00:00 2001 From: Kiana McCullough Date: Fri, 20 Dec 2024 11:49:34 -0800 Subject: [PATCH 4/4] no separator on small screen --- .../components/entity/page/CreatedByModifiedBy.tsx | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/packages/synapse-react-client/src/components/entity/page/CreatedByModifiedBy.tsx b/packages/synapse-react-client/src/components/entity/page/CreatedByModifiedBy.tsx index f5c45d00a7..624d84fff8 100644 --- a/packages/synapse-react-client/src/components/entity/page/CreatedByModifiedBy.tsx +++ b/packages/synapse-react-client/src/components/entity/page/CreatedByModifiedBy.tsx @@ -5,6 +5,8 @@ import { SxProps, Tooltip, Typography, + useMediaQuery, + useTheme, } from '@mui/material' import { BUNDLE_MASK_LAST_UPDATED_ON } from '../../../utils/SynapseConstants' import { @@ -29,6 +31,11 @@ export type CreatedByModifiedByProps = { } function Separator() { + const theme = useTheme() + const isSmallScreen = useMediaQuery(theme.breakpoints.down('sm')) + if (isSmallScreen) { + return null + } return ( / @@ -114,11 +121,14 @@ export function CreatedByModifiedBy(props: CreatedByModifiedByProps) { > } - sx={{ + sx={theme => ({ '& .MuiBreadcrumbs-ol': { justifyContent: 'center', + [theme.breakpoints.down('sm')]: { + gap: '4px', + }, }, - }} + })} >