Skip to content

Commit 6658489

Browse files
committed
Merge branch 'main' into remove-onyx-connect-in-EmojiUtils-CardMessageUtils
2 parents f39bba5 + ddc915f commit 6658489

61 files changed

Lines changed: 331 additions & 1761 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
"test:debug": "TZ=utc NODE_OPTIONS='--inspect-brk --experimental-vm-modules' jest --runInBand",
4747
"perf-test": "NODE_OPTIONS=--experimental-vm-modules npx reassure",
4848
"typecheck": "NODE_OPTIONS=--max_old_space_size=8192 tsc",
49-
"lint": "NODE_OPTIONS=--max_old_space_size=8192 eslint . --max-warnings=308 --cache --cache-location=node_modules/.cache/eslint",
49+
"lint": "NODE_OPTIONS=--max_old_space_size=8192 eslint . --max-warnings=299 --cache --cache-location=node_modules/.cache/eslint",
5050
"lint-changed": "NODE_OPTIONS=--max_old_space_size=8192 ./scripts/lintChanged.sh",
5151
"lint-watch": "npx eslint-watch --watch --changed",
5252
"shellcheck": "./scripts/shellCheck.sh",

src/CONST/index.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1527,9 +1527,6 @@ const CONST = {
15271527
SEARCH_OPTION_LIST_DEBOUNCE_TIME: 300,
15281528
RESIZE_DEBOUNCE_TIME: 100,
15291529
UNREAD_UPDATE_DEBOUNCE_TIME: 300,
1530-
SEARCH_CONVERT_SEARCH_VALUES: 'search_convert_search_values',
1531-
SEARCH_MAKE_TREE: 'search_make_tree',
1532-
SEARCH_BUILD_TREE: 'search_build_tree',
15331530
SEARCH_FILTER_OPTIONS: 'search_filter_options',
15341531
USE_DEBOUNCED_STATE_DELAY: 300,
15351532
LIST_SCROLLING_DEBOUNCE_TIME: 200,
@@ -1538,10 +1535,8 @@ const CONST = {
15381535
PLAY_SOUND_MESSAGE_DEBOUNCE_TIME: 500,
15391536
NOTIFY_NEW_ACTION_DELAY: 700,
15401537
SKELETON_ANIMATION_SPEED: 3,
1541-
SEARCH_OPTIONS_COMPARISON: 'search_options_comparison',
15421538
SEARCH_MOST_RECENT_OPTIONS: 'search_most_recent_options',
15431539
DEBOUNCE_HANDLE_SEARCH: 'debounce_handle_search',
1544-
FAST_SEARCH_TREE_CREATION: 'fast_search_tree_creation',
15451540
},
15461541
PRIORITY_MODE: {
15471542
GSD: 'gsd',

src/ONYXKEYS.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -834,8 +834,8 @@ const ONYXKEYS = {
834834
SEARCH_SAVED_SEARCH_RENAME_FORM_DRAFT: 'searchSavedSearchRenameFormDraft',
835835
TEXT_PICKER_MODAL_FORM: 'textPickerModalForm',
836836
TEXT_PICKER_MODAL_FORM_DRAFT: 'textPickerModalFormDraft',
837-
RULES_CUSTOM_NAME_MODAL_FORM: 'rulesCustomNameModalForm',
838-
RULES_CUSTOM_NAME_MODAL_FORM_DRAFT: 'rulesCustomNameModalFormDraft',
837+
REPORTS_DEFAULT_TITLE_MODAL_FORM: 'ReportsDefaultTitleModalForm',
838+
REPORTS_DEFAULT_TITLE_MODAL_FORM_DRAFT: 'ReportsDefaultTitleModalFormDraft',
839839
RULES_AUTO_APPROVE_REPORTS_UNDER_MODAL_FORM: 'rulesAutoApproveReportsUnderModalForm',
840840
RULES_AUTO_APPROVE_REPORTS_UNDER_MODAL_FORM_DRAFT: 'rulesAutoApproveReportsUnderModalFormDraft',
841841
RULES_RANDOM_REPORT_AUDIT_MODAL_FORM: 'rulesRandomReportAuditModalForm',
@@ -954,7 +954,7 @@ type OnyxFormValuesMapping = {
954954
[ONYXKEYS.FORMS.SAGE_INTACCT_DIMENSION_TYPE_FORM]: FormTypes.SageIntacctDimensionForm;
955955
[ONYXKEYS.FORMS.SEARCH_ADVANCED_FILTERS_FORM]: FormTypes.SearchAdvancedFiltersForm;
956956
[ONYXKEYS.FORMS.TEXT_PICKER_MODAL_FORM]: FormTypes.TextPickerModalForm;
957-
[ONYXKEYS.FORMS.RULES_CUSTOM_NAME_MODAL_FORM]: FormTypes.RulesCustomNameModalForm;
957+
[ONYXKEYS.FORMS.REPORTS_DEFAULT_TITLE_MODAL_FORM]: FormTypes.ReportsDefaultTitleModalForm;
958958
[ONYXKEYS.FORMS.RULES_AUTO_APPROVE_REPORTS_UNDER_MODAL_FORM]: FormTypes.RulesAutoApproveReportsUnderModalForm;
959959
[ONYXKEYS.FORMS.RULES_RANDOM_REPORT_AUDIT_MODAL_FORM]: FormTypes.RulesRandomReportAuditModalForm;
960960
[ONYXKEYS.FORMS.RULES_AUTO_PAY_REPORTS_UNDER_MODAL_FORM]: FormTypes.RulesAutoPayReportsUnderModalForm;

src/ROUTES.ts

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1630,43 +1630,43 @@ const ROUTES = {
16301630
route: 'workspaces/:policyID/tax/:taxID/tax-code',
16311631
getRoute: (policyID: string, taxID: string) => `workspaces/${policyID}/tax/${encodeURIComponent(taxID)}/tax-code` as const,
16321632
},
1633-
WORKSPACE_REPORT_FIELDS: {
1634-
route: 'workspaces/:policyID/reportFields',
1633+
WORKSPACE_REPORTS: {
1634+
route: 'workspaces/:policyID/reports',
16351635
getRoute: (policyID: string | undefined) => {
16361636
if (!policyID) {
1637-
Log.warn('Invalid policyID is used to build the WORKSPACE_REPORT_FIELDS route');
1637+
Log.warn('Invalid policyID is used to build the WORKSPACE_REPORTS route');
16381638
}
1639-
return `workspaces/${policyID}/reportFields` as const;
1639+
return `workspaces/${policyID}/reports` as const;
16401640
},
16411641
},
16421642
WORKSPACE_CREATE_REPORT_FIELD: {
1643-
route: 'workspaces/:policyID/reportFields/new',
1644-
getRoute: (policyID: string) => `workspaces/${policyID}/reportFields/new` as const,
1643+
route: 'workspaces/:policyID/reports/newReportField',
1644+
getRoute: (policyID: string) => `workspaces/${policyID}/reports/newReportField` as const,
16451645
},
16461646
WORKSPACE_REPORT_FIELDS_SETTINGS: {
1647-
route: 'workspaces/:policyID/reportFields/:reportFieldID/edit',
1648-
getRoute: (policyID: string, reportFieldID: string) => `workspaces/${policyID}/reportFields/${encodeURIComponent(reportFieldID)}/edit` as const,
1647+
route: 'workspaces/:policyID/reports/:reportFieldID/edit',
1648+
getRoute: (policyID: string, reportFieldID: string) => `workspaces/${policyID}/reports/${encodeURIComponent(reportFieldID)}/edit` as const,
16491649
},
16501650
WORKSPACE_REPORT_FIELDS_LIST_VALUES: {
1651-
route: 'workspaces/:policyID/reportFields/listValues/:reportFieldID?',
1652-
getRoute: (policyID: string, reportFieldID?: string) => `workspaces/${policyID}/reportFields/listValues/${reportFieldID ? encodeURIComponent(reportFieldID) : ''}` as const,
1651+
route: 'workspaces/:policyID/reports/listValues/:reportFieldID?',
1652+
getRoute: (policyID: string, reportFieldID?: string) => `workspaces/${policyID}/reports/listValues/${reportFieldID ? encodeURIComponent(reportFieldID) : ''}` as const,
16531653
},
16541654
WORKSPACE_REPORT_FIELDS_ADD_VALUE: {
1655-
route: 'workspaces/:policyID/reportFields/addValue/:reportFieldID?',
1656-
getRoute: (policyID: string, reportFieldID?: string) => `workspaces/${policyID}/reportFields/addValue/${reportFieldID ? encodeURIComponent(reportFieldID) : ''}` as const,
1655+
route: 'workspaces/:policyID/reports/addValue/:reportFieldID?',
1656+
getRoute: (policyID: string, reportFieldID?: string) => `workspaces/${policyID}/reports/addValue/${reportFieldID ? encodeURIComponent(reportFieldID) : ''}` as const,
16571657
},
16581658
WORKSPACE_REPORT_FIELDS_VALUE_SETTINGS: {
1659-
route: 'workspaces/:policyID/reportFields/:valueIndex/:reportFieldID?',
1659+
route: 'workspaces/:policyID/reports/:valueIndex/:reportFieldID?',
16601660
getRoute: (policyID: string, valueIndex: number, reportFieldID?: string) =>
1661-
`workspaces/${policyID}/reportFields/${valueIndex}/${reportFieldID ? encodeURIComponent(reportFieldID) : ''}` as const,
1661+
`workspaces/${policyID}/reports/${valueIndex}/${reportFieldID ? encodeURIComponent(reportFieldID) : ''}` as const,
16621662
},
16631663
WORKSPACE_REPORT_FIELDS_EDIT_VALUE: {
1664-
route: 'workspaces/:policyID/reportFields/new/:valueIndex/edit',
1665-
getRoute: (policyID: string, valueIndex: number) => `workspaces/${policyID}/reportFields/new/${valueIndex}/edit` as const,
1664+
route: 'workspaces/:policyID/reports/newReportField/:valueIndex/edit',
1665+
getRoute: (policyID: string, valueIndex: number) => `workspaces/${policyID}/reports/newReportField/${valueIndex}/edit` as const,
16661666
},
16671667
WORKSPACE_EDIT_REPORT_FIELDS_INITIAL_VALUE: {
1668-
route: 'workspaces/:policyID/reportFields/:reportFieldID/edit/initialValue',
1669-
getRoute: (policyID: string, reportFieldID: string) => `workspaces/${policyID}/reportFields/${encodeURIComponent(reportFieldID)}/edit/initialValue` as const,
1668+
route: 'workspaces/:policyID/reports/:reportFieldID/edit/initialValue',
1669+
getRoute: (policyID: string, reportFieldID: string) => `workspaces/${policyID}/reports/${encodeURIComponent(reportFieldID)}/edit/initialValue` as const,
16701670
},
16711671
WORKSPACE_COMPANY_CARDS: {
16721672
route: 'workspaces/:policyID/company-cards',
@@ -1884,9 +1884,9 @@ const ROUTES = {
18841884
route: 'workspaces/:policyID/per-diem/edit/currency/:rateID/:subRateID',
18851885
getRoute: (policyID: string, rateID: string, subRateID: string) => `workspaces/${policyID}/per-diem/edit/currency/${rateID}/${subRateID}` as const,
18861886
},
1887-
RULES_CUSTOM_NAME: {
1888-
route: 'workspaces/:policyID/rules/name',
1889-
getRoute: (policyID: string) => `workspaces/${policyID}/rules/name` as const,
1887+
REPORTS_DEFAULT_TITLE: {
1888+
route: 'workspaces/:policyID/reports/name',
1889+
getRoute: (policyID: string) => `workspaces/${policyID}/reports/name` as const,
18901890
},
18911891
RULES_AUTO_APPROVE_REPORTS_UNDER: {
18921892
route: 'workspaces/:policyID/rules/auto-approve',

src/SCREENS.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -225,9 +225,6 @@ const SCREENS = {
225225
SCHEDULE_CALL: 'ScheduleCall',
226226
},
227227
PUBLIC_CONSOLE_DEBUG: 'Console_Debug',
228-
ONBOARDING_MODAL: {
229-
ONBOARDING: 'Onboarding',
230-
},
231228
SIGN_IN_WITH_APPLE_DESKTOP: 'AppleSignInDesktop',
232229
SIGN_IN_WITH_GOOGLE_DESKTOP: 'GoogleSignInDesktop',
233230
DESKTOP_SIGN_IN_REDIRECT: 'DesktopSignInRedirect',
@@ -556,7 +553,7 @@ const SCREENS = {
556553
TAGS_IMPORTED_MULTI_LEVEL: 'Tags_Imported_Multi_Level',
557554
TAG_EDIT: 'Tag_Edit',
558555
TAXES: 'Workspace_Taxes',
559-
REPORT_FIELDS: 'Workspace_ReportFields',
556+
REPORTS: 'Workspace_Reports',
560557
REPORT_FIELDS_SETTINGS: 'Workspace_ReportFields_Settings',
561558
REPORT_FIELDS_CREATE: 'Workspace_ReportFields_Create',
562559
REPORT_FIELDS_LIST_VALUES: 'Workspace_ReportFields_ListValues',
@@ -624,7 +621,7 @@ const SCREENS = {
624621
DOWNGRADE: 'Workspace_Downgrade',
625622
PAY_AND_DOWNGRADE: 'Workspace_Pay_And_Downgrade',
626623
RULES: 'Policy_Rules',
627-
RULES_CUSTOM_NAME: 'Rules_Custom_Name',
624+
REPORTS_DEFAULT_TITLE: 'Reports_Default_Title',
628625
RULES_AUTO_APPROVE_REPORTS_UNDER: 'Rules_Auto_Approve_Reports_Under',
629626
RULES_RANDOM_REPORT_AUDIT: 'Rules_Random_Report_Audit',
630627
RULES_AUTO_PAY_REPORTS_UNDER: 'Rules_AutoPay_Reports_Under',

src/components/FocusTrap/WIDE_LAYOUT_INACTIVE_SCREENS.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const WIDE_LAYOUT_INACTIVE_SCREENS: string[] = [
2525
SCREENS.WORKSPACE.MORE_FEATURES,
2626
SCREENS.WORKSPACE.TAGS,
2727
SCREENS.WORKSPACE.TAXES,
28-
SCREENS.WORKSPACE.REPORT_FIELDS,
28+
SCREENS.WORKSPACE.REPORTS,
2929
SCREENS.WORKSPACE.EXPENSIFY_CARD,
3030
SCREENS.WORKSPACE.COMPANY_CARDS,
3131
SCREENS.WORKSPACE.DISTANCE_RATES,

src/components/OptionListContextProvider.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ function OptionsListContextProvider({children}: OptionsListProviderProps) {
5454
const personalDetails = usePersonalDetails();
5555
const prevPersonalDetails = usePrevious(personalDetails);
5656
const hasInitialData = useMemo(() => Object.keys(personalDetails ?? {}).length > 0, [personalDetails]);
57+
const [transactions] = useOnyx(ONYXKEYS.COLLECTION.TRANSACTION, {canBeMissing: true});
5758

5859
const loadOptions = useCallback(() => {
5960
const optionLists = createOptionList(personalDetails, reports, reportAttributes?.reports);
@@ -160,7 +161,7 @@ function OptionsListContextProvider({children}: OptionsListProviderProps) {
160161
reports: Array.from(updatedReportsMap.values()),
161162
};
162163
});
163-
}, [changedReportActions, personalDetails, reportAttributes?.reports]);
164+
}, [changedReportActions, personalDetails, reportAttributes?.reports, transactions]);
164165

165166
/**
166167
* This effect is used to update the options list when personal details change.

src/components/ReportActionItem/MoneyRequestView.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,8 @@ function MoneyRequestView({allReports, report, policy, shouldShowAnimatedBackgro
196196
const taxRatesDescription = taxRates?.name;
197197
const taxRateTitle = updatedTransaction ? getTaxName(policy, updatedTransaction) : getTaxName(policy, transaction);
198198

199+
const fallbackTaxRateTitle = transaction?.taxValue;
200+
199201
const isSettled = isSettledReportUtils(moneyRequestReport?.reportID);
200202
const isCancelled = moneyRequestReport && moneyRequestReport?.isCancelledIOU;
201203
const isChatReportArchived = useReportIsArchived(moneyRequestReport?.chatReportID);
@@ -776,7 +778,7 @@ function MoneyRequestView({allReports, report, policy, shouldShowAnimatedBackgro
776778
{shouldShowTax && (
777779
<OfflineWithFeedback pendingAction={getPendingFieldAction('taxCode')}>
778780
<MenuItemWithTopDescription
779-
title={taxRateTitle ?? ''}
781+
title={taxRateTitle ?? fallbackTaxRateTitle}
780782
description={taxRatesDescription}
781783
interactive={canEditTaxFields}
782784
shouldShowRightIcon={canEditTaxFields}

0 commit comments

Comments
 (0)