Deprecate the modelviewdialog namespace (#4075)

* Deprecate the modelviewdialog namespace

* use @deprecated tag
This commit is contained in:
Alan Ren
2019-02-19 09:43:37 -08:00
committed by GitHub
parent d4ffe53dbd
commit 1cc6a108a7
44 changed files with 579 additions and 210 deletions

View File

@@ -18,7 +18,7 @@ export abstract class AgentDialog<T extends IAgentDialogData> {
protected _onSuccess: vscode.EventEmitter<T> = new vscode.EventEmitter<T>();
public readonly onSuccess: vscode.Event<T> = this._onSuccess.event;
public dialog: sqlops.window.modelviewdialog.Dialog;
public dialog: sqlops.window.Dialog;
// Dialog Name for Telemetry
public dialogName: string;
@@ -32,11 +32,11 @@ export abstract class AgentDialog<T extends IAgentDialogData> {
protected abstract async updateModel();
protected abstract async initializeDialog(dialog: sqlops.window.modelviewdialog.Dialog);
protected abstract async initializeDialog(dialog: sqlops.window.Dialog);
public async openDialog(dialogName?: string) {
let event = dialogName ? dialogName : null;
this.dialog = sqlops.window.modelviewdialog.createDialog(this.title, event);
this.dialog = sqlops.window.createModelViewDialog(this.title, event);
await this.model.initialize();
@@ -48,7 +48,7 @@ export abstract class AgentDialog<T extends IAgentDialogData> {
this.dialog.cancelButton.label = AgentDialog.CancelButtonText;
this.dialog.cancelButton.onClick(async () => await this.cancel());
sqlops.window.modelviewdialog.openDialog(this.dialog);
sqlops.window.openDialog(this.dialog);
}
protected async execute() {

View File

@@ -121,9 +121,9 @@ export class AlertDialog extends AgentDialog<AlertData> {
private readonly EditAlertDialog = 'EditAlertDialogOpened';
// UI Components
private generalTab: sqlops.window.modelviewdialog.DialogTab;
private responseTab: sqlops.window.modelviewdialog.DialogTab;
private optionsTab: sqlops.window.modelviewdialog.DialogTab;
private generalTab: sqlops.window.DialogTab;
private responseTab: sqlops.window.DialogTab;
private optionsTab: sqlops.window.DialogTab;
// General tab controls
private nameTextBox: sqlops.InputBoxComponent;
@@ -175,13 +175,13 @@ export class AlertDialog extends AgentDialog<AlertData> {
this.dialogName = this.isEdit ? this.EditAlertDialog : this.NewAlertDialog;
}
protected async initializeDialog(dialog: sqlops.window.modelviewdialog.Dialog) {
protected async initializeDialog(dialog: sqlops.window.Dialog) {
this.databases = await AgentUtils.getDatabases(this.ownerUri);
this.databases.unshift(AlertDialog.AllDatabases);
this.generalTab = sqlops.window.modelviewdialog.createTab(AlertDialog.GeneralTabText);
this.responseTab = sqlops.window.modelviewdialog.createTab(AlertDialog.ResponseTabText);
this.optionsTab = sqlops.window.modelviewdialog.createTab(AlertDialog.OptionsTabText);
this.generalTab = sqlops.window.createTab(AlertDialog.GeneralTabText);
this.responseTab = sqlops.window.createTab(AlertDialog.ResponseTabText);
this.optionsTab = sqlops.window.createTab(AlertDialog.OptionsTabText);
this.initializeGeneralTab(this.databases, dialog);
this.initializeResponseTab();
@@ -190,7 +190,7 @@ export class AlertDialog extends AgentDialog<AlertData> {
dialog.content = [this.generalTab, this.responseTab, this.optionsTab];
}
private initializeGeneralTab(databases: string[], dialog: sqlops.window.modelviewdialog.Dialog) {
private initializeGeneralTab(databases: string[], dialog: sqlops.window.Dialog) {
this.generalTab.registerContent(async view => {
// create controls
this.nameTextBox = view.modelBuilder.inputBox().component();

View File

@@ -73,11 +73,11 @@ export class JobDialog extends AgentDialog<JobData> {
private readonly EditJobDialogEvent: string = 'EditJobDialogOpened';
// UI Components
private generalTab: sqlops.window.modelviewdialog.DialogTab;
private stepsTab: sqlops.window.modelviewdialog.DialogTab;
private alertsTab: sqlops.window.modelviewdialog.DialogTab;
private schedulesTab: sqlops.window.modelviewdialog.DialogTab;
private notificationsTab: sqlops.window.modelviewdialog.DialogTab;
private generalTab: sqlops.window.DialogTab;
private stepsTab: sqlops.window.DialogTab;
private alertsTab: sqlops.window.DialogTab;
private schedulesTab: sqlops.window.DialogTab;
private notificationsTab: sqlops.window.DialogTab;
// General tab controls
private nameTextBox: sqlops.InputBoxComponent;
@@ -139,11 +139,11 @@ export class JobDialog extends AgentDialog<JobData> {
}
protected async initializeDialog() {
this.generalTab = sqlops.window.modelviewdialog.createTab(this.GeneralTabText);
this.stepsTab = sqlops.window.modelviewdialog.createTab(this.StepsTabText);
this.alertsTab = sqlops.window.modelviewdialog.createTab(this.AlertsTabText);
this.schedulesTab = sqlops.window.modelviewdialog.createTab(this.SchedulesTabText);
this.notificationsTab = sqlops.window.modelviewdialog.createTab(this.NotificationsTabText);
this.generalTab = sqlops.window.createTab(this.GeneralTabText);
this.stepsTab = sqlops.window.createTab(this.StepsTabText);
this.alertsTab = sqlops.window.createTab(this.AlertsTabText);
this.schedulesTab = sqlops.window.createTab(this.SchedulesTabText);
this.notificationsTab = sqlops.window.createTab(this.NotificationsTabText);
this.initializeGeneralTab();
this.initializeStepsTab();
this.initializeAlertsTab();

View File

@@ -74,11 +74,11 @@ export class JobStepDialog extends AgentDialog<JobStepData> {
// UI Components
// Dialogs
private fileBrowserDialog: sqlops.window.modelviewdialog.Dialog;
private fileBrowserDialog: sqlops.window.Dialog;
// Dialog tabs
private generalTab: sqlops.window.modelviewdialog.DialogTab;
private advancedTab: sqlops.window.modelviewdialog.DialogTab;
private generalTab: sqlops.window.DialogTab;
private advancedTab: sqlops.window.DialogTab;
//Input boxes
private nameTextBox: sqlops.InputBoxComponent;
@@ -138,8 +138,8 @@ export class JobStepDialog extends AgentDialog<JobStepData> {
}
private initializeUIComponents() {
this.generalTab = sqlops.window.modelviewdialog.createTab(this.GeneralTabText);
this.advancedTab = sqlops.window.modelviewdialog.createTab(this.AdvancedTabText);
this.generalTab = sqlops.window.createTab(this.GeneralTabText);
this.advancedTab = sqlops.window.createTab(this.AdvancedTabText);
this.dialog.content = [this.generalTab, this.advancedTab];
}
@@ -425,8 +425,8 @@ export class JobStepDialog extends AgentDialog<JobStepData> {
private openFileBrowserDialog() {
let fileBrowserTitle = this.FileBrowserDialogTitle + `${this.server}`;
this.fileBrowserDialog = sqlops.window.modelviewdialog.createDialog(fileBrowserTitle);
let fileBrowserTab = sqlops.window.modelviewdialog.createTab('File Browser');
this.fileBrowserDialog = sqlops.window.createModelViewDialog(fileBrowserTitle);
let fileBrowserTab = sqlops.window.createTab('File Browser');
this.fileBrowserDialog.content = [fileBrowserTab];
fileBrowserTab.registerContent(async (view) => {
this.fileBrowserTree = view.modelBuilder.fileBrowserTree()
@@ -470,7 +470,7 @@ export class JobStepDialog extends AgentDialog<JobStepData> {
});
this.fileBrowserDialog.okButton.label = this.OkButtonText;
this.fileBrowserDialog.cancelButton.label = this.CancelButtonText;
sqlops.window.modelviewdialog.openDialog(this.fileBrowserDialog);
sqlops.window.openDialog(this.fileBrowserDialog);
}
private createTSQLOptions(view) {

View File

@@ -48,8 +48,8 @@ export class OperatorDialog extends AgentDialog<OperatorData> {
private readonly EditOperatorDialog = 'EditOperatorDialogOpened';
// UI Components
private generalTab: sqlops.window.modelviewdialog.DialogTab;
private notificationsTab: sqlops.window.modelviewdialog.DialogTab;
private generalTab: sqlops.window.DialogTab;
private notificationsTab: sqlops.window.DialogTab;
// General tab controls
private nameTextBox: sqlops.InputBoxComponent;
@@ -83,9 +83,9 @@ export class OperatorDialog extends AgentDialog<OperatorData> {
this.dialogName = this.isEdit ? this.EditOperatorDialog : this.NewOperatorDialog;
}
protected async initializeDialog(dialog: sqlops.window.modelviewdialog.Dialog) {
this.generalTab = sqlops.window.modelviewdialog.createTab(OperatorDialog.GeneralTabText);
this.notificationsTab = sqlops.window.modelviewdialog.createTab(OperatorDialog.NotificationsTabText);
protected async initializeDialog(dialog: sqlops.window.Dialog) {
this.generalTab = sqlops.window.createTab(OperatorDialog.GeneralTabText);
this.notificationsTab = sqlops.window.createTab(OperatorDialog.NotificationsTabText);
this.initializeGeneralTab();
this.initializeNotificationTab();

View File

@@ -25,7 +25,7 @@ export class PickScheduleDialog {
// UI Components
private dialog: sqlops.window.modelviewdialog.Dialog;
private dialog: sqlops.window.Dialog;
private schedulesTable: sqlops.TableComponent;
private model: PickScheduleData;
@@ -39,13 +39,13 @@ export class PickScheduleDialog {
public async showDialog() {
await this.model.initialize();
this.dialog = sqlops.window.modelviewdialog.createDialog(this.DialogTitle);
this.dialog = sqlops.window.createModelViewDialog(this.DialogTitle);
this.initializeContent();
this.dialog.okButton.onClick(async () => await this.execute());
this.dialog.cancelButton.onClick(async () => await this.cancel());
this.dialog.okButton.label = this.OkButtonText;
this.dialog.cancelButton.label = this.CancelButtonText;
sqlops.window.modelviewdialog.openDialog(this.dialog);
sqlops.window.openDialog(this.dialog);
}
private initializeContent() {

View File

@@ -40,7 +40,7 @@ export class ProxyDialog extends AgentDialog<ProxyData> {
private readonly EditProxyDialog = 'EditProxyDialogOpened';
// UI Components
private generalTab: sqlops.window.modelviewdialog.DialogTab;
private generalTab: sqlops.window.DialogTab;
// General tab controls
private proxyNameTextBox: sqlops.InputBoxComponent;
@@ -71,8 +71,8 @@ export class ProxyDialog extends AgentDialog<ProxyData> {
this.dialogName = this.isEdit ? this.EditProxyDialog : this.NewProxyDialog;
}
protected async initializeDialog(dialog: sqlops.window.modelviewdialog.Dialog) {
this.generalTab = sqlops.window.modelviewdialog.createTab(ProxyDialog.GeneralTabText);
protected async initializeDialog(dialog: sqlops.window.Dialog) {
this.generalTab = sqlops.window.createTab(ProxyDialog.GeneralTabText);
this.initializeGeneralTab();

View File

@@ -21,7 +21,7 @@ export class ScheduleDialog {
private readonly SchedulesLabelText: string = localize('scheduleDialog.schedules', 'Schedules');
// UI Components
private dialog: sqlops.window.modelviewdialog.Dialog;
private dialog: sqlops.window.Dialog;
private schedulesTable: sqlops.TableComponent;
private model: ScheduleData;
@@ -35,14 +35,14 @@ export class ScheduleDialog {
public async showDialog() {
await this.model.initialize();
this.dialog = sqlops.window.modelviewdialog.createDialog(this.DialogTitle);
this.dialog = sqlops.window.createModelViewDialog(this.DialogTitle);
this.initializeContent();
this.dialog.okButton.onClick(async () => await this.execute());
this.dialog.cancelButton.onClick(async () => await this.cancel());
this.dialog.okButton.label = this.OkButtonText;
this.dialog.cancelButton.label = this.CancelButtonText;
sqlops.window.modelviewdialog.openDialog(this.dialog);
sqlops.window.openDialog(this.dialog);
}
private initializeContent() {