
* add api error log in notifications * Refactor graphql error handling * Update messages * Install macaw-ui from commit hash * Make notification id be ref index rather than date * Refactor notification container styles to allow scroll * Add fix to apollo onError function to get operation name * Fix userPermission race-condition * Add refactored error handling * Temporarly install macaw from pill PR * Handle case when there are no graphql errors * Update errors * Run build-types * Update stories to include messages * Update shipping types * Traverse through onCompleted data and show errors * Update tests * Update messages * Clear error notifications on submit * Check if context exists - fix tests
34 lines
928 B
TypeScript
34 lines
928 B
TypeScript
import { OrderErrorCode } from "@saleor/types/globalTypes";
|
|
import { storiesOf } from "@storybook/react";
|
|
import React from "react";
|
|
|
|
import OrderPaymentVoidDialog, {
|
|
OrderPaymentVoidDialogProps
|
|
} from "../../../orders/components/OrderPaymentVoidDialog";
|
|
import Decorator from "../../Decorator";
|
|
|
|
const props: OrderPaymentVoidDialogProps = {
|
|
confirmButtonState: "default",
|
|
errors: [],
|
|
onClose: () => undefined,
|
|
onConfirm: () => undefined,
|
|
open: true
|
|
};
|
|
|
|
storiesOf("Orders / OrderPaymentVoidDialog", module)
|
|
.addDecorator(Decorator)
|
|
.add("default", () => <OrderPaymentVoidDialog {...props} />)
|
|
.add("errors", () => (
|
|
<OrderPaymentVoidDialog
|
|
{...props}
|
|
errors={[
|
|
{
|
|
__typename: "OrderError",
|
|
code: OrderErrorCode.VOID_INACTIVE_PAYMENT,
|
|
field: null,
|
|
addressType: null,
|
|
message: "Void inactive payment Error"
|
|
}
|
|
]}
|
|
/>
|
|
));
|