ML extension - Improving predict parameter mapping experience (#10264)

This commit is contained in:
Leila Lali
2020-05-10 18:10:17 -07:00
committed by GitHub
parent f6e7b56946
commit 3d2d791f18
44 changed files with 782 additions and 388 deletions

View File

@@ -19,6 +19,7 @@ export class ModelImportLocationPage extends ModelViewBase implements IPageView,
private _form: azdata.FormContainer | undefined;
private _formBuilder: azdata.FormBuilder | undefined;
public tableSelectionComponent: TableSelectionComponent | undefined;
private _labelComponent: azdata.TextComponent | undefined;
constructor(apiWrapper: ApiWrapper, parent: ModelViewBase) {
super(apiWrapper, parent.root, parent);
@@ -31,12 +32,35 @@ export class ModelImportLocationPage extends ModelViewBase implements IPageView,
public registerComponent(modelBuilder: azdata.ModelBuilder): azdata.Component {
this._formBuilder = modelBuilder.formContainer();
this.tableSelectionComponent = new TableSelectionComponent(this._apiWrapper, this, true);
this.tableSelectionComponent = new TableSelectionComponent(this._apiWrapper, this, { editable: true, preSelected: true });
this._labelComponent = modelBuilder.text().withProperties({
width: 200
}).component();
const container = modelBuilder.flexContainer().withLayout({
width: 800,
height: '400px',
justifyContent: 'center'
}).withItems([
this._labelComponent
], {
CSSStyles: {
'align-items': 'center',
'padding-top': '30px',
'font-size': '16px'
}
}).component();
this.tableSelectionComponent.onSelectedChanged(async () => {
await this.onTableSelected();
});
this.tableSelectionComponent.registerComponent(modelBuilder);
this.tableSelectionComponent.registerComponent(modelBuilder, constants.databaseName, constants.tableName);
this.tableSelectionComponent.addComponents(this._formBuilder);
this._formBuilder.addFormItem({
title: '',
component: container
});
this._form = this._formBuilder.component();
return this._form;
}
@@ -45,6 +69,15 @@ export class ModelImportLocationPage extends ModelViewBase implements IPageView,
if (this.tableSelectionComponent?.data) {
this.importTable = this.tableSelectionComponent?.data;
}
if (this.importTable && this._labelComponent) {
const validated = await this.verifyImportConfigTable(this.importTable);
if (validated) {
this._labelComponent.value = constants.modelSchemaIsAcceptedMessage;
} else {
this._labelComponent.value = constants.modelSchemaIsNotAcceptedMessage;
}
}
}
/**