diff --git a/locale/defaultMessages.json b/locale/defaultMessages.json index cde614428..3e8ad6c52 100644 --- a/locale/defaultMessages.json +++ b/locale/defaultMessages.json @@ -919,6 +919,10 @@ "context": "modal button", "string": "Upload URL" }, + "4XhJY+": { + "context": "dialog header", + "string": "Add product from {channelName}" + }, "4Z0O2B": { "context": "section header title", "string": "Gift Card Timeline" @@ -1524,10 +1528,6 @@ "context": "number of webhook headers in model", "string": "{number,plural,one{{number} header} other{{number} custom request headers}}" }, - "9Y6vg+": { - "context": "dialog header", - "string": "Add product" - }, "9YazHG": { "string": "Company" }, @@ -4329,6 +4329,10 @@ "context": "orders section name", "string": "Orders" }, + "Taa5V7": { + "context": "dialog subtitle", + "string": "You can only add products available for the order's channel" + }, "Tenl9A": { "context": "grant refund, refund card toggle", "string": "Refund shipment: {currency} {amount}" diff --git a/src/orders/components/OrderProductAddDialog/OrderProductAddDialog.tsx b/src/orders/components/OrderProductAddDialog/OrderProductAddDialog.tsx index f058974ff..ba83366de 100644 --- a/src/orders/components/OrderProductAddDialog/OrderProductAddDialog.tsx +++ b/src/orders/components/OrderProductAddDialog/OrderProductAddDialog.tsx @@ -29,6 +29,7 @@ import { Typography, } from "@material-ui/core"; import { ConfirmButtonTransitionState } from "@saleor/macaw-ui"; +import { Text } from "@saleor/macaw-ui/next"; import React from "react"; import InfiniteScroll from "react-infinite-scroll-component"; import { FormattedMessage, useIntl } from "react-intl"; @@ -53,6 +54,7 @@ export interface OrderProductAddDialogProps extends FetchMoreProps { onSubmit: ( data: SearchOrderVariantQuery["search"]["edges"][0]["node"]["variants"], ) => void; + channelName?: string; } const scrollableTargetId = "orderProductAddScrollableDialog"; @@ -69,6 +71,7 @@ const OrderProductAddDialog: React.FC = props => { onFetchMore, onClose, onSubmit, + channelName, } = props; const classes = useStyles(props); @@ -126,8 +129,18 @@ const OrderProductAddDialog: React.FC = props => { maxWidth="sm" > - + + + + + + = ({ onClose={closeModal} onFetch={variantSearch} onFetchMore={loadMore} + channelName={order.channel.name} onSubmit={variants => extractMutationErrors( orderLinesAdd.mutate({ diff --git a/src/orders/views/OrderDetails/OrderUnconfirmedDetails/index.tsx b/src/orders/views/OrderDetails/OrderUnconfirmedDetails/index.tsx index 637f07ddb..a98da9678 100644 --- a/src/orders/views/OrderDetails/OrderUnconfirmedDetails/index.tsx +++ b/src/orders/views/OrderDetails/OrderUnconfirmedDetails/index.tsx @@ -332,6 +332,7 @@ export const OrderUnconfirmedDetails: React.FC< onClose={closeModal} onFetch={variantSearch} onFetchMore={loadMore} + channelName={order.channel?.name} onSubmit={variants => orderLinesAdd.mutate({ id,