Added SQL MI tile and sub resource types to resource deployment (#14043)

* Made azure arc as resourcesubtype
Added new azure arc resource type
Added support for different eula statement for different subtypes
Consolidated getSelectedOption

* Fixed some PR based comments

* Fixed more pr comments

* Fixed the error in unit test by deep copying extension resourceTypes (to keep the original one intact)

* Fixed property name 'agreement' to 'agreements'

* Cloning subresourceTypes
This commit is contained in:
Aasim Khan
2021-01-27 22:06:53 -08:00
committed by GitHub
parent 8651db1e7e
commit 14cf6add73
9 changed files with 1160 additions and 943 deletions

View File

@@ -164,7 +164,7 @@ export class ToolsAndEulaPage extends ResourceTypePage {
);
return view.initializeModel(this.form!.withLayout({ width: '100%' }).component()).then(() => {
this._agreementContainer.clearItems();
if (this._resourceType.agreement) {
if (this._resourceType.agreements) {
const agreementTitle = this.view.modelBuilder.text().withProps({
value: localize('resourceDeployment.AgreementTitle', "Accept terms of use"),
CSSStyles: {
@@ -173,7 +173,6 @@ export class ToolsAndEulaPage extends ResourceTypePage {
}
}).component();
this._agreementContainer.addItem(agreementTitle);
this._agreementContainer.addItem(this.createAgreementCheckbox(this._resourceType.agreement));
} else {
this.form.removeFormItem({
component: this._agreementContainer
@@ -227,6 +226,9 @@ export class ToolsAndEulaPage extends ResourceTypePage {
});
}
if (this._agreementContainer) {
this._agreementContainer.addItem(this.createAgreementCheckbox());
}
this.updateOkButtonText();
this.updateToolsDisplayTable();
});
@@ -235,7 +237,8 @@ export class ToolsAndEulaPage extends ResourceTypePage {
}
private createAgreementCheckbox(agreementInfo: AgreementInfo): azdata.FlexContainer {
private createAgreementCheckbox(): azdata.FlexContainer {
const agreementInfo = this._resourceType.getAgreementInfo(this.getSelectedOptions())!;
this._agreementCheckBox = this.view.modelBuilder.checkBox().withProperties<azdata.CheckBoxProperties>({
ariaLabel: this.getAgreementDisplayText(agreementInfo),
required: true
@@ -275,26 +278,24 @@ export class ToolsAndEulaPage extends ResourceTypePage {
}
private getCurrentProvider(): DeploymentProvider {
const options: { option: string, value: string }[] = [];
this._optionDropDownMap.forEach((selectBox, option) => {
let selectedValue: azdata.CategoryValue = selectBox.value as azdata.CategoryValue;
options.push({ option: option, value: selectedValue.name });
});
const options = this.getSelectedOptions();
this.resourceProvider = this._resourceType.getProvider(options)!;
return this._resourceType.getProvider(options)!;
}
private getCurrentOkText(): string {
const options: { option: string, value: string }[] = [];
return this._resourceType.getOkButtonText(this.getSelectedOptions())!;
}
private getSelectedOptions(): { option: string, value: string }[] {
const options: { option: string, value: string }[] = [];
this._optionDropDownMap.forEach((selectBox, option) => {
let selectedValue: azdata.CategoryValue = selectBox.value as azdata.CategoryValue;
options.push({ option: option, value: selectedValue.name });
});
return this._resourceType.getOkButtonText(options)!;
return options;
}
private updateOkButtonText(): void {