Skip to content

Commit

Permalink
Merge branch 'Expensify:main' into arrow-feature-signed
Browse files Browse the repository at this point in the history
  • Loading branch information
JediWattson authored Jan 5, 2023
2 parents ba8c0e9 + 64b9717 commit 65b694a
Show file tree
Hide file tree
Showing 59 changed files with 3,308 additions and 278 deletions.
69 changes: 57 additions & 12 deletions .github/scripts/verifyPodfile.sh
Original file line number Diff line number Diff line change
@@ -1,19 +1,64 @@
#!/bin/bash

declare -r GREEN='\033[0;32m'
declare -r RED='\033[0;31m'
declare -r NC='\033[0m'
START_DIR=$(pwd)
ROOT_DIR=$(dirname "$(dirname "$(dirname "${BASH_SOURCE[0]}")")")
cd "$ROOT_DIR" || exit 1

podfileSha=$(openssl sha1 ios/Podfile | awk '{print $2}')
podfileLockSha=$(awk '/PODFILE CHECKSUM: /{print $3}' ios/Podfile.lock)
source scripts/shellUtils.sh

echo "Podfile: $podfileSha"
echo "Podfile.lock: $podfileLockSha"
title "Verifying that Podfile.lock is synced with the project"

if [ "$podfileSha" == "$podfileLockSha" ]; then
echo -e "${GREEN}Podfile verified!${NC}"
exit 0
declare EXIT_CODE=0

PODFILE_SHA=$(openssl sha1 ios/Podfile | awk '{print $2}')
PODFILE_LOCK_SHA=$(awk '/PODFILE CHECKSUM: /{print $3}' ios/Podfile.lock)

echo "Podfile: $PODFILE_SHA"
echo "Podfile.lock: $PODFILE_LOCK_SHA"

if [[ "$PODFILE_SHA" == "$PODFILE_LOCK_SHA" ]]; then
success "Podfile checksum verified!"
else
echo -e "${RED}Error: Podfile.lock out of date with Podfile. Did you forget to run \`npx pod-install\`?${NC}"
exit 1
error "Podfile.lock checksum mismatch. Did you forget to run \`npx pod-install\`?"
EXIT_CODE=1
fi

info "Comparing Podfile.lock with node packages..."

# Retrieve a list of podspec directories as listed in the Podfile.lock
SPEC_DIRS=$(yq '.["EXTERNAL SOURCES"].[].":path" | select( . == "*node_modules*")' < ios/Podfile.lock)

# Format a list of Pods based on the output of the config command
FORMATTED_PODS=$( \
jq --raw-output --slurp 'map((.name + " (" + .version + ")")) | .[]' <<< "$( \
npx react-native config | \
jq '.dependencies[].platforms.ios.podspecPath | select( . != null )' | \
xargs -L 1 pod ipc spec --silent
)"
)

# Check for uncommitted package removals
# If they are listed in Podfile.lock but the directories don't exist they have been removed
while read -r DIR; do
if [[ ! -d "${DIR#../}" ]]; then
error "Directory \`${DIR#../node_modules/}\` not found in node_modules. Did you forget to run \`npx pod-install\` after removing the package?"
EXIT_CODE=1
fi
done <<< "$SPEC_DIRS"

# Check for uncommitted package additions/updates
while read -r POD; do
if ! grep -q "$POD" ./ios/Podfile.lock; then
error "$POD not found in Podfile.lock. Did you forget to run \`npx pod-install\`?"
EXIT_CODE=1
fi
done <<< "$FORMATTED_PODS"

if [[ "$EXIT_CODE" == 0 ]]; then
success "Podfile.lock is up to date."
fi

# Cleanup
cd "$START_DIR" || exit 1

exit $EXIT_CODE
2 changes: 1 addition & 1 deletion .github/workflows/verifyPodfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
jobs:
verify:
if: github.actor != 'OSBotify'
runs-on: ubuntu-latest
runs-on: macos-latest
steps:
# This action checks-out the repository, so the workflow can access it.
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
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 1001024700
versionName "1.2.47-0"
versionCode 1001024802
versionName "1.2.48-2"
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()

if (isNewArchitectureEnabled()) {
Expand Down
7 changes: 7 additions & 0 deletions config/webpack/webpack.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,13 @@ module.exports = (env = {}) => portfinder.getPortPromise({port: BASE_PORT})
config: [__filename],
},
},
snapshot: {
// A list of paths webpack trusts would not be modified while webpack is running
managedPaths: [
// Onyx can be modified on the fly, changes to other node_modules would not be reflected live
/([\\/]node_modules[\\/](?!react-native-onyx))/,
],
},
});

return TimeAnalyticsPlugin.wrap(config);
Expand Down
12 changes: 12 additions & 0 deletions contributingGuides/FORMS.md
Original file line number Diff line number Diff line change
Expand Up @@ -247,3 +247,15 @@ Form.js will automatically provide the following props to any input with the inp
- errorText: The translated error text that is returned by validate for that specific input.
- onBlur: An onBlur handler that calls validate.
- onInputChange: An onChange handler that saves draft values and calls validate for that input (inputA). Passing an inputID as a second param allows inputA to manipulate the input value of the provided inputID (inputB).

### Safe Area Padding

Any `Form.js` that has a button will also add safe area padding by default. If the `<Form/>` is inside a `<ScreenWrapper>` we will want to disable the default safe area padding applied there e.g.

```js
<ScreenWrapper includeSafeAreaPaddingBottom={false}>
<Form>
{...}
</Form>
</ScreenWrapper>
```
2 changes: 1 addition & 1 deletion contributingGuides/PERFORMANCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ In order to profile with Hermes follow these steps:

To capture reliable performance metrics for native app launch we must test against a release build. To make this easier for everyone to do we created an opt-in tool (using [`react-native-performance`](https://github.com/oblador/react-native-performance) that will capture metrics and display them in an alert once the app becomes interactive. To set this up just set `CAPTURE_METRICS=true` in your `.env` file then create a release build on iOS or Android. The metrics this tool shows are as follows:

- `nativeLaunch` - Total time for the native process to intialize
- `nativeLaunch` - Total time for the native process to initialize
- `runJSBundle` - Total time to parse and execute the JS bundle
- `timeToInteractive` - Rough TTI (Time to Interactive). Includes native init time + sidebar UI partially loaded

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.2.47</string>
<string>1.2.48</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
Expand All @@ -30,7 +30,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>1.2.47.0</string>
<string>1.2.48.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.2.47</string>
<string>1.2.48</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.2.47.0</string>
<string>1.2.48.2</string>
</dict>
</plist>
Binary file modified ios/chat_expensify_adhoc.mobileprovision.gpg
Binary file not shown.
17 changes: 17 additions & 0 deletions metro.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,32 @@

const {getDefaultConfig} = require('metro-config');
const _ = require('underscore');
require('dotenv').config();

/* eslint arrow-body-style: 0 */
module.exports = (() => {
const isUsingMockAPI = process.env.E2E_TESTING === 'true';
if (isUsingMockAPI) {
// eslint-disable-next-line no-console
console.warn('⚠️ Using mock API');
}

return getDefaultConfig()
.then((config) => {
return {
resolver: {
assetExts: _.filter(config.resolver.assetExts, ext => ext !== 'svg'),
sourceExts: ['jsx', 'js', 'ts', 'tsx', 'json', 'svg'],
resolveRequest: (context, moduleName, platform) => {
const resolution = context.resolveRequest(context, moduleName, platform);
if (isUsingMockAPI && moduleName.includes('/API')) {
return {
...resolution,
filePath: resolution.filePath.replace(/src\/libs\/API.js/, 'src/libs/E2E/API.mock.js'),
};
}
return resolution;
},
},
transformer: {
getTransformOptions: () => ({
Expand Down
39 changes: 29 additions & 10 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.2.47-0",
"version": "1.2.48-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 @@ -69,7 +69,6 @@
"babel-polyfill": "^6.26.0",
"dom-serializer": "^0.2.2",
"domhandler": "^4.3.0",
"dotenv": "^8.2.0",
"expensify-common": "git+https://github.com/Expensify/expensify-common.git#e67235baa887dcbe9dc4bf41ddf1925f19a1e8ad",
"fbjs": "^3.0.2",
"file-loader": "^6.0.0",
Expand Down Expand Up @@ -162,6 +161,7 @@
"copy-webpack-plugin": "^6.4.1",
"css-loader": "^5.2.4",
"diff-so-fancy": "^1.3.0",
"dotenv": "^16.0.3",
"electron": "^21.2.2",
"electron-builder": "23.5.0",
"electron-notarize": "^1.2.1",
Expand Down
1 change: 1 addition & 0 deletions src/ONYXKEYS.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ export default {
PROFILE_SETTINGS_FORM: 'profileSettingsForm',
DISPLAY_NAME_FORM: 'displayNameForm',
NEW_ROOM_FORM: 'newRoomForm',
ROOM_SETTINGS_FORM: 'roomSettingsForm',
},

// Whether we should show the compose input or not
Expand Down
27 changes: 16 additions & 11 deletions src/components/AttachmentModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import withLocalize, {withLocalizePropTypes} from './withLocalize';
import ConfirmModal from './ConfirmModal';
import TextWithEllipsis from './TextWithEllipsis';
import HeaderGap from './HeaderGap';
import SafeAreaConsumer from './SafeAreaConsumer';

/**
* Modal render prop component that exposes modal launching triggers that can be used
Expand Down Expand Up @@ -294,17 +295,21 @@ class AttachmentModal extends PureComponent {
</View>
{/* If we have an onConfirm method show a confirmation button */}
{this.props.onConfirm && (
<Animated.View style={StyleUtils.fade(this.state.confirmButtonFadeAnimation)}>
<Button
success
style={[styles.buttonConfirm, this.props.isSmallScreenWidth ? {} : styles.attachmentButtonBigScreen]}
textStyles={[styles.buttonConfirmText]}
text={this.props.translate('common.send')}
onPress={this.submitAndClose}
disabled={this.state.isConfirmButtonDisabled}
pressOnEnter
/>
</Animated.View>
<SafeAreaConsumer>
{({safeAreaPaddingBottomStyle}) => (
<Animated.View style={[StyleUtils.fade(this.state.confirmButtonFadeAnimation), safeAreaPaddingBottomStyle]}>
<Button
success
style={[styles.buttonConfirm, this.props.isSmallScreenWidth ? {} : styles.attachmentButtonBigScreen]}
textStyles={[styles.buttonConfirmText]}
text={this.props.translate('common.send')}
onPress={this.submitAndClose}
disabled={this.state.isConfirmButtonDisabled}
pressOnEnter
/>
</Animated.View>
)}
</SafeAreaConsumer>
)}
</Modal>

Expand Down
2 changes: 1 addition & 1 deletion src/components/Composer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ class Composer extends React.Component {
.then((x) => {
const extension = IMAGE_EXTENSIONS[x.type];
if (!extension) {
throw new Error(this.props.translate('composer.noExtentionFoundForMimeType'));
throw new Error(this.props.translate('composer.noExtensionFoundForMimeType'));
}

return new File([x], `pasted_image.${extension}`, {});
Expand Down
Loading

0 comments on commit 65b694a

Please sign in to comment.