Skip to content

Commit 763bdf6

Browse files
authored
Merge pull request Expensify#63616 from nkdengineer/fix/62925
2 parents 654ec47 + e07cf92 commit 763bdf6

3 files changed

Lines changed: 0 additions & 49 deletions

File tree

src/CONST.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1241,7 +1241,6 @@ const CONST = {
12411241
ADD_EXPENSE: 'addExpense',
12421242
SPLIT: 'split',
12431243
REOPEN: 'reopen',
1244-
MOVE_EXPENSE: 'moveExpense',
12451244
PAY: 'pay',
12461245
},
12471246
PRIMARY_ACTIONS: {

src/components/MoneyReportHeader.tsx

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import {ActivityIndicator, InteractionManager, View} from 'react-native';
44
import type {OnyxEntry} from 'react-native-onyx';
55
import {useOnyx} from 'react-native-onyx';
66
import type {ValueOf} from 'type-fest';
7-
import useActiveRoute from '@hooks/useActiveRoute';
87
import useLocalize from '@hooks/useLocalize';
98
import useMobileSelectionMode from '@hooks/useMobileSelectionMode';
109
import useNetwork from '@hooks/useNetwork';
@@ -43,7 +42,6 @@ import {
4342
isInvoiceReport as isInvoiceReportUtil,
4443
isProcessingReport,
4544
isReportOwner,
46-
isTrackExpenseReport as isTrackExpenseReportUtil,
4745
navigateOnDeleteExpense,
4846
navigateToDetailsPage,
4947
reportTransactionsSelector,
@@ -154,7 +152,6 @@ function MoneyReportHeader({
154152
const {shouldUseNarrowLayout, isSmallScreenWidth, isMediumScreenWidth} = useResponsiveLayout();
155153
const shouldDisplayNarrowVersion = shouldUseNarrowLayout || isMediumScreenWidth;
156154
const route = useRoute();
157-
const {getReportRHPActiveRoute} = useActiveRoute();
158155
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
159156
const [chatReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${moneyRequestReport?.chatReportID}`, {canBeMissing: true});
160157
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
@@ -249,18 +246,6 @@ function MoneyReportHeader({
249246
);
250247

251248
const isInvoiceReport = isInvoiceReportUtil(moneyRequestReport);
252-
const isTrackExpenseReport = isTrackExpenseReportUtil(moneyRequestReport);
253-
254-
const iouType = useMemo(() => {
255-
if (isTrackExpenseReport) {
256-
return CONST.IOU.TYPE.TRACK;
257-
}
258-
if (isInvoiceReport) {
259-
return CONST.IOU.TYPE.INVOICE;
260-
}
261-
262-
return CONST.IOU.TYPE.SUBMIT;
263-
}, [isTrackExpenseReport, isInvoiceReport]);
264249

265250
const [isDownloadErrorModalVisible, setIsDownloadErrorModalVisible] = useState(false);
266251

@@ -807,20 +792,6 @@ function MoneyReportHeader({
807792
Navigation.navigate(ROUTES.REPORT_WITH_ID_CHANGE_WORKSPACE.getRoute(moneyRequestReport.reportID));
808793
},
809794
},
810-
[CONST.REPORT.SECONDARY_ACTIONS.MOVE_EXPENSE]: {
811-
text: translate('iou.moveExpenses', {count: 1}),
812-
icon: Expensicons.DocumentMerge,
813-
value: CONST.REPORT.SECONDARY_ACTIONS.MOVE_EXPENSE,
814-
onSelected: () => {
815-
if (!moneyRequestReport || !transaction) {
816-
return;
817-
}
818-
819-
Navigation.navigate(
820-
ROUTES.MONEY_REQUEST_STEP_REPORT.getRoute(CONST.IOU.ACTION.EDIT, iouType, transaction.transactionID, moneyRequestReport.reportID, getReportRHPActiveRoute()),
821-
);
822-
},
823-
},
824795
[CONST.REPORT.SECONDARY_ACTIONS.DELETE]: {
825796
text: translate('common.delete'),
826797
icon: Expensicons.Trashcan,

src/libs/ReportSecondaryActionUtils.ts

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import {getIOUActionForReportID, getIOUActionForTransactionID, getOneTransaction
2020
import {isPrimaryPayAction} from './ReportPrimaryActionUtils';
2121
import {
2222
canAddTransaction,
23-
canEditFieldOfMoneyRequest,
2423
canEditReportPolicy,
2524
canHoldUnholdReportAction,
2625
getTransactionDetails,
@@ -397,20 +396,6 @@ function isChangeWorkspaceAction(report: Report, policies: OnyxCollection<Policy
397396
return hasAvailablePolicies && canEditReportPolicy(report, reportPolicy);
398397
}
399398

400-
function isMoveTransactionAction(reportTransactions: Transaction[], reportActions?: ReportAction[]) {
401-
const transaction = reportTransactions.at(0);
402-
403-
if (reportTransactions.length !== 1 || !transaction || !reportActions) {
404-
return false;
405-
}
406-
407-
const iouReportAction = getIOUActionForTransactionID(reportActions, transaction.transactionID);
408-
409-
const canMoveExpense = canEditFieldOfMoneyRequest(iouReportAction, CONST.EDIT_REQUEST_FIELD.REPORT);
410-
411-
return canMoveExpense;
412-
}
413-
414399
function isDeleteAction(report: Report, reportTransactions: Transaction[], reportActions: ReportAction[], policy?: Policy): boolean {
415400
const isExpenseReport = isExpenseReportUtils(report);
416401
const isIOUReport = isIOUReportUtils(report);
@@ -561,10 +546,6 @@ function getSecondaryReportActions(
561546
options.push(CONST.REPORT.SECONDARY_ACTIONS.CHANGE_WORKSPACE);
562547
}
563548

564-
if (isMoveTransactionAction(reportTransactions, reportActions)) {
565-
options.push(CONST.REPORT.SECONDARY_ACTIONS.MOVE_EXPENSE);
566-
}
567-
568549
options.push(CONST.REPORT.SECONDARY_ACTIONS.VIEW_DETAILS);
569550

570551
if (isDeleteAction(report, reportTransactions, reportActions ?? [], policy)) {

0 commit comments

Comments
 (0)