X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/8775768ca3a344775c81b7278a50d56d9be3f9b6..32dcbe112366f6ce4037e87527aac5ea7865bee0:/src/store/search-bar/search-bar-reducer.ts diff --git a/src/store/search-bar/search-bar-reducer.ts b/src/store/search-bar/search-bar-reducer.ts index 97e22d7e1e..ce2a77ccae 100644 --- a/src/store/search-bar/search-bar-reducer.ts +++ b/src/store/search-bar/search-bar-reducer.ts @@ -3,10 +3,14 @@ // SPDX-License-Identifier: AGPL-3.0 import { searchBarActions, SearchBarActions } from '~/store/search-bar/search-bar-actions'; +import { GroupContentsResource } from '~/services/groups-service/groups-service'; interface SearchBar { currentView: string; open: boolean; + searchResults: GroupContentsResource[]; + searchValue: string; + savedQueries: string[]; } export enum SearchView { @@ -17,7 +21,10 @@ export enum SearchView { const initialState: SearchBar = { currentView: SearchView.BASIC, - open: false + open: false, + searchResults: [], + searchValue: '', + savedQueries: [''] }; export const searchBarReducer = (state = initialState, action: SearchBarActions): SearchBar => @@ -25,5 +32,8 @@ export const searchBarReducer = (state = initialState, action: SearchBarActions) SET_CURRENT_VIEW: currentView => ({ ...state, currentView }), OPEN_SEARCH_VIEW: () => ({ ...state, open: true }), CLOSE_SEARCH_VIEW: () => ({ ...state, open: false }), + SET_SEARCH_RESULTS: (searchResults) => ({ ...state, searchResults }), + SET_SEARCH_VALUE: (searchValue) => ({ ...state, searchValue }), + SET_SAVED_QUERIES: savedQueries => ({ ...state, savedQueries }), default: () => state }); \ No newline at end of file