From 2a1c046dd658d346e62364099b05645def5cfa1e Mon Sep 17 00:00:00 2001 From: Patrick Fic <> Date: Mon, 27 Jun 2022 16:17:45 -0700 Subject: [PATCH] IO-1943 Enter again bill functionality bugfix. --- bodyshop_translations.babel | 26 +++++++++++++++++++ .../bill-form/bill-form.lines.component.jsx | 15 ++++++++++- client/src/translations/en_us/common.json | 3 +++ client/src/translations/es/common.json | 3 +++ client/src/translations/fr/common.json | 3 +++ 5 files changed, 49 insertions(+), 1 deletion(-) diff --git a/bodyshop_translations.babel b/bodyshop_translations.babel index 67e97ec5a..132e51f2b 100644 --- a/bodyshop_translations.babel +++ b/bodyshop_translations.babel @@ -2063,6 +2063,32 @@ + + validation + + + atleastone + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + + + diff --git a/client/src/components/bill-form/bill-form.lines.component.jsx b/client/src/components/bill-form/bill-form.lines.component.jsx index 30aebdfe8..31ea44149 100644 --- a/client/src/components/bill-form/bill-form.lines.component.jsx +++ b/client/src/components/bill-form/bill-form.lines.component.jsx @@ -552,7 +552,20 @@ export function BillEnterModalLinesComponent({ }); return ( - + { + if (!billlines || billlines.length < 1) { + return Promise.reject( + new Error(t("billlines.validation.atleastone")) + ); + } + }, + }, + ]} + > {(fields, { add, remove, move }) => { return ( <> diff --git a/client/src/translations/en_us/common.json b/client/src/translations/en_us/common.json index 1ca15c9bd..b8b7ba774 100644 --- a/client/src/translations/en_us/common.json +++ b/client/src/translations/en_us/common.json @@ -136,6 +136,9 @@ "other": "-- Not On Estimate --", "reconciled": "Reconciled!", "unreconciled": "Unreconciled" + }, + "validation": { + "atleastone": "At least one bill line must be entered." } }, "bills": { diff --git a/client/src/translations/es/common.json b/client/src/translations/es/common.json index b0f04fef8..07c7aa35e 100644 --- a/client/src/translations/es/common.json +++ b/client/src/translations/es/common.json @@ -136,6 +136,9 @@ "other": "", "reconciled": "", "unreconciled": "" + }, + "validation": { + "atleastone": "" } }, "bills": { diff --git a/client/src/translations/fr/common.json b/client/src/translations/fr/common.json index ddb84ae53..eeeeb35b9 100644 --- a/client/src/translations/fr/common.json +++ b/client/src/translations/fr/common.json @@ -136,6 +136,9 @@ "other": "", "reconciled": "", "unreconciled": "" + }, + "validation": { + "atleastone": "" } }, "bills": {