Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to bulk select cards from the same bank in the Card filter #53389

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
951f85b
add expensify card feeds to card filter
SzymczakJ Dec 2, 2024
4113519
add company card feeds to card filter
SzymczakJ Dec 2, 2024
e0d5bf8
Merge branch 'main' into @szymczak/add-feeds-to-card-filter
SzymczakJ Dec 3, 2024
9336e8f
add handling of domain feeds
SzymczakJ Dec 5, 2024
defc543
add search input
SzymczakJ Dec 5, 2024
98b3512
improve naming
SzymczakJ Dec 5, 2024
a5545b7
fix typescript
SzymczakJ Dec 5, 2024
6ebe579
fix typescript
SzymczakJ Dec 5, 2024
a1ae60e
add lowercase filtring
SzymczakJ Dec 6, 2024
d9f0e8a
wrap workspaceFeeds data in useMemo
SzymczakJ Dec 6, 2024
42ecedc
fix filter not appearing bug
SzymczakJ Dec 6, 2024
93e23ca
fix export bug
SzymczakJ Dec 6, 2024
00f3ad8
fix linter
SzymczakJ Dec 6, 2024
cfb2417
fix PR comments
SzymczakJ Dec 9, 2024
6f8efac
fix wrong card names bug
SzymczakJ Dec 9, 2024
bd92551
Merge branch 'main' into @szymczak/add-feeds-to-card-filter
SzymczakJ Dec 10, 2024
5d93a9d
add tests to card filter data generation
SzymczakJ Dec 11, 2024
ab009cc
fix buildSubstitutionsMapTest tests
SzymczakJ Dec 11, 2024
e9cb9da
Merge branch 'main' into @szymczak/add-feeds-to-card-filter
SzymczakJ Dec 11, 2024
cec56f7
clean up Search tests
SzymczakJ Dec 11, 2024
9068aa8
delete redundant comments
SzymczakJ Dec 11, 2024
313bb46
fix PR comments
SzymczakJ Dec 11, 2024
0f274f9
Merge branch 'main' into @szymczak/add-feeds-to-card-filter
SzymczakJ Dec 17, 2024
a48f976
fix typo
SzymczakJ Dec 17, 2024
5f21294
fix linter warnings
SzymczakJ Dec 17, 2024
b4e5aab
add api call
SzymczakJ Dec 17, 2024
e18af2a
fix linter warning
SzymczakJ Dec 17, 2024
fc3f071
fix linter
SzymczakJ Dec 17, 2024
947d918
Merge branch 'main' into @szymczak/add-feeds-to-card-filter
SzymczakJ Dec 18, 2024
6ad3f86
fix PR comments
SzymczakJ Dec 19, 2024
d340930
fix PR comments
SzymczakJ Dec 20, 2024
719a972
Merge branch 'main' into @szymczak/add-feeds-to-card-filter
SzymczakJ Jan 7, 2025
306f6c6
fix card filter SelectionList selection behaviour
SzymczakJ Jan 7, 2025
415ef30
filter out unissued cards in card filter page
SzymczakJ Jan 7, 2025
00dc930
include lastFourPan in card filter search
SzymczakJ Jan 7, 2025
a49beaf
change cardList item design
SzymczakJ Jan 8, 2025
4954b15
fix tests and eslint
SzymczakJ Jan 8, 2025
2a8fe1d
Merge branch 'main' into @szymczak/add-feeds-to-card-filter
SzymczakJ Jan 8, 2025
79a5c3d
fix typescript error
SzymczakJ Jan 8, 2025
7a8d927
merge main
SzymczakJ Jan 9, 2025
137ffe8
Merge branch 'main' into @szymczak/add-feeds-to-card-filter
SzymczakJ Jan 9, 2025
a3001be
apply design changes
SzymczakJ Jan 10, 2025
b22f596
Merge branch 'main' into @szymczak/add-feeds-to-card-filter
SzymczakJ Jan 10, 2025
69400ad
clean up code
SzymczakJ Jan 10, 2025
ded2e05
Merge branch 'main' into @szymczak/add-feeds-to-card-filter
SzymczakJ Jan 13, 2025
22dd304
fix card page bugs
SzymczakJ Jan 13, 2025
185b375
fix tests
SzymczakJ Jan 13, 2025
e7c543b
Merge branch 'main' into @szymczak/add-feeds-to-card-filter
SzymczakJ Jan 13, 2025
91b84ef
fix eslint
SzymczakJ Jan 13, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 37 additions & 22 deletions src/components/Search/SearchPageHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,18 @@ import useNetwork from '@hooks/useNetwork';
import useResponsiveLayout from '@hooks/useResponsiveLayout';
import useTheme from '@hooks/useTheme';
import useThemeStyles from '@hooks/useThemeStyles';
import * as SearchActions from '@libs/actions/Search';
import {
approveMoneyRequestOnSearch,
deleteMoneyRequestOnSearch,
exportSearchItemsToCSV,
payMoneyRequestOnSearch,
unholdMoneyRequestOnSearch,
updateAdvancedFilters,
} from '@libs/actions/Search';
import {mergeCardListWithWorkspaceFeeds} from '@libs/CardUtils';
import Navigation from '@libs/Navigation/Navigation';
import {getAllTaxRates} from '@libs/PolicyUtils';
import * as PolicyUtils from '@libs/PolicyUtils';
import * as SearchQueryUtils from '@libs/SearchQueryUtils';
import {getAllTaxRates, hasVBBA} from '@libs/PolicyUtils';
import {buildFilterFormValuesFromQuery, isCannedSearchQuery} from '@libs/SearchQueryUtils';
import SearchSelectedNarrow from '@pages/Search/SearchSelectedNarrow';
import variables from '@styles/variables';
import CONST from '@src/CONST';
Expand Down Expand Up @@ -50,7 +57,9 @@ function SearchPageHeader({queryJSON}: SearchPageHeaderProps) {
const personalDetails = usePersonalDetails();
const [reports] = useOnyx(ONYXKEYS.COLLECTION.REPORT);
const taxRates = getAllTaxRates();
const [cardList = {}] = useOnyx(ONYXKEYS.CARD_LIST);
const [userCardList = {}] = useOnyx(ONYXKEYS.CARD_LIST);
const [workspaceCardFeeds = {}] = useOnyx(ONYXKEYS.COLLECTION.WORKSPACE_CARDS_LIST);
const allCards = useMemo(() => mergeCardListWithWorkspaceFeeds(workspaceCardFeeds, userCardList), [userCardList, workspaceCardFeeds]);
const [currencyList = {}] = useOnyx(ONYXKEYS.CURRENCY_LIST);
const [policyCategories] = useOnyx(ONYXKEYS.COLLECTION.POLICY_CATEGORIES);
const [policyTagsLists] = useOnyx(ONYXKEYS.COLLECTION.POLICY_TAGS);
Expand Down Expand Up @@ -85,7 +94,7 @@ function SearchPageHeader({queryJSON}: SearchPageHeaderProps) {
}

setIsDeleteExpensesConfirmModalVisible(false);
SearchActions.deleteMoneyRequestOnSearch(hash, selectedTransactionsKeys);
deleteMoneyRequestOnSearch(hash, selectedTransactionsKeys);

// Translations copy for delete modal depends on amount of selected items,
// We need to wait for modal to fully disappear before clearing them to avoid translation flicker between singular vs plural
Expand Down Expand Up @@ -125,7 +134,7 @@ function SearchPageHeader({queryJSON}: SearchPageHeaderProps) {
const reportIDList = !selectedReports.length
? Object.values(selectedTransactions).map((transaction) => transaction.reportID)
: selectedReports?.filter((report) => !!report).map((report) => report.reportID) ?? [];
SearchActions.approveMoneyRequestOnSearch(hash, reportIDList, transactionIDList);
approveMoneyRequestOnSearch(hash, reportIDList, transactionIDList);
},
});
}
Expand Down Expand Up @@ -164,9 +173,9 @@ function SearchPageHeader({queryJSON}: SearchPageHeaderProps) {
return;
}

