Skip to content

Commit

Permalink
Merge pull request #9585 from Expensify/update-staging-from-main
Browse files Browse the repository at this point in the history
Update version to 1.1.79-0 on staging
  • Loading branch information
OSBotify authored Jun 28, 2022
2 parents 157ec5a + af3e709 commit 0654401
Show file tree
Hide file tree
Showing 39 changed files with 908 additions and 540 deletions.
2 changes: 1 addition & 1 deletion .github/scripts/validateActionsAndWorkflows.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ if [[ -z "${CI}" && -z "$(command -v shellcheck)" ]]; then
brew install shellcheck
fi

bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash)
curl -s curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash | bash -s -- 1.6.13
./actionlint -color || EXIT_CODE=1

# Cleanup after ourselves and delete actionlint
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Please follow these steps to propose a job:
2. If your bug or enhancement matches an existing issue, please feel free to comment on that GitHub issue with your findings if you think it will help solve the issue.
4. If there is no existing GitHub issue or Upwork job, check if the issue is happening on prod (as opposed to only happening on dev)
5. If the issue is just in dev then it means it's a new issue and has not been deployed to production. In this case, you should try to find the offending PR and comment in the issue tied to the PR and ask the assigned users to add the `DeployBlockerCash` label. If you can't find it, follow the reporting instructions in the next item, but note that the issue is a regression only found in dev and not in prod.
6. If the issue happens in production then report the issue(s) in the [#expensify-open-source](https://github.com/Expensify/App/blob/main/CONTRIBUTING.md#asking-questions) Slack channel, prefixed with `BUG:` or `Feature Request:`. Please use the templates for bugs and feature requests that are bookmarked in #expensify-open-source. View [this guide](https://github.com/Expensify/App/blob/main/HOW_TO_CREATE_A_PLAN.md) for help creating a plan when proposing a feature request.
6. If the issue happens in main, staging or production then report the issue(s) in the [#expensify-open-source](https://github.com/Expensify/App/blob/main/CONTRIBUTING.md#asking-questions) Slack channel, prefixed with `BUG:` or `Feature Request:`. Please use the templates for bugs and feature requests that are bookmarked in #expensify-open-source. View [this guide](https://github.com/Expensify/App/blob/main/HOW_TO_CREATE_A_PLAN.md) for help creating a plan when proposing a feature request.
7. After review in #expensify-open-source, if you've provided a quality proposal that we choose to implement, a GitHub issue will be created and your Slack handle will be included in the original post after `Issue reported by:`
8. If an external contributor other than yourself is hired to work on the issue, you will also be hired for the same job in Upwork. No additional work is needed. If the issue is fixed internally, a dedicated job will be created to hire and pay you after the issue is fixed.
9. Payment will be made 7 days after code is deployed to production if there are no regressions. If a regression is discovered, payment will be issued 7 days after all regressions are fixed.
Expand Down
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@ android {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
multiDexEnabled rootProject.ext.multiDexEnabled
versionCode 1001017808
versionName "1.1.78-8"
versionCode 1001017900
versionName "1.1.79-0"
}
splits {
abi {
Expand Down
18 changes: 18 additions & 0 deletions docs/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ These are best practices related to the current API used for App. This does not
- There should be no client-side handling that is unique to any API call.
- Data is pushed to the client and put straight into Onyx by low-level libraries.
- Clients should be kept up-to-date with many small incremental changes to data.
- Creating data needs to be optimistic on every connection (offline, slow 3G, etc), eg. `RequestMoney` or `SplitBill` should work without waiting for a server response.
- For new objects created from the client (reports, reportActions, policies) we're going to generate a random string ID immediately on the client, rather than needing to wait for the server to give us an ID for the created object.
- This client-generated ID will become the primary key for that record in the database. This will provide more offline functionality than was previously possible.

## Response Handling
When the web server responds to an API call the response is sent to the server in one of two ways.
1. **HTTPS Response** - Data that is returned with the HTTPS response is only sent to the client that initiated the request.
Expand Down Expand Up @@ -50,4 +54,18 @@ For example: Accessing the data for a chat report will return the data if the re
- Verbs should be unique and indicate the user's action (as perceived by the user). eg. `Request`, `Open`, `Accept`, `Pay`
- If a unique verb cannot be used, then use only the standard verbs: `Update`, `Add`, `Delete`
- Names must NOT include names of parameters eg. Bad: `SignInWithPasswordOr2FA` Good: `SignIn`
- Names must NOT include the word Page or View, eg. Bad: `OpenReportPage` Good: `OpenReport`
- Names must NOT reveal backend implementation details that the user does not know about eg. `AddVBBA` (users don't know what a VBBA is - verified business bank account) Good: `AddBankAccount`
- For deep links like `StartAppWhileSignedInAndOpenWorkspace`, create separate commands for each specific scenario like `StartAppWhileSignedIn` and `OpenWorkspace`, where both requests will be triggered in parallel.

## FAQ

### How should error messages be persisted to Onyx?

- The API layer Pusher onyxData should set specific error messages.
- In cases where the API does not set an error, a generic error message can be set in the API.write parameter `onyxData.failureData`.
- Previous errors should be cleared in the `onyxData.optimisticData` when a new request is made.

### How should we remove local data from the store if the data no longer exist in the server? eg. local policy data for policies the user is no longer a member of.

Use `Onyx.set(key, null)` for each data (eg. policy) not found in the server.
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.1.78</string>
<string>1.1.79</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
Expand All @@ -30,7 +30,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>1.1.78.8</string>
<string>1.1.79.0</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.1.78</string>
<string>1.1.79</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.1.78.8</string>
<string>1.1.79.0</string>
</dict>
</plist>
6 changes: 3 additions & 3 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.1.78-8",
"version": "1.1.79-0",
"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 @@ -61,7 +61,7 @@
"dom-serializer": "^0.2.2",
"domhandler": "^4.3.0",
"dotenv": "^8.2.0",
"expensify-common": "git+https://github.com/Expensify/expensify-common.git#3d87e9b87c6e5ce5fa4bac05bceb3cdf3ad6ca56",
"expensify-common": "git+https://github.com/Expensify/expensify-common.git#dfc17a33907dd487610cf1eeb6212f4d89b96b6f",
"fbjs": "^3.0.2",
"file-loader": "^6.0.0",
"html-entities": "^1.3.1",
Expand Down
15 changes: 15 additions & 0 deletions src/CONST.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,11 +168,26 @@ const CONST = {
shortcutKey: 'Enter',
modifiers: [],
},
CTRL_ENTER: {
descriptionKey: null,
shortcutKey: 'Enter',
modifiers: ['CTRL'],
},
COPY: {
descriptionKey: 'copy',
shortcutKey: 'C',
modifiers: ['CTRL'],
},
ARROW_UP: {
descriptionKey: null,
shortcutKey: 'ArrowUp',
modifiers: [],
},
ARROW_DOWN: {
descriptionKey: null,
shortcutKey: 'ArrowDown',
modifiers: [],
},
},
KEYBOARD_SHORTCUT_KEY_DISPLAY_NAME: {
CONTROL: 'CTRL',
Expand Down
76 changes: 76 additions & 0 deletions src/components/ArrowKeyFocusManager.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
import {Component} from 'react';
import PropTypes from 'prop-types';
import CONST from '../CONST';
import KeyboardShortcut from '../libs/KeyboardShortcut';

const propTypes = {
/** Children to render. */
children: PropTypes.oneOfType([
PropTypes.func,
PropTypes.node,
]).isRequired,

/** The current focused index. */
focusedIndex: PropTypes.number.isRequired,

/** The maximum index – provided so that the focus can be sent back to the beginning of the list when the end is reached. */
maxIndex: PropTypes.number.isRequired,

/** A callback executed when the focused input changes. */
onFocusedIndexChanged: PropTypes.func.isRequired,
};

class ArrowKeyFocusManager extends Component {
componentDidMount() {
const arrowUpConfig = CONST.KEYBOARD_SHORTCUTS.ARROW_UP;
const arrowDownConfig = CONST.KEYBOARD_SHORTCUTS.ARROW_DOWN;

this.unsubscribeArrowUpKey = KeyboardShortcut.subscribe(arrowUpConfig.shortcutKey, () => {
if (this.props.maxIndex <= 1) {
return;
}

let newFocusedIndex = this.props.focusedIndex - 1;

// Wrap around to the bottom of the list
if (newFocusedIndex < 0) {
newFocusedIndex = this.props.maxIndex;
}

this.props.onFocusedIndexChanged(newFocusedIndex);
}, arrowUpConfig.descriptionKey, arrowUpConfig.modifiers, true);

this.unsubscribeArrowDownKey = KeyboardShortcut.subscribe(arrowDownConfig.shortcutKey, () => {
if (this.props.maxIndex <= 1) {
return;
}

let newFocusedIndex = this.props.focusedIndex + 1;

// Wrap around to the top of the list
if (newFocusedIndex > this.props.maxIndex) {
newFocusedIndex = 0;
}

this.props.onFocusedIndexChanged(newFocusedIndex);
}, arrowDownConfig.descriptionKey, arrowDownConfig.modifiers, true);
}

componentWillUnmount() {
if (this.unsubscribeArrowUpKey) {
this.unsubscribeArrowUpKey();
}

if (this.unsubscribeArrowDownKey) {
this.unsubscribeArrowDownKey();
}
}

render() {
return this.props.children;
}
}

ArrowKeyFocusManager.propTypes = propTypes;

export default ArrowKeyFocusManager;
5 changes: 4 additions & 1 deletion src/components/EmojiPicker/EmojiPickerMenu/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ class EmojiPickerMenu extends Component {
start: 0,
end: 0,
},
isFocused: false,
};
}

Expand Down Expand Up @@ -441,12 +442,14 @@ class EmojiPickerMenu extends Component {
placeholder={this.props.translate('common.search')}
placeholderTextColor={themeColors.textSupporting}
onChangeText={this.filterEmojis}
style={styles.textInput}
style={[styles.textInput, this.state.isFocused && styles.borderColorFocus]}
defaultValue=""
ref={el => this.searchInput = el}
autoFocus
selectTextOnFocus={this.state.selectTextOnFocus}
onSelectionChange={this.onSelectionChange}
onFocus={() => this.setState({isFocused: true})}
onBlur={() => this.setState({isFocused: false})}
/>
</View>
)}
Expand Down
Loading

0 comments on commit 0654401

Please sign in to comment.