Skip to content

Commit

Permalink
fix conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
marcaaron committed Sep 30, 2022
2 parents dbb2e11 + 6c81537 commit 51f029e
Show file tree
Hide file tree
Showing 31 changed files with 407 additions and 365 deletions.
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,8 @@ android {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
multiDexEnabled rootProject.ext.multiDexEnabled
versionCode 1001021000
versionName "1.2.10-0"
versionCode 1001021001
versionName "1.2.10-1"
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()

if (isNewArchitectureEnabled()) {
Expand Down
2 changes: 1 addition & 1 deletion ios/NewExpensify/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>1.2.10.0</string>
<string>1.2.10.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.2.10.0</string>
<string>1.2.10.1</string>
</dict>
</plist>
32 changes: 16 additions & 16 deletions package-lock.json

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

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "new.expensify",
"version": "1.2.10-0",
"version": "1.2.10-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 @@ -64,7 +64,7 @@
"dom-serializer": "^0.2.2",
"domhandler": "^4.3.0",
"dotenv": "^8.2.0",
"expensify-common": "git+https://github.com/Expensify/expensify-common.git#a9e791c1190052e934c20efdcd7cd4429b4680cb",
"expensify-common": "git+https://github.com/Expensify/expensify-common.git#03a86215c0ae2bc4e7978e1ca9717fbc7fdea11b",
"fbjs": "^3.0.2",
"file-loader": "^6.0.0",
"html-entities": "^1.3.1",
Expand Down Expand Up @@ -94,7 +94,7 @@
"react-native-image-picker": "^4.8.5",
"react-native-image-size": "git+https://github.com/Expensify/react-native-image-size#6b5ab5110dc3ed554f8eafbc38d7d87c17147972",
"react-native-modal": "^13.0.0",
"react-native-onyx": "1.0.15",
"react-native-onyx": "1.0.17",
"react-native-pdf": "^6.6.2",
"react-native-performance": "^2.0.0",
"react-native-permissions": "^3.0.1",
Expand All @@ -104,7 +104,7 @@
"react-native-render-html": "6.3.1",
"react-native-safe-area-context": "^3.1.4",
"react-native-screens": "^3.10.1",
"react-native-svg": "^12.1.0",
"react-native-svg": "^12.4.4",
"react-native-webview": "^11.17.2",
"react-pdf": "5.7.2",
"react-plaid-link": "3.3.2",
Expand Down
2 changes: 2 additions & 0 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import HTMLEngineProvider from './components/HTMLEngineProvider';
import ComposeProviders from './components/ComposeProviders';
import SafeArea from './components/SafeArea';
import * as Environment from './libs/Environment/Environment';
import {WindowDimensionsProvider} from './components/withWindowDimensions';

// For easier debugging and development, when we are in web we expose Onyx to the window, so you can more easily set data into Onyx
if (window && Environment.isDevelopment()) {
Expand All @@ -37,6 +38,7 @@ const App = () => (
SafeArea,
LocaleContextProvider,
HTMLEngineProvider,
WindowDimensionsProvider,
]}
>
<CustomStatusBar />
Expand Down
1 change: 1 addition & 0 deletions src/ONYXKEYS.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,5 +177,6 @@ export default {
FORMS: {
ADD_DEBIT_CARD_FORM: 'addDebitCardForm',
REQUEST_CALL_FORM: 'requestCallForm',
REIMBURSEMENT_ACCOUNT_FORM: 'reimbursementAccount',
},
};
29 changes: 25 additions & 4 deletions src/components/BlockingViews/FullPageNotFoundView.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,30 @@ const propTypes = {

/** If true, child components are replaced with a blocking "not found" view */
shouldShow: PropTypes.bool,

/** The key in the translations file to use for the title */
titleKey: PropTypes.string,

/** The key in the translations file to use for the subtitle */
subtitleKey: PropTypes.string,

/** Whether we should show a back icon */
shouldShowBackButton: PropTypes.bool,

/** Whether we should show a close button */
shouldShowCloseButton: PropTypes.bool,

/** Method to trigger when pressing the back button of the header */
onBackButtonPress: PropTypes.func,
};

const defaultProps = {
shouldShow: false,
titleKey: 'notFound.notHere',
subtitleKey: 'notFound.pageNotFound',
shouldShowBackButton: true,
shouldShowCloseButton: true,
onBackButtonPress: () => Navigation.dismissModal(),
};

// eslint-disable-next-line rulesdir/no-negated-variables
Expand All @@ -30,15 +50,16 @@ const FullPageNotFoundView = (props) => {
return (
<>
<HeaderWithCloseButton
shouldShowBackButton
onBackButtonPress={() => Navigation.dismissModal()}
shouldShowBackButton={props.shouldShowBackButton}
shouldShowCloseButton={props.shouldShowCloseButton}
onBackButtonPress={props.onBackButtonPress}
onCloseButtonPress={() => Navigation.dismissModal()}
/>
<View style={styles.flex1}>
<BlockingView
icon={Expensicons.QuestionMark}
title={props.translate('notFound.notHere')}
subtitle={props.translate('notFound.pageNotFound')}
title={props.translate(props.titleKey)}
subtitle={props.translate(props.subtitleKey)}
/>
</View>
</>
Expand Down
24 changes: 18 additions & 6 deletions src/components/Form.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {withOnyx} from 'react-native-onyx';
import compose from '../libs/compose';
import withLocalize, {withLocalizePropTypes} from './withLocalize';
import * as FormActions from '../libs/actions/FormActions';
import * as ErrorUtils from '../libs/ErrorUtils';
import styles from '../styles/styles';
import FormAlertWithSubmitButton from './FormAlertWithSubmitButton';

Expand All @@ -16,6 +17,9 @@ const propTypes = {
/** Text to be displayed in the submit button */
submitButtonText: PropTypes.string.isRequired,

/** Controls the submit button's visibility */
isSubmitButtonVisible: PropTypes.bool,

/** Callback to validate the form */
validate: PropTypes.func.isRequired,

Expand All @@ -32,8 +36,8 @@ const propTypes = {
/** Controls the loading state of the form */
isLoading: PropTypes.bool,

/** Server side error message */
error: PropTypes.string,
/** Server side errors keyed by microtime */
errors: PropTypes.objectOf(PropTypes.string),
}),

/** Contains draft values for each input in the form */
Expand All @@ -44,9 +48,10 @@ const propTypes = {
};

const defaultProps = {
isSubmitButtonVisible: true,
formState: {
isLoading: false,
error: '',
errors: null,
},
draftValues: {},
};
Expand Down Expand Up @@ -75,6 +80,11 @@ class Form extends React.Component {
this.touchedInputs[inputID] = true;
}

getErrorMessage() {
const latestErrorMessage = ErrorUtils.getLatestErrorMessage(this.props.formState);
return this.props.formState.error || (typeof latestErrorMessage === 'string' ? latestErrorMessage : '');
}

submit() {
// Return early if the form is already submitting to avoid duplicate submission
if (this.props.formState.isLoading) {
Expand All @@ -100,7 +110,7 @@ class Form extends React.Component {
* @returns {Object} - An object containing the errors for each inputID, e.g. {inputID1: error1, inputID2: error2}
*/
validate(values) {
FormActions.setErrorMessage(this.props.formID, '');
FormActions.setErrors(this.props.formID, null);
const validationErrors = this.props.validate(values);

if (!_.isObject(validationErrors)) {
Expand Down Expand Up @@ -184,17 +194,19 @@ class Form extends React.Component {
>
<View style={[this.props.style]}>
{this.childrenWrapperWithProps(this.props.children)}
{this.props.isSubmitButtonVisible && (
<FormAlertWithSubmitButton
buttonText={this.props.submitButtonText}
isAlertVisible={_.size(this.state.errors) > 0 || Boolean(this.props.formState.error)}
isAlertVisible={_.size(this.state.errors) > 0 || Boolean(this.getErrorMessage())}
isLoading={this.props.formState.isLoading}
message={this.props.formState.error}
message={this.getErrorMessage()}
onSubmit={this.submit}
onFixTheErrorsLinkPressed={() => {
this.inputRefs[_.first(_.keys(this.state.errors))].focus();
}}
containerStyles={[styles.mh0, styles.mt5]}
/>
)}
</View>
</ScrollView>
</>
Expand Down
Loading

0 comments on commit 51f029e

Please sign in to comment.