X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/bc427c3f9f88acefbe12d7b9043d845acf5635a7..1c7242e61e9d71c7a37483ec0583dd0256f8ee7e:/src/views-components/context-menu/context-menu.tsx

diff --git a/src/views-components/context-menu/context-menu.tsx b/src/views-components/context-menu/context-menu.tsx
index 2f837d5a78..8b00893703 100644
--- a/src/views-components/context-menu/context-menu.tsx
+++ b/src/views-components/context-menu/context-menu.tsx
@@ -4,19 +4,20 @@
 
 import { connect } from "react-redux";
 import { RootState } from "../../store/store";
-import actions from "../../store/context-menu/context-menu-actions";
-import ContextMenu, { ContextMenuProps, ContextMenuItem } from "../../components/context-menu/context-menu";
+import { contextMenuActions } from "../../store/context-menu/context-menu-actions";
+import { ContextMenu as ContextMenuComponent, ContextMenuProps, ContextMenuItem } from "../../components/context-menu/context-menu";
 import { createAnchorAt } from "../../components/popover/helpers";
 import { ContextMenuResource } from "../../store/context-menu/context-menu-reducer";
 import { ContextMenuActionSet, ContextMenuAction } from "./context-menu-action-set";
 import { Dispatch } from "redux";
 
-type DataProps = Pick<ContextMenuProps, "anchorEl" | "items"> & { resource?: ContextMenuResource };
+type DataProps = Pick<ContextMenuProps, "anchorEl" | "items" | "open"> & { resource?: ContextMenuResource };
 const mapStateToProps = (state: RootState): DataProps => {
-    const { position, resource } = state.contextMenu;
+    const { open, position, resource } = state.contextMenu;
     return {
         anchorEl: resource ? createAnchorAt(position) : undefined,
         items: getMenuActionSet(resource),
+        open,
         resource
     };
 };
@@ -24,10 +25,10 @@ const mapStateToProps = (state: RootState): DataProps => {
 type ActionProps = Pick<ContextMenuProps, "onClose"> & { onItemClick: (item: ContextMenuItem, resource?: ContextMenuResource) => void };
 const mapDispatchToProps = (dispatch: Dispatch): ActionProps => ({
     onClose: () => {
-        dispatch(actions.CLOSE_CONTEXT_MENU());
+        dispatch(contextMenuActions.CLOSE_CONTEXT_MENU());
     },
     onItemClick: (action: ContextMenuAction, resource?: ContextMenuResource) => {
-        dispatch(actions.CLOSE_CONTEXT_MENU());
+        dispatch(contextMenuActions.CLOSE_CONTEXT_MENU());
         if (resource) {
             action.execute(dispatch, resource);
         }
@@ -42,7 +43,7 @@ const mergeProps = ({ resource, ...dataProps }: DataProps, actionProps: ActionPr
     }
 });
 
-export const ContextMenuHOC = connect(mapStateToProps, mapDispatchToProps, mergeProps)(ContextMenu);
+export const ContextMenu = connect(mapStateToProps, mapDispatchToProps, mergeProps)(ContextMenuComponent);
 
 const menuActionSets = new Map<string, ContextMenuActionSet>();
 
@@ -54,3 +55,12 @@ const getMenuActionSet = (resource?: ContextMenuResource): ContextMenuActionSet
     return resource ? menuActionSets.get(resource.kind) || [] : [];
 };
 
+export enum ContextMenuKind {
+    ROOT_PROJECT = "RootProject",
+    PROJECT = "Project",
+    RESOURCE = "Resource",
+    FAVORITE = "Favorite",
+    COLLECTION_FILES = "CollectionFiles",
+    COLLECTION_FILES_ITEM = "CollectionFilesItem",
+    COLLECTION = 'Collection'
+}
