184
184
name =" startUrl"
185
185
@input =" handleUrlInput"
186
186
v-model =" startUrl"
187
+ @keydown.enter =" handleContinueClick()"
187
188
/>
188
189
<h4 class =" start-url-error" >{{ startUrlError }}</h4 >
189
190
<div class =" title topMargin" >Region</div >
201
202
</select >
202
203
<button
203
204
class =" continue-button topMargin"
204
- :disabled =" startUrl.length == 0 || startUrlError.length > 0 || !selectedRegion "
205
+ :disabled =" shouldDisableSsoContinue() "
205
206
v-on:click =" handleContinueClick()"
206
207
>
207
208
Continue
245
246
id =" profileName"
246
247
name =" profileName"
247
248
v-model =" profileName"
249
+ @keydown.enter =" handleContinueClick()"
248
250
/>
249
251
<div class =" title" >Access Key</div >
250
- <input class =" iamInput bottomMargin" type =" text" id =" accessKey" name =" accessKey" v-model =" accessKey" />
252
+ <input
253
+ class =" iamInput bottomMargin"
254
+ type =" text"
255
+ id =" accessKey"
256
+ name =" accessKey"
257
+ v-model =" accessKey"
258
+ @keydown.enter =" handleContinueClick()"
259
+ />
251
260
<div class =" title" >Secret Key</div >
252
- <input class =" iamInput bottomMargin" type =" text" id =" secretKey" name =" secretKey" v-model =" secretKey" />
253
- <button
254
- class =" continue-button"
255
- :disabled =" profileName.length <= 0 || accessKey.length <= 0 || secretKey.length <= 0"
256
- v-on:click =" handleContinueClick()"
257
- >
261
+ <input
262
+ class =" iamInput bottomMargin"
263
+ type =" text"
264
+ id =" secretKey"
265
+ name =" secretKey"
266
+ v-model =" secretKey"
267
+ @keydown.enter =" handleContinueClick()"
268
+ />
269
+ <button class =" continue-button" :disabled =" shouldDisableIamContinue()" v-on:click =" handleContinueClick()" >
258
270
Continue
259
271
</button >
260
272
</template >
@@ -393,7 +405,6 @@ export default defineComponent({
393
405
}
394
406
},
395
407
async handleContinueClick() {
396
- void client .emitUiClick (' auth_continueButton' )
397
408
if (this .stage === ' START' ) {
398
409
if (this .selectedLoginOption === LoginOption .BUILDER_ID ) {
399
410
this .stage = ' AUTHENTICATING'
@@ -406,6 +417,7 @@ export default defineComponent({
406
417
}
407
418
} else if (this .selectedLoginOption === LoginOption .ENTERPRISE_SSO ) {
408
419
this .stage = ' SSO_FORM'
420
+ this .$nextTick (() => document .getElementById (' startUrl' )! .focus ())
409
421
await client .storeMetricMetadata ({ region: this .selectedRegion })
410
422
} else if (this .selectedLoginOption >= LoginOption .EXISTING_LOGINS ) {
411
423
this .stage = ' AUTHENTICATING'
@@ -420,8 +432,12 @@ export default defineComponent({
420
432
}
421
433
} else if (this .selectedLoginOption === LoginOption .IAM_CREDENTIAL ) {
422
434
this .stage = ' AWS_PROFILE'
435
+ this .$nextTick (() => document .getElementById (' profileName' )! .focus ())
423
436
}
424
437
} else if (this .stage === ' SSO_FORM' ) {
438
+ if (this .shouldDisableSsoContinue ()) {
439
+ return
440
+ }
425
441
this .stage = ' AUTHENTICATING'
426
442
const error = await client .startEnterpriseSetup (this .startUrl , this .selectedRegion , this .app )
427
443
if (error ) {
@@ -431,6 +447,9 @@ export default defineComponent({
431
447
this .stage = ' CONNECTED'
432
448
}
433
449
} else if (this .stage === ' AWS_PROFILE' ) {
450
+ if (this .shouldDisableIamContinue ()) {
451
+ return
452
+ }
434
453
this .stage = ' AUTHENTICATING'
435
454
const error = await client .startIamCredentialSetup (this .profileName , this .accessKey , this .secretKey )
436
455
if (error ) {
@@ -440,6 +459,7 @@ export default defineComponent({
440
459
this .stage = ' CONNECTED'
441
460
}
442
461
}
462
+ void client .emitUiClick (' auth_continueButton' )
443
463
},
444
464
async handleCodeCatalystSignin() {
445
465
void client .emitUiClick (' auth_codeCatalystSignIn' )
@@ -525,6 +545,12 @@ export default defineComponent({
525
545
handleHelpLinkClick() {
526
546
void client .emitUiClick (' auth_helpLink' )
527
547
},
548
+ shouldDisableSsoContinue() {
549
+ return this .startUrl .length == 0 || this .startUrlError .length > 0 || ! this .selectedRegion
550
+ },
551
+ shouldDisableIamContinue() {
552
+ return this .profileName .length <= 0 || this .accessKey .length <= 0 || this .secretKey .length <= 0
553
+ },
528
554
},
529
555
})
530
556
</script >
0 commit comments