diff --git a/src/fixtures.ts b/src/fixtures.ts index aff42ef0d..5b45c2f75 100644 --- a/src/fixtures.ts +++ b/src/fixtures.ts @@ -1,5 +1,4 @@ import { ShopInfo_shop_permissions } from "./components/Shop/types/ShopInfo"; -import { Filter } from "./components/TableFilter"; import { FetchMoreProps, FilterPageProps, @@ -303,80 +302,14 @@ export const searchPageProps: SearchPageProps = { onSearchChange: () => undefined }; -export const filterPageProps: FilterPageProps = { +export const filterPageProps: FilterPageProps = { ...searchPageProps, ...tabPageProps, currencySymbol: "USD", - filtersList: [], - onFilterAdd: () => undefined + filterOpts: {}, + onFilterChange: () => undefined }; -export const filters: Filter[] = [ - { - label: "Property X is ", - onClick: () => undefined - }, - { - label: "Property Y is ", - onClick: () => undefined - }, - { - label: "Property Z is ", - onClick: () => undefined - }, - { - label: "Property X is ", - onClick: () => undefined - }, - { - label: "Property Y is ", - onClick: () => undefined - }, - { - label: "Property Z is ", - onClick: () => undefined - }, - { - label: "Property X is ", - onClick: () => undefined - }, - { - label: "Property Y is ", - onClick: () => undefined - }, - { - label: "Property Z is ", - onClick: () => undefined - }, - { - label: "Property X is ", - onClick: () => undefined - }, - { - label: "Property Y is ", - onClick: () => undefined - }, - { - label: "Property Z is ", - onClick: () => undefined - }, - { - label: "Property X is ", - onClick: () => undefined - }, - { - label: "Property Y is ", - onClick: () => undefined - }, - { - label: "Property Z is ", - onClick: () => undefined - } -].map((filter, filterIndex) => ({ - ...filter, - label: filter.label + filterIndex -})); - export const fetchMoreProps: FetchMoreProps = { hasMore: true, loading: false, diff --git a/src/storybook/stories/orders/OrderListPage.tsx b/src/storybook/stories/orders/OrderListPage.tsx index c3095aee4..5fb565871 100644 --- a/src/storybook/stories/orders/OrderListPage.tsx +++ b/src/storybook/stories/orders/OrderListPage.tsx @@ -5,9 +5,9 @@ import OrderListPage, { OrderListPageProps } from "@saleor/orders/components/OrderListPage"; import { OrderListUrlSortField } from "@saleor/orders/urls"; +import { OrderStatusFilter } from "@saleor/types/globalTypes"; import { filterPageProps, - filters, listActionsProps, pageListProps, sortPageProps @@ -20,6 +20,19 @@ const props: OrderListPageProps = { ...pageListProps.default, ...filterPageProps, ...sortPageProps, + filterOpts: { + created: { + active: false, + value: { + max: "400", + min: "50" + } + }, + status: { + active: false, + value: [OrderStatusFilter.CANCELED, OrderStatusFilter.FULFILLED] + } + }, orders, sort: { ...sortPageProps.sort, @@ -30,9 +43,6 @@ const props: OrderListPageProps = { storiesOf("Views / Orders / Order list", module) .addDecorator(Decorator) .add("default", () => ) - .add("with custom filters", () => ( - - )) .add("loading", () => ( ) - .add("with custom filters", () => ( - - )) .add("loading", () => (