Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 0 additions & 1 deletion src/CONST/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1025,7 +1025,6 @@ const CONST = {
SUGGESTED_FOLLOWUPS: 'suggestedFollowups',
BULK_EDIT: 'bulkEdit',
NEW_MANUAL_EXPENSE_FLOW: 'newManualExpenseFlow',
WALLET_CONNECTION_STATUS: 'walletConnectionStatus',
BULK_SUBMIT_APPROVE_PAY: 'bulkSubmitApprovePay',
VENDOR_MATCHING: 'vendorMatching',
DUALENTRY: 'dualEntry',
Expand Down
1 change: 0 additions & 1 deletion src/languages/de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,6 @@ const translations: TranslationDeepObject<typeof en> = {
copyToClipboard: 'In Zwischenablage kopieren',
thisIsTakingLongerThanExpected: 'Das dauert länger als erwartet ...',
domains: 'Domains',
actionRequired: 'Aktion erforderlich',
duplicate: 'Duplizieren',
duplicated: 'Dupliziert',
duplicateExpense: 'Doppelte Ausgabe',
Expand Down
1 change: 0 additions & 1 deletion src/languages/el.ts
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,6 @@ const translations: TranslationDeepObject<typeof en> = {
copyToClipboard: 'Αντιγραφή στο πρόχειρο',
thisIsTakingLongerThanExpected: 'Αυτό παίρνει περισσότερο χρόνο από το αναμενόμενο...',
domains: 'Τομείς',
actionRequired: 'Απαιτείται ενέργεια',
duplicate: 'Διπλότυπο',
duplicated: 'Διπλότυπο',
duplicateExpense: 'Διπλή δαπάνη',
Expand Down
1 change: 0 additions & 1 deletion src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,6 @@ const translations = {
copyToClipboard: 'Copy to clipboard',
thisIsTakingLongerThanExpected: 'This is taking longer than expected...',
domains: 'Domains',
actionRequired: 'Action required',
duplicate: 'Duplicate',
duplicated: 'Duplicated',
duplicateExpense: 'Duplicate expense',
Expand Down
1 change: 0 additions & 1 deletion src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,6 @@ const translations: TranslationDeepObject<typeof en> = {
copyToClipboard: 'Copiar al portapapeles',
thisIsTakingLongerThanExpected: 'Está tardando más de lo esperado...',
domains: 'Dominios',
actionRequired: 'Acción requerida',
duplicate: 'Duplicar',
duplicated: 'Duplicado',
duplicateExpense: 'Duplicar gasto',
Expand Down
1 change: 0 additions & 1 deletion src/languages/fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,6 @@ const translations: TranslationDeepObject<typeof en> = {
copyToClipboard: 'Copier dans le presse-papiers',
thisIsTakingLongerThanExpected: 'Cela prend plus de temps que prévu...',
domains: 'Domaines',
actionRequired: 'Action requise',
duplicate: 'Dupliquer',
duplicated: 'Dupliqué',
duplicateExpense: 'Dépense en double',
Expand Down
1 change: 0 additions & 1 deletion src/languages/it.ts
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,6 @@ const translations: TranslationDeepObject<typeof en> = {
copyToClipboard: 'Copia negli appunti',
thisIsTakingLongerThanExpected: 'Sta impiegando più tempo del previsto...',
domains: 'Domini',
actionRequired: 'Azione richiesta',
duplicate: 'Duplica',
duplicated: 'Duplicato',
duplicateExpense: 'Spesa duplicata',
Expand Down
1 change: 0 additions & 1 deletion src/languages/ja.ts
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,6 @@ const translations: TranslationDeepObject<typeof en> = {
copyToClipboard: 'クリップボードにコピー',
thisIsTakingLongerThanExpected: '想定より時間がかかっています…',
domains: 'ドメイン',
actionRequired: '対応が必要',
duplicate: '複製',
duplicated: '複製済み',
duplicateExpense: '重複経費',
Expand Down
1 change: 0 additions & 1 deletion src/languages/nl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,6 @@ const translations: TranslationDeepObject<typeof en> = {
copyToClipboard: 'Kopieer naar klembord',
thisIsTakingLongerThanExpected: 'Dit duurt langer dan verwacht...',
domains: 'Domeinen',
actionRequired: 'Actie vereist',
duplicate: 'Dupliceren',
duplicated: 'Gedupliceerd',
opensInNewTab: 'Opent in een nieuw tabblad',
Expand Down
1 change: 0 additions & 1 deletion src/languages/pl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,6 @@ const translations: TranslationDeepObject<typeof en> = {
copyToClipboard: 'Skopiuj do schowka',
thisIsTakingLongerThanExpected: 'To trwa dłużej, niż się spodziewaliśmy...',
domains: 'Domeny',
actionRequired: 'Wymagane działanie',
duplicate: 'Duplikuj',
duplicated: 'Zduplikowano',
opensInNewTab: 'Otwiera się w nowej karcie',
Expand Down
1 change: 0 additions & 1 deletion src/languages/pt-BR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,6 @@ const translations: TranslationDeepObject<typeof en> = {
copyToClipboard: 'Copiar para a área de transferência',
thisIsTakingLongerThanExpected: 'Isso está demorando mais do que o esperado...',
domains: 'Domínios',
actionRequired: 'Ação necessária',
duplicate: 'Duplicar',
duplicated: 'Duplicado',
duplicateExpense: 'Duplicar despesa',
Expand Down
1 change: 0 additions & 1 deletion src/languages/zh-hans.ts
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,6 @@ const translations: TranslationDeepObject<typeof en> = {
copyToClipboard: '复制到剪贴板',
thisIsTakingLongerThanExpected: '这比预期花费的时间更长…',
domains: '域名',
actionRequired: '需要采取操作',
duplicate: '复制',
duplicated: '已重复',
duplicateExpense: '重复报销',
Expand Down
7 changes: 2 additions & 5 deletions src/pages/settings/Wallet/WalletPage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import useNetwork from '@hooks/useNetwork';
import useOnyx from '@hooks/useOnyx';
import usePaymentMethodState from '@hooks/usePaymentMethodState';
import type {FormattedSelectedPaymentMethod} from '@hooks/usePaymentMethodState/types';
import usePermissions from '@hooks/usePermissions';
import useResponsiveLayout from '@hooks/useResponsiveLayout';
import useTheme from '@hooks/useTheme';
import useThemeStyles from '@hooks/useThemeStyles';
Expand Down Expand Up @@ -101,8 +100,6 @@ function WalletPage() {
const [betas] = useOnyx(ONYXKEYS.BETAS);
const delegateAccountID = useDelegateAccountID();
const isUserValidated = userAccount?.validated ?? false;
const {isBetaEnabled} = usePermissions();
const shouldShowWalletConnectionStatus = isBetaEnabled(CONST.BETAS.WALLET_CONNECTION_STATUS);
const {isAccountLocked} = useLockedAccountState();
const {showLockedAccountModal} = useLockedAccountActions();
const {login: currentUserLogin, email, accountID: currentUserAccountID} = useCurrentUserPersonalDetails();
Expand Down Expand Up @@ -709,7 +706,7 @@ function WalletPage() {
style={[styles.mt5, [shouldUseNarrowLayout ? styles.mhn5 : styles.mhn8]]}
listItemStyle={shouldUseNarrowLayout ? styles.ph5 : styles.ph8}
shouldShowBankAccountSections
shouldShowConnectionStatus={shouldShowWalletConnectionStatus}
shouldShowConnectionStatus
threeDotsMenuItems={threeDotMenuItems}
/>
</Section>
Expand All @@ -729,7 +726,7 @@ function WalletPage() {
threeDotsMenuItems={cardThreeDotsMenuItems}
style={[styles.mt5, [shouldUseNarrowLayout ? styles.mhn5 : styles.mhn8]]}
listItemStyle={shouldUseNarrowLayout ? styles.ph5 : styles.ph8}
shouldShowConnectionStatus={shouldShowWalletConnectionStatus}
shouldShowConnectionStatus

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This hardcoded shouldShowConnectionStatus broke PaymentMethodList's combo-card grouping, which only merges same-domain Expensify Cards into one row when !shouldShowConnectionStatus — removing the beta made that guard permanently false, so legacy combo cards (paired physical + virtual) started rendering as two duplicate rows. Fixed in #103199 by dropping the !shouldShowConnectionStatus check from the merge condition.

/>
<View style={shouldUseNarrowLayout ? styles.mhn5 : styles.mhn8}>
<MenuItem
Expand Down
98 changes: 30 additions & 68 deletions src/pages/workspace/workflows/tabs/WorkflowsPaymentsTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import {useMemoizedLazyExpensifyIcons} from '@hooks/useLazyAsset';
import useLocalize from '@hooks/useLocalize';
import useNetwork from '@hooks/useNetwork';
import useOnyx from '@hooks/useOnyx';
import usePermissions from '@hooks/usePermissions';
import usePersonalDetailByLogin from '@hooks/usePersonalDetailByLogin';
import usePolicy from '@hooks/usePolicy';
import usePolicyFeatureWriteAccess from '@hooks/usePolicyFeatureWriteAccess';
Expand Down Expand Up @@ -61,12 +60,10 @@ function WorkflowsPaymentsTab({policyID}: WorkflowsPaymentsTabProps) {
const {translate, formatPhoneNumber} = useLocalize();
const styles = useThemeStyles();
const policy = usePolicy(policyID);
const expensifyIcons = useMemoizedLazyExpensifyIcons(['DotIndicator', 'Plus']);
const expensifyIcons = useMemoizedLazyExpensifyIcons(['Plus']);
const {showConfirmModal} = useConfirmModal();
const {isOffline} = useNetwork();
const {isBetaEnabled} = usePermissions();
const isGlobalReimbursementFXEnabled = useIsGlobalReimbursementFXEnabled();
const isWalletConnectionStatusBetaEnabled = isBetaEnabled(CONST.BETAS.WALLET_CONNECTION_STATUS);

const [bankAccountList] = useOnyx(ONYXKEYS.BANK_ACCOUNT_LIST);
const [reimbursementAccount] = useOnyx(ONYXKEYS.REIMBURSEMENT_ACCOUNT);
Expand Down Expand Up @@ -149,20 +146,10 @@ function WorkflowsPaymentsTab({policyID}: WorkflowsPaymentsTabProps) {
});

const hasReimburserError = !!policy?.errorFields?.reimburser;
const getBadgeText = (accountState: string | undefined) => {
switch (accountState) {
case CONST.BANK_ACCOUNT.STATE.SETUP:
return translate('common.actionRequired');
Comment thread
marufsharifi marked this conversation as resolved.
Resolved
case CONST.BANK_ACCOUNT.STATE.LOCKED:
return translate('common.locked');
default:
return undefined;
}
};
// `||` not `??`: bankCurrency can be an empty string, which should fall through to additionalData.
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
const bankAccountCurrency = bankAccountConnectedToWorkspace?.bankCurrency || bankAccountConnectedToWorkspace?.accountData?.additionalData?.currency;
const bankConnectionStatus = isWalletConnectionStatusBetaEnabled ? getBankAccountConnectionStatus(state, bankAccountCurrency) : undefined;
const bankConnectionStatus = getBankAccountConnectionStatus(state, bankAccountCurrency);
const bankConnectionBrickRoadIndicator = bankConnectionStatus?.brickRoadIndicator ?? (hasReimburserError ? CONST.BRICK_ROAD_INDICATOR_STATUS.ERROR : undefined);
const bankConnectionStatusAddon = bankConnectionStatus ? (
<ConnectionStatusBadge
Expand Down Expand Up @@ -209,17 +196,10 @@ function WorkflowsPaymentsTab({policyID}: WorkflowsPaymentsTabProps) {
});
};

let bankAccountMenuItemOnPress: React.ComponentProps<typeof MenuItem>['onPress'];
if (isWalletConnectionStatusBetaEnabled) {
bankAccountMenuItemOnPress = canInteractWithBankAccountRow ? handleBankAccountPress : undefined;
} else {
bankAccountMenuItemOnPress = canWritePayments ? handleBankAccountPress : undefined;
}

const bankAccountMenuItemProps: React.ComponentProps<typeof MenuItem> = {
title: bankTitle,
description: getPaymentMethodDescription(CONST.PAYMENT_METHODS.BUSINESS_BANK_ACCOUNT, accountData, translate),
onPress: bankAccountMenuItemOnPress,
onPress: canInteractWithBankAccountRow ? handleBankAccountPress : undefined,
displayInDefaultIconColor: true,
icon: bankIcon.icon,
iconHeight: bankIcon.iconHeight ?? bankIcon.iconSize,
Expand All @@ -229,28 +209,14 @@ function WorkflowsPaymentsTab({policyID}: WorkflowsPaymentsTabProps) {
descriptionTextStyle: isBankAccountPendingDelete ? styles.offlineFeedbackDeleted : undefined,
sentryLabel: CONST.SENTRY_LABEL.WORKSPACE.WORKFLOWS.BANK_ACCOUNT,
shouldGreyOutWhenDisabled: !policy?.pendingFields?.reimbursementChoice,
...(isWalletConnectionStatusBetaEnabled
? {
disabled: isOffline || !canWritePayments || isBankAccountPendingDelete,
shouldShowRightIcon: canWritePayments && !isBankAccountPendingDelete,
interactive: canWritePayments && !isBankAccountPendingDelete,
descriptionAddon: bankConnectionStatusAddon,
shouldRemoveBackground: true,
shouldRemoveHoverBackground: true,
wrapperStyle: styles.ph0,
brickRoadIndicator: bankConnectionMessage ? undefined : bankConnectionBrickRoadIndicator,
}
: {
disabled: isOffline || !canWritePayments,
shouldShowRightIcon: canWritePayments,
interactive: canWritePayments,
badgeIcon: isAccountInSetupState || (isBusinessBankAccountLocked && canWritePayments) ? expensifyIcons.DotIndicator : undefined,
badgeText: getBadgeText(accountData?.state),
isBadgeSuccess: isAccountInSetupState,
isBadgeError: isBusinessBankAccountLocked && canWritePayments,
wrapperStyle: [styles.sectionMenuItemTopDescription, styles.mt3, styles.mbn3],
brickRoadIndicator: hasReimburserError ? CONST.BRICK_ROAD_INDICATOR_STATUS.ERROR : undefined,
}),
disabled: isOffline || !canWritePayments || isBankAccountPendingDelete,
shouldShowRightIcon: canWritePayments && !isBankAccountPendingDelete,
interactive: canWritePayments && !isBankAccountPendingDelete,
descriptionAddon: bankConnectionStatusAddon,
shouldRemoveBackground: true,
shouldRemoveHoverBackground: true,
wrapperStyle: styles.ph0,
brickRoadIndicator: bankConnectionMessage ? undefined : bankConnectionBrickRoadIndicator,
};
const bankAccountMenuItem = <MenuItem {...bankAccountMenuItemProps} />;

Expand Down Expand Up @@ -298,29 +264,25 @@ function WorkflowsPaymentsTab({policyID}: WorkflowsPaymentsTabProps) {
<View style={[styles.sectionMenuItemTopDescription, styles.mt5, styles.pb1, styles.pt1]}>
<Text style={[styles.textLabelSupportingNormal, styles.colorMuted]}>{translate('workflowsPayerPage.paymentAccount')}</Text>
</View>
{isWalletConnectionStatusBetaEnabled ? (
<Hoverable>
{(isHovered) => (
<View style={[styles.sectionMenuItemTopDescription, styles.mt3, styles.mbn3, isHovered && styles.hoveredComponentBG]}>
{bankAccountMenuItem}
{!!bankConnectionMessage && (
<View style={styles.mb2}>
<ConnectionStatusMessage
message={bankConnectionMessage}
actionText={bankConnectionActionText}
onActionPress={canWritePayments && canPerformBankAccountAction ? handleBankAccountPress : undefined}
isActionDisabled={!canInteractWithBankAccountRow}
statusTone="danger"
shouldIncludeHorizontalPadding={false}
/>
</View>
)}
</View>
)}
</Hoverable>
) : (
bankAccountMenuItem
)}
<Hoverable>
{(isHovered) => (
<View style={[styles.sectionMenuItemTopDescription, styles.mt3, styles.mbn3, isHovered && styles.hoveredComponentBG]}>
{bankAccountMenuItem}
{!!bankConnectionMessage && (
<View style={styles.mb2}>
<ConnectionStatusMessage
message={bankConnectionMessage}
actionText={bankConnectionActionText}
onActionPress={canWritePayments && canPerformBankAccountAction ? handleBankAccountPress : undefined}
isActionDisabled={!canInteractWithBankAccountRow}
statusTone="danger"
shouldIncludeHorizontalPadding={false}
/>
</View>
)}
</View>
)}
</Hoverable>
</OfflineWithFeedback>
) : (
canWritePayments && (
Expand Down
Loading