mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
Fixed a bug with validing empty table name (#13259)
This commit is contained in:
@@ -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;
|
||||||
|
|||||||
@@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user