From 1c0c4ea22f3a8fe0aedd7f1dd69390f44329eb5c Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Fri, 6 Aug 2021 17:10:47 -0600 Subject: [PATCH 1/9] prevent ui change --- src/libs/actions/BankAccounts.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libs/actions/BankAccounts.js b/src/libs/actions/BankAccounts.js index b3f016ac3ab4..a020aea2bb80 100644 --- a/src/libs/actions/BankAccounts.js +++ b/src/libs/actions/BankAccounts.js @@ -330,7 +330,8 @@ function fetchUserWallet() { function fetchFreePlanVerifiedBankAccount(stepToOpen) { // We are using set here since we will rely on data from the server (not local data) to populate the VBA flow // and determine which step to navigate to. - Onyx.set(ONYXKEYS.REIMBURSEMENT_ACCOUNT, {loading: true}); + // We temporarily keep the achData state to prevent UI changes while fetching. + Onyx.set(ONYXKEYS.REIMBURSEMENT_ACCOUNT, {loading: true, achData: {state: reimbursementAccountInSetup.state}}); let bankAccountID; API.Get({ From f995b9b248fff7f9aedb9e46f1dced1534309f92 Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Fri, 6 Aug 2021 17:15:21 -0600 Subject: [PATCH 2/9] use lodashget --- src/libs/actions/BankAccounts.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/libs/actions/BankAccounts.js b/src/libs/actions/BankAccounts.js index a020aea2bb80..2876cf790eba 100644 --- a/src/libs/actions/BankAccounts.js +++ b/src/libs/actions/BankAccounts.js @@ -331,7 +331,10 @@ function fetchFreePlanVerifiedBankAccount(stepToOpen) { // We are using set here since we will rely on data from the server (not local data) to populate the VBA flow // and determine which step to navigate to. // We temporarily keep the achData state to prevent UI changes while fetching. - Onyx.set(ONYXKEYS.REIMBURSEMENT_ACCOUNT, {loading: true, achData: {state: reimbursementAccountInSetup.state}}); + Onyx.set(ONYXKEYS.REIMBURSEMENT_ACCOUNT, { + loading: true, + achData: {state: lodashGet(reimbursementAccountInSetup, 'state', '')}, + }); let bankAccountID; API.Get({ From 22c872cfb2409cc0e1e2b774102f2da4a0db09f6 Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Mon, 9 Aug 2021 10:24:59 -0600 Subject: [PATCH 3/9] achData default state --- src/libs/actions/BankAccounts.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libs/actions/BankAccounts.js b/src/libs/actions/BankAccounts.js index 2876cf790eba..cc01b979f4f4 100644 --- a/src/libs/actions/BankAccounts.js +++ b/src/libs/actions/BankAccounts.js @@ -406,6 +406,7 @@ function fetchFreePlanVerifiedBankAccount(stepToOpen) { achData.isInSetup = !bankAccount || bankAccount.isInSetup(); achData.bankAccountInReview = bankAccount && bankAccount.isVerifying(); achData.domainLimit = 0; + achData.state = lodashGet(achData, 'state', ''); // If the bank account has already been created in the db and is not yet open // let's show the manual form with the previously added values From 62049474b1a681a5a68b89df6e5a7928b36c7981 Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Mon, 9 Aug 2021 11:20:02 -0600 Subject: [PATCH 4/9] move comment --- src/libs/actions/BankAccounts.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libs/actions/BankAccounts.js b/src/libs/actions/BankAccounts.js index cc01b979f4f4..789b171f83c7 100644 --- a/src/libs/actions/BankAccounts.js +++ b/src/libs/actions/BankAccounts.js @@ -330,9 +330,10 @@ function fetchUserWallet() { function fetchFreePlanVerifiedBankAccount(stepToOpen) { // We are using set here since we will rely on data from the server (not local data) to populate the VBA flow // and determine which step to navigate to. - // We temporarily keep the achData state to prevent UI changes while fetching. Onyx.set(ONYXKEYS.REIMBURSEMENT_ACCOUNT, { loading: true, + + // We temporarily keep the achData state to prevent UI changes while fetching. achData: {state: lodashGet(reimbursementAccountInSetup, 'state', '')}, }); let bankAccountID; From 13f06391b09287e28dfd6c55ad04aef0a846a75b Mon Sep 17 00:00:00 2001 From: Aman Ansar Date: Mon, 9 Aug 2021 23:13:33 +0530 Subject: [PATCH 5/9] stop adding duplicate members --- src/languages/en.js | 1 + src/languages/es.js | 1 + src/pages/workspace/WorkspaceInvitePage.js | 7 +++++++ 3 files changed, 9 insertions(+) diff --git a/src/languages/en.js b/src/languages/en.js index a2d9379d2a96..c39a2998c68b 100755 --- a/src/languages/en.js +++ b/src/languages/en.js @@ -586,6 +586,7 @@ export default { personalMessagePrompt: 'Add a Personal Message (Optional)', enterEmailOrPhone: 'Email or Phone', pleaseEnterValidLogin: 'Please ensure the email or phone number is valid (e.g. +15005550006).', + pleaseEnterUniqueLogin: 'That user is already a member of this workspace.', genericFailureMessage: 'An error occurred inviting the user to the workspace, please try again.', welcomeNote: ({workspaceName}) => `You have been invited to the ${workspaceName} Workspace! Download the Expensify mobile App to start tracking your expenses.`, }, diff --git a/src/languages/es.js b/src/languages/es.js index c93e0a4103e9..ac5426aed761 100644 --- a/src/languages/es.js +++ b/src/languages/es.js @@ -588,6 +588,7 @@ export default { personalMessagePrompt: 'Agregar un mensaje personal (Opcional)', enterEmailOrPhone: 'Email o teléfono', pleaseEnterValidLogin: 'Asegúrese de que el correo electrónico o el número de teléfono sean válidos (e.g. +15005550006).', + pleaseEnterUniqueLogin: 'Ese usuario ya es miembro de este espacio de trabajo.', genericFailureMessage: 'Se produjo un error al invitar al usuario al espacio de trabajo. Vuelva a intentarlo..', welcomeNote: ({workspaceName}) => `¡Has sido invitado a la ${workspaceName} Espacio de trabajo! Descargue la aplicación móvil Expensify para comenzar a rastrear sus gastos.`, }, diff --git a/src/pages/workspace/WorkspaceInvitePage.js b/src/pages/workspace/WorkspaceInvitePage.js index cd107c43c84a..f0be2cbfa7cf 100644 --- a/src/pages/workspace/WorkspaceInvitePage.js +++ b/src/pages/workspace/WorkspaceInvitePage.js @@ -4,6 +4,7 @@ import {TextInput, View, ScrollView} from 'react-native'; import {withOnyx} from 'react-native-onyx'; import Str from 'expensify-common/lib/str'; import _ from 'underscore'; +import lodashGet from 'lodash/get'; import withLocalize, {withLocalizePropTypes} from '../../components/withLocalize'; import ScreenWrapper from '../../components/ScreenWrapper'; import HeaderWithCloseButton from '../../components/HeaderWithCloseButton'; @@ -78,6 +79,12 @@ class WorkspaceInvitePage extends React.Component { Growl.error(this.props.translate('workspace.invite.pleaseEnterValidLogin'), 5000); return; } + const policyEmployeeList = lodashGet(this.props, 'policy.employeeList', []); + const AreLoginsDuplicate = _.every(logins, login => _.contains(policyEmployeeList, login)); + if (AreLoginsDuplicate) { + Growl.error(this.props.translate('workspace.invite.pleaseEnterUniqueLogin'), 5000); + return; + } invite(logins, this.state.welcomeNote || this.getWelcomeNotePlaceholder(), this.props.route.params.policyID); From e24e3fb956ac67f6c6003c57c7a0c22f979a64a6 Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Mon, 9 Aug 2021 12:58:54 -0600 Subject: [PATCH 6/9] add edge case comment --- src/libs/actions/BankAccounts.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/libs/actions/BankAccounts.js b/src/libs/actions/BankAccounts.js index 789b171f83c7..e9ed3ac640a7 100644 --- a/src/libs/actions/BankAccounts.js +++ b/src/libs/actions/BankAccounts.js @@ -407,6 +407,10 @@ function fetchFreePlanVerifiedBankAccount(stepToOpen) { achData.isInSetup = !bankAccount || bankAccount.isInSetup(); achData.bankAccountInReview = bankAccount && bankAccount.isVerifying(); achData.domainLimit = 0; + + // Adding a default empty state to make sure we override the temporary one we are keeping + // for UI purposes. This covers an edge case in which a user deleted their bank account, + // but would still see Finish Setup in the UI, instead of Get Started. achData.state = lodashGet(achData, 'state', ''); // If the bank account has already been created in the db and is not yet open From b40c801f1fe14fce3f5976c4a77c62d2a267f6d4 Mon Sep 17 00:00:00 2001 From: OSBotify Date: Wed, 11 Aug 2021 16:14:40 +0000 Subject: [PATCH 7/9] Update version to 1.0.83-2 --- android/app/build.gradle | 4 ++-- ios/ExpensifyCash/Info.plist | 2 +- ios/ExpensifyCashTests/Info.plist | 2 +- package-lock.json | 2 +- package.json | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index 3011237b1118..52a02d501736 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -150,8 +150,8 @@ android { minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion multiDexEnabled rootProject.ext.multiDexEnabled - versionCode 1001008301 - versionName "1.0.83-1" + versionCode 1001008302 + versionName "1.0.83-2" } splits { abi { diff --git a/ios/ExpensifyCash/Info.plist b/ios/ExpensifyCash/Info.plist index bb9717379d1b..ae4f4674d822 100644 --- a/ios/ExpensifyCash/Info.plist +++ b/ios/ExpensifyCash/Info.plist @@ -30,7 +30,7 @@ CFBundleVersion - 1.0.83.1 + 1.0.83.2 ITSAppUsesNonExemptEncryption LSApplicationQueriesSchemes diff --git a/ios/ExpensifyCashTests/Info.plist b/ios/ExpensifyCashTests/Info.plist index 88bbe4843316..8de36bb30369 100644 --- a/ios/ExpensifyCashTests/Info.plist +++ b/ios/ExpensifyCashTests/Info.plist @@ -19,6 +19,6 @@ CFBundleSignature ???? CFBundleVersion - 1.0.83.1 + 1.0.83.2 diff --git a/package-lock.json b/package-lock.json index 84acb501dd36..4c9c96b5b303 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "expensify.cash", - "version": "1.0.83-1", + "version": "1.0.83-2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 798875c8062f..69c3a6b15817 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "expensify.cash", - "version": "1.0.83-1", + "version": "1.0.83-2", "author": "Expensify, Inc.", "homepage": "https://new.expensify.com", "description": "Expensify.cash is the next generation of Expensify: a reimagination of payments based atop a foundation of chat.", From 132122d021db3f4ad6f749758863754d9575feda Mon Sep 17 00:00:00 2001 From: OSBotify Date: Wed, 11 Aug 2021 16:27:49 +0000 Subject: [PATCH 8/9] Update version to 1.0.83-3 --- android/app/build.gradle | 4 ++-- ios/ExpensifyCash/Info.plist | 2 +- ios/ExpensifyCashTests/Info.plist | 2 +- package-lock.json | 2 +- package.json | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index 52a02d501736..2fb803ae4c60 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -150,8 +150,8 @@ android { minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion multiDexEnabled rootProject.ext.multiDexEnabled - versionCode 1001008302 - versionName "1.0.83-2" + versionCode 1001008303 + versionName "1.0.83-3" } splits { abi { diff --git a/ios/ExpensifyCash/Info.plist b/ios/ExpensifyCash/Info.plist index ae4f4674d822..716346ea21e7 100644 --- a/ios/ExpensifyCash/Info.plist +++ b/ios/ExpensifyCash/Info.plist @@ -30,7 +30,7 @@ CFBundleVersion - 1.0.83.2 + 1.0.83.3 ITSAppUsesNonExemptEncryption LSApplicationQueriesSchemes diff --git a/ios/ExpensifyCashTests/Info.plist b/ios/ExpensifyCashTests/Info.plist index 8de36bb30369..85e03e179825 100644 --- a/ios/ExpensifyCashTests/Info.plist +++ b/ios/ExpensifyCashTests/Info.plist @@ -19,6 +19,6 @@ CFBundleSignature ???? CFBundleVersion - 1.0.83.2 + 1.0.83.3 diff --git a/package-lock.json b/package-lock.json index 4c9c96b5b303..9c01291dc872 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "expensify.cash", - "version": "1.0.83-2", + "version": "1.0.83-3", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 69c3a6b15817..8eac24afa217 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "expensify.cash", - "version": "1.0.83-2", + "version": "1.0.83-3", "author": "Expensify, Inc.", "homepage": "https://new.expensify.com", "description": "Expensify.cash is the next generation of Expensify: a reimagination of payments based atop a foundation of chat.", From 4fbb6d53f42964a7dd460f0cd2c812a94661c67b Mon Sep 17 00:00:00 2001 From: OSBotify Date: Wed, 11 Aug 2021 16:30:52 +0000 Subject: [PATCH 9/9] Update version to 1.0.83-4 --- android/app/build.gradle | 4 ++-- ios/ExpensifyCash/Info.plist | 2 +- ios/ExpensifyCashTests/Info.plist | 2 +- package-lock.json | 2 +- package.json | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index 2fb803ae4c60..aa334ee9934b 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -150,8 +150,8 @@ android { minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion multiDexEnabled rootProject.ext.multiDexEnabled - versionCode 1001008303 - versionName "1.0.83-3" + versionCode 1001008304 + versionName "1.0.83-4" } splits { abi { diff --git a/ios/ExpensifyCash/Info.plist b/ios/ExpensifyCash/Info.plist index 716346ea21e7..5e12486acc30 100644 --- a/ios/ExpensifyCash/Info.plist +++ b/ios/ExpensifyCash/Info.plist @@ -30,7 +30,7 @@ CFBundleVersion - 1.0.83.3 + 1.0.83.4 ITSAppUsesNonExemptEncryption LSApplicationQueriesSchemes diff --git a/ios/ExpensifyCashTests/Info.plist b/ios/ExpensifyCashTests/Info.plist index 85e03e179825..b501c8a4d25b 100644 --- a/ios/ExpensifyCashTests/Info.plist +++ b/ios/ExpensifyCashTests/Info.plist @@ -19,6 +19,6 @@ CFBundleSignature ???? CFBundleVersion - 1.0.83.3 + 1.0.83.4 diff --git a/package-lock.json b/package-lock.json index 9c01291dc872..941233211df8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "expensify.cash", - "version": "1.0.83-3", + "version": "1.0.83-4", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 8eac24afa217..70903c016b02 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "expensify.cash", - "version": "1.0.83-3", + "version": "1.0.83-4", "author": "Expensify, Inc.", "homepage": "https://new.expensify.com", "description": "Expensify.cash is the next generation of Expensify: a reimagination of payments based atop a foundation of chat.",