X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/eede2d8dc696f24552414b2425bb5d3a745280cc..9e4b7889a99ff2f76d8029aef3a85c4620178ba3:/src/views/data-explorer/data-explorer.tsx diff --git a/src/views/data-explorer/data-explorer.tsx b/src/views/data-explorer/data-explorer.tsx index 5f17b638f1..20c6df55b1 100644 --- a/src/views/data-explorer/data-explorer.tsx +++ b/src/views/data-explorer/data-explorer.tsx @@ -3,7 +3,6 @@ // SPDX-License-Identifier: AGPL-3.0 import * as React from 'react'; -import { DataTableProps } from "../../components/data-table"; import { RouteComponentProps } from 'react-router'; import { Project } from '../../models/project'; import { ProjectState, findTreeItem } from '../../store/project/project-reducer'; @@ -11,20 +10,17 @@ import { RootState } from '../../store/store'; import { connect, DispatchProp } from 'react-redux'; import { push } from 'react-router-redux'; import projectActions from "../../store/project/project-action"; -import { DataExplorer, DataItem } from '../../components/data-explorer'; -import { TreeItem } from '../../components/tree/tree'; +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 { mapProjectTreeItem } from "../../views-selectors/data-explorer/data-explorer"; interface DataExplorerViewDataProps { projects: ProjectState; } type DataExplorerViewProps = DataExplorerViewDataProps & RouteComponentProps<{ name: string }> & DispatchProp; - -type DataExplorerViewState = Pick, "columns">; - -interface MappedProjectItem extends DataItem { - uuid: string; -} +type DataExplorerViewState = DataColumns; class DataExplorerView extends React.Component { @@ -33,28 +29,18 @@ class DataExplorerView extends React.Component ); } - goToProject = (project: MappedProjectItem) => { - this.props.dispatch(push(`/project/${project.uuid}`)); - this.props.dispatch(projectActions.TOGGLE_PROJECT_TREE_ITEM(project.uuid)); + goToProject = (item: DataItem) => { + this.props.dispatch(push(`/project/${item.uuid}`)); + this.props.dispatch(projectActions.TOGGLE_PROJECT_TREE_ITEM(item.uuid)); } - } -const mapTreeItem = (item: TreeItem): MappedProjectItem => ({ - name: item.data.name, - type: item.data.kind, - owner: item.data.ownerUuid, - lastModified: item.data.modifiedAt, - uuid: item.data.uuid -}); - - export default connect( (state: RootState) => ({ projects: state.projects