From fc1dd95eef3ad41a0bc73bdc1423cd6877e5eb8c Mon Sep 17 00:00:00 2001 From: Lisa Knox Date: Mon, 1 Apr 2024 15:27:58 -0400 Subject: [PATCH] 21364: loadmore button now disables if it cant load more Arvados-DCO-1.1-Signed-off-by: Lisa Knox --- .../workbench2/src/components/data-explorer/data-explorer.tsx | 4 +++- .../src/store/data-explorer/data-explorer-reducer.ts | 2 +- .../src/views-components/data-explorer/data-explorer.tsx | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/services/workbench2/src/components/data-explorer/data-explorer.tsx b/services/workbench2/src/components/data-explorer/data-explorer.tsx index 83a71ab509..13ad46286c 100644 --- a/services/workbench2/src/components/data-explorer/data-explorer.tsx +++ b/services/workbench2/src/components/data-explorer/data-explorer.tsx @@ -169,6 +169,7 @@ export const DataExplorer = withStyles(styles)( setCheckedListOnStore, checkedList, working, + page, } = this.props; return ( = itemsAvailable || (itemsAvailable === 0 && page === 0)} > Load more diff --git a/services/workbench2/src/store/data-explorer/data-explorer-reducer.ts b/services/workbench2/src/store/data-explorer/data-explorer-reducer.ts index 2bc8caad36..41dca03b68 100644 --- a/services/workbench2/src/store/data-explorer/data-explorer-reducer.ts +++ b/services/workbench2/src/store/data-explorer/data-explorer-reducer.ts @@ -95,7 +95,7 @@ export const dataExplorerReducer = ( update(state, id, (explorer) => ({ ...explorer, items: state[id].items.concat(items), - itemsAvailable: state[id].itemsAvailable + itemsAvailable, + itemsAvailable: itemsAvailable, page, rowsPerPage, })), diff --git a/services/workbench2/src/views-components/data-explorer/data-explorer.tsx b/services/workbench2/src/views-components/data-explorer/data-explorer.tsx index 643949a20e..c2cea62a8b 100644 --- a/services/workbench2/src/views-components/data-explorer/data-explorer.tsx +++ b/services/workbench2/src/views-components/data-explorer/data-explorer.tsx @@ -23,7 +23,7 @@ interface Props { } const mapStateToProps = ({ progressIndicator, dataExplorer, router, multiselect, detailsPanel, properties}: RootState, { id }: Props) => { - const working = !!progressIndicator.some(p => p.id === id && p.working); + const working = !!progressIndicator.some(p => p.working); const dataExplorerState = getDataExplorer(dataExplorer, id); const currentRoute = router.location ? router.location.pathname : ""; const isDetailsResourceChecked = multiselect.checkedList[detailsPanel.resourceUuid] -- 2.30.2