Update invoice error messages

This commit is contained in:
Dawid Tarasiuk 2020-06-24 19:12:51 +02:00
parent 8a756f539b
commit 81115da9e0
2 changed files with 66 additions and 6 deletions

View file

@ -2667,6 +2667,13 @@
"context": "order history message",
"string": "Order was cancelled"
},
"src_dot_orders_dot_components_dot_OrderInvoiceEmailSendDialog_dot_1821123638": {
"string": "Are you sure you want to send this invoice: {invoiceNumber} to the customer?"
},
"src_dot_orders_dot_components_dot_OrderInvoiceEmailSendDialog_dot_2166306944": {
"context": "dialog header",
"string": "Send Invoice"
},
"src_dot_orders_dot_components_dot_OrderInvoiceList_dot_24460204": {
"context": "section header",
"string": "Invoices"
@ -2868,6 +2875,9 @@
"context": "order line total price",
"string": "Total"
},
"src_dot_orders_dot_views_dot_OrderDetails_dot_1039259580": {
"string": "Were generating the invoice you requested. Please wait a couple of moments"
},
"src_dot_orders_dot_views_dot_OrderDetails_dot_1056718390": {
"string": "Payment successfully captured"
},
@ -2901,6 +2911,12 @@
"src_dot_orders_dot_views_dot_OrderDetails_dot_3367579693": {
"string": "Order successfully updated"
},
"src_dot_orders_dot_views_dot_OrderDetails_dot_4085755992": {
"string": "Invoice email sent"
},
"src_dot_orders_dot_views_dot_OrderDetails_dot_55607988": {
"string": "Invoice is Generating"
},
"src_dot_orders_dot_views_dot_OrderDetails_dot_580490159": {
"context": "window title",
"string": "Order #{orderNumber}"
@ -5136,6 +5152,10 @@
"src_dot_utils_dot_errors_dot_duplicatedInputItem": {
"string": "Cannot add and remove group the same time"
},
"src_dot_utils_dot_errors_dot_emailNotSet": {
"context": "error message",
"string": "Email address is not set"
},
"src_dot_utils_dot_errors_dot_graphqlError": {
"string": "API error"
},
@ -5145,6 +5165,10 @@
"src_dot_utils_dot_errors_dot_invalidPassword": {
"string": "Invalid password"
},
"src_dot_utils_dot_errors_dot_invalidStatus": {
"context": "error message",
"string": "Cannot request an invoice for draft order"
},
"src_dot_utils_dot_errors_dot_noShippingAddress": {
"context": "error message",
"string": "Cannot choose a shipping method for an order without the shipping address"
@ -5153,6 +5177,18 @@
"context": "error message",
"string": "Only draft orders can be edited"
},
"src_dot_utils_dot_errors_dot_notFound": {
"context": "error message",
"string": "Invoice not found"
},
"src_dot_utils_dot_errors_dot_notReady": {
"context": "error message",
"string": "Billing address is not set or invoice is not ready to be send"
},
"src_dot_utils_dot_errors_dot_numberNotSet": {
"context": "error message",
"string": "Number not set for an invoice"
},
"src_dot_utils_dot_errors_dot_outOfScopeGroup": {
"string": "Group is out of your permission scope"
},
@ -5200,6 +5236,10 @@
"src_dot_utils_dot_errors_dot_unknownError": {
"string": "Unknown error"
},
"src_dot_utils_dot_errors_dot_urlNotSet": {
"context": "error message",
"string": "URL not set for an invoice"
},
"src_dot_utils_dot_errors_dot_variantNoDigitalContent": {
"string": "This variant does not have any digital content"
},

View file

@ -9,6 +9,27 @@ const messages = defineMessages({
emailNotSet: {
defaultMessage: "Email address is not set",
description: "error message"
},
invalidStatus: {
defaultMessage: "Cannot request an invoice for draft order",
description: "error message"
},
notFound: {
defaultMessage: "Invoice not found",
description: "error message"
},
notReady: {
defaultMessage:
"Billing address is not set or invoice is not ready to be send",
description: "error message"
},
numberNotSet: {
defaultMessage: "Number not set for an invoice",
description: "error message"
},
urlNotSet: {
defaultMessage: "URL not set for an invoice",
description: "error message"
}
});
@ -21,16 +42,15 @@ function getInvoiceErrorMessage(
case InvoiceErrorCode.EMAIL_NOT_SET:
return intl.formatMessage(messages.emailNotSet);
case InvoiceErrorCode.INVALID_STATUS:
// TODO: update error messages
return intl.formatMessage({ defaultMessage: "" });
return intl.formatMessage(messages.invalidStatus);
case InvoiceErrorCode.NOT_FOUND:
return intl.formatMessage({ defaultMessage: "" });
return intl.formatMessage(messages.notFound);
case InvoiceErrorCode.NOT_READY:
return intl.formatMessage({ defaultMessage: "" });
return intl.formatMessage(messages.notReady);
case InvoiceErrorCode.NUMBER_NOT_SET:
return intl.formatMessage({ defaultMessage: "" });
return intl.formatMessage(messages.numberNotSet);
case InvoiceErrorCode.URL_NOT_SET:
return intl.formatMessage({ defaultMessage: "" });
return intl.formatMessage(messages.urlNotSet);
case InvoiceErrorCode.REQUIRED:
return intl.formatMessage(commonMessages.requiredField);
default: