From b7c3166fab825e977ce0b6a58741db33600bbf72 Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Mon, 12 Apr 2021 14:24:10 -0700 Subject: [PATCH] IO-879 Added bill enter cancel confirmation --- bodyshop_translations.babel | 21 +++++++++++++++++++ .../bill-enter-modal.container.jsx | 6 +++++- client/src/translations/en_us/common.json | 1 + client/src/translations/es/common.json | 1 + client/src/translations/fr/common.json | 1 + 5 files changed, 29 insertions(+), 1 deletion(-) diff --git a/bodyshop_translations.babel b/bodyshop_translations.babel index 715cdad14..93d088cbc 100644 --- a/bodyshop_translations.babel +++ b/bodyshop_translations.babel @@ -12102,6 +12102,27 @@ + + cancel + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + confirmpassword false diff --git a/client/src/components/bill-enter-modal/bill-enter-modal.container.jsx b/client/src/components/bill-enter-modal/bill-enter-modal.container.jsx index 8e41fcee6..bd2085c49 100644 --- a/client/src/components/bill-enter-modal/bill-enter-modal.container.jsx +++ b/client/src/components/bill-enter-modal/bill-enter-modal.container.jsx @@ -191,7 +191,10 @@ function BillEnterModalContainer({ }; const handleCancel = () => { - toggleModalVisible(); + const r = window.confirm(t("general.labels.cancel")); + if (r === true) { + toggleModalVisible(); + } }; useEffect(() => { @@ -227,6 +230,7 @@ function BillEnterModalContainer({ width={"90%"} visible={billEnterModal.visible} okText={t("general.actions.save")} + keyboard="false" onOk={() => form.submit()} onCancel={handleCancel} afterClose={() => form.resetFields()} diff --git a/client/src/translations/en_us/common.json b/client/src/translations/en_us/common.json index df051be15..cde10cc5c 100644 --- a/client/src/translations/en_us/common.json +++ b/client/src/translations/en_us/common.json @@ -778,6 +778,7 @@ "actions": "Actions", "areyousure": "Are you sure?", "barcode": "Barcode", + "cancel": "Are you sure you want to cancel? Your changes will not be saved.", "confirmpassword": "Confirm Password", "email": "Email", "errors": "Errors", diff --git a/client/src/translations/es/common.json b/client/src/translations/es/common.json index b61d27ce0..d5cc45a58 100644 --- a/client/src/translations/es/common.json +++ b/client/src/translations/es/common.json @@ -778,6 +778,7 @@ "actions": "Comportamiento", "areyousure": "", "barcode": "código de barras", + "cancel": "", "confirmpassword": "", "email": "", "errors": "", diff --git a/client/src/translations/fr/common.json b/client/src/translations/fr/common.json index 841193043..072e272cc 100644 --- a/client/src/translations/fr/common.json +++ b/client/src/translations/fr/common.json @@ -778,6 +778,7 @@ "actions": "actes", "areyousure": "", "barcode": "code à barre", + "cancel": "", "confirmpassword": "", "email": "", "errors": "",