
* Handle limit reached error * Update changelog * Move notifications to higher layer * Handle limits top-level * Remove unused imports * Add alert component * Fetch limits from API * Display limits in staff list * Fix disabled text button color * Display limits in products pages * Display limits in channel list * Display limits in warehouse list * Display limits in order list * Add stories for limits * Move alert to corresponding section * Update schema * Update changelog * Fetch only needed limitations * Fix types * Fix story * Display limits in variant creator * Improve type consistency * Update snapshots * Update limit counter after object deletion * Fix copy * Improve code readability * Lint files * Fix dark mode alerts * Improve contrast * Fix sku limit in product variant list * Update stories * Update messages * Extract messages
44 lines
1.3 KiB
TypeScript
44 lines
1.3 KiB
TypeScript
import {
|
|
limits,
|
|
limitsReached,
|
|
pageListProps,
|
|
searchPageProps,
|
|
sortPageProps,
|
|
tabPageProps
|
|
} from "@saleor/fixtures";
|
|
import Decorator from "@saleor/storybook/Decorator";
|
|
import WarehouseListPage, {
|
|
WarehouseListPageProps
|
|
} from "@saleor/warehouses/components/WarehouseListPage";
|
|
import { WarehouseListUrlSortField } from "@saleor/warehouses/urls";
|
|
import { storiesOf } from "@storybook/react";
|
|
import React from "react";
|
|
|
|
import { warehouseList } from "../../fixtures";
|
|
|
|
const props: WarehouseListPageProps = {
|
|
...pageListProps.default,
|
|
...searchPageProps,
|
|
...sortPageProps,
|
|
...tabPageProps,
|
|
limits,
|
|
onBack: () => undefined,
|
|
onRemove: () => undefined,
|
|
sort: {
|
|
...sortPageProps.sort,
|
|
sort: WarehouseListUrlSortField.name
|
|
},
|
|
warehouses: warehouseList
|
|
};
|
|
|
|
storiesOf("Views / Warehouses / Warehouse list", module)
|
|
.addDecorator(Decorator)
|
|
.add("default", () => <WarehouseListPage {...props} />)
|
|
.add("loading", () => (
|
|
<WarehouseListPage {...props} disabled={true} warehouses={undefined} />
|
|
))
|
|
.add("no data", () => <WarehouseListPage {...props} warehouses={[]} />)
|
|
.add("no limits", () => <WarehouseListPage {...props} limits={undefined} />)
|
|
.add("limits reached", () => (
|
|
<WarehouseListPage {...props} limits={limitsReached} />
|
|
));
|