From 9c8b05f041619fd2047c60fcd272fb4fd05d01b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Ml=C3=A1dek?= Date: Tue, 24 Jan 2023 19:15:34 +0100 Subject: [PATCH] chore: fix Surface story, add prefilled story --- webui/src/stories/Surface.stories.ts | 12 ++++++++++-- webui/src/views/Surface.svelte | 4 ++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/webui/src/stories/Surface.stories.ts b/webui/src/stories/Surface.stories.ts index 45a04d1..e9f25ea 100644 --- a/webui/src/stories/Surface.stories.ts +++ b/webui/src/stories/Surface.stories.ts @@ -1,6 +1,7 @@ import type { Meta, StoryObj } from "@storybook/svelte"; import Surface from "../views/Surface.svelte"; import FullscreenDecorator from "./FullscreenDecorator.svelte"; +import RouterDecorator from "./RouterDecorator.svelte"; const meta: Meta = { title: "Views/Surface", @@ -9,10 +10,17 @@ const meta: Meta = { parameters: { layout: "fullscreen", }, - decorators: [() => FullscreenDecorator], + decorators: [() => FullscreenDecorator, () => RouterDecorator], }; export default meta; type Story = StoryObj; -export const Default: Story = {}; +export const Empty: Story = {}; + +export const Prefilled: Story = { + args: { + x: "X_AXIS_ATTR", + y: "Y_AXIS_ATTR" + } +} \ No newline at end of file diff --git a/webui/src/views/Surface.svelte b/webui/src/views/Surface.svelte index f87c43e..589c195 100644 --- a/webui/src/views/Surface.svelte +++ b/webui/src/views/Surface.svelte @@ -14,8 +14,8 @@ ); const urlParams = new URLSearchParams(urlSearch); - let x: string = urlParams.get("x"); - let y: string = urlParams.get("y"); + export let x: string = urlParams.get("x"); + export let y: string = urlParams.get("y"); let viewMode = "link"; let currentX = NaN;