18123: Add isActive checkbox to group member list for user members
[arvados-workbench2.git] / src / store / search-results-panel / search-results-panel-actions.ts
index f7dc5d458f7fde7eb3af468253d4d816c5e5761f..e1bcfa853b17a718e82a7b2e0271fcb3b0f5f459 100644 (file)
@@ -3,10 +3,11 @@
 // SPDX-License-Identifier: AGPL-3.0
 
 import { Dispatch } from 'redux';
-import { RootState } from '~/store/store';
-import { ServiceRepository } from '~/services/services';
-import { bindDataExplorerActions } from '~/store/data-explorer/data-explorer-action';
-import { setBreadcrumbs } from '~/store/breadcrumbs/breadcrumbs-actions';
+import { RootState } from 'store/store';
+import { ServiceRepository } from 'services/services';
+import { bindDataExplorerActions } from 'store/data-explorer/data-explorer-action';
+import { setBreadcrumbs } from 'store/breadcrumbs/breadcrumbs-actions';
+import { searchBarActions } from 'store/search-bar/search-bar-actions';
 
 export const SEARCH_RESULTS_PANEL_ID = "searchResultsPanel";
 export const searchResultsPanelActions = bindDataExplorerActions(SEARCH_RESULTS_PANEL_ID);
@@ -14,5 +15,15 @@ export const searchResultsPanelActions = bindDataExplorerActions(SEARCH_RESULTS_
 export const loadSearchResultsPanel = () =>
     (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
         dispatch(setBreadcrumbs([{ label: 'Search results' }]));
-        dispatch(searchResultsPanelActions.REQUEST_ITEMS());
-    };
\ No newline at end of file
+        const loc = getState().router.location;
+        if (loc !== null) {
+            const search = new URLSearchParams(loc.search);
+            const q = search.get('q');
+            if (q !== null) {
+                dispatch(searchBarActions.SET_SEARCH_VALUE(q));
+            }
+        }
+        dispatch(searchBarActions.SET_SEARCH_RESULTS([]));
+        dispatch(searchResultsPanelActions.CLEAR());
+        dispatch(searchResultsPanelActions.REQUEST_ITEMS(true));
+    };