Skip to content
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 packages/manager/.changeset/pr-12112-fixed-1745593237854.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@linode/manager": Fixed
---

OBJ bucket nested breadcrumb navigation ([#12112](https://github.com/linode/manager/pull/12112))
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { useNavigate, useParams } from '@tanstack/react-router';
import * as React from 'react';

import { useWindowDimensions } from 'src/hooks/useWindowDimensions';
Expand All @@ -13,12 +14,15 @@ import {

interface Props {
bucketName: string;
history: any;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is why we don't any!! basically this ended up being a stray window.history instance that wasn't even tied to any router.

prefix: string;
}

export const BucketBreadcrumb = (props: Props) => {
const { bucketName, history, prefix } = props;
const { bucketName, prefix } = props;
const navigate = useNavigate();
const { clusterId } = useParams({
from: '/object-storage/buckets/$clusterId/$bucketName',
});
const { width } = useWindowDimensions();
const bucketPath = bucketName + '/' + prefix;

Expand All @@ -38,7 +42,11 @@ export const BucketBreadcrumb = (props: Props) => {
{/* Bucket name */}
<StyledLink
onClick={() => {
history.push({ search: '?prefix=' });
navigate({
to: '/object-storage/buckets/$clusterId/$bucketName',
params: { clusterId, bucketName },
search: { prefix: '' },
});
}}
variant="body1"
>
Expand Down Expand Up @@ -66,7 +74,11 @@ export const BucketBreadcrumb = (props: Props) => {
}

const prefixString = prefixArrayToString(prefixArray, idx);
history.push({ search: '?prefix=' + prefixString });
navigate({
to: '/object-storage/buckets/$clusterId/$bucketName',
params: { clusterId, bucketName },
search: { prefix: prefixString },
});
}}
variant="body1"
>
Expand All @@ -76,7 +88,7 @@ export const BucketBreadcrumb = (props: Props) => {
);
})}
</StyledPrefixWrapper>
<StyledCopyTooltip text={bucketPath} placement="bottom" />
<StyledCopyTooltip placement="bottom" text={bucketPath} />
</StyledRootContainer>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -355,11 +355,7 @@ export const BucketDetail = () => {
return (
<>
<DocumentTitleSegment segment={`${bucketName} | Bucket`} />
<BucketBreadcrumb
bucketName={bucketName}
history={history}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

!!

prefix={prefix}
/>
<BucketBreadcrumb bucketName={bucketName} prefix={prefix} />
<ObjectUploader
bucketName={bucketName}
clusterId={clusterId}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const BucketProperties = React.memo((props: Props) => {

return (
<>
<BucketBreadcrumb bucketName={label} history={history} prefix={prefix} />
<BucketBreadcrumb bucketName={label} prefix={prefix} />
<StyledText>{hostname}</StyledText>

<StyledRootContainer>
Expand Down