Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/tienifr/App into fix/26828
Browse files Browse the repository at this point in the history
  • Loading branch information
tienifr committed Sep 15, 2023
2 parents 189975d + e48121c commit 726f9fa
Show file tree
Hide file tree
Showing 81 changed files with 848 additions and 473 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/testBuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,6 @@ jobs:
IOS: ${{ needs.iOS.result }}
WEB: ${{ needs.web.result }}
ANDROID_LINK: ${{steps.get_android_path.outputs.android_path}}
DESKTOP_LINK: https://ad-hoc-expensify-cash.s3.amazonaws.com/desktop/${{ env.PULL_REQUEST_NUMBER }}/NewExpensify.dmg
DESKTOP_LINK: https://ad-hoc-expensify-cash.s3.amazonaws.com/desktop/${{ env.PULL_REQUEST_NUMBER }}/NewExpensifyAdHoc.dmg
IOS_LINK: ${{steps.get_ios_path.outputs.ios_path}}
WEB_LINK: https://${{ env.PULL_REQUEST_NUMBER }}.pr-testing.expensify.com
18 changes: 9 additions & 9 deletions .storybook/theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ export default create({
fontBase: 'ExpensifyNeue-Regular',
fontCode: 'monospace',
base: 'dark',
appBg: colors.greenHighlightBackground,
colorPrimary: colors.greenDefaultButton,
appBg: colors.darkHighlightBackground,
colorPrimary: colors.darkDefaultButton,
colorSecondary: colors.green,
appContentBg: colors.greenAppBackground,
textColor: colors.white,
barTextColor: colors.white,
appContentBg: colors.darkAppBackground,
textColor: colors.darkPrimaryText,
barTextColor: colors.darkPrimaryText,
barSelectedColor: colors.green,
barBg: colors.greenAppBackground,
appBorderColor: colors.greenBorders,
inputBg: colors.greenHighlightBackground,
inputBorder: colors.greenBorders,
barBg: colors.darkAppBackground,
appBorderColor: colors.darkBorders,
inputBg: colors.darkHighlightBackground,
inputBorder: colors.darkBorders,
appBorderRadius: 8,
inputBorderRadius: 8,
});
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ android {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
multiDexEnabled rootProject.ext.multiDexEnabled
versionCode 1001036901
versionName "1.3.69-1"
versionCode 1001037002
versionName "1.3.70-2"
}

flavorDimensions "default"
Expand Down
28 changes: 23 additions & 5 deletions config/electronBuilder.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,24 @@ const macIcon = {
adhoc: './desktop/icon-adhoc.png',
};

const appIds = {
production: 'com.expensifyreactnative.chat',
staging: 'com.expensifyreactnative.dev.chat',
adhoc: 'com.expensifyreactnative.adhoc.chat',
};

const productNames = {
production: 'New Expensify',
staging: 'New Expensify Dev',
adhoc: 'New Expensify AdHoc',
};

const artifactNames = {
production: 'NewExpensify.dmg',
staging: 'NewExpensifyDev.dmg',
adhoc: 'NewExpensifyAdHoc.dmg',
};

const isCorrectElectronEnv = ['production', 'staging', 'adhoc'].includes(process.env.ELECTRON_ENV);

