[ARVADOS-WORKBENCH2] created: 1.2.0-805-gf601bcf
Git user
git at public.curoverse.com
Thu Nov 1 16:55:43 EDT 2018
at f601bcf1cfeb8779c1cb1418f1f7a4b6a293e59d (commit)
commit f601bcf1cfeb8779c1cb1418f1f7a4b6a293e59d
Author: Michal Klobukowski <michal.klobukowski at contractors.roche.com>
Date: Thu Nov 1 21:55:02 2018 +0100
Restore context menu to side panel
Feature #14252
Arvados-DCO-1.1-Signed-off-by: Michal Klobukowski <michal.klobukowski at contractors.roche.com>
diff --git a/src/store/context-menu/context-menu-actions.ts b/src/store/context-menu/context-menu-actions.ts
index 3ae79db..c7fde68 100644
--- a/src/store/context-menu/context-menu-actions.ts
+++ b/src/store/context-menu/context-menu-actions.ts
@@ -65,6 +65,7 @@ export const openRootProjectContextMenu = (event: React.MouseEvent<HTMLElement>,
export const openProjectContextMenu = (event: React.MouseEvent<HTMLElement>, projectUuid: string) =>
(dispatch: Dispatch, getState: () => RootState) => {
+ event.preventDefault();
const res = getResource<ProjectResource>(projectUuid)(getState().resources);
if (res) {
dispatch<any>(openContextMenu(event, {
diff --git a/src/store/tree-picker/tree-picker-actions.ts b/src/store/tree-picker/tree-picker-actions.ts
index 0e8118f..3a9daf0 100644
--- a/src/store/tree-picker/tree-picker-actions.ts
+++ b/src/store/tree-picker/tree-picker-actions.ts
@@ -14,6 +14,7 @@ import { GroupContentsResource } from '../../services/groups-service/groups-serv
import { CollectionDirectory, CollectionFile } from '../../models/collection-file';
import { getTreePicker, TreePicker } from './tree-picker';
import { ProjectsTreePickerItem } from '~/views-components/projects-tree-picker/generic-projects-tree-picker';
+import { updateResources } from '../resources/resources-actions';
export const treePickerActions = unionize({
LOAD_TREE_PICKER_NODE: ofType<{ id: string, pickerId: string }>(),
@@ -105,7 +106,7 @@ export const loadProject = (params: LoadProjectParams) =>
)(new FilterBuilder());
const { items } = await services.groupsService.contents(loadShared ? '' : id, { filters, excludeHomeProject: loadShared || undefined });
-
+ dispatch(updateResources(items));
dispatch<any>(receiveTreePickerData<GroupContentsResource>({
id,
pickerId,
diff --git a/src/views-components/projects-tree-picker/generic-projects-tree-picker.tsx b/src/views-components/projects-tree-picker/generic-projects-tree-picker.tsx
index 1681a95..d9e6511 100644
--- a/src/views-components/projects-tree-picker/generic-projects-tree-picker.tsx
+++ b/src/views-components/projects-tree-picker/generic-projects-tree-picker.tsx
@@ -15,6 +15,7 @@ import { GroupContentsResource } from '~/services/groups-service/groups-service'
import { CollectionDirectory, CollectionFile, CollectionFileType } from '~/models/collection-file';
import { ResourceKind } from '~/models/resource';
import { TreePickerProps, TreePicker } from "~/views-components/tree-picker/tree-picker";
+import { Omit } from "lodash";
export interface ProjectsTreePickerRootItem {
id: string;
@@ -46,8 +47,7 @@ const mapDispatchToProps = (dispatch: Dispatch, {
includeCollections,
includeFiles,
relatedTreePickers,
- ...props }: ProjectsTreePickerProps): PickedTreePickerProps => ({
- onContextMenu: () => { return; },
+ ...props }: ProjectsTreePickerProps): Omit<PickedTreePickerProps, 'onContextMenu'> => ({
toggleItemActive: (event, item, pickerId) => {
dispatch(treePickerActions.ACTIVATE_TREE_PICKER_NODE({ id: item.id, pickerId, relatedTreePickers }));
if (props.toggleItemActive) {
diff --git a/src/views-components/side-panel-tree/side-panel-tree.tsx b/src/views-components/side-panel-tree/side-panel-tree.tsx
index e2465d2..8214624 100644
--- a/src/views-components/side-panel-tree/side-panel-tree.tsx
+++ b/src/views-components/side-panel-tree/side-panel-tree.tsx
@@ -16,7 +16,7 @@ import { IconType } from '~/components/icon/icon';
const relatedTreePickers = values(SidePanelTreeId);
-export type SidePanelTreesProps = Pick<ProjectsTreePickerProps, 'toggleItemActive'>;
+export type SidePanelTreesProps = Pick<ProjectsTreePickerProps, 'toggleItemActive' | 'onContextMenu'>;
export const SidePanelTrees = (props: SidePanelTreesProps) =>
<div>
diff --git a/src/views-components/side-panel/side-panel.tsx b/src/views-components/side-panel/side-panel.tsx
index 80916e5..7bfc6bd 100644
--- a/src/views-components/side-panel/side-panel.tsx
+++ b/src/views-components/side-panel/side-panel.tsx
@@ -8,6 +8,7 @@ import { SidePanelTrees as SidePanelTreesComponent, SidePanelTreesProps } from '
import { navigateFromSidePanel } from '~/store/side-panel/side-panel-action';
import { Grid } from '@material-ui/core';
import { SidePanelButton } from '~/views-components/side-panel-button/side-panel-button';
+import { openSidePanelContextMenu } from '~/store/context-menu/context-menu-actions';
export const SidePanel = () =>
<Grid item xs>
@@ -17,6 +18,7 @@ export const SidePanel = () =>
const dispatchProps: SidePanelTreesProps = {
toggleItemActive: (_, { id }) => navigateFromSidePanel(id),
+ onContextMenu: (event, { id }) => openSidePanelContextMenu(event, id),
};
const SidePanelTrees = connect(
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list