88 Badge ,
99 Box ,
1010 Button ,
11+ Col ,
1112 Dd ,
1213 descriptors ,
1314 Dl ,
@@ -33,7 +34,7 @@ import { IconButton } from '@/elements/IconButton';
3334import { Pagination } from '@/elements/Pagination' ;
3435import { ProfileSection } from '@/elements/Section' ;
3536import { useClipboard } from '@/hooks' ;
36- import { Check , Copy , RotateLeftRight } from '@/icons' ;
37+ import { Check , Copy , LinkIcon , RotateLeftRight } from '@/icons' ;
3738import { common , mqu } from '@/styledSystem' ;
3839import { handleError } from '@/utils/errorHandler' ;
3940
@@ -76,10 +77,7 @@ export const TestConfigurationStep = (): JSX.Element => {
7677 elementDescriptor = { descriptors . configureSSOStep }
7778 elementId = { descriptors . configureSSOStep . setId ( 'test' ) }
7879 >
79- < Step . Header
80- title = { localizationKeys ( 'configureSSO.testConfigurationStep.title' ) }
81- description = { localizationKeys ( 'configureSSO.testConfigurationStep.subtitle' ) }
82- />
80+ < Step . Header title = { localizationKeys ( 'configureSSO.testConfigurationStep.title' ) } />
8381
8482 < Step . Body >
8583 < Step . Section
@@ -89,53 +87,14 @@ export const TestConfigurationStep = (): JSX.Element => {
8987 borderBottomColor : theme . colors . $borderAlpha100 ,
9088 } ) }
9189 >
92- < ProfileSection . Root
93- title = { localizationKeys ( 'configureSSO.testConfigurationStep.testUrl.title' ) }
94- id = 'testSsoUrl'
95- centered = { false }
96- sx = { t => ( {
97- borderTopWidth : 0 ,
98- paddingTop : 0 ,
99- paddingBottom : 0 ,
100- flexDirection : 'column-reverse' ,
101- gap : t . space . $1 ,
102- } ) }
103- >
90+ < Col gap = { 3 } >
10491 < Text
105- colorScheme = 'secondary '
106- localizationKey = { localizationKeys ( 'configureSSO.testConfigurationStep.testUrl. subtitle' ) }
92+ as = 'p '
93+ localizationKey = { localizationKeys ( 'configureSSO.testConfigurationStep.subtitle' ) }
10794 />
108- < ProfileSection . Item
109- id = 'testSsoUrl'
110- sx = { { paddingInlineStart : 0 } }
111- >
112- < Flex gap = { 2 } >
113- < CopyTestUrlButton onTestRunCreated = { handleTestRunCreated } />
114-
115- < Button
116- elementDescriptor = { descriptors . configureSSOTestRefreshButton }
117- variant = 'bordered'
118- colorScheme = 'secondary'
119- size = 'xs'
120- onClick = { ( ) => void revalidateTestRuns ( ) }
121- isDisabled = { areTestRunsLoading }
122- sx = { t => ( { gap : t . space . $1x5 } ) }
123- >
124- < Icon
125- icon = { RotateLeftRight }
126- size = 'sm'
127- colorScheme = 'neutral'
128- />
129- < Text
130- as = 'span'
131- localizationKey = { localizationKeys (
132- 'configureSSO.testConfigurationStep.testResults.actionLabel__refresh' ,
133- ) }
134- />
135- </ Button >
136- </ Flex >
137- </ ProfileSection . Item >
138- </ ProfileSection . Root >
95+
96+ < OpenTestUrlButton onTestRunCreated = { handleTestRunCreated } />
97+ </ Col >
13998 </ Step . Section >
14099
141100 < Step . Section sx = { { flex : 1 , minHeight : 0 } } >
@@ -157,6 +116,28 @@ export const TestConfigurationStep = (): JSX.Element => {
157116 } ,
158117 } ) }
159118 >
119+ < Button
120+ elementDescriptor = { descriptors . configureSSOTestRefreshButton }
121+ variant = 'bordered'
122+ colorScheme = 'secondary'
123+ size = 'xs'
124+ onClick = { ( ) => void revalidateTestRuns ( ) }
125+ isDisabled = { areTestRunsLoading }
126+ sx = { t => ( { gap : t . space . $1x5 } ) }
127+ >
128+ < Icon
129+ icon = { RotateLeftRight }
130+ size = 'sm'
131+ colorScheme = 'neutral'
132+ />
133+ < Text
134+ as = 'span'
135+ localizationKey = { localizationKeys (
136+ 'configureSSO.testConfigurationStep.testResults.actionLabel__refresh' ,
137+ ) }
138+ />
139+ </ Button >
140+
160141 < TestResultsTable
161142 rows = { testRuns ?? [ ] }
162143 isPolling = { isPolling }
@@ -369,7 +350,7 @@ const TestResultsTable = ({
369350 justify = 'center'
370351 sx = { t => ( { padding : `${ t . space . $10 } 0` , flex : 1 } ) }
371352 >
372- < CopyTestUrlButton onTestRunCreated = { onTestRunCreated } />
353+ < OpenTestUrlButton onTestRunCreated = { onTestRunCreated } />
373354 </ Flex >
374355 </ Td >
375356 </ Tr >
@@ -717,20 +698,18 @@ const TestRunStatusCell = ({ testRun }: { testRun: EnterpriseConnectionTestRunRe
717698 ) ;
718699} ;
719700
720- type CopyTestUrlButtonProps = {
701+ type OpenTestUrlButtonProps = {
721702 onTestRunCreated ?: ( testUrl : string ) => void ;
722703} ;
723704
724- const CopyTestUrlButton = ( { onTestRunCreated } : CopyTestUrlButtonProps ) : JSX . Element => {
705+ const OpenTestUrlButton = ( { onTestRunCreated } : OpenTestUrlButtonProps ) : JSX . Element => {
725706 const { user } = useUser ( ) ;
726707 const card = useCardState ( ) ;
727708 const { enterpriseConnection } = useConfigureSSO ( ) ;
728709
729- const [ testUrl , setTestUrl ] = useState ( '' ) ;
730710 const [ isCreatingTestRun , setIsCreatingTestRun ] = useState ( false ) ;
731- const { onCopy, hasCopied } = useClipboard ( testUrl ) ;
732711
733- const createTestRun = ( ) => {
712+ const openTestRun = ( ) => {
734713 if ( ! user || ! enterpriseConnection ) {
735714 return ;
736715 }
@@ -740,26 +719,25 @@ const CopyTestUrlButton = ({ onTestRunCreated }: CopyTestUrlButtonProps): JSX.El
740719 user
741720 . createEnterpriseConnectionTestRun ( enterpriseConnection . id )
742721 . then ( ( { url } ) => {
743- setTestUrl ( url ) ;
744- onCopy ( url ) ;
745722 onTestRunCreated ?.( url ) ;
723+ // `noopener,noreferrer` so the IdP can't reach back into the dashboard
724+ // via `window.opener` once it lands the SAML response.
725+ window . open ( url , '_blank' , 'noopener,noreferrer' ) ;
746726 } )
747727 . catch ( err => handleError ( err as Error , [ ] , card . setError ) )
748728 . finally ( ( ) => setIsCreatingTestRun ( false ) ) ;
749729 } ;
750730
751731 return (
752732 < Button
753- elementDescriptor = { descriptors . configureSSOTestUrlCopyButton }
733+ elementDescriptor = { descriptors . configureSSOTestUrlOpenButton }
754734 id = 'testSsoUrl'
755735 variant = 'bordered'
756736 colorScheme = 'secondary'
757737 size = 'xs'
758- onClick = { createTestRun }
738+ onClick = { openTestRun }
759739 isDisabled = { isCreatingTestRun }
760- sx = { t => ( {
761- gap : t . space . $1x5 ,
762- } ) }
740+ sx = { t => ( { gap : t . space . $1x5 , width : 'fit-content' } ) }
763741 >
764742 { isCreatingTestRun ? (
765743 < Spinner
@@ -768,14 +746,14 @@ const CopyTestUrlButton = ({ onTestRunCreated }: CopyTestUrlButtonProps): JSX.El
768746 />
769747 ) : (
770748 < Icon
771- icon = { hasCopied ? Check : Copy }
749+ icon = { LinkIcon }
772750 size = 'sm'
773751 colorScheme = 'neutral'
774752 />
775753 ) }
776754 < Text
777755 as = 'span'
778- localizationKey = { localizationKeys ( 'configureSSO.testConfigurationStep.testUrl.actionLabel__copy ' ) }
756+ localizationKey = { localizationKeys ( 'configureSSO.testConfigurationStep.testUrl.actionLabel__open ' ) }
779757 />
780758 </ Button >
781759 ) ;
0 commit comments