[ARVADOS-WORKBENCH2] created: 1.2.0-732-g9d465ad

Git user git at public.curoverse.com
Thu Oct 25 06:24:32 EDT 2018


        at  9d465addb74ffb1209dab4b86e45f933bb21c840 (commit)


commit 9d465addb74ffb1209dab4b86e45f933bb21c840
Author: Pawel Kowalczyk <pawel.kowalczyk at contractors.roche.com>
Date:   Thu Oct 25 12:24:09 2018 +0200

    advanced-tab-curl-cli-python-examples
    
    Feature #13969
    
    Arvados-DCO-1.1-Signed-off-by: Pawel Kowalczyk <pawel.kowalczyk at contractors.roche.com>

diff --git a/src/store/advanced-tab/advanced-tab.ts b/src/store/advanced-tab/advanced-tab.ts
new file mode 100644
index 0000000..5e1a9e7
--- /dev/null
+++ b/src/store/advanced-tab/advanced-tab.ts
@@ -0,0 +1,140 @@
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
+import { dialogActions } from '~/store/dialog/dialog-actions';
+import { RootState } from '~/store/store';
+import { Dispatch } from 'redux';
+import { ResourceKind, extractUuidKind } from '~/models/resource';
+import { getResource } from '~/store/resources/resources';
+import { GroupContentsResourcePrefix } from '~/services/groups-service/groups-service';
+import { snackbarActions, SnackbarKind } from '~/store/snackbar/snackbar-actions';
+
+export const ADVANCED_TAB_DIALOG = 'advancedTabDialog';
+
+export interface AdvancedTabDialogData {
+    kind: string;
+    pythonHeader: string;
+    pythonExample: string;
+    CLIGetHeader: string;
+    CLIGetExample: string;
+    CLIUpdateHeader: string;
+    CLIUpdateExample: string;
+    curlHeader: string;
+    curlExample: string;
+}
+
+enum CollectionData {
+    COLLECTION = 'collection',
+    STORAGE_CLASSES_CONFIRMED = 'storage_classes_confirmed'
+}
+
+enum ProcessData {
+    CONTAINER_REQUEST = 'container_request',
+    OUTPUT_NAME = 'output_name'
+}
+
+enum ProjectData {
+    GROUP = 'group',
+    DELETE_AT = 'delete_at'
+}
+
+export const openAdvancedTabDialog = (uuid: string) =>
+    (dispatch: Dispatch<any>, getState: () => RootState) => {
+        const { resources } = getState();
+        const kind = extractUuidKind(uuid);
+        const data = getResource(uuid)(resources);
+        if (data) {
+            if (kind === ResourceKind.COLLECTION) {
+                const dataCollection: AdvancedTabDialogData = {
+                    kind,
+                    pythonHeader: pythonHeader(CollectionData.COLLECTION),
+                    pythonExample: pythonExample(data.uuid, GroupContentsResourcePrefix.COLLECTION),
+                    CLIGetHeader: CLIGetHeader(CollectionData.COLLECTION),
+                    CLIGetExample: CLIGetExample(data.uuid, GroupContentsResourcePrefix.COLLECTION),
+                    CLIUpdateHeader: CLIUpdateHeader(CollectionData.COLLECTION, CollectionData.STORAGE_CLASSES_CONFIRMED),
+                    CLIUpdateExample: CLIUpdateExample(data.uuid, CollectionData.COLLECTION, data.storageClassesConfirmed, CollectionData.STORAGE_CLASSES_CONFIRMED),
+                    curlHeader: curlHeader(CollectionData.COLLECTION, CollectionData.STORAGE_CLASSES_CONFIRMED),
+                    curlExample: curlExample(data.uuid, GroupContentsResourcePrefix.COLLECTION, data.storageClassesConfirmed, CollectionData.COLLECTION, CollectionData.STORAGE_CLASSES_CONFIRMED)
+                };
+                dispatch(dialogActions.OPEN_DIALOG({ id: ADVANCED_TAB_DIALOG, data: dataCollection }));
+            } else if (kind === ResourceKind.PROCESS) {
+                const dataProcess: AdvancedTabDialogData = {
+                    kind,
+                    pythonHeader: pythonHeader(ProcessData.CONTAINER_REQUEST),
+                    pythonExample: pythonExample(data.uuid, GroupContentsResourcePrefix.PROCESS),
+                    CLIGetHeader: CLIGetHeader(ProcessData.CONTAINER_REQUEST),
+                    CLIGetExample: CLIGetExample(data.uuid, GroupContentsResourcePrefix.PROCESS),
+                    CLIUpdateHeader: CLIUpdateHeader(ProcessData.CONTAINER_REQUEST, ProcessData.OUTPUT_NAME),
+                    CLIUpdateExample: CLIUpdateExample(data.uuid, ProcessData.CONTAINER_REQUEST, data.outputName, ProcessData.OUTPUT_NAME),
+                    curlHeader: curlHeader(ProcessData.CONTAINER_REQUEST, ProcessData.OUTPUT_NAME),
+                    curlExample: curlExample(data.uuid, GroupContentsResourcePrefix.PROCESS, data.outputName, ProcessData.CONTAINER_REQUEST, ProcessData.OUTPUT_NAME)
+                };
+                dispatch(dialogActions.OPEN_DIALOG({ id: ADVANCED_TAB_DIALOG, data: dataProcess }));
+            } else if (kind === ResourceKind.PROJECT) {
+                const dataProject: AdvancedTabDialogData = {
+                    kind,
+                    pythonHeader: pythonHeader(ProjectData.GROUP),
+                    pythonExample: pythonExample(data.uuid, GroupContentsResourcePrefix.PROJECT),
+                    CLIGetHeader: CLIGetHeader(ProjectData.GROUP),
+                    CLIGetExample: CLIGetExample(data.uuid, GroupContentsResourcePrefix.PROJECT),
+                    CLIUpdateHeader: CLIUpdateHeader(ProjectData.GROUP, ProjectData.DELETE_AT),
+                    CLIUpdateExample: CLIUpdateExample(data.uuid, ProjectData.GROUP, data.deleteAt, ProjectData.DELETE_AT),
+                    curlHeader: curlHeader(ProjectData.GROUP, ProjectData.DELETE_AT),
+                    curlExample: curlExample(data.uuid, GroupContentsResourcePrefix.PROJECT, data.deleteAt, ProjectData.GROUP, ProjectData.DELETE_AT)
+                };
+                dispatch(dialogActions.OPEN_DIALOG({ id: ADVANCED_TAB_DIALOG, data: dataProject }));
+            }
+        } else {
+            dispatch(snackbarActions.OPEN_SNACKBAR({ message: "Could not open advanced tab for this resource.", hideDuration: 2000, kind: SnackbarKind.ERROR }));
+        }
+    };
+
+const pythonHeader = (resourceKind: string) =>
+    `An example python command to get a ${resourceKind} using its uuid:`;
+
+const pythonExample = (uuid: string, resourcePrefix: string) => {
+    const pythonExample = `import arvados
+
+ x = arvados.api().${resourcePrefix}().get(uuid='${uuid}').execute()`;
+
+    return pythonExample;
+};
+
+const CLIGetHeader = (resourceKind: string) =>
+    `An example arv command to get a ${resourceKind} using its uuid:`;
+
+const CLIGetExample = (uuid: string, resourcePrefix: string) => {
+    const cliGetExample = `arv ${resourcePrefix} get \\
+ --uuid ${uuid}`;
+
+    return cliGetExample;
+};
+
+const CLIUpdateHeader = (resourceKind: string, resourceName: string) =>
+    `An example arv command to update the "${resourceName}" attribute for the current ${resourceKind}:`;
+
+const CLIUpdateExample = (uuid: string, resourceKind: string, resource: string | string[], resourceName: string) => {
+    const CLIUpdateCollectionExample = `arv ${resourceKind} update \\ 
+ --uuid ${uuid} \\
+ --${resourceKind} '{"${resourceName}":${resource}}'`;
+
+    return CLIUpdateCollectionExample;
+};
+
+const curlHeader = (resourceKind: string, resource: string) =>
+    `An example curl command to update the "${resource}" attribute for the current ${resourceKind}:`;
+
+const curlExample = (uuid: string, resourcePrefix: string, resource: string | string[], resourceKind: string, resourceName: string) => {
+    const curlExample = `curl -X PUT \\
+ -H "Authorization: OAuth2 $ARVADOS_API_TOKEN" \\
+ --data-urlencode ${resourceKind}@/dev/stdin \\
+ https://$ARVADOS_API_HOST/arvados/v1/${resourcePrefix}/${uuid} \\
+ <<EOF
+{
+  "${resourceName}": ${resource}
+}
+EOF`;
+
+    return curlExample;
+};
\ No newline at end of file
diff --git a/src/store/resources/resources.ts b/src/store/resources/resources.ts
index e7153de..189fd4b 100644
--- a/src/store/resources/resources.ts
+++ b/src/store/resources/resources.ts
@@ -7,7 +7,7 @@ import { ResourceKind } from '~/models/resource';
 
 export type ResourcesState = { [key: string]: Resource };
 
