Switch withProperties to be withProps (#16380)

* Transition to withProps in arc

* Transition to withProps inputbox

* Transition to withProps in checkbox

* Transition to withProps text

* Transition to withProps in declarative table

* Transition to withProps hyperlink

* Transition to withProps in button

* Transition to withProps radiobutton

* Transition to withProps in input

* Transition to withProps button

* Transition to withProps in text

* Transition to withProps image

* Transition to withProps declare table

* Transition to withProps in table

* Transition to withProps radio button

* Transition to withProps in image

* Transition to withProps radio button

* Transition to withProps in commit

* Transition to withProps div cont

* Transition to withProps in comp

* Transition to withProps radio card

* Transition to withProps in comp icon

* Transition to withProps card

* Transition to withProps list
This commit is contained in:
nasc17
2021-07-21 11:12:47 -07:00
committed by GitHub
parent b2a2a48ed6
commit b472539646
70 changed files with 274 additions and 274 deletions

View File

@@ -98,7 +98,7 @@ export class OpenExistingDialog extends DialogBase {
}
protected async initialize(view: azdataType.ModelView): Promise<void> {
this.localRadioButton = view.modelBuilder.radioButton().withProperties<azdataType.RadioButtonProperties>({
this.localRadioButton = view.modelBuilder.radioButton().withProps({
name: 'location',
label: constants.Local,
checked: true
@@ -112,7 +112,7 @@ export class OpenExistingDialog extends DialogBase {
}
}));
this.remoteGitRepoRadioButton = view.modelBuilder.radioButton().withProperties<azdataType.RadioButtonProperties>({
this.remoteGitRepoRadioButton = view.modelBuilder.radioButton().withProps({
name: 'location',
label: constants.RemoteGitRepo
}).component();
@@ -134,7 +134,7 @@ export class OpenExistingDialog extends DialogBase {
}
}));
const gitRepoTextBox = view.modelBuilder.inputBox().withProperties<azdataType.InputBoxProperties>({
const gitRepoTextBox = view.modelBuilder.inputBox().withProps({
ariaLabel: constants.GitRepoUrlTitle,
placeHolder: constants.GitRepoUrlPlaceholder,
required: true,
@@ -150,7 +150,7 @@ export class OpenExistingDialog extends DialogBase {
component: gitRepoTextBox
};
this.localClonePathTextBox = view.modelBuilder.inputBox().withProperties<azdataType.InputBoxProperties>({
this.localClonePathTextBox = view.modelBuilder.inputBox().withProps({
ariaLabel: constants.LocalClonePathTitle,
placeHolder: constants.LocalClonePathPlaceholder,
required: true,
@@ -161,7 +161,7 @@ export class OpenExistingDialog extends DialogBase {
this.localClonePathTextBox!.updateProperty('title', this.localClonePathTextBox!.value!);
}));
const localClonePathBrowseFolderButton = view.modelBuilder.button().withProperties<azdataType.ButtonProperties>({
const localClonePathBrowseFolderButton = view.modelBuilder.button().withProps({
ariaLabel: constants.BrowseButtonText,
iconPath: IconPathHelper.folder,
width: '18px',
@@ -190,7 +190,7 @@ export class OpenExistingDialog extends DialogBase {
required: true
};
this.filePathTextBox = view.modelBuilder.inputBox().withProperties<azdataType.InputBoxProperties>({
this.filePathTextBox = view.modelBuilder.inputBox().withProps({
ariaLabel: constants.LocationSelectorTitle,
placeHolder: constants.ProjectFilePlaceholder,
required: true,
@@ -201,7 +201,7 @@ export class OpenExistingDialog extends DialogBase {
this.filePathTextBox!.updateProperty('title', this.filePathTextBox!.value!);
}));
const localProjectBrowseFolderButton = view.modelBuilder.button().withProperties<azdataType.ButtonProperties>({
const localProjectBrowseFolderButton = view.modelBuilder.button().withProps({
ariaLabel: constants.BrowseButtonText,
iconPath: IconPathHelper.folder,
width: '18px',

View File

@@ -84,7 +84,7 @@ export class ProjectDashboard {
});
const refreshButton = this.modelView!.modelBuilder.button()
.withProperties<azdataType.ButtonProperties>({
.withProps({
label: constants.Refresh,
iconPath: IconPathHelper.refresh,
height: '20px'
@@ -110,7 +110,7 @@ export class ProjectDashboard {
private createButton(projectAction: IProjectAction): azdataType.ButtonComponent {
let button = this.modelView!.modelBuilder.button()
.withProperties<azdataType.ButtonProperties>({
.withProps({
label: projectAction.id,
iconPath: projectAction.icon,
height: '20px'
@@ -159,13 +159,13 @@ export class ProjectDashboard {
}).component();
const titleLabel = this.modelView!.modelBuilder.text()
.withProperties<azdataType.TextComponentProperties>({ value: title, CSSStyles: { 'margin-block-start': '20px', 'margin-block-end': '0px' } })
.withProps({ value: title, CSSStyles: { 'margin-block-start': '20px', 'margin-block-end': '0px' } })
.component();
header.addItem(titleLabel, { CSSStyles: { 'padding-left': '34px', 'padding-top': '15px', 'font-size': '36px', 'font-weight': '400' } });
const projectFolderPath = path.dirname(location);
const locationLabel = this.modelView!.modelBuilder.text()
.withProperties<azdataType.TextComponentProperties>({ value: projectFolderPath, CSSStyles: { 'margin-block-start': '20px', 'margin-block-end': '0px' } })
.withProps({ value: projectFolderPath, CSSStyles: { 'margin-block-start': '20px', 'margin-block-end': '0px' } })
.component();
header.addItem(locationLabel, { CSSStyles: { 'padding-left': '34px', 'padding-top': '15px', 'padding-bottom': '50px', 'font-size': '16px' } });
@@ -200,14 +200,14 @@ export class ProjectDashboard {
dashboardData.forEach(info => {
const tableNameLabel = this.modelView!.modelBuilder.text()
.withProperties<azdataType.TextComponentProperties>({ value: info.name, CSSStyles: { 'margin-block-start': '30px', 'margin-block-end': '0px' } })
.withProps({ value: info.name, CSSStyles: { 'margin-block-start': '30px', 'margin-block-end': '0px' } })
.component();
tableContainer.addItem(tableNameLabel, { CSSStyles: { 'padding-left': '25px', 'padding-bottom': '20px', ...constants.cssStyles.title } });
if (info.data.length === 0) {
const noDataText = constants.noPreviousData(info.name.toLocaleLowerCase());
const noDataLabel = this.modelView!.modelBuilder.text()
.withProperties<azdataType.TextComponentProperties>({ value: noDataText })
.withProps({ value: noDataText })
.component();
tableContainer.addItem(noDataLabel, { CSSStyles: { 'padding-left': '25px', 'padding-bottom': '20px' } });
} else {
@@ -236,14 +236,14 @@ export class ProjectDashboard {
if (typeof val === 'string') {
columnValue.push({ value: val });
} else {
const iconComponent = this.modelView!.modelBuilder.image().withProperties<azdataType.ImageComponentProperties>({
const iconComponent = this.modelView!.modelBuilder.image().withProps({
iconPath: val.icon,
width: '15px',
height: '15px',
iconHeight: '15px',
iconWidth: '15px'
}).component();
const stringComponent = this.modelView!.modelBuilder.text().withProperties<azdataType.TextComponentProperties>({
const stringComponent = this.modelView!.modelBuilder.text().withProps({
value: val.text,
CSSStyles: { 'margin-block-start': 'auto', 'block-size': 'auto', 'margin-block-end': '0px' }
}).component();
@@ -256,7 +256,7 @@ export class ProjectDashboard {
});
const table = this.modelView!.modelBuilder.declarativeTable()
.withProperties<azdataType.DeclarativeTableProperties>({ columns: columns, dataValues: data, ariaLabel: info.name, CSSStyles: { 'margin-left': '30px' } }).component();
.withProps({ columns: columns, dataValues: data, ariaLabel: info.name, CSSStyles: { 'margin-left': '30px' } }).component();
tableContainer.addItem(table);
}