
* Update schema * refactor(shippingMethods): change name from availableShippingMethods to shippingMethod * refactor(shippingMethods): change shippingMethod to shippingMethodType * Add missing files * refactor(order): add active and message prop to the shippingMethod field * Add support for new webhook types * refactor(OrderShippingMethodEditDialog): show inactive shipping method as disabled * refactor(SingleSelectField): change the disabled prop strictly boolean Co-authored-by: Dominik Żegleń <flesz3@o2.pl> * refactor(OrderShippingMethodEditDialog): remove unused style Co-authored-by: Michal Zajac <michal.99.zajac@gmail.com> Co-authored-by: Michal Zajac <50200782+Michal99Zajac@users.noreply.github.com> Co-authored-by: Dominik Żegleń <flesz3@o2.pl>
43 lines
1.2 KiB
TypeScript
43 lines
1.2 KiB
TypeScript
import { OrderErrorCode } from "@saleor/types/globalTypes";
|
|
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
|
|
},
|
|
{
|
|
__typename: "OrderError",
|
|
code: OrderErrorCode.GRAPHQL_ERROR,
|
|
field: null,
|
|
addressType: null
|
|
}
|
|
]}
|
|
/>
|
|
));
|