Skip to content

Commit

Permalink
Merge branch 'main' of github.com:Expensify/App into jasper-readPromi…
Browse files Browse the repository at this point in the history
…seSeqQueue
  • Loading branch information
jasperhuangg committed Nov 3, 2022
2 parents 0885f91 + 1721965 commit a656dae
Show file tree
Hide file tree
Showing 25 changed files with 795 additions and 1,692 deletions.
2 changes: 1 addition & 1 deletion .github/actions/composite/setupNode/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ runs:
cache: npm

- name: Install node packages
uses: nick-invision/retry@7c68161adf97a48beb850a595b8784ec57a98cbb
uses: nick-invision/retry@0711ba3d7808574133d713a0d92d2941be03a350
with:
timeout_minutes: 10
max_attempts: 5
Expand Down
4 changes: 2 additions & 2 deletions .github/actions/composite/updateProtectedBranch/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ runs:
- name: Check changed files
if: ${{ inputs.TARGET_BRANCH == 'main' }}
id: changedFiles
# Version: 3.3.0
uses: umani/changed-files@1d252c611c64289d35243fc37ece7323ea5e93e1
# TODO: Remove and switch back to upstream when https://github.com/umani/changed-files/pull/27 is merged
uses: roryabraham/changed-files@c14fad74000cf77ff62b7f78cfd34c2124665c35
with:
repo-token: ${{ github.token }}
pr-number: ${{ steps.createPullRequest.outputs.PR_NUMBER }}
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/createNewVersion.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ jobs:
with:
GPG_PASSPHRASE: ${{ secrets.LARGE_SECRET_PASSPHRASE }}

- uses: softprops/turnstyle@8db075d65b19bf94e6e8687b504db69938dc3c65
# TODO: Point back at upstream when https://github.com/softprops/turnstyle/pull/46 is merged
- uses: roryabraham/turnstyle@d50d3ffc3f2c8d280dec4cd802c1c735fcda77c8
with:
poll-interval-seconds: 10
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/platformDeploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ jobs:
bundler-cache: true

- name: Install cocoapods
uses: nick-invision/retry@7c68161adf97a48beb850a595b8784ec57a98cbb
uses: nick-invision/retry@0711ba3d7808574133d713a0d92d2941be03a350
with:
timeout_minutes: 10
max_attempts: 5
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/preDeploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ jobs:
needs: [chooseDeployActions, createNewVersion]
runs-on: ubuntu-latest
steps:
- uses: softprops/turnstyle@8db075d65b19bf94e6e8687b504db69938dc3c65
# TODO: Point back at upstream when https://github.com/softprops/turnstyle/pull/46 is merged
- uses: roryabraham/turnstyle@d50d3ffc3f2c8d280dec4cd802c1c735fcda77c8
with:
poll-interval-seconds: 10
env:
Expand Down
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 1001022300
versionName "1.2.23-0"
versionCode 1001022307
versionName "1.2.23-7"
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.23.0</string>
<string>1.2.23.7</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.23.0</string>
<string>1.2.23.7</string>
</dict>
</plist>
2,002 changes: 660 additions & 1,342 deletions package-lock.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "new.expensify",
"version": "1.2.23-0",
"version": "1.2.23-7",
"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 @@ -140,7 +140,7 @@
"@storybook/manager-webpack5": "^6.5.10",
"@storybook/react": "^6.5.9",
"@storybook/theming": "^6.5.9",
"@svgr/webpack": "^5.5.0",
"@svgr/webpack": "^6.0.0",
"@testing-library/jest-native": "^3.4.2",
"@testing-library/react-native": "^7.0.2",
"@vercel/ncc": "^0.27.0",
Expand Down Expand Up @@ -178,7 +178,7 @@
"react-native-clean-project": "^4.0.0-alpha4.0",
"react-native-flipper": "https://gitpkg.now.sh/facebook/flipper/react-native/react-native-flipper?9cacc9b59402550eae866e0e81e5f0c2f8203e6b",
"react-native-performance-flipper-reporter": "^2.0.0",
"react-native-svg-transformer": "^0.14.3",
"react-native-svg-transformer": "^1.0.0",
"react-test-renderer": "18.1.0",
"semver": "^7.3.4",
"speed-measure-webpack-plugin": "^1.5.0",
Expand Down
15 changes: 5 additions & 10 deletions src/components/CheckboxWithLabel.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import React from 'react';
import PropTypes from 'prop-types';
import {View, TouchableOpacity} from 'react-native';
import _ from 'underscore';
import styles from '../styles/styles';
import Checkbox from './Checkbox';
import Text from './Text';
import InlineErrorText from './InlineErrorText';
import FormHelpMessage from './FormHelpMessage';

