Skip to content

Commit

Permalink
Merge branch 'Expensify:main' into fix-double-back
Browse files Browse the repository at this point in the history
  • Loading branch information
shubham1206agra authored Jan 15, 2025
2 parents 36dcf88 + 1d6d64f commit ebf5a13
Show file tree
Hide file tree
Showing 100 changed files with 4,155 additions and 1,438 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.changed.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ module.exports = {
files: [
'src/libs/actions/IOU.ts',
'src/libs/actions/Report.ts',
'src/libs/OptionsListUtils.ts',
'src/pages/home/ReportScreen.tsx',
'src/pages/workspace/WorkspaceInitialPage.tsx',
'src/pages/home/report/PureReportActionItem.tsx',
'src/libs/SidebarUtils.ts',
],
rules: {
'rulesdir/no-default-id-values': 'off',
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deployNewHelp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20.18.0'
node-version: '20.18.1'

# Wil install the _help/package.js
- name: Install Node.js Dependencies
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20.18.0
20.18.1
2 changes: 1 addition & 1 deletion Mobile-Expensify
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ android {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
multiDexEnabled rootProject.ext.multiDexEnabled
versionCode 1009008500
versionName "9.0.85-0"
versionCode 1009008600
versionName "9.0.86-0"
// Supported language variants must be declared here to avoid from being removed during the compilation.
// This also helps us to not include unnecessary language variants in the APK.
resConfigs "en", "es"
Expand Down
1,207 changes: 1,207 additions & 0 deletions assets/images/product-illustrations/emptystate__holdexpense.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
46 changes: 46 additions & 0 deletions contributingGuides/STYLE.md
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,8 @@ Here are some common cases you may face when fixing your code to remove the old/
#### **Case 1**: Argument of type 'string | undefined' is not assignable to parameter of type 'string'.
##### 1. Utility function
```diff
-Report.getNewerActions(newestActionCurrentReport?.reportID ?? '-1', newestActionCurrentReport?.reportActionID ?? '-1');
+Report.getNewerActions(newestActionCurrentReport?.reportID, newestActionCurrentReport?.reportActionID);
Expand All @@ -520,6 +522,50 @@ We need to change `Report.getNewerActions()` arguments to allow `undefined`. By
+ }
```
##### 2. `ROUTES.ts`'s `getRoute()` function
```diff
-Navigation.navigate(ROUTES.WORKSPACE_PROFILE_ADDRESS.getRoute(policyID ?? '-1'))
+Navigation.navigate(ROUTES.WORKSPACE_PROFILE_ADDRESS.getRoute(policyID))
```
> error TS2345: Argument of type 'string | undefined' is not assignable to parameter of type 'string'. Type 'undefined' is not assignable to type 'string'.
We need to change the `getRoute()` `policyID` argument type to allow `undefined` to fix the TS error. Besides that, we *must* add a warning log if a user tries to navigate without the `policyID`. The log will help to catch and investigate cases of navigation with invalid IDs in the future.
```diff
WORKSPACE_PROFILE_ADDRESS: {
route: 'settings/workspaces/:policyID/profile/address',
- getRoute: (policyID: string, backTo?: string) => getUrlWithBackToParam(`settings/workspaces/${policyID}/profile/address` as const, backTo),
+ getRoute: (policyID: string | undefined, backTo?: string) => {
+ if (!policyID) {
+ Log.warn("Invalid policyID is used to build the WORKSPACE_PROFILE_ADDRESS route")
+ }
+ return getUrlWithBackToParam(`settings/workspaces/${policyID}/profile/address` as const, backTo);
+ },
},
```
##### Important Note:
When you change the function id argument type to allow `undefined`, check if it makes sense to call the function without the argument. If so, you can type the argument as optional. Otherwise, please use explicit `undefined` typing to identify that the parameter should **always** be passed, even if it's `undefined`.
``` ts
// BAD
-function getReport(reportID: string) {
+function getReport(reportID?: string) { // it doesn't makes sense to call getReport() without reportID, so it can't be optional

-function findLastAccessedReport(excludeReportID: string) {
+function findLastAccessedReport(excludeReportID: string | undefined) { // you can call findLastAccessedReport() without excludeReportID, so it can't be the required param

// GOOD
-function getReport(reportID: string) {
+function getReport(reportID: string | undefined) {

-function findLastAccessedReport(excludeReportID: string) {
+function findLastAccessedReport(excludeReportID?: string) {
```
#### **Case 2**: Type 'undefined' cannot be used as an index type.
```diff
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ To pay an expense,
{% include end-option.html %}
{% include end-selector.html %}

![Click Pay Button]({{site.url}}/assets/images/Reports_PayExpense_02.png){:width="100%"}

# Pay back friends and family

You'll need to [set up your wallet](https://help.expensify.com/articles/new-expensify/expenses-&-payments/Set-up-your-wallet) to send and receive personal payments within Expensify. The wallet is currently available to customers in the US-only.
Expand Down
Binary file added docs/assets/images/commfeed/commfeed-01.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/images/commfeed/commfeed-02.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/images/commfeed/commfeed-03.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/images/commfeed/commfeed-04.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/images/commfeed/commfeed-05.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/images/commfeed/commfeed-06.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/images/commfeed/commfeed-07.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions ios/NewExpensify.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
7FD73CA22B23CE9500420AF3 /* NotificationServiceExtension.appex in Embed Foundation Extensions */ = {isa = PBXBuildFile; fileRef = 7FD73C9B2B23CE9500420AF3 /* NotificationServiceExtension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
8744C5400E24E379441C04A4 /* libPods-NewExpensify.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 59A21B2405370FDDD847C813 /* libPods-NewExpensify.a */; };
9E17CB36A6B22BDD4BE53561 /* libPods-NotificationServiceExtension.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 9196A72C11B91A52A43D6E8A /* libPods-NotificationServiceExtension.a */; };
AC131FBB2CF634F20010CE80 /* BackgroundTasks.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AC131FBA2CF634F20010CE80 /* BackgroundTasks.framework */; };
ACA597C323AA39404655647F /* libPods-NewExpensify-NewExpensifyTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = EF33B19FC6A7FE676839430D /* libPods-NewExpensify-NewExpensifyTests.a */; };
BDB853621F354EBB84E619C2 /* ExpensifyNewKansas-MediumItalic.otf in Resources */ = {isa = PBXBuildFile; fileRef = D2AFB39EC1D44BF9B91D3227 /* ExpensifyNewKansas-MediumItalic.otf */; };
D27CE6B77196EF3EF450EEAC /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = 0D3F9E814828D91464DF9D35 /* PrivacyInfo.xcprivacy */; };
Expand Down Expand Up @@ -141,6 +142,7 @@
8B28D84EF339436DBD42A203 /* ExpensifyNeue-BoldItalic.otf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = "ExpensifyNeue-BoldItalic.otf"; path = "../assets/fonts/native/ExpensifyNeue-BoldItalic.otf"; sourceTree = "<group>"; };
8EFE0319D586C1078DB926FD /* Pods-NewExpensify.releaseadhoc.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-NewExpensify.releaseadhoc.xcconfig"; path = "Target Support Files/Pods-NewExpensify/Pods-NewExpensify.releaseadhoc.xcconfig"; sourceTree = "<group>"; };
9196A72C11B91A52A43D6E8A /* libPods-NotificationServiceExtension.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-NotificationServiceExtension.a"; sourceTree = BUILT_PRODUCTS_DIR; };
AC131FBA2CF634F20010CE80 /* BackgroundTasks.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = BackgroundTasks.framework; path = System/Library/Frameworks/BackgroundTasks.framework; sourceTree = SDKROOT; };
BBE493797E97F2995E627244 /* Pods-NotificationServiceExtension.debugadhoc.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-NotificationServiceExtension.debugadhoc.xcconfig"; path = "Target Support Files/Pods-NotificationServiceExtension/Pods-NotificationServiceExtension.debugadhoc.xcconfig"; sourceTree = "<group>"; };
BCD444BEDDB0AF1745B39049 /* ExpoModulesProvider.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ExpoModulesProvider.swift; path = "Pods/Target Support Files/Pods-NewExpensify-NewExpensifyTests/ExpoModulesProvider.swift"; sourceTree = "<group>"; };
BF6A4C5167244B9FB8E4D4E3 /* ExpensifyNeue-Italic.otf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = "ExpensifyNeue-Italic.otf"; path = "../assets/fonts/native/ExpensifyNeue-Italic.otf"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -180,6 +182,7 @@
383643682B6D4AE2005BB9AE /* DeviceCheck.framework in Frameworks */,
E51DC681C7DEE40AEBDDFBFE /* BuildFile in Frameworks */,
E51DC681C7DEE40AEBDDFBFE /* BuildFile in Frameworks */,
AC131FBB2CF634F20010CE80 /* BackgroundTasks.framework in Frameworks */,
8744C5400E24E379441C04A4 /* libPods-NewExpensify.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -239,6 +242,7 @@
2D16E6871FA4F8E400B85C8A /* Frameworks */ = {
isa = PBXGroup;
children = (
AC131FBA2CF634F20010CE80 /* BackgroundTasks.framework */,
383643672B6D4AE2005BB9AE /* DeviceCheck.framework */,
ED297162215061F000B7C4FE /* JavaScriptCore.framework */,
ED2971642150620600B7C4FE /* JavaScriptCore.framework */,
Expand Down
4 changes: 4 additions & 0 deletions ios/NewExpensify/AppDelegate.mm
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
#import "RCTBootSplash.h"
#import "RCTStartupTimer.h"
#import <HardwareShortcuts.h>
#import <BackgroundTasks/BackgroundTasks.h>
#import <expensify-react-native-background-task/RNBackgroundTaskManager.h>

@interface AppDelegate () <UNUserNotificationCenterDelegate>

Expand Down Expand Up @@ -49,6 +51,8 @@ - (BOOL)application:(UIApplication *)application
[UIApplication sharedApplication].applicationIconBadgeNumber = 0;
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"isFirstRunComplete"];
}

[RNBackgroundTaskManager setup];

return YES;
}
Expand Down
Loading

0 comments on commit ebf5a13

Please sign in to comment.