88 Badge ,
99 Box ,
1010 Button ,
11+ Col ,
1112 Dd ,
1213 descriptors ,
1314 Dl ,
@@ -31,9 +32,8 @@ import { useCardState } from '@/elements/contexts';
3132import { Drawer } from '@/elements/Drawer' ;
3233import { IconButton } from '@/elements/IconButton' ;
3334import { Pagination } from '@/elements/Pagination' ;
34- import { ProfileSection } from '@/elements/Section' ;
3535import { useClipboard } from '@/hooks' ;
36- import { Check , Copy , RotateLeftRight } from '@/icons' ;
36+ import { Check , Copy , LinkIcon , RotateLeftRight } from '@/icons' ;
3737import { common , mqu } from '@/styledSystem' ;
3838import { handleError } from '@/utils/errorHandler' ;
3939
@@ -76,10 +76,7 @@ export const TestConfigurationStep = (): JSX.Element => {
7676 elementDescriptor = { descriptors . configureSSOStep }
7777 elementId = { descriptors . configureSSOStep . setId ( 'test' ) }
7878 >
79- < Step . Header
80- title = { localizationKeys ( 'configureSSO.testConfigurationStep.title' ) }
81- description = { localizationKeys ( 'configureSSO.testConfigurationStep.subtitle' ) }
82- />
79+ < Step . Header title = { localizationKeys ( 'configureSSO.testConfigurationStep.title' ) } />
8380
8481 < Step . Body >
8582 < Step . Section
@@ -89,74 +86,50 @@ export const TestConfigurationStep = (): JSX.Element => {
8986 borderBottomColor : theme . colors . $borderAlpha100 ,
9087 } ) }
9188 >
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- >
89+ < Col gap = { 3 } >
10490 < Text
105- colorScheme = 'secondary '
106- localizationKey = { localizationKeys ( 'configureSSO.testConfigurationStep.testUrl. subtitle' ) }
91+ as = 'p '
92+ localizationKey = { localizationKeys ( 'configureSSO.testConfigurationStep.subtitle' ) }
10793 />
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 >
94+
95+ < OpenTestUrlButton onTestRunCreated = { handleTestRunCreated } />
96+ </ Col >
13997 </ Step . Section >
14098
141- < Step . Section sx = { { flex : 1 , minHeight : 0 } } >
142- < ProfileSection . Root
143- title = { localizationKeys ( 'configureSSO.testConfigurationStep.testResults.title' ) }
144- id = 'testResults'
145- centered = { false }
146- sx = { t => ( {
147- borderTopWidth : 0 ,
148- paddingTop : 0 ,
149- paddingBottom : 0 ,
150- flexDirection : 'column-reverse' ,
151- gap : t . space . $2 ,
152- flex : 1 ,
153- minHeight : 0 ,
154- '& > *:first-of-type' : {
155- flex : 1 ,
156- minHeight : 0 ,
157- } ,
158- } ) }
99+ < Step . Section sx = { t => ( { flex : 1 , minHeight : 0 , gap : t . space . $3 } ) } >
100+ < Flex
101+ align = 'center'
102+ justify = 'between'
103+ sx = { t => ( { gap : t . space . $2 , flexShrink : 0 } ) }
159104 >
105+ < Text
106+ variant = 'subtitle'
107+ localizationKey = { localizationKeys ( 'configureSSO.testConfigurationStep.testResults.title' ) }
108+ />
109+ < Button
110+ elementDescriptor = { descriptors . configureSSOTestRefreshButton }
111+ variant = 'bordered'
112+ colorScheme = 'secondary'
113+ size = 'xs'
114+ onClick = { ( ) => void revalidateTestRuns ( ) }
115+ isDisabled = { areTestRunsLoading }
116+ sx = { t => ( { gap : t . space . $1x5 } ) }
117+ >
118+ < Icon
119+ icon = { RotateLeftRight }
120+ size = 'sm'
121+ colorScheme = 'neutral'
122+ />
123+ < Text
124+ as = 'span'
125+ localizationKey = { localizationKeys (
126+ 'configureSSO.testConfigurationStep.testResults.actionLabel__refresh' ,
127+ ) }
128+ />
129+ </ Button >
130+ </ Flex >
131+
132+ < Col sx = { { flex : 1 , minHeight : 0 } } >
160133 < TestResultsTable
161134 rows = { testRuns ?? [ ] }
162135 isPolling = { isPolling }
@@ -168,7 +141,7 @@ export const TestConfigurationStep = (): JSX.Element => {
168141 onPageChange = { setCurrentPage }
169142 onTestRunCreated = { handleTestRunCreated }
170143 />
171- </ ProfileSection . Root >
144+ </ Col >
172145 </ Step . Section >
173146 </ Step . Body >
174147
@@ -369,7 +342,7 @@ const TestResultsTable = ({
369342 justify = 'center'
370343 sx = { t => ( { padding : `${ t . space . $10 } 0` , flex : 1 } ) }
371344 >
372- < CopyTestUrlButton onTestRunCreated = { onTestRunCreated } />
345+ < OpenTestUrlButton onTestRunCreated = { onTestRunCreated } />
373346 </ Flex >
374347 </ Td >
375348 </ Tr >
@@ -717,20 +690,18 @@ const TestRunStatusCell = ({ testRun }: { testRun: EnterpriseConnectionTestRunRe
717690 ) ;
718691} ;
719692
720- type CopyTestUrlButtonProps = {
693+ type OpenTestUrlButtonProps = {
721694 onTestRunCreated ?: ( testUrl : string ) => void ;
722695} ;
723696
724- const CopyTestUrlButton = ( { onTestRunCreated } : CopyTestUrlButtonProps ) : JSX . Element => {
697+ const OpenTestUrlButton = ( { onTestRunCreated } : OpenTestUrlButtonProps ) : JSX . Element => {
725698 const { user } = useUser ( ) ;
726699 const card = useCardState ( ) ;
727700 const { enterpriseConnection } = useConfigureSSO ( ) ;
728701
729- const [ testUrl , setTestUrl ] = useState ( '' ) ;
730702 const [ isCreatingTestRun , setIsCreatingTestRun ] = useState ( false ) ;
731- const { onCopy, hasCopied } = useClipboard ( testUrl ) ;
732703
733- const createTestRun = ( ) => {
704+ const openTestRun = ( ) => {
734705 if ( ! user || ! enterpriseConnection ) {
735706 return ;
736707 }
@@ -740,26 +711,25 @@ const CopyTestUrlButton = ({ onTestRunCreated }: CopyTestUrlButtonProps): JSX.El
740711 user
741712 . createEnterpriseConnectionTestRun ( enterpriseConnection . id )
742713 . then ( ( { url } ) => {
743- setTestUrl ( url ) ;
744- onCopy ( url ) ;
745714 onTestRunCreated ?.( url ) ;
715+ // `noopener,noreferrer` so the IdP can't reach back into the dashboard
716+ // via `window.opener` once it lands the SAML response.
717+ window . open ( url , '_blank' , 'noopener,noreferrer' ) ;
746718 } )
747719 . catch ( err => handleError ( err as Error , [ ] , card . setError ) )
748720 . finally ( ( ) => setIsCreatingTestRun ( false ) ) ;
749721 } ;
750722
751723 return (
752724 < Button
753- elementDescriptor = { descriptors . configureSSOTestUrlCopyButton }
725+ elementDescriptor = { descriptors . configureSSOTestUrlOpenButton }
754726 id = 'testSsoUrl'
755727 variant = 'bordered'
756728 colorScheme = 'secondary'
757729 size = 'xs'
758- onClick = { createTestRun }
730+ onClick = { openTestRun }
759731 isDisabled = { isCreatingTestRun }
760- sx = { t => ( {
761- gap : t . space . $1x5 ,
762- } ) }
732+ sx = { t => ( { gap : t . space . $1x5 , width : 'fit-content' } ) }
763733 >
764734 { isCreatingTestRun ? (
765735 < Spinner
@@ -768,14 +738,14 @@ const CopyTestUrlButton = ({ onTestRunCreated }: CopyTestUrlButtonProps): JSX.El
768738 />
769739 ) : (
770740 < Icon
771- icon = { hasCopied ? Check : Copy }
741+ icon = { LinkIcon }
772742 size = 'sm'
773743 colorScheme = 'neutral'
774744 />
775745 ) }
776746 < Text
777747 as = 'span'
778- localizationKey = { localizationKeys ( 'configureSSO.testConfigurationStep.testUrl.actionLabel__copy ' ) }
748+ localizationKey = { localizationKeys ( 'configureSSO.testConfigurationStep.testUrl.actionLabel__open ' ) }
779749 />
780750 </ Button >
781751 ) ;
0 commit comments