Skip to content

Commit

Permalink
Merge branch 'main' into feature/rn-update-0.72
Browse files Browse the repository at this point in the history
  • Loading branch information
fabioh8010 committed Jul 26, 2023
2 parents 7d40e26 + 1fac96b commit 2b07cf5
Show file tree
Hide file tree
Showing 93 changed files with 1,349 additions and 1,102 deletions.
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ android {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
multiDexEnabled rootProject.ext.multiDexEnabled
versionCode 1001034503
versionName "1.3.45-3"
versionCode 1001034508
versionName "1.3.45-8"
}

signingConfigs {
Expand Down
1 change: 1 addition & 0 deletions assets/animations/ExpensifyLounge.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions assets/animations/WorkspacePlanet.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion contributingGuides/FORMS.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ Form inputs will NOT store draft values by default. This is to avoid accidentall

### Validate on Blur, on Change and Submit

Each individual form field that requires validation will have its own validate test defined. When the form field loses focus (blur) we will run that validate test and show feedback. A blur on one field will not cause other fields to validate or show errors unless they have already been blurred.
Each individual form field that requires validation will have its own validate test defined. When the form field loses focus (blur) we will run that validate test and show feedback. A blur on one field will not cause other fields to validate or show errors unless they have already been blurred. To prevent server errors from being cleared inadvertently, we only run validation on blur if any form data has changed since the last validation/submit.

Once a user has “touched” an input, i.e. blurred the input, we will also start validating that input on change when the user goes back to editing it.

Expand Down
2 changes: 1 addition & 1 deletion ios/NewExpensify/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>1.3.45.3</string>
<string>1.3.45.8</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.3.45.3</string>
<string>1.3.45.8</string>
</dict>
</plist>
4 changes: 2 additions & 2 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -739,7 +739,7 @@ PODS:
- React-Core
- RNReactNativeHapticFeedback (1.14.0):
- React-Core
- RNReanimated (3.3.0):
- RNReanimated (3.4.0):
- DoubleConversion
- FBLazyVector
- glog
Expand Down Expand Up @@ -1209,7 +1209,7 @@ SPEC CHECKSUMS:
RNLocalize: d4b8af4e442d4bcca54e68fc687a2129b4d71a81
RNPermissions: dcdb7b99796bbeda6975a6e79ad519c41b251b1c
RNReactNativeHapticFeedback: 1e3efeca9628ff9876ee7cdd9edec1b336913f8c
RNReanimated: 9f7068e43b9358a46a688d94a5a3adb258139457
RNReanimated: 020859659f64be2d30849a1fe88c821a7c3e0cbf
RNScreens: d037903436160a4b039d32606668350d2a808806
RNSVG: 53c661b76829783cdaf9b7a57258f3d3b4c28315
SDWebImage: a7f831e1a65eb5e285e3fb046a23fcfbf08e696d
Expand Down
18 changes: 9 additions & 9 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.3.45-3",
"version": "1.3.45-8",
"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 @@ -122,7 +122,7 @@
"react-native-plaid-link-sdk": "^10.0.0",
"react-native-qrcode-svg": "^6.2.0",
"react-native-quick-sqlite": "^8.0.0-beta.2",
"react-native-reanimated": "3.3.0",
"react-native-reanimated": "3.4.0",
"react-native-render-html": "6.3.1",
"react-native-safe-area-context": "4.4.1",
"react-native-screens": "3.21.0",
Expand Down
4 changes: 1 addition & 3 deletions src/CONST.js
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,7 @@ const CONST = {
TASKEDITED: 'TASKEDITED',
TASKCANCELLED: 'TASKCANCELLED',
IOU: 'IOU',
REIMBURSEMENTQUEUED: 'REIMBURSEMENTQUEUED',
RENAMED: 'RENAMED',
CHRONOSOOOLIST: 'CHRONOSOOOLIST',
TASKCOMPLETED: 'TASKCOMPLETED',
Expand Down Expand Up @@ -2541,9 +2542,6 @@ const CONST = {
ADJUSTABLE: 'adjustable',
IMAGE: 'image',
},
SETTINGS_LOUNGE_ACCESS: {
HEADER_IMAGE_ASPECT_RATIO: 0.64,
},
TRANSLATION_KEYS: {
ATTACHMENT: 'common.attachment',
},
Expand Down
1 change: 1 addition & 0 deletions src/ONYXKEYS.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ export default {
EDIT_TASK_FORM: 'editTaskForm',
MONEY_REQUEST_DESCRIPTION_FORM: 'moneyRequestDescriptionForm',
NEW_CONTACT_METHOD_FORM: 'newContactMethodForm',
PAYPAL_FORM: 'payPalForm',
},

// Whether we should show the compose input or not
Expand Down
1 change: 1 addition & 0 deletions src/SCREENS.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@ export default {
TRANSITION_BETWEEN_APPS: 'TransitionBetweenApps',
SETTINGS: {
PREFERENCES: 'Settings_Preferences',
WORKSPACES: 'Settings_Workspaces',
},
};
2 changes: 1 addition & 1 deletion src/components/AddPlaidBankAccount.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ class AddPlaidBankAccount extends React.Component {
token={token}
onSuccess={({publicToken, metadata}) => {
Log.info('[PlaidLink] Success!');
BankAccounts.openPlaidBankAccountSelector(publicToken, metadata.institution.name, this.props.allowDebit);
BankAccounts.openPlaidBankAccountSelector(publicToken, metadata.institution.name, this.props.allowDebit, this.props.bankAccountID);
}}
onError={(error) => {
Log.hmmm('[PlaidLink] Error: ', error.message);
Expand Down
4 changes: 2 additions & 2 deletions src/components/Avatar.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import * as Expensicons from './Icon/Expensicons';
import Image from './Image';
import styles from '../styles/styles';
import * as ReportUtils from '../libs/ReportUtils';
import useOnNetworkReconnect from '../hooks/useOnNetworkReconnect';
import useNetwork from '../hooks/useNetwork';

const propTypes = {
/** Source for the avatar. Can be a URL or an icon. */
Expand Down Expand Up @@ -64,7 +64,7 @@ const defaultProps = {
function Avatar(props) {
const [imageError, setImageError] = useState(false);

useOnNetworkReconnect(() => setImageError(false));
useNetwork({onReconnect: () => setImageError(false)});

if (!props.source) {
return null;
Expand Down
114 changes: 63 additions & 51 deletions src/components/DatePicker/index.js
Original file line number Diff line number Diff line change
@@ -1,90 +1,102 @@
import React from 'react';
import moment from 'moment';
import React, {forwardRef, useEffect, useRef} from 'react';
import _ from 'underscore';
import TextInput from '../TextInput';
import CONST from '../../CONST';
import * as Browser from '../../libs/Browser';
import TextInput from '../TextInput';
import {defaultProps, propTypes} from './datepickerPropTypes';
import {propTypes, defaultProps} from './datepickerPropTypes';
import withWindowDimensions, {windowDimensionsPropTypes} from '../withWindowDimensions';
import './styles.css';

const datePickerPropTypes = {
...propTypes,
...windowDimensionsPropTypes,
};

function DatePicker({defaultValue, maxDate, minDate, onInputChange, innerRef, label, value, placeholder, errorText, containerStyles, disabled, onBlur}) {
const inputRef = useRef(null);
const defaultDateValue = defaultValue ? moment(defaultValue).format(CONST.DATE.MOMENT_FORMAT_STRING) : '';
class DatePicker extends React.Component {
constructor(props) {
super(props);

this.setDate = this.setDate.bind(this);
this.showDatepicker = this.showDatepicker.bind(this);

useEffect(() => {
inputRef.current.setAttribute('type', 'date');
inputRef.current.setAttribute('max', moment(maxDate).format(CONST.DATE.MOMENT_FORMAT_STRING));
inputRef.current.setAttribute('min', moment(minDate).format(CONST.DATE.MOMENT_FORMAT_STRING));
inputRef.current.classList.add('expensify-datepicker');
}, [maxDate, minDate]);
this.defaultValue = props.defaultValue ? moment(props.defaultValue).format(CONST.DATE.MOMENT_FORMAT_STRING) : '';
}

componentDidMount() {
// Adds nice native datepicker on web/desktop. Not possible to set this through props
this.inputRef.setAttribute('type', 'date');
this.inputRef.setAttribute('max', moment(this.props.maxDate).format(CONST.DATE.MOMENT_FORMAT_STRING));
this.inputRef.setAttribute('min', moment(this.props.minDate).format(CONST.DATE.MOMENT_FORMAT_STRING));
this.inputRef.classList.add('expensify-datepicker');
}

/**
* Trigger the `onChange` handler when the user input has a complete date or is cleared
* @param {String} text
*/
const setDate = (text) => {
setDate(text) {
if (!text) {
onInputChange('');
this.props.onInputChange('');
return;
}

const asMoment = moment(text, true);
if (asMoment.isValid()) {
onInputChange(asMoment.format(CONST.DATE.MOMENT_FORMAT_STRING));
this.props.onInputChange(asMoment.format(CONST.DATE.MOMENT_FORMAT_STRING));
}
};
}

/**
* Pops the datepicker up when we focus this field. This only works on mWeb chrome
* On mWeb chrome the user needs to tap on the field again in order to bring the datepicker. But our current styles
* don't make this very obvious. To avoid confusion we open the datepicker when the user focuses the field
*/
const showDatepicker = () => {
if (!inputRef.current || !Browser.isMobileChrome()) {
showDatepicker() {
if (!this.inputRef || !Browser.isMobileChrome()) {
return;
}

inputRef.current.click();
};
this.inputRef.click();
}

return (
<TextInput
forceActiveLabel
ref={(el) => {
inputRef.current = el;
render() {
return (
<TextInput
forceActiveLabel
ref={(el) => {
this.inputRef = el;

if (_.isFunction(innerRef)) {
innerRef(el);
}
}}
onFocus={showDatepicker}
label={label}
accessibilityLabel={label}
accessibilityRole={CONST.ACCESSIBILITY_ROLE.TEXT}
onInputChange={setDate}
value={value}
defaultValue={defaultDateValue}
placeholder={placeholder}
errorText={errorText}
containerStyles={containerStyles}
disabled={disabled}
onBlur={onBlur}
/>
);
if (_.isFunction(this.props.innerRef)) {
this.props.innerRef(el);
}
}}
onFocus={this.showDatepicker}
label={this.props.label}
accessibilityLabel={this.props.label}
accessibilityRole={CONST.ACCESSIBILITY_ROLE.TEXT}
onInputChange={this.setDate}
value={this.props.value}
defaultValue={this.defaultValue}
placeholder={this.props.placeholder}
errorText={this.props.errorText}
containerStyles={this.props.containerStyles}
disabled={this.props.disabled}
onBlur={this.props.onBlur}
/>
);
}
}

DatePicker.propTypes = datePickerPropTypes;
DatePicker.defaultProps = defaultProps;
DatePicker.displayName = 'DatePicker';

export default forwardRef((props, ref) => (
<DatePicker
// eslint-disable-next-line react/jsx-props-no-spreading
{...props}
innerRef={ref}
/>
));
export default withWindowDimensions(
React.forwardRef((props, ref) => (
<DatePicker
// eslint-disable-next-line react/jsx-props-no-spreading
{...props}
innerRef={ref}
/>
)),
);
4 changes: 2 additions & 2 deletions src/components/DisplayNames/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,11 @@ class DisplayNames extends PureComponent {
}

return (
// Tokenization of string only support 1 numberOfLines on Web
// Tokenization of string only support prop numberOfLines on Web
<Text
style={[...this.props.textStyles, styles.pRelative]}
onLayout={this.setContainerLayout}
numberOfLines={1}
numberOfLines={this.props.numberOfLines || undefined}
ref={(el) => (this.containerRef = el)}
>
{this.props.shouldUseFullTitle
Expand Down
2 changes: 1 addition & 1 deletion src/components/DisplayNames/index.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ function DisplayNames(props) {
<Text
accessibilityLabel={props.accessibilityLabel}
style={props.textStyles}
numberOfLines={props.numberOfLines}
numberOfLines={props.numberOfLines || undefined}
>
{props.fullTitle}
</Text>
Expand Down
Loading

0 comments on commit 2b07cf5

Please sign in to comment.