Skip to content

Commit

Permalink
Clean up storybook (#2941)
Browse files Browse the repository at this point in the history
  • Loading branch information
krzysztofzuraw authored Jan 5, 2023
1 parent 7545bc1 commit fe709db
Show file tree
Hide file tree
Showing 213 changed files with 501 additions and 4,998 deletions.
3 changes: 2 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules
build
build
*.stories.tsx
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
],
"overrides": [
{
"files": ["src/**/*.test.*"],
"files": ["src/**/*.test.*", "src/**/*.stories.*"],
"rules": {
"react-refresh/only-export-components": "off"
}
Expand Down
4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -169,15 +169,13 @@
"workbox-strategies": "^6.1.2"
},
"optionalDependencies": {
"@storybook/addon-storyshots": "^5.2.8",
"@storybook/react": "^5.1.9",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^12.1.5",
"@testing-library/react-hooks": "^8.0.1",
"@testing-library/user-event": "^14.4.3",
"@types/jest": "^26.0.14",
"@types/setup-polly-jest": "^0.5.0",
"@types/storybook__addon-storyshots": "^3.4.9",
"@types/storybook__react": "^4.0.2",
"cypress": "^10.0.2",
"cypress-file-upload": "^5.0.8",
Expand Down Expand Up @@ -293,4 +291,4 @@
"prepare": "is-ci || husky install"
},
"description": "![Saleor Dashboard](https://user-images.githubusercontent.com/249912/82305745-5c52fd00-99be-11ea-9ac6-cc04a6f28c91.png)"
}
}

This file was deleted.

This file was deleted.

19 changes: 0 additions & 19 deletions src/apps/components/AppDeleteDialog/AppDeleteDialog.stories.tsx

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const props: AppDetailsPageProps = {
onAppDeactivateOpen: () => undefined,
};

storiesOf("Views / Apps / App details", module)
storiesOf("Apps / App details", module)
.addDecorator(Decorator)
.add("default", () => <AppDetailsPage {...props} />)
.add("loading", () => <AppDetailsPage {...props} loading={true} />);

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const props: AppInstallPageProps = {
onSubmit: () => Promise.resolve([]),
};

storiesOf("Views / Apps / Install App", module)
storiesOf("Apps / Install App", module)
.addDecorator(Decorator)
.add("default", () => <AppInstallPage {...props} />)
.add("loading", () => <AppInstallPage {...props} loading={true} />);
2 changes: 1 addition & 1 deletion src/apps/components/AppPage/AppPage.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const props: AppPageProps = {
onError: () => undefined,
};

storiesOf("Views / Apps / App", module)
storiesOf("Apps / App", module)
.addDecorator(Decorator)
.add("default", () => <AppPage {...props} />)
.add("settings", () => (
Expand Down
2 changes: 1 addition & 1 deletion src/apps/components/AppsListPage/AppListPage.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const props: AppsListPageProps = {
onInstalledAppRemove: () => undefined,
};

storiesOf("Views / Apps / Apps list", module)
storiesOf("Apps / Apps list", module)
.addDecorator(Decorator)
.addDecorator(story => (
<AppListContext.Provider
Expand Down
36 changes: 0 additions & 36 deletions src/apps/components/HorizontalSpacer/HorizontalSpacer.stories.tsx

This file was deleted.

9 changes: 0 additions & 9 deletions src/auth/components/LoginLoading/LoginLoading.stories.tsx

This file was deleted.

4 changes: 2 additions & 2 deletions src/auth/components/LoginPage/LoginPage.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Decorator from "@saleor/storybook/Decorator";
import { storiesOf } from "@storybook/react";
import React from "react";

import LoginPage, { LoginCardProps } from "../../../auth/components/LoginPage";
import LoginPage, { LoginCardProps } from "./LoginPage";

const props: Omit<LoginCardProps, "classes"> = {
disabled: false,
Expand All @@ -20,7 +20,7 @@ const props: Omit<LoginCardProps, "classes"> = {
onSubmit: () => undefined,
};

storiesOf("Views / Authentication / Log in", module)
storiesOf("Authentication / Log in", module)
.addDecorator(CardDecorator)
.addDecorator(Decorator)
.add("default", () => <LoginPage {...props} />)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import React from "react";

import NewPasswordPage from "./NewPasswordPage";

storiesOf("Views / Authentication / Set up a new password", module)
storiesOf("Authentication / Set up a new password", module)
.addDecorator(CardDecorator)
.addDecorator(Decorator)
.add("default", () => (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import CardDecorator from "@saleor/storybook/CardDecorator";
import Decorator from "@saleor/storybook/Decorator";
import { formError } from "@saleor/storybook/misc";
import { formError } from "@saleor/storybook/formError";
import { storiesOf } from "@storybook/react";
import React from "react";

Expand All @@ -11,7 +11,7 @@ const props: ResetPasswordPageProps = {
error: undefined,
onSubmit: () => undefined,
};
storiesOf("Views / Authentication / Reset password", module)
storiesOf("Authentication / Reset password", module)
.addDecorator(CardDecorator)
.addDecorator(Decorator)
.add("default", () => <ResetPasswordPage {...props} />)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import React from "react";

import ResetPasswordSuccessPage from "./ResetPasswordSuccessPage";

storiesOf("Views / Authentication / Reset password success", module)
storiesOf("Authentication / Reset password success", module)
.addDecorator(CardDecorator)
.addDecorator(Decorator)
.add("default", () => <ResetPasswordSuccessPage onBack={() => undefined} />);
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { ProductErrorCode } from "@saleor/graphql";
import Decorator from "@saleor/storybook/Decorator";
import { storiesOf } from "@storybook/react";
import React from "react";

import CategoryCreatePage, {
CategoryCreatePageProps,
} from "../../../categories/components/CategoryCreatePage";
import Decorator from "../../Decorator";
} from "./CategoryCreatePage";

const createProps: CategoryCreatePageProps = {
backUrl: "",
Expand All @@ -15,7 +15,7 @@ const createProps: CategoryCreatePageProps = {
saveButtonBarState: "default",
};

storiesOf("Views / Categories / Create category", module)
storiesOf("Categories / Create category", module)
.addDecorator(Decorator)
.add("default", () => <CategoryCreatePage {...createProps} />)
.add("When loading", () => (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import CategoryListPage, {
CategoryTableProps,
} from "@saleor/categories/components/CategoryListPage";
import { categories } from "@saleor/categories/fixtures";
import { CategoryListUrlSortField } from "@saleor/categories/urls";
import {
Expand All @@ -10,11 +7,12 @@ import {
sortPageProps,
tabPageProps,
} from "@saleor/fixtures";
import Decorator from "@saleor/storybook/Decorator";
import { PaginatorContextDecorator } from "@saleor/storybook/PaginatorContextDecorator";
import { storiesOf } from "@storybook/react";
import React from "react";

import Decorator from "../../Decorator";
import CategoryListPage, { CategoryTableProps } from "./CategoryListPage";

const categoryTableProps: CategoryTableProps = {
categories,
Expand All @@ -30,7 +28,7 @@ const categoryTableProps: CategoryTableProps = {
},
};

storiesOf("Views / Categories / Category list", module)
storiesOf("Categories / Category list", module)
.addDecorator(Decorator)
.addDecorator(PaginatorContextDecorator)
.add("default", () => <CategoryListPage {...categoryTableProps} />)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import placeholderImage from "@assets/images/placeholder255x255.png";
import { category as categoryFixture } from "@saleor/categories/fixtures";
import { listActionsProps } from "@saleor/fixtures";
import { ProductErrorCode } from "@saleor/graphql";
import Decorator from "@saleor/storybook/Decorator";
import { PaginatorContextDecorator } from "@saleor/storybook/PaginatorContextDecorator";
import { mapEdgesToItems } from "@saleor/utils/maps";
import { storiesOf } from "@storybook/react";
Expand All @@ -8,10 +11,7 @@ import React from "react";
import CategoryUpdatePage, {
CategoryPageTab,
CategoryUpdatePageProps,
} from "../../../categories/components/CategoryUpdatePage";
import { category as categoryFixture } from "../../../categories/fixtures";
import { listActionsProps } from "../../../fixtures";
import Decorator from "../../Decorator";
} from "./CategoryUpdatePage";

const category = categoryFixture(placeholderImage);

Expand All @@ -35,7 +35,7 @@ const updateProps: Omit<CategoryUpdatePageProps, "classes"> = {
...listActionsProps,
};

storiesOf("Views / Categories / Update category", module)
storiesOf("Categories / Update category", module)
.addDecorator(Decorator)
.addDecorator(PaginatorContextDecorator)
.add("default", () => <CategoryUpdatePage {...updateProps} />)
Expand Down

This file was deleted.

This file was deleted.

Loading

0 comments on commit fe709db

Please sign in to comment.