saleor-dashboard/src/storybook/stories/orders/OrderPaymentVoidDialog.tsx
Wojciech Mista 29461658a2
Add api error log in notifications (#1873)
* 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
2022-03-04 11:52:58 +01:00

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"
}
]}
/>
));