From 9e43285ba816e7aa794103497fe2c0852b4ef4a1 Mon Sep 17 00:00:00 2001 From: Johannes Kirschbauer Date: Tue, 5 Aug 2025 19:28:47 +0200 Subject: [PATCH] UI/install: bootstrap steps for {DiskSchema, Vars, Summary} --- .../src/workflows/Install/Install.stories.tsx | 35 +++ .../workflows/Install/steps/installSteps.tsx | 244 +++++++++++++++++- 2 files changed, 272 insertions(+), 7 deletions(-) diff --git a/pkgs/clan-app/ui/src/workflows/Install/Install.stories.tsx b/pkgs/clan-app/ui/src/workflows/Install/Install.stories.tsx index eba2f9658..1590091b8 100644 --- a/pkgs/clan-app/ui/src/workflows/Install/Install.stories.tsx +++ b/pkgs/clan-app/ui/src/workflows/Install/Install.stories.tsx @@ -66,3 +66,38 @@ export const InstallCheckHardware: Story = { initialStep: "install:check-hardware", }, }; +export const InstallSelectDisk: Story = { + description: "Select disk to install the system on", + args: { + machineName: "Test Machine", + initialStep: "install:disk", + }, +}; +export const InstallVars: Story = { + description: "Fill required credentials and data for the installation", + args: { + machineName: "Test Machine", + initialStep: "install:data", + }, +}; +export const InstallSummary: Story = { + description: "Summary of the installation steps", + args: { + machineName: "Test Machine", + initialStep: "install:summary", + }, +}; +export const InstallProgress: Story = { + description: "Shown while the installation is in progress", + args: { + machineName: "Test Machine", + initialStep: "install:progress", + }, +}; +export const InstallDone: Story = { + description: "Shown after the installation is done", + args: { + machineName: "Test Machine", + initialStep: "install:done", + }, +}; diff --git a/pkgs/clan-app/ui/src/workflows/Install/steps/installSteps.tsx b/pkgs/clan-app/ui/src/workflows/Install/steps/installSteps.tsx index 4aebfdd9c..1f94c759c 100644 --- a/pkgs/clan-app/ui/src/workflows/Install/steps/installSteps.tsx +++ b/pkgs/clan-app/ui/src/workflows/Install/steps/installSteps.tsx @@ -16,10 +16,11 @@ import { createSignal, Show } from "solid-js"; import { Divider } from "@/src/components/Divider/Divider"; import { Orienter } from "@/src/components/Form/Orienter"; import { Button } from "@/src/components/Button/Button"; +import { Select } from "@/src/components/Select/Select"; export const InstallHeader = (props: { machineName: string }) => { return ( - + Installing: {props.machineName} ); @@ -129,6 +130,216 @@ const CheckHardware = () => { ); }; +const DiskSchema = v.object({ + mainDisk: v.pipe( + v.string("Please select a disk"), + v.nonEmpty("Please select a disk"), + ), +}); + +type DiskForm = v.InferInput; + +const ConfigureDisk = () => { + const [formStore, { Form, Field }] = createForm({ + validate: valiForm(DiskSchema), + }); + const stepSignal = useStepper(); + + const handleSubmit: SubmitHandler = (values, event) => { + console.log("submitted", values); + // Here you would typically trigger the ISO creation process + stepSignal.next(); + }; + + return ( +
+ +
+ + {(field, props) => ( +