-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: New SSO workflow skeleton (#1032)
* feat: New SSO workflow skeleton fix: Make service provider metadata button primary color feat: Add non-SAP fields to SSO Configure page feat: Show different SSO metadata inputs based on radio selection test: Add test for SSO metadata input hiding feat: Add back buttons to sso config workflow chore: rename function * test: New sso flow cancel button test
- Loading branch information
1 parent
f4328dc
commit e5edf15
Showing
17 changed files
with
554 additions
and
17 deletions.
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.