Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(renterd): files copy metadata #867

Merged
merged 1 commit into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/silver-pants-deliver.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'renterd': patch
---

Fixed an issue with the copy file metadata action in the file context menu.
5 changes: 5 additions & 0 deletions .changeset/thick-geckos-laugh.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@siafoundation/renterd-types': minor
---

The object response has been updated in v2.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export function FilesHealthColumnContents({
)
}

if (!obj.data?.object) {
if (!obj.data) {
return (
<Layout displayHealth={displayHealth} label={label}>
<Text size="12">Error fetching slab metadata.</Text>
Expand All @@ -56,7 +56,7 @@ export function FilesHealthColumnContents({
}

const slabs = sortBy(
obj.data.object.slabs?.map((s) => ({
obj.data.slabs?.map((s) => ({
...s.slab,
// id is for use as a unique React key.
// slab key is not necessarily unique. e.g. an object uploaded with tiny
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,7 @@ export function CopyMetadataMenuItem({ path }: Props) {
disabled={!obj.data}
onSelect={() => {
if (obj.data) {
copyToClipboard(
JSON.stringify(obj.data.object, null, 2),
'object metadata'
)
copyToClipboard(JSON.stringify(obj.data, null, 2), 'object metadata')
}
}}
>
Expand Down
2 changes: 1 addition & 1 deletion libs/renterd-types/src/bus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ export type ObjectsResponse = {

export type ObjectParams = { key: string; bucket: string }
export type ObjectPayload = void
export type ObjectResponse = { object: Obj }
export type ObjectResponse = Obj

export type ObjectAddParams = { key: string; bucket: string }
export type ObjectAddPayload = {
Expand Down
Loading