
* 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
47 lines
1.4 KiB
TypeScript
47 lines
1.4 KiB
TypeScript
import { OrderErrorCode } from "@saleor/graphql";
|
|
import { storiesOf } from "@storybook/react";
|
|
import React from "react";
|
|
|
|
import OrderShippingMethodEditDialog, {
|
|
OrderShippingMethodEditDialogProps,
|
|
} from "../../../orders/components/OrderShippingMethodEditDialog";
|
|
import { order as orderFixture } from "../../../orders/fixtures";
|
|
import Decorator from "../../Decorator";
|
|
|
|
const order = orderFixture("");
|
|
const props: OrderShippingMethodEditDialogProps = {
|
|
confirmButtonState: "default",
|
|
errors: [],
|
|
onClose: () => undefined,
|
|
onSubmit: () => undefined,
|
|
open: true,
|
|
shippingMethod: null,
|
|
shippingMethods: order.shippingMethods,
|
|
};
|
|
|
|
storiesOf("Orders / OrderShippingMethodEditDialog", module)
|
|
.addDecorator(Decorator)
|
|
.add("default", () => <OrderShippingMethodEditDialog {...props} />)
|
|
.add("errors", () => (
|
|
<OrderShippingMethodEditDialog
|
|
{...props}
|
|
errors={[
|
|
{
|
|
__typename: "OrderError",
|
|
code: OrderErrorCode.SHIPPING_METHOD_NOT_APPLICABLE,
|
|
field: "shippingMethod",
|
|
addressType: null,
|
|
message: "Shipping method not applicable",
|
|
orderLines: null,
|
|
},
|
|
{
|
|
__typename: "OrderError",
|
|
code: OrderErrorCode.GRAPHQL_ERROR,
|
|
field: null,
|
|
addressType: null,
|
|
message: "Graphql error",
|
|
orderLines: null,
|
|
},
|
|
]}
|
|
/>
|
|
));
|