From fba96ad8163bf96908b22837342ab6cbfc482fd0 Mon Sep 17 00:00:00 2001 From: Eskalifer1 Date: Tue, 8 Jul 2025 13:43:20 +0300 Subject: [PATCH 1/5] fix:65263: Invite users in filters --- src/components/Search/SearchFiltersParticipantsSelector.tsx | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/components/Search/SearchFiltersParticipantsSelector.tsx b/src/components/Search/SearchFiltersParticipantsSelector.tsx index 94eb7c3e4304b..3b4d955c235c5 100644 --- a/src/components/Search/SearchFiltersParticipantsSelector.tsx +++ b/src/components/Search/SearchFiltersParticipantsSelector.tsx @@ -13,7 +13,6 @@ import type {Option, Section} from '@libs/OptionsListUtils'; import type {OptionData} from '@libs/ReportUtils'; import {getDisplayNameForParticipant} from '@libs/ReportUtils'; import Navigation from '@navigation/Navigation'; -import {searchInServer} from '@userActions/Report'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; import ROUTES from '@src/ROUTES'; @@ -72,6 +71,7 @@ function SearchFiltersParticipantsSelector({initialAccountIDs, onFiltersUpdate}: selectedOptions, excludeLogins: CONST.EXPENSIFY_EMAILS_OBJECT, maxRecentReportsToShow: CONST.IOU.MAX_RECENT_REPORTS_TO_SHOW, + canInviteUser: false, }); }, [defaultOptions, cleanSearchTerm, selectedOptions]); @@ -156,10 +156,6 @@ function SearchFiltersParticipantsSelector({initialAccountIDs, onFiltersUpdate}: // eslint-disable-next-line react-compiler/react-compiler, react-hooks/exhaustive-deps -- this should react only to changes in form data }, [initialAccountIDs, personalDetails]); - useEffect(() => { - searchInServer(debouncedSearchTerm.trim()); - }, [debouncedSearchTerm]); - const handleParticipantSelection = useCallback( (option: Option) => { const foundOptionIndex = selectedOptions.findIndex((selectedOption: Option) => { From 2193c22239d4ade2b3e3c9e11dba136df0f6bdf3 Mon Sep 17 00:00:00 2001 From: Eskalifer1 Date: Tue, 8 Jul 2025 13:51:53 +0300 Subject: [PATCH 2/5] fix:65263: eslint fix --- src/components/Search/SearchFiltersParticipantsSelector.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Search/SearchFiltersParticipantsSelector.tsx b/src/components/Search/SearchFiltersParticipantsSelector.tsx index 3b4d955c235c5..00c3c5ca743fc 100644 --- a/src/components/Search/SearchFiltersParticipantsSelector.tsx +++ b/src/components/Search/SearchFiltersParticipantsSelector.tsx @@ -46,7 +46,7 @@ function SearchFiltersParticipantsSelector({initialAccountIDs, onFiltersUpdate}: const [isSearchingForReports] = useOnyx(ONYXKEYS.IS_SEARCHING_FOR_REPORTS, {canBeMissing: false, initWithStoredValues: false}); const [selectedOptions, setSelectedOptions] = useState([]); - const [searchTerm, debouncedSearchTerm, setSearchTerm] = useDebouncedState(''); + const [searchTerm, setSearchTerm] = useDebouncedState(''); const cleanSearchTerm = useMemo(() => searchTerm.trim().toLowerCase(), [searchTerm]); const defaultOptions = useMemo(() => { From 59b961de79d6503b4acf7fbfe0c9e4814dce98d2 Mon Sep 17 00:00:00 2001 From: Eskalifer1 Date: Tue, 8 Jul 2025 13:59:57 +0300 Subject: [PATCH 3/5] fix:65263; replaced useDebounceState with useState --- src/components/Search/SearchFiltersParticipantsSelector.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/components/Search/SearchFiltersParticipantsSelector.tsx b/src/components/Search/SearchFiltersParticipantsSelector.tsx index 00c3c5ca743fc..b8ef771a52904 100644 --- a/src/components/Search/SearchFiltersParticipantsSelector.tsx +++ b/src/components/Search/SearchFiltersParticipantsSelector.tsx @@ -3,7 +3,6 @@ import {usePersonalDetails} from '@components/OnyxProvider'; import {useOptionsList} from '@components/OptionListContextProvider'; import SelectionList from '@components/SelectionList'; import UserSelectionListItem from '@components/SelectionList/Search/UserSelectionListItem'; -import useDebouncedState from '@hooks/useDebouncedState'; import useLocalize from '@hooks/useLocalize'; import useOnyx from '@hooks/useOnyx'; import useScreenWrapperTransitionStatus from '@hooks/useScreenWrapperTransitionStatus'; @@ -46,7 +45,7 @@ function SearchFiltersParticipantsSelector({initialAccountIDs, onFiltersUpdate}: const [isSearchingForReports] = useOnyx(ONYXKEYS.IS_SEARCHING_FOR_REPORTS, {canBeMissing: false, initWithStoredValues: false}); const [selectedOptions, setSelectedOptions] = useState([]); - const [searchTerm, setSearchTerm] = useDebouncedState(''); + const [searchTerm, setSearchTerm] = useState(''); const cleanSearchTerm = useMemo(() => searchTerm.trim().toLowerCase(), [searchTerm]); const defaultOptions = useMemo(() => { From 964f1d85dd8d040bd7f0455c5dc712eb403dd39d Mon Sep 17 00:00:00 2001 From: Eskalifer1 Date: Tue, 8 Jul 2025 22:17:52 +0300 Subject: [PATCH 4/5] fix:65263: Removed inviting users from UserSelectPopup --- .../Search/FilterDropdowns/UserSelectPopup.tsx | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/components/Search/FilterDropdowns/UserSelectPopup.tsx b/src/components/Search/FilterDropdowns/UserSelectPopup.tsx index cf1961a2eee31..6c7242d7e6542 100644 --- a/src/components/Search/FilterDropdowns/UserSelectPopup.tsx +++ b/src/components/Search/FilterDropdowns/UserSelectPopup.tsx @@ -1,5 +1,5 @@ import isEmpty from 'lodash/isEmpty'; -import React, {memo, useCallback, useEffect, useMemo, useState} from 'react'; +import React, {memo, useCallback, useMemo, useState} from 'react'; import {View} from 'react-native'; import Button from '@components/Button'; import {usePersonalDetails} from '@components/OnyxProvider'; @@ -16,7 +16,6 @@ import canFocusInputOnScreenFocus from '@libs/canFocusInputOnScreenFocus'; import type {Option, Section} from '@libs/OptionsListUtils'; import {filterAndOrderOptions, getValidOptions} from '@libs/OptionsListUtils'; import type {OptionData} from '@libs/ReportUtils'; -import {searchInServer} from '@userActions/Report'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; @@ -45,7 +44,7 @@ function UserSelectPopup({value, closeOverlay, onChange}: UserSelectPopupProps) const [accountID] = useOnyx(ONYXKEYS.SESSION, {canBeMissing: true, selector: (onyxSession) => onyxSession?.accountID}); const shouldFocusInputOnScreenFocus = canFocusInputOnScreenFocus(); - const [searchTerm, debouncedSearchTerm, setSearchTerm] = useDebouncedState(''); + const [searchTerm, setSearchTerm] = useState(''); const [isSearchingForReports] = useOnyx(ONYXKEYS.IS_SEARCHING_FOR_REPORTS, {initWithStoredValues: false, canBeMissing: true}); const [selectedOptions, setSelectedOptions] = useState(() => { return value.reduce((acc, id) => { @@ -83,6 +82,7 @@ function UserSelectPopup({value, closeOverlay, onChange}: UserSelectPopupProps) const {personalDetails: filteredOptionsList, recentReports} = filterAndOrderOptions(optionsList, cleanSearchTerm, { excludeLogins: CONST.EXPENSIFY_EMAILS_OBJECT, maxRecentReportsToShow: CONST.IOU.MAX_RECENT_REPORTS_TO_SHOW, + canInviteUser: false, }); const personalDetailList = filteredOptionsList @@ -154,10 +154,6 @@ function UserSelectPopup({value, closeOverlay, onChange}: UserSelectPopupProps) closeOverlay(); }, [closeOverlay, onChange]); - useEffect(() => { - searchInServer(debouncedSearchTerm.trim()); - }, [debouncedSearchTerm]); - const isLoadingNewOptions = !!isSearchingForReports; const dataLength = sections.flatMap((section) => section.data).length; From 08c1a031d9627e39c162dfc3260b1cfb93a868eb Mon Sep 17 00:00:00 2001 From: Eskalifer1 Date: Tue, 8 Jul 2025 22:24:32 +0300 Subject: [PATCH 5/5] fix eslint --- src/components/Search/FilterDropdowns/UserSelectPopup.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/Search/FilterDropdowns/UserSelectPopup.tsx b/src/components/Search/FilterDropdowns/UserSelectPopup.tsx index 6c7242d7e6542..658e2f2ae5f2b 100644 --- a/src/components/Search/FilterDropdowns/UserSelectPopup.tsx +++ b/src/components/Search/FilterDropdowns/UserSelectPopup.tsx @@ -6,7 +6,6 @@ import {usePersonalDetails} from '@components/OnyxProvider'; import {useOptionsList} from '@components/OptionListContextProvider'; import SelectionList from '@components/SelectionList'; import UserSelectionListItem from '@components/SelectionList/Search/UserSelectionListItem'; -import useDebouncedState from '@hooks/useDebouncedState'; import useLocalize from '@hooks/useLocalize'; import useOnyx from '@hooks/useOnyx'; import useResponsiveLayout from '@hooks/useResponsiveLayout';