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
1 change: 1 addition & 0 deletions src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -953,6 +953,7 @@ const translations = {
error: {
invalidCategoryLength: 'The category name exceeds 255 characters. Please shorten it or choose a different category.',
invalidAmount: 'Please enter a valid amount before continuing.',
invalidIntegerAmount: 'Please enter a whole dollar amount before continuing.',
invalidTaxAmount: ({amount}: RequestAmountParams) => `Maximum tax amount is ${amount}`,
invalidSplit: 'The sum of splits must equal the total amount.',
invalidSplitParticipants: 'Please enter an amount greater than zero for at least two participants.',
Expand Down
1 change: 1 addition & 0 deletions src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -950,6 +950,7 @@ const translations = {
error: {
invalidCategoryLength: 'La longitud 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.',
invalidIntegerAmount: 'Por favor, introduce una cantidad entera en dólares antes de continuar.',
invalidTaxAmount: ({amount}: RequestAmountParams) => `El importe máximo del impuesto es ${amount}`,
invalidSplit: 'La suma de las partes debe ser igual al importe total.',
invalidSplitParticipants: 'Introduce un importe superior a cero para al menos dos participantes.',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,10 @@ function WorkspaceEditCardLimitPage({route}: WorkspaceEditCardLimitPageProps) {
const errors = ValidationUtils.getFieldRequiredErrors(values, [INPUT_IDS.LIMIT]);

// We only want integers to be sent as the limit
if (!Number.isInteger(Number(values.limit))) {
if (!Number(values.limit)) {
errors.limit = translate('iou.error.invalidAmount');
} else if (!Number.isInteger(Number(values.limit))) {
errors.limit = translate('iou.error.invalidIntegerAmount');
}

return errors;
Expand Down
5 changes: 4 additions & 1 deletion src/pages/workspace/expensifyCard/issueNew/LimitStep.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,12 @@ function LimitStep() {
const errors = ValidationUtils.getFieldRequiredErrors(values, [INPUT_IDS.LIMIT]);

// We only want integers to be sent as the limit
if (!Number(values.limit) || !Number.isInteger(Number(values.limit))) {
if (!Number(values.limit)) {
errors.limit = translate('iou.error.invalidAmount');
} else if (!Number.isInteger(Number(values.limit))) {
errors.limit = translate('iou.error.invalidIntegerAmount');
}

return errors;
},
[translate],
Expand Down