Skip to content

Commit

Permalink
Merge pull request #5223 from Expensify/update-staging-from-main
Browse files Browse the repository at this point in the history
  • Loading branch information
OSBotify authored Sep 13, 2021
2 parents ccf2bf5 + af2fc04 commit 1e86d37
Show file tree
Hide file tree
Showing 19 changed files with 93 additions and 55 deletions.
2 changes: 2 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ It MUST be an entire link to the issue; otherwise, the linking will not work as
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
Do NOT only link the issue number like this: $ #1234
--->
$ GH_LINK

Expand Down
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 1001009700
versionName "1.0.97-0"
versionCode 1001009701
versionName "1.0.97-1"
}
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.0.97.0</string>
<string>1.0.97.1</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.0.97.0</string>
<string>1.0.97.1</string>
</dict>
</plist>
11 changes: 3 additions & 8 deletions package-lock.json

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

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "new.expensify",
"version": "1.0.97-0",
"version": "1.0.97-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.",
Expand Down Expand Up @@ -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#a78cc23afe54d487ce2b7bafefa07e58d0280612",
"expensify-common": "git://github.com/Expensify/expensify-common.git#b5d9167a26cfd40beebdfb79958b3bbed1af7b64",
"expo-haptics": "^10.0.0",
"file-loader": "^6.0.0",
"html-entities": "^1.3.1",
Expand Down
6 changes: 2 additions & 4 deletions src/CONST.js

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

