Skip to content

Commit bacb5f8

Browse files
authored
Preserve white space in breadcrumb disply and navigation (#2932)
1 parent ae7371d commit bacb5f8

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

portal-ui/src/screens/Console/Buckets/ListBuckets/Objects/ListObjects/IconWithLabel.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const styles = (theme: Theme) =>
2424
},
2525
},
2626
fileNameText: {
27-
whiteSpace: "nowrap",
27+
whiteSpace: "pre",
2828
overflow: "hidden",
2929
textOverflow: "ellipsis",
3030
},

portal-ui/src/screens/Console/ObjectBrowser/BrowserBreadcrumbs.tsx

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import makeStyles from "@mui/styles/makeStyles";
2222
import { Theme } from "@mui/material/styles";
2323
import { Link, useNavigate } from "react-router-dom";
2424
import { objectBrowserCommon } from "../Common/FormComponents/common/styleLibrary";
25-
import { encodeURLString } from "../../../common/utils";
25+
import { encodeURLString, safeDecodeURIComponent } from "../../../common/utils";
2626
import { Button, CopyIcon, NewPathIcon, Tooltip, Breadcrumbs } from "mds";
2727
import { hasPermission } from "../../../common/SecureComponent";
2828
import {
@@ -127,17 +127,26 @@ const BrowserBreadcrumbs = ({
127127
<Fragment key={`breadcrumbs-${index.toString()}`}>
128128
<span className={classes.slashSpacingStyle}>/</span>
129129
{index === lastBreadcrumbsIndex ? (
130-
<span style={{ cursor: "default" }}>{objectItem}</span>
130+
<span style={{ cursor: "default", whiteSpace: "pre" }}>
131+
{safeDecodeURIComponent(objectItem) /*Only for display*/}
132+
</span>
131133
) : (
132134
<Link
135+
style={{
136+
whiteSpace: "pre",
137+
}}
133138
to={route}
134139
onClick={() => {
135140
dispatch(
136141
setVersionsModeEnabled({ status: false, objectName: "" })
137142
);
138143
}}
139144
>
140-
{objectItem}
145+
{
146+
safeDecodeURIComponent(
147+
objectItem
148+
) /*Only for display to preserve */
149+
}
141150
</Link>
142151
)}
143152
</Fragment>
@@ -210,6 +219,9 @@ const BrowserBreadcrumbs = ({
210219
/>
211220
)}
212221
<Breadcrumbs
222+
sx={{
223+
whiteSpace: "pre",
224+
}}
213225
goBackFunction={goBackFunction}
214226
additionalOptions={
215227
<Fragment>

0 commit comments

Comments
 (0)