X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/71b9264c1720e619f8cfcb297a7848ece420c61c..f470b41502497ccc4b37872cc921d71e57a37986:/src/store/data-explorer/data-explorer-reducer.ts diff --git a/src/store/data-explorer/data-explorer-reducer.ts b/src/store/data-explorer/data-explorer-reducer.ts index 0fa32905..7705a891 100644 --- a/src/store/data-explorer/data-explorer-reducer.ts +++ b/src/store/data-explorer/data-explorer-reducer.ts @@ -8,7 +8,7 @@ import { SortDirection, toggleSortDirection } from "~/components/data-table/data-column"; -import { DataExplorerAction, dataExplorerActions } from "./data-explorer-action"; +import { DataExplorerAction, dataExplorerActions, DataTableRequestState } from "./data-explorer-action"; import { DataColumns, DataTableFetchMode } from "~/components/data-table/data-table"; import { DataTableFilters } from "~/components/data-table-filters/data-table-filters-tree"; @@ -22,6 +22,7 @@ export interface DataExplorer { rowsPerPageOptions: number[]; searchValue: string; working?: boolean; + requestState: DataTableRequestState; } export const initialDataExplorer: DataExplorer = { @@ -30,9 +31,10 @@ export const initialDataExplorer: DataExplorer = { items: [], itemsAvailable: 0, page: 0, - rowsPerPage: 10, - rowsPerPageOptions: [5, 10, 25, 50], - searchValue: "" + rowsPerPage: 50, + rowsPerPageOptions: [50, 100, 200, 500], + searchValue: "", + requestState: DataTableRequestState.IDLE }; export type DataExplorerState = Record; @@ -75,6 +77,9 @@ export const dataExplorerReducer = (state: DataExplorerState = {}, action: DataE SET_EXPLORER_SEARCH_VALUE: ({ id, searchValue }) => update(state, id, explorer => ({ ...explorer, searchValue })), + SET_REQUEST_STATE: ({ id, requestState }) => + update(state, id, explorer => ({ ...explorer, requestState })), + TOGGLE_SORT: ({ id, columnName }) => update(state, id, mapColumns(toggleSort(columnName))),