2023-01-16 09:45:12 +00:00
|
|
|
import { saleList } from "@dashboard/discounts/fixtures";
|
|
|
|
import { SaleListUrlSortField } from "@dashboard/discounts/urls";
|
2019-09-12 13:31:08 +00:00
|
|
|
import {
|
2020-05-14 09:30:32 +00:00
|
|
|
filterPageProps,
|
2019-09-12 13:31:08 +00:00
|
|
|
listActionsProps,
|
|
|
|
pageListProps,
|
2020-01-03 13:21:58 +00:00
|
|
|
sortPageProps,
|
2022-06-21 09:36:55 +00:00
|
|
|
tabPageProps,
|
2023-01-16 09:45:12 +00:00
|
|
|
} from "@dashboard/fixtures";
|
|
|
|
import { DiscountStatusEnum, DiscountValueTypeEnum } from "@dashboard/graphql";
|
2023-01-05 12:34:34 +00:00
|
|
|
import React from "react";
|
|
|
|
|
2023-05-12 11:06:27 +00:00
|
|
|
import { PaginatorContextDecorator } from "../../../../.storybook/decorators";
|
2023-01-05 12:34:34 +00:00
|
|
|
import SaleListPage, { SaleListPageProps } from "./SaleListPage";
|
2019-06-19 14:40:52 +00:00
|
|
|
|
|
|
|
const props: SaleListPageProps = {
|
|
|
|
...listActionsProps,
|
|
|
|
...pageListProps.default,
|
2020-01-03 13:21:58 +00:00
|
|
|
...filterPageProps,
|
2019-12-17 17:13:56 +00:00
|
|
|
...sortPageProps,
|
2019-09-12 13:31:08 +00:00
|
|
|
...tabPageProps,
|
2020-01-03 13:21:58 +00:00
|
|
|
filterOpts: {
|
2021-06-28 13:51:19 +00:00
|
|
|
channel: {
|
|
|
|
active: false,
|
|
|
|
value: "default-channel",
|
|
|
|
choices: [
|
|
|
|
{
|
|
|
|
value: "default-channel",
|
2022-06-21 09:36:55 +00:00
|
|
|
label: "Default channel",
|
|
|
|
},
|
|
|
|
],
|
2021-06-28 13:51:19 +00:00
|
|
|
},
|
2020-01-03 13:21:58 +00:00
|
|
|
saleType: {
|
|
|
|
active: false,
|
2022-06-21 09:36:55 +00:00
|
|
|
value: DiscountValueTypeEnum.FIXED,
|
2020-01-03 13:21:58 +00:00
|
|
|
},
|
|
|
|
started: {
|
|
|
|
active: false,
|
|
|
|
value: {
|
|
|
|
max: undefined,
|
2022-06-21 09:36:55 +00:00
|
|
|
min: undefined,
|
|
|
|
},
|
2020-01-03 13:21:58 +00:00
|
|
|
},
|
|
|
|
status: {
|
|
|
|
active: false,
|
2022-06-21 09:36:55 +00:00
|
|
|
value: [DiscountStatusEnum.ACTIVE],
|
|
|
|
},
|
2020-01-03 13:21:58 +00:00
|
|
|
},
|
2019-12-17 17:13:56 +00:00
|
|
|
sales: saleList,
|
2020-11-23 09:39:24 +00:00
|
|
|
selectedChannelId: "123",
|
2019-12-17 17:13:56 +00:00
|
|
|
sort: {
|
|
|
|
...sortPageProps.sort,
|
2022-06-21 09:36:55 +00:00
|
|
|
sort: SaleListUrlSortField.name,
|
|
|
|
},
|
2019-06-19 14:40:52 +00:00
|
|
|
};
|
|
|
|
|
2023-05-12 11:06:27 +00:00
|
|
|
export default {
|
|
|
|
title: "Discounts / Sale list",
|
|
|
|
decorators: [PaginatorContextDecorator],
|
|
|
|
};
|
|
|
|
|
|
|
|
export const Default = () => <SaleListPage {...props} />;
|
|
|
|
|
|
|
|
export const Loading = () => <SaleListPage {...props} sales={undefined} />;
|
|
|
|
|
|
|
|
export const NoData = () => <SaleListPage {...props} sales={[]} />;
|
|
|
|
|
|
|
|
export const NoChannels = () => (
|
|
|
|
<SaleListPage
|
|
|
|
{...props}
|
|
|
|
sales={saleList.map(sale => ({ ...sale, channelListings: [] }))}
|
|
|
|
selectedChannelId=""
|
|
|
|
/>
|
|
|
|
);
|