From: Michal Klobukowski Date: Sun, 1 Jul 2018 20:38:12 +0000 (+0200) Subject: Clean up the code according to code review X-Git-Tag: 1.2.0~63^2 X-Git-Url: https://git.arvados.org/arvados-workbench2.git/commitdiff_plain/e00f9cc69e8e98679c4cb310ff1399c4f1abff71 Clean up the code according to code review Feature #13678 Arvados-DCO-1.1-Signed-off-by: Michal Klobukowski --- diff --git a/src/components/data-explorer/data-explorer.tsx b/src/components/data-explorer/data-explorer.tsx index de9cb45d..ff51c71c 100644 --- a/src/components/data-explorer/data-explorer.tsx +++ b/src/components/data-explorer/data-explorer.tsx @@ -63,9 +63,7 @@ class DataExplorer extends React.Component & WithStyles< this.props.onRowClick(item)} onRowContextMenu={this.openContextMenu} @@ -121,12 +119,12 @@ class DataExplorer extends React.Component & WithStyles< renderContextMenuTrigger = (item: T) => - this.openContextMenuWithTrigger(event, item)}> + this.openContextMenuTrigger(event, item)}> - openContextMenuWithTrigger = (event: React.MouseEvent, item: T) => { + openContextMenuTrigger = (event: React.MouseEvent, item: T) => { event.preventDefault(); this.setState({ contextMenu: { diff --git a/src/store/data-explorer/data-explorer-action.ts b/src/store/data-explorer/data-explorer-action.ts index c4ff6145..fd3a7afe 100644 --- a/src/store/data-explorer/data-explorer-action.ts +++ b/src/store/data-explorer/data-explorer-action.ts @@ -3,27 +3,20 @@ // SPDX-License-Identifier: AGPL-3.0 import { default as unionize, ofType, UnionOf } from "unionize"; -import { SortDirection, DataColumn } from "../../components/data-table/data-column"; import { DataTableFilterItem } from "../../components/data-table-filters/data-table-filters"; import { DataColumns } from "../../components/data-table/data-table"; -type WithId = T & { id: string }; - const actions = unionize({ - SET_COLUMNS: ofType }>>(), - SET_FILTERS: ofType>(), - SET_ITEMS: ofType>(), - SET_PAGE: ofType>(), - SET_ROWS_PER_PAGE: ofType>(), - TOGGLE_COLUMN: ofType>(), - TOGGLE_SORT: ofType>(), - SET_SEARCH_VALUE: ofType>() + SET_COLUMNS: ofType<{id: string, columns: DataColumns }>(), + SET_FILTERS: ofType<{id: string,columnName: string, filters: DataTableFilterItem[]}>(), + SET_ITEMS: ofType<{id: string,items: any[]}>(), + SET_PAGE: ofType<{id: string,page: number}>(), + SET_ROWS_PER_PAGE: ofType<{id: string,rowsPerPage: number}>(), + TOGGLE_COLUMN: ofType<{id: string, columnName: string }>(), + TOGGLE_SORT: ofType<{id: string, columnName: string }>(), + SET_SEARCH_VALUE: ofType<{id: string,searchValue: string}>() }, { tag: "type", value: "payload" }); export type DataExplorerAction = UnionOf; export default actions; - - - -