Preserve white space in breadcrumb disply and navigation (#2932)
This commit is contained in:
committed by
GitHub
parent
ae7371da95
commit
bacb5f8901
@@ -24,7 +24,7 @@ const styles = (theme: Theme) =>
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
fileNameText: {
|
fileNameText: {
|
||||||
whiteSpace: "nowrap",
|
whiteSpace: "pre",
|
||||||
overflow: "hidden",
|
overflow: "hidden",
|
||||||
textOverflow: "ellipsis",
|
textOverflow: "ellipsis",
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ import makeStyles from "@mui/styles/makeStyles";
|
|||||||
import { Theme } from "@mui/material/styles";
|
import { Theme } from "@mui/material/styles";
|
||||||
import { Link, useNavigate } from "react-router-dom";
|
import { Link, useNavigate } from "react-router-dom";
|
||||||
import { objectBrowserCommon } from "../Common/FormComponents/common/styleLibrary";
|
import { objectBrowserCommon } from "../Common/FormComponents/common/styleLibrary";
|
||||||
import { encodeURLString } from "../../../common/utils";
|
import { encodeURLString, safeDecodeURIComponent } from "../../../common/utils";
|
||||||
import { Button, CopyIcon, NewPathIcon, Tooltip, Breadcrumbs } from "mds";
|
import { Button, CopyIcon, NewPathIcon, Tooltip, Breadcrumbs } from "mds";
|
||||||
import { hasPermission } from "../../../common/SecureComponent";
|
import { hasPermission } from "../../../common/SecureComponent";
|
||||||
import {
|
import {
|
||||||
@@ -127,9 +127,14 @@ const BrowserBreadcrumbs = ({
|
|||||||
<Fragment key={`breadcrumbs-${index.toString()}`}>
|
<Fragment key={`breadcrumbs-${index.toString()}`}>
|
||||||
<span className={classes.slashSpacingStyle}>/</span>
|
<span className={classes.slashSpacingStyle}>/</span>
|
||||||
{index === lastBreadcrumbsIndex ? (
|
{index === lastBreadcrumbsIndex ? (
|
||||||
<span style={{ cursor: "default" }}>{objectItem}</span>
|
<span style={{ cursor: "default", whiteSpace: "pre" }}>
|
||||||
|
{safeDecodeURIComponent(objectItem) /*Only for display*/}
|
||||||
|
</span>
|
||||||
) : (
|
) : (
|
||||||
<Link
|
<Link
|
||||||
|
style={{
|
||||||
|
whiteSpace: "pre",
|
||||||
|
}}
|
||||||
to={route}
|
to={route}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
dispatch(
|
dispatch(
|
||||||
@@ -137,7 +142,11 @@ const BrowserBreadcrumbs = ({
|
|||||||
);
|
);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{objectItem}
|
{
|
||||||
|
safeDecodeURIComponent(
|
||||||
|
objectItem
|
||||||
|
) /*Only for display to preserve */
|
||||||
|
}
|
||||||
</Link>
|
</Link>
|
||||||
)}
|
)}
|
||||||
</Fragment>
|
</Fragment>
|
||||||
@@ -210,6 +219,9 @@ const BrowserBreadcrumbs = ({
|
|||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
<Breadcrumbs
|
<Breadcrumbs
|
||||||
|
sx={{
|
||||||
|
whiteSpace: "pre",
|
||||||
|
}}
|
||||||
goBackFunction={goBackFunction}
|
goBackFunction={goBackFunction}
|
||||||
additionalOptions={
|
additionalOptions={
|
||||||
<Fragment>
|
<Fragment>
|
||||||
|
|||||||
Reference in New Issue
Block a user