-export const getResource = <T extends Resource = Resource>(id: string) =>
+export const getResource = <T extends Resource = any>(id: string) =>
     (state: ResourcesState): T | undefined =>
         state[id] as T;
 
diff --git a/src/views-components/advanced-tab-dialog/advanced-tab-dialog.tsx b/src/views-components/advanced-tab-dialog/advanced-tab-dialog.tsx
new file mode 100644
index 0000000..a280829
--- /dev/null
+++ b/src/views-components/advanced-tab-dialog/advanced-tab-dialog.tsx
@@ -0,0 +1,109 @@
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
+import * as React from "react";
+import { Dialog, DialogActions, Button, StyleRulesCallback, WithStyles, withStyles, DialogTitle, DialogContent, Tabs, Tab, DialogContentText } from '@material-ui/core';
+import { WithDialogProps } from '~/store/dialog/with-dialog';
+import { withDialog } from "~/store/dialog/with-dialog";
+import { compose } from 'redux';
+import { ADVANCED_TAB_DIALOG } from "~/store/advanced-tab/advanced-tab";
+import { DefaultCodeSnippet } from "~/components/default-code-snippet/default-code-snippet";
+
+type CssRules = 'content' | 'codeSnippet' | 'secondContentText';
+
+const styles: StyleRulesCallback<CssRules> = theme => ({
+    content: {
+        paddingTop: theme.spacing.unit * 3
+    },
+    codeSnippet: {
+        borderRadius: theme.spacing.unit * 0.5,
+        border: '1px solid',
+        borderColor: theme.palette.grey["400"]
+    },
+    secondContentText: {
+        paddingTop: theme.spacing.unit * 2
+    }
+});
+
+export const AdvancedTabDialog = compose(
+    withDialog(ADVANCED_TAB_DIALOG),
+    withStyles(styles),
+)(
+    class extends React.Component<WithDialogProps<any> & WithStyles<CssRules>>{
+        state = {
+            value: 0,
+        };
+
+        componentDidMount() {
+            this.setState({ value: 0 });
+        }
+
+        handleChange = (event: React.MouseEvent<HTMLElement>, value: number) => {
+            this.setState({ value });
+        }
+        render() {
+            const { classes, open, closeDialog } = this.props;
+            const { value } = this.state;
+            const {
+                pythonHeader,
+                pythonExample,
+                CLIGetHeader,
+                CLIGetExample,
+                CLIUpdateHeader,
+                CLIUpdateExample,
+                curlHeader,
+                curlExample
+            } = this.props.data;
+            return <Dialog
+                open={open}
+                maxWidth="md"
+                onClose={closeDialog}
+                onExit={() => this.setState({ value: 0 })} >
+                <DialogTitle>Advanced</DialogTitle>
+                <Tabs value={value} onChange={this.handleChange}>
+                    <Tab label="API RESPONSE" />
+                    <Tab label="METADATA" />
+                    <Tab label="PYTHON EXAMPLE" />
+                    <Tab label="CLI EXAMPLE" />
+                    <Tab label="CURL EXAMPLE" />
+                </Tabs>
+                <DialogContent className={classes.content}>
+                    {value === 0 && <div>
+                        API CONTENT
+                    </div>}
+                    {value === 1 && <div>
+                        METADATA CONTENT
+                    </div>}
+                    {value === 2 && <div>
+                        <DialogContentText>{pythonHeader}</DialogContentText>
+                        <DefaultCodeSnippet
+                            className={classes.codeSnippet}
+                            lines={[pythonExample]} />
+                    </div>}
+                    {value === 3 && <div>
+                        <DialogContentText>{CLIGetHeader}</DialogContentText>
+                        <DefaultCodeSnippet
+                            className={classes.codeSnippet}
+                            lines={[CLIGetExample]} />
+                        <DialogContentText className={classes.secondContentText}>{CLIUpdateHeader}</DialogContentText>
+                        <DefaultCodeSnippet
+                            className={classes.codeSnippet}
+                            lines={[CLIUpdateExample]} />
+                    </div>}
+                    {value === 4 && <div>
+                        <DialogContentText>{curlHeader}</DialogContentText>
+                        <DefaultCodeSnippet
+                            className={classes.codeSnippet}
+                            lines={[curlExample]} />
+                    </div>}
+                </DialogContent>
+                <DialogActions>
+                    <Button variant='flat' color='primary' onClick={closeDialog}>
+                        Close
+                    </Button>
+                </DialogActions>
+            </Dialog>;
+        }
+    }
+);
\ No newline at end of file
diff --git a/src/views-components/context-menu/action-sets/collection-action-set.ts b/src/views-components/context-menu/action-sets/collection-action-set.ts
index cff30fb..121fe17 100644
--- a/src/views-components/context-menu/action-sets/collection-action-set.ts
+++ b/src/views-components/context-menu/action-sets/collection-action-set.ts
@@ -13,14 +13,13 @@ import { openCollectionCopyDialog } from "~/store/collections/collection-copy-ac
 import { ToggleTrashAction } from "~/views-components/context-menu/actions/trash-action";
 import { toggleCollectionTrashed } from "~/store/trash/trash-actions";
 import { detailsPanelActions } from '~/store/details-panel/details-panel-action';
+import { openAdvancedTabDialog } from "~/store/advanced-tab/advanced-tab";
 
 export const collectionActionSet: ContextMenuActionSet = [[
     {
         icon: RenameIcon,
         name: "Edit collection",
-        execute: (dispatch, resource) => {
-            dispatch<any>(openCollectionUpdateDialog(resource));
-        }
+        execute: (dispatch, resource) => dispatch<any>(openCollectionUpdateDialog(resource))
     },
     {
         icon: ShareIcon,
@@ -44,16 +43,13 @@ export const collectionActionSet: ContextMenuActionSet = [[
     },
     {
         component: ToggleTrashAction,
-        execute: (dispatch, resource) => {
-            dispatch<any>(toggleCollectionTrashed(resource.uuid, resource.isTrashed!!));
-        }
+        execute: (dispatch, resource) => dispatch<any>(toggleCollectionTrashed(resource.uuid, resource.isTrashed!!))
     },
     {
         icon: CopyIcon,
         name: "Copy to project",
-        execute: (dispatch, resource) => {
-            dispatch<any>(openCollectionCopyDialog(resource));
-        }
+        execute: (dispatch, resource) => dispatch<any>(openCollectionCopyDialog(resource))
+
     },
     {
         icon: DetailsIcon,
@@ -70,9 +66,7 @@ export const collectionActionSet: ContextMenuActionSet = [[
     {
         icon: AdvancedIcon,
         name: "Advanced",
-        execute: (dispatch, resource) => {
-            // add code
-        }
+        execute: (dispatch, resource) => dispatch<any>(openAdvancedTabDialog(resource.uuid))
     },
     {
         icon: RemoveIcon,
diff --git a/src/views-components/context-menu/action-sets/collection-files-action-set.ts b/src/views-components/context-menu/action-sets/collection-files-action-set.ts
index 5c4dab3..c86f1d7 100644
--- a/src/views-components/context-menu/action-sets/collection-files-action-set.ts
+++ b/src/views-components/context-menu/action-sets/collection-files-action-set.ts
@@ -2,33 +2,23 @@
 //
 // SPDX-License-Identifier: AGPL-3.0
 
-import { ContextMenuActionSet } from "../context-menu-action-set";
+import { ContextMenuActionSet } from "~/views-components/context-menu/context-menu-action-set";
 import { collectionPanelFilesAction, openMultipleFilesRemoveDialog } from "~/store/collection-panel/collection-panel-files/collection-panel-files-actions";
 import { openCollectionPartialCopyDialog } from '~/store/collections/collection-partial-copy-actions';
 
 export const collectionFilesActionSet: ContextMenuActionSet = [[{
     name: "Select all",
-    execute: (dispatch) => {
-        dispatch(collectionPanelFilesAction.SELECT_ALL_COLLECTION_FILES());
-    }
+    execute: dispatch => dispatch(collectionPanelFilesAction.SELECT_ALL_COLLECTION_FILES())
 }, {
     name: "Unselect all",
-    execute: (dispatch) => {
-        dispatch(collectionPanelFilesAction.UNSELECT_ALL_COLLECTION_FILES());
-    }
+    execute: dispatch => dispatch(collectionPanelFilesAction.UNSELECT_ALL_COLLECTION_FILES())
 }, {
     name: "Remove selected",
-    execute: (dispatch) => {
-        dispatch(openMultipleFilesRemoveDialog());
-    }
+    execute: dispatch => dispatch(openMultipleFilesRemoveDialog())
 }, {
     name: "Download selected",
-    execute: (dispatch, resource) => {
-        return;
-    }
+    execute: () => { return; }
 }, {
     name: "Create a new collection with selected",
-    execute: (dispatch) => {
-        dispatch<any>(openCollectionPartialCopyDialog());
-    }
+    execute: dispatch => dispatch<any>(openCollectionPartialCopyDialog())
 }]];
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 b556489..2baa524 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
@@ -11,16 +11,12 @@ import { openFileRemoveDialog, openRenameFileDialog } from '~/store/collection-p
 export const collectionFilesItemActionSet: ContextMenuActionSet = [[{
     name: "Rename",
     icon: RenameIcon,
-    execute: (dispatch, resource) => {
-        dispatch<any>(openRenameFileDialog({ name: resource.name, id: resource.uuid }));
-    }
+    execute: (dispatch, resource) => dispatch<any>(openRenameFileDialog({ name: resource.name, id: resource.uuid }))
 }, {
     component: DownloadCollectionFileAction,
     execute: () => { return; }
 }, {
     name: "Remove",
     icon: RemoveIcon,
-    execute: (dispatch, resource) => {
-        dispatch<any>(openFileRemoveDialog(resource.uuid));
-    }
+    execute: (dispatch, resource) => dispatch<any>(openFileRemoveDialog(resource.uuid))
 }]];
diff --git a/src/views-components/context-menu/action-sets/collection-resource-action-set.ts b/src/views-components/context-menu/action-sets/collection-resource-action-set.ts
index 8665bc1..c54d40e 100644
--- a/src/views-components/context-menu/action-sets/collection-resource-action-set.ts
+++ b/src/views-components/context-menu/action-sets/collection-resource-action-set.ts
@@ -18,9 +18,7 @@ export const collectionResourceActionSet: ContextMenuActionSet = [[
     {
         icon: RenameIcon,
         name: "Edit collection",
-        execute: (dispatch, resource) => {
-            dispatch<any>(openCollectionUpdateDialog(resource));
-        }
+        execute: (dispatch, resource) => dispatch<any>(openCollectionUpdateDialog(resource))
     },
     {
         icon: ShareIcon,
@@ -44,16 +42,12 @@ export const collectionResourceActionSet: ContextMenuActionSet = [[
     },
     {
         component: ToggleTrashAction,
-        execute: (dispatch, resource) => {
-            dispatch<any>(toggleCollectionTrashed(resource.uuid, resource.isTrashed!!));
-        }
+        execute: (dispatch, resource) => dispatch<any>(toggleCollectionTrashed(resource.uuid, resource.isTrashed!!))
     },
     {
         icon: CopyIcon,
         name: "Copy to project",
-        execute: (dispatch, resource) => {
-            dispatch<any>(openCollectionCopyDialog(resource));
-        },
+        execute: (dispatch, resource) => dispatch<any>(openCollectionCopyDialog(resource))
     },
     {
         icon: DetailsIcon,
diff --git a/src/views-components/context-menu/action-sets/process-action-set.ts b/src/views-components/context-menu/action-sets/process-action-set.ts
index 3248873..9447567 100644
--- a/src/views-components/context-menu/action-sets/process-action-set.ts
+++ b/src/views-components/context-menu/action-sets/process-action-set.ts
@@ -2,8 +2,8 @@
 //
 // SPDX-License-Identifier: AGPL-3.0
 
-import { ContextMenuActionSet } from "../context-menu-action-set";
-import { ToggleFavoriteAction } from "../actions/favorite-action";
+import { ContextMenuActionSet } from "~/views-components/context-menu/context-menu-action-set";
+import { ToggleFavoriteAction } from "~/views-components/context-menu/actions/favorite-action";
 import { toggleFavorite } from "~/store/favorites/favorites-actions";
 import {
     RenameIcon, ShareIcon, MoveToIcon, CopyIcon, DetailsIcon, ProvenanceGraphIcon,
@@ -14,8 +14,9 @@ import { navigateToProcessLogs } from '~/store/navigation/navigation-action';
 import { openMoveProcessDialog } from '~/store/processes/process-move-actions';
 import { openProcessUpdateDialog } from "~/store/processes/process-update-actions";
 import { openCopyProcessDialog } from '~/store/processes/process-copy-actions';
-import { openProcessCommandDialog } from '../../../store/processes/process-command-actions';
+import { openProcessCommandDialog } from '~/store/processes/process-command-actions';
 import { detailsPanelActions } from '~/store/details-panel/details-panel-action';
+import { openAdvancedTabDialog } from "~/store/advanced-tab/advanced-tab";
 
 export const processActionSet: ContextMenuActionSet = [[
     {
@@ -72,9 +73,7 @@ export const processActionSet: ContextMenuActionSet = [[
     {
         icon: CommandIcon,
         name: "Command",
-        execute: (dispatch, resource) => {
-            dispatch<any>(openProcessCommandDialog(resource.uuid));
-        }
+        execute: (dispatch, resource) => dispatch<any>(openProcessCommandDialog(resource.uuid))
     },
     {
         icon: DetailsIcon,
@@ -84,9 +83,7 @@ export const processActionSet: ContextMenuActionSet = [[
     {
         icon: LogIcon,
         name: "Log",
-        execute: (dispatch, resource) => {
-            dispatch<any>(navigateToProcessLogs(resource.uuid));
-        }
+        execute: (dispatch, resource) => dispatch<any>(navigateToProcessLogs(resource.uuid))
     },
     {
         icon: ProvenanceGraphIcon,
@@ -98,9 +95,7 @@ export const processActionSet: ContextMenuActionSet = [[
     {
         icon: AdvancedIcon,
         name: "Advanced",
-        execute: (dispatch, resource) => {
-            // add code
-        }
+        execute: (dispatch, resource) => dispatch<any>(openAdvancedTabDialog(resource.uuid))
     },
     {
         icon: RemoveIcon,
diff --git a/src/views-components/context-menu/action-sets/project-action-set.ts b/src/views-components/context-menu/action-sets/project-action-set.ts
index 85848a2..cc57a3f 100644
--- a/src/views-components/context-menu/action-sets/project-action-set.ts
+++ b/src/views-components/context-menu/action-sets/project-action-set.ts
@@ -3,7 +3,7 @@
 // SPDX-License-Identifier: AGPL-3.0
 
 import { ContextMenuActionSet } from "../context-menu-action-set";
-import { NewProjectIcon, RenameIcon, CopyIcon, MoveToIcon, DetailsIcon } from '~/components/icon/icon';
+import { NewProjectIcon, RenameIcon, CopyIcon, MoveToIcon, DetailsIcon, AdvancedIcon } from '~/components/icon/icon';
 import { ToggleFavoriteAction } from "../actions/favorite-action";
 import { toggleFavorite } from "~/store/favorites/favorites-actions";
 import { favoritePanelActions } from "~/store/favorite-panel/favorite-panel-action";
@@ -13,21 +13,18 @@ import { openProjectUpdateDialog } from '~/store/projects/project-update-actions
 import { ToggleTrashAction } from "~/views-components/context-menu/actions/trash-action";
 import { toggleProjectTrashed } from "~/store/trash/trash-actions";
 import { detailsPanelActions } from '~/store/details-panel/details-panel-action';
+import { openAdvancedTabDialog } from "~/store/advanced-tab/advanced-tab";
 
 export const projectActionSet: ContextMenuActionSet = [[
     {
         icon: NewProjectIcon,
         name: "New project",
-        execute: (dispatch, resource) => {
-            dispatch<any>(openProjectCreateDialog(resource.uuid));
-        }
+        execute: (dispatch, resource) => dispatch<any>(openProjectCreateDialog(resource.uuid))
     },
     {
         icon: RenameIcon,
         name: "Edit project",
-        execute: (dispatch, resource) => {
-            dispatch<any>(openProjectUpdateDialog(resource));
-        }
+        execute: (dispatch, resource) => dispatch<any>(openProjectUpdateDialog(resource))
     },
     {
         component: ToggleFavoriteAction,
@@ -39,9 +36,7 @@ export const projectActionSet: ContextMenuActionSet = [[
     },
     {
         component: ToggleTrashAction,
-        execute: (dispatch, resource) => {
-            dispatch<any>(toggleProjectTrashed(resource.uuid, resource.ownerUuid, resource.isTrashed!!));
-        }
+        execute: (dispatch, resource) => dispatch<any>(toggleProjectTrashed(resource.uuid, resource.ownerUuid, resource.isTrashed!!))
     },
     {
         icon: MoveToIcon,
@@ -59,5 +54,10 @@ export const projectActionSet: ContextMenuActionSet = [[
         icon: DetailsIcon,
         name: "View details",
         execute: dispatch => dispatch(detailsPanelActions.TOGGLE_DETAILS_PANEL())
-    }
+    },
+    {
+        icon: AdvancedIcon,
+        name: "Advanced",
+        execute: (dispatch, resource) => dispatch<any>(openAdvancedTabDialog(resource.uuid))
+    },
 ]];
diff --git a/src/views-components/context-menu/action-sets/root-project-action-set.ts b/src/views-components/context-menu/action-sets/root-project-action-set.ts
index 386c516..d80fc9d 100644
--- a/src/views-components/context-menu/action-sets/root-project-action-set.ts
+++ b/src/views-components/context-menu/action-sets/root-project-action-set.ts
@@ -11,15 +11,11 @@ export const rootProjectActionSet: ContextMenuActionSet =  [[
     {
         icon: NewProjectIcon,
         name: "New project",
-        execute: (dispatch, resource) => {
-            dispatch<any>(openProjectCreateDialog(resource.uuid));
-        }
+        execute: (dispatch, resource) =>  dispatch<any>(openProjectCreateDialog(resource.uuid))
     },
     {
         icon: CollectionIcon,
         name: "New Collection",
-        execute: (dispatch, resource) => {
-            dispatch<any>(openCollectionCreateDialog(resource.uuid));
-        }
+        execute: (dispatch, resource) => dispatch<any>(openCollectionCreateDialog(resource.uuid))
     }
 ]];
diff --git a/src/views-components/context-menu/action-sets/trash-action-set.ts b/src/views-components/context-menu/action-sets/trash-action-set.ts
index fafd5fe..f81a995 100644
--- a/src/views-components/context-menu/action-sets/trash-action-set.ts
+++ b/src/views-components/context-menu/action-sets/trash-action-set.ts
@@ -9,8 +9,6 @@ import { toggleTrashed } from "~/store/trash/trash-actions";
 export const trashActionSet: ContextMenuActionSet = [[
     {
         component: ToggleTrashAction,
-        execute: (dispatch, resource) => {
-            dispatch<any>(toggleTrashed(resource.kind, resource.uuid, resource.ownerUuid, resource.isTrashed!!));
-        }
+        execute: (dispatch, resource) => dispatch<any>(toggleTrashed(resource.kind, resource.uuid, resource.ownerUuid, resource.isTrashed!!))
     },
 ]];
diff --git a/src/views-components/context-menu/action-sets/trashed-collection-action-set.ts b/src/views-components/context-menu/action-sets/trashed-collection-action-set.ts
index c42da1e..e11228b 100644
--- a/src/views-components/context-menu/action-sets/trashed-collection-action-set.ts
+++ b/src/views-components/context-menu/action-sets/trashed-collection-action-set.ts
@@ -5,14 +5,14 @@
 import { ContextMenuActionSet } from "../context-menu-action-set";
 import { DetailsIcon, ProvenanceGraphIcon, AdvancedIcon, RestoreFromTrashIcon } from '~/components/icon/icon';
 import { toggleCollectionTrashed } from "~/store/trash/trash-actions";
+import { detailsPanelActions } from "~/store/details-panel/details-panel-action";
+import { openAdvancedTabDialog } from "~/store/advanced-tab/advanced-tab";
 
 export const trashedCollectionActionSet: ContextMenuActionSet = [[
     {
         icon: DetailsIcon,
         name: "View details",
-        execute: (dispatch, resource) => {
-            // add code
-        }
+        execute: dispatch => dispatch(detailsPanelActions.TOGGLE_DETAILS_PANEL())
     },
     {
         icon: ProvenanceGraphIcon,
@@ -24,15 +24,11 @@ export const trashedCollectionActionSet: ContextMenuActionSet = [[
     {
         icon: AdvancedIcon,
         name: "Advanced",
-        execute: (dispatch, resource) => {
-            // add code
-        }
+        execute: (dispatch, resource) => dispatch<any>(openAdvancedTabDialog(resource.uuid))
     },
     {
         icon: RestoreFromTrashIcon,
         name: "Restore",
-        execute: (dispatch, resource) => {
-            dispatch<any>(toggleCollectionTrashed(resource.uuid, true));
-        }
+        execute: (dispatch, resource) => dispatch<any>(toggleCollectionTrashed(resource.uuid, true))
     },
 ]];
diff --git a/src/views/workbench/workbench.tsx b/src/views/workbench/workbench.tsx
index 788c96a..1e65384 100644
--- a/src/views/workbench/workbench.tsx
+++ b/src/views/workbench/workbench.tsx
@@ -42,12 +42,7 @@ import { RunProcessPanel } from '~/views/run-process-panel/run-process-panel';
 import SplitterLayout from 'react-splitter-layout';
 import { WorkflowPanel } from '~/views/workflow-panel/workflow-panel';
 import { SearchResultsPanel } from '~/views/search-results-panel/search-results-panel';
-import { HomeTreePicker } from '~/views-components/projects-tree-picker/home-tree-picker';
-import { SharedTreePicker } from '~/views-components/projects-tree-picker/shared-tree-picker';
-import { FavoritesTreePicker } from '../../views-components/projects-tree-picker/favorites-tree-picker';
-import { ProjectsTreePicker } from '~/views-components/projects-tree-picker/projects-tree-picker';
-import { Chips } from '~/components/chips/chips';
-import { ChipsInput } from '../../components/chips-input/chips-input';
+import { AdvancedTabDialog } from '~/views-components/advanced-tab-dialog/advanced-tab-dialog';
 
 type CssRules = 'root' | 'container' | 'splitter' | 'asidePanel' | 'contentWrapper' | 'content';
 
@@ -114,6 +109,7 @@ export const WorkbenchPanel =
             <Grid item>
                 <DetailsPanel />
             </Grid>
+            <AdvancedTabDialog />
             <ContextMenu />
             <CopyCollectionDialog />
             <CopyProcessDialog />
diff --git a/src/views/workflow-panel/workflow-description-card.tsx b/src/views/workflow-panel/workflow-description-card.tsx
index 70fdb6b..b4b9f20 100644
--- a/src/views/workflow-panel/workflow-description-card.tsx
+++ b/src/views/workflow-panel/workflow-description-card.tsx
@@ -14,8 +14,7 @@ import {
     TableHead,
     TableCell,
     TableBody,
-    TableRow,
-    Divider
+    TableRow
 } from '@material-ui/core';
 import { ArvadosTheme } from '~/common/custom-theme';
 import { WorkflowIcon } from '~/components/icon/icon';

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list