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

@@ -107,7 +107,7 @@ export class AddDatabaseReferenceDialog {
this.dacpacFormComponent = this.createDacpacTextbox();
const locationDropdown = this.createLocationDropdown();
const variableSection = this.createVariableSection();
this.suppressMissingDependenciesErrorsCheckbox = view.modelBuilder.checkBox().withProperties({
this.suppressMissingDependenciesErrorsCheckbox = view.modelBuilder.checkBox().withProps({
label: constants.suppressMissingDependenciesErrors
}).component();
const exampleUsage = this.createExampleUsage();
@@ -190,7 +190,7 @@ export class AddDatabaseReferenceDialog {
private createRadioButtons(): azdataType.FormComponent {
this.projectRadioButton = this.view!.modelBuilder.radioButton()
.withProperties({
.withProps({
name: 'referenceType',
label: constants.projectRadioButtonTitle
}).component();
@@ -200,7 +200,7 @@ export class AddDatabaseReferenceDialog {
});
this.systemDatabaseRadioButton = this.view!.modelBuilder.radioButton()
.withProperties({
.withProps({
name: 'referenceType',
label: constants.systemDatabaseRadioButtonTitle
}).component();
@@ -210,7 +210,7 @@ export class AddDatabaseReferenceDialog {
});
const dacpacRadioButton = this.view!.modelBuilder.radioButton()
.withProperties({
.withProps({
name: 'referenceType',
label: constants.dacpacText
}).component();
@@ -233,7 +233,7 @@ export class AddDatabaseReferenceDialog {
let flexRadioButtonsModel: azdataType.FlexContainer = this.view!.modelBuilder.flexContainer()
.withLayout({ flexFlow: 'column' })
.withItems([this.projectRadioButton, this.systemDatabaseRadioButton, dacpacRadioButton])
.withProperties({ ariaRole: 'radiogroup' })
.withProps({ ariaRole: 'radiogroup' })
.component();
return {
@@ -284,7 +284,7 @@ export class AddDatabaseReferenceDialog {
}
private async createProjectDropdown(): Promise<azdataType.FormComponent> {
this.projectDropdown = this.view!.modelBuilder.dropDown().withProperties({
this.projectDropdown = this.view!.modelBuilder.dropDown().withProps({
ariaLabel: constants.databaseProject
}).component();
@@ -306,7 +306,7 @@ export class AddDatabaseReferenceDialog {
}
private createSystemDatabaseDropdown(): azdataType.FormComponent {
this.systemDatabaseDropdown = this.view!.modelBuilder.dropDown().withProperties({
this.systemDatabaseDropdown = this.view!.modelBuilder.dropDown().withProps({
values: [constants.master, constants.msdb],
ariaLabel: constants.databaseNameLabel
}).component();
@@ -327,7 +327,7 @@ export class AddDatabaseReferenceDialog {
}
private createDacpacTextbox(): azdataType.FormComponent {
this.dacpacTextbox = this.view!.modelBuilder.inputBox().withProperties({
this.dacpacTextbox = this.view!.modelBuilder.inputBox().withProps({
ariaLabel: constants.dacpacText,
placeHolder: constants.dacpacPlaceholder,
width: '400px'
@@ -350,7 +350,7 @@ export class AddDatabaseReferenceDialog {
}
private createLoadDacpacButton(): azdataType.ButtonComponent {
const loadDacpacButton = this.view!.modelBuilder.button().withProperties({
const loadDacpacButton = this.view!.modelBuilder.button().withProps({
ariaLabel: constants.loadDacpacButton,
iconPath: IconPathHelper.folder_blue,
height: '18px',
@@ -382,7 +382,7 @@ export class AddDatabaseReferenceDialog {
}
private createLocationDropdown(): azdataType.FormComponent {
this.locationDropdown = this.view!.modelBuilder.dropDown().withProperties({
this.locationDropdown = this.view!.modelBuilder.dropDown().withProps({
ariaLabel: constants.locationDropdown,
values: this.currentReferenceType === ReferenceType.systemDb ? constants.systemDbLocationDropdownValues : constants.locationDropdownValues
}).component();
@@ -486,7 +486,7 @@ export class AddDatabaseReferenceDialog {
this.serverVariableTextbox = this.createInputBox(constants.serverVariable, false, true);
const serverVariableRow = this.view!.modelBuilder.flexContainer().withItems([this.createLabel(constants.serverVariable, true), this.serverVariableTextbox], { flex: '0 0 auto' }).withLayout({ flexFlow: 'row', alignItems: 'center' }).component();
const variableSection = this.view!.modelBuilder.flexContainer().withItems([databaseNameRow, databaseVariableRow, serverNameRow, serverVariableRow]).withLayout({ flexFlow: 'column' }).withProperties({ CSSStyles: { 'margin-bottom': '25px' } }).component();
const variableSection = this.view!.modelBuilder.flexContainer().withItems([databaseNameRow, databaseVariableRow, serverNameRow, serverVariableRow]).withLayout({ flexFlow: 'column' }).withProps({ CSSStyles: { 'margin-bottom': '25px' } }).component();
this.setDefaultDatabaseValues();
return {
@@ -506,7 +506,7 @@ export class AddDatabaseReferenceDialog {
}
private createInputBox(ariaLabel: string, enabled: boolean, required: boolean): azdataType.InputBoxComponent {
const inputBox = this.view!.modelBuilder.inputBox().withProperties({
const inputBox = this.view!.modelBuilder.inputBox().withProps({
ariaLabel: ariaLabel,
enabled: enabled,
width: cssStyles.addDatabaseReferenceInputboxWidth,
@@ -522,7 +522,7 @@ export class AddDatabaseReferenceDialog {
}
private createExampleUsage(): azdataType.FormComponent {
this.exampleUsage = this.view!.modelBuilder.text().withProperties({
this.exampleUsage = this.view!.modelBuilder.text().withProps({
value: this.currentReferenceType === ReferenceType.project ? constants.databaseNameRequiredVariableOptional : constants.systemDatabaseReferenceRequired,
CSSStyles: { 'user-select': 'text' }
}).component();

View File

@@ -158,7 +158,7 @@ export class CreateProjectFromDatabaseDialog {
}
private createDatabaseRow(view: azdataType.ModelView): azdataType.FlexContainer {
this.sourceDatabaseDropDown = view.modelBuilder.dropDown().withProperties({
this.sourceDatabaseDropDown = view.modelBuilder.dropDown().withProps({
ariaLabel: constants.databaseNameLabel,
required: true,
width: cssStyles.createProjectFromDatabaseTextboxWidth
@@ -186,7 +186,7 @@ export class CreateProjectFromDatabaseDialog {
}
private createSourceConnectionComponent(view: azdataType.ModelView): azdataType.InputBoxComponent {
this.sourceConnectionTextBox = view.modelBuilder.inputBox().withProperties({
this.sourceConnectionTextBox = view.modelBuilder.inputBox().withProps({
value: '',
placeHolder: constants.selectConnection,
width: cssStyles.createProjectFromDatabaseTextboxWidth,
@@ -201,7 +201,7 @@ export class CreateProjectFromDatabaseDialog {
}
private createSelectConnectionButton(view: azdataType.ModelView): azdataType.Component {
this.selectConnectionButton = view.modelBuilder.button().withProperties({
this.selectConnectionButton = view.modelBuilder.button().withProps({
ariaLabel: constants.selectConnection,
iconPath: IconPathHelper.selectConnection,
height: '16px',
@@ -282,7 +282,7 @@ export class CreateProjectFromDatabaseDialog {
private createProjectLocationRow(view: azdataType.ModelView): azdataType.FlexContainer {
const browseFolderButton: azdataType.Component = this.createBrowseFolderButton(view);
this.projectLocationTextBox = view.modelBuilder.inputBox().withProperties({
this.projectLocationTextBox = view.modelBuilder.inputBox().withProps({
value: '',
ariaLabel: constants.projectLocationLabel,
placeHolder: constants.projectLocationPlaceholderText,
@@ -336,7 +336,7 @@ export class CreateProjectFromDatabaseDialog {
}
private createFolderStructureRow(view: azdataType.ModelView): azdataType.FlexContainer {
this.folderStructureDropDown = view.modelBuilder.dropDown().withProperties({
this.folderStructureDropDown = view.modelBuilder.dropDown().withProps({
values: [constants.file, constants.flat, constants.objectType, constants.schema, constants.schemaObjectType],
value: constants.schemaObjectType,
ariaLabel: constants.folderStructureLabel,
@@ -367,7 +367,7 @@ export class CreateProjectFromDatabaseDialog {
private createWorkspaceContainerRow(view: azdataType.ModelView): azdataType.FlexContainer {
const initialWorkspaceInputBoxValue = !!vscode.workspace.workspaceFile && !isCurrentWorkspaceUntitled() ? vscode.workspace.workspaceFile.fsPath : '';
this.workspaceInputBox = view.modelBuilder.inputBox().withProperties({
this.workspaceInputBox = view.modelBuilder.inputBox().withProps({
ariaLabel: constants.workspaceLocationTitle,
enabled: !vscode.workspace.workspaceFile || isCurrentWorkspaceUntitled(), // want it editable if no saved workspace is open
value: initialWorkspaceInputBoxValue,

View File

@@ -258,7 +258,7 @@ export class PublishDatabaseDialog {
private createRadioButtons(view: azdataType.ModelView): azdataType.Component {
this.connectionsRadioButton = view.modelBuilder.radioButton()
.withProperties({
.withProps({
name: 'connection',
label: constants.connectionRadioButtonLabel
}).component();
@@ -273,7 +273,7 @@ export class PublishDatabaseDialog {
});
this.dataSourcesRadioButton = view.modelBuilder.radioButton()
.withProperties({
.withProps({
name: 'connection',
label: constants.dataSourceRadioButtonLabel
}).component();
@@ -290,14 +290,14 @@ export class PublishDatabaseDialog {
let flexRadioButtonsModel: azdataType.FlexContainer = view.modelBuilder.flexContainer()
.withLayout({ flexFlow: 'column' })
.withItems([this.connectionsRadioButton, this.dataSourcesRadioButton])
.withProperties({ ariaRole: 'radiogroup' })
.withProps({ ariaRole: 'radiogroup' })
.component();
return flexRadioButtonsModel;
}
private createTargetConnectionComponent(view: azdataType.ModelView): azdataType.InputBoxComponent {
this.targetConnectionTextBox = view.modelBuilder.inputBox().withProperties({
this.targetConnectionTextBox = view.modelBuilder.inputBox().withProps({
value: '',
ariaLabel: constants.targetConnectionLabel,
placeHolder: constants.selectConnection,
@@ -316,7 +316,7 @@ export class PublishDatabaseDialog {
if (this.project.dataSources.length > 0) {
return this.createDataSourcesDropdown(view);
} else {
const noDataSourcesText = view.modelBuilder.text().withProperties({ value: constants.noDataSourcesText }).component();
const noDataSourcesText = view.modelBuilder.text().withProps({ value: constants.noDataSourcesText }).component();
return {
title: constants.dataSourceDropdownTitle,
component: noDataSourcesText
@@ -338,7 +338,7 @@ export class PublishDatabaseDialog {
});
});
this.dataSourcesDropDown = view.modelBuilder.dropDown().withProperties({
this.dataSourcesDropDown = view.modelBuilder.dropDown().withProps({
values: dataSourcesValues,
}).component();
@@ -362,7 +362,7 @@ export class PublishDatabaseDialog {
private createProfileRow(view: azdataType.ModelView): azdataType.FlexContainer {
const loadProfileButton = this.createLoadProfileButton(view);
this.loadProfileTextBox = view.modelBuilder.inputBox().withProperties({
this.loadProfileTextBox = view.modelBuilder.inputBox().withProps({
placeHolder: constants.loadProfilePlaceholderText,
ariaLabel: constants.profile,
width: cssStyles.publishDialogTextboxWidth
@@ -396,7 +396,7 @@ export class PublishDatabaseDialog {
}
private createDatabaseRow(view: azdataType.ModelView): azdataType.FlexContainer {
this.targetDatabaseDropDown = view.modelBuilder.dropDown().withProperties({
this.targetDatabaseDropDown = view.modelBuilder.dropDown().withProps({
values: [this.getDefaultDatabaseName()],
value: this.getDefaultDatabaseName(),
ariaLabel: constants.databaseNameLabel,
@@ -460,7 +460,7 @@ export class PublishDatabaseDialog {
}
private createLoadSqlCmdVarsButton(view: azdataType.ModelView): azdataType.ButtonComponent {
let loadSqlCmdVarsButton: azdataType.ButtonComponent = view.modelBuilder.button().withProperties({
let loadSqlCmdVarsButton: azdataType.ButtonComponent = view.modelBuilder.button().withProps({
label: constants.loadSqlCmdVarsButtonTitle,
title: constants.loadSqlCmdVarsButtonTitle,
ariaLabel: constants.loadSqlCmdVarsButtonTitle,
@@ -485,7 +485,7 @@ export class PublishDatabaseDialog {
}
private createSelectConnectionButton(view: azdataType.ModelView): azdataType.Component {
let selectConnectionButton: azdataType.ButtonComponent = view.modelBuilder.button().withProperties({
let selectConnectionButton: azdataType.ButtonComponent = view.modelBuilder.button().withProps({
ariaLabel: constants.selectConnection,
iconPath: IconPathHelper.selectConnection,
height: '16px',
@@ -528,7 +528,7 @@ export class PublishDatabaseDialog {
}
private createLoadProfileButton(view: azdataType.ModelView): azdataType.ButtonComponent {
let loadProfileButton: azdataType.ButtonComponent = view.modelBuilder.button().withProperties({
let loadProfileButton: azdataType.ButtonComponent = view.modelBuilder.button().withProps({
ariaLabel: constants.loadProfilePlaceholderText,
iconPath: IconPathHelper.folder_blue,
height: '18px',