Fix draft order incorrect label (#1375) (#1384)

* changed order draft label from 'add customers first' to 'add shipping address first'

* ran extract-messages

* moved messages to a separate file

* changed exports from default to named
This commit is contained in:
Michał Droń 2021-09-13 13:24:48 +02:00 committed by GitHub
parent 19e9b0ffc2
commit 5c986799f0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 45 additions and 42 deletions

View file

@ -3879,14 +3879,14 @@
"context": "total price of ordered products",
"string": "Total"
},
"src_dot_orders_dot_components_dot_OrderDraftDetailsSummary_dot_addCustomerInfo": {
"context": "add customer first label",
"string": "add customer first"
},
"src_dot_orders_dot_components_dot_OrderDraftDetailsSummary_dot_addDiscount": {
"context": "add discount button",
"string": "Add Discount"
},
"src_dot_orders_dot_components_dot_OrderDraftDetailsSummary_dot_addShippingAddressInfo": {
"context": "add shipping address first label",
"string": "add shipping address first"
},
"src_dot_orders_dot_components_dot_OrderDraftDetailsSummary_dot_addShippingCarrier": {
"context": "add shipping carrier button",
"string": "Add shipping carrier"

View file

@ -8,11 +8,11 @@ import { OrderDiscountData } from "@saleor/products/components/OrderDiscountProv
import { DiscountValueTypeEnum } from "@saleor/types/globalTypes";
import React, { useRef } from "react";
import { useIntl } from "react-intl";
import { defineMessages } from "react-intl";
import { OrderDetails_order } from "../../types/OrderDetails";
import OrderDiscountCommonModal from "../OrderDiscountCommonModal";
import { ORDER_DISCOUNT } from "../OrderDiscountCommonModal/types";
import { messages } from "./messages";
const useStyles = makeStyles(
theme => ({
@ -46,41 +46,6 @@ const useStyles = makeStyles(
{ name: "OrderDraftDetailsSummary" }
);
const messages = defineMessages({
addCustomerInfo: {
defaultMessage: "add customer first",
description: "add customer first label"
},
subtotal: {
defaultMessage: "Subtotal",
description: "subtotal price"
},
addDiscount: {
defaultMessage: "Add Discount",
description: "add discount button"
},
discount: {
defaultMessage: "Discount",
description: "discount button"
},
addShippingCarrier: {
defaultMessage: "Add shipping carrier",
description: "add shipping carrier button"
},
noShippingCarriers: {
defaultMessage: "No applicable shipping carriers",
description: "no shipping carriers title"
},
total: {
defaultMessage: "Total",
description: "total price"
},
taxes: {
defaultMessage: "Taxes (VAT included)",
description: "taxes title"
}
});
const PRICE_PLACEHOLDER = "---";
interface OrderDraftDetailsSummaryProps
@ -181,7 +146,9 @@ const OrderDraftDetailsSummary: React.FC<OrderDraftDetailsSummaryProps> = props
);
}
const addCustomerInfo = intl.formatMessage(messages.addCustomerInfo);
const addShippingAddressInfo = intl.formatMessage(
messages.addShippingAddressInfo
);
return (
<div className={classes.shippingMethodContainer}>
@ -189,7 +156,7 @@ const OrderDraftDetailsSummary: React.FC<OrderDraftDetailsSummaryProps> = props
{shippingCarrierBase}
</Link>
<HorizontalSpacer />
<Typography variant="caption">{`(${addCustomerInfo})`}</Typography>
<Typography variant="caption">{`(${addShippingAddressInfo})`}</Typography>
</div>
);
};

View file

@ -0,0 +1,36 @@
import { defineMessages } from "react-intl";
export const messages = defineMessages({
addShippingAddressInfo: {
defaultMessage: "add shipping address first",
description: "add shipping address first label"
},
subtotal: {
defaultMessage: "Subtotal",
description: "subtotal price"
},
addDiscount: {
defaultMessage: "Add Discount",
description: "add discount button"
},
discount: {
defaultMessage: "Discount",
description: "discount button"
},
addShippingCarrier: {
defaultMessage: "Add shipping carrier",
description: "add shipping carrier button"
},
noShippingCarriers: {
defaultMessage: "No applicable shipping carriers",
description: "no shipping carriers title"
},
total: {
defaultMessage: "Total",
description: "total price"
},
taxes: {
defaultMessage: "Taxes (VAT included)",
description: "taxes title"
}
});