const hasVBBA = PolicyUtils.hasVBBA(policyID);
const hasPolicyVBBA = hasVBBA(policyID);

if (lastPolicyPaymentMethod !== CONST.IOU.PAYMENT_TYPE.ELSEWHERE && !hasVBBA) {
if (lastPolicyPaymentMethod !== CONST.IOU.PAYMENT_TYPE.ELSEWHERE && !hasPolicyVBBA) {
Navigation.navigate(ROUTES.SEARCH_REPORT.getRoute({reportID: item.reportID, backTo: activeRoute}));
return;
}
Expand All @@ -182,7 +191,7 @@ function SearchPageHeader({queryJSON}: SearchPageHeaderProps) {
}))
) as PaymentData[];

SearchActions.payMoneyRequestOnSearch(hash, paymentData, transactionIDList);
payMoneyRequestOnSearch(hash, paymentData, transactionIDList);
},
});
}
Expand All @@ -199,8 +208,14 @@ function SearchPageHeader({queryJSON}: SearchPageHeaderProps) {
}

const reportIDList = selectedReports?.filter((report) => !!report).map((report) => report.reportID) ?? [];
SearchActions.exportSearchItemsToCSV(
{query: status, jsonQuery: JSON.stringify(queryJSON), reportIDList, transactionIDList: selectedTransactionsKeys, policyIDs: [activeWorkspaceID ?? '']},
exportSearchItemsToCSV(
{
query: status,
jsonQuery: JSON.stringify(queryJSON),
reportIDList,
transactionIDList: selectedTransactionsKeys,
policyIDs: activeWorkspaceID ? [activeWorkspaceID] : [''],
},
() => {
setIsDownloadErrorModalVisible(true);
},
Expand Down Expand Up @@ -241,7 +256,7 @@ function SearchPageHeader({queryJSON}: SearchPageHeaderProps) {
return;
}

SearchActions.unholdMoneyRequestOnSearch(hash, selectedTransactionsKeys);
unholdMoneyRequestOnSearch(hash, selectedTransactionsKeys);
},
});
}
Expand Down Expand Up @@ -284,20 +299,20 @@ function SearchPageHeader({queryJSON}: SearchPageHeaderProps) {

return options;
}, [
queryJSON,
status,
selectedTransactionsKeys,
selectedTransactions,
isOffline,
selectedReports,
translate,
hash,
lastPaymentMethods,
status,
queryJSON,
activeWorkspaceID,
theme.icon,
styles.colorMuted,
styles.fontWeightNormal,
isOffline,
activeWorkspaceID,
selectedReports,
styles.textWrap,
lastPaymentMethods,
]);

