-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Add view transactions cta to Expensify card and company cards page #55095
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
Changes from all commits
cc64293
e474137
936ddc7
4bda948
0f925fb
2b5511c
90ea140
ab09dbb
3453dca
6e9621c
4a800f6
84fbd33
d7e8ca2
bbb8385
3238b9b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -624,14 +624,22 @@ function buildCannedSearchQuery({ | |
| type = CONST.SEARCH.DATA_TYPES.EXPENSE, | ||
| status = CONST.SEARCH.STATUS.EXPENSE.ALL, | ||
| policyID, | ||
| cardID, | ||
| }: { | ||
| type?: SearchDataTypes; | ||
| status?: SearchStatus; | ||
| policyID?: string; | ||
| cardID?: string; | ||
| } = {}): SearchQueryString { | ||
| const queryString = policyID | ||
| ? `type:${type} status:${Array.isArray(status) ? status.join(',') : status} policyID:${policyID}` | ||
| : `type:${type} status:${Array.isArray(status) ? status.join(',') : status}`; | ||
| let queryString = `type:${type} status:${Array.isArray(status) ? status.join(',') : status}`; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. did you try to mock some transaction data and see if we get the search results ?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is the same as before. I haven't tested this part. Did you notice any issues? |
||
|
|
||
| if (policyID) { | ||
| queryString = `type:${type} status:${Array.isArray(status) ? status.join(',') : status} policyID:${policyID}`; | ||
| } | ||
|
|
||
| if (cardID) { | ||
| queryString = `type:${type} status:${Array.isArray(status) ? status.join(',') : status} expense-type:card card:${cardID}`; | ||
| } | ||
|
|
||
| // Parse the query to fill all default query fields with values | ||
| const normalizedQueryJSON = buildSearchQueryJSON(queryString); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -27,14 +27,26 @@ import variables from '@styles/variables'; | |
| import CONST from '@src/CONST'; | ||
| import ONYXKEYS from '@src/ONYXKEYS'; | ||
| import ROUTES from '@src/ROUTES'; | ||
| import type {AccountData, CompanyCardFeed} from '@src/types/onyx'; | ||
| import type {AccountData, Card, CompanyCardFeed} from '@src/types/onyx'; | ||
| import type {BankIcon} from '@src/types/onyx/Bank'; | ||
| import type {Errors} from '@src/types/onyx/OnyxCommon'; | ||
| import type PaymentMethod from '@src/types/onyx/PaymentMethod'; | ||
| import type {FilterMethodPaymentType} from '@src/types/onyx/WalletTransfer'; | ||
| import {isEmptyObject} from '@src/types/utils/EmptyObject'; | ||
| import isLoadingOnyxValue from '@src/types/utils/isLoadingOnyxValue'; | ||
|
|
||
| type PaymentMethodPressHandler = ( | ||
| event?: GestureResponderEvent | KeyboardEvent, | ||
| accountType?: string, | ||
| accountData?: AccountData, | ||
| icon?: FormattedSelectedPaymentMethodIcon, | ||
| isDefault?: boolean, | ||
| methodID?: number, | ||
| description?: string, | ||
| ) => void; | ||
|
|
||
| type CardPressHandler = (event?: GestureResponderEvent | KeyboardEvent, cardData?: Card, icon?: FormattedSelectedPaymentMethodIcon, cardID?: number) => void; | ||
|
|
||
| type PaymentMethodListProps = { | ||
| /** Type of active/highlighted payment method */ | ||
| actionPaymentMethodType?: string; | ||
|
|
@@ -88,15 +100,7 @@ type PaymentMethodListProps = { | |
| shouldShowRightIcon?: boolean; | ||
|
|
||
| /** What to do when a menu item is pressed */ | ||
| onPress: ( | ||
| event?: GestureResponderEvent | KeyboardEvent, | ||
| accountType?: string, | ||
| accountData?: AccountData, | ||
| icon?: FormattedSelectedPaymentMethodIcon, | ||
| isDefault?: boolean, | ||
| methodID?: number, | ||
| description?: string, | ||
| ) => void; | ||
| onPress: PaymentMethodPressHandler | CardPressHandler; | ||
|
|
||
| /** The policy invoice's transfer bank accountID */ | ||
| invoiceTransferBankAccountID?: number; | ||
|
|
@@ -214,13 +218,14 @@ function PaymentMethodList({ | |
| const icon = getCardFeedIcon(card.bank as CompanyCardFeed); | ||
|
|
||
| if (!isExpensifyCard(card.cardID)) { | ||
| const pressHandler = onPress as CardPressHandler; | ||
| assignedCardsGrouped.push({ | ||
| key: card.cardID.toString(), | ||
| title: maskCardNumber(card.cardName, card.bank), | ||
| description: getDescriptionForPolicyDomainCard(card.domainName), | ||
| shouldShowRightIcon: false, | ||
| interactive: false, | ||
| interactive: true, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Came from this issue |
||
| canDismissError: false, | ||
| shouldShowRightIcon, | ||
| errors: card.errors, | ||
| pendingAction: card.pendingAction, | ||
| brickRoadIndicator: | ||
|
|
@@ -231,6 +236,20 @@ function PaymentMethodList({ | |
| iconStyles: [styles.cardIcon], | ||
| iconWidth: variables.cardIconWidth, | ||
| iconHeight: variables.cardIconHeight, | ||
| iconRight: Expensicons.ThreeDots, | ||
| isMethodActive: activePaymentMethodID === card.cardID, | ||
| onPress: (e: GestureResponderEvent | KeyboardEvent | undefined) => | ||
| pressHandler( | ||
| e, | ||
| card, | ||
| { | ||
| icon, | ||
| iconStyles: [styles.cardIcon], | ||
| iconWidth: variables.cardIconWidth, | ||
| iconHeight: variables.cardIconHeight, | ||
| }, | ||
| card.cardID, | ||
| ), | ||
| }); | ||
| return; | ||
| } | ||
|
|
@@ -294,11 +313,12 @@ function PaymentMethodList({ | |
| ); | ||
| } | ||
| combinedPaymentMethods = combinedPaymentMethods.map((paymentMethod) => { | ||
| const pressHandler = onPress as PaymentMethodPressHandler; | ||
| const isMethodActive = isPaymentMethodActive(actionPaymentMethodType, activePaymentMethodID, paymentMethod); | ||
| return { | ||
| ...paymentMethod, | ||
| onPress: (e: GestureResponderEvent) => | ||
| onPress( | ||
| pressHandler( | ||
| e, | ||
| paymentMethod.accountType, | ||
| paymentMethod.accountData, | ||
|
|
||
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.
Did we confirm this translation ?
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.
Yes.