mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-10-21 19:04:19 +00:00
fix(ui): preserve setup phase on wizard back navigation
This commit is contained in:
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);
|
||||
|
||||
Reference in new issue
Block a user