[ARVADOS-WORKBENCH2] updated: 1.1.4-370-g3d8cd86
Git user
git at public.curoverse.com
Tue Jul 24 04:19:45 EDT 2018
Summary of changes:
src/index.tsx | 2 ++
.../{project-action-set.ts => resource-action-set.ts} | 10 +---------
src/views-components/context-menu/context-menu.tsx | 3 ++-
src/views/workbench/workbench.tsx | 7 +++++--
4 files changed, 10 insertions(+), 12 deletions(-)
copy src/views-components/context-menu/action-sets/{project-action-set.ts => resource-action-set.ts} (53%)
via 3d8cd860cc352f12a44593382cd36bd24c9c3a44 (commit)
from 09dedf976871785e061bb78d56f5cb466147627a (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 3d8cd860cc352f12a44593382cd36bd24c9c3a44
Author: Michal Klobukowski <michal.klobukowski at contractors.roche.com>
Date: Tue Jul 24 10:19:29 2018 +0200
Add resource actions set
Feature #13784
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 6d53e0d..caba632 100644
--- a/src/index.tsx
+++ b/src/index.tsx
@@ -22,9 +22,11 @@ import { setBaseUrl } from './common/api/server-api';
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';
addMenuActionSet(ContextMenuKind.RootProject, rootProjectActionSet);
addMenuActionSet(ContextMenuKind.Project, projectActionSet);
+addMenuActionSet(ContextMenuKind.Resource, resourceActionSet);
fetchConfig()
.then(config => {
diff --git a/src/views-components/context-menu/action-sets/resource-action-set.ts b/src/views-components/context-menu/action-sets/resource-action-set.ts
new file mode 100644
index 0000000..59af117
--- /dev/null
+++ b/src/views-components/context-menu/action-sets/resource-action-set.ts
@@ -0,0 +1,14 @@
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
+import { ContextMenuActionSet } from "../context-menu-action-set";
+import { ToggleFavoriteAction } from "./favorite-action";
+import { toggleFavorite } from "../../../store/favorites/favorites-actions";
+
+export const resourceActionSet: ContextMenuActionSet = [[{
+ component: ToggleFavoriteAction,
+ execute: (dispatch, resource) => {
+ dispatch<any>(toggleFavorite(resource.uuid));
+ }
+}]];
diff --git a/src/views-components/context-menu/context-menu.tsx b/src/views-components/context-menu/context-menu.tsx
index f1e0645..245fe35 100644
--- a/src/views-components/context-menu/context-menu.tsx
+++ b/src/views-components/context-menu/context-menu.tsx
@@ -57,5 +57,6 @@ const getMenuActionSet = (resource?: ContextMenuResource): ContextMenuActionSet
export enum ContextMenuKind {
RootProject = "RootProject",
- Project = "Project"
+ Project = "Project",
+ Resource = "Resource"
}
diff --git a/src/views/workbench/workbench.tsx b/src/views/workbench/workbench.tsx
index a62b713..96fd223 100644
--- a/src/views/workbench/workbench.tsx
+++ b/src/views/workbench/workbench.tsx
@@ -193,7 +193,7 @@ export const Workbench = withStyles(styles)(
<Route path="/projects/:id" render={this.renderProjectPanel} />
</Switch>
</div>
- { user && <DetailsPanel /> }
+ {user && <DetailsPanel />}
</main>
<ContextMenu />
<CreateProjectDialog />
@@ -203,7 +203,10 @@ export const Workbench = withStyles(styles)(
renderProjectPanel = (props: RouteComponentProps<{ id: string }>) => <ProjectPanel
onItemRouteChange={itemId => this.props.dispatch<any>(setProjectItem(itemId, ItemMode.ACTIVE))}
- onContextMenu={(event, item) => this.openContextMenu(event, item.uuid, ContextMenuKind.Project)}
+ onContextMenu={(event, item) => {
+ const kind = item.kind === ResourceKind.Project ? ContextMenuKind.Project : ContextMenuKind.Resource;
+ this.openContextMenu(event, item.uuid, kind);
+ }}
onDialogOpen={this.handleCreationDialogOpen}
onItemClick={item => {
this.props.dispatch<any>(loadDetails(item.uuid, item.kind as ResourceKind));
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list