mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-05 17:23:51 -05:00
Fixed a bug with deleting models from list in import model wizard (#12798)
This commit is contained in:
@@ -73,7 +73,11 @@ export class ModelDetailsPage extends ModelViewBase implements IPageView, IDataC
|
||||
}
|
||||
|
||||
public validate(): Promise<boolean> {
|
||||
if (this.data && this.data.length > 0 && !this.data.find(x => !x.modelDetails?.modelName)) {
|
||||
if (!this.data || this.data.length === 0) {
|
||||
this.showErrorMessage(constants.modelsRequiredError);
|
||||
return Promise.resolve(false);
|
||||
}
|
||||
else if (this.data && this.data.length > 0 && !this.data.find(x => !x.modelDetails?.modelName)) {
|
||||
return Promise.resolve(true);
|
||||
} else {
|
||||
this.showErrorMessage(constants.modelNameRequiredError);
|
||||
|
||||
@@ -31,7 +31,7 @@ export class ModelsDetailsTableComponent extends ModelViewBase implements IDataC
|
||||
.withProperties<azdata.DeclarativeTableProperties>(
|
||||
{
|
||||
columns: [
|
||||
{ // Name
|
||||
{ // File Name
|
||||
displayName: constants.modelFileName,
|
||||
ariaLabel: constants.modelFileName,
|
||||
valueType: azdata.DeclarativeDataType.string,
|
||||
@@ -57,7 +57,7 @@ export class ModelsDetailsTableComponent extends ModelViewBase implements IDataC
|
||||
...constants.cssStyles.tableRow
|
||||
},
|
||||
},
|
||||
{ // Created
|
||||
{ // Description
|
||||
displayName: constants.modelDescription,
|
||||
ariaLabel: constants.modelDescription,
|
||||
valueType: azdata.DeclarativeDataType.component,
|
||||
@@ -121,6 +121,9 @@ export class ModelsDetailsTableComponent extends ModelViewBase implements IDataC
|
||||
let tableData: any[][] = [];
|
||||
tableData = tableData.concat(models.map(model => this.createTableRow(model)));
|
||||
this._table.data = tableData;
|
||||
if (tableData.length === 0) {
|
||||
this._table.dataValues = tableData;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user