withProperties -> withProps (#15876)

* withProperties -> withProps

* Fix errors

* remove ,

* fixes

* Update azdata-test

* Fix dacpac tests

* Add required and remove added layout
This commit is contained in:
Charles Gagnon
2021-06-23 14:26:14 -07:00
committed by GitHub
parent e21f56d719
commit 3a3d7f5271
73 changed files with 417 additions and 414 deletions

View File

@@ -190,7 +190,7 @@ export class SchemaCompareDialog {
this.view = view;
}
this.sourceTextBox = this.view.modelBuilder.inputBox().withProperties({
this.sourceTextBox = this.view.modelBuilder.inputBox().withProps({
value: this.schemaCompareMainWindow.sourceEndpointInfo ? this.schemaCompareMainWindow.sourceEndpointInfo.packageFilePath : '',
width: this.textBoxWidth,
ariaLabel: loc.sourceFile
@@ -200,7 +200,7 @@ export class SchemaCompareDialog {
this.dialog.okButton.enabled = await this.shouldEnableOkayButton();
});
this.targetTextBox = this.view.modelBuilder.inputBox().withProperties({
this.targetTextBox = this.view.modelBuilder.inputBox().withProps({
value: this.schemaCompareMainWindow.targetEndpointInfo ? this.schemaCompareMainWindow.targetEndpointInfo.packageFilePath : '',
width: this.textBoxWidth,
ariaLabel: loc.targetFile
@@ -286,14 +286,14 @@ export class SchemaCompareDialog {
private createFileBrowser(isTarget: boolean, endpoint: mssql.SchemaCompareEndpointInfo): azdata.FormComponent {
let currentTextbox = isTarget ? this.targetTextBox : this.sourceTextBox;
if (isTarget) {
this.targetFileButton = this.view.modelBuilder.button().withProperties({
this.targetFileButton = this.view.modelBuilder.button().withProps({
label: '•••',
title: loc.selectTargetFile,
ariaLabel: loc.selectTargetFile,
secondary: true
}).component();
} else {
this.sourceFileButton = this.view.modelBuilder.button().withProperties({
this.sourceFileButton = this.view.modelBuilder.button().withProps({
label: '•••',
title: loc.selectSourceFile,
ariaLabel: loc.selectSourceFile,
@@ -338,13 +338,13 @@ export class SchemaCompareDialog {
private createSourceRadioButtons(): azdata.FormComponent {
this.sourceDacpacRadioButton = this.view.modelBuilder.radioButton()
.withProperties({
.withProps({
name: 'source',
label: loc.DacpacRadioButtonLabel
}).component();
this.sourceDatabaseRadioButton = this.view.modelBuilder.radioButton()
.withProperties({
.withProps({
name: 'source',
label: loc.DatabaseRadioButtonLabel
}).component();
@@ -379,7 +379,7 @@ export class SchemaCompareDialog {
let flexRadioButtonsModel = this.view.modelBuilder.flexContainer()
.withLayout({ flexFlow: 'column' })
.withItems([this.sourceDacpacRadioButton, this.sourceDatabaseRadioButton])
.withProperties({ ariaRole: 'radiogroup' })
.withProps({ ariaRole: 'radiogroup' })
.component();
return {
@@ -390,13 +390,13 @@ export class SchemaCompareDialog {
private createTargetRadioButtons(): azdata.FormComponent {
let dacpacRadioButton = this.view.modelBuilder.radioButton()
.withProperties({
.withProps({
name: 'target',
label: loc.DacpacRadioButtonLabel
}).component();
let databaseRadioButton = this.view.modelBuilder.radioButton()
.withProperties({
.withProps({
name: 'target',
label: loc.DatabaseRadioButtonLabel
}).component();
@@ -433,7 +433,7 @@ export class SchemaCompareDialog {
.withLayout({ flexFlow: 'column' })
.withItems([dacpacRadioButton, databaseRadioButton]
)
.withProperties({ ariaRole: 'radiogroup' })
.withProps({ ariaRole: 'radiogroup' })
.component();
return {
@@ -456,7 +456,7 @@ export class SchemaCompareDialog {
}
protected createSourceServerDropdown(): azdata.FormComponent {
this.sourceServerDropdown = this.view.modelBuilder.dropDown().withProperties(
this.sourceServerDropdown = this.view.modelBuilder.dropDown().withProps(
{
editable: true,
fireOnTextChange: true,
@@ -491,7 +491,7 @@ export class SchemaCompareDialog {
}
private createConnectionButton(isTarget: boolean): azdata.ButtonComponent {
const selectConnectionButton = this.view.modelBuilder.button().withProperties({
const selectConnectionButton = this.view.modelBuilder.button().withProps({
ariaLabel: loc.selectConnection,
iconPath: path.join(this.extensionContext.extensionPath, 'media', 'selectConnection.svg'),
height: '20px',
@@ -516,7 +516,7 @@ export class SchemaCompareDialog {
}
protected createTargetServerDropdown(): azdata.FormComponent {
this.targetServerDropdown = this.view.modelBuilder.dropDown().withProperties(
this.targetServerDropdown = this.view.modelBuilder.dropDown().withProps(
{
editable: true,
fireOnTextChange: true,
@@ -651,7 +651,7 @@ export class SchemaCompareDialog {
}
protected createSourceDatabaseDropdown(): azdata.FormComponent {
this.sourceDatabaseDropdown = this.view.modelBuilder.dropDown().withProperties(
this.sourceDatabaseDropdown = this.view.modelBuilder.dropDown().withProps(
{
editable: true,
fireOnTextChange: true,
@@ -671,7 +671,7 @@ export class SchemaCompareDialog {
}
protected createTargetDatabaseDropdown(): azdata.FormComponent {
this.targetDatabaseDropdown = this.view.modelBuilder.dropDown().withProperties(
this.targetDatabaseDropdown = this.view.modelBuilder.dropDown().withProps(
{
editable: true,
fireOnTextChange: true,

View File

@@ -98,7 +98,8 @@ export class SchemaCompareOptionsDialog {
private initializeSchemaCompareOptionsDialogTab(): void {
this.generalOptionsTab.registerContent(async view => {
this.descriptionHeading = view.modelBuilder.table().withProperties({
this.descriptionHeading = view.modelBuilder.table().withProps({
data: [],
columns: [
{
value: 'Option Description',
@@ -108,7 +109,7 @@ export class SchemaCompareOptionsDialog {
]
}).component();
this.descriptionText = view.modelBuilder.text().withProperties({
this.descriptionText = view.modelBuilder.text().withProps({
value: ' '
}).component();

View File

@@ -132,9 +132,10 @@ export class SchemaCompareMainWindow {
this.view = view;
}
this.differencesTable = this.view.modelBuilder.table().withProperties({
this.differencesTable = this.view.modelBuilder.table().withProps({
data: [],
title: loc.differencesTableTitle
title: loc.differencesTableTitle,
columns: []
}).component();
this.diffEditor = this.view.modelBuilder.diffeditor().withProperties({
@@ -146,17 +147,9 @@ export class SchemaCompareMainWindow {
this.splitView = this.view.modelBuilder.splitViewContainer().component();
let sourceTargetLabels = this.view.modelBuilder.flexContainer()
.withProperties({
alignItems: 'stretch',
horizontal: true
}).component();
let sourceTargetLabels = this.view.modelBuilder.flexContainer().component();
this.sourceTargetFlexLayout = this.view.modelBuilder.flexContainer()
.withProperties({
alignItems: 'stretch',
horizontal: true
}).component();
this.sourceTargetFlexLayout = this.view.modelBuilder.flexContainer().component();
this.createSwitchButton();
this.createCompareButton();
@@ -205,17 +198,17 @@ export class SchemaCompareMainWindow {
component: this.saveScmpButton
}]);
let sourceLabel = this.view.modelBuilder.text().withProperties({
let sourceLabel = this.view.modelBuilder.text().withProps({
value: loc.sourceTitle,
CSSStyles: { 'margin-bottom': '0px' }
}).component();
let targetLabel = this.view.modelBuilder.text().withProperties({
let targetLabel = this.view.modelBuilder.text().withProps({
value: loc.targetTitle,
CSSStyles: { 'margin-bottom': '0px' }
}).component();
let arrowLabel = this.view.modelBuilder.text().withProperties({
let arrowLabel = this.view.modelBuilder.text().withProps({
value: '➔'
}).component();
@@ -228,15 +221,15 @@ export class SchemaCompareMainWindow {
this.sourceTargetFlexLayout.addItem(this.selectTargetButton, { CSSStyles: { 'margin-top': '10px' } });
this.loader = this.view.modelBuilder.loadingComponent().component();
this.waitText = this.view.modelBuilder.text().withProperties({
this.waitText = this.view.modelBuilder.text().withProps({
value: loc.waitText
}).component();
this.startText = this.view.modelBuilder.text().withProperties({
this.startText = this.view.modelBuilder.text().withProps({
value: loc.startText
}).component();
this.noDifferencesLabel = this.view.modelBuilder.text().withProperties({
this.noDifferencesLabel = this.view.modelBuilder.text().withProps({
value: loc.noDifferencesText
}).component();
@@ -625,7 +618,7 @@ export class SchemaCompareMainWindow {
}
private createCompareButton(): void {
this.compareButton = this.view.modelBuilder.button().withProperties({
this.compareButton = this.view.modelBuilder.button().withProps({
label: loc.compare,
iconPath: {
light: path.join(this.extensionContext.extensionPath, 'media', 'compare.svg'),
@@ -640,7 +633,7 @@ export class SchemaCompareMainWindow {
}
private createCancelButton(): void {
this.cancelCompareButton = this.view.modelBuilder.button().withProperties({
this.cancelCompareButton = this.view.modelBuilder.button().withProps({
label: loc.stop,
iconPath: {
light: path.join(this.extensionContext.extensionPath, 'media', 'stop.svg'),
@@ -689,7 +682,7 @@ export class SchemaCompareMainWindow {
}
private createGenerateScriptButton(): void {
this.generateScriptButton = this.view.modelBuilder.button().withProperties({
this.generateScriptButton = this.view.modelBuilder.button().withProps({
label: loc.generateScript,
iconPath: {
light: path.join(this.extensionContext.extensionPath, 'media', 'generate-script.svg'),
@@ -725,7 +718,7 @@ export class SchemaCompareMainWindow {
}
private createOptionsButton() {
this.optionsButton = this.view.modelBuilder.button().withProperties({
this.optionsButton = this.view.modelBuilder.button().withProps({
label: loc.options,
iconPath: {
light: path.join(this.extensionContext.extensionPath, 'media', 'options.svg'),
@@ -744,7 +737,7 @@ export class SchemaCompareMainWindow {
private createApplyButton() {
this.applyButton = this.view.modelBuilder.button().withProperties({
this.applyButton = this.view.modelBuilder.button().withProps({
label: loc.apply,
iconPath: {
light: path.join(this.extensionContext.extensionPath, 'media', 'start.svg'),
@@ -855,7 +848,7 @@ export class SchemaCompareMainWindow {
}
private createSwitchButton(): void {
this.switchButton = this.view.modelBuilder.button().withProperties({
this.switchButton = this.view.modelBuilder.button().withProps({
label: loc.switchDirection,
iconPath: {
light: path.join(this.extensionContext.extensionPath, 'media', 'switch-directions.svg'),
@@ -891,7 +884,7 @@ export class SchemaCompareMainWindow {
}
private createSourceAndTargetButtons(): void {
this.selectSourceButton = this.view.modelBuilder.button().withProperties({
this.selectSourceButton = this.view.modelBuilder.button().withProps({
label: '•••',
title: loc.selectSource,
ariaLabel: loc.selectSource,
@@ -905,7 +898,7 @@ export class SchemaCompareMainWindow {
await this.promise;
});
this.selectTargetButton = this.view.modelBuilder.button().withProperties({
this.selectTargetButton = this.view.modelBuilder.button().withProps({
label: '•••',
title: loc.selectTarget,
ariaLabel: loc.selectTarget,
@@ -921,7 +914,7 @@ export class SchemaCompareMainWindow {
}
private createOpenScmpButton() {
this.openScmpButton = this.view.modelBuilder.button().withProperties({
this.openScmpButton = this.view.modelBuilder.button().withProps({
label: loc.openScmp,
iconPath: {
light: path.join(this.extensionContext.extensionPath, 'media', 'open-scmp.svg'),
@@ -1009,7 +1002,7 @@ export class SchemaCompareMainWindow {
}
private createSaveScmpButton(): void {
this.saveScmpButton = this.view.modelBuilder.button().withProperties({
this.saveScmpButton = this.view.modelBuilder.button().withProps({
label: loc.saveScmp,
iconPath: {
light: path.join(this.extensionContext.extensionPath, 'media', 'save-scmp.svg'),