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<string>(),
dispatch(searchBarActions.SET_SAVED_QUERIES(savedSearchQueries));
};
- export const closeSearchView = () =>
+ export const closeSearchView = () =>
(dispatch: Dispatch<any>, 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<any>, 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) {
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 {
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';