import { push } from 'react-router-redux';
import projectActions from "../../store/project/project-action";
import { DataColumns } from "../../components/data-table/data-table";
-import { DataItem } from "../../views-components/data-explorer/data-item";
-import DataExplorer from "../../views-components/data-explorer/data-explorer";
+import DataExplorer, { DataExplorerContextActions } from "../../views-components/data-explorer/data-explorer";
import { mapProjectTreeItem } from "./data-explorer-selectors";
+import { DataItem } from "../../views-components/data-explorer/data-item";
interface DataExplorerViewDataProps {
projects: ProjectState;
<DataExplorer
items={projectItems.map(mapProjectTreeItem)}
onItemClick={this.goToProject}
+ contextActions={this.contextActions}
/>
);
}
+ contextActions: DataExplorerContextActions = {
+ onAddToFavourite: console.log,
+ onCopy: console.log,
+ onDownload: console.log,
+ onMoveTo: console.log,
+ onRemove: console.log,
+ onRename: console.log,
+ onShare: console.log
+ };
+
goToProject = (item: DataItem) => {
- this.props.dispatch(push(`/project/${item.uuid}`));
+ this.props.dispatch(push(`/project/${item}`));
this.props.dispatch(projectActions.TOGGLE_PROJECT_TREE_ITEM(item.uuid));
}
}