2019-09-12 13:31:08 +00:00
|
|
|
import {
|
2020-05-14 09:30:32 +00:00
|
|
|
filterPageProps,
|
2021-04-13 09:59:16 +00:00
|
|
|
limits,
|
|
|
|
limitsReached,
|
2019-09-12 13:31:08 +00:00
|
|
|
pageListProps,
|
|
|
|
searchPageProps,
|
2020-01-07 12:06:11 +00:00
|
|
|
sortPageProps,
|
2020-05-14 09:30:32 +00:00
|
|
|
tabPageProps
|
2020-04-23 15:43:08 +00:00
|
|
|
} from "@saleor/fixtures";
|
2022-03-09 08:56:55 +00:00
|
|
|
import { StaffMemberStatus } from "@saleor/graphql";
|
2020-04-23 15:43:08 +00:00
|
|
|
import { staffMembers } from "@saleor/staff/fixtures";
|
2020-05-14 09:30:32 +00:00
|
|
|
import { StaffListUrlSortField } from "@saleor/staff/urls";
|
2020-04-23 15:43:08 +00:00
|
|
|
import Decorator from "@saleor/storybook/Decorator";
|
2022-05-31 12:53:16 +00:00
|
|
|
import { PaginatorContextDecorator } from "@saleor/storybook/PaginatorContextDecorator";
|
2020-05-14 09:30:32 +00:00
|
|
|
import { storiesOf } from "@storybook/react";
|
|
|
|
import React from "react";
|
|
|
|
|
2020-04-23 15:43:08 +00:00
|
|
|
import StaffListPage, { StaffListPageProps } from ".";
|
2019-06-19 14:40:52 +00:00
|
|
|
|
|
|
|
const props: StaffListPageProps = {
|
2019-09-12 13:31:08 +00:00
|
|
|
...pageListProps.default,
|
|
|
|
...searchPageProps,
|
2019-12-17 17:13:56 +00:00
|
|
|
...sortPageProps,
|
2019-09-12 13:31:08 +00:00
|
|
|
...tabPageProps,
|
2020-01-07 12:06:11 +00:00
|
|
|
...filterPageProps,
|
|
|
|
filterOpts: {
|
|
|
|
status: {
|
|
|
|
active: false,
|
|
|
|
value: StaffMemberStatus.ACTIVE
|
|
|
|
}
|
|
|
|
},
|
2021-04-13 09:59:16 +00:00
|
|
|
limits,
|
2019-06-19 14:40:52 +00:00
|
|
|
onAdd: undefined,
|
2019-12-17 17:13:56 +00:00
|
|
|
sort: {
|
|
|
|
...sortPageProps.sort,
|
|
|
|
sort: StaffListUrlSortField.name
|
|
|
|
},
|
2019-09-12 13:31:08 +00:00
|
|
|
staffMembers
|
2019-06-19 14:40:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
storiesOf("Views / Staff / Staff members", module)
|
|
|
|
.addDecorator(Decorator)
|
2022-05-31 12:53:16 +00:00
|
|
|
.addDecorator(PaginatorContextDecorator)
|
2019-06-19 14:40:52 +00:00
|
|
|
.add("default", () => <StaffListPage {...props} />)
|
|
|
|
.add("when loading", () => (
|
|
|
|
<StaffListPage {...props} disabled={true} staffMembers={undefined} />
|
2021-04-13 09:59:16 +00:00
|
|
|
))
|
|
|
|
.add("no limits", () => <StaffListPage {...props} limits={undefined} />)
|
|
|
|
.add("limits reached", () => (
|
|
|
|
<StaffListPage {...props} limits={limitsReached} />
|
2019-06-19 14:40:52 +00:00
|
|
|
));
|