Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[HOLD] Implement Uneven Splits #40386

Merged
merged 118 commits into from
May 7, 2024
Merged
Show file tree
Hide file tree
Changes from 71 commits
Commits
Show all changes
118 commits
Select commit Hold shift + click to select a range
d99170a
Add TS definitions
youssef-lr Apr 15, 2024
99efbb6
Set split shares when first creating the split
youssef-lr Apr 15, 2024
cf65044
Add IOU functions to set split shares and adjust them
youssef-lr Apr 16, 2024
97ac991
Allow configuring split amounts
youssef-lr Apr 17, 2024
4bc7142
Use temporary amount input
youssef-lr Apr 17, 2024
e9cc173
Pass custom styles
youssef-lr Apr 17, 2024
b24ff87
Temporary updates to the amount input
youssef-lr Apr 18, 2024
6afe0e5
Merge branch 'main' into youssef_uneven_splits_2
youssef-lr Apr 18, 2024
9e53204
Allow setting individual shares
youssef-lr Apr 18, 2024
00db6ff
Show a form error if sum of shares don't match total
youssef-lr Apr 18, 2024
23d8693
Prevent submitting form if total doesn't match
youssef-lr Apr 18, 2024
cc3de14
Adjust shares automatically
youssef-lr Apr 18, 2024
d98103f
Revert changes
youssef-lr Apr 18, 2024
14c9ead
Use temporary input
youssef-lr Apr 18, 2024
f032df0
Show even splits for workspace chat splits
youssef-lr Apr 18, 2024
3d2e12e
Send uneven splits to backend
youssef-lr Apr 18, 2024
eb5c8f1
Save splits array in the transaction optimistically
youssef-lr Apr 18, 2024
39fa362
Merge branch 'main' into youssef_uneven_splits_2
youssef-lr Apr 19, 2024
2001821
Copy changes to MoneyRequestConfirmationList
youssef-lr Apr 19, 2024
f8116b3
Allow excluding group chat users from splits by setting amount to 0
youssef-lr Apr 19, 2024
756d11a
Reset split shares when amount changes
youssef-lr Apr 20, 2024
1cd5bd1
Display read only shares in splti details page
youssef-lr Apr 20, 2024
2cb1d95
Show split share in split preview card
youssef-lr Apr 20, 2024
959d6d0
Allow easy tab navigation for inputs
youssef-lr Apr 20, 2024
e75e56f
Refactoring and TS fixes
youssef-lr Apr 20, 2024
7baa777
wip: Reset button
youssef-lr Apr 20, 2024
6712733
Allow resetting the amounts
youssef-lr Apr 20, 2024
327624e
Bug fix
youssef-lr Apr 21, 2024
e915d7c
Debounce form error in splits page
youssef-lr Apr 22, 2024
845d1a6
Bug fix
youssef-lr Apr 22, 2024
6d5762f
Lint
youssef-lr Apr 22, 2024
5c1758e
Hide inputs for Smartscan splits
youssef-lr Apr 22, 2024
1579091
Fix currency not shown in split amounts in details page
youssef-lr Apr 23, 2024
bca161b
Bug fix
youssef-lr Apr 23, 2024
f5b0c10
Filter out participants with shares equal to 0
youssef-lr Apr 23, 2024
db455e5
Prevent creating a split containing a single participant
youssef-lr Apr 23, 2024
cbe5d36
Prevent submitting form if there's an error
youssef-lr Apr 23, 2024
5dd0aed
Merge branch 'main' into youssef_uneven_splits_2
youssef-lr Apr 23, 2024
66c367d
Lint
youssef-lr Apr 23, 2024
dc7f13d
Merge branch 'main' into youssef_uneven_splits_2
youssef-lr Apr 23, 2024
a22f42d
Add margin next to participant emails
youssef-lr Apr 23, 2024
57610d7
Merge branch 'main' into youssef_uneven_splits_2
youssef-lr Apr 25, 2024
ec56107
Always show confirmation for uneven splits
youssef-lr Apr 25, 2024
6cd30c2
Fix input style
youssef-lr Apr 25, 2024
4e71237
Clean up code for section button
youssef-lr Apr 25, 2024
076d99a
Merge branch 'main' into youssef_uneven_splits_2
youssef-lr Apr 25, 2024
e064698
TS lint
youssef-lr Apr 25, 2024
e7ff3dc
More lint
youssef-lr Apr 25, 2024
8f33768
Skip confirmation screen for smartscanned splits
youssef-lr Apr 25, 2024
d5da181
Remove workaround for removing participants
youssef-lr Apr 25, 2024
7eba6d0
Bring back effect
youssef-lr Apr 25, 2024
23e41fe
Lint
youssef-lr Apr 25, 2024
061fcf1
Don't run unneeded logic unless we have modified shares
youssef-lr Apr 25, 2024
946d75f
Translation
youssef-lr Apr 25, 2024
6590eb4
TS
youssef-lr Apr 25, 2024
ed6f2e3
More TS
youssef-lr Apr 25, 2024
624bad4
Merge branch 'main' into youssef_uneven_splits_2
youssef-lr Apr 25, 2024
af91070
TS and comment imporvement
youssef-lr Apr 25, 2024
2d0d0ba
Remove unintended changes
youssef-lr Apr 25, 2024
17c172b
One last TS fix
youssef-lr Apr 25, 2024
64a8525
Remove unintended change
youssef-lr Apr 26, 2024
58da039
Merge branch 'main' into youssef_uneven_splits_2
youssef-lr Apr 26, 2024
d49ab6d
Cleanup
youssef-lr Apr 26, 2024
d0ce531
Cleanup
youssef-lr Apr 26, 2024
4df0953
Header new copy
youssef-lr Apr 26, 2024
dd6005f
Add comment
youssef-lr Apr 26, 2024
e46a6ce
Show current user's share in the split preview
youssef-lr Apr 26, 2024
1599a86
Merge branch 'main' into youssef_uneven_splits_2
youssef-lr Apr 26, 2024
0daec60
Fix form error disappearing
youssef-lr Apr 26, 2024
9a74508
Fix merchant error missing when completing a split bill
youssef-lr Apr 26, 2024
9dee700
Cleanup
youssef-lr Apr 26, 2024
742e4e3
Rename variable
youssef-lr Apr 26, 2024
44ad9e1
Clean up code
youssef-lr Apr 26, 2024
f3db250
Fix selection always moving to the end
youssef-lr Apr 26, 2024
f2b7bf6
Proper fix for selection moving when amount changes
youssef-lr Apr 28, 2024
7afaca5
Add comment
youssef-lr Apr 28, 2024
5c594aa
Clarify comment
youssef-lr Apr 28, 2024
fbad80a
Copy update
youssef-lr Apr 28, 2024
4deb9ec
Clean up code
youssef-lr Apr 28, 2024
14d5775
Format amounts
youssef-lr Apr 28, 2024
09cde3c
Cleanup
youssef-lr Apr 28, 2024
51041d8
Fix keyboard disabled on native
youssef-lr Apr 29, 2024
d00fb89
Update MoneyRequestAmountInput.tsx
youssef-lr Apr 29, 2024
cea2cf8
Rename callback
youssef-lr Apr 29, 2024
4431b47
Merge branch 'main' into youssef_uneven_splits_2
youssef-lr Apr 29, 2024
dc97bfd
Bug fix
youssef-lr Apr 29, 2024
4b64601
Merge branch 'main' into youssef_uneven_splits_2
youssef-lr Apr 30, 2024
3ac8cb3
TS fix
youssef-lr Apr 30, 2024
9641c4d
Fix input flickering
youssef-lr May 1, 2024
dbe50b9
Bug fixes and add logic to native
youssef-lr May 1, 2024
ce825c9
Style
youssef-lr May 1, 2024
b3c6539
Add autoGrowDirection
youssef-lr May 1, 2024
eb81dff
Cleanup
youssef-lr May 1, 2024
36c5e35
Add a missing change to native
youssef-lr May 1, 2024
fc3768b
Cleanup
youssef-lr May 1, 2024
c2303f0
TS
youssef-lr May 1, 2024
516f2de
Bug fix
youssef-lr May 1, 2024
9657b24
Show dot in numeric keyboard
youssef-lr May 1, 2024
1061dfd
Merge branch 'main' into youssef_uneven_splits_2
youssef-lr May 1, 2024
0397b60
Merge branch 'main' into youssef_uneven_splits_2
youssef-lr May 2, 2024
37deba6
Add accessibility hit slope
youssef-lr May 3, 2024
626ecda
Revert implementation of autgrow with direction to the left
youssef-lr May 3, 2024
7305b68
Revert unintended changes
youssef-lr May 3, 2024
f745d48
Don't format amount when text input is focused
youssef-lr May 3, 2024
c4bc1fd
Don't break other existing amount inputs
youssef-lr May 3, 2024
188e7a2
Remove unneeded prop
youssef-lr May 3, 2024
1332a1c
Remove unused param
youssef-lr May 3, 2024
0d04ae4
Update styles and right-align input
youssef-lr May 3, 2024
ceb81ed
Adjust padding based on prefix length relating to uppercase letters
youssef-lr May 3, 2024
ca87ee5
Replace comma input with period for native keyboards that show a comma
youssef-lr May 3, 2024
c397762
Calculate exact width of the input based on total amount length
youssef-lr May 6, 2024
8af33a4
Add callback removed by mistake
youssef-lr May 6, 2024
672e3ec
Allow editing formatted amount
youssef-lr May 6, 2024
2b296bb
Use fixed width for inputs and max length
youssef-lr May 6, 2024
2056fb0
Don't format amount on blur if it exceeds max length
youssef-lr May 6, 2024
d5ce4cf
Reset selection on blur on mobile
youssef-lr May 6, 2024
209cac2
Merge branch 'main' into youssef_uneven_splits_2
youssef-lr May 6, 2024
c9021df
Fix paidBy section being sticky
youssef-lr May 7, 2024
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
2 changes: 1 addition & 1 deletion src/components/MoneyRequestAmountInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -248,4 +248,4 @@ function MoneyRequestAmountInput(
MoneyRequestAmountInput.displayName = 'MoneyRequestAmountInput';

export default React.forwardRef(MoneyRequestAmountInput);
export type {CurrentMoney, MoneyRequestAmountInputRef};
export type {CurrentMoney, MoneyRequestAmountInputProps, MoneyRequestAmountInputRef};
213 changes: 140 additions & 73 deletions src/components/MoneyRequestConfirmationList.tsx

Large diffs are not rendered by default.

20 changes: 18 additions & 2 deletions src/components/OptionRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import DisplayNames from './DisplayNames';
import Hoverable from './Hoverable';
import Icon from './Icon';
import * as Expensicons from './Icon/Expensicons';
import MoneyRequestAmountInput from './MoneyRequestAmountInput';
import MultipleAvatars from './MultipleAvatars';
import OfflineWithFeedback from './OfflineWithFeedback';
import PressableWithFeedback from './Pressable/PressableWithFeedback';
Expand Down Expand Up @@ -138,7 +139,7 @@ function OptionRow({
style,
(option.alternateTextMaxLines ?? 1) === 1 ? styles.pre : styles.preWrap,
];
const contentContainerStyles = [styles.flex1];
const contentContainerStyles = [styles.flex1, styles.mr3];
const sidebarInnerRowStyle = StyleSheet.flatten([styles.chatLinkRowPressable, styles.flexGrow1, styles.optionItemAvatarNameWrapper, styles.optionRow, styles.justifyContentCenter]);
const flattenHoverStyle = StyleSheet.flatten(hoverStyle);
const hoveredStyle = hoverStyle ? flattenHoverStyle : styles.sidebarLinkHover;
Expand Down Expand Up @@ -201,6 +202,7 @@ function OptionRow({
hoverStyle={!optionIsFocused ? hoverStyle ?? styles.sidebarLinkHover : undefined}
needsOffscreenAlphaCompositing={(option.icons?.length ?? 0) >= 2}
onMouseDown={shouldPreventDefaultFocusOnSelectRow ? (event) => event.preventDefault() : undefined}
tabIndex={option.tabIndex ?? 0}
>
<View style={sidebarInnerRowStyle}>
<View style={[styles.flexRow, styles.alignItemsCenter]}>
Expand Down Expand Up @@ -251,6 +253,18 @@ function OptionRow({
<Text style={[styles.textLabel]}>{option.descriptiveText}</Text>
</View>
) : null}
{option.shouldShowAmountInput && option.amountInputProps ? (
<MoneyRequestAmountInput
touchableInputWrapperStyle={[styles.amountInputWithPrefix]}
prefixContainerStyle={[styles.pv0]}
inputStyle={[
StyleUtils.getPaddingLeft(StyleUtils.getCharacterPadding(option.amountInputProps.prefixCharacter ?? '') + styles.pl1.paddingLeft) as TextStyle,
]}
containerStyle={styles.iouAmountTextInputContainer}
// eslint-disable-next-line react/jsx-props-no-spreading
{...option.amountInputProps}
/>
) : null}
{!isSelected && option.brickRoadIndicator === CONST.BRICK_ROAD_INDICATOR_STATUS.ERROR && (
<View style={[styles.alignItemsCenter, styles.justifyContentCenter]}>
<Icon
Expand Down Expand Up @@ -343,7 +357,9 @@ export default React.memo(
prevProps.option.ownerAccountID === nextProps.option.ownerAccountID &&
prevProps.option.subtitle === nextProps.option.subtitle &&
prevProps.option.pendingAction === nextProps.option.pendingAction &&
prevProps.option.customIcon === nextProps.option.customIcon,
prevProps.option.customIcon === nextProps.option.customIcon &&
prevProps.option.tabIndex === nextProps.option.tabIndex &&
lodashIsEqual(prevProps.option.amountInputProps, nextProps.option.amountInputProps),
);

export type {OptionRowProps};
14 changes: 12 additions & 2 deletions src/components/OptionsList/BaseOptionsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import type {SectionListRenderItem} from 'react-native';
import {View} from 'react-native';
import OptionRow from '@components/OptionRow';
import OptionsListSkeletonView from '@components/OptionsListSkeletonView';
import {PressableWithFeedback} from '@components/Pressable';
import SectionList from '@components/SectionList';
import Text from '@components/Text';
import usePrevious from '@hooks/usePrevious';
Expand Down Expand Up @@ -205,7 +206,7 @@ function BaseOptionsList(
/**
* Function which renders a section header component
*/
const renderSectionHeader = ({section: {title, shouldShow}}: {section: OptionsListDataWithIndexOffset}) => {
const renderSectionHeader = ({section: {title, shouldShow, shouldShowActionButton, onActionButtonPress, actionButtonTitle}}: {section: OptionsListDataWithIndexOffset}) => {
if (!title && shouldShow && !hideSectionHeaders && sectionHeaderStyle) {
return <View style={sectionHeaderStyle} />;
}
Expand All @@ -216,8 +217,17 @@ function BaseOptionsList(
// We do this so that we can reference the height in `getItemLayout` –
// we need to know the heights of all list items up-front in order to synchronously compute the layout of any given list item.
// So be aware that if you adjust the content of the section header (for example, change the font size), you may need to adjust this explicit height as well.
<View style={[styles.optionsListSectionHeader, styles.justifyContentCenter, sectionHeaderStyle]}>
<View style={[styles.optionsListSectionHeader, styles.flexRow, styles.justifyContentBetween, sectionHeaderStyle]}>
<Text style={[styles.ph5, styles.textLabelSupporting]}>{title}</Text>
{shouldShowActionButton && (
<PressableWithFeedback
onPress={onActionButtonPress}
accessibilityLabel={CONST.ROLE.BUTTON}
role={CONST.ROLE.BUTTON}
>
<Text style={[styles.pr5, styles.textLabelSupporting, styles.link]}>{actionButtonTitle}</Text>
</PressableWithFeedback>
)}
</View>
);
}
Expand Down
9 changes: 9 additions & 0 deletions src/components/OptionsList/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,15 @@ type Section = {

/** Whether this section is disabled or not */
isDisabled?: boolean;

/** Whether to show an action button in the section header */
shouldShowActionButton?: boolean;

/** Title of the action button */
actionButtonTitle?: string;

/** Callback of the action button */
onActionButtonPress?: () => void;
};

type SectionWithIndexOffset = Section & {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import ExpensiMark from 'expensify-common/lib/ExpensiMark';
import {truncate} from 'lodash';
import lodashSortBy from 'lodash/sortBy';
import React from 'react';
import React, {useMemo} from 'react';
import {View} from 'react-native';
import type {GestureResponderEvent} from 'react-native';
import ConfirmedRoute from '@components/ConfirmedRoute';
Expand Down Expand Up @@ -211,6 +211,16 @@ function MoneyRequestPreviewContent({

const displayAmount = isDeleted ? getDisplayDeleteAmountText() : getDisplayAmountText();

const shouldShowSplitShare = isBillSplit && !!requestAmount && requestAmount > 0;
const splitShare = useMemo(
() =>
shouldShowSplitShare &&
(transaction?.comment?.splits
? transaction?.comment?.splits?.find((split) => split.accountID === sessionAccountID)?.amount
: IOUUtils.calculateAmount(isPolicyExpenseChat ? 1 : participantAccountIDs.length - 1, requestAmount, requestCurrency ?? '', action.actorAccountID === sessionAccountID)),
[shouldShowSplitShare, isPolicyExpenseChat, action.actorAccountID, participantAccountIDs.length, transaction?.comment?.splits, requestAmount, requestCurrency, sessionAccountID],
);

const childContainer = (
<View>
<OfflineWithFeedback
Expand Down Expand Up @@ -301,14 +311,9 @@ function MoneyRequestPreviewContent({
)}
{shouldShowMerchant && <Text style={[styles.textLabelSupporting, styles.textNormal]}>{merchantOrDescription}</Text>}
</View>
{isBillSplit && participantAccountIDs.length > 0 && !!requestAmount && requestAmount > 0 && (
{splitShare && (
<Text style={[styles.textLabel, styles.colorMuted, styles.ml1, styles.amountSplitPadding]}>
{translate('iou.amountEach', {
amount: CurrencyUtils.convertToDisplayString(
IOUUtils.calculateAmount(isPolicyExpenseChat ? 1 : participantAccountIDs.length - 1, requestAmount, requestCurrency ?? ''),
requestCurrency,
),
})}
{translate('iou.yourSplit', {amount: CurrencyUtils.convertToDisplayString(splitShare ?? 0, requestCurrency ?? '')})}
</Text>
)}
</View>
Expand Down
10 changes: 6 additions & 4 deletions src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import type {
AddressLineParams,
AdminCanceledRequestParams,
AlreadySignedInParams,
AmountEachParams,
ApprovedAmountParams,
BeginningOfChatHistoryAdminRoomPartOneParams,
BeginningOfChatHistoryAnnounceRoomPartOneParams,
Expand All @@ -29,6 +28,7 @@ import type {
GoBackMessageParams,
GoToRoomParams,
InstantSummaryParams,
InvalidSplitTotalParams,
LocalTimeParams,
LoggedInAsParams,
LogSizeParams,
Expand Down Expand Up @@ -83,6 +83,7 @@ import type {
UpdatedTheRequestParams,
UsePlusButtonParams,
UserIsAlreadyMemberParams,
UserSplitParams,
ViolationsAutoReportedRejectedExpenseParams,
ViolationsCashExpenseWithNoReceiptParams,
ViolationsConversionSurchargeParams,
Expand Down Expand Up @@ -398,7 +399,7 @@ export default {
},
moneyRequestConfirmationList: {
paidBy: 'Paid by',
splitWith: 'Split with',
splitAmounts: 'Split amounts',
whatsItFor: "What's it for?",
},
optionsSelector: {
Expand Down Expand Up @@ -661,7 +662,7 @@ export default {
trackedAmount: ({formattedAmount, comment}: RequestedAmountMessageParams) => `tracking ${formattedAmount}${comment ? ` for ${comment}` : ''}`,
splitAmount: ({amount}: SplitAmountParams) => `split ${amount}`,
didSplitAmount: ({formattedAmount, comment}: DidSplitAmountMessageParams) => `split ${formattedAmount}${comment ? ` for ${comment}` : ''}`,
amountEach: ({amount}: AmountEachParams) => `${amount} each`,
yourSplit: ({amount}: UserSplitParams) => `Your split ${amount}`,
payerOwesAmount: ({payer, amount, comment}: PayerOwesAmountParams) => `${payer} owes ${amount}${comment ? ` for ${comment}` : ''}`,
payerOwes: ({payer}: PayerOwesParams) => `${payer} owes: `,
payerPaidAmount: ({payer, amount}: PayerPaidAmountParams): string => `${payer ? `${payer} ` : ''}paid ${amount}`,
Expand Down Expand Up @@ -698,7 +699,8 @@ export default {
invalidCategoryLength: 'The length of the category chosen exceeds the maximum allowed (255). Please choose a different or shorten the category name first.',
invalidAmount: 'Please enter a valid amount before continuing.',
invalidTaxAmount: ({amount}: RequestAmountParams) => `Maximum tax amount is ${amount}`,
invalidSplit: 'Split amounts do not equal total amount',
invalidSplit: ({invalidAmount, correctAmount}: InvalidSplitTotalParams) => `You entered ${invalidAmount} but the total is ${correctAmount}`,
invalidSplitParticipants: 'Enter an amount greater than zero for at least two participants',
other: 'Unexpected error, please try again later',
genericCreateFailureMessage: 'Unexpected error submitting this expense. Please try again later.',
receiptFailureMessage: "The receipt didn't upload. ",
Expand Down
10 changes: 6 additions & 4 deletions src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import type {
AddressLineParams,
AdminCanceledRequestParams,
AlreadySignedInParams,
AmountEachParams,
ApprovedAmountParams,
BeginningOfChatHistoryAdminRoomPartOneParams,
BeginningOfChatHistoryAnnounceRoomPartOneParams,
Expand All @@ -28,6 +27,7 @@ import type {
GoBackMessageParams,
GoToRoomParams,
InstantSummaryParams,
InvalidSplitTotalParams,
LocalTimeParams,
LoggedInAsParams,
LogSizeParams,
Expand Down Expand Up @@ -81,6 +81,7 @@ import type {
UpdatedTheRequestParams,
UsePlusButtonParams,
UserIsAlreadyMemberParams,
UserSplitParams,
ViolationsAutoReportedRejectedExpenseParams,
ViolationsCashExpenseWithNoReceiptParams,
ViolationsConversionSurchargeParams,
Expand Down Expand Up @@ -389,7 +390,7 @@ export default {
},
moneyRequestConfirmationList: {
paidBy: 'Pagado por',
splitWith: 'Dividir con',
splitAmounts: 'Importes a dividir',
whatsItFor: '¿Para qué es?',
},
optionsSelector: {
Expand Down Expand Up @@ -654,7 +655,7 @@ export default {
trackedAmount: ({formattedAmount, comment}: RequestedAmountMessageParams) => `realizó un seguimiento de ${formattedAmount}${comment ? ` para ${comment}` : ''}`,
splitAmount: ({amount}: SplitAmountParams) => `dividir ${amount}`,
didSplitAmount: ({formattedAmount, comment}: DidSplitAmountMessageParams) => `dividió ${formattedAmount}${comment ? ` para ${comment}` : ''}`,
amountEach: ({amount}: AmountEachParams) => `${amount} cada uno`,
yourSplit: ({amount}: UserSplitParams) => `Tu parte ${amount}`,
payerOwesAmount: ({payer, amount, comment}: PayerOwesAmountParams) => `${payer} debe ${amount}${comment ? ` para ${comment}` : ''}`,
payerOwes: ({payer}: PayerOwesParams) => `${payer} debe: `,
payerPaidAmount: ({payer, amount}: PayerPaidAmountParams) => `${payer ? `${payer} ` : ''}pagó ${amount}`,
Expand Down Expand Up @@ -693,7 +694,8 @@ export default {
invalidCategoryLength: 'El largo de la categoría escogida excede el máximo permitido (255). Por favor, escoge otra categoría o acorta la categoría primero.',
invalidAmount: 'Por favor, ingresa un importe válido antes de continuar.',
invalidTaxAmount: ({amount}: RequestAmountParams) => `El importe máximo del impuesto es ${amount}`,
invalidSplit: 'La suma de las partes no equivale al importe total',
invalidSplit: ({invalidAmount, correctAmount}: InvalidSplitTotalParams) => `Has introducido ${invalidAmount} pero el total es ${correctAmount}`,
invalidSplitParticipants: 'Introduce un importe superior a cero para al menos dos participantes',
other: 'Error inesperado, por favor inténtalo más tarde',
genericCreateFailureMessage: 'Error inesperado al enviar este gasto. Por favor, inténtalo más tarde.',
receiptFailureMessage: 'El recibo no se subió. ',
Expand Down
7 changes: 5 additions & 2 deletions src/languages/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ type SplitAmountParams = {amount: string};

type DidSplitAmountMessageParams = {formattedAmount: string; comment: string};

type AmountEachParams = {amount: string};
type UserSplitParams = {amount: string};

type PayerOwesAmountParams = {payer: string; amount: number | string; comment?: string};

Expand Down Expand Up @@ -302,12 +302,14 @@ type DistanceRateOperationsParams = {count: number};

type ReimbursementRateParams = {unit: Unit};

type InvalidSplitTotalParams = {invalidAmount: string; correctAmount: string};

export type {
AdminCanceledRequestParams,
ApprovedAmountParams,
AddressLineParams,
AlreadySignedInParams,
AmountEachParams,
UserSplitParams,
BeginningOfChatHistoryAdminRoomPartOneParams,
BeginningOfChatHistoryAnnounceRoomPartOneParams,
BeginningOfChatHistoryAnnounceRoomPartTwo,
Expand Down Expand Up @@ -407,4 +409,5 @@ export type {
HeldRequestParams,
PaySomeoneParams,
ReimbursementRateParams,
InvalidSplitTotalParams,
};
5 changes: 5 additions & 0 deletions src/libs/ReportUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import type {FileObject} from '@components/AttachmentModal';
import * as Expensicons from '@components/Icon/Expensicons';
import * as defaultGroupAvatars from '@components/Icon/GroupDefaultAvatars';
import * as defaultWorkspaceAvatars from '@components/Icon/WorkspaceDefaultAvatars';
import type {MoneyRequestAmountInputProps} from '@components/MoneyRequestAmountInput';
import type {IOUAction, IOUType} from '@src/CONST';
import CONST from '@src/CONST';
import type {ParentNavigationSummaryParams, TranslationPaths} from '@src/languages/types';
Expand Down Expand Up @@ -441,6 +442,10 @@ type OptionData = {
reportID?: string;
enabled?: boolean;
data?: Partial<TaxRate>;
transactionThreadReportID?: string | null;
shouldShowAmountInput?: boolean;
amountInputProps?: MoneyRequestAmountInputProps;
tabIndex?: 0 | -1;
} & Report;

type OnyxDataTaskAssigneeChat = {
Expand Down
Loading
Loading