Skip to content

Commit 9810d29

Browse files
authored
chore: make dynamic parameters TemplateEmbedPage the default (coder#25069)
1 parent 36d52ba commit 9810d29

9 files changed

Lines changed: 694 additions & 693 deletions

site/src/pages/TemplatePage/TemplateEmbedPage/TemplateEmbedExperimentRouter.tsx

Lines changed: 0 additions & 35 deletions
This file was deleted.
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
import type { Meta, StoryObj } from "@storybook/react-vite";
2+
import { action } from "storybook/actions";
3+
import { MockPreviewParameter, MockTemplate } from "#/testHelpers/entities";
4+
import { TemplateEmbedPageView } from "./TemplateEmbedPageView";
5+
6+
const meta: Meta<typeof TemplateEmbedPageView> = {
7+
title: "pages/TemplatePage/TemplateEmbedPageView",
8+
component: TemplateEmbedPageView,
9+
args: {
10+
template: MockTemplate,
11+
parameters: [
12+
{
13+
...MockPreviewParameter,
14+
name: "eevee",
15+
display_name: "Favorite Eevee",
16+
form_type: "input",
17+
value: { value: "Glaceon", valid: true },
18+
default_value: { value: "Jolteon", valid: true },
19+
order: 1,
20+
},
21+
{
22+
...MockPreviewParameter,
23+
name: "commander",
24+
display_name: "Commander",
25+
form_type: "input",
26+
value: { value: "Lyra Dawnbringer", valid: true },
27+
default_value: { value: "", valid: true },
28+
order: 0,
29+
},
30+
],
31+
diagnostics: [],
32+
sendMessage: action("sendMessage"),
33+
isLoading: false,
34+
},
35+
};
36+
37+
export default meta;
38+
type Story = StoryObj<typeof TemplateEmbedPageView>;
39+
40+
export const Example: Story = {};
41+
42+
export const Loading: Story = {
43+
args: {
44+
isLoading: true,
45+
},
46+
};
47+
48+
export const WithError: Story = {
49+
args: {
50+
error: new Error("failed to connect"),
51+
parameters: [],
52+
},
53+
};
54+
55+
export const Validation: Story = {
56+
args: {
57+
diagnostics: [
58+
{
59+
severity: "warning",
60+
summary: "Invalid wibble",
61+
detail: "Needs more wobble",
62+
extra: {
63+
code: "wooble",
64+
},
65+
},
66+
],
67+
},
68+
};

0 commit comments

Comments
 (0)