Skip to content

Commit 28b7fef

Browse files
authored
Merge pull request #10 from Expensify/master
Merge
2 parents b140d36 + d3f1d28 commit 28b7fef

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+615
-231
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/bash
2+
#
3+
# Validates the Github Actions and workflows using the json schemas provided by https://www.schemastore.org/json/
4+
5+
# Track exit codes separately so we can run a full validation, report errors, and exit with the correct code
6+
declare EXIT_CODE=0
7+
8+
# Download the up-to-date json schemas for github actions and workflows
9+
cd ./.github && mkdir ./tempSchemas || exit 1
10+
curl https://json.schemastore.org/github-action.json --output ./tempSchemas/github-action.json --silent || exit 1
11+
curl https://json.schemastore.org/github-workflow.json --output ./tempSchemas/github-workflow.json --silent || exit 1
12+
13+
# Validate the actions and workflows using the JSON schemas and ajv https://github.com/ajv-validator/ajv-cli
14+
find ./actions/ -type f -name "*.yml" -print0 | xargs -0 -I file ajv -s ./tempSchemas/github-action.json -d file --strict=false || EXIT_CODE=1
15+
find ./workflows/ -type f -name "*.yml" -print0 | xargs -0 -I file ajv -s ./tempSchemas/github-workflow.json -d file --strict=false || EXIT_CODE=1
16+
17+
# Cleanup after ourselves and delete the schemas
18+
rm -rf ./tempSchemas
19+
20+
exit $EXIT_CODE

.github/workflows/verifyGithubActionBuilds.yml renamed to .github/workflows/validateGithubActions.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Verify Github Action Builds
1+
name: Validate Github Actions
22

33
on:
44
pull_request:
@@ -25,4 +25,8 @@ jobs:
2525

2626
# Rebuild all the actions on this branch and check for a diff. Fail if there is one,
2727
# because that would be a sign that the PR author did not rebuild the Github Actions
28-
- run: ./.github/scripts/verifyActions.sh
28+
- name: Verify Javascript Action Builds
29+
run: ./.github/scripts/verifyActions.sh
30+
31+
- name: Validate actions and workflows
32+
run: npm run gh-actions-validate

android/app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,8 @@ android {
148148
minSdkVersion rootProject.ext.minSdkVersion
149149
targetSdkVersion rootProject.ext.targetSdkVersion
150150
multiDexEnabled rootProject.ext.multiDexEnabled
151-
versionCode 1001001002
152-
versionName "1.0.10-2"
151+
versionCode 1001001102
152+
versionName "1.0.11-2"
153153
}
154154
splits {
155155
abi {

assets/images/upload.svg

Lines changed: 11 additions & 0 deletions
Loading

ios/ExpensifyCash/Info.plist

Lines changed: 2 additions & 2 deletions
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.0.10</string>
20+
<string>1.0.11</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.0.10.2</string>
33+
<string>1.0.11.2</string>
3434
<key>ITSAppUsesNonExemptEncryption</key>
3535
<false/>
3636
<key>LSApplicationQueriesSchemes</key>

ios/ExpensifyCashTests/Info.plist

Lines changed: 2 additions & 2 deletions
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.0.10</string>
18+
<string>1.0.11</string>
1919
<key>CFBundleSignature</key>
2020
<string>????</string>
2121
<key>CFBundleVersion</key>
22-
<string>1.0.10.2</string>
22+
<string>1.0.11.2</string>
2323
</dict>
2424
</plist>

package-lock.json

Lines changed: 93 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "expensify.cash",
3-
"version": "1.0.10-2",
3+
"version": "1.0.11-2",
44
"author": "Expensify, Inc.",
55
"homepage": "https://expensify.cash",
66
"description": "Expensify.cash is the next generation of Expensify: a reimagination of payments based atop a foundation of chat.",
@@ -25,13 +25,15 @@
2525
"detox-build": "detox build --configuration ios.sim.debug",
2626
"detox-test": "detox test --configuration ios.sim.debug",
2727
"gh-actions-build": "./.github/scripts/buildActions.sh",
28+
"gh-actions-validate": "./.github/scripts/validateActionsAndWorkflows.sh",
2829
"analyze-packages": "ANALYZE_BUNDLE=true webpack --config config/webpack/webpack.prod.js"
2930
},
3031
"dependencies": {
3132
"@babel/plugin-proposal-class-properties": "^7.12.1",
3233
"@babel/preset-flow": "^7.12.13",
3334
"@react-native-community/async-storage": "^1.11.0",
3435
"@react-native-community/cli": "4.13.1",
36+
"@react-native-community/clipboard": "^1.5.1",
3537
"@react-native-community/masked-view": "^0.1.10",
3638
"@react-native-community/netinfo": "^5.9.10",
3739
"@react-native-community/progress-bar-android": "^1.0.4",
@@ -99,6 +101,7 @@
99101
"@testing-library/jest-native": "^3.4.2",
100102
"@testing-library/react-native": "^7.0.2",
101103
"@vercel/ncc": "^0.27.0",
104+
"ajv-cli": "^5.0.0",
102105
"babel-eslint": "^10.1.0",
103106
"babel-jest": "^26.2.2",
104107
"babel-loader": "^8.1.0",

src/CONST.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ const CONST = {
99
DEFAULT: 'default',
1010
HOVERED: 'hovered',
1111
PRESSED: 'pressed',
12+
COMPLETE: 'complete',
1213
},
1314
CLOUDFRONT_URL,
1415
NEW_ZOOM_MEETING_URL: 'https://zoom.us/start/videomeeting',
@@ -71,13 +72,6 @@ const CONST = {
7172
ERROR: {
7273
API_OFFLINE: 'API is offline',
7374
},
74-
MENU_ITEM_KEYS: {
75-
NEW_CHAT: 'NewChat',
76-
NEW_GROUP: 'NewGroup',
77-
REQUEST_MONEY: 'RequestMoney',
78-
SPLIT_BILL: 'SplitBill',
79-
ATTACHMENT_PICKER: 'AttachmentPicker',
80-
},
8175
NVP: {
8276
PAYPAL_ME_ADDRESS: 'expensify_payPalMeAddress',
8377
PRIORITY_MODE: 'priorityMode',

src/components/CreateMenu.js

Lines changed: 16 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,7 @@ import {View} from 'react-native';
33
import PropTypes from 'prop-types';
44
import Popover from './Popover';
55
import styles from '../styles/styles';
6-
import {
7-
ChatBubble, Users, Receipt, MoneyCircle, Paperclip,
8-
} from './Icon/Expensicons';
9-
import ROUTES from '../ROUTES';
106
import withWindowDimensions, {windowDimensionsPropTypes} from './withWindowDimensions';
11-
import CONST from '../CONST';
12-
import Navigation from '../libs/Navigation/Navigation';
137
import MenuItem from './MenuItem';
148

159
const propTypes = {
@@ -23,63 +17,22 @@ const propTypes = {
2317
onItemSelected: PropTypes.func.isRequired,
2418

2519
// Menu items to be rendered on the list
26-
menuOptions: PropTypes.arrayOf(
27-
PropTypes.oneOf(Object.values(CONST.MENU_ITEM_KEYS)),
20+
menuItems: PropTypes.arrayOf(
21+
PropTypes.shape({
22+
icon: PropTypes.func.isRequired,
23+
text: PropTypes.string.isRequired,
24+
onSelected: PropTypes.func.isRequired,
25+
}),
2826
).isRequired,
2927

30-
// Callback to fire when a AttachmentPicker item is selected
31-
onAttachmentPickerSelected: PropTypes.func,
32-
3328
...windowDimensionsPropTypes,
3429
};
35-
36-
const defaultProps = {
37-
onAttachmentPickerSelected: () => {},
38-
};
39-
4030
class CreateMenu extends PureComponent {
4131
constructor(props) {
4232
super(props);
43-
33+
this.onModalHide = () => {};
4434
this.setOnModalHide = this.setOnModalHide.bind(this);
4535
this.resetOnModalHide = this.resetOnModalHide.bind(this);
46-
this.onModalHide = () => {};
47-
48-
const MENU_ITEMS = {
49-
[CONST.MENU_ITEM_KEYS.NEW_CHAT]: {
50-
icon: ChatBubble,
51-
text: 'New Chat',
52-
onSelected: () => Navigation.navigate(ROUTES.NEW_CHAT),
53-
},
54-
[CONST.MENU_ITEM_KEYS.NEW_GROUP]: {
55-
icon: Users,
56-
text: 'New Group',
57-
onSelected: () => Navigation.navigate(ROUTES.NEW_GROUP),
58-
},
59-
[CONST.MENU_ITEM_KEYS.REQUEST_MONEY]: {
60-
icon: MoneyCircle,
61-
text: 'Request Money',
62-
onSelected: () => Navigation.navigate(ROUTES.NEW_CHAT),
63-
},
64-
[CONST.MENU_ITEM_KEYS.SPLIT_BILL]: {
65-
icon: Receipt,
66-
text: 'Split Bill',
67-
onSelected: () => Navigation.navigate(ROUTES.NEW_CHAT),
68-
},
69-
[CONST.MENU_ITEM_KEYS.ATTACHMENT_PICKER]: {
70-
icon: Paperclip,
71-
text: 'Add Attachment',
72-
onSelected: () => this.props.onAttachmentPickerSelected(),
73-
},
74-
};
75-
76-
this.menuItemData = props.menuOptions.map(key => ({
77-
...MENU_ITEMS[key],
78-
onPress: () => {
79-
props.onItemSelected();
80-
this.setOnModalHide(() => MENU_ITEMS[key].onSelected());
81-
},
82-
}));
8336
}
8437

8538
/**
@@ -109,12 +62,19 @@ class CreateMenu extends PureComponent {
10962
anchorPosition={styles.createMenuPosition}
11063
>
11164
<View style={this.props.isSmallScreenWidth ? {} : styles.createMenuContainer}>
112-
{this.menuItemData.map(({icon, text, onPress}) => (
65+
{this.props.menuItems.map(({
66+
icon,
67+
text,
68+
onSelected = () => {},
69+
}) => (
11370
<MenuItem
11471
key={text}
11572
icon={icon}
11673
title={text}
117-
onPress={onPress}
74+
onPress={() => {
75+
this.props.onItemSelected();
76+
this.setOnModalHide(onSelected);
77+
}}
11878
/>
11979
))}
12080
</View>
@@ -124,6 +84,5 @@ class CreateMenu extends PureComponent {
12484
}
12585

12686
CreateMenu.propTypes = propTypes;
127-
CreateMenu.defaultProps = defaultProps;
12887
CreateMenu.displayName = 'CreateMenu';
12988
export default withWindowDimensions(CreateMenu);

0 commit comments

Comments
 (0)