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

59 lines
1.8 KiB
TypeScript
Raw Normal View History

2023-01-05 12:34:34 +00:00
import { pageListProps, searchPageProps } from "@saleor/fixtures";
Use graphql-codegen (#1874) * Use generated hooks in apps * Remove unused files * Use proper types in apps * Use generated hooks in attributes * Use generated hooks in auth module * Use generated hooks in categories * Use generated hooks in channels * Use generated types in collections * Remove legacy types from background tasks * Use generated hooks in customers * Use generated hooks in discounts * Use generated hook in file upload * Use generated types in gift cards * Use generated types in home * Use generated hooks in navigation * Use generated hooks in orders * Use generated hooks in pages * Use generated hooks in page types * Use generated hooks in permission groups * Use generated hooks in plugins * Use generated hooks in products * Use fragment to mark product variants * Improve code a bit * Use generated hooks in page types * Use generated types in searches * Use generated hooks in shipping * Use generated hooks in site settings * Use generated hooks in staff members * Use generated hooks in taxes * Place all gql generated files in one directory * Use generated hooks in translations * Use global types from new generated module * Use generated hooks in warehouses * Use generated hooks in webhooks * Use generated fragment types * Unclutter types * Remove hoc components * Split hooks and types * Fetch introspection file * Delete obsolete schema file * Fix rebase artifacts * Fix autoreplace * Fix auth provider tests * Fix urls * Remove leftover types * Fix rebase artifacts
2022-03-09 08:56:55 +00:00
import { LanguageCodeEnum } from "@saleor/graphql";
2023-01-05 12:34:34 +00:00
import Decorator from "@saleor/storybook/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
import { PaginatorContextDecorator } from "@saleor/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>
));