-
Notifications
You must be signed in to change notification settings - Fork 32
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
feat: New SSO workflow skeleton #1032
Merged
Merged
Changes from all commits
Commits
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 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 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 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 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 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 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 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 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 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 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 |
---|---|---|
@@ -1,3 +1,31 @@ | ||
const NewSSOStepper = () => null; | ||
import React, { useState, useContext } from 'react'; | ||
import FormContextWrapper from '../../forms/FormContextWrapper'; | ||
import { SSOConfigContext } from './SSOConfigContext'; | ||
import SSOFormWorkflowConfig from './SSOFormWorkflowConfig'; | ||
|
||
const NewSSOStepper = () => { | ||
const { | ||
setProviderConfig, | ||
} = useContext(SSOConfigContext); | ||
const [isStepperOpen, setIsStepperOpen] = useState(true); | ||
const handleCloseWorkflow = () => { | ||
setProviderConfig?.(null); | ||
setIsStepperOpen(false); | ||
}; | ||
|
||
return (isStepperOpen | ||
&& ( | ||
<div> | ||
<FormContextWrapper | ||
workflowTitle="New SSO integration" | ||
formWorkflowConfig={SSOFormWorkflowConfig()} | ||
onClickOut={handleCloseWorkflow} | ||
formData={{}} | ||
isStepperOpen={isStepperOpen} | ||
/> | ||
</div> | ||
) | ||
); | ||
}; | ||
|
||
export default NewSSOStepper; |
59 changes: 59 additions & 0 deletions
59
src/components/settings/SettingsSSOTab/SSOFormWorkflowConfig.tsx
This file contains 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,59 @@ | ||
import type { FormWorkflowStep } from '../../forms/FormWorkflow'; | ||
import SSOConfigConnectStep from './steps/NewSSOConfigConnectStep'; | ||
import SSOConfigConfigureStep from './steps/NewSSOConfigConfigureStep'; | ||
import SSOConfigAuthorizeStep from './steps/NewSSOConfigAuthorizeStep'; | ||
import SSOConfigConfirmStep from './steps/NewSSOConfigConfirmStep'; | ||
|
||
type SSOConfigCamelCase = {}; | ||
|
||
export const SSOFormWorkflowConfig = () => { | ||
const placeHolderButton = (buttonName?: string) => () => ({ | ||
buttonText: buttonName || 'Next', | ||
opensNewWindow: false, | ||
onClick: () => {}, | ||
}); | ||
|
||
const steps: FormWorkflowStep<SSOConfigCamelCase>[] = [ | ||
{ | ||
index: 0, | ||
formComponent: SSOConfigConnectStep, | ||
validations: [], | ||
stepName: 'Connect', | ||
nextButtonConfig: placeHolderButton(), | ||
}, { | ||
index: 1, | ||
formComponent: SSOConfigConfigureStep, | ||
validations: [], | ||
stepName: 'Configure', | ||
nextButtonConfig: placeHolderButton('Configure'), | ||
showBackButton: true, | ||
showCancelButton: false, | ||
}, { | ||
index: 2, | ||
formComponent: SSOConfigAuthorizeStep, | ||
validations: [], | ||
stepName: 'Authorize', | ||
nextButtonConfig: placeHolderButton(), | ||
showBackButton: true, | ||
showCancelButton: false, | ||
}, { | ||
index: 3, | ||
formComponent: SSOConfigConfirmStep, | ||
validations: [], | ||
stepName: 'Confirm and Test', | ||
nextButtonConfig: placeHolderButton('Finish'), | ||
showBackButton: true, | ||
showCancelButton: false, | ||
}, | ||
]; | ||
|
||
// Start at the first step | ||
const getCurrentStep = () => steps[0]; | ||
|
||
return { | ||
getCurrentStep, | ||
steps, | ||
}; | ||
}; | ||
|
||
export default SSOFormWorkflowConfig; |
38 changes: 38 additions & 0 deletions
38
src/components/settings/SettingsSSOTab/steps/NewSSOConfigAuthorizeStep.tsx
This file contains 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,38 @@ | ||
import React from 'react'; | ||
import { | ||
Alert, Form, Hyperlink, Button, Row, | ||
} from '@edx/paragon'; | ||
import { Info, Download } from '@edx/paragon/icons'; | ||
|
||
const handleCheck = () => null; | ||
|
||
const SSOConfigAuthorizeStep = () => ( | ||
<> | ||
<h2>Authorize edX as a Service Provider</h2> | ||
<Alert variant="info" className="mb-4" icon={Info}> | ||
<h3>Action required in a new window</h3> | ||
Return to this window after completing the following steps in a new window to finish configuring your integration. | ||
</Alert> | ||
<hr /> | ||
<p> | ||
1. Download the edX Service Provider metadata as an XML file: | ||
</p> | ||
|
||
<Row className="justify-content-center mb-4 "> | ||
<Button variant="primary" iconAfter={Download}>edX Service Provider Metadata</Button> | ||
</Row> | ||
|
||
<p> | ||
2. <Hyperlink destination="/" target="_blank">Launch a new window</Hyperlink> and upload the XML file to the list of | ||
authorized SAML Service Providers on your Identity Provider's portal or website. | ||
</p> | ||
<hr /> | ||
<p>Return to this window and check the box once complete</p> | ||
|
||
<Form.Checkbox className="mt-4" checked={false} onChange={handleCheck}> | ||
I have authorized edX as a Service Provider | ||
</Form.Checkbox> | ||
</> | ||
); | ||
|
||
export default SSOConfigAuthorizeStep; |
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.
why is this getting added to the LMS settings tab?
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.
The FormWorkflow originally had this hard-coded, as it was only used in the LMS config stepper.