Skip to content

Commit f235baf

Browse files
authored
Merge pull request #8515 from Expensify/update-staging-from-main
Update version to 1.1.52-0 on staging
2 parents aec6045 + 71c028b commit f235baf

26 files changed

+147
-78
lines changed

android/app/build.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,8 @@ android {
152152
minSdkVersion rootProject.ext.minSdkVersion
153153
targetSdkVersion rootProject.ext.targetSdkVersion
154154
multiDexEnabled rootProject.ext.multiDexEnabled
155-
versionCode 1001015100
156-
versionName "1.1.51-0"
155+
versionCode 1001015200
156+
versionName "1.1.52-0"
157157
}
158158
splits {
159159
abi {

ios/NewExpensify/Info.plist

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<key>CFBundlePackageType</key>
1818
<string>APPL</string>
1919
<key>CFBundleShortVersionString</key>
20-
<string>1.1.51</string>
20+
<string>1.1.52</string>
2121
<key>CFBundleSignature</key>
2222
<string>????</string>
2323
<key>CFBundleURLTypes</key>
@@ -30,7 +30,7 @@
3030
</dict>
3131
</array>
3232
<key>CFBundleVersion</key>
33-
<string>1.1.51.0</string>
33+
<string>1.1.52.0</string>
3434
<key>ITSAppUsesNonExemptEncryption</key>
3535
<false/>
3636
<key>LSApplicationQueriesSchemes</key>

ios/NewExpensifyTests/Info.plist

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515
<key>CFBundlePackageType</key>
1616
<string>BNDL</string>
1717
<key>CFBundleShortVersionString</key>
18-
<string>1.1.51</string>
18+
<string>1.1.52</string>
1919
<key>CFBundleSignature</key>
2020
<string>????</string>
2121
<key>CFBundleVersion</key>
22-
<string>1.1.51.0</string>
22+
<string>1.1.52.0</string>
2323
</dict>
2424
</plist>

package-lock.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "new.expensify",
3-
"version": "1.1.51-0",
3+
"version": "1.1.52-0",
44
"author": "Expensify, Inc.",
55
"homepage": "https://new.expensify.com",
66
"description": "New Expensify is the next generation of Expensify: a reimagination of payments based atop a foundation of chat.",

src/CONST.js

+1
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,7 @@ const CONST = {
305305
COLD: 'cold',
306306
REPORT_ACTION_ITEM_LAYOUT_DEBOUNCE_TIME: 1500,
307307
TOOLTIP_SENSE: 1000,
308+
SPINNER_TIMEOUT: 15 * 1000,
308309
},
309310
PRIORITY_MODE: {
310311
GSD: 'gsd',

src/components/ArchivedReportFooter.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import withLocalize, {withLocalizePropTypes} from './withLocalize';
88
import compose from '../libs/compose';
99
import personalDetailsPropType from '../pages/personalDetailsPropType';
1010
import ONYXKEYS from '../ONYXKEYS';
11+
import * as ReportUtils from '../libs/reportUtils';
1112

1213
const propTypes = {
1314
/** The reason this report was archived */
@@ -53,7 +54,6 @@ const defaultProps = {
5354

5455
const ArchivedReportFooter = (props) => {
5556
const archiveReason = lodashGet(props.reportClosedAction, 'originalMessage.reason', CONST.REPORT.ARCHIVE_REASON.DEFAULT);
56-
const policyName = lodashGet(props.policies, `${ONYXKEYS.COLLECTION.POLICY}${props.report.policyID}.name`);
5757
let displayName = lodashGet(props.personalDetails, `${props.report.ownerEmail}.displayName`, props.report.ownerEmail);
5858

5959
let oldDisplayName;
@@ -69,7 +69,7 @@ const ArchivedReportFooter = (props) => {
6969
text={props.translate(`reportArchiveReasons.${archiveReason}`, {
7070
displayName: `<strong>${displayName}</strong>`,
7171
oldDisplayName: `<strong>${oldDisplayName}</strong>`,
72-
policyName: `<strong>${policyName}</strong>`,
72+
policyName: `<strong>${ReportUtils.getPolicyName(props.report, props.policies)}</strong>`,
7373
})}
7474
shouldRenderHTML={archiveReason !== CONST.REPORT.ARCHIVE_REASON.DEFAULT}
7575
/>

src/components/FullscreenLoadingIndicator.js

+49-19
Original file line numberDiff line numberDiff line change
@@ -5,38 +5,68 @@ import {ActivityIndicator, StyleSheet, View} from 'react-native';
55
import styles from '../styles/styles';
66
import themeColors from '../styles/themes/default';
77
import stylePropTypes from '../styles/stylePropTypes';
8+
import Log from '../libs/Log';
9+
import CONST from '../CONST';
810

911
const propTypes = {
10-
/** Controls whether the loader is mounted and displayed */
11-
visible: PropTypes.bool,
12+
/**
13+
* Context info printed in timing log.
14+
* Providing this prop would capture logs for mounting/unmounting and staying visible for too long
15+
*/
16+
logDetail: PropTypes.shape({
17+
/** Name is used to distinct the loader in captured logs. */
18+
name: PropTypes.string.isRequired,
19+
}),
1220

1321
/** Additional style props */
1422
style: stylePropTypes,
1523
};
1624

1725
const defaultProps = {
18-
visible: true,
1926
style: [],
27+
logDetail: null,
2028
};
2129

22-
/**
23-
* Loading indication component intended to cover the whole page, while the page prepares for initial render
24-
*
25-
* @param {Object} props
26-
* @returns {JSX.Element}
27-
*/
28-
const FullScreenLoadingIndicator = (props) => {
29-
if (!props.visible) {
30-
return null;
30+
class FullScreenLoadingIndicator extends React.Component {
31+
componentDidMount() {
32+
if (!this.props.logDetail) {
33+
return;
34+
}
35+
36+
if (!this.props.logDetail.name) {
37+
throw new Error('A name should be set to distinct logged messages. Please check the `logDetails` prop.');
38+
}
39+
40+
Log.info('[LoadingIndicator] Became visible', false, this.props.logDetail);
41+
42+
this.timeoutID = setTimeout(
43+
() => Log.alert(
44+
`${CONST.ERROR.ENSURE_BUGBOT} [LoadingIndicator] Visible after timeout`,
45+
{timeout: CONST.TIMING.SPINNER_TIMEOUT, ...this.props.logDetail},
46+
false,
47+
),
48+
CONST.TIMING.SPINNER_TIMEOUT,
49+
);
3150
}
3251

33-
const additionalStyles = _.isArray(props.style) ? props.style : [props.style];
34-
return (
35-
<View style={[StyleSheet.absoluteFillObject, styles.fullScreenLoading, ...additionalStyles]}>
36-
<ActivityIndicator color={themeColors.spinner} size="large" />
37-
</View>
38-
);
39-
};
52+
componentWillUnmount() {
53+
if (!this.timeoutID) {
54+
return;
55+
}
56+
57+
clearTimeout(this.timeoutID);
58+
Log.info('[LoadingIndicator] Disappeared', false, this.props.logDetail);
59+
}
60+
61+
render() {
62+
const additionalStyles = _.isArray(this.props.style) ? this.props.style : [this.props.style];
63+
return (
64+
<View style={[StyleSheet.absoluteFillObject, styles.fullScreenLoading, ...additionalStyles]}>
65+
<ActivityIndicator color={themeColors.spinner} size="large" />
66+
</View>
67+
);
68+
}
69+
}
4070

4171
FullScreenLoadingIndicator.propTypes = propTypes;
4272
FullScreenLoadingIndicator.defaultProps = defaultProps;

src/components/ReportWelcomeText.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import withLocalize, {withLocalizePropTypes} from './withLocalize';
1010
import compose from '../libs/compose';
1111
import * as ReportUtils from '../libs/reportUtils';
1212
import * as OptionsListUtils from '../libs/OptionsListUtils';
13-
import * as Localize from '../libs/Localize';
1413
import ONYXKEYS from '../ONYXKEYS';
1514
import CONST from '../CONST';
1615

@@ -91,7 +90,7 @@ const ReportWelcomeText = (props) => {
9190
{props.translate('reportActionsView.beginningOfChatHistoryPolicyExpenseChatPartTwo')}
9291
</Text>
9392
<Text style={[styles.textStrong]}>
94-
{lodashGet(props.policies, [`${ONYXKEYS.COLLECTION.POLICY}${props.report.policyID}`, 'name'], Localize.translateLocal('workspace.common.unavailable'))}
93+
{ReportUtils.getPolicyName(props.report, props.policies)}
9594
</Text>
9695
<Text>
9796
{props.translate('reportActionsView.beginningOfChatHistoryPolicyExpenseChatPartThree')}

src/components/WalletStatementModal/index.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,7 @@ class WalletStatementModal extends React.Component {
4141
const authToken = lodashGet(this.props, 'session.authToken', null);
4242
return (
4343
<>
44-
<FullScreenLoadingIndicator
45-
visible={this.state.isLoading}
46-
/>
44+
{this.state.isLoading && <FullScreenLoadingIndicator />}
4745
<View style={[styles.flex1]}>
4846
<iframe
4947
src={`${this.props.statementPageURL}&authToken=${authToken}`}

src/languages/en.js

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ export default {
3737
privacyPolicy: 'Privacy policy',
3838
delete: 'Delete',
3939
deleted: 'deleted',
40+
archived: 'archived',
4041
contacts: 'Contacts',
4142
recents: 'Recents',
4243
close: 'Close',

src/languages/es.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ export default {
3737
privacyPolicy: 'Política de privacidad',
3838
delete: 'Eliminar',
3939
deleted: 'eliminado',
40+
archived: 'archivado',
4041
contacts: 'Contactos',
4142
recents: 'Recientes',
4243
close: 'Cerrar',
@@ -854,7 +855,7 @@ export default {
854855
nameInputHelpText: 'Este es el nombre que verás en tu espacio de trabajo.',
855856
nameIsRequiredError: 'Debes definir un nombre para tu espacio de trabajo.',
856857
currencyInputLabel: 'Moneda por defecto',
857-
currencyInputHelpText: 'Todas los gastos en este epecio de trabajo serán convertidos a esta moneda.',
858+
currencyInputHelpText: 'Todas los gastos en este espacio de trabajo serán convertidos a esta moneda.',
858859
save: 'Guardar',
859860
genericFailureMessage: 'Se produjo un error al guardar el espacio de trabajo. Por favor, inténtalo de nuevo.',
860861
avatarUploadFailureMessage: 'No se pudo subir el avatar. Por favor, inténtalo de nuevo.',

src/libs/Navigation/AppNavigator/MainDrawerNavigator.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ const MainDrawerNavigator = (props) => {
4949

5050
// Wait until reports are fetched and there is a reportID in initialParams
5151
if (!initialParams.reportID) {
52-
return <FullScreenLoadingIndicator />;
52+
return <FullScreenLoadingIndicator logDetail={{name: 'Main Drawer Loader', initialParams}} />;
5353
}
5454

5555
// After the app initializes and reports are available the home navigation is mounted

src/libs/Navigation/Navigation.js

+14-9
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
import _ from 'underscore';
22
import React from 'react';
33
import {Keyboard} from 'react-native';
4-
import {
5-
StackActions,
6-
DrawerActions,
7-
getPathFromState,
8-
} from '@react-navigation/native';
4+
import {DrawerActions, getPathFromState, StackActions} from '@react-navigation/native';
95
import PropTypes from 'prop-types';
106
import Onyx from 'react-native-onyx';
117
import Log from '../Log';
@@ -168,6 +164,16 @@ function dismissModal(shouldOpenDrawer = false) {
168164
}
169165
}
170166

167+
/**
168+
* Returns the current active route
169+
* @returns {String}
170+
*/
171+
function getActiveRoute() {
172+
return navigationRef.current && navigationRef.current.getCurrentRoute().name
173+
? getPathFromState(navigationRef.current.getState(), linkingConfig.config)
174+
: '';
175+
}
176+
171177
/**
172178
* Check whether the passed route is currently Active or not.
173179
*
@@ -179,10 +185,7 @@ function dismissModal(shouldOpenDrawer = false) {
179185
*/
180186
function isActiveRoute(routePath) {
181187
// We remove First forward slash from the URL before matching
182-
const path = navigationRef.current && navigationRef.current.getCurrentRoute().name
183-
? getPathFromState(navigationRef.current.getState(), linkingConfig.config).substring(1)
184-
: '';
185-
return path === routePath;
188+
return getActiveRoute().substring(1) === routePath;
186189
}
187190

188191
/**
@@ -214,9 +217,11 @@ DismissModal.defaultProps = {
214217
};
215218

216219
export default {
220+
canNavigate,
217221
navigate,
218222
dismissModal,
219223
isActiveRoute,
224+
getActiveRoute,
220225
goBack,
221226
DismissModal,
222227
closeDrawer,

src/libs/Navigation/NavigationRoot.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,12 @@ class NavigationRoot extends Component {
5757
render() {
5858
return (
5959
<NavigationContainer
60-
fallback={<FullScreenLoadingIndicator style={styles.navigatorFullScreenLoading} />}
60+
fallback={(
61+
<FullScreenLoadingIndicator
62+
logDetail={{name: 'Navigation Fallback Loader', authenticated: this.props.authenticated}}
63+
style={styles.navigatorFullScreenLoading}
64+
/>
65+
)}
6166
onStateChange={this.parseAndStoreRoute}
6267
onReady={this.props.onReady}
6368
theme={navigationTheme}

src/libs/Network/index.js

+2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import * as NetworkStore from './NetworkStore';
99
import * as NetworkEvents from './NetworkEvents';
1010
import * as PersistedRequestsQueue from './PersistedRequestsQueue';
1111
import processRequest from './processRequest';
12+
import {version} from '../../../package.json';
1213

1314
// Queue for network requests so we don't lose actions done by the user while offline
1415
let networkRequestQueue = [];
@@ -181,6 +182,7 @@ function post(command, data = {}, type = CONST.NETWORK.METHOD.POST, shouldUseSec
181182
...data,
182183
shouldRetry: lodashGet(data, 'shouldRetry', true),
183184
canCancel: lodashGet(data, 'canCancel', true),
185+
appversion: version,
184186
};
185187

186188
// Add the request to a queue of actions to perform

src/libs/OptionsListUtils.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,7 @@ function createOption(personalDetailList, report, {
250250
}) {
251251
const isChatRoom = ReportUtils.isChatRoom(report);
252252
const isPolicyExpenseChat = ReportUtils.isPolicyExpenseChat(report);
253+
const isArchivedRoom = ReportUtils.isArchivedRoom(report);
253254
const hasMultipleParticipants = personalDetailList.length > 1 || isChatRoom || isPolicyExpenseChat;
254255
const personalDetail = personalDetailList[0];
255256
const hasDraftComment = hasReportDraftComment(report);
@@ -262,7 +263,7 @@ function createOption(personalDetailList, report, {
262263
const lastMessageTextFromReport = ReportUtils.isReportMessageAttachment({text: lodashGet(report, 'lastMessageText', ''), html: lodashGet(report, 'lastMessageHtml', '')})
263264
? `[${Localize.translateLocal('common.attachment')}]`
264265
: Str.htmlDecode(lodashGet(report, 'lastMessageText', ''));
265-
let lastMessageText = report && hasMultipleParticipants && lastActorDetails
266+
let lastMessageText = report && !isArchivedRoom && hasMultipleParticipants && lastActorDetails
266267
? `${lastActorDetails.displayName}: `
267268
: '';
268269
lastMessageText += report ? lastMessageTextFromReport : '';
@@ -273,7 +274,7 @@ function createOption(personalDetailList, report, {
273274
let text;
274275
let alternateText;
275276
if (isChatRoom || isPolicyExpenseChat) {
276-
text = lodashGet(report, ['reportName'], '');
277+
text = (isArchivedRoom && report.isOwnPolicyExpenseChat) ? report.oldPolicyName : lodashGet(report, ['reportName'], '');
277278
alternateText = (showChatPreviewLine && !forcePolicyNamePreview && lastMessageText)
278279
? lastMessageText
279280
: subtitle;
@@ -315,7 +316,7 @@ function createOption(personalDetailList, report, {
315316
isIOUReportOwner: lodashGet(iouReport, 'ownerEmail', '') === currentUserLogin,
316317
iouReportAmount: lodashGet(iouReport, 'total', 0),
317318
isChatRoom,
318-
isArchivedRoom: ReportUtils.isArchivedRoom(report),
319+
isArchivedRoom,
319320
shouldShowSubscript: isPolicyExpenseChat && !report.isOwnPolicyExpenseChat,
320321
isPolicyExpenseChat,
321322
};

0 commit comments

Comments
 (0)