@@ -59,6 +59,13 @@ const CONTEXT_STRINGS = {
5959 testError :
6060 "The data connector could not be mounted. Please retry with different credentials, or skip the data connector. If you skip, the data connector will not be mounted in the session." ,
6161 } ,
62+ job : {
63+ continueButton : "Continue" ,
64+ dataCy : "job-data-connector-credentials-modal" ,
65+ header : "Job Storage Credentials" ,
66+ testError :
67+ "The data connector could not be mounted. Please retry with different credentials, or skip the data connector. If you skip, the data connector will not be mounted in the job." ,
68+ } ,
6269 storage : {
6370 continueButton : "Test and Save" ,
6471 dataCy : "data-connector-credentials-modal" ,
@@ -113,7 +120,7 @@ function DataConnectorSecrets({
113120 dataConnectorConfig . savedCredentialFields . map ( ( secret ) => [
114121 storageSecretNameToFieldName ( { name : secret } ) ,
115122 secret ,
116- ] ) ,
123+ ] )
117124 )
118125 : { } ;
119126
@@ -158,7 +165,7 @@ function DataConnectorSecrets({
158165}
159166
160167interface DataConnectorSecretsModalProps {
161- context ?: "session" | "storage" ;
168+ context ?: "session" | "job" | " storage";
162169 isOpen : boolean ;
163170 onCancel : ( ) => void ;
164171 onStart : ( dataConnectorConfigs : DataConnectorConfiguration [ ] ) => void ;
@@ -176,16 +183,16 @@ export default function DataConnectorSecretsModal({
176183 initialDataConnectorConfigs == null
177184 ? [ ]
178185 : initialDataConnectorConfigs . filter (
179- ( config ) => config . sensitiveFieldDefinitions . length === 0 ,
186+ ( config ) => config . sensitiveFieldDefinitions . length === 0
180187 ) ,
181- [ initialDataConnectorConfigs ] ,
188+ [ initialDataConnectorConfigs ]
182189 ) ;
183190 const [ dataConnectorConfigs , setDataConnectorConfigs ] = useState (
184191 initialDataConnectorConfigs == null
185192 ? [ ]
186193 : initialDataConnectorConfigs . filter (
187- ( config ) => config . sensitiveFieldDefinitions . length > 0 ,
188- ) ,
194+ ( config ) => config . sensitiveFieldDefinitions . length > 0
195+ )
189196 ) ;
190197 const [ index , setIndex ] = useState ( 0 ) ;
191198 const { control, handleSubmit, reset : resetForm } = useForm ( ) ;
@@ -204,7 +211,7 @@ export default function DataConnectorSecretsModal({
204211 onStart ( [ ...noCredentialsConfigs , ...csConfigs ] ) ;
205212 }
206213 } ,
207- [ index , noCredentialsConfigs , onStart , resetForm , validationResult ] ,
214+ [ index , noCredentialsConfigs , onStart , resetForm , validationResult ]
208215 ) ;
209216
210217 const onSkip = useCallback ( ( ) => {
@@ -256,7 +263,7 @@ export default function DataConnectorSecretsModal({
256263 newCloudStorageConfigs [ index ] = config ;
257264 setDataConnectorConfigs ( newCloudStorageConfigs ) ;
258265 } ,
259- [ dataConnectorConfigs , index , validateCloudStorageConnection ] ,
266+ [ dataConnectorConfigs , index , validateCloudStorageConnection ]
260267 ) ;
261268
262269 useEffect ( ( ) => {
@@ -278,7 +285,7 @@ export default function DataConnectorSecretsModal({
278285 if ( dataConnectorConfigs == null ) return null ;
279286 if ( dataConnectorConfigs . length < 1 ) return null ;
280287 const hasSavedCredentials = dataConnectorConfigs . some (
281- ( csc ) => csc . savedCredentialFields ?. length > 0 ,
288+ ( csc ) => csc . savedCredentialFields ?. length > 0
282289 ) ;
283290
284291 return (
@@ -327,10 +334,8 @@ export default function DataConnectorSecretsModal({
327334 ) ;
328335}
329336
330- interface CredentialsButtonsProps extends Pick <
331- DataConnectorSecretsModalProps ,
332- "onCancel"
333- > {
337+ interface CredentialsButtonsProps
338+ extends Pick < DataConnectorSecretsModalProps , "onCancel" > {
334339 context : NonNullable < DataConnectorSecretsModalProps [ "context" ] > ;
335340 hasSavedCredentials : boolean ;
336341 onSkip : ( ) => void ;
@@ -352,7 +357,9 @@ function CredentialsButtons({
352357 < XLg className = { cx ( "bi" , "me-1" ) } />
353358 Cancel
354359 </ Button >
355- { context === "session" && < SkipConnectionTestButton onSkip = { onSkip } /> }
360+ { ( context === "session" || context === "job" ) && (
361+ < SkipConnectionTestButton context = { context } onSkip = { onSkip } />
362+ ) }
356363 { context === "storage" && (
357364 < ClearCredentialsButton
358365 onSkip = { onSkip }
@@ -364,10 +371,10 @@ function CredentialsButtons({
364371 validationResult == null
365372 ? "primary"
366373 : validationResult . isSuccess
367- ? "primary"
368- : validationResult . isError
369- ? "danger"
370- : "primary"
374+ ? "primary"
375+ : validationResult . isError
376+ ? "danger"
377+ : "primary"
371378 }
372379 className = { cx ( "ms-2" ) }
373380 disabled = { validationResult . isLoading }
@@ -431,7 +438,7 @@ function ProgressBreadcrumbs({
431438 "btn-link" ,
432439 "p-0" ,
433440 idx === index && [ "text-decoration-none" , "link-rk-text" ] ,
434- idx > index && "text-decoration-none" ,
441+ idx > index && "text-decoration-none"
435442 ) }
436443 disabled = { idx >= index }
437444 onClick = { ( ) => {
@@ -485,7 +492,8 @@ function SaveCredentialsInput({
485492 ) ;
486493}
487494
488- interface SensitiveFieldWidgetProps extends DataConnectorConfigurationSecretsProps {
495+ interface SensitiveFieldWidgetProps
496+ extends DataConnectorConfigurationSecretsProps {
489497 credentialFieldDict : Record < string , string > ;
490498 field : {
491499 name : string ;
@@ -573,7 +581,7 @@ function SensitiveFieldInput({
573581 "form-control" ,
574582 "rounded-0" ,
575583 "rounded-start" ,
576- fieldState . error && "is-invalid" ,
584+ fieldState . error && "is-invalid"
577585 ) }
578586 placeholder = { "" }
579587 { ...field }
@@ -612,9 +620,11 @@ function SensitiveFieldInput({
612620}
613621
614622function SkipConnectionTestButton ( {
623+ context,
615624 onSkip,
616- } : Pick < CredentialsButtonsProps , "onSkip" > ) {
625+ } : Pick < CredentialsButtonsProps , "context" | " onSkip"> ) {
617626 const skipButtonRef = useRef < HTMLAnchorElement > ( null ) ;
627+ const targetLabel = context === "job" ? "job" : "session" ;
618628 return (
619629 < >
620630 < span ref = { skipButtonRef } >
@@ -624,7 +634,7 @@ function SkipConnectionTestButton({
624634 </ Button >
625635 </ span >
626636 < UncontrolledTooltip target = { skipButtonRef } >
627- Skip the data connector. It will not be mounted in the session.
637+ { ` Skip the data connector. It will not be mounted in the ${ targetLabel } .` }
628638 </ UncontrolledTooltip >
629639 </ >
630640 ) ;
0 commit comments