3 changes: 3 additions & 0 deletions src/ONYXKEYS.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ export default {
// Holds information about the users account that is logging in
ACCOUNT: 'account',

// Boolean flag only true when first set
NVP_IS_FIRST_TIME_NEW_EXPENSIFY_USER: 'isFirstTimeNewExpensifyUser',

// Holds an array of client IDs which is used for multi-tabs on web in order to know
// which tab is the leader, and which ones are the followers
ACTIVE_CLIENTS: 'activeClients',
Expand Down
10 changes: 5 additions & 5 deletions src/components/AttachmentPicker/index.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,12 @@ class AttachmentPicker extends Component {
this.menuItemData = [
{
icon: Camera,
text: this.props.translate('attachmentPicker.takePhoto'),
textTranslationKey: 'attachmentPicker.takePhoto',
pickAttachment: () => this.showImagePicker(launchCamera),
},
{
icon: Gallery,
text: this.props.translate('attachmentPicker.chooseFromGallery'),
textTranslationKey: 'attachmentPicker.chooseFromGallery',
pickAttachment: () => this.showImagePicker(launchImageLibrary),
},
];
Expand All @@ -102,7 +102,7 @@ class AttachmentPicker extends Component {
this.menuItemData.push(
{
icon: Paperclip,
text: this.props.translate('attachmentPicker.chooseDocument'),
textTranslationKey: 'attachmentPicker.chooseDocument',
pickAttachment: () => this.showDocumentPicker(),
},
);
Expand Down Expand Up @@ -286,9 +286,9 @@ class AttachmentPicker extends Component {
{
this.menuItemData.map(item => (
<MenuItem
key={item.text}
key={item.textTranslationKey}
icon={item.icon}
title={item.text}
title={this.props.translate(item.textTranslationKey)}
onPress={() => this.selectItem(item)}
/>
))
Expand Down
2 changes: 1 addition & 1 deletion src/components/FAB/FAB.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ AnimatedPressable.displayName = 'AnimatedPressable';
class FAB extends PureComponent {
constructor(props) {
super(props);
this.animatedValue = new Animated.Value(0);
this.animatedValue = new Animated.Value(props.isActive ? 1 : 0);
}

componentDidUpdate(prevProps) {
Expand Down
2 changes: 1 addition & 1 deletion src/languages/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,7 @@ export default {
availabilityText: '*Our guides are available from Sunday at 5pm CT to Friday at 5pm CT. Any requests outside this window will be returned 9am - 5pm, Monday - Friday in your local time. Call time is based on the order the call was received.',
callMe: 'Call me',
growlMessageOnSave: 'Call requested.',
growlMessageInvalidPhone: 'That doesn’t look like a valid phone number. Try again with the country code.\ne.g. +15005550006',
errorMessageInvalidPhone: 'That doesn’t look like a valid phone number. Try again with the country code. e.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: 'Help',
Expand Down
2 changes: 1 addition & 1 deletion src/languages/es.js
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,7 @@ export default {
availabilityText: '*Nuestros guías están disponibles de domingo desde las 17.00 CT a viernes hasta las 17.00 CT. Si solicitas una llamada fuera de este horario, te llamaremos de lunes a viernes de 9.00 a 17.00 en tu hora local. El orden de llamada corresponde con el orden de solicitud.',
callMe: 'Llámame',
growlMessageOnSave: 'Llamada solicitada.',
growlMessageInvalidPhone: 'El teléfono no es valido. Intentalo de nuevo agregando el código de país. P. ej.: +15005550006',
errorMessageInvalidPhone: '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: 'Ayuda',
Expand Down
1 change: 1 addition & 0 deletions src/libs/Navigation/AppNavigator/AuthScreens.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ class AuthScreens extends React.Component {

// Fetch some data we need on initialization
NameValuePair.get(CONST.NVP.PRIORITY_MODE, ONYXKEYS.NVP_PRIORITY_MODE, 'default');
NameValuePair.get(CONST.NVP.IS_FIRST_TIME_NEW_EXPENSIFY_USER, ONYXKEYS.NVP_IS_FIRST_TIME_NEW_EXPENSIFY_USER, true);

API.Get({
returnValueList: 'nameValuePairs',
Expand Down
4 changes: 2 additions & 2 deletions src/libs/actions/PaymentMethods.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import CONST from '../../CONST';
*/
function getPaymentMethods() {
return API.Get({
returnValueList: 'bankAccountList, cardList, userWallet, nameValuePairs',
returnValueList: 'bankAccountList, fundList, userWallet, nameValuePairs',
name: 'paypalMeAddress',
includeDeleted: false,
includeNotIssued: false,
Expand All @@ -21,7 +21,7 @@ function getPaymentMethods() {
Onyx.multiSet({
[ONYXKEYS.USER_WALLET]: lodashGet(response, 'userWallet', {}),
[ONYXKEYS.BANK_ACCOUNT_LIST]: lodashGet(response, 'bankAccountList', []),
[ONYXKEYS.CARD_LIST]: lodashGet(response, 'cardList', []),
[ONYXKEYS.CARD_LIST]: lodashGet(response, 'fundList', []),
[ONYXKEYS.NVP_PAYPAL_ME_ADDRESS]:
lodashGet(response, ['nameValuePairs', CONST.NVP.PAYPAL_ME_ADDRESS], ''),
});
Expand Down
38 changes: 31 additions & 7 deletions src/pages/RequestCallPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ class RequestCallPage extends Component {
firstName,
lastName,
phoneNumber: this.getPhoneNumber(props.user.loginList) ?? '',
phoneNumberError: '',
isLoading: false,
};

Expand All @@ -79,18 +80,33 @@ class RequestCallPage extends Component {
}

onSubmit() {
this.setState({isLoading: true});
if (!this.state.firstName.length || !this.state.lastName.length) {
Growl.success(this.props.translate('requestCallPage.growlMessageEmptyName'));
this.setState({isLoading: false});
const shouldNotSubmit = _.isEmpty(this.state.firstName.trim())
|| _.isEmpty(this.state.lastName.trim())
|| _.isEmpty(this.state.phoneNumber.trim())
|| !Str.isValidPhone(this.state.phoneNumber);

if (_.isEmpty(this.state.firstName.trim()) || _.isEmpty(this.state.lastName.trim())) {
Growl.error(this.props.translate('requestCallPage.growlMessageEmptyName'));
return;
}

const personalPolicy = _.find(this.props.policies, policy => policy.type === CONST.POLICY.TYPE.PERSONAL);
if (_.isEmpty(this.state.phoneNumber.trim())) {
this.setState({phoneNumberError: this.props.translate('messages.noPhoneNumber')});
} else if (!Str.isValidPhone(this.state.phoneNumber)) {
this.setState({phoneNumberError: this.props.translate('requestCallPage.errorMessageInvalidPhone')});
} else {
this.setState({phoneNumberError: ''});
}

if (shouldNotSubmit) {
return;
}
const personalPolicy = _.find(this.props.policies, policy => policy && policy.type === CONST.POLICY.TYPE.PERSONAL);
if (!personalPolicy) {
Growl.error(this.props.translate('requestCallPage.growlMessageNoPersonalPolicy'), 3000);
return;
}
this.setState({isLoading: true});
requestInboxCall(this.props.route.params.taskID, personalPolicy.id, this.state.firstName, this.state.lastName, this.state.phoneNumber)
.then((result) => {
this.setState({isLoading: false});
Expand Down Expand Up @@ -150,7 +166,6 @@ class RequestCallPage extends Component {
}

render() {
const isButtonDisabled = false;
return (
<ScreenWrapper>
<KeyboardAvoidingView>
Expand Down Expand Up @@ -184,6 +199,16 @@ class RequestCallPage extends Component {
autoCorrect={false}
value={this.state.phoneNumber}
placeholder="+14158675309"
errorText={this.state.phoneNumberError}
onBlur={() => {
if (_.isEmpty(this.state.phoneNumber.trim())) {
this.setState({phoneNumberError: this.props.translate('messages.noPhoneNumber')});
} else if (!Str.isValidPhone(this.state.phoneNumber)) {
this.setState({phoneNumberError: this.props.translate('requestCallPage.errorMessageInvalidPhone')});
} else {
this.setState({phoneNumberError: ''});
}
}}
onChangeText={phoneNumber => this.setState({phoneNumber})}
/>
</View>
Expand All @@ -194,7 +219,6 @@ class RequestCallPage extends Component {
<FixedFooter>
<Button
success
isDisabled={isButtonDisabled}
onPress={this.onSubmit}
style={[styles.w100]}
text={this.props.translate('requestCallPage.callMe')}
Expand Down
3 changes: 2 additions & 1 deletion src/pages/home/report/ReportActionCompose.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import _ from 'underscore';
import lodashGet from 'lodash/get';
import {withOnyx} from 'react-native-onyx';
import lodashIntersection from 'lodash/intersection';
import moment from 'moment';
import styles, {getButtonBackgroundColorStyle, getIconFillColor} from '../../../styles/styles';
import themeColors from '../../../styles/themes/default';
import TextInputFocusable from '../../../components/TextInputFocusable';
Expand Down Expand Up @@ -467,7 +468,7 @@ class ReportActionCompose extends React.Component {
&& !hasMultipleParticipants
&& reportRecipient
&& reportRecipientTimezone
&& currentUserTimezone.selected !== reportRecipientTimezone.selected;
&& moment().tz(currentUserTimezone.selected).utcOffset() !== moment().tz(reportRecipientTimezone.selected).utcOffset();

// Prevents focusing and showing the keyboard while the drawer is covering the chat.
const isComposeDisabled = this.props.isDrawerOpen && this.props.isSmallScreenWidth;
Expand Down
19 changes: 18 additions & 1 deletion src/pages/home/sidebar/SidebarScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,15 @@ import Permissions from '../../../libs/Permissions';
import ONYXKEYS from '../../../ONYXKEYS';
import {create} from '../../../libs/actions/Policy';
import Performance from '../../../libs/Performance';
import NameValuePair from '../../../libs/actions/NameValuePair';

const propTypes = {
/** Beta features list */
/* Beta features list */
betas: PropTypes.arrayOf(PropTypes.string).isRequired,

/* Flag for new users used to open the Global Create menu on first load */
isFirstTimeNewExpensifyUser: PropTypes.bool.isRequired,

...windowDimensionsPropTypes,

...withLocalizePropTypes,
Expand All @@ -52,6 +56,16 @@ class SidebarScreen extends Component {
componentDidMount() {
Performance.markStart(CONST.TIMING.SIDEBAR_LOADED);
Timing.start(CONST.TIMING.SIDEBAR_LOADED, true);

if (this.props.isFirstTimeNewExpensifyUser) {
// For some reason, the menu doesn't open without the timeout
setTimeout(() => {
this.toggleCreateMenu();

// Set the NVP back to false (this may need to be moved if this NVP is used for anything else later)
NameValuePair.set(CONST.NVP.IS_FIRST_TIME_NEW_EXPENSIFY_USER, false, ONYXKEYS.NVP_IS_FIRST_TIME_NEW_EXPENSIFY_USER);
}, 200);
}
}

/**
Expand Down Expand Up @@ -170,5 +184,8 @@ export default compose(
betas: {
key: ONYXKEYS.BETAS,
},
isFirstTimeNewExpensifyUser: {
key: ONYXKEYS.NVP_IS_FIRST_TIME_NEW_EXPENSIFY_USER,
},
}),
)(SidebarScreen);
2 changes: 1 addition & 1 deletion src/pages/iou/steps/IOUAmountPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ class IOUAmountPage extends React.Component {
*/
validateAmount(amount) {
const decimalNumberRegex = new RegExp(/^\d+(,\d+)*(\.\d{0,3})?$/, 'i');
return amount === '' || decimalNumberRegex.test(amount);
return amount === '' || (decimalNumberRegex.test(amount) && amount.length <= CONST.IOU.AMOUNT_MAX_LENGTH);
}

/**
Expand Down
31 changes: 14 additions & 17 deletions src/pages/settings/Payments/PaymentMethodList.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,23 +103,20 @@ class PaymentMethodList extends Component {
});

_.each(this.props.cardList, (card) => {
// Add all cards besides the "cash" card
if (card.cardName !== CONST.CARD_TYPES.DEFAULT_CASH) {
const formattedCardNumber = card.cardNumber
? `${this.props.translate('paymentMethodList.cardLastFour')} ${card.cardNumber.slice(-4)}`
: null;
const {icon, iconSize} = getBankIcon(card.bank, true);
combinedPaymentMethods.push({
type: MENU_ITEM,
title: card.cardName,
// eslint-disable-next-line
description: formattedCardNumber,
icon,
iconSize,
onPress: e => this.props.onPress(e, card.cardID),
key: `card-${card.cardID}`,
});
}
const formattedCardNumber = card.cardNumber
? `${this.props.translate('paymentMethodList.cardLastFour')} ${card.cardNumber.slice(-4)}`
: null;
const {icon, iconSize} = getBankIcon(card.bank, true);
combinedPaymentMethods.push({
type: MENU_ITEM,
title: card.addressName,
// eslint-disable-next-line
description: formattedCardNumber,
icon,
iconSize,
onPress: e => this.props.onPress(e, card.cardID),
key: `card-${card.cardID}`,
});
});

if (this.props.payPalMeUsername) {
Expand Down

0 comments on commit 1e86d37

Please sign in to comment.