if (!isCorrectElectronEnv) {
Expand All @@ -32,8 +50,8 @@ if (!isCorrectElectronEnv) {
* It can be used to create local builds of the same, by omitting the `--publish` flag
*/
module.exports = {
appId: 'com.expensifyreactnative.chat',
productName: 'New Expensify',
appId: appIds[process.env.ELECTRON_ENV],
productName: productNames[process.env.ELECTRON_ENV],
extraMetadata: {
version,
},
Expand All @@ -46,8 +64,8 @@ module.exports = {
type: 'distribution',
},
dmg: {
title: 'New Expensify',
artifactName: 'NewExpensify.dmg',
title: productNames[process.env.ELECTRON_ENV],
artifactName: artifactNames[process.env.ELECTRON_ENV],
internetEnabled: true,
},
publish: [
Expand All @@ -65,7 +83,7 @@ module.exports = {
output: 'desktop-build',
},
protocols: {
name: 'New Expensify',
name: productNames[process.env.ELECTRON_ENV],
schemes: ['new-expensify'],
},
};
4 changes: 2 additions & 2 deletions ios/NewExpensify/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.3.69</string>
<string>1.3.70</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
Expand All @@ -40,7 +40,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>1.3.69.1</string>
<string>1.3.70.2</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.3.69</string>
<string>1.3.70</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.3.69.1</string>
<string>1.3.70.2</string>
</dict>
</plist>
29 changes: 9 additions & 20 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.69-1",
"version": "1.3.70-2",
"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 @@ -107,7 +107,7 @@
"patch-package": "^8.0.0",
"process": "^0.11.10",
"prop-types": "^15.7.2",
"pusher-js": "7.4.0",
"pusher-js": "8.3.0",
"react": "18.2.0",
"react-collapse": "^5.1.0",
"react-content-loader": "^6.1.0",
Expand Down
4 changes: 3 additions & 1 deletion src/ROUTES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export default {
NEW_CHAT: 'new/chat',
NEW_TASK,
REPORT,
REPORT_WITH_ID: 'r/:reportID/:reportActionID?',
REPORT_WITH_ID: 'r/:reportID?/:reportActionID?',
EDIT_REQUEST: 'r/:threadReportID/edit/:field',
getEditRequestRoute: (threadReportID: string, field: ValueOf<typeof CONST.EDIT_REQUEST_FIELD>) => `r/${threadReportID}/edit/${field}`,
EDIT_CURRENCY_REQUEST: 'r/:threadReportID/edit/currency',
Expand Down Expand Up @@ -104,6 +104,7 @@ export default {
MONEY_REQUEST_SCAN_TAB: ':iouType/new/:reportID?/scan',
MONEY_REQUEST_DISTANCE_TAB: ':iouType/new/:reportID?/distance',
MONEY_REQUEST_WAYPOINT: ':iouType/new/waypoint/:waypointIndex',
MONEY_REQUEST_ADDRESS: ':iouType/new/address/:reportID?',
IOU_SEND_ADD_BANK_ACCOUNT: `${IOU_SEND}/add-bank-account`,
IOU_SEND_ADD_DEBIT_CARD: `${IOU_SEND}/add-debit-card`,
IOU_SEND_ENABLE_PAYMENTS: `${IOU_SEND}/enable-payments`,
Expand All @@ -118,6 +119,7 @@ export default {
getMoneyRequestMerchantRoute: (iouType: string, reportID = '') => `${iouType}/new/merchant/${reportID}`,
getMoneyRequestDistanceTabRoute: (iouType: string, reportID = '') => `${iouType}/new/${reportID}/distance`,
getMoneyRequestWaypointRoute: (iouType: string, waypointIndex: number) => `${iouType}/new/waypoint/${waypointIndex}`,
getMoneyRequestAddressRoute: (iouType: string, reportID = '') => `${iouType}/new/address/${reportID}`,
getMoneyRequestTagRoute: (iouType: string, reportID = '') => `${iouType}/new/tag/${reportID}`,
SPLIT_BILL_DETAILS: `r/:reportID/split/:reportActionID`,
getSplitBillDetailsRoute: (reportID: string, reportActionID: string) => `r/${reportID}/split/${reportActionID}`,
Expand Down
22 changes: 20 additions & 2 deletions src/components/AddPlaidBankAccount.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import _ from 'underscore';
import React, {useEffect, useRef, useCallback} from 'react';
import React, {useEffect, useRef, useCallback, useMemo} from 'react';
import {ActivityIndicator, View} from 'react-native';
import {useIsFocused} from '@react-navigation/native';
import PropTypes from 'prop-types';
import {withOnyx} from 'react-native-onyx';
import lodashGet from 'lodash/get';
Expand Down Expand Up @@ -38,6 +39,9 @@ const propTypes = {
/** Fired when the user exits the Plaid flow */
onExitPlaid: PropTypes.func,

/** Fired when the screen is blurred */
onBlurPlaid: PropTypes.func,

/** Fired when the user selects an account */
onSelect: PropTypes.func,

Expand All @@ -61,6 +65,7 @@ const defaultProps = {
selectedPlaidAccountID: '',
plaidLinkToken: '',
onExitPlaid: () => {},
onBlurPlaid: () => {},
onSelect: () => {},
text: '',
receivedRedirectURI: null,
Expand All @@ -75,6 +80,7 @@ function AddPlaidBankAccount({
selectedPlaidAccountID,
plaidLinkToken,
onExitPlaid,
onBlurPlaid,
onSelect,
text,
receivedRedirectURI,
Expand All @@ -88,6 +94,7 @@ function AddPlaidBankAccount({

const {translate} = useLocalize();
const {isOffline} = useNetwork();
const isFocused = useIsFocused();

/**
* @returns {String}
Expand All @@ -102,6 +109,11 @@ function AddPlaidBankAccount({
}
};

/**
* @returns {Array}
*/
const plaidBankAccounts = useMemo(() => lodashGet(plaidData, 'bankAccounts') || [], [plaidData]);

/**
* @returns {Boolean}
* I'm using useCallback so the useEffect which uses this function doesn't run on every render.
Expand Down Expand Up @@ -151,6 +163,13 @@ function AddPlaidBankAccount({
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);

useEffect(() => {
if (isFocused || plaidBankAccounts.length) {
return;
}
onBlurPlaid();
}, [isFocused, onBlurPlaid, plaidBankAccounts.length]);

useEffect(() => {
// If we are coming back from offline and we haven't authenticated with Plaid yet, we need to re-run our call to kick off Plaid
// previousNetworkState.current also makes sure that this doesn't run on the first render.
Expand All @@ -160,7 +179,6 @@ function AddPlaidBankAccount({
previousNetworkState.current = isOffline;
}, [allowDebit, bankAccountID, isAuthenticatedWithPlaid, isOffline]);

const plaidBankAccounts = lodashGet(plaidData, 'bankAccounts') || [];
const token = getPlaidLinkToken();
const options = _.map(plaidBankAccounts, (account) => ({
value: account.plaidAccountID,
Expand Down
4 changes: 2 additions & 2 deletions src/components/ConfirmedRoute.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import transactionPropTypes from './transactionPropTypes';
import BlockingView from './BlockingViews/BlockingView';
import useNetwork from '../hooks/useNetwork';
import useLocalize from '../hooks/useLocalize';
import MapView from './MapView';
import DistanceMapView from './DistanceMapView';

const propTypes = {
/** Transaction that stores the distance request data */
Expand Down Expand Up @@ -90,7 +90,7 @@ function ConfirmedRoute({mapboxAccessToken, transaction}) {
return (
<>
{!isOffline && Boolean(mapboxAccessToken.token) ? (
<MapView
<DistanceMapView
accessToken={mapboxAccessToken.token}
mapPadding={CONST.MAP_PADDING}
pitchEnabled={false}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import Text from '../Text';
import Icon from '../Icon';
import * as Illustrations from '../Icon/Illustrations';
import * as Expensicons from '../Icon/Expensicons';
import colors from '../../styles/colors';
import themeColors from '../../styles/themes/default';
import styles from '../../styles/styles';
import withLocalize, {withLocalizePropTypes} from '../withLocalize';
import Navigation from '../../libs/Navigation/Navigation';
Expand Down Expand Up @@ -56,7 +56,7 @@ function DeeplinkRedirectLoadingIndicator({translate, openLinkInBrowser, session
<Icon
width={154}
height={34}
fill={colors.green}
fill={themeColors.success}
src={Expensicons.ExpensifyWordmark}
/>
</View>
Expand Down
Loading

0 comments on commit 726f9fa

Please sign in to comment.