From edd1e586454b81553819abfd78b2fa87ec95e80e Mon Sep 17 00:00:00 2001 From: Alex Freska Date: Tue, 10 Sep 2024 11:34:30 -0400 Subject: [PATCH] refactor(renterd): migrate objects and multipart apis --- .changeset/brown-pianos-travel.md | 7 ++ .changeset/cyan-jokes-prove.md | 5 ++ .changeset/dry-elephants-try.md | 7 ++ .changeset/wild-ties-rescue.md | 5 ++ apps/explorer/components/EntityHeading.tsx | 4 +- .../FilesHealthColumnContents.tsx | 5 +- .../Files/FilesCmd/FilesSearchCmd/index.tsx | 22 +++--- .../FilesDirectory/FilesStatsMenu/index.tsx | 9 +-- .../contexts/filesDirectory/dataset.tsx | 40 ++++++----- .../renterd/contexts/filesDirectory/index.tsx | 5 +- apps/renterd/contexts/filesFlat/dataset.tsx | 23 ++++--- .../renterd/contexts/filesManager/dataset.tsx | 6 +- .../renterd/contexts/filesManager/uploads.tsx | 6 +- apps/renterd/contexts/uploads/index.tsx | 8 +-- apps/renterd/lib/multipartUpload.spec.ts | 10 +-- apps/renterd/lib/multipartUpload.ts | 15 ++-- libs/design-system/src/lib/utils.ts | 12 ++-- libs/renterd-js/src/bus.ts | 21 +----- libs/renterd-react/src/bus.ts | 34 +++------- libs/renterd-react/src/worker.ts | 7 +- libs/renterd-types/src/bus.ts | 68 ++++++++----------- libs/renterd-types/src/types.ts | 30 ++++---- 22 files changed, 173 insertions(+), 176 deletions(-) create mode 100644 .changeset/brown-pianos-travel.md create mode 100644 .changeset/cyan-jokes-prove.md create mode 100644 .changeset/dry-elephants-try.md create mode 100644 .changeset/wild-ties-rescue.md diff --git a/.changeset/brown-pianos-travel.md b/.changeset/brown-pianos-travel.md new file mode 100644 index 000000000..690fba00d --- /dev/null +++ b/.changeset/brown-pianos-travel.md @@ -0,0 +1,7 @@ +--- +'@siafoundation/renterd-js': minor +'@siafoundation/renterd-react': minor +'@siafoundation/renterd-types': minor +--- + +Removed deprecated object search and object directory APIs. diff --git a/.changeset/cyan-jokes-prove.md b/.changeset/cyan-jokes-prove.md new file mode 100644 index 000000000..46ff3d245 --- /dev/null +++ b/.changeset/cyan-jokes-prove.md @@ -0,0 +1,5 @@ +--- +'renterd': minor +--- + +The files directory and global mode explorers now use the new list objects API. diff --git a/.changeset/dry-elephants-try.md b/.changeset/dry-elephants-try.md new file mode 100644 index 000000000..e1774edfd --- /dev/null +++ b/.changeset/dry-elephants-try.md @@ -0,0 +1,7 @@ +--- +'@siafoundation/renterd-js': minor +'@siafoundation/renterd-react': minor +'@siafoundation/renterd-types': minor +--- + +Updated the multipart upload APIs with the new payloads. diff --git a/.changeset/wild-ties-rescue.md b/.changeset/wild-ties-rescue.md new file mode 100644 index 000000000..eac06cab1 --- /dev/null +++ b/.changeset/wild-ties-rescue.md @@ -0,0 +1,5 @@ +--- +'@siafoundation/design-system': minor +--- + +Added ellipsis boolean to truncate, deprecated humanId. diff --git a/apps/explorer/components/EntityHeading.tsx b/apps/explorer/components/EntityHeading.tsx index e428208a6..262c521ad 100644 --- a/apps/explorer/components/EntityHeading.tsx +++ b/apps/explorer/components/EntityHeading.tsx @@ -3,7 +3,7 @@ import { copyToClipboard, Heading, - humanId, + truncate, Button, Link, } from '@siafoundation/design-system' @@ -25,7 +25,7 @@ export function EntityHeading({ label, type, value, href }: Props) { {upperFirst(label)}{' '} {type === 'block' && Number(value).toLocaleString()} - {type !== 'block' && humanId(value, 15)} + {type !== 'block' && truncate(value, 15)}