[arvados] updated: 2.7.0-6276-gf3207157e3

git repository hosting git at public.arvados.org
Thu May 30 17:29:17 UTC 2024


Summary of changes:
 .../src/components/data-explorer/data-explorer.tsx          | 13 ++++++++++++-
 .../src/views-components/data-explorer/data-explorer.tsx    |  3 ++-
 2 files changed, 14 insertions(+), 2 deletions(-)

       via  f3207157e37645e509cebd48486991e496b05c1c (commit)
      from  4bb6dd0ff6e6543d378efae4387fe6a726290c88 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit f3207157e37645e509cebd48486991e496b05c1c
Author: Lisa Knox <lisaknox83 at gmail.com>
Date:   Thu May 30 13:29:07 2024 -0400

    21364: stopped itemsAvailable count from resetting on load more click
    
    Arvados-DCO-1.1-Signed-off-by: Lisa Knox <lisa.knox at curii.com>

diff --git a/services/workbench2/src/components/data-explorer/data-explorer.tsx b/services/workbench2/src/components/data-explorer/data-explorer.tsx
index 91ece48c3a..063e34cda7 100644
--- a/services/workbench2/src/components/data-explorer/data-explorer.tsx
+++ b/services/workbench2/src/components/data-explorer/data-explorer.tsx
@@ -107,6 +107,7 @@ interface DataExplorerDataProps<T> {
     isMSToolbarVisible: boolean;
     checkedList: TCheckedList;
     isNotFound: boolean;
+    searchBarValue: string;
 }
 
 interface DataExplorerActionProps<T> {
@@ -132,6 +133,7 @@ export const DataExplorer = withStyles(styles)(
     class DataExplorerGeneric<T> extends React.Component<DataExplorerProps<T>> {
 
         multiSelectToolbarInTitle = !this.props.title && !this.props.progressBar;
+        maxItemsAvailable = 0;
 
         componentDidMount() {
             if (this.props.onSetColumns) {
@@ -139,6 +141,15 @@ export const DataExplorer = withStyles(styles)(
             }
         }
 
+        componentDidUpdate( prevProps: Readonly<DataExplorerProps<T>>, prevState: Readonly<{}>, snapshot?: any ): void {
+            if (this.props.itemsAvailable !== prevProps.itemsAvailable) {
+                this.maxItemsAvailable = Math.max(this.maxItemsAvailable, this.props.itemsAvailable);
+            }
+            if (this.props.searchBarValue !== prevProps.searchBarValue) {
+                this.maxItemsAvailable = 0;
+            }
+        }
+
         render() {
             const {
                 columns,
@@ -326,7 +337,7 @@ export const DataExplorer = withStyles(styles)(
                                     ) : (
                                         <Grid className={classes.loadMoreContainer}>
                                             <Typography  className={classes.numResults}>
-                                                Showing {items.length} / {itemsAvailable} results
+                                                Showing {items.length} / {this.maxItemsAvailable} results
                                             </Typography>
                                             <Button
                                                 size="small"
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 c2cea62a8b..21818fac30 100644
--- a/services/workbench2/src/views-components/data-explorer/data-explorer.tsx
+++ b/services/workbench2/src/views-components/data-explorer/data-explorer.tsx
@@ -22,7 +22,7 @@ interface Props {
     working?: boolean;
 }
 
-const mapStateToProps = ({ progressIndicator, dataExplorer, router, multiselect, detailsPanel, properties}: RootState, { id }: Props) => {
+const mapStateToProps = ({ progressIndicator, dataExplorer, router, multiselect, detailsPanel, properties, searchBar}: RootState, { id }: Props) => {
     const working = !!progressIndicator.some(p => p.working);
     const dataExplorerState = getDataExplorer(dataExplorer, id);
     const currentRoute = router.location ? router.location.pathname : "";
@@ -39,6 +39,7 @@ const mapStateToProps = ({ progressIndicator, dataExplorer, router, multiselect,
         isMSToolbarVisible,
         checkedList: multiselect.checkedList,
         working,
+        searchBarValue: searchBar.searchValue,
     };
 };
 

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list