-
Notifications
You must be signed in to change notification settings - Fork 453
chore(ui): Add verify domain step in <ConfigureSSO />
#8486
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
LauraBeatris
wants to merge
15
commits into
main
Choose a base branch
from
laura/add-verify-domain-step
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
c201042
Add boilerplate for wizard steps
LauraBeatris 023d9af
Add support for inner steps
LauraBeatris da46a7c
Query for enterprise connections
LauraBeatris 1a5e8c7
Add changeset
LauraBeatris 972d352
Improve loading state
LauraBeatris 029c44f
Move Wizard to ConfigureSSO folder
LauraBeatris 2022081
Update to declarative API
LauraBeatris a3ab014
Add guard for user
LauraBeatris 551b23a
Always display verify domain step
LauraBeatris 78d6cc4
Add element descriptors
LauraBeatris a7f1340
Add `isCompleted` prop to step
LauraBeatris 1e5e1b1
Add `isCompleted` prop to step
LauraBeatris ba16b60
Implement email verification step
LauraBeatris 732f5ec
Implement add email address step
LauraBeatris 64d4187
Handle updating email address to primary
LauraBeatris File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| '@clerk/ui': patch | ||
| --- | ||
|
|
||
| Add wizard steps for the `<__experimental_ConfigureSSO />` component |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
packages/ui/src/components/ConfigureSSO/ConfigureSSOContext.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| import type { EnterpriseConnectionResource } from '@clerk/shared/types'; | ||
| import React, { type PropsWithChildren } from 'react'; | ||
|
|
||
| /** | ||
| * Shared form state for the ConfigureSSO wizard, persisted across steps | ||
| */ | ||
| export interface ConfigureSSOData { | ||
| /** | ||
| * The enterprise connection from the user's primary email address domain | ||
| */ | ||
| enterpriseConnection: EnterpriseConnectionResource | undefined; | ||
| } | ||
|
|
||
| export interface ConfigureSSOContextValue extends ConfigureSSOData { | ||
| /** | ||
| * `true` while the parent is still fetching the user's enterprise | ||
| * connection | ||
| */ | ||
| isLoading: boolean; | ||
| } | ||
|
|
||
| interface ConfigureSSOFlowProviderProps { | ||
| enterpriseConnection: EnterpriseConnectionResource | undefined; | ||
| isLoading: boolean; | ||
| } | ||
|
|
||
| const ConfigureSSOFlowContext = React.createContext<ConfigureSSOContextValue | null>(null); | ||
| ConfigureSSOFlowContext.displayName = 'ConfigureSSOFlowContext'; | ||
|
|
||
| export const ConfigureSSOFlowProvider = ({ | ||
| enterpriseConnection, | ||
| isLoading, | ||
| children, | ||
| }: PropsWithChildren<ConfigureSSOFlowProviderProps>): JSX.Element => { | ||
| const value = React.useMemo<ConfigureSSOContextValue>( | ||
| () => ({ | ||
| enterpriseConnection, | ||
| isLoading, | ||
| }), | ||
| [enterpriseConnection, isLoading], | ||
| ); | ||
|
|
||
| return <ConfigureSSOFlowContext.Provider value={value}>{children}</ConfigureSSOFlowContext.Provider>; | ||
| }; | ||
|
|
||
| export const useConfigureSSOFlow = (): ConfigureSSOContextValue => { | ||
| const ctx = React.useContext(ConfigureSSOFlowContext); | ||
| if (!ctx) { | ||
| throw new Error('useConfigureSSOFlow called outside <ConfigureSSOFlowProvider>.'); | ||
| } | ||
| return ctx; | ||
| }; |
23 changes: 23 additions & 0 deletions
23
packages/ui/src/components/ConfigureSSO/steps/ConfigureCreateAppStep.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| import { Flow, Text } from '@/customizables'; | ||
|
|
||
| import { useConfigureSSOWizard, useRegisterContinueAction } from '../wizard'; | ||
| import { StepLayout } from './StepLayout'; | ||
|
|
||
| export const ConfigureCreateApp = (): JSX.Element => { | ||
| const { goNext } = useConfigureSSOWizard(); | ||
|
|
||
| useRegisterContinueAction({ | ||
| handler: () => goNext(), | ||
| }); | ||
|
|
||
| return ( | ||
| <Flow.Part part='configureCreateApp'> | ||
| <StepLayout | ||
| title='Configure Okta Workforce' | ||
| subtitle='Create a new enterprise application in your Okta Dashboard.' | ||
| > | ||
| <Text>UI goes here</Text> | ||
| </StepLayout> | ||
| </Flow.Part> | ||
| ); | ||
| }; |
13 changes: 13 additions & 0 deletions
13
packages/ui/src/components/ConfigureSSO/steps/ConfirmationStep.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| import { Flow, Text } from '@/customizables'; | ||
|
|
||
| import { StepLayout } from './StepLayout'; | ||
|
|
||
| export const ConfirmationStep = (): JSX.Element => { | ||
| return ( | ||
| <Flow.Part part='sso-confirmation'> | ||
| <StepLayout> | ||
| <Text>UI goes here</Text> | ||
| </StepLayout> | ||
| </Flow.Part> | ||
| ); | ||
| }; |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll replicate this across locales once I get a first pass on the PR review, just to avoid a huge diff