const requiredPropsCheck = (props) => {
if (!props.label && !props.LabelComponent) {
Expand Down Expand Up @@ -77,8 +76,6 @@ class CheckboxWithLabel extends React.Component {

this.isChecked = props.value || props.defaultValue || props.isChecked;
this.LabelComponent = props.LabelComponent;
this.defaultStyles = [styles.flexRow, styles.alignItemsCenter];
this.wrapperStyles = _.isArray(props.style) ? [...this.defaultStyles, ...props.style] : [...this.defaultStyles, props.style];

this.toggleCheckbox = this.toggleCheckbox.bind(this);
}
Expand All @@ -90,8 +87,8 @@ class CheckboxWithLabel extends React.Component {

render() {
return (
<>
<View style={this.wrapperStyles}>
<View style={this.props.style}>
<View style={[styles.flexRow, styles.alignItemsCenter]}>
<Checkbox
isChecked={this.isChecked}
onPress={this.toggleCheckbox}
Expand Down Expand Up @@ -121,10 +118,8 @@ class CheckboxWithLabel extends React.Component {
{this.LabelComponent && (<this.LabelComponent />)}
</TouchableOpacity>
</View>
<InlineErrorText styles={[styles.ml8]}>
{this.props.errorText}
</InlineErrorText>
</>
<FormHelpMessage message={this.props.errorText} />
</View>
);
}
}
Expand Down
67 changes: 31 additions & 36 deletions src/components/FormAlertWrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,14 @@ import {View} from 'react-native';
import PropTypes from 'prop-types';
import React from 'react';
import {withNetwork} from './OnyxProvider';
import Icon from './Icon';
import * as Expensicons from './Icon/Expensicons';
import RenderHTML from './RenderHTML';
import TextLink from './TextLink';
import Text from './Text';
import colors from '../styles/colors';
import TextLink from './TextLink';
import compose from '../libs/compose';
import networkPropTypes from './networkPropTypes';
import styles from '../styles/styles';
import withLocalize, {withLocalizePropTypes} from './withLocalize';
import FormHelpMessage from './FormHelpMessage';

const propTypes = {
/** Wrapped child components */
Expand Down Expand Up @@ -52,38 +50,35 @@ const defaultProps = {
//
// This component takes other components as a child prop. It will then render any wrapped components as a function using "render props",
// and passes it a (bool) isOffline parameter. Child components can then use the isOffline variable to determine offline behavior.
const FormAlertWrapper = props => (
<View style={props.containerStyles}>
{props.isAlertVisible && (
<View style={[styles.flexRow, styles.alignItemsCenter, styles.mb3]}>
<Icon src={Expensicons.Exclamation} fill={colors.red} />
<View style={[styles.flexRow, styles.ml2, styles.flexWrap, styles.flex1]}>
{!_.isEmpty(props.message) && props.isMessageHtml && <RenderHTML html={`<muted-text>${props.message}</muted-text>`} />}

{!_.isEmpty(props.message) && !props.isMessageHtml && <Text style={styles.mutedTextLabel}>{props.message}</Text>}

{_.isEmpty(props.message) && (
<>
<Text style={styles.mutedTextLabel}>
{`${props.translate('common.please')} `}
</Text>
<TextLink
style={styles.label}
onPress={props.onFixTheErrorsLinkPressed}
>
{props.translate('common.fixTheErrors')}
</TextLink>
<Text style={styles.mutedTextLabel}>
{` ${props.translate('common.inTheFormBeforeContinuing')}.`}
</Text>
</>
)}
</View>
</View>
)}
{props.children(props.network.isOffline)}
</View>
);
const FormAlertWrapper = (props) => {
let children;
if (_.isEmpty(props.message)) {
children = (
<Text style={[styles.formError, styles.mb0]}>
{`${props.translate('common.please')} `}
<TextLink
style={styles.label}
onPress={props.onFixTheErrorsLinkPressed}
>
{props.translate('common.fixTheErrors')}
</TextLink>
{` ${props.translate('common.inTheFormBeforeContinuing')}.`}
</Text>
);
} else if (props.isMessageHtml) {
children = <RenderHTML html={`<muted-text>${props.message}</muted-text>`} />;
}
return (
<View style={props.containerStyles}>
{props.isAlertVisible && (
<FormHelpMessage message={props.message} style={[styles.mb3]}>
{children}
</FormHelpMessage>
)}
{props.children(props.network.isOffline)}
</View>
);
};

FormAlertWrapper.propTypes = propTypes;
FormAlertWrapper.defaultProps = defaultProps;
Expand Down
56 changes: 56 additions & 0 deletions src/components/FormHelpMessage.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import React from 'react';
import _ from 'underscore';
import PropTypes from 'prop-types';
import {View} from 'react-native';
import Icon from './Icon';
import * as Expensicons from './Icon/Expensicons';
import Text from './Text';
import colors from '../styles/colors';
import styles from '../styles/styles';
import stylePropTypes from '../styles/stylePropTypes';

const propTypes = {
/** Error or hint text. Ignored when children is not empty */
message: PropTypes.string,

/** Children to render next to dot indicator */
children: PropTypes.node,

/** Indicates whether to show error or hint */
isError: PropTypes.bool,

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

const defaultProps = {
message: '',
children: null,
isError: true,
style: [],
};

const FormHelpMessage = (props) => {
if (_.isEmpty(props.message) && _.isEmpty(props.children)) {
return null;
}

return (
<View style={[styles.flexRow, styles.alignItemsCenter, styles.mt2, styles.mb1, ...props.style]}>
{props.isError && <Icon src={Expensicons.DotIndicator} fill={colors.red} />}
<View style={[styles.flex1, styles.ml2]}>
{props.children || (
<Text style={[props.isError ? styles.formError : styles.formHelp, styles.mb0]}>
{props.message}
</Text>
)}
</View>
</View>
);
};

FormHelpMessage.propTypes = propTypes;
FormHelpMessage.defaultProps = defaultProps;
FormHelpMessage.displayName = 'FormHelpMessage';

export default FormHelpMessage;
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const customHTMLElementModels = {
}),
'muted-text': defaultHTMLElementModels.div.extend({
tagName: 'muted-text',
mixedUAStyles: styles.mutedTextLabel,
mixedUAStyles: {...styles.formError, ...styles.mb0},
}),
comment: defaultHTMLElementModels.div.extend({
tagName: 'comment',
Expand Down
6 changes: 2 additions & 4 deletions src/components/Picker/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import PropTypes from 'prop-types';
import BasePicker from './BasePicker';
import Text from '../Text';
import styles from '../../styles/styles';
import InlineErrorText from '../InlineErrorText';
import FormHelpMessage from '../FormHelpMessage';

const propTypes = {
/** Picker label */
Expand Down Expand Up @@ -95,9 +95,7 @@ class Picker extends PureComponent {
onInputChange={this.onInputChange}
/>
</View>
<InlineErrorText styles={[styles.mh3]}>
{this.props.errorText}
</InlineErrorText>
<FormHelpMessage message={this.props.errorText} />
</>
);
}
Expand Down
6 changes: 2 additions & 4 deletions src/components/RadioButtonWithLabel.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import _ from 'underscore';
import styles from '../styles/styles';
import RadioButton from './RadioButton';
import Text from './Text';
import InlineErrorText from './InlineErrorText';
import FormHelpMessage from './FormHelpMessage';

const propTypes = {
/** Whether the radioButton is checked */
Expand Down Expand Up @@ -75,9 +75,7 @@ const RadioButtonWithLabel = (props) => {
{LabelComponent && (<LabelComponent />)}
</TouchableOpacity>
</View>
<InlineErrorText>
{props.errorText}
</InlineErrorText>
<FormHelpMessage message={props.errorText} />
</>
);
};
Expand Down
6 changes: 2 additions & 4 deletions src/components/TextInput/BaseTextInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import variables from '../../styles/variables';
import Checkbox from '../Checkbox';
import getSecureEntryKeyboardType from '../../libs/getSecureEntryKeyboardType';
import CONST from '../../CONST';
import FormHelpMessage from '../FormHelpMessage';

class BaseTextInput extends Component {
constructor(props) {
Expand Down Expand Up @@ -198,7 +199,6 @@ class BaseTextInput extends Component {
const inputProps = _.omit(this.props, _.keys(baseTextInputPropTypes.propTypes));
const hasLabel = Boolean(this.props.label.length);
const inputHelpText = this.props.errorText || this.props.hint;
const formHelpStyles = this.props.errorText ? styles.formError : styles.formHelp;
const placeholder = (this.props.prefixCharacter || this.state.isFocused || !hasLabel || (hasLabel && this.props.forceActiveLabel)) ? this.props.placeholder : null;
const textInputContainerStyles = _.reduce([
styles.textInputContainer,
Expand Down Expand Up @@ -305,9 +305,7 @@ class BaseTextInput extends Component {
</TouchableWithoutFeedback>
</View>
{!_.isEmpty(inputHelpText) && (
<Text style={[formHelpStyles, styles.mt1, styles.ph3]}>
{inputHelpText}
</Text>
<FormHelpMessage isError={!_.isEmpty(this.props.errorText)} message={inputHelpText} />
)}
</View>
{/*
Expand Down
3 changes: 2 additions & 1 deletion src/libs/ReportUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ function getDisplayNameForParticipant(participant, shouldUseShortForm = false) {

const loginWithoutSMSDomain = Str.removeSMSDomain(participant.login);
let longName = participant.displayName || loginWithoutSMSDomain;
if (Str.isSMSLogin(longName)) {
if (longName === loginWithoutSMSDomain && Str.isSMSLogin(longName)) {
longName = LocalePhoneNumber.toLocalPhone(preferredLocale, longName);
}
const shortName = participant.firstName || longName;
Expand Down Expand Up @@ -1083,6 +1083,7 @@ export {
isPolicyExpenseChat,
getDefaultAvatar,
getIcons,
getDisplayNameForParticipant,
getRoomWelcomeMessage,
getDisplayNamesWithTooltips,
getReportName,
Expand Down
Loading

0 comments on commit a656dae

Please sign in to comment.