From f144f54e4aac23c60ff2fb28959c0972d0988329 Mon Sep 17 00:00:00 2001 From: Abdelrahman Khattab Date: Sun, 16 Jun 2024 22:20:19 +0200 Subject: [PATCH 01/40] Fixing form amount inconsistency with some currencies --- src/components/MoneyRequestAmountInput.tsx | 2 +- src/libs/CurrencyUtils.ts | 4 ++-- src/pages/iou/MoneyRequestAmountForm.tsx | 2 +- src/pages/iou/request/IOURequestStartPage.tsx | 5 ++++- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/components/MoneyRequestAmountInput.tsx b/src/components/MoneyRequestAmountInput.tsx index 0c3868312c41..7d3f4ba5e687 100644 --- a/src/components/MoneyRequestAmountInput.tsx +++ b/src/components/MoneyRequestAmountInput.tsx @@ -103,7 +103,7 @@ const getNewSelection = (oldSelection: Selection, prevLength: number, newLength: return {start: cursorPosition, end: cursorPosition}; }; -const defaultOnFormatAmount = (amount: number) => CurrencyUtils.convertToFrontendAmountAsString(amount); +const defaultOnFormatAmount = (amount: number, currency?: string) => CurrencyUtils.convertToFrontendAmountAsString(amount, currency); function MoneyRequestAmountInput( { diff --git a/src/libs/CurrencyUtils.ts b/src/libs/CurrencyUtils.ts index 7b54fbf0bed7..aa2bd2c8d44d 100644 --- a/src/libs/CurrencyUtils.ts +++ b/src/libs/CurrencyUtils.ts @@ -96,11 +96,11 @@ function convertToFrontendAmountAsInteger(amountAsInt: number): number { * * @note we do not support any currencies with more than two decimal places. */ -function convertToFrontendAmountAsString(amountAsInt: number | null | undefined): string { +function convertToFrontendAmountAsString(amountAsInt: number | null | undefined, currency?: string): string { if (amountAsInt === null || amountAsInt === undefined) { return ''; } - return convertToFrontendAmountAsInteger(amountAsInt).toFixed(2); + return convertToFrontendAmountAsInteger(amountAsInt).toFixed(currency ? getCurrencyDecimals(currency) : 2); } /** diff --git a/src/pages/iou/MoneyRequestAmountForm.tsx b/src/pages/iou/MoneyRequestAmountForm.tsx index 667c27c96a8c..4b55fb6b0e1c 100644 --- a/src/pages/iou/MoneyRequestAmountForm.tsx +++ b/src/pages/iou/MoneyRequestAmountForm.tsx @@ -150,7 +150,7 @@ function MoneyRequestAmountForm( }, [isFocused, wasFocused]); const initializeAmount = useCallback((newAmount: number) => { - const frontendAmount = newAmount ? CurrencyUtils.convertToFrontendAmountAsString(newAmount) : ''; + const frontendAmount = newAmount ? CurrencyUtils.convertToFrontendAmountAsString(newAmount, currency) : ''; moneyRequestAmountInput.current?.changeAmount(frontendAmount); moneyRequestAmountInput.current?.changeSelection({ start: frontendAmount.length, diff --git a/src/pages/iou/request/IOURequestStartPage.tsx b/src/pages/iou/request/IOURequestStartPage.tsx index 44f3c1b6a1bc..bd92f4d0fb08 100644 --- a/src/pages/iou/request/IOURequestStartPage.tsx +++ b/src/pages/iou/request/IOURequestStartPage.tsx @@ -163,7 +163,10 @@ function IOURequestStartPage({ {shouldDisplayDistanceRequest && {() => }} ) : ( - + )} From c8d53326767a7d4351e0a1d2b9f17f864c71d002 Mon Sep 17 00:00:00 2001 From: Abdelrahman Khattab Date: Sun, 16 Jun 2024 22:43:57 +0200 Subject: [PATCH 02/40] Fixing linting --- src/pages/iou/MoneyRequestAmountForm.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pages/iou/MoneyRequestAmountForm.tsx b/src/pages/iou/MoneyRequestAmountForm.tsx index 4b55fb6b0e1c..bbfc7e59a8d4 100644 --- a/src/pages/iou/MoneyRequestAmountForm.tsx +++ b/src/pages/iou/MoneyRequestAmountForm.tsx @@ -149,8 +149,8 @@ function MoneyRequestAmountForm( }); }, [isFocused, wasFocused]); - const initializeAmount = useCallback((newAmount: number) => { - const frontendAmount = newAmount ? CurrencyUtils.convertToFrontendAmountAsString(newAmount, currency) : ''; + const initializeAmount = useCallback((newAmount: number, newCurrency: string) => { + const frontendAmount = newAmount ? CurrencyUtils.convertToFrontendAmountAsString(newAmount, newCurrency) : ''; moneyRequestAmountInput.current?.changeAmount(frontendAmount); moneyRequestAmountInput.current?.changeSelection({ start: frontendAmount.length, @@ -162,7 +162,7 @@ function MoneyRequestAmountForm( if (!currency || typeof amount !== 'number') { return; } - initializeAmount(amount); + initializeAmount(amount, currency); // we want to re-initialize the state only when the selected tab // eslint-disable-next-line react-hooks/exhaustive-deps }, [selectedTab]); From 5fa91a94bcddef0758872346af48cb6a06388c01 Mon Sep 17 00:00:00 2001 From: Abdelrahman Khattab <59809993+abzokhattab@users.noreply.github.com> Date: Mon, 24 Jun 2024 23:22:26 +0200 Subject: [PATCH 03/40] Refactoring Co-authored-by: Eugene Voloshchak --- src/libs/CurrencyUtils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/CurrencyUtils.ts b/src/libs/CurrencyUtils.ts index aa2bd2c8d44d..b7c402397e1c 100644 --- a/src/libs/CurrencyUtils.ts +++ b/src/libs/CurrencyUtils.ts @@ -100,7 +100,7 @@ function convertToFrontendAmountAsString(amountAsInt: number | null | undefined, if (amountAsInt === null || amountAsInt === undefined) { return ''; } - return convertToFrontendAmountAsInteger(amountAsInt).toFixed(currency ? getCurrencyDecimals(currency) : 2); + return convertToFrontendAmountAsInteger(amountAsInt).toFixed(getCurrencyDecimals(currency)); } /** From 23f098a1a149d67fcc318c94ec8d9264589af5e9 Mon Sep 17 00:00:00 2001 From: Bernhard Owen Josephus Date: Sat, 29 Jun 2024 12:07:20 +0800 Subject: [PATCH 04/40] no need to convert to markdown --- src/pages/workspace/WorkspaceInviteMessagePage.tsx | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/pages/workspace/WorkspaceInviteMessagePage.tsx b/src/pages/workspace/WorkspaceInviteMessagePage.tsx index 9bab92bc38b0..3306cf2669af 100644 --- a/src/pages/workspace/WorkspaceInviteMessagePage.tsx +++ b/src/pages/workspace/WorkspaceInviteMessagePage.tsx @@ -22,7 +22,6 @@ import useAutoFocusInput from '@hooks/useAutoFocusInput'; import useLocalize from '@hooks/useLocalize'; import useThemeStyles from '@hooks/useThemeStyles'; import Navigation from '@libs/Navigation/Navigation'; -import {parseHtmlToMarkdown} from '@libs/OnyxAwareParser'; import * as OptionsListUtils from '@libs/OptionsListUtils'; import * as PolicyUtils from '@libs/PolicyUtils'; import updateMultilineInputRange from '@libs/updateMultilineInputRange'; @@ -88,15 +87,13 @@ function WorkspaceInviteMessagePage({ // policy?.description can be an empty string // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing policy?.description || - parser.replace( - translate('workspace.common.welcomeNote', { - workspaceName: policy?.name ?? '', - }), - ); + translate('workspace.common.welcomeNote', { + workspaceName: policy?.name ?? '', + }); useEffect(() => { if (!isEmptyObject(invitedEmailsToAccountIDsDraft)) { - setWelcomeNote(parseHtmlToMarkdown(getDefaultWelcomeNote())); + setWelcomeNote(getDefaultWelcomeNote()); return; } Navigation.goBack(ROUTES.WORKSPACE_INVITE.getRoute(route.params.policyID), true); From 93b8f92b273bbef413520e61e30eee2f88c85699 Mon Sep 17 00:00:00 2001 From: Bernhard Owen Josephus Date: Sat, 29 Jun 2024 15:59:06 +0800 Subject: [PATCH 05/40] remove unused variable --- src/pages/workspace/WorkspaceInviteMessagePage.tsx | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/pages/workspace/WorkspaceInviteMessagePage.tsx b/src/pages/workspace/WorkspaceInviteMessagePage.tsx index 3306cf2669af..9ac8270ae42f 100644 --- a/src/pages/workspace/WorkspaceInviteMessagePage.tsx +++ b/src/pages/workspace/WorkspaceInviteMessagePage.tsx @@ -1,5 +1,4 @@ import type {StackScreenProps} from '@react-navigation/stack'; -import {ExpensiMark} from 'expensify-common'; import lodashDebounce from 'lodash/debounce'; import React, {useEffect, useMemo, useState} from 'react'; import {Keyboard, View} from 'react-native'; @@ -58,8 +57,6 @@ type WorkspaceInviteMessagePageProps = WithPolicyAndFullscreenLoadingProps & WorkspaceInviteMessagePageOnyxProps & StackScreenProps; -const parser = new ExpensiMark(); - function WorkspaceInviteMessagePage({ workspaceInviteMessageDraft, invitedEmailsToAccountIDsDraft, From eb4265702da585dce86ac2c5506c691cd0e449d3 Mon Sep 17 00:00:00 2001 From: Krishna Gupta Date: Wed, 3 Jul 2024 05:01:39 +0530 Subject: [PATCH 06/40] fix: iOS - Distance - Center icon overlaps with compass icon. Signed-off-by: Krishna Gupta --- src/components/MapView/MapView.tsx | 4 +++- src/styles/utils/positioning.ts | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/MapView/MapView.tsx b/src/components/MapView/MapView.tsx index 283f7c396edb..f4475c83d75b 100644 --- a/src/components/MapView/MapView.tsx +++ b/src/components/MapView/MapView.tsx @@ -207,7 +207,9 @@ const MapView = forwardRef( onTouchStart={() => setUserInteractedWithMap(true)} pitchEnabled={pitchEnabled} attributionPosition={{...styles.r2, ...styles.b2}} - scaleBarEnabled={false} + scaleBarEnabled + compassEnabled + compassPosition={{...styles.l2, ...styles.t8}} logoPosition={{...styles.l2, ...styles.b2}} // eslint-disable-next-line react/jsx-props-no-spreading {...responder.panHandlers} diff --git a/src/styles/utils/positioning.ts b/src/styles/utils/positioning.ts index 5e0169990499..6731b0ebc58f 100644 --- a/src/styles/utils/positioning.ts +++ b/src/styles/utils/positioning.ts @@ -22,6 +22,9 @@ export default { t0: { top: 0, }, + t8: { + top: 32, + }, tn4: { top: -16, }, From e17952a10148783b1b22a35292009b2ada656837 Mon Sep 17 00:00:00 2001 From: Abdelrahman Khattab Date: Mon, 8 Jul 2024 13:07:57 +0200 Subject: [PATCH 07/40] Type refactoring: making currency as required in the convertToFrontendAmountAsString function --- src/components/MoneyRequestAmountInput.tsx | 4 ++-- src/libs/CurrencyUtils.ts | 2 +- tests/unit/CurrencyUtilsTest.ts | 22 +++++++++++++--------- 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/src/components/MoneyRequestAmountInput.tsx b/src/components/MoneyRequestAmountInput.tsx index 7d3f4ba5e687..08829fe74f3e 100644 --- a/src/components/MoneyRequestAmountInput.tsx +++ b/src/components/MoneyRequestAmountInput.tsx @@ -28,7 +28,7 @@ type MoneyRequestAmountInputProps = { amount?: number; /** A callback to format the amount number */ - onFormatAmount?: (amount: number, currency?: string) => string; + onFormatAmount?: (amount: number, currency: string) => string; /** Currency chosen by user or saved in Onyx */ currency?: string; @@ -103,7 +103,7 @@ const getNewSelection = (oldSelection: Selection, prevLength: number, newLength: return {start: cursorPosition, end: cursorPosition}; }; -const defaultOnFormatAmount = (amount: number, currency?: string) => CurrencyUtils.convertToFrontendAmountAsString(amount, currency); +const defaultOnFormatAmount = (amount: number, currency: string) => CurrencyUtils.convertToFrontendAmountAsString(amount, currency); function MoneyRequestAmountInput( { diff --git a/src/libs/CurrencyUtils.ts b/src/libs/CurrencyUtils.ts index b7c402397e1c..9364991bea6e 100644 --- a/src/libs/CurrencyUtils.ts +++ b/src/libs/CurrencyUtils.ts @@ -96,7 +96,7 @@ function convertToFrontendAmountAsInteger(amountAsInt: number): number { * * @note we do not support any currencies with more than two decimal places. */ -function convertToFrontendAmountAsString(amountAsInt: number | null | undefined, currency?: string): string { +function convertToFrontendAmountAsString(amountAsInt: number | null | undefined, currency: string): string { if (amountAsInt === null || amountAsInt === undefined) { return ''; } diff --git a/tests/unit/CurrencyUtilsTest.ts b/tests/unit/CurrencyUtilsTest.ts index 87b7c7ee4569..023c6396f160 100644 --- a/tests/unit/CurrencyUtilsTest.ts +++ b/tests/unit/CurrencyUtilsTest.ts @@ -119,15 +119,19 @@ describe('CurrencyUtils', () => { describe('convertToFrontendAmountAsString', () => { test.each([ - [2500, '25.00'], - [2550, '25.50'], - [25, '0.25'], - [2500.5, '25.00'], - [null, ''], - [undefined, ''], - [0, '0.00'], - ])('Correctly converts %s to amount in units handled in frontend as a string', (input, expectedResult) => { - expect(CurrencyUtils.convertToFrontendAmountAsString(input)).toBe(expectedResult); + [2500, 'USD', '25.00'], + [2550, 'USD', '25.50'], + [25, 'USD', '0.25'], + [2500.5, 'USD', '25.00'], + [null, 'USD', ''], + [undefined, 'USD', ''], + [0, 'USD', '0.00'], + [123456, 'JPY', '1235'], // JPY has 0 decimals + [1234, 'JPY', '12'], // JPY has 0 decimals + [123456, 'LYD', '1234.56'], + [12345678, 'UYW', '123456.78'], + ])('Correctly converts %s to amount in %s currency as a string', (input, currency, expectedResult) => { + expect(CurrencyUtils.convertToFrontendAmountAsString(input, currency)).toBe(expectedResult); }); }); From ae56662c44e0681fb5d6fad3cbacfa615a76c3a1 Mon Sep 17 00:00:00 2001 From: Pavlo Tsimura Date: Tue, 9 Jul 2024 11:21:33 +0200 Subject: [PATCH 08/40] Optimistically disable the distance rate on removal --- src/libs/DistanceRequestUtils.ts | 4 ++-- src/libs/actions/Policy/DistanceRate.ts | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/libs/DistanceRequestUtils.ts b/src/libs/DistanceRequestUtils.ts index a85db2bc28d8..76d595dc6976 100644 --- a/src/libs/DistanceRequestUtils.ts +++ b/src/libs/DistanceRequestUtils.ts @@ -80,9 +80,9 @@ function getDefaultMileageRate(policy: OnyxInputOrEntry): MileageRate | if (!distanceUnit?.rates) { return; } - const mileageRates = getMileageRates(policy); + const mileageRates = Object.values(getMileageRates(policy)); - const distanceRate = Object.values(mileageRates).find((rate) => rate.name === CONST.CUSTOM_UNITS.DEFAULT_RATE) ?? Object.values(mileageRates)[0] ?? {}; + const distanceRate = mileageRates.find((rate) => rate.name === CONST.CUSTOM_UNITS.DEFAULT_RATE) ?? mileageRates[0] ?? {}; return { customUnitRateID: distanceRate.customUnitRateID, diff --git a/src/libs/actions/Policy/DistanceRate.ts b/src/libs/actions/Policy/DistanceRate.ts index c10e4d87484c..b81b180cca52 100644 --- a/src/libs/actions/Policy/DistanceRate.ts +++ b/src/libs/actions/Policy/DistanceRate.ts @@ -489,6 +489,7 @@ function deletePolicyDistanceRates(policyID: string, customUnit: CustomUnit, rat if (rateIDsToDelete.includes(rateID)) { optimisticRates[rateID] = { ...currentRates[rateID], + enabled: false, pendingAction: CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE, }; failureRates[rateID] = { From c27688cb7b0c2c6f6e824ec58478da480d0a12b2 Mon Sep 17 00:00:00 2001 From: Bernhard Owen Josephus Date: Wed, 10 Jul 2024 11:20:54 +0800 Subject: [PATCH 09/40] remove unused import --- src/pages/workspace/WorkspaceInviteMessagePage.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/pages/workspace/WorkspaceInviteMessagePage.tsx b/src/pages/workspace/WorkspaceInviteMessagePage.tsx index 6a22307e32e4..2d420d0da3a9 100644 --- a/src/pages/workspace/WorkspaceInviteMessagePage.tsx +++ b/src/pages/workspace/WorkspaceInviteMessagePage.tsx @@ -22,7 +22,6 @@ import useLocalize from '@hooks/useLocalize'; import useThemeStyles from '@hooks/useThemeStyles'; import Navigation from '@libs/Navigation/Navigation'; import * as OptionsListUtils from '@libs/OptionsListUtils'; -import Parser from '@libs/Parser'; import * as PolicyUtils from '@libs/PolicyUtils'; import updateMultilineInputRange from '@libs/updateMultilineInputRange'; import type {SettingsNavigatorParamList} from '@navigation/types'; From 50798ab62c204738db251500d716217accc26d70 Mon Sep 17 00:00:00 2001 From: cretadn22 Date: Wed, 10 Jul 2024 22:29:00 +0700 Subject: [PATCH 10/40] update state correctly --- src/components/PopoverMenu.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/PopoverMenu.tsx b/src/components/PopoverMenu.tsx index 0f97a3c4414f..7874a7859da3 100644 --- a/src/components/PopoverMenu.tsx +++ b/src/components/PopoverMenu.tsx @@ -158,7 +158,7 @@ function PopoverMenu({ onPress={() => { setCurrentMenuItems(previousMenuItems); setFocusedIndex(-1); - enteredSubMenuIndexes.splice(-1); + setEnteredSubMenuIndexes((prevState) => prevState.slice(0, -1)) }} /> ); From 9676f602aaf21d1c158056aca0cae7530f4de4e6 Mon Sep 17 00:00:00 2001 From: cretadn22 Date: Wed, 10 Jul 2024 23:21:52 +0700 Subject: [PATCH 11/40] fix errors --- src/components/PopoverMenu.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/PopoverMenu.tsx b/src/components/PopoverMenu.tsx index 7874a7859da3..b08351af5430 100644 --- a/src/components/PopoverMenu.tsx +++ b/src/components/PopoverMenu.tsx @@ -158,7 +158,7 @@ function PopoverMenu({ onPress={() => { setCurrentMenuItems(previousMenuItems); setFocusedIndex(-1); - setEnteredSubMenuIndexes((prevState) => prevState.slice(0, -1)) + setEnteredSubMenuIndexes((prevState) => prevState.slice(0, -1)); }} /> ); From 0cd568566a0c32ee8cf8aced860af89bf1b0a680 Mon Sep 17 00:00:00 2001 From: Taras Perun Date: Thu, 11 Jul 2024 13:14:42 +0200 Subject: [PATCH 12/40] adjust composer expanded height --- src/pages/home/report/ReportActionsList.tsx | 2 +- src/styles/index.ts | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/pages/home/report/ReportActionsList.tsx b/src/pages/home/report/ReportActionsList.tsx index 9945eeb7fb4f..1f846e29955f 100644 --- a/src/pages/home/report/ReportActionsList.tsx +++ b/src/pages/home/report/ReportActionsList.tsx @@ -679,7 +679,7 @@ function ReportActionsList({ isActive={(isFloatingMessageCounterVisible && !!currentUnreadMarker) || canScrollToNewerComments} onClick={scrollToBottomAndMarkReportAsRead} /> - + }, chatFooterFullCompose: { - flex: 1, + height: '100%', + paddingTop: 20, }, chatItemDraft: { From 06faee8306f321bd88265c255f9015c39bc059ca Mon Sep 17 00:00:00 2001 From: cretadn22 Date: Sat, 13 Jul 2024 16:15:50 +0700 Subject: [PATCH 13/40] render header text --- src/components/PopoverMenu.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/components/PopoverMenu.tsx b/src/components/PopoverMenu.tsx index b08351af5430..78108a6e97af 100644 --- a/src/components/PopoverMenu.tsx +++ b/src/components/PopoverMenu.tsx @@ -164,6 +164,13 @@ function PopoverMenu({ ); }; + const renderHeaderText = () => { + if (!headerText || enteredSubMenuIndexes.length !== 0) { + return; + } + return {headerText}; + }; + useKeyboardShortcut( CONST.KEYBOARD_SHORTCUTS.ENTER, () => { @@ -215,7 +222,7 @@ function PopoverMenu({ > - {!!headerText && enteredSubMenuIndexes.length === 0 && {headerText}} + {renderHeaderText()} {enteredSubMenuIndexes.length > 0 && renderBackButtonItem()} {currentMenuItems.map((item, menuIndex) => ( Date: Sun, 14 Jul 2024 23:09:12 +0700 Subject: [PATCH 14/40] fix workspace name showing previous name when switching from offline to online mode --- src/libs/actions/Policy/Policy.ts | 127 +++++++++++++++++------------- 1 file changed, 74 insertions(+), 53 deletions(-) diff --git a/src/libs/actions/Policy/Policy.ts b/src/libs/actions/Policy/Policy.ts index e5ebe2281a94..79cb673cdea3 100644 --- a/src/libs/actions/Policy/Policy.ts +++ b/src/libs/actions/Policy/Policy.ts @@ -55,6 +55,7 @@ import * as ReportConnection from '@libs/ReportConnection'; import * as ReportUtils from '@libs/ReportUtils'; import * as TransactionUtils from '@libs/TransactionUtils'; import type {PolicySelector} from '@pages/home/sidebar/SidebarScreen/FloatingActionButtonAndPopover'; +import * as PersistedRequests from '@userActions/PersistedRequests'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; import type {InvitedEmailsToAccountIDs, PersonalDetailsList, Policy, PolicyCategory, ReimbursementAccount, Report, ReportAction, TaxRatesWithDefault, Transaction} from '@src/types/onyx'; @@ -1067,6 +1068,26 @@ function updateGeneralSettings(policyID: string, name: string, currencyValue?: s currency, }; + const persistedRequests = PersistedRequests.getAll(); + + persistedRequests.forEach((persistedRequest, requestIndex) => { + const {command, data} = persistedRequest; + + if (command === WRITE_COMMANDS.CREATE_WORKSPACE && data?.policyID === policyID) { + if (data.policyName !== name) { + const updatedRequest = { + ...persistedRequest, + data: { + ...data, + policyName: name, + }, + }; + + PersistedRequests.update(requestIndex, updatedRequest); + } + } + }); + API.write(WRITE_COMMANDS.UPDATE_WORKSPACE_GENERAL_SETTINGS, params, { optimisticData, finallyData, @@ -3076,75 +3097,75 @@ function getPoliciesConnectedToSageIntacct(): Policy[] { } export { - leaveWorkspace, addBillingCardAndRequestPolicyOwnerChange, - hasActiveChatEnabledPolicies, - setWorkspaceErrors, + buildPolicyData, + clearAvatarErrors, clearCustomUnitErrors, - hideWorkspaceAlertMessage, - deleteWorkspace, - updateAddress, - updateWorkspaceCustomUnitAndRate, - updateLastAccessedWorkspace, clearDeleteWorkspaceError, - openWorkspaceReimburseView, - setPolicyIDForReimburseView, + clearErrors, + clearNetSuiteAutoSyncErrorField, + clearNetSuiteErrorField, clearOnyxDataForReimburseView, - setRateForReimburseView, - setUnitForReimburseView, - generateDefaultWorkspaceName, - updateGeneralSettings, - deleteWorkspaceAvatar, - updateWorkspaceAvatar, - clearAvatarErrors, - generatePolicyID, + clearPolicyErrorField, + clearQBOErrorField, + clearSageIntacctErrorField, + clearWorkspaceReimbursementErrors, + clearXeroErrorField, + createDraftInitialWorkspace, + createDraftWorkspace, + createPolicyExpenseChats, createWorkspace, - openPolicyTaxesPage, - openWorkspaceInvitePage, - openWorkspace, - removeWorkspace, createWorkspaceFromIOUPayment, - clearErrors, + deleteWorkspace, + deleteWorkspaceAvatar, dismissAddedWithPrimaryLoginMessages, - openDraftWorkspaceRequest, - createDraftInitialWorkspace, - setWorkspaceInviteMessageDraft, - setWorkspaceApprovalMode, - setWorkspaceAutoReportingFrequency, - setWorkspaceAutoReportingMonthlyOffset, - updateWorkspaceDescription, - setWorkspacePayer, - setWorkspaceReimbursement, - openPolicyWorkflowsPage, + enableDistanceRequestTax, + enableExpensifyCard, enablePolicyConnections, enablePolicyReportFields, enablePolicyTaxes, enablePolicyWorkflows, - enableDistanceRequestTax, + generateCustomUnitID, + generateDefaultWorkspaceName, + generatePolicyID, + getPoliciesConnectedToSageIntacct, + getPrimaryPolicy, + hasActiveChatEnabledPolicies, + hideWorkspaceAlertMessage, + isCurrencySupportedForDirectReimbursement, + leaveWorkspace, + openDraftWorkspaceRequest, + openPolicyExpensifyCardsPage, + openPolicyInitialPage, openPolicyMoreFeaturesPage, openPolicyProfilePage, - openPolicyInitialPage, - generateCustomUnitID, - clearQBOErrorField, - clearXeroErrorField, - clearNetSuiteErrorField, - clearNetSuiteAutoSyncErrorField, - clearWorkspaceReimbursementErrors, - setWorkspaceCurrencyDefault, + openPolicyTaxesPage, + openPolicyWorkflowsPage, + openWorkspace, + openWorkspaceInvitePage, + openWorkspaceReimburseView, + removeWorkspace, + requestExpensifyCardLimitIncrease, setForeignCurrencyDefault, setPolicyCustomTaxName, - clearPolicyErrorField, - isCurrencySupportedForDirectReimbursement, - getPrimaryPolicy, - createDraftWorkspace, - buildPolicyData, - enableExpensifyCard, - createPolicyExpenseChats, + setPolicyIDForReimburseView, + setRateForReimburseView, + setUnitForReimburseView, + setWorkspaceApprovalMode, + setWorkspaceAutoReportingFrequency, + setWorkspaceAutoReportingMonthlyOffset, + setWorkspaceCurrencyDefault, + setWorkspaceErrors, + setWorkspaceInviteMessageDraft, + setWorkspacePayer, + setWorkspaceReimbursement, + updateAddress, + updateGeneralSettings, + updateLastAccessedWorkspace, + updateWorkspaceAvatar, + updateWorkspaceCustomUnitAndRate, + updateWorkspaceDescription, upgradeToCorporate, - openPolicyExpensifyCardsPage, - requestExpensifyCardLimitIncrease, - getPoliciesConnectedToSageIntacct, - clearSageIntacctErrorField, }; export type {NewCustomUnit}; From 7010100f69259dcf17c4e57e50cc708c0df0212e Mon Sep 17 00:00:00 2001 From: krishna2323 Date: Mon, 15 Jul 2024 02:54:07 +0530 Subject: [PATCH 15/40] remove scale bar. Signed-off-by: krishna2323 --- src/components/MapView/MapView.tsx | 5 +++-- src/styles/utils/positioning.ts | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/components/MapView/MapView.tsx b/src/components/MapView/MapView.tsx index b42714a7f2f0..5adbf1933008 100644 --- a/src/components/MapView/MapView.tsx +++ b/src/components/MapView/MapView.tsx @@ -213,9 +213,10 @@ const MapView = forwardRef( onTouchStart={() => setUserInteractedWithMap(true)} pitchEnabled={pitchEnabled} attributionPosition={{...styles.r2, ...styles.b2}} - scaleBarEnabled + scaleBarEnabled={false} + scaleBarPosition={{...styles.tn8, left: 0}} compassEnabled - compassPosition={{...styles.l2, ...styles.t8}} + compassPosition={{...styles.l2, ...styles.t5}} logoPosition={{...styles.l2, ...styles.b2}} // eslint-disable-next-line react/jsx-props-no-spreading {...responder.panHandlers} diff --git a/src/styles/utils/positioning.ts b/src/styles/utils/positioning.ts index 6731b0ebc58f..c266a7469bc2 100644 --- a/src/styles/utils/positioning.ts +++ b/src/styles/utils/positioning.ts @@ -22,8 +22,8 @@ export default { t0: { top: 0, }, - t8: { - top: 32, + t5: { + top: 20, }, tn4: { top: -16, From d43f443e864705f4dc0a557a3b2df7985f94d6e0 Mon Sep 17 00:00:00 2001 From: krishna2323 Date: Mon, 15 Jul 2024 02:55:53 +0530 Subject: [PATCH 16/40] add comment. Signed-off-by: krishna2323 --- src/components/MapView/MapView.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/MapView/MapView.tsx b/src/components/MapView/MapView.tsx index 5adbf1933008..dd74f91f6ee9 100644 --- a/src/components/MapView/MapView.tsx +++ b/src/components/MapView/MapView.tsx @@ -214,6 +214,7 @@ const MapView = forwardRef( pitchEnabled={pitchEnabled} attributionPosition={{...styles.r2, ...styles.b2}} scaleBarEnabled={false} + // scaleBarEnabled={false} will not work on iOS, top: -32 is to hide the scale bar on iOS scaleBarPosition={{...styles.tn8, left: 0}} compassEnabled compassPosition={{...styles.l2, ...styles.t5}} From b2ab21a0fbddf02f1db26a077cd19d66a517a529 Mon Sep 17 00:00:00 2001 From: Huu Le Date: Mon, 15 Jul 2024 10:55:46 +0700 Subject: [PATCH 17/40] add condition to check if currency is updated --- src/libs/actions/Policy/Policy.ts | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/libs/actions/Policy/Policy.ts b/src/libs/actions/Policy/Policy.ts index 79cb673cdea3..a5afbb7d11b8 100644 --- a/src/libs/actions/Policy/Policy.ts +++ b/src/libs/actions/Policy/Policy.ts @@ -1070,20 +1070,23 @@ function updateGeneralSettings(policyID: string, name: string, currencyValue?: s const persistedRequests = PersistedRequests.getAll(); - persistedRequests.forEach((persistedRequest, requestIndex) => { - const {command, data} = persistedRequest; + persistedRequests.forEach((request, index) => { + const {command, data} = request; if (command === WRITE_COMMANDS.CREATE_WORKSPACE && data?.policyID === policyID) { - if (data.policyName !== name) { + const policyNameChanged = data.policyName !== name; + const outputCurrencyChanged = data.outputCurrency !== currency; + + if (policyNameChanged || outputCurrencyChanged) { const updatedRequest = { - ...persistedRequest, + ...request, data: { ...data, - policyName: name, + policyName: policyNameChanged ? name : data.policyName, + outputCurrency: outputCurrencyChanged ? currency : data.outputCurrency, }, }; - - PersistedRequests.update(requestIndex, updatedRequest); + PersistedRequests.update(index, updatedRequest); } } }); From 14aeacf8bc6ea45b2d54b9485db45d97c1247455 Mon Sep 17 00:00:00 2001 From: Shridhar Goel <35566748+ShridharGoel@users.noreply.github.com> Date: Mon, 15 Jul 2024 19:57:30 +0530 Subject: [PATCH 18/40] Update splash to use same logo size in web and mobile --- web/index.html | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/web/index.html b/web/index.html index acccbbe4f442..384868af1a51 100644 --- a/web/index.html +++ b/web/index.html @@ -81,20 +81,13 @@ transition: transform var(--label-transition-duration); } - @media screen and (min-width: 480px) { + @media screen { .splash-logo > svg { width: 104px; height: 104px; } } - @media screen and (max-width: 479px) { - .splash-logo > svg { - width: 52px; - height: 52px; - } - } - #splash { position: absolute; bottom: 0; From a1a38327c9c2867d35a603fea7de5c2225db69fb Mon Sep 17 00:00:00 2001 From: Huu Le Date: Tue, 16 Jul 2024 00:04:11 +0700 Subject: [PATCH 19/40] Update policy and currency condition names --- src/libs/actions/Policy/Policy.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/libs/actions/Policy/Policy.ts b/src/libs/actions/Policy/Policy.ts index a5afbb7d11b8..23cdb1c7c921 100644 --- a/src/libs/actions/Policy/Policy.ts +++ b/src/libs/actions/Policy/Policy.ts @@ -1074,16 +1074,16 @@ function updateGeneralSettings(policyID: string, name: string, currencyValue?: s const {command, data} = request; if (command === WRITE_COMMANDS.CREATE_WORKSPACE && data?.policyID === policyID) { - const policyNameChanged = data.policyName !== name; - const outputCurrencyChanged = data.outputCurrency !== currency; + const isPolicyNameChanged = data.policyName !== name; + const isCurrencyChanged = data.outputCurrency !== currency; - if (policyNameChanged || outputCurrencyChanged) { + if (isPolicyNameChanged || isCurrencyChanged) { const updatedRequest = { ...request, data: { ...data, - policyName: policyNameChanged ? name : data.policyName, - outputCurrency: outputCurrencyChanged ? currency : data.outputCurrency, + policyName: isPolicyNameChanged ? name : data.policyName, + outputCurrency: isCurrencyChanged ? currency : data.outputCurrency, }, }; PersistedRequests.update(index, updatedRequest); From f3e18e32edb2c891567405e53bab4675896f9c0c Mon Sep 17 00:00:00 2001 From: krishna2323 Date: Mon, 15 Jul 2024 19:03:39 +0530 Subject: [PATCH 20/40] fix: Connect bank - -1 is pre-filled for the tax ID number when connecting a new bank account. Signed-off-by: krishna2323 --- .../BusinessInfo/substeps/TaxIdBusiness.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/ReimbursementAccount/BusinessInfo/substeps/TaxIdBusiness.tsx b/src/pages/ReimbursementAccount/BusinessInfo/substeps/TaxIdBusiness.tsx index 2063211f41f4..8e3ec6d5ec6e 100644 --- a/src/pages/ReimbursementAccount/BusinessInfo/substeps/TaxIdBusiness.tsx +++ b/src/pages/ReimbursementAccount/BusinessInfo/substeps/TaxIdBusiness.tsx @@ -28,8 +28,8 @@ const STEP_FIELDS = [COMPANY_TAX_ID_KEY]; function TaxIdBusiness({reimbursementAccount, onNext, isEditing}: TaxIdBusinessProps) { const {translate} = useLocalize(); const styles = useThemeStyles(); - const defaultCompanyTaxId = reimbursementAccount?.achData?.companyTaxID ?? '-1'; - const bankAccountID = reimbursementAccount?.achData?.bankAccountID ?? -1; + const defaultCompanyTaxId = reimbursementAccount?.achData?.companyTaxID ?? ''; + const bankAccountID = reimbursementAccount?.achData?.bankAccountID ?? 0; const shouldDisableCompanyTaxID = !!(bankAccountID && defaultCompanyTaxId && reimbursementAccount?.achData?.state !== 'SETUP'); const validate = useCallback( From c4b78bad2384ddde15b0002f26da367e1cb80893 Mon Sep 17 00:00:00 2001 From: Bernhard Owen Josephus Date: Thu, 11 Jul 2024 12:43:51 +0800 Subject: [PATCH 21/40] optimistically update the policy current user employee info --- src/libs/actions/User.ts | 11 ++++++++++- .../Profile/Contacts/ContactMethodDetailsPage.tsx | 3 ++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/libs/actions/User.ts b/src/libs/actions/User.ts index 7b3b1abd04ef..8b5937363bc5 100644 --- a/src/libs/actions/User.ts +++ b/src/libs/actions/User.ts @@ -765,7 +765,7 @@ function generateStatementPDF(period: string) { /** * Sets a contact method / secondary login as the user's "Default" contact method. */ -function setContactMethodAsDefault(newDefaultContactMethod: string, policies: OnyxCollection>) { +function setContactMethodAsDefault(newDefaultContactMethod: string, policies: OnyxCollection>) { const oldDefaultContactMethod = currentEmail; const optimisticData: OnyxUpdate[] = [ { @@ -862,11 +862,16 @@ function setContactMethodAsDefault(newDefaultContactMethod: string, policies: On if (policy?.ownerAccountID !== currentUserAccountID) { return; } + const currentEmployee = policy.employeeList?.[oldDefaultContactMethod] ?? {role: 'admin'}; optimisticData.push({ onyxMethod: Onyx.METHOD.MERGE, key: `${ONYXKEYS.COLLECTION.POLICY}${policy.id}`, value: { owner: newDefaultContactMethod, + employeeList: { + [oldDefaultContactMethod]: null, + [newDefaultContactMethod]: currentEmployee, + }, }, }); failureData.push({ @@ -874,6 +879,10 @@ function setContactMethodAsDefault(newDefaultContactMethod: string, policies: On key: `${ONYXKEYS.COLLECTION.POLICY}${policy.id}`, value: { owner: policy.owner, + employeeList: { + [oldDefaultContactMethod]: currentEmployee, + [newDefaultContactMethod]: null, + }, }, }); }); diff --git a/src/pages/settings/Profile/Contacts/ContactMethodDetailsPage.tsx b/src/pages/settings/Profile/Contacts/ContactMethodDetailsPage.tsx index 393b377869df..9a02c0fef67e 100644 --- a/src/pages/settings/Profile/Contacts/ContactMethodDetailsPage.tsx +++ b/src/pages/settings/Profile/Contacts/ContactMethodDetailsPage.tsx @@ -34,10 +34,11 @@ import isLoadingOnyxValue from '@src/types/utils/isLoadingOnyxValue'; import ValidateCodeForm from './ValidateCodeForm'; import type {ValidateCodeFormHandle} from './ValidateCodeForm/BaseValidateCodeForm'; -const policiesSelector = (policy: OnyxEntry): Pick => ({ +const policiesSelector = (policy: OnyxEntry): Pick => ({ id: policy?.id ?? '-1', ownerAccountID: policy?.ownerAccountID, owner: policy?.owner ?? '', + employeeList: policy?.employeeList, }); type ContactMethodDetailsPageProps = StackScreenProps; From 164e4cb1b37fbb1ee1cc977efb1ee87b56f57903 Mon Sep 17 00:00:00 2001 From: Bernhard Owen Josephus Date: Thu, 11 Jul 2024 19:46:24 +0800 Subject: [PATCH 22/40] update all policy employee list too --- src/libs/actions/User.ts | 52 +++++++++++++++++++++++++++------------- 1 file changed, 36 insertions(+), 16 deletions(-) diff --git a/src/libs/actions/User.ts b/src/libs/actions/User.ts index 8b5937363bc5..3019e3dfbb6c 100644 --- a/src/libs/actions/User.ts +++ b/src/libs/actions/User.ts @@ -859,32 +859,52 @@ function setContactMethodAsDefault(newDefaultContactMethod: string, policies: On ]; Object.values(policies ?? {}).forEach((policy) => { - if (policy?.ownerAccountID !== currentUserAccountID) { + if (!policy) { return; } - const currentEmployee = policy.employeeList?.[oldDefaultContactMethod] ?? {role: 'admin'}; - optimisticData.push({ - onyxMethod: Onyx.METHOD.MERGE, - key: `${ONYXKEYS.COLLECTION.POLICY}${policy.id}`, - value: { - owner: newDefaultContactMethod, + + let optimisticPolicyDataValue; + let failurePolicyDataValue; + + if (policy.employeeList) { + const currentEmployee = policy.employeeList[oldDefaultContactMethod]; + optimisticPolicyDataValue = { employeeList: { [oldDefaultContactMethod]: null, [newDefaultContactMethod]: currentEmployee, }, - }, - }); - failureData.push({ - onyxMethod: Onyx.METHOD.MERGE, - key: `${ONYXKEYS.COLLECTION.POLICY}${policy.id}`, - value: { - owner: policy.owner, + }; + failurePolicyDataValue = { employeeList: { [oldDefaultContactMethod]: currentEmployee, [newDefaultContactMethod]: null, }, - }, - }); + }; + } + + if (policy.ownerAccountID === currentUserAccountID) { + optimisticPolicyDataValue = { + ...optimisticPolicyDataValue, + owner: newDefaultContactMethod, + }; + failurePolicyDataValue = { + ...failurePolicyDataValue, + owner: policy.owner, + }; + } + + if (optimisticPolicyDataValue && failurePolicyDataValue) { + optimisticData.push({ + onyxMethod: Onyx.METHOD.MERGE, + key: `${ONYXKEYS.COLLECTION.POLICY}${policy.id}`, + value: optimisticPolicyDataValue, + }); + failureData.push({ + onyxMethod: Onyx.METHOD.MERGE, + key: `${ONYXKEYS.COLLECTION.POLICY}${policy.id}`, + value: failurePolicyDataValue, + }); + } }); const parameters: SetContactMethodAsDefaultParams = { partnerUserID: newDefaultContactMethod, From 681ce0de39426cea84fd7ef7ea39add6eab5fc90 Mon Sep 17 00:00:00 2001 From: Huu Le Date: Sun, 14 Jul 2024 23:09:12 +0700 Subject: [PATCH 23/40] fix workspace name showing previous name when switching from offline to online mode --- src/libs/actions/Policy/Policy.ts | 58 +++++++++++++++++++++---------- 1 file changed, 40 insertions(+), 18 deletions(-) diff --git a/src/libs/actions/Policy/Policy.ts b/src/libs/actions/Policy/Policy.ts index 5c63d1030642..c1d11680a73d 100644 --- a/src/libs/actions/Policy/Policy.ts +++ b/src/libs/actions/Policy/Policy.ts @@ -1,9 +1,3 @@ -import {PUBLIC_DOMAINS, Str} from 'expensify-common'; -import {escapeRegExp} from 'lodash'; -import lodashClone from 'lodash/clone'; -import type {NullishDeep, OnyxCollection, OnyxEntry, OnyxUpdate} from 'react-native-onyx'; -import Onyx from 'react-native-onyx'; -import type {ValueOf} from 'type-fest'; import * as API from '@libs/API'; import type { AddBillingCardAndRequestWorkspaceOwnerChangeParams, @@ -40,7 +34,7 @@ import type { UpgradeToCorporateParams, } from '@libs/API/parameters'; import type UpdatePolicyAddressParams from '@libs/API/parameters/UpdatePolicyAddressParams'; -import {READ_COMMANDS, WRITE_COMMANDS} from '@libs/API/types'; +import { READ_COMMANDS, WRITE_COMMANDS } from '@libs/API/types'; import DateUtils from '@libs/DateUtils'; import * as ErrorUtils from '@libs/ErrorUtils'; import getIsNarrowLayout from '@libs/getIsNarrowLayout'; @@ -49,21 +43,27 @@ import * as NetworkStore from '@libs/Network/NetworkStore'; import * as NumberUtils from '@libs/NumberUtils'; import * as PhoneNumber from '@libs/PhoneNumber'; import * as PolicyUtils from '@libs/PolicyUtils'; -import {navigateWhenEnableFeature} from '@libs/PolicyUtils'; +import { navigateWhenEnableFeature } from '@libs/PolicyUtils'; import * as ReportActionsUtils from '@libs/ReportActionsUtils'; import * as ReportConnection from '@libs/ReportConnection'; import * as ReportUtils from '@libs/ReportUtils'; import * as TransactionUtils from '@libs/TransactionUtils'; -import type {PolicySelector} from '@pages/home/sidebar/SidebarScreen/FloatingActionButtonAndPopover'; -import * as PersistedRequests from '@userActions/PersistedRequests'; +import type { PolicySelector } from '@pages/home/sidebar/SidebarScreen/FloatingActionButtonAndPopover'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; -import type {InvitedEmailsToAccountIDs, PersonalDetailsList, Policy, PolicyCategory, ReimbursementAccount, Report, ReportAction, TaxRatesWithDefault, Transaction} from '@src/types/onyx'; -import type {Errors} from '@src/types/onyx/OnyxCommon'; -import type {Attributes, CompanyAddress, CustomUnit, Rate, TaxRate, Unit} from '@src/types/onyx/Policy'; -import type {OnyxData} from '@src/types/onyx/Request'; -import {isEmptyObject} from '@src/types/utils/EmptyObject'; -import {buildOptimisticPolicyCategories} from './Category'; +import type { InvitedEmailsToAccountIDs, PersonalDetailsList, Policy, PolicyCategory, ReimbursementAccount, Report, ReportAction, TaxRatesWithDefault, Transaction } from '@src/types/onyx'; +import type { Errors } from '@src/types/onyx/OnyxCommon'; +import type { Attributes, CompanyAddress, CustomUnit, Rate, TaxRate, Unit } from '@src/types/onyx/Policy'; +import type { OnyxData } from '@src/types/onyx/Request'; +import { isEmptyObject } from '@src/types/utils/EmptyObject'; +import * as PersistedRequests from '@userActions/PersistedRequests'; +import { PUBLIC_DOMAINS, Str } from 'expensify-common'; +import { escapeRegExp } from 'lodash'; +import lodashClone from 'lodash/clone'; +import type { NullishDeep, OnyxCollection, OnyxEntry, OnyxUpdate } from 'react-native-onyx'; +import Onyx from 'react-native-onyx'; +import type { ValueOf } from 'type-fest'; +import { buildOptimisticPolicyCategories } from './Category'; type ReportCreationData = Record< string, @@ -3106,6 +3106,7 @@ export { clearCustomUnitErrors, clearDeleteWorkspaceError, clearErrors, + clearNetSuiteAutoSyncErrorField, clearNetSuiteErrorField, clearOnyxDataForReimburseView, @@ -3115,6 +3116,11 @@ export { clearWorkspaceReimbursementErrors, clearXeroErrorField, createDraftInitialWorkspace, + + + + + createDraftWorkspace, createPolicyExpenseChats, createWorkspace, @@ -3128,16 +3134,22 @@ export { enablePolicyReportFields, enablePolicyTaxes, enablePolicyWorkflows, + generateCustomUnitID, generateDefaultWorkspaceName, generatePolicyID, getAdminPoliciesConnectedToSageIntacct, + + + + getPrimaryPolicy, hasActiveChatEnabledPolicies, hideWorkspaceAlertMessage, isCurrencySupportedForDirectReimbursement, leaveWorkspace, openDraftWorkspaceRequest, + openPolicyExpensifyCardsPage, openPolicyInitialPage, openPolicyMoreFeaturesPage, @@ -3150,14 +3162,22 @@ export { removeWorkspace, requestExpensifyCardLimitIncrease, setForeignCurrencyDefault, + + + + setPolicyCustomTaxName, setPolicyIDForReimburseView, setRateForReimburseView, setUnitForReimburseView, setWorkspaceApprovalMode, setWorkspaceAutoReportingFrequency, + setWorkspaceAutoReportingMonthlyOffset, setWorkspaceCurrencyDefault, + + + setWorkspaceErrors, setWorkspaceInviteMessageDraft, setWorkspacePayer, @@ -3168,7 +3188,9 @@ export { updateWorkspaceAvatar, updateWorkspaceCustomUnitAndRate, updateWorkspaceDescription, - upgradeToCorporate, + + upgradeToCorporate }; -export type {NewCustomUnit}; + export type { NewCustomUnit }; + From 062e56b5b6293daec2da2169ecbfb8d08430887e Mon Sep 17 00:00:00 2001 From: Huu Le Date: Mon, 15 Jul 2024 10:55:46 +0700 Subject: [PATCH 24/40] add condition to check if currency is updated From c822da9bd98c1a207be9f5a6fda7cdc601aa5914 Mon Sep 17 00:00:00 2001 From: Huu Le Date: Sun, 14 Jul 2024 23:09:12 +0700 Subject: [PATCH 25/40] fix workspace name showing previous name when switching from offline to online mode --- src/libs/actions/Policy/Policy.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/libs/actions/Policy/Policy.ts b/src/libs/actions/Policy/Policy.ts index c1d11680a73d..7a3c6f24c406 100644 --- a/src/libs/actions/Policy/Policy.ts +++ b/src/libs/actions/Policy/Policy.ts @@ -3188,7 +3188,6 @@ export { updateWorkspaceAvatar, updateWorkspaceCustomUnitAndRate, updateWorkspaceDescription, - upgradeToCorporate }; From 6287e159e1dadf07651a74cf2afaf9fe6ca6139d Mon Sep 17 00:00:00 2001 From: Huu Le Date: Tue, 16 Jul 2024 01:21:48 +0700 Subject: [PATCH 26/40] fix lint --- src/libs/actions/Policy/Policy.ts | 57 ++++++++++--------------------- 1 file changed, 18 insertions(+), 39 deletions(-) diff --git a/src/libs/actions/Policy/Policy.ts b/src/libs/actions/Policy/Policy.ts index 7a3c6f24c406..5c63d1030642 100644 --- a/src/libs/actions/Policy/Policy.ts +++ b/src/libs/actions/Policy/Policy.ts @@ -1,3 +1,9 @@ +import {PUBLIC_DOMAINS, Str} from 'expensify-common'; +import {escapeRegExp} from 'lodash'; +import lodashClone from 'lodash/clone'; +import type {NullishDeep, OnyxCollection, OnyxEntry, OnyxUpdate} from 'react-native-onyx'; +import Onyx from 'react-native-onyx'; +import type {ValueOf} from 'type-fest'; import * as API from '@libs/API'; import type { AddBillingCardAndRequestWorkspaceOwnerChangeParams, @@ -34,7 +40,7 @@ import type { UpgradeToCorporateParams, } from '@libs/API/parameters'; import type UpdatePolicyAddressParams from '@libs/API/parameters/UpdatePolicyAddressParams'; -import { READ_COMMANDS, WRITE_COMMANDS } from '@libs/API/types'; +import {READ_COMMANDS, WRITE_COMMANDS} from '@libs/API/types'; import DateUtils from '@libs/DateUtils'; import * as ErrorUtils from '@libs/ErrorUtils'; import getIsNarrowLayout from '@libs/getIsNarrowLayout'; @@ -43,27 +49,21 @@ import * as NetworkStore from '@libs/Network/NetworkStore'; import * as NumberUtils from '@libs/NumberUtils'; import * as PhoneNumber from '@libs/PhoneNumber'; import * as PolicyUtils from '@libs/PolicyUtils'; -import { navigateWhenEnableFeature } from '@libs/PolicyUtils'; +import {navigateWhenEnableFeature} from '@libs/PolicyUtils'; import * as ReportActionsUtils from '@libs/ReportActionsUtils'; import * as ReportConnection from '@libs/ReportConnection'; import * as ReportUtils from '@libs/ReportUtils'; import * as TransactionUtils from '@libs/TransactionUtils'; -import type { PolicySelector } from '@pages/home/sidebar/SidebarScreen/FloatingActionButtonAndPopover'; +import type {PolicySelector} from '@pages/home/sidebar/SidebarScreen/FloatingActionButtonAndPopover'; +import * as PersistedRequests from '@userActions/PersistedRequests'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; -import type { InvitedEmailsToAccountIDs, PersonalDetailsList, Policy, PolicyCategory, ReimbursementAccount, Report, ReportAction, TaxRatesWithDefault, Transaction } from '@src/types/onyx'; -import type { Errors } from '@src/types/onyx/OnyxCommon'; -import type { Attributes, CompanyAddress, CustomUnit, Rate, TaxRate, Unit } from '@src/types/onyx/Policy'; -import type { OnyxData } from '@src/types/onyx/Request'; -import { isEmptyObject } from '@src/types/utils/EmptyObject'; -import * as PersistedRequests from '@userActions/PersistedRequests'; -import { PUBLIC_DOMAINS, Str } from 'expensify-common'; -import { escapeRegExp } from 'lodash'; -import lodashClone from 'lodash/clone'; -import type { NullishDeep, OnyxCollection, OnyxEntry, OnyxUpdate } from 'react-native-onyx'; -import Onyx from 'react-native-onyx'; -import type { ValueOf } from 'type-fest'; -import { buildOptimisticPolicyCategories } from './Category'; +import type {InvitedEmailsToAccountIDs, PersonalDetailsList, Policy, PolicyCategory, ReimbursementAccount, Report, ReportAction, TaxRatesWithDefault, Transaction} from '@src/types/onyx'; +import type {Errors} from '@src/types/onyx/OnyxCommon'; +import type {Attributes, CompanyAddress, CustomUnit, Rate, TaxRate, Unit} from '@src/types/onyx/Policy'; +import type {OnyxData} from '@src/types/onyx/Request'; +import {isEmptyObject} from '@src/types/utils/EmptyObject'; +import {buildOptimisticPolicyCategories} from './Category'; type ReportCreationData = Record< string, @@ -3106,7 +3106,6 @@ export { clearCustomUnitErrors, clearDeleteWorkspaceError, clearErrors, - clearNetSuiteAutoSyncErrorField, clearNetSuiteErrorField, clearOnyxDataForReimburseView, @@ -3116,11 +3115,6 @@ export { clearWorkspaceReimbursementErrors, clearXeroErrorField, createDraftInitialWorkspace, - - - - - createDraftWorkspace, createPolicyExpenseChats, createWorkspace, @@ -3134,22 +3128,16 @@ export { enablePolicyReportFields, enablePolicyTaxes, enablePolicyWorkflows, - generateCustomUnitID, generateDefaultWorkspaceName, generatePolicyID, getAdminPoliciesConnectedToSageIntacct, - - - - getPrimaryPolicy, hasActiveChatEnabledPolicies, hideWorkspaceAlertMessage, isCurrencySupportedForDirectReimbursement, leaveWorkspace, openDraftWorkspaceRequest, - openPolicyExpensifyCardsPage, openPolicyInitialPage, openPolicyMoreFeaturesPage, @@ -3162,22 +3150,14 @@ export { removeWorkspace, requestExpensifyCardLimitIncrease, setForeignCurrencyDefault, - - - - setPolicyCustomTaxName, setPolicyIDForReimburseView, setRateForReimburseView, setUnitForReimburseView, setWorkspaceApprovalMode, setWorkspaceAutoReportingFrequency, - setWorkspaceAutoReportingMonthlyOffset, setWorkspaceCurrencyDefault, - - - setWorkspaceErrors, setWorkspaceInviteMessageDraft, setWorkspacePayer, @@ -3188,8 +3168,7 @@ export { updateWorkspaceAvatar, updateWorkspaceCustomUnitAndRate, updateWorkspaceDescription, - upgradeToCorporate + upgradeToCorporate, }; - export type { NewCustomUnit }; - +export type {NewCustomUnit}; From 2a77d9c9ac09fcac2ba4626ee93e140b06db8b7b Mon Sep 17 00:00:00 2001 From: Abdelrahman Khattab Date: Mon, 15 Jul 2024 23:06:31 +0200 Subject: [PATCH 27/40] minor edit --- src/pages/iou/MoneyRequestAmountForm.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/iou/MoneyRequestAmountForm.tsx b/src/pages/iou/MoneyRequestAmountForm.tsx index 31ac5bf46af2..f03b4638c83f 100644 --- a/src/pages/iou/MoneyRequestAmountForm.tsx +++ b/src/pages/iou/MoneyRequestAmountForm.tsx @@ -164,7 +164,7 @@ function MoneyRequestAmountForm( if (!currency || typeof amount !== 'number') { return; } - initializeAmount(amount, currency); + initializeAmount(amount); // we want to re-initialize the state only when the selected tab // eslint-disable-next-line react-compiler/react-compiler, react-hooks/exhaustive-deps }, [selectedTab]); From 4c934fc098bdd393c0443e3b1b222719e3f5e78a Mon Sep 17 00:00:00 2001 From: Abdelrahman Khattab Date: Tue, 16 Jul 2024 00:13:10 +0200 Subject: [PATCH 28/40] making currency as required --- src/components/MoneyRequestAmountInput.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/MoneyRequestAmountInput.tsx b/src/components/MoneyRequestAmountInput.tsx index fa7863e52eb5..ed5dbbdf06d5 100644 --- a/src/components/MoneyRequestAmountInput.tsx +++ b/src/components/MoneyRequestAmountInput.tsx @@ -106,7 +106,7 @@ const getNewSelection = (oldSelection: Selection, prevLength: number, newLength: return {start: cursorPosition, end: cursorPosition}; }; -const defaultOnFormatAmount = (amount: number, currency?: string) => CurrencyUtils.convertToFrontendAmountAsString(amount, currency ?? CONST.CURRENCY.USD); +const defaultOnFormatAmount = (amount: number, currency: string) => CurrencyUtils.convertToFrontendAmountAsString(amount, currency ?? CONST.CURRENCY.USD); function MoneyRequestAmountInput( { From 9b5c74d74b6d5f8a4fbbd769d820f568732c85c1 Mon Sep 17 00:00:00 2001 From: krishna2323 Date: Tue, 16 Jul 2024 18:34:09 +0530 Subject: [PATCH 29/40] minor update. Signed-off-by: krishna2323 --- src/components/MapView/MapView.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/MapView/MapView.tsx b/src/components/MapView/MapView.tsx index dd74f91f6ee9..59102e55c930 100644 --- a/src/components/MapView/MapView.tsx +++ b/src/components/MapView/MapView.tsx @@ -214,7 +214,7 @@ const MapView = forwardRef( pitchEnabled={pitchEnabled} attributionPosition={{...styles.r2, ...styles.b2}} scaleBarEnabled={false} - // scaleBarEnabled={false} will not work on iOS, top: -32 is to hide the scale bar on iOS + // We use scaleBarPosition with top: -32 to hide the scale bar on iOS because scaleBarEnabled={false} not work on iOS scaleBarPosition={{...styles.tn8, left: 0}} compassEnabled compassPosition={{...styles.l2, ...styles.t5}} From d64e7a6431676e3e9fa336ddd099facbc98a0ed4 Mon Sep 17 00:00:00 2001 From: Huu Le Date: Tue, 16 Jul 2024 22:20:11 +0700 Subject: [PATCH 30/40] revert import order and update variable name for clarity --- src/libs/actions/Policy/Policy.ts | 110 +++++++++++++++--------------- 1 file changed, 55 insertions(+), 55 deletions(-) diff --git a/src/libs/actions/Policy/Policy.ts b/src/libs/actions/Policy/Policy.ts index 5c63d1030642..e8b80968ed70 100644 --- a/src/libs/actions/Policy/Policy.ts +++ b/src/libs/actions/Policy/Policy.ts @@ -1078,7 +1078,7 @@ function updateGeneralSettings(policyID: string, name: string, currencyValue?: s const isCurrencyChanged = data.outputCurrency !== currency; if (isPolicyNameChanged || isCurrencyChanged) { - const updatedRequest = { + const createWorkspaceRequest = { ...request, data: { ...data, @@ -1086,7 +1086,7 @@ function updateGeneralSettings(policyID: string, name: string, currencyValue?: s outputCurrency: isCurrencyChanged ? currency : data.outputCurrency, }, }; - PersistedRequests.update(index, updatedRequest); + PersistedRequests.update(index, createWorkspaceRequest); } } }); @@ -3100,75 +3100,75 @@ function getAdminPoliciesConnectedToSageIntacct(): Policy[] { } export { + leaveWorkspace, addBillingCardAndRequestPolicyOwnerChange, - buildPolicyData, - clearAvatarErrors, + hasActiveChatEnabledPolicies, + setWorkspaceErrors, clearCustomUnitErrors, + hideWorkspaceAlertMessage, + deleteWorkspace, + updateAddress, + updateWorkspaceCustomUnitAndRate, + updateLastAccessedWorkspace, clearDeleteWorkspaceError, - clearErrors, - clearNetSuiteAutoSyncErrorField, - clearNetSuiteErrorField, + openWorkspaceReimburseView, + setPolicyIDForReimburseView, clearOnyxDataForReimburseView, - clearPolicyErrorField, - clearQBOErrorField, - clearSageIntacctErrorField, - clearWorkspaceReimbursementErrors, - clearXeroErrorField, - createDraftInitialWorkspace, - createDraftWorkspace, - createPolicyExpenseChats, + setRateForReimburseView, + setUnitForReimburseView, + generateDefaultWorkspaceName, + updateGeneralSettings, + deleteWorkspaceAvatar, + updateWorkspaceAvatar, + clearAvatarErrors, + generatePolicyID, createWorkspace, + openPolicyTaxesPage, + openWorkspaceInvitePage, + openWorkspace, + removeWorkspace, createWorkspaceFromIOUPayment, - deleteWorkspace, - deleteWorkspaceAvatar, + clearErrors, dismissAddedWithPrimaryLoginMessages, - enableDistanceRequestTax, - enableExpensifyCard, + openDraftWorkspaceRequest, + createDraftInitialWorkspace, + setWorkspaceInviteMessageDraft, + setWorkspaceApprovalMode, + setWorkspaceAutoReportingFrequency, + setWorkspaceAutoReportingMonthlyOffset, + updateWorkspaceDescription, + setWorkspacePayer, + setWorkspaceReimbursement, + openPolicyWorkflowsPage, enablePolicyConnections, enablePolicyReportFields, enablePolicyTaxes, enablePolicyWorkflows, - generateCustomUnitID, - generateDefaultWorkspaceName, - generatePolicyID, - getAdminPoliciesConnectedToSageIntacct, - getPrimaryPolicy, - hasActiveChatEnabledPolicies, - hideWorkspaceAlertMessage, - isCurrencySupportedForDirectReimbursement, - leaveWorkspace, - openDraftWorkspaceRequest, - openPolicyExpensifyCardsPage, - openPolicyInitialPage, + enableDistanceRequestTax, openPolicyMoreFeaturesPage, openPolicyProfilePage, - openPolicyTaxesPage, - openPolicyWorkflowsPage, - openWorkspace, - openWorkspaceInvitePage, - openWorkspaceReimburseView, - removeWorkspace, - requestExpensifyCardLimitIncrease, + openPolicyInitialPage, + generateCustomUnitID, + clearQBOErrorField, + clearXeroErrorField, + clearSageIntacctErrorField, + clearNetSuiteErrorField, + clearNetSuiteAutoSyncErrorField, + clearWorkspaceReimbursementErrors, + setWorkspaceCurrencyDefault, setForeignCurrencyDefault, setPolicyCustomTaxName, - setPolicyIDForReimburseView, - setRateForReimburseView, - setUnitForReimburseView, - setWorkspaceApprovalMode, - setWorkspaceAutoReportingFrequency, - setWorkspaceAutoReportingMonthlyOffset, - setWorkspaceCurrencyDefault, - setWorkspaceErrors, - setWorkspaceInviteMessageDraft, - setWorkspacePayer, - setWorkspaceReimbursement, - updateAddress, - updateGeneralSettings, - updateLastAccessedWorkspace, - updateWorkspaceAvatar, - updateWorkspaceCustomUnitAndRate, - updateWorkspaceDescription, + clearPolicyErrorField, + isCurrencySupportedForDirectReimbursement, + getPrimaryPolicy, + createDraftWorkspace, + buildPolicyData, + enableExpensifyCard, + createPolicyExpenseChats, upgradeToCorporate, + openPolicyExpensifyCardsPage, + requestExpensifyCardLimitIncrease, + getAdminPoliciesConnectedToSageIntacct, }; export type {NewCustomUnit}; From cd4f3067e2ccc34d35c9714ef1c202c706ac34c4 Mon Sep 17 00:00:00 2001 From: Huu Le Date: Tue, 16 Jul 2024 22:37:23 +0700 Subject: [PATCH 31/40] remove update currency --- src/libs/actions/Policy/Policy.ts | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/libs/actions/Policy/Policy.ts b/src/libs/actions/Policy/Policy.ts index e8b80968ed70..8379ad9e9b19 100644 --- a/src/libs/actions/Policy/Policy.ts +++ b/src/libs/actions/Policy/Policy.ts @@ -1073,17 +1073,13 @@ function updateGeneralSettings(policyID: string, name: string, currencyValue?: s persistedRequests.forEach((request, index) => { const {command, data} = request; - if (command === WRITE_COMMANDS.CREATE_WORKSPACE && data?.policyID === policyID) { - const isPolicyNameChanged = data.policyName !== name; - const isCurrencyChanged = data.outputCurrency !== currency; - - if (isPolicyNameChanged || isCurrencyChanged) { + if (command === WRITE_COMMANDS.CREATE_WORKSPACE && data?.policyID === policyID) { + if (data.policyName !== name) { const createWorkspaceRequest = { ...request, data: { ...data, - policyName: isPolicyNameChanged ? name : data.policyName, - outputCurrency: isCurrencyChanged ? currency : data.outputCurrency, + policyName: name, }, }; PersistedRequests.update(index, createWorkspaceRequest); From 49315c3efe5f38f65bee8de2a371cb4eede6b6a5 Mon Sep 17 00:00:00 2001 From: Abdelrahman Khattab <59809993+abzokhattab@users.noreply.github.com> Date: Tue, 16 Jul 2024 17:41:19 +0200 Subject: [PATCH 32/40] Minor Co-authored-by: Daniel Gale-Rosen <5487802+dangrous@users.noreply.github.com> --- src/components/MoneyRequestAmountInput.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/MoneyRequestAmountInput.tsx b/src/components/MoneyRequestAmountInput.tsx index ed5dbbdf06d5..12420dafd87e 100644 --- a/src/components/MoneyRequestAmountInput.tsx +++ b/src/components/MoneyRequestAmountInput.tsx @@ -28,7 +28,7 @@ type MoneyRequestAmountInputProps = { amount?: number; /** A callback to format the amount number */ - onFormatAmount?: (amount: number, currency: string) => string; + onFormatAmount?: (amount: number, currency?: string) => string; /** Currency chosen by user or saved in Onyx */ currency?: string; From 3bb57a6f48823819894f7d937fffe386b5f42939 Mon Sep 17 00:00:00 2001 From: Abdelrahman Khattab <59809993+abzokhattab@users.noreply.github.com> Date: Tue, 16 Jul 2024 17:41:30 +0200 Subject: [PATCH 33/40] Minor edit Co-authored-by: Daniel Gale-Rosen <5487802+dangrous@users.noreply.github.com> --- src/components/MoneyRequestAmountInput.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/MoneyRequestAmountInput.tsx b/src/components/MoneyRequestAmountInput.tsx index 12420dafd87e..702e6c384b58 100644 --- a/src/components/MoneyRequestAmountInput.tsx +++ b/src/components/MoneyRequestAmountInput.tsx @@ -106,7 +106,7 @@ const getNewSelection = (oldSelection: Selection, prevLength: number, newLength: return {start: cursorPosition, end: cursorPosition}; }; -const defaultOnFormatAmount = (amount: number, currency: string) => CurrencyUtils.convertToFrontendAmountAsString(amount, currency ?? CONST.CURRENCY.USD); +const defaultOnFormatAmount = (amount: number, currency?: string) => CurrencyUtils.convertToFrontendAmountAsString(amount, currency ?? CONST.CURRENCY.USD); function MoneyRequestAmountInput( { From ae3fb3a5dee13fe9538197ecec7a460256c8d333 Mon Sep 17 00:00:00 2001 From: Huu Le Date: Tue, 16 Jul 2024 22:49:24 +0700 Subject: [PATCH 34/40] remove space --- src/libs/actions/Policy/Policy.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/actions/Policy/Policy.ts b/src/libs/actions/Policy/Policy.ts index 8379ad9e9b19..95c2e1c721d0 100644 --- a/src/libs/actions/Policy/Policy.ts +++ b/src/libs/actions/Policy/Policy.ts @@ -1073,7 +1073,7 @@ function updateGeneralSettings(policyID: string, name: string, currencyValue?: s persistedRequests.forEach((request, index) => { const {command, data} = request; - if (command === WRITE_COMMANDS.CREATE_WORKSPACE && data?.policyID === policyID) { + if (command === WRITE_COMMANDS.CREATE_WORKSPACE && data?.policyID === policyID) { if (data.policyName !== name) { const createWorkspaceRequest = { ...request, From 9d5f227665e58796c86ec00302b654936e6d819c Mon Sep 17 00:00:00 2001 From: Shridhar Goel <35566748+ShridharGoel@users.noreply.github.com> Date: Tue, 16 Jul 2024 22:40:36 +0530 Subject: [PATCH 35/40] Update index.html --- web/index.html | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/web/index.html b/web/index.html index 384868af1a51..eb86478cc895 100644 --- a/web/index.html +++ b/web/index.html @@ -81,11 +81,9 @@ transition: transform var(--label-transition-duration); } - @media screen { - .splash-logo > svg { - width: 104px; - height: 104px; - } + .splash-logo > svg { + width: 104px; + height: 104px; } #splash { From 1c7da9ed976186dba3f715f1bfe6da47acce50c3 Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Tue, 16 Jul 2024 17:17:56 -0600 Subject: [PATCH 36/40] explicitly require ostruct --- fastlane/Fastfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fastlane/Fastfile b/fastlane/Fastfile index af9e798d2343..2560e48728c5 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -10,6 +10,8 @@ # https://docs.fastlane.tools/plugins/available-plugins # +require 'ostruct' + skip_docs opt_out_usage From ead070d543fcb6efa8101c78cb92ca83100a5b4f Mon Sep 17 00:00:00 2001 From: tienifr Date: Wed, 17 Jul 2024 15:59:54 +0700 Subject: [PATCH 37/40] fix: app crashes after exporting report to CSV --- src/libs/ReportActionsUtils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/ReportActionsUtils.ts b/src/libs/ReportActionsUtils.ts index b0ee360a86e0..1aaa5cd7bfee 100644 --- a/src/libs/ReportActionsUtils.ts +++ b/src/libs/ReportActionsUtils.ts @@ -666,7 +666,7 @@ function isActionableTrackExpense(reportAction: OnyxInputOrEntry): */ function isResolvedActionTrackExpense(reportAction: OnyxEntry): boolean { const originalMessage = getOriginalMessage(reportAction); - const resolution = originalMessage && 'resolution' in originalMessage ? originalMessage?.resolution : null; + const resolution = originalMessage && typeof originalMessage === 'object' && 'resolution' in originalMessage ? originalMessage?.resolution : null; return isActionableTrackExpense(reportAction) && !!resolution; } From 91b6e3b55b7caf9d46dd8656eb12efe848d91c89 Mon Sep 17 00:00:00 2001 From: war-in Date: Wed, 17 Jul 2024 13:05:54 +0200 Subject: [PATCH 38/40] fix spacing --- .../accounting/intacct/advanced/SageIntacctAdvancedPage.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/workspace/accounting/intacct/advanced/SageIntacctAdvancedPage.tsx b/src/pages/workspace/accounting/intacct/advanced/SageIntacctAdvancedPage.tsx index 40ab18c7f9cd..2458b8579539 100644 --- a/src/pages/workspace/accounting/intacct/advanced/SageIntacctAdvancedPage.tsx +++ b/src/pages/workspace/accounting/intacct/advanced/SageIntacctAdvancedPage.tsx @@ -118,7 +118,7 @@ function SageIntacctAdvancedPage({policy}: WithPolicyProps) { switchAccessibilityLabel={section.label} isActive={section.isActive} onToggle={section.onToggle} - wrapperStyle={[styles.ph5, styles.pb3]} + wrapperStyle={[styles.ph5, styles.pv3]} pendingAction={section.pendingAction} errors={section.error} onCloseError={section.onCloseError} From cff0655e94b394cbd3ad91960777ffba15569e56 Mon Sep 17 00:00:00 2001 From: cretadn22 Date: Wed, 17 Jul 2024 19:54:34 +0700 Subject: [PATCH 39/40] handle conflict --- src/components/PopoverMenu.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/PopoverMenu.tsx b/src/components/PopoverMenu.tsx index cdd3f4bb778e..3a59f1e8d349 100644 --- a/src/components/PopoverMenu.tsx +++ b/src/components/PopoverMenu.tsx @@ -158,7 +158,7 @@ function PopoverMenu({ onPress={() => { setCurrentMenuItems(previousMenuItems); setFocusedIndex(-1); - setEnteredSubMenuIndexes(enteredSubMenuIndexes.slice(0, -1)); + setEnteredSubMenuIndexes((prevState) => prevState.slice(0, -1)) }} /> ); From b4a40239ea9432607880d28f8ef3a9c5bf42a82c Mon Sep 17 00:00:00 2001 From: cretadn22 Date: Wed, 17 Jul 2024 19:55:34 +0700 Subject: [PATCH 40/40] handle conflict --- src/components/PopoverMenu.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/PopoverMenu.tsx b/src/components/PopoverMenu.tsx index 3a59f1e8d349..d41c1a9aaa63 100644 --- a/src/components/PopoverMenu.tsx +++ b/src/components/PopoverMenu.tsx @@ -158,7 +158,7 @@ function PopoverMenu({ onPress={() => { setCurrentMenuItems(previousMenuItems); setFocusedIndex(-1); - setEnteredSubMenuIndexes((prevState) => prevState.slice(0, -1)) + setEnteredSubMenuIndexes((prevState) => prevState.slice(0, -1)); }} /> );