From 23c77e2cdd64f19211347bfb7930628e90b84c57 Mon Sep 17 00:00:00 2001 From: Rodrigo Lino da Costa Date: Wed, 22 May 2024 10:00:52 -0300 Subject: [PATCH 1/2] add traslation for hold violation --- src/CONST.ts | 1 + src/languages/en.ts | 1 + src/languages/es.ts | 1 + src/libs/Violations/ViolationsUtils.ts | 2 ++ 4 files changed, 5 insertions(+) diff --git a/src/CONST.ts b/src/CONST.ts index 6517ece4276d9..8367f7d4c56ba 100755 --- a/src/CONST.ts +++ b/src/CONST.ts @@ -3673,6 +3673,7 @@ const CONST = { TAX_OUT_OF_POLICY: 'taxOutOfPolicy', TAX_RATE_CHANGED: 'taxRateChanged', TAX_REQUIRED: 'taxRequired', + HOLD: 'hold', }, /** Context menu types */ diff --git a/src/languages/en.ts b/src/languages/en.ts index f8d122f3b69ae..c2ea960298846 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -3059,6 +3059,7 @@ export default { taxOutOfPolicy: ({taxName}: ViolationsTaxOutOfPolicyParams) => `${taxName ?? 'Tax'} no longer valid`, taxRateChanged: 'Tax rate was modified', taxRequired: 'Missing tax rate', + hold: 'Hold', }, violationDismissal: { rter: { diff --git a/src/languages/es.ts b/src/languages/es.ts index 536a6182f393b..3f833fdd698e0 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -3563,6 +3563,7 @@ export default { taxOutOfPolicy: ({taxName}: ViolationsTaxOutOfPolicyParams) => `${taxName ?? 'El impuesto'} ya no es vĂ¡lido`, taxRateChanged: 'La tasa de impuesto fue modificada', taxRequired: 'Falta la tasa de impuesto', + hold: 'Bloqueada', }, violationDismissal: { rter: { diff --git a/src/libs/Violations/ViolationsUtils.ts b/src/libs/Violations/ViolationsUtils.ts index 42f58be1d6999..eb5f0311a37ab 100644 --- a/src/libs/Violations/ViolationsUtils.ts +++ b/src/libs/Violations/ViolationsUtils.ts @@ -280,6 +280,8 @@ const ViolationsUtils = { return translate('violations.taxRateChanged'); case 'taxRequired': return translate('violations.taxRequired'); + case 'hold': + return translate('violations.hold'); default: // The interpreter should never get here because the switch cases should be exhaustive. // If typescript is showing an error on the assertion below it means the switch statement is out of From fd5c9db808343c216eda1e2deb404c74bdcd54f4 Mon Sep 17 00:00:00 2001 From: Rodrigo Lino da Costa Date: Thu, 23 May 2024 17:18:50 -0300 Subject: [PATCH 2/2] adds none as field for violation --- src/hooks/useViolations.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/hooks/useViolations.ts b/src/hooks/useViolations.ts index 7aadb4ce4ca3c..d1cc7ec701817 100644 --- a/src/hooks/useViolations.ts +++ b/src/hooks/useViolations.ts @@ -5,7 +5,7 @@ import type {TransactionViolation, ViolationName} from '@src/types/onyx'; /** * Names of Fields where violations can occur. */ -type ViolationField = 'amount' | 'billable' | 'category' | 'comment' | 'date' | 'merchant' | 'receipt' | 'tag' | 'tax'; +type ViolationField = 'amount' | 'billable' | 'category' | 'comment' | 'date' | 'merchant' | 'receipt' | 'tag' | 'tax' | 'none'; /** * Map from Violation Names to the field where that violation can occur. @@ -44,6 +44,7 @@ const violationFields: Record = { taxOutOfPolicy: 'tax', taxRateChanged: 'tax', taxRequired: 'tax', + hold: 'none', }; type ViolationsMap = Map;