
* Add warning alert before finilizing draft order * Add line error indicators in draft order view * Handle unfilled fields errors before draft order finalize * Handle draft order line errors * Differentiate line alert severity * Fix order line alert margin * Remove unnecessairy comment * Refactor order draft alert components * Update order draft test snapshots * Refaactor order details code * Hide add products button when no products available on order draft page * Hide no shipping methods warning if they cannot be determined * Update product assignment dialog messaages * Update order channel error messages * Fix missing order lines in error crash
35 lines
988 B
TypeScript
35 lines
988 B
TypeScript
import { Typography } from "@material-ui/core";
|
|
import FormSpacer from "@saleor/components/FormSpacer";
|
|
import {
|
|
OrderDetailsFragment,
|
|
WarehouseClickAndCollectOptionEnum,
|
|
} from "@saleor/graphql";
|
|
import React from "react";
|
|
import { FormattedMessage } from "react-intl";
|
|
|
|
import messages from "./messages";
|
|
|
|
interface PickupAnnotationProps {
|
|
order?: OrderDetailsFragment;
|
|
}
|
|
|
|
export const PickupAnnotation: React.FC<PickupAnnotationProps> = ({
|
|
order,
|
|
}) => {
|
|
if (order?.deliveryMethod?.__typename === "Warehouse") {
|
|
return (
|
|
<>
|
|
<FormSpacer />
|
|
<Typography variant="caption" color="textSecondary">
|
|
{order?.deliveryMethod?.clickAndCollectOption ===
|
|
WarehouseClickAndCollectOptionEnum.LOCAL ? (
|
|
<FormattedMessage {...messages.orderCustomerFulfillmentLocal} />
|
|
) : (
|
|
<FormattedMessage {...messages.orderCustomerFulfillmentAll} />
|
|
)}
|
|
</Typography>
|
|
</>
|
|
);
|
|
}
|
|
return null;
|
|
};
|