From fdb6d210d60f901a7229931df898fe1ed702499b Mon Sep 17 00:00:00 2001 From: Alex <33497058+bexsoft@users.noreply.github.com> Date: Thu, 12 May 2022 18:01:54 -0500 Subject: [PATCH] Added copy path button to breadcrumbs bar (#1990) --- .../ObjectBrowser/BrowserBreadcrumbs.tsx | 38 ++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/portal-ui/src/screens/Console/ObjectBrowser/BrowserBreadcrumbs.tsx b/portal-ui/src/screens/Console/ObjectBrowser/BrowserBreadcrumbs.tsx index 98920a0f3..6c169b66f 100644 --- a/portal-ui/src/screens/Console/ObjectBrowser/BrowserBreadcrumbs.tsx +++ b/portal-ui/src/screens/Console/ObjectBrowser/BrowserBreadcrumbs.tsx @@ -17,6 +17,7 @@ import React, { Fragment, useState } from "react"; import { connect } from "react-redux"; import get from "lodash/get"; +import CopyToClipboard from "react-copy-to-clipboard"; import Grid from "@mui/material/Grid"; import withStyles from "@mui/styles/withStyles"; import createStyles from "@mui/styles/createStyles"; @@ -26,13 +27,14 @@ import { Button, IconButton, Tooltip } from "@mui/material"; import { ObjectBrowserState } from "./types"; import { objectBrowserCommon } from "../Common/FormComponents/common/styleLibrary"; import { encodeFileName } from "../../../common/utils"; -import { BackCaretIcon, NewPathIcon } from "../../../icons"; +import { BackCaretIcon, CopyIcon, NewPathIcon } from "../../../icons"; import { hasPermission } from "../../../common/SecureComponent"; import { IAM_SCOPES } from "../../../common/SecureComponent/permissions"; import { BucketObjectItem } from "../Buckets/ListBuckets/Objects/ListObjects/types"; import { setVersionsModeEnabled } from "./actions"; import history from "../../../history"; import withSuspense from "../Common/Components/withSuspense"; +import { setSnackBarMessage } from "../../../actions"; const CreatePathModal = withSuspense( React.lazy( @@ -55,6 +57,7 @@ interface IObjectBrowser { existingFiles: BucketObjectItem[]; additionalOptions?: React.ReactNode; setVersionsModeEnabled: typeof setVersionsModeEnabled; + setSnackBarMessage: typeof setSnackBarMessage; } const styles = (theme: Theme) => @@ -76,6 +79,7 @@ const BrowserBreadcrumbs = ({ hidePathButton, setVersionsModeEnabled, additionalOptions, + setSnackBarMessage, }: IObjectBrowser) => { const [createFolderOpen, setCreateFolderOpen] = useState(false); @@ -187,6 +191,37 @@ const BrowserBreadcrumbs = ({
{listBreadcrumbs}
+ +