Skip to content

Commit

Permalink
Merge pull request #8491 from Expensify/update-staging-from-main
Browse files Browse the repository at this point in the history
Update version to 1.1.51-0 on staging
  • Loading branch information
OSBotify authored Apr 5, 2022
2 parents ea98a29 + 49f23b9 commit aec6045
Show file tree
Hide file tree
Showing 26 changed files with 155 additions and 72 deletions.
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 1001014901
versionName "1.1.49-1"
versionCode 1001015100
versionName "1.1.51-0"
}
splits {
abi {
Expand Down
2 changes: 1 addition & 1 deletion config/electronBuilder.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ module.exports = {
},
dmg: {
title: 'New Expensify',
artifactName: `NewExpensify${process.env.ARTIFACT_SUFFIX || ''}.dmg`,
artifactName: 'NewExpensify.dmg',
internetEnabled: true,
},
publish: [{
Expand Down
2 changes: 1 addition & 1 deletion config/webpack/webpack.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ module.exports = (env = {}) => {
mode: 'development',
devtool: 'inline-source-map',
devServer: {
contentBase: path.join(__dirname, '../dist'),
contentBase: path.join(__dirname, '../../dist'),
hot: true,
...proxySettings,
historyApiFallback: true,
Expand Down
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.49</string>
<string>1.1.51</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
Expand All @@ -30,7 +30,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>1.1.49.1</string>
<string>1.1.51.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.49</string>
<string>1.1.51</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.1.49.1</string>
<string>1.1.51.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.49-1",
"version": "1.1.51-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
4 changes: 1 addition & 3 deletions scripts/build-desktop.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,4 @@ info ""
title "Building Desktop App Archive Using Electron"
info ""
shift 1
"$LOCAL_PACKAGES/electron-builder" --config config/electronBuilder.config.js --x64 "$@"
export ARTIFACT_SUFFIX="-arm64"
"$LOCAL_PACKAGES/electron-builder" --config config/electronBuilder.config.js --arm64 "$@"
"$LOCAL_PACKAGES/electron-builder" --config config/electronBuilder.config.js "$@"
2 changes: 1 addition & 1 deletion src/components/ErrorBoundary/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ import Log from '../../libs/Log';

BaseErrorBoundary.defaultProps.logError = (errorMessage, error, errorInfo) => {
// Log the error to the server
Log.alert(errorMessage, {error: error.message, errorInfo}, false);
Log.alert(`${errorMessage} - ${error.message}`, {errorInfo}, false);
};
export default BaseErrorBoundary;
2 changes: 1 addition & 1 deletion src/components/ErrorBoundary/index.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Log from '../../libs/Log';

BaseErrorBoundary.defaultProps.logError = (errorMessage, error, errorInfo) => {
// Log the error to the server
Log.alert(errorMessage, {error: error.message, errorInfo}, false);
Log.alert(`${errorMessage} - ${error.message}`, {errorInfo}, false);

/* On native we also log the error to crashlytics
* Since the error was handled we need to manually tell crashlytics about it */
Expand Down
27 changes: 27 additions & 0 deletions src/components/ImageView/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import styles from '../../styles/styles';
import * as StyleUtils from '../../styles/StyleUtils';
import canUseTouchScreen from '../../libs/canUseTouchscreen';
import withWindowDimensions, {windowDimensionsPropTypes} from '../withWindowDimensions';
import FullscreenLoadingIndicator from '../FullscreenLoadingIndicator';

const propTypes = {
/** URL to full-sized image */
Expand All @@ -23,7 +24,10 @@ class ImageView extends PureComponent {
this.onContainerPressIn = this.onContainerPressIn.bind(this);
this.onContainerPress = this.onContainerPress.bind(this);
this.onContainerPressOut = this.onContainerPressOut.bind(this);
this.imageLoadingStart = this.imageLoadingStart.bind(this);
this.imageLoadingEnd = this.imageLoadingEnd.bind(this);
this.state = {
isLoading: false,
containerHeight: 0,
containerWidth: 0,
isZoomed: false,
Expand Down Expand Up @@ -227,6 +231,14 @@ class ImageView extends PureComponent {
this.setState(prevState => ({isDragging: prevState.isMouseDown}));
}

imageLoadingStart() {
this.setState({isLoading: true});
}

imageLoadingEnd() {
this.setState({isLoading: false});
}

render() {
if (this.canUseTouchScreen) {
return (
Expand All @@ -240,7 +252,14 @@ class ImageView extends PureComponent {
styles.h100,
]}
resizeMode="contain"
onLoadStart={this.imageLoadingStart}
onLoadEnd={this.imageLoadingEnd}
/>
{this.state.isLoading && (
<FullscreenLoadingIndicator
style={[styles.opacity1, styles.bgTransparent]}
/>
)}
</View>
);
}
Expand Down Expand Up @@ -274,8 +293,16 @@ class ImageView extends PureComponent {
styles.w100,
]}
resizeMode="contain"
onLoadStart={this.imageLoadingStart}
onLoadEnd={this.imageLoadingEnd}
/>
</Pressable>

{this.state.isLoading && (
<FullscreenLoadingIndicator
style={[styles.opacity1, styles.bgTransparent]}
/>
)}
</View>
);
}
Expand Down
58 changes: 43 additions & 15 deletions src/components/ImageView/index.native.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import React, {PureComponent} from 'react';
import PropTypes from 'prop-types';
import {View, InteractionManager, PanResponder} from 'react-native';
import {
View, InteractionManager, PanResponder,
} from 'react-native';
import Image from 'react-native-fast-image';
import ImageZoom from 'react-native-image-pan-zoom';
import ImageSize from 'react-native-image-size';
Expand All @@ -9,6 +11,7 @@ import styles from '../../styles/styles';
import * as StyleUtils from '../../styles/StyleUtils';
import variables from '../../styles/variables';
import withWindowDimensions, {windowDimensionsPropTypes} from '../withWindowDimensions';
import FullscreenLoadingIndicator from '../FullscreenLoadingIndicator';

/**
* On the native layer, we use a image library to handle zoom functionality
Expand All @@ -25,6 +28,7 @@ class ImageView extends PureComponent {
super(props);

this.state = {
isLoading: false,
thumbnailWidth: 100,
thumbnailHeight: 100,
imageWidth: undefined,
Expand All @@ -43,6 +47,9 @@ class ImageView extends PureComponent {
this.panResponder = PanResponder.create({
onStartShouldSetPanResponder: this.updatePanResponderTouches.bind(this),
});

this.imageLoadingStart = this.imageLoadingStart.bind(this);
this.imageLoadingEnd = this.imageLoadingEnd.bind(this);
}

componentDidMount() {
Expand All @@ -64,22 +71,25 @@ class ImageView extends PureComponent {
ImageSize.getSize(this.props.url).then(({width, height}) => {
let imageWidth = width;
let imageHeight = height;
const aspectRatio = (imageHeight / imageWidth);

// Fit the image to windowWidth
imageWidth = Math.round(this.props.windowWidth);
imageHeight = Math.round(imageWidth * aspectRatio);
const containerWidth = Math.round(this.props.windowWidth);
const containerHeight = Math.round(this.props.windowHeight - variables.contentHeaderHeight);

const aspectRatio = Math.min(containerHeight / imageHeight, containerWidth / imageWidth);

// Resize small images to fit the screen. Else resize the smaller dimension to avoid resize issue on Android - https://github.com/Expensify/App/pull/7660#issuecomment-1071622163
if (imageHeight < containerHeight && imageWidth < containerWidth) {
imageHeight *= aspectRatio;
imageWidth *= aspectRatio;
} else if (imageHeight > imageWidth) {
imageHeight *= aspectRatio;
} else {
imageWidth *= aspectRatio;
}

// Resize the image to max dimensions possible on the Native platforms to prevent crashes on Android. To keep the same behavior, apply to IOS as well.
const maxDimensionsScale = 11;
imageHeight = Math.min(imageHeight, (this.props.windowHeight * maxDimensionsScale));

// reduce the imageHeight to windowHeight if imageHeight is greater than the windowHeight
if (imageHeight > (this.props.windowHeight - variables.contentHeaderHeight)) {
imageHeight = Math.round(this.props.windowHeight - variables.contentHeaderHeight);
imageWidth = Math.round((1 / aspectRatio) * imageHeight);
}

imageWidth = Math.min(imageWidth, (this.props.windowWidth * maxDimensionsScale));
this.setState({imageHeight, imageWidth});
});
}
Expand All @@ -100,6 +110,14 @@ class ImageView extends PureComponent {
return false;
}

imageLoadingStart() {
this.setState({isLoading: true});
}

imageLoadingEnd() {
this.setState({isLoading: false});
}

render() {
// Default windowHeight accounts for the modal header height
const windowHeight = this.props.windowHeight - variables.contentHeaderHeight;
Expand All @@ -120,7 +138,10 @@ class ImageView extends PureComponent {
<Image
source={{uri: this.props.url}}
style={StyleUtils.getWidthAndHeightStyle(this.state.thumbnailWidth, this.state.thumbnailHeight)}
resizeMode={Image.resizeMode.contain}
resizeMode="contain"
/>
<FullscreenLoadingIndicator
style={[styles.opacity1, styles.bgTransparent]}
/>
</View>
);
Expand Down Expand Up @@ -177,7 +198,9 @@ class ImageView extends PureComponent {
this.props.style,
]}
source={{uri: this.props.url}}
resizeMode={Image.resizeMode.contain}
resizeMode="contain"
onLoadStart={this.imageLoadingStart}
onLoadEnd={this.imageLoadingEnd}
/>
{/**
Create an invisible view on top of the image so we can capture and set the amount of touches before
Expand All @@ -194,6 +217,11 @@ class ImageView extends PureComponent {
]}
/>
</ImageZoom>
{this.state.isLoading && (
<FullscreenLoadingIndicator
style={[styles.opacity1, styles.bgTransparent]}
/>
)}
</View>
);
}
Expand Down
44 changes: 39 additions & 5 deletions src/components/ImageWithSizeCalculation.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import React, {PureComponent} from 'react';
import {Image} from 'react-native';
import {View, Image} from 'react-native';
import PropTypes from 'prop-types';
import Log from '../libs/Log';
import styles from '../styles/styles';
import makeCancellablePromise from '../libs/MakeCancellablePromise';
import FullscreenLoadingIndicator from './FullscreenLoadingIndicator';

const propTypes = {
/** Url for image to display */
Expand All @@ -29,6 +30,17 @@ const defaultProps = {
* it can be appropriately resized.
*/
class ImageWithSizeCalculation extends PureComponent {
constructor(props) {
super(props);

this.state = {
isLoading: false,
};

this.imageLoadingStart = this.imageLoadingStart.bind(this);
this.imageLoadingEnd = this.imageLoadingEnd.bind(this);
}

componentDidMount() {
this.calculateImageSize();
}
Expand Down Expand Up @@ -83,17 +95,39 @@ class ImageWithSizeCalculation extends PureComponent {
});
}

imageLoadingStart() {
this.setState({isLoading: true});
}

imageLoadingEnd() {
this.setState({isLoading: false});
}

render() {
return (
<Image
<View
style={[
styles.w100,
styles.h100,
this.props.style,
]}
source={{uri: this.props.url}}
resizeMode="contain"
/>
>
<Image
style={[
styles.w100,
styles.h100,
]}
source={{uri: this.props.url}}
resizeMode="contain"
onLoadStart={this.imageLoadingStart}
onLoadEnd={this.imageLoadingEnd}
/>
{this.state.isLoading && (
<FullscreenLoadingIndicator
style={[styles.opacity1, styles.bgTransparent]}
/>
)}
</View>
);
}
}
Expand Down
1 change: 1 addition & 0 deletions src/components/TextInput/BaseTextInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ class BaseTextInput extends Component {
this.props.inputStyle,
!hasLabel && styles.pv0,
this.props.prefixCharacter && StyleUtils.getPaddingLeft(this.state.prefixWidth + styles.pl1.paddingLeft),
this.props.secureTextEntry && styles.secureInput,
]}
multiline={this.props.multiline}
maxLength={this.props.maxLength}
Expand Down
1 change: 0 additions & 1 deletion src/languages/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -706,7 +706,6 @@ export default {
learnMore: 'Learn more',
isMyDataSafe: 'Is my data safe?',
onFidoConditions: 'By continuing with the request to add this bank account, you confirm that you have read, understand and accept ',
onFidoFacialScan: 'Onfido’s Facial Scan Policy and Release',
isControllingOfficer: 'I am authorized to use my company bank account for business spend',
isControllingOfficerError: 'You must be a controlling officer with authorization to operate the business bank account.',
},
Expand Down
1 change: 0 additions & 1 deletion src/languages/es.js
Original file line number Diff line number Diff line change
Expand Up @@ -708,7 +708,6 @@ export default {
learnMore: 'Más información',
isMyDataSafe: '¿Están seguros mis datos?',
onFidoConditions: 'Al continuar con la solicitud de añadir esta cuenta bancaria, confirma que ha leído, entiende y acepta ',
onFidoFacialScan: 'Onfido’s Facial Scan Policy and Release',
isControllingOfficer: 'Estoy autorizado a utilizar la cuenta bancaria de mi compañía para gastos de empresa',
isControllingOfficerError: 'Debe ser un oficial controlador con autorización para operar la cuenta bancaria de la compañía',
},
Expand Down
Loading

0 comments on commit aec6045

Please sign in to comment.