-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Add bank account filter to Search #90791
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
Merged
JS00001
merged 146 commits into
Expensify:main
from
allgandalf:add-bank-account-search-filter
Jun 29, 2026
Merged
Changes from all commits
Commits
Show all changes
146 commits
Select commit
Hold shift + click to select a range
5e04a97
Add bankAccount SYNTAX_FILTER_KEYS entries
allgandalf 3becfee
Add bank account RHP screen constant
allgandalf f5de9fd
Add bankAccount filter key to form types
allgandalf f185a84
Map bank account RHP screen to filter route
allgandalf c643533
Register bank account RHP in SEARCH_TO_RHP relations
allgandalf 2e3e735
Register bank account RHP screen in ModalStackNavigator
allgandalf 12f0383
Add SearchFiltersBankAccountPage component
allgandalf 3e63d3d
Show bank account row in advanced filters list
allgandalf 21b128c
Gate bank account filter row to expense type with bank accounts
allgandalf 0795430
Serialize bankAccount filter to query string
allgandalf 4bed07b
Parse bankAccount filter from jsonQuery into form values
allgandalf d43728b
Render bankAccount filter chip display value
allgandalf 16fc975
Add bankAccount to peggy baseRules
allgandalf aaade06
Add bankAccount to search and autocomplete parser grammars
allgandalf 4becdd8
Regenerate parser artifacts for bankAccount
allgandalf 1d25a34
Add bankAccount to autocomplete substitution map
allgandalf cef8778
Handle bankAccount in isValidAutocompleteRange
allgandalf 36c6544
Suggest bank accounts in autocomplete dropdown
allgandalf f3f6b5b
Add BankAccountSelector chip popover component
allgandalf 3e970cb
Map BankAccount filter to BankAccountSelector
allgandalf 5c261cf
Render bank account chip on search filter bar
allgandalf 2af656d
Add bankAccount to FILTER_LABEL_MAP
allgandalf 69a7541
Add SearchQueryUtilsTest case for bankAccount filter
allgandalf 3e879ab
Add SearchParserTest case for bankAccount filter
allgandalf e6bad71
Add SearchAutocompleteParserTest case for bankAccount
allgandalf 09b634f
Add SearchAutocompleteUtilsTest cases for bankAccount
allgandalf 0f9ddc2
Add useAdvancedSearchFilters bank account gating tests
allgandalf 5e1035a
Fix bankName indexing types in SearchQueryUtils
allgandalf f9ae792
Fix types in SearchFiltersBankAccountPage
allgandalf 6235fff
Fix types in BankAccountSelector
allgandalf 1fafd5b
Fix bankName type in useAutocompleteSuggestions
allgandalf 59efdf1
Fix bankName type in useFilterBankAccountValue
allgandalf f2d4040
Use nullish coalescing for formattedBankName in BankAccountSelector
allgandalf fd266f4
Use nullish coalescing for formattedBankName in useFilterBankAccountV…
allgandalf e78057a
Use nullish coalescing for formattedBankName in useAutocompleteSugges…
allgandalf d0329d2
Use nullish coalescing for formattedBankName in SearchQueryUtils
allgandalf 4bbf120
Use nullish coalescing for formattedBankName in SearchFiltersBankAcco…
allgandalf dca6f7b
Use localeCompare from useLocalize in bank account autocomplete sort
allgandalf ad0f065
Read localeCompare from useLocalize inside useAutocompleteSuggestions
allgandalf a01cec2
Use computed key for bankAccountID in test fixtures
allgandalf dda71ee
Disable max-params lint on buildSubstitutionsMap
allgandalf f30d07d
Merge main into add-bank-account-search-filter
allgandalf 4770a01
Reorder buildFilterFormValuesFromQuery params and disable max-params
allgandalf 245823d
Merge branch 'Expensify:main' into add-bank-account-search-filter
allgandalf 51b5487
Merge branch 'Expensify:main' into add-bank-account-search-filter
allgandalf 19f5107
Add getBankAccountSearchLabel util in BankAccountUtils
allgandalf 65501dd
Use getBankAccountSearchLabel in BankAccountSelector
allgandalf 3582237
Use getBankAccountSearchLabel in useFilterBankAccountValue
allgandalf 872d111
Use getBankAccountSearchLabel in SearchFiltersBankAccountPage
allgandalf 704a2d9
Use getBankAccountSearchLabel in useAutocompleteSuggestions
allgandalf 42403d1
Use getBankAccountSearchLabel in SearchQueryUtils getFilterDisplayValue
allgandalf a78a13e
Justify max-params disable on buildSubstitutionsMap
allgandalf 2f8abec
Justify max-params disable on buildFilterFormValuesFromQuery
allgandalf 5a2f7b2
Restore CONST import in BankAccountSelector after refactor
allgandalf 8038d1a
Render bank account labels in advanced filter list row
allgandalf 4eff095
Drop FilterKey suffix from peggy bankAccount rule
allgandalf e423cd5
Merge main into add-bank-account-search-filter
allgandalf 94e8c34
Sync Mobile-Expensify submodule pointer with main
allgandalf b03ea71
Extend BankAccountSelector props with SearchFilterSelectionListProps
allgandalf 24f067d
Pass footer through BankAccountSelector to render mobile Confirm button
allgandalf f4f94f3
Pass autoFocus through BankAccountSelector
allgandalf 30984eb
Pass selectionListTextInputStyle through BankAccountSelector
allgandalf d061a0f
Pass selectionListStyle through BankAccountSelector
allgandalf 8b64b01
Pass searchPlaceholder through BankAccountSelector
allgandalf 75a8d55
Add JSDoc comments to BankAccountItem fields
allgandalf fb6a5a5
Accept bank-account user-friendly form in peggy bankAccount rule
allgandalf 7cc2f60
Show loading indicator on SearchFiltersBankAccountPage while Onyx loads
allgandalf f49291f
Use kebab-case bank-account for user-friendly filter key
allgandalf a9248e8
Pass bankAccountList to buildUserReadableQueryString in SearchAutocom…
allgandalf 72bbf79
Pass bankAccountList to buildUserReadableQueryString from saved searc…
allgandalf 3f87f92
Merge remote-tracking branch 'origin/main' into add-bank-account-sear…
allgandalf 60d719a
Include bankAccountList in useMemo deps for SearchAutocompleteList
allgandalf bfe5e75
Merge upstream/main into add-bank-account-search-filter
allgandalf f1e9111
Align BankAccountSelector and loading spinner with upstream MultiSele…
allgandalf c4501fd
Sync Mobile-Expensify submodule pointer with main
allgandalf 9d59abe
Merge remote-tracking branch 'upstream/main' into add-bank-account-se…
allgandalf be652ec
Add isSearchEligibleBankAccount + getSearchEligibleBankAccounts util
allgandalf d27e79f
Filter SearchFiltersBankAccountPage picker to settlement-eligible ban…
allgandalf f49cf89
Filter BankAccountSelector chip popover to settlement-eligible bank a…
allgandalf c171c63
Filter useAutocompleteSuggestions to settlement-eligible bank accounts
allgandalf 4829c93
Filter useFilterBankAccountValue chip label to settlement-eligible ba…
allgandalf 7e3a1d7
Gate SearchQueryUtils bank account paths on isSearchEligibleBankAccount
allgandalf d9208e5
Filter AdvancedSearchFilters bank account row title to settlement-eli…
allgandalf 68a0bdc
Gate shouldDisplayBankAccountFilter on count of settlement-eligible a…
allgandalf 5d17fda
Test BANK_ACCOUNT row gating against settlement-eligible predicate
allgandalf 33ca711
Pin selected bank accounts to top of picker to match Card filter
allgandalf 677ec68
Merge branch 'Expensify:main' into add-bank-account-search-filter
allgandalf 279c429
Validate bankAccount filter on presence only so saved searches surviv…
allgandalf 101c7a3
Render bankAccount filter label on presence only in user-readable query
allgandalf 2ba2765
Render bankAccount filter list title on presence only
allgandalf 19547fa
Drop unused isSearchEligibleBankAccount export to satisfy knip
allgandalf 0acb06e
Drop coined word from bankAccount filter comment to satisfy spellcheck
allgandalf 230c4e2
Merge branch 'Expensify:main' into add-bank-account-search-filter
allgandalf 17a378b
i18n: add bank-account filter section titles
allgandalf ef013e4
Export isSearchEligibleBankAccount for the closed-banks picker section
allgandalf 673c062
i18n: localize bank-account filter section titles
allgandalf dfad6af
Show closed bank accounts in search filter picker
allgandalf b6b5785
Hoist picker into a child component so initial selection loads from a…
allgandalf 82b49f0
Merge remote-tracking branch 'origin/add-bank-account-search-filter' …
allgandalf 1a54f7f
Merge branch 'Expensify:main' into add-bank-account-search-filter
allgandalf b0588db
Apply Polyglot Parrot translations for bank-account filter sections
allgandalf abecb69
Merge remote-tracking branch 'upstream/main' into add-bank-account-se…
allgandalf e8c320f
Resolve filter-bar pill label from full bankAccountList so closed sel…
allgandalf f8a93c7
Resolve filter-bar popover picker from full bankAccountList so closed…
allgandalf 4e181ec
Preserve bank-account filter IDs while Onyx list is loading
allgandalf fb368b2
Show bank-account filter row when user has any business account, open…
allgandalf 860215b
Document BankAccountPicker props with JSDoc
allgandalf 0af3ff7
Drop redundant useCallback on buildItem
allgandalf 874c769
Drop redundant useMemo on openItems and closedItems
allgandalf 10b399f
Drop redundant useCallback on searchFilter
allgandalf ffadf3b
Drop redundant useMemo on sections
allgandalf 1716f3b
Bump eslint-seatbelt baseline for bank-account additions
allgandalf dd00bbc
Drop duplicate FinancialForce write-command keys from API/types.ts me…
allgandalf 88f504e
Restore Mobile-Expensify pointer to PR base so submodule diff is empty
allgandalf 24a0da7
Merge remote-tracking branch 'upstream/main' into add-bank-account-se…
allgandalf 14da041
Restore Mobile-Expensify pointer to PR base after main merge
allgandalf 3a4ffa4
Adapt BankAccountSelector to new generic SearchFilterCommonProps
allgandalf c8fb6fb
Resync Mobile-Expensify pointer with current main tip
allgandalf 91ed111
refactor BankAccountSelector to sectioned picker mirroring CardSelector
allgandalf ceaa434
drop dead SearchFiltersBankAccountPage and its route registration
allgandalf ad84a77
suggest closed business accounts in autocomplete to match the picker
allgandalf 334e341
render bank account label on save search page instead of raw id
allgandalf 24132a7
widen useFilterBankAccountValue to SearchFilter value and drop call s…
allgandalf 3ba274a
Resync Mobile-Expensify pointer with current main tip
allgandalf 7c07c96
Restore Mobile-Expensify pointer to merge-base value
allgandalf 5141948
Drop unused isSearchEligibleBankAccount and getSearchEligibleBankAcco…
allgandalf 88fe4dd
Normalize useFilterBankAccountValue to handle single-id string value
allgandalf e83ddb5
Merge remote-tracking branch 'upstream/main' into add-bank-account-se…
allgandalf 86a8f2d
Bump eslint-seatbelt SearchQueryUtils count to 73 after main merge
allgandalf cca88b2
Pass bankAccount form value through getDisplayValue as array, not joi…
allgandalf 557bcf4
Merge branch 'Expensify:main' into add-bank-account-search-filter
allgandalf 49cad7a
Add common.bank translation key for generic bank label
allgandalf 641f22f
Use common.bank in getBankAccountSearchLabel so generic label is loca…
allgandalf 40c71bf
Localize bank-account translation values in 9 non-English locales
allgandalf ba04b29
Drop partially-setup bank account IDs at filter validation
allgandalf 3f6385f
Merge remote-tracking branch 'upstream/main' into add-bank-account-se…
allgandalf 8229a14
Revert "Localize bank-account translation values in 9 non-English loc…
allgandalf d22547f
Revert "Use common.bank in getBankAccountSearchLabel so generic label…
allgandalf 199ec51
Revert "Add common.bank translation key for generic bank label"
allgandalf e5b31c2
Lowercase bankName before BANK_NAMES_USER_FRIENDLY lookup and add isF…
allgandalf 532fc85
Use isFilterableBankAccount in advanced filter gate, picker, and auto…
allgandalf ee7ee61
Merge remote-tracking branch 'upstream/main' into add-bank-account-se…
allgandalf e58842f
Cast lowercased bankName to BANK_NAMES_USER_FRIENDLY key for type-saf…
allgandalf 29a8a3e
Update bank-account visibility test: LOCKED shows filter, PENDING hid…
allgandalf 1d7bbd0
Bump eslint-seatbelt for BankAccountUtils.ts cast to BANK_NAMES_USER_…
allgandalf 894855b
Merge remote-tracking branch 'upstream/main' into add-bank-account-se…
allgandalf File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
181 changes: 181 additions & 0 deletions
181
src/components/Search/FilterComponents/BankAccountSelector.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,181 @@ | ||
| import React from 'react'; | ||
| import {View} from 'react-native'; | ||
| import ActivityIndicator from '@components/ActivityIndicator'; | ||
| import Icon from '@components/Icon'; | ||
| import getBankIcon from '@components/Icon/BankIcons'; | ||
| import type {SearchFilterCommonProps} from '@components/Search/types'; | ||
| import MultiSelectListItem from '@components/SelectionList/ListItem/MultiSelectListItem'; | ||
| import SelectionListWithSections from '@components/SelectionList/SelectionListWithSections'; | ||
| import type {TextInputOptions} from '@components/SelectionList/types'; | ||
| import useDebouncedState from '@hooks/useDebouncedState'; | ||
| import useLocalize from '@hooks/useLocalize'; | ||
| import useOnyx from '@hooks/useOnyx'; | ||
| import useResponsiveLayout from '@hooks/useResponsiveLayout'; | ||
| import useTheme from '@hooks/useTheme'; | ||
| import useThemeStyles from '@hooks/useThemeStyles'; | ||
| import {getBankAccountSearchLabel, isFilterableBankAccount} from '@libs/BankAccountUtils'; | ||
| import type {SkeletonSpanReasonAttributes} from '@libs/telemetry/useSkeletonSpan'; | ||
| import variables from '@styles/variables'; | ||
| import CONST from '@src/CONST'; | ||
| import ONYXKEYS from '@src/ONYXKEYS'; | ||
| import isLoadingOnyxValue from '@src/types/utils/isLoadingOnyxValue'; | ||
| import ListFilterView from './ListFilterViewWrapper'; | ||
|
|
||
| type BankAccountSelectorProps = SearchFilterCommonProps<string[] | undefined>; | ||
|
|
||
| /** Row item rendered by SelectionListWithSections for a single bank account. */ | ||
| type BankAccountFilterItem = { | ||
| /** Display label, e.g. `Chase xx1234`. */ | ||
| text: string; | ||
| /** Bank account ID stringified — used as both the stable list key and the filter value. */ | ||
| keyForList: string; | ||
| /** Same as keyForList; kept on the item so onChange logic mirrors CardSelector. */ | ||
| value: string; | ||
| /** Whether this account is currently selected in the filter. */ | ||
| isSelected: boolean; | ||
| /** Bank icon wrapper rendered at the start of the row. */ | ||
| leftElement: React.JSX.Element; | ||
| /** Last four digits of the account number — searched in addition to the display text. */ | ||
| lastFour: string; | ||
| }; | ||
|
|
||
| function BankAccountSelector({value = [], selectionListTextInputStyle, selectionListStyle, autoFocus, footer, onChange}: BankAccountSelectorProps) { | ||
| const theme = useTheme(); | ||
| const styles = useThemeStyles(); | ||
| const {translate} = useLocalize(); | ||
| const {isLargeScreenWidth} = useResponsiveLayout(); | ||
| const [bankAccountList, bankAccountListMetadata] = useOnyx(ONYXKEYS.BANK_ACCOUNT_LIST); | ||
| const [searchTerm, debouncedSearchTerm, setSearchTerm] = useDebouncedState(''); | ||
|
|
||
| const openItems: BankAccountFilterItem[] = []; | ||
| const closedItems: BankAccountFilterItem[] = []; | ||
| for (const bankAccount of Object.values(bankAccountList ?? {})) { | ||
| const bankAccountID = bankAccount?.accountData?.bankAccountID; | ||
| if (!bankAccountID) { | ||
| continue; | ||
| } | ||
| if (!isFilterableBankAccount(bankAccount)) { | ||
| continue; | ||
| } | ||
|
|
||
| const key = bankAccountID.toString(); | ||
| const bankName = bankAccount?.accountData?.additionalData?.bankName; | ||
| const accountNumber = bankAccount?.accountData?.accountNumber ?? ''; | ||
| const {icon, iconSize, iconStyles} = getBankIcon({bankName, styles, maxIconSize: isLargeScreenWidth ? variables.w28 : undefined}); | ||
| const leftElement = ( | ||
| <View style={[styles.mr3, styles.alignItemsCenter, styles.justifyContentCenter]}> | ||
| <Icon | ||
| src={icon} | ||
| width={iconSize} | ||
| height={iconSize} | ||
| additionalStyles={iconStyles} | ||
| /> | ||
| </View> | ||
| ); | ||
|
|
||
| const item: BankAccountFilterItem = { | ||
| text: getBankAccountSearchLabel(bankAccount), | ||
| keyForList: key, | ||
| value: key, | ||
| isSelected: value.includes(key), | ||
| leftElement, | ||
| lastFour: accountNumber.slice(-4), | ||
| }; | ||
|
|
||
| if (bankAccount?.accountData?.state === CONST.BANK_ACCOUNT.STATE.OPEN) { | ||
| openItems.push(item); | ||
| } else { | ||
| closedItems.push(item); | ||
| } | ||
| } | ||
|
|
||
| const shouldShowSearchInput = openItems.length + closedItems.length >= CONST.STANDARD_LIST_ITEM_LIMIT; | ||
|
|
||
| const searchFunction = (item: BankAccountFilterItem) => | ||
| item.text.toLocaleLowerCase().includes(debouncedSearchTerm.toLocaleLowerCase()) || item.lastFour.toLocaleLowerCase().includes(debouncedSearchTerm.toLocaleLowerCase()); | ||
|
|
||
| const selectedData = [...openItems, ...closedItems].filter((item) => item.isSelected && searchFunction(item)); | ||
| const unselectedOpenData = openItems.filter((item) => !item.isSelected && searchFunction(item)); | ||
| const unselectedClosedData = closedItems.filter((item) => !item.isSelected && searchFunction(item)); | ||
|
|
||
| const itemCount = selectedData.length + unselectedOpenData.length + unselectedClosedData.length; | ||
| const sectionHeaderCount = unselectedClosedData.length > 0 ? 1 : 0; | ||
|
|
||
| const sections = [ | ||
| { | ||
| title: undefined, | ||
| data: selectedData, | ||
| sectionIndex: 0, | ||
| }, | ||
| { | ||
| title: undefined, | ||
| data: unselectedOpenData, | ||
| sectionIndex: 1, | ||
| }, | ||
| { | ||
| title: translate('search.filters.bankAccount.closedBankAccounts'), | ||
| data: unselectedClosedData, | ||
| sectionIndex: 2, | ||
| }, | ||
| ]; | ||
|
|
||
| const updateSelection = (item: BankAccountFilterItem) => { | ||
| if (!item.keyForList) { | ||
| return; | ||
| } | ||
| if (item.isSelected) { | ||
| onChange(value.filter((id) => id !== item.keyForList)); | ||
| return; | ||
| } | ||
| onChange([...value, item.keyForList]); | ||
| }; | ||
|
|
||
| const textInputOptions: TextInputOptions = { | ||
| value: searchTerm, | ||
| label: translate('common.search'), | ||
| onChangeText: setSearchTerm, | ||
| headerMessage: debouncedSearchTerm.trim() && sections.every((section) => !section.data.length) ? translate('common.noResultsFound') : '', | ||
| style: { | ||
| containerStyle: selectionListTextInputStyle, | ||
| }, | ||
| disableAutoFocus: !autoFocus, | ||
| }; | ||
|
|
||
| const isLoadingOnyxData = isLoadingOnyxValue(bankAccountListMetadata); | ||
| const reasonAttributes: SkeletonSpanReasonAttributes = {context: 'SearchFiltersBankAccountPage', isLoadingFromOnyx: isLoadingOnyxData}; | ||
|
|
||
| return ( | ||
| <ListFilterView | ||
| itemCount={itemCount} | ||
| itemHeight={variables.optionRowHeight} | ||
| isSearchable={shouldShowSearchInput} | ||
| extraHeight={28 * sectionHeaderCount} | ||
| > | ||
| {isLoadingOnyxData ? ( | ||
| <View style={[styles.flex1, styles.flexColumn, styles.justifyContentCenter, styles.alignItemsCenter]}> | ||
| <ActivityIndicator | ||
| color={theme.spinner} | ||
| size={CONST.ACTIVITY_INDICATOR_SIZE.LARGE} | ||
| style={[styles.pl3]} | ||
| reasonAttributes={reasonAttributes} | ||
| /> | ||
| </View> | ||
| ) : ( | ||
| <SelectionListWithSections<BankAccountFilterItem> | ||
| sections={sections} | ||
| ListItem={MultiSelectListItem} | ||
| onSelectRow={updateSelection} | ||
| shouldPreventDefaultFocusOnSelectRow={false} | ||
| shouldShowTextInput={shouldShowSearchInput} | ||
| textInputOptions={textInputOptions} | ||
| shouldStopPropagation | ||
| canSelectMultiple | ||
| style={selectionListStyle} | ||
| footerContent={footer} | ||
| /> | ||
| )} | ||
| </ListFilterView> | ||
| ); | ||
| } | ||
|
|
||
| export default BankAccountSelector; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| import useOnyx from '@hooks/useOnyx'; | ||
| import {getBankAccountSearchLabel} from '@libs/BankAccountUtils'; | ||
| import type {SearchFilter} from '@libs/SearchUIUtils'; | ||
| import ONYXKEYS from '@src/ONYXKEYS'; | ||
|
|
||
| function useFilterBankAccountValue(value: SearchFilter['value']): string { | ||
| const [bankAccountList] = useOnyx(ONYXKEYS.BANK_ACCOUNT_LIST); | ||
|
|
||
| const ids = Array.isArray(value) ? value : [value]; | ||
|
|
||
| const bankAccountLabels = Object.values(bankAccountList ?? {}) | ||
| .filter((bankAccount) => ids.includes(bankAccount?.accountData?.bankAccountID?.toString() ?? '')) | ||
| .map((bankAccount) => getBankAccountSearchLabel(bankAccount)); | ||
|
|
||
| return bankAccountLabels.join(', '); | ||
| } | ||
|
|
||
| export default useFilterBankAccountValue; |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When an account has both a business settlement account and a personal deposit account, the bank-account filter is shown because visibility only requires a business account, but this selector adds every bank account that has an ID. The new full-page picker explicitly excludes personal accounts because the backend search filter does not accept them, so this shared selector can let users create
bankAccount:<personalID>searches that will never match. Filter this list to business accounts here as well, while preserving whichever non-open business accounts should remain searchable.Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is valid concert @allgandalf
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed in 91ed111. BankAccountSelector now skips anything that is not type=BUSINESS before adding to the picker, matching the dedicated page logic. same filter applied to the autocomplete in ad84a77.