import { initUserProject, treePickerActions } from '~/store/tree-picker/tree-picker-actions';
import { ServiceRepository } from '~/services/services';
import { FilterBuilder } from "~/services/api/filter-builder";
-import { ResourceKind, isResourceUuid, extractUuidKind } from '~/models/resource';
+import { ResourceKind, isResourceUuid, extractUuidKind, RESOURCE_UUID_REGEX, COLLECTION_PDH_REGEX } from '~/models/resource';
import { SearchView } from '~/store/search-bar/search-bar-reducer';
import { navigateTo, navigateToSearchResults } from '~/store/navigation/navigation-action';
import { snackbarActions, SnackbarKind } from '~/store/snackbar/snackbar-actions';
} else if (searchValuePresent) {
dispatch(searchBarActions.SET_CURRENT_VIEW(SearchView.AUTOCOMPLETE));
dispatch(searchBarActions.SET_SELECTED_ITEM(searchValue));
- debounceStartSearch(dispatch);
} else {
dispatch(searchBarActions.SET_CURRENT_VIEW(SearchView.BASIC));
dispatch(searchBarActions.SET_SEARCH_RESULTS([]));
dispatch<any>(saveRecentQuery(searchValue));
dispatch<any>(loadRecentQueries());
dispatch(searchBarActions.CLOSE_SEARCH_VIEW());
- dispatch(searchBarActions.SET_SEARCH_VALUE(searchValue));
- dispatch(searchBarActions.SET_SEARCH_RESULTS([]));
- dispatch(searchResultsPanelActions.CLEAR());
- dispatch(navigateToSearchResults);
+ if (RESOURCE_UUID_REGEX.exec(searchValue) || COLLECTION_PDH_REGEX.exec(searchValue)) {
+ dispatch<any>(navigateTo(searchValue));
+ } else {
+ dispatch(searchBarActions.SET_SEARCH_VALUE(searchValue));
+ dispatch(searchBarActions.SET_SEARCH_RESULTS([]));
+ dispatch(searchResultsPanelActions.CLEAR());
+ dispatch(navigateToSearchResults);
+ }
};
-const debounceStartSearch = debounce((dispatch: Dispatch) => dispatch<any>(startSearch()), DEFAULT_SEARCH_DEBOUNCE);
const startSearch = () =>
(dispatch: Dispatch, getState: () => RootState) => {
if (data.hasOwnProperty(key)) {
const pattern = v === false
? `${field.replace(':', '\\:\\s*')}\\s*`
- : `${field.replace(':', '\\:\\s*')}\\:\\s*[\\w|\\#|\\-|\\/]*\\s*`;
+ : `${field.replace(':', '\\:\\s*')}\\:\\s*"[\\w|\\#|\\-|\\/]*"\\s*`;
value = value.replace(new RegExp(pattern), '');
}
.forEach(p => keyMap.push([`has:"${p.key}"`, `prop-"${p.key}"`]));
if (prevData) {
+ const fd = flatData(data);
+ const pfd = flatData(prevData);
const obj = getModifiedKeysValues(flatData(data), flatData(prevData));
value = buildQueryFromKeyMap({
searchValue: data.searchValue,
const filter = new FilterBuilder();
const resourceKind = data.type;
- if(data.searchValue){
+ if (data.searchValue) {
filter.addFullTextSearch(data.searchValue);
}