From 039522cc262791f7d7f1a7c672f1b0cb9d505010 Mon Sep 17 00:00:00 2001 From: Nikki Wines Date: Wed, 14 Sep 2022 18:06:42 +0100 Subject: [PATCH 1/8] add updateBeneficialOwnersForBankAccount command --- src/libs/actions/BankAccounts.js | 22 +++++++++++++++++-- .../ReimbursementAccount/ACHContractStep.js | 2 +- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/src/libs/actions/BankAccounts.js b/src/libs/actions/BankAccounts.js index d2242b028962..aae80c7e5fe3 100644 --- a/src/libs/actions/BankAccounts.js +++ b/src/libs/actions/BankAccounts.js @@ -1,9 +1,11 @@ import Onyx from 'react-native-onyx'; +import lodashGet from 'lodash/get'; import CONST from '../../CONST'; import * as API from '../API'; import ONYXKEYS from '../../ONYXKEYS'; import * as Localize from '../Localize'; import DateUtils from '../DateUtils'; +import * as store from './ReimbursementAccount/store'; export { setupWithdrawalAccount, @@ -47,8 +49,6 @@ function clearPlaid() { * * @returns {Object} */ -// We'll remove the below once this function is used by the VBBA commands that are yet to be implemented -/* eslint-disable no-unused-vars */ function getVBBADataForOnyx() { return { optimisticData: [ @@ -159,9 +159,27 @@ function deletePaymentBankAccount(bankAccountID) { }); } +/** + * Add beneficial owners for the bank account, accept the ACH terms and conditions and verify the accuracy of the information provided + * + * @param {Object} achContractStepData + */ + function updateBeneficialOwnersForBankAccount(achContractStepData) { + const bankAccountID = lodashGet(store.getReimbursementAccountInSetup(), 'bankAccountID'); + API.write('updateBeneficialOwnersForBankAccount', { + bankAccountID, + ownsMoreThan25Percent: achContractStepData.ownsMoreThan25Percent, + hasOtherBeneficialOwners: achContractStepData.hasOtherBeneficialOwners, + didAcceptTermsAndConditions: achContractStepData.didAcceptTermsAndConditions, + didCertifyTrueInformation: achContractStepData.didCertifyTrueInformation, + beneficialOwners: achContractStepData.beneficialOwners, + }, getVBBADataForOnyx()); +} + export { addPersonalBankAccount, deletePaymentBankAccount, clearPersonalBankAccount, clearPlaid, + updateBeneficialOwnersForBankAccount, }; diff --git a/src/pages/ReimbursementAccount/ACHContractStep.js b/src/pages/ReimbursementAccount/ACHContractStep.js index ae5fc4932460..619fb603712e 100644 --- a/src/pages/ReimbursementAccount/ACHContractStep.js +++ b/src/pages/ReimbursementAccount/ACHContractStep.js @@ -149,7 +149,7 @@ class ACHContractStep extends React.Component { this.setState(prevState => ({ beneficialOwners: !prevState.hasOtherBeneficialOwners ? [] : prevState.beneficialOwners, }), - () => BankAccounts.setupWithdrawalAccount({...this.state})); + () => BankAccounts.updateBeneficialOwnersForBankAccount({...this.state})); } /** From 0d681698dba7247f4916fcf4d7e635636306f23d Mon Sep 17 00:00:00 2001 From: Nikki Wines Date: Wed, 21 Sep 2022 15:18:13 +0200 Subject: [PATCH 2/8] modify params to match web-e requirements --- src/libs/actions/BankAccounts.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/libs/actions/BankAccounts.js b/src/libs/actions/BankAccounts.js index 2fea6deab8cf..2bb3f15db667 100644 --- a/src/libs/actions/BankAccounts.js +++ b/src/libs/actions/BankAccounts.js @@ -166,13 +166,13 @@ function deletePaymentBankAccount(bankAccountID) { */ function updateBeneficialOwnersForBankAccount(achContractStepData) { const bankAccountID = lodashGet(store.getReimbursementAccountInSetup(), 'bankAccountID'); - API.write('updateBeneficialOwnersForBankAccount', { + API.write('UpdateBeneficialOwnersForBankAccount', { bankAccountID, ownsMoreThan25Percent: achContractStepData.ownsMoreThan25Percent, hasOtherBeneficialOwners: achContractStepData.hasOtherBeneficialOwners, - didAcceptTermsAndConditions: achContractStepData.didAcceptTermsAndConditions, - didCertifyTrueInformation: achContractStepData.didCertifyTrueInformation, - beneficialOwners: achContractStepData.beneficialOwners, + didAcceptTermsAndConditions: achContractStepData.acceptTermsAndConditions, + didCertifyTrueInformation: achContractStepData.certifyTrueInformation, + beneficialOwners: JSON.stringify(achContractStepData.beneficialOwners), }, getVBBADataForOnyx()); } From 1426b37eab817314ab7f95b87881cb516f309acc Mon Sep 17 00:00:00 2001 From: Nikki Wines Date: Wed, 21 Sep 2022 16:03:05 +0200 Subject: [PATCH 3/8] modify how we pass params to updateBeneificialOwnersForBankAccount --- src/libs/actions/BankAccounts.js | 20 +++++++++---------- .../ReimbursementAccount/ACHContractStep.js | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/libs/actions/BankAccounts.js b/src/libs/actions/BankAccounts.js index 2bb3f15db667..e06831bb4608 100644 --- a/src/libs/actions/BankAccounts.js +++ b/src/libs/actions/BankAccounts.js @@ -162,18 +162,18 @@ function deletePaymentBankAccount(bankAccountID) { /** * Add beneficial owners for the bank account, accept the ACH terms and conditions and verify the accuracy of the information provided * - * @param {Object} achContractStepData + * @param {Object} params + * + * // ACH Contract Step + * @param {Boolean} [params.ownsMoreThan25Percent] + * @param {Boolean} [params.hasOtherBeneficialOwners] + * @param {Boolean} [params.acceptTermsAndConditions] + * @param {Boolean} [params.certifyTrueInformation] + * @param {String} [params.beneficialOwners] */ -function updateBeneficialOwnersForBankAccount(achContractStepData) { +function updateBeneficialOwnersForBankAccount(params) { const bankAccountID = lodashGet(store.getReimbursementAccountInSetup(), 'bankAccountID'); - API.write('UpdateBeneficialOwnersForBankAccount', { - bankAccountID, - ownsMoreThan25Percent: achContractStepData.ownsMoreThan25Percent, - hasOtherBeneficialOwners: achContractStepData.hasOtherBeneficialOwners, - didAcceptTermsAndConditions: achContractStepData.acceptTermsAndConditions, - didCertifyTrueInformation: achContractStepData.certifyTrueInformation, - beneficialOwners: JSON.stringify(achContractStepData.beneficialOwners), - }, getVBBADataForOnyx()); + API.write('UpdateBeneficialOwnersForBankAccount', {bankAccountID, ...params}, getVBBADataForOnyx()); } /** diff --git a/src/pages/ReimbursementAccount/ACHContractStep.js b/src/pages/ReimbursementAccount/ACHContractStep.js index 619fb603712e..60bb20ee2eea 100644 --- a/src/pages/ReimbursementAccount/ACHContractStep.js +++ b/src/pages/ReimbursementAccount/ACHContractStep.js @@ -149,7 +149,7 @@ class ACHContractStep extends React.Component { this.setState(prevState => ({ beneficialOwners: !prevState.hasOtherBeneficialOwners ? [] : prevState.beneficialOwners, }), - () => BankAccounts.updateBeneficialOwnersForBankAccount({...this.state})); + () => BankAccounts.updateBeneficialOwnersForBankAccount({...this.state, beneficialOwners: JSON.stringify(this.state.beneficialOwners)})); } /** From 3a13751782aeb0399fc29828f4fcd4f5bb9c63ee Mon Sep 17 00:00:00 2001 From: Nikki Wines Date: Fri, 30 Sep 2022 14:19:45 +0200 Subject: [PATCH 4/8] Revert "Merge branch 'cmartins-UpdateCompanyInformationForBankAccount' of github.com:Expensify/App into HEAD" This reverts commit e62c5e8f8e4971ab1462817affffb1b2eed0d249, reversing changes made to 41210fc7cbc6ad41e3f99e0e4524a3a9a1e04e93. --- .well-known/apple-app-site-association | 4 - android/app/build.gradle | 4 +- android/app/src/main/AndroidManifest.xml | 2 - desktop/dev.js | 9 - desktop/start.js | 26 +-- ios/NewExpensify/Info.plist | 4 +- ios/NewExpensifyTests/Info.plist | 4 +- package-lock.json | 203 +++++++++++++++++- package.json | 3 +- src/App.js | 2 - src/CONST.js | 3 + src/ONYXKEYS.js | 9 - src/components/AddPaymentMethodMenu.js | 13 +- src/components/ArchivedReportFooter.js | 7 +- src/components/Banner.js | 72 ++----- src/components/BigNumberPad.js | 1 - src/components/Button.js | 6 +- .../EmojiPicker/EmojiPickerMenu/index.js | 8 +- .../EmojiPicker/EmojiPickerMenuItem.js | 19 +- .../EmojiPicker/EmojiSkinToneList.js | 3 +- src/components/FormAlertWithSubmitButton.js | 6 +- src/components/IOUBadge.js | 18 +- src/components/IOUConfirmationList.js | 2 +- src/components/OnyxProvider.js | 8 +- src/components/ReportWelcomeText.js | 3 +- src/components/optionPropTypes.js | 2 +- src/components/paypalMeDataPropTypes.js | 15 -- src/components/withWindowDimensions.js | 168 +++++++-------- src/languages/en.js | 3 +- src/languages/es.js | 3 +- .../AppNavigator/MainDrawerNavigator.js | 5 +- .../Navigation/DeprecatedCustomActions.js | 17 +- src/libs/OptionsListUtils.js | 2 +- src/libs/PaymentUtils.js | 49 ++++- src/libs/ReimbursementAccountUtils.js | 17 +- src/libs/ReportActionsUtils.js | 4 +- src/libs/SidebarUtils.js | 9 +- src/libs/actions/BankAccounts.js | 84 +------- src/libs/actions/IOU.js | 2 +- src/libs/actions/PaymentMethods.js | 78 +++---- src/libs/actions/Policy.js | 119 ++++++---- .../fetchFreePlanVerifiedBankAccount.js | 14 +- .../ReimbursementAccount/navigation.js | 5 + src/libs/actions/Report.js | 53 +++-- src/libs/actions/ReportActions.js | 4 +- src/libs/actions/Session/index.js | 70 +++++- src/libs/actions/User.js | 22 +- src/libs/deprecatedAPI.js | 13 ++ src/libs/models/BankAccount.js | 41 ++++ src/pages/EnablePayments/ActivateStep.js | 5 +- .../EnablePayments/AdditionalDetailsStep.js | 4 +- .../EnablePayments/EnablePaymentsPage.js | 53 +++-- src/pages/NewChatPage.js | 8 +- .../ReimbursementAccount/ACHContractStep.js | 5 +- .../BankAccountManualStep.js | 1 + .../ReimbursementAccount/BankAccountStep.js | 15 +- src/pages/ReimbursementAccount/CompanyStep.js | 22 +- .../ReimbursementAccountPage.js | 9 +- .../ReimbursementAccount/RequestorStep.js | 45 +--- .../ReimbursementAccount/ValidationStep.js | 2 +- src/pages/ReportDetailsPage.js | 15 +- src/pages/ReportParticipantsPage.js | 12 +- src/pages/ReportSettingsPage.js | 21 +- src/pages/SearchPage.js | 6 +- src/pages/SetPasswordPage.js | 14 +- src/pages/home/HeaderView.js | 12 +- src/pages/home/ReportScreen.js | 42 ++-- .../PopoverReportActionContextMenu.js | 10 +- .../ContextMenu/ReportActionContextMenu.js | 6 +- ...genericReportActionContextMenuPropTypes.js | 2 +- src/pages/home/report/ReportActionCompose.js | 11 +- src/pages/home/report/ReportActionItem.js | 15 +- .../home/report/ReportActionItemCreated.js | 15 +- .../report/ReportActionItemMessageEdit.js | 9 +- src/pages/home/report/ReportActionsList.js | 9 +- src/pages/home/report/ReportActionsView.js | 15 +- .../report/reportActionFragmentPropTypes.js | 2 +- src/pages/home/sidebar/SidebarLinks.js | 12 +- src/pages/iou/IOUModal.js | 9 +- src/pages/iou/steps/IOUConfirmPage.js | 2 +- .../IOUParticipantsPage.js | 2 +- .../IOUParticipantsRequest.js | 6 +- .../IOUParticipantsSplit.js | 8 +- src/pages/iouReportPropTypes.js | 18 -- src/pages/reportPropTypes.js | 76 ------- .../settings/Payments/AddPayPalMePage.js | 18 +- .../settings/Payments/PaymentMethodList.js | 18 +- .../Payments/PaymentsPage/BasePaymentsPage.js | 16 +- .../settings/Payments/TransferBalancePage.js | 6 +- src/pages/signin/PasswordForm.js | 2 +- src/pages/workspace/WorkspaceInvitePage.js | 4 +- src/styles/styles.js | 4 - tests/unit/LHNOrderTest.js | 12 +- .../fetchFreePlanVerifiedBankAccountTest.js | 51 ++++- 94 files changed, 1012 insertions(+), 875 deletions(-) delete mode 100644 desktop/dev.js delete mode 100644 src/components/paypalMeDataPropTypes.js delete mode 100644 src/pages/iouReportPropTypes.js delete mode 100644 src/pages/reportPropTypes.js diff --git a/.well-known/apple-app-site-association b/.well-known/apple-app-site-association index fcd7138da7e6..28ee9ee23fbd 100644 --- a/.well-known/apple-app-site-association +++ b/.well-known/apple-app-site-association @@ -43,10 +43,6 @@ { "/": "/statements/*", "comment": "Wallet statements" - }, - { - "/": "/concierge/*", - "comment": "Concierge" } ] } diff --git a/android/app/build.gradle b/android/app/build.gradle index 1cdaa76a4443..6c4e8e48e955 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -156,8 +156,8 @@ android { minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion multiDexEnabled rootProject.ext.multiDexEnabled - versionCode 1001021000 - versionName "1.2.10-0" + versionCode 1001020800 + versionName "1.2.8-0" buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString() if (isNewArchitectureEnabled()) { diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index eb109cc8a30e..5b4e43c86366 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -61,7 +61,6 @@ - @@ -73,7 +72,6 @@ - diff --git a/desktop/dev.js b/desktop/dev.js deleted file mode 100644 index 43a2122f6846..000000000000 --- a/desktop/dev.js +++ /dev/null @@ -1,9 +0,0 @@ -// Development entry point of the desktop app with support for live reload -// We keep this file (dev.js) out Webpack bundling process and provide it raw to Electron -// Reloading Electron on change requires some native Node dependencies which cannot be -// easily bundled with webpack, and we don't really need them bundled for staging/prod -// We are free to load any bundled code from this file, and we load the bundled main.js from dist - -// The `dist` folder is not part of the source and does not exist until we build or start Desktop -// eslint-disable-next-line import/extensions -require('./dist/main'); diff --git a/desktop/start.js b/desktop/start.js index 815be335c46f..79e62d7187ed 100644 --- a/desktop/start.js +++ b/desktop/start.js @@ -9,35 +9,25 @@ portfinder.getPortPromise({ port: basePort, }).then((port) => { const devServer = `webpack-dev-server --config config/webpack/webpack.dev.js --port ${port} --env platform=desktop`; - const buildMain = 'webpack watch --config config/webpack/webpack.desktop.js --config-name desktop-main --mode=development'; - - const env = { - PORT: port, - NODE_ENV: 'development', - }; + const buildMain = 'webpack --config config/webpack/webpack.desktop.js --config-name desktop-main --mode=development'; const processes = [ - { - command: buildMain, - name: 'Main', - prefixColor: 'blue.dim', - env, - }, { command: devServer, name: 'Renderer', prefixColor: 'red.dim', - env, }, { - command: `wait-port localhost:${port} && npx electronmon ./desktop/dev.js`, - name: 'Electron', + command: `${buildMain} && wait-port localhost:${port} && electron desktop/dist/main.js`, + name: 'Main', prefixColor: 'cyan.dim', - env, + env: { + PORT: port, + NODE_ENV: 'development', + }, }, ]; - - return concurrently(processes, { + concurrently(processes, { inputStream: process.stdin, prefix: 'name', diff --git a/ios/NewExpensify/Info.plist b/ios/NewExpensify/Info.plist index d442f5fc21cd..59c8131fdba0 100644 --- a/ios/NewExpensify/Info.plist +++ b/ios/NewExpensify/Info.plist @@ -17,7 +17,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 1.2.10 + 1.2.8 CFBundleSignature ???? CFBundleURLTypes @@ -30,7 +30,7 @@ CFBundleVersion - 1.2.10.0 + 1.2.8.0 ITSAppUsesNonExemptEncryption LSApplicationQueriesSchemes diff --git a/ios/NewExpensifyTests/Info.plist b/ios/NewExpensifyTests/Info.plist index 319b0779092c..1a6b406877ae 100644 --- a/ios/NewExpensifyTests/Info.plist +++ b/ios/NewExpensifyTests/Info.plist @@ -15,10 +15,10 @@ CFBundlePackageType BNDL CFBundleShortVersionString - 1.2.10 + 1.2.8 CFBundleSignature ???? CFBundleVersion - 1.2.10.0 + 1.2.8.0 diff --git a/package-lock.json b/package-lock.json index 589a57e2f85b..d28de1edcb02 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "new.expensify", - "version": "1.2.10-0", + "version": "1.2.8-0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "new.expensify", - "version": "1.2.10-0", + "version": "1.2.8-0", "hasInstallScript": true, "license": "MIT", "dependencies": { @@ -129,6 +129,7 @@ "electron": "^17.4.11", "electron-builder": "23.5.0", "electron-notarize": "^1.2.1", + "electron-reloader": "^1.2.1", "eslint": "^7.6.0", "eslint-config-expensify": "2.0.30", "eslint-loader": "^4.0.2", @@ -20428,6 +20429,18 @@ "url": "https://opencollective.com/date-fns" } }, + "node_modules/date-time": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/date-time/-/date-time-3.1.0.tgz", + "integrity": "sha512-uqCUKXE5q1PNBXjPqvwhwJf9SwMoAHBgWJ6DcrnS5o+W2JOiIILl0JEdVD8SGujrNS02GGxgwAg2PN2zONgtjg==", + "dev": true, + "dependencies": { + "time-zone": "^1.0.0" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/dayjs": { "version": "1.11.5", "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.5.tgz", @@ -21364,6 +21377,12 @@ "node": ">=12" } }, + "node_modules/electron-is-dev": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/electron-is-dev/-/electron-is-dev-1.2.0.tgz", + "integrity": "sha512-R1oD5gMBPS7PVU8gJwH6CtT0e6VSoD0+SzSnYpNm+dBkcijgA+K7VAMHDfnRq/lkKPZArpzplTW6jfiMYosdzw==", + "dev": true + }, "node_modules/electron-notarize": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/electron-notarize/-/electron-notarize-1.2.1.tgz", @@ -21525,6 +21544,92 @@ "node": ">=8" } }, + "node_modules/electron-reloader": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/electron-reloader/-/electron-reloader-1.2.3.tgz", + "integrity": "sha512-aDnACAzNg0QvQhzw7LYOx/nVS10mEtbuG6M0QQvNQcLnJEwFs6is+EGRCnM+KQlQ4KcTbdwnt07nd7ZjHpY4iw==", + "dev": true, + "dependencies": { + "chalk": "^4.1.0", + "chokidar": "^3.5.0", + "date-time": "^3.1.0", + "electron-is-dev": "^1.2.0", + "find-up": "^5.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/electron-reloader/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/electron-reloader/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/electron-reloader/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/electron-reloader/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/electron-reloader/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/electron-reloader/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/electron-to-chromium": { "version": "1.4.223", "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.223.tgz", @@ -40267,6 +40372,15 @@ "integrity": "sha512-eHY7nBftgThBqOyHGVN+l8gF0BucP09fMo0oO/Lb0w1OF80dJv+lDVpXG60WMQvkcxAkNybKsrEIE3ZtKGmPrA==", "dev": true }, + "node_modules/time-zone": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/time-zone/-/time-zone-1.0.0.tgz", + "integrity": "sha512-TIsDdtKo6+XrPtiTm1ssmMngN1sAhyKnTO2kunQWqNPWIVvCm15Wmw4SWInwTVgJ5u/Tr04+8Ei9TNcw4x4ONA==", + "dev": true, + "engines": { + "node": ">=4" + } + }, "node_modules/timers-browserify": { "version": "2.0.12", "resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-2.0.12.tgz", @@ -58452,6 +58566,15 @@ "integrity": "sha512-dlLD5rKaKxpFdnjrs+5azHDFOPEu4ANy/LTh04A1DTzMM7qoajmKCBc8pkKRFT41CNzw+4gQh79X5C+Jq27HAw==", "dev": true }, + "date-time": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/date-time/-/date-time-3.1.0.tgz", + "integrity": "sha512-uqCUKXE5q1PNBXjPqvwhwJf9SwMoAHBgWJ6DcrnS5o+W2JOiIILl0JEdVD8SGujrNS02GGxgwAg2PN2zONgtjg==", + "dev": true, + "requires": { + "time-zone": "^1.0.0" + } + }, "dayjs": { "version": "1.11.5", "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.5.tgz", @@ -59199,6 +59322,12 @@ } } }, + "electron-is-dev": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/electron-is-dev/-/electron-is-dev-1.2.0.tgz", + "integrity": "sha512-R1oD5gMBPS7PVU8gJwH6CtT0e6VSoD0+SzSnYpNm+dBkcijgA+K7VAMHDfnRq/lkKPZArpzplTW6jfiMYosdzw==", + "dev": true + }, "electron-notarize": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/electron-notarize/-/electron-notarize-1.2.1.tgz", @@ -59326,6 +59455,70 @@ } } }, + "electron-reloader": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/electron-reloader/-/electron-reloader-1.2.3.tgz", + "integrity": "sha512-aDnACAzNg0QvQhzw7LYOx/nVS10mEtbuG6M0QQvNQcLnJEwFs6is+EGRCnM+KQlQ4KcTbdwnt07nd7ZjHpY4iw==", + "dev": true, + "requires": { + "chalk": "^4.1.0", + "chokidar": "^3.5.0", + "date-time": "^3.1.0", + "electron-is-dev": "^1.2.0", + "find-up": "^5.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, "electron-to-chromium": { "version": "1.4.223", "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.223.tgz", @@ -73770,6 +73963,12 @@ "integrity": "sha512-eHY7nBftgThBqOyHGVN+l8gF0BucP09fMo0oO/Lb0w1OF80dJv+lDVpXG60WMQvkcxAkNybKsrEIE3ZtKGmPrA==", "dev": true }, + "time-zone": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/time-zone/-/time-zone-1.0.0.tgz", + "integrity": "sha512-TIsDdtKo6+XrPtiTm1ssmMngN1sAhyKnTO2kunQWqNPWIVvCm15Wmw4SWInwTVgJ5u/Tr04+8Ei9TNcw4x4ONA==", + "dev": true + }, "timers-browserify": { "version": "2.0.12", "resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-2.0.12.tgz", diff --git a/package.json b/package.json index 72db7454f40d..d9e584a04e89 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "new.expensify", - "version": "1.2.10-0", + "version": "1.2.8-0", "author": "Expensify, Inc.", "homepage": "https://new.expensify.com", "description": "New Expensify is the next generation of Expensify: a reimagination of payments based atop a foundation of chat.", @@ -156,6 +156,7 @@ "electron": "^17.4.11", "electron-builder": "23.5.0", "electron-notarize": "^1.2.1", + "electron-reloader": "^1.2.1", "eslint": "^7.6.0", "eslint-config-expensify": "2.0.30", "eslint-loader": "^4.0.2", diff --git a/src/App.js b/src/App.js index ef53f1209a7e..2f25e4122d42 100644 --- a/src/App.js +++ b/src/App.js @@ -13,7 +13,6 @@ import HTMLEngineProvider from './components/HTMLEngineProvider'; import ComposeProviders from './components/ComposeProviders'; import SafeArea from './components/SafeArea'; import * as Environment from './libs/Environment/Environment'; -import {WindowDimensionsProvider} from './components/withWindowDimensions'; // For easier debugging and development, when we are in web we expose Onyx to the window, so you can more easily set data into Onyx if (window && Environment.isDevelopment()) { @@ -38,7 +37,6 @@ const App = () => ( SafeArea, LocaleContextProvider, HTMLEngineProvider, - WindowDimensionsProvider, ]} > diff --git a/src/CONST.js b/src/CONST.js index 67d08a4d6fc4..bd24f7a7d063 100755 --- a/src/CONST.js +++ b/src/CONST.js @@ -69,6 +69,9 @@ const CONST = { }, VERIFICATIONS: { ERROR_MESSAGE: 'verifications.errorMessage', + EXTERNAL_API_RESPONSES: 'verifications.externalApiResponses', + REQUESTOR_IDENTITY_ID: 'verifications.externalApiResponses.requestorIdentityID', + REQUESTOR_IDENTITY_ONFIDO: 'verifications.externalApiResponses.requestorIdentityOnfido', THROTTLED: 'verifications.throttled', }, FIELDS_TYPE: { diff --git a/src/ONYXKEYS.js b/src/ONYXKEYS.js index 713dfa3df45a..ab94c4dff47c 100755 --- a/src/ONYXKEYS.js +++ b/src/ONYXKEYS.js @@ -5,9 +5,6 @@ export default { // Holds information about the users account that is logging in ACCOUNT: 'account', - // Holds the reportID for the report between the user and their account manager - ACCOUNT_MANAGER_REPORT_ID: 'accountManagerReportID', - // Boolean flag only true when first set NVP_IS_FIRST_TIME_NEW_EXPENSIFY_USER: 'isFirstTimeNewExpensifyUser', @@ -70,9 +67,6 @@ export default { // Contains the user's payPalMe address NVP_PAYPAL_ME_ADDRESS: 'nvp_paypalMeAddress', - // Contains the user's payPalMe data - PAYPAL: 'paypal', - // Contains the user preference for the LHN priority mode NVP_PRIORITY_MODE: 'nvp_priorityMode', @@ -85,9 +79,6 @@ export default { // Token needed to initialize Plaid link PLAID_LINK_TOKEN: 'plaidLinkToken', - // Token needed to initialize Onfido - ONFIDO_TOKEN: 'onfidoToken', - // Collection Keys COLLECTION: { REPORT: 'report_', diff --git a/src/components/AddPaymentMethodMenu.js b/src/components/AddPaymentMethodMenu.js index e71e42e1d15a..ad8e10a31c70 100644 --- a/src/components/AddPaymentMethodMenu.js +++ b/src/components/AddPaymentMethodMenu.js @@ -9,7 +9,6 @@ import CONST from '../CONST'; import withWindowDimensions from './withWindowDimensions'; import Permissions from '../libs/Permissions'; import PopoverMenu from './PopoverMenu'; -import paypalMeDataPropTypes from './paypalMeDataPropTypes'; import * as BankAccounts from '../libs/actions/BankAccounts'; const propTypes = { @@ -20,8 +19,8 @@ const propTypes = { left: PropTypes.number, }), - /** Account details for PayPal.Me */ - payPalMeData: paypalMeDataPropTypes, + /** Username for PayPal.Me */ + payPalMeUsername: PropTypes.string, /** Should we show the Paypal option */ shouldShowPaypal: PropTypes.bool, @@ -34,7 +33,7 @@ const propTypes = { const defaultProps = { anchorPosition: {}, - payPalMeData: {}, + payPalMeUsername: '', shouldShowPaypal: true, betas: [], }; @@ -60,7 +59,7 @@ const AddPaymentMethodMenu = props => ( onSelected: () => props.onItemSelected(CONST.PAYMENT_METHODS.DEBIT_CARD), }, ] : []), - ...(props.shouldShowPaypal && !props.payPalMeData.description ? [{ + ...(props.shouldShowPaypal && !props.payPalMeUsername ? [{ text: props.translate('common.payPalMe'), icon: Expensicons.PayPal, onSelected: () => props.onItemSelected(CONST.PAYMENT_METHODS.PAYPAL), @@ -78,8 +77,8 @@ export default compose( withWindowDimensions, withLocalize, withOnyx({ - payPalMeData: { - key: ONYXKEYS.PAYPAL, + payPalMeUsername: { + key: ONYXKEYS.NVP_PAYPAL_ME_ADDRESS, }, betas: { key: ONYXKEYS.BETAS, diff --git a/src/components/ArchivedReportFooter.js b/src/components/ArchivedReportFooter.js index c271b0f8c0bc..bcb204c98369 100644 --- a/src/components/ArchivedReportFooter.js +++ b/src/components/ArchivedReportFooter.js @@ -9,7 +9,6 @@ import compose from '../libs/compose'; import personalDetailsPropType from '../pages/personalDetailsPropType'; import ONYXKEYS from '../ONYXKEYS'; import * as ReportUtils from '../libs/ReportUtils'; -import reportPropTypes from '../pages/reportPropTypes'; const propTypes = { /** The reason this report was archived */ @@ -28,7 +27,10 @@ const propTypes = { }), /** The archived report */ - report: reportPropTypes.isRequired, + report: PropTypes.shape({ + /** The policy this report is attached to */ + policyID: PropTypes.string, + }).isRequired, /** Personal details of all users */ personalDetails: PropTypes.objectOf(personalDetailsPropType).isRequired, @@ -70,7 +72,6 @@ const ArchivedReportFooter = (props) => { policyName: `${ReportUtils.getPolicyName(props.report, props.policies)}`, })} shouldRenderHTML={archiveReason !== CONST.REPORT.ARCHIVE_REASON.DEFAULT} - shouldShowIcon /> ); }; diff --git a/src/components/Banner.js b/src/components/Banner.js index 3b5a8d66e3aa..87808c22af24 100644 --- a/src/components/Banner.js +++ b/src/components/Banner.js @@ -1,7 +1,6 @@ import React, {memo} from 'react'; import PropTypes from 'prop-types'; -import {View, Pressable} from 'react-native'; -import compose from '../libs/compose'; +import {View} from 'react-native'; import Hoverable from './Hoverable'; import Icon from './Icon'; import * as Expensicons from './Icon/Expensicons'; @@ -10,45 +9,17 @@ import Text from './Text'; import styles from '../styles/styles'; import * as StyleUtils from '../styles/StyleUtils'; import getButtonState from '../libs/getButtonState'; -import Tooltip from './Tooltip'; -import withLocalize, {withLocalizePropTypes} from './withLocalize'; const propTypes = { /** Text to display in the banner. */ text: PropTypes.string.isRequired, - /** Should this component render the left-aligned exclamation icon? */ - shouldShowIcon: PropTypes.bool, - - /** Should this component render a close button? */ - shouldShowCloseButton: PropTypes.bool, - /** Should this component render the text as HTML? */ shouldRenderHTML: PropTypes.bool, - - /** Callback called when the close button is pressed */ - onClose: PropTypes.func, - - /** Callback called when the message is pressed */ - onPress: PropTypes.func, - - // eslint-disable-next-line react/forbid-prop-types - containerStyles: PropTypes.arrayOf(PropTypes.object), - - // eslint-disable-next-line react/forbid-prop-types - textStyles: PropTypes.arrayOf(PropTypes.object), - - ...withLocalizePropTypes, }; const defaultProps = { shouldRenderHTML: false, - shouldShowIcon: false, - shouldShowCloseButton: false, - onClose: () => {}, - onPress: () => {}, - containerStyles: [], - textStyles: [], }; const Banner = props => ( @@ -61,35 +32,19 @@ const Banner = props => ( styles.borderRadiusNormal, isHovered ? styles.activeComponentBG : styles.hoveredComponentBG, styles.breakAll, - ...props.containerStyles, ]} > - - {props.shouldShowIcon && ( - - - - )} - { - props.shouldRenderHTML - ? - : {props.text} - } + + - {props.shouldShowCloseButton && ( - - - - - - )} + { + props.shouldRenderHTML + ? + : {props.text} + } )} @@ -99,7 +54,4 @@ Banner.propTypes = propTypes; Banner.defaultProps = defaultProps; Banner.displayName = 'Banner'; -export default compose( - withLocalize, - memo, -)(Banner); +export default memo(Banner); diff --git a/src/components/BigNumberPad.js b/src/components/BigNumberPad.js index 867b946f25bc..56dc37d5a440 100644 --- a/src/components/BigNumberPad.js +++ b/src/components/BigNumberPad.js @@ -78,7 +78,6 @@ class BigNumberPad extends React.Component { ControlSelection.unblock(); this.props.longPressHandlerStateChanged(false); }} - textSelectable={false} /> ); })} diff --git a/src/components/Button.js b/src/components/Button.js index e71652d52382..e50d13abcbb0 100644 --- a/src/components/Button.js +++ b/src/components/Button.js @@ -106,9 +106,6 @@ const propTypes = { /** Id to use for this button */ nativeID: PropTypes.string, - - /** Whether text in Button should selectable */ - textSelectable: PropTypes.bool, }; const defaultProps = { @@ -139,7 +136,6 @@ const defaultProps = { shouldRemoveLeftBorderRadius: false, shouldEnableHapticFeedback: false, nativeID: '', - textSelectable: true, }; class Button extends Component { @@ -183,7 +179,7 @@ class Button extends Component { const textComponent = ( this.addToFrequentAndSelectEmoji(emoji, item)} - onHoverIn={() => this.setState({highlightedIndex: index})} - onHoverOut={() => { - if (this.state.arePointerEventsDisabled) { - return; - } - this.setState({highlightedIndex: -1}); - }} + onHover={() => this.setState({highlightedIndex: index})} emoji={emojiCode} isHighlighted={index === this.state.highlightedIndex} /> diff --git a/src/components/EmojiPicker/EmojiPickerMenuItem.js b/src/components/EmojiPicker/EmojiPickerMenuItem.js index 929930efe27e..ee24d689f87d 100644 --- a/src/components/EmojiPicker/EmojiPickerMenuItem.js +++ b/src/components/EmojiPicker/EmojiPickerMenuItem.js @@ -4,6 +4,7 @@ import {Pressable} from 'react-native'; import styles from '../../styles/styles'; import * as StyleUtils from '../../styles/StyleUtils'; import getButtonState from '../../libs/getButtonState'; +import Hoverable from '../Hoverable'; import Text from '../Text'; const propTypes = { @@ -14,10 +15,7 @@ const propTypes = { onPress: PropTypes.func.isRequired, /** Handles what to do when we hover over this item with our cursor */ - onHoverIn: PropTypes.func, - - /** Handles what to do when the hover is out */ - onHoverOut: PropTypes.func, + onHover: PropTypes.func, /** Whether this menu item is currently highlighted or not */ isHighlighted: PropTypes.bool, @@ -26,8 +24,6 @@ const propTypes = { const EmojiPickerMenuItem = props => ( props.onPress(props.emoji)} - onHoverIn={props.onHoverIn} - onHoverOut={props.onHoverOut} style={({ pressed, }) => ([ @@ -37,9 +33,11 @@ const EmojiPickerMenuItem = props => ( styles.emojiItem, ])} > - - {props.emoji} - + + + {props.emoji} + + ); @@ -47,8 +45,7 @@ EmojiPickerMenuItem.propTypes = propTypes; EmojiPickerMenuItem.displayName = 'EmojiPickerMenuItem'; EmojiPickerMenuItem.defaultProps = { isHighlighted: false, - onHoverIn: () => {}, - onHoverOut: () => {}, + onHover: () => {}, }; // Significantly speeds up re-renders of the EmojiPickerMenu's FlatList diff --git a/src/components/EmojiPicker/EmojiSkinToneList.js b/src/components/EmojiPicker/EmojiSkinToneList.js index d8efbcc0ec21..45dc28755592 100644 --- a/src/components/EmojiPicker/EmojiSkinToneList.js +++ b/src/components/EmojiPicker/EmojiSkinToneList.js @@ -84,8 +84,7 @@ class EmojiSkinToneList extends Component { _.map(Emojis.skinTones, skinToneEmoji => ( this.updateSelectedSkinTone(skinToneEmoji)} - onHoverIn={() => this.setState({highlightedIndex: skinToneEmoji.skinTone})} - onHoverOut={() => this.setState({highlightedIndex: -1})} + onHover={() => this.setState({highlightedIndex: skinToneEmoji.skinTone})} key={skinToneEmoji.code} emoji={skinToneEmoji.code} isHighlighted={skinToneEmoji.skinTone === this.state.highlightedIndex} diff --git a/src/components/FormAlertWithSubmitButton.js b/src/components/FormAlertWithSubmitButton.js index c3ef4b464c9a..ca1e86d817ea 100644 --- a/src/components/FormAlertWithSubmitButton.js +++ b/src/components/FormAlertWithSubmitButton.js @@ -32,9 +32,6 @@ const propTypes = { /** Submit function */ onSubmit: PropTypes.func.isRequired, - - /** Should the button be enabled when offline */ - enabledWhenOffline: PropTypes.bool, }; const defaultProps = { @@ -44,7 +41,6 @@ const defaultProps = { containerStyles: [], isLoading: false, onFixTheErrorsPressed: () => {}, - enabledWhenOffline: false, }; const FormAlertWithSubmitButton = props => ( @@ -55,7 +51,7 @@ const FormAlertWithSubmitButton = props => ( message={props.message} onFixTheErrorsPressed={props.onFixTheErrorsPressed} > - {isOffline => ((isOffline && !props.enabledWhenOffline) ? ( + {isOffline => (isOffline ? (