Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions assets/images/arrow-split.svg

This file was deleted.

3 changes: 0 additions & 3 deletions src/CONST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1226,7 +1226,6 @@ const CONST = {
DELETE: 'delete',
RETRACT: 'retract',
ADD_EXPENSE: 'addExpense',
SPLIT: 'split',
REOPEN: 'reopen',
MOVE_EXPENSE: 'moveExpense',
PAY: 'pay',
Expand Down Expand Up @@ -1257,7 +1256,6 @@ const CONST = {
},
TRANSACTION_SECONDARY_ACTIONS: {
HOLD: 'hold',
SPLIT: 'split',
VIEW_DETAILS: 'viewDetails',
DELETE: 'delete',
},
Expand Down Expand Up @@ -2777,7 +2775,6 @@ const CONST = {
SEND: 'send',
PAY: 'pay',
SPLIT: 'split',
SPLIT_EXPENSE: 'split-expense',
REQUEST: 'request',
INVOICE: 'invoice',
SUBMIT: 'submit',
Expand Down
18 changes: 0 additions & 18 deletions src/ROUTES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -573,24 +573,6 @@ const ROUTES = {
return getUrlWithBackToParam(`r/${reportID}/invite` as const, backTo);
},
},
SPLIT_EXPENSE: {
route: 'create/split-expense/overview/:reportID/:transactionID/:splitExpenseTransactionID?',
getRoute: (reportID: string | undefined, originalTransactionID: string | undefined, splitExpenseTransactionID?: string, backTo?: string) => {
if (!reportID || !originalTransactionID) {
Log.warn(`Invalid ${reportID}(reportID) or ${originalTransactionID}(transactionID) is used to build the SPLIT_EXPENSE route`);
}
return getUrlWithBackToParam(`create/split-expense/overview/${reportID}/${originalTransactionID}${splitExpenseTransactionID ? `/${splitExpenseTransactionID}` : ''}`, backTo);
},
},
SPLIT_EXPENSE_EDIT: {
route: 'edit/split-expense/overview/:reportID/:transactionID/:splitExpenseTransactionID?',
getRoute: (reportID: string | undefined, originalTransactionID: string | undefined, splitExpenseTransactionID?: string, backTo?: string) => {
if (!reportID || !originalTransactionID) {
Log.warn(`Invalid ${reportID}(reportID) or ${originalTransactionID}(transactionID) is used to build the SPLIT_EXPENSE_EDIT route`);
}
return getUrlWithBackToParam(`edit/split-expense/overview/${reportID}/${originalTransactionID}${splitExpenseTransactionID ? `/${splitExpenseTransactionID}` : ''}`, backTo);
},
},
MONEY_REQUEST_HOLD_REASON: {
route: ':type/edit/reason/:transactionID?/:searchHash?',
getRoute: (type: ValueOf<typeof CONST.POLICY.TYPE>, transactionID: string, reportID: string, backTo: string, searchHash?: number) => {
Expand Down
2 changes: 0 additions & 2 deletions src/SCREENS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -264,8 +264,6 @@ const SCREENS = {
STEP_SUBRATE_EDIT: 'Money_Request_SubRate_Edit',
STEP_REPORT: 'Money_Request_Report',
EDIT_REPORT: 'Money_Request_Edit_Report',
SPLIT_EXPENSE: 'Money_Request_Split_Expense',
SPLIT_EXPENSE_EDIT: 'Money_Request_Split_Expense_Edit',
},

TRANSACTION_DUPLICATE: {
Expand Down
2 changes: 1 addition & 1 deletion src/components/AmountTextInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ type AmountTextInputProps = {

/** Hide the focus styles on TextInput */
hideFocusedState?: boolean;
} & Pick<BaseTextInputProps, 'autoFocus' | 'autoGrowExtraSpace' | 'submitBehavior'>;
} & Pick<BaseTextInputProps, 'autoFocus' | 'autoGrowExtraSpace'>;

function AmountTextInput(
{
Expand Down
2 changes: 0 additions & 2 deletions src/components/Icon/Expensicons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import ArrowCollapse from '@assets/images/arrow-collapse.svg';
import ArrowDownLong from '@assets/images/arrow-down-long.svg';
import ArrowRightLong from '@assets/images/arrow-right-long.svg';
import ArrowRight from '@assets/images/arrow-right.svg';
import ArrowSplit from '@assets/images/arrow-split.svg';
import ArrowUpLong from '@assets/images/arrow-up-long.svg';
import UpArrow from '@assets/images/arrow-up.svg';
import ArrowsLeftRight from '@assets/images/arrows-leftright.svg';
Expand Down Expand Up @@ -239,7 +238,6 @@ export {
AnnounceRoomAvatar,
Apple,
AppleLogo,
ArrowSplit,
ArrowCollapse,
ArrowRight,
ArrowRightLong,
Expand Down
14 changes: 0 additions & 14 deletions src/components/MoneyReportHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ import {
deleteMoneyRequest,
getNavigationUrlOnMoneyRequestDelete,
getNextApproverAccountID,
initSplitExpense,
payInvoice,
payMoneyRequest,
reopenReport,
Expand Down Expand Up @@ -756,19 +755,6 @@ function MoneyReportHeader({
changeMoneyRequestHoldStatus(requestParentReportAction);
},
},
[CONST.REPORT.SECONDARY_ACTIONS.SPLIT]: {
text: translate('iou.split'),
icon: Expensicons.ArrowSplit,
value: CONST.REPORT.SECONDARY_ACTIONS.SPLIT,
onSelected: () => {
if (Number(transactions?.length) !== 1) {
return;
}

const currentTransaction = transactions.at(0);
initSplitExpense(currentTransaction, moneyRequestReport?.reportID ?? String(CONST.DEFAULT_NUMBER_ID));
},
},
[CONST.REPORT.SECONDARY_ACTIONS.CHANGE_WORKSPACE]: {
text: translate('iou.changeWorkspace'),
icon: Expensicons.Buildings,
Expand Down
4 changes: 1 addition & 3 deletions src/components/MoneyRequestAmountInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ type MoneyRequestAmountInputProps = {

/** The testID of the input. Used to locate this view in end-to-end tests. */
testID?: string;
} & Pick<TextInputWithCurrencySymbolProps, 'autoGrowExtraSpace' | 'submitBehavior'>;
} & Pick<TextInputWithCurrencySymbolProps, 'autoGrowExtraSpace'>;

type Selection = {
start: number;
Expand Down Expand Up @@ -132,7 +132,6 @@ function MoneyRequestAmountInput(
autoGrowExtraSpace,
contentWidth,
testID,
submitBehavior,
...props
}: MoneyRequestAmountInputProps,
forwardedRef: ForwardedRef<BaseTextInputRef>,
Expand Down Expand Up @@ -344,7 +343,6 @@ function MoneyRequestAmountInput(
onMouseUp={handleMouseUp}
contentWidth={contentWidth}
testID={testID}
submitBehavior={submitBehavior}
/>
);
}
Expand Down
14 changes: 3 additions & 11 deletions src/components/MoneyRequestHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import useResponsiveLayout from '@hooks/useResponsiveLayout';
import useTheme from '@hooks/useTheme';
import useThemeStyles from '@hooks/useThemeStyles';
import useTransactionViolations from '@hooks/useTransactionViolations';
import {deleteMoneyRequest, initSplitExpense} from '@libs/actions/IOU';
import {deleteMoneyRequest} from '@libs/actions/IOU';
import Navigation from '@libs/Navigation/Navigation';
import {getOriginalMessage, getReportActions, isMoneyRequestAction} from '@libs/ReportActionsUtils';
import {getTransactionThreadPrimaryAction} from '@libs/ReportPrimaryActionUtils';
Expand Down Expand Up @@ -201,8 +201,8 @@ function MoneyRequestHeader({report, parentReportAction, policy, onBackButtonPre
if (!transaction || !reportActions) {
return [];
}
return getSecondaryTransactionThreadActions(parentReport, transaction, Object.values(reportActions), policy);
}, [parentReport, policy, transaction]);
return getSecondaryTransactionThreadActions(parentReport, transaction, Object.values(reportActions));
}, [parentReport, transaction]);

const secondaryActionsImplementation: Record<ValueOf<typeof CONST.REPORT.TRANSACTION_SECONDARY_ACTIONS>, DropdownOption<ValueOf<typeof CONST.REPORT.TRANSACTION_SECONDARY_ACTIONS>>> = {
[CONST.REPORT.TRANSACTION_SECONDARY_ACTIONS.HOLD]: {
Expand All @@ -217,14 +217,6 @@ function MoneyRequestHeader({report, parentReportAction, policy, onBackButtonPre
changeMoneyRequestHoldStatus(parentReportAction);
},
},
[CONST.REPORT.TRANSACTION_SECONDARY_ACTIONS.SPLIT]: {
text: translate('iou.split'),
icon: Expensicons.ArrowSplit,
value: CONST.REPORT.SECONDARY_ACTIONS.SPLIT,
onSelected: () => {
initSplitExpense(transaction, reportID ?? String(CONST.DEFAULT_NUMBER_ID));
},
},
[CONST.REPORT.TRANSACTION_SECONDARY_ACTIONS.VIEW_DETAILS]: {
value: CONST.REPORT.SECONDARY_ACTIONS.VIEW_DETAILS,
text: translate('iou.viewDetails'),
Expand Down
4 changes: 0 additions & 4 deletions src/components/ReportActionItem/MoneyRequestView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ import {
getBillable,
getDescription,
getDistanceInMeters,
getOriginalTransactionWithSplitInfo,
getTagForDisplay,
getTaxName,
hasMissingSmartscanFields,
Expand Down Expand Up @@ -292,9 +291,6 @@ function MoneyRequestView({report, shouldShowAnimatedBackground, readonly = fals
if (!isDistanceRequest && !isPerDiemRequest) {
amountDescription += ` ${CONST.DOT_SEPARATOR} ${translate('iou.cash')}`;
}
if (getOriginalTransactionWithSplitInfo(transaction).isExpenseSplit) {
amountDescription += ` ${CONST.DOT_SEPARATOR} ${translate('iou.split')}`;
}
if (isCancelled) {
amountDescription += ` ${CONST.DOT_SEPARATOR} ${translate('iou.canceled')}`;
} else if (isApproved) {
Expand Down
14 changes: 4 additions & 10 deletions src/components/ReportActionItem/TransactionPreview/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import {convertToDisplayString} from '@libs/CurrencyUtils';
import {canUseTouchScreen} from '@libs/DeviceCapabilities';
import {getIOUActionForReportID, getOriginalMessage, isMoneyRequestAction as isMoneyRequestActionReportActionsUtils} from '@libs/ReportActionsUtils';
import {getTransactionDetails} from '@libs/ReportUtils';
import {getReviewNavigationRoute} from '@libs/TransactionPreviewUtils';
import {getOriginalTransactionWithSplitInfo, isCardTransaction, removeSettledAndApprovedTransactions} from '@libs/TransactionUtils';
import {getOriginalTransactionIfBillIsSplit, getReviewNavigationRoute} from '@libs/TransactionPreviewUtils';
import {isCardTransaction, removeSettledAndApprovedTransactions} from '@libs/TransactionUtils';
import Navigation from '@navigation/Navigation';
import type {PlatformStackRouteProp} from '@navigation/PlatformStackNavigation/types';
import type {TransactionDuplicateNavigatorParamList} from '@navigation/types';
Expand Down Expand Up @@ -78,13 +78,7 @@ function TransactionPreview(props: TransactionPreviewProps) {
Navigation.navigate(getReviewNavigationRoute(route, report, transaction, duplicates));
}, [duplicates, report, route, transaction]);

let transactionPreview = transaction;

const {originalTransaction, isBillSplit} = getOriginalTransactionWithSplitInfo(transaction);

if (isBillSplit) {
transactionPreview = originalTransaction;
}
const {originalTransaction, isBillSplit} = getOriginalTransactionIfBillIsSplit(transaction);

const iouAction = isBillSplit && originalTransaction ? getIOUActionForReportID(chatReportID, originalTransaction.transactionID) ?? action : action;

Expand All @@ -111,7 +105,7 @@ function TransactionPreview(props: TransactionPreviewProps) {
isBillSplit={isBillSplit}
chatReport={chatReport}
personalDetails={personalDetails}
transaction={transactionPreview}
transaction={originalTransaction}
iouReport={iouReport}
violations={violations}
offlineWithFeedbackOnClose={offlineWithFeedbackOnClose}
Expand Down
8 changes: 2 additions & 6 deletions src/components/ReportWelcomeText.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,8 @@ function ReportWelcomeText({report, policy}: ReportWelcomeTextProps) {
const policyName = getPolicyName({report});

const filteredOptions = moneyRequestOptions.filter(
(
item,
): item is Exclude<
IOUType,
typeof CONST.IOU.TYPE.REQUEST | typeof CONST.IOU.TYPE.SEND | typeof CONST.IOU.TYPE.CREATE | typeof CONST.IOU.TYPE.INVOICE | typeof CONST.IOU.TYPE.SPLIT_EXPENSE
> => item !== CONST.IOU.TYPE.INVOICE,
(item): item is Exclude<IOUType, typeof CONST.IOU.TYPE.REQUEST | typeof CONST.IOU.TYPE.SEND | typeof CONST.IOU.TYPE.CREATE | typeof CONST.IOU.TYPE.INVOICE> =>
item !== CONST.IOU.TYPE.INVOICE,
);
const additionalText = filteredOptions
.map(
Expand Down
2 changes: 1 addition & 1 deletion src/components/Search/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ function mapToItemWithSelectionInfo(item: SearchListItem, selectedTransactions:
...item,
shouldAnimateInHighlight,
transactions: item.transactions?.map((transaction) => mapToTransactionItemWithSelectionInfo(transaction, selectedTransactions, canSelectMultiple, shouldAnimateInHighlight)),
isSelected: item?.transactions?.length > 0 && item.transactions?.every((transaction) => selectedTransactions[transaction.keyForList]?.isSelected && canSelectMultiple),
isSelected: item.transactions.length > 0 && item.transactions?.every((transaction) => selectedTransactions[transaction.keyForList]?.isSelected && canSelectMultiple),
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -407,15 +407,15 @@ function TransactionListItemRow({
</View>
<View style={[StyleUtils.getReportTableColumnStyles(CONST.SEARCH.TABLE_COLUMNS.FROM)]}>
<UserInfoCell
accountID={item.from?.accountID}
avatar={item.from?.avatar}
accountID={item.from.accountID}
avatar={item.from.avatar}
displayName={item.formattedFrom}
/>
</View>
<View style={[StyleUtils.getReportTableColumnStyles(CONST.SEARCH.TABLE_COLUMNS.FROM)]}>
<UserInfoCell
accountID={item.to?.accountID}
avatar={item.to?.avatar}
accountID={item.to.accountID}
avatar={item.to.avatar}
displayName={item.formattedTo}
/>
</View>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,6 @@ function UserInfoCellsWithArrow({
const styles = useThemeStyles();
const theme = useTheme();

if (!participantFrom) {
return null;
}

return (
<>
<View style={[styles.mw50, fromRecipientStyle]}>
Expand Down
Loading