Update product references from 'sqlops' to 'azdata' (#4259)

* Update extensions to use azdata

* Switch core code to use azdata
This commit is contained in:
Karl Burtram
2019-03-01 13:59:37 -08:00
committed by GitHub
parent 220685a522
commit 84890eb1b4
371 changed files with 3208 additions and 3184 deletions

View File

@@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
'use strict';
import * as sqlops from 'sqlops';
import * as azdata from 'azdata';
import { WizardPageBase } from '../../wizardPageBase';
import { CreateClusterWizard } from '../createClusterWizard';
import * as nls from 'vscode-nls';
@@ -25,7 +25,7 @@ export class ClusterProfilePage extends WizardPageBase<CreateClusterWizard> {
});
}
protected initialize(view: sqlops.ModelView): Thenable<void> {
protected initialize(view: azdata.ModelView): Thenable<void> {
let formBuilder = view.modelBuilder.formContainer();
let form = formBuilder.component();
return view.initializeModel(form);

View File

@@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
'use strict';
import * as sqlops from 'sqlops';
import * as azdata from 'azdata';
import * as vscode from 'vscode';
import * as os from 'os';
import { WizardPageBase } from '../../wizardPageBase';
@@ -17,10 +17,10 @@ const localize = nls.loadMessageBundle();
const ClusterRadioButtonGroupName = 'cluster';
export class SelectExistingClusterPage extends WizardPageBase<CreateClusterWizard> {
private existingClusterControl: sqlops.FlexContainer;
private clusterContextsLabel: sqlops.TextComponent;
private errorLoadingClustersLabel: sqlops.TextComponent;
private clusterContextContainer: sqlops.DivContainer;
private existingClusterControl: azdata.FlexContainer;
private clusterContextsLabel: azdata.TextComponent;
private errorLoadingClustersLabel: azdata.TextComponent;
private clusterContextContainer: azdata.DivContainer;
constructor(wizard: CreateClusterWizard) {
super(localize('bdc-create.selectTargetClusterPageTitle', 'Where do you want to deploy this SQL Server big data cluster?'),
@@ -28,7 +28,7 @@ export class SelectExistingClusterPage extends WizardPageBase<CreateClusterWizar
wizard);
}
protected initialize(view: sqlops.ModelView): Thenable<void> {
protected initialize(view: azdata.ModelView): Thenable<void> {
this.initExistingClusterControl(view);
let formBuilder = view.modelBuilder.formContainer().withFormItems(
[
@@ -56,14 +56,14 @@ export class SelectExistingClusterPage extends WizardPageBase<CreateClusterWizar
if (!clusterSelected) {
this.wizard.wizardObject.message = {
text: localize('bdc-create.ClusterContextNotSelectedMessage', 'Please select a cluster context.'),
level: sqlops.window.MessageLevel.Error
level: azdata.window.MessageLevel.Error
};
}
return clusterSelected;
});
}
private initExistingClusterControl(view: sqlops.ModelView): void {
private initExistingClusterControl(view: azdata.ModelView): void {
let self = this;
let configFileLabel = view.modelBuilder.text().withProperties({ value: localize('bdc-create.kubeConfigFileLabelText', 'Kube config file path') }).component();
let configFileInput = view.modelBuilder.inputBox().withProperties({ width: '300px' }).component();
@@ -104,7 +104,7 @@ export class SelectExistingClusterPage extends WizardPageBase<CreateClusterWizar
let clusters = await self.wizard.model.loadClusters();
if (clusters.length !== 0) {
let options = clusters.map(cluster => {
let option = view.modelBuilder.radioButton().withProperties<sqlops.RadioButtonProperties>({
let option = view.modelBuilder.radioButton().withProperties<azdata.RadioButtonProperties>({
label: cluster.contextName,
checked: cluster.active,
name: ClusterRadioButtonGroupName

View File

@@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
'use strict';
import * as sqlops from 'sqlops';
import * as azdata from 'azdata';
import { WizardPageBase } from '../../wizardPageBase';
import { TargetClusterTypeInfo, ToolInstallationStatus, ToolInfo } from '../../../interfaces';
import * as nls from 'vscode-nls';
@@ -16,13 +16,13 @@ const InstallToolsButtonText = localize('bdc-create.InstallToolsText', 'Install
const InstallingButtonText = localize('bdc-create.InstallingButtonText', 'Installing...');
export class SelectTargetClusterTypePage extends WizardPageBase<CreateClusterWizard> {
private cards: sqlops.CardComponent[];
private toolsTable: sqlops.TableComponent;
private formBuilder: sqlops.FormBuilder;
private form: sqlops.FormContainer;
private installToolsButton: sqlops.window.Button;
private toolsLoadingWrapper: sqlops.LoadingComponent;
private refreshToolsButton: sqlops.window.Button;
private cards: azdata.CardComponent[];
private toolsTable: azdata.TableComponent;
private formBuilder: azdata.FormBuilder;
private form: azdata.FormContainer;
private installToolsButton: azdata.window.Button;
private toolsLoadingWrapper: azdata.LoadingComponent;
private refreshToolsButton: azdata.window.Button;
private isValid: boolean = false;
private isLoading: boolean = false;
private requiredTools: ToolInfo[];
@@ -31,7 +31,7 @@ export class SelectTargetClusterTypePage extends WizardPageBase<CreateClusterWiz
super(localize('bdc-create.selectTargetClusterTypePageTitle', 'Where do you want to deploy this SQL Server big data cluster?'),
localize('bdc-create.selectTargetClusterTypePageDescription', 'Choose the target environment and then install the required tools.'),
wizard);
this.installToolsButton = sqlops.window.createButton(InstallToolsButtonText);
this.installToolsButton = azdata.window.createButton(InstallToolsButtonText);
this.installToolsButton.hidden = true;
this.installToolsButton.onClick(async () => {
this.wizard.wizardObject.message = null;
@@ -54,7 +54,7 @@ export class SelectTargetClusterTypePage extends WizardPageBase<CreateClusterWiz
});
this.wizard.addButton(this.installToolsButton);
this.refreshToolsButton = sqlops.window.createButton(localize('bdc-create.RefreshToolsButtonText', 'Refresh Status'));
this.refreshToolsButton = azdata.window.createButton(localize('bdc-create.RefreshToolsButtonText', 'Refresh Status'));
this.refreshToolsButton.hidden = true;
this.refreshToolsButton.onClick(() => {
this.updateRequiredToolStatus();
@@ -62,7 +62,7 @@ export class SelectTargetClusterTypePage extends WizardPageBase<CreateClusterWiz
this.wizard.addButton(this.refreshToolsButton);
}
protected initialize(view: sqlops.ModelView): Thenable<void> {
protected initialize(view: azdata.ModelView): Thenable<void> {
let self = this;
self.registerNavigationValidator();
return self.wizard.model.getAllTargetClusterTypeInfo().then((clusterTypes) => {
@@ -74,20 +74,20 @@ export class SelectTargetClusterTypePage extends WizardPageBase<CreateClusterWiz
});
let cardsContainer = view.modelBuilder.flexContainer().withItems(self.cards, { flex: '0 0 auto' }).withLayout({ flexFlow: 'row', alignItems: 'left' }).component();
let toolColumn: sqlops.TableColumn = {
let toolColumn: azdata.TableColumn = {
value: localize('bdc-create.toolNameColumnHeader', 'Tool'),
width: 100
};
let descriptionColumn: sqlops.TableColumn = {
let descriptionColumn: azdata.TableColumn = {
value: localize('bdc-create.toolDescriptionColumnHeader', 'Description'),
width: 200
};
let statusColumn: sqlops.TableColumn = {
let statusColumn: azdata.TableColumn = {
value: localize('bdc-create.toolStatusColumnHeader', 'Status'),
width: 100
};
self.toolsTable = view.modelBuilder.table().withProperties<sqlops.TableComponentProperties>({
self.toolsTable = view.modelBuilder.table().withProperties<azdata.TableComponentProperties>({
height: 150,
data: [],
columns: [toolColumn, descriptionColumn, statusColumn],
@@ -125,7 +125,7 @@ export class SelectTargetClusterTypePage extends WizardPageBase<CreateClusterWiz
this.wizard.wizardObject.registerNavigationValidator(() => {
if (this.isLoading) {
let messageText = localize('bdc-create.ToolsRefreshingText', 'Please wait while the required tools status is being refreshed.');
let messageLevel = sqlops.window.MessageLevel.Information;
let messageLevel = azdata.window.MessageLevel.Information;
this.wizard.wizardObject.message = {
level: messageLevel,
text: messageText
@@ -137,7 +137,7 @@ export class SelectTargetClusterTypePage extends WizardPageBase<CreateClusterWiz
localize('bdc-create.TargetClusterTypeNotSelectedText', 'Please select a target cluster type.') :
localize('bdc-create.MissingToolsText', 'Please install the required tools.');
this.wizard.wizardObject.message = {
level: sqlops.window.MessageLevel.Error,
level: azdata.window.MessageLevel.Error,
text: messageText
};
}
@@ -150,10 +150,10 @@ export class SelectTargetClusterTypePage extends WizardPageBase<CreateClusterWiz
this.refreshToolsButton.hidden = true;
}
private createCard(view: sqlops.ModelView, targetClusterTypeInfo: TargetClusterTypeInfo): sqlops.CardComponent {
private createCard(view: azdata.ModelView, targetClusterTypeInfo: TargetClusterTypeInfo): azdata.CardComponent {
let self = this;
let card = view.modelBuilder.card().withProperties<sqlops.CardProperties>({
cardType: sqlops.CardType.VerticalButton,
let card = view.modelBuilder.card().withProperties<azdata.CardProperties>({
cardType: azdata.CardType.VerticalButton,
iconPath: {
dark: self.wizard.context.asAbsolutePath(targetClusterTypeInfo.iconPath.dark),
light: self.wizard.context.asAbsolutePath(targetClusterTypeInfo.iconPath.light)

View File

@@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
'use strict';
import * as sqlops from 'sqlops';
import * as azdata from 'azdata';
import { WizardPageBase } from '../../wizardPageBase';
import * as nls from 'vscode-nls';
import { ClusterPorts, ContainerRegistryInfo } from '../../../interfaces';
@@ -22,7 +22,7 @@ export class SettingsPage extends WizardPageBase<CreateClusterWizard> {
wizard);
}
protected initialize(view: sqlops.ModelView): Thenable<void> {
protected initialize(view: azdata.ModelView): Thenable<void> {
let clusterPorts: ClusterPorts;
let containerRegistryInfo: ContainerRegistryInfo;
@@ -41,7 +41,7 @@ export class SettingsPage extends WizardPageBase<CreateClusterWizard> {
label: localize('bdc-create.AdminUsernameText', 'Admin username'),
isRequiredField: true,
inputWidth: UserNameInputWidth
}, (inputBox: sqlops.InputBoxComponent) => {
}, (inputBox: azdata.InputBoxComponent) => {
this.wizard.model.adminUserName = inputBox.value;
});
let adminPasswordInput = this.createInputWithLabel(view, {
@@ -49,7 +49,7 @@ export class SettingsPage extends WizardPageBase<CreateClusterWizard> {
isRequiredField: true,
inputType: 'password',
inputWidth: UserNameInputWidth
}, (inputBox: sqlops.InputBoxComponent) => {
}, (inputBox: azdata.InputBoxComponent) => {
this.wizard.model.adminPassword = inputBox.value;
});
@@ -59,7 +59,7 @@ export class SettingsPage extends WizardPageBase<CreateClusterWizard> {
isRequiredField: true,
inputWidth: PortInputWidth,
initialValue: clusterPorts.sql
}, (inputBox: sqlops.InputBoxComponent) => {
}, (inputBox: azdata.InputBoxComponent) => {
this.wizard.model.sqlPort = inputBox.value;
});
let knoxPortInput = this.createInputWithLabel(view, {
@@ -67,7 +67,7 @@ export class SettingsPage extends WizardPageBase<CreateClusterWizard> {
isRequiredField: true,
inputWidth: PortInputWidth,
initialValue: clusterPorts.knox
}, (inputBox: sqlops.InputBoxComponent) => {
}, (inputBox: azdata.InputBoxComponent) => {
this.wizard.model.knoxPort = inputBox.value;
});
let controllerPortInput = this.createInputWithLabel(view, {
@@ -75,7 +75,7 @@ export class SettingsPage extends WizardPageBase<CreateClusterWizard> {
isRequiredField: true,
inputWidth: PortInputWidth,
initialValue: clusterPorts.controller
}, (inputBox: sqlops.InputBoxComponent) => {
}, (inputBox: azdata.InputBoxComponent) => {
this.wizard.model.controllerPort = inputBox.value;
});
let proxyPortInput = this.createInputWithLabel(view, {
@@ -83,7 +83,7 @@ export class SettingsPage extends WizardPageBase<CreateClusterWizard> {
isRequiredField: true,
inputWidth: PortInputWidth,
initialValue: clusterPorts.proxy
}, (inputBox: sqlops.InputBoxComponent) => {
}, (inputBox: azdata.InputBoxComponent) => {
this.wizard.model.proxyPort = inputBox.value;
});
let grafanaPortInput = this.createInputWithLabel(view, {
@@ -91,7 +91,7 @@ export class SettingsPage extends WizardPageBase<CreateClusterWizard> {
isRequiredField: true,
inputWidth: PortInputWidth,
initialValue: clusterPorts.grafana
}, (inputBox: sqlops.InputBoxComponent) => {
}, (inputBox: azdata.InputBoxComponent) => {
this.wizard.model.grafanaPort = inputBox.value;
});
let kibanaPortInput = this.createInputWithLabel(view, {
@@ -99,10 +99,10 @@ export class SettingsPage extends WizardPageBase<CreateClusterWizard> {
isRequiredField: true,
inputWidth: PortInputWidth,
initialValue: clusterPorts.kibana
}, (inputBox: sqlops.InputBoxComponent) => {
}, (inputBox: azdata.InputBoxComponent) => {
this.wizard.model.kibanaPort = inputBox.value;
});
let restorePortSettingsButton = view.modelBuilder.button().withProperties<sqlops.ButtonProperties>({
let restorePortSettingsButton = view.modelBuilder.button().withProperties<azdata.ButtonProperties>({
label: RestoreDefaultValuesText,
width: 200
}).component();
@@ -122,7 +122,7 @@ export class SettingsPage extends WizardPageBase<CreateClusterWizard> {
isRequiredField: true,
inputWidth: UserNameInputWidth,
initialValue: containerRegistryInfo.registry
}, (inputBox: sqlops.InputBoxComponent) => {
}, (inputBox: azdata.InputBoxComponent) => {
this.wizard.model.containerRegistry = inputBox.value;
});
@@ -131,7 +131,7 @@ export class SettingsPage extends WizardPageBase<CreateClusterWizard> {
isRequiredField: true,
inputWidth: UserNameInputWidth,
initialValue: containerRegistryInfo.repository
}, (inputBox: sqlops.InputBoxComponent) => {
}, (inputBox: azdata.InputBoxComponent) => {
this.wizard.model.containerRepository = inputBox.value;
});
@@ -140,7 +140,7 @@ export class SettingsPage extends WizardPageBase<CreateClusterWizard> {
isRequiredField: true,
inputWidth: UserNameInputWidth,
initialValue: containerRegistryInfo.imageTag
}, (inputBox: sqlops.InputBoxComponent) => {
}, (inputBox: azdata.InputBoxComponent) => {
this.wizard.model.containerRegistry = inputBox.value;
});
@@ -149,7 +149,7 @@ export class SettingsPage extends WizardPageBase<CreateClusterWizard> {
isRequiredField: false,
inputWidth: UserNameInputWidth,
placeHolder: registryUserNamePasswordHintText
}, (inputBox: sqlops.InputBoxComponent) => {
}, (inputBox: azdata.InputBoxComponent) => {
this.wizard.model.containerRegistryUserName = inputBox.value;
});
@@ -159,10 +159,10 @@ export class SettingsPage extends WizardPageBase<CreateClusterWizard> {
inputWidth: UserNameInputWidth,
placeHolder: registryUserNamePasswordHintText,
inputType: 'password'
}, (inputBox: sqlops.InputBoxComponent) => {
}, (inputBox: azdata.InputBoxComponent) => {
this.wizard.model.containerRegistryPassword = inputBox.value;
});
let restoreContainerSettingsButton = view.modelBuilder.button().withProperties<sqlops.ButtonProperties>({
let restoreContainerSettingsButton = view.modelBuilder.button().withProperties<azdata.ButtonProperties>({
label: RestoreDefaultValuesText,
width: 200
}).component();
@@ -179,16 +179,16 @@ export class SettingsPage extends WizardPageBase<CreateClusterWizard> {
let acceptEulaCheckbox = view.modelBuilder.checkBox().component();
acceptEulaCheckbox.checked = false;
let eulaLink: sqlops.LinkArea = {
let eulaLink: azdata.LinkArea = {
text: localize('bdc-create.LicenseAgreementText', 'License Agreement'),
url: 'https://docs.microsoft.com/en-us/sql/getting-started/about-the-sql-server-license-terms?view=sql-server-2014'
};
let privacyPolicyLink: sqlops.LinkArea = {
let privacyPolicyLink: azdata.LinkArea = {
text: localize('bdc-create.PrivacyPolicyText', 'Privacy Policy'),
url: 'https://privacy.microsoft.com/en-us/privacystatement'
};
let checkboxText = view.modelBuilder.text().withProperties<sqlops.TextComponentProperties>({
let checkboxText = view.modelBuilder.text().withProperties<azdata.TextComponentProperties>({
value: localize({
key: 'bdc-create.AcceptTermsText',
comment: ['{0} is the place holder for License Agreement, {1} is the place holder for Privacy Policy']
@@ -217,14 +217,14 @@ export class SettingsPage extends WizardPageBase<CreateClusterWizard> {
});
}
private createInputWithLabel(view: sqlops.ModelView, options: {
private createInputWithLabel(view: azdata.ModelView, options: {
label: string,
isRequiredField: boolean,
inputWidth: string,
inputType?: string,
initialValue?: string,
placeHolder?: string
}, textChangedHandler: (inputBox: sqlops.InputBoxComponent) => void): { row: sqlops.FlexContainer, input: sqlops.InputBoxComponent } {
}, textChangedHandler: (inputBox: azdata.InputBoxComponent) => void): { row: azdata.FlexContainer, input: azdata.InputBoxComponent } {
let inputType = !!options.inputType ? options.inputType : 'text';
let input = view.modelBuilder.inputBox().withProperties({
required: options.isRequiredField,
@@ -245,7 +245,7 @@ export class SettingsPage extends WizardPageBase<CreateClusterWizard> {
};
}
private createRow(view: sqlops.ModelView, items: sqlops.Component[]): sqlops.FlexContainer {
private createRow(view: azdata.ModelView, items: azdata.Component[]): azdata.FlexContainer {
return view.modelBuilder.flexContainer().withItems(items, { CSSStyles: { 'margin-right': '5px' } }).withLayout({ flexFlow: 'row', alignItems: 'center' }).component();
}
}

View File

@@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
'use strict';
import * as sqlops from 'sqlops';
import * as azdata from 'azdata';
import { WizardPageBase } from '../../wizardPageBase';
import { CreateClusterWizard } from '../createClusterWizard';
import * as nls from 'vscode-nls';
@@ -16,7 +16,7 @@ export class SummaryPage extends WizardPageBase<CreateClusterWizard> {
super(localize('bdc-create.summaryPageTitle', 'Summary'), '', wizard);
}
protected initialize(view: sqlops.ModelView): Thenable<void> {
protected initialize(view: azdata.ModelView): Thenable<void> {
let formBuilder = view.modelBuilder.formContainer();
let form = formBuilder.component();
return view.initializeModel(form);

View File

@@ -4,14 +4,14 @@
*--------------------------------------------------------------------------------------------*/
'use strict';
import * as sqlops from 'sqlops';
import * as azdata from 'azdata';
import { ExtensionContext } from 'vscode';
import { WizardPageBase } from './wizardPageBase';
export abstract class WizardBase<T,W> {
public wizardObject: sqlops.window.Wizard;
private customButtons: sqlops.window.Button[];
public wizardObject: azdata.window.Wizard;
private customButtons: azdata.window.Button[];
private pages: WizardPageBase<W>[];
constructor(public model: T, public context: ExtensionContext, private title: string) {
@@ -19,7 +19,7 @@ export abstract class WizardBase<T,W> {
}
public open(): Thenable<void> {
this.wizardObject = sqlops.window.createWizard(this.title);
this.wizardObject = azdata.window.createWizard(this.title);
this.initialize();
this.wizardObject.customButtons = this.customButtons;
this.wizardObject.onPageChanged((e) => {
@@ -34,7 +34,7 @@ export abstract class WizardBase<T,W> {
protected abstract initialize(): void;
public addButton(button: sqlops.window.Button) {
public addButton(button: azdata.window.Button) {
this.customButtons.push(button);
}

View File

@@ -4,12 +4,12 @@
*--------------------------------------------------------------------------------------------*/
'use strict';
import * as sqlops from 'sqlops';
import * as azdata from 'azdata';
export abstract class WizardPageBase<T> {
private _page: sqlops.window.WizardPage;
private _page: azdata.window.WizardPage;
public get pageObject(): sqlops.window.WizardPage {
public get pageObject(): azdata.window.WizardPage {
return this._page;
}
@@ -18,14 +18,14 @@ export abstract class WizardPageBase<T> {
}
constructor(title: string, description: string, private _wizard: T) {
this._page = sqlops.window.createWizardPage(title);
this._page = azdata.window.createWizardPage(title);
this._page.description = description;
this._page.registerContent((view: sqlops.ModelView) => {
this._page.registerContent((view: azdata.ModelView) => {
return this.initialize(view);
});
}
protected abstract initialize(view: sqlops.ModelView): Thenable<void>;
protected abstract initialize(view: azdata.ModelView): Thenable<void>;
public onEnter(): void { }