diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 4f78ee6b69bf..e9e4da575b4b 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,2 +1,6 @@ # Every PR gets a review from an internal Expensify engineer * @Expensify/pullerbear + +# Assign the Design team to review changes to our styles & assets +src/styles/ @Expensify/design @Expensify/pullerbear +assets/ @Expensify/design @Expensify/pullerbear diff --git a/android/app/src/main/java/com/expensify/chat/MainActivity.kt b/android/app/src/main/java/com/expensify/chat/MainActivity.kt index 935ba8c8825f..2daebb9b1c00 100644 --- a/android/app/src/main/java/com/expensify/chat/MainActivity.kt +++ b/android/app/src/main/java/com/expensify/chat/MainActivity.kt @@ -14,6 +14,8 @@ import com.facebook.react.ReactActivityDelegate import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.fabricEnabled import com.facebook.react.defaults.DefaultReactActivityDelegate +import com.oblador.performance.RNPerformance + class MainActivity : ReactActivity() { /** * Returns the name of the main component registered from JavaScript. This is used to schedule @@ -82,4 +84,9 @@ class MainActivity : ReactActivity() { KeyCommandModule.getInstance().onKeyDownEvent(keyCode, event) return super.onKeyUp(keyCode, event) } + + override fun onStart() { + super.onStart() + RNPerformance.getInstance().mark("appCreationEnd", false); + } } diff --git a/android/app/src/main/java/com/expensify/chat/MainApplication.kt b/android/app/src/main/java/com/expensify/chat/MainApplication.kt index 2362af009979..e660a871359d 100644 --- a/android/app/src/main/java/com/expensify/chat/MainApplication.kt +++ b/android/app/src/main/java/com/expensify/chat/MainApplication.kt @@ -15,6 +15,7 @@ import com.facebook.react.defaults.DefaultReactNativeHost import com.facebook.react.modules.i18nmanager.I18nUtil import com.facebook.soloader.SoLoader import com.google.firebase.crashlytics.FirebaseCrashlytics +import com.oblador.performance.RNPerformance import expo.modules.ApplicationLifecycleDispatcher import expo.modules.ReactNativeHostWrapper @@ -42,6 +43,8 @@ class MainApplication : MultiDexApplication(), ReactApplication { override fun onCreate() { super.onCreate() + RNPerformance.getInstance().mark("appCreationStart", false); + if (isOnfidoProcess()) { return } diff --git a/docs/redirects.csv b/docs/redirects.csv index f239d95187c8..9c12c4b0048a 100644 --- a/docs/redirects.csv +++ b/docs/redirects.csv @@ -67,6 +67,12 @@ https://help.expensify.com/articles/expensify-classic/settings/Merge-Accounts,ht https://help.expensify.com/articles/expensify-classic/settings/Preferences,https://help.expensify.com/expensify-classic/hubs/settings/account-settings https://help.expensify.com/articles/expensify-classic/getting-started/support/Your-Expensify-Account-Manager,https://use.expensify.com/support https://help.expensify.com/articles/expensify-classic/settings/Copilot,https://help.expensify.com/expensify-classic/hubs/copilots-and-delegates/ +https://help.expensify.com/articles/expensify-classic/workspace-and-domain-settings/reports/Currency,https://help.expensify.com/articles/expensify-classic/reports/Currency +https://help.expensify.com/articles/expensify-classic/workspace-and-domain-settings/reports/Report-Fields-And-Titles,https://help.expensify.com/articles/expensify-classic/workspaces/reports/Report-Fields-And-Titles +https://help.expensify.com/articles/expensify-classic/workspace-and-domain-settings/reports/Scheduled-Submit,https://help.expensify.com/articles/expensify-classic/workspaces/reports/Scheduled-Submit +https://help.expensify.com/articles/expensify-classic/workspace-and-domain-settings/Categories,https://help.expensify.com/articles/expensify-classic/workspaces/Categori +https://help.expensify.com/articles/expensify-classic/workspace-and-domain-settings/Expenses,https://help.expensify.com/expensify-classic/hubs/expenses/ +https://help.expensify.com/articles/expensify-classic/workspace-and-domain-settings/Per-Diem,https://help.expensify.com/articles/expensify-classic/expenses/Per-Diem-Expenses https://help.expensify.com/articles/expensify-classic/workspace-and-domain-settings/Budgets,https://help.expensify.com/articles/expensify-classic/workspaces/Budgets https://help.expensify.com/articles/expensify-classic/workspace-and-domain-settings/Reimbursement,https://help.expensify.com/articles/expensify-classic/send-payments/Reimbursing-Reports https://help.expensify.com/articles/expensify-classic/workspace-and-domain-settings/Tags,https://help.expensify.com/articles/expensify-classic/workspaces/Tags diff --git a/src/CONST.ts b/src/CONST.ts index 2b3cc7c09708..3b660997dbb7 100755 --- a/src/CONST.ts +++ b/src/CONST.ts @@ -1827,6 +1827,8 @@ const CONST = { RECEIPT: 'receipt', DISTANCE: 'distance', TAG: 'tag', + TAX_RATE: 'taxRate', + TAX_AMOUNT: 'taxAmount', }, FOOTER: { EXPENSE_MANAGEMENT_URL: `${USE_EXPENSIFY_URL}/expense-management`, diff --git a/src/Expensify.tsx b/src/Expensify.tsx index 026025593aef..6a57d6fdcc10 100644 --- a/src/Expensify.tsx +++ b/src/Expensify.tsx @@ -26,6 +26,7 @@ import NavigationRoot from './libs/Navigation/NavigationRoot'; import NetworkConnection from './libs/NetworkConnection'; import PushNotification from './libs/Notification/PushNotification'; import './libs/Notification/PushNotification/subscribePushNotification'; +import Performance from './libs/Performance'; import StartupTimer from './libs/StartupTimer'; // This lib needs to be imported, but it has nothing to export since all it contains is an Onyx connection import './libs/UnreadIndicatorUpdater'; @@ -130,6 +131,7 @@ function Expensify({ const onSplashHide = useCallback(() => { setIsSplashHidden(true); + Performance.markEnd(CONST.TIMING.SIDEBAR_LOADED); }, []); useLayoutEffect(() => { diff --git a/src/ONYXKEYS.ts b/src/ONYXKEYS.ts index c134d2a65db2..46b2c5f8055c 100755 --- a/src/ONYXKEYS.ts +++ b/src/ONYXKEYS.ts @@ -632,7 +632,7 @@ type OnyxValuesMapping = { [ONYXKEYS.RECENTLY_USED_REPORT_FIELDS]: OnyxTypes.RecentlyUsedReportFields; [ONYXKEYS.UPDATE_REQUIRED]: boolean; [ONYXKEYS.PLAID_CURRENT_EVENT]: string; - [ONYXKEYS.LOGS]: Record; + [ONYXKEYS.LOGS]: OnyxTypes.CapturedLogs; [ONYXKEYS.SHOULD_STORE_LOGS]: boolean; [ONYXKEYS.CACHED_PDF_PATHS]: Record; [ONYXKEYS.POLICY_OWNERSHIP_CHANGE_CHECKS]: Record; diff --git a/src/components/ClientSideLoggingToolMenu/BaseClientSideLoggingToolMenu.tsx b/src/components/ClientSideLoggingToolMenu/BaseClientSideLoggingToolMenu.tsx new file mode 100644 index 000000000000..fcad770908a6 --- /dev/null +++ b/src/components/ClientSideLoggingToolMenu/BaseClientSideLoggingToolMenu.tsx @@ -0,0 +1,96 @@ +import React from 'react'; +import {Alert} from 'react-native'; +import {withOnyx} from 'react-native-onyx'; +import type {OnyxEntry} from 'react-native-onyx'; +import Button from '@components/Button'; +import Switch from '@components/Switch'; +import TestToolRow from '@components/TestToolRow'; +import Text from '@components/Text'; +import useLocalize from '@hooks/useLocalize'; +import useThemeStyles from '@hooks/useThemeStyles'; +import * as Console from '@libs/actions/Console'; +import {parseStringifiedMessages} from '@libs/Console'; +import ONYXKEYS from '@src/ONYXKEYS'; +import type {CapturedLogs, Log} from '@src/types/onyx'; + +type BaseClientSideLoggingToolMenuOnyxProps = { + /** Logs captured on the current device */ + capturedLogs: OnyxEntry; + + /** Whether or not logs should be stored */ + shouldStoreLogs: OnyxEntry; +}; + +type BaseClientSideLoggingToolProps = { + /** Locally created file */ + file?: {path: string; newFileName: string; size: number}; + /** Action to run when pressing Share button */ + onShareLogs?: () => void; + /** Action to run when disabling the switch */ + onDisableLogging: (logs: Log[]) => void; + /** Action to run when enabling logging */ + onEnableLogging?: () => void; +} & BaseClientSideLoggingToolMenuOnyxProps; + +function BaseClientSideLoggingToolMenu({shouldStoreLogs, capturedLogs, file, onShareLogs, onDisableLogging, onEnableLogging}: BaseClientSideLoggingToolProps) { + const {translate} = useLocalize(); + + const onToggle = () => { + if (!shouldStoreLogs) { + Console.setShouldStoreLogs(true); + + if (onEnableLogging) { + onEnableLogging(); + } + + return; + } + + if (!capturedLogs) { + Alert.alert(translate('initialSettingsPage.troubleshoot.noLogsToShare')); + Console.disableLoggingAndFlushLogs(); + return; + } + + const logs = Object.values(capturedLogs); + const logsWithParsedMessages = parseStringifiedMessages(logs); + + onDisableLogging(logsWithParsedMessages); + Console.disableLoggingAndFlushLogs(); + }; + const styles = useThemeStyles(); + return ( + <> + + + + {!!file && ( + <> + {`path: ${file.path}`} + +