mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-05 17:23:51 -05:00
Add validation error message for inputbox component (#8909)
* add validation error message for inputbox component * addressing comments * remove copying entire definition for InputBoxProperties
This commit is contained in:
@@ -14,6 +14,7 @@ export abstract class BasePage {
|
||||
protected readonly wizardPage: azdata.window.WizardPage;
|
||||
protected readonly model: DacFxDataModel;
|
||||
protected readonly view: azdata.ModelView;
|
||||
protected databaseValues: string[];
|
||||
|
||||
/**
|
||||
* This method constructs all the elements of the page.
|
||||
@@ -105,30 +106,27 @@ export abstract class BasePage {
|
||||
return values;
|
||||
}
|
||||
|
||||
protected async getDatabaseValues(): Promise<{ displayName: string, name: string }[]> {
|
||||
protected async getDatabaseValues(): Promise<string[]> {
|
||||
let idx = -1;
|
||||
let count = -1;
|
||||
let values = (await azdata.connection.listDatabases(this.model.server.connectionId)).map(db => {
|
||||
this.databaseValues = (await azdata.connection.listDatabases(this.model.server.connectionId)).map(db => {
|
||||
count++;
|
||||
if (this.model.database && db === this.model.database) {
|
||||
idx = count;
|
||||
}
|
||||
|
||||
return {
|
||||
displayName: db,
|
||||
name: db
|
||||
};
|
||||
return db;
|
||||
});
|
||||
|
||||
if (idx >= 0) {
|
||||
let tmp = values[0];
|
||||
values[0] = values[idx];
|
||||
values[idx] = tmp;
|
||||
let tmp = this.databaseValues[0];
|
||||
this.databaseValues[0] = this.databaseValues[idx];
|
||||
this.databaseValues[idx] = tmp;
|
||||
} else {
|
||||
this.deleteDatabaseValues();
|
||||
}
|
||||
|
||||
return values;
|
||||
return this.databaseValues;
|
||||
}
|
||||
|
||||
protected deleteServerValues() {
|
||||
|
||||
Reference in New Issue
Block a user