Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🍒 Cherry pick PR #5787 to staging 🍒 #5823

Merged
merged 2 commits into from
Oct 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@ android {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
multiDexEnabled rootProject.ext.multiDexEnabled
versionCode 1001010710
versionName "1.1.7-10"
versionCode 1001010711
versionName "1.1.7-11"
}
splits {
abi {
Expand Down
2 changes: 1 addition & 1 deletion ios/NewExpensify/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>1.1.7.10</string>
<string>1.1.7.11</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>LSApplicationQueriesSchemes</key>
Expand Down
2 changes: 1 addition & 1 deletion ios/NewExpensifyTests/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.1.7.10</string>
<string>1.1.7.11</string>
</dict>
</plist>
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "new.expensify",
"version": "1.1.7-10",
"version": "1.1.7-11",
"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.",
Expand Down
24 changes: 19 additions & 5 deletions src/components/FullscreenLoadingIndicator.js
Original file line number Diff line number Diff line change
@@ -1,30 +1,44 @@
import _ from 'underscore';
import React from 'react';
import PropTypes from 'prop-types';
import {ActivityIndicator, StyleSheet, View} from 'react-native';
import styles from '../styles/styles';
import themeColors from '../styles/themes/default';
import stylePropTypes from '../styles/stylePropTypes';

const propTypes = {
/** Controls whether the loader is mounted and displayed */
visible: PropTypes.bool,

/** Additional style props */
style: stylePropTypes,
};

const defaultProps = {
visible: true,
style: [],
};

/**
* Loading indication component intended to cover the whole page, while the page prepares for initial render
*
* @returns {JSX.Element}
*/
const FullScreenLoadingIndicator = ({visible}) => visible && (
<View style={[StyleSheet.absoluteFillObject, styles.fullScreenLoading]}>
<ActivityIndicator color={themeColors.spinner} size="large" />
</View>
);
const FullScreenLoadingIndicator = ({visible, style}) => {
if (!visible) {
return null;
}

const additionalStyles = _.isArray(style) ? style : [style];
return (
<View style={[StyleSheet.absoluteFillObject, styles.fullScreenLoading, ...additionalStyles]}>
<ActivityIndicator color={themeColors.spinner} size="large" />
</View>
);
};

FullScreenLoadingIndicator.propTypes = propTypes;
FullScreenLoadingIndicator.defaultProps = defaultProps;
FullScreenLoadingIndicator.displayName = 'FullScreenLoadingIndicator';

export default FullScreenLoadingIndicator;
49 changes: 49 additions & 0 deletions src/components/ReimbursementAccountLoadingIndicator.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import React from 'react';
import {Image, StyleSheet, View} from 'react-native';
import PropTypes from 'prop-types';
import styles from '../styles/styles';
import CONST from '../CONST';
import withLocalize, {withLocalizePropTypes} from './withLocalize';
import Text from './Text';
import HeaderWithCloseButton from './HeaderWithCloseButton';
import Navigation from '../libs/Navigation/Navigation';
import ScreenWrapper from './ScreenWrapper';
import FullScreenLoadingIndicator from './FullscreenLoadingIndicator';

const propTypes = {
/** Whether the user is submitting verifications data */
isSubmittingVerificationsData: PropTypes.bool.isRequired,

...withLocalizePropTypes,
};

const ReimbursementAccountLoadingIndicator = ({translate, isSubmittingVerificationsData}) => (
<ScreenWrapper style={[StyleSheet.absoluteFillObject, styles.reimbursementAccountFullScreenLoading]}>
<HeaderWithCloseButton
title={translate('reimbursementAccountLoadingAnimation.oneMoment')}
onCloseButtonPress={Navigation.dismissModal}
/>
{isSubmittingVerificationsData ? (
<View style={[styles.pageWrapper]}>
<Image
source={{uri: `${CONST.CLOUDFRONT_URL}/images/icons/emptystates/emptystate_reviewing.gif`}}
style={[
styles.loadingVBAAnimation,
]}
/>
<View style={[styles.ph6]}>
<Text style={[styles.textAlignCenter]}>
{translate('reimbursementAccountLoadingAnimation.explanationLine')}
</Text>
</View>
</View>
) : (
<FullScreenLoadingIndicator style={[styles.flex1, styles.pRelative]} />
)}
</ScreenWrapper>
);

ReimbursementAccountLoadingIndicator.propTypes = propTypes;
ReimbursementAccountLoadingIndicator.displayName = 'ReimbursementAccountLoadingIndicator';

export default withLocalize(ReimbursementAccountLoadingIndicator);
39 changes: 0 additions & 39 deletions src/components/VBALoadingIndicator.js

This file was deleted.

2 changes: 1 addition & 1 deletion src/languages/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,7 @@ export default {
certify: 'Must certify information is true and accurate',
},
},
vbaLoadingAnimation: {
reimbursementAccountLoadingAnimation: {
oneMoment: 'One Moment',
explanationLine: 'We’re taking a look at your information. You will be able to continue with next steps shortly.',
},
Expand Down
2 changes: 1 addition & 1 deletion src/languages/es.js
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,7 @@ export default {
certify: 'Debe certificar que la información es verdadera y precisa',
},
},
vbaLoadingAnimation: {
reimbursementAccountLoadingAnimation: {
oneMoment: 'Un Momento',
explanationLine: 'Estamos verificando tu información y podrás continuar con los siguientes pasos en unos momentos.',
},
Expand Down
28 changes: 19 additions & 9 deletions src/pages/ReimbursementAccount/ReimbursementAccountPage.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import _ from 'underscore';
import lodashGet from 'lodash/get';
import React from 'react';
import {withOnyx} from 'react-native-onyx';
Expand All @@ -10,7 +11,7 @@ import {
hideBankAccountErrors,
} from '../../libs/actions/BankAccounts';
import ONYXKEYS from '../../ONYXKEYS';
import VBALoadingIndicator from '../../components/VBALoadingIndicator';
import ReimbursementAccountLoadingIndicator from '../../components/ReimbursementAccountLoadingIndicator';
import Permissions from '../../libs/Permissions';
import Navigation from '../../libs/Navigation/Navigation';
import CONST from '../../CONST';
Expand Down Expand Up @@ -150,8 +151,24 @@ class ReimbursementAccountPage extends React.Component {
return null;
}

// The SetupWithdrawalAccount flow allows us to continue the flow from various points depending on where the
// user left off. This view will refer to the achData as the single source of truth to determine which route to
// display. We can also specify a specific route to navigate to via route params when the component first
// mounts which will set the achData.currentStep after the account data is fetched and overwrite the logical
// next step.
const achData = lodashGet(this.props, 'reimbursementAccount.achData', {});
const currentStep = achData.currentStep || CONST.BANK_ACCOUNT.STEP.BANK_ACCOUNT;
if (this.props.reimbursementAccount.loading) {
return <VBALoadingIndicator />;
const isSubmittingVerificationsData = _.contains([
CONST.BANK_ACCOUNT.STEP.COMPANY,
CONST.BANK_ACCOUNT.STEP.REQUESTOR,
CONST.BANK_ACCOUNT.STEP.ACH_CONTRACT,
], currentStep);
return (
<ReimbursementAccountLoadingIndicator
isSubmittingVerificationsData={isSubmittingVerificationsData}
/>
);
}

let errorComponent;
Expand Down Expand Up @@ -188,13 +205,6 @@ class ReimbursementAccountPage extends React.Component {
);
}

// The SetupWithdrawalAccount flow allows us to continue the flow from various points depending on where the
// user left off. This view will refer to the achData as the single source of truth to determine which route to
// display. We can also specify a specific route to navigate to via route params when the component first
// mounts which will set the achData.currentStep after the account data is fetched and overwrite the logical
// next step.
const achData = lodashGet(this.props, 'reimbursementAccount.achData', {});
const currentStep = achData.currentStep || CONST.BANK_ACCOUNT.STEP.BANK_ACCOUNT;
return (
<ScreenWrapper>
<KeyboardAvoidingView>
Expand Down
2 changes: 1 addition & 1 deletion src/styles/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -1805,7 +1805,7 @@ const styles = {
zIndex: 10,
},

vbaFullScreenLoading: {
reimbursementAccountFullScreenLoading: {
backgroundColor: themeColors.componentBG,
opacity: 0.8,
justifyContent: 'flex-start',
Expand Down