[arvados-workbench2] created: 2.4.0-408-g2320420d

git repository hosting git at public.arvados.org
Thu Dec 15 13:32:20 UTC 2022


        at  2320420dc775b0aa6d51332e265bc9cd142cf4c6 (commit)


commit 2320420dc775b0aa6d51332e265bc9cd142cf4c6
Author: Lucas Di Pentima <lucas.dipentima at curii.com>
Date:   Wed Dec 14 21:52:10 2022 +0100

    19865: Resets the search term on route changes.
    
    Instead of passing the UUID of the selected object, pass the current location
    path, so navigation actions that change said path will trigger an input
    field reset, but selecting different items in the table won't.
    
    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 e4eef593..0183d481 100644
--- a/src/components/data-explorer/data-explorer.tsx
+++ b/src/components/data-explorer/data-explorer.tsx
@@ -118,9 +118,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
                 });
             }
 
@@ -172,7 +174,7 @@ export const DataExplorer = withStyles(styles)(
                                         {!hideSearchInput && <SearchInput
                                             label={searchLabel}
                                             value={searchValue}
-                                            selfClearProp={currentItemUuid}
+                                            selfClearProp={''}
                                             onSearch={onSearch} />}
                                     </div>}
                                     {actions}
diff --git a/src/components/search-input/search-input.tsx b/src/components/search-input/search-input.tsx
index 6d85ed22..fbb4f599 100644
--- a/src/components/search-input/search-input.tsx
+++ b/src/components/search-input/search-input.tsx
@@ -71,7 +71,7 @@ export const SearchInput = (props: SearchInputProps) => {
             () => {
                 props.onSearch(eventValue);
             },
-             props.debounce || DEFAULT_SEARCH_DEBOUNCE
+            props.debounce || DEFAULT_SEARCH_DEBOUNCE
         ));
     };
 
diff --git a/src/views-components/data-explorer/data-explorer.tsx b/src/views-components/data-explorer/data-explorer.tsx
index 46aca455..48046987 100644
--- a/src/views-components/data-explorer/data-explorer.tsx
+++ b/src/views-components/data-explorer/data-explorer.tsx
@@ -33,7 +33,7 @@ const mapStateToProps = (state: RootState, { id }: Props) => {
         currentRefresh: currentRefresh,
         currentRoute: currentRoute,
         paperKey: currentRoute,
-        currentItemUuid
+        currentItemUuid,
     };
 };
 

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list