Skip to content

Commit c2263f1

Browse files
committed
fix footer stories
1 parent d07a319 commit c2263f1

File tree

9 files changed

+32
-8
lines changed

9 files changed

+32
-8
lines changed

site/src/components/FormFooter/FormFooter.stories.tsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,31 @@
1+
import { action } from "@storybook/addon-actions";
12
import type { Meta, StoryObj } from "@storybook/react";
23
import { FormFooter } from "./FormFooter";
34

45
const meta: Meta<typeof FormFooter> = {
56
title: "components/FormFooter",
67
component: FormFooter,
8+
args: {
9+
isLoading: false,
10+
onCancel: action("onCancel"),
11+
},
712
};
813

914
export default meta;
1015
type Story = StoryObj<typeof FormFooter>;
1116

1217
export const Ready: Story = {
18+
args: {},
19+
};
20+
21+
export const NoCancel: Story = {
1322
args: {
14-
isLoading: false,
23+
onCancel: undefined,
1524
},
1625
};
1726

1827
export const Custom: Story = {
1928
args: {
20-
isLoading: false,
2129
submitLabel: "Create",
2230
},
2331
};

site/src/pages/CreateTemplatePage/CreateTemplateForm.stories.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { action } from "@storybook/addon-actions";
12
import type { Meta, StoryObj } from "@storybook/react";
23
import {
34
MockTemplate,
@@ -15,6 +16,7 @@ const meta: Meta<typeof CreateTemplateForm> = {
1516
component: CreateTemplateForm,
1617
args: {
1718
isSubmitting: false,
19+
onCancel: action("onCancel"),
1820
},
1921
};
2022

site/src/pages/CreateWorkspacePage/CreateWorkspacePageView.stories.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { action } from "@storybook/addon-actions";
12
import type { Meta, StoryObj } from "@storybook/react";
23
import { chromatic } from "testHelpers/chromatic";
34
import {
@@ -26,6 +27,7 @@ const meta: Meta<typeof CreateWorkspacePageView> = {
2627
permissions: {
2728
createWorkspaceForUser: true,
2829
},
30+
onCancel: action("onCancel"),
2931
},
3032
};
3133

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
11
import type { Meta, StoryObj } from "@storybook/react";
22
import { MockGroup } from "testHelpers/entities";
33
import { SettingsGroupPageView } from "./SettingsGroupPageView";
4+
import { action } from "@storybook/addon-actions/*";
45

56
const meta: Meta<typeof SettingsGroupPageView> = {
67
title: "pages/GroupsPage/SettingsGroupPageView",
78
component: SettingsGroupPageView,
8-
};
9-
10-
export default meta;
11-
type Story = StoryObj<typeof SettingsGroupPageView>;
12-
13-
const Example: Story = {
149
args: {
10+
onCancel: action("onCancel"),
1511
group: MockGroup,
1612
isLoading: false,
1713
},
1814
};
1915

16+
export default meta;
17+
type Story = StoryObj<typeof SettingsGroupPageView>;
18+
19+
const Example: Story = {};
20+
2021
export { Example as SettingsGroupPageView };

site/src/pages/TemplateSettingsPage/TemplateGeneralSettingsPage/TemplateSettingsPageView.stories.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { action } from "@storybook/addon-actions";
12
import type { Meta, StoryObj } from "@storybook/react";
23
import { mockApiError, MockTemplate } from "testHelpers/entities";
34
import { TemplateSettingsPageView } from "./TemplateSettingsPageView";
@@ -9,6 +10,7 @@ const meta: Meta<typeof TemplateSettingsPageView> = {
910
template: MockTemplate,
1011
accessControlEnabled: true,
1112
advancedSchedulingEnabled: true,
13+
onCancel: action("onCancel"),
1214
},
1315
};
1416

site/src/pages/TemplateSettingsPage/TemplateVariablesPage/TemplateVariablesPageView.stories.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { action } from "@storybook/addon-actions";
12
import type { Meta, StoryObj } from "@storybook/react";
23
import {
34
mockApiError,
@@ -13,6 +14,9 @@ import { TemplateVariablesPageView } from "./TemplateVariablesPageView";
1314
const meta: Meta<typeof TemplateVariablesPageView> = {
1415
title: "pages/TemplateSettingsPage/TemplateVariablesPageView",
1516
component: TemplateVariablesPageView,
17+
args: {
18+
onCancel: action("onCancel"),
19+
},
1620
};
1721

1822
export default meta;

site/src/pages/WorkspaceSettingsPage/WorkspaceParametersPage/WorkspaceParametersPage.stories.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { action } from "@storybook/addon-actions";
12
import type { Meta, StoryObj } from "@storybook/react";
23
import {
34
MockWorkspaceBuildParameter1,
@@ -19,6 +20,7 @@ const meta: Meta<typeof WorkspaceParametersPageView> = {
1920
isSubmitting: false,
2021
workspace: MockWorkspace,
2122
canChangeVersions: true,
23+
onCancel: action("onCancel"),
2224

2325
data: {
2426
buildParameters: [

site/src/pages/WorkspaceSettingsPage/WorkspaceSchedulePage/WorkspaceScheduleForm.stories.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
import { emptyTTL } from "pages/WorkspaceSettingsPage/WorkspaceSchedulePage/ttl";
1111
import { MockTemplate, mockApiError } from "testHelpers/entities";
1212
import { WorkspaceScheduleForm } from "./WorkspaceScheduleForm";
13+
import { action } from "@storybook/addon-actions/*";
1314

1415
dayjs.extend(advancedFormat);
1516
dayjs.extend(utc);

site/src/pages/WorkspaceSettingsPage/WorkspaceSettingsPageView.stories.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { action } from "@storybook/addon-actions";
12
import type { Meta, StoryObj } from "@storybook/react";
23
import { MockWorkspace } from "testHelpers/entities";
34
import { WorkspaceSettingsPageView } from "./WorkspaceSettingsPageView";
@@ -8,6 +9,7 @@ const meta: Meta<typeof WorkspaceSettingsPageView> = {
89
args: {
910
error: undefined,
1011
workspace: MockWorkspace,
12+
onCancel: action("onCancel"),
1113
},
1214
};
1315

0 commit comments

Comments
 (0)