[ARVADOS-WORKBENCH2] updated: 1.1.4-479-g935518a

Git user git at public.curoverse.com
Thu Aug 2 10:17:50 EDT 2018


Summary of changes:
 .../action-sets/collection-files-item-action-set.ts   |  3 ++-
 .../rename-dialog.tsx}                                | 19 +++++++++++--------
 src/views/workbench/workbench.tsx                     |  6 ++++--
 3 files changed, 17 insertions(+), 11 deletions(-)
 copy src/views-components/{remove-dialog/remove-dialog.tsx => rename-dialog/rename-dialog.tsx} (57%)

       via  935518acfda7773331e816492d05d005ec44950f (commit)
      from  833a5d07f87b31133ade505b82215b9a5d47bdc3 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 935518acfda7773331e816492d05d005ec44950f
Author: Michal Klobukowski <michal.klobukowski at contractors.roche.com>
Date:   Thu Aug 2 16:17:32 2018 +0200

    Mock rename dialog
    
    Feature #13855
    
    Arvados-DCO-1.1-Signed-off-by: Michal Klobukowski <michal.klobukowski at contractors.roche.com>

diff --git a/src/views-components/context-menu/action-sets/collection-files-item-action-set.ts b/src/views-components/context-menu/action-sets/collection-files-item-action-set.ts
index da11b47..0b623ec 100644
--- a/src/views-components/context-menu/action-sets/collection-files-item-action-set.ts
+++ b/src/views-components/context-menu/action-sets/collection-files-item-action-set.ts
@@ -5,13 +5,14 @@
 import { ContextMenuActionSet } from "../context-menu-action-set";
 import { RenameIcon, DownloadIcon, RemoveIcon } from "../../../components/icon/icon";
 import { openRemoveDialog } from "../../remove-dialog/remove-dialog";
+import { openRenameDialog } from "../../rename-dialog/rename-dialog";
 
 
 export const collectionFilesItemActionSet: ContextMenuActionSet = [[{
     name: "Rename",
     icon: RenameIcon,
     execute: (dispatch, resource) => {
-        return;
+        dispatch(openRenameDialog('the item'));
     }
 },{
     name: "Download",
diff --git a/src/views-components/rename-dialog/rename-dialog.tsx b/src/views-components/rename-dialog/rename-dialog.tsx
new file mode 100644
index 0000000..8fe38cb
--- /dev/null
+++ b/src/views-components/rename-dialog/rename-dialog.tsx
@@ -0,0 +1,37 @@
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
+import * as React from "react";
+import { Dialog, DialogTitle, DialogContent, DialogActions, Button, TextField, Typography } from "@material-ui/core";
+import { withDialog } from "../../store/dialog/with-dialog";
+import { dialogActions } from "../../store/dialog/dialog-actions";
+
+export const RENAME_DIALOG = 'nameDialog';
+
+export const RenameDialog = withDialog(RENAME_DIALOG)(
+    (props) =>
+        <Dialog open={props.open}>
+            <DialogTitle>{`Rename`}</DialogTitle>
+            <DialogContent>
+                <Typography variant='body1' gutterBottom>
+                    {`Please, enter a new name for ${props.data}`}
+                </Typography>
+                <TextField fullWidth={true} placeholder='New name' />
+            </DialogContent>
+            <DialogActions>
+                <Button
+                    variant='flat'
+                    color='primary'
+                    onClick={props.closeDialog}>
+                    Cancel
+                </Button>
+                <Button variant='raised' color='primary'>
+                    Ok
+                </Button>
+            </DialogActions>
+        </Dialog>
+);
+
+export const openRenameDialog = (originalName: string, ) =>
+    dialogActions.OPEN_DIALOG({ id: RENAME_DIALOG, data: originalName });
diff --git a/src/views/workbench/workbench.tsx b/src/views/workbench/workbench.tsx
index 6fc3484..36e8bec 100644
--- a/src/views/workbench/workbench.tsx
+++ b/src/views/workbench/workbench.tsx
@@ -42,6 +42,7 @@ import { CollectionPanel } from '../collection-panel/collection-panel';
 import { loadCollection } from '../../store/collection-panel/collection-panel-action';
 import { getCollectionUrl } from '../../models/collection';
 import { RemoveDialog } from '../../views-components/remove-dialog/remove-dialog';
+import { RenameDialog } from '../../views-components/rename-dialog/rename-dialog';
 
 const drawerWidth = 240;
 const appBarHeight = 100;
@@ -228,6 +229,7 @@ export const Workbench = withStyles(styles)(
                         <CreateProjectDialog />
                         <CreateCollectionDialog />
                         <RemoveDialog />
+                        <RenameDialog />
                         <CurrentTokenDialog
                             currentToken={this.props.currentToken}
                             open={this.state.isCurrentTokenDialogOpen}
@@ -236,7 +238,7 @@ export const Workbench = withStyles(styles)(
                 );
             }
 
-            renderCollectionPanel = (props: RouteComponentProps<{ id: string }>) => <CollectionPanel 
+            renderCollectionPanel = (props: RouteComponentProps<{ id: string }>) => <CollectionPanel
                 onItemRouteChange={(collectionId) => this.props.dispatch<any>(loadCollection(collectionId, ResourceKind.COLLECTION))}
                 onContextMenu={(event, item) => {
                     this.openContextMenu(event, {
@@ -268,7 +270,7 @@ export const Workbench = withStyles(styles)(
                         case ResourceKind.COLLECTION:
                             this.props.dispatch<any>(loadCollection(item.uuid, item.kind as ResourceKind));
                             this.props.dispatch(push(getCollectionUrl(item.uuid)));
-                        default: 
+                        default:
                             this.props.dispatch<any>(setProjectItem(item.uuid, ItemMode.ACTIVE));
                             this.props.dispatch<any>(loadDetails(item.uuid, item.kind as ResourceKind));
                     }

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list