mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user