Fixed ML urls in dashboard (#10411)

* Fixed ML urls in dashboard
This commit is contained in:
Leila Lali
2020-05-15 11:07:31 -07:00
committed by GitHub
parent 1d1e21b579
commit 1bcda64a1b
10 changed files with 81 additions and 36 deletions

View File

@@ -39,8 +39,15 @@ export class CurrentModelsComponent extends ModelViewBase implements IPageView {
* @param modelBuilder register the components
*/
public registerComponent(modelBuilder: azdata.ModelBuilder): azdata.Component {
this._tableSelectionComponent = new TableSelectionComponent(this._apiWrapper, this, { editable: false, preSelected: true });
this._tableSelectionComponent.registerComponent(modelBuilder, constants.databaseName, constants.tableName);
this._tableSelectionComponent = new TableSelectionComponent(this._apiWrapper, this, {
editable: false,
preSelected: true,
databaseTitle: constants.databaseName,
tableTitle: constants.tableName,
databaseInfo: constants.modelDatabaseInfo,
tableInfo: constants.modelTableInfo
});
this._tableSelectionComponent.registerComponent(modelBuilder);
this._tableSelectionComponent.onSelectedChanged(async () => {
await this.onTableSelected();
});

View File

@@ -34,12 +34,12 @@ export class ManageModelsDialog extends ModelViewBase {
selectable: false
});
let registerModelButton = this._apiWrapper.createButton(constants.importModelTitle);
let registerModelButton = this._apiWrapper.createButton(constants.registerModelTitle);
registerModelButton.onClick(async () => {
await this.sendDataRequest(RegisterModelEventName, this.currentLanguagesTab?.modelTable?.importTable);
});
let dialog = this.dialogView.createDialog(constants.registerModelTitle, [this.currentLanguagesTab]);
let dialog = this.dialogView.createDialog(constants.importedModelTitle, [this.currentLanguagesTab]);
dialog.isWide = true;
dialog.customButtons = [registerModelButton];
this.mainViewPanel = dialog;

View File

@@ -35,7 +35,15 @@ 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, { editable: true, preSelected: true });
this.tableSelectionComponent = new TableSelectionComponent(this._apiWrapper, this,
{
editable: true,
preSelected: true,
databaseTitle: constants.databaseName,
tableTitle: constants.tableName,
databaseInfo: constants.databaseToStoreInfo,
tableInfo: constants.tableToStoreInfo
});
this._descriptionComponent = modelBuilder.text().withProperties({
width: 200
}).component();
@@ -74,7 +82,7 @@ export class ModelImportLocationPage extends ModelViewBase implements IPageView,
this.tableSelectionComponent.onSelectedChanged(async () => {
await this.onTableSelected();
});
this.tableSelectionComponent.registerComponent(modelBuilder, constants.databaseName, constants.tableName);
this.tableSelectionComponent.registerComponent(modelBuilder);
this.tableSelectionComponent.addComponents(this._formBuilder);
this._formBuilder.addFormItem({

View File

@@ -35,8 +35,16 @@ export class InputColumnsComponent extends ModelViewBase implements IDataCompone
* @param modelBuilder model builder
*/
public registerComponent(modelBuilder: azdata.ModelBuilder): azdata.Component {
this._tableSelectionComponent = new TableSelectionComponent(this._apiWrapper, this, { editable: false, preSelected: false });
this._tableSelectionComponent.registerComponent(modelBuilder, constants.columnDatabase, constants.columnTable);
this._tableSelectionComponent = new TableSelectionComponent(this._apiWrapper, this,
{
editable: false,
preSelected: false,
databaseTitle: constants.columnDatabase,
tableTitle: constants.columnTable,
databaseInfo: constants.columnDatabaseInfo,
tableInfo: constants.columnTableInfo
});
this._tableSelectionComponent.registerComponent(modelBuilder);
this._tableSelectionComponent.onSelectedChanged(async () => {
await this.onTableSelected();
});

View File

@@ -13,7 +13,11 @@ import * as constants from '../../common/constants';
export interface ITableSelectionSettings {
editable: boolean,
preSelected: boolean
preSelected: boolean,
databaseTitle: string,
tableTitle: string,
databaseInfo: string,
tableInfo: string
}
/**
* View to render filters to pick an azure resource
@@ -47,7 +51,7 @@ export class TableSelectionComponent extends ModelViewBase implements IDataCompo
* Register components
* @param modelBuilder model builder
*/
public registerComponent(modelBuilder: azdata.ModelBuilder, databaseTitle: string, tableTitle: string): azdata.Component {
public registerComponent(modelBuilder: azdata.ModelBuilder): azdata.Component {
this._databases = modelBuilder.dropDown().withProperties({
width: this.componentMaxLength,
}).component();
@@ -111,23 +115,23 @@ export class TableSelectionComponent extends ModelViewBase implements IDataCompo
});
const databaseForm = modelBuilder.formContainer().withFormItems([{
title: databaseTitle,
title: this._settings.databaseTitle,
component: this._databases,
}], { info: databaseTitle }).withLayout({
}], { info: this._settings.databaseInfo }).withLayout({
padding: '0px'
}).component();
const tableForm = modelBuilder.formContainer();
if (this._settings.editable) {
tableForm.addFormItem({
title: tableTitle,
title: this._settings.tableTitle,
component: group
}, { info: tableTitle });
}, { info: this._settings.tableInfo });
} else {
tableForm.addFormItem({
title: tableTitle,
title: this._settings.tableTitle,
component: this._tables
}, { info: tableTitle });
}, { info: this._settings.tableInfo });
}
this._dbTableComponent = modelBuilder.flexContainer().withItems([