1- import { Step } from '@/components/ConfigureSSO/elements/Step' ;
2- import { useWizard , Wizard } from '@/components/ConfigureSSO/elements/Wizard' ;
3- import { InnerStepCounter } from '@/components/ConfigureSSO/elements/Wizard/InnerStepCounter' ;
4- import { Col , descriptors , Heading , localizationKeys } from '@/customizables' ;
1+ import { type JSX } from 'react' ;
52
6- export const SamlCustomConfigureSteps = ( ) => {
3+ import { Col , descriptors , Heading , localizationKeys , Text } from '@/customizables' ;
4+ import { ClipboardInput } from '@/elements/ClipboardInput' ;
5+ import { Form } from '@/elements/Form' ;
6+ import { Check , ClipboardOutline } from '@/icons' ;
7+ import { useFormControl } from '@/ui/utils/useFormControl' ;
8+
9+ import { useConfigureSSO } from '../../../ConfigureSSOContext' ;
10+ import { Step } from '../../../elements/Step' ;
11+ import { useWizard , Wizard } from '../../../elements/Wizard' ;
12+ import { InnerStepCounter } from '../../../elements/Wizard/InnerStepCounter' ;
13+ import { AttributeMappingTable , type AttributeMappingTableConfig } from './shared/AttributeMappingTable' ;
14+ import { IdentityProviderMetadataForm } from './shared/IdentityProviderMetadataForm' ;
15+
16+ export const SamlCustomConfigureSteps = ( ) : JSX . Element => {
717 return (
818 < >
919 < Wizard . Step id = 'create-app' >
@@ -51,8 +61,25 @@ export const SamlCustomConfigureSteps = () => {
5161 ) ;
5262} ;
5363
54- const SamlCustomCreateAppStep = ( ) => {
55- const { goPrev, goNext, isFirstStep, isLastStep } = useWizard ( ) ;
64+ const SamlCustomCreateAppStep = ( ) : JSX . Element => {
65+ const { goNext, goPrev, isFirstStep, isLastStep } = useWizard ( ) ;
66+ const { enterpriseConnection } = useConfigureSSO ( ) ;
67+
68+ const acsUrl = enterpriseConnection ?. samlConnection ?. acsUrl ?? '' ;
69+ const spEntityId = enterpriseConnection ?. samlConnection ?. spEntityId ?? '' ;
70+
71+ const acsUrlField = useFormControl ( 'acsUrl' , acsUrl , {
72+ type : 'text' ,
73+ label : localizationKeys ( 'configureSSO.configureStep.samlCustom.createAppStep.serviceProviderFields.acsUrl.label' ) ,
74+ isRequired : false ,
75+ } ) ;
76+ const spEntityIdField = useFormControl ( 'spEntityId' , spEntityId , {
77+ type : 'text' ,
78+ label : localizationKeys (
79+ 'configureSSO.configureStep.samlCustom.createAppStep.serviceProviderFields.spEntityId.label' ,
80+ ) ,
81+ isRequired : false ,
82+ } ) ;
5683
5784 return (
5885 < >
@@ -67,32 +94,36 @@ const SamlCustomCreateAppStep = () => {
6794 'configureSSO.configureStep.samlCustom.createAppStep.createAppInstructions.title' ,
6895 ) }
6996 />
97+ < Text
98+ as = 'p'
99+ colorScheme = 'secondary'
100+ localizationKey = { localizationKeys (
101+ 'configureSSO.configureStep.samlCustom.createAppStep.createAppInstructions.paragraph' ,
102+ ) }
103+ />
70104 </ Col >
71- </ Step . Section >
72- </ Step . Body >
73105
74- < Step . Footer >
75- < Step . Footer . Previous
76- onClick = { ( ) => goPrev ( ) }
77- isDisabled = { isFirstStep }
78- />
79- < Step . Footer . Continue
80- onClick = { ( ) => goNext ( ) }
81- isDisabled = { isLastStep }
82- />
83- </ Step . Footer >
84- </ >
85- ) ;
86- } ;
87-
88- const SamlCustomAttributeMappingStep = ( ) => {
89- const { goPrev, goNext, isFirstStep, isLastStep } = useWizard ( ) ;
106+ < Form . ControlRow elementId = { acsUrlField . id } >
107+ < Form . CommonInputWrapper { ...acsUrlField . props } >
108+ < ClipboardInput
109+ value = { acsUrl }
110+ readOnly
111+ copyIcon = { ClipboardOutline }
112+ copiedIcon = { Check }
113+ />
114+ </ Form . CommonInputWrapper >
115+ </ Form . ControlRow >
90116
91- return (
92- < >
93- < Step . Body >
94- < Step . Section sx = { theme => ( { gap : theme . space . $5 } ) } >
95- < p > add table here</ p >
117+ < Form . ControlRow elementId = { spEntityIdField . id } >
118+ < Form . CommonInputWrapper { ...spEntityIdField . props } >
119+ < ClipboardInput
120+ value = { spEntityId }
121+ readOnly
122+ copyIcon = { ClipboardOutline }
123+ copiedIcon = { Check }
124+ />
125+ </ Form . CommonInputWrapper >
126+ </ Form . ControlRow >
96127 </ Step . Section >
97128 </ Step . Body >
98129
@@ -110,14 +141,63 @@ const SamlCustomAttributeMappingStep = () => {
110141 ) ;
111142} ;
112143
113- const SamlCustomAssignUsersStep = ( ) => {
114- const { goPrev, goNext, isFirstStep, isLastStep } = useWizard ( ) ;
144+ const CUSTOM_ATTRIBUTE_MAPPING : AttributeMappingTableConfig = {
145+ columns : {
146+ first : localizationKeys (
147+ 'configureSSO.configureStep.samlCustom.attributeMappingStep.attributeMappingTable.columns.userProfile' ,
148+ ) ,
149+ second : localizationKeys (
150+ 'configureSSO.configureStep.samlCustom.attributeMappingStep.attributeMappingTable.columns.attributeName' ,
151+ ) ,
152+ } ,
153+ rows : [
154+ {
155+ id : 'email' ,
156+ isRequired : true ,
157+ first : localizationKeys (
158+ 'configureSSO.configureStep.samlCustom.attributeMappingStep.attributeMappingTable.rows.email.userProfile' ,
159+ ) ,
160+ second : localizationKeys (
161+ 'configureSSO.configureStep.samlCustom.attributeMappingStep.attributeMappingTable.rows.email.attributeName' ,
162+ ) ,
163+ } ,
164+ {
165+ id : 'firstName' ,
166+ isRequired : false ,
167+ first : localizationKeys (
168+ 'configureSSO.configureStep.samlCustom.attributeMappingStep.attributeMappingTable.rows.firstName.userProfile' ,
169+ ) ,
170+ second : localizationKeys (
171+ 'configureSSO.configureStep.samlCustom.attributeMappingStep.attributeMappingTable.rows.firstName.attributeName' ,
172+ ) ,
173+ } ,
174+ {
175+ id : 'lastName' ,
176+ isRequired : false ,
177+ first : localizationKeys (
178+ 'configureSSO.configureStep.samlCustom.attributeMappingStep.attributeMappingTable.rows.lastName.userProfile' ,
179+ ) ,
180+ second : localizationKeys (
181+ 'configureSSO.configureStep.samlCustom.attributeMappingStep.attributeMappingTable.rows.lastName.attributeName' ,
182+ ) ,
183+ } ,
184+ ] ,
185+ } ;
186+
187+ const SamlCustomAttributeMappingStep = ( ) : JSX . Element => {
188+ const { goNext, goPrev, isFirstStep, isLastStep } = useWizard ( ) ;
115189
116190 return (
117191 < >
118192 < Step . Body >
119- < Step . Section sx = { theme => ( { gap : theme . space . $5 } ) } >
120- < p > add content here</ p >
193+ < Step . Section sx = { theme => ( { gap : theme . space . $3 } ) } >
194+ < Text
195+ as = 'p'
196+ colorScheme = 'secondary'
197+ localizationKey = { localizationKeys ( 'configureSSO.configureStep.samlCustom.attributeMappingStep.paragraph' ) }
198+ />
199+
200+ < AttributeMappingTable config = { CUSTOM_ATTRIBUTE_MAPPING } />
121201 </ Step . Section >
122202 </ Step . Body >
123203
@@ -135,14 +215,24 @@ const SamlCustomAssignUsersStep = () => {
135215 ) ;
136216} ;
137217
138- const SamlCustomIdentityProviderMetadataStep = ( ) => {
139- const { goPrev , goNext , isFirstStep, isLastStep } = useWizard ( ) ;
218+ const SamlCustomAssignUsersStep = ( ) : JSX . Element => {
219+ const { goNext , goPrev , isFirstStep, isLastStep } = useWizard ( ) ;
140220
141221 return (
142222 < >
143223 < Step . Body >
144- < Step . Section sx = { theme => ( { gap : theme . space . $5 } ) } >
145- < p > add content here</ p >
224+ < Step . Section sx = { theme => ( { gap : theme . space . $3 } ) } >
225+ < Heading
226+ elementDescriptor = { descriptors . configureSSOInstructionsHeading }
227+ as = 'h3'
228+ textVariant = 'subtitle'
229+ localizationKey = { localizationKeys ( 'configureSSO.configureStep.samlCustom.assignUsersStep.title' ) }
230+ />
231+ < Text
232+ as = 'p'
233+ colorScheme = 'secondary'
234+ localizationKey = { localizationKeys ( 'configureSSO.configureStep.samlCustom.assignUsersStep.paragraph' ) }
235+ />
146236 </ Step . Section >
147237 </ Step . Body >
148238
@@ -159,3 +249,63 @@ const SamlCustomIdentityProviderMetadataStep = () => {
159249 </ >
160250 ) ;
161251} ;
252+
253+ const SamlCustomIdentityProviderMetadataStep = ( ) : JSX . Element => (
254+ < IdentityProviderMetadataForm
255+ modes = { {
256+ title : localizationKeys ( 'configureSSO.configureStep.samlCustom.identityProviderMetadataStep.modes.title' ) ,
257+ ariaLabel : localizationKeys ( 'configureSSO.configureStep.samlCustom.identityProviderMetadataStep.modes.ariaLabel' ) ,
258+ metadataUrlLabel : localizationKeys (
259+ 'configureSSO.configureStep.samlCustom.identityProviderMetadataStep.modes.metadataUrl' ,
260+ ) ,
261+ manualLabel : localizationKeys ( 'configureSSO.configureStep.samlCustom.identityProviderMetadataStep.modes.manual' ) ,
262+ } }
263+ metadataUrl = { {
264+ label : localizationKeys ( 'configureSSO.configureStep.samlCustom.identityProviderMetadataStep.metadataUrl.label' ) ,
265+ placeholder : localizationKeys (
266+ 'configureSSO.configureStep.samlCustom.identityProviderMetadataStep.metadataUrl.placeholder' ,
267+ ) ,
268+ description : localizationKeys (
269+ 'configureSSO.configureStep.samlCustom.identityProviderMetadataStep.metadataUrl.description' ,
270+ ) ,
271+ } }
272+ manual = { {
273+ description : localizationKeys (
274+ 'configureSSO.configureStep.samlCustom.identityProviderMetadataStep.manual.description' ,
275+ ) ,
276+ signOnUrl : {
277+ label : localizationKeys (
278+ 'configureSSO.configureStep.samlCustom.identityProviderMetadataStep.manual.signOnUrl.label' ,
279+ ) ,
280+ placeholder : localizationKeys (
281+ 'configureSSO.configureStep.samlCustom.identityProviderMetadataStep.manual.signOnUrl.placeholder' ,
282+ ) ,
283+ } ,
284+ issuer : {
285+ label : localizationKeys (
286+ 'configureSSO.configureStep.samlCustom.identityProviderMetadataStep.manual.issuer.label' ,
287+ ) ,
288+ placeholder : localizationKeys (
289+ 'configureSSO.configureStep.samlCustom.identityProviderMetadataStep.manual.issuer.placeholder' ,
290+ ) ,
291+ } ,
292+ signingCertificate : {
293+ label : localizationKeys (
294+ 'configureSSO.configureStep.samlCustom.identityProviderMetadataStep.manual.signingCertificate.label' ,
295+ ) ,
296+ uploadFile : localizationKeys (
297+ 'configureSSO.configureStep.samlCustom.identityProviderMetadataStep.manual.signingCertificate.uploadFile' ,
298+ ) ,
299+ replaceFile : localizationKeys (
300+ 'configureSSO.configureStep.samlCustom.identityProviderMetadataStep.manual.signingCertificate.replaceFile' ,
301+ ) ,
302+ removeFile : localizationKeys (
303+ 'configureSSO.configureStep.samlCustom.identityProviderMetadataStep.manual.signingCertificate.removeFile' ,
304+ ) ,
305+ fileUploaded : localizationKeys (
306+ 'configureSSO.configureStep.samlCustom.identityProviderMetadataStep.manual.signingCertificate.fileUploaded' ,
307+ ) ,
308+ } ,
309+ } }
310+ />
311+ ) ;
0 commit comments