Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Add story for list view
dominik-zeglen44827b96849d
diff --git a/saleor/static/dashboard-next/navigation/fixtures.ts b/saleor/static/dashboard-next/navigation/fixtures.tsnew file mode 100644index 0000000000..17c1ee8186--- /dev/null+++ b/saleor/static/dashboard-next/navigation/fixtures.ts@@ -0,0 +1,23 @@+import { MenuList_menus_edges_node } from "./types/MenuList";++export const menuList: MenuList_menus_edges_node[] = [+ {+ __typename: "Menu",+ id: "TWVudTox",+ items: [+ { id: "TWVudUl0ZW06MQ==", __typename: "MenuItem" },+ { id: "TWVudUl0ZW06Mg==", __typename: "MenuItem" },+ { id: "TWVudUl0ZW06Mw==", __typename: "MenuItem" }+ ],+ name: "navbar"+ },+ {+ __typename: "Menu",+ id: "TWVudToy",+ items: [+ { id: "TWVudUl0ZW06NA==", __typename: "MenuItem" },+ { id: "TWVudUl0ZW06Nw==", __typename: "MenuItem" }+ ],+ name: "footer"+ }+];diff --git a/saleor/static/dashboard-next/storybook/config.js b/saleor/static/dashboard-next/storybook/config.jsindex 9d91fd17b3..f6def8725c 100644--- a/saleor/static/dashboard-next/storybook/config.js+++ b/saleor/static/dashboard-next/storybook/config.js@@ -73,6 +73,9 @@ function loadStories() {// Homepagerequire("./stories/home/HomePage");+ // Navigation+ require("./stories/navigation/MenuListPage");+// Staffrequire("./stories/staff/StaffListPage");require("./stories/staff/StaffDetailsPage");diff --git a/saleor/static/dashboard-next/storybook/stories/navigation/MenuListPage.tsx b/saleor/static/dashboard-next/storybook/stories/navigation/MenuListPage.tsxindex d54c353027..9e13d48e1c 100644--- a/saleor/static/dashboard-next/storybook/stories/navigation/MenuListPage.tsx+++ b/saleor/static/dashboard-next/storybook/stories/navigation/MenuListPage.tsx@@ -1,15 +1,21 @@import { storiesOf } from "@storybook/react";import * as React from "react";+import { pageListProps } from "../../../fixtures";import MenuListPage, {MenuListPageProps} from "../../../navigation/components/MenuListPage";+import { menuList } from "../../../navigation/fixtures";import Decorator from "../../Decorator";const props: MenuListPageProps = {-+ ...pageListProps.default,+ menus: menuList,+ onDelete: () => undefined};-storiesOf("Navigation / MenuListPage", module)+storiesOf("Views / Navigation / Menu list", module).addDecorator(Decorator)- .add("default", () => <MenuListPage {...props} />);+ .add("default", () => <MenuListPage {...props} />)+ .add("loading", () => <MenuListPage {...props} menus={undefined} />)+ .add("no data", () => <MenuListPage {...props} menus={[]} />);