mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-28 17:23:19 -05:00
Fix filtered resource options persisting across deployments (#14702)
This commit is contained in:
@@ -21,6 +21,7 @@ import { DeployAzureSQLDBWizardModel } from './deployAzureSQLDBWizard/deployAzur
|
||||
import { ToolsAndEulaPage } from './toolsAndEulaSettingsPage';
|
||||
import { OptionValuesFilter, ResourceTypeService } from '../services/resourceTypeService';
|
||||
import { PageLessDeploymentModel } from './pageLessDeploymentModel';
|
||||
import { deepClone } from '../common/utils';
|
||||
|
||||
export class ResourceTypeWizard {
|
||||
private customButtons: azdata.window.Button[] = [];
|
||||
@@ -65,7 +66,7 @@ export class ResourceTypeWizard {
|
||||
* Setting the first provider from the first value of the dropdowns.
|
||||
* If there are no options (dropdowns) then the resource type has only one provider which is set as default here.
|
||||
*/
|
||||
let filteredOptions = resourceType.options;
|
||||
let filteredOptions = deepClone(resourceType.options);
|
||||
const optionsFilter = this._optionValuesFilter?.[this.resourceType.name];
|
||||
if (optionsFilter) {
|
||||
filteredOptions.forEach(option => {
|
||||
|
||||
@@ -10,7 +10,7 @@ import { AgreementInfo, DeploymentProvider, HelpText, ITool, ResourceType, Resou
|
||||
import { createFlexContainer } from './modelViewUtils';
|
||||
import * as loc from '../localizedConstants';
|
||||
import { IToolsService } from '../services/toolsService';
|
||||
import { getErrorMessage } from '../common/utils';
|
||||
import { deepClone, getErrorMessage } from '../common/utils';
|
||||
import { ResourceTypePage } from './resourceTypePage';
|
||||
import { ResourceTypeWizard } from './resourceTypeWizard';
|
||||
import { OptionValuesFilter as OptionValuesFilter } from '../services/resourceTypeService';
|
||||
@@ -200,7 +200,7 @@ export class ToolsAndEulaPage extends ResourceTypePage {
|
||||
}).component();
|
||||
this._optionsContainer.addItem(optionsTitle);
|
||||
this._resourceType.options.forEach((option, index) => {
|
||||
let optionValues = option.values;
|
||||
let optionValues = deepClone(option.values);
|
||||
const optionValueFilter = this.optionValuesFilter?.[this._resourceType.name]?.[option.name];
|
||||
if (optionValueFilter) {
|
||||
optionValues = optionValues.filter(optionValue => optionValueFilter.includes(optionValue.name));
|
||||
|
||||
Reference in New Issue
Block a user