SET_SEARCH_RESULTS: ofType<GroupContentsResource[]>(),
SET_SEARCH_VALUE: ofType<string>(),
SET_SAVED_QUERIES: ofType<SearchBarAdvanceFormData[]>(),
- UPDATE_SAVED_QUERY: ofType<SearchBarAdvanceFormData[]>()
-});
+ SET_RECENT_QUERIES: ofType<string[]>(),
+ UPDATE_SAVED_QUERY: ofType<SearchBarAdvanceFormData[]>(),
+ SET_SELECTED_ITEM: ofType<string>(),
+ MOVE_UP: ofType<{}>(),
+ MOVE_DOWN: ofType<{}>(),
+ SELECT_FIRST_ITEM: ofType<{}>()
- });
++});
export type SearchBarActions = UnionOf<typeof searchBarActions>;
};
export const searchData = (searchValue: string) =>
- async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
+ async (dispatch: Dispatch, getState: () => RootState) => {
const currentView = getState().searchBar.currentView;
dispatch(searchBarActions.SET_SEARCH_VALUE(searchValue));
- dispatch(searchBarActions.SET_SEARCH_RESULTS([]));
- dispatch<any>(searchGroups(searchValue, 5, {}));
- if (currentView === SearchView.BASIC) {
- dispatch(searchBarActions.CLOSE_SEARCH_VIEW());
- dispatch(navigateToSearchResults);
+ if (searchValue.length > 0) {
- dispatch<any>(searchGroups(searchValue));
++ dispatch<any>(searchGroups(searchValue, 5, {}));
+ if (currentView === SearchView.BASIC) {
+ dispatch(searchBarActions.CLOSE_SEARCH_VIEW());
+ dispatch(navigateToSearchResults);
+ }
}
-
};
export const searchAdvanceData = (data: SearchBarAdvanceFormData) =>
return type ? [type] : [ResourceKind.PROJECT, ResourceKind.COLLECTION, ResourceKind.PROCESS];
};
+ const buildDateFilter = (date?: string): string => {
+ return date ? date : '';
+ };
+
export const initAdvanceFormProjectsTree = () =>
- (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
+ (dispatch: Dispatch) => {
dispatch<any>(initUserProject(SEARCH_BAR_ADVANCE_FORM_PICKER_ID));
};