Skip to content

Commit

Permalink
Merge branch 'Expensify:main' into fix-8590
Browse files Browse the repository at this point in the history
  • Loading branch information
allroundexperts authored May 20, 2022
2 parents e8ad005 + 02fb4e9 commit 26dab7c
Show file tree
Hide file tree
Showing 54 changed files with 415 additions and 218 deletions.
11 changes: 5 additions & 6 deletions .github/workflows/platformDeploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -209,13 +209,12 @@ jobs:
max_attempts: 5
command: npm ci

- uses: actions/cache@v2
with:
path: ios/Pods
key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}

- name: Install cocoapods
run: cd ios && pod install
uses: nick-invision/retry@7c68161adf97a48beb850a595b8784ec57a98cbb
with:
timeout_minutes: 10
max_attempts: 5
command: cd ios && pod install

- name: Decrypt profile
run: cd ios && gpg --quiet --batch --yes --decrypt --passphrase="$LARGE_SECRET_PASSPHRASE" --output chat_expensify_appstore.mobileprovision chat_expensify_appstore.mobileprovision.gpg
Expand Down
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@ android {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
multiDexEnabled rootProject.ext.multiDexEnabled
versionCode 1001016103
versionName "1.1.61-3"
versionCode 1001016400
versionName "1.1.64-0"
}
splits {
abi {
Expand Down
25 changes: 25 additions & 0 deletions assets/images/avatars/fallback-avatar.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions assets/images/avatars/fallback-workspace-avatar.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions ios/NewExpensify/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.1.61</string>
<string>1.1.64</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
Expand All @@ -30,7 +30,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>1.1.61.3</string>
<string>1.1.64.0</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>LSApplicationQueriesSchemes</key>
Expand Down
4 changes: 2 additions & 2 deletions ios/NewExpensifyTests/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.1.61</string>
<string>1.1.64</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.1.61.3</string>
<string>1.1.64.0</string>
</dict>
</plist>
2 changes: 1 addition & 1 deletion package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "new.expensify",
"version": "1.1.61-3",
"version": "1.1.64-0",
"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
30 changes: 25 additions & 5 deletions src/components/Avatar.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import Icon from './Icon';
import themeColors from '../styles/themes/default';
import CONST from '../CONST';
import * as StyleUtils from '../styles/StyleUtils';
import * as Expensicons from './Icon/Expensicons';

const propTypes = {
/** Source for the avatar. Can be a URL or an icon. */
Expand All @@ -23,6 +24,9 @@ const propTypes = {

/** The fill color for the icon. Can be hex, rgb, rgba, or valid react-native named color such as 'red' or 'blue' */
fill: PropTypes.string,

/** A fallback avatar icon to display when there is an error on loading avatar from remote URL. */
fallbackIcon: PropTypes.func,
};

const defaultProps = {
Expand All @@ -31,9 +35,17 @@ const defaultProps = {
containerStyles: [],
size: CONST.AVATAR_SIZE.DEFAULT,
fill: themeColors.icon,
fallbackIcon: Expensicons.FallbackAvatar,
};

class Avatar extends PureComponent {
constructor(props) {
super(props);
this.state = {
imageError: false,
};
}

render() {
if (!this.props.source) {
return null;
Expand All @@ -45,13 +57,21 @@ class Avatar extends PureComponent {
];

const iconSize = StyleUtils.getAvatarSize(this.props.size);

return (
<View pointerEvents="none" style={this.props.containerStyles}>
{
_.isFunction(this.props.source)
? <Icon src={this.props.source} fill={this.props.fill} height={iconSize} width={iconSize} />
: <Image source={{uri: this.props.source}} style={imageStyle} />
}
{_.isFunction(this.props.source) || this.state.imageError
? (
<Icon
src={this.state.imageError ? this.props.fallbackIcon : this.props.source}
height={iconSize}
width={iconSize}
fill={this.state.imageError ? themeColors.offline : this.props.fill}
/>
)
: (
<Image source={{uri: this.props.source}} style={imageStyle} onError={() => this.setState({imageError: true})} />
)}
</View>
);
}
Expand Down
6 changes: 6 additions & 0 deletions src/components/AvatarWithImagePicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ const propTypes = {
/** Size of Indicator */
size: PropTypes.oneOf([CONST.AVATAR_SIZE.LARGE, CONST.AVATAR_SIZE.DEFAULT]),

/** A fallback avatar icon to display when there is an error on loading avatar from remote URL. */
fallbackIcon: PropTypes.func,

...withLocalizePropTypes,
};

Expand All @@ -65,6 +68,7 @@ const defaultProps = {
isUsingDefaultAvatar: false,
isUploading: false,
size: CONST.AVATAR_SIZE.DEFAULT,
fallbackIcon: Expensicons.FallbackAvatar,
};

class AvatarWithImagePicker extends React.Component {
Expand Down Expand Up @@ -181,6 +185,8 @@ class AvatarWithImagePicker extends React.Component {
containerStyles={styles.avatarLarge}
imageStyles={[styles.avatarLarge, styles.alignSelfCenter]}
source={this.props.avatarURL}
fallbackIcon={this.props.fallbackIcon}
size={this.props.size}
/>
)
: (
Expand Down
1 change: 1 addition & 0 deletions src/components/AvatarWithIndicator.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ class AvatarWithIndicator extends PureComponent {
<Avatar
imageStyles={[this.props.size === 'large' ? styles.avatarLarge : null]}
source={this.props.source}
size={this.props.size}
/>
</Tooltip>
<Tooltip text={this.userStatus()} absolute>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Button.js
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ class Button extends Component {
onPressOut={this.props.onPressOut}
disabled={this.props.isLoading || this.props.isDisabled}
style={[
this.props.isDisabled ? styles.cursorDisabled : {},
this.props.isDisabled ? {...styles.cursorDisabled, ...styles.noSelect} : {},
...this.additionalStyles,
]}
>
Expand Down
2 changes: 1 addition & 1 deletion src/components/ConfirmContent.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ const ConfirmContent = props => (
/>
{props.shouldShowCancelButton && (
<Button
style={[styles.mt3]}
style={[styles.mt3, styles.noSelect]}
onPress={props.onCancel}
text={props.cancelText || props.translate('common.no')}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ const BaseHTMLEngineProvider = (props) => {
baseStyle={styles.webViewStyles.baseFontStyle}
tagsStyles={styles.webViewStyles.tagStyles}
enableCSSInlineProcessing={false}
dangerouslyDisableWhitespaceCollapsing
systemFonts={_.values(fontFamily)}
>
<RenderHTMLConfigProvider
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ class PreRenderer extends React.Component {
const node = this.ref.getScrollableNode();
const horizontalOverflow = node.scrollWidth > node.offsetWidth;

if ((event.currentTarget === node) && horizontalOverflow) {
// Account for vertical scrolling variation when horizontally scrolling via touchpad by checking a large delta.
const isVerticalScrolling = Math.abs(event.deltaY) > 3; // This is for touchpads sensitive
if ((event.currentTarget === node) && horizontalOverflow && !isVerticalScrolling) {
node.scrollLeft += event.deltaX;
event.preventDefault();
event.stopPropagation();
Expand Down
8 changes: 5 additions & 3 deletions src/components/IOUConfirmationList.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ const propTypes = {
phoneNumber: PropTypes.string,
})).isRequired,

/** Whether this is an IOU split and belongs to a group report */
isGroupSplit: PropTypes.bool.isRequired,
/** Is this IOU associated with existing report */
isIOUAttachedToExistingChatReport: PropTypes.bool.isRequired,

...windowDimensionsPropTypes,

Expand Down Expand Up @@ -225,6 +225,7 @@ class IOUConfirmationList extends Component {
data: [formattedMyPersonalDetails],
shouldShow: true,
indexOffset: 0,
isDisabled: true,
}, {
title: this.props.translate('iOUConfirmationList.whoWasThere'),
data: formattedSelectedParticipants,
Expand Down Expand Up @@ -350,6 +351,7 @@ class IOUConfirmationList extends Component {
const shouldDisableButton = selectedParticipants.length === 0 || this.props.network.isOffline;
const isLoading = this.props.iou.loading && !this.props.network.isOffline;
const recipient = this.state.participants[0];
const canModifyParticipants = this.props.isIOUAttachedToExistingChatReport && this.props.hasMultipleParticipants;
return (
<>
<ScrollView style={[styles.flexGrow0, styles.flexShrink1, styles.flexBasisAuto, styles.w100]}>
Expand All @@ -362,7 +364,7 @@ class IOUConfirmationList extends Component {
canSelectMultipleOptions={this.props.hasMultipleParticipants}
selectedOptions={this.getSelectedOptions()}
onSelectRow={toggleOption}
isDisabled={!this.props.isGroupSplit}
isDisabled={!canModifyParticipants}
optionHoveredStyle={hoverStyle}
/>
</ScrollView>
Expand Down
4 changes: 4 additions & 0 deletions src/components/Icon/Expensicons.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ import AdminRoomAvatar from '../../../assets/images/avatars/admin-room.svg';
import AnnounceRoomAvatar from '../../../assets/images/avatars/announce-room.svg';
import Connect from '../../../assets/images/connect.svg';
import DomainRoomAvatar from '../../../assets/images/avatars/domain-room.svg';
import FallbackAvatar from '../../../assets/images/avatars/fallback-avatar.svg';
import FallbackWorkspaceAvatar from '../../../assets/images/avatars/fallback-workspace-avatar.svg';

export {
ActiveRoomAvatar,
Expand Down Expand Up @@ -112,6 +114,8 @@ export {
Eye,
EyeDisabled,
ExpensifyCard,
FallbackAvatar,
FallbackWorkspaceAvatar,
Gallery,
Gear,
Hashtag,
Expand Down
Loading

0 comments on commit 26dab7c

Please sign in to comment.