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([

View File

@@ -339,6 +339,10 @@ export class DashboardWidget {
}).component();
const links = [{
title: constants.sqlMlExtDocTitle,
description: constants.sqlMlExtDocDesc,
link: constants.mlExtDocLink
}, {
title: constants.sqlMlDocTitle,
description: constants.sqlMlDocDesc,
link: constants.mlDocLink
@@ -461,7 +465,7 @@ export class DashboardWidget {
dark: this.asAbsolutePath('images/makePredictions.svg'),
light: this.asAbsolutePath('images/makePredictions.svg'),
},
link: '',
link: 'https://go.microsoft.com/fwlink/?linkid=2129795',
command: constants.mlsPredictModelCommand
};
const predictionButton = this.createTaskButton(view, predictionMetadata);
@@ -472,7 +476,7 @@ export class DashboardWidget {
dark: this.asAbsolutePath('images/manageModels.svg'),
light: this.asAbsolutePath('images/manageModels.svg'),
},
link: '',
link: 'https://go.microsoft.com/fwlink/?linkid=2129796',
command: constants.mlManageModelsCommand
};
const importModelsButton = this.createTaskButton(view, importMetadata);
@@ -483,7 +487,7 @@ export class DashboardWidget {
dark: this.asAbsolutePath('images/createNotebook.svg'),
light: this.asAbsolutePath('images/createNotebook.svg'),
},
link: '',
link: 'https://go.microsoft.com/fwlink/?linkid=2129920',
command: constants.notebookCommandNew
};
const notebookModelsButton = this.createTaskButton(view, notebookMetadata);
@@ -551,7 +555,7 @@ export class DashboardWidget {
CSSStyles: {
'padding': '0px',
'padding-bottom': '5px',
'width': '180px',
'width': '200px',
'margin': '0px',
'color': '#006ab1'
}