fix(ui): preserve setup phase on wizard back navigation

This commit is contained in:
alejandrobailo committed 2026-02-23 15:56:25 +01:00
1 parent 817349fa3e
commit 89133550b9
2 files changed
+8 -5

No files matched your search

@@ -72,6 +72,7 @@ interface OrgSetupFormProps {
onNext: () => void;
onFooterChange: (config: WizardFooterConfig) => void;
onPhaseChange: (phase: OrgSetupPhase) => void;
initialPhase?: OrgSetupPhase;
}
export function OrgSetupForm({
@@ -79,14 +80,13 @@ export function OrgSetupForm({
onNext,
onFooterChange,
onPhaseChange,
initialPhase = ORG_SETUP_PHASE.DETAILS,
}: OrgSetupFormProps) {
const { data: session } = useSession();
const [apiError, setApiError] = useState<string | null>(null);
const [isExternalIdCopied, setIsExternalIdCopied] = useState(false);
const stackSetExternalId = session?.tenantId ?? "";
const [setupPhase, setSetupPhase] = useState<OrgSetupPhase>(
ORG_SETUP_PHASE.DETAILS,
);
const [setupPhase, setSetupPhase] = useState<OrgSetupPhase>(initialPhase);
const {
setOrganization,
setDiscovery,
@@ -207,7 +207,9 @@ export function OrgSetupForm({
return;
}
const existingOrganization = Array.isArray(existingOrganizationsResult?.data)
const existingOrganization = Array.isArray(
existingOrganizationsResult?.data,
)
? existingOrganizationsResult.data.find(
(organization: {
id: string;
@@ -366,6 +366,7 @@ export function ProviderWizardModal({
}}
onFooterChange={setFooterConfig}
onPhaseChange={setOrgSetupPhase}
initialPhase={orgSetupPhase}
/>
)}
@@ -385,7 +386,7 @@ export function ProviderWizardModal({
<OrgAccountSelection
onBack={() => {
setOrgCurrentStep(ORG_WIZARD_STEP.SETUP);
setOrgSetupPhase(ORG_SETUP_PHASE.DETAILS);
setOrgSetupPhase(ORG_SETUP_PHASE.ACCESS);
}}
onNext={() => {
setOrgCurrentStep(ORG_WIZARD_STEP.LAUNCH);