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

@@ -138,8 +138,8 @@ export function createViewContext(): ViewTestContext {
let button = radioButton();
let builder: azdata.ComponentBuilder<azdata.RadioButtonComponent, azdata.RadioButtonProperties> = {
component: () => button,
withProps: () => undefined,
withProperties: (properties) => {
withProperties: () => undefined,
withProps: (properties) => {
switch ((properties as any).label) {
case loc.newDatabase:
button.label = loc.newDatabase;

View File

@@ -33,7 +33,7 @@ export abstract class DacFxConfigPage extends BasePage {
protected async createServerDropdown(isTargetServer: boolean): Promise<azdata.FormComponent> {
const serverDropDownTitle = isTargetServer ? loc.targetServer : loc.sourceServer;
this.serverDropdown = this.view.modelBuilder.dropDown().withProperties({
this.serverDropdown = this.view.modelBuilder.dropDown().withProps({
required: true,
ariaLabel: serverDropDownTitle
}).component();
@@ -79,7 +79,7 @@ export abstract class DacFxConfigPage extends BasePage {
protected async createDatabaseTextBox(title: string): Promise<azdata.FormComponent> {
this.databaseTextBox = this.view.modelBuilder.inputBox()
.withValidation(component => !this.databaseNameExists(component.value))
.withProperties({
.withProps({
required: true,
validationErrorMessage: loc.databaseNameExistsErrorMessage
}).component();
@@ -97,7 +97,7 @@ export abstract class DacFxConfigPage extends BasePage {
protected async createDatabaseDropdown(): Promise<azdata.FormComponent> {
const databaseDropdownTitle = loc.sourceDatabase;
this.databaseDropdown = this.view.modelBuilder.dropDown().withProperties({
this.databaseDropdown = this.view.modelBuilder.dropDown().withProps({
required: true,
ariaLabel: databaseDropdownTitle
}).component();
@@ -114,13 +114,12 @@ export abstract class DacFxConfigPage extends BasePage {
this.model.filePath = this.fileTextBox.value;
});
this.databaseLoader = this.view.modelBuilder.loadingComponent().withItem(this.databaseDropdown).withProperties({
required: true
}).component();
this.databaseLoader = this.view.modelBuilder.loadingComponent().withItem(this.databaseDropdown).component();
return {
component: this.databaseLoader,
title: databaseDropdownTitle
title: databaseDropdownTitle,
required: true
};
}
@@ -167,7 +166,7 @@ export abstract class DacFxConfigPage extends BasePage {
this.fileTextBox = this.view.modelBuilder.inputBox().withValidation(
component => isValidBasename(component.value)
)
.withProperties({
.withProps({
required: true,
ariaLive: 'polite'
}).component();

View File

@@ -20,8 +20,10 @@ export class DacFxSummaryPage extends BasePage {
}
async start(): Promise<boolean> {
this.table = this.view.modelBuilder.table().withProperties({
title: loc.summaryTableTitle
this.table = this.view.modelBuilder.table().withProps({
title: loc.summaryTableTitle,
data: [],
columns: []
}).component();
this.loader = this.view.modelBuilder.loadingComponent().withItem(this.table).component();
this.form = this.view.modelBuilder.formContainer().withFormItems(

View File

@@ -101,13 +101,13 @@ export class DeployConfigPage extends DacFxConfigPage {
private createRadiobuttons(): azdata.FormComponent {
let upgradeRadioButton = this.view.modelBuilder.radioButton()
.withProperties({
.withProps({
name: 'updateExistingOrCreateNew',
label: loc.upgradeExistingDatabase,
}).component();
let newRadioButton = this.view.modelBuilder.radioButton()
.withProperties({
.withProps({
name: 'updateExistingOrCreateNew',
label: loc.newDatabase,
}).component();
@@ -136,7 +136,7 @@ export class DeployConfigPage extends DacFxConfigPage {
protected async createDeployDatabaseDropdown(): Promise<azdata.FormComponent> {
const targetDatabaseTitle = loc.databaseName;
this.databaseDropdown = this.view.modelBuilder.dropDown().withProperties({
this.databaseDropdown = this.view.modelBuilder.dropDown().withProps({
ariaLabel: targetDatabaseTitle
}).component();
@@ -150,13 +150,12 @@ export class DeployConfigPage extends DacFxConfigPage {
this.model.database = databaseDropdownValue;
});
this.databaseLoader = this.view.modelBuilder.loadingComponent().withItem(this.databaseDropdown).withProperties({
required: true
}).component();
this.databaseLoader = this.view.modelBuilder.loadingComponent().withItem(this.databaseDropdown).component();
return {
component: this.databaseLoader,
title: targetDatabaseTitle
title: targetDatabaseTitle,
required: true
};
}

View File

@@ -48,8 +48,10 @@ export class DeployPlanPage extends DacFxConfigPage {
}
async start(): Promise<boolean> {
this.table = this.view.modelBuilder.table().withProperties({
ariaLabel: loc.deployPlanTableTitle
this.table = this.view.modelBuilder.table().withProps({
ariaLabel: loc.deployPlanTableTitle,
data: [],
columns: []
}).component();
this.loader = this.view.modelBuilder.loadingComponent().withItem(this.table).component();
this.dataLossComponentGroup = await this.createDataLossComponents();
@@ -117,7 +119,7 @@ export class DeployPlanPage extends DacFxConfigPage {
private async createDataLossCheckbox(): Promise<azdata.FormComponent> {
this.dataLossCheckbox = this.view.modelBuilder.checkBox()
.withValidation(component => component.checked === true)
.withProperties({
.withProps({
label: loc.proceedDataLossMessage,
}).component();
@@ -130,7 +132,7 @@ export class DeployPlanPage extends DacFxConfigPage {
private async createNoDataLossText(): Promise<azdata.FormComponent> {
let noDataLossText = this.view.modelBuilder.text()
.withProperties({
.withProps({
value: loc.noDataLossMessage
}).component();
@@ -143,7 +145,7 @@ export class DeployPlanPage extends DacFxConfigPage {
private async createDataLossComponents(): Promise<azdata.FormComponentGroup> {
let dataLossComponent = await this.createDataLossCheckbox();
this.dataLossText = this.view.modelBuilder.text()
.withProperties({
.withProps({
value: loc.dataLossMessage
}).component();

View File

@@ -98,7 +98,7 @@ export class ExtractConfigPage extends DacFxConfigPage {
}
private async createVersionTextBox(): Promise<azdata.FormComponent> {
this.versionTextBox = this.view.modelBuilder.inputBox().withProperties({
this.versionTextBox = this.view.modelBuilder.inputBox().withProps({
required: true,
ariaLabel: loc.version
}).component();

View File

@@ -49,7 +49,7 @@ export class SelectOperationPage extends BasePage {
private async createDeployRadioButton(): Promise<azdata.FormComponent> {
this.deployRadioButton = this.view.modelBuilder.radioButton()
.withProperties({
.withProps({
name: 'selectedOperation',
label: loc.deployDescription,
checked: true // Default to first radio button being selected
@@ -77,7 +77,7 @@ export class SelectOperationPage extends BasePage {
private async createExtractRadioButton(): Promise<azdata.FormComponent> {
this.extractRadioButton = this.view.modelBuilder.radioButton()
.withProperties({
.withProps({
name: 'selectedOperation',
label: loc.extractDescription,
}).component();
@@ -102,7 +102,7 @@ export class SelectOperationPage extends BasePage {
private async createImportRadioButton(): Promise<azdata.FormComponent> {
this.importRadioButton = this.view.modelBuilder.radioButton()
.withProperties({
.withProps({
name: 'selectedOperation',
label: loc.importDescription,
}).component();
@@ -127,7 +127,7 @@ export class SelectOperationPage extends BasePage {
private async createExportRadioButton(): Promise<azdata.FormComponent> {
this.exportRadioButton = this.view.modelBuilder.radioButton()
.withProperties({
.withProps({
name: 'selectedOperation',
label: loc.exportDescription,
}).component();