mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
Added fix for the infinite page refresh in resource Deployment tools page (#13813)
* Added fixed for the infinite loop in resource Deployment tools page Generating events for select boxes only when the select box value is changed. * Fixed the check logic in select method * Reverted to old code and fixed some bugs * Fixed event generation check logic
This commit is contained in:
@@ -198,19 +198,22 @@ export class ToolsAndEulaPage extends ResourceTypePage {
|
|||||||
}).component();
|
}).component();
|
||||||
optionLabel.width = '150px';
|
optionLabel.width = '150px';
|
||||||
|
|
||||||
|
const optionSelectedValue = (this.wizard.toolsEulaPagePresets) ? this.wizard.toolsEulaPagePresets[index] : option.values[0];
|
||||||
const optionSelectBox = this.view.modelBuilder.dropDown().withProperties<azdata.DropDownProperties>({
|
const optionSelectBox = this.view.modelBuilder.dropDown().withProperties<azdata.DropDownProperties>({
|
||||||
values: option.values,
|
values: option.values,
|
||||||
value: (this.wizard.toolsEulaPagePresets) ? this.wizard.toolsEulaPagePresets[index] : option.values[0],
|
value: optionSelectedValue,
|
||||||
width: '300px',
|
width: '300px',
|
||||||
ariaLabel: option.displayName
|
ariaLabel: option.displayName
|
||||||
}).component();
|
}).component();
|
||||||
|
|
||||||
resourceTypeOptions.push(option.values[0]);
|
resourceTypeOptions.push(optionSelectedValue);
|
||||||
|
|
||||||
this.wizard.registerDisposable(optionSelectBox.onValueChanged(async () => {
|
this.wizard.registerDisposable(optionSelectBox.onValueChanged(async () => {
|
||||||
|
if (resourceTypeOptions[index].name !== (<ResourceTypeOptionValue>optionSelectBox.value).name) {
|
||||||
resourceTypeOptions[index] = <ResourceTypeOptionValue>optionSelectBox.value;
|
resourceTypeOptions[index] = <ResourceTypeOptionValue>optionSelectBox.value;
|
||||||
this.wizard.provider = this.getCurrentProvider();
|
this.wizard.provider = this.getCurrentProvider();
|
||||||
await this.wizard.open();
|
await this.wizard.open();
|
||||||
|
}
|
||||||
}));
|
}));
|
||||||
|
|
||||||
this._optionDropDownMap.set(option.name, optionSelectBox);
|
this._optionDropDownMap.set(option.name, optionSelectBox);
|
||||||
|
|||||||
@@ -197,6 +197,10 @@ export class SelectBox extends vsSelectBox {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public select(index: number): void {
|
public select(index: number): void {
|
||||||
|
let selectedOptionIndex = this._optionsDictionary.get(this._selectedOption);
|
||||||
|
if (selectedOptionIndex === index) { // Not generating an event if the same value is selected.
|
||||||
|
return;
|
||||||
|
}
|
||||||
super.select(index);
|
super.select(index);
|
||||||
if (this._dialogOptions !== undefined) {
|
if (this._dialogOptions !== undefined) {
|
||||||
this._selectedOption = this._dialogOptions[index]?.value;
|
this._selectedOption = this._dialogOptions[index]?.value;
|
||||||
|
|||||||
Reference in New Issue
Block a user