import { deleteCollectionTag } from '~/store/collection-panel/collection-panel-action';
import { snackbarActions } from '~/store/snackbar/snackbar-actions';
import { getResource } from '~/store/resources/resources';
-import { loadCollection } from '../../store/collection-panel/collection-panel-action';
-import { contextMenuActions } from '~/store/context-menu/context-menu-actions';
+import { openContextMenu } from '~/store/context-menu/context-menu-actions';
import { ContextMenuKind } from '~/views-components/context-menu/context-menu';
type CssRules = 'card' | 'iconHeader' | 'tag' | 'copyIcon' | 'label' | 'value';
};
})(
class extends React.Component<CollectionPanelProps> {
-
render() {
const { classes, item, tags } = this.props;
return <div>
<IconButton
aria-label="More options"
onClick={this.handleContextMenu}>
- <MoreOptionsIcon />
+ <Tooltip title="More options">
+ <MoreOptionsIcon />
+ </Tooltip>
</IconButton>
}
title={item && item.name}
}
handleContextMenu = (event: React.MouseEvent<any>) => {
- event.preventDefault();
- const { uuid, name, description } = this.props.item;
+ const { uuid, ownerUuid, name, description, kind } = this.props.item;
const resource = {
uuid,
+ ownerUuid,
name,
description,
- kind: ContextMenuKind.COLLECTION
+ kind,
+ menuKind: ContextMenuKind.COLLECTION
};
- this.props.dispatch(
- contextMenuActions.OPEN_CONTEXT_MENU({
- position: { x: event.clientX, y: event.clientY },
- resource
- })
- );
+ this.props.dispatch<any>(openContextMenu(event, resource));
}
handleDelete = (uuid: string) => () => {
hideDuration: 2000
}));
}
-
- componentDidMount() {
- const { match, item } = this.props;
- if (!item && match.params.id) {
- this.props.dispatch<any>(loadCollection(match.params.id));
- }
- }
-
}
)
);