Skip to content

Commit

Permalink
Merge pull request #10 from Expensify/master
Browse files Browse the repository at this point in the history
Merge
  • Loading branch information
tugbadogan authored Apr 3, 2021
2 parents b140d36 + d3f1d28 commit 28b7fef
Show file tree
Hide file tree
Showing 42 changed files with 615 additions and 231 deletions.
20 changes: 20 additions & 0 deletions .github/scripts/validateActionsAndWorkflows.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash
#
# Validates the Github Actions and workflows using the json schemas provided by https://www.schemastore.org/json/

# Track exit codes separately so we can run a full validation, report errors, and exit with the correct code
declare EXIT_CODE=0

# Download the up-to-date json schemas for github actions and workflows
cd ./.github && mkdir ./tempSchemas || exit 1
curl https://json.schemastore.org/github-action.json --output ./tempSchemas/github-action.json --silent || exit 1
curl https://json.schemastore.org/github-workflow.json --output ./tempSchemas/github-workflow.json --silent || exit 1

# Validate the actions and workflows using the JSON schemas and ajv https://github.com/ajv-validator/ajv-cli
find ./actions/ -type f -name "*.yml" -print0 | xargs -0 -I file ajv -s ./tempSchemas/github-action.json -d file --strict=false || EXIT_CODE=1
find ./workflows/ -type f -name "*.yml" -print0 | xargs -0 -I file ajv -s ./tempSchemas/github-workflow.json -d file --strict=false || EXIT_CODE=1

# Cleanup after ourselves and delete the schemas
rm -rf ./tempSchemas

exit $EXIT_CODE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Verify Github Action Builds
name: Validate Github Actions

on:
pull_request:
Expand All @@ -25,4 +25,8 @@ jobs:

# Rebuild all the actions on this branch and check for a diff. Fail if there is one,
# because that would be a sign that the PR author did not rebuild the Github Actions
- run: ./.github/scripts/verifyActions.sh
- name: Verify Javascript Action Builds
run: ./.github/scripts/verifyActions.sh