if (shouldUseNarrowLayout) {
Expand Down Expand Up @@ -346,13 +361,13 @@ function SearchPageHeader({queryJSON}: SearchPageHeaderProps) {

const onFiltersButtonPress = () => {
hideProductTrainingTooltip();
const filterFormValues = SearchQueryUtils.buildFilterFormValuesFromQuery(queryJSON, policyCategories, policyTagsLists, currencyList, personalDetails, cardList, reports, taxRates);
SearchActions.updateAdvancedFilters(filterFormValues);
const filterFormValues = buildFilterFormValuesFromQuery(queryJSON, policyCategories, policyTagsLists, currencyList, personalDetails, allCards, reports, taxRates);
updateAdvancedFilters(filterFormValues);

Navigation.navigate(ROUTES.SEARCH_ADVANCED_FILTERS);
};

const isCannedQuery = SearchQueryUtils.isCannedSearchQuery(queryJSON);
const isCannedQuery = isCannedSearchQuery(queryJSON);

return (
<>
Expand Down
32 changes: 18 additions & 14 deletions src/components/Search/SearchPageHeaderInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,15 @@ import type {SelectionListHandle} from '@components/SelectionList/types';
import Text from '@components/Text';
import useLocalize from '@hooks/useLocalize';
import useThemeStyles from '@hooks/useThemeStyles';
import * as SearchActions from '@libs/actions/Search';
import {navigateToAndOpenReport} from '@libs/actions/Report';
import {clearAllFilters} from '@libs/actions/Search';
import {mergeCardListWithWorkspaceFeeds} from '@libs/CardUtils';
import Navigation from '@libs/Navigation/Navigation';
import {getAllTaxRates} from '@libs/PolicyUtils';
import type {OptionData} from '@libs/ReportUtils';
import * as SearchAutocompleteUtils from '@libs/SearchAutocompleteUtils';
import * as SearchQueryUtils from '@libs/SearchQueryUtils';
import {getAutocompleteQueryWithComma, getQueryWithoutAutocompletedPart} from '@libs/SearchAutocompleteUtils';
import {buildUserReadableQueryString, getQueryWithUpdatedValues, isCannedSearchQuery, sanitizeSearchValue} from '@libs/SearchQueryUtils';
import variables from '@styles/variables';
import * as ReportUserActions from '@userActions/Report';
import CONST from '@src/CONST';
import type {TranslationPaths} from '@src/languages/types';
import ONYXKEYS from '@src/ONYXKEYS';
Expand Down Expand Up @@ -71,10 +72,13 @@ function SearchPageHeaderInput({queryJSON, children}: SearchPageHeaderInputProps
const personalDetails = usePersonalDetails();
const [reports] = useOnyx(ONYXKEYS.COLLECTION.REPORT);
const taxRates = useMemo(() => getAllTaxRates(), []);
const [userCardList = {}] = useOnyx(ONYXKEYS.CARD_LIST);
const [workspaceCardFeeds = {}] = useOnyx(ONYXKEYS.COLLECTION.WORKSPACE_CARDS_LIST);
const allCards = useMemo(() => mergeCardListWithWorkspaceFeeds(workspaceCardFeeds, userCardList), [userCardList, workspaceCardFeeds]);

const {type, inputQuery: originalInputQuery} = queryJSON;
const isCannedQuery = SearchQueryUtils.isCannedSearchQuery(queryJSON);
const queryText = SearchQueryUtils.buildUserReadableQueryString(queryJSON, personalDetails, reports, taxRates);
const isCannedQuery = isCannedSearchQuery(queryJSON);
const queryText = buildUserReadableQueryString(queryJSON, personalDetails, reports, taxRates, allCards);
const headerText = isCannedQuery ? translate(getHeaderContent(type).titleText) : '';

// The actual input text that the user sees
Expand Down Expand Up @@ -107,13 +111,13 @@ function SearchPageHeaderInput({queryJSON, children}: SearchPageHeaderInputProps
}, [queryText]);

useEffect(() => {
const substitutionsMap = buildSubstitutionsMap(originalInputQuery, personalDetails, reports, taxRates);
const substitutionsMap = buildSubstitutionsMap(originalInputQuery, personalDetails, reports, taxRates, allCards);
setAutocompleteSubstitutions(substitutionsMap);
}, [originalInputQuery, personalDetails, reports, taxRates]);
}, [allCards, originalInputQuery, personalDetails, reports, taxRates]);

const onSearchQueryChange = useCallback(
(userQuery: string) => {
const updatedUserQuery = SearchAutocompleteUtils.getAutocompleteQueryWithComma(textInputValue, userQuery);
const updatedUserQuery = getAutocompleteQueryWithComma(textInputValue, userQuery);
setTextInputValue(updatedUserQuery);
setAutocompleteQueryValue(updatedUserQuery);

Expand All @@ -132,15 +136,15 @@ function SearchPageHeaderInput({queryJSON, children}: SearchPageHeaderInputProps
const submitSearch = useCallback(
(queryString: SearchQueryString) => {
const queryWithSubstitutions = getQueryWithSubstitutions(queryString, autocompleteSubstitutions);
const updatedQuery = SearchQueryUtils.getQueryWithUpdatedValues(queryWithSubstitutions, queryJSON.policyID);
const updatedQuery = getQueryWithUpdatedValues(queryWithSubstitutions, queryJSON.policyID);
if (!updatedQuery) {
return;
}

Navigation.navigate(ROUTES.SEARCH_CENTRAL_PANE.getRoute({query: updatedQuery}));

if (updatedQuery !== originalInputQuery) {
SearchActions.clearAllFilters();
clearAllFilters();
setTextInputValue('');
setAutocompleteQueryValue('');
setIsAutocompleteListVisible(false);
Expand All @@ -157,8 +161,8 @@ function SearchPageHeaderInput({queryJSON, children}: SearchPageHeaderInputProps
}

if (item.searchItemType === CONST.SEARCH.SEARCH_ROUTER_ITEM_TYPE.AUTOCOMPLETE_SUGGESTION && textInputValue) {
const trimmedUserSearchQuery = SearchAutocompleteUtils.getQueryWithoutAutocompletedPart(textInputValue);
onSearchQueryChange(`${trimmedUserSearchQuery}${SearchQueryUtils.sanitizeSearchValue(item.searchQuery)} `);
const trimmedUserSearchQuery = getQueryWithoutAutocompletedPart(textInputValue);
onSearchQueryChange(`${trimmedUserSearchQuery}${sanitizeSearchValue(item.searchQuery)} `);

if (item.mapKey && item.autocompleteID) {
const substitutions = {...autocompleteSubstitutions, [item.mapKey]: item.autocompleteID};
Expand All @@ -171,7 +175,7 @@ function SearchPageHeaderInput({queryJSON, children}: SearchPageHeaderInputProps
} else if (item?.reportID) {
Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(item?.reportID));
} else if ('login' in item) {
ReportUserActions.navigateToAndOpenReport(item.login ? [item.login] : [], false);
navigateToAndOpenReport(item.login ? [item.login] : [], false);
}
},
[autocompleteSubstitutions, onSearchQueryChange, submitSearch, textInputValue],
Expand Down
46 changes: 24 additions & 22 deletions src/components/Search/SearchRouter/SearchRouterList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ import useLocalize from '@hooks/useLocalize';
import usePolicy from '@hooks/usePolicy';
import useResponsiveLayout from '@hooks/useResponsiveLayout';
import useThemeStyles from '@hooks/useThemeStyles';
import * as CardUtils from '@libs/CardUtils';
import * as OptionsListUtils from '@libs/OptionsListUtils';
import type {SearchOption} from '@libs/OptionsListUtils';
import {searchInServer} from '@libs/actions/Report';
import {getCardDescription, isCard, isCardIssued, mergeCardListWithWorkspaceFeeds} from '@libs/CardUtils';
import {combineOrderingOfReportsAndPersonalDetails, getSearchOptions, getValidOptions} from '@libs/OptionsListUtils';
import type {Options, SearchOption} from '@libs/OptionsListUtils';
import Performance from '@libs/Performance';
import {getAllTaxRates} from '@libs/PolicyUtils';
import type {OptionData} from '@libs/ReportUtils';
Expand All @@ -29,11 +30,10 @@ import {
getAutocompleteRecentTags,
getAutocompleteTags,
getAutocompleteTaxList,
getQueryWithoutAutocompletedPart,
parseForAutocomplete,
} from '@libs/SearchAutocompleteUtils';
import * as SearchAutocompleteUtils from '@libs/SearchAutocompleteUtils';
import * as SearchQueryUtils from '@libs/SearchQueryUtils';
import * as ReportUserActions from '@userActions/Report';
import {buildSearchQueryJSON, buildUserReadableQueryString, sanitizeSearchValue} from '@libs/SearchQueryUtils';
import Timing from '@userActions/Timing';
import CONST from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';
Expand All @@ -47,7 +47,7 @@ type AutocompleteItemData = {
mapKey?: SearchFilterKey;
};

type GetAdditionalSectionsCallback = (options: OptionsListUtils.Options) => Array<SectionListDataType<OptionData | SearchQueryItem>> | undefined;
type GetAdditionalSectionsCallback = (options: Options) => Array<SectionListDataType<OptionData | SearchQueryItem>> | undefined;

type SearchRouterListProps = {
/** Value of TextInput */
Expand Down Expand Up @@ -139,7 +139,7 @@ function SearchRouterList(
if (!areOptionsInitialized) {
return defaultListOptions;
}
return OptionsListUtils.getSearchOptions(options, betas ?? []);
return getSearchOptions(options, betas ?? []);
}, [areOptionsInitialized, betas, options]);

const [isInitialRender, setIsInitialRender] = useState(true);
Expand All @@ -148,14 +148,17 @@ function SearchRouterList(
const statusAutocompleteList = Object.values({...CONST.SEARCH.STATUS.TRIP, ...CONST.SEARCH.STATUS.INVOICE, ...CONST.SEARCH.STATUS.CHAT, ...CONST.SEARCH.STATUS.TRIP});
const expenseTypes = Object.values(CONST.SEARCH.TRANSACTION_TYPE);

const [cardList = {}] = useOnyx(ONYXKEYS.CARD_LIST);
const cardAutocompleteList = Object.values(cardList);
const [userCardList = {}] = useOnyx(ONYXKEYS.CARD_LIST);
const [workspaceCardFeeds = {}] = useOnyx(ONYXKEYS.COLLECTION.WORKSPACE_CARDS_LIST);
const allCards = useMemo(() => mergeCardListWithWorkspaceFeeds(workspaceCardFeeds, userCardList), [userCardList, workspaceCardFeeds]);
const cardAutocompleteList = Object.values(allCards);

const participantsAutocompleteList = useMemo(() => {
if (!areOptionsInitialized) {
return [];
}

const filteredOptions = OptionsListUtils.getValidOptions(
const filteredOptions = getValidOptions(
{
reports: options.reports,
personalDetails: options.personalDetails,
Expand Down Expand Up @@ -335,16 +338,14 @@ function SearchRouterList(
}
case CONST.SEARCH.SYNTAX_FILTER_KEYS.CARD_ID: {
const filteredCards = cardAutocompleteList
.filter(
(card) =>
card.bank.toLowerCase().includes(autocompleteValue.toLowerCase()) && !alreadyAutocompletedKeys.includes(CardUtils.getCardDescription(card.cardID).toLowerCase()),
)
.filter((card) => isCard(card) && isCardIssued(card))
.filter((card) => card.bank.toLowerCase().includes(autocompleteValue.toLowerCase()) && !alreadyAutocompletedKeys.includes(getCardDescription(card.cardID).toLowerCase()))
.sort()
.slice(0, 10);

return filteredCards.map((card) => ({
filterKey: CONST.SEARCH.SEARCH_USER_FRIENDLY_KEYS.CARD_ID,
text: CardUtils.getCardDescription(card.cardID),
text: getCardDescription(card.cardID, allCards),
autocompleteID: card.cardID.toString(),
mapKey: CONST.SEARCH.SYNTAX_FILTER_KEYS.CARD_ID,
}));
Expand All @@ -368,16 +369,17 @@ function SearchRouterList(
statusAutocompleteList,
expenseTypes,
cardAutocompleteList,
allCards,
]);

const sortedRecentSearches = useMemo(() => {
return Object.values(recentSearches ?? {}).sort((a, b) => b.timestamp.localeCompare(a.timestamp));
}, [recentSearches]);

const recentSearchesData = sortedRecentSearches?.slice(0, 5).map(({query, timestamp}) => {
const searchQueryJSON = SearchQueryUtils.buildSearchQueryJSON(query);
const searchQueryJSON = buildSearchQueryJSON(query);
return {
text: searchQueryJSON ? SearchQueryUtils.buildUserReadableQueryString(searchQueryJSON, personalDetails, reports, taxRates) : query,
text: searchQueryJSON ? buildUserReadableQueryString(searchQueryJSON, personalDetails, reports, taxRates, allCards) : query,
singleIcon: Expensicons.History,
searchQuery: query,
keyForList: timestamp,
Expand All @@ -397,7 +399,7 @@ function SearchRouterList(

Timing.start(CONST.TIMING.SEARCH_FILTER_OPTIONS);
const filteredOptions = filterOptions(autocompleteQueryValue);
const orderedOptions = OptionsListUtils.combineOrderingOfReportsAndPersonalDetails(filteredOptions, autocompleteQueryValue, {
const orderedOptions = combineOrderingOfReportsAndPersonalDetails(filteredOptions, autocompleteQueryValue, {
sortByReportTypeInSearch: true,
preferChatroomsOverThreads: true,
});
Expand All @@ -411,7 +413,7 @@ function SearchRouterList(
}, [autocompleteQueryValue, filterOptions, searchOptions]);

useEffect(() => {
ReportUserActions.searchInServer(autocompleteQueryValue.trim());
searchInServer(autocompleteQueryValue.trim());
}, [autocompleteQueryValue]);

/* Sections generation */
Expand Down Expand Up @@ -458,8 +460,8 @@ function SearchRouterList(
return;
}

const trimmedUserSearchQuery = SearchAutocompleteUtils.getQueryWithoutAutocompletedPart(autocompleteQueryValue);
setTextQuery(`${trimmedUserSearchQuery}${SearchQueryUtils.sanitizeSearchValue(focusedItem.searchQuery)} `);
const trimmedUserSearchQuery = getQueryWithoutAutocompletedPart(autocompleteQueryValue);
setTextQuery(`${trimmedUserSearchQuery}${sanitizeSearchValue(focusedItem.searchQuery)} `);
updateAutocompleteSubstitutions(focusedItem);
},
[autocompleteQueryValue, setTextQuery, updateAutocompleteSubstitutions],
Expand Down
Loading
Loading