From: Pawel Kowalczyk Date: Mon, 15 Oct 2018 13:32:37 +0000 (+0200) Subject: merge master X-Git-Tag: 1.3.0~62^2~4 X-Git-Url: https://git.arvados.org/arvados-workbench2.git/commitdiff_plain/2cfb56ef5060cbad461062690fad650f15c49731 merge master Feature #14277 Arvados-DCO-1.1-Signed-off-by: Pawel Kowalczyk --- 2cfb56ef5060cbad461062690fad650f15c49731 diff --cc src/store/search-bar/search-bar-actions.ts index 394920a5,f7527852..771cbc89 --- a/src/store/search-bar/search-bar-actions.ts +++ b/src/store/search-bar/search-bar-actions.ts @@@ -10,9 -10,7 +10,10 @@@ import { ServiceRepository } from '~/se import { FilterBuilder } from "~/services/api/filter-builder"; import { ResourceKind } from '~/models/resource'; import { GroupClass } from '~/models/group'; +import { SearchView } from '~/store/search-bar/search-bar-reducer'; +import { navigateToSearchResults, navigateTo } from '~/store/navigation/navigation-action'; +import { snackbarActions, SnackbarKind } from '~/store/snackbar/snackbar-actions'; + import { SearchBarAdvanceFormData } from '~/models/search-bar'; export const searchBarActions = unionize({ SET_CURRENT_VIEW: ofType(), @@@ -75,24 -61,17 +65,28 @@@ export const openSearchView = () = dispatch(searchBarActions.SET_SAVED_QUERIES(savedSearchQueries)); }; - export const closeSearchView = () => + export const closeSearchView = () => (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => { - dispatch(searchBarActions.CLOSE_SEARCH_VIEW()); - dispatch(searchBarActions.SET_CURRENT_VIEW(SearchView.BASIC)); + const isOpen = getState().searchBar.open; + if(isOpen) { + dispatch(searchBarActions.CLOSE_SEARCH_VIEW()); ++ dispatch(searchBarActions.SET_CURRENT_VIEW(SearchView.BASIC)); + } }; + +export const navigateToItem = (uuid: string) => + (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => { + dispatch(searchBarActions.CLOSE_SEARCH_VIEW()); + dispatch(navigateTo(uuid)); + }; + export const searchData = (searchValue: string) => async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => { + const currentView = getState().searchBar.currentView; + if (currentView !== SearchView.AUTOCOMPLETE) { + dispatch(searchBarActions.CLOSE_SEARCH_VIEW()); + } dispatch(searchBarActions.SET_SEARCH_VALUE(searchValue)); dispatch(searchBarActions.SET_SEARCH_RESULTS([])); if (searchValue) { diff --cc src/views-components/search-bar/search-bar.tsx index 5c42af20,d6561c59..5208a7d6 --- a/src/views-components/search-bar/search-bar.tsx +++ b/src/views-components/search-bar/search-bar.tsx @@@ -12,11 -12,11 +12,12 @@@ import saveRecentQuery, loadRecentQueries, saveQuery, - openSearchView + openSearchView, - closeSearchView ++ closeSearchView, ++ navigateToItem } from '~/store/search-bar/search-bar-actions'; import { SearchBarView } from '~/views-components/search-bar/search-bar-view'; - import { SearchBarAdvanceFormData } from '~/store/search-bar/search-bar-actions'; - import { closeSearchView, navigateToItem } from '~/store/search-bar/search-bar-actions'; + import { SearchBarAdvanceFormData } from '~/models/search-bar'; const mapStateToProps = ({ searchBar }: RootState) => { return { diff --cc src/views/workbench/workbench.tsx index ade9a4e1,09435d09..788c96ae --- a/src/views/workbench/workbench.tsx +++ b/src/views/workbench/workbench.tsx @@@ -41,7 -41,12 +41,13 @@@ import { SharedWithMePanel } from '~/vi import { RunProcessPanel } from '~/views/run-process-panel/run-process-panel'; import SplitterLayout from 'react-splitter-layout'; import { WorkflowPanel } from '~/views/workflow-panel/workflow-panel'; +import { SearchResultsPanel } from '~/views/search-results-panel/search-results-panel'; + import { HomeTreePicker } from '~/views-components/projects-tree-picker/home-tree-picker'; + import { SharedTreePicker } from '~/views-components/projects-tree-picker/shared-tree-picker'; + import { FavoritesTreePicker } from '../../views-components/projects-tree-picker/favorites-tree-picker'; + import { ProjectsTreePicker } from '~/views-components/projects-tree-picker/projects-tree-picker'; + import { Chips } from '~/components/chips/chips'; + import { ChipsInput } from '../../components/chips-input/chips-input'; type CssRules = 'root' | 'container' | 'splitter' | 'asidePanel' | 'contentWrapper' | 'content';