- name: Validate actions and workflows
run: npm run gh-actions-validate
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@ android {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
multiDexEnabled rootProject.ext.multiDexEnabled
versionCode 1001001002
versionName "1.0.10-2"
versionCode 1001001102
versionName "1.0.11-2"
}
splits {
abi {
Expand Down
11 changes: 11 additions & 0 deletions assets/images/upload.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/ExpensifyCash/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.0.10</string>
<string>1.0.11</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
Expand All @@ -30,7 +30,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>1.0.10.2</string>
<string>1.0.11.2</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>LSApplicationQueriesSchemes</key>
Expand Down
4 changes: 2 additions & 2 deletions ios/ExpensifyCashTests/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.0.10</string>
<string>1.0.11</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0.10.2</string>
<string>1.0.11.2</string>
</dict>
</plist>
94 changes: 93 additions & 1 deletion package-lock.json

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

5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "expensify.cash",
"version": "1.0.10-2",
"version": "1.0.11-2",
"author": "Expensify, Inc.",
"homepage": "https://expensify.cash",
"description": "Expensify.cash is the next generation of Expensify: a reimagination of payments based atop a foundation of chat.",
Expand All @@ -25,13 +25,15 @@
"detox-build": "detox build --configuration ios.sim.debug",
"detox-test": "detox test --configuration ios.sim.debug",
"gh-actions-build": "./.github/scripts/buildActions.sh",
"gh-actions-validate": "./.github/scripts/validateActionsAndWorkflows.sh",
"analyze-packages": "ANALYZE_BUNDLE=true webpack --config config/webpack/webpack.prod.js"
},
"dependencies": {
"@babel/plugin-proposal-class-properties": "^7.12.1",
"@babel/preset-flow": "^7.12.13",
"@react-native-community/async-storage": "^1.11.0",
"@react-native-community/cli": "4.13.1",
"@react-native-community/clipboard": "^1.5.1",
"@react-native-community/masked-view": "^0.1.10",
"@react-native-community/netinfo": "^5.9.10",
"@react-native-community/progress-bar-android": "^1.0.4",
Expand Down Expand Up @@ -99,6 +101,7 @@
"@testing-library/jest-native": "^3.4.2",
"@testing-library/react-native": "^7.0.2",
"@vercel/ncc": "^0.27.0",
"ajv-cli": "^5.0.0",
"babel-eslint": "^10.1.0",
"babel-jest": "^26.2.2",
"babel-loader": "^8.1.0",
Expand Down
8 changes: 1 addition & 7 deletions src/CONST.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const CONST = {
DEFAULT: 'default',
HOVERED: 'hovered',
PRESSED: 'pressed',
COMPLETE: 'complete',
},
CLOUDFRONT_URL,
NEW_ZOOM_MEETING_URL: 'https://zoom.us/start/videomeeting',
Expand Down Expand Up @@ -71,13 +72,6 @@ const CONST = {
ERROR: {
API_OFFLINE: 'API is offline',
},
MENU_ITEM_KEYS: {
NEW_CHAT: 'NewChat',
NEW_GROUP: 'NewGroup',
REQUEST_MONEY: 'RequestMoney',
SPLIT_BILL: 'SplitBill',
ATTACHMENT_PICKER: 'AttachmentPicker',
},
NVP: {
PAYPAL_ME_ADDRESS: 'expensify_payPalMeAddress',
PRIORITY_MODE: 'priorityMode',
Expand Down
73 changes: 16 additions & 57 deletions src/components/CreateMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,7 @@ import {View} from 'react-native';
import PropTypes from 'prop-types';
import Popover from './Popover';
import styles from '../styles/styles';
import {
ChatBubble, Users, Receipt, MoneyCircle, Paperclip,
} from './Icon/Expensicons';
import ROUTES from '../ROUTES';
import withWindowDimensions, {windowDimensionsPropTypes} from './withWindowDimensions';
import CONST from '../CONST';
import Navigation from '../libs/Navigation/Navigation';
import MenuItem from './MenuItem';

const propTypes = {
Expand All @@ -23,63 +17,22 @@ const propTypes = {
onItemSelected: PropTypes.func.isRequired,

// Menu items to be rendered on the list
menuOptions: PropTypes.arrayOf(
PropTypes.oneOf(Object.values(CONST.MENU_ITEM_KEYS)),
menuItems: PropTypes.arrayOf(
PropTypes.shape({
icon: PropTypes.func.isRequired,
text: PropTypes.string.isRequired,
onSelected: PropTypes.func.isRequired,
}),
).isRequired,

// Callback to fire when a AttachmentPicker item is selected
onAttachmentPickerSelected: PropTypes.func,

...windowDimensionsPropTypes,
};

const defaultProps = {
onAttachmentPickerSelected: () => {},
};

class CreateMenu extends PureComponent {
constructor(props) {
super(props);

this.onModalHide = () => {};
this.setOnModalHide = this.setOnModalHide.bind(this);
this.resetOnModalHide = this.resetOnModalHide.bind(this);
this.onModalHide = () => {};

const MENU_ITEMS = {
[CONST.MENU_ITEM_KEYS.NEW_CHAT]: {
icon: ChatBubble,
text: 'New Chat',
onSelected: () => Navigation.navigate(ROUTES.NEW_CHAT),
},
[CONST.MENU_ITEM_KEYS.NEW_GROUP]: {
icon: Users,
text: 'New Group',
onSelected: () => Navigation.navigate(ROUTES.NEW_GROUP),
},
[CONST.MENU_ITEM_KEYS.REQUEST_MONEY]: {
icon: MoneyCircle,
text: 'Request Money',
onSelected: () => Navigation.navigate(ROUTES.NEW_CHAT),
},
[CONST.MENU_ITEM_KEYS.SPLIT_BILL]: {
icon: Receipt,
text: 'Split Bill',
onSelected: () => Navigation.navigate(ROUTES.NEW_CHAT),
},
[CONST.MENU_ITEM_KEYS.ATTACHMENT_PICKER]: {
icon: Paperclip,
text: 'Add Attachment',
onSelected: () => this.props.onAttachmentPickerSelected(),
},
};

this.menuItemData = props.menuOptions.map(key => ({
...MENU_ITEMS[key],
onPress: () => {
props.onItemSelected();
this.setOnModalHide(() => MENU_ITEMS[key].onSelected());
},
}));
}

/**
Expand Down Expand Up @@ -109,12 +62,19 @@ class CreateMenu extends PureComponent {
anchorPosition={styles.createMenuPosition}
>
<View style={this.props.isSmallScreenWidth ? {} : styles.createMenuContainer}>
{this.menuItemData.map(({icon, text, onPress}) => (
{this.props.menuItems.map(({
icon,
text,
onSelected = () => {},
}) => (
<MenuItem
key={text}
icon={icon}
title={text}
onPress={onPress}
onPress={() => {
this.props.onItemSelected();
this.setOnModalHide(onSelected);
}}
/>
))}
</View>
Expand All @@ -124,6 +84,5 @@ class CreateMenu extends PureComponent {
}

CreateMenu.propTypes = propTypes;
CreateMenu.defaultProps = defaultProps;
CreateMenu.displayName = 'CreateMenu';
export default withWindowDimensions(CreateMenu);
Loading

0 comments on commit 28b7fef

Please sign in to comment.