[ARVADOS-WORKBENCH2] updated: 1.2.0-437-g8a570b4
Git user
git at public.curoverse.com
Tue Sep 25 05:31:16 EDT 2018
Summary of changes:
src/index.tsx | 4 ++-
.../action-sets/trashed-collection-action-set.ts | 38 ++++++++++++++++++++++
src/views-components/context-menu/context-menu.tsx | 1 +
src/views/collection-panel/collection-panel.tsx | 6 ++--
4 files changed, 46 insertions(+), 3 deletions(-)
create mode 100644 src/views-components/context-menu/action-sets/trashed-collection-action-set.ts
via 8a570b430be529010e28929c589103ad6ffebedd (commit)
from 9efef4484a8c28b97dae64e785e2dd7c38687cca (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 8a570b430be529010e28929c589103ad6ffebedd
Author: Michal Klobukowski <michal.klobukowski at contractors.roche.com>
Date: Tue Sep 25 11:31:03 2018 +0200
Add trashed collection context menu
Feature #14244
Arvados-DCO-1.1-Signed-off-by: Michal Klobukowski <michal.klobukowski at contractors.roche.com>
diff --git a/src/index.tsx b/src/index.tsx
index f456c99..52054a4 100644
--- a/src/index.tsx
+++ b/src/index.tsx
@@ -18,7 +18,7 @@ import { createServices } from "./services/services";
import { MuiThemeProvider } from '@material-ui/core/styles';
import { CustomTheme } from './common/custom-theme';
import { fetchConfig } from './common/config';
-import { addMenuActionSet, ContextMenuKind } from "./views-components/context-menu/context-menu";
+import { addMenuActionSet, ContextMenuKind } from './views-components/context-menu/context-menu';
import { rootProjectActionSet } from "./views-components/context-menu/action-sets/root-project-action-set";
import { projectActionSet } from "./views-components/context-menu/action-sets/project-action-set";
import { resourceActionSet } from './views-components/context-menu/action-sets/resource-action-set';
@@ -38,6 +38,7 @@ import { addRouteChangeHandlers } from './routes/route-change-handlers';
import { setCurrentTokenDialogApiHost } from '~/store/current-token-dialog/current-token-dialog-actions';
import { processResourceActionSet } from './views-components/context-menu/action-sets/process-resource-action-set';
import { progressIndicatorActions } from '~/store/progress-indicator/progress-indicator-actions';
+import { trashedCollectionActionSet } from '~/views-components/context-menu/action-sets/trashed-collection-action-set';
const getBuildNumber = () => "BN-" + (process.env.REACT_APP_BUILD_NUMBER || "dev");
const getGitCommit = () => "GIT-" + (process.env.REACT_APP_GIT_COMMIT || "latest").substr(0, 7);
@@ -55,6 +56,7 @@ addMenuActionSet(ContextMenuKind.COLLECTION_FILES, collectionFilesActionSet);
addMenuActionSet(ContextMenuKind.COLLECTION_FILES_ITEM, collectionFilesItemActionSet);
addMenuActionSet(ContextMenuKind.COLLECTION, collectionActionSet);
addMenuActionSet(ContextMenuKind.COLLECTION_RESOURCE, collectionResourceActionSet);
+addMenuActionSet(ContextMenuKind.TRASHED_COLLECTION, trashedCollectionActionSet);
addMenuActionSet(ContextMenuKind.PROCESS, processActionSet);
addMenuActionSet(ContextMenuKind.PROCESS_RESOURCE, processResourceActionSet);
addMenuActionSet(ContextMenuKind.TRASH, trashActionSet);
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
new file mode 100644
index 0000000..c42da1e
--- /dev/null
+++ b/src/views-components/context-menu/action-sets/trashed-collection-action-set.ts
@@ -0,0 +1,38 @@
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
+import { ContextMenuActionSet } from "../context-menu-action-set";
+import { DetailsIcon, ProvenanceGraphIcon, AdvancedIcon, RestoreFromTrashIcon } from '~/components/icon/icon';
+import { toggleCollectionTrashed } from "~/store/trash/trash-actions";
+
+export const trashedCollectionActionSet: ContextMenuActionSet = [[
+ {
+ icon: DetailsIcon,
+ name: "View details",
+ execute: (dispatch, resource) => {
+ // add code
+ }
+ },
+ {
+ icon: ProvenanceGraphIcon,
+ name: "Provenance graph",
+ execute: (dispatch, resource) => {
+ // add code
+ }
+ },
+ {
+ icon: AdvancedIcon,
+ name: "Advanced",
+ execute: (dispatch, resource) => {
+ // add code
+ }
+ },
+ {
+ icon: RestoreFromTrashIcon,
+ name: "Restore",
+ execute: (dispatch, resource) => {
+ dispatch<any>(toggleCollectionTrashed(resource.uuid, true));
+ }
+ },
+]];
diff --git a/src/views-components/context-menu/context-menu.tsx b/src/views-components/context-menu/context-menu.tsx
index d5c82be..ad6f7e3 100644
--- a/src/views-components/context-menu/context-menu.tsx
+++ b/src/views-components/context-menu/context-menu.tsx
@@ -64,6 +64,7 @@ export enum ContextMenuKind {
COLLECTION_FILES_ITEM = "CollectionFilesItem",
COLLECTION = 'Collection',
COLLECTION_RESOURCE = 'CollectionResource',
+ TRASHED_COLLECTION = 'TrashedCollection',
PROCESS = "Process",
PROCESS_RESOURCE = 'ProcessResource',
PROCESS_LOGS = "ProcessLogs"
diff --git a/src/views/collection-panel/collection-panel.tsx b/src/views/collection-panel/collection-panel.tsx
index 6724937..07eb7d9 100644
--- a/src/views/collection-panel/collection-panel.tsx
+++ b/src/views/collection-panel/collection-panel.tsx
@@ -134,14 +134,16 @@ export const CollectionPanel = withStyles(styles)(
}
handleContextMenu = (event: React.MouseEvent<any>) => {
- const { uuid, ownerUuid, name, description, kind } = this.props.item;
+ const { uuid, ownerUuid, name, description, kind, isTrashed } = this.props.item;
const resource = {
uuid,
ownerUuid,
name,
description,
kind,
- menuKind: ContextMenuKind.COLLECTION
+ menuKind: isTrashed
+ ? ContextMenuKind.TRASHED_COLLECTION
+ : ContextMenuKind.COLLECTION
};
this.props.dispatch<any>(openContextMenu(event, resource));
}
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list