X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/eda7767bc88b7a2a3dc582af47417937ff4de38a..00f6263122e23665b758b0182e9d478844713bf9:/src/views-components/details-panel/collection-details.tsx

diff --git a/src/views-components/details-panel/collection-details.tsx b/src/views-components/details-panel/collection-details.tsx
index 6066a5889f..d31a83d11e 100644
--- a/src/views-components/details-panel/collection-details.tsx
+++ b/src/views-components/details-panel/collection-details.tsx
@@ -14,8 +14,7 @@ import { Grid, ListItem, StyleRulesCallback, Typography, withStyles, WithStyles
 import { formatDate, formatFileSize } from '~/common/formatters';
 import { Dispatch } from 'redux';
 import { navigateTo } from '~/store/navigation/navigation-action';
-import { resourceKindToContextMenuKind, openContextMenu } from '~/store/context-menu/context-menu-actions';
-import { ContextMenuKind } from '../context-menu/context-menu';
+import { openContextMenu, resourceUuidToContextMenuKind } from '~/store/context-menu/context-menu-actions';
 
 export type CssRules = 'versionBrowserHeader' | 'versionBrowserItem';
 
@@ -67,7 +66,7 @@ interface CollectionVersionBrowserProps {
 
 interface CollectionVersionBrowserDispatchProps {
     showVersion: (c: CollectionResource) => void;
-    handleContextMenu: (event: React.MouseEvent<HTMLElement>, collection: CollectionResource, menuKind: ContextMenuKind | undefined) => void;
+    handleContextMenu: (event: React.MouseEvent<HTMLElement>, collection: CollectionResource) => void;
 }
 
 const mapStateToProps = (state: RootState): CollectionVersionBrowserProps => {
@@ -84,7 +83,8 @@ const mapStateToProps = (state: RootState): CollectionVersionBrowserProps => {
 const mapDispatchToProps = () =>
     (dispatch: Dispatch): CollectionVersionBrowserDispatchProps => ({
         showVersion: (collection) => dispatch<any>(navigateTo(collection.uuid)),
-        handleContextMenu: (event: React.MouseEvent<HTMLElement>, collection: CollectionResource, menuKind: ContextMenuKind) => {
+        handleContextMenu: (event: React.MouseEvent<HTMLElement>, collection: CollectionResource) => {
+            const menuKind = dispatch<any>(resourceUuidToContextMenuKind(collection.uuid));
             if (collection && menuKind) {
                 dispatch<any>(openContextMenu(event, {
                     name: collection.name,
@@ -125,14 +125,7 @@ const CollectionVersionBrowser = withStyles(styles)(
                             data-cy={`collection-version-browser-select-${item.version}`}
                             key={item.version}
                             onClick={e => showVersion(item)}
-                            onContextMenu={event => handleContextMenu(
-                                event,
-                                item,
-                                resourceKindToContextMenuKind(
-                                    item.uuid,
-                                    isAdmin,
-                                    (item.uuid === item.currentVersionUuid))
-                            )}
+                            onContextMenu={event => handleContextMenu(event, item)}
                             selected={isSelectedVersion}>
                             <Grid item xs={2}>
                                 <Typography variant="caption" className={classes.versionBrowserItem}>
