Skip to content

Commit c12931b

Browse files
Merge branch 'main' / Resolve conflicts
2 parents 1620af7 + b5da681 commit c12931b

File tree

15 files changed

+329
-185
lines changed

15 files changed

+329
-185
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ In this scenario, it’s possible that you found a bug or enhancement that we ha
7070
#### Propose a solution for the job
7171
4. After you reproduce the issue, make a proposal for your solution and post it as a comment in the corresponding GitHub issue (linked in the Upwork job). Your solution proposal should include a brief technical explanation of the changes you will make.
7272
- Note: If you post a proposed solution in an issue that has not been tagged with the `External` label, Expensify has the right to use your proposal to fix said issue, without providing compensation for your solution.
73+
- Note: Before submitting a proposal on an issue, be sure to read any other existing proposals. Any new proposal should be substantively different from existing proposals.
7374
5. Pause at this step until Expensify provides feedback on your proposal (do not begin coding or creating a pull request yet).
7475
6. If your solution proposal is accepted, Expensify will hire you on Upwork and assign the GitHub issue to you.
7576

android/app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,8 @@ android {
150150
minSdkVersion rootProject.ext.minSdkVersion
151151
targetSdkVersion rootProject.ext.targetSdkVersion
152152
multiDexEnabled rootProject.ext.multiDexEnabled
153-
versionCode 1001010501
154-
versionName "1.1.5-1"
153+
versionCode 1001010600
154+
versionName "1.1.6-0"
155155
}
156156
splits {
157157
abi {

assets/images/paypal.svg

Lines changed: 4 additions & 8 deletions
Loading

ios/NewExpensify/Info.plist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<key>CFBundlePackageType</key>
1818
<string>APPL</string>
1919
<key>CFBundleShortVersionString</key>
20-
<string>1.1.5</string>
20+
<string>1.1.6</string>
2121
<key>CFBundleSignature</key>
2222
<string>????</string>
2323
<key>CFBundleURLTypes</key>
@@ -31,7 +31,7 @@
3131
</dict>
3232
</array>
3333
<key>CFBundleVersion</key>
34-
<string>1.1.5.1</string>
34+
<string>1.1.6.0</string>
3535
<key>ITSAppUsesNonExemptEncryption</key>
3636
<false/>
3737
<key>LSApplicationQueriesSchemes</key>

ios/NewExpensifyTests/Info.plist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515
<key>CFBundlePackageType</key>
1616
<string>BNDL</string>
1717
<key>CFBundleShortVersionString</key>
18-
<string>1.1.5</string>
18+
<string>1.1.6</string>
1919
<key>CFBundleSignature</key>
2020
<string>????</string>
2121
<key>CFBundleVersion</key>
22-
<string>1.1.5.1</string>
22+
<string>1.1.6.0</string>
2323
</dict>
2424
</plist>

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "new.expensify",
3-
"version": "1.1.5-1",
3+
"version": "1.1.6-0",
44
"author": "Expensify, Inc.",
55
"homepage": "https://new.expensify.com",
66
"description": "New Expensify is the next generation of Expensify: a reimagination of payments based atop a foundation of chat.",
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
import _ from 'underscore';
2+
import React from 'react';
3+
import {View} from 'react-native';
4+
import PropTypes from 'prop-types';
5+
import styles from '../styles/styles';
6+
import Icon from './Icon';
7+
import {Exclamation} from './Icon/Expensicons';
8+
import colors from '../styles/colors';
9+
import Button from './Button';
10+
import withLocalize, {withLocalizePropTypes} from './withLocalize';
11+
import TextLink from './TextLink';
12+
import Text from './Text';
13+
import RenderHTML from './RenderHTML';
14+
15+
const propTypes = {
16+
/** Whether to show the alert text */
17+
isAlertVisible: PropTypes.bool.isRequired,
18+
19+
/** Submit function */
20+
onSubmit: PropTypes.func.isRequired,
21+
22+
/** Text for the button */
23+
buttonText: PropTypes.string.isRequired,
24+
25+
/** Callback fired when the "fix the errors" link is pressed */
26+
onFixTheErrorsLinkPressed: PropTypes.func.isRequired,
27+
28+
/** Error message to display above button */
29+
message: PropTypes.string,
30+
31+
/** Whether message is in html format */
32+
isMessageHtml: PropTypes.bool,
33+
34+
...withLocalizePropTypes,
35+
};
36+
37+
const defaultProps = {
38+
message: '',
39+
isMessageHtml: false,
40+
};
41+
42+
const FormAlertWithSubmitButton = ({
43+
isAlertVisible,
44+
onSubmit,
45+
buttonText,
46+
translate,
47+
onFixTheErrorsLinkPressed,
48+
message,
49+
isMessageHtml,
50+
}) => {
51+
/**
52+
* @returns {React.Component}
53+
*/
54+
function getAlertPrompt() {
55+
let error = '';
56+
57+
if (!_.isEmpty(message)) {
58+
if (isMessageHtml) {
59+
error = (
60+
<RenderHTML html={`<muted-text>${message}</muted-text>`} />
61+
);
62+
} else {
63+
error = (
64+
<Text style={styles.mutedTextLabel}>{message}</Text>
65+
);
66+
}
67+
} else {
68+
error = (
69+
<>
70+
<Text style={styles.mutedTextLabel}>
71+
{`${translate('common.please')} `}
72+
</Text>
73+
<TextLink
74+
style={styles.label}
75+
onPress={onFixTheErrorsLinkPressed}
76+
>
77+
{translate('common.fixTheErrors')}
78+
</TextLink>
79+
<Text style={styles.mutedTextLabel}>
80+
{` ${translate('common.inTheFormBeforeContinuing')}.`}
81+
</Text>
82+
</>
83+
);
84+
}
85+
86+
return (
87+
<View style={[styles.flexRow, styles.ml2, styles.flexWrap, styles.flex1]}>
88+
{error}
89+
</View>
90+
);
91+
}
92+
93+
return (
94+
<View style={[styles.mh5, styles.mb5, styles.flex1, styles.justifyContentEnd]}>
95+
{isAlertVisible && (
96+
<View style={[styles.flexRow, styles.alignItemsCenter, styles.mb3]}>
97+
<Icon src={Exclamation} fill={colors.red} />
98+
{getAlertPrompt()}
99+
</View>
100+
)}
101+
<Button
102+
success
103+
text={buttonText}
104+
onPress={onSubmit}
105+
pressOnEnter
106+
/>
107+
</View>
108+
);
109+
};
110+
111+
FormAlertWithSubmitButton.propTypes = propTypes;
112+
FormAlertWithSubmitButton.defaultProps = defaultProps;
113+
export default withLocalize(FormAlertWithSubmitButton);

src/languages/en.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@ export default {
7878
},
7979
please: 'Please',
8080
contactUs: 'contact us',
81+
pleaseEnterEmailOrPhoneNumber: 'Please enter an email or phone number',
82+
fixTheErrors: 'fix the errors',
83+
inTheFormBeforeContinuing: 'in the form before continuing',
8184
confirm: 'Confirm',
8285
reset: 'Reset',
8386
done: 'Done',
@@ -369,7 +372,6 @@ export default {
369372
},
370373
},
371374
loginForm: {
372-
pleaseEnterEmailOrPhoneNumber: 'Please enter an email or phone number',
373375
phoneOrEmail: 'Phone or email',
374376
error: {
375377
invalidFormatLogin: 'The email or phone number entered is invalid. Please fix the format and try again.',
@@ -444,8 +446,6 @@ export default {
444446
firstName: 'Please enter valid first name',
445447
lastName: 'Please enter valid last name',
446448
noDefaultDepositAccountOrDebitCardAvailable: 'Please add a default deposit bank account or debit card',
447-
fixTheErrors: 'fix the errors',
448-
inTheFormBeforeContinuing: 'in the form before continuing',
449449
validationAmounts: 'The validation amounts you entered are incorrect. Please double-check your bank statement and try again.',
450450
},
451451
},

src/languages/es.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@ export default {
7878
},
7979
please: 'Por favor',
8080
contactUs: 'contáctenos',
81+
pleaseEnterEmailOrPhoneNumber: 'Por favor escribe un email o número de teléfono',
82+
fixTheErrors: 'corrige los errores',
83+
inTheFormBeforeContinuing: 'en el formulario antes de continuar',
8184
confirm: 'Confirmar',
8285
reset: 'Restablecer',
8386
done: 'Listo',
@@ -369,7 +372,6 @@ export default {
369372
},
370373
},
371374
loginForm: {
372-
pleaseEnterEmailOrPhoneNumber: 'Por favor escribe un email o número de teléfono',
373375
phoneOrEmail: 'Número de teléfono o email',
374376
error: {
375377
invalidFormatLogin: 'El email o número de teléfono que has introducido no es válido. Corrígelo e inténtalo de nuevo.',
@@ -444,8 +446,6 @@ export default {
444446
firstName: 'Ingresa un nombre válido',
445447
lastName: 'Ingresa un apellido válido',
446448
noDefaultDepositAccountOrDebitCardAvailable: 'Por favor agrega una cuenta bancaria para depósitos o una tarjeta de débito',
447-
fixTheErrors: 'corrige los errores',
448-
inTheFormBeforeContinuing: 'en el formulario antes de continuar',
449449
validationAmounts: 'Los montos de validación que ingresaste son incorrectos. Verifica tu cuenta de banco e intenta de nuevo.',
450450
},
451451
},

src/libs/actions/BankAccounts.js

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,7 @@ function setFreePlanVerifiedBankAccountID(bankAccountID) {
529529
* @param {Boolean} isErrorModalMessageHtml if @errorModalMessage is in html format or not
530530
*/
531531
function showBankAccountErrorModal(errorModalMessage = null, isErrorModalMessageHtml = false) {
532-
Onyx.merge(ONYXKEYS.REIMBURSEMENT_ACCOUNT, {isErrorModalVisible: true, errorModalMessage, isErrorModalMessageHtml});
532+
Onyx.merge(ONYXKEYS.REIMBURSEMENT_ACCOUNT, {errorModalMessage, isErrorModalMessageHtml});
533533
}
534534

535535
/**
@@ -583,13 +583,6 @@ function validateBankAccount(bankAccountID, validateCode) {
583583
});
584584
}
585585

586-
/**
587-
* Hide error modal
588-
*/
589-
function hideBankAccountErrorModal() {
590-
Onyx.merge(ONYXKEYS.REIMBURSEMENT_ACCOUNT, {isErrorModalVisible: false});
591-
}
592-
593586
/**
594587
* Set the current fields with errors.
595588
*
@@ -810,7 +803,6 @@ export {
810803
setupWithdrawalAccount,
811804
validateBankAccount,
812805
hideBankAccountErrors,
813-
hideBankAccountErrorModal,
814806
showBankAccountErrorModal,
815807
showBankAccountFormValidationError,
816808
setBankAccountFormValidationErrors,

src/libs/actions/Policy.js

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ function updateAllPolicies(policyCollection) {
7373

7474
// Set all the policies
7575
_.each(policyCollection, (policyData, key) => {
76-
Onyx.merge(key, policyData);
76+
Onyx.merge(key, {...policyData, alertMessage: '', errors: null});
7777
});
7878
}
7979

@@ -179,6 +179,7 @@ function invite(logins, welcomeNote, policyID) {
179179
// Make a shallow copy to preserve original data, and concat the login
180180
const policy = _.clone(allPolicies[key]);
181181
policy.employeeList = [...policy.employeeList, ...newEmployeeList];
182+
policy.alertMessage = '';
182183

183184
// Optimistically add the user to the policy
184185
Onyx.set(key, policy);
@@ -193,21 +194,21 @@ function invite(logins, welcomeNote, policyID) {
193194
// Save the personalDetails for the invited user in Onyx
194195
if (data.jsonCode === 200) {
195196
Onyx.merge(ONYXKEYS.PERSONAL_DETAILS, formatPersonalDetails(data.personalDetails));
197+
Navigation.goBack();
196198
return;
197199
}
198200

199201
// If the operation failed, undo the optimistic addition
200202
const policyDataWithoutLogin = _.clone(allPolicies[key]);
201203
policyDataWithoutLogin.employeeList = _.without(allPolicies[key].employeeList, ...newEmployeeList);
202-
Onyx.set(key, policyDataWithoutLogin);
203204

204205
// Show the user feedback that the addition failed
205-
let errorMessage = translateLocal('workspace.invite.genericFailureMessage');
206+
policyDataWithoutLogin.alertMessage = translateLocal('workspace.invite.genericFailureMessage');
206207
if (data.jsonCode === 402) {
207-
errorMessage += ` ${translateLocal('workspace.invite.pleaseEnterValidLogin')}`;
208+
policyDataWithoutLogin.alertMessage += ` ${translateLocal('workspace.invite.pleaseEnterValidLogin')}`;
208209
}
209210

210-
Growl.error(errorMessage, 5000);
211+
Onyx.set(key, policyDataWithoutLogin);
211212
});
212213
}
213214

@@ -294,6 +295,22 @@ function updateLocalPolicyValues(policyID, values) {
294295
Onyx.merge(`${ONYXKEYS.COLLECTION.POLICY}${policyID}`, values);
295296
}
296297

298+
/**
299+
* @param {String} policyID
300+
* @param {Object} errors
301+
*/
302+
function setWorkspaceErrors(policyID, errors) {
303+
Onyx.merge(`${ONYXKEYS.COLLECTION.POLICY}${policyID}`, {errors: null});
304+
Onyx.merge(`${ONYXKEYS.COLLECTION.POLICY}${policyID}`, {errors});
305+
}
306+
307+
/**
308+
* @param {String} policyID
309+
*/
310+
function hideWorkspaceAlertMessage(policyID) {
311+
Onyx.merge(`${ONYXKEYS.COLLECTION.POLICY}${policyID}`, {alertMessage: ''});
312+
}
313+
297314
export {
298315
getPolicySummaries,
299316
getPolicyList,
@@ -304,4 +321,6 @@ export {
304321
uploadAvatar,
305322
update,
306323
updateLocalPolicyValues,
324+
setWorkspaceErrors,
325+
hideWorkspaceAlertMessage,
307326
};

0 commit comments

Comments
 (0)