mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
Focus connection dialog on password when prompting for it (#1019)
This commit is contained in:
@@ -283,11 +283,9 @@ export class ConnectionWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private setConnectButton(): void {
|
private setConnectButton(): void {
|
||||||
let authDisplayName: string = this.getAuthTypeDisplayName(this.authenticationType);
|
|
||||||
let authType: AuthenticationType = this.getMatchingAuthType(authDisplayName);
|
|
||||||
let showUsernameAndPassword: boolean = true;
|
let showUsernameAndPassword: boolean = true;
|
||||||
if (authType) {
|
if (this.authType) {
|
||||||
showUsernameAndPassword = authType.showUsernameAndPassword;
|
showUsernameAndPassword = this.authType.showUsernameAndPassword;
|
||||||
}
|
}
|
||||||
showUsernameAndPassword ? this._callbacks.onSetConnectButton(!!this.serverName && !!this.userName) :
|
showUsernameAndPassword ? this._callbacks.onSetConnectButton(!!this.serverName && !!this.userName) :
|
||||||
this._callbacks.onSetConnectButton(!!this.serverName);
|
this._callbacks.onSetConnectButton(!!this.serverName);
|
||||||
@@ -344,6 +342,7 @@ export class ConnectionWidget {
|
|||||||
|
|
||||||
public focusOnOpen(): void {
|
public focusOnOpen(): void {
|
||||||
this._serverNameInputBox.focus();
|
this._serverNameInputBox.focus();
|
||||||
|
this.focusPasswordIfNeeded();
|
||||||
}
|
}
|
||||||
|
|
||||||
private getModelValue(value: string): string {
|
private getModelValue(value: string): string {
|
||||||
@@ -391,6 +390,7 @@ export class ConnectionWidget {
|
|||||||
// 1. Authentication type is SQL Login and no username is provided
|
// 1. Authentication type is SQL Login and no username is provided
|
||||||
// 2. No server name is provided
|
// 2. No server name is provided
|
||||||
this.setConnectButton();
|
this.setConnectButton();
|
||||||
|
this.focusPasswordIfNeeded();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -555,6 +555,17 @@ export class ConnectionWidget {
|
|||||||
public set databaseDropdownExpanded(val: boolean) {
|
public set databaseDropdownExpanded(val: boolean) {
|
||||||
this._databaseDropdownExpanded = val;
|
this._databaseDropdownExpanded = val;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private get authType(): AuthenticationType {
|
||||||
|
let authDisplayName: string = this.getAuthTypeDisplayName(this.authenticationType);
|
||||||
|
return this.getMatchingAuthType(authDisplayName);
|
||||||
|
}
|
||||||
|
|
||||||
|
private focusPasswordIfNeeded(): void {
|
||||||
|
if (this.authType && this.authType.showUsernameAndPassword && this.userName && !this.password) {
|
||||||
|
this._passwordInputBox.focus();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class AuthenticationType {
|
class AuthenticationType {
|
||||||
|
|||||||
Reference in New Issue
Block a user