Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Fix stories

dominik-zeglenf4be69170a27
diff --git a/saleor/static/dashboard-next/products/components/ProductUpdatePage/ProductUpdatePage.tsx b/saleor/static/dashboard-next/products/components/ProductUpdatePage/ProductUpdatePage.tsx
index 7c6161da24..27ad11f9c8 100644
--- a/saleor/static/dashboard-next/products/components/ProductUpdatePage/ProductUpdatePage.tsx
+++ b/saleor/static/dashboard-next/products/components/ProductUpdatePage/ProductUpdatePage.tsx
@@ -30,7 +30,7 @@ interface ProductUpdateProps {
id: string;
name: string;
}>;
- categories: Array<{
+ categories?: Array<{
id: string;
name: string;
}>;
diff --git a/saleor/static/dashboard-next/products/fixtures.ts b/saleor/static/dashboard-next/products/fixtures.ts
index dbf9743c03..700f586147 100644
--- a/saleor/static/dashboard-next/products/fixtures.ts
+++ b/saleor/static/dashboard-next/products/fixtures.ts
@@ -11,7 +11,7 @@ export const product = (placeholderImage: string) => ({
collections: {
edges: [{ node: { id: "Q29sbGVjdGlvbjoy", name: "Winter sale" } }]
},
- price: { currency: "NZD", amount: 339.39 },
+ price: { currency: "NZD", amount: 339.39, localized: "339.39 NZD" },
availableOn: "2018-08-25T18:45:54.125Z",
isPublished: true,
attributes: [
@@ -67,8 +67,12 @@ export const product = (placeholderImage: string) => ({
id: "pv75934",
sku: "87192-94370",
name: "Cordoba Oro",
- priceOverride: 678.78,
- quantity: 48,
+ priceOverride: {
+ amount: 678.78,
+ currency: "USD",
+ localized: "678.78 USD"
+ },
+ stockQuantity: 48,
margin: 2
}
},
@@ -78,7 +82,7 @@ export const product = (placeholderImage: string) => ({
sku: "69055-15190",
name: "silver",
priceOverride: null,
- quantity: 14,
+ stockQuantity: 14,
margin: 7
}
}
@@ -91,7 +95,8 @@ export const product = (placeholderImage: string) => ({
node: {
id: "UHJvZHVjdEltYWdlOjE=",
sortOrder: 0,
- image: placeholderImage
+ image: placeholderImage,
+ url: placeholderImage
}
},
{
@@ -99,17 +104,19 @@ export const product = (placeholderImage: string) => ({
id: "UHJvZHVjdEltYWdlOjE=",
sortOrder: 2,
image: placeholderImage,
- alt: "Id sit dolores adipisci"
+ alt: "Id sit dolores adipisci",
+ url: placeholderImage
}
}
]
},
availability: { available: false },
purchaseCost: {
- start: { currency: "NZD", amount: 339.39 },
- stop: { currency: "NZD", amount: 678.78 }
+ start: { currency: "NZD", amount: 339.39, localized: "339.39 NZD" },
+ stop: { currency: "NZD", amount: 678.78, localized: "678.78 NZD" }
},
- margin: { start: 2, stop: 7 }
+ margin: { start: 2, stop: 7 },
+ url: "/example-url"
});
export const products = (placeholderImage: string) => [
{
@@ -150,36 +157,50 @@ export const products = (placeholderImage: string) => [
}
];
-// export const variants = product.variants.edges.map(edge => edge.node);
-// export const grossMargin = product.grossMargin[0];
-// export const salePrice = {
-// start: product('').availability.priceRange.start.net.localized,
-// stop: product('').availability.priceRange.stop.net.localized
-// };
-// export const purchaseCost = {
-// start: product('').purchaseCost.start.gross.localized,
-// stop: product('').purchaseCost.stop.gross.localized
-// };
-// export const collections = product.collections.edges.map(edge => edge.node);
-// export const images = product('').images.edges.map(edge => edge.node);
-
export const variant = (placeholderImage: string) => ({
attributes: [
{
attribute: {
- name: "Cover",
- slug: "cover",
- values: ["hard", "soft"]
+ id: "pta18161",
+ sortNumber: 0,
+ name: "Borders",
+ slug: "Borders",
+ values: [
+ { id: "ptav47282", sortNumber: 0, name: "portals", slug: "portals" },
+ { id: "ptav17253", sortNumber: 1, name: "Baht", slug: "Baht" }
+ ]
},
- value: "hard"
+ value: {
+ id: "ptav47282",
+ sortNumber: 0,
+ name: "portals",
+ slug: "portals"
+ }
},
{
attribute: {
- name: "Version",
- slug: "version",
- values: ["regular", "extended"]
+ id: "pta22785",
+ sortNumber: 1,
+ name: "Legacy",
+ slug: "Legacy",
+ values: [
+ { id: "ptav31282", sortNumber: 0, name: "payment", slug: "payment" },
+ {
+ id: "ptav14907",
+ sortNumber: 1,
+ name: "Auto Loan Account",
+ slug: "Auto-Loan-Account"
+ },
+ { id: "ptav27366", sortNumber: 2, name: "Garden", slug: "Garden" },
+ { id: "ptav11873", sortNumber: 3, name: "override", slug: "override" }
+ ]
},
- value: "extended"
+ value: {
+ id: "ptav14907",
+ sortNumber: 1,
+ name: "Auto Loan Account",
+ slug: "Auto-Loan-Account"
+ }
}
],
images: {
@@ -210,8 +231,12 @@ export const variant = (placeholderImage: string) => ({
name: "Extended Hard",
priceOverride: {
currency: "USD",
- amount: 100
+ amount: 100,
+ localized: "100 USD"
},
+ quantity: 19,
+ quantityAllocated: 12,
+ stockQuantity: 1,
product: {
id: "prod1",
name: "Our Awesome Book",
@@ -223,7 +248,7 @@ export const variant = (placeholderImage: string) => ({
id: "img1",
url: placeholderImage,
alt: "Front",
- order: 1
+ sortOrder: 1
}
},
{
@@ -231,7 +256,7 @@ export const variant = (placeholderImage: string) => ({
id: "img2",
url: placeholderImage,
alt: "Back",
- order: 4
+ sortOrder: 4
}
},
{
@@ -239,7 +264,7 @@ export const variant = (placeholderImage: string) => ({
id: "img3",
url: placeholderImage,
alt: "Right side",
- order: 2
+ sortOrder: 2
}
},
{
@@ -247,7 +272,7 @@ export const variant = (placeholderImage: string) => ({
id: "img4",
url: placeholderImage,
alt: "Left side",
- order: 3
+ sortOrder: 3
}
},
{
@@ -255,7 +280,7 @@ export const variant = (placeholderImage: string) => ({
id: "img5",
url: placeholderImage,
alt: "Paper",
- order: 0
+ sortOrder: 0
}
},
{
@@ -263,7 +288,7 @@ export const variant = (placeholderImage: string) => ({
id: "img6",
url: placeholderImage,
alt: "Hard cover",
- order: 1
+ sortOrder: 1
}
},
{
@@ -271,7 +296,7 @@ export const variant = (placeholderImage: string) => ({
id: "img7",
url: placeholderImage,
alt: "Extended version",
- order: 0
+ sortOrder: 0
}
},
{
@@ -279,7 +304,7 @@ export const variant = (placeholderImage: string) => ({
id: "img8",
url: placeholderImage,
alt: "Cut version",
- order: 2
+ sortOrder: 2
}
},
{
@@ -287,7 +312,7 @@ export const variant = (placeholderImage: string) => ({
id: "img9",
url: placeholderImage,
alt: "Soft cover",
- order: 2
+ sortOrder: 2
}
}
]
diff --git a/saleor/static/dashboard-next/products/index.tsx b/saleor/static/dashboard-next/products/index.tsx
index 173d289275..e4c44d833e 100644
--- a/saleor/static/dashboard-next/products/index.tsx
+++ b/saleor/static/dashboard-next/products/index.tsx
@@ -69,7 +69,6 @@ export interface AttributeType {
}
export interface AttributeValueType {
- id: string;
name: string;
slug: string;
}
diff --git a/saleor/static/dashboard-next/storybook/config.js b/saleor/static/dashboard-next/storybook/config.js
index a34ba4a252..dfbd6b4a5c 100644
--- a/saleor/static/dashboard-next/storybook/config.js
+++ b/saleor/static/dashboard-next/storybook/config.js
@@ -51,24 +51,10 @@ function loadStories() {
require("./stories/pages/PageProperties");
// Products
- require("./stories/products/ProductAttributesForm");
- require("./stories/products/ProductAvailabilityForm");
- require("./stories/products/ProductCategoryAndCollectionsForm");
- require("./stories/products/ProductDetailsForm");
require("./stories/products/ProductImagePage");
- require("./stories/products/ProductImages");
require("./stories/products/ProductListCard");
require("./stories/products/ProductUpdatePage");
- require("./stories/products/ProductVariantAttributes");
- require("./stories/products/ProductVariantDeleteDialog");
- require("./stories/products/ProductVariantImageSelectDialog");
- require("./stories/products/ProductVariantImages");
- require("./stories/products/ProductVariantNavigation");
require("./stories/products/ProductVariantPage");
- require("./stories/products/ProductVariantPrice");
- require("./stories/products/ProductVariantProduct");
- require("./stories/products/ProductVariantStock");
- require("./stories/products/ProductVariants");
// Orders
require("./stories/orders/OrderAddressEditDialog");
diff --git a/saleor/static/dashboard-next/storybook/stories/products/ProductAttributesForm.tsx b/saleor/static/dashboard-next/storybook/stories/products/ProductAttributesForm.tsx
deleted file mode 100644
index 8f22f231d5..0000000000
--- a/saleor/static/dashboard-next/storybook/stories/products/ProductAttributesForm.tsx
+++ /dev/null
@@ -1,19 +0,0 @@
-import { storiesOf } from "@storybook/react";
-import * as React from "react";
-
-import ProductAttributesForm from "../../../products/components/ProductAttributesForm";
-import { product as productFixture } from "../../../products/fixtures";
-
-const product = productFixture("");
-
-storiesOf("Products / ProductAttributesForm", module)
- .add("when loading data", () => (
- <ProductAttributesForm disabled={true} onChange={() => {}} />
- ))
- .add("when data loaded", () => (
- <ProductAttributesForm
- attributes={product.attributes}
- data={product.attributes}
- onChange={() => {}}
- />
- ));
diff --git a/saleor/static/dashboard-next/storybook/stories/products/ProductAvailabilityForm.tsx b/saleor/static/dashboard-next/storybook/stories/products/ProductAvailabilityForm.tsx
deleted file mode 100644
index 75197cb819..0000000000
--- a/saleor/static/dashboard-next/storybook/stories/products/ProductAvailabilityForm.tsx
+++ /dev/null
@@ -1,16 +0,0 @@
-import { storiesOf } from "@storybook/react";
-import * as React from "react";
-
-import ProductAvailabilityForm from "../../../products/components/ProductAvailabilityForm";
-
-storiesOf("Products / ProductAvailabilityForm", module)
- .add("when loading data", () => (
- <ProductAvailabilityForm onChange={() => {}} />
- ))
- .add("with loaded data", () => (
- <ProductAvailabilityForm
- onChange={() => {}}
- available={true}
- availableOn={"04-10-2010"}
- />
- ));
diff --git a/saleor/static/dashboard-next/storybook/stories/products/ProductCategoryAndCollectionsForm.tsx b/saleor/static/dashboard-next/storybook/stories/products/ProductCategoryAndCollectionsForm.tsx
deleted file mode 100644
index 620a59a359..0000000000
--- a/saleor/static/dashboard-next/storybook/stories/products/ProductCategoryAndCollectionsForm.tsx
+++ /dev/null
@@ -1,35 +0,0 @@
-import { storiesOf } from "@storybook/react";
-import * as React from "react";
-
-import ProductCategoryAndCollectionsForm from "../../../products/components/ProductCategoryAndCollectionsForm";
-
-const category = "876752";
-const collections = [
- { value: "1", label: "Winter collection" },
- { value: "2", label: "Emperor's choice" }
-];
-const categories = [
- {
- value: "123123",
- label: "Lorem ipsum dolor"
- },
- {
- value: "876752",
- label: "Mauris vehicula tortor vulputate"
- }
-];
-const productCollections = ["1"];
-
-storiesOf("Products / ProductCategoryAndCollectionsForm", module)
- .add("while loading data", () => (
- <ProductCategoryAndCollectionsForm onChange={() => {}} loading={true} />
- ))
- .add("when data is loaded", () => (
- <ProductCategoryAndCollectionsForm
- onChange={() => {}}
- collections={collections}
- categories={categories}
- category={category}
- productCollections={productCollections}
- />
- ));
diff --git a/saleor/static/dashboard-next/storybook/stories/products/ProductCollections.tsx b/saleor/static/dashboard-next/storybook/stories/products/ProductCollections.tsx
deleted file mode 100644
index bde40c4595..0000000000
--- a/saleor/static/dashboard-next/storybook/stories/products/ProductCollections.tsx
+++ /dev/null
@@ -1,14 +0,0 @@
-import { storiesOf } from "@storybook/react";
-import * as React from "react";
-
-import ProductCollections from "../../../products/components/ProductCollections";
-import { collections } from "../../../products/fixtures";
-
-storiesOf("Products / ProductCollections", module)
- .add("when loading data", () => <ProductCollections onRowClick={() => {}} />)
- .add("with no collections", () => (
- <ProductCollections collections={[]} onRowClick={() => {}} />
- ))
- .add("with collections", () => (
- <ProductCollections collections={collections} onRowClick={() => {}} />
- ));
diff --git a/saleor/static/dashboard-next/storybook/stories/products/ProductDescription.tsx b/saleor/static/dashboard-next/storybook/stories/products/ProductDescription.tsx
deleted file mode 100644
index 1e4d06c689..0000000000
--- a/saleor/static/dashboard-next/storybook/stories/products/ProductDescription.tsx
+++ /dev/null
@@ -1,39 +0,0 @@
-import { storiesOf } from "@storybook/react";
-import * as React from "react";
-
-import ProductDescription from "../../../products/components/ProductDescription";
-import { product } from "../../../products/fixtures";
-
-storiesOf("Products / ProductDescription", module)
- .add("with no description", () => (
- <ProductDescription
- id={product.id}
- name={product.name}
- url={product.url}
- description={""}
- onBack={() => {}}
- onDelete={() => {}}
- onEdit={() => {}}
- onShow={() => {}}
- />
- ))
- .add("with description", () => (
- <ProductDescription
- id={product.id}
- name={product.name}
- description={product.description}
- url={product.url}
- onBack={() => {}}
- onDelete={() => {}}
- onEdit={() => {}}
- onShow={() => {}}
- />
- ))
- .add("when loading data", () => (
- <ProductDescription
- onBack={() => {}}
- onDelete={() => {}}
- onEdit={() => {}}
- onShow={() => {}}
- />
- ));
diff --git a/saleor/static/dashboard-next/storybook/stories/products/ProductDetailsForm.tsx b/saleor/static/dashboard-next/storybook/stories/products/ProductDetailsForm.tsx
deleted file mode 100644
index ce64c822a1..0000000000
--- a/saleor/static/dashboard-next/storybook/stories/products/ProductDetailsForm.tsx
+++ /dev/null
@@ -1,25 +0,0 @@
-import { storiesOf } from "@storybook/react";
-import * as React from "react";
-
-import ProductDetailsForm from "../../../products/components/ProductDetailsForm";
-import { product as productFixture } from "../../../products/fixtures";
-
-const product = productFixture("");
-
-storiesOf("Products / ProductDetailsForm", module)
- .add("with no initial data", () => (
- <ProductDetailsForm onBack={() => {}} onChange={() => {}} />
- ))
- .add("with initial data", () => (
- <ProductDetailsForm
- onBack={() => {}}
- onChange={() => {}}
- name={product.name}
- description={product.description}
- currencySymbol={product.price.currency}
- price={product.price.amount}
- />
- ))
- .add("when loading data", () => (
- <ProductDetailsForm onBack={() => {}} onChange={() => {}} disabled={true} />
- ));
diff --git a/saleor/static/dashboard-next/storybook/stories/products/ProductImages.tsx b/saleor/static/dashboard-next/storybook/stories/products/ProductImages.tsx
deleted file mode 100644
index e1112e0cc5..0000000000
--- a/saleor/static/dashboard-next/storybook/stories/products/ProductImages.tsx
+++ /dev/null
@@ -1,33 +0,0 @@
-import { storiesOf } from "@storybook/react";
-import * as React from "react";
-
-import * as placeholderImage from "../../../../images/placeholder255x255.png";
-import ProductImages from "../../../products/components/ProductImages";
-import { product as productFixture } from "../../../products/fixtures";
-
-const images = productFixture(placeholderImage).images.edges.map(
- edge => edge.node
-);
-
-storiesOf("Products / ProductImages", module)
- .add("without data", () => (
- <ProductImages
- images={[]}
- onImageReorder={() => {}}
- onImageUpload={() => {}}
- />
- ))
- .add("with data", () => (
- <ProductImages
- images={images}
- onImageReorder={() => {}}
- onImageUpload={() => {}}
- />
- ))
- .add("when loading data", () => (
- <ProductImages
- placeholderImage={placeholderImage}
- onImageReorder={() => {}}
- onImageUpload={() => {}}
- />
- ));
diff --git a/saleor/static/dashboard-next/storybook/stories/products/ProductListCard.tsx b/saleor/static/dashboard-next/storybook/stories/products/ProductListCard.tsx
index 3d62fd13e1..753a0460b9 100644
--- a/saleor/static/dashboard-next/storybook/stories/products/ProductListCard.tsx
+++ b/saleor/static/dashboard-next/storybook/stories/products/ProductListCard.tsx
@@ -61,7 +61,7 @@ const products = [
storiesOf("Views / Products / Product list", module)
.add("default", () => (
- <ProductListCard products={[]} {...pageListProps.default} />
+ <ProductListCard products={products} {...pageListProps.default} />
))
.add("loading", () => <ProductListCard {...pageListProps.loading} />)
.add("no data", () => (
diff --git a/saleor/static/dashboard-next/storybook/stories/products/ProductPriceAndAvailability.tsx b/saleor/static/dashboard-next/storybook/stories/products/ProductPriceAndAvailability.tsx
deleted file mode 100644
index 73baecd401..0000000000
--- a/saleor/static/dashboard-next/storybook/stories/products/ProductPriceAndAvailability.tsx
+++ /dev/null
@@ -1,32 +0,0 @@
-import { storiesOf } from "@storybook/react";
-import * as React from "react";
-
-import ProductPriceAndAvailability from "../../../products/components/ProductPriceAndAvailability";
-import {
- grossMargin,
- purchaseCost,
- salePrice
-} from "../../../products/fixtures";
-
-storiesOf("Products / ProductPriceAndAvailability", module)
- .add("when loading data", () => (
- <ProductPriceAndAvailability onPublish={() => {}} />
- ))
- .add("when product is available", () => (
- <ProductPriceAndAvailability
- onPublish={() => {}}
- grossMargin={grossMargin}
- salePrice={salePrice}
- purchaseCost={purchaseCost}
- isAvailable={true}
- />
- ))
- .add("when product is not available", () => (
- <ProductPriceAndAvailability
- onPublish={() => {}}
- grossMargin={grossMargin}
- salePrice={salePrice}
- purchaseCost={purchaseCost}
- isAvailable={false}
- />
- ));
diff --git a/saleor/static/dashboard-next/storybook/stories/products/ProductUpdatePage.tsx b/saleor/static/dashboard-next/storybook/stories/products/ProductUpdatePage.tsx
index 2fa2526df2..7109431d97 100644
--- a/saleor/static/dashboard-next/storybook/stories/products/ProductUpdatePage.tsx
+++ b/saleor/static/dashboard-next/storybook/stories/products/ProductUpdatePage.tsx
@@ -2,6 +2,7 @@ import { storiesOf } from "@storybook/react";
import * as React from "react";
import * as placeholderImage from "../../../../images/placeholder255x255.png";
+import { categories } from "../../../categories/fixtures";
import ProductUpdatePage from "../../../products/components/ProductUpdatePage";
import { product as productFixture } from "../../../products/fixtures";
import Decorator from "../../Decorator";
@@ -10,14 +11,6 @@ const product = productFixture(placeholderImage);
storiesOf("Views / Products / Product edit", module)
.addDecorator(Decorator)
- .add("when loading data", () => (
- <ProductUpdatePage
- onBack={() => {}}
- onSubmit={() => {}}
- disabled={true}
- placeholderImage={placeholderImage}
- />
- ))
.add("when data is fully loaded", () => (
<ProductUpdatePage
onBack={() => {}}
@@ -25,9 +18,6 @@ storiesOf("Views / Products / Product edit", module)
product={product}
collections={product.collections.edges.map(edge => edge.node)}
categories={[product.category]}
- storefrontUrl={(text: string) =>
- `https://demo.getsaleor.com/product/${text}`
- }
placeholderImage={placeholderImage}
images={product.images.edges.map(edge => edge.node)}
variants={product.variants.edges.map(edge => edge.node)}
@@ -37,4 +27,13 @@ storiesOf("Views / Products / Product edit", module)
onVariantAdd={() => {}}
onVariantShow={() => {}}
/>
+ ))
+ .add("when loading data", () => (
+ <ProductUpdatePage
+ categories={[]}
+ onBack={() => {}}
+ onSubmit={() => {}}
+ disabled={true}
+ placeholderImage={placeholderImage}
+ />
));
diff --git a/saleor/static/dashboard-next/storybook/stories/products/ProductVariantAttributes.tsx b/saleor/static/dashboard-next/storybook/stories/products/ProductVariantAttributes.tsx
deleted file mode 100644
index b65abcd4b3..0000000000
--- a/saleor/static/dashboard-next/storybook/stories/products/ProductVariantAttributes.tsx
+++ /dev/null
@@ -1,18 +0,0 @@
-import { storiesOf } from "@storybook/react";
-import * as React from "react";
-
-import ProductVariantAttributes from "../../../products/components/ProductVariantAttributes";
-import { variant as variantFixture } from "../../../products/fixtures";
-
-const variant = variantFixture("");
-
-storiesOf("Products / ProductVariantAttributes", module)
- .add("when loading data", () => (
- <ProductVariantAttributes onChange={() => {}} loading={true} />
- ))
- .add("when loaded data", () => (
- <ProductVariantAttributes
- attributes={variant.attributes}
- onChange={() => {}}
- />
- ));
diff --git a/saleor/static/dashboard-next/storybook/stories/products/ProductVariantImages.tsx b/saleor/static/dashboard-next/storybook/stories/products/ProductVariantImages.tsx
deleted file mode 100644
index 5c28beeb22..0000000000
--- a/saleor/static/dashboard-next/storybook/stories/products/ProductVariantImages.tsx
+++ /dev/null
@@ -1,24 +0,0 @@
-import { storiesOf } from "@storybook/react";
-import * as React from "react";
-
-import * as placeholderImage from "../../../../images/placeholder255x255.png";
-import ProductVariantImages from "../../../products/components/ProductVariantImages";
-import { variantProductImages as imagesFixture } from "../../../products/fixtures";
-
-const images = imagesFixture(placeholderImage);
-
-storiesOf("Products / ProductVariantImages", module)
- .add("when loading data", () => (
- <ProductVariantImages
- onImageAdd={() => {}}
- loading={true}
- placeholderImage={placeholderImage}
- />
- ))
- .add("when loaded data", () => (
- <ProductVariantImages
- images={images}
- onImageAdd={() => {}}
- placeholderImage={placeholderImage}
- />
- ));
diff --git a/saleor/static/dashboard-next/storybook/stories/products/ProductVariantNavigation.tsx b/saleor/static/dashboard-next/storybook/stories/products/ProductVariantNavigation.tsx
deleted file mode 100644
index d01ff68193..0000000000
--- a/saleor/static/dashboard-next/storybook/stories/products/ProductVariantNavigation.tsx
+++ /dev/null
@@ -1,17 +0,0 @@
-import { storiesOf } from "@storybook/react";
-import * as React from "react";
-
-import ProductVariantNavigation from "../../../products/components/ProductVariantNavigation";
-import { variantSiblings as variantSiblingsFixture } from "../../../products/fixtures";
-
-storiesOf("Products / ProductVariantNavigation", module)
- .add("when loading data", () => <ProductVariantNavigation loading={true} />)
- .add("when loaded data", () => (
- <ProductVariantNavigation variants={variantSiblingsFixture("")} />
- ))
- .add("with clickable rows", () => (
- <ProductVariantNavigation
- variants={variantSiblingsFixture("")}
- onRowClick={() => {}}
- />
- ));
diff --git a/saleor/static/dashboard-next/storybook/stories/products/ProductVariantPage.tsx b/saleor/static/dashboard-next/storybook/stories/products/ProductVariantPage.tsx
index 0a31a31829..9110d6a42b 100644
--- a/saleor/static/dashboard-next/storybook/stories/products/ProductVariantPage.tsx
+++ b/saleor/static/dashboard-next/storybook/stories/products/ProductVariantPage.tsx
@@ -10,22 +10,24 @@ const variant = variantFixture(placeholderImage);
storiesOf("Views / Products / Product variant details", module)
.addDecorator(Decorator)
- .add("when loading data", () => (
+ .add("when loaded data", () => (
<ProductVariantPage
- loading={true}
+ variant={variant}
onBack={() => () => {}}
- placeholderImage={placeholderImage}
onDelete={() => {}}
onImageSelect={() => {}}
onSubmit={() => {}}
+ onVariantClick={() => () => {}}
/>
))
- .add("when loaded data", () => (
+ .add("when loading data", () => (
<ProductVariantPage
- variant={variant}
+ loading={true}
onBack={() => () => {}}
+ placeholderImage={placeholderImage}
onDelete={() => {}}
onImageSelect={() => {}}
onSubmit={() => {}}
+ onVariantClick={() => () => {}}
/>
));
diff --git a/saleor/static/dashboard-next/storybook/stories/products/ProductVariantPrice.tsx b/saleor/static/dashboard-next/storybook/stories/products/ProductVariantPrice.tsx
deleted file mode 100644
index 14b21609bb..0000000000
--- a/saleor/static/dashboard-next/storybook/stories/products/ProductVariantPrice.tsx
+++ /dev/null
@@ -1,20 +0,0 @@
-import { storiesOf } from "@storybook/react";
-import * as React from "react";
-
-import ProductVariantPrice from "../../../products/components/ProductVariantPrice";
-import { variant as variantFixture } from "../../../products/fixtures";
-
-const variant = variantFixture("");
-
-storiesOf("Products / ProductVariantPrice", module)
- .add("when loading data", () => (
- <ProductVariantPrice onChange={() => {}} loading={true} />
- ))
- .add("when loaded data", () => (
- <ProductVariantPrice
- costPrice={variant.priceOverride.amount}
- onChange={() => {}}
- priceOverride={variant.priceOverride.amount}
- currencySymbol={variant.priceOverride.currency}
- />
- ));
diff --git a/saleor/static/dashboard-next/storybook/stories/products/ProductVariantProduct.tsx b/saleor/static/dashboard-next/storybook/stories/products/ProductVariantProduct.tsx
deleted file mode 100644
index 900793fe49..0000000000
--- a/saleor/static/dashboard-next/storybook/stories/products/ProductVariantProduct.tsx
+++ /dev/null
@@ -1,14 +0,0 @@
-import { storiesOf } from "@storybook/react";
-import * as React from "react";
-
-import * as placeholderImage from "../../../../images/placeholder60x60.png";
-import ProductVariantProduct from "../../../products/components/ProductVariantProduct";
-import { variant as variantFixture } from "../../../products/fixtures";
-
-const product = variantFixture(placeholderImage).product;
-
-storiesOf("Products / ProductVariantProduct", module)
- .add("when loading data", () => (
- <ProductVariantProduct loading={true} placeholderImage={placeholderImage} />
- ))
- .add("when loaded data", () => <ProductVariantProduct product={product} />);
diff --git a/saleor/static/dashboard-next/storybook/stories/products/ProductVariantStock.tsx b/saleor/static/dashboard-next/storybook/stories/products/ProductVariantStock.tsx
deleted file mode 100644
index 729c21f8ae..0000000000
--- a/saleor/static/dashboard-next/storybook/stories/products/ProductVariantStock.tsx
+++ /dev/null
@@ -1,20 +0,0 @@
-import { storiesOf } from "@storybook/react";
-import * as React from "react";
-
-import ProductVariantStock from "../../../products/components/ProductVariantStock";
-import { variant as variantFixture } from "../../../products/fixtures";
-
-const variant = variantFixture("");
-
-storiesOf("Products / ProductVariantStock", module)
- .add("when loading data", () => (
- <ProductVariantStock loading={true} onChange={() => {}} />
- ))
- .add("when loaded data", () => (
- <ProductVariantStock
- onChange={() => {}}
- sku={variant.sku}
- stock={variant.stock}
- stockAllocated={variant.stockAllocated}
- />
- ));
diff --git a/saleor/static/dashboard-next/storybook/stories/products/ProductVariants.tsx b/saleor/static/dashboard-next/storybook/stories/products/ProductVariants.tsx
deleted file mode 100644
index 83589416b1..0000000000
--- a/saleor/static/dashboard-next/storybook/stories/products/ProductVariants.tsx
+++ /dev/null
@@ -1,22 +0,0 @@
-import { storiesOf } from "@storybook/react";
-import * as React from "react";
-
-import ProductVariants from "../../../products/components/ProductVariants";
-import { product as productFixture } from "../../../products/fixtures";
-
-const product = productFixture("");
-const variants = product.variants.edges.map(edge => edge.node);
-
-storiesOf("Products / ProductVariants", module)
- .add("when loading data", () => <ProductVariants />)
- .add("when product has no variants", () => <ProductVariants variants={[]} />)
- .add("when product has variants", () => (
- <ProductVariants variants={variants} fallbackPrice={product.price} />
- ))
- .add("with clickable rows", () => (
- <ProductVariants
- variants={variants}
- onRowClick={() => {}}
- fallbackPrice={product.price}
- />
- ));