Skip to content

Commit

Permalink
Merge branch 'main' of github.com:Expensify/App into arosiclair-fix-o…
Browse files Browse the repository at this point in the history
…pen-report-errors
  • Loading branch information
arosiclair committed Jul 2, 2024
2 parents 12efe8a + eb8b251 commit afc914f
Show file tree
Hide file tree
Showing 31 changed files with 372 additions and 381 deletions.
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ android {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
multiDexEnabled rootProject.ext.multiDexEnabled
versionCode 1009000303
versionName "9.0.3-3"
versionCode 1009000305
versionName "9.0.3-5"
// 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
2 changes: 1 addition & 1 deletion ios/NewExpensify/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>9.0.3.3</string>
<string>9.0.3.5</string>
<key>FullStory</key>
<dict>
<key>OrgId</key>
Expand Down
2 changes: 1 addition & 1 deletion ios/NewExpensifyTests/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>9.0.3.3</string>
<string>9.0.3.5</string>
</dict>
</plist>
2 changes: 1 addition & 1 deletion ios/NotificationServiceExtension/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<key>CFBundleShortVersionString</key>
<string>9.0.3</string>
<key>CFBundleVersion</key>
<string>9.0.3.3</string>
<string>9.0.3.5</string>
<key>NSExtension</key>
<dict>
<key>NSExtensionPointIdentifier</key>
Expand Down
20 changes: 14 additions & 6 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1243,7 +1243,13 @@ PODS:
- react-native-config (1.5.0):
- react-native-config/App (= 1.5.0)
- react-native-config/App (1.5.0):
- React-Core
- RCT-Folly
- RCTRequired
- RCTTypeSafety
- React
- React-Codegen
- React-RCTFabric
- ReactCommon/turbomodule/core
- react-native-document-picker (9.1.1):
- RCT-Folly
- RCTRequired
Expand Down Expand Up @@ -1974,7 +1980,7 @@ PODS:
- ReactCommon/turbomodule/bridging
- ReactCommon/turbomodule/core
- Yoga
- RNScreens (3.30.1):
- RNScreens (3.32.0):
- glog
- hermes-engine
- RCT-Folly (= 2022.05.16.00)
Expand All @@ -1988,13 +1994,14 @@ PODS:
- React-ImageManager
- React-NativeModulesApple
- React-RCTFabric
- React-RCTImage
- React-rendererdebug
- React-utils
- ReactCommon/turbomodule/bridging
- ReactCommon/turbomodule/core
- RNScreens/common (= 3.30.1)
- RNScreens/common (= 3.32.0)
- Yoga
- RNScreens/common (3.30.1):
- RNScreens/common (3.32.0):
- glog
- hermes-engine
- RCT-Folly (= 2022.05.16.00)
Expand All @@ -2008,6 +2015,7 @@ PODS:
- React-ImageManager
- React-NativeModulesApple
- React-RCTFabric
- React-RCTImage
- React-rendererdebug
- React-utils
- ReactCommon/turbomodule/bridging
Expand Down Expand Up @@ -2552,7 +2560,7 @@ SPEC CHECKSUMS:
react-native-airship: 38e2596999242b68c933959d6145512e77937ac0
react-native-blob-util: 1ddace5234c62e3e6e4e154d305ad07ef686599b
react-native-cameraroll: f373bebbe9f6b7c3fd2a6f97c5171cda574cf957
react-native-config: 5330c8258265c1e5fdb8c009d2cabd6badd96727
react-native-config: 5ce986133b07fc258828b20b9506de0e683efc1c
react-native-document-picker: 8532b8af7c2c930f9e202aac484ac785b0f4f809
react-native-geolocation: f9e92eb774cb30ac1e099f34b3a94f03b4db7eb3
react-native-image-picker: f8a13ff106bcc7eb00c71ce11fdc36aac2a44440
Expand Down Expand Up @@ -2612,7 +2620,7 @@ SPEC CHECKSUMS:
RNPermissions: 0b61d30d21acbeafe25baaa47d9bae40a0c65216
RNReactNativeHapticFeedback: 616c35bdec7d20d4c524a7949ca9829c09e35f37
RNReanimated: 323436b1a5364dca3b5f8b1a13458455e0de9efe
RNScreens: 9ec969a95987a6caae170ef09313138abf3331e1
RNScreens: abd354e98519ed267600b7ee64fdcb8e060b1218
RNShare: 2a4cdfc0626ad56b0ef583d424f2038f772afe58
RNSound: 6c156f925295bdc83e8e422e7d8b38d33bc71852
RNSVG: 18f1381e046be2f1c30b4724db8d0c966238089f
Expand Down
12 changes: 6 additions & 6 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": "9.0.3-3",
"version": "9.0.3-5",
"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 @@ -168,7 +168,7 @@
"react-native-release-profiler": "^0.1.6",
"react-native-render-html": "6.3.1",
"react-native-safe-area-context": "4.8.2",
"react-native-screens": "3.30.1",
"react-native-screens": "3.32.0",
"react-native-share": "^10.0.2",
"react-native-sound": "^0.11.2",
"react-native-svg": "14.1.0",
Expand Down
12 changes: 0 additions & 12 deletions patches/react-native-screens+3.30.1+001+fix-screen-type.patch

This file was deleted.

39 changes: 0 additions & 39 deletions scripts/applyPatches.sh

This file was deleted.

7 changes: 2 additions & 5 deletions scripts/postInstall.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
#!/bin/bash

# Exit immediately if any command exits with a non-zero status
set -e

# Go to project root
ROOT_DIR=$(dirname "$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &> /dev/null && pwd)")
cd "$ROOT_DIR" || exit 1

# Apply packages using patch-package
scripts/applyPatches.sh
# Run patch-package
npx patch-package

# Install node_modules in subpackages, unless we're in a CI/CD environment,
# where the node_modules for subpackages are cached separately.
Expand Down
33 changes: 0 additions & 33 deletions src/hooks/usePaginatedReportActions.ts

This file was deleted.

5 changes: 0 additions & 5 deletions src/libs/API/parameters/OpenPolicyInitialPageParams.ts

This file was deleted.

5 changes: 0 additions & 5 deletions src/libs/API/parameters/OpenPolicyProfilePageParams.ts

This file was deleted.

2 changes: 0 additions & 2 deletions src/libs/API/parameters/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,6 @@ export type {default as OpenPolicyDistanceRatesPageParams} from './OpenPolicyDis
export type {default as OpenPolicyTaxesPageParams} from './OpenPolicyTaxesPageParams';
export type {default as EnablePolicyTaxesParams} from './EnablePolicyTaxesParams';
export type {default as OpenPolicyMoreFeaturesPageParams} from './OpenPolicyMoreFeaturesPageParams';
export type {default as OpenPolicyProfilePageParams} from './OpenPolicyProfilePageParams';
export type {default as OpenPolicyInitialPageParams} from './OpenPolicyInitialPageParams';
export type {default as CreatePolicyDistanceRateParams} from './CreatePolicyDistanceRateParams';
export type {default as SetPolicyDistanceRatesUnitParams} from './SetPolicyDistanceRatesUnitParams';
export type {default as SetPolicyDistanceRatesDefaultCategoryParams} from './SetPolicyDistanceRatesDefaultCategoryParams';
Expand Down
4 changes: 0 additions & 4 deletions src/libs/API/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -537,8 +537,6 @@ const READ_COMMANDS = {
OPEN_POLICY_WORKFLOWS_PAGE: 'OpenPolicyWorkflowsPage',
OPEN_POLICY_DISTANCE_RATES_PAGE: 'OpenPolicyDistanceRatesPage',
OPEN_POLICY_MORE_FEATURES_PAGE: 'OpenPolicyMoreFeaturesPage',
OPEN_POLICY_PROFILE_PAGE: 'OpenPolicyProfilePage',
OPEN_POLICY_INITIAL_PAGE: 'OpenPolicyInitialPage',
OPEN_POLICY_ACCOUNTING_PAGE: 'OpenPolicyAccountingPage',
SEARCH: 'Search',
OPEN_SUBSCRIPTION_PAGE: 'OpenSubscriptionPage',
Expand Down Expand Up @@ -587,8 +585,6 @@ type ReadCommandParameters = {
[READ_COMMANDS.OPEN_POLICY_WORKFLOWS_PAGE]: Parameters.OpenPolicyWorkflowsPageParams;
[READ_COMMANDS.OPEN_POLICY_DISTANCE_RATES_PAGE]: Parameters.OpenPolicyDistanceRatesPageParams;
[READ_COMMANDS.OPEN_POLICY_MORE_FEATURES_PAGE]: Parameters.OpenPolicyMoreFeaturesPageParams;
[READ_COMMANDS.OPEN_POLICY_PROFILE_PAGE]: Parameters.OpenPolicyProfilePageParams;
[READ_COMMANDS.OPEN_POLICY_INITIAL_PAGE]: Parameters.OpenPolicyInitialPageParams;
[READ_COMMANDS.OPEN_POLICY_ACCOUNTING_PAGE]: Parameters.OpenPolicyAccountingPageParams;
[READ_COMMANDS.SEARCH]: Parameters.SearchParams;
[READ_COMMANDS.OPEN_SUBSCRIPTION_PAGE]: null;
Expand Down
46 changes: 36 additions & 10 deletions src/libs/ReportUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,7 @@ type OptimisticTaskReport = Pick<
| 'notificationPreference'
| 'parentReportActionID'
| 'lastVisibleActionCreated'
| 'hasParentAccess'
>;

type TransactionDetails = {
Expand Down Expand Up @@ -1080,7 +1081,7 @@ function doesReportBelongToWorkspace(report: OnyxEntry<Report>, policyMemberAcco
/**
* Given an array of reports, return them filtered by a policyID and policyMemberAccountIDs.
*/
function filterReportsByPolicyIDAndMemberAccountIDs(reports: Report[], policyMemberAccountIDs: number[] = [], policyID?: string) {
function filterReportsByPolicyIDAndMemberAccountIDs(reports: Array<OnyxEntry<Report>>, policyMemberAccountIDs: number[] = [], policyID?: string) {
return reports.filter((report) => !!report && doesReportBelongToWorkspace(report, policyMemberAccountIDs, policyID));
}

Expand Down Expand Up @@ -1166,14 +1167,15 @@ function findLastAccessedReport(
reportMetadata: OnyxCollection<ReportMetadata> = {},
policyID?: string,
policyMemberAccountIDs: number[] = [],
excludeReportID?: string,
): OnyxEntry<Report> {
// If it's the user's first time using New Expensify, then they could either have:
// - just a Concierge report, if so we'll return that
// - their Concierge report, and a separate report that must have deeplinked them to the app before they created their account.
// If it's the latter, we'll use the deeplinked report over the Concierge report,
// since the Concierge report would be incorrectly selected over the deep-linked report in the logic below.

let reportsValues = Object.values(reports ?? {}) as Report[];
let reportsValues = Object.values(reports ?? {});

if (!!policyID || policyMemberAccountIDs.length > 0) {
reportsValues = filterReportsByPolicyIDAndMemberAccountIDs(reportsValues, policyMemberAccountIDs, policyID);
Expand All @@ -1189,13 +1191,28 @@ function findLastAccessedReport(
});
}

if (ignoreDomainRooms) {
// We allow public announce rooms, admins, and announce rooms through since we bypass the default rooms beta for them.
// Check where ReportUtils.findLastAccessedReport is called in MainDrawerNavigator.js for more context.
// Domain rooms are now the only type of default room that are on the defaultRooms beta.
sortedReports = sortedReports.filter(
(report) => !isDomainRoom(report) || getPolicyType(report, policies) === CONST.POLICY.TYPE.FREE || hasExpensifyGuidesEmails(Object.keys(report?.participants ?? {}).map(Number)),
);
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
const shouldFilter = excludeReportID || ignoreDomainRooms;
if (shouldFilter) {
sortedReports = sortedReports.filter((report) => {
if (excludeReportID && report?.reportID === excludeReportID) {
return false;
}

// We allow public announce rooms, admins, and announce rooms through since we bypass the default rooms beta for them.
// Check where ReportUtils.findLastAccessedReport is called in MainDrawerNavigator.js for more context.
// Domain rooms are now the only type of default room that are on the defaultRooms beta.
if (
ignoreDomainRooms &&
isDomainRoom(report) &&
getPolicyType(report, policies) !== CONST.POLICY.TYPE.FREE &&
!hasExpensifyGuidesEmails(Object.keys(report?.participants ?? {}).map(Number))
) {
return false;
}

return true;
});
}

if (isFirstTimeNewExpensifyUser) {
Expand Down Expand Up @@ -2279,7 +2296,15 @@ function getLastVisibleMessage(reportID: string | undefined, actionsToMerge: Rep
* @param [parentReportAction] - The parent report action of the report (Used to check if the task has been canceled)
*/
function isWaitingForAssigneeToCompleteTask(report: OnyxEntry<Report>, parentReportAction: OnyxEntry<ReportAction>): boolean {
return isTaskReport(report) && isReportManager(report) && isOpenTaskReport(report, parentReportAction);
if (report?.hasOutstandingChildTask) {
return true;
}

if (isOpenTaskReport(report, parentReportAction) && !report?.hasParentAccess && isReportManager(report)) {
return true;
}

return false;
}

function isUnreadWithMention(reportOrOption: OnyxEntry<Report> | OptionData): boolean {
Expand Down Expand Up @@ -5105,6 +5130,7 @@ function buildOptimisticTaskReport(
statusNum: CONST.REPORT.STATUS_NUM.OPEN,
notificationPreference,
lastVisibleActionCreated: DateUtils.getDBTime(),
hasParentAccess: true,
};
}

Expand Down
Loading

0 comments on commit afc914f

Please sign in to comment.