Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into fix/massive-lag-on-…
Browse files Browse the repository at this point in the history
…task-assignee-selection
  • Loading branch information
Thanos30 committed Jul 6, 2023
2 parents e01a4b2 + 40c494f commit 158bdd9
Show file tree
Hide file tree
Showing 152 changed files with 2,528 additions and 2,096 deletions.
1 change: 1 addition & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ This is a checklist for PR authors. Please make sure to complete all tasks and c
- [ ] The file is named correctly
- [ ] The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
- [ ] The only data being stored in the state is data necessary for rendering and nothing else
- [ ] If we are not using the full Onyx data that we loaded, I've added the proper selector in order to ensure the component only re-renders when the data it is using changes
- [ ] For Class Components, any internal methods passed to components event handlers are bound to `this` properly so there are no scoping issues (i.e. for `onClick={this.submit}` the method `this.submit` should be bound to `this` in the constructor)
- [ ] Any internal methods bound to `this` are necessary to be bound (i.e. avoid `this.submit = this.submit.bind(this);` if `this.submit` is never passed to a component event handler like `onClick`)
- [ ] All JSX used for rendering exists in the render method
Expand Down
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ android {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
multiDexEnabled rootProject.ext.multiDexEnabled
versionCode 1001033505
versionName "1.3.35-5"
versionCode 1001033702
versionName "1.3.37-2"
}

splits {
Expand Down
114 changes: 114 additions & 0 deletions contributingGuides/NAVIGATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,117 @@ Using [react-freeze](https://github.com/software-mansion/react-freeze) allows us

- To keep the navigation state that was present before changing the layout, we save the state on every change and use it for the `initialState` prop.
Changing the layout means that every component inside `NavigationContainer` is mounted anew.

## Why we need to use minimal action in the `linkTo` function

### The problem
Let's assume that the user wants to navigate like this:

```
1. Settings_root - navigate > Profile
2. Profile - UP > Settings_root
3. Settings_root - navigate > About
4. About - browser back button > Settings_root
```

Without minimal action, expected behavior won't be achieved and the final screen will be `Profile`.

Broken behavior is the outcome of two things:
1. Back button in the browser resets the navigation state with the state saved in step two.

2. `Navigation.navigate` creates action with `getActionFromState` dispatched at the top level of the navigation hierarchy.

The reason why `getActionFromState` provided by `react-navigation` is dispatched at the top level of the navigation hierarchy is that it doesn't know about current navigation state, only about desired one.

In this example it doesn't know if the `RightModalNavigator` and `Settings` are already mounted.


The action for the first step looks like that:
```json
{
"type": "NAVIGATE",
"payload": {
"name": "RightModalNavigator",
"params": {
"initial": true,
"screen": "Settings",
"params": {
"initial": true,
"screen": "Profile",
}
}
}
}
```


That means, the params for the `RightModalNavigator` and `Settings` (also a navigator) will be filled with the information that we want to have the `Profile` screen in the state.

```json
{
"index": 2,
"routes": [
{ "name": "Home", },
{
"name": "RightModalNavigator",
// here you can see that the params are filled with the information about structure that should be in the state.
"params": {
"initial": true,
"screen": "Settings",
"params": {
"initial": true,
"screen": "Settings_Profile",
"path": "/settings/profile"
}
},
"state": {
"index": 0,
"routes": [
{
"name": "Settings",
// Same here
"params": {
"initial": true,
"screen": "Settings_Profile",
"path": "/settings/profile"
},
"state": {
"index": 0,
"routes": [
{
"name": "Settings_Profile"
}
]
}
}
]
}
}
]
}
```

This information will stay here even if we pop the `Profile` screen and navigate to `About` screen.

Later on, when the user presses the browser back button expecting that the `Settings_root` screen will appear, the navigation state will be reset with information about the `Profile` screen in the params and this will be used as a source of truth for the navigation.

### The solution

If we can create simple action that will only push one screen to the existing navigator, we won't fill any params of the navigators.

The `getMinimalAction` compares action generated by the `getActionFromState` with the current navigation state and tries to find the smallest action possible.

The action for the first step created with `getMinimalAction` looks like this:

```json
{
"type": "NAVIGATE",
"payload": {
"name": "Settings_Profile"
},
"target": "Settings-stack-key-xyz"
}
```

### Deeplinking
There is no minimal action for deeplinking directly to the `Profile` screen. But because the `Settings_root` is not on the stack, pressing UP will reset the params for navigators to the correct ones.
6 changes: 3 additions & 3 deletions docs/_data/_routes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ home:

# Hubs are comprised of sections and articles. Sections contain multiple related articles, but there can be standalone articles as well
hubs:
- href: send-money
title: Send money
description: With only a couple of clicks, send money to your friends or coworkers.
- href: split-bills
title: Split bills
description: With only a couple of clicks, split bills with your friends or coworkers.
icon: /assets/images/paper-airplane.svg

- href: request-money
Expand Down
53 changes: 0 additions & 53 deletions docs/articles/request-money/Request-and-Send-Money.md

This file was deleted.

35 changes: 35 additions & 0 deletions docs/articles/request-money/Request-and-Split-Bills.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
title: Request Money and Split Bills with Friends
description: Everything you need to know about Requesting Money and Splitting Bills with Friends!
---

<!-- The lines above are required by Jekyll to process the .md file -->

# How do these Payment Features work?
Our suite of money movement features enables you to request money owed by an individual or split a bill with a group.

**Request Money** lets your friends pay you back directly in Expensify. When you send a payment request to a friend, Expensify will display the amount owed and the option to pay the corresponding request in a chat between you.

**Split Bill** allows you to split payments between friends and ensures the person who settled the tab gets paid back.

These two features ensure you can live in the moment and settle up afterward.

# How to Request Money
- Select the Green **+** button and choose **Request Money**
- Enter the amount **$** they owe and click **Next**
- Search for the user or enter their email!
- Enter a reason for the request (optional)
- Click **Request!**
- If you change your mind, all you have to do is click **Cancel**
- The user will be able to **Settle up outside of Expensify** or pay you via **Venmo** or **PayPal.me**

# How to Split a Bill
- Select the Green **+** button and choose **Split Bill**
- Enter the total amount for the bill and click **Next**
- Search for users or enter their emails and **Select**
- Enter a reason for the split
- The split is then shared equally between the attendees

# FAQs
## Can I request money from more than one person at a time?
If you need to request money for more than one person at a time, you’ll want to use the Split Bill feature. The Request Money option is for one-to-one payments between two people.
53 changes: 0 additions & 53 deletions docs/articles/send-money/paying-friends/Request-and-Send-Money.md

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
title: Request Money and Split Bills with Friends
description: Everything you need to know about Requesting Money and Splitting Bills with Friends!
---

<!-- The lines above are required by Jekyll to process the .md file -->

# How do these Payment Features work?
Our suite of money movement features enables you to request money owed by an individual or split a bill with a group.

**Request Money** lets your friends pay you back directly in Expensify. When you send a payment request to a friend, Expensify will display the amount owed and the option to pay the corresponding request in a chat between you.

**Split Bill** allows you to split payments between friends and ensures the person who settled the tab gets paid back.

These two features ensure you can live in the moment and settle up afterward.

# How to Request Money
- Select the Green **+** button and choose **Request Money**
- Enter the amount **$** they owe and click **Next**
- Search for the user or enter their email!
- Enter a reason for the request (optional)
- Click **Request!**
- If you change your mind, all you have to do is click **Cancel**
- The user will be able to **Settle up outside of Expensify** or pay you via **Venmo** or **PayPal.me**

# How to Split a Bill
- Select the Green **+** button and choose **Split Bill**
- Enter the total amount for the bill and click **Next**
- Search for users or enter their emails and **Select**
- Enter a reason for the split
- The split is then shared equally between the attendees

# FAQs
## Can I request money from more than one person at a time?
If you need to request money for more than one person at a time, you’ll want to use the Split Bill feature. The Request Money option is for one-to-one payments between two people.
2 changes: 1 addition & 1 deletion docs/hubs/send-money.html → docs/hubs/split-bills.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
layout: default
title: Send money
title: Split bills
---

{% include hub.html %}
2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ <h2>
</h2>

<div class="cards-group">
{% include hub-card.html href="send-money" %}
{% include hub-card.html href="split-bills" %}
{% include hub-card.html href="request-money" %}
{% include hub-card.html href="playbooks" %}
{% include hub-card.html href="other" %}
Expand Down
2 changes: 0 additions & 2 deletions ios/NewExpensify.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,6 @@
CURRENT_PROJECT_VERSION = 3;
DEVELOPMENT_TEAM = 368M544MTT;
ENABLE_BITCODE = NO;
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;
INFOPLIST_FILE = "$(SRCROOT)/NewExpensify/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
Expand Down Expand Up @@ -683,7 +682,6 @@
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 3;
DEVELOPMENT_TEAM = 368M544MTT;
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;
INFOPLIST_FILE = NewExpensify/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
Expand Down
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.35</string>
<string>1.3.37</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
Expand All @@ -32,7 +32,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>1.3.35.5</string>
<string>1.3.37.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.35</string>
<string>1.3.37</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.3.35.5</string>
<string>1.3.37.2</string>
</dict>
</plist>
Loading

0 comments on commit 158bdd9

Please sign in to comment.