mirror of
https://github.com/Portabase/portabase.git
synced 2026-07-14 11:16:13 +02:00
fix(onboarding): skip db-settings step if no database is found on the agent
This commit is contained in:
@@ -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 && (
|
||||||
|
|||||||
@@ -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",
|
||||||
|
|||||||
Reference in New Issue
Block a user