Fix stories

This commit is contained in:
dominik-zeglen 2019-09-12 15:31:08 +02:00
parent 490c3b7543
commit 08cbf24964
9 changed files with 76 additions and 28 deletions

View file

@ -17,7 +17,7 @@ import {
import { ProductTypeList_productTypes_edges_node } from "../../types/ProductTypeList"; import { ProductTypeList_productTypes_edges_node } from "../../types/ProductTypeList";
import ProductTypeList from "../ProductTypeList"; import ProductTypeList from "../ProductTypeList";
interface ProductTypeListPageProps export interface ProductTypeListPageProps
extends PageListProps, extends PageListProps,
ListActions, ListActions,
SearchPageProps, SearchPageProps,

View file

@ -5,12 +5,19 @@ import CollectionListPage, {
CollectionListPageProps CollectionListPageProps
} from "../../../collections/components/CollectionListPage"; } from "../../../collections/components/CollectionListPage";
import { collections } from "../../../collections/fixtures"; import { collections } from "../../../collections/fixtures";
import { listActionsProps, pageListProps } from "../../../fixtures"; import {
listActionsProps,
pageListProps,
searchPageProps,
tabPageProps
} from "../../../fixtures";
import Decorator from "../../Decorator"; import Decorator from "../../Decorator";
const props: CollectionListPageProps = { const props: CollectionListPageProps = {
...listActionsProps, ...listActionsProps,
...pageListProps.default, ...pageListProps.default,
...searchPageProps,
...tabPageProps,
collections collections
}; };
@ -19,4 +26,5 @@ storiesOf("Views / Collections / Collection list", module)
.add("default", () => <CollectionListPage {...props} />) .add("default", () => <CollectionListPage {...props} />)
.add("loading", () => ( .add("loading", () => (
<CollectionListPage {...props} collections={undefined} disabled={true} /> <CollectionListPage {...props} collections={undefined} disabled={true} />
)); ))
.add("no data", () => <CollectionListPage {...props} collections={[]} />);

View file

@ -5,12 +5,19 @@ import CustomerListPage, {
CustomerListPageProps CustomerListPageProps
} from "../../../customers/components/CustomerListPage"; } from "../../../customers/components/CustomerListPage";
import { customerList } from "../../../customers/fixtures"; import { customerList } from "../../../customers/fixtures";
import { listActionsProps, pageListProps } from "../../../fixtures"; import {
listActionsProps,
pageListProps,
searchPageProps,
tabPageProps
} from "../../../fixtures";
import Decorator from "../../Decorator"; import Decorator from "../../Decorator";
const props: CustomerListPageProps = { const props: CustomerListPageProps = {
...listActionsProps, ...listActionsProps,
...pageListProps.default, ...pageListProps.default,
...searchPageProps,
...tabPageProps,
customers: customerList customers: customerList
}; };

View file

@ -5,12 +5,19 @@ import SaleListPage, {
SaleListPageProps SaleListPageProps
} from "../../../discounts/components/SaleListPage"; } from "../../../discounts/components/SaleListPage";
import { saleList } from "../../../discounts/fixtures"; import { saleList } from "../../../discounts/fixtures";
import { listActionsProps, pageListProps } from "../../../fixtures"; import {
listActionsProps,
pageListProps,
searchPageProps,
tabPageProps
} from "../../../fixtures";
import Decorator from "../../Decorator"; import Decorator from "../../Decorator";
const props: SaleListPageProps = { const props: SaleListPageProps = {
...listActionsProps, ...listActionsProps,
...pageListProps.default, ...pageListProps.default,
...searchPageProps,
...tabPageProps,
defaultCurrency: "USD", defaultCurrency: "USD",
sales: saleList sales: saleList
}; };

View file

@ -5,12 +5,19 @@ import VoucherListPage, {
VoucherListPageProps VoucherListPageProps
} from "../../../discounts/components/VoucherListPage"; } from "../../../discounts/components/VoucherListPage";
import { voucherList } from "../../../discounts/fixtures"; import { voucherList } from "../../../discounts/fixtures";
import { listActionsProps, pageListProps } from "../../../fixtures"; import {
listActionsProps,
pageListProps,
searchPageProps,
tabPageProps
} from "../../../fixtures";
import Decorator from "../../Decorator"; import Decorator from "../../Decorator";
const props: VoucherListPageProps = { const props: VoucherListPageProps = {
...listActionsProps, ...listActionsProps,
...pageListProps.default, ...pageListProps.default,
...searchPageProps,
...tabPageProps,
defaultCurrency: "USD", defaultCurrency: "USD",
vouchers: voucherList vouchers: voucherList
}; };

View file

@ -1,7 +1,12 @@
import { storiesOf } from "@storybook/react"; import { storiesOf } from "@storybook/react";
import React from "react"; import React from "react";
import { listActionsProps, pageListProps } from "../../../fixtures"; import {
listActionsProps,
pageListProps,
searchPageProps,
tabPageProps
} from "../../../fixtures";
import OrderDraftListPage, { import OrderDraftListPage, {
OrderDraftListPageProps OrderDraftListPageProps
} from "../../../orders/components/OrderDraftListPage"; } from "../../../orders/components/OrderDraftListPage";
@ -11,6 +16,8 @@ import Decorator from "../../Decorator";
const props: OrderDraftListPageProps = { const props: OrderDraftListPageProps = {
...listActionsProps, ...listActionsProps,
...pageListProps.default, ...pageListProps.default,
...searchPageProps,
...tabPageProps,
onAdd: () => undefined, onAdd: () => undefined,
orders orders
}; };

View file

@ -1,26 +1,31 @@
import { storiesOf } from "@storybook/react"; import { storiesOf } from "@storybook/react";
import React from "react"; import React from "react";
import { listActionsProps, pageListProps } from "../../../fixtures"; import {
import ProductTypeListPage from "../../../productTypes/components/ProductTypeListPage"; listActionsProps,
pageListProps,
searchPageProps,
tabPageProps
} from "../../../fixtures";
import ProductTypeListPage, {
ProductTypeListPageProps
} from "../../../productTypes/components/ProductTypeListPage";
import { productTypes } from "../../../productTypes/fixtures"; import { productTypes } from "../../../productTypes/fixtures";
import Decorator from "../../Decorator"; import Decorator from "../../Decorator";
const props: ProductTypeListPageProps = {
...listActionsProps,
...pageListProps.default,
...searchPageProps,
...tabPageProps,
onBack: () => undefined,
productTypes
};
storiesOf("Views / Product types / Product types list", module) storiesOf("Views / Product types / Product types list", module)
.addDecorator(Decorator) .addDecorator(Decorator)
.add("default", () => ( .add("default", () => <ProductTypeListPage {...props} />)
<ProductTypeListPage
onBack={() => undefined}
productTypes={productTypes}
{...listActionsProps}
{...pageListProps.default}
/>
))
.add("loading", () => ( .add("loading", () => (
<ProductTypeListPage <ProductTypeListPage {...props} disabled={true} productTypes={undefined} />
onBack={() => undefined} ))
productTypes={undefined} .add("no data", () => <ProductTypeListPage {...props} productTypes={[]} />);
{...listActionsProps}
{...pageListProps.loading}
/>
));

View file

@ -1,7 +1,11 @@
import { storiesOf } from "@storybook/react"; import { storiesOf } from "@storybook/react";
import React from "react"; import React from "react";
import { pageListProps } from "../../../fixtures"; import {
pageListProps,
searchPageProps,
tabPageProps
} from "../../../fixtures";
import StaffListPage, { import StaffListPage, {
StaffListPageProps StaffListPageProps
} from "../../../staff/components/StaffListPage"; } from "../../../staff/components/StaffListPage";
@ -9,10 +13,12 @@ import { staffMembers } from "../../../staff/fixtures";
import Decorator from "../../Decorator"; import Decorator from "../../Decorator";
const props: StaffListPageProps = { const props: StaffListPageProps = {
...pageListProps.default,
...searchPageProps,
...tabPageProps,
onAdd: undefined, onAdd: undefined,
onBack: () => undefined, onBack: () => undefined,
staffMembers, staffMembers
...pageListProps.default
}; };
storiesOf("Views / Staff / Staff members", module) storiesOf("Views / Staff / Staff members", module)

View file

@ -1,7 +1,7 @@
import { storiesOf } from "@storybook/react"; import { storiesOf } from "@storybook/react";
import React from "react"; import React from "react";
import { pageListProps } from "../../../fixtures"; import { pageListProps, searchPageProps } from "../../../fixtures";
import TranslationsEntitiesList from "../../../translations/components/TranslationsEntitiesList"; import TranslationsEntitiesList from "../../../translations/components/TranslationsEntitiesList";
import TranslationsEntitiesListPage, { import TranslationsEntitiesListPage, {
TranslationsEntitiesListPageProps TranslationsEntitiesListPageProps
@ -11,6 +11,7 @@ import Decorator from "../../Decorator";
const props: TranslationsEntitiesListPageProps = { const props: TranslationsEntitiesListPageProps = {
...pageListProps.default, ...pageListProps.default,
...searchPageProps,
children: null, children: null,
filters: { filters: {
current: "products", current: "products",