Fixed a bug with validing empty table name (#13259)

This commit is contained in:
Leila Lali
2020-11-05 16:07:18 -08:00
committed by GitHub
parent 415a20f9f7
commit fe546e3791
2 changed files with 8 additions and 4 deletions

View File

@@ -170,7 +170,7 @@ export class ModelManagementController extends ControllerBase {
}); });
view.on(PredictWizardEventName, async (args) => { view.on(PredictWizardEventName, async (args) => {
const models = <ImportedModel[] | undefined>args; const models = <ImportedModel[] | undefined>args;
await this.executeAction(view, PredictWizardEventName, args, this.predictModel, models, view, this, this._apiWrapper, this._root); await this.executeAction(view, PredictWizardEventName, args, this.predictModel, models, undefined, this, this._apiWrapper, this._root);
}); });
view.on(EditModelEventName, async (args) => { view.on(EditModelEventName, async (args) => {
const model = <ImportedModel>args; const model = <ImportedModel>args;

View File

@@ -93,13 +93,17 @@ export class TableSelectionComponent extends ModelViewBase implements IDataCompo
} }
}).component(); }).component();
this._existingTableButton.onDidClick(() => { this._existingTableButton.onDidClick(async () => {
this._existingTablesSelected = true; this._existingTablesSelected = true;
this.refreshTableComponent(); this.refreshTableComponent();
this._selectedTableName = <string>this._tables?.value ?? '';
await this.onTableSelected();
}); });
this._newTableButton.onDidClick(() => { this._newTableButton.onDidClick(async () => {
this._existingTablesSelected = false; this._existingTablesSelected = false;
this.refreshTableComponent(); this.refreshTableComponent();
this._selectedTableName = '';
await this.onTableSelected();
}); });
this._newTableName.onTextChanged(async () => { this._newTableName.onTextChanged(async () => {
if (this._newTableName) { if (this._newTableName) {
@@ -209,7 +213,7 @@ export class TableSelectionComponent extends ModelViewBase implements IDataCompo
} }
public get isDataValid(): boolean { public get isDataValid(): boolean {
return this.data !== undefined && this.data.databaseName !== this._settings.defaultDbName && this.data.tableName !== this._settings.defaultTableName; return this.data !== undefined && this.data.databaseName !== '' && this.data.tableName !== '' && this.data.databaseName !== undefined && this.data.tableName !== undefined && this.data.databaseName !== this._settings.defaultDbName && this.data.tableName !== this._settings.defaultTableName;
} }
/** /**