Skip to content

chore(site): Upgrade storybook to 7.0.4 #7127

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Apr 13, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Fix
  • Loading branch information
BrunoQuaresma committed Apr 13, 2023
commit c4072abe757631304b4a16b3e46c1849928e2b35
2 changes: 2 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -636,6 +636,7 @@ jobs:
uses: chromaui/action@v1
env:
NODE_OPTIONS: "--max_old_space_size=4096"
STORYBOOK: true
with:
buildScriptName: "storybook:build"
exitOnceUploaded: true
Expand All @@ -655,6 +656,7 @@ jobs:
uses: chromaui/action@v1
env:
NODE_OPTIONS: "--max_old_space_size=4096"
STORYBOOK: true
with:
autoAcceptChanges: true
buildScriptName: "storybook:build"
Expand Down
2 changes: 1 addition & 1 deletion site/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"lint:fix": "FIX=true yarn lint",
"playwright:install": "playwright install --with-deps chromium",
"playwright:test": "playwright test --config=e2e/playwright.config.ts",
"storybook": "storybook dev -p 6006",
"storybook": "STORYBOOK=true storybook dev -p 6006",
"storybook:build": "storybook build",
"test": "jest --selectProjects test",
"test:ci": "jest --selectProjects test --silent",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,16 @@ export default {
title: "Components/Dialogs/ConfirmDialog",
component: ConfirmDialog,
argTypes: {
onClose: {
action: "onClose",
defaultValue: action("onClose"),
},
onConfirm: {
action: "onConfirm",
defaultValue: action("onConfirm"),
},
open: {
control: "boolean",
defaultValue: true,
},
title: {
defaultValue: "Confirm Dialog",
},
},
args: {
onClose: action("onClose"),
onConfirm: action("onConfirm"),
open: true,
title: "Confirm Dialog",
},
} as ComponentMeta<typeof ConfirmDialog>

const Template: Story<ConfirmDialogProps> = (args) => (
Expand Down
27 changes: 8 additions & 19 deletions site/src/components/Dialogs/DeleteDialog/DeleteDialog.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,18 @@ export default {
title: "Components/Dialogs/DeleteDialog",
component: DeleteDialog,
argTypes: {
onCancel: {
action: "onClose",
defaultValue: action("onClose"),
},
onConfirm: {
action: "onConfirm",
defaultValue: action("onConfirm"),
},
open: {
control: "boolean",
defaultValue: true,
},
entity: {
defaultValue: "foo",
},
name: {
defaultValue: "MyFoo",
},
info: {
defaultValue:
"Here's some info about the foo so you know you're deleting the right one.",
},
},
args: {
onCancel: action("onClose"),
onConfirm: action("onConfirm"),
open: true,
entity: "foo",
name: "MyFoo",
info: "Here's some info about the foo so you know you're deleting the right one.",
},
} as ComponentMeta<typeof DeleteDialog>

const Template: Story<DeleteDialogProps> = (args) => <DeleteDialog {...args} />
Expand Down
7 changes: 5 additions & 2 deletions site/src/components/LoadingButton/LoadingButton.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@ export default {
title: "components/LoadingButton",
component: LoadingButton,
argTypes: {
loading: { control: { type: "boolean" } },
children: { control: "text", defaultValue: "Create workspace" },
loading: { control: "boolean" },
children: { control: "text" },
},
args: {
children: "Create workspace",
},
}

Expand Down
1 change: 0 additions & 1 deletion site/src/components/Resources/AgentRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ export const AgentRow: FC<AgentRowProps> = ({
}) => {
const styles = useStyles()
const { t } = useTranslation("agent")

const [logsMachine, sendLogsEvent] = useMachine(workspaceAgentLogsMachine, {
context: { agentID: agent.id },
services: process.env.STORYBOOK
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ComponentMeta, Story } from "@storybook/react"
import { Story } from "@storybook/react"
import { userFilterQuery, workspaceFilterQuery } from "../../utils/filters"
import {
SearchBarWithFilter,
Expand All @@ -8,12 +8,10 @@ import {
export default {
title: "components/SearchBarWithFilter",
component: SearchBarWithFilter,
argTypes: {
filter: {
defaultValue: workspaceFilterQuery.me,
},
args: {
filter: workspaceFilterQuery.me,
},
} as ComponentMeta<typeof SearchBarWithFilter>
}

const Template: Story<SearchBarWithFilterProps> = (args) => (
<SearchBarWithFilter {...args} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Example.args = {
},
MockTemplateVersion,
],
onPromoteClick: undefined,
}

export const CanPromote = Template.bind({})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@ dayjs.extend(utc)
export default {
title: "components/WorkspaceSchedule",
component: WorkspaceSchedule,
argTypes: {
canUpdateWorkspace: {
defaultValue: true,
},
args: {
canUpdateWorkspace: true,
},
}

Expand Down
5 changes: 4 additions & 1 deletion site/src/pages/CliAuthPage/CliAuthPageView.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ export default {
title: "pages/CliAuthPageView",
component: CliAuthPageView,
argTypes: {
sessionToken: { control: "text", defaultValue: "some-session-token" },
sessionToken: { control: "text" },
},
args: {
sessionToken: "some-session-token",
},
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ RichParameters.args = {
MockTemplateVersionParameter3,
{
name: "Region",
required: false,
description: "",
description_plaintext: "",
type: "string",
Expand Down
6 changes: 2 additions & 4 deletions site/src/pages/WorkspacesPage/WorkspacesPageView.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,8 @@ const allWorkspaces = [
export default {
title: "pages/WorkspacesPageView",
component: WorkspacesPageView,
argTypes: {
limit: {
defaultValue: DEFAULT_RECORDS_PER_PAGE,
},
args: {
limit: DEFAULT_RECORDS_PER_PAGE,
},
} as ComponentMeta<typeof WorkspacesPageView>

Expand Down
1 change: 1 addition & 0 deletions site/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export default defineConfig({
define: {
"process.env": {
NODE_ENV: process.env.NODE_ENV,
STORYBOOK: process.env.STORYBOOK,
INSPECT_XSTATE: process.env.INSPECT_XSTATE,
},
},
Expand Down