X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/085692af7ee9809e2714edacad1251e78a196bd3..925a083d8e82281a6d1de1f1021a88da147e5bac:/src/views-components/process-command-dialog/process-command-dialog.tsx

diff --git a/src/views-components/process-command-dialog/process-command-dialog.tsx b/src/views-components/process-command-dialog/process-command-dialog.tsx
index 4bde68d8..7695837e 100644
--- a/src/views-components/process-command-dialog/process-command-dialog.tsx
+++ b/src/views-components/process-command-dialog/process-command-dialog.tsx
@@ -2,21 +2,26 @@
 //
 // SPDX-License-Identifier: AGPL-3.0
 
-import * as React from "react";
-import { Dialog, DialogTitle, DialogActions, Button, StyleRulesCallback, WithStyles, withStyles } from '@material-ui/core';
-import { withDialog } from "~/store/dialog/with-dialog";
-import { PROCESS_COMMAND_DIALOG_NAME } from '~/store/processes/process-command-actions';
-import { WithDialogProps } from '~/store/dialog/with-dialog';
-import { ProcessCommandDialogData } from '~/store/processes/process-command-actions';
-import { DefaultCodeSnippet } from "~/components/default-code-snippet/default-code-snippet";
+import React from "react";
+import { Dialog, DialogActions, Button, StyleRulesCallback, WithStyles, withStyles, Tooltip, IconButton, CardHeader } from '@material-ui/core';
+import { withDialog } from "store/dialog/with-dialog";
+import { PROCESS_COMMAND_DIALOG_NAME } from 'store/processes/process-command-actions';
+import { WithDialogProps } from 'store/dialog/with-dialog';
+import { ProcessCommandDialogData } from 'store/processes/process-command-actions';
+import { DefaultCodeSnippet } from "components/default-code-snippet/default-code-snippet";
 import { compose } from 'redux';
+import CopyToClipboard from "react-copy-to-clipboard";
+import { CopyIcon } from 'components/icon/icon';
 
-type CssRules = 'codeSnippet';
+type CssRules = 'codeSnippet' | 'copyToClipboard';
 
 const styles: StyleRulesCallback<CssRules> = theme => ({
     codeSnippet: {
         marginLeft: theme.spacing.unit * 3,
         marginRight: theme.spacing.unit * 3,
+    },
+    copyToClipboard: {
+        marginRight: theme.spacing.unit,
     }
 });
 
@@ -30,13 +35,23 @@ export const ProcessCommandDialog = compose(
             maxWidth="md"
             onClose={props.closeDialog}
             style={{ alignSelf: 'stretch' }}>
-            <DialogTitle>{`Command - ${props.data.processName}`}</DialogTitle>
+            <CardHeader
+                title={`Command - ${props.data.processName}`}
+                action={
+                    <Tooltip title="Copy to clipboard">
+                        <CopyToClipboard text={props.data.command}>
+                            <IconButton className={props.classes.copyToClipboard}>
+                                <CopyIcon />
+                            </IconButton>
+                        </CopyToClipboard>
+                    </Tooltip>
+                } />
             <DefaultCodeSnippet
                 className={props.classes.codeSnippet}
                 lines={[props.data.command]} />
             <DialogActions>
                 <Button
-                    variant='flat'
+                    variant='text'
                     color='primary'
                     onClick={props.closeDialog}>
                     Close
