saleor-dashboard/src/translations/components/TranslationsEntitiesListPage/TranslationsEntitiesListPage.stories.tsx

59 lines
1.8 KiB
TypeScript
Raw Normal View History

import { pageListProps, searchPageProps } from "@dashboard/fixtures";
import { LanguageCodeEnum } from "@dashboard/graphql";
import Decorator from "@dashboard/storybook/Decorator";
import { PaginatorContextDecorator } from "@dashboard/storybook/PaginatorContextDecorator";
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
2023-01-05 12:34:34 +00:00
import TranslationsEntitiesList from "../TranslationsEntitiesList";
2019-06-19 14:40:52 +00:00
import TranslationsEntitiesListPage, {
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,
onAttributesTabClick: () => undefined,
2019-06-19 14:40:52 +00:00
onProductsTabClick: () => undefined,
onSalesTabClick: () => undefined,
onShippingMethodsTabClick: () => undefined,
onVouchersTabClick: () => undefined,
onMenuItemsTabClick: () => undefined,
2019-06-19 14:40:52 +00:00
},
language: {
__typename: "LanguageDisplay",
code: LanguageCodeEnum.EN,
language: "English",
},
2019-06-19 14:40:52 +00:00
};
2023-01-05 12:34:34 +00:00
storiesOf("Translations / Entity list", module)
2019-06-19 14:40:52 +00:00
.addDecorator(Decorator)
Enhancements to pagination navigation (#2063) * Update macaw to include Paginator changes * Add link support to TablePagination component * Rewrite usePaginator to use context and links instead of onClick * Refactor ProductList to use new usePaginator hook * Add decorator for PaginatorContext in ProductList stories * Refactor AppList to use new usePaginator hook * Refactor AttributeList to use new usePaginator hook * Add missing pagination props for local pagination to AttributeValues * Refactor CategoryList to use new usePaginator hook * Refactor CategoryDetails to use useLocalPaginator and context * Refactor CollectionList to use new usePaginator hook * Refactor CollectionProducts to use new usePaginator hook * Refactor CustomerList to use new usePaginator hook * Refactor VoucherDetailsPage to use PaginationContext * Refactor SaleDetails to use PaginatorContext * Refactor SaleList to use new usePaginator hook * Refactor VoucherList to use new usePaginator hook * Fix type error in paginatorContextValues fixture * Refactor GitfCardList to use new usePaginator hook * Remove unused imports * Refactor MenuList to use new usePaginator hook * Refactor OrderDraftList to use new usePaginator hook * Refactor OrderListPage to use new usePaginator hook * Refactor PageList to use new usePaginator hook * Refactor PageTypeList to use new usePaginator hook * Refactor PermissionGroupList to use new usePaginator hook * Refactor PluginsList to use new usePaginator hook * Refactor ProductTypeList to use new usePaginator hook * Refactor ShippingMethodProducts to use PaginationContext * Refactor ShippingZonesList to use new usePaginator hook * Refactor StaffList to use new usePaginator hook * Fix TS errors * Update TranslationEntities and TranslationFields to use new usePaginator * Refactor WarehouseList to use new usePaginator hook * Fix errors in stories that didn't use PaginationContextDecorator * Mention changes in changelog * Update to latest macaw version, update snapshots
2022-05-31 12:53:16 +00:00
.addDecorator(PaginatorContextDecorator)
2019-06-19 14:40:52 +00:00
.add("default", () => (
<TranslationsEntitiesListPage {...props}>
<TranslationsEntitiesList
disabled={false}
entities={[
{
completion: { current: 1, max: 3 },
id: "1",
name: "White Hoodie",
2019-06-19 14:40:52 +00:00
},
{
completion: { current: 2, max: 3 },
id: "1",
name: "Brown Supreme Hoodie",
},
2019-06-19 14:40:52 +00:00
]}
getRowHref={() => ""}
2019-06-19 14:40:52 +00:00
/>
</TranslationsEntitiesListPage>
));