mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-28 17:23:19 -05:00
fix the input box validation (#15634)
* fix the input box validation * fix one more place
This commit is contained in:
@@ -887,27 +887,27 @@ export class ConnectionWidget extends lifecycle.Disposable {
|
||||
|
||||
private validateInputs(): boolean {
|
||||
let isFocused = false;
|
||||
let validateServerName = this._serverNameInputBox.validate();
|
||||
if (!validateServerName) {
|
||||
const isServerNameValid = this._serverNameInputBox.validate() === undefined;
|
||||
if (!isServerNameValid) {
|
||||
this._serverNameInputBox.focus();
|
||||
isFocused = true;
|
||||
}
|
||||
let validateUserName = this._userNameInputBox.validate();
|
||||
if (!validateUserName && !isFocused) {
|
||||
const isUserNameValid = this._userNameInputBox.validate() === undefined;
|
||||
if (!isUserNameValid && !isFocused) {
|
||||
this._userNameInputBox.focus();
|
||||
isFocused = true;
|
||||
}
|
||||
let validatePassword = this._passwordInputBox.validate();
|
||||
if (!validatePassword && !isFocused) {
|
||||
const isPasswordValid = this._passwordInputBox.validate() === undefined;
|
||||
if (!isPasswordValid && !isFocused) {
|
||||
this._passwordInputBox.focus();
|
||||
isFocused = true;
|
||||
}
|
||||
let validateAzureAccount = this.validateAzureAccountSelection();
|
||||
if (!validateAzureAccount && !isFocused) {
|
||||
const isAzureAccountValid = this.validateAzureAccountSelection();
|
||||
if (!isAzureAccountValid && !isFocused) {
|
||||
this._azureAccountDropdown.focus();
|
||||
isFocused = true;
|
||||
}
|
||||
return validateServerName && validateUserName && validatePassword && validateAzureAccount;
|
||||
return isServerNameValid && isUserNameValid && isPasswordValid && isAzureAccountValid;
|
||||
}
|
||||
|
||||
public connect(model: IConnectionProfile): boolean {
|
||||
|
||||
@@ -307,11 +307,11 @@ export class ServerGroupDialog extends Modal {
|
||||
|
||||
private validateInputs(): boolean {
|
||||
const renderedDialog = this.withRenderedDialog;
|
||||
let validate = renderedDialog.groupNameInputBox.validate();
|
||||
if (!validate) {
|
||||
const isNameValid = renderedDialog.groupNameInputBox.validate() === undefined;
|
||||
if (!isNameValid) {
|
||||
renderedDialog.groupNameInputBox.focus();
|
||||
}
|
||||
return validate;
|
||||
return isNameValid;
|
||||
}
|
||||
|
||||
// initialize the view based on the current state of the view model
|
||||
|
||||
Reference in New Issue
Block a user