From d14f5987b3ae89cfa251124b4d65d9166b75aea1 Mon Sep 17 00:00:00 2001 From: Aman Ansar Date: Wed, 4 Aug 2021 04:35:09 +0530 Subject: [PATCH 001/200] add autofocus --- src/pages/workspace/WorkspaceInvitePage.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/pages/workspace/WorkspaceInvitePage.js b/src/pages/workspace/WorkspaceInvitePage.js index cd107c43c84a..d7bbd6879310 100644 --- a/src/pages/workspace/WorkspaceInvitePage.js +++ b/src/pages/workspace/WorkspaceInvitePage.js @@ -55,6 +55,7 @@ class WorkspaceInvitePage extends React.Component { }; this.inviteUser = this.inviteUser.bind(this); + this.emailOrPhoneInputRef = null; } /** @@ -86,7 +87,12 @@ class WorkspaceInvitePage extends React.Component { render() { return ( - + { + if (this.emailOrPhoneInputRef) { + this.emailOrPhoneInputRef.focus(); + } + }} + > this.emailOrPhoneInputRef = el} autoCompleteType="email" autoCorrect={false} autoCapitalize="none" From ddb7d7f1d8da6ea9fd95df921458f1b20e3fce62 Mon Sep 17 00:00:00 2001 From: Jack Nam Date: Wed, 4 Aug 2021 17:29:28 -0700 Subject: [PATCH 002/200] ping applause --- .github/actions/markPullRequestsAsDeployed/index.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/actions/markPullRequestsAsDeployed/index.js b/.github/actions/markPullRequestsAsDeployed/index.js index 0cdd013beb67..3737076d7375 100644 --- a/.github/actions/markPullRequestsAsDeployed/index.js +++ b/.github/actions/markPullRequestsAsDeployed/index.js @@ -153,12 +153,18 @@ function getPRDeployVerb(pr) { }); } -function getPRMessage(PR) { - return getPRDeployVerb(PR).then((deployVerb) => { +function getPRMessage(pr) { + return getPRDeployVerb(pr).then((deployVerb) => { let message = `🚀 [${deployVerb}](${workflowURL}) to ${isProd ? 'production' : 'staging'}\ in version: ${version}🚀`; message += `\n\n platform | result \n ---|--- \n🤖 android 🤖|${androidResult} \n🖥 desktop 🖥|${desktopResult}`; message += `\n🍎 iOS 🍎|${iOSResult} \n🕸 web 🕸|${webResult}`; + + const prData = PRMap[pr]; + if (deployVerb == 'Cherry-picked' && (/no qa/gi).test(prData.title)) { + message += `\n\nThe PR title did not include [No QA], so this likely is a CP that requires QA @Expensify/applauseleads`; + } + return message; }); } From 7d6f488430dff3701607a4d33dfed62115c0546a Mon Sep 17 00:00:00 2001 From: Jack Nam Date: Wed, 4 Aug 2021 17:32:52 -0700 Subject: [PATCH 003/200] copy over changes --- .github/actions/markPullRequestsAsDeployed/index.js | 4 ++-- .../markPullRequestsAsDeployed.js | 11 +++++++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/.github/actions/markPullRequestsAsDeployed/index.js b/.github/actions/markPullRequestsAsDeployed/index.js index 3737076d7375..5447289bc21d 100644 --- a/.github/actions/markPullRequestsAsDeployed/index.js +++ b/.github/actions/markPullRequestsAsDeployed/index.js @@ -161,8 +161,8 @@ function getPRMessage(pr) { message += `\n🍎 iOS 🍎|${iOSResult} \n🕸 web 🕸|${webResult}`; const prData = PRMap[pr]; - if (deployVerb == 'Cherry-picked' && (/no qa/gi).test(prData.title)) { - message += `\n\nThe PR title did not include [No QA], so this likely is a CP that requires QA @Expensify/applauseleads`; + if (deployVerb === 'Cherry-picked' && (/no qa/gi).test(prData.title)) { + message += `\n\nThe PR title did not include [No QA], so this likely is a CP that requires QA @Expensify/applauseleads`; } return message; diff --git a/.github/actions/markPullRequestsAsDeployed/markPullRequestsAsDeployed.js b/.github/actions/markPullRequestsAsDeployed/markPullRequestsAsDeployed.js index 4c5a3090ee7a..98e543a7337d 100644 --- a/.github/actions/markPullRequestsAsDeployed/markPullRequestsAsDeployed.js +++ b/.github/actions/markPullRequestsAsDeployed/markPullRequestsAsDeployed.js @@ -143,12 +143,19 @@ function getPRDeployVerb(pr) { }); } -function getPRMessage(PR) { - return getPRDeployVerb(PR).then((deployVerb) => { +function getPRMessage(pr) { + return getPRDeployVerb(pr).then((deployVerb) => { let message = `🚀 [${deployVerb}](${workflowURL}) to ${isProd ? 'production' : 'staging'}\ in version: ${version}🚀`; message += `\n\n platform | result \n ---|--- \n🤖 android 🤖|${androidResult} \n🖥 desktop 🖥|${desktopResult}`; message += `\n🍎 iOS 🍎|${iOSResult} \n🕸 web 🕸|${webResult}`; + + const prData = PRMap[pr]; + if (deployVerb === 'Cherry-picked' && (/no qa/gi).test(prData.title)) { + // eslint-disable-next-line max-len + message += '\n\nThe PR title did not include [No QA], so this likely is a CP that requires QA @Expensify/applauseleads'; + } + return message; }); } From b535022bd2bed861a5c34e2fdf3dcce581bf4f18 Mon Sep 17 00:00:00 2001 From: Jack Nam Date: Wed, 4 Aug 2021 17:36:10 -0700 Subject: [PATCH 004/200] take me home country road --- .github/actions/markPullRequestsAsDeployed/index.js | 2 +- .../markPullRequestsAsDeployed/markPullRequestsAsDeployed.js | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/actions/markPullRequestsAsDeployed/index.js b/.github/actions/markPullRequestsAsDeployed/index.js index 5447289bc21d..d73a4d8968bb 100644 --- a/.github/actions/markPullRequestsAsDeployed/index.js +++ b/.github/actions/markPullRequestsAsDeployed/index.js @@ -162,7 +162,7 @@ function getPRMessage(pr) { const prData = PRMap[pr]; if (deployVerb === 'Cherry-picked' && (/no qa/gi).test(prData.title)) { - message += `\n\nThe PR title did not include [No QA], so this likely is a CP that requires QA @Expensify/applauseleads`; + message += '\n\nThe PR title did not include [No QA], so this likely is a CP that requires QA @Expensify/applauseleads'; } return message; diff --git a/.github/actions/markPullRequestsAsDeployed/markPullRequestsAsDeployed.js b/.github/actions/markPullRequestsAsDeployed/markPullRequestsAsDeployed.js index 98e543a7337d..772e933a5960 100644 --- a/.github/actions/markPullRequestsAsDeployed/markPullRequestsAsDeployed.js +++ b/.github/actions/markPullRequestsAsDeployed/markPullRequestsAsDeployed.js @@ -152,7 +152,6 @@ function getPRMessage(pr) { const prData = PRMap[pr]; if (deployVerb === 'Cherry-picked' && (/no qa/gi).test(prData.title)) { - // eslint-disable-next-line max-len message += '\n\nThe PR title did not include [No QA], so this likely is a CP that requires QA @Expensify/applauseleads'; } From 81a0077aa2e69e62021ebb25e4e27ff8a658c3d1 Mon Sep 17 00:00:00 2001 From: Jack Nam Date: Wed, 4 Aug 2021 17:39:17 -0700 Subject: [PATCH 005/200] god damn max line lint --- .../markPullRequestsAsDeployed/markPullRequestsAsDeployed.js | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/actions/markPullRequestsAsDeployed/markPullRequestsAsDeployed.js b/.github/actions/markPullRequestsAsDeployed/markPullRequestsAsDeployed.js index 772e933a5960..98e543a7337d 100644 --- a/.github/actions/markPullRequestsAsDeployed/markPullRequestsAsDeployed.js +++ b/.github/actions/markPullRequestsAsDeployed/markPullRequestsAsDeployed.js @@ -152,6 +152,7 @@ function getPRMessage(pr) { const prData = PRMap[pr]; if (deployVerb === 'Cherry-picked' && (/no qa/gi).test(prData.title)) { + // eslint-disable-next-line max-len message += '\n\nThe PR title did not include [No QA], so this likely is a CP that requires QA @Expensify/applauseleads'; } From 91b218e84e7b65dc33aefecd60e6f5294a29d206 Mon Sep 17 00:00:00 2001 From: Jack Nam Date: Wed, 4 Aug 2021 17:39:25 -0700 Subject: [PATCH 006/200] Update index.js --- .github/actions/markPullRequestsAsDeployed/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/actions/markPullRequestsAsDeployed/index.js b/.github/actions/markPullRequestsAsDeployed/index.js index d73a4d8968bb..63c1e03fbde6 100644 --- a/.github/actions/markPullRequestsAsDeployed/index.js +++ b/.github/actions/markPullRequestsAsDeployed/index.js @@ -162,6 +162,7 @@ function getPRMessage(pr) { const prData = PRMap[pr]; if (deployVerb === 'Cherry-picked' && (/no qa/gi).test(prData.title)) { + // eslint-disable-next-line max-len message += '\n\nThe PR title did not include [No QA], so this likely is a CP that requires QA @Expensify/applauseleads'; } From 951c3765ac798ec8de9a5d4462ecb07c17831ac1 Mon Sep 17 00:00:00 2001 From: Jack Nam Date: Wed, 4 Aug 2021 21:26:35 -0700 Subject: [PATCH 007/200] flip conditional --- .github/actions/markPullRequestsAsDeployed/index.js | 4 ++-- .../markPullRequestsAsDeployed/markPullRequestsAsDeployed.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/actions/markPullRequestsAsDeployed/index.js b/.github/actions/markPullRequestsAsDeployed/index.js index 63c1e03fbde6..c21b94e4958e 100644 --- a/.github/actions/markPullRequestsAsDeployed/index.js +++ b/.github/actions/markPullRequestsAsDeployed/index.js @@ -161,9 +161,9 @@ function getPRMessage(pr) { message += `\n🍎 iOS 🍎|${iOSResult} \n🕸 web 🕸|${webResult}`; const prData = PRMap[pr]; - if (deployVerb === 'Cherry-picked' && (/no qa/gi).test(prData.title)) { + if (deployVerb === 'Cherry-picked' && !(/no qa/gi).test(prData.title)) { // eslint-disable-next-line max-len - message += '\n\nThe PR title did not include [No QA], so this likely is a CP that requires QA @Expensify/applauseleads'; + message += '\n\nThe PR title did not include [No QA], so this CP requires QA @Expensify/applauseleads'; } return message; diff --git a/.github/actions/markPullRequestsAsDeployed/markPullRequestsAsDeployed.js b/.github/actions/markPullRequestsAsDeployed/markPullRequestsAsDeployed.js index 98e543a7337d..f6c1479edbda 100644 --- a/.github/actions/markPullRequestsAsDeployed/markPullRequestsAsDeployed.js +++ b/.github/actions/markPullRequestsAsDeployed/markPullRequestsAsDeployed.js @@ -151,9 +151,9 @@ function getPRMessage(pr) { message += `\n🍎 iOS 🍎|${iOSResult} \n🕸 web 🕸|${webResult}`; const prData = PRMap[pr]; - if (deployVerb === 'Cherry-picked' && (/no qa/gi).test(prData.title)) { + if (deployVerb === 'Cherry-picked' && !(/no qa/gi).test(prData.title)) { // eslint-disable-next-line max-len - message += '\n\nThe PR title did not include [No QA], so this likely is a CP that requires QA @Expensify/applauseleads'; + message += '\n\nThe PR title did not include [No QA], so this CP requires QA @Expensify/applauseleads'; } return message; From c64aeff2ae2ff6a27f3d54365608b9710761fbee Mon Sep 17 00:00:00 2001 From: Amal Nazeem Date: Mon, 9 Aug 2021 12:59:37 -0400 Subject: [PATCH 008/200] Add new routes --- src/ROUTES.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/ROUTES.js b/src/ROUTES.js index bbe1883d441e..216444029cf7 100644 --- a/src/ROUTES.js +++ b/src/ROUTES.js @@ -70,6 +70,8 @@ export default { // when linking users from e.com in order to share a session in this app. VALIDATE_LOGIN_WITH_VALIDATE_CODE_NEW_WORKSPACE: 'v/:accountID/:validateCode/new-workspace', VALIDATE_LOGIN_WITH_VALIDATE_CODE_2FA_NEW_WORKSPACE: 'v/:accountID/:validateCode/2fa/new-workspace', + VALIDATE_LOGIN_WITH_VALIDATE_CODE_WORKSPACE_CARD: 'v/:accountID/:validateCode/workspace/:policyID/card', + VALIDATE_LOGIN_WITH_VALIDATE_CODE_2FA_WORKSPACE_CARD: 'v/:accountID/:validateCode/2fa/workspace/:policyID/card', ENABLE_PAYMENTS: 'enable-payments', WORKSPACE_NEW: 'workspace/new', WORKSPACE: 'workspace', From d5b58c123b891ae3384aaed23570d7720a7908f2 Mon Sep 17 00:00:00 2001 From: Amal Nazeem Date: Mon, 9 Aug 2021 21:04:18 -0400 Subject: [PATCH 009/200] Add workspace_card route to be available when validating login and redirecting --- src/SCREENS.js | 2 ++ src/libs/Navigation/AppNavigator/AuthScreens.js | 10 ++++++++++ src/libs/Navigation/AppNavigator/PublicScreens.js | 10 ++++++++++ src/libs/Navigation/linkingConfig.js | 2 ++ src/pages/ValidateLogin2FANewWorkspacePage.js | 7 ++++++- src/pages/ValidateLoginNewWorkspacePage.js | 8 +++++++- 6 files changed, 37 insertions(+), 2 deletions(-) diff --git a/src/SCREENS.js b/src/SCREENS.js index 521e5a471852..a1a74ce5c3c9 100644 --- a/src/SCREENS.js +++ b/src/SCREENS.js @@ -8,4 +8,6 @@ export default { REPORT: 'Report', VALIDATE_LOGIN_NEW_WORKSPACE: 'ValidateLoginNewWorkspace', VALIDATE_LOGIN_2FA_NEW_WORKSPACE: 'ValidateLogin2FANewWorkspace', + VALIDATE_LOGIN_WORKSPACE_CARD: 'ValidateLoginWorkspaceCard', + VALIDATE_LOGIN_2FA_WORKSPACE_CARD: 'ValidateLogin2FAWorkspaceCard', }; diff --git a/src/libs/Navigation/AppNavigator/AuthScreens.js b/src/libs/Navigation/AppNavigator/AuthScreens.js index 5ba802e792bf..ec1b675b3934 100644 --- a/src/libs/Navigation/AppNavigator/AuthScreens.js +++ b/src/libs/Navigation/AppNavigator/AuthScreens.js @@ -291,6 +291,16 @@ class AuthScreens extends React.Component { options={defaultScreenOptions} component={ValidateLogin2FANewWorkspacePage} /> + + {/* These are the various modal routes */} {/* Note: Each modal must have it's own stack navigator since we want to be able to navigate to any diff --git a/src/libs/Navigation/AppNavigator/PublicScreens.js b/src/libs/Navigation/AppNavigator/PublicScreens.js index bfe32607bdcf..278e4ee0938b 100644 --- a/src/libs/Navigation/AppNavigator/PublicScreens.js +++ b/src/libs/Navigation/AppNavigator/PublicScreens.js @@ -42,5 +42,15 @@ export default () => ( options={defaultScreenOptions} component={ValidateLogin2FANewWorkspacePage} /> + + ); diff --git a/src/libs/Navigation/linkingConfig.js b/src/libs/Navigation/linkingConfig.js index cf3c57b07ac6..6549bf2cf43e 100644 --- a/src/libs/Navigation/linkingConfig.js +++ b/src/libs/Navigation/linkingConfig.js @@ -29,6 +29,8 @@ export default { ValidateLogin: ROUTES.VALIDATE_LOGIN_WITH_VALIDATE_CODE, [SCREENS.VALIDATE_LOGIN_NEW_WORKSPACE]: ROUTES.VALIDATE_LOGIN_WITH_VALIDATE_CODE_NEW_WORKSPACE, [SCREENS.VALIDATE_LOGIN_2FA_NEW_WORKSPACE]: ROUTES.VALIDATE_LOGIN_WITH_VALIDATE_CODE_2FA_NEW_WORKSPACE, + [SCREENS.VALIDATE_LOGIN_WORKSPACE_CARD]: ROUTES.VALIDATE_LOGIN_WITH_VALIDATE_CODE_WORKSPACE_CARD, + [SCREENS.VALIDATE_LOGIN_2FA_WORKSPACE_CARD]: ROUTES.VALIDATE_LOGIN_WITH_VALIDATE_CODE_2FA_WORKSPACE_CARD, // Modal Screens Settings: { diff --git a/src/pages/ValidateLogin2FANewWorkspacePage.js b/src/pages/ValidateLogin2FANewWorkspacePage.js index 6e9c07d44b9b..001f9abda145 100644 --- a/src/pages/ValidateLogin2FANewWorkspacePage.js +++ b/src/pages/ValidateLogin2FANewWorkspacePage.js @@ -49,6 +49,7 @@ class ValidateLogin2FANewWorkspacePage extends Component { super(props); this.validateAndSubmitForm = this.validateAndSubmitForm.bind(this); + console.log(props); this.state = { twoFactorAuthCode: '', @@ -70,8 +71,12 @@ class ValidateLogin2FANewWorkspacePage extends Component { if (_.isEmpty(this.props.betas)) { setRedirectToWorkspaceNewAfterSignIn(true); - } else { + } else if (this.props.route.name === SCREENS.VALIDATE_LOGIN_WORKSPACE_CARD) { + Navigation.navigate(ROUTES.getWorkspaceCardRoute(this.props.route.params.policyID)); + } else if (this.props.route.name === SCREENS.VALIDATE_LOGIN_NEW_WORKSPACE) { Navigation.navigate(ROUTES.WORKSPACE_NEW); + } else { + Navigation.navigate(ROUTES.HOME); } } } diff --git a/src/pages/ValidateLoginNewWorkspacePage.js b/src/pages/ValidateLoginNewWorkspacePage.js index 864d742dd8b9..dd033ced372e 100644 --- a/src/pages/ValidateLoginNewWorkspacePage.js +++ b/src/pages/ValidateLoginNewWorkspacePage.js @@ -8,6 +8,7 @@ import compose from '../libs/compose'; import ONYXKEYS from '../ONYXKEYS'; import Navigation from '../libs/Navigation/Navigation'; import ROUTES from '../ROUTES'; +import SCREENS from '../SCREENS'; import {continueSessionFromECom, setRedirectToWorkspaceNewAfterSignIn} from '../libs/actions/Session'; @@ -36,6 +37,7 @@ const defaultProps = { }; class ValidateLoginNewWorkspacePage extends Component { componentDidMount() { + console.log(this.props); // If the user has an active session already, they need to be redirected straight to the new workspace page if (this.props.session.authToken) { // In order to navigate to a modal, we first have to dismiss the current modal. But there is no current @@ -47,8 +49,12 @@ class ValidateLoginNewWorkspacePage extends Component { Navigation.dismissModal(); if (_.isEmpty(this.props.betas)) { setRedirectToWorkspaceNewAfterSignIn(true); - } else { + } else if (this.props.route.name === SCREENS.VALIDATE_LOGIN_WORKSPACE_CARD) { + Navigation.navigate(ROUTES.getWorkspaceCardRoute(this.props.route.params.policyID)); + } else if (this.props.route.name === SCREENS.VALIDATE_LOGIN_NEW_WORKSPACE) { Navigation.navigate(ROUTES.WORKSPACE_NEW); + } else { + Navigation.navigate(ROUTES.HOME); } return; } From 38d8a24a2435c8f50068e944eed93ee7f657f4b4 Mon Sep 17 00:00:00 2001 From: Amal Nazeem Date: Mon, 9 Aug 2021 21:13:34 -0400 Subject: [PATCH 010/200] remove console statements and add missing import --- src/pages/ValidateLogin2FANewWorkspacePage.js | 2 +- src/pages/ValidateLoginNewWorkspacePage.js | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/pages/ValidateLogin2FANewWorkspacePage.js b/src/pages/ValidateLogin2FANewWorkspacePage.js index 001f9abda145..2f5d38687cf9 100644 --- a/src/pages/ValidateLogin2FANewWorkspacePage.js +++ b/src/pages/ValidateLogin2FANewWorkspacePage.js @@ -18,6 +18,7 @@ import compose from '../libs/compose'; import ONYXKEYS from '../ONYXKEYS'; import Navigation from '../libs/Navigation/Navigation'; import ROUTES from '../ROUTES'; +import SCREENS from '../SCREENS'; const propTypes = { /* Onyx Props */ @@ -49,7 +50,6 @@ class ValidateLogin2FANewWorkspacePage extends Component { super(props); this.validateAndSubmitForm = this.validateAndSubmitForm.bind(this); - console.log(props); this.state = { twoFactorAuthCode: '', diff --git a/src/pages/ValidateLoginNewWorkspacePage.js b/src/pages/ValidateLoginNewWorkspacePage.js index dd033ced372e..01c1b66ded1f 100644 --- a/src/pages/ValidateLoginNewWorkspacePage.js +++ b/src/pages/ValidateLoginNewWorkspacePage.js @@ -37,7 +37,6 @@ const defaultProps = { }; class ValidateLoginNewWorkspacePage extends Component { componentDidMount() { - console.log(this.props); // If the user has an active session already, they need to be redirected straight to the new workspace page if (this.props.session.authToken) { // In order to navigate to a modal, we first have to dismiss the current modal. But there is no current From 7d68706cb9ab02d4dcef8a80f59d9d89c4850454 Mon Sep 17 00:00:00 2001 From: Clem Dal Palu Date: Tue, 10 Aug 2021 10:56:53 +0200 Subject: [PATCH 011/200] Fix the text style in about page --- src/pages/settings/AboutPage.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/settings/AboutPage.js b/src/pages/settings/AboutPage.js index 03706a6d0cdf..3e23e166493e 100644 --- a/src/pages/settings/AboutPage.js +++ b/src/pages/settings/AboutPage.js @@ -102,7 +102,7 @@ const AboutPage = ({translate, session}) => { v {version} - + {translate('initialSettingsPage.aboutPage.description')} From b9dc99db31aacd19af8f29f7d9d7db873eb791b6 Mon Sep 17 00:00:00 2001 From: Clem Dal Palu Date: Tue, 10 Aug 2021 11:47:45 +0200 Subject: [PATCH 012/200] Change wording to have a better alignment of text --- src/languages/en.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/languages/en.js b/src/languages/en.js index 409468da619e..9d0f1800652d 100755 --- a/src/languages/en.js +++ b/src/languages/en.js @@ -215,7 +215,7 @@ export default { initialSettingsPage: { about: 'About', aboutPage: { - description: 'The New Expensify is built by a community of open source developers from around the world. Come help us build the next generation of Expensify.', + description: 'The New Expensify is built by a community of open source developers from around the world. Help us build the next generation of Expensify.', appDownloadLinks: 'App download links', viewTheCode: 'View the code', viewOpenJobs: 'View open jobs', From ee2e2203f3280ae029185843a88170aee60af3b0 Mon Sep 17 00:00:00 2001 From: Amal Nazeem Date: Tue, 10 Aug 2021 13:12:29 -0400 Subject: [PATCH 013/200] Update uses to remove VALIDATE_ since we aren't validating logins --- src/ROUTES.js | 8 ++++---- src/SCREENS.js | 8 ++++---- src/libs/Navigation/AppNavigator/AuthScreens.js | 8 ++++---- src/libs/Navigation/AppNavigator/PublicScreens.js | 8 ++++---- src/libs/Navigation/linkingConfig.js | 8 ++++---- src/pages/ValidateLogin2FANewWorkspacePage.js | 4 ++-- src/pages/ValidateLoginNewWorkspacePage.js | 4 ++-- 7 files changed, 24 insertions(+), 24 deletions(-) diff --git a/src/ROUTES.js b/src/ROUTES.js index 41756a3334dd..4b6930110ade 100644 --- a/src/ROUTES.js +++ b/src/ROUTES.js @@ -70,10 +70,10 @@ export default { // This is a special validation URL that will take the user to /workspace/new after validation. This is used // when linking users from e.com in order to share a session in this app. - VALIDATE_LOGIN_WITH_VALIDATE_CODE_NEW_WORKSPACE: 'v/:accountID/:validateCode/new-workspace', - VALIDATE_LOGIN_WITH_VALIDATE_CODE_2FA_NEW_WORKSPACE: 'v/:accountID/:validateCode/2fa/new-workspace', - VALIDATE_LOGIN_WITH_VALIDATE_CODE_WORKSPACE_CARD: 'v/:accountID/:validateCode/workspace/:policyID/card', - VALIDATE_LOGIN_WITH_VALIDATE_CODE_2FA_WORKSPACE_CARD: 'v/:accountID/:validateCode/2fa/workspace/:policyID/card', + LOGIN_WITH_VALIDATE_CODE_NEW_WORKSPACE: 'v/:accountID/:validateCode/new-workspace', + LOGIN_WITH_VALIDATE_CODE_2FA_NEW_WORKSPACE: 'v/:accountID/:validateCode/2fa/new-workspace', + LOGIN_WITH_VALIDATE_CODE_WORKSPACE_CARD: 'v/:accountID/:validateCode/workspace/:policyID/card', + LOGIN_WITH_VALIDATE_CODE_2FA_WORKSPACE_CARD: 'v/:accountID/:validateCode/2fa/workspace/:policyID/card', ENABLE_PAYMENTS: 'enable-payments', WORKSPACE_NEW: 'workspace/new', WORKSPACE: 'workspace', diff --git a/src/SCREENS.js b/src/SCREENS.js index a1a74ce5c3c9..fdd2e6c867ac 100644 --- a/src/SCREENS.js +++ b/src/SCREENS.js @@ -6,8 +6,8 @@ export default { HOME: 'Home', LOADING: 'Loading', REPORT: 'Report', - VALIDATE_LOGIN_NEW_WORKSPACE: 'ValidateLoginNewWorkspace', - VALIDATE_LOGIN_2FA_NEW_WORKSPACE: 'ValidateLogin2FANewWorkspace', - VALIDATE_LOGIN_WORKSPACE_CARD: 'ValidateLoginWorkspaceCard', - VALIDATE_LOGIN_2FA_WORKSPACE_CARD: 'ValidateLogin2FAWorkspaceCard', + LOGIN_REDIRECT_NEW_WORKSPACE: 'LoginRedirectNewWorkspace', + LOGIN_REDIRECT_2FA_NEW_WORKSPACE: 'LoginRedirect2FANewWorkspace', + LOGIN_REDIRECT_WORKSPACE_CARD: 'LoginRedirectWorkspaceCard', + LOGIN_REDIRECT_2FA_WORKSPACE_CARD: 'LoginRedirect2FAWorkspaceCard', }; diff --git a/src/libs/Navigation/AppNavigator/AuthScreens.js b/src/libs/Navigation/AppNavigator/AuthScreens.js index b7ed1adb4597..b4edcdb7a656 100644 --- a/src/libs/Navigation/AppNavigator/AuthScreens.js +++ b/src/libs/Navigation/AppNavigator/AuthScreens.js @@ -299,22 +299,22 @@ class AuthScreens extends React.Component { component={ValidateLoginPage} /> diff --git a/src/libs/Navigation/AppNavigator/PublicScreens.js b/src/libs/Navigation/AppNavigator/PublicScreens.js index 278e4ee0938b..f114dcd72daa 100644 --- a/src/libs/Navigation/AppNavigator/PublicScreens.js +++ b/src/libs/Navigation/AppNavigator/PublicScreens.js @@ -33,22 +33,22 @@ export default () => ( component={PublicWorkspaceNewView} /> diff --git a/src/libs/Navigation/linkingConfig.js b/src/libs/Navigation/linkingConfig.js index 91c32fec5211..20e32613bafb 100644 --- a/src/libs/Navigation/linkingConfig.js +++ b/src/libs/Navigation/linkingConfig.js @@ -27,10 +27,10 @@ export default { // Public Routes SetPassword: ROUTES.SET_PASSWORD_WITH_VALIDATE_CODE, ValidateLogin: ROUTES.VALIDATE_LOGIN_WITH_VALIDATE_CODE, - [SCREENS.VALIDATE_LOGIN_NEW_WORKSPACE]: ROUTES.VALIDATE_LOGIN_WITH_VALIDATE_CODE_NEW_WORKSPACE, - [SCREENS.VALIDATE_LOGIN_2FA_NEW_WORKSPACE]: ROUTES.VALIDATE_LOGIN_WITH_VALIDATE_CODE_2FA_NEW_WORKSPACE, - [SCREENS.VALIDATE_LOGIN_WORKSPACE_CARD]: ROUTES.VALIDATE_LOGIN_WITH_VALIDATE_CODE_WORKSPACE_CARD, - [SCREENS.VALIDATE_LOGIN_2FA_WORKSPACE_CARD]: ROUTES.VALIDATE_LOGIN_WITH_VALIDATE_CODE_2FA_WORKSPACE_CARD, + [SCREENS.LOGIN_REDIRECT_NEW_WORKSPACE]: ROUTES.LOGIN_WITH_VALIDATE_CODE_NEW_WORKSPACE, + [SCREENS.LOGIN_REDIRECT_2FA_NEW_WORKSPACE]: ROUTES.LOGIN_WITH_VALIDATE_CODE_2FA_NEW_WORKSPACE, + [SCREENS.LOGIN_REDIRECT_WORKSPACE_CARD]: ROUTES.LOGIN_WITH_VALIDATE_CODE_WORKSPACE_CARD, + [SCREENS.LOGIN_REDIRECT_2FA_WORKSPACE_CARD]: ROUTES.LOGIN_WITH_VALIDATE_CODE_2FA_WORKSPACE_CARD, // Modal Screens Settings: { diff --git a/src/pages/ValidateLogin2FANewWorkspacePage.js b/src/pages/ValidateLogin2FANewWorkspacePage.js index eb7ae1360710..3ca4fd142bc5 100644 --- a/src/pages/ValidateLogin2FANewWorkspacePage.js +++ b/src/pages/ValidateLogin2FANewWorkspacePage.js @@ -71,9 +71,9 @@ class ValidateLogin2FANewWorkspacePage extends Component { if (_.isEmpty(this.props.betas)) { setRedirectToWorkspaceNewAfterSignIn(true); - } else if (this.props.route.name === SCREENS.VALIDATE_LOGIN_WORKSPACE_CARD) { + } else if (this.props.route.name === SCREENS.LOGIN_REDIRECT_2FA_WORKSPACE_CARD) { Navigation.navigate(ROUTES.getWorkspaceCardRoute(this.props.route.params.policyID)); - } else if (this.props.route.name === SCREENS.VALIDATE_LOGIN_NEW_WORKSPACE) { + } else if (this.props.route.name === SCREENS.LOGIN_REDIRECT_2FA_NEW_WORKSPACE) { Navigation.navigate(ROUTES.WORKSPACE_NEW); } else { Navigation.navigate(ROUTES.HOME); diff --git a/src/pages/ValidateLoginNewWorkspacePage.js b/src/pages/ValidateLoginNewWorkspacePage.js index 6c9abe6299ee..78cb09a999b6 100644 --- a/src/pages/ValidateLoginNewWorkspacePage.js +++ b/src/pages/ValidateLoginNewWorkspacePage.js @@ -47,9 +47,9 @@ class ValidateLoginNewWorkspacePage extends Component { Navigation.dismissModal(); if (_.isEmpty(this.props.betas)) { setRedirectToWorkspaceNewAfterSignIn(true); - } else if (this.props.route.name === SCREENS.VALIDATE_LOGIN_WORKSPACE_CARD) { + } else if (this.props.route.name === SCREENS.LOGIN_REDIRECT_WORKSPACE_CARD) { Navigation.navigate(ROUTES.getWorkspaceCardRoute(this.props.route.params.policyID)); - } else if (this.props.route.name === SCREENS.VALIDATE_LOGIN_NEW_WORKSPACE) { + } else if (this.props.route.name === SCREENS.LOGIN_REDIRECT_NEW_WORKSPACE) { Navigation.navigate(ROUTES.WORKSPACE_NEW); } else { Navigation.navigate(ROUTES.HOME); From 0bec93524535cf2e3cec350b518443c87fdb5ab6 Mon Sep 17 00:00:00 2001 From: Amal Nazeem Date: Tue, 10 Aug 2021 15:22:03 -0400 Subject: [PATCH 014/200] Rename to redirectAfterSignIn so flag is generic to all validateCodeLogin routes --- src/Expensify.js | 10 +++++----- src/libs/actions/Session.js | 8 ++++---- src/pages/ValidateLogin2FANewWorkspacePage.js | 4 ++-- src/pages/ValidateLoginNewWorkspacePage.js | 4 ++-- src/pages/workspace/PublicWorkspaceNewView.js | 4 ++-- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/Expensify.js b/src/Expensify.js index 60134552bde4..811bffce0a7c 100644 --- a/src/Expensify.js +++ b/src/Expensify.js @@ -19,7 +19,7 @@ import {growlRef} from './libs/Growl'; import Navigation from './libs/Navigation/Navigation'; import ROUTES from './ROUTES'; import StartupTimer from './libs/StartupTimer'; -import {setRedirectToWorkspaceNewAfterSignIn} from './libs/actions/Session'; +import {setRedirectAfterSign} from './libs/actions/Session'; const propTypes = { /* Onyx Props */ @@ -34,7 +34,7 @@ const propTypes = { accountID: PropTypes.number, /** Should app immediately redirect to new workspace route once authenticated */ - redirectToWorkspaceNewAfterSignIn: PropTypes.bool, + redirectAfterSignIn: PropTypes.bool, }), /** Whether a new update is available and ready to install. */ @@ -54,7 +54,7 @@ const defaultProps = { session: { authToken: null, accountID: null, - redirectToWorkspaceNewAfterSignIn: false, + redirectAfterSignIn: false, }, updateAvailable: false, initialReportDataLoaded: false, @@ -114,8 +114,8 @@ class Expensify extends PureComponent { if (this.getAuthToken() && !_.isEmpty(this.props.betas) - && lodashGet(this.props, 'session.redirectToWorkspaceNewAfterSignIn', false)) { - setRedirectToWorkspaceNewAfterSignIn(false); + && lodashGet(this.props, 'session.redirectAfterSignIn', false)) { + setRedirectAfterSign(false); Navigation.navigate(ROUTES.WORKSPACE_NEW); } diff --git a/src/libs/actions/Session.js b/src/libs/actions/Session.js index eeb303a25c54..477e8a9b369f 100644 --- a/src/libs/actions/Session.js +++ b/src/libs/actions/Session.js @@ -304,12 +304,12 @@ function continueSessionFromECom(accountID, validateCode, twoFactorAuthCode) { } /** - * Sets the redirectToWorkspaceNewAfterSignIn flag in the session variable + * Sets the redirectAfterSignIn flag in the session variable * * @param {Boolean} shouldRedirect */ -function setRedirectToWorkspaceNewAfterSignIn(shouldRedirect) { - Onyx.merge(ONYXKEYS.SESSION, {redirectToWorkspaceNewAfterSignIn: shouldRedirect}); +function setRedirectAfterSign(shouldRedirect) { + Onyx.merge(ONYXKEYS.SESSION, {redirectAfterSignIn: shouldRedirect}); } export { @@ -322,5 +322,5 @@ export { resendValidationLink, resetPassword, restartSignin, - setRedirectToWorkspaceNewAfterSignIn, + setRedirectAfterSign, }; diff --git a/src/pages/ValidateLogin2FANewWorkspacePage.js b/src/pages/ValidateLogin2FANewWorkspacePage.js index 3ca4fd142bc5..36a71e029b2f 100644 --- a/src/pages/ValidateLogin2FANewWorkspacePage.js +++ b/src/pages/ValidateLogin2FANewWorkspacePage.js @@ -6,7 +6,7 @@ import {withOnyx} from 'react-native-onyx'; import _ from 'underscore'; import withLocalize, {withLocalizePropTypes} from '../components/withLocalize'; import validateLinkPropTypes from './validateLinkPropTypes'; -import {continueSessionFromECom, setRedirectToWorkspaceNewAfterSignIn} from '../libs/actions/Session'; +import {continueSessionFromECom, setRedirectAfterSign} from '../libs/actions/Session'; import styles from '../styles/styles'; import ExpensifyCashLogo from '../components/ExpensifyCashLogo'; import variables from '../styles/variables'; @@ -70,7 +70,7 @@ class ValidateLogin2FANewWorkspacePage extends Component { Navigation.dismissModal(); if (_.isEmpty(this.props.betas)) { - setRedirectToWorkspaceNewAfterSignIn(true); + setRedirectAfterSign(true); } else if (this.props.route.name === SCREENS.LOGIN_REDIRECT_2FA_WORKSPACE_CARD) { Navigation.navigate(ROUTES.getWorkspaceCardRoute(this.props.route.params.policyID)); } else if (this.props.route.name === SCREENS.LOGIN_REDIRECT_2FA_NEW_WORKSPACE) { diff --git a/src/pages/ValidateLoginNewWorkspacePage.js b/src/pages/ValidateLoginNewWorkspacePage.js index 78cb09a999b6..f88406b6e200 100644 --- a/src/pages/ValidateLoginNewWorkspacePage.js +++ b/src/pages/ValidateLoginNewWorkspacePage.js @@ -9,7 +9,7 @@ import ONYXKEYS from '../ONYXKEYS'; import Navigation from '../libs/Navigation/Navigation'; import ROUTES from '../ROUTES'; import SCREENS from '../SCREENS'; -import {continueSessionFromECom, setRedirectToWorkspaceNewAfterSignIn} from '../libs/actions/Session'; +import {continueSessionFromECom, setRedirectAfterSign} from '../libs/actions/Session'; const propTypes = { /* Onyx Props */ @@ -46,7 +46,7 @@ class ValidateLoginNewWorkspacePage extends Component { // if they cancel out of the new workspace modal. Navigation.dismissModal(); if (_.isEmpty(this.props.betas)) { - setRedirectToWorkspaceNewAfterSignIn(true); + setRedirectAfterSign(true); } else if (this.props.route.name === SCREENS.LOGIN_REDIRECT_WORKSPACE_CARD) { Navigation.navigate(ROUTES.getWorkspaceCardRoute(this.props.route.params.policyID)); } else if (this.props.route.name === SCREENS.LOGIN_REDIRECT_NEW_WORKSPACE) { diff --git a/src/pages/workspace/PublicWorkspaceNewView.js b/src/pages/workspace/PublicWorkspaceNewView.js index 3d4a62f581a7..53856e2f9a37 100644 --- a/src/pages/workspace/PublicWorkspaceNewView.js +++ b/src/pages/workspace/PublicWorkspaceNewView.js @@ -1,7 +1,7 @@ import React from 'react'; import PropTypes from 'prop-types'; import SCREENS from '../../SCREENS'; -import {setRedirectToWorkspaceNewAfterSignIn} from '../../libs/actions/Session'; +import {setRedirectAfterSign} from '../../libs/actions/Session'; const propTypes = { /** react-navigation navigation object available to screen components */ @@ -13,7 +13,7 @@ const propTypes = { class PublicWorkspaceNewView extends React.PureComponent { componentDidMount() { - setRedirectToWorkspaceNewAfterSignIn(true); + setRedirectAfterSign(true); this.props.navigation.replace(SCREENS.HOME); } From 6d2007420de8f13dbfe7d9f4d6bcce946991f81d Mon Sep 17 00:00:00 2001 From: Amal Nazeem Date: Tue, 10 Aug 2021 16:23:16 -0400 Subject: [PATCH 015/200] Rename component and constants to match generic functionality of logging with validate code --- src/SCREENS.js | 8 ++++---- .../Navigation/AppNavigator/AuthScreens.js | 20 +++++++++---------- .../Navigation/AppNavigator/PublicScreens.js | 20 +++++++++---------- src/libs/Navigation/linkingConfig.js | 8 ++++---- src/pages/ValidateLogin2FANewWorkspacePage.js | 14 ++++++------- src/pages/ValidateLoginNewWorkspacePage.js | 14 ++++++------- 6 files changed, 42 insertions(+), 42 deletions(-) diff --git a/src/SCREENS.js b/src/SCREENS.js index fdd2e6c867ac..764965e7335c 100644 --- a/src/SCREENS.js +++ b/src/SCREENS.js @@ -6,8 +6,8 @@ export default { HOME: 'Home', LOADING: 'Loading', REPORT: 'Report', - LOGIN_REDIRECT_NEW_WORKSPACE: 'LoginRedirectNewWorkspace', - LOGIN_REDIRECT_2FA_NEW_WORKSPACE: 'LoginRedirect2FANewWorkspace', - LOGIN_REDIRECT_WORKSPACE_CARD: 'LoginRedirectWorkspaceCard', - LOGIN_REDIRECT_2FA_WORKSPACE_CARD: 'LoginRedirect2FAWorkspaceCard', + LOGIN_WITH_VALIDATE_CODE_NEW_WORKSPACE: 'LoginWithValidateCodeNewWorkspace', + LOGIN_WITH_VALIDATE_CODE_2FA_NEW_WORKSPACE: 'LoginWithValidateCode2FANewWorkspace', + LOGIN_WITH_VALIDATE_CODE_WORKSPACE_CARD: 'LoginWithValidateCodeWorkspaceCard', + LOGIN_WITH_VALIDATE_CODE_2FA_WORKSPACE_CARD: 'LoginWithValidateCode2FAWorkspaceCard', }; diff --git a/src/libs/Navigation/AppNavigator/AuthScreens.js b/src/libs/Navigation/AppNavigator/AuthScreens.js index b4edcdb7a656..811741e535c6 100644 --- a/src/libs/Navigation/AppNavigator/AuthScreens.js +++ b/src/libs/Navigation/AppNavigator/AuthScreens.js @@ -62,8 +62,8 @@ import { } from './ModalStackNavigators'; import SCREENS from '../../../SCREENS'; import Timers from '../../Timers'; -import ValidateLoginNewWorkspacePage from '../../../pages/ValidateLoginNewWorkspacePage'; -import ValidateLogin2FANewWorkspacePage from '../../../pages/ValidateLogin2FANewWorkspacePage'; +import LoginWithValidateCodePage from '../../../pages/ValidateLoginNewWorkspacePage'; +import LoginWithValidateCode2FAPage from '../../../pages/LoginWithValidateCode2FAPage'; import WorkspaceSettingsDrawerNavigator from './WorkspaceSettingsDrawerNavigator'; import spacing from '../../../styles/utilities/spacing'; import CardOverlay from '../../../components/CardOverlay'; @@ -299,24 +299,24 @@ class AuthScreens extends React.Component { component={ValidateLoginPage} /> {/* These are the various modal routes */} diff --git a/src/libs/Navigation/AppNavigator/PublicScreens.js b/src/libs/Navigation/AppNavigator/PublicScreens.js index f114dcd72daa..27558acda47e 100644 --- a/src/libs/Navigation/AppNavigator/PublicScreens.js +++ b/src/libs/Navigation/AppNavigator/PublicScreens.js @@ -5,8 +5,8 @@ import SetPasswordPage from '../../../pages/SetPasswordPage'; import PublicWorkspaceNewView from '../../../pages/workspace/PublicWorkspaceNewView'; import ValidateLoginPage from '../../../pages/ValidateLoginPage'; import SCREENS from '../../../SCREENS'; -import ValidateLoginNewWorkspacePage from '../../../pages/ValidateLoginNewWorkspacePage'; -import ValidateLogin2FANewWorkspacePage from '../../../pages/ValidateLogin2FANewWorkspacePage'; +import LoginWithValidateCodePage from '../../../pages/ValidateLoginNewWorkspacePage'; +import LoginWithValidateCode2FAPage from '../../../pages/LoginWithValidateCode2FAPage'; import defaultScreenOptions from './defaultScreenOptions'; const RootStack = createStackNavigator(); @@ -33,24 +33,24 @@ export default () => ( component={PublicWorkspaceNewView} /> ); diff --git a/src/libs/Navigation/linkingConfig.js b/src/libs/Navigation/linkingConfig.js index 20e32613bafb..ba16784927b2 100644 --- a/src/libs/Navigation/linkingConfig.js +++ b/src/libs/Navigation/linkingConfig.js @@ -27,10 +27,10 @@ export default { // Public Routes SetPassword: ROUTES.SET_PASSWORD_WITH_VALIDATE_CODE, ValidateLogin: ROUTES.VALIDATE_LOGIN_WITH_VALIDATE_CODE, - [SCREENS.LOGIN_REDIRECT_NEW_WORKSPACE]: ROUTES.LOGIN_WITH_VALIDATE_CODE_NEW_WORKSPACE, - [SCREENS.LOGIN_REDIRECT_2FA_NEW_WORKSPACE]: ROUTES.LOGIN_WITH_VALIDATE_CODE_2FA_NEW_WORKSPACE, - [SCREENS.LOGIN_REDIRECT_WORKSPACE_CARD]: ROUTES.LOGIN_WITH_VALIDATE_CODE_WORKSPACE_CARD, - [SCREENS.LOGIN_REDIRECT_2FA_WORKSPACE_CARD]: ROUTES.LOGIN_WITH_VALIDATE_CODE_2FA_WORKSPACE_CARD, + [SCREENS.LOGIN_WITH_VALIDATE_CODE_NEW_WORKSPACE]: ROUTES.LOGIN_WITH_VALIDATE_CODE_NEW_WORKSPACE, + [SCREENS.LOGIN_WITH_VALIDATE_CODE_2FA_NEW_WORKSPACE]: ROUTES.LOGIN_WITH_VALIDATE_CODE_2FA_NEW_WORKSPACE, + [SCREENS.LOGIN_WITH_VALIDATE_CODE_WORKSPACE_CARD]: ROUTES.LOGIN_WITH_VALIDATE_CODE_WORKSPACE_CARD, + [SCREENS.LOGIN_WITH_VALIDATE_CODE_2FA_WORKSPACE_CARD]: ROUTES.LOGIN_WITH_VALIDATE_CODE_2FA_WORKSPACE_CARD, // Modal Screens Settings: { diff --git a/src/pages/ValidateLogin2FANewWorkspacePage.js b/src/pages/ValidateLogin2FANewWorkspacePage.js index 36a71e029b2f..438573c87144 100644 --- a/src/pages/ValidateLogin2FANewWorkspacePage.js +++ b/src/pages/ValidateLogin2FANewWorkspacePage.js @@ -45,7 +45,7 @@ const defaultProps = { session: {}, betas: [], }; -class ValidateLogin2FANewWorkspacePage extends Component { +class LoginWithValidateCode2FAPage extends Component { constructor(props) { super(props); @@ -59,7 +59,7 @@ class ValidateLogin2FANewWorkspacePage extends Component { } componentDidMount() { - // If the user has an active session already, they need to be redirected straight to the new workspace page + // If the user has an active session already, they need to be redirected straight to the relevant page if (this.props.session.authToken) { // In order to navigate to a modal, we first have to dismiss the current modal. But there is no current // modal you say? I know, it confuses me too. Without dismissing the current modal, if they user cancels @@ -71,9 +71,9 @@ class ValidateLogin2FANewWorkspacePage extends Component { if (_.isEmpty(this.props.betas)) { setRedirectAfterSign(true); - } else if (this.props.route.name === SCREENS.LOGIN_REDIRECT_2FA_WORKSPACE_CARD) { + } else if (this.props.route.name === SCREENS.LOGIN_WITH_VALIDATE_CODE_2FA_WORKSPACE_CARD) { Navigation.navigate(ROUTES.getWorkspaceCardRoute(this.props.route.params.policyID)); - } else if (this.props.route.name === SCREENS.LOGIN_REDIRECT_2FA_NEW_WORKSPACE) { + } else if (this.props.route.name === SCREENS.LOGIN_WITH_VALIDATE_CODE_2FA_NEW_WORKSPACE) { Navigation.navigate(ROUTES.WORKSPACE_NEW); } else { Navigation.navigate(ROUTES.HOME); @@ -150,8 +150,8 @@ class ValidateLogin2FANewWorkspacePage extends Component { } } -ValidateLogin2FANewWorkspacePage.propTypes = propTypes; -ValidateLogin2FANewWorkspacePage.defaultProps = defaultProps; +LoginWithValidateCode2FAPage.propTypes = propTypes; +LoginWithValidateCode2FAPage.defaultProps = defaultProps; export default compose( withLocalize, @@ -163,4 +163,4 @@ export default compose( key: ONYXKEYS.BETAS, }, }), -)(ValidateLogin2FANewWorkspacePage); +)(LoginWithValidateCode2FAPage); diff --git a/src/pages/ValidateLoginNewWorkspacePage.js b/src/pages/ValidateLoginNewWorkspacePage.js index f88406b6e200..a91ddf75eff6 100644 --- a/src/pages/ValidateLoginNewWorkspacePage.js +++ b/src/pages/ValidateLoginNewWorkspacePage.js @@ -34,9 +34,9 @@ const defaultProps = { session: {}, betas: [], }; -class ValidateLoginNewWorkspacePage extends Component { +class LoginWithValidateCodePage extends Component { componentDidMount() { - // If the user has an active session already, they need to be redirected straight to the new workspace page + // If the user has an active session already, they need to be redirected straight to the relevant page if (this.props.session.authToken) { // In order to navigate to a modal, we first have to dismiss the current modal. But there is no current // modal you say? I know, it confuses me too. Without dismissing the current modal, if they user cancels @@ -47,9 +47,9 @@ class ValidateLoginNewWorkspacePage extends Component { Navigation.dismissModal(); if (_.isEmpty(this.props.betas)) { setRedirectAfterSign(true); - } else if (this.props.route.name === SCREENS.LOGIN_REDIRECT_WORKSPACE_CARD) { + } else if (this.props.route.name === SCREENS.LOGIN_WITH_VALIDATE_CODE_WORKSPACE_CARD) { Navigation.navigate(ROUTES.getWorkspaceCardRoute(this.props.route.params.policyID)); - } else if (this.props.route.name === SCREENS.LOGIN_REDIRECT_NEW_WORKSPACE) { + } else if (this.props.route.name === SCREENS.LOGIN_WITH_VALIDATE_CODE_NEW_WORKSPACE) { Navigation.navigate(ROUTES.WORKSPACE_NEW); } else { Navigation.navigate(ROUTES.HOME); @@ -69,8 +69,8 @@ class ValidateLoginNewWorkspacePage extends Component { } } -ValidateLoginNewWorkspacePage.propTypes = propTypes; -ValidateLoginNewWorkspacePage.defaultProps = defaultProps; +LoginWithValidateCodePage.propTypes = propTypes; +LoginWithValidateCodePage.defaultProps = defaultProps; export default compose( withOnyx({ @@ -81,4 +81,4 @@ export default compose( key: ONYXKEYS.BETAS, }, }), -)(ValidateLoginNewWorkspacePage); +)(LoginWithValidateCodePage); From 7ca2bb3c6b24f1e21e666632dd8490c6cd377a68 Mon Sep 17 00:00:00 2001 From: Amal Nazeem Date: Tue, 10 Aug 2021 16:41:24 -0400 Subject: [PATCH 016/200] Rename files to fit new generic functionality --- src/libs/Navigation/AppNavigator/AuthScreens.js | 2 +- src/libs/Navigation/AppNavigator/PublicScreens.js | 2 +- ...in2FANewWorkspacePage.js => LoginWithValidateCode2FAPage.js} | 0 ...ateLoginNewWorkspacePage.js => LoginWithValidateCodePage.js} | 0 4 files changed, 2 insertions(+), 2 deletions(-) rename src/pages/{ValidateLogin2FANewWorkspacePage.js => LoginWithValidateCode2FAPage.js} (100%) rename src/pages/{ValidateLoginNewWorkspacePage.js => LoginWithValidateCodePage.js} (100%) diff --git a/src/libs/Navigation/AppNavigator/AuthScreens.js b/src/libs/Navigation/AppNavigator/AuthScreens.js index 811741e535c6..d399267ca9f7 100644 --- a/src/libs/Navigation/AppNavigator/AuthScreens.js +++ b/src/libs/Navigation/AppNavigator/AuthScreens.js @@ -62,7 +62,7 @@ import { } from './ModalStackNavigators'; import SCREENS from '../../../SCREENS'; import Timers from '../../Timers'; -import LoginWithValidateCodePage from '../../../pages/ValidateLoginNewWorkspacePage'; +import LoginWithValidateCodePage from '../../../pages/LoginWithValidateCodePage'; import LoginWithValidateCode2FAPage from '../../../pages/LoginWithValidateCode2FAPage'; import WorkspaceSettingsDrawerNavigator from './WorkspaceSettingsDrawerNavigator'; import spacing from '../../../styles/utilities/spacing'; diff --git a/src/libs/Navigation/AppNavigator/PublicScreens.js b/src/libs/Navigation/AppNavigator/PublicScreens.js index 27558acda47e..0e6d7db91ad7 100644 --- a/src/libs/Navigation/AppNavigator/PublicScreens.js +++ b/src/libs/Navigation/AppNavigator/PublicScreens.js @@ -5,7 +5,7 @@ import SetPasswordPage from '../../../pages/SetPasswordPage'; import PublicWorkspaceNewView from '../../../pages/workspace/PublicWorkspaceNewView'; import ValidateLoginPage from '../../../pages/ValidateLoginPage'; import SCREENS from '../../../SCREENS'; -import LoginWithValidateCodePage from '../../../pages/ValidateLoginNewWorkspacePage'; +import LoginWithValidateCodePage from '../../../pages/LoginWithValidateCodePage'; import LoginWithValidateCode2FAPage from '../../../pages/LoginWithValidateCode2FAPage'; import defaultScreenOptions from './defaultScreenOptions'; diff --git a/src/pages/ValidateLogin2FANewWorkspacePage.js b/src/pages/LoginWithValidateCode2FAPage.js similarity index 100% rename from src/pages/ValidateLogin2FANewWorkspacePage.js rename to src/pages/LoginWithValidateCode2FAPage.js diff --git a/src/pages/ValidateLoginNewWorkspacePage.js b/src/pages/LoginWithValidateCodePage.js similarity index 100% rename from src/pages/ValidateLoginNewWorkspacePage.js rename to src/pages/LoginWithValidateCodePage.js From b4e635ea5640c42353eb46e497e370f72edf275d Mon Sep 17 00:00:00 2001 From: Amal Nazeem Date: Wed, 11 Aug 2021 14:35:54 -0400 Subject: [PATCH 017/200] Remove uneeded line --- src/pages/LoginWithValidateCodePage.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/pages/LoginWithValidateCodePage.js b/src/pages/LoginWithValidateCodePage.js index 76d7e872de47..85ba088a6927 100644 --- a/src/pages/LoginWithValidateCodePage.js +++ b/src/pages/LoginWithValidateCodePage.js @@ -55,7 +55,6 @@ class LoginWithValidateCodePage extends Component { create(); } else { Navigation.navigate(ROUTES.HOME); - setRedirectToWorkspaceNewAfterSignIn(true); } return; } From f47c7289247e8fc4dfa1319add28abc3bac049a9 Mon Sep 17 00:00:00 2001 From: Amal Nazeem Date: Wed, 11 Aug 2021 14:46:00 -0400 Subject: [PATCH 018/200] Clearer comment --- src/pages/LoginWithValidateCode2FAPage.js | 2 +- src/pages/LoginWithValidateCodePage.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/LoginWithValidateCode2FAPage.js b/src/pages/LoginWithValidateCode2FAPage.js index 28d0fe81f166..72d3a5b38c50 100644 --- a/src/pages/LoginWithValidateCode2FAPage.js +++ b/src/pages/LoginWithValidateCode2FAPage.js @@ -75,7 +75,7 @@ class LoginWithValidateCode2FAPage extends Component { } else if (this.props.route.name === SCREENS.LOGIN_WITH_VALIDATE_CODE_2FA_WORKSPACE_CARD) { Navigation.navigate(ROUTES.getWorkspaceCardRoute(this.props.route.params.policyID)); } else if (this.props.route.name === SCREENS.LOGIN_WITH_VALIDATE_CODE_2FA_NEW_WORKSPACE) { - // Create a new workspace then the user will be routed to it's settings page + // Create a new workspace so that the user will be routed to it's settings page afterwards create(); } else { Navigation.navigate(ROUTES.HOME); diff --git a/src/pages/LoginWithValidateCodePage.js b/src/pages/LoginWithValidateCodePage.js index 85ba088a6927..828384a57f7f 100644 --- a/src/pages/LoginWithValidateCodePage.js +++ b/src/pages/LoginWithValidateCodePage.js @@ -51,7 +51,7 @@ class LoginWithValidateCodePage extends Component { } else if (this.props.route.name === SCREENS.LOGIN_WITH_VALIDATE_CODE_WORKSPACE_CARD) { Navigation.navigate(ROUTES.getWorkspaceCardRoute(this.props.route.params.policyID)); } else if (this.props.route.name === SCREENS.LOGIN_WITH_VALIDATE_CODE_NEW_WORKSPACE) { - // Create a new workspace then the user will be routed to it's settings page + // Create a new workspace so that the user will be routed to it's settings page afterwards create(); } else { Navigation.navigate(ROUTES.HOME); From 1b0607b9fcff2f481ed41cbb165fabae053f276e Mon Sep 17 00:00:00 2001 From: Amal Nazeem Date: Wed, 11 Aug 2021 15:01:34 -0400 Subject: [PATCH 019/200] Fix missing parentheses --- src/Expensify.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Expensify.js b/src/Expensify.js index 3eed94a79963..7f363896b183 100644 --- a/src/Expensify.js +++ b/src/Expensify.js @@ -116,7 +116,7 @@ class Expensify extends PureComponent { && lodashGet(this.props, 'session.redirectAfterSignIn', false)) { setRedirectAfterSign(false); create(); - + } if (this.getAuthToken() && this.props.initialReportDataLoaded && this.props.isSidebarLoaded) { BootSplash.getVisibilityStatus() From 6d2ab5c2f0507b06ea735cda0215d52a8859fff7 Mon Sep 17 00:00:00 2001 From: Alexander Date: Thu, 12 Aug 2021 12:14:27 -0700 Subject: [PATCH 020/200] Add inbox call button to HeaderWithCloseButton --- src/components/HeaderWithCloseButton.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/components/HeaderWithCloseButton.js b/src/components/HeaderWithCloseButton.js index a56dac010ba0..82bcb0f307ae 100755 --- a/src/components/HeaderWithCloseButton.js +++ b/src/components/HeaderWithCloseButton.js @@ -9,6 +9,7 @@ import Icon from './Icon'; import {Close, Download, BackArrow} from './Icon/Expensicons'; import compose from '../libs/compose'; import withLocalize, {withLocalizePropTypes} from './withLocalize'; +import VideoChatButtonAndMenu from './VideoChatButtonAndMenu'; const propTypes = { /** Title of the Header */ @@ -32,6 +33,9 @@ const propTypes = { /** Whether we should show a download button */ shouldShowDownloadButton: PropTypes.bool, + /** Whether weshould show a inbox call button */ + shouldShowInboxCallButton: PropTypes.bool, + ...withLocalizePropTypes, }; @@ -43,6 +47,7 @@ const defaultProps = { shouldShowBackButton: false, shouldShowBorderBottom: false, shouldShowDownloadButton: false, + shouldShowInboxCallButton: false, }; const HeaderWithCloseButton = props => ( @@ -77,6 +82,11 @@ const HeaderWithCloseButton = props => ( ) } + { + props.shouldShowInboxCallButton && + + } + Date: Thu, 12 Aug 2021 13:02:18 -0700 Subject: [PATCH 021/200] Genericize requesting inbox calls --- src/ROUTES.js | 3 ++- src/components/HeaderWithCloseButton.js | 2 +- src/components/VideoChatButtonAndMenu.js | 4 +++- src/libs/actions/Inbox.js | 6 +++--- src/pages/RequestCallPage.js | 10 ++++++++-- 5 files changed, 17 insertions(+), 8 deletions(-) diff --git a/src/ROUTES.js b/src/ROUTES.js index 4adf292a87b1..943c18b40c2b 100644 --- a/src/ROUTES.js +++ b/src/ROUTES.js @@ -80,7 +80,8 @@ export default { getWorkspacePeopleRoute: policyID => `workspace/${policyID}/people`, getWorkspaceInviteRoute: policyID => `workspace/${policyID}/invite`, WORKSPACE_INVITE: 'workspace/:policyID/invite', - REQUEST_CALL: 'request-call', + getRequestCallRoute: taskID => `request-call/${taskID}`, + REQUEST_CALL: 'request-call/:taskID', getWorkspaceEditorRoute: policyID => `workspace/${policyID}/edit`, WORKSPACE_EDITOR: 'workspace/:policyID/edit', VALIDATE_CODE_URL: (accountID, validateCode, exitTo = '') => { diff --git a/src/components/HeaderWithCloseButton.js b/src/components/HeaderWithCloseButton.js index 82bcb0f307ae..3bf692b2f128 100755 --- a/src/components/HeaderWithCloseButton.js +++ b/src/components/HeaderWithCloseButton.js @@ -47,7 +47,7 @@ const defaultProps = { shouldShowBackButton: false, shouldShowBorderBottom: false, shouldShowDownloadButton: false, - shouldShowInboxCallButton: false, + shouldShowInboxCallButton: true, }; const HeaderWithCloseButton = props => ( diff --git a/src/components/VideoChatButtonAndMenu.js b/src/components/VideoChatButtonAndMenu.js index 437bcd957311..2363270f4ff7 100755 --- a/src/components/VideoChatButtonAndMenu.js +++ b/src/components/VideoChatButtonAndMenu.js @@ -22,10 +22,12 @@ const propTypes = { ...withLocalizePropTypes, ...windowDimensionsPropTypes, isConcierge: PropTypes.bool, + taskID: PropTypes.string, }; const defaultProps = { isConcierge: false, + taskID: '', }; class VideoChatButtonAndMenu extends Component { @@ -99,7 +101,7 @@ class VideoChatButtonAndMenu extends Component { onPress={() => { // If this is the Concierge chat, we'll open the modal for requesting a setup call instead if (this.props.isConcierge) { - Navigation.navigate(ROUTES.REQUEST_CALL); + Navigation.navigate(ROUTES.getRequestCallRoute(this.props.taskID)); return; } this.toggleVideoChatMenu(); diff --git a/src/libs/actions/Inbox.js b/src/libs/actions/Inbox.js index 0a7554a8c3f2..4623bb260ed7 100644 --- a/src/libs/actions/Inbox.js +++ b/src/libs/actions/Inbox.js @@ -1,14 +1,14 @@ import {Inbox_CallUser} from '../API'; -function requestConciergeDMCall(policyID, firstName, lastName, phoneNumber) { +function requestInboxCall(taskID, policyID, firstName, lastName, phoneNumber) { return Inbox_CallUser({ policyID, firstName, lastName, phoneNumber, - taskID: 'NewExpensifyConciergeDM', + taskID, }); } // eslint-disable-next-line import/prefer-default-export -export {requestConciergeDMCall}; +export {requestInboxCall}; diff --git a/src/pages/RequestCallPage.js b/src/pages/RequestCallPage.js index 3d5a1e195057..a474f769b221 100644 --- a/src/pages/RequestCallPage.js +++ b/src/pages/RequestCallPage.js @@ -16,7 +16,7 @@ import Button from '../components/Button'; import FixedFooter from '../components/FixedFooter'; import CONST from '../CONST'; import Growl from '../libs/Growl'; -import {requestConciergeDMCall} from '../libs/actions/Inbox'; +import {requestInboxCall} from '../libs/actions/Inbox'; import {fetchOrCreateChatReport} from '../libs/actions/Report'; import personalDetailsPropType from './personalDetailsPropType'; import ExpensiTextInput from '../components/ExpensiTextInput'; @@ -52,6 +52,12 @@ const propTypes = { /** The type of the policy */ type: PropTypes.string, }).isRequired, + + route: PropTypes.shape({ + params: PropTypes.shape({ + taskID: PropTypes.string + }), + }).isRequired, }; class RequestCallPage extends Component { @@ -83,7 +89,7 @@ class RequestCallPage extends Component { Growl.error(this.props.translate('requestCallPage.growlMessageNoPersonalPolicy'), 3000); return; } - requestConciergeDMCall(personalPolicy.id, this.state.firstName, this.state.lastName, this.state.phoneNumber) + requestInboxCall(this.props.route.params.taskID, personalPolicy.id, this.state.firstName, this.state.lastName, this.state.phoneNumber) .then((result) => { this.setState({isLoading: false}); if (result.jsonCode === 200) { From 1a60440b3ab4db711bd51617b1f661b10ed6d516 Mon Sep 17 00:00:00 2001 From: Alexander Date: Thu, 12 Aug 2021 14:42:50 -0700 Subject: [PATCH 022/200] functional calls from the workspace page --- src/components/HeaderWithCloseButton.js | 7 +++++-- src/components/VideoChatButtonAndMenu.js | 8 ++++---- src/pages/home/HeaderView.js | 2 +- src/pages/workspace/WorkspaceCardPage.js | 2 ++ 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/components/HeaderWithCloseButton.js b/src/components/HeaderWithCloseButton.js index 3bf692b2f128..3dba9f91a490 100755 --- a/src/components/HeaderWithCloseButton.js +++ b/src/components/HeaderWithCloseButton.js @@ -36,6 +36,8 @@ const propTypes = { /** Whether weshould show a inbox call button */ shouldShowInboxCallButton: PropTypes.bool, + inboxCallTaskID: PropTypes.string, + ...withLocalizePropTypes, }; @@ -47,7 +49,8 @@ const defaultProps = { shouldShowBackButton: false, shouldShowBorderBottom: false, shouldShowDownloadButton: false, - shouldShowInboxCallButton: true, + shouldShowInboxCallButton: false, + inboxCallTaskID: '', }; const HeaderWithCloseButton = props => ( @@ -83,7 +86,7 @@ const HeaderWithCloseButton = props => ( } { - props.shouldShowInboxCallButton && + props.shouldShowInboxCallButton && } diff --git a/src/components/VideoChatButtonAndMenu.js b/src/components/VideoChatButtonAndMenu.js index 2363270f4ff7..07e646e11809 100755 --- a/src/components/VideoChatButtonAndMenu.js +++ b/src/components/VideoChatButtonAndMenu.js @@ -21,12 +21,12 @@ import ROUTES from '../ROUTES'; const propTypes = { ...withLocalizePropTypes, ...windowDimensionsPropTypes, - isConcierge: PropTypes.bool, + openInboxCall: PropTypes.bool, taskID: PropTypes.string, }; const defaultProps = { - isConcierge: false, + openInboxCall: false, taskID: '', }; @@ -100,7 +100,7 @@ class VideoChatButtonAndMenu extends Component { { // If this is the Concierge chat, we'll open the modal for requesting a setup call instead - if (this.props.isConcierge) { + if (this.props.openInboxCall) { Navigation.navigate(ROUTES.getRequestCallRoute(this.props.taskID)); return; } @@ -110,7 +110,7 @@ class VideoChatButtonAndMenu extends Component { > diff --git a/src/pages/home/HeaderView.js b/src/pages/home/HeaderView.js index 4f3149f02fee..b5cb368f761d 100644 --- a/src/pages/home/HeaderView.js +++ b/src/pages/home/HeaderView.js @@ -158,7 +158,7 @@ const HeaderView = (props) => { {props.report.hasOutstandingIOU && ( )} - + togglePinnedState(props.report)} style={[styles.touchableButtonImage, styles.mr0]} diff --git a/src/pages/workspace/WorkspaceCardPage.js b/src/pages/workspace/WorkspaceCardPage.js index fd734172821c..856a595d106e 100644 --- a/src/pages/workspace/WorkspaceCardPage.js +++ b/src/pages/workspace/WorkspaceCardPage.js @@ -110,6 +110,8 @@ const WorkspaceCardPage = ({ onCloseButtonPress={() => Navigation.dismissModal()} onBackButtonPress={() => Navigation.goBack()} shouldShowBackButton={isSmallScreenWidth} + shouldShowInboxCallButton + inboxCallTaskID={'WorkspaceCompanyCards'} /> From 3f8c5cbaaab7f5d0f47c5f59198234ebaa468387 Mon Sep 17 00:00:00 2001 From: Alexander Date: Thu, 12 Aug 2021 14:52:49 -0700 Subject: [PATCH 023/200] Style --- src/pages/RequestCallPage.js | 2 +- src/pages/home/HeaderView.js | 2 +- src/pages/workspace/WorkspaceCardPage.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pages/RequestCallPage.js b/src/pages/RequestCallPage.js index a474f769b221..d5c6c03abfd4 100644 --- a/src/pages/RequestCallPage.js +++ b/src/pages/RequestCallPage.js @@ -55,7 +55,7 @@ const propTypes = { route: PropTypes.shape({ params: PropTypes.shape({ - taskID: PropTypes.string + taskID: PropTypes.string, }), }).isRequired, }; diff --git a/src/pages/home/HeaderView.js b/src/pages/home/HeaderView.js index b5cb368f761d..d9fcf8a5b8a2 100644 --- a/src/pages/home/HeaderView.js +++ b/src/pages/home/HeaderView.js @@ -158,7 +158,7 @@ const HeaderView = (props) => { {props.report.hasOutstandingIOU && ( )} - + togglePinnedState(props.report)} style={[styles.touchableButtonImage, styles.mr0]} diff --git a/src/pages/workspace/WorkspaceCardPage.js b/src/pages/workspace/WorkspaceCardPage.js index 856a595d106e..27eaff65988f 100644 --- a/src/pages/workspace/WorkspaceCardPage.js +++ b/src/pages/workspace/WorkspaceCardPage.js @@ -111,7 +111,7 @@ const WorkspaceCardPage = ({ onBackButtonPress={() => Navigation.goBack()} shouldShowBackButton={isSmallScreenWidth} shouldShowInboxCallButton - inboxCallTaskID={'WorkspaceCompanyCards'} + inboxCallTaskID="WorkspaceCompanyCards" /> From 4b5c433b11aff2221f30e57aad575f563a95db3d Mon Sep 17 00:00:00 2001 From: Amal Nazeem Date: Thu, 12 Aug 2021 18:18:10 -0400 Subject: [PATCH 024/200] Remove unused public workspace route --- .../Navigation/AppNavigator/PublicScreens.js | 5 ---- src/pages/workspace/PublicWorkspaceNewView.js | 27 ------------------- 2 files changed, 32 deletions(-) delete mode 100644 src/pages/workspace/PublicWorkspaceNewView.js diff --git a/src/libs/Navigation/AppNavigator/PublicScreens.js b/src/libs/Navigation/AppNavigator/PublicScreens.js index 0e6d7db91ad7..2ea797d0ddbc 100644 --- a/src/libs/Navigation/AppNavigator/PublicScreens.js +++ b/src/libs/Navigation/AppNavigator/PublicScreens.js @@ -2,7 +2,6 @@ import React from 'react'; import {createStackNavigator} from '@react-navigation/stack'; import SignInPage from '../../../pages/signin/SignInPage'; import SetPasswordPage from '../../../pages/SetPasswordPage'; -import PublicWorkspaceNewView from '../../../pages/workspace/PublicWorkspaceNewView'; import ValidateLoginPage from '../../../pages/ValidateLoginPage'; import SCREENS from '../../../SCREENS'; import LoginWithValidateCodePage from '../../../pages/LoginWithValidateCodePage'; @@ -28,10 +27,6 @@ export default () => ( options={defaultScreenOptions} component={SetPasswordPage} /> - Date: Thu, 12 Aug 2021 18:26:40 -0400 Subject: [PATCH 025/200] rename to setRedirectAfterSignIn --- src/Expensify.js | 5 ++--- src/libs/actions/Session.js | 4 ++-- src/pages/LoginWithValidateCode2FAPage.js | 4 ++-- src/pages/LoginWithValidateCodePage.js | 4 ++-- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/Expensify.js b/src/Expensify.js index 7f363896b183..ea0807f062d6 100644 --- a/src/Expensify.js +++ b/src/Expensify.js @@ -17,7 +17,7 @@ import Visibility from './libs/Visibility'; import GrowlNotification from './components/GrowlNotification'; import {growlRef} from './libs/Growl'; import StartupTimer from './libs/StartupTimer'; -import {setRedirectAfterSign} from './libs/actions/Session'; +import {setRedirectAfterSignIn} from './libs/actions/Session'; import {create} from './libs/actions/Policy'; const propTypes = { @@ -114,8 +114,7 @@ class Expensify extends PureComponent { if (this.getAuthToken() && !_.isEmpty(this.props.betas) && lodashGet(this.props, 'session.redirectAfterSignIn', false)) { - setRedirectAfterSign(false); - create(); + setRedirectAfterSignIn(false); } if (this.getAuthToken() && this.props.initialReportDataLoaded && this.props.isSidebarLoaded) { diff --git a/src/libs/actions/Session.js b/src/libs/actions/Session.js index 477e8a9b369f..0ab21fec7cec 100644 --- a/src/libs/actions/Session.js +++ b/src/libs/actions/Session.js @@ -308,7 +308,7 @@ function continueSessionFromECom(accountID, validateCode, twoFactorAuthCode) { * * @param {Boolean} shouldRedirect */ -function setRedirectAfterSign(shouldRedirect) { +function setRedirectAfterSignIn(shouldRedirect) { Onyx.merge(ONYXKEYS.SESSION, {redirectAfterSignIn: shouldRedirect}); } @@ -322,5 +322,5 @@ export { resendValidationLink, resetPassword, restartSignin, - setRedirectAfterSign, + setRedirectAfterSignIn, }; diff --git a/src/pages/LoginWithValidateCode2FAPage.js b/src/pages/LoginWithValidateCode2FAPage.js index 72d3a5b38c50..264e060f77a8 100644 --- a/src/pages/LoginWithValidateCode2FAPage.js +++ b/src/pages/LoginWithValidateCode2FAPage.js @@ -6,7 +6,7 @@ import {withOnyx} from 'react-native-onyx'; import _ from 'underscore'; import withLocalize, {withLocalizePropTypes} from '../components/withLocalize'; import validateLinkPropTypes from './validateLinkPropTypes'; -import {continueSessionFromECom, setRedirectAfterSign} from '../libs/actions/Session'; +import {continueSessionFromECom, setRedirectAfterSignIn} from '../libs/actions/Session'; import styles from '../styles/styles'; import ExpensifyCashLogo from '../components/ExpensifyCashLogo'; import variables from '../styles/variables'; @@ -71,7 +71,7 @@ class LoginWithValidateCode2FAPage extends Component { Navigation.dismissModal(); if (_.isEmpty(this.props.betas)) { - setRedirectAfterSign(true); + setRedirectAfterSignIn(true); } else if (this.props.route.name === SCREENS.LOGIN_WITH_VALIDATE_CODE_2FA_WORKSPACE_CARD) { Navigation.navigate(ROUTES.getWorkspaceCardRoute(this.props.route.params.policyID)); } else if (this.props.route.name === SCREENS.LOGIN_WITH_VALIDATE_CODE_2FA_NEW_WORKSPACE) { diff --git a/src/pages/LoginWithValidateCodePage.js b/src/pages/LoginWithValidateCodePage.js index 828384a57f7f..0fdc4b27b90e 100644 --- a/src/pages/LoginWithValidateCodePage.js +++ b/src/pages/LoginWithValidateCodePage.js @@ -9,7 +9,7 @@ import ONYXKEYS from '../ONYXKEYS'; import Navigation from '../libs/Navigation/Navigation'; import ROUTES from '../ROUTES'; import SCREENS from '../SCREENS'; -import {continueSessionFromECom, setRedirectAfterSign} from '../libs/actions/Session'; +import {continueSessionFromECom, setRedirectAfterSignIn} from '../libs/actions/Session'; import {create} from '../libs/actions/Policy'; const propTypes = { @@ -47,7 +47,7 @@ class LoginWithValidateCodePage extends Component { // if they cancel out of the new workspace modal. Navigation.dismissModal(); if (_.isEmpty(this.props.betas)) { - setRedirectAfterSign(true); + setRedirectAfterSignIn(true); } else if (this.props.route.name === SCREENS.LOGIN_WITH_VALIDATE_CODE_WORKSPACE_CARD) { Navigation.navigate(ROUTES.getWorkspaceCardRoute(this.props.route.params.policyID)); } else if (this.props.route.name === SCREENS.LOGIN_WITH_VALIDATE_CODE_NEW_WORKSPACE) { From ed2a67e6410cd539cdd84834a55bfd886942f807 Mon Sep 17 00:00:00 2001 From: Amal Nazeem Date: Thu, 12 Aug 2021 22:14:51 -0400 Subject: [PATCH 026/200] consolidated beta loading logic in LoginWith components --- src/Expensify.js | 16 --------- src/libs/actions/Session.js | 10 ------ src/pages/LoginWithValidateCode2FAPage.js | 42 ++++++++++++++--------- src/pages/LoginWithValidateCodePage.js | 41 ++++++++++++++-------- 4 files changed, 52 insertions(+), 57 deletions(-) diff --git a/src/Expensify.js b/src/Expensify.js index ea0807f062d6..29b4cddeb552 100644 --- a/src/Expensify.js +++ b/src/Expensify.js @@ -3,7 +3,6 @@ import PropTypes from 'prop-types'; import React, {PureComponent} from 'react'; import {View, AppState} from 'react-native'; import {withOnyx} from 'react-native-onyx'; -import _ from 'underscore'; import BootSplash from './libs/BootSplash'; import * as ActiveClientManager from './libs/ActiveClientManager'; @@ -17,8 +16,6 @@ import Visibility from './libs/Visibility'; import GrowlNotification from './components/GrowlNotification'; import {growlRef} from './libs/Growl'; import StartupTimer from './libs/StartupTimer'; -import {setRedirectAfterSignIn} from './libs/actions/Session'; -import {create} from './libs/actions/Policy'; const propTypes = { /* Onyx Props */ @@ -44,9 +41,6 @@ const propTypes = { /** Tells us if the sidebar has rendered */ isSidebarLoaded: PropTypes.bool, - - /** List of betas */ - betas: PropTypes.arrayOf(PropTypes.string), }; const defaultProps = { @@ -58,7 +52,6 @@ const defaultProps = { updateAvailable: false, initialReportDataLoaded: false, isSidebarLoaded: false, - betas: [], }; class Expensify extends PureComponent { @@ -111,12 +104,6 @@ class Expensify extends PureComponent { BootSplash.show({fade: true}); } - if (this.getAuthToken() - && !_.isEmpty(this.props.betas) - && lodashGet(this.props, 'session.redirectAfterSignIn', false)) { - setRedirectAfterSignIn(false); - } - if (this.getAuthToken() && this.props.initialReportDataLoaded && this.props.isSidebarLoaded) { BootSplash.getVisibilityStatus() .then((value) => { @@ -171,9 +158,6 @@ export default withOnyx({ session: { key: ONYXKEYS.SESSION, }, - betas: { - key: ONYXKEYS.BETAS, - }, updateAvailable: { key: ONYXKEYS.UPDATE_AVAILABLE, initWithStoredValues: false, diff --git a/src/libs/actions/Session.js b/src/libs/actions/Session.js index 0ab21fec7cec..75922c7bf794 100644 --- a/src/libs/actions/Session.js +++ b/src/libs/actions/Session.js @@ -303,15 +303,6 @@ function continueSessionFromECom(accountID, validateCode, twoFactorAuthCode) { }); } -/** - * Sets the redirectAfterSignIn flag in the session variable - * - * @param {Boolean} shouldRedirect - */ -function setRedirectAfterSignIn(shouldRedirect) { - Onyx.merge(ONYXKEYS.SESSION, {redirectAfterSignIn: shouldRedirect}); -} - export { continueSessionFromECom, fetchAccountDetails, @@ -322,5 +313,4 @@ export { resendValidationLink, resetPassword, restartSignin, - setRedirectAfterSignIn, }; diff --git a/src/pages/LoginWithValidateCode2FAPage.js b/src/pages/LoginWithValidateCode2FAPage.js index 264e060f77a8..f9b64b3185d6 100644 --- a/src/pages/LoginWithValidateCode2FAPage.js +++ b/src/pages/LoginWithValidateCode2FAPage.js @@ -3,10 +3,9 @@ import {TextInput, View} from 'react-native'; import lodashGet from 'lodash/get'; import PropTypes from 'prop-types'; import {withOnyx} from 'react-native-onyx'; -import _ from 'underscore'; import withLocalize, {withLocalizePropTypes} from '../components/withLocalize'; import validateLinkPropTypes from './validateLinkPropTypes'; -import {continueSessionFromECom, setRedirectAfterSignIn} from '../libs/actions/Session'; +import {continueSessionFromECom} from '../libs/actions/Session'; import styles from '../styles/styles'; import ExpensifyCashLogo from '../components/ExpensifyCashLogo'; import variables from '../styles/variables'; @@ -20,6 +19,7 @@ import Navigation from '../libs/Navigation/Navigation'; import ROUTES from '../ROUTES'; import SCREENS from '../SCREENS'; import {create} from '../libs/actions/Policy'; +import Permissions from '../libs/Permissions'; const propTypes = { /* Onyx Props */ @@ -63,26 +63,36 @@ class LoginWithValidateCode2FAPage extends Component { // If the user has an active session already, they need to be redirected straight to the relevant page if (this.props.session.authToken) { // In order to navigate to a modal, we first have to dismiss the current modal. But there is no current - // modal you say? I know, it confuses me too. Without dismissing the current modal, if they user cancels - // out of the new workspace modal, then they will be routed back to - // /v///new-workspace and we don't want that. We want them to go back to `/` and - // by calling dismissModal(), the /v/... route is removed from history so the user will get taken to `/` + // modal you say? I know, it confuses me too. Without dismissing the current modal, if they user cancels out + // of the new workspace modal, then they will be routed back to + // /v///workspace/123/card and we don't want that. We want them to go back to `/` + // and by calling dismissModal(), the /v/... route is removed from history so the user will get taken to `/` // if they cancel out of the new workspace modal. Navigation.dismissModal(); - - if (_.isEmpty(this.props.betas)) { - setRedirectAfterSignIn(true); - } else if (this.props.route.name === SCREENS.LOGIN_WITH_VALIDATE_CODE_2FA_WORKSPACE_CARD) { - Navigation.navigate(ROUTES.getWorkspaceCardRoute(this.props.route.params.policyID)); - } else if (this.props.route.name === SCREENS.LOGIN_WITH_VALIDATE_CODE_2FA_NEW_WORKSPACE) { - // Create a new workspace so that the user will be routed to it's settings page afterwards - create(); - } else { - Navigation.navigate(ROUTES.HOME); + if (Permissions.canUseFreePlan(this.props.betas)) { + this.rerouteToRelevantPage(); } } } + componentDidUpdate() { + // Betas can be loaded a little after a user is authenticated, so check again if the betas have been updated + if (this.props.session.authToken && Permissions.canUseFreePlan(this.props.betas)) { + this.rerouteToRelevantPage(); + } + } + + rerouteToRelevantPage() { + if (this.props.route.name === SCREENS.LOGIN_WITH_VALIDATE_CODE_2FA_WORKSPACE_CARD) { + Navigation.navigate(ROUTES.getWorkspaceCardRoute(this.props.route.params.policyID)); + } else if (this.props.route.name === SCREENS.LOGIN_WITH_VALIDATE_CODE_2FA_NEW_WORKSPACE) { + // Create a new workspace so that the user will be routed to its settings page afterwards + create(); + } else { + Navigation.navigate(ROUTES.HOME); + } + } + validateAndSubmitForm() { if (!this.state.twoFactorAuthCode.trim()) { this.setState({formError: this.props.translate('passwordForm.pleaseFillOutAllFields')}); diff --git a/src/pages/LoginWithValidateCodePage.js b/src/pages/LoginWithValidateCodePage.js index 0fdc4b27b90e..342108abfeac 100644 --- a/src/pages/LoginWithValidateCodePage.js +++ b/src/pages/LoginWithValidateCodePage.js @@ -2,15 +2,15 @@ import {Component} from 'react'; import PropTypes from 'prop-types'; import {withOnyx} from 'react-native-onyx'; import lodashGet from 'lodash/get'; -import _ from 'underscore'; import validateLinkPropTypes from './validateLinkPropTypes'; import compose from '../libs/compose'; import ONYXKEYS from '../ONYXKEYS'; import Navigation from '../libs/Navigation/Navigation'; import ROUTES from '../ROUTES'; import SCREENS from '../SCREENS'; -import {continueSessionFromECom, setRedirectAfterSignIn} from '../libs/actions/Session'; +import {continueSessionFromECom} from '../libs/actions/Session'; import {create} from '../libs/actions/Policy'; +import Permissions from '../libs/Permissions'; const propTypes = { /* Onyx Props */ @@ -40,21 +40,14 @@ class LoginWithValidateCodePage extends Component { // If the user has an active session already, they need to be redirected straight to the relevant page if (this.props.session.authToken) { // In order to navigate to a modal, we first have to dismiss the current modal. But there is no current - // modal you say? I know, it confuses me too. Without dismissing the current modal, if they user cancels - // out of the new workspace modal, then they will be routed back to - // /v///new-workspace and we don't want that. We want them to go back to `/` and - // by calling dismissModal(), the /v/... route is removed from history so the user will get taken to `/` + // modal you say? I know, it confuses me too. Without dismissing the current modal, if they user cancels out + // of the new workspace modal, then they will be routed back to + // /v///workspace/123/card and we don't want that. We want them to go back to `/` + // and by calling dismissModal(), the /v/... route is removed from history so the user will get taken to `/` // if they cancel out of the new workspace modal. Navigation.dismissModal(); - if (_.isEmpty(this.props.betas)) { - setRedirectAfterSignIn(true); - } else if (this.props.route.name === SCREENS.LOGIN_WITH_VALIDATE_CODE_WORKSPACE_CARD) { - Navigation.navigate(ROUTES.getWorkspaceCardRoute(this.props.route.params.policyID)); - } else if (this.props.route.name === SCREENS.LOGIN_WITH_VALIDATE_CODE_NEW_WORKSPACE) { - // Create a new workspace so that the user will be routed to it's settings page afterwards - create(); - } else { - Navigation.navigate(ROUTES.HOME); + if (Permissions.canUseFreePlan(this.props.betas)) { + this.rerouteToRelevantPage(); } return; } @@ -64,6 +57,24 @@ class LoginWithValidateCodePage extends Component { continueSessionFromECom(accountID, validateCode); } + componentDidUpdate() { + // Betas can be loaded a little after a user is authenticated, so check again if the betas have been updated + if (this.props.session.authToken && Permissions.canUseFreePlan(this.props.betas)) { + this.rerouteToRelevantPage(); + } + } + + rerouteToRelevantPage() { + if (this.props.route.name === SCREENS.LOGIN_WITH_VALIDATE_CODE_WORKSPACE_CARD) { + Navigation.navigate(ROUTES.getWorkspaceCardRoute(this.props.route.params.policyID)); + } else if (this.props.route.name === SCREENS.LOGIN_WITH_VALIDATE_CODE_NEW_WORKSPACE) { + // Create a new workspace so that the user will be routed to its settings page afterwards + create(); + } else { + Navigation.navigate(ROUTES.HOME); + } + } + render() { // Don't render anything here since the user is redirected to the new workspace page // once we've attempted to validate their login in continueSessionFromECom() From f0ffacfabd64308f4957b081d95ff07c497adcdb Mon Sep 17 00:00:00 2001 From: Amal Nazeem Date: Thu, 12 Aug 2021 22:16:30 -0400 Subject: [PATCH 027/200] Make sure new policy is autocreated only after all policies have been loaded --- src/ONYXKEYS.js | 4 ++++ src/libs/actions/Policy.js | 2 ++ src/pages/workspace/WorkspaceSidebar.js | 23 +++++++++++++---------- 3 files changed, 19 insertions(+), 10 deletions(-) diff --git a/src/ONYXKEYS.js b/src/ONYXKEYS.js index 71b269290712..56d37527b7e0 100755 --- a/src/ONYXKEYS.js +++ b/src/ONYXKEYS.js @@ -19,6 +19,10 @@ export default { // Boolean flag set whenever the sidebar has loaded IS_SIDEBAR_LOADED: 'isSidebarLoaded', + // Boolean flag set after policies are loaded. This exists since policies are loaded only behind the freePlan beta. + // This and all calls to this can be removed after Permissions.canUseFreePlan() is no longer needed. + ARE_ALL_POLICIES_LOADED: 'areAllPoliciesLoaded', + NETWORK_REQUEST_QUEUE: 'networkRequestQueue', // What the active route is for our navigator. Global route that determines what views to display. diff --git a/src/libs/actions/Policy.js b/src/libs/actions/Policy.js index 661a66b6ba27..f90888ce5349 100644 --- a/src/libs/actions/Policy.js +++ b/src/libs/actions/Policy.js @@ -95,6 +95,8 @@ function getPolicyList() { // And overwrite them with only the ones returned by the API call ...policyDataToStore, }); + + Onyx.set(ONYXKEYS.ARE_ALL_POLICIES_LOADED, true); } }); } diff --git a/src/pages/workspace/WorkspaceSidebar.js b/src/pages/workspace/WorkspaceSidebar.js index 0dd7990db4e1..a39450f48ad4 100644 --- a/src/pages/workspace/WorkspaceSidebar.js +++ b/src/pages/workspace/WorkspaceSidebar.js @@ -1,5 +1,5 @@ import _ from 'underscore'; -import React, {useEffect} from 'react'; +import React from 'react'; import {View, ScrollView, Pressable} from 'react-native'; import {withOnyx} from 'react-native-onyx'; import lodashGet from 'lodash/get'; @@ -45,7 +45,9 @@ const defaultProps = { policy: {}, }; -const WorkspaceSidebar = ({translate, isSmallScreenWidth, policy}) => { +const WorkspaceSidebar = ({ + translate, isSmallScreenWidth, policy, areAllPoliciesLoaded, +}) => { const menuItems = [ { translationKey: 'workspace.common.card', @@ -65,14 +67,12 @@ const WorkspaceSidebar = ({translate, isSmallScreenWidth, policy}) => { }, ]; - useEffect(() => { - if (_.isEmpty(policy)) { - Growl.error(translate('workspace.error.growlMessageInvalidPolicy'), CONST.GROWL.DURATION_LONG); - Navigation.dismissModal(); - create(); - return null; - } - }, [policy]); + if (areAllPoliciesLoaded && _.isEmpty(policy)) { + Growl.error(translate('workspace.error.growlMessageInvalidPolicy'), CONST.GROWL.DURATION_LONG); + Navigation.dismissModal(); + create(); + return null; + } const openEditor = () => Navigation.navigate(ROUTES.getWorkspaceEditorRoute(policy.id)); @@ -172,5 +172,8 @@ export default compose( return `${ONYXKEYS.COLLECTION.POLICY}${policyID}`; }, }, + areAllPoliciesLoaded: { + key: ONYXKEYS.ARE_ALL_POLICIES_LOADED, + }, }), )(WorkspaceSidebar); From 81150170013225760f83f144822978ad23cf1a58 Mon Sep 17 00:00:00 2001 From: Amal Nazeem Date: Thu, 12 Aug 2021 22:51:37 -0400 Subject: [PATCH 028/200] remove unused proptype --- src/Expensify.js | 4 ---- src/libs/Permissions.js | 3 ++- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/Expensify.js b/src/Expensify.js index 29b4cddeb552..6f08789e9c0c 100644 --- a/src/Expensify.js +++ b/src/Expensify.js @@ -28,9 +28,6 @@ const propTypes = { /** Currently logged in user accountID */ accountID: PropTypes.number, - - /** Should app immediately redirect to new workspace route once authenticated */ - redirectAfterSignIn: PropTypes.bool, }), /** Whether a new update is available and ready to install. */ @@ -47,7 +44,6 @@ const defaultProps = { session: { authToken: null, accountID: null, - redirectAfterSignIn: false, }, updateAvailable: false, initialReportDataLoaded: false, diff --git a/src/libs/Permissions.js b/src/libs/Permissions.js index 1ca31ce88712..72c85e3dd501 100644 --- a/src/libs/Permissions.js +++ b/src/libs/Permissions.js @@ -8,7 +8,8 @@ import CONST from '../CONST'; * @returns {Boolean} */ function canUseAllBetas(betas) { - return isDevelopment() || _.contains(betas, CONST.BETAS.ALL); + // return isDevelopment() || _.contains(betas, CONST.BETAS.ALL); + return _.contains(betas, CONST.BETAS.ALL); } /** From 16b821ad10ba420af968b1b0db5a98700f14b711 Mon Sep 17 00:00:00 2001 From: Aman Ansari Date: Fri, 13 Aug 2021 13:22:46 +0530 Subject: [PATCH 029/200] update copy for login --- src/languages/en.js | 3 ++- src/languages/es.js | 3 ++- src/pages/signin/ChangeExpensifyLoginLink.js | 20 ++++++++++++-------- src/pages/signin/ResendValidationForm.js | 13 ++++++++++++- src/styles/styles.js | 6 ++++++ 5 files changed, 34 insertions(+), 11 deletions(-) diff --git a/src/languages/en.js b/src/languages/en.js index 39fafd4d7da9..cc9f9fda9799 100755 --- a/src/languages/en.js +++ b/src/languages/en.js @@ -11,6 +11,7 @@ export default { new: 'NEW', search: 'Search', next: 'Next', + goBack: 'Go back', add: 'Add', resend: 'Resend', save: 'Save', @@ -326,7 +327,7 @@ export default { }, resendValidationForm: { linkHasBeenResent: 'Link has been re-sent', - weSentYouMagicSignInLink: 'We\'ve sent you a magic sign in link – just click on it to log in!', + weSentYouMagicSignInLink: ({loginType}) => `We've sent a magic sign in link to your ${loginType}.`, resendLink: 'Resend Link', }, detailsPage: { diff --git a/src/languages/es.js b/src/languages/es.js index c04745f36511..4f439932a8e9 100644 --- a/src/languages/es.js +++ b/src/languages/es.js @@ -11,6 +11,7 @@ export default { new: 'NUEVO', search: 'Buscar', next: 'Siguiente', + goBack: 'Regresar', add: 'Agregar', resend: 'Reenviar', save: 'Guardar', @@ -326,7 +327,7 @@ export default { }, resendValidationForm: { linkHasBeenResent: 'El enlace se ha reenviado', - weSentYouMagicSignInLink: '¡Te hemos enviado un enlace - simplemente haz click en él para conectarte!', + weSentYouMagicSignInLink: ({loginType}) => `Hemos enviado un enlace mágico de inicio de sesión a tu ${loginType}.`, resendLink: 'Reenviar Enlace', }, detailsPage: { diff --git a/src/pages/signin/ChangeExpensifyLoginLink.js b/src/pages/signin/ChangeExpensifyLoginLink.js index 778291d53a68..7341d9b17f0f 100755 --- a/src/pages/signin/ChangeExpensifyLoginLink.js +++ b/src/pages/signin/ChangeExpensifyLoginLink.js @@ -22,19 +22,23 @@ const propTypes = { }; const ChangeExpensifyLoginLink = ({credentials, translate, toLocalPhone}) => ( - + + + {translate('common.not')} +   + {Str.isSMSLogin(credentials.login) + ? toLocalPhone(Str.removeSMSDomain(credentials.login)) + : Str.removeSMSDomain(credentials.login)} + {'? '} + - - {translate('common.not')} -   - {Str.isSMSLogin(credentials.login) - ? toLocalPhone(Str.removeSMSDomain(credentials.login)) - : Str.removeSMSDomain(credentials.login)} - ? + + {translate('common.goBack')} + {'.'} diff --git a/src/pages/signin/ResendValidationForm.js b/src/pages/signin/ResendValidationForm.js index cbae3f489a83..cd4de333416e 100755 --- a/src/pages/signin/ResendValidationForm.js +++ b/src/pages/signin/ResendValidationForm.js @@ -3,6 +3,7 @@ import {View} from 'react-native'; import {withOnyx} from 'react-native-onyx'; import PropTypes from 'prop-types'; import _ from 'underscore'; +import Str from 'expensify-common/lib/str'; import styles from '../../styles/styles'; import Button from '../../components/Button'; import Text from '../../components/Text'; @@ -15,6 +16,11 @@ import compose from '../../libs/compose'; const propTypes = { /* Onyx Props */ + credentials: PropTypes.shape({ + /** The email/phone the user logged in with */ + login: PropTypes.string, + }).isRequired, + /** The details about the account that the user is signing in with */ account: PropTypes.shape({ /** Whether or not a sign on form is loading (being submitted) */ @@ -77,7 +83,11 @@ class ResendValidationForm extends React.Component { <> - {this.props.translate('resendValidationForm.weSentYouMagicSignInLink')} + {this.props.translate('resendValidationForm.weSentYouMagicSignInLink', { + loginType: (Str.isSMSLogin(this.props.credentials.login) + ? this.props.translate('common.phoneNumber').toLowerCase() + : this.props.translate('common.email')).toLowerCase(), + })} {!_.isEmpty(this.state.formSuccess) && ( @@ -106,6 +116,7 @@ ResendValidationForm.defaultProps = defaultProps; export default compose( withLocalize, withOnyx({ + credentials: {key: ONYXKEYS.CREDENTIALS}, account: {key: ONYXKEYS.ACCOUNT}, }), )(ResendValidationForm); diff --git a/src/styles/styles.js b/src/styles/styles.js index aa5acafba932..1847a7d69b84 100644 --- a/src/styles/styles.js +++ b/src/styles/styles.js @@ -704,6 +704,12 @@ const styles = { maxWidth: 400, }, + changeExpensifyLoginLinkContainer: { + flexDirection: 'row', + flexWrap: 'wrap', + ...wordBreak.breakWord, + }, + loginTermsText: { color: themeColors.textSupporting, fontFamily: fontFamily.GTA, From 6c94b285c402c0369b187dd7073102b60f957a93 Mon Sep 17 00:00:00 2001 From: Manan Jadhav Date: Fri, 13 Aug 2021 20:58:59 +0530 Subject: [PATCH 030/200] fix(hide-automated-acc-trans): Updated OptionListUtils to add flags for filters --- src/libs/OptionsListUtils.js | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/src/libs/OptionsListUtils.js b/src/libs/OptionsListUtils.js index 718282357cc3..ceb674c7c8e3 100644 --- a/src/libs/OptionsListUtils.js +++ b/src/libs/OptionsListUtils.js @@ -293,6 +293,8 @@ function getOptions(reports, personalDetails, draftComments, activeReportID, { selectedOptions = [], maxRecentReportsToShow = 0, excludeConcierge = false, + excludeChronos = false, + excludeReceipts = false, excludeDefaultRooms = false, includeMultipleParticipantReports = false, includePersonalDetails = false, @@ -384,6 +386,14 @@ function getOptions(reports, personalDetails, draftComments, activeReportID, { loginOptionsToExclude.push({login: CONST.EMAIL.CONCIERGE}); } + if (excludeChronos) { + loginOptionsToExclude.push({login: CONST.EMAIL.CHRONOS}); + } + + if (excludeReceipts) { + loginOptionsToExclude.push({login: CONST.EMAIL.RECEIPTS}); + } + if (includeRecentReports) { for (let i = 0; i < allReportOptions.length; i++) { // Stop adding options to the recentReports array when we reach the maxRecentReportsToShow value @@ -527,7 +537,10 @@ function getSearchOptions( * @param {Object} reports * @param {Object} personalDetails * @param {String} searchValue - * @param {Boolean} excludeConcierge + * @param {Object} excludedOptions + * @param {Boolean} parameters.excludeConcierge + * @param {Boolean} parameters.excludeChronos + * @param {Boolean} parameters.excludeReceipts * @param {Array} betas * @returns {Object} */ @@ -535,7 +548,11 @@ function getNewChatOptions( reports, personalDetails, searchValue = '', - excludeConcierge, + { + excludeConcierge = false, + excludeChronos = false, + excludeReceipts = true, + } = {}, betas, ) { return getOptions(reports, personalDetails, {}, 0, { @@ -546,6 +563,8 @@ function getNewChatOptions( includeRecentReports: true, maxRecentReportsToShow: 5, excludeConcierge, + excludeChronos, + excludeReceipts, }); } From 414c4b492c38d3de5a107b3205384a75d25c6988 Mon Sep 17 00:00:00 2001 From: Manan Jadhav Date: Fri, 13 Aug 2021 20:59:37 +0530 Subject: [PATCH 031/200] fix(hide-automated-acc-trans): Hide chronos and receipts from Request money screen --- .../IOUParticipantsPage/IOUParticipantsRequest.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/pages/iou/steps/IOUParticipantsPage/IOUParticipantsRequest.js b/src/pages/iou/steps/IOUParticipantsPage/IOUParticipantsRequest.js index 6b3ee1b552bd..e28dff963e34 100755 --- a/src/pages/iou/steps/IOUParticipantsPage/IOUParticipantsRequest.js +++ b/src/pages/iou/steps/IOUParticipantsPage/IOUParticipantsRequest.js @@ -56,7 +56,11 @@ class IOUParticipantsRequest extends Component { props.reports, props.personalDetails, '', - true, + { + excludeConcierge: true, + excludeChronos: true, + excludeReceipts: true, + }, props.betas, ); @@ -128,7 +132,11 @@ class IOUParticipantsRequest extends Component { this.props.reports, this.props.personalDetails, searchValue, - true, + { + excludeConcierge: true, + excludeChronos: true, + excludeReceipts: true, + }, this.props.betas, ); this.setState({ From 771a3c948817c91736a2eb3c80c6f5c741647b0b Mon Sep 17 00:00:00 2001 From: Manan Jadhav Date: Fri, 13 Aug 2021 21:00:03 +0530 Subject: [PATCH 032/200] fix(hide-automated-acc-trans): Added default allowed for receipts and chronos for chats --- src/pages/NewChatPage.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/pages/NewChatPage.js b/src/pages/NewChatPage.js index 96b2153541f3..00075f1d5d0f 100755 --- a/src/pages/NewChatPage.js +++ b/src/pages/NewChatPage.js @@ -65,7 +65,11 @@ class NewChatPage extends Component { props.reports, props.personalDetails, '', - false, + { + excludeConcierge: false, + excludeChronos: false, + excludeReceipts: true, + }, props.betas, ); From 34644cc62f9407bf41112c85ea8a6c1486fb92fb Mon Sep 17 00:00:00 2001 From: Manan Jadhav Date: Fri, 13 Aug 2021 21:00:33 +0530 Subject: [PATCH 033/200] fix(hide-automated-acc-trans): Added receipts email to const --- src/CONST.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/CONST.js b/src/CONST.js index 7e930f9bb99b..481f6a6b7721 100755 --- a/src/CONST.js +++ b/src/CONST.js @@ -260,6 +260,7 @@ const CONST = { EMAIL: { CHRONOS: 'chronos@expensify.com', CONCIERGE: 'concierge@expensify.com', + RECEIPTS: 'receipts@expensify.com', }, ENVIRONMENT: { From 8cceef25478723d9a9c53990bc50e50e3ab63b0f Mon Sep 17 00:00:00 2001 From: Amal Nazeem Date: Fri, 13 Aug 2021 11:42:34 -0400 Subject: [PATCH 034/200] revert change to permissions --- src/libs/Permissions.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/libs/Permissions.js b/src/libs/Permissions.js index 72c85e3dd501..1ca31ce88712 100644 --- a/src/libs/Permissions.js +++ b/src/libs/Permissions.js @@ -8,8 +8,7 @@ import CONST from '../CONST'; * @returns {Boolean} */ function canUseAllBetas(betas) { - // return isDevelopment() || _.contains(betas, CONST.BETAS.ALL); - return _.contains(betas, CONST.BETAS.ALL); + return isDevelopment() || _.contains(betas, CONST.BETAS.ALL); } /** From d154f4462a9c095c2de14396f1e8557127b173a1 Mon Sep 17 00:00:00 2001 From: Amal Nazeem Date: Fri, 13 Aug 2021 11:43:54 -0400 Subject: [PATCH 035/200] fix comment typo --- src/pages/LoginWithValidateCode2FAPage.js | 2 +- src/pages/LoginWithValidateCodePage.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/LoginWithValidateCode2FAPage.js b/src/pages/LoginWithValidateCode2FAPage.js index f9b64b3185d6..895b7012af8a 100644 --- a/src/pages/LoginWithValidateCode2FAPage.js +++ b/src/pages/LoginWithValidateCode2FAPage.js @@ -63,7 +63,7 @@ class LoginWithValidateCode2FAPage extends Component { // If the user has an active session already, they need to be redirected straight to the relevant page if (this.props.session.authToken) { // In order to navigate to a modal, we first have to dismiss the current modal. But there is no current - // modal you say? I know, it confuses me too. Without dismissing the current modal, if they user cancels out + // modal you say? I know, it confuses me too. Without dismissing the current modal, if the user cancels out // of the new workspace modal, then they will be routed back to // /v///workspace/123/card and we don't want that. We want them to go back to `/` // and by calling dismissModal(), the /v/... route is removed from history so the user will get taken to `/` diff --git a/src/pages/LoginWithValidateCodePage.js b/src/pages/LoginWithValidateCodePage.js index 342108abfeac..753e8fe35f92 100644 --- a/src/pages/LoginWithValidateCodePage.js +++ b/src/pages/LoginWithValidateCodePage.js @@ -40,7 +40,7 @@ class LoginWithValidateCodePage extends Component { // If the user has an active session already, they need to be redirected straight to the relevant page if (this.props.session.authToken) { // In order to navigate to a modal, we first have to dismiss the current modal. But there is no current - // modal you say? I know, it confuses me too. Without dismissing the current modal, if they user cancels out + // modal you say? I know, it confuses me too. Without dismissing the current modal, if the user cancels out // of the new workspace modal, then they will be routed back to // /v///workspace/123/card and we don't want that. We want them to go back to `/` // and by calling dismissModal(), the /v/... route is removed from history so the user will get taken to `/` From 90b2c21baeb8c00a4be403896fcd6f09d4251c56 Mon Sep 17 00:00:00 2001 From: Amal Nazeem Date: Fri, 13 Aug 2021 12:31:05 -0400 Subject: [PATCH 036/200] Show loader to prevent user from being immediately rerouted to the home page --- src/pages/LoginWithValidateCode2FAPage.js | 6 +++--- src/pages/LoginWithValidateCodePage.js | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/pages/LoginWithValidateCode2FAPage.js b/src/pages/LoginWithValidateCode2FAPage.js index 895b7012af8a..be223e9c8128 100644 --- a/src/pages/LoginWithValidateCode2FAPage.js +++ b/src/pages/LoginWithValidateCode2FAPage.js @@ -20,6 +20,7 @@ import ROUTES from '../ROUTES'; import SCREENS from '../SCREENS'; import {create} from '../libs/actions/Policy'; import Permissions from '../libs/Permissions'; +import FullScreenLoadingIndicator from '../components/FullscreenLoadingIndicator'; const propTypes = { /* Onyx Props */ @@ -110,10 +111,9 @@ class LoginWithValidateCode2FAPage extends Component { } render() { - // If the user is already logged in, don't need to display anything because they will get redirected to the - // new workspace page in componentDidMount + // Show a loader so that the user isn't immediately kicked to the home page before rerouteToRelevantPage runs if (this.props.session.authToken) { - return null; + return ; } return ( diff --git a/src/pages/LoginWithValidateCodePage.js b/src/pages/LoginWithValidateCodePage.js index 753e8fe35f92..4f0ef692a069 100644 --- a/src/pages/LoginWithValidateCodePage.js +++ b/src/pages/LoginWithValidateCodePage.js @@ -11,6 +11,7 @@ import SCREENS from '../SCREENS'; import {continueSessionFromECom} from '../libs/actions/Session'; import {create} from '../libs/actions/Policy'; import Permissions from '../libs/Permissions'; +import FullScreenLoadingIndicator from '../components/FullscreenLoadingIndicator'; const propTypes = { /* Onyx Props */ @@ -76,9 +77,8 @@ class LoginWithValidateCodePage extends Component { } render() { - // Don't render anything here since the user is redirected to the new workspace page - // once we've attempted to validate their login in continueSessionFromECom() - return null; + // Show a loader so that the user isn't immediately kicked to the home page before rerouteToRelevantPage runs + return ; } } From 4afd1609f9f825d599f6feb29c6784796660795b Mon Sep 17 00:00:00 2001 From: Manan Jadhav Date: Fri, 13 Aug 2021 22:28:23 +0530 Subject: [PATCH 037/200] fix(hide-automated-acc-trans): Hide chronos, receipts, etc. from getNewGroupChat --- src/libs/OptionsListUtils.js | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/libs/OptionsListUtils.js b/src/libs/OptionsListUtils.js index ceb674c7c8e3..59285214e58b 100644 --- a/src/libs/OptionsListUtils.js +++ b/src/libs/OptionsListUtils.js @@ -538,9 +538,9 @@ function getSearchOptions( * @param {Object} personalDetails * @param {String} searchValue * @param {Object} excludedOptions - * @param {Boolean} parameters.excludeConcierge - * @param {Boolean} parameters.excludeChronos - * @param {Boolean} parameters.excludeReceipts + * @param {Boolean} excludedOptions.excludeConcierge + * @param {Boolean} excludedOptions.excludeChronos + * @param {Boolean} excludedOptions.excludeReceipts * @param {Array} betas * @returns {Object} */ @@ -607,7 +607,10 @@ function getIOUConfirmationOptionsFromParticipants( * @param {Object} personalDetails * @param {String} searchValue * @param {Array} selectedOptions - * @param {Boolean} excludeConcierge + * @param {Object} excludedOptions + * @param {Boolean} excludedOptions.excludeConcierge + * @param {Boolean} excludedOptions.excludeChronos + * @param {Boolean} excludedOptions.excludeReceipts * @param {Array} betas * @returns {Object} */ @@ -616,7 +619,11 @@ function getNewGroupOptions( personalDetails, searchValue = '', selectedOptions = [], - excludeConcierge, + { + excludeConcierge = false, + excludeChronos = false, + excludeReceipts = true, + } = {}, betas, ) { return getOptions(reports, personalDetails, {}, 0, { @@ -629,6 +636,8 @@ function getNewGroupOptions( includeMultipleParticipantReports: false, maxRecentReportsToShow: 5, excludeConcierge, + excludeChronos, + excludeReceipts, }); } From f8cc950158a408e76d983d1c3e2b6726569da960 Mon Sep 17 00:00:00 2001 From: Manan Jadhav Date: Fri, 13 Aug 2021 22:29:06 +0530 Subject: [PATCH 038/200] fix(hide-automated-acc-trans): Updated flags to hide automated accounts --- .../IOUParticipantsSplit.js | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/pages/iou/steps/IOUParticipantsPage/IOUParticipantsSplit.js b/src/pages/iou/steps/IOUParticipantsPage/IOUParticipantsSplit.js index 6b9c6e75dc46..34912d57d5bf 100755 --- a/src/pages/iou/steps/IOUParticipantsPage/IOUParticipantsSplit.js +++ b/src/pages/iou/steps/IOUParticipantsPage/IOUParticipantsSplit.js @@ -82,7 +82,11 @@ class IOUParticipantsSplit extends Component { props.personalDetails, '', props.participants, - true, + { + excludeConcierge: true, + excludeChronos: true, + excludeReceipts: true, + }, props.betas, ); @@ -183,7 +187,11 @@ class IOUParticipantsSplit extends Component { this.props.personalDetails, isOptionInList ? prevState.searchValue : '', newSelectedOptions, - true, + { + excludeConcierge: true, + excludeChronos: true, + excludeReceipts: true, + }, this.props.betas, ); return { @@ -220,7 +228,11 @@ class IOUParticipantsSplit extends Component { this.props.personalDetails, searchValue, [], - true, + { + excludeConcierge: true, + excludeChronos: true, + excludeReceipts: true, + }, this.props.betas, ); this.setState({ From 5a1d2941a5e9fef4abb076a4b7d39857dd5d7b5c Mon Sep 17 00:00:00 2001 From: Manan Jadhav Date: Fri, 13 Aug 2021 22:39:57 +0530 Subject: [PATCH 039/200] fix(hide-automated-acc-trans): removed exluded emails from invite list --- src/libs/OptionsListUtils.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libs/OptionsListUtils.js b/src/libs/OptionsListUtils.js index 59285214e58b..f19be56830fb 100644 --- a/src/libs/OptionsListUtils.js +++ b/src/libs/OptionsListUtils.js @@ -478,6 +478,7 @@ function getOptions(reports, personalDetails, draftComments, activeReportID, { && personalDetailsOptions.length === 0 && _.every(selectedOptions, option => option.login !== searchValue) && ((Str.isValidEmail(searchValue) && !Str.isDomainEmail(searchValue)) || Str.isValidPhone(searchValue)) + && (!_.find(loginOptionsToExclude, loginOptionToExclude => loginOptionToExclude.login === searchValue)) && (searchValue !== CONST.EMAIL.CHRONOS || Permissions.canUseChronos(betas)) ) { // If the phone number doesn't have an international code then let's prefix it with the From 876fc469a1f1d231cc16e66c8858b5704d844ead Mon Sep 17 00:00:00 2001 From: Amal Nazeem Date: Fri, 13 Aug 2021 13:11:11 -0400 Subject: [PATCH 040/200] Fix 2fa page's styles --- src/pages/LoginWithValidateCode2FAPage.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/LoginWithValidateCode2FAPage.js b/src/pages/LoginWithValidateCode2FAPage.js index be223e9c8128..f2c9ee6255a8 100644 --- a/src/pages/LoginWithValidateCode2FAPage.js +++ b/src/pages/LoginWithValidateCode2FAPage.js @@ -117,11 +117,11 @@ class LoginWithValidateCode2FAPage extends Component { } return ( - + - + {this.props.translate('signInPage.expensifyDotCash')} From ec60643eab73eeb448497f23473f88127a44bcff Mon Sep 17 00:00:00 2001 From: Amal Nazeem Date: Fri, 13 Aug 2021 13:29:42 -0400 Subject: [PATCH 041/200] Fix missing React import needed for FullScreenLoadingIndicator --- src/pages/LoginWithValidateCodePage.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/LoginWithValidateCodePage.js b/src/pages/LoginWithValidateCodePage.js index 4f0ef692a069..32363195e937 100644 --- a/src/pages/LoginWithValidateCodePage.js +++ b/src/pages/LoginWithValidateCodePage.js @@ -1,4 +1,4 @@ -import {Component} from 'react'; +import React, {Component} from 'react'; import PropTypes from 'prop-types'; import {withOnyx} from 'react-native-onyx'; import lodashGet from 'lodash/get'; From 278c7efc3a93d010a696ea6e0fb57a11b09d6d30 Mon Sep 17 00:00:00 2001 From: Aman Ansari Date: Fri, 13 Aug 2021 23:11:49 +0530 Subject: [PATCH 042/200] don't show user while searching --- src/libs/OptionsListUtils.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/libs/OptionsListUtils.js b/src/libs/OptionsListUtils.js index 718282357cc3..c516666c0202 100644 --- a/src/libs/OptionsListUtils.js +++ b/src/libs/OptionsListUtils.js @@ -466,6 +466,8 @@ function getOptions(reports, personalDetails, draftComments, activeReportID, { if (searchValue && recentReportOptions.length === 0 && personalDetailsOptions.length === 0 + // eslint-disable-next-line no-use-before-define + && !isCurrentUser({login: searchValue}) && _.every(selectedOptions, option => option.login !== searchValue) && ((Str.isValidEmail(searchValue) && !Str.isDomainEmail(searchValue)) || Str.isValidPhone(searchValue)) && (searchValue !== CONST.EMAIL.CHRONOS || Permissions.canUseChronos(betas)) From 68671783547922a038b984676b35400802ad0ca7 Mon Sep 17 00:00:00 2001 From: Donnie Darko Date: Fri, 13 Aug 2021 22:43:02 +0500 Subject: [PATCH 043/200] remove ExpensiTextInput's height if there's multiline prop --- src/components/ExpensiTextInput/BaseExpensiTextInput.js | 9 ++++++++- src/pages/workspace/WorkspaceInvitePage.js | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/components/ExpensiTextInput/BaseExpensiTextInput.js b/src/components/ExpensiTextInput/BaseExpensiTextInput.js index 6c911d4fde85..9db35977cd12 100644 --- a/src/components/ExpensiTextInput/BaseExpensiTextInput.js +++ b/src/components/ExpensiTextInput/BaseExpensiTextInput.js @@ -118,12 +118,18 @@ class BaseExpensiTextInput extends Component { ignoreLabelTranslateX, innerRef, autoFocus, + multiline, ...inputProps } = this.props; const hasLabel = Boolean(label.length); return ( - + this.input.focus()} focusable={false}> Date: Fri, 13 Aug 2021 23:19:47 +0530 Subject: [PATCH 044/200] test(hide-automated-acc-trans): Modified tests for concierge --- tests/unit/OptionsListUtilsTest.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/unit/OptionsListUtilsTest.js b/tests/unit/OptionsListUtilsTest.js index 27ee71d6976a..7efc74b844fd 100644 --- a/tests/unit/OptionsListUtilsTest.js +++ b/tests/unit/OptionsListUtilsTest.js @@ -273,7 +273,9 @@ describe('OptionsListUtils', () => { ); // Test by excluding Concierge from the results - results = OptionsListUtils.getNewChatOptions(REPORTS_WITH_CONCIERGE, PERSONAL_DETAILS_WITH_CONCIERGE, '', true); + results = OptionsListUtils.getNewChatOptions( + REPORTS_WITH_CONCIERGE, PERSONAL_DETAILS_WITH_CONCIERGE, '', {excludeConcierge: true}, + ); // All the personalDetails should be returned minus the currently logged in user and Concierge expect(results.personalDetails.length).toBe(_.size(PERSONAL_DETAILS_WITH_CONCIERGE) - 2 - MAX_RECENT_REPORTS); @@ -402,7 +404,9 @@ describe('OptionsListUtils', () => { PERSONAL_DETAILS_WITH_CONCIERGE, '', [], - true, + { + excludeConcierge: true, + }, ); // We should expect all the personalDetails to show (minus the 5 that are already showing, From f99e35fdeafabc3383e626334b942c52ed6b6d3b Mon Sep 17 00:00:00 2001 From: Manan Jadhav Date: Fri, 13 Aug 2021 23:24:25 +0530 Subject: [PATCH 045/200] test(hide-automated-acc-trans): Added exclusion tests for Chronos --- tests/unit/OptionsListUtilsTest.js | 61 ++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/tests/unit/OptionsListUtilsTest.js b/tests/unit/OptionsListUtilsTest.js index 7efc74b844fd..c893801a9111 100644 --- a/tests/unit/OptionsListUtilsTest.js +++ b/tests/unit/OptionsListUtilsTest.js @@ -162,6 +162,19 @@ describe('OptionsListUtils', () => { }, }; + const REPORTS_WITH_CHRONOS = { + ...REPORTS, + 10: { + lastVisitedTimestamp: 1610666739302, + lastMessageTimestamp: 1, + isPinned: false, + reportID: 10, + participants: ['chronos@expensify.com'], + reportName: 'Chronos', + unreadActionCount: 1, + }, + }; + const PERSONAL_DETAILS_WITH_CONCIERGE = { ...PERSONAL_DETAILS, @@ -171,6 +184,15 @@ describe('OptionsListUtils', () => { }, }; + const PERSONAL_DETAILS_WITH_CHRONOS = { + ...PERSONAL_DETAILS, + + 'chronos@expensify.com': { + displayName: 'Chronos', + login: 'chronos@expensify.com', + }, + }; + // Set the currently logged in user, report data, and personal details beforeAll(() => { Onyx.init({ @@ -284,6 +306,19 @@ describe('OptionsListUtils', () => { expect.objectContaining({login: 'concierge@expensify.com'}), ]), ); + + // Test by excluding Chronos from the results + results = OptionsListUtils.getNewChatOptions( + REPORTS_WITH_CHRONOS, PERSONAL_DETAILS_WITH_CHRONOS, '', {excludeChronos: true}, + ); + + // All the personalDetails should be returned minus the currently logged in user and Concierge + expect(results.personalDetails.length).toBe(_.size(PERSONAL_DETAILS_WITH_CHRONOS) - 2 - MAX_RECENT_REPORTS); + expect(results.personalDetails).not.toEqual( + expect.arrayContaining([ + expect.objectContaining({login: 'chronos@expensify.com'}), + ]), + ); }); it('getNewGroupOptions()', () => { @@ -422,6 +457,32 @@ describe('OptionsListUtils', () => { expect.objectContaining({login: 'concierge@expensify.com'}), ]), ); + + + // Test by excluding Chronos from the results + results = OptionsListUtils.getNewGroupOptions( + REPORTS_WITH_CHRONOS, + PERSONAL_DETAILS_WITH_CHRONOS, + '', + [], + { + excludeChronos: true, + }, + ); + + // We should expect all the personalDetails to show (minus the 5 that are already showing, + // the currently logged in user and Concierge) + expect(results.personalDetails.length).toBe(_.size(PERSONAL_DETAILS_WITH_CHRONOS) - 7); + expect(results.personalDetails).not.toEqual( + expect.arrayContaining([ + expect.objectContaining({login: 'chronos@expensify.com'}), + ]), + ); + expect(results.recentReports).not.toEqual( + expect.arrayContaining([ + expect.objectContaining({login: 'chronos@expensify.com'}), + ]), + ); }); it('getSidebarOptions() with default priority mode', () => { From d28b65f1d5caa7038e05a2fd1c3e58ef9efab8c9 Mon Sep 17 00:00:00 2001 From: Manan Jadhav Date: Fri, 13 Aug 2021 23:27:23 +0530 Subject: [PATCH 046/200] test(hide-automated-acc-trans): Added exclusion tests for Receipts --- tests/unit/OptionsListUtilsTest.js | 62 +++++++++++++++++++++++++++++- 1 file changed, 61 insertions(+), 1 deletion(-) diff --git a/tests/unit/OptionsListUtilsTest.js b/tests/unit/OptionsListUtilsTest.js index c893801a9111..3a9b992050ad 100644 --- a/tests/unit/OptionsListUtilsTest.js +++ b/tests/unit/OptionsListUtilsTest.js @@ -164,7 +164,7 @@ describe('OptionsListUtils', () => { const REPORTS_WITH_CHRONOS = { ...REPORTS, - 10: { + 11: { lastVisitedTimestamp: 1610666739302, lastMessageTimestamp: 1, isPinned: false, @@ -175,6 +175,19 @@ describe('OptionsListUtils', () => { }, }; + const REPORTS_WITH_RECEIPTS = { + ...REPORTS, + 12: { + lastVisitedTimestamp: 1610666739302, + lastMessageTimestamp: 1, + isPinned: false, + reportID: 10, + participants: ['receipts@expensify.com'], + reportName: 'Receipts', + unreadActionCount: 1, + }, + }; + const PERSONAL_DETAILS_WITH_CONCIERGE = { ...PERSONAL_DETAILS, @@ -193,6 +206,15 @@ describe('OptionsListUtils', () => { }, }; + const PERSONAL_DETAILS_WITH_RECEIPTS = { + ...PERSONAL_DETAILS, + + 'receipts@expensify.com': { + displayName: 'Receipts', + login: 'receipts@expensify.com', + }, + }; + // Set the currently logged in user, report data, and personal details beforeAll(() => { Onyx.init({ @@ -319,6 +341,19 @@ describe('OptionsListUtils', () => { expect.objectContaining({login: 'chronos@expensify.com'}), ]), ); + + // Test by excluding Receipts from the results + results = OptionsListUtils.getNewChatOptions( + REPORTS_WITH_RECEIPTS, PERSONAL_DETAILS_WITH_RECEIPTS, '', {excludeReceipts: true}, + ); + + // All the personalDetails should be returned minus the currently logged in user and Concierge + expect(results.personalDetails.length).toBe(_.size(PERSONAL_DETAILS_WITH_RECEIPTS) - 2 - MAX_RECENT_REPORTS); + expect(results.personalDetails).not.toEqual( + expect.arrayContaining([ + expect.objectContaining({login: 'receipts@expensify.com'}), + ]), + ); }); it('getNewGroupOptions()', () => { @@ -483,6 +518,31 @@ describe('OptionsListUtils', () => { expect.objectContaining({login: 'chronos@expensify.com'}), ]), ); + + // Test by excluding Receipts from the results + results = OptionsListUtils.getNewGroupOptions( + REPORTS_WITH_RECEIPTS, + PERSONAL_DETAILS_WITH_RECEIPTS, + '', + [], + { + excludeReceipts: true, + }, + ); + + // We should expect all the personalDetails to show (minus the 5 that are already showing, + // the currently logged in user and Concierge) + expect(results.personalDetails.length).toBe(_.size(PERSONAL_DETAILS_WITH_RECEIPTS) - 7); + expect(results.personalDetails).not.toEqual( + expect.arrayContaining([ + expect.objectContaining({login: 'receipts@expensify.com'}), + ]), + ); + expect(results.recentReports).not.toEqual( + expect.arrayContaining([ + expect.objectContaining({login: 'receipts@expensify.com'}), + ]), + ); }); it('getSidebarOptions() with default priority mode', () => { From 9dd5edb1b5171f8cd3f143c537fa3ddbcb546acd Mon Sep 17 00:00:00 2001 From: Alexander Date: Fri, 13 Aug 2021 11:23:43 -0700 Subject: [PATCH 047/200] Add inbox call button component --- src/components/HeaderWithCloseButton.js | 3 +- src/components/InboxCallButton.js | 99 +++++++++++++++++++++++++ 2 files changed, 101 insertions(+), 1 deletion(-) create mode 100644 src/components/InboxCallButton.js diff --git a/src/components/HeaderWithCloseButton.js b/src/components/HeaderWithCloseButton.js index 3dba9f91a490..5754027b87f0 100755 --- a/src/components/HeaderWithCloseButton.js +++ b/src/components/HeaderWithCloseButton.js @@ -10,6 +10,7 @@ import {Close, Download, BackArrow} from './Icon/Expensicons'; import compose from '../libs/compose'; import withLocalize, {withLocalizePropTypes} from './withLocalize'; import VideoChatButtonAndMenu from './VideoChatButtonAndMenu'; +import InboxCallButton from "./InboxCallButton"; const propTypes = { /** Title of the Header */ @@ -86,7 +87,7 @@ const HeaderWithCloseButton = props => ( } { - props.shouldShowInboxCallButton && + props.shouldShowInboxCallButton && } diff --git a/src/components/InboxCallButton.js b/src/components/InboxCallButton.js new file mode 100644 index 000000000000..65d2dcf4c9d4 --- /dev/null +++ b/src/components/InboxCallButton.js @@ -0,0 +1,99 @@ +import React, {Component} from 'react'; +import { + View, Pressable, Dimensions, +} from 'react-native'; +import PropTypes from 'prop-types'; +import Icon from './Icon'; +import {Phone} from './Icon/Expensicons'; +import styles from '../styles/styles'; +import themeColors from '../styles/themes/default'; +import withWindowDimensions, {windowDimensionsPropTypes} from './withWindowDimensions'; +import withLocalize, {withLocalizePropTypes} from './withLocalize'; +import compose from '../libs/compose'; +import Navigation from '../libs/Navigation/Navigation'; +import ROUTES from '../ROUTES'; +import Text from "./Text"; + +const propTypes = { + ...withLocalizePropTypes, + ...windowDimensionsPropTypes, + taskID: PropTypes.string, +}; + +const defaultProps = { + taskID: '', +}; + +class InboxCallButton extends Component { + constructor(props) { + super(props); + + this.measureVideoChatIconPosition = this.measureVideoChatIconPosition.bind(this); + this.videoChatIconWrapper = null; + + this.state = { + videoChatIconPosition: {x: 0, y: 0}, + }; + } + + componentDidMount() { + Dimensions.addEventListener('change', this.measureVideoChatIconPosition); + } + + componentWillUnmount() { + Dimensions.removeEventListener('change', this.measureVideoChatIconPosition); + } + + /** + * This gets called onLayout to find the cooridnates of the wrapper for the video chat button. + */ + measureVideoChatIconPosition() { + if (this.videoChatIconWrapper) { + this.videoChatIconWrapper.measureInWindow((x, y) => this.setState({ + videoChatIconPosition: {x, y}, + })); + } + } + + render() { + return ( + <> + this.videoChatIconWrapper = el} + onLayout={this.measureVideoChatIconPosition} + style={[styles.flex1, styles.flexRow, styles.justifyContentCenter, styles.alignItemsCenter]} + > + { + Navigation.navigate(ROUTES.getRequestCallRoute(this.props.taskID)); + }} + style={[styles.button, styles.buttonSmall]} + > + + + + + + + Need Help? + + + + + + + ); + } +} + +InboxCallButton.propTypes = propTypes; +InboxCallButton.defaultProps = defaultProps; +InboxCallButton.displayName = 'InboxCallButton'; +export default compose( + withWindowDimensions, + withLocalize, +)(InboxCallButton); From b9b2a2dbfb7c95652c87ab2a7024bfacb02fb668 Mon Sep 17 00:00:00 2001 From: Alexander Date: Fri, 13 Aug 2021 11:36:50 -0700 Subject: [PATCH 048/200] Translate --- src/components/InboxCallButton.js | 2 +- src/languages/en.js | 1 + src/languages/es.js | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/InboxCallButton.js b/src/components/InboxCallButton.js index 65d2dcf4c9d4..481df5b5399a 100644 --- a/src/components/InboxCallButton.js +++ b/src/components/InboxCallButton.js @@ -79,7 +79,7 @@ class InboxCallButton extends Component { - Need Help? + {this.props.translate('requestCallPage.needHelp')} diff --git a/src/languages/en.js b/src/languages/en.js index 864bc7aac79b..d34cda2554f4 100755 --- a/src/languages/en.js +++ b/src/languages/en.js @@ -613,5 +613,6 @@ export default { growlMessageInvalidPhone: 'That doesn’t look like a valid phone number. Try again with the country code.\ne.g. +15005550006', growlMessageEmptyName: 'Please provide both a first and last name so our Guides know how to address you!', growlMessageNoPersonalPolicy: 'I wasn’t able to find a personal policy to associate this Guides call with, please check your connection and try again.', + needHelp: 'Need help?', }, }; diff --git a/src/languages/es.js b/src/languages/es.js index 8d3dee117fbf..f8324334b779 100644 --- a/src/languages/es.js +++ b/src/languages/es.js @@ -615,5 +615,6 @@ export default { growlMessageInvalidPhone: 'El teléfono no es valido. Intentalo de nuevo agregando el código de país. P. ej.: +15005550006', growlMessageEmptyName: 'Por favor ingresa tu nombre completo', growlMessageNoPersonalPolicy: 'No he podido encontrar una póliza personal con la que asociar esta llamada a las Guías, compruebe su conexión e inténtelo de nuevo.', + needHelp: '¿Necesitas ayuda?', }, }; From df251c7d5b82fb584596ee0c69a3c22940e3a62a Mon Sep 17 00:00:00 2001 From: Alexander Date: Fri, 13 Aug 2021 11:45:38 -0700 Subject: [PATCH 049/200] Convert to functional component, style --- src/components/HeaderWithCloseButton.js | 3 +- src/components/InboxCallButton.js | 105 ++++++++---------------- 2 files changed, 33 insertions(+), 75 deletions(-) diff --git a/src/components/HeaderWithCloseButton.js b/src/components/HeaderWithCloseButton.js index 5754027b87f0..6d533e64fd4d 100755 --- a/src/components/HeaderWithCloseButton.js +++ b/src/components/HeaderWithCloseButton.js @@ -9,8 +9,7 @@ import Icon from './Icon'; import {Close, Download, BackArrow} from './Icon/Expensicons'; import compose from '../libs/compose'; import withLocalize, {withLocalizePropTypes} from './withLocalize'; -import VideoChatButtonAndMenu from './VideoChatButtonAndMenu'; -import InboxCallButton from "./InboxCallButton"; +import InboxCallButton from './InboxCallButton'; const propTypes = { /** Title of the Header */ diff --git a/src/components/InboxCallButton.js b/src/components/InboxCallButton.js index 481df5b5399a..9d76515dee99 100644 --- a/src/components/InboxCallButton.js +++ b/src/components/InboxCallButton.js @@ -1,22 +1,20 @@ -import React, {Component} from 'react'; +import React from 'react'; import { - View, Pressable, Dimensions, + View, Pressable, } from 'react-native'; import PropTypes from 'prop-types'; import Icon from './Icon'; import {Phone} from './Icon/Expensicons'; import styles from '../styles/styles'; import themeColors from '../styles/themes/default'; -import withWindowDimensions, {windowDimensionsPropTypes} from './withWindowDimensions'; import withLocalize, {withLocalizePropTypes} from './withLocalize'; import compose from '../libs/compose'; import Navigation from '../libs/Navigation/Navigation'; import ROUTES from '../ROUTES'; -import Text from "./Text"; +import Text from './Text'; const propTypes = { ...withLocalizePropTypes, - ...windowDimensionsPropTypes, taskID: PropTypes.string, }; @@ -24,76 +22,37 @@ const defaultProps = { taskID: '', }; -class InboxCallButton extends Component { - constructor(props) { - super(props); - - this.measureVideoChatIconPosition = this.measureVideoChatIconPosition.bind(this); - this.videoChatIconWrapper = null; - - this.state = { - videoChatIconPosition: {x: 0, y: 0}, - }; - } - - componentDidMount() { - Dimensions.addEventListener('change', this.measureVideoChatIconPosition); - } - - componentWillUnmount() { - Dimensions.removeEventListener('change', this.measureVideoChatIconPosition); - } - - /** - * This gets called onLayout to find the cooridnates of the wrapper for the video chat button. - */ - measureVideoChatIconPosition() { - if (this.videoChatIconWrapper) { - this.videoChatIconWrapper.measureInWindow((x, y) => this.setState({ - videoChatIconPosition: {x, y}, - })); - } - } - - render() { - return ( - <> - this.videoChatIconWrapper = el} - onLayout={this.measureVideoChatIconPosition} - style={[styles.flex1, styles.flexRow, styles.justifyContentCenter, styles.alignItemsCenter]} - > - { - Navigation.navigate(ROUTES.getRequestCallRoute(this.props.taskID)); - }} - style={[styles.button, styles.buttonSmall]} - > - - - - - - - {this.props.translate('requestCallPage.needHelp')} - - - - +const InboxCallButton = props => ( + <> + + { + Navigation.navigate(ROUTES.getRequestCallRoute(props.taskID)); + }} + style={[styles.button, styles.buttonSmall]} + > + + + + + + + {props.translate('requestCallPage.needHelp')} + + - - ); - } -} + + + +); InboxCallButton.propTypes = propTypes; InboxCallButton.defaultProps = defaultProps; InboxCallButton.displayName = 'InboxCallButton'; -export default compose( - withWindowDimensions, - withLocalize, -)(InboxCallButton); +export default compose(withLocalize)(InboxCallButton); From acfe0dacf2b9279ec50a8d323377790e619a35d8 Mon Sep 17 00:00:00 2001 From: Manan Jadhav Date: Sat, 14 Aug 2021 02:16:01 +0530 Subject: [PATCH 050/200] feat(tooltip-icon-button): Added tooltips to buttons --- src/components/HeaderWithCloseButton.js | 23 ++++++++++----- src/languages/en.js | 3 ++ src/languages/es.js | 3 ++ src/pages/home/report/ReportActionCompose.js | 11 ++++--- src/pages/home/sidebar/SidebarLinks.js | 19 +++++++----- src/pages/iou/IOUModal.js | 31 ++++++++++++-------- 6 files changed, 57 insertions(+), 33 deletions(-) diff --git a/src/components/HeaderWithCloseButton.js b/src/components/HeaderWithCloseButton.js index a56dac010ba0..09487b5e986c 100755 --- a/src/components/HeaderWithCloseButton.js +++ b/src/components/HeaderWithCloseButton.js @@ -9,6 +9,7 @@ import Icon from './Icon'; import {Close, Download, BackArrow} from './Icon/Expensicons'; import compose from '../libs/compose'; import withLocalize, {withLocalizePropTypes} from './withLocalize'; +import Tooltip from './Tooltip'; const propTypes = { /** Title of the Header */ @@ -68,23 +69,29 @@ const HeaderWithCloseButton = props => ( { props.shouldShowDownloadButton && ( + + + ) } - - - + + + + + + diff --git a/src/languages/en.js b/src/languages/en.js index 22a746f24070..57d435e4a7db 100755 --- a/src/languages/en.js +++ b/src/languages/en.js @@ -36,6 +36,8 @@ export default { contacts: 'Contacts', recents: 'Recents', close: 'Close', + download: 'Download', + back: 'Back', saveAndContinue: 'Save & Continue', settings: 'Settings', termsOfService: 'Terms of Service', @@ -121,6 +123,7 @@ export default { fileUploadFailed: 'Upload Failed. File is not supported.', roomIsArchived: 'This chat room has been deleted', localTime: ({user, time}) => `It's ${time} for ${user}`, + emoji: 'Emoji', }, reportActionContextMenu: { copyToClipboard: 'Copy to Clipboard', diff --git a/src/languages/es.js b/src/languages/es.js index 0dfd38895d84..91b35d9cdb51 100644 --- a/src/languages/es.js +++ b/src/languages/es.js @@ -36,6 +36,8 @@ export default { contacts: 'Contactos', recents: 'Recientes', close: 'Cerrar', + download: 'Descargar', + back: 'De vuelta', saveAndContinue: 'Guardar y Continuar', settings: 'Configuración', termsOfService: 'Términos de servicio', @@ -121,6 +123,7 @@ export default { fileUploadFailed: 'Subida fallida. El archivo no es compatible.', roomIsArchived: 'Esta sala de chat ha sido eliminada', localTime: ({user, time}) => `Son las ${time} para ${user}`, + emoji: 'Emoji', }, reportActionContextMenu: { copyToClipboard: 'Copiar al Portapapeles', diff --git a/src/pages/home/report/ReportActionCompose.js b/src/pages/home/report/ReportActionCompose.js index 38eedffa1780..f13c43f84f51 100755 --- a/src/pages/home/report/ReportActionCompose.js +++ b/src/pages/home/report/ReportActionCompose.js @@ -57,6 +57,7 @@ import {participantPropTypes} from '../sidebar/optionPropTypes'; import currentUserPersonalDetailsPropsTypes from '../../settings/Profile/currentUserPersonalDetailsPropsTypes'; import ParticipantLocalTime from './ParticipantLocalTime'; import {withNetwork, withPersonalDetails} from '../../../components/OnyxProvider'; +import Tooltip from '../../../components/Tooltip'; const propTypes = { /** Beta features list */ @@ -626,10 +627,12 @@ class ReportActionCompose extends React.Component { disabled={isBlockedFromConcierge || isArchivedChatRoom} > {({hovered, pressed}) => ( - + + + )} - - - + + + + + {this.state.currentStepIndex > 0 && ( + + + + + + )} +
+ + Navigation.dismissModal()} style={[styles.touchableButtonImage]} + accessibilityRole="button" + accessibilityLabel={this.props.translate('common.close')} > - + - )} -
- - Navigation.dismissModal()} - style={[styles.touchableButtonImage]} - accessibilityRole="button" - accessibilityLabel={this.props.translate('common.close')} - > - - + From 36eef4b013f2b2a0522cd55b36f354dfae2f083a Mon Sep 17 00:00:00 2001 From: Manan Jadhav Date: Sat, 14 Aug 2021 02:34:36 +0530 Subject: [PATCH 051/200] feat(tooltip-icon-button): Added tooltips to buttons --- src/components/HeaderWithCloseButton.js | 14 ++++++----- src/languages/en.js | 2 ++ src/languages/es.js | 2 ++ src/pages/home/HeaderView.js | 33 +++++++++++++++---------- 4 files changed, 32 insertions(+), 19 deletions(-) diff --git a/src/components/HeaderWithCloseButton.js b/src/components/HeaderWithCloseButton.js index 09487b5e986c..b5a332f078e1 100755 --- a/src/components/HeaderWithCloseButton.js +++ b/src/components/HeaderWithCloseButton.js @@ -58,12 +58,14 @@ const HeaderWithCloseButton = props => ( ]} > {props.shouldShowBackButton && ( - - - + + + + + )}
diff --git a/src/languages/en.js b/src/languages/en.js index 57d435e4a7db..5512cc5fd6ca 100755 --- a/src/languages/en.js +++ b/src/languages/en.js @@ -37,6 +37,7 @@ export default { recents: 'Recents', close: 'Close', download: 'Download', + pin: 'Pin', back: 'Back', saveAndContinue: 'Save & Continue', settings: 'Settings', @@ -103,6 +104,7 @@ export default { nameEmailOrPhoneNumber: 'Name, email, or phone number', }, videoChatButtonAndMenu: { + tooltip: 'Video Chat', zoom: 'Zoom', googleMeet: 'Google Meet', }, diff --git a/src/languages/es.js b/src/languages/es.js index 91b35d9cdb51..7a5727b4a622 100644 --- a/src/languages/es.js +++ b/src/languages/es.js @@ -37,6 +37,7 @@ export default { recents: 'Recientes', close: 'Cerrar', download: 'Descargar', + pin: 'Alfiler', back: 'De vuelta', saveAndContinue: 'Guardar y Continuar', settings: 'Configuración', @@ -103,6 +104,7 @@ export default { nameEmailOrPhoneNumber: 'Nombre, email o número de teléfono', }, videoChatButtonAndMenu: { + tooltip: 'Chat de video', zoom: 'Zoom', googleMeet: 'Google Meet', }, diff --git a/src/pages/home/HeaderView.js b/src/pages/home/HeaderView.js index 4f3149f02fee..93e766ce16ca 100644 --- a/src/pages/home/HeaderView.js +++ b/src/pages/home/HeaderView.js @@ -25,6 +25,7 @@ import withLocalize, {withLocalizePropTypes} from '../../components/withLocalize import CONST from '../../CONST'; import {getDefaultRoomSubtitle, isDefaultRoom, isArchivedRoom} from '../../libs/reportUtils'; import Text from '../../components/Text'; +import Tooltip from '../../components/Tooltip'; const propTypes = { /** Toggles the navigationMenu open and closed */ @@ -96,12 +97,14 @@ const HeaderView = (props) => { {props.isSmallScreenWidth && ( - - - + + + + + )} {props.report && props.report.reportName && ( { {props.report.hasOutstandingIOU && ( )} - - togglePinnedState(props.report)} - style={[styles.touchableButtonImage, styles.mr0]} - > - - + + + + + togglePinnedState(props.report)} + style={[styles.touchableButtonImage, styles.mr0]} + > + + + )} From 45e21bd276a1c1aa8ec3f90c36b9f283ea9d7601 Mon Sep 17 00:00:00 2001 From: Manan Jadhav Date: Sat, 14 Aug 2021 12:02:34 +0530 Subject: [PATCH 052/200] refactor(tooltip-icon-button): Moved tooltip to pressable from parent comp --- src/components/VideoChatButtonAndMenu.js | 39 +++++++++++++----------- src/pages/home/HeaderView.js | 5 ++- 2 files changed, 23 insertions(+), 21 deletions(-) diff --git a/src/components/VideoChatButtonAndMenu.js b/src/components/VideoChatButtonAndMenu.js index 437bcd957311..ffaf648fdabb 100755 --- a/src/components/VideoChatButtonAndMenu.js +++ b/src/components/VideoChatButtonAndMenu.js @@ -17,6 +17,7 @@ import withLocalize, {withLocalizePropTypes} from './withLocalize'; import compose from '../libs/compose'; import Navigation from '../libs/Navigation/Navigation'; import ROUTES from '../ROUTES'; +import Tooltip from './Tooltip'; const propTypes = { ...withLocalizePropTypes, @@ -95,24 +96,26 @@ class VideoChatButtonAndMenu extends Component { ref={el => this.videoChatIconWrapper = el} onLayout={this.measureVideoChatIconPosition} > - { - // If this is the Concierge chat, we'll open the modal for requesting a setup call instead - if (this.props.isConcierge) { - Navigation.navigate(ROUTES.REQUEST_CALL); - return; - } - this.toggleVideoChatMenu(); - }} - style={[styles.touchableButtonImage, styles.mr0]} - > - - + + { + // If this is the Concierge chat, we'll open the modal for requesting a setup call instead + if (this.props.isConcierge) { + Navigation.navigate(ROUTES.REQUEST_CALL); + return; + } + this.toggleVideoChatMenu(); + }} + style={[styles.touchableButtonImage, styles.mr0]} + > + + + { {props.report.hasOutstandingIOU && ( )} - - - + + togglePinnedState(props.report)} From a01af101b7daf7dbd8794d8ac028f70ed1b1990e Mon Sep 17 00:00:00 2001 From: Manan Jadhav Date: Sat, 14 Aug 2021 12:05:58 +0530 Subject: [PATCH 053/200] fix(tooltip-icon-button): change tooltip label based on condition --- src/languages/en.js | 1 + src/languages/es.js | 1 + src/pages/home/HeaderView.js | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/languages/en.js b/src/languages/en.js index 5512cc5fd6ca..ee6a1b59070b 100755 --- a/src/languages/en.js +++ b/src/languages/en.js @@ -38,6 +38,7 @@ export default { close: 'Close', download: 'Download', pin: 'Pin', + unPin: 'Unpin', back: 'Back', saveAndContinue: 'Save & Continue', settings: 'Settings', diff --git a/src/languages/es.js b/src/languages/es.js index 7a5727b4a622..7e6ce0894a61 100644 --- a/src/languages/es.js +++ b/src/languages/es.js @@ -38,6 +38,7 @@ export default { close: 'Cerrar', download: 'Descargar', pin: 'Alfiler', + unPin: 'Desprender', back: 'De vuelta', saveAndContinue: 'Guardar y Continuar', settings: 'Configuración', diff --git a/src/pages/home/HeaderView.js b/src/pages/home/HeaderView.js index c2c34a6ab0ec..e43fd8377535 100644 --- a/src/pages/home/HeaderView.js +++ b/src/pages/home/HeaderView.js @@ -163,7 +163,7 @@ const HeaderView = (props) => { )} - + togglePinnedState(props.report)} style={[styles.touchableButtonImage, styles.mr0]} From a2aac3831227d8237a15c1f77a1f7a4c6785d01c Mon Sep 17 00:00:00 2001 From: Manan Jadhav Date: Sat, 14 Aug 2021 15:47:50 +0530 Subject: [PATCH 054/200] fix(tooltip-icon-button): Added tooltip to AvatarImagePicker --- src/components/AvatarWithImagePicker.js | 79 +++++++++++++------------ src/languages/en.js | 1 + src/languages/es.js | 1 + 3 files changed, 43 insertions(+), 38 deletions(-) diff --git a/src/components/AvatarWithImagePicker.js b/src/components/AvatarWithImagePicker.js index 27f969259bd2..3d35be886540 100644 --- a/src/components/AvatarWithImagePicker.js +++ b/src/components/AvatarWithImagePicker.js @@ -11,6 +11,7 @@ import { import styles from '../styles/styles'; import themeColors from '../styles/themes/default'; import AttachmentPicker from './AttachmentPicker'; +import Tooltip from './Tooltip'; import withLocalize, {withLocalizePropTypes} from './withLocalize'; import variables from '../styles/variables'; @@ -99,45 +100,47 @@ class AvatarWithImagePicker extends React.Component { const additionalStyles = _.isArray(this.props.style) ? this.props.style : [this.props.style]; return ( - - {this.props.avatarURL - ? ( - - ) - : ( - - )} - - {({openPicker}) => ( - <> - this.setState({isMenuVisible: true})} - > - - - this.setState({isMenuVisible: false})} - onItemSelected={() => this.setState({isMenuVisible: false})} - menuItems={this.createMenuItems(openPicker)} - anchorPosition={this.props.anchorPosition} - animationIn="fadeInDown" - animationOut="fadeOutUp" + + + {this.props.avatarURL + ? ( + - - )} - - + ) + : ( + + )} + + {({openPicker}) => ( + <> + this.setState({isMenuVisible: true})} + > + + + this.setState({isMenuVisible: false})} + onItemSelected={() => this.setState({isMenuVisible: false})} + menuItems={this.createMenuItems(openPicker)} + anchorPosition={this.props.anchorPosition} + animationIn="fadeInDown" + animationOut="fadeOutUp" + /> + + )} + + + ); } diff --git a/src/languages/en.js b/src/languages/en.js index ee6a1b59070b..2d8b1a808660 100755 --- a/src/languages/en.js +++ b/src/languages/en.js @@ -200,6 +200,7 @@ export default { avatarWithImagePicker: { uploadPhoto: 'Upload Photo', removePhoto: 'Remove Photo', + editImage: 'Edit Photo', }, profilePage: { profile: 'Profile', diff --git a/src/languages/es.js b/src/languages/es.js index 7e6ce0894a61..c01162a09315 100644 --- a/src/languages/es.js +++ b/src/languages/es.js @@ -200,6 +200,7 @@ export default { avatarWithImagePicker: { uploadPhoto: 'Subir Foto', removePhoto: 'Eliminar Foto', + editImage: 'Editar Foto', }, profilePage: { profile: 'Perfil', From 09ebd0aadee5eaed3304a8618f850d143085418d Mon Sep 17 00:00:00 2001 From: Aman Ansari Date: Mon, 16 Aug 2021 15:49:46 +0530 Subject: [PATCH 055/200] add requested changes --- src/libs/OptionsListUtils.js | 63 ++++++++++++++++++------------------ 1 file changed, 31 insertions(+), 32 deletions(-) diff --git a/src/libs/OptionsListUtils.js b/src/libs/OptionsListUtils.js index c516666c0202..8fc57b704904 100644 --- a/src/libs/OptionsListUtils.js +++ b/src/libs/OptionsListUtils.js @@ -277,6 +277,36 @@ function isSearchStringMatch(searchValue, searchText, participantNames = new Set }); } +/** + * Returns the given userDetails is currentUser or not. + * @param {Object} userDetails + * @returns {Bool} + */ + +function isCurrentUser(userDetails) { + if (!userDetails) { + // If userDetails is null or undefined + return false; + } + + // If user login is mobile number, append sms domain if not appended already just a fail safe. + const userDetailsLogin = addSMSDomainIfPhoneNumber(userDetails.login); + + // Initial check with currentUserLogin + let result = currentUserLogin.toLowerCase() === userDetailsLogin.toLowerCase(); + const {loginList} = currentUser; + let index = 0; + + // Checking userDetailsLogin against to current user login options. + while (index < loginList.length && !result) { + if (loginList[index].partnerUserID.toLowerCase() === userDetailsLogin.toLowerCase()) { + result = true; + } + index++; + } + return result; +} + /** * Build the options * @@ -466,7 +496,6 @@ function getOptions(reports, personalDetails, draftComments, activeReportID, { if (searchValue && recentReportOptions.length === 0 && personalDetailsOptions.length === 0 - // eslint-disable-next-line no-use-before-define && !isCurrentUser({login: searchValue}) && _.every(selectedOptions, option => option.login !== searchValue) && ((Str.isValidEmail(searchValue) && !Str.isDomainEmail(searchValue)) || Str.isValidPhone(searchValue)) @@ -724,38 +753,9 @@ function getReportIcons(report, personalDetails) { .map(item => item.avatar); } -/** - * Returns the given userDetails is currentUser or not. - * @param {Object} userDetails - * @returns {Bool} - */ - -function isCurrentUser(userDetails) { - if (!userDetails) { - // If userDetails is null or undefined - return false; - } - - // If user login is mobile number, append sms domain if not appended already just a fail safe. - const userDetailsLogin = addSMSDomainIfPhoneNumber(userDetails.login); - - // Initial check with currentUserLogin - let result = currentUserLogin.toLowerCase() === userDetailsLogin.toLowerCase(); - const {loginList} = currentUser; - let index = 0; - - // Checking userDetailsLogin against to current user login options. - while (index < loginList.length && !result) { - if (loginList[index].partnerUserID.toLowerCase() === userDetailsLogin.toLowerCase()) { - result = true; - } - index++; - } - return result; -} - export { addSMSDomainIfPhoneNumber, + isCurrentUser, getSearchOptions, getNewChatOptions, getNewGroupOptions, @@ -767,5 +767,4 @@ export { getIOUConfirmationOptionsFromParticipants, getDefaultAvatar, getReportIcons, - isCurrentUser, }; From 296151771c9f978f0db1349167419885555d8feb Mon Sep 17 00:00:00 2001 From: Manan Jadhav Date: Mon, 16 Aug 2021 18:07:51 +0530 Subject: [PATCH 056/200] refactor(tooltip-icon-button): Updated translations and added tooltip to send --- src/languages/es.js | 8 +++---- src/pages/home/report/ReportActionCompose.js | 22 +++++++++++--------- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/src/languages/es.js b/src/languages/es.js index c01162a09315..660d670b6288 100644 --- a/src/languages/es.js +++ b/src/languages/es.js @@ -37,9 +37,9 @@ export default { recents: 'Recientes', close: 'Cerrar', download: 'Descargar', - pin: 'Alfiler', - unPin: 'Desprender', - back: 'De vuelta', + pin: 'Anclar', + unPin: 'Desanclar', + back: 'Volver', saveAndContinue: 'Guardar y Continuar', settings: 'Configuración', termsOfService: 'Términos de servicio', @@ -105,7 +105,7 @@ export default { nameEmailOrPhoneNumber: 'Nombre, email o número de teléfono', }, videoChatButtonAndMenu: { - tooltip: 'Chat de video', + tooltip: 'Videollamada', zoom: 'Zoom', googleMeet: 'Google Meet', }, diff --git a/src/pages/home/report/ReportActionCompose.js b/src/pages/home/report/ReportActionCompose.js index f13c43f84f51..943d1e899902 100755 --- a/src/pages/home/report/ReportActionCompose.js +++ b/src/pages/home/report/ReportActionCompose.js @@ -635,16 +635,18 @@ class ReportActionCompose extends React.Component { )} - - - + + + + + {this.props.network.isOffline ? ( From b186790c2648d565c46e20a6617e45e4d5ef9a6d Mon Sep 17 00:00:00 2001 From: Aman Ansari Date: Mon, 16 Aug 2021 21:06:24 +0530 Subject: [PATCH 057/200] fix logic --- src/libs/OptionsListUtils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/OptionsListUtils.js b/src/libs/OptionsListUtils.js index 8fc57b704904..a3bd6d6ad494 100644 --- a/src/libs/OptionsListUtils.js +++ b/src/libs/OptionsListUtils.js @@ -294,7 +294,7 @@ function isCurrentUser(userDetails) { // Initial check with currentUserLogin let result = currentUserLogin.toLowerCase() === userDetailsLogin.toLowerCase(); - const {loginList} = currentUser; + const loginList = _.isEmpty(currentUser) ? [] : currentUser.loginList; let index = 0; // Checking userDetailsLogin against to current user login options. From 16fbade73ca56fd4a4a0d15e89cc68ad036849a8 Mon Sep 17 00:00:00 2001 From: Manan Jadhav Date: Mon, 16 Aug 2021 21:11:19 +0530 Subject: [PATCH 058/200] fix(tooltip-icon-button): Added tooltip for add + button --- src/languages/en.js | 2 ++ src/languages/es.js | 2 ++ src/pages/home/report/ReportActionCompose.js | 24 +++++++++++--------- 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/src/languages/en.js b/src/languages/en.js index 2d8b1a808660..a668fe70ca73 100755 --- a/src/languages/en.js +++ b/src/languages/en.js @@ -118,6 +118,7 @@ export default { phrase4: 'Welcome back to the New Expensify! Please enter your password.', }, reportActionCompose: { + addAction: 'Actions', sendAttachment: 'Send Attachment', addAttachment: 'Add Attachment', writeSomething: 'Write something...', @@ -150,6 +151,7 @@ export default { multipleUsers: 'Multiple users', }, sidebarScreen: { + fabAction: 'New Chat', newChat: 'New Chat', newGroup: 'New Group', headerChat: 'Chats', diff --git a/src/languages/es.js b/src/languages/es.js index 660d670b6288..d9fb973ced9c 100644 --- a/src/languages/es.js +++ b/src/languages/es.js @@ -118,6 +118,7 @@ export default { phrase4: '¡Bienvenido de vuelta al Nuevo Expensify! Por favor, introduce tu contraseña.', }, reportActionCompose: { + addAction: 'Actions', sendAttachment: 'Enviar adjunto', addAttachment: 'Agregar Archivo Adjunto', writeSomething: 'Escribe algo...', @@ -150,6 +151,7 @@ export default { multipleUsers: 'Varios usuarios', }, sidebarScreen: { + fabAction: 'Nuevo Chat', newChat: 'Nuevo Chat', newGroup: 'Nuevo Grupo', headerChat: 'Chats', diff --git a/src/pages/home/report/ReportActionCompose.js b/src/pages/home/report/ReportActionCompose.js index 943d1e899902..cbb46947cc33 100755 --- a/src/pages/home/report/ReportActionCompose.js +++ b/src/pages/home/report/ReportActionCompose.js @@ -485,17 +485,19 @@ class ReportActionCompose extends React.Component { {({openPicker}) => ( <> - { - e.preventDefault(); - this.setMenuVisibility(true); - }} - style={styles.chatItemAttachButton} - underlayColor={themeColors.componentBG} - disabled={isBlockedFromConcierge || isArchivedChatRoom} - > - - + + { + e.preventDefault(); + this.setMenuVisibility(true); + }} + style={styles.chatItemAttachButton} + underlayColor={themeColors.componentBG} + disabled={isBlockedFromConcierge || isArchivedChatRoom} + > + + + this.setMenuVisibility(false)} From 5e01516336fdf232e2596feb37da700e728404ba Mon Sep 17 00:00:00 2001 From: Manan Jadhav Date: Mon, 16 Aug 2021 22:10:35 +0530 Subject: [PATCH 059/200] refactor(tooltip-icon-button): Updated es translations --- src/languages/es.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/languages/es.js b/src/languages/es.js index d9fb973ced9c..d04aba7e1ad1 100644 --- a/src/languages/es.js +++ b/src/languages/es.js @@ -37,8 +37,8 @@ export default { recents: 'Recientes', close: 'Cerrar', download: 'Descargar', - pin: 'Anclar', - unPin: 'Desanclar', + pin: 'Fijar', + unPin: 'Desfijar', back: 'Volver', saveAndContinue: 'Guardar y Continuar', settings: 'Configuración', From db74e686e51b727ea89d3b2e021e9634826b5e17 Mon Sep 17 00:00:00 2001 From: Marc Glasser Date: Mon, 16 Aug 2021 07:29:10 -1000 Subject: [PATCH 060/200] update withOnyx to fix prop dependent key updates --- .../expensify/chat/generated/BasePackageList.java | 13 ------------- package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 3 insertions(+), 16 deletions(-) delete mode 100644 android/app/src/main/java/com/expensify/chat/generated/BasePackageList.java diff --git a/android/app/src/main/java/com/expensify/chat/generated/BasePackageList.java b/android/app/src/main/java/com/expensify/chat/generated/BasePackageList.java deleted file mode 100644 index 77ee44f9be7a..000000000000 --- a/android/app/src/main/java/com/expensify/chat/generated/BasePackageList.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.expensify.chat.generated; - -import java.util.Arrays; -import java.util.List; -import org.unimodules.core.interfaces.Package; - -public class BasePackageList { - public List getPackageList() { - return Arrays.asList( - new expo.modules.haptics.HapticsPackage() - ); - } -} diff --git a/package-lock.json b/package-lock.json index 4a73d8a34015..016ac467353a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -36092,8 +36092,8 @@ } }, "react-native-onyx": { - "version": "git+https://github.com/Expensify/react-native-onyx.git#2908a47dee13d99ce756bebb75740ed2f27c2d2e", - "from": "git+https://github.com/Expensify/react-native-onyx.git#2908a47dee13d99ce756bebb75740ed2f27c2d2e", + "version": "git+https://github.com/Expensify/react-native-onyx.git#131ef8d87ade63721263e0b0f8b17410a8cda312", + "from": "git+https://github.com/Expensify/react-native-onyx.git#131ef8d87ade63721263e0b0f8b17410a8cda312", "requires": { "ascii-table": "0.0.9", "expensify-common": "git+https://github.com/Expensify/expensify-common.git#2e5cff552cf132da90a3fb9756e6b4fb6ae7b40c", diff --git a/package.json b/package.json index 0f47a20d7e18..49b3a8506886 100644 --- a/package.json +++ b/package.json @@ -84,7 +84,7 @@ "react-native-image-picker": "^4.0.3", "react-native-keyboard-spacer": "^0.4.1", "react-native-modal": "^11.10.0", - "react-native-onyx": "git+https://github.com/Expensify/react-native-onyx.git#2908a47dee13d99ce756bebb75740ed2f27c2d2e", + "react-native-onyx": "git+https://github.com/Expensify/react-native-onyx.git#131ef8d87ade63721263e0b0f8b17410a8cda312", "react-native-pdf": "^6.2.2", "react-native-performance": "^2.0.0", "react-native-permissions": "^3.0.1", From 866c23f13f5d2a2a00cac0395b682eafa9f9413a Mon Sep 17 00:00:00 2001 From: Marc Glasser Date: Mon, 16 Aug 2021 07:32:26 -1000 Subject: [PATCH 061/200] accidental file deletion --- .../expensify/chat/generated/BasePackageList.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 android/app/src/main/java/com/expensify/chat/generated/BasePackageList.java diff --git a/android/app/src/main/java/com/expensify/chat/generated/BasePackageList.java b/android/app/src/main/java/com/expensify/chat/generated/BasePackageList.java new file mode 100644 index 000000000000..77ee44f9be7a --- /dev/null +++ b/android/app/src/main/java/com/expensify/chat/generated/BasePackageList.java @@ -0,0 +1,13 @@ +package com.expensify.chat.generated; + +import java.util.Arrays; +import java.util.List; +import org.unimodules.core.interfaces.Package; + +public class BasePackageList { + public List getPackageList() { + return Arrays.asList( + new expo.modules.haptics.HapticsPackage() + ); + } +} From 501dd9551872f7dfc825ca5b332f792e6529cfd2 Mon Sep 17 00:00:00 2001 From: Amal Nazeem Date: Mon, 16 Aug 2021 16:28:23 -0400 Subject: [PATCH 062/200] Use existing collection to determine if policies have been loaded --- src/pages/workspace/WorkspaceSidebar.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/pages/workspace/WorkspaceSidebar.js b/src/pages/workspace/WorkspaceSidebar.js index a39450f48ad4..2152e827b4ef 100644 --- a/src/pages/workspace/WorkspaceSidebar.js +++ b/src/pages/workspace/WorkspaceSidebar.js @@ -37,16 +37,20 @@ const propTypes = { name: PropTypes.string, }), + /** All the polices that we have loaded in Onyx */ + allPolicies: PropTypes.object, + ...withLocalizePropTypes, ...windowDimensionsPropTypes, }; const defaultProps = { policy: {}, + allPolicies: null, }; const WorkspaceSidebar = ({ - translate, isSmallScreenWidth, policy, areAllPoliciesLoaded, + translate, isSmallScreenWidth, policy, allPolicies, }) => { const menuItems = [ { @@ -67,7 +71,8 @@ const WorkspaceSidebar = ({ }, ]; - if (areAllPoliciesLoaded && _.isEmpty(policy)) { + // After all the policies have loaded, we can know if the given policyID points to a nonexistant workspace + if (allPolicies !== null && _.isEmpty(policy)) { Growl.error(translate('workspace.error.growlMessageInvalidPolicy'), CONST.GROWL.DURATION_LONG); Navigation.dismissModal(); create(); @@ -172,8 +177,8 @@ export default compose( return `${ONYXKEYS.COLLECTION.POLICY}${policyID}`; }, }, - areAllPoliciesLoaded: { - key: ONYXKEYS.ARE_ALL_POLICIES_LOADED, + allPolicies: { + key: ONYXKEYS.COLLECTION.POLICY, }, }), )(WorkspaceSidebar); From 78fbef950eeaf4fdeb1765334b885b472777d7b8 Mon Sep 17 00:00:00 2001 From: Manan Jadhav Date: Tue, 17 Aug 2021 03:48:13 +0530 Subject: [PATCH 063/200] fix(tooltip-icon-button): Added tooltip prop for FAB --- src/components/FAB/fabPropTypes.js | 3 +++ src/components/FAB/index.ios.js | 4 ++-- src/pages/home/sidebar/SidebarScreen.js | 2 ++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/components/FAB/fabPropTypes.js b/src/components/FAB/fabPropTypes.js index 1c934826d7eb..c9fd33a0f7bd 100644 --- a/src/components/FAB/fabPropTypes.js +++ b/src/components/FAB/fabPropTypes.js @@ -6,6 +6,9 @@ const fabPropTypes = { // Current state (active or not active) of the component isActive: PropTypes.bool.isRequired, + + // tooltip for the button + tooltip: PropTypes.string.isRequired, }; export default fabPropTypes; diff --git a/src/components/FAB/index.ios.js b/src/components/FAB/index.ios.js index 300bc3ee1eb6..befa6a0fd871 100644 --- a/src/components/FAB/index.ios.js +++ b/src/components/FAB/index.ios.js @@ -7,10 +7,10 @@ import FAB from './FAB'; import fabPropTypes from './fabPropTypes'; // KeyboardAvoidingView only need in IOS so that's the reason make platform specific FAB component. -function Fab({onPress, isActive}) { +function Fab({onPress, isActive, tooltip}) { return ( - + ); } diff --git a/src/pages/home/sidebar/SidebarScreen.js b/src/pages/home/sidebar/SidebarScreen.js index e908d5410d9f..51c975b9ae9b 100755 --- a/src/pages/home/sidebar/SidebarScreen.js +++ b/src/pages/home/sidebar/SidebarScreen.js @@ -102,7 +102,9 @@ class SidebarScreen extends Component { onAvatarClick={this.navigateToSettings} isSmallScreenWidth={this.props.isSmallScreenWidth} /> + Date: Mon, 16 Aug 2021 20:20:19 -0400 Subject: [PATCH 064/200] Use switch and add comments for clarity --- src/pages/LoginWithValidateCode2FAPage.js | 24 +++++++++++++++-------- src/pages/LoginWithValidateCodePage.js | 22 ++++++++++++++------- 2 files changed, 31 insertions(+), 15 deletions(-) diff --git a/src/pages/LoginWithValidateCode2FAPage.js b/src/pages/LoginWithValidateCode2FAPage.js index f2c9ee6255a8..2926c6997b78 100644 --- a/src/pages/LoginWithValidateCode2FAPage.js +++ b/src/pages/LoginWithValidateCode2FAPage.js @@ -31,7 +31,7 @@ const propTypes = { authToken: PropTypes.string, }), - /** The accountID and validateCode are passed via the URL */ + /** The route name, accountID, and validateCode are passed via the URL */ route: validateLinkPropTypes, /** List of betas */ @@ -84,13 +84,21 @@ class LoginWithValidateCode2FAPage extends Component { } rerouteToRelevantPage() { - if (this.props.route.name === SCREENS.LOGIN_WITH_VALIDATE_CODE_2FA_WORKSPACE_CARD) { - Navigation.navigate(ROUTES.getWorkspaceCardRoute(this.props.route.params.policyID)); - } else if (this.props.route.name === SCREENS.LOGIN_WITH_VALIDATE_CODE_2FA_NEW_WORKSPACE) { - // Create a new workspace so that the user will be routed to its settings page afterwards - create(); - } else { - Navigation.navigate(ROUTES.HOME); + // Since all 2FA validate code login routes lead to this component, redirect to the appropriate page based on + // the original route. + switch (this.props.route.name) { + case SCREENS.LOGIN_WITH_VALIDATE_CODE_2FA_WORKSPACE_CARD: + Navigation.navigate(ROUTES.getWorkspaceCardRoute(this.props.route.params.policyID)); + break; + + case SCREENS.LOGIN_WITH_VALIDATE_CODE_2FA_NEW_WORKSPACE: + // Creating a policy will reroute the user to the settings page afterwards + create(); + break; + + default: + Navigation.navigate(ROUTES.HOME); + break; } } diff --git a/src/pages/LoginWithValidateCodePage.js b/src/pages/LoginWithValidateCodePage.js index 32363195e937..706399ff520c 100644 --- a/src/pages/LoginWithValidateCodePage.js +++ b/src/pages/LoginWithValidateCodePage.js @@ -66,13 +66,21 @@ class LoginWithValidateCodePage extends Component { } rerouteToRelevantPage() { - if (this.props.route.name === SCREENS.LOGIN_WITH_VALIDATE_CODE_WORKSPACE_CARD) { - Navigation.navigate(ROUTES.getWorkspaceCardRoute(this.props.route.params.policyID)); - } else if (this.props.route.name === SCREENS.LOGIN_WITH_VALIDATE_CODE_NEW_WORKSPACE) { - // Create a new workspace so that the user will be routed to its settings page afterwards - create(); - } else { - Navigation.navigate(ROUTES.HOME); + // Since all validate code login routes lead to this component, redirect to the appropriate page based on + // the original route. + switch (this.props.route.name) { + case SCREENS.LOGIN_WITH_VALIDATE_CODE_2FA_WORKSPACE_CARD: + Navigation.navigate(ROUTES.getWorkspaceCardRoute(this.props.route.params.policyID)); + break; + + case SCREENS.LOGIN_WITH_VALIDATE_CODE_2FA_NEW_WORKSPACE: + // Creating a policy will reroute the user to the settings page afterwards + create(); + break; + + default: + Navigation.navigate(ROUTES.HOME); + break; } } From 96b4a4a627a06053aaaf781699495a41d80913c1 Mon Sep 17 00:00:00 2001 From: Amal Nazeem Date: Mon, 16 Aug 2021 21:21:14 -0400 Subject: [PATCH 065/200] Use existing policies collection to determine if policies have loaded --- src/ONYXKEYS.js | 2 +- src/libs/actions/Policy.js | 2 -- src/pages/workspace/WorkspaceSidebar.js | 5 ++++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/ONYXKEYS.js b/src/ONYXKEYS.js index 56d37527b7e0..1eebf32cc1be 100755 --- a/src/ONYXKEYS.js +++ b/src/ONYXKEYS.js @@ -19,7 +19,7 @@ export default { // Boolean flag set whenever the sidebar has loaded IS_SIDEBAR_LOADED: 'isSidebarLoaded', - // Boolean flag set after policies are loaded. This exists since policies are loaded only behind the freePlan beta. + // Boolean flag set after policies are loaded. This is since policies are loaded only behind the freePlan beta. // This and all calls to this can be removed after Permissions.canUseFreePlan() is no longer needed. ARE_ALL_POLICIES_LOADED: 'areAllPoliciesLoaded', diff --git a/src/libs/actions/Policy.js b/src/libs/actions/Policy.js index f90888ce5349..661a66b6ba27 100644 --- a/src/libs/actions/Policy.js +++ b/src/libs/actions/Policy.js @@ -95,8 +95,6 @@ function getPolicyList() { // And overwrite them with only the ones returned by the API call ...policyDataToStore, }); - - Onyx.set(ONYXKEYS.ARE_ALL_POLICIES_LOADED, true); } }); } diff --git a/src/pages/workspace/WorkspaceSidebar.js b/src/pages/workspace/WorkspaceSidebar.js index 2152e827b4ef..ffb564966b12 100644 --- a/src/pages/workspace/WorkspaceSidebar.js +++ b/src/pages/workspace/WorkspaceSidebar.js @@ -38,7 +38,9 @@ const propTypes = { }), /** All the polices that we have loaded in Onyx */ - allPolicies: PropTypes.object, + allPolicies: PropTypes.shape({ + id: PropTypes.string, + }), ...withLocalizePropTypes, ...windowDimensionsPropTypes, @@ -72,6 +74,7 @@ const WorkspaceSidebar = ({ ]; // After all the policies have loaded, we can know if the given policyID points to a nonexistant workspace + // allPolicies as a prop can be removed after Permissions.canUseFreePlan() is no longer needed and free plan is out of beta. if (allPolicies !== null && _.isEmpty(policy)) { Growl.error(translate('workspace.error.growlMessageInvalidPolicy'), CONST.GROWL.DURATION_LONG); Navigation.dismissModal(); From cc0c2b88fa87fa285cd191032458fd8e2bdc7d35 Mon Sep 17 00:00:00 2001 From: Amal Nazeem Date: Mon, 16 Aug 2021 21:21:29 -0400 Subject: [PATCH 066/200] Use screens relevant to validateCode not 2fa --- src/pages/LoginWithValidateCodePage.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/LoginWithValidateCodePage.js b/src/pages/LoginWithValidateCodePage.js index 706399ff520c..7a73b921c3d9 100644 --- a/src/pages/LoginWithValidateCodePage.js +++ b/src/pages/LoginWithValidateCodePage.js @@ -69,11 +69,11 @@ class LoginWithValidateCodePage extends Component { // Since all validate code login routes lead to this component, redirect to the appropriate page based on // the original route. switch (this.props.route.name) { - case SCREENS.LOGIN_WITH_VALIDATE_CODE_2FA_WORKSPACE_CARD: + case SCREENS.LOGIN_WITH_VALIDATE_CODE_WORKSPACE_CARD: Navigation.navigate(ROUTES.getWorkspaceCardRoute(this.props.route.params.policyID)); break; - case SCREENS.LOGIN_WITH_VALIDATE_CODE_2FA_NEW_WORKSPACE: + case SCREENS.LOGIN_WITH_VALIDATE_CODE_NEW_WORKSPACE: // Creating a policy will reroute the user to the settings page afterwards create(); break; From fac742ead7a576529d240335f045bb84f54c036f Mon Sep 17 00:00:00 2001 From: Amal Nazeem Date: Mon, 16 Aug 2021 21:29:11 -0400 Subject: [PATCH 067/200] Remove unused Onyx key --- src/ONYXKEYS.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/ONYXKEYS.js b/src/ONYXKEYS.js index 1eebf32cc1be..71b269290712 100755 --- a/src/ONYXKEYS.js +++ b/src/ONYXKEYS.js @@ -19,10 +19,6 @@ export default { // Boolean flag set whenever the sidebar has loaded IS_SIDEBAR_LOADED: 'isSidebarLoaded', - // Boolean flag set after policies are loaded. This is since policies are loaded only behind the freePlan beta. - // This and all calls to this can be removed after Permissions.canUseFreePlan() is no longer needed. - ARE_ALL_POLICIES_LOADED: 'areAllPoliciesLoaded', - NETWORK_REQUEST_QUEUE: 'networkRequestQueue', // What the active route is for our navigator. Global route that determines what views to display. From fcbeadf70369f25eeca03428f621e4e422e12ae6 Mon Sep 17 00:00:00 2001 From: Amal Nazeem Date: Mon, 16 Aug 2021 21:34:12 -0400 Subject: [PATCH 068/200] Clarify when this logic can be removed --- src/pages/workspace/WorkspaceSidebar.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pages/workspace/WorkspaceSidebar.js b/src/pages/workspace/WorkspaceSidebar.js index ffb564966b12..f35a92b3e5bb 100644 --- a/src/pages/workspace/WorkspaceSidebar.js +++ b/src/pages/workspace/WorkspaceSidebar.js @@ -74,7 +74,8 @@ const WorkspaceSidebar = ({ ]; // After all the policies have loaded, we can know if the given policyID points to a nonexistant workspace - // allPolicies as a prop can be removed after Permissions.canUseFreePlan() is no longer needed and free plan is out of beta. + // When free plan is out of beta and Permissions.canUseFreePlan() gets removed, + // all code involving 'allPolicies' can be removed since policy loading will no longer be delayed on login. if (allPolicies !== null && _.isEmpty(policy)) { Growl.error(translate('workspace.error.growlMessageInvalidPolicy'), CONST.GROWL.DURATION_LONG); Navigation.dismissModal(); From 2d4ec43a7b5767062a59b7b914f66b576d6edec8 Mon Sep 17 00:00:00 2001 From: Rajat Parashar Date: Tue, 17 Aug 2021 10:50:27 +0530 Subject: [PATCH 069/200] fix: context-menu on native devices --- .../{canUseTouchscreen.js => canUseTouchscreen/index.js} | 0 src/libs/canUseTouchscreen/index.native.js | 5 +++++ 2 files changed, 5 insertions(+) rename src/libs/{canUseTouchscreen.js => canUseTouchscreen/index.js} (100%) create mode 100644 src/libs/canUseTouchscreen/index.native.js diff --git a/src/libs/canUseTouchscreen.js b/src/libs/canUseTouchscreen/index.js similarity index 100% rename from src/libs/canUseTouchscreen.js rename to src/libs/canUseTouchscreen/index.js diff --git a/src/libs/canUseTouchscreen/index.native.js b/src/libs/canUseTouchscreen/index.native.js new file mode 100644 index 000000000000..4306b0cff3f6 --- /dev/null +++ b/src/libs/canUseTouchscreen/index.native.js @@ -0,0 +1,5 @@ +function canUseTouchScreen() { + return true; +} + +export default canUseTouchScreen; From 94f93bc294578dc78d46d4b4d72bccb06aa59624 Mon Sep 17 00:00:00 2001 From: Donnie Darko Date: Tue, 17 Aug 2021 10:51:53 +0500 Subject: [PATCH 070/200] change input color and remove its padding --- ios/NewExpensify.xcodeproj/project.pbxproj | 2 +- ios/Podfile.lock | 2 +- src/styles/styles.js | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ios/NewExpensify.xcodeproj/project.pbxproj b/ios/NewExpensify.xcodeproj/project.pbxproj index dd12a4cf01f4..0102b9f060be 100644 --- a/ios/NewExpensify.xcodeproj/project.pbxproj +++ b/ios/NewExpensify.xcodeproj/project.pbxproj @@ -879,7 +879,7 @@ CURRENT_PROJECT_VERSION = 3; DEVELOPMENT_TEAM = 368M544MTT; "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64; - INFOPLIST_FILE = "NewExpensify/Info.plist"; + INFOPLIST_FILE = NewExpensify/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 11.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; MARKETING_VERSION = 1.0.0; diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 3f434d1f589b..3b959e669135 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -877,7 +877,7 @@ SPEC CHECKSUMS: DoubleConversion: cf9b38bf0b2d048436d9a82ad2abe1404f11e7de EXHaptics: 337c160c148baa6f0e7166249f368965906e346b FBLazyVector: 7b423f9e248eae65987838148c36eec1dbfe0b53 - FBReactNativeSpec: 884d4cc2b011759361797a4035c47e10099393b5 + FBReactNativeSpec: c783a75db87c963c60afcd461fc38358805fe5ba Firebase: 54cdc8bc9c9b3de54f43dab86e62f5a76b47034f FirebaseABTesting: 4cb61aeeb50f60680af1c01fff781dfaf9293916 FirebaseAnalytics: 4751d6a49598a2b58da678cc07df696bcd809ab9 diff --git a/src/styles/styles.js b/src/styles/styles.js index d71e788b16a4..69a11041e920 100644 --- a/src/styles/styles.js +++ b/src/styles/styles.js @@ -536,6 +536,8 @@ const styles = { expensiTextInput: { fontFamily: fontFamily.GTA, fontSize: variables.fontSizeNormal, + color: themeColors.text, + ...spacing.pv0, }, expensiTextInputDesktop: addOutlineWidth({}, 0), expensiTextInputAndroid: left => ({ From 10dcaadb1569a9833d0ca53ce1a20a0637094c15 Mon Sep 17 00:00:00 2001 From: Sahil Khan Date: Tue, 17 Aug 2021 17:15:28 +0530 Subject: [PATCH 071/200] Add capatilisation to translation & some margin for the input --- src/components/IOUConfirmationList.js | 2 +- src/languages/en.js | 2 +- src/languages/es.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/IOUConfirmationList.js b/src/components/IOUConfirmationList.js index 33ba326f2042..6732d2c4bb1a 100755 --- a/src/components/IOUConfirmationList.js +++ b/src/components/IOUConfirmationList.js @@ -346,7 +346,7 @@ class IOUConfirmationList extends Component { disableRowInteractivity={!this.props.hasMultipleParticipants} optionHoveredStyle={hoverStyle} /> - + Date: Tue, 17 Aug 2021 17:31:42 +0530 Subject: [PATCH 072/200] Search label removed, added no results found instead --- src/libs/OptionsListUtils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/OptionsListUtils.js b/src/libs/OptionsListUtils.js index 718282357cc3..9b2bf977ceee 100644 --- a/src/libs/OptionsListUtils.js +++ b/src/libs/OptionsListUtils.js @@ -678,7 +678,7 @@ function getHeaderMessage(hasSelectableOptions, hasUserToInvite, searchValue, ma return translate(preferredLocale, 'messages.noPhoneNumber'); } - return searchValue; + return translate(preferredLocale, 'common.noResultsFound'); } return ''; From 3ca36e52f26abaa8088cb80bbe50843795dea098 Mon Sep 17 00:00:00 2001 From: Manan Jadhav Date: Tue, 17 Aug 2021 18:05:50 +0530 Subject: [PATCH 073/200] Revert "fix(tooltip-icon-button): Added tooltip prop for FAB" This reverts commit 78fbef950eeaf4fdeb1765334b885b472777d7b8. --- src/components/FAB/fabPropTypes.js | 3 --- src/components/FAB/index.ios.js | 4 ++-- src/pages/home/sidebar/SidebarScreen.js | 2 -- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/components/FAB/fabPropTypes.js b/src/components/FAB/fabPropTypes.js index c9fd33a0f7bd..1c934826d7eb 100644 --- a/src/components/FAB/fabPropTypes.js +++ b/src/components/FAB/fabPropTypes.js @@ -6,9 +6,6 @@ const fabPropTypes = { // Current state (active or not active) of the component isActive: PropTypes.bool.isRequired, - - // tooltip for the button - tooltip: PropTypes.string.isRequired, }; export default fabPropTypes; diff --git a/src/components/FAB/index.ios.js b/src/components/FAB/index.ios.js index befa6a0fd871..300bc3ee1eb6 100644 --- a/src/components/FAB/index.ios.js +++ b/src/components/FAB/index.ios.js @@ -7,10 +7,10 @@ import FAB from './FAB'; import fabPropTypes from './fabPropTypes'; // KeyboardAvoidingView only need in IOS so that's the reason make platform specific FAB component. -function Fab({onPress, isActive, tooltip}) { +function Fab({onPress, isActive}) { return ( - + ); } diff --git a/src/pages/home/sidebar/SidebarScreen.js b/src/pages/home/sidebar/SidebarScreen.js index 51c975b9ae9b..e908d5410d9f 100755 --- a/src/pages/home/sidebar/SidebarScreen.js +++ b/src/pages/home/sidebar/SidebarScreen.js @@ -102,9 +102,7 @@ class SidebarScreen extends Component { onAvatarClick={this.navigateToSettings} isSmallScreenWidth={this.props.isSmallScreenWidth} /> - Date: Tue, 17 Aug 2021 18:24:09 +0530 Subject: [PATCH 074/200] refactor(tooltip-icon-button): Changed translation for Actions --- src/languages/es.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/languages/es.js b/src/languages/es.js index d04aba7e1ad1..3c9f4f026dfb 100644 --- a/src/languages/es.js +++ b/src/languages/es.js @@ -118,7 +118,7 @@ export default { phrase4: '¡Bienvenido de vuelta al Nuevo Expensify! Por favor, introduce tu contraseña.', }, reportActionCompose: { - addAction: 'Actions', + addAction: 'Acción', sendAttachment: 'Enviar adjunto', addAttachment: 'Agregar Archivo Adjunto', writeSomething: 'Escribe algo...', From 9b2a47e86fb5e042196d8afcafb81da091a95501 Mon Sep 17 00:00:00 2001 From: Aman Ansari Date: Tue, 17 Aug 2021 19:19:18 +0530 Subject: [PATCH 075/200] select default/local currency --- src/pages/iou/IOUCurrencySelection.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/iou/IOUCurrencySelection.js b/src/pages/iou/IOUCurrencySelection.js index df3d418076b2..36f6bc01b58d 100644 --- a/src/pages/iou/IOUCurrencySelection.js +++ b/src/pages/iou/IOUCurrencySelection.js @@ -75,7 +75,7 @@ class IOUCurrencySelection extends Component { this.state = { searchValue: '', currencyData: currencyOptions, - toggledCurrencyCode: '', + toggledCurrencyCode: this.props.myPersonalDetails.localCurrencyCode, }; this.getCurrencyOptions = this.getCurrencyOptions.bind(this); this.toggleOption = this.toggleOption.bind(this); From 1ae25f2a34457392a1c7a13ecdaa6c5061a1e328 Mon Sep 17 00:00:00 2001 From: Aman Ansari Date: Tue, 17 Aug 2021 19:40:59 +0530 Subject: [PATCH 076/200] fix --- src/libs/OptionsListUtils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/OptionsListUtils.js b/src/libs/OptionsListUtils.js index a3bd6d6ad494..a4e7b27a9f69 100644 --- a/src/libs/OptionsListUtils.js +++ b/src/libs/OptionsListUtils.js @@ -294,7 +294,7 @@ function isCurrentUser(userDetails) { // Initial check with currentUserLogin let result = currentUserLogin.toLowerCase() === userDetailsLogin.toLowerCase(); - const loginList = _.isEmpty(currentUser) ? [] : currentUser.loginList; + const loginList = _.isEmpty(currentUser) || _.isEmpty(currentUser.loginList) ? [] : currentUser.loginList; let index = 0; // Checking userDetailsLogin against to current user login options. From 18494fafc47fbe0bd93e0508516a1ef4cea18544 Mon Sep 17 00:00:00 2001 From: Aman Ansari Date: Tue, 17 Aug 2021 22:43:54 +0530 Subject: [PATCH 077/200] update code --- src/pages/workspace/WorkspaceInvitePage.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/pages/workspace/WorkspaceInvitePage.js b/src/pages/workspace/WorkspaceInvitePage.js index 8f8700934224..e50a52266516 100644 --- a/src/pages/workspace/WorkspaceInvitePage.js +++ b/src/pages/workspace/WorkspaceInvitePage.js @@ -55,6 +55,7 @@ class WorkspaceInvitePage extends React.Component { welcomeNote: '', }; + this.focusEmailOrPhoneInput = this.focusEmailOrPhoneInput.bind(this); this.inviteUser = this.inviteUser.bind(this); this.emailOrPhoneInputRef = null; } @@ -70,6 +71,13 @@ class WorkspaceInvitePage extends React.Component { }); } + focusEmailOrPhoneInput() { + if (!this.emailOrPhoneInputRef) { + return; + } + this.emailOrPhoneInputRef.focus(); + } + /** * Handle the invite button click */ @@ -94,12 +102,7 @@ class WorkspaceInvitePage extends React.Component { render() { return ( - { - if (this.emailOrPhoneInputRef) { - this.emailOrPhoneInputRef.focus(); - } - }} - > + Date: Tue, 17 Aug 2021 07:33:13 -1000 Subject: [PATCH 078/200] Make Firebase traces an opt-in feature of global Timing class --- src/libs/actions/App.js | 4 ++-- src/libs/actions/Timing.js | 20 +++++++++++++++++--- src/libs/xhr.js | 0 src/pages/home/sidebar/SidebarScreen.js | 3 +-- 4 files changed, 20 insertions(+), 7 deletions(-) delete mode 100644 src/libs/xhr.js diff --git a/src/libs/actions/App.js b/src/libs/actions/App.js index 642f826ddf80..9686a5282316 100644 --- a/src/libs/actions/App.js +++ b/src/libs/actions/App.js @@ -6,10 +6,10 @@ import * as API from '../API'; import CONST from '../../CONST'; import Log from '../Log'; import CONFIG from '../../CONFIG'; -import Firebase from '../Firebase'; import ROUTES from '../../ROUTES'; import {printPerformanceMetrics} from '../Performance'; import canCapturePerformanceMetrics from '../canCapturePerformanceMetrics'; +import Timing from './Timing'; let currentUserAccountID; Onyx.connect({ @@ -60,7 +60,7 @@ function setSidebarLoaded() { } Onyx.set(ONYXKEYS.IS_SIDEBAR_LOADED, true); - Firebase.stopTrace(CONST.TIMING.SIDEBAR_LOADED); + Timing.end(CONST.TIMING.SIDEBAR_LOADED); if (!canCapturePerformanceMetrics()) { return; diff --git a/src/libs/actions/Timing.js b/src/libs/actions/Timing.js index a0cbae149360..0653340d0da4 100644 --- a/src/libs/actions/Timing.js +++ b/src/libs/actions/Timing.js @@ -1,6 +1,7 @@ import getPlatform from '../getPlatform'; import {Graphite_Timer} from '../API'; import {isDevelopment} from '../Environment/Environment'; +import Firebase from '../Firebase'; let timestampData = {}; @@ -8,9 +9,16 @@ let timestampData = {}; * Start a performance timing measurement * * @param {String} eventName + * @param {Boolean} shouldUseFirebase - adds an additional trace in Firebase */ -function start(eventName) { - timestampData[eventName] = Date.now(); +function start(eventName, shouldUseFirebase = false) { + timestampData[eventName] = {startTime: Date.now(), shouldUseFirebase}; + + if (!shouldUseFirebase) { + return; + } + + Firebase.startTrace(eventName); } /** @@ -21,7 +29,13 @@ function start(eventName) { */ function end(eventName, secondaryName = '') { if (eventName in timestampData) { - const eventTime = Date.now() - timestampData[eventName]; + const {startTime, shouldUseFirebase} = timestampData[eventName]; + const eventTime = Date.now() - startTime; + + if (shouldUseFirebase) { + Firebase.stopTrace(eventName); + } + const grafanaEventName = secondaryName ? `expensify.cash.${eventName}.${secondaryName}` : `expensify.cash.${eventName}`; diff --git a/src/libs/xhr.js b/src/libs/xhr.js deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/src/pages/home/sidebar/SidebarScreen.js b/src/pages/home/sidebar/SidebarScreen.js index e908d5410d9f..0b5be467c738 100755 --- a/src/pages/home/sidebar/SidebarScreen.js +++ b/src/pages/home/sidebar/SidebarScreen.js @@ -23,7 +23,6 @@ import { } from '../../../components/Icon/Expensicons'; import Permissions from '../../../libs/Permissions'; import ONYXKEYS from '../../../ONYXKEYS'; -import Firebase from '../../../libs/Firebase'; import {create} from '../../../libs/actions/Policy'; const propTypes = { @@ -50,7 +49,7 @@ class SidebarScreen extends Component { } componentDidMount() { - Firebase.startTrace(CONST.TIMING.SIDEBAR_LOADED); + Timing.start(CONST.TIMING.SIDEBAR_LOADED); } /** From 3e975e7d8551e8f687aca6a4ac6c05ef4ecdc05e Mon Sep 17 00:00:00 2001 From: Marc Glasser Date: Tue, 17 Aug 2021 08:21:19 -1000 Subject: [PATCH 079/200] actually use param --- src/pages/home/sidebar/SidebarScreen.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/home/sidebar/SidebarScreen.js b/src/pages/home/sidebar/SidebarScreen.js index 0b5be467c738..faa88d72d24b 100755 --- a/src/pages/home/sidebar/SidebarScreen.js +++ b/src/pages/home/sidebar/SidebarScreen.js @@ -49,7 +49,7 @@ class SidebarScreen extends Component { } componentDidMount() { - Timing.start(CONST.TIMING.SIDEBAR_LOADED); + Timing.start(CONST.TIMING.SIDEBAR_LOADED, true); } /** From b40cabf3316cc7a9e02b19207a4b698b3c479ba5 Mon Sep 17 00:00:00 2001 From: Amal Nazeem Date: Tue, 17 Aug 2021 14:32:08 -0400 Subject: [PATCH 080/200] Add todo to comment so it's clearer theres some action to be done in remove this --- src/pages/workspace/WorkspaceSidebar.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/workspace/WorkspaceSidebar.js b/src/pages/workspace/WorkspaceSidebar.js index f35a92b3e5bb..e0bbe1101f5a 100644 --- a/src/pages/workspace/WorkspaceSidebar.js +++ b/src/pages/workspace/WorkspaceSidebar.js @@ -74,7 +74,7 @@ const WorkspaceSidebar = ({ ]; // After all the policies have loaded, we can know if the given policyID points to a nonexistant workspace - // When free plan is out of beta and Permissions.canUseFreePlan() gets removed, + // TODO: When free plan is out of beta and Permissions.canUseFreePlan() gets removed, // all code involving 'allPolicies' can be removed since policy loading will no longer be delayed on login. if (allPolicies !== null && _.isEmpty(policy)) { Growl.error(translate('workspace.error.growlMessageInvalidPolicy'), CONST.GROWL.DURATION_LONG); From c2e0b6eb853ff047cf2f704b8db17cd0938466c9 Mon Sep 17 00:00:00 2001 From: Alexander Date: Tue, 17 Aug 2021 13:31:22 -0700 Subject: [PATCH 081/200] Fix styling --- src/components/InboxCallButton.js | 2 +- src/languages/en.js | 2 +- src/languages/es.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/InboxCallButton.js b/src/components/InboxCallButton.js index 9d76515dee99..e0048d1cfe62 100644 --- a/src/components/InboxCallButton.js +++ b/src/components/InboxCallButton.js @@ -25,7 +25,7 @@ const defaultProps = { const InboxCallButton = props => ( <> { diff --git a/src/languages/en.js b/src/languages/en.js index f0d5a0415675..3d2154480f11 100755 --- a/src/languages/en.js +++ b/src/languages/en.js @@ -618,6 +618,6 @@ export default { growlMessageInvalidPhone: 'That doesn’t look like a valid phone number. Try again with the country code.\ne.g. +15005550006', growlMessageEmptyName: 'Please provide both a first and last name so our Guides know how to address you!', growlMessageNoPersonalPolicy: 'I wasn’t able to find a personal policy to associate this Guides call with, please check your connection and try again.', - needHelp: 'Need help?', + needHelp: 'Help', }, }; diff --git a/src/languages/es.js b/src/languages/es.js index 3e1dd8715896..260ef8d54c40 100644 --- a/src/languages/es.js +++ b/src/languages/es.js @@ -620,6 +620,6 @@ export default { growlMessageInvalidPhone: 'El teléfono no es valido. Intentalo de nuevo agregando el código de país. P. ej.: +15005550006', growlMessageEmptyName: 'Por favor ingresa tu nombre completo', growlMessageNoPersonalPolicy: 'No he podido encontrar una póliza personal con la que asociar esta llamada a las Guías, compruebe su conexión e inténtelo de nuevo.', - needHelp: '¿Necesitas ayuda?', + needHelp: 'Ayuda', }, }; From 6cbeb32b6110985f578c5f36fcd14581d222aa94 Mon Sep 17 00:00:00 2001 From: Marc Glasser Date: Tue, 17 Aug 2021 12:12:13 -1000 Subject: [PATCH 082/200] Bump Onyx version --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 247e068ccc3d..2401f3affaca 100644 --- a/package-lock.json +++ b/package-lock.json @@ -36092,8 +36092,8 @@ } }, "react-native-onyx": { - "version": "git+https://github.com/Expensify/react-native-onyx.git#2908a47dee13d99ce756bebb75740ed2f27c2d2e", - "from": "git+https://github.com/Expensify/react-native-onyx.git#2908a47dee13d99ce756bebb75740ed2f27c2d2e", + "version": "git+https://github.com/Expensify/react-native-onyx.git#8a26c925087fee9841b5bd23d58604f408d2e13f", + "from": "git+https://github.com/Expensify/react-native-onyx.git#8a26c925087fee9841b5bd23d58604f408d2e13f", "requires": { "ascii-table": "0.0.9", "expensify-common": "git+https://github.com/Expensify/expensify-common.git#2e5cff552cf132da90a3fb9756e6b4fb6ae7b40c", diff --git a/package.json b/package.json index f3858bb37b18..edb742a0c4b3 100644 --- a/package.json +++ b/package.json @@ -84,7 +84,7 @@ "react-native-image-picker": "^4.0.3", "react-native-keyboard-spacer": "^0.4.1", "react-native-modal": "^11.10.0", - "react-native-onyx": "git+https://github.com/Expensify/react-native-onyx.git#2908a47dee13d99ce756bebb75740ed2f27c2d2e", + "react-native-onyx": "git+https://github.com/Expensify/react-native-onyx.git#8a26c925087fee9841b5bd23d58604f408d2e13f", "react-native-pdf": "^6.2.2", "react-native-performance": "^2.0.0", "react-native-permissions": "^3.0.1", From 406c7d788e53d59f826288406addc019bed90d4c Mon Sep 17 00:00:00 2001 From: Marc Glasser Date: Tue, 17 Aug 2021 12:24:25 -1000 Subject: [PATCH 083/200] update to use merge commit --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2401f3affaca..8c873b8bc772 100644 --- a/package-lock.json +++ b/package-lock.json @@ -36092,8 +36092,8 @@ } }, "react-native-onyx": { - "version": "git+https://github.com/Expensify/react-native-onyx.git#8a26c925087fee9841b5bd23d58604f408d2e13f", - "from": "git+https://github.com/Expensify/react-native-onyx.git#8a26c925087fee9841b5bd23d58604f408d2e13f", + "version": "git+https://github.com/Expensify/react-native-onyx.git#8ec207377f0fb1a83989118e60fb90b9bda0aaca", + "from": "git+https://github.com/Expensify/react-native-onyx.git#8ec207377f0fb1a83989118e60fb90b9bda0aaca", "requires": { "ascii-table": "0.0.9", "expensify-common": "git+https://github.com/Expensify/expensify-common.git#2e5cff552cf132da90a3fb9756e6b4fb6ae7b40c", diff --git a/package.json b/package.json index edb742a0c4b3..9d667cad274f 100644 --- a/package.json +++ b/package.json @@ -84,7 +84,7 @@ "react-native-image-picker": "^4.0.3", "react-native-keyboard-spacer": "^0.4.1", "react-native-modal": "^11.10.0", - "react-native-onyx": "git+https://github.com/Expensify/react-native-onyx.git#8a26c925087fee9841b5bd23d58604f408d2e13f", + "react-native-onyx": "git+https://github.com/Expensify/react-native-onyx.git#8ec207377f0fb1a83989118e60fb90b9bda0aaca", "react-native-pdf": "^6.2.2", "react-native-performance": "^2.0.0", "react-native-permissions": "^3.0.1", From 588ccb928bc80e23494e214b2028cfcb8cdb888d Mon Sep 17 00:00:00 2001 From: OSBotify Date: Tue, 17 Aug 2021 23:14:05 +0000 Subject: [PATCH 084/200] Update version to 1.0.86-1 --- android/app/build.gradle | 4 ++-- ios/NewExpensify/Info.plist | 2 +- ios/NewExpensifyTests/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 b2cca83f91f2..87a6aacb8bbf 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 1001008600 - versionName "1.0.86-0" + versionCode 1001008601 + versionName "1.0.86-1" } splits { abi { diff --git a/ios/NewExpensify/Info.plist b/ios/NewExpensify/Info.plist index 436947212543..121e687f2f42 100644 --- a/ios/NewExpensify/Info.plist +++ b/ios/NewExpensify/Info.plist @@ -30,7 +30,7 @@ CFBundleVersion - 1.0.86.0 + 1.0.86.1 ITSAppUsesNonExemptEncryption LSApplicationQueriesSchemes diff --git a/ios/NewExpensifyTests/Info.plist b/ios/NewExpensifyTests/Info.plist index 1b8b6aee20ad..f352246bf05c 100644 --- a/ios/NewExpensifyTests/Info.plist +++ b/ios/NewExpensifyTests/Info.plist @@ -19,6 +19,6 @@ CFBundleSignature ???? CFBundleVersion - 1.0.86.0 + 1.0.86.1 diff --git a/package-lock.json b/package-lock.json index 8c873b8bc772..a5a21ccb19fd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "new.expensify", - "version": "1.0.86-0", + "version": "1.0.86-1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 9d667cad274f..97cbce2d4621 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "new.expensify", - "version": "1.0.86-0", + "version": "1.0.86-1", "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.", From ca786d1a7e2d9893b46ad208461edbd3679e7a9b Mon Sep 17 00:00:00 2001 From: Marc Glasser Date: Tue, 17 Aug 2021 13:24:46 -1000 Subject: [PATCH 085/200] bump version --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 016ac467353a..e0afa2be99aa 100644 --- a/package-lock.json +++ b/package-lock.json @@ -36092,8 +36092,8 @@ } }, "react-native-onyx": { - "version": "git+https://github.com/Expensify/react-native-onyx.git#131ef8d87ade63721263e0b0f8b17410a8cda312", - "from": "git+https://github.com/Expensify/react-native-onyx.git#131ef8d87ade63721263e0b0f8b17410a8cda312", + "version": "git+https://github.com/Expensify/react-native-onyx.git#57ca276b3b83f38bc8825f98f7e68287a1e2af41", + "from": "git+https://github.com/Expensify/react-native-onyx.git#57ca276b3b83f38bc8825f98f7e68287a1e2af41", "requires": { "ascii-table": "0.0.9", "expensify-common": "git+https://github.com/Expensify/expensify-common.git#2e5cff552cf132da90a3fb9756e6b4fb6ae7b40c", diff --git a/package.json b/package.json index 49b3a8506886..ec81840a90f7 100644 --- a/package.json +++ b/package.json @@ -84,7 +84,7 @@ "react-native-image-picker": "^4.0.3", "react-native-keyboard-spacer": "^0.4.1", "react-native-modal": "^11.10.0", - "react-native-onyx": "git+https://github.com/Expensify/react-native-onyx.git#131ef8d87ade63721263e0b0f8b17410a8cda312", + "react-native-onyx": "git+https://github.com/Expensify/react-native-onyx.git#57ca276b3b83f38bc8825f98f7e68287a1e2af41", "react-native-pdf": "^6.2.2", "react-native-performance": "^2.0.0", "react-native-permissions": "^3.0.1", From 853c14e9b24e8945da73b0a0931bd9d01db229c5 Mon Sep 17 00:00:00 2001 From: Alexander Date: Tue, 17 Aug 2021 16:35:00 -0700 Subject: [PATCH 086/200] Fix comments --- src/components/HeaderWithCloseButton.js | 3 +- src/components/InboxCallButton.js | 50 ++++++++++++------------- 2 files changed, 27 insertions(+), 26 deletions(-) diff --git a/src/components/HeaderWithCloseButton.js b/src/components/HeaderWithCloseButton.js index 6d533e64fd4d..8ff09e7cae5f 100755 --- a/src/components/HeaderWithCloseButton.js +++ b/src/components/HeaderWithCloseButton.js @@ -33,9 +33,10 @@ const propTypes = { /** Whether we should show a download button */ shouldShowDownloadButton: PropTypes.bool, - /** Whether weshould show a inbox call button */ + /** Whether we should show a inbox call button */ shouldShowInboxCallButton: PropTypes.bool, + /** The task ID to associate with the call button, if we show it*/ inboxCallTaskID: PropTypes.string, ...withLocalizePropTypes, diff --git a/src/components/InboxCallButton.js b/src/components/InboxCallButton.js index e0048d1cfe62..d618f6aac309 100644 --- a/src/components/InboxCallButton.js +++ b/src/components/InboxCallButton.js @@ -15,6 +15,8 @@ import Text from './Text'; const propTypes = { ...withLocalizePropTypes, + + /** The task ID to queue a call for */ taskID: PropTypes.string, }; @@ -23,33 +25,31 @@ const defaultProps = { }; const InboxCallButton = props => ( - <> - + { + Navigation.navigate(ROUTES.getRequestCallRoute(props.taskID)); + }} + style={[styles.button, styles.buttonSmall]} > - { - Navigation.navigate(ROUTES.getRequestCallRoute(props.taskID)); - }} - style={[styles.button, styles.buttonSmall]} - > - - - - - - - {props.translate('requestCallPage.needHelp')} - - + + + + + + + {props.translate('requestCallPage.needHelp')} + - - - + + + ); InboxCallButton.propTypes = propTypes; From 3c65e28772766a0259c5f657778e6f3f40045d9d Mon Sep 17 00:00:00 2001 From: OSBotify Date: Tue, 17 Aug 2021 23:36:27 +0000 Subject: [PATCH 087/200] Update version to 1.0.86-2 --- android/app/build.gradle | 4 ++-- ios/NewExpensify/Info.plist | 2 +- ios/NewExpensifyTests/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 87a6aacb8bbf..c5a2f3deabec 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 1001008601 - versionName "1.0.86-1" + versionCode 1001008602 + versionName "1.0.86-2" } splits { abi { diff --git a/ios/NewExpensify/Info.plist b/ios/NewExpensify/Info.plist index 121e687f2f42..4cc608c2c9da 100644 --- a/ios/NewExpensify/Info.plist +++ b/ios/NewExpensify/Info.plist @@ -30,7 +30,7 @@ CFBundleVersion - 1.0.86.1 + 1.0.86.2 ITSAppUsesNonExemptEncryption LSApplicationQueriesSchemes diff --git a/ios/NewExpensifyTests/Info.plist b/ios/NewExpensifyTests/Info.plist index f352246bf05c..bb95038faaf4 100644 --- a/ios/NewExpensifyTests/Info.plist +++ b/ios/NewExpensifyTests/Info.plist @@ -19,6 +19,6 @@ CFBundleSignature ???? CFBundleVersion - 1.0.86.1 + 1.0.86.2 diff --git a/package-lock.json b/package-lock.json index 8d14221c2894..ab5d518b58ed 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "new.expensify", - "version": "1.0.86-1", + "version": "1.0.86-2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index bd8878610a82..8a4aab7649ab 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "new.expensify", - "version": "1.0.86-1", + "version": "1.0.86-2", "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.", From 71d3f50cd929f82a771e884dc6f33c6381256f7e Mon Sep 17 00:00:00 2001 From: Alexander Date: Tue, 17 Aug 2021 16:41:56 -0700 Subject: [PATCH 088/200] Style --- src/components/HeaderWithCloseButton.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/HeaderWithCloseButton.js b/src/components/HeaderWithCloseButton.js index 8ff09e7cae5f..2f290779e97c 100755 --- a/src/components/HeaderWithCloseButton.js +++ b/src/components/HeaderWithCloseButton.js @@ -36,7 +36,7 @@ const propTypes = { /** Whether we should show a inbox call button */ shouldShowInboxCallButton: PropTypes.bool, - /** The task ID to associate with the call button, if we show it*/ + /** The task ID to associate with the call button, if we show it */ inboxCallTaskID: PropTypes.string, ...withLocalizePropTypes, From cc8d7d344cccdc6aaa4a64fcdb66acd181b0347a Mon Sep 17 00:00:00 2001 From: Brandon Stites Date: Tue, 17 Aug 2021 18:36:25 -0600 Subject: [PATCH 089/200] Exclude cards that are not activated --- src/libs/actions/PaymentMethods.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libs/actions/PaymentMethods.js b/src/libs/actions/PaymentMethods.js index 5f995433e465..4647a4bc9998 100644 --- a/src/libs/actions/PaymentMethods.js +++ b/src/libs/actions/PaymentMethods.js @@ -15,6 +15,7 @@ function getPaymentMethods() { name: 'paypalMeAddress', includeDeleted: false, includeNotIssued: false, + excludeNotActivated: true, }) .then((response) => { Onyx.multiSet({ From 638fcdd86590aba535fa335b3742cb606def8921 Mon Sep 17 00:00:00 2001 From: Marc Glasser Date: Tue, 17 Aug 2021 15:16:24 -1000 Subject: [PATCH 090/200] fix onyx --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index a5a21ccb19fd..8a02a365a847 100644 --- a/package-lock.json +++ b/package-lock.json @@ -36092,8 +36092,8 @@ } }, "react-native-onyx": { - "version": "git+https://github.com/Expensify/react-native-onyx.git#8ec207377f0fb1a83989118e60fb90b9bda0aaca", - "from": "git+https://github.com/Expensify/react-native-onyx.git#8ec207377f0fb1a83989118e60fb90b9bda0aaca", + "version": "git+https://github.com/Expensify/react-native-onyx.git#cf254893f5168aa3a2be76166f05c93a858626cf", + "from": "git+https://github.com/Expensify/react-native-onyx.git#cf254893f5168aa3a2be76166f05c93a858626cf", "requires": { "ascii-table": "0.0.9", "expensify-common": "git+https://github.com/Expensify/expensify-common.git#2e5cff552cf132da90a3fb9756e6b4fb6ae7b40c", diff --git a/package.json b/package.json index 97cbce2d4621..bf26c5731824 100644 --- a/package.json +++ b/package.json @@ -84,7 +84,7 @@ "react-native-image-picker": "^4.0.3", "react-native-keyboard-spacer": "^0.4.1", "react-native-modal": "^11.10.0", - "react-native-onyx": "git+https://github.com/Expensify/react-native-onyx.git#8ec207377f0fb1a83989118e60fb90b9bda0aaca", + "react-native-onyx": "git+https://github.com/Expensify/react-native-onyx.git#cf254893f5168aa3a2be76166f05c93a858626cf", "react-native-pdf": "^6.2.2", "react-native-performance": "^2.0.0", "react-native-permissions": "^3.0.1", From 76a7aba4039e82dc5be1f2f7176101b338144172 Mon Sep 17 00:00:00 2001 From: Jack Nam Date: Tue, 17 Aug 2021 18:57:42 -0700 Subject: [PATCH 091/200] add changes for deploy message --- .github/actions/markPullRequestsAsDeployed/index.js | 11 +++++++++-- .../markPullRequestsAsDeployed.js | 11 +++++++++-- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/.github/actions/markPullRequestsAsDeployed/index.js b/.github/actions/markPullRequestsAsDeployed/index.js index 214c545167c9..eab49710c1d1 100644 --- a/.github/actions/markPullRequestsAsDeployed/index.js +++ b/.github/actions/markPullRequestsAsDeployed/index.js @@ -50,13 +50,19 @@ const workflowURL = `${process.env.GITHUB_SERVER_URL}/${process.env.GITHUB_REPOS /** * @param {String} deployer * @param {String} deployVerb + * @param {String} issueTitle * @returns {String} */ -function getDeployMessage(deployer, deployVerb) { +function getDeployMessage(deployer, deployVerb, issueTitle) { let message = `🚀 [${deployVerb}](${workflowURL}) to ${isProd ? 'production' : 'staging'}`; message += ` by @${deployer} in version: ${version} 🚀`; message += `\n\n platform | result \n ---|--- \n🤖 android 🤖|${androidResult} \n🖥 desktop 🖥|${desktopResult}`; message += `\n🍎 iOS 🍎|${iOSResult} \n🕸 web 🕸|${webResult}`; + + if (deployVerb === 'Cherry-picked' && !(/no qa/gi).test(issueTitle)) { + message += '\n\nThe PR title did not include [No QA], so this CP requires QA @Expensify/applauseleads'; + } + return message; } @@ -127,6 +133,7 @@ const run = function () { * (reflected in the branch name). */ let deployer = lodashGet(response, 'data.merged_by.login', ''); + const issueTitle = lodashGet(response, 'data.title', ''); const CPActorMatches = data.message .match(/Merge pull request #\d+ from Expensify\/(.+)-cherry-pick-staging-\d+/); if (_.isArray(CPActorMatches) && CPActorMatches.length === 2 && CPActorMatches[1] !== 'OSBotify') { @@ -134,7 +141,7 @@ const run = function () { } // Finally, comment on the PR - const deployMessage = getDeployMessage(deployer, isCP ? 'Cherry-picked' : 'Deployed'); + const deployMessage = getDeployMessage(deployer, isCP ? 'Cherry-picked' : 'Deployed', issueTitle); return commentPR(PR, deployMessage); }), Promise.resolve()); diff --git a/.github/actions/markPullRequestsAsDeployed/markPullRequestsAsDeployed.js b/.github/actions/markPullRequestsAsDeployed/markPullRequestsAsDeployed.js index 9c4d27d63baf..3ef462c8edec 100644 --- a/.github/actions/markPullRequestsAsDeployed/markPullRequestsAsDeployed.js +++ b/.github/actions/markPullRequestsAsDeployed/markPullRequestsAsDeployed.js @@ -40,13 +40,19 @@ const workflowURL = `${process.env.GITHUB_SERVER_URL}/${process.env.GITHUB_REPOS /** * @param {String} deployer * @param {String} deployVerb + * @param {String} issueTitle * @returns {String} */ -function getDeployMessage(deployer, deployVerb) { +function getDeployMessage(deployer, deployVerb, issueTitle) { let message = `🚀 [${deployVerb}](${workflowURL}) to ${isProd ? 'production' : 'staging'}`; message += ` by @${deployer} in version: ${version} 🚀`; message += `\n\n platform | result \n ---|--- \n🤖 android 🤖|${androidResult} \n🖥 desktop 🖥|${desktopResult}`; message += `\n🍎 iOS 🍎|${iOSResult} \n🕸 web 🕸|${webResult}`; + + if (deployVerb === 'Cherry-picked' && !(/no qa/gi).test(issueTitle)) { + message += '\n\nThe PR title did not include [No QA], so this CP requires QA @Expensify/applauseleads'; + } + return message; } @@ -117,6 +123,7 @@ const run = function () { * (reflected in the branch name). */ let deployer = lodashGet(response, 'data.merged_by.login', ''); + const issueTitle = lodashGet(response, 'data.title', ''); const CPActorMatches = data.message .match(/Merge pull request #\d+ from Expensify\/(.+)-cherry-pick-staging-\d+/); if (_.isArray(CPActorMatches) && CPActorMatches.length === 2 && CPActorMatches[1] !== 'OSBotify') { @@ -124,7 +131,7 @@ const run = function () { } // Finally, comment on the PR - const deployMessage = getDeployMessage(deployer, isCP ? 'Cherry-picked' : 'Deployed'); + const deployMessage = getDeployMessage(deployer, isCP ? 'Cherry-picked' : 'Deployed', issueTitle); return commentPR(PR, deployMessage); }), Promise.resolve()); From 2d4e779a8257ca07757a85069e4eb1bb647a42e1 Mon Sep 17 00:00:00 2001 From: Clem Dal Palu Date: Wed, 18 Aug 2021 10:29:17 +0200 Subject: [PATCH 092/200] Also change the Spanish about text --- src/languages/es.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/languages/es.js b/src/languages/es.js index 8d3dee117fbf..765790d889c0 100644 --- a/src/languages/es.js +++ b/src/languages/es.js @@ -215,7 +215,7 @@ export default { initialSettingsPage: { about: 'Acerca de', aboutPage: { - description: 'El nuevo aplicación Expensify está creado por una comunidad de desarrolladores de código abierto de todo el mundo. Ven y ayúdanos a construir la próxima generación de Expensify.', + description: 'La nueva Expensify está creada por una comunidad de desarrolladores de código abierto de todo el mundo. Ayúdanos a construir el futuro de Expensify.', appDownloadLinks: 'Enlaces para descargar la App', viewTheCode: 'Ver codigo', viewOpenJobs: 'Ver trabajos disponibles', From 1b15fa8ebc9843e7aea53f26e07c67da364f2390 Mon Sep 17 00:00:00 2001 From: Peter Velkov Date: Wed, 18 Aug 2021 12:19:16 +0300 Subject: [PATCH 093/200] Document why we pass the `currentDate` but we don't really use it --- src/pages/home/report/ReportActionItemDate.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/pages/home/report/ReportActionItemDate.js b/src/pages/home/report/ReportActionItemDate.js index 03434cb59468..8ee127a721fd 100644 --- a/src/pages/home/report/ReportActionItemDate.js +++ b/src/pages/home/report/ReportActionItemDate.js @@ -23,6 +23,9 @@ ReportActionItemDate.displayName = 'ReportActionItemDate'; export default compose( withLocalize, + + /** This component is hooked to the current date so that relative times can update when necessary + * e.g. past midnight */ withCurrentDate(), memo, )(ReportActionItemDate); From 07e6cea43a980fc7876b25d56cbe7ffec42f3638 Mon Sep 17 00:00:00 2001 From: Vit Horacek Date: Wed, 18 Aug 2021 10:47:11 +0100 Subject: [PATCH 094/200] Update the PR template to enforce formatting of the linked issues --- .github/PULL_REQUEST_TEMPLATE.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 632da16035b1..a005837deb0a 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -4,7 +4,15 @@ ### Fixed Issues - + $ GH_LINK ### Tests From 7846ed3b0bba8d37dd0577aece628904ab6f0e62 Mon Sep 17 00:00:00 2001 From: Vit Horacek Date: Wed, 18 Aug 2021 10:47:31 +0100 Subject: [PATCH 095/200] Remove dummy change introduced during testing webhook feature --- test.md | 1 - 1 file changed, 1 deletion(-) delete mode 100644 test.md diff --git a/test.md b/test.md deleted file mode 100644 index db0d8318b8f5..000000000000 --- a/test.md +++ /dev/null @@ -1 +0,0 @@ -This is for testing purposes, I will remove this file in subsequent PR. \ No newline at end of file From 20ee86ae45c92674cf290e8e09614281b915fac6 Mon Sep 17 00:00:00 2001 From: Amal Nazeem Date: Wed, 18 Aug 2021 11:45:53 -0400 Subject: [PATCH 096/200] Add missing doc --- src/pages/workspace/WorkspaceSidebar.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pages/workspace/WorkspaceSidebar.js b/src/pages/workspace/WorkspaceSidebar.js index e0bbe1101f5a..1e7a5bde9df4 100644 --- a/src/pages/workspace/WorkspaceSidebar.js +++ b/src/pages/workspace/WorkspaceSidebar.js @@ -39,6 +39,7 @@ const propTypes = { /** All the polices that we have loaded in Onyx */ allPolicies: PropTypes.shape({ + /** ID of the policy */ id: PropTypes.string, }), From 23798c7986896cdb751c6ab93f44ab1318cb7a48 Mon Sep 17 00:00:00 2001 From: Amal Nazeem Date: Wed, 18 Aug 2021 11:46:41 -0400 Subject: [PATCH 097/200] Use Policy to make code more contextual --- src/pages/LoginWithValidateCode2FAPage.js | 4 ++-- src/pages/LoginWithValidateCodePage.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/pages/LoginWithValidateCode2FAPage.js b/src/pages/LoginWithValidateCode2FAPage.js index 2926c6997b78..5484242544d7 100644 --- a/src/pages/LoginWithValidateCode2FAPage.js +++ b/src/pages/LoginWithValidateCode2FAPage.js @@ -18,7 +18,7 @@ import ONYXKEYS from '../ONYXKEYS'; import Navigation from '../libs/Navigation/Navigation'; import ROUTES from '../ROUTES'; import SCREENS from '../SCREENS'; -import {create} from '../libs/actions/Policy'; +import * as Policy from '../libs/actions/Policy'; import Permissions from '../libs/Permissions'; import FullScreenLoadingIndicator from '../components/FullscreenLoadingIndicator'; @@ -93,7 +93,7 @@ class LoginWithValidateCode2FAPage extends Component { case SCREENS.LOGIN_WITH_VALIDATE_CODE_2FA_NEW_WORKSPACE: // Creating a policy will reroute the user to the settings page afterwards - create(); + Policy.create(); break; default: diff --git a/src/pages/LoginWithValidateCodePage.js b/src/pages/LoginWithValidateCodePage.js index 7a73b921c3d9..c01fcbcc52e2 100644 --- a/src/pages/LoginWithValidateCodePage.js +++ b/src/pages/LoginWithValidateCodePage.js @@ -9,7 +9,7 @@ import Navigation from '../libs/Navigation/Navigation'; import ROUTES from '../ROUTES'; import SCREENS from '../SCREENS'; import {continueSessionFromECom} from '../libs/actions/Session'; -import {create} from '../libs/actions/Policy'; +import * as Policy from '../libs/actions/Policy'; import Permissions from '../libs/Permissions'; import FullScreenLoadingIndicator from '../components/FullscreenLoadingIndicator'; @@ -75,7 +75,7 @@ class LoginWithValidateCodePage extends Component { case SCREENS.LOGIN_WITH_VALIDATE_CODE_NEW_WORKSPACE: // Creating a policy will reroute the user to the settings page afterwards - create(); + Policy.create(); break; default: From b4d779c04eed42100f780890fc285ce134dfc753 Mon Sep 17 00:00:00 2001 From: Amal Nazeem Date: Wed, 18 Aug 2021 11:52:32 -0400 Subject: [PATCH 098/200] Use @ --- src/pages/workspace/WorkspaceSidebar.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/workspace/WorkspaceSidebar.js b/src/pages/workspace/WorkspaceSidebar.js index 1e7a5bde9df4..96d2132eb8d2 100644 --- a/src/pages/workspace/WorkspaceSidebar.js +++ b/src/pages/workspace/WorkspaceSidebar.js @@ -75,7 +75,7 @@ const WorkspaceSidebar = ({ ]; // After all the policies have loaded, we can know if the given policyID points to a nonexistant workspace - // TODO: When free plan is out of beta and Permissions.canUseFreePlan() gets removed, + // @TODO: When free plan is out of beta and Permissions.canUseFreePlan() gets removed, // all code involving 'allPolicies' can be removed since policy loading will no longer be delayed on login. if (allPolicies !== null && _.isEmpty(policy)) { Growl.error(translate('workspace.error.growlMessageInvalidPolicy'), CONST.GROWL.DURATION_LONG); From d87afd333222af17add31b7c9b03c3d1a86a8ab4 Mon Sep 17 00:00:00 2001 From: Alexander Date: Wed, 18 Aug 2021 09:32:48 -0700 Subject: [PATCH 099/200] Add tooltip --- src/components/InboxCallButton.js | 8 +++++--- src/languages/en.js | 1 + src/languages/es.js | 1 + 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/components/InboxCallButton.js b/src/components/InboxCallButton.js index d618f6aac309..ef271cfca57f 100644 --- a/src/components/InboxCallButton.js +++ b/src/components/InboxCallButton.js @@ -12,6 +12,7 @@ import compose from '../libs/compose'; import Navigation from '../libs/Navigation/Navigation'; import ROUTES from '../ROUTES'; import Text from './Text'; +import Tooltip from './Tooltip'; const propTypes = { ...withLocalizePropTypes, @@ -25,8 +26,9 @@ const defaultProps = { }; const InboxCallButton = props => ( - { @@ -49,7 +51,7 @@ const InboxCallButton = props => ( - + ); InboxCallButton.propTypes = propTypes; diff --git a/src/languages/en.js b/src/languages/en.js index 3d2154480f11..2f5197968f6c 100755 --- a/src/languages/en.js +++ b/src/languages/en.js @@ -619,5 +619,6 @@ export default { growlMessageEmptyName: 'Please provide both a first and last name so our Guides know how to address you!', growlMessageNoPersonalPolicy: 'I wasn’t able to find a personal policy to associate this Guides call with, please check your connection and try again.', needHelp: 'Help', + needHelpTooltip: 'Get live help from our team', }, }; diff --git a/src/languages/es.js b/src/languages/es.js index 260ef8d54c40..758910dd62dd 100644 --- a/src/languages/es.js +++ b/src/languages/es.js @@ -621,5 +621,6 @@ export default { growlMessageEmptyName: 'Por favor ingresa tu nombre completo', growlMessageNoPersonalPolicy: 'No he podido encontrar una póliza personal con la que asociar esta llamada a las Guías, compruebe su conexión e inténtelo de nuevo.', needHelp: 'Ayuda', + needHelpTooltip: 'Recibe ayuda telefónica de nuestro equipo', }, }; From 7b457eb3f414c88a20dea6cc8255457fc6edc833 Mon Sep 17 00:00:00 2001 From: Marc Glasser Date: Wed, 18 Aug 2021 06:50:32 -1000 Subject: [PATCH 100/200] use merge commit --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index a24988c994c3..a4a198767f33 100644 --- a/package-lock.json +++ b/package-lock.json @@ -36092,8 +36092,8 @@ } }, "react-native-onyx": { - "version": "git+https://github.com/Expensify/react-native-onyx.git#cf254893f5168aa3a2be76166f05c93a858626cf", - "from": "git+https://github.com/Expensify/react-native-onyx.git#cf254893f5168aa3a2be76166f05c93a858626cf", + "version": "git+https://github.com/Expensify/react-native-onyx.git#f3b24dd2c947bb4b9b60dc3718dc170f93f751f0", + "from": "git+https://github.com/Expensify/react-native-onyx.git#f3b24dd2c947bb4b9b60dc3718dc170f93f751f0", "requires": { "ascii-table": "0.0.9", "expensify-common": "git+https://github.com/Expensify/expensify-common.git#2e5cff552cf132da90a3fb9756e6b4fb6ae7b40c", diff --git a/package.json b/package.json index 3e4b845857ca..f6a2f88e8ae4 100644 --- a/package.json +++ b/package.json @@ -84,7 +84,7 @@ "react-native-image-picker": "^4.0.3", "react-native-keyboard-spacer": "^0.4.1", "react-native-modal": "^11.10.0", - "react-native-onyx": "git+https://github.com/Expensify/react-native-onyx.git#cf254893f5168aa3a2be76166f05c93a858626cf", + "react-native-onyx": "git+https://github.com/Expensify/react-native-onyx.git#f3b24dd2c947bb4b9b60dc3718dc170f93f751f0", "react-native-pdf": "^6.2.2", "react-native-performance": "^2.0.0", "react-native-permissions": "^3.0.1", From 0cc2837b44eaeb05bd0fdf8c328cf6cfaf8c7073 Mon Sep 17 00:00:00 2001 From: Jack Nam Date: Wed, 18 Aug 2021 10:14:31 -0700 Subject: [PATCH 101/200] update issueTitle to prtitle --- .github/actions/markPullRequestsAsDeployed/index.js | 6 +++--- .../markPullRequestsAsDeployed.js | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/actions/markPullRequestsAsDeployed/index.js b/.github/actions/markPullRequestsAsDeployed/index.js index eab49710c1d1..0a4b9a23f839 100644 --- a/.github/actions/markPullRequestsAsDeployed/index.js +++ b/.github/actions/markPullRequestsAsDeployed/index.js @@ -50,16 +50,16 @@ const workflowURL = `${process.env.GITHUB_SERVER_URL}/${process.env.GITHUB_REPOS /** * @param {String} deployer * @param {String} deployVerb - * @param {String} issueTitle + * @param {String} prTitle * @returns {String} */ -function getDeployMessage(deployer, deployVerb, issueTitle) { +function getDeployMessage(deployer, deployVerb, prTitle) { let message = `🚀 [${deployVerb}](${workflowURL}) to ${isProd ? 'production' : 'staging'}`; message += ` by @${deployer} in version: ${version} 🚀`; message += `\n\n platform | result \n ---|--- \n🤖 android 🤖|${androidResult} \n🖥 desktop 🖥|${desktopResult}`; message += `\n🍎 iOS 🍎|${iOSResult} \n🕸 web 🕸|${webResult}`; - if (deployVerb === 'Cherry-picked' && !(/no qa/gi).test(issueTitle)) { + if (deployVerb === 'Cherry-picked' && !(/no qa/gi).test(prTitle)) { message += '\n\nThe PR title did not include [No QA], so this CP requires QA @Expensify/applauseleads'; } diff --git a/.github/actions/markPullRequestsAsDeployed/markPullRequestsAsDeployed.js b/.github/actions/markPullRequestsAsDeployed/markPullRequestsAsDeployed.js index 3ef462c8edec..fe135ee636ff 100644 --- a/.github/actions/markPullRequestsAsDeployed/markPullRequestsAsDeployed.js +++ b/.github/actions/markPullRequestsAsDeployed/markPullRequestsAsDeployed.js @@ -40,16 +40,16 @@ const workflowURL = `${process.env.GITHUB_SERVER_URL}/${process.env.GITHUB_REPOS /** * @param {String} deployer * @param {String} deployVerb - * @param {String} issueTitle + * @param {String} prTitle * @returns {String} */ -function getDeployMessage(deployer, deployVerb, issueTitle) { +function getDeployMessage(deployer, deployVerb, prTitle) { let message = `🚀 [${deployVerb}](${workflowURL}) to ${isProd ? 'production' : 'staging'}`; message += ` by @${deployer} in version: ${version} 🚀`; message += `\n\n platform | result \n ---|--- \n🤖 android 🤖|${androidResult} \n🖥 desktop 🖥|${desktopResult}`; message += `\n🍎 iOS 🍎|${iOSResult} \n🕸 web 🕸|${webResult}`; - if (deployVerb === 'Cherry-picked' && !(/no qa/gi).test(issueTitle)) { + if (deployVerb === 'Cherry-picked' && !(/no qa/gi).test(prTitle)) { message += '\n\nThe PR title did not include [No QA], so this CP requires QA @Expensify/applauseleads'; } From f70497471a62b709b05d995c06571c19a20772a0 Mon Sep 17 00:00:00 2001 From: OSBotify Date: Wed, 18 Aug 2021 17:31:06 +0000 Subject: [PATCH 102/200] Update version to 1.0.86-3 --- android/app/build.gradle | 4 ++-- ios/NewExpensify/Info.plist | 2 +- ios/NewExpensifyTests/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 c5a2f3deabec..8764c39970b9 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 1001008602 - versionName "1.0.86-2" + versionCode 1001008603 + versionName "1.0.86-3" } splits { abi { diff --git a/ios/NewExpensify/Info.plist b/ios/NewExpensify/Info.plist index 4cc608c2c9da..7dbbb803c49e 100644 --- a/ios/NewExpensify/Info.plist +++ b/ios/NewExpensify/Info.plist @@ -30,7 +30,7 @@ CFBundleVersion - 1.0.86.2 + 1.0.86.3 ITSAppUsesNonExemptEncryption LSApplicationQueriesSchemes diff --git a/ios/NewExpensifyTests/Info.plist b/ios/NewExpensifyTests/Info.plist index bb95038faaf4..825fb729d8f6 100644 --- a/ios/NewExpensifyTests/Info.plist +++ b/ios/NewExpensifyTests/Info.plist @@ -19,6 +19,6 @@ CFBundleSignature ???? CFBundleVersion - 1.0.86.2 + 1.0.86.3 diff --git a/package-lock.json b/package-lock.json index a4a198767f33..d38a1eaf8dc0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "new.expensify", - "version": "1.0.86-2", + "version": "1.0.86-3", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index f6a2f88e8ae4..bf52c50538cb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "new.expensify", - "version": "1.0.86-2", + "version": "1.0.86-3", "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.", From 2e2b39f5778c59883b281a16d3418e8e18e35e95 Mon Sep 17 00:00:00 2001 From: Akshaya Salvi Date: Wed, 18 Aug 2021 23:08:47 +0530 Subject: [PATCH 103/200] Added rightElement for AttachmentView --- src/components/AttachmentView.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/components/AttachmentView.js b/src/components/AttachmentView.js index 6e2d7c03225f..575be58d7983 100755 --- a/src/components/AttachmentView.js +++ b/src/components/AttachmentView.js @@ -20,6 +20,8 @@ const propTypes = { name: PropTypes.string, }), + rightElement: PropTypes.element, + ...withLocalizePropTypes, }; @@ -27,6 +29,7 @@ const defaultProps = { file: { name: '', }, + rightElement: undefined, }; const AttachmentView = (props) => { @@ -58,6 +61,11 @@ const AttachmentView = (props) => { {props.file && props.file.name} + {props.rightElement && ( + + {props.rightElement} + + )} ); }; From 7c57fc9a6943b76d774e69e8e6eb3e85dc227dd9 Mon Sep 17 00:00:00 2001 From: Akshaya Salvi Date: Wed, 18 Aug 2021 23:09:30 +0530 Subject: [PATCH 104/200] Fetch Filename from the textNode (to be changed) --- .../AnchorForCommentsOnly/anchorForCommentsOnlyPropTypes.js | 3 +++ src/components/HTMLEngineProvider/BaseHTMLEngineProvider.js | 2 ++ 2 files changed, 5 insertions(+) diff --git a/src/components/AnchorForCommentsOnly/anchorForCommentsOnlyPropTypes.js b/src/components/AnchorForCommentsOnly/anchorForCommentsOnlyPropTypes.js index 04fddf8e02bf..9b1f8333318e 100644 --- a/src/components/AnchorForCommentsOnly/anchorForCommentsOnlyPropTypes.js +++ b/src/components/AnchorForCommentsOnly/anchorForCommentsOnlyPropTypes.js @@ -24,6 +24,8 @@ const propTypes = { /** Any additional styles to apply */ // eslint-disable-next-line react/forbid-prop-types style: PropTypes.any, + + text: PropTypes.string, }; const defaultProps = { @@ -33,6 +35,7 @@ const defaultProps = { shouldDownloadFile: false, children: null, style: {}, + text: '', }; export {propTypes, defaultProps}; diff --git a/src/components/HTMLEngineProvider/BaseHTMLEngineProvider.js b/src/components/HTMLEngineProvider/BaseHTMLEngineProvider.js index 4259d3e4de02..f12524793d68 100755 --- a/src/components/HTMLEngineProvider/BaseHTMLEngineProvider.js +++ b/src/components/HTMLEngineProvider/BaseHTMLEngineProvider.js @@ -67,6 +67,8 @@ function AnchorRenderer({tnode, key, style}) { // An auth token is needed to download Expensify chat attachments const isAttachment = Boolean(htmlAttribs['data-expensify-source']); + const fileName = isAttachment && tnode.domNode && tnode.domNode.children && tnode.domNode.children[0] && tnode.domNode.children[0].data ? tnode.domNode.children[0].data : null; + const target = htmlAttribs.target ?? (isAttachment ? null : '_blank'); return ( Date: Wed, 18 Aug 2021 23:10:27 +0530 Subject: [PATCH 105/200] replaced hyperlink with attachmentview based on condition --- .../BaseAnchorForCommentsOnly/index.js | 72 ++++++++++++------- 1 file changed, 48 insertions(+), 24 deletions(-) diff --git a/src/components/AnchorForCommentsOnly/BaseAnchorForCommentsOnly/index.js b/src/components/AnchorForCommentsOnly/BaseAnchorForCommentsOnly/index.js index c12ea1eb4275..4c67013f2eb9 100644 --- a/src/components/AnchorForCommentsOnly/BaseAnchorForCommentsOnly/index.js +++ b/src/components/AnchorForCommentsOnly/BaseAnchorForCommentsOnly/index.js @@ -1,11 +1,15 @@ import React from 'react'; -import {StyleSheet} from 'react-native'; +import {Pressable, StyleSheet} from 'react-native'; import lodashGet from 'lodash/get'; import Text from '../../Text'; +import Icon from '../../Icon'; import {propTypes, defaultProps} from '../anchorForCommentsOnlyPropTypes'; import PressableWithSecondaryInteraction from '../../PressableWithSecondaryInteraction'; import {showContextMenu} from '../../../pages/home/report/ContextMenu/ReportActionContextMenu'; import {CONTEXT_MENU_TYPES} from '../../../pages/home/report/ContextMenu/ContextMenuActions'; +import {Download} from '../../Icon/Expensicons'; +import AttachmentView from '../../AttachmentView'; +import fileDownload from '../../../libs/fileDownload'; /* @@ -17,34 +21,54 @@ const BaseAnchorForCommentsOnly = ({ target, children, style, + text, ...props }) => { let linkRef; return ( - { - showContextMenu( - CONTEXT_MENU_TYPES.LINK, - event, - href, - lodashGet(linkRef, 'current'), - ); - } - } - > - linkRef = el} - style={StyleSheet.flatten(style)} - accessibilityRole="link" - href={href} - hrefAttrs={{rel, target}} + + props.shouldDownloadFile + ? ( + { + fileDownload(href); + }} + > + + )} + /> + + ) + : ( + { + showContextMenu( + CONTEXT_MENU_TYPES.LINK, + event, + href, + lodashGet(linkRef, 'current'), + ); + } + } + > + linkRef = el} + style={StyleSheet.flatten(style)} + accessibilityRole="link" + href={href} + hrefAttrs={{rel, target}} // eslint-disable-next-line react/jsx-props-no-spreading - {...props} - > - {children} - - + {...props} + > + {children} + + + ) + ); }; From 7b52c25544ab4b77f222156819135481c13ce80e Mon Sep 17 00:00:00 2001 From: Akshaya Salvi Date: Wed, 18 Aug 2021 23:10:38 +0530 Subject: [PATCH 106/200] pass filename as prop --- src/components/HTMLEngineProvider/BaseHTMLEngineProvider.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/HTMLEngineProvider/BaseHTMLEngineProvider.js b/src/components/HTMLEngineProvider/BaseHTMLEngineProvider.js index f12524793d68..2f7a39b21e86 100755 --- a/src/components/HTMLEngineProvider/BaseHTMLEngineProvider.js +++ b/src/components/HTMLEngineProvider/BaseHTMLEngineProvider.js @@ -68,7 +68,7 @@ function AnchorRenderer({tnode, key, style}) { // An auth token is needed to download Expensify chat attachments const isAttachment = Boolean(htmlAttribs['data-expensify-source']); const fileName = isAttachment && tnode.domNode && tnode.domNode.children && tnode.domNode.children[0] && tnode.domNode.children[0].data ? tnode.domNode.children[0].data : null; - const target = htmlAttribs.target ?? (isAttachment ? null : '_blank'); + return ( From 622fef0cafae2338149f2fd54c2a3aba683b1418 Mon Sep 17 00:00:00 2001 From: Akshaya Salvi Date: Wed, 18 Aug 2021 23:27:49 +0530 Subject: [PATCH 107/200] cleaned up the data fetch with lodash.get --- src/components/HTMLEngineProvider/BaseHTMLEngineProvider.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/HTMLEngineProvider/BaseHTMLEngineProvider.js b/src/components/HTMLEngineProvider/BaseHTMLEngineProvider.js index 2f7a39b21e86..7053d7a4a4f7 100755 --- a/src/components/HTMLEngineProvider/BaseHTMLEngineProvider.js +++ b/src/components/HTMLEngineProvider/BaseHTMLEngineProvider.js @@ -10,6 +10,7 @@ import { splitBoxModelStyle, } from 'react-native-render-html'; import PropTypes from 'prop-types'; +import lodashGet from 'lodash/get'; import Config from '../../CONFIG'; import styles, {webViewStyles, getFontFamilyMonospace} from '../../styles/styles'; import fontFamily from '../../styles/fontFamily'; @@ -67,7 +68,7 @@ function AnchorRenderer({tnode, key, style}) { // An auth token is needed to download Expensify chat attachments const isAttachment = Boolean(htmlAttribs['data-expensify-source']); - const fileName = isAttachment && tnode.domNode && tnode.domNode.children && tnode.domNode.children[0] && tnode.domNode.children[0].data ? tnode.domNode.children[0].data : null; + const fileName = isAttachment ? lodashGet(tnode, 'domNode.children[0].data') : null; return ( Date: Wed, 18 Aug 2021 11:12:45 -0700 Subject: [PATCH 108/200] PR feedback --- src/components/HeaderWithCloseButton.js | 5 +---- src/components/VideoChatButtonAndMenu.js | 12 +++++------- src/pages/RequestCallPage.js | 2 ++ src/pages/home/HeaderView.js | 2 +- 4 files changed, 9 insertions(+), 12 deletions(-) diff --git a/src/components/HeaderWithCloseButton.js b/src/components/HeaderWithCloseButton.js index 2f290779e97c..24479b48554b 100755 --- a/src/components/HeaderWithCloseButton.js +++ b/src/components/HeaderWithCloseButton.js @@ -86,10 +86,7 @@ const HeaderWithCloseButton = props => ( ) } - { - props.shouldShowInboxCallButton && - - } + {props.shouldShowInboxCallButton && } { // If this is the Concierge chat, we'll open the modal for requesting a setup call instead - if (this.props.openInboxCall) { - Navigation.navigate(ROUTES.getRequestCallRoute(this.props.taskID)); + if (this.props.isConcierge) { + Navigation.navigate(ROUTES.getRequestCallRoute('NewExpensifyConciergeDM')); return; } this.toggleVideoChatMenu(); @@ -110,7 +108,7 @@ class VideoChatButtonAndMenu extends Component { > diff --git a/src/pages/RequestCallPage.js b/src/pages/RequestCallPage.js index d5c6c03abfd4..f6d4064edcea 100644 --- a/src/pages/RequestCallPage.js +++ b/src/pages/RequestCallPage.js @@ -53,8 +53,10 @@ const propTypes = { type: PropTypes.string, }).isRequired, + /** Route object from navigation */ route: PropTypes.shape({ params: PropTypes.shape({ + /** The task ID to request the call for */ taskID: PropTypes.string, }), }).isRequired, diff --git a/src/pages/home/HeaderView.js b/src/pages/home/HeaderView.js index d9fcf8a5b8a2..4f3149f02fee 100644 --- a/src/pages/home/HeaderView.js +++ b/src/pages/home/HeaderView.js @@ -158,7 +158,7 @@ const HeaderView = (props) => { {props.report.hasOutstandingIOU && ( )} - + togglePinnedState(props.report)} style={[styles.touchableButtonImage, styles.mr0]} From 3cd4f434527950c377818d61a3bcccb4511bf01e Mon Sep 17 00:00:00 2001 From: chiragsalian Date: Wed, 18 Aug 2021 11:19:27 -0700 Subject: [PATCH 109/200] Increase to 5 seconds --- src/libs/actions/BankAccounts.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/actions/BankAccounts.js b/src/libs/actions/BankAccounts.js index 78d8e0a1f9f4..69e2c696db7b 100644 --- a/src/libs/actions/BankAccounts.js +++ b/src/libs/actions/BankAccounts.js @@ -577,7 +577,7 @@ function validateBankAccount(bankAccountID, validateCode) { API.BankAccount_Validate({bankAccountID, validateCode}) .then((response) => { if (response.jsonCode === 200) { - Growl.show('Bank Account successfully validated!', CONST.GROWL.SUCCESS, 3000); + Growl.show('Bank Account successfully validated!', CONST.GROWL.SUCCESS, 5000); API.User_IsUsingExpensifyCard() .then(({isUsingExpensifyCard}) => { const reimbursementAccount = { From 18db232637dd377869f33730ac80a3c495ea62c7 Mon Sep 17 00:00:00 2001 From: Aldo Canepa Date: Wed, 18 Aug 2021 11:24:32 -0700 Subject: [PATCH 110/200] Handle errorText in TextInputWithLabel --- .../ExpensiTextInput/BaseExpensiTextInput.js | 85 ++++++++++--------- 1 file changed, 46 insertions(+), 39 deletions(-) diff --git a/src/components/ExpensiTextInput/BaseExpensiTextInput.js b/src/components/ExpensiTextInput/BaseExpensiTextInput.js index 6c911d4fde85..d6db9a275e72 100644 --- a/src/components/ExpensiTextInput/BaseExpensiTextInput.js +++ b/src/components/ExpensiTextInput/BaseExpensiTextInput.js @@ -4,6 +4,7 @@ import { } from 'react-native'; import Str from 'expensify-common/lib/str'; import ExpensiTextInputLabel from './ExpensiTextInputLabel'; +import Text from '../Text'; import {propTypes, defaultProps} from './propTypes'; import themeColors from '../../styles/themes/default'; import styles from '../../styles/styles'; @@ -118,51 +119,57 @@ class BaseExpensiTextInput extends Component { ignoreLabelTranslateX, innerRef, autoFocus, + errorText, ...inputProps } = this.props; const hasLabel = Boolean(label.length); return ( - - this.input.focus()} focusable={false}> - - {hasLabel ? ( - + + this.input.focus()} focusable={false}> + + {hasLabel ? ( + + ) : null} + { + if (typeof innerRef === 'function') { innerRef(ref); } + this.input = ref; + }} + // eslint-disable-next-line + {...inputProps} + value={value} + placeholder={(this.state.isFocused || !label) ? placeholder : null} + placeholderTextColor={themeColors.placeholderText} + underlineColorAndroid="transparent" + style={[...inputStyle, errorText ? styles.errorOutline : undefined]} + onFocus={this.onFocus} + onBlur={this.onBlur} + onChangeText={this.setValue} /> - ) : null} - { - if (typeof innerRef === 'function') { innerRef(ref); } - this.input = ref; - }} - // eslint-disable-next-line - {...inputProps} - value={value} - placeholder={(this.state.isFocused || !label) ? placeholder : null} - placeholderTextColor={themeColors.placeholderText} - underlineColorAndroid="transparent" - style={inputStyle} - onFocus={this.onFocus} - onBlur={this.onBlur} - onChangeText={this.setValue} - /> - - + + + + {errorText !== '' && ( + {errorText} + )} ); } From dccba860ef7e778c73838563b10f3b5a4ad81a51 Mon Sep 17 00:00:00 2001 From: joelbettner Date: Wed, 18 Aug 2021 12:26:02 -0600 Subject: [PATCH 111/200] import Text --- src/pages/ReimbursementAccount/IdentityForm.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pages/ReimbursementAccount/IdentityForm.js b/src/pages/ReimbursementAccount/IdentityForm.js index f352b9cd6751..038ef8e3cfb3 100644 --- a/src/pages/ReimbursementAccount/IdentityForm.js +++ b/src/pages/ReimbursementAccount/IdentityForm.js @@ -7,6 +7,7 @@ import styles from '../../styles/styles'; import withLocalize, {withLocalizePropTypes} from '../../components/withLocalize'; import {translateLocal} from '../../libs/translate'; import {hideBankAccountErrors} from '../../libs/actions/BankAccounts'; +import Text from '../../components/Text' const propTypes = { /** Style for wrapping View */ From 08f5275d502201a6431b1a62ad1480f41fa49741 Mon Sep 17 00:00:00 2001 From: joelbettner Date: Wed, 18 Aug 2021 12:35:31 -0600 Subject: [PATCH 112/200] Addinig missing semi-colon --- src/pages/ReimbursementAccount/IdentityForm.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/ReimbursementAccount/IdentityForm.js b/src/pages/ReimbursementAccount/IdentityForm.js index 038ef8e3cfb3..abba918e2619 100644 --- a/src/pages/ReimbursementAccount/IdentityForm.js +++ b/src/pages/ReimbursementAccount/IdentityForm.js @@ -7,7 +7,7 @@ import styles from '../../styles/styles'; import withLocalize, {withLocalizePropTypes} from '../../components/withLocalize'; import {translateLocal} from '../../libs/translate'; import {hideBankAccountErrors} from '../../libs/actions/BankAccounts'; -import Text from '../../components/Text' +import Text from '../../components/Text'; const propTypes = { /** Style for wrapping View */ From 924271fdfc8d9377adfe61b374654b60fd4c3ef2 Mon Sep 17 00:00:00 2001 From: Akshaya Salvi Date: Thu, 19 Aug 2021 00:23:42 +0530 Subject: [PATCH 113/200] Added attachment layout to native devices --- .../BaseAnchorForCommentsOnly/index.native.js | 47 ++++++++++++++----- 1 file changed, 34 insertions(+), 13 deletions(-) diff --git a/src/components/AnchorForCommentsOnly/BaseAnchorForCommentsOnly/index.native.js b/src/components/AnchorForCommentsOnly/BaseAnchorForCommentsOnly/index.native.js index 0cf0e3362838..187d1d01ca21 100644 --- a/src/components/AnchorForCommentsOnly/BaseAnchorForCommentsOnly/index.native.js +++ b/src/components/AnchorForCommentsOnly/BaseAnchorForCommentsOnly/index.native.js @@ -1,12 +1,15 @@ import React from 'react'; import lodashGet from 'lodash/get'; -import {Linking, StyleSheet} from 'react-native'; +import {Linking, StyleSheet, Pressable} from 'react-native'; import {propTypes, defaultProps} from '../anchorForCommentsOnlyPropTypes'; import fileDownload from '../../../libs/fileDownload'; import Text from '../../Text'; import PressableWithSecondaryInteraction from '../../PressableWithSecondaryInteraction'; import {showContextMenu} from '../../../pages/home/report/ContextMenu/ReportActionContextMenu'; import {CONTEXT_MENU_TYPES} from '../../../pages/home/report/ContextMenu/ContextMenuActions'; +import Icon from '../../Icon'; +import {Download} from '../../Icon/Expensicons'; +import AttachmentView from '../../AttachmentView'; /* * This is a default anchor component for regular links. @@ -16,12 +19,29 @@ const BaseAnchorForCommentsOnly = ({ children, style, shouldDownloadFile, + text, ...props }) => { let linkRef; return ( - { + fileDownload(href); + }} + > + + )} + /> + + ) + : ( + { showContextMenu( CONTEXT_MENU_TYPES.LINK, @@ -31,17 +51,18 @@ const BaseAnchorForCommentsOnly = ({ ); } } - onPress={() => (shouldDownloadFile ? fileDownload(href) : Linking.openURL(href))} - > - linkRef = el} - style={StyleSheet.flatten(style)} + onPress={() => Linking.openURL(href)} + > + linkRef = el} + style={StyleSheet.flatten(style)} // eslint-disable-next-line react/jsx-props-no-spreading - {...props} - > - {children} - - + {...props} + > + {children} + + + ) ); }; From 06b156e7540bd61648fdff0b2eb43794c992c0e4 Mon Sep 17 00:00:00 2001 From: Manan Jadhav Date: Thu, 19 Aug 2021 03:04:20 +0530 Subject: [PATCH 114/200] fix(md-links): Bumped expensify-common to support nested markdown links --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index d38a1eaf8dc0..ca7595744909 100644 --- a/package-lock.json +++ b/package-lock.json @@ -23082,8 +23082,8 @@ } }, "expensify-common": { - "version": "git://github.com/Expensify/expensify-common.git#5fb22bd4a3619eb9fe9e2a9c0dc25e291863a2a2", - "from": "git://github.com/Expensify/expensify-common.git#5fb22bd4a3619eb9fe9e2a9c0dc25e291863a2a2", + "version": "git://github.com/Expensify/expensify-common.git#a88a45c68947da7ea769a6ee6a6d3b04d6f62dd7", + "from": "git://github.com/Expensify/expensify-common.git#a88a45c68947da7ea769a6ee6a6d3b04d6f62dd7", "requires": { "classnames": "2.3.1", "clipboard": "2.0.4", diff --git a/package.json b/package.json index bf52c50538cb..564e7caaca76 100644 --- a/package.json +++ b/package.json @@ -60,7 +60,7 @@ "electron-log": "^4.3.5", "electron-serve": "^1.0.0", "electron-updater": "^4.3.4", - "expensify-common": "git://github.com/Expensify/expensify-common.git#5fb22bd4a3619eb9fe9e2a9c0dc25e291863a2a2", + "expensify-common": "git://github.com/Expensify/expensify-common.git#a88a45c68947da7ea769a6ee6a6d3b04d6f62dd7", "expo-haptics": "^10.0.0", "file-loader": "^6.0.0", "html-entities": "^1.3.1", From f658da2826244c006d0d06243ea40e5e5abd0897 Mon Sep 17 00:00:00 2001 From: Akshaya Salvi Date: Thu, 19 Aug 2021 04:02:24 +0530 Subject: [PATCH 115/200] changed prop name to fileName --- .../BaseAnchorForCommentsOnly/index.js | 4 ++-- .../BaseAnchorForCommentsOnly/index.native.js | 4 ++-- .../AnchorForCommentsOnly/anchorForCommentsOnlyPropTypes.js | 6 ++++-- src/components/HTMLEngineProvider/BaseHTMLEngineProvider.js | 4 ++-- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/components/AnchorForCommentsOnly/BaseAnchorForCommentsOnly/index.js b/src/components/AnchorForCommentsOnly/BaseAnchorForCommentsOnly/index.js index 4c67013f2eb9..cae9116eadac 100644 --- a/src/components/AnchorForCommentsOnly/BaseAnchorForCommentsOnly/index.js +++ b/src/components/AnchorForCommentsOnly/BaseAnchorForCommentsOnly/index.js @@ -21,7 +21,7 @@ const BaseAnchorForCommentsOnly = ({ target, children, style, - text, + fileName, ...props }) => { let linkRef; @@ -35,7 +35,7 @@ const BaseAnchorForCommentsOnly = ({ > )} diff --git a/src/components/AnchorForCommentsOnly/BaseAnchorForCommentsOnly/index.native.js b/src/components/AnchorForCommentsOnly/BaseAnchorForCommentsOnly/index.native.js index 187d1d01ca21..0398e117c68c 100644 --- a/src/components/AnchorForCommentsOnly/BaseAnchorForCommentsOnly/index.native.js +++ b/src/components/AnchorForCommentsOnly/BaseAnchorForCommentsOnly/index.native.js @@ -19,7 +19,7 @@ const BaseAnchorForCommentsOnly = ({ children, style, shouldDownloadFile, - text, + fileName, ...props }) => { let linkRef; @@ -32,7 +32,7 @@ const BaseAnchorForCommentsOnly = ({ > )} diff --git a/src/components/AnchorForCommentsOnly/anchorForCommentsOnlyPropTypes.js b/src/components/AnchorForCommentsOnly/anchorForCommentsOnlyPropTypes.js index 9b1f8333318e..fdb58c7d0994 100644 --- a/src/components/AnchorForCommentsOnly/anchorForCommentsOnlyPropTypes.js +++ b/src/components/AnchorForCommentsOnly/anchorForCommentsOnlyPropTypes.js @@ -21,11 +21,13 @@ const propTypes = { /** Any children to display */ children: PropTypes.node, + /** Display label in case of attachments */ + fileName: PropTypes.string, + /** Any additional styles to apply */ // eslint-disable-next-line react/forbid-prop-types style: PropTypes.any, - text: PropTypes.string, }; const defaultProps = { @@ -35,7 +37,7 @@ const defaultProps = { shouldDownloadFile: false, children: null, style: {}, - text: '', + fileName: '', }; export {propTypes, defaultProps}; diff --git a/src/components/HTMLEngineProvider/BaseHTMLEngineProvider.js b/src/components/HTMLEngineProvider/BaseHTMLEngineProvider.js index 7053d7a4a4f7..95b6003c99d8 100755 --- a/src/components/HTMLEngineProvider/BaseHTMLEngineProvider.js +++ b/src/components/HTMLEngineProvider/BaseHTMLEngineProvider.js @@ -68,7 +68,7 @@ function AnchorRenderer({tnode, key, style}) { // An auth token is needed to download Expensify chat attachments const isAttachment = Boolean(htmlAttribs['data-expensify-source']); - const fileName = isAttachment ? lodashGet(tnode, 'domNode.children[0].data') : null; + const fileName = lodashGet(tnode, 'domNode.children[0].data', ''); return ( From cab465cb023e20384cabe36f213375add2e98f4a Mon Sep 17 00:00:00 2001 From: Akshaya Salvi Date: Thu, 19 Aug 2021 04:07:09 +0530 Subject: [PATCH 116/200] Renamed prop to isAttachment --- .../BaseAnchorForCommentsOnly/index.js | 2 +- .../BaseAnchorForCommentsOnly/index.native.js | 4 ++-- .../anchorForCommentsOnlyPropTypes.js | 7 ++++--- src/components/AnchorForCommentsOnly/index.js | 2 +- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/components/AnchorForCommentsOnly/BaseAnchorForCommentsOnly/index.js b/src/components/AnchorForCommentsOnly/BaseAnchorForCommentsOnly/index.js index cae9116eadac..4677db8bcb03 100644 --- a/src/components/AnchorForCommentsOnly/BaseAnchorForCommentsOnly/index.js +++ b/src/components/AnchorForCommentsOnly/BaseAnchorForCommentsOnly/index.js @@ -27,7 +27,7 @@ const BaseAnchorForCommentsOnly = ({ let linkRef; return ( - props.shouldDownloadFile + props.isAttachment ? ( { fileDownload(href); diff --git a/src/components/AnchorForCommentsOnly/BaseAnchorForCommentsOnly/index.native.js b/src/components/AnchorForCommentsOnly/BaseAnchorForCommentsOnly/index.native.js index 0398e117c68c..08a5fab15814 100644 --- a/src/components/AnchorForCommentsOnly/BaseAnchorForCommentsOnly/index.native.js +++ b/src/components/AnchorForCommentsOnly/BaseAnchorForCommentsOnly/index.native.js @@ -18,13 +18,13 @@ const BaseAnchorForCommentsOnly = ({ href, children, style, - shouldDownloadFile, + isAttachment, fileName, ...props }) => { let linkRef; return ( - shouldDownloadFile + isAttachment ? ( { fileDownload(href); diff --git a/src/components/AnchorForCommentsOnly/anchorForCommentsOnlyPropTypes.js b/src/components/AnchorForCommentsOnly/anchorForCommentsOnlyPropTypes.js index fdb58c7d0994..d6463a67eef2 100644 --- a/src/components/AnchorForCommentsOnly/anchorForCommentsOnlyPropTypes.js +++ b/src/components/AnchorForCommentsOnly/anchorForCommentsOnlyPropTypes.js @@ -15,8 +15,9 @@ const propTypes = { This is unused in native, but is here for parity with web */ target: PropTypes.string, - /** Should the link be treated as a file download or a regular hyperlink? (relevant to native platforms only) */ - shouldDownloadFile: PropTypes.bool, + /** Flag to differentiate attachments and hyperlink. Base on flag link will be treated as a file download or a regular hyperlink? + * (relevant to native platforms only) */ + isAttachment: PropTypes.bool, /** Any children to display */ children: PropTypes.node, @@ -34,7 +35,7 @@ const defaultProps = { href: '', rel: '', target: '', - shouldDownloadFile: false, + isAttachment: false, children: null, style: {}, fileName: '', diff --git a/src/components/AnchorForCommentsOnly/index.js b/src/components/AnchorForCommentsOnly/index.js index 080324d755d6..556c2c577d87 100644 --- a/src/components/AnchorForCommentsOnly/index.js +++ b/src/components/AnchorForCommentsOnly/index.js @@ -29,7 +29,7 @@ const AnchorForCommentsOnly = (props) => { const propsToPass = _.omit(props, 'isAuthTokenRequired'); if (props.isAuthTokenRequired) { propsToPass.href = addEncryptedAuthTokenToURL(props.href); - propsToPass.shouldDownloadFile = true; + propsToPass.isAttachment = true; } // eslint-disable-next-line react/jsx-props-no-spreading return ; From 5518ed20ac7ebb1bf435cf16f6274219a8cc0b33 Mon Sep 17 00:00:00 2001 From: Akshaya Salvi Date: Thu, 19 Aug 2021 04:11:18 +0530 Subject: [PATCH 117/200] Moved download icon to AttachmentView with a flag for hide/show --- .../BaseAnchorForCommentsOnly/index.js | 6 +----- .../BaseAnchorForCommentsOnly/index.native.js | 6 +----- src/components/AttachmentView.js | 11 ++++++----- 3 files changed, 8 insertions(+), 15 deletions(-) diff --git a/src/components/AnchorForCommentsOnly/BaseAnchorForCommentsOnly/index.js b/src/components/AnchorForCommentsOnly/BaseAnchorForCommentsOnly/index.js index 4677db8bcb03..e6818fd6127f 100644 --- a/src/components/AnchorForCommentsOnly/BaseAnchorForCommentsOnly/index.js +++ b/src/components/AnchorForCommentsOnly/BaseAnchorForCommentsOnly/index.js @@ -2,12 +2,10 @@ import React from 'react'; import {Pressable, StyleSheet} from 'react-native'; import lodashGet from 'lodash/get'; import Text from '../../Text'; -import Icon from '../../Icon'; import {propTypes, defaultProps} from '../anchorForCommentsOnlyPropTypes'; import PressableWithSecondaryInteraction from '../../PressableWithSecondaryInteraction'; import {showContextMenu} from '../../../pages/home/report/ContextMenu/ReportActionContextMenu'; import {CONTEXT_MENU_TYPES} from '../../../pages/home/report/ContextMenu/ContextMenuActions'; -import {Download} from '../../Icon/Expensicons'; import AttachmentView from '../../AttachmentView'; import fileDownload from '../../../libs/fileDownload'; @@ -36,9 +34,7 @@ const BaseAnchorForCommentsOnly = ({ - )} + shouldShowDownloadIcon /> ) diff --git a/src/components/AnchorForCommentsOnly/BaseAnchorForCommentsOnly/index.native.js b/src/components/AnchorForCommentsOnly/BaseAnchorForCommentsOnly/index.native.js index 08a5fab15814..5e2f9a5c3083 100644 --- a/src/components/AnchorForCommentsOnly/BaseAnchorForCommentsOnly/index.native.js +++ b/src/components/AnchorForCommentsOnly/BaseAnchorForCommentsOnly/index.native.js @@ -7,8 +7,6 @@ import Text from '../../Text'; import PressableWithSecondaryInteraction from '../../PressableWithSecondaryInteraction'; import {showContextMenu} from '../../../pages/home/report/ContextMenu/ReportActionContextMenu'; import {CONTEXT_MENU_TYPES} from '../../../pages/home/report/ContextMenu/ContextMenuActions'; -import Icon from '../../Icon'; -import {Download} from '../../Icon/Expensicons'; import AttachmentView from '../../AttachmentView'; /* @@ -33,9 +31,7 @@ const BaseAnchorForCommentsOnly = ({ - )} + shouldShowDownloadIcon /> ) diff --git a/src/components/AttachmentView.js b/src/components/AttachmentView.js index 575be58d7983..456514f2fbae 100755 --- a/src/components/AttachmentView.js +++ b/src/components/AttachmentView.js @@ -6,7 +6,7 @@ import styles from '../styles/styles'; import PDFView from './PDFView'; import ImageView from './ImageView'; import Icon from './Icon'; -import {Paperclip} from './Icon/Expensicons'; +import {Paperclip, Download} from './Icon/Expensicons'; import withLocalize, {withLocalizePropTypes} from './withLocalize'; import compose from '../libs/compose'; import Text from './Text'; @@ -20,7 +20,8 @@ const propTypes = { name: PropTypes.string, }), - rightElement: PropTypes.element, + /** Flag to show/hide download icon */ + shouldShowDownloadIcon: PropTypes.bool, ...withLocalizePropTypes, }; @@ -29,7 +30,7 @@ const defaultProps = { file: { name: '', }, - rightElement: undefined, + shouldShowDownloadIcon: false, }; const AttachmentView = (props) => { @@ -61,9 +62,9 @@ const AttachmentView = (props) => { {props.file && props.file.name} - {props.rightElement && ( + {props.shouldShowDownloadIcon && ( - {props.rightElement} + )} From 33d5b09883006cd7493612c0b8dc084fa257d378 Mon Sep 17 00:00:00 2001 From: Matt Allen Date: Wed, 18 Aug 2021 16:51:24 -0700 Subject: [PATCH 118/200] Update CONTRIBUTING.md Updating line 30 from Payment for your contributions will be made no less than 7 days after the pull request is merged to allow for regression testing. to Payment for your contributions will be made no less than 7 days after the pull request is deployed to production to allow for regression testing. --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8f2666cc7949..a974b3de9608 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -27,7 +27,7 @@ If you are hired for an Upwork job and have any job-specific questions, please a If you've found a vulnerability, please email security@expensify.com with the subject `Vulnerability Report` instead of creating an issue. ## Payment for Contributions -We hire and pay external contributors via Upwork.com. If you'd like to be paid for contributing, please create an Upwork account and apply for a job in the [Upwork issue list](https://www.upwork.com/ab/jobs/search/?q=Expensify%20React%20Native&sort=recency&user_location_match=2). If you think your compensation should be increased for a specific job, you can request a reevaluation by commenting in the Github issue where the Upwork job was posted. Payment for your contributions will be made no less than 7 days after the pull request is merged to allow for regression testing. We hire one contributor for each Upwork job. New contributors are limited to working on one job at a time, however experienced contributors may work on numerous jobs simultaneously. If you have not received payment after 8 days of the PR being deployed to production, please email contributors@expensify.com referencing the GH issue and your GH handle. +We hire and pay external contributors via Upwork.com. If you'd like to be paid for contributing, please create an Upwork account and apply for a job in the [Upwork issue list](https://www.upwork.com/ab/jobs/search/?q=Expensify%20React%20Native&sort=recency&user_location_match=2). If you think your compensation should be increased for a specific job, you can request a reevaluation by commenting in the Github issue where the Upwork job was posted. Payment for your contributions will be made no less than 7 days after the pull request is deployed to production to allow for regression testing. We hire one contributor for each Upwork job. New contributors are limited to working on one job at a time, however experienced contributors may work on numerous jobs simultaneously. If you have not received payment after 8 days of the PR being deployed to production, please email contributors@expensify.com referencing the GH issue and your GH handle. ## Finding Jobs There are two ways you can find a job that you can contribute to: From df765209dc30e53be8294700261a86753fa584a8 Mon Sep 17 00:00:00 2001 From: Vit Horacek <36083550+mountiny@users.noreply.github.com> Date: Thu, 19 Aug 2021 11:52:27 +0200 Subject: [PATCH 119/200] Update .github/PULL_REQUEST_TEMPLATE.md Co-authored-by: Aldo Canepa Garay <87341702+aldo-expensify@users.noreply.github.com> --- .github/PULL_REQUEST_TEMPLATE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index a005837deb0a..65aa684b6d51 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -9,7 +9,7 @@ Please replace GH_LINK with the link to the GitHub issue this Pull Request is fi Do NOT add the special GH keywords like `fixed` etc, we have our own process of managing the flow. It MUST be an entire link to the issue, otherwise the linking will not work as expected. -Make sure this section looks similar to this (you can link multiple issues using the same formatting, just add new line): +Make sure this section looks similar to this (you can link multiple issues using the same formatting, just add a new line): $ https://github.com/Expensify/App/issues/4723 ---> From 470a4062f6c0b421aa42f8e542d283711e749bf3 Mon Sep 17 00:00:00 2001 From: Manan Jadhav Date: Thu, 19 Aug 2021 19:25:20 +0530 Subject: [PATCH 120/200] fix(hide-time-for-exp-emails): Added constant for Expensify Emails --- src/CONST.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/CONST.js b/src/CONST.js index 481f6a6b7721..d7435de9f1fb 100755 --- a/src/CONST.js +++ b/src/CONST.js @@ -261,6 +261,13 @@ const CONST = { CHRONOS: 'chronos@expensify.com', CONCIERGE: 'concierge@expensify.com', RECEIPTS: 'receipts@expensify.com', + HELP: 'help@expensify.com', + QA: 'qa@expensify.com', + CONTRIBUTORS: 'contributors@expensify.com', + FIRST_RESPONDER: 'firstresponders@expensify.com', + QA_TRAVIS: 'qa+travisreceipts@expensify.com', + BILLS: 'bills@expensify.com', + STUDENT_AMBASSADOR: 'studentambassadors@expensify.com', }, ENVIRONMENT: { @@ -385,4 +392,13 @@ const CONST = { }, }; +const EXPENSIFY_EMAILS = [ + CONST.EMAIL.CONCIERGE, CONST.EMAIL.CONTRIBUTORS, CONST.EMAIL.FIRST_RESPONDER, + CONST.EMAIL.HELP, CONST.EMAIL.QA, CONST.EMAIL.CHRONOS, CONST.EMAIL.RECEIPTS, + CONST.EMAIL.BILLS, CONST.EMAIL.STUDENT_AMBASSADOR, CONST.EMAIL.QA_TRAVIS, +]; + +export { + EXPENSIFY_EMAILS, +}; export default CONST; From 0884cd6cb0451d50868d38559877f94b1f1499a9 Mon Sep 17 00:00:00 2001 From: Manan Jadhav Date: Thu, 19 Aug 2021 19:26:02 +0530 Subject: [PATCH 121/200] fix(hide-time-for-exp-emails): disabled localtime when expensify emails exist in participants --- src/pages/home/report/ReportActionCompose.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/pages/home/report/ReportActionCompose.js b/src/pages/home/report/ReportActionCompose.js index 38eedffa1780..a5df885a6024 100755 --- a/src/pages/home/report/ReportActionCompose.js +++ b/src/pages/home/report/ReportActionCompose.js @@ -11,6 +11,7 @@ import {withNavigationFocus} from '@react-navigation/compat'; import _ from 'underscore'; import lodashGet from 'lodash/get'; import {withOnyx} from 'react-native-onyx'; +import lodashIntersection from 'lodash/intersection'; import styles, {getButtonBackgroundColorStyle, getIconFillColor} from '../../../styles/styles'; import themeColors from '../../../styles/themes/default'; import TextInputFocusable from '../../../components/TextInputFocusable'; @@ -41,7 +42,7 @@ import EmojiPickerMenu from './EmojiPickerMenu'; import withWindowDimensions, {windowDimensionsPropTypes} from '../../../components/withWindowDimensions'; import withDrawerState from '../../../components/withDrawerState'; import getButtonState from '../../../libs/getButtonState'; -import CONST from '../../../CONST'; +import CONST, {EXPENSIFY_EMAILS} from '../../../CONST'; import canFocusInputOnScreenFocus from '../../../libs/canFocusInputOnScreenFocus'; import variables from '../../../styles/variables'; import withLocalize, {withLocalizePropTypes} from '../../../components/withLocalize'; @@ -432,13 +433,11 @@ class ReportActionCompose extends React.Component { // eslint-disable-next-line no-unused-vars const reportParticipants = lodashGet(this.props.report, 'participants', []); const hasMultipleParticipants = reportParticipants.length > 1; - const hasChronosParticipant = _.contains(reportParticipants, CONST.EMAIL.CHRONOS); - const hasConciergeParticipant = _.contains(reportParticipants, CONST.EMAIL.CONCIERGE); + const hasExpensifyEmails = lodashIntersection(reportParticipants, EXPENSIFY_EMAILS).length > 0; const reportRecipient = this.props.personalDetails[reportParticipants[0]]; const currentUserTimezone = lodashGet(this.props.myPersonalDetails, 'timezone', CONST.DEFAULT_TIME_ZONE); const reportRecipientTimezone = lodashGet(reportRecipient, 'timezone', CONST.DEFAULT_TIME_ZONE); - const shouldShowReportRecipientLocalTime = !hasConciergeParticipant - && !hasChronosParticipant + const shouldShowReportRecipientLocalTime = !hasExpensifyEmails && !hasMultipleParticipants && reportRecipient && reportRecipientTimezone From 7aea6ba1c142ae15a98b694e25b7c7b22beb99bc Mon Sep 17 00:00:00 2001 From: Manan Jadhav Date: Thu, 19 Aug 2021 19:27:36 +0530 Subject: [PATCH 122/200] fix(hide-time-for-exp-emails): rollback hasConciergeParticipant flag --- src/pages/home/report/ReportActionCompose.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pages/home/report/ReportActionCompose.js b/src/pages/home/report/ReportActionCompose.js index a5df885a6024..6dc552bee8e3 100755 --- a/src/pages/home/report/ReportActionCompose.js +++ b/src/pages/home/report/ReportActionCompose.js @@ -434,6 +434,7 @@ class ReportActionCompose extends React.Component { const reportParticipants = lodashGet(this.props.report, 'participants', []); const hasMultipleParticipants = reportParticipants.length > 1; const hasExpensifyEmails = lodashIntersection(reportParticipants, EXPENSIFY_EMAILS).length > 0; + const hasConciergeParticipant = _.contains(reportParticipants, CONST.EMAIL.CONCIERGE); const reportRecipient = this.props.personalDetails[reportParticipants[0]]; const currentUserTimezone = lodashGet(this.props.myPersonalDetails, 'timezone', CONST.DEFAULT_TIME_ZONE); const reportRecipientTimezone = lodashGet(reportRecipient, 'timezone', CONST.DEFAULT_TIME_ZONE); From 3e6fae691c5e8ef1b116839e9485164bba1fef5b Mon Sep 17 00:00:00 2001 From: Amal Nazeem Date: Thu, 19 Aug 2021 11:36:49 -0400 Subject: [PATCH 123/200] remove @TODO since workspace has already been created --- src/pages/workspace/WorkspaceSidebar.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/workspace/WorkspaceSidebar.js b/src/pages/workspace/WorkspaceSidebar.js index 96d2132eb8d2..35f780924915 100644 --- a/src/pages/workspace/WorkspaceSidebar.js +++ b/src/pages/workspace/WorkspaceSidebar.js @@ -75,7 +75,7 @@ const WorkspaceSidebar = ({ ]; // After all the policies have loaded, we can know if the given policyID points to a nonexistant workspace - // @TODO: When free plan is out of beta and Permissions.canUseFreePlan() gets removed, + // When free plan is out of beta and Permissions.canUseFreePlan() gets removed, // all code involving 'allPolicies' can be removed since policy loading will no longer be delayed on login. if (allPolicies !== null && _.isEmpty(policy)) { Growl.error(translate('workspace.error.growlMessageInvalidPolicy'), CONST.GROWL.DURATION_LONG); From 53e0c3278b5ce63fd3c7e0038e8824b5dd1d8291 Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Thu, 19 Aug 2021 10:27:32 -0600 Subject: [PATCH 124/200] remove unused cherry pick step --- .github/workflows/platformDeploy.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/platformDeploy.yml b/.github/workflows/platformDeploy.yml index 7e78114c801a..864855931b28 100644 --- a/.github/workflows/platformDeploy.yml +++ b/.github/workflows/platformDeploy.yml @@ -330,12 +330,6 @@ jobs: with: node-version: '14.x' - - name: Determine if this was a cherry-pick - id: isStagingDeployLocked - uses: Expensify/App/.github/actions/isStagingDeployLocked@main - with: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Set version run: echo "VERSION=$(npm run print-version --silent)" >> $GITHUB_ENV From 1118460c8bbb13c4677ca3e28525766d6d62434f Mon Sep 17 00:00:00 2001 From: Aldo Canepa Date: Thu, 19 Aug 2021 09:41:34 -0700 Subject: [PATCH 125/200] Add mt1 to error label. Handle errorText undefined --- src/components/ExpensiTextInput/BaseExpensiTextInput.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/ExpensiTextInput/BaseExpensiTextInput.js b/src/components/ExpensiTextInput/BaseExpensiTextInput.js index d6db9a275e72..bd6835aac2d8 100644 --- a/src/components/ExpensiTextInput/BaseExpensiTextInput.js +++ b/src/components/ExpensiTextInput/BaseExpensiTextInput.js @@ -167,8 +167,8 @@ class BaseExpensiTextInput extends Component { - {errorText !== '' && ( - {errorText} + {Boolean(errorText) && ( + {errorText} )} ); From c1850644d4f1f3e8fb697a7c5a3f712fb4cd28e4 Mon Sep 17 00:00:00 2001 From: Aldo Canepa Date: Thu, 19 Aug 2021 09:44:35 -0700 Subject: [PATCH 126/200] Updated propTypes with errorText --- src/components/ExpensiTextInput/propTypes.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/components/ExpensiTextInput/propTypes.js b/src/components/ExpensiTextInput/propTypes.js index 6231018ccee5..e4f935fa14a1 100644 --- a/src/components/ExpensiTextInput/propTypes.js +++ b/src/components/ExpensiTextInput/propTypes.js @@ -4,6 +4,9 @@ const propTypes = { /** Input label */ label: PropTypes.string, + /** Text to show if there is an error */ + errorText: PropTypes.string, + /** Input value */ value: PropTypes.string.isRequired, @@ -28,6 +31,7 @@ const propTypes = { const defaultProps = { label: '', + errorText: '', placeholder: '', error: false, containerStyles: [], From 71fe291df76eaea02e2b9dbe41c8ed5e6cbe30d8 Mon Sep 17 00:00:00 2001 From: Vit Horacek Date: Thu, 19 Aug 2021 17:47:00 +0100 Subject: [PATCH 127/200] Update grammar --- .github/PULL_REQUEST_TEMPLATE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 65aa684b6d51..e1bef835fe07 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -7,7 +7,7 @@