-
Notifications
You must be signed in to change notification settings - Fork 303
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrated Storybook notation from CSF2 to CSF3 (#487)
* Migrate common directory to CSF3 notation * Migrate InstalledPackages directory to CSF3 notation * Migrate modal directory to CSF3 notation * Migrate repository directory to CSF3 notation * Migrate others components to CSF3 notation * Fix lint error in repository directory
- Loading branch information
Showing
23 changed files
with
413 additions
and
465 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,28 @@ | ||
/* eslint-disable no-console */ | ||
// Status.stories.ts|tsx | ||
import { Meta } from "@storybook/react"; | ||
import Button from "./Button"; | ||
|
||
import { ComponentStory, ComponentMeta } from "@storybook/react"; | ||
import Button, { ButtonProps } from "./Button"; | ||
//👇 This default export determines where your story goes in the story list | ||
export default { | ||
const meta = { | ||
/* 👇 The title prop is optional. | ||
* See https://storybook.js.org/docs/react/configure/overview#configure-story-loading | ||
* to learn how to generate automatic titles | ||
*/ | ||
title: "Button", | ||
component: Button, | ||
} as ComponentMeta<typeof Button>; | ||
} satisfies Meta<typeof Button>; | ||
|
||
// Recall that Button has 'props' which is of type ButtonProps | ||
// We want to past theme to the story with the name 'Default', so we | ||
// create a template for it. | ||
// We want to declare default values for the props, so we create a | ||
// default args object. | ||
const Template: ComponentStory<typeof Button> = (args: ButtonProps) => ( | ||
<Button {...args} /> | ||
); | ||
export const Default = Template.bind({}); | ||
Default.args = { | ||
children: ( | ||
<> | ||
<span>↑</span> | ||
<span>Update</span> | ||
</> | ||
), | ||
onClick: () => { | ||
console.log("click"); | ||
export default meta; | ||
|
||
export const Default = { | ||
args: { | ||
children: ( | ||
<> | ||
<span>↑</span> | ||
<span>Update</span> | ||
</> | ||
), | ||
onClick: () => { | ||
console.log("click"); | ||
}, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 23 additions & 29 deletions
52
frontend/src/components/InstalledPackages/InstalledPackageCard.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,35 @@ | ||
// InstalledPackageCard.stories.ts|tsx | ||
|
||
import { ComponentStory, ComponentMeta } from "@storybook/react"; | ||
import { Meta } from "@storybook/react"; | ||
import InstalledPackageCard from "./InstalledPackageCard"; | ||
|
||
//👇 This default export determines where your story goes in the story list | ||
export default { | ||
const meta = { | ||
/* 👇 The title prop is optional. | ||
* See https://storybook.js.org/docs/react/configure/overview#configure-story-loading | ||
* to learn how to generate automatic titles | ||
*/ | ||
title: "InstalledPackageCard", | ||
component: InstalledPackageCard, | ||
} as ComponentMeta<typeof InstalledPackageCard>; | ||
|
||
//👇 We create a “template” of how args map to rendering | ||
const Template: ComponentStory<typeof InstalledPackageCard> = (args) => ( | ||
<InstalledPackageCard {...args} /> | ||
); | ||
} satisfies Meta<typeof InstalledPackageCard>; | ||
|
||
export const Default = Template.bind({}); | ||
export default meta; | ||
|
||
Default.args = { | ||
release: { | ||
id: "", | ||
name: "", | ||
namespace: "", | ||
revision: 1, | ||
updated: "", | ||
status: "", | ||
chart: "", | ||
chart_name: "", | ||
chart_ver: "", | ||
app_version: "", | ||
icon: "", | ||
description: "", | ||
has_tests: false, | ||
chartName: "", // duplicated in some cases in the backend, we need to resolve this | ||
chartVersion: "", // duplicated in some cases in the backend, we need to resolve this | ||
export const Default = { | ||
args: { | ||
release: { | ||
id: "", | ||
name: "", | ||
namespace: "", | ||
revision: 1, | ||
updated: "", | ||
status: "", | ||
chart: "", | ||
chart_name: "", | ||
chart_ver: "", | ||
app_version: "", | ||
icon: "", | ||
description: "", | ||
has_tests: false, | ||
chartName: "", // duplicated in some cases in the backend, we need to resolve this | ||
chartVersion: "", // duplicated in some cases in the backend, we need to resolve this | ||
}, | ||
}, | ||
}; |
92 changes: 43 additions & 49 deletions
92
frontend/src/components/InstalledPackages/InstalledPackagesHeader.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,60 +1,54 @@ | ||
// InstalledPackagesHeader.stories.ts|tsx | ||
|
||
import { ComponentStory, ComponentMeta } from "@storybook/react"; | ||
import { Meta } from "@storybook/react"; | ||
import InstalledPackagesHeader from "./InstalledPackagesHeader"; | ||
|
||
//👇 This default export determines where your story goes in the story list | ||
export default { | ||
const meta = { | ||
/* 👇 The title prop is optional. | ||
* See https://storybook.js.org/docs/react/configure/overview#configure-story-loading | ||
* to learn how to generate automatic titles | ||
*/ | ||
title: "InstalledPackagesHeader", | ||
component: InstalledPackagesHeader, | ||
} as ComponentMeta<typeof InstalledPackagesHeader>; | ||
|
||
//👇 We create a “template” of how args map to rendering | ||
const Template: ComponentStory<typeof InstalledPackagesHeader> = (args) => ( | ||
<InstalledPackagesHeader {...args} /> | ||
); | ||
} satisfies Meta<typeof InstalledPackagesHeader>; | ||
|
||
export const Default = Template.bind({}); | ||
export default meta; | ||
|
||
Default.args = { | ||
filteredReleases: [ | ||
{ | ||
id: "", | ||
name: "", | ||
namespace: "", | ||
revision: 1, | ||
updated: "", | ||
status: "", | ||
chart: "", | ||
chart_name: "", | ||
chart_ver: "", | ||
app_version: "", | ||
icon: "", | ||
description: "", | ||
has_tests: false, | ||
chartName: "", // duplicated in some cases in the backend, we need to resolve this | ||
chartVersion: "", // duplicated in some cases in the | ||
}, | ||
{ | ||
id: "", | ||
name: "", | ||
namespace: "", | ||
revision: 1, | ||
updated: "", | ||
status: "", | ||
chart: "", | ||
chart_name: "", | ||
chart_ver: "", | ||
app_version: "", | ||
icon: "", | ||
description: "", | ||
has_tests: false, | ||
chartName: "", // duplicated in some cases in the backend, we need to resolve this | ||
chartVersion: "", // duplicated in some cases in the | ||
}, | ||
], | ||
export const Default = { | ||
args: { | ||
filteredReleases: [ | ||
{ | ||
id: "", | ||
name: "", | ||
namespace: "", | ||
revision: 1, | ||
updated: "", | ||
status: "", | ||
chart: "", | ||
chart_name: "", | ||
chart_ver: "", | ||
app_version: "", | ||
icon: "", | ||
description: "", | ||
has_tests: false, | ||
chartName: "", // duplicated in some cases in the backend, we need to resolve this | ||
chartVersion: "", // duplicated in some cases in the | ||
}, | ||
{ | ||
id: "", | ||
name: "", | ||
namespace: "", | ||
revision: 1, | ||
updated: "", | ||
status: "", | ||
chart: "", | ||
chart_name: "", | ||
chart_ver: "", | ||
app_version: "", | ||
icon: "", | ||
description: "", | ||
has_tests: false, | ||
chartName: "", // duplicated in some cases in the backend, we need to resolve this | ||
chartVersion: "", // duplicated in some cases in the | ||
}, | ||
], | ||
}, | ||
}; |
Oops, something went wrong.