X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/5d2d4c926ba82b3147c7a315e1b5c8a49b71e9d2..f80a908d033729d3fb63e2611e3bd11d94fa2a65:/src/views-components/data-explorer/data-explorer.tsx diff --git a/src/views-components/data-explorer/data-explorer.tsx b/src/views-components/data-explorer/data-explorer.tsx index d548f607..59555707 100644 --- a/src/views-components/data-explorer/data-explorer.tsx +++ b/src/views-components/data-explorer/data-explorer.tsx @@ -14,29 +14,26 @@ import { DataColumns } from "~/components/data-table/data-table"; interface Props { id: string; - columns: DataColumns; onRowClick: (item: any) => void; - onContextMenu: (event: React.MouseEvent, item: any) => void; + onContextMenu?: (event: React.MouseEvent, item: any) => void; onRowDoubleClick: (item: any) => void; extractKey?: (item: any) => React.Key; } -const mapStateToProps = (state: RootState, { id, columns }: Props) => { - const s = getDataExplorer(state.dataExplorer, id); - if (s.columns.length === 0) { - s.columns = columns; - } - return s; +const mapStateToProps = (state: RootState, { id }: Props) => { + const progress = state.progressIndicator.find(p => p.id === id); + const working = progress && progress.working; + return { ...getDataExplorer(state.dataExplorer, id), working }; }; const mapDispatchToProps = () => { - return (dispatch: Dispatch, { id, columns, onRowClick, onRowDoubleClick, onContextMenu }: Props) => ({ + return (dispatch: Dispatch, { id, onRowClick, onRowDoubleClick, onContextMenu }: Props) => ({ onSetColumns: (columns: DataColumns) => { dispatch(dataExplorerActions.SET_COLUMNS({ id, columns })); }, onSearch: (searchValue: string) => { - dispatch(dataExplorerActions.SET_SEARCH_VALUE({ id, searchValue })); + dispatch(dataExplorerActions.SET_EXPLORER_SEARCH_VALUE({ id, searchValue })); }, onColumnToggle: (column: DataColumn) => {