Fix stories
This commit is contained in:
parent
a028c69810
commit
9a9c6a01a1
6 changed files with 1838 additions and 150 deletions
|
@ -27,11 +27,7 @@ import { FormChange } from "@saleor/hooks/useForm";
|
|||
import { FormsetAtomicData, FormsetChange } from "@saleor/hooks/useFormset";
|
||||
import { renderCollection } from "@saleor/misc";
|
||||
import { ICONBUTTON_SIZE } from "@saleor/theme";
|
||||
import {
|
||||
getFieldError,
|
||||
getFormErrors,
|
||||
getProductErrorMessage
|
||||
} from "@saleor/utils/errors";
|
||||
import { getFormErrors, getProductErrorMessage } from "@saleor/utils/errors";
|
||||
import React from "react";
|
||||
import { FormattedMessage, useIntl } from "react-intl";
|
||||
|
||||
|
|
|
@ -207,6 +207,7 @@ export const product: (
|
|||
name: "Versatile",
|
||||
taxType: {
|
||||
__typename: "TaxType",
|
||||
description: "standard",
|
||||
taxCode: "standard"
|
||||
},
|
||||
variantAttributes: [
|
||||
|
@ -257,6 +258,7 @@ export const product: (
|
|||
sku: "59661-34207",
|
||||
taxType: {
|
||||
__typename: "TaxType",
|
||||
description: "standard",
|
||||
taxCode: "standard"
|
||||
},
|
||||
thumbnail: { __typename: "Image" as "Image", url: placeholderImage },
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -10,6 +10,7 @@ import ProductCreatePage, {
|
|||
import { product as productFixture } from "../../../products/fixtures";
|
||||
import { productTypes } from "../../../productTypes/fixtures";
|
||||
import Decorator from "../../Decorator";
|
||||
import { taxTypes } from "../taxes/fixtures";
|
||||
|
||||
const product = productFixture("");
|
||||
|
||||
|
@ -34,6 +35,7 @@ storiesOf("Views / Products / Create product", module)
|
|||
onSubmit={() => undefined}
|
||||
saveButtonBarState="default"
|
||||
warehouses={warehouseList}
|
||||
taxTypes={taxTypes}
|
||||
weightUnit="kg"
|
||||
/>
|
||||
))
|
||||
|
@ -56,6 +58,7 @@ storiesOf("Views / Products / Create product", module)
|
|||
onSubmit={() => undefined}
|
||||
saveButtonBarState="default"
|
||||
warehouses={undefined}
|
||||
taxTypes={taxTypes}
|
||||
weightUnit="kg"
|
||||
/>
|
||||
))
|
||||
|
@ -84,6 +87,7 @@ storiesOf("Views / Products / Create product", module)
|
|||
onSubmit={() => undefined}
|
||||
saveButtonBarState="default"
|
||||
warehouses={warehouseList}
|
||||
taxTypes={taxTypes}
|
||||
weightUnit="kg"
|
||||
/>
|
||||
));
|
||||
|
|
|
@ -12,6 +12,7 @@ import { storiesOf } from "@storybook/react";
|
|||
import React from "react";
|
||||
|
||||
import Decorator from "../../Decorator";
|
||||
import { taxTypes } from "../taxes/fixtures";
|
||||
|
||||
const product = productFixture(placeholderImage);
|
||||
|
||||
|
@ -40,6 +41,7 @@ const props: ProductUpdatePageProps = {
|
|||
placeholderImage,
|
||||
product,
|
||||
saveButtonBarState: "default",
|
||||
taxTypes,
|
||||
variants: product.variants,
|
||||
warehouses: warehouseList
|
||||
};
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import { TaxTypeFragment } from "@saleor/fragments/types/TaxTypeFragment";
|
||||
|
||||
import { CountryList_shop_countries } from "../../../taxes/types/CountryList";
|
||||
import { TaxRateType } from "../../../types/globalTypes";
|
||||
|
||||
|
@ -2714,3 +2716,84 @@ export const countries: CountryList = [
|
|||
vat: null
|
||||
}
|
||||
].filter(country => country.vat);
|
||||
|
||||
/* eslint-disable sort-keys */
|
||||
export const taxTypes: TaxTypeFragment[] = [
|
||||
{
|
||||
description: "accommodation",
|
||||
taxCode: "accommodation",
|
||||
__typename: "TaxType"
|
||||
},
|
||||
{
|
||||
description: "admission to cultural events",
|
||||
taxCode: "admission to cultural events",
|
||||
__typename: "TaxType"
|
||||
},
|
||||
{
|
||||
description: "admission to entertainment events",
|
||||
taxCode: "admission to entertainment events",
|
||||
__typename: "TaxType"
|
||||
},
|
||||
{
|
||||
description: "admission to sporting events",
|
||||
taxCode: "admission to sporting events",
|
||||
__typename: "TaxType"
|
||||
},
|
||||
{ description: "advertising", taxCode: "advertising", __typename: "TaxType" },
|
||||
{
|
||||
description: "agricultural supplies",
|
||||
taxCode: "agricultural supplies",
|
||||
__typename: "TaxType"
|
||||
},
|
||||
{
|
||||
description: "baby foodstuffs",
|
||||
taxCode: "baby foodstuffs",
|
||||
__typename: "TaxType"
|
||||
},
|
||||
{ description: "bikes", taxCode: "bikes", __typename: "TaxType" },
|
||||
{ description: "books", taxCode: "books", __typename: "TaxType" },
|
||||
{
|
||||
description: "childrens clothing",
|
||||
taxCode: "childrens clothing",
|
||||
__typename: "TaxType"
|
||||
},
|
||||
{
|
||||
description: "domestic fuel",
|
||||
taxCode: "domestic fuel",
|
||||
__typename: "TaxType"
|
||||
},
|
||||
{
|
||||
description: "domestic services",
|
||||
taxCode: "domestic services",
|
||||
__typename: "TaxType"
|
||||
},
|
||||
{ description: "e-books", taxCode: "e-books", __typename: "TaxType" },
|
||||
{ description: "foodstuffs", taxCode: "foodstuffs", __typename: "TaxType" },
|
||||
{ description: "hotels", taxCode: "hotels", __typename: "TaxType" },
|
||||
{ description: "medical", taxCode: "medical", __typename: "TaxType" },
|
||||
{ description: "newspapers", taxCode: "newspapers", __typename: "TaxType" },
|
||||
{
|
||||
description: "passenger transport",
|
||||
taxCode: "passenger transport",
|
||||
__typename: "TaxType"
|
||||
},
|
||||
{
|
||||
description: "pharmaceuticals",
|
||||
taxCode: "pharmaceuticals",
|
||||
__typename: "TaxType"
|
||||
},
|
||||
{
|
||||
description: "property renovations",
|
||||
taxCode: "property renovations",
|
||||
__typename: "TaxType"
|
||||
},
|
||||
{ description: "restaurants", taxCode: "restaurants", __typename: "TaxType" },
|
||||
{
|
||||
description: "social housing",
|
||||
taxCode: "social housing",
|
||||
__typename: "TaxType"
|
||||
},
|
||||
{ description: "standard", taxCode: "standard", __typename: "TaxType" },
|
||||
{ description: "water", taxCode: "water", __typename: "TaxType" },
|
||||
{ description: "wine", taxCode: "wine", __typename: "TaxType" }
|
||||
];
|
||||
|
|
Loading…
Reference in a new issue