Skip to content

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

Fix types

dominik-zeglendaadf1723199
diff --git a/saleor/static/dashboard-next/products/misc.ts b/saleor/static/dashboard-next/products/misc.ts
deleted file mode 100644
index c4152b5ce8..0000000000
--- a/saleor/static/dashboard-next/products/misc.ts
+++ /dev/null
@@ -1,21 +0,0 @@
-import { empty, only } from "../misc";
-import { StockAvailability } from "../types/globalTypes";
-import { ProductListFilterTabs } from "./components/ProductListFilter";
-import { ProductListUrlQueryParams } from "./urls";
-
-export const getTabName = (
- qs: ProductListUrlQueryParams
-): ProductListFilterTabs => {
- const filters = {
- status: qs.status
- };
- if (empty(filters)) {
- return "all";
- }
- if (only(filters, "status")) {
- return filters.status === StockAvailability.IN_STOCK
- ? "available"
- : "outOfStock";
- }
- return "custom";
-};
diff --git a/saleor/static/dashboard-next/storybook/stories/products/ProductListCard.tsx b/saleor/static/dashboard-next/storybook/stories/products/ProductListCard.tsx
index 07db7aefe5..3ba0579ded 100644
--- a/saleor/static/dashboard-next/storybook/stories/products/ProductListCard.tsx
+++ b/saleor/static/dashboard-next/storybook/stories/products/ProductListCard.tsx
@@ -84,13 +84,15 @@ const props: ProductListCardProps = {
...listActionsProps,
...pageListProps.default,
currencySymbol: "USD",
- currentTab: "all",
+ currentTab: 0,
filtersList: [],
+ initialSearch: "",
onAllProducts: () => undefined,
- onAvailable: () => undefined,
- onCustomFilter: () => undefined,
- onOfStock: () => undefined,
- onSearchChange: val => console.log(val),
+ onFilterAdd: () => undefined,
+ onFilterDelete: () => undefined,
+ onFilterSave: () => undefined,
+ onSearchChange: () => undefined,
+ onTabChange: () => undefined,
products
};
@@ -98,7 +100,7 @@ storiesOf("Views / Products / Product list", module)
.addDecorator(Decorator)
.add("default", () => <ProductListCard {...props} />)
.add("with custom filters", () => (
- <ProductListCard {...props} filtersList={filtersList} currentTab="custom" />
+ <ProductListCard {...props} filtersList={filtersList} />
))
.add("loading", () => (
<ProductListCard