- Notifications
You must be signed in to change notification settings - Fork920
feat: manage provisioner tags in template editor#11600
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
58532a5
77d27cd
9de069f
07b2241
94fecc5
95159b9
b62fd65
c7d327d
6d0c615
4b28359
cad35c7
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -106,6 +106,7 @@ | ||
"@storybook/addon-links": "7.5.2", | ||
"@storybook/addon-mdx-gfm": "7.5.2", | ||
"@storybook/addon-themes": "7.6.4", | ||
"@storybook/preview-api": "7.6.9", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. What does it do? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. This is for the | ||
"@storybook/react": "7.5.2", | ||
"@storybook/react-vite": "7.5.2", | ||
"@swc/core": "1.3.38", | ||
Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.
Uh oh!
There was an error while loading.Please reload this page.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import type { Meta, StoryObj } from "@storybook/react"; | ||
import { chromatic } from "testHelpers/chromatic"; | ||
import { MockTemplateVersion } from "testHelpers/entities"; | ||
import { ProvisionerTagsPopover } from "./ProvisionerTagsPopover"; | ||
import { useArgs } from "@storybook/preview-api"; | ||
const meta: Meta<typeof ProvisionerTagsPopover> = { | ||
title: "component/ProvisionerTagsPopover", | ||
parameters: { | ||
chromatic, | ||
layout: "centered", | ||
}, | ||
component: ProvisionerTagsPopover, | ||
args: { | ||
tags: MockTemplateVersion.job.tags, | ||
}, | ||
render: function Render(args) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Since you are passing the component you don't need this render function at all. At least if you are using it just to test with Chromatic. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. I wanted this to function in Storybook live, and my understanding was that this was the way to manipulate args getting passed into the component with | ||
const [{ tags }, updateArgs] = useArgs(); | ||
return ( | ||
<ProvisionerTagsPopover | ||
{...args} | ||
tags={tags} | ||
onSubmit={({ key, value }) => { | ||
updateArgs({ tags: { ...tags, [key]: value } }); | ||
}} | ||
onDelete={(key) => { | ||
const newTags = { ...tags }; | ||
delete newTags[key]; | ||
updateArgs({ tags: newTags }); | ||
}} | ||
/> | ||
); | ||
}, | ||
}; | ||
export default meta; | ||
type Story = StoryObj<typeof ProvisionerTagsPopover>; | ||
export const Example: Story = {}; |
Uh oh!
There was an error while loading.Please reload this page.