Skip to content

Commit 1c4bbdc

Browse files
committed
feat(ui): add SelectProviderStep boilerplate as the first wizard step
Adds the Select Provider step at the top of the ConfigureSSO wizard tree. The step is structurally a regular wizard step — same Step chrome, same goNext / goPrev mechanics, same per-step descriptor — but ConfigureSSOHeader filters it out of the breadcrumb by id so it doesn't appear in the Stepper. When the user is on Select Provider, no breadcrumb bullet is highlighted (currentIndex resolves to -1 against the filtered list, all items render muted) — matches the design intent. The step body is placeholder UI for now. The provider tile selection, the FlowProvider integration, and the initial-step derivation all land separately when we actually build the Select Provider screen.
1 parent b823d63 commit 1c4bbdc

5 files changed

Lines changed: 53 additions & 3 deletions

File tree

packages/ui/src/components/ConfigureSSO/ConfigureSSO.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { ConfigureSSOHeader } from './ConfigureSSOHeader';
1313
import { ConfigureSSONavbar } from './ConfigureSSONavbar';
1414
import { ConfigureSSOSkeleton } from './ConfigureSSOSkeleton';
1515
import { Wizard } from './elements/Wizard';
16-
import { ConfigureStep, ConfirmationStep, TestConfigurationStep, VerifyDomainStep } from './steps';
16+
import { ConfigureStep, ConfirmationStep, SelectProviderStep, TestConfigurationStep, VerifyDomainStep } from './steps';
1717

1818
const ConfigureSSOInternal = () => {
1919
return (
@@ -81,6 +81,10 @@ const ConfigureSSOCardContent = () => {
8181
const ConfigureSSOSteps = () => {
8282
return (
8383
<>
84+
<Wizard.Step id='select-provider'>
85+
<SelectProviderStep />
86+
</Wizard.Step>
87+
8488
<Wizard.Step
8589
id='verify-domain'
8690
label='Verify domain'

packages/ui/src/components/ConfigureSSO/ConfigureSSOHeader.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,17 @@ import { useWizard } from './elements/Wizard';
77

88
export const ConfigureSSOHeader = (): JSX.Element => {
99
const { activeSteps, currentStep, goToStep } = useWizard();
10-
const currentIndex = activeSteps.findIndex(s => s.id === currentStep?.id);
10+
// Select Provider isn't part of the visual breadcrumb per the design —
11+
// filter it out here. The wizard still tracks it as the first step
12+
// for navigation (goNext from it advances to verify-domain, Previous
13+
// is naturally disabled because isFirstStep is true).
14+
const visibleSteps = activeSteps.filter(step => step.id !== 'select-provider');
15+
const currentIndex = visibleSteps.findIndex(step => step.id === currentStep?.id);
1116

1217
return (
1318
<ProfileCardHeader>
1419
<Stepper>
15-
{activeSteps.map((step, index) => {
20+
{visibleSteps.map((step, index) => {
1621
const isCurrent = index === currentIndex;
1722
const isCompleted = step.isCompleted ?? index < currentIndex;
1823
const isReachable = isCompleted || index <= currentIndex;
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import { descriptors, Flow, Text } from '@/customizables';
2+
3+
import { Step } from '../elements/Step';
4+
import { useWizard } from '../elements/Wizard';
5+
6+
export const SelectProviderStep = (): JSX.Element => {
7+
const { goNext, goPrev, isFirstStep, isLastStep } = useWizard();
8+
9+
return (
10+
<Flow.Part part='selectProvider'>
11+
<Step
12+
elementDescriptor={descriptors.configureSSOWizardBody}
13+
elementId={descriptors.configureSSOWizardBody.setId('select-provider')}
14+
>
15+
<Step.Header
16+
title='Select provider'
17+
description='Select the provider you are going to setup SSO for.'
18+
/>
19+
20+
<Step.Body>
21+
<Step.Section>
22+
<Text>UI goes here</Text>
23+
</Step.Section>
24+
</Step.Body>
25+
26+
<Step.Footer>
27+
<Step.Footer.Previous
28+
onClick={() => goPrev()}
29+
isDisabled={isFirstStep}
30+
/>
31+
<Step.Footer.Continue
32+
onClick={() => goNext()}
33+
isDisabled={isLastStep}
34+
/>
35+
</Step.Footer>
36+
</Step>
37+
</Flow.Part>
38+
);
39+
};
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
export { ConfigureStep } from './ConfigureStep';
22
export { ConfirmationStep } from './ConfirmationStep';
3+
export { SelectProviderStep } from './SelectProviderStep';
34
export { TestConfigurationStep } from './TestConfigurationStep';
45
export { VerifyDomainStep } from './VerifyDomainStep';

packages/ui/src/elements/contexts/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ export type FlowMetadata = {
135135
| 'organizationCreationDisabled'
136136
| 'methodSelectionMFA'
137137
| 'provideEmail'
138+
| 'selectProvider'
138139
| 'verifyDomain'
139140
| 'configureCreateApp'
140141
| 'configureMapAttributes'

0 commit comments

Comments
 (0)