fix(onboarding): skip db-settings step if no database is found on the agent

This commit is contained in:
Théo LAGACHE
2026-06-19 14:44:32 +02:00
parent ec07424ddf
commit 50f7fb17e8
2 changed files with 15 additions and 5 deletions
+7 -3
View File
@@ -43,7 +43,7 @@ export const OnboardingShell = () => {
<OnboardingStepper /> <OnboardingStepper />
<div className="flex-1">{renderStep()}</div> <div className="flex-1">{renderStep()}</div>
<div className="flex justify-between"> <div className="flex justify-between">
{currentIndex > 0 ? ( {currentIndex > 0 && (
<Button <Button
type="button" type="button"
variant="ghost" variant="ghost"
@@ -59,6 +59,12 @@ export const OnboardingShell = () => {
if (notifiers.length === 0 && storages.length === 0) { if (notifiers.length === 0 && storages.length === 0) {
prevId = "storage"; prevId = "storage";
} }
} else if (currentStepId === "finish") {
const databases =
(state.context.flowData.databases as unknown[]) || [];
if (databases.length === 0) {
prevId = "project-create";
}
} }
if (prevId) goToStep(prevId); if (prevId) goToStep(prevId);
}} }}
@@ -66,8 +72,6 @@ export const OnboardingShell = () => {
> >
Back Back
</Button> </Button>
) : (
<div />
)} )}
<div className="flex gap-2"> <div className="flex gap-2">
{state.isSkippable && ( {state.isSkippable && (
+8 -2
View File
@@ -118,8 +118,14 @@ export const onboardingSteps: OnboardingStep[] = [
id: "project-create", id: "project-create",
component: StepProjectCreate, component: StepProjectCreate,
isSkippable: true, isSkippable: true,
skipToStep: "db-settings", skipToStep: (ctx: any) => {
nextStep: "db-settings", const databases = (ctx.flowData?.databases as unknown[]) || [];
return databases.length === 0 ? "finish" : "db-settings";
},
nextStep: (ctx: any) => {
const databases = (ctx.flowData?.databases as unknown[]) || [];
return databases.length === 0 ? "finish" : "db-settings";
},
}, },
{ {
id: "db-settings", id: "db-settings",