2019-06-19 14:40:52 +00:00
|
|
|
import { storiesOf } from "@storybook/react";
|
2019-08-09 10:26:22 +00:00
|
|
|
import React from "react";
|
2019-06-19 14:40:52 +00:00
|
|
|
|
2019-12-17 17:13:56 +00:00
|
|
|
import { StaffListUrlSortField } from "@saleor/staff/urls";
|
2020-01-07 12:06:11 +00:00
|
|
|
import { StaffMemberStatus } from "@saleor/types/globalTypes";
|
2019-09-12 13:31:08 +00:00
|
|
|
import {
|
|
|
|
pageListProps,
|
|
|
|
searchPageProps,
|
2019-12-17 17:13:56 +00:00
|
|
|
tabPageProps,
|
2020-01-07 12:06:11 +00:00
|
|
|
sortPageProps,
|
|
|
|
filterPageProps
|
2020-04-23 15:43:08 +00:00
|
|
|
} from "@saleor/fixtures";
|
|
|
|
import { staffMembers } from "@saleor/staff/fixtures";
|
|
|
|
import Decorator from "@saleor/storybook/Decorator";
|
|
|
|
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
|
|
|
|
}
|
|
|
|
},
|
2019-06-19 14:40:52 +00:00
|
|
|
onAdd: undefined,
|
|
|
|
onBack: () => 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)
|
|
|
|
.add("default", () => <StaffListPage {...props} />)
|
|
|
|
.add("when loading", () => (
|
|
|
|
<StaffListPage {...props} disabled={true} staffMembers={undefined} />
|
|
|
|
));
|