[arvados-workbench2] updated: 2.4.0-381-g3f3ea67a

git repository hosting git at public.arvados.org
Thu Dec 15 09:42:48 UTC 2022


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

       via  3f3ea67a093f3521fe613f0f82247b622c48b9b0 (commit)
      from  6ed29d15f871865afa2a2321075cbd9fdf2d46ba (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 3f3ea67a093f3521fe613f0f82247b622c48b9b0
Author: Lucas Di Pentima <lucas.dipentima at curii.com>
Date:   Thu Dec 15 10:41:35 2022 +0100

    19865: Improved search box reset on route change.
    
    Instead of querying the location bar, rely on already existing mechanisms
    from DataExplorer to detect route changes.
    
    Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas.dipentima at curii.com>

diff --git a/src/components/data-explorer/data-explorer.tsx b/src/components/data-explorer/data-explorer.tsx
index 052a5ae9..549c4765 100644
--- a/src/components/data-explorer/data-explorer.tsx
+++ b/src/components/data-explorer/data-explorer.tsx
@@ -82,7 +82,6 @@ interface DataExplorerDataProps<T> {
     title?: React.ReactNode;
     paperKey?: string;
     currentItemUuid: string;
-    currentPath: string;
     elementPath?: string;
 }
 
@@ -110,6 +109,7 @@ export const DataExplorer = withStyles(styles)(
             showLoading: false,
             prevRefresh: '',
             prevRoute: '',
+            searchValue: '',
         };
 
         componentDidUpdate(prevProps: DataExplorerProps<T>) {
@@ -119,9 +119,11 @@ export const DataExplorer = withStyles(styles)(
             if (currentRoute !== this.state.prevRoute) {
                 // Component already mounted, but the user comes from a route change,
                 // like browsing through a project hierarchy.
+                this.props.onSearch('');
                 this.setState({
                     showLoading: this.props.working,
                     prevRoute: currentRoute,
+                    searchValue: '', // reset search on navigation
                 });
             }
 
@@ -145,20 +147,22 @@ export const DataExplorer = withStyles(styles)(
                 this.props.onSetColumns(this.props.columns);
             }
             // Component just mounted, so we need to show the loading indicator.
+            this.props.onSearch('');
             this.setState({
                 showLoading: this.props.working,
                 prevRefresh: this.props.currentRefresh || '',
                 prevRoute: this.props.currentRoute || '',
+                searchValue: '',
             });
         }
 
         render() {
             const {
                 columns, onContextMenu, onFiltersChange, onSortToggle, extractKey,
-                rowsPerPage, rowsPerPageOptions, onColumnToggle, searchLabel, searchValue, onSearch,
+                rowsPerPage, rowsPerPageOptions, onColumnToggle, searchLabel, onSearch,
                 items, itemsAvailable, onRowClick, onRowDoubleClick, classes,
                 defaultViewIcon, defaultViewMessages, hideColumnSelector, actions, paperProps, hideSearchInput,
-                paperKey, fetchMode, currentItemUuid, currentPath, title,
+                paperKey, fetchMode, currentItemUuid, title,
                 doHidePanel, doMaximizePanel, doUnMaximizePanel, panelName, panelMaximized, elementPath
             } = this.props;
 
@@ -173,8 +177,8 @@ export const DataExplorer = withStyles(styles)(
                                     {!hideSearchInput && <div className={classes.searchBox}>
                                         {!hideSearchInput && <SearchInput
                                             label={searchLabel}
-                                            value={searchValue}
-                                            selfClearProp={currentPath}
+                                            value={this.state.searchValue}
+                                            selfClearProp={''}
                                             onSearch={onSearch} />}
                                     </div>}
                                     {actions}
diff --git a/src/views-components/data-explorer/data-explorer.tsx b/src/views-components/data-explorer/data-explorer.tsx
index 2f8eca11..2a0d1f47 100644
--- a/src/views-components/data-explorer/data-explorer.tsx
+++ b/src/views-components/data-explorer/data-explorer.tsx
@@ -27,7 +27,6 @@ const mapStateToProps = (state: RootState, { id }: Props) => {
     const currentRoute = state.router.location ? state.router.location.pathname : '';
     const currentRefresh = localStorage.getItem(LAST_REFRESH_TIMESTAMP) || '';
     const currentItemUuid = currentRoute === '/workflows' ? state.properties.workflowPanelDetailsUuid : state.detailsPanel.resourceUuid;
-    const currentPath = state.router.location?.pathname;
 
     return {
         ...dataExplorerState,
@@ -36,7 +35,6 @@ const mapStateToProps = (state: RootState, { id }: Props) => {
         currentRoute: currentRoute,
         paperKey: currentRoute,
         currentItemUuid,
-        currentPath,
     };
 };
 

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list