From 5373dd62f5d496f2159e7e5bd3776f6d25919a73 Mon Sep 17 00:00:00 2001 From: Florent De Neve Date: Thu, 23 Nov 2023 11:03:12 -0400 Subject: [PATCH 1/8] Remove released betas --- src/CONST.ts | 7 -- src/components/AddPaymentMethodMenu.js | 77 +++++-------------- src/components/LHNOptionsList/OptionRowLHN.js | 2 +- src/components/SettlementButton.js | 2 +- src/libs/E2E/apiMocks/beginSignin.ts | 5 -- src/libs/Permissions.ts | 20 ----- src/libs/__mocks__/Permissions.ts | 1 - src/libs/actions/User.js | 1 - src/pages/ProfilePage.js | 2 +- .../AttachmentPickerWithMenuItems.js | 2 +- .../home/report/ReportActionItemSingle.js | 2 +- .../FloatingActionButtonAndPopover.js | 6 +- .../SignInOrAvatarWithOptionalStatus.js | 5 +- src/pages/settings/InitialSettingsPage.js | 2 +- src/pages/settings/Profile/ProfilePage.js | 6 +- src/pages/settings/Wallet/AddDebitCardPage.js | 4 - .../settings/Wallet/WalletPage/WalletPage.js | 19 +++-- src/pages/tasks/NewTaskDescriptionPage.js | 4 - src/pages/tasks/NewTaskDetailsPage.js | 4 - src/pages/tasks/NewTaskPage.js | 5 -- src/pages/tasks/NewTaskTitlePage.js | 4 - src/pages/workspace/WorkspacesListPage.js | 3 +- 22 files changed, 43 insertions(+), 140 deletions(-) diff --git a/src/CONST.ts b/src/CONST.ts index 436ac4ebbc31..fc4973e2cf39 100755 --- a/src/CONST.ts +++ b/src/CONST.ts @@ -248,17 +248,11 @@ const CONST = { BETAS: { ALL: 'all', CHRONOS_IN_CASH: 'chronosInCash', - PAY_WITH_EXPENSIFY: 'payWithExpensify', - FREE_PLAN: 'freePlan', DEFAULT_ROOMS: 'defaultRooms', - BETA_EXPENSIFY_WALLET: 'expensifyWallet', BETA_COMMENT_LINKING: 'commentLinking', INTERNATIONALIZATION: 'internationalization', POLICY_ROOMS: 'policyRooms', - PASSWORDLESS: 'passwordless', - TASKS: 'tasks', THREADS: 'threads', - CUSTOM_STATUS: 'customStatus', NEW_DOT_SAML: 'newDotSAML', PDF_META_STORE: 'pdfMetaStore', REPORT_ACTION_CONTEXT_MENU: 'reportActionContextMenu', @@ -320,7 +314,6 @@ const CONST = { SECURE_RECEIPTS: 'secureReceipts', SECURE_RECEIPTS_REPORTS: 'secureReceiptsReports', SELF_SERVICE_HARD_LAUNCH: 'selfServiceHardLaunch', - SEND_MONEY: 'sendMoney', SMART_SCAN_USER_DISPUTES: 'smartScanUserDisputes', SMS_SIGN_UP: 'smsSignUp', STRIPE_CONNECT: 'stripeConnect', diff --git a/src/components/AddPaymentMethodMenu.js b/src/components/AddPaymentMethodMenu.js index 4f1500132106..da98045c0a7e 100644 --- a/src/components/AddPaymentMethodMenu.js +++ b/src/components/AddPaymentMethodMenu.js @@ -1,19 +1,15 @@ -import lodashGet from 'lodash/get'; import PropTypes from 'prop-types'; import React from 'react'; import {withOnyx} from 'react-native-onyx'; import _ from 'underscore'; -import useLocalize from '@hooks/useLocalize'; import compose from '@libs/compose'; import Permissions from '@libs/Permissions'; -import * as ReportActionsUtils from '@libs/ReportActionsUtils'; -import * as ReportUtils from '@libs/ReportUtils'; -import iouReportPropTypes from '@pages/iouReportPropTypes'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; import * as Expensicons from './Icon/Expensicons'; import PopoverMenu from './PopoverMenu'; import refPropTypes from './refPropTypes'; +import withLocalize, {withLocalizePropTypes} from './withLocalize'; import withWindowDimensions from './withWindowDimensions'; const propTypes = { @@ -23,12 +19,6 @@ const propTypes = { /** Callback to execute when the component closes. */ onClose: PropTypes.func.isRequired, - /** Callback to execute when the payment method is selected. */ - onItemSelected: PropTypes.func.isRequired, - - /** The IOU/Expense report we are paying */ - iouReport: iouReportPropTypes, - /** Anchor position for the AddPaymentMenu. */ anchorPosition: PropTypes.shape({ horizontal: PropTypes.number, @@ -47,15 +37,10 @@ const propTypes = { /** Popover anchor ref */ anchorRef: refPropTypes, - /** Session info for the currently logged in user. */ - session: PropTypes.shape({ - /** Currently logged in user accountID */ - accountID: PropTypes.number, - }), + ...withLocalizePropTypes, }; const defaultProps = { - iouReport: {}, anchorPosition: {}, anchorAlignment: { horizontal: CONST.MODAL.ANCHOR_ORIGIN_HORIZONTAL.LEFT, @@ -63,50 +48,32 @@ const defaultProps = { }, betas: [], anchorRef: () => {}, - session: {}, }; -function AddPaymentMethodMenu({isVisible, onClose, anchorPosition, anchorAlignment, anchorRef, iouReport, onItemSelected, session, betas}) { - const {translate} = useLocalize(); - +function AddPaymentMethodMenu(props) { return ( { + props.onItemSelected(CONST.PAYMENT_METHODS.BANK_ACCOUNT); + }, + }, + ...([ { - text: translate('common.personalBankAccount'), - icon: Expensicons.Bank, - onSelected: () => { - onItemSelected(CONST.PAYMENT_METHODS.PERSONAL_BANK_ACCOUNT); - }, - }, - ] - : []), - ...(!ReportActionsUtils.hasRequestFromCurrentAccount(lodashGet(iouReport, 'reportID', 0), lodashGet(session, 'accountID', 0)) - ? [ - { - text: translate('common.businessBankAccount'), - icon: Expensicons.Building, - onSelected: () => onItemSelected(CONST.PAYMENT_METHODS.BUSINESS_BANK_ACCOUNT), - }, - ] - : []), - ...(Permissions.canUseWallet(betas) - ? [ - { - text: translate('common.debitCard'), + text: props.translate('common.debitCard'), icon: Expensicons.CreditCard, - onSelected: () => onItemSelected(CONST.PAYMENT_METHODS.DEBIT_CARD), + onSelected: () => props.onItemSelected(CONST.PAYMENT_METHODS.DEBIT_CARD), }, - ] - : []), + ]), ]} withoutOverlay /> @@ -119,12 +86,10 @@ AddPaymentMethodMenu.displayName = 'AddPaymentMethodMenu'; export default compose( withWindowDimensions, + withLocalize, withOnyx({ betas: { key: ONYXKEYS.BETAS, }, - session: { - key: ONYXKEYS.SESSION, - }, }), )(AddPaymentMethodMenu); diff --git a/src/components/LHNOptionsList/OptionRowLHN.js b/src/components/LHNOptionsList/OptionRowLHN.js index 8420f3db7a1e..117d15339dae 100644 --- a/src/components/LHNOptionsList/OptionRowLHN.js +++ b/src/components/LHNOptionsList/OptionRowLHN.js @@ -157,7 +157,7 @@ function OptionRowLHN(props) { const statusClearAfterDate = lodashGet(optionItem, 'status.clearAfter', ''); const formattedDate = DateUtils.getStatusUntilDate(statusClearAfterDate); const statusContent = formattedDate ? `${statusText} (${formattedDate})` : statusText; - const isStatusVisible = Permissions.canUseCustomStatus(props.betas) && !!emojiCode && ReportUtils.isOneOnOneChat(ReportUtils.getReport(optionItem.reportID)); + const isStatusVisible = !!emojiCode && ReportUtils.isOneOnOneChat(ReportUtils.getReport(optionItem.reportID)); const isGroupChat = optionItem.type === CONST.REPORT.TYPE.CHAT && _.isEmpty(optionItem.chatType) && !optionItem.isThread && lodashGet(optionItem, 'displayNamesWithTooltips.length', 0) > 2; diff --git a/src/components/SettlementButton.js b/src/components/SettlementButton.js index 27ba3d08a16f..f281ddd6c003 100644 --- a/src/components/SettlementButton.js +++ b/src/components/SettlementButton.js @@ -155,7 +155,7 @@ function SettlementButton({ value: CONST.IOU.PAYMENT_TYPE.ELSEWHERE, }, }; - const canUseWallet = !isExpenseReport && currency === CONST.CURRENCY.USD && Permissions.canUsePayWithExpensify(betas) && Permissions.canUseWallet(betas); + const canUseWallet = !isExpenseReport && currency === CONST.CURRENCY.USD; // To achieve the one tap pay experience we need to choose the correct payment type as default, // if user already paid for some request or expense, let's use the last payment method or use default. diff --git a/src/libs/E2E/apiMocks/beginSignin.ts b/src/libs/E2E/apiMocks/beginSignin.ts index 298846250a12..c5002f1f3dd8 100644 --- a/src/libs/E2E/apiMocks/beginSignin.ts +++ b/src/libs/E2E/apiMocks/beginSignin.ts @@ -17,11 +17,6 @@ const beginSignin = ({email}: SigninParams): Response => ({ validated: true, }, }, - { - onyxMethod: 'set', - key: 'betas', - value: ['passwordless'], - }, ], jsonCode: 200, requestID: '783e54ef4b38cff5-SJC', diff --git a/src/libs/Permissions.ts b/src/libs/Permissions.ts index 0c8843b87415..c3e01735fb07 100644 --- a/src/libs/Permissions.ts +++ b/src/libs/Permissions.ts @@ -9,18 +9,10 @@ function canUseChronos(betas: Beta[]): boolean { return betas?.includes(CONST.BETAS.CHRONOS_IN_CASH) || canUseAllBetas(betas); } -function canUsePayWithExpensify(betas: Beta[]): boolean { - return betas?.includes(CONST.BETAS.PAY_WITH_EXPENSIFY) || canUseAllBetas(betas); -} - function canUseDefaultRooms(betas: Beta[]): boolean { return betas?.includes(CONST.BETAS.DEFAULT_ROOMS) || canUseAllBetas(betas); } -function canUseWallet(betas: Beta[]): boolean { - return betas?.includes(CONST.BETAS.BETA_EXPENSIFY_WALLET) || canUseAllBetas(betas); -} - function canUseCommentLinking(betas: Beta[]): boolean { return betas?.includes(CONST.BETAS.BETA_COMMENT_LINKING) || canUseAllBetas(betas); } @@ -34,14 +26,6 @@ function canUsePolicyRooms(betas: Beta[]): boolean { return betas?.includes(CONST.BETAS.POLICY_ROOMS) || canUseAllBetas(betas); } -function canUseTasks(betas: Beta[]): boolean { - return betas?.includes(CONST.BETAS.TASKS) || canUseAllBetas(betas); -} - -function canUseCustomStatus(betas: Beta[]): boolean { - return betas?.includes(CONST.BETAS.CUSTOM_STATUS) || canUseAllBetas(betas); -} - function canUseViolations(betas: Beta[]): boolean { return betas?.includes(CONST.BETAS.VIOLATIONS) || canUseAllBetas(betas); } @@ -55,13 +39,9 @@ function canUseLinkPreviews(): boolean { export default { canUseChronos, - canUsePayWithExpensify, canUseDefaultRooms, - canUseWallet, canUseCommentLinking, canUsePolicyRooms, - canUseTasks, - canUseCustomStatus, canUseLinkPreviews, canUseViolations, }; diff --git a/src/libs/__mocks__/Permissions.ts b/src/libs/__mocks__/Permissions.ts index e95d13f52803..4f47c0b756b7 100644 --- a/src/libs/__mocks__/Permissions.ts +++ b/src/libs/__mocks__/Permissions.ts @@ -12,5 +12,4 @@ export default { ...jest.requireActual('../Permissions'), canUseDefaultRooms: (betas: Beta[]) => betas.includes(CONST.BETAS.DEFAULT_ROOMS), canUsePolicyRooms: (betas: Beta[]) => betas.includes(CONST.BETAS.POLICY_ROOMS), - canUseCustomStatus: (betas: Beta[]) => betas.includes(CONST.BETAS.CUSTOM_STATUS), }; diff --git a/src/libs/actions/User.js b/src/libs/actions/User.js index 3c91dc4624cd..ad6fd7be10dd 100644 --- a/src/libs/actions/User.js +++ b/src/libs/actions/User.js @@ -77,7 +77,6 @@ function closeAccount(message) { * Resends a validation link to a given login * * @param {String} login - * @param {Boolean} isPasswordless - temporary param to trigger passwordless flow in backend */ function resendValidateCode(login) { Session.resendValidateCode(login); diff --git a/src/pages/ProfilePage.js b/src/pages/ProfilePage.js index 4b3c927ef317..538601ad68ad 100755 --- a/src/pages/ProfilePage.js +++ b/src/pages/ProfilePage.js @@ -133,7 +133,7 @@ function ProfilePage(props) { const statusEmojiCode = lodashGet(details, 'status.emojiCode', ''); const statusText = lodashGet(details, 'status.text', ''); - const hasStatus = !!statusEmojiCode && Permissions.canUseCustomStatus(props.betas); + const hasStatus = !!statusEmojiCode; const statusContent = `${statusEmojiCode} ${statusText}`; const navigateBackTo = lodashGet(props.route, 'params.backTo', ROUTES.HOME); diff --git a/src/pages/home/report/ReportActionCompose/AttachmentPickerWithMenuItems.js b/src/pages/home/report/ReportActionCompose/AttachmentPickerWithMenuItems.js index 44183b23e43f..17dad987377c 100644 --- a/src/pages/home/report/ReportActionCompose/AttachmentPickerWithMenuItems.js +++ b/src/pages/home/report/ReportActionCompose/AttachmentPickerWithMenuItems.js @@ -152,7 +152,7 @@ function AttachmentPickerWithMenuItems({ * @returns {Boolean} */ const taskOption = useMemo(() => { - if (!Permissions.canUseTasks(betas) || !ReportUtils.canCreateTaskInReport(report)) { + if (!ReportUtils.canCreateTaskInReport(report)) { return []; } diff --git a/src/pages/home/report/ReportActionItemSingle.js b/src/pages/home/report/ReportActionItemSingle.js index 955e024bd7a8..d60c2fc6914c 100644 --- a/src/pages/home/report/ReportActionItemSingle.js +++ b/src/pages/home/report/ReportActionItemSingle.js @@ -205,7 +205,7 @@ function ReportActionItemSingle(props) { ); }; - const hasEmojiStatus = !displayAllActors && status && status.emojiCode && Permissions.canUseCustomStatus(props.betas); + const hasEmojiStatus = !displayAllActors && status && status.emojiCode; const formattedDate = DateUtils.getStatusUntilDate(lodashGet(status, 'clearAfter')); const statusText = lodashGet(status, 'text', ''); const statusTooltipText = formattedDate ? `${statusText} (${formattedDate})` : statusText; diff --git a/src/pages/home/sidebar/SidebarScreen/FloatingActionButtonAndPopover.js b/src/pages/home/sidebar/SidebarScreen/FloatingActionButtonAndPopover.js index 739f7e3e0295..2e18dee79b59 100644 --- a/src/pages/home/sidebar/SidebarScreen/FloatingActionButtonAndPopover.js +++ b/src/pages/home/sidebar/SidebarScreen/FloatingActionButtonAndPopover.js @@ -207,15 +207,13 @@ function FloatingActionButtonAndPopover(props) { text: props.translate('iou.sendMoney'), onSelected: () => interceptAnonymousUser(() => IOU.startMoneyRequest(CONST.IOU.TYPE.SEND)), }, - ...(Permissions.canUseTasks(props.betas) - ? [ + ...([ { icon: Expensicons.Task, text: props.translate('newTaskPage.assignTask'), onSelected: () => interceptAnonymousUser(() => Task.clearOutTaskInfoAndNavigate()), }, - ] - : []), + ]), { icon: Expensicons.Heart, text: props.translate('sidebarScreen.saveTheWorld'), diff --git a/src/pages/home/sidebar/SignInOrAvatarWithOptionalStatus.js b/src/pages/home/sidebar/SignInOrAvatarWithOptionalStatus.js index 8e41e1c6af6a..6dc3aaec45b1 100644 --- a/src/pages/home/sidebar/SignInOrAvatarWithOptionalStatus.js +++ b/src/pages/home/sidebar/SignInOrAvatarWithOptionalStatus.js @@ -32,9 +32,8 @@ const defaultProps = { }, }; -function SignInOrAvatarWithOptionalStatus({currentUserPersonalDetails, isCreateMenuOpen, betas}) { - const statusEmojiCode = lodashGet(currentUserPersonalDetails, 'status.emojiCode', ''); - const emojiStatus = Permissions.canUseCustomStatus(betas) ? statusEmojiCode : ''; +function SignInOrAvatarWithOptionalStatus({currentUserPersonalDetails, isCreateMenuOpen}) { + const emojiStatus = lodashGet(currentUserPersonalDetails, 'status.emojiCode', ''); if (Session.isAnonymousUser()) { return ; diff --git a/src/pages/settings/InitialSettingsPage.js b/src/pages/settings/InitialSettingsPage.js index d88105b31360..bf5d1a9aa4a2 100755 --- a/src/pages/settings/InitialSettingsPage.js +++ b/src/pages/settings/InitialSettingsPage.js @@ -289,7 +289,7 @@ function InitialSettingsPage(props) { * @returns {Number} the user wallet balance */ const getWalletBalance = (isPaymentItem) => - isPaymentItem && Permissions.canUseWallet(props.betas) ? CurrencyUtils.convertToDisplayString(props.userWallet.currentBalance) : undefined; + isPaymentItem && CurrencyUtils.convertToDisplayString(props.userWallet.currentBalance); return ( <> diff --git a/src/pages/settings/Profile/ProfilePage.js b/src/pages/settings/Profile/ProfilePage.js index 1e4485b4c36b..6dae3f5b01f7 100755 --- a/src/pages/settings/Profile/ProfilePage.js +++ b/src/pages/settings/Profile/ProfilePage.js @@ -83,15 +83,13 @@ function ProfilePage(props) { pageRoute: ROUTES.SETTINGS_CONTACT_METHODS.route, brickRoadIndicator: contactMethodBrickRoadIndicator, }, - ...(Permissions.canUseCustomStatus(props.betas) - ? [ + ...([ { description: props.translate('statusPage.status'), title: emojiCode ? `${emojiCode} ${lodashGet(props, 'currentUserPersonalDetails.status.text', '')}` : '', pageRoute: ROUTES.SETTINGS_STATUS, }, - ] - : []), + ]), { description: props.translate('pronounsPage.pronouns'), title: getPronouns(), diff --git a/src/pages/settings/Wallet/AddDebitCardPage.js b/src/pages/settings/Wallet/AddDebitCardPage.js index 45893dfb5d65..ffa13a0a1441 100644 --- a/src/pages/settings/Wallet/AddDebitCardPage.js +++ b/src/pages/settings/Wallet/AddDebitCardPage.js @@ -104,10 +104,6 @@ function DebitCardPage(props) { return errors; }; - if (!Permissions.canUseWallet(props.betas)) { - return ; - } - return ( nameOnCardRef.current && nameOnCardRef.current.focus()} diff --git a/src/pages/settings/Wallet/WalletPage/WalletPage.js b/src/pages/settings/Wallet/WalletPage/WalletPage.js index 4ef540f91eef..19d7c182c546 100644 --- a/src/pages/settings/Wallet/WalletPage/WalletPage.js +++ b/src/pages/settings/Wallet/WalletPage/WalletPage.js @@ -106,7 +106,7 @@ function WalletPage({bankAccountList, betas, cardList, fundList, isLoadingPaymen }, [shouldShowEmptyState, windowWidth]); const getSelectedPaymentMethodID = useCallback(() => { - if (paymentMethod.selectedPaymentMethodType === CONST.PAYMENT_METHODS.PERSONAL_BANK_ACCOUNT) { + if (paymentMethod.selectedPaymentMethodType === CONST.PAYMENT_METHODS.BANK_ACCOUNT) { return paymentMethod.selectedPaymentMethod.bankAccountID; } if (paymentMethod.selectedPaymentMethodType === CONST.PAYMENT_METHODS.DEBIT_CARD) { @@ -152,12 +152,12 @@ function WalletPage({bankAccountList, betas, cardList, fundList, isLoadingPaymen // The delete/default menu if (accountType) { let formattedSelectedPaymentMethod; - if (accountType === CONST.PAYMENT_METHODS.PERSONAL_BANK_ACCOUNT) { + if (accountType === CONST.PAYMENT_METHODS.BANK_ACCOUNT) { formattedSelectedPaymentMethod = { title: account.addressName, icon: account.icon, description: PaymentUtils.getPaymentMethodDescription(accountType, account), - type: CONST.PAYMENT_METHODS.PERSONAL_BANK_ACCOUNT, + type: CONST.PAYMENT_METHODS.BANK_ACCOUNT, }; } else if (accountType === CONST.PAYMENT_METHODS.DEBIT_CARD) { formattedSelectedPaymentMethod = { @@ -202,7 +202,7 @@ function WalletPage({bankAccountList, betas, cardList, fundList, isLoadingPaymen return; } - if (paymentType === CONST.PAYMENT_METHODS.PERSONAL_BANK_ACCOUNT) { + if (paymentType === CONST.PAYMENT_METHODS.BANK_ACCOUNT) { BankAccounts.openPersonalBankAccountSetupView(); return; } @@ -228,7 +228,7 @@ function WalletPage({bankAccountList, betas, cardList, fundList, isLoadingPaymen const previousPaymentMethod = _.find(paymentMethods, (method) => method.isDefault); const currentPaymentMethod = _.find(paymentMethods, (method) => method.methodID === paymentMethod.methodID); - if (paymentMethod.selectedPaymentMethodType === CONST.PAYMENT_METHODS.PERSONAL_BANK_ACCOUNT) { + if (paymentMethod.selectedPaymentMethodType === CONST.PAYMENT_METHODS.BANK_ACCOUNT) { PaymentMethods.makeDefaultPaymentMethod(paymentMethod.selectedPaymentMethod.bankAccountID, null, previousPaymentMethod, currentPaymentMethod); } else if (paymentMethod.selectedPaymentMethodType === CONST.PAYMENT_METHODS.DEBIT_CARD) { PaymentMethods.makeDefaultPaymentMethod(null, paymentMethod.selectedPaymentMethod.fundID, previousPaymentMethod, currentPaymentMethod); @@ -243,7 +243,7 @@ function WalletPage({bankAccountList, betas, cardList, fundList, isLoadingPaymen ]); const deletePaymentMethod = useCallback(() => { - if (paymentMethod.selectedPaymentMethodType === CONST.PAYMENT_METHODS.PERSONAL_BANK_ACCOUNT) { + if (paymentMethod.selectedPaymentMethodType === CONST.PAYMENT_METHODS.BANK_ACCOUNT) { BankAccounts.deletePaymentBankAccount(paymentMethod.selectedPaymentMethod.bankAccountID); } else if (paymentMethod.selectedPaymentMethodType === CONST.PAYMENT_METHODS.DEBIT_CARD) { PaymentMethods.deletePaymentCard(paymentMethod.selectedPaymentMethod.fundID); @@ -294,7 +294,7 @@ function WalletPage({bankAccountList, betas, cardList, fundList, isLoadingPaymen // We should reset selected payment method state values and close corresponding modals if the selected payment method is deleted let shouldResetPaymentMethodData = false; - if (paymentMethod.selectedPaymentMethodType === CONST.PAYMENT_METHODS.PERSONAL_BANK_ACCOUNT && _.isEmpty(bankAccountList[paymentMethod.methodID])) { + if (paymentMethod.selectedPaymentMethodType === CONST.PAYMENT_METHODS.BANK_ACCOUNT && _.isEmpty(bankAccountList[paymentMethod.methodID])) { shouldResetPaymentMethodData = true; } else if (paymentMethod.selectedPaymentMethodType === CONST.PAYMENT_METHODS.DEBIT_CARD && _.isEmpty(fundList[paymentMethod.methodID])) { shouldResetPaymentMethodData = true; @@ -309,8 +309,7 @@ function WalletPage({bankAccountList, betas, cardList, fundList, isLoadingPaymen const shouldShowMakeDefaultButton = !paymentMethod.isSelectedPaymentMethodDefault && - Permissions.canUseWallet(betas) && - !(paymentMethod.formattedSelectedPaymentMethod.type === CONST.PAYMENT_METHODS.PERSONAL_BANK_ACCOUNT && paymentMethod.selectedPaymentMethod.type === CONST.BANK_ACCOUNT.TYPE.BUSINESS); + !(paymentMethod.formattedSelectedPaymentMethod.type === CONST.PAYMENT_METHODS.BANK_ACCOUNT && paymentMethod.selectedPaymentMethod.type === CONST.BANK_ACCOUNT.TYPE.BUSINESS); // Determines whether or not the modal popup is mounted from the bottom of the screen instead of the side mount on Web or Desktop screens const isPopoverBottomMount = anchorPosition.anchorPositionTop === 0 || isSmallScreenWidth; @@ -364,7 +363,7 @@ function WalletPage({bankAccountList, betas, cardList, fundList, isLoadingPaymen navigateToWalletOrTransferBalancePage(source)} onSelectPaymentMethod={(selectedPaymentMethod) => { - if (hasActivatedWallet || selectedPaymentMethod !== CONST.PAYMENT_METHODS.PERSONAL_BANK_ACCOUNT) { + if (hasActivatedWallet || selectedPaymentMethod !== CONST.PAYMENT_METHODS.BANK_ACCOUNT) { return; } // To allow upgrading to a gold wallet, continue with the KYC flow after adding a bank account diff --git a/src/pages/tasks/NewTaskDescriptionPage.js b/src/pages/tasks/NewTaskDescriptionPage.js index e571edce39e9..49e685de6a62 100644 --- a/src/pages/tasks/NewTaskDescriptionPage.js +++ b/src/pages/tasks/NewTaskDescriptionPage.js @@ -52,10 +52,6 @@ function NewTaskDescriptionPage(props) { Navigation.goBack(ROUTES.NEW_TASK); }; - if (!Permissions.canUseTasks(props.betas)) { - Navigation.dismissModal(); - return null; - } return ( Date: Thu, 23 Nov 2023 11:07:47 -0400 Subject: [PATCH 2/8] remove more places --- src/components/AddPaymentMethodMenu.js | 5 ----- src/pages/settings/Wallet/WalletPage/WalletPage.js | 6 +----- tests/perf-test/ReportActionCompose.perf-test.js | 4 ---- tests/perf-test/ReportScreen.perf-test.js | 1 - 4 files changed, 1 insertion(+), 15 deletions(-) diff --git a/src/components/AddPaymentMethodMenu.js b/src/components/AddPaymentMethodMenu.js index da98045c0a7e..ea445399c96e 100644 --- a/src/components/AddPaymentMethodMenu.js +++ b/src/components/AddPaymentMethodMenu.js @@ -3,7 +3,6 @@ import React from 'react'; import {withOnyx} from 'react-native-onyx'; import _ from 'underscore'; import compose from '@libs/compose'; -import Permissions from '@libs/Permissions'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; import * as Expensicons from './Icon/Expensicons'; @@ -31,9 +30,6 @@ const propTypes = { vertical: PropTypes.oneOf(_.values(CONST.MODAL.ANCHOR_ORIGIN_VERTICAL)), }), - /** List of betas available to current user */ - betas: PropTypes.arrayOf(PropTypes.string), - /** Popover anchor ref */ anchorRef: refPropTypes, @@ -46,7 +42,6 @@ const defaultProps = { horizontal: CONST.MODAL.ANCHOR_ORIGIN_HORIZONTAL.LEFT, vertical: CONST.MODAL.ANCHOR_ORIGIN_VERTICAL.BOTTOM, }, - betas: [], anchorRef: () => {}, }; diff --git a/src/pages/settings/Wallet/WalletPage/WalletPage.js b/src/pages/settings/Wallet/WalletPage/WalletPage.js index 19d7c182c546..cbb8471da8da 100644 --- a/src/pages/settings/Wallet/WalletPage/WalletPage.js +++ b/src/pages/settings/Wallet/WalletPage/WalletPage.js @@ -25,7 +25,6 @@ import compose from '@libs/compose'; import getClickedTargetLocation from '@libs/getClickedTargetLocation'; import Navigation from '@libs/Navigation/Navigation'; import * as PaymentUtils from '@libs/PaymentUtils'; -import Permissions from '@libs/Permissions'; import PaymentMethodList from '@pages/settings/Wallet/PaymentMethodList'; import WalletEmptyState from '@pages/settings/Wallet/WalletEmptyState'; import useTheme from '@styles/themes/useTheme'; @@ -38,7 +37,7 @@ import ONYXKEYS from '@src/ONYXKEYS'; import ROUTES from '@src/ROUTES'; import {defaultProps, propTypes} from './walletPagePropTypes'; -function WalletPage({bankAccountList, betas, cardList, fundList, isLoadingPaymentMethods, network, shouldListenForResize, userWallet, walletTerms}) { +function WalletPage({bankAccountList, cardList, fundList, isLoadingPaymentMethods, network, shouldListenForResize, userWallet, walletTerms}) { const theme = useTheme(); const styles = useThemeStyles(); const {translate} = useLocalize(); @@ -564,9 +563,6 @@ WalletPage.displayName = 'WalletPage'; export default compose( withNetwork(), withOnyx({ - betas: { - key: ONYXKEYS.BETAS, - }, cardList: { key: ONYXKEYS.CARD_LIST, }, diff --git a/tests/perf-test/ReportActionCompose.perf-test.js b/tests/perf-test/ReportActionCompose.perf-test.js index 6419d8f895ef..05d2b5a4906a 100644 --- a/tests/perf-test/ReportActionCompose.perf-test.js +++ b/tests/perf-test/ReportActionCompose.perf-test.js @@ -22,10 +22,6 @@ jest.mock('react-native-reanimated', () => ({ useAnimatedRef: jest.fn, })); -jest.mock('../../src/libs/Permissions', () => ({ - canUseTasks: jest.fn(() => true), -})); - jest.mock('@react-navigation/native', () => { const actualNav = jest.requireActual('@react-navigation/native'); return { diff --git a/tests/perf-test/ReportScreen.perf-test.js b/tests/perf-test/ReportScreen.perf-test.js index f8a44b54cc39..a49aaff4d697 100644 --- a/tests/perf-test/ReportScreen.perf-test.js +++ b/tests/perf-test/ReportScreen.perf-test.js @@ -54,7 +54,6 @@ jest.mock('../../src/hooks/useEnvironment', () => ); jest.mock('../../src/libs/Permissions', () => ({ - canUseTasks: jest.fn(() => true), canUseLinkPreviews: jest.fn(() => true), })); From e564ecc90c7f6c2af1edb22b78161e24eb352f44 Mon Sep 17 00:00:00 2001 From: Florent De Neve Date: Thu, 23 Nov 2023 11:09:56 -0400 Subject: [PATCH 3/8] reset src/components/AddPaymentMethodMenu.js --- src/components/AddPaymentMethodMenu.js | 75 +++++++++++++++++++------- 1 file changed, 56 insertions(+), 19 deletions(-) diff --git a/src/components/AddPaymentMethodMenu.js b/src/components/AddPaymentMethodMenu.js index ea445399c96e..547913ad7048 100644 --- a/src/components/AddPaymentMethodMenu.js +++ b/src/components/AddPaymentMethodMenu.js @@ -1,14 +1,18 @@ +import lodashGet from 'lodash/get'; import PropTypes from 'prop-types'; import React from 'react'; import {withOnyx} from 'react-native-onyx'; import _ from 'underscore'; +import useLocalize from '@hooks/useLocalize'; import compose from '@libs/compose'; +import * as ReportActionsUtils from '@libs/ReportActionsUtils'; +import * as ReportUtils from '@libs/ReportUtils'; +import iouReportPropTypes from '@pages/iouReportPropTypes'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; import * as Expensicons from './Icon/Expensicons'; import PopoverMenu from './PopoverMenu'; import refPropTypes from './refPropTypes'; -import withLocalize, {withLocalizePropTypes} from './withLocalize'; import withWindowDimensions from './withWindowDimensions'; const propTypes = { @@ -18,6 +22,12 @@ const propTypes = { /** Callback to execute when the component closes. */ onClose: PropTypes.func.isRequired, + /** Callback to execute when the payment method is selected. */ + onItemSelected: PropTypes.func.isRequired, + + /** The IOU/Expense report we are paying */ + iouReport: iouReportPropTypes, + /** Anchor position for the AddPaymentMenu. */ anchorPosition: PropTypes.shape({ horizontal: PropTypes.number, @@ -30,43 +40,68 @@ const propTypes = { vertical: PropTypes.oneOf(_.values(CONST.MODAL.ANCHOR_ORIGIN_VERTICAL)), }), + /** List of betas available to current user */ + betas: PropTypes.arrayOf(PropTypes.string), + /** Popover anchor ref */ anchorRef: refPropTypes, - ...withLocalizePropTypes, + /** Session info for the currently logged in user. */ + session: PropTypes.shape({ + /** Currently logged in user accountID */ + accountID: PropTypes.number, + }), }; const defaultProps = { + iouReport: {}, anchorPosition: {}, anchorAlignment: { horizontal: CONST.MODAL.ANCHOR_ORIGIN_HORIZONTAL.LEFT, vertical: CONST.MODAL.ANCHOR_ORIGIN_VERTICAL.BOTTOM, }, + betas: [], anchorRef: () => {}, + session: {}, }; -function AddPaymentMethodMenu(props) { +function AddPaymentMethodMenu({isVisible, onClose, anchorPosition, anchorAlignment, anchorRef, iouReport, onItemSelected, session, betas}) { + const {translate} = useLocalize(); + return ( { - props.onItemSelected(CONST.PAYMENT_METHODS.BANK_ACCOUNT); - }, - }, + ...(ReportUtils.isIOUReport(iouReport) + ? [ + { + text: translate('common.personalBankAccount'), + icon: Expensicons.Bank, + onSelected: () => { + onItemSelected(CONST.PAYMENT_METHODS.PERSONAL_BANK_ACCOUNT); + }, + }, + ] + : []), + ...(!ReportActionsUtils.hasRequestFromCurrentAccount(lodashGet(iouReport, 'reportID', 0), lodashGet(session, 'accountID', 0)) + ? [ + { + text: translate('common.businessBankAccount'), + icon: Expensicons.Building, + onSelected: () => onItemSelected(CONST.PAYMENT_METHODS.BUSINESS_BANK_ACCOUNT), + }, + ] + : []), ...([ { - text: props.translate('common.debitCard'), + text: translate('common.debitCard'), icon: Expensicons.CreditCard, - onSelected: () => props.onItemSelected(CONST.PAYMENT_METHODS.DEBIT_CARD), + onSelected: () => onItemSelected(CONST.PAYMENT_METHODS.DEBIT_CARD), }, ]), ]} @@ -81,10 +116,12 @@ AddPaymentMethodMenu.displayName = 'AddPaymentMethodMenu'; export default compose( withWindowDimensions, - withLocalize, withOnyx({ betas: { key: ONYXKEYS.BETAS, }, + session: { + key: ONYXKEYS.SESSION, + }, }), )(AddPaymentMethodMenu); From 45494aef8ee06f05e07473388e07c2ed095ffc85 Mon Sep 17 00:00:00 2001 From: Florent De Neve Date: Thu, 23 Nov 2023 11:21:46 -0400 Subject: [PATCH 4/8] Remove more references to beta --- src/components/LHNOptionsList/OptionRowLHN.js | 5 ----- src/components/SettlementButton.js | 13 ++----------- src/pages/ProfilePage.js | 4 ---- .../AttachmentPickerWithMenuItems.js | 16 ++-------------- src/pages/home/report/ReportActionItemSingle.js | 12 +----------- .../FloatingActionButtonAndPopover.js | 8 -------- .../sidebar/SignInOrAvatarWithOptionalStatus.js | 17 +---------------- src/pages/settings/InitialSettingsPage.js | 10 +--------- src/pages/settings/Profile/ProfilePage.js | 4 ---- src/pages/settings/Wallet/AddDebitCardPage.js | 9 --------- src/pages/tasks/NewTaskDescriptionPage.js | 8 -------- src/pages/tasks/NewTaskDetailsPage.js | 8 -------- src/pages/tasks/NewTaskPage.js | 7 ------- src/pages/tasks/NewTaskTitlePage.js | 8 -------- src/pages/workspace/WorkspacesListPage.js | 1 - 15 files changed, 7 insertions(+), 123 deletions(-) diff --git a/src/components/LHNOptionsList/OptionRowLHN.js b/src/components/LHNOptionsList/OptionRowLHN.js index 117d15339dae..4e01ee4d7830 100644 --- a/src/components/LHNOptionsList/OptionRowLHN.js +++ b/src/components/LHNOptionsList/OptionRowLHN.js @@ -20,7 +20,6 @@ import DateUtils from '@libs/DateUtils'; import DomUtils from '@libs/DomUtils'; import {getGroupChatName} from '@libs/GroupChatUtils'; import * as OptionsListUtils from '@libs/OptionsListUtils'; -import Permissions from '@libs/Permissions'; import ReportActionComposeFocusManager from '@libs/ReportActionComposeFocusManager'; import * as ReportUtils from '@libs/ReportUtils'; import * as ContextMenuActions from '@pages/home/report/ContextMenu/ContextMenuActions'; @@ -36,9 +35,6 @@ const propTypes = { // eslint-disable-next-line react/forbid-prop-types hoverStyle: PropTypes.object, - /** List of betas available to current user */ - betas: PropTypes.arrayOf(PropTypes.string), - /** The ID of the report that the option is for */ reportID: PropTypes.string.isRequired, @@ -65,7 +61,6 @@ const defaultProps = { style: null, optionItem: null, isFocused: false, - betas: [], }; function OptionRowLHN(props) { diff --git a/src/components/SettlementButton.js b/src/components/SettlementButton.js index f281ddd6c003..8cf9655d34dc 100644 --- a/src/components/SettlementButton.js +++ b/src/components/SettlementButton.js @@ -5,7 +5,6 @@ import _ from 'underscore'; import useLocalize from '@hooks/useLocalize'; import useNetwork from '@hooks/useNetwork'; import compose from '@libs/compose'; -import Permissions from '@libs/Permissions'; import * as ReportUtils from '@libs/ReportUtils'; import iouReportPropTypes from '@pages/iouReportPropTypes'; import * as BankAccounts from '@userActions/BankAccounts'; @@ -34,9 +33,6 @@ const propTypes = { /** The IOU/Expense report we are paying */ iouReport: iouReportPropTypes, - /** List of betas available to current user */ - betas: PropTypes.arrayOf(PropTypes.string), - /** The route to redirect if user does not have a payment method setup */ enablePaymentsRoute: PropTypes.string.isRequired, @@ -89,9 +85,8 @@ const defaultProps = { currency: CONST.CURRENCY.USD, chatReportID: '', - // The "betas" array, "iouReport" and "nvp_lastPaymentMethod" objects needs to be stable to prevent the "useMemo" + // The "iouReport" and "nvp_lastPaymentMethod" objects needs to be stable to prevent the "useMemo" // hook from being recreated unnecessarily, hence the use of CONST.EMPTY_ARRAY and CONST.EMPTY_OBJECT - betas: CONST.EMPTY_ARRAY, iouReport: CONST.EMPTY_OBJECT, nvp_lastPaymentMethod: CONST.EMPTY_OBJECT, style: [], @@ -113,7 +108,6 @@ function SettlementButton({ addBankAccountRoute, kycWallAnchorAlignment, paymentMethodDropdownAnchorAlignment, - betas, buttonSize, chatReportID, currency, @@ -171,7 +165,7 @@ function SettlementButton({ return _.sortBy(buttonOptions, (method) => (method.value === paymentMethod ? 0 : 1)); } return buttonOptions; - }, [betas, currency, formattedAmount, iouReport, nvp_lastPaymentMethod, policyID, translate]); + }, [currency, formattedAmount, iouReport, nvp_lastPaymentMethod, policyID, translate]); const selectPaymentType = (event, iouPaymentType, triggerKYCFlow) => { if (iouPaymentType === CONST.IOU.PAYMENT_TYPE.EXPENSIFY || iouPaymentType === CONST.IOU.PAYMENT_TYPE.VBBA) { @@ -219,9 +213,6 @@ SettlementButton.displayName = 'SettlementButton'; export default compose( withNavigation, withOnyx({ - betas: { - key: ONYXKEYS.BETAS, - }, nvp_lastPaymentMethod: { key: ONYXKEYS.NVP_LAST_PAYMENT_METHOD, }, diff --git a/src/pages/ProfilePage.js b/src/pages/ProfilePage.js index 538601ad68ad..ffe8271629f4 100755 --- a/src/pages/ProfilePage.js +++ b/src/pages/ProfilePage.js @@ -25,7 +25,6 @@ import UserDetailsTooltip from '@components/UserDetailsTooltip'; import withLocalize, {withLocalizePropTypes} from '@components/withLocalize'; import compose from '@libs/compose'; import Navigation from '@libs/Navigation/Navigation'; -import Permissions from '@libs/Permissions'; import * as ReportUtils from '@libs/ReportUtils'; import * as UserUtils from '@libs/UserUtils'; import * as ValidationUtils from '@libs/ValidationUtils'; @@ -292,9 +291,6 @@ export default compose( isLoadingReportData: { key: ONYXKEYS.IS_LOADING_REPORT_DATA, }, - betas: { - key: ONYXKEYS.BETAS, - }, session: { key: ONYXKEYS.SESSION, }, diff --git a/src/pages/home/report/ReportActionCompose/AttachmentPickerWithMenuItems.js b/src/pages/home/report/ReportActionCompose/AttachmentPickerWithMenuItems.js index 17dad987377c..ec9421bfa1cb 100644 --- a/src/pages/home/report/ReportActionCompose/AttachmentPickerWithMenuItems.js +++ b/src/pages/home/report/ReportActionCompose/AttachmentPickerWithMenuItems.js @@ -1,7 +1,6 @@ import PropTypes from 'prop-types'; import React, {useMemo} from 'react'; import {View} from 'react-native'; -import {withOnyx} from 'react-native-onyx'; import _ from 'underscore'; import AttachmentPicker from '@components/AttachmentPicker'; import Icon from '@components/Icon'; @@ -12,19 +11,14 @@ import Tooltip from '@components/Tooltip/PopoverAnchorTooltip'; import useLocalize from '@hooks/useLocalize'; import useWindowDimensions from '@hooks/useWindowDimensions'; import * as Browser from '@libs/Browser'; -import Permissions from '@libs/Permissions'; import * as ReportUtils from '@libs/ReportUtils'; import useThemeStyles from '@styles/useThemeStyles'; import * as IOU from '@userActions/IOU'; import * as Report from '@userActions/Report'; import * as Task from '@userActions/Task'; import CONST from '@src/CONST'; -import ONYXKEYS from '@src/ONYXKEYS'; const propTypes = { - /** Beta features list */ - betas: PropTypes.arrayOf(PropTypes.string), - /** The report currently being looked at */ report: PropTypes.shape({ /** ID of the report */ @@ -87,7 +81,6 @@ const propTypes = { }; const defaultProps = { - betas: [], reportParticipantIDs: [], }; @@ -98,7 +91,6 @@ const defaultProps = { * @returns {React.Component} */ function AttachmentPickerWithMenuItems({ - betas, report, reportParticipantIDs, displayFileInModal, @@ -163,7 +155,7 @@ function AttachmentPickerWithMenuItems({ onSelected: () => Task.clearOutTaskInfoAndNavigate(reportID), }, ]; - }, [betas, report, reportID, translate]); + }, [report, reportID, translate]); const onPopoverMenuClose = () => { setMenuVisibility(false); @@ -287,8 +279,4 @@ AttachmentPickerWithMenuItems.propTypes = propTypes; AttachmentPickerWithMenuItems.defaultProps = defaultProps; AttachmentPickerWithMenuItems.displayName = 'AttachmentPickerWithMenuItems'; -export default withOnyx({ - betas: { - key: ONYXKEYS.BETAS, - }, -})(AttachmentPickerWithMenuItems); +export default AttachmentPickerWithMenuItems; diff --git a/src/pages/home/report/ReportActionItemSingle.js b/src/pages/home/report/ReportActionItemSingle.js index d60c2fc6914c..2752d5b5c536 100644 --- a/src/pages/home/report/ReportActionItemSingle.js +++ b/src/pages/home/report/ReportActionItemSingle.js @@ -2,7 +2,6 @@ import lodashGet from 'lodash/get'; import PropTypes from 'prop-types'; import React, {useCallback, useMemo} from 'react'; import {View} from 'react-native'; -import {withOnyx} from 'react-native-onyx'; import _ from 'underscore'; import Avatar from '@components/Avatar'; import MultipleAvatars from '@components/MultipleAvatars'; @@ -18,7 +17,6 @@ import compose from '@libs/compose'; import ControlSelection from '@libs/ControlSelection'; import DateUtils from '@libs/DateUtils'; import Navigation from '@libs/Navigation/Navigation'; -import Permissions from '@libs/Permissions'; import * as ReportUtils from '@libs/ReportUtils'; import * as UserUtils from '@libs/UserUtils'; import reportPropTypes from '@pages/reportPropTypes'; @@ -26,7 +24,6 @@ import styles from '@styles/styles'; import * as StyleUtils from '@styles/StyleUtils'; import themeColors from '@styles/themes/default'; import CONST from '@src/CONST'; -import ONYXKEYS from '@src/ONYXKEYS'; import ROUTES from '@src/ROUTES'; import ReportActionItemDate from './ReportActionItemDate'; import ReportActionItemFragment from './ReportActionItemFragment'; @@ -267,11 +264,4 @@ ReportActionItemSingle.propTypes = propTypes; ReportActionItemSingle.defaultProps = defaultProps; ReportActionItemSingle.displayName = 'ReportActionItemSingle'; -export default compose( - withLocalize, - withOnyx({ - betas: { - key: ONYXKEYS.BETAS, - }, - }), -)(ReportActionItemSingle); +export default withLocalize(ReportActionItemSingle); diff --git a/src/pages/home/sidebar/SidebarScreen/FloatingActionButtonAndPopover.js b/src/pages/home/sidebar/SidebarScreen/FloatingActionButtonAndPopover.js index 2e18dee79b59..fd9f0854b5a1 100644 --- a/src/pages/home/sidebar/SidebarScreen/FloatingActionButtonAndPopover.js +++ b/src/pages/home/sidebar/SidebarScreen/FloatingActionButtonAndPopover.js @@ -13,7 +13,6 @@ import withWindowDimensions from '@components/withWindowDimensions'; import usePrevious from '@hooks/usePrevious'; import compose from '@libs/compose'; import Navigation from '@libs/Navigation/Navigation'; -import Permissions from '@libs/Permissions'; import useThemeStyles from '@styles/useThemeStyles'; import * as App from '@userActions/App'; import * as IOU from '@userActions/IOU'; @@ -54,9 +53,6 @@ const propTypes = { name: PropTypes.string, }), - /* Beta features list */ - betas: PropTypes.arrayOf(PropTypes.string), - /** Indicated whether the report data is loading */ isLoading: PropTypes.bool, @@ -74,7 +70,6 @@ const defaultProps = { onHideCreateMenu: () => {}, onShowCreateMenu: () => {}, allPolicies: {}, - betas: [], isLoading: false, innerRef: null, demoInfo: {}, @@ -276,9 +271,6 @@ export default compose( key: ONYXKEYS.COLLECTION.POLICY, selector: policySelector, }, - betas: { - key: ONYXKEYS.BETAS, - }, isLoading: { key: ONYXKEYS.IS_LOADING_APP, }, diff --git a/src/pages/home/sidebar/SignInOrAvatarWithOptionalStatus.js b/src/pages/home/sidebar/SignInOrAvatarWithOptionalStatus.js index 6dc3aaec45b1..8e680a20d419 100644 --- a/src/pages/home/sidebar/SignInOrAvatarWithOptionalStatus.js +++ b/src/pages/home/sidebar/SignInOrAvatarWithOptionalStatus.js @@ -2,13 +2,9 @@ import lodashGet from 'lodash/get'; import PropTypes from 'prop-types'; import React from 'react'; -import {withOnyx} from 'react-native-onyx'; import withCurrentUserPersonalDetails from '@components/withCurrentUserPersonalDetails'; -import compose from '@libs/compose'; -import Permissions from '@libs/Permissions'; import personalDetailsPropType from '@pages/personalDetailsPropType'; import * as Session from '@userActions/Session'; -import ONYXKEYS from '@src/ONYXKEYS'; import AvatarWithOptionalStatus from './AvatarWithOptionalStatus'; import PressableAvatarWithIndicator from './PressableAvatarWithIndicator'; import SignInButton from './SignInButton'; @@ -19,13 +15,9 @@ const propTypes = { /** Whether the create menu is open or not */ isCreateMenuOpen: PropTypes.bool, - - /** Beta features list */ - betas: PropTypes.arrayOf(PropTypes.string), }; const defaultProps = { - betas: [], isCreateMenuOpen: false, currentUserPersonalDetails: { status: {emojiCode: ''}, @@ -52,11 +44,4 @@ function SignInOrAvatarWithOptionalStatus({currentUserPersonalDetails, isCreateM SignInOrAvatarWithOptionalStatus.propTypes = propTypes; SignInOrAvatarWithOptionalStatus.defaultProps = defaultProps; SignInOrAvatarWithOptionalStatus.displayName = 'SignInOrAvatarWithOptionalStatus'; -export default compose( - withCurrentUserPersonalDetails, - withOnyx({ - betas: { - key: ONYXKEYS.BETAS, - }, - }), -)(SignInOrAvatarWithOptionalStatus); +export default withCurrentUserPersonalDetails(SignInOrAvatarWithOptionalStatus); diff --git a/src/pages/settings/InitialSettingsPage.js b/src/pages/settings/InitialSettingsPage.js index bf5d1a9aa4a2..89d97ff360a7 100755 --- a/src/pages/settings/InitialSettingsPage.js +++ b/src/pages/settings/InitialSettingsPage.js @@ -25,7 +25,6 @@ import useWaitForNavigation from '@hooks/useWaitForNavigation'; import compose from '@libs/compose'; import * as CurrencyUtils from '@libs/CurrencyUtils'; import Navigation from '@libs/Navigation/Navigation'; -import Permissions from '@libs/Permissions'; import * as PolicyUtils from '@libs/PolicyUtils'; import * as ReportUtils from '@libs/ReportUtils'; import * as UserUtils from '@libs/UserUtils'; @@ -89,9 +88,6 @@ const propTypes = { /** Bank account attached to free plan */ reimbursementAccount: ReimbursementAccountProps.reimbursementAccountPropTypes, - /** List of betas available to current user */ - betas: PropTypes.arrayOf(PropTypes.string), - /** Information about the user accepting the terms for payments */ walletTerms: walletTermsPropTypes, @@ -120,7 +116,6 @@ const defaultProps = { currentBalance: 0, }, reimbursementAccount: {}, - betas: [], walletTerms: {}, bankAccountList: {}, fundList: null, @@ -324,7 +319,7 @@ function InitialSettingsPage(props) { })} ); - }, [getDefaultMenuItems, props.betas, props.userWallet.currentBalance, translate, isExecuting, singleExecution]); + }, [getDefaultMenuItems, props.userWallet.currentBalance, translate, isExecuting, singleExecution]); const headerContent = ( @@ -426,9 +421,6 @@ export default compose( userWallet: { key: ONYXKEYS.USER_WALLET, }, - betas: { - key: ONYXKEYS.BETAS, - }, bankAccountList: { key: ONYXKEYS.BANK_ACCOUNT_LIST, }, diff --git a/src/pages/settings/Profile/ProfilePage.js b/src/pages/settings/Profile/ProfilePage.js index 6dae3f5b01f7..74515c52dcf3 100755 --- a/src/pages/settings/Profile/ProfilePage.js +++ b/src/pages/settings/Profile/ProfilePage.js @@ -15,7 +15,6 @@ import withLocalize, {withLocalizePropTypes} from '@components/withLocalize'; import withWindowDimensions, {windowDimensionsPropTypes} from '@components/withWindowDimensions'; import compose from '@libs/compose'; import Navigation from '@libs/Navigation/Navigation'; -import Permissions from '@libs/Permissions'; import * as UserUtils from '@libs/UserUtils'; import userPropTypes from '@pages/settings/userPropTypes'; import useThemeStyles from '@styles/useThemeStyles'; @@ -182,8 +181,5 @@ export default compose( user: { key: ONYXKEYS.USER, }, - betas: { - key: ONYXKEYS.BETAS, - }, }), )(ProfilePage); diff --git a/src/pages/settings/Wallet/AddDebitCardPage.js b/src/pages/settings/Wallet/AddDebitCardPage.js index ffa13a0a1441..ed4a545ff208 100644 --- a/src/pages/settings/Wallet/AddDebitCardPage.js +++ b/src/pages/settings/Wallet/AddDebitCardPage.js @@ -14,9 +14,7 @@ import TextLink from '@components/TextLink'; import useLocalize from '@hooks/useLocalize'; import usePrevious from '@hooks/usePrevious'; import Navigation from '@libs/Navigation/Navigation'; -import Permissions from '@libs/Permissions'; import * as ValidationUtils from '@libs/ValidationUtils'; -import NotFoundPage from '@pages/ErrorPage/NotFoundPage'; import useThemeStyles from '@styles/useThemeStyles'; import * as PaymentMethods from '@userActions/PaymentMethods'; import CONST from '@src/CONST'; @@ -28,16 +26,12 @@ const propTypes = { formData: PropTypes.shape({ setupComplete: PropTypes.bool, }), - - /** List of betas available to current user */ - betas: PropTypes.arrayOf(PropTypes.string), }; const defaultProps = { formData: { setupComplete: false, }, - betas: [], }; function DebitCardPage(props) { @@ -208,7 +202,4 @@ export default withOnyx({ formData: { key: ONYXKEYS.FORMS.ADD_DEBIT_CARD_FORM, }, - betas: { - key: ONYXKEYS.BETAS, - }, })(DebitCardPage); diff --git a/src/pages/tasks/NewTaskDescriptionPage.js b/src/pages/tasks/NewTaskDescriptionPage.js index 49e685de6a62..002ca2944e52 100644 --- a/src/pages/tasks/NewTaskDescriptionPage.js +++ b/src/pages/tasks/NewTaskDescriptionPage.js @@ -13,7 +13,6 @@ import useAutoFocusInput from '@hooks/useAutoFocusInput'; import * as Browser from '@libs/Browser'; import compose from '@libs/compose'; import Navigation from '@libs/Navigation/Navigation'; -import Permissions from '@libs/Permissions'; import updateMultilineInputRange from '@libs/UpdateMultilineInputRange'; import useThemeStyles from '@styles/useThemeStyles'; import * as Task from '@userActions/Task'; @@ -22,9 +21,6 @@ import ONYXKEYS from '@src/ONYXKEYS'; import ROUTES from '@src/ROUTES'; const propTypes = { - /** Beta features list */ - betas: PropTypes.arrayOf(PropTypes.string), - /** Grab the Share description of the Task */ task: PropTypes.shape({ /** Description of the Task */ @@ -35,7 +31,6 @@ const propTypes = { }; const defaultProps = { - betas: [], task: { description: '', }, @@ -101,9 +96,6 @@ NewTaskDescriptionPage.defaultProps = defaultProps; export default compose( withOnyx({ - betas: { - key: ONYXKEYS.BETAS, - }, task: { key: ONYXKEYS.TASK, }, diff --git a/src/pages/tasks/NewTaskDetailsPage.js b/src/pages/tasks/NewTaskDetailsPage.js index 173aa13410d8..818ae4440842 100644 --- a/src/pages/tasks/NewTaskDetailsPage.js +++ b/src/pages/tasks/NewTaskDetailsPage.js @@ -14,7 +14,6 @@ import * as Browser from '@libs/Browser'; import compose from '@libs/compose'; import * as ErrorUtils from '@libs/ErrorUtils'; import Navigation from '@libs/Navigation/Navigation'; -import Permissions from '@libs/Permissions'; import useThemeStyles from '@styles/useThemeStyles'; import * as Task from '@userActions/Task'; import CONST from '@src/CONST'; @@ -22,9 +21,6 @@ import ONYXKEYS from '@src/ONYXKEYS'; import ROUTES from '@src/ROUTES'; const propTypes = { - /** Beta features list */ - betas: PropTypes.arrayOf(PropTypes.string), - /** Task title and description data */ task: PropTypes.shape({ title: PropTypes.string, @@ -35,7 +31,6 @@ const propTypes = { }; const defaultProps = { - betas: [], task: {}, }; @@ -135,9 +130,6 @@ NewTaskDetailsPage.defaultProps = defaultProps; export default compose( withOnyx({ - betas: { - key: ONYXKEYS.BETAS, - }, task: { key: ONYXKEYS.TASK, }, diff --git a/src/pages/tasks/NewTaskPage.js b/src/pages/tasks/NewTaskPage.js index ca2a203eaabc..0e10015b445c 100644 --- a/src/pages/tasks/NewTaskPage.js +++ b/src/pages/tasks/NewTaskPage.js @@ -15,7 +15,6 @@ import compose from '@libs/compose'; import * as LocalePhoneNumber from '@libs/LocalePhoneNumber'; import Navigation from '@libs/Navigation/Navigation'; import * as OptionsListUtils from '@libs/OptionsListUtils'; -import Permissions from '@libs/Permissions'; import * as ReportUtils from '@libs/ReportUtils'; import reportPropTypes from '@pages/reportPropTypes'; import useThemeStyles from '@styles/useThemeStyles'; @@ -33,9 +32,6 @@ const propTypes = { parentReportID: PropTypes.string, }), - /** Beta features list */ - betas: PropTypes.arrayOf(PropTypes.string), - /** All of the personal details for everyone */ personalDetails: PropTypes.objectOf( PropTypes.shape({ @@ -226,9 +222,6 @@ NewTaskPage.defaultProps = defaultProps; export default compose( withOnyx({ - betas: { - key: ONYXKEYS.BETAS, - }, task: { key: ONYXKEYS.TASK, }, diff --git a/src/pages/tasks/NewTaskTitlePage.js b/src/pages/tasks/NewTaskTitlePage.js index 7eb886bad944..f1c583e4aa2a 100644 --- a/src/pages/tasks/NewTaskTitlePage.js +++ b/src/pages/tasks/NewTaskTitlePage.js @@ -12,7 +12,6 @@ import useAutoFocusInput from '@hooks/useAutoFocusInput'; import compose from '@libs/compose'; import * as ErrorUtils from '@libs/ErrorUtils'; import Navigation from '@libs/Navigation/Navigation'; -import Permissions from '@libs/Permissions'; import useThemeStyles from '@styles/useThemeStyles'; import * as Task from '@userActions/Task'; import CONST from '@src/CONST'; @@ -20,9 +19,6 @@ import ONYXKEYS from '@src/ONYXKEYS'; import ROUTES from '@src/ROUTES'; const propTypes = { - /** Beta features list */ - betas: PropTypes.arrayOf(PropTypes.string), - /** Grab the Share title of the Task */ task: PropTypes.shape({ /** Title of the Task */ @@ -33,7 +29,6 @@ const propTypes = { }; const defaultProps = { - betas: [], task: { title: '', }, @@ -107,9 +102,6 @@ NewTaskTitlePage.defaultProps = defaultProps; export default compose( withOnyx({ - betas: { - key: ONYXKEYS.BETAS, - }, task: { key: ONYXKEYS.TASK, }, diff --git a/src/pages/workspace/WorkspacesListPage.js b/src/pages/workspace/WorkspacesListPage.js index 29e68a5121fa..1e51c64a711c 100755 --- a/src/pages/workspace/WorkspacesListPage.js +++ b/src/pages/workspace/WorkspacesListPage.js @@ -12,7 +12,6 @@ import MenuItem from '@components/MenuItem'; import OfflineWithFeedback from '@components/OfflineWithFeedback'; import useLocalize from '@hooks/useLocalize'; import useNetwork from '@hooks/useNetwork'; -import usePermissions from '@hooks/usePermissions'; import compose from '@libs/compose'; import * as CurrencyUtils from '@libs/CurrencyUtils'; import Navigation from '@libs/Navigation/Navigation'; From eece94181783429ae41256a86652b70221f26bc3 Mon Sep 17 00:00:00 2001 From: Florent De Neve Date: Thu, 23 Nov 2023 11:27:56 -0400 Subject: [PATCH 5/8] remove more forgotten references --- src/components/AddPaymentMethodMenu.js | 9 +-------- src/pages/home/report/ReportActionItemSingle.js | 1 - src/pages/tasks/NewTaskPage.js | 1 - 3 files changed, 1 insertion(+), 10 deletions(-) diff --git a/src/components/AddPaymentMethodMenu.js b/src/components/AddPaymentMethodMenu.js index 547913ad7048..223d880777bd 100644 --- a/src/components/AddPaymentMethodMenu.js +++ b/src/components/AddPaymentMethodMenu.js @@ -40,9 +40,6 @@ const propTypes = { vertical: PropTypes.oneOf(_.values(CONST.MODAL.ANCHOR_ORIGIN_VERTICAL)), }), - /** List of betas available to current user */ - betas: PropTypes.arrayOf(PropTypes.string), - /** Popover anchor ref */ anchorRef: refPropTypes, @@ -60,12 +57,11 @@ const defaultProps = { horizontal: CONST.MODAL.ANCHOR_ORIGIN_HORIZONTAL.LEFT, vertical: CONST.MODAL.ANCHOR_ORIGIN_VERTICAL.BOTTOM, }, - betas: [], anchorRef: () => {}, session: {}, }; -function AddPaymentMethodMenu({isVisible, onClose, anchorPosition, anchorAlignment, anchorRef, iouReport, onItemSelected, session, betas}) { +function AddPaymentMethodMenu({isVisible, onClose, anchorPosition, anchorAlignment, anchorRef, iouReport, onItemSelected, session}) { const {translate} = useLocalize(); return ( @@ -117,9 +113,6 @@ AddPaymentMethodMenu.displayName = 'AddPaymentMethodMenu'; export default compose( withWindowDimensions, withOnyx({ - betas: { - key: ONYXKEYS.BETAS, - }, session: { key: ONYXKEYS.SESSION, }, diff --git a/src/pages/home/report/ReportActionItemSingle.js b/src/pages/home/report/ReportActionItemSingle.js index 2752d5b5c536..e69531e2cc53 100644 --- a/src/pages/home/report/ReportActionItemSingle.js +++ b/src/pages/home/report/ReportActionItemSingle.js @@ -13,7 +13,6 @@ import Text from '@components/Text'; import Tooltip from '@components/Tooltip'; import UserDetailsTooltip from '@components/UserDetailsTooltip'; import withLocalize, {withLocalizePropTypes} from '@components/withLocalize'; -import compose from '@libs/compose'; import ControlSelection from '@libs/ControlSelection'; import DateUtils from '@libs/DateUtils'; import Navigation from '@libs/Navigation/Navigation'; diff --git a/src/pages/tasks/NewTaskPage.js b/src/pages/tasks/NewTaskPage.js index 0e10015b445c..24bdb39d5bff 100644 --- a/src/pages/tasks/NewTaskPage.js +++ b/src/pages/tasks/NewTaskPage.js @@ -53,7 +53,6 @@ const propTypes = { }; const defaultProps = { - betas: [], task: {}, personalDetails: {}, reports: {}, From 434edcd3758e79310e7adadbdd69f5b2c19e4ae6 Mon Sep 17 00:00:00 2001 From: Florent De Neve Date: Thu, 23 Nov 2023 12:17:43 -0400 Subject: [PATCH 6/8] run prettier --- src/components/AddPaymentMethodMenu.js | 14 +++++++------- .../FloatingActionButtonAndPopover.js | 14 +++++++------- src/pages/settings/InitialSettingsPage.js | 3 +-- src/pages/settings/Profile/ProfilePage.js | 14 +++++++------- 4 files changed, 22 insertions(+), 23 deletions(-) diff --git a/src/components/AddPaymentMethodMenu.js b/src/components/AddPaymentMethodMenu.js index 223d880777bd..ce26985932d6 100644 --- a/src/components/AddPaymentMethodMenu.js +++ b/src/components/AddPaymentMethodMenu.js @@ -93,13 +93,13 @@ function AddPaymentMethodMenu({isVisible, onClose, anchorPosition, anchorAlignme }, ] : []), - ...([ - { - text: translate('common.debitCard'), - icon: Expensicons.CreditCard, - onSelected: () => onItemSelected(CONST.PAYMENT_METHODS.DEBIT_CARD), - }, - ]), + ...[ + { + text: translate('common.debitCard'), + icon: Expensicons.CreditCard, + onSelected: () => onItemSelected(CONST.PAYMENT_METHODS.DEBIT_CARD), + }, + ], ]} withoutOverlay /> diff --git a/src/pages/home/sidebar/SidebarScreen/FloatingActionButtonAndPopover.js b/src/pages/home/sidebar/SidebarScreen/FloatingActionButtonAndPopover.js index fd9f0854b5a1..a1ba7042f158 100644 --- a/src/pages/home/sidebar/SidebarScreen/FloatingActionButtonAndPopover.js +++ b/src/pages/home/sidebar/SidebarScreen/FloatingActionButtonAndPopover.js @@ -202,13 +202,13 @@ function FloatingActionButtonAndPopover(props) { text: props.translate('iou.sendMoney'), onSelected: () => interceptAnonymousUser(() => IOU.startMoneyRequest(CONST.IOU.TYPE.SEND)), }, - ...([ - { - icon: Expensicons.Task, - text: props.translate('newTaskPage.assignTask'), - onSelected: () => interceptAnonymousUser(() => Task.clearOutTaskInfoAndNavigate()), - }, - ]), + ...[ + { + icon: Expensicons.Task, + text: props.translate('newTaskPage.assignTask'), + onSelected: () => interceptAnonymousUser(() => Task.clearOutTaskInfoAndNavigate()), + }, + ], { icon: Expensicons.Heart, text: props.translate('sidebarScreen.saveTheWorld'), diff --git a/src/pages/settings/InitialSettingsPage.js b/src/pages/settings/InitialSettingsPage.js index 89d97ff360a7..1bd57bcab32b 100755 --- a/src/pages/settings/InitialSettingsPage.js +++ b/src/pages/settings/InitialSettingsPage.js @@ -283,8 +283,7 @@ function InitialSettingsPage(props) { * @param {Boolean} isPaymentItem whether the item being rendered is the payments menu item * @returns {Number} the user wallet balance */ - const getWalletBalance = (isPaymentItem) => - isPaymentItem && CurrencyUtils.convertToDisplayString(props.userWallet.currentBalance); + const getWalletBalance = (isPaymentItem) => isPaymentItem && CurrencyUtils.convertToDisplayString(props.userWallet.currentBalance); return ( <> diff --git a/src/pages/settings/Profile/ProfilePage.js b/src/pages/settings/Profile/ProfilePage.js index 74515c52dcf3..fc6c38f96335 100755 --- a/src/pages/settings/Profile/ProfilePage.js +++ b/src/pages/settings/Profile/ProfilePage.js @@ -82,13 +82,13 @@ function ProfilePage(props) { pageRoute: ROUTES.SETTINGS_CONTACT_METHODS.route, brickRoadIndicator: contactMethodBrickRoadIndicator, }, - ...([ - { - description: props.translate('statusPage.status'), - title: emojiCode ? `${emojiCode} ${lodashGet(props, 'currentUserPersonalDetails.status.text', '')}` : '', - pageRoute: ROUTES.SETTINGS_STATUS, - }, - ]), + ...[ + { + description: props.translate('statusPage.status'), + title: emojiCode ? `${emojiCode} ${lodashGet(props, 'currentUserPersonalDetails.status.text', '')}` : '', + pageRoute: ROUTES.SETTINGS_STATUS, + }, + ], { description: props.translate('pronounsPage.pronouns'), title: getPronouns(), From 295ca0e75ddcd515e8c25b9b496dfbdf9a97bebf Mon Sep 17 00:00:00 2001 From: Florent De Neve Date: Thu, 23 Nov 2023 16:48:59 -0400 Subject: [PATCH 7/8] remove more unused betas --- src/CONST.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/CONST.ts b/src/CONST.ts index 8b91738e65e5..f1364ebbb5bf 100755 --- a/src/CONST.ts +++ b/src/CONST.ts @@ -250,10 +250,7 @@ const CONST = { CHRONOS_IN_CASH: 'chronosInCash', DEFAULT_ROOMS: 'defaultRooms', BETA_COMMENT_LINKING: 'commentLinking', - INTERNATIONALIZATION: 'internationalization', POLICY_ROOMS: 'policyRooms', - THREADS: 'threads', - NEW_DOT_SAML: 'newDotSAML', VIOLATIONS: 'violations', }, BUTTON_STATES: { From 473a57aabe122b2f74525df1041d5c1d4f4e9632 Mon Sep 17 00:00:00 2001 From: Florent De Neve Date: Thu, 23 Nov 2023 16:49:10 -0400 Subject: [PATCH 8/8] undo bad changes --- .../settings/Wallet/WalletPage/WalletPage.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/pages/settings/Wallet/WalletPage/WalletPage.js b/src/pages/settings/Wallet/WalletPage/WalletPage.js index cbb8471da8da..3ac8586daf97 100644 --- a/src/pages/settings/Wallet/WalletPage/WalletPage.js +++ b/src/pages/settings/Wallet/WalletPage/WalletPage.js @@ -105,7 +105,7 @@ function WalletPage({bankAccountList, cardList, fundList, isLoadingPaymentMethod }, [shouldShowEmptyState, windowWidth]); const getSelectedPaymentMethodID = useCallback(() => { - if (paymentMethod.selectedPaymentMethodType === CONST.PAYMENT_METHODS.BANK_ACCOUNT) { + if (paymentMethod.selectedPaymentMethodType === CONST.PAYMENT_METHODS.PERSONAL_BANK_ACCOUNT) { return paymentMethod.selectedPaymentMethod.bankAccountID; } if (paymentMethod.selectedPaymentMethodType === CONST.PAYMENT_METHODS.DEBIT_CARD) { @@ -151,12 +151,12 @@ function WalletPage({bankAccountList, cardList, fundList, isLoadingPaymentMethod // The delete/default menu if (accountType) { let formattedSelectedPaymentMethod; - if (accountType === CONST.PAYMENT_METHODS.BANK_ACCOUNT) { + if (accountType === CONST.PAYMENT_METHODS.PERSONAL_BANK_ACCOUNT) { formattedSelectedPaymentMethod = { title: account.addressName, icon: account.icon, description: PaymentUtils.getPaymentMethodDescription(accountType, account), - type: CONST.PAYMENT_METHODS.BANK_ACCOUNT, + type: CONST.PAYMENT_METHODS.PERSONAL_BANK_ACCOUNT, }; } else if (accountType === CONST.PAYMENT_METHODS.DEBIT_CARD) { formattedSelectedPaymentMethod = { @@ -201,7 +201,7 @@ function WalletPage({bankAccountList, cardList, fundList, isLoadingPaymentMethod return; } - if (paymentType === CONST.PAYMENT_METHODS.BANK_ACCOUNT) { + if (paymentType === CONST.PAYMENT_METHODS.PERSONAL_BANK_ACCOUNT) { BankAccounts.openPersonalBankAccountSetupView(); return; } @@ -227,7 +227,7 @@ function WalletPage({bankAccountList, cardList, fundList, isLoadingPaymentMethod const previousPaymentMethod = _.find(paymentMethods, (method) => method.isDefault); const currentPaymentMethod = _.find(paymentMethods, (method) => method.methodID === paymentMethod.methodID); - if (paymentMethod.selectedPaymentMethodType === CONST.PAYMENT_METHODS.BANK_ACCOUNT) { + if (paymentMethod.selectedPaymentMethodType === CONST.PAYMENT_METHODS.PERSONAL_BANK_ACCOUNT) { PaymentMethods.makeDefaultPaymentMethod(paymentMethod.selectedPaymentMethod.bankAccountID, null, previousPaymentMethod, currentPaymentMethod); } else if (paymentMethod.selectedPaymentMethodType === CONST.PAYMENT_METHODS.DEBIT_CARD) { PaymentMethods.makeDefaultPaymentMethod(null, paymentMethod.selectedPaymentMethod.fundID, previousPaymentMethod, currentPaymentMethod); @@ -242,7 +242,7 @@ function WalletPage({bankAccountList, cardList, fundList, isLoadingPaymentMethod ]); const deletePaymentMethod = useCallback(() => { - if (paymentMethod.selectedPaymentMethodType === CONST.PAYMENT_METHODS.BANK_ACCOUNT) { + if (paymentMethod.selectedPaymentMethodType === CONST.PAYMENT_METHODS.PERSONAL_BANK_ACCOUNT) { BankAccounts.deletePaymentBankAccount(paymentMethod.selectedPaymentMethod.bankAccountID); } else if (paymentMethod.selectedPaymentMethodType === CONST.PAYMENT_METHODS.DEBIT_CARD) { PaymentMethods.deletePaymentCard(paymentMethod.selectedPaymentMethod.fundID); @@ -293,7 +293,7 @@ function WalletPage({bankAccountList, cardList, fundList, isLoadingPaymentMethod // We should reset selected payment method state values and close corresponding modals if the selected payment method is deleted let shouldResetPaymentMethodData = false; - if (paymentMethod.selectedPaymentMethodType === CONST.PAYMENT_METHODS.BANK_ACCOUNT && _.isEmpty(bankAccountList[paymentMethod.methodID])) { + if (paymentMethod.selectedPaymentMethodType === CONST.PAYMENT_METHODS.PERSONAL_BANK_ACCOUNT && _.isEmpty(bankAccountList[paymentMethod.methodID])) { shouldResetPaymentMethodData = true; } else if (paymentMethod.selectedPaymentMethodType === CONST.PAYMENT_METHODS.DEBIT_CARD && _.isEmpty(fundList[paymentMethod.methodID])) { shouldResetPaymentMethodData = true; @@ -308,7 +308,7 @@ function WalletPage({bankAccountList, cardList, fundList, isLoadingPaymentMethod const shouldShowMakeDefaultButton = !paymentMethod.isSelectedPaymentMethodDefault && - !(paymentMethod.formattedSelectedPaymentMethod.type === CONST.PAYMENT_METHODS.BANK_ACCOUNT && paymentMethod.selectedPaymentMethod.type === CONST.BANK_ACCOUNT.TYPE.BUSINESS); + !(paymentMethod.formattedSelectedPaymentMethod.type === CONST.PAYMENT_METHODS.PERSONAL_BANK_ACCOUNT && paymentMethod.selectedPaymentMethod.type === CONST.BANK_ACCOUNT.TYPE.BUSINESS); // Determines whether or not the modal popup is mounted from the bottom of the screen instead of the side mount on Web or Desktop screens const isPopoverBottomMount = anchorPosition.anchorPositionTop === 0 || isSmallScreenWidth; @@ -362,7 +362,7 @@ function WalletPage({bankAccountList, cardList, fundList, isLoadingPaymentMethod navigateToWalletOrTransferBalancePage(source)} onSelectPaymentMethod={(selectedPaymentMethod) => { - if (hasActivatedWallet || selectedPaymentMethod !== CONST.PAYMENT_METHODS.BANK_ACCOUNT) { + if (hasActivatedWallet || selectedPaymentMethod !== CONST.PAYMENT_METHODS.PERSONAL_BANK_ACCOUNT) { return; } // To allow upgrading to a gold wallet, continue with the KYC flow after adding a bank account