2023-01-16 09:45:12 +00:00
|
|
|
import { pageListProps, searchPageProps } from "@dashboard/fixtures";
|
|
|
|
import { LanguageCodeEnum } from "@dashboard/graphql";
|
2023-05-22 09:09:36 +00:00
|
|
|
import { Meta, StoryObj } from "@storybook/react";
|
2019-08-09 10:26:22 +00:00
|
|
|
import React from "react";
|
2019-06-19 14:40:52 +00:00
|
|
|
|
2023-05-12 11:06:27 +00:00
|
|
|
import { PaginatorContextDecorator } from "../../../../.storybook/decorators";
|
2023-01-05 12:34:34 +00:00
|
|
|
import TranslationsEntitiesList from "../TranslationsEntitiesList";
|
2019-06-19 14:40:52 +00:00
|
|
|
import TranslationsEntitiesListPage, {
|
2022-06-21 09:36:55 +00:00
|
|
|
TranslationsEntitiesListPageProps,
|
2023-01-05 12:34:34 +00:00
|
|
|
} from "./TranslationsEntitiesListPage";
|
2019-06-19 14:40:52 +00:00
|
|
|
|
|
|
|
const props: TranslationsEntitiesListPageProps = {
|
|
|
|
...pageListProps.default,
|
2019-09-12 13:31:08 +00:00
|
|
|
...searchPageProps,
|
2019-06-19 14:40:52 +00:00
|
|
|
children: null,
|
|
|
|
filters: {
|
|
|
|
current: "products",
|
|
|
|
onCategoriesTabClick: () => undefined,
|
|
|
|
onCollectionsTabClick: () => undefined,
|
|
|
|
onPagesTabClick: () => undefined,
|
2021-08-09 14:59:12 +00:00
|
|
|
onAttributesTabClick: () => undefined,
|
2019-06-19 14:40:52 +00:00
|
|
|
onProductsTabClick: () => undefined,
|
|
|
|
onSalesTabClick: () => undefined,
|
2020-11-27 15:53:48 +00:00
|
|
|
onShippingMethodsTabClick: () => undefined,
|
2022-06-21 09:36:55 +00:00
|
|
|
onVouchersTabClick: () => undefined,
|
2022-07-26 09:12:02 +00:00
|
|
|
onMenuItemsTabClick: () => undefined,
|
2019-06-19 14:40:52 +00:00
|
|
|
},
|
|
|
|
language: {
|
|
|
|
__typename: "LanguageDisplay",
|
|
|
|
code: LanguageCodeEnum.EN,
|
2022-06-21 09:36:55 +00:00
|
|
|
language: "English",
|
|
|
|
},
|
2019-06-19 14:40:52 +00:00
|
|
|
};
|
|
|
|
|
2023-05-22 09:09:36 +00:00
|
|
|
const ListPage = props => (
|
2023-05-12 11:06:27 +00:00
|
|
|
<TranslationsEntitiesListPage {...props}>
|
|
|
|
<TranslationsEntitiesList
|
|
|
|
disabled={false}
|
|
|
|
entities={[
|
|
|
|
{
|
|
|
|
completion: { current: 1, max: 3 },
|
|
|
|
id: "1",
|
|
|
|
name: "White Hoodie",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
completion: { current: 2, max: 3 },
|
|
|
|
id: "1",
|
|
|
|
name: "Brown Supreme Hoodie",
|
|
|
|
},
|
|
|
|
]}
|
|
|
|
getRowHref={() => ""}
|
|
|
|
/>
|
|
|
|
</TranslationsEntitiesListPage>
|
|
|
|
);
|
2023-05-22 09:09:36 +00:00
|
|
|
|
|
|
|
const meta: Meta<typeof ListPage> = {
|
|
|
|
title: "Translations / Entity list",
|
|
|
|
decorators: [PaginatorContextDecorator],
|
|
|
|
component: ListPage,
|
|
|
|
};
|
|
|
|
export default meta;
|
|
|
|
type Story = StoryObj<typeof ListPage>;
|
|
|
|
|
|
|
|
export const Default: Story = {
|
|
|
|
args: {
|
|
|
|
...props,
|
|
|
|
},
|
|
|
|
parameters: {
|
|
|
|
chromatic: { diffThreshold: 0.85 },
|
|
|
|
},
|
|
|
|
};
|