mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
Fix deployment wizard for filtered options (#14114)
This commit is contained in:
@@ -56,7 +56,7 @@ export class ResourceTypeService implements IResourceTypeService {
|
|||||||
resourceType.getProvider = (selectedOptions) => { return this.getProvider(resourceType, selectedOptions); };
|
resourceType.getProvider = (selectedOptions) => { return this.getProvider(resourceType, selectedOptions); };
|
||||||
resourceType.getOkButtonText = (selectedOptions) => { return this.getOkButtonText(resourceType, selectedOptions); };
|
resourceType.getOkButtonText = (selectedOptions) => { return this.getOkButtonText(resourceType, selectedOptions); };
|
||||||
resourceType.getAgreementInfo = (selectedOptions) => { return this.getAgreementInfo(resourceType, selectedOptions); };
|
resourceType.getAgreementInfo = (selectedOptions) => { return this.getAgreementInfo(resourceType, selectedOptions); };
|
||||||
this.getResourceSubTypes(filterByPlatform, resourceType);
|
this.getResourceSubTypes(resourceType);
|
||||||
this._resourceTypes.push(resourceType);
|
this._resourceTypes.push(resourceType);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -125,7 +125,7 @@ export class ResourceTypeService implements IResourceTypeService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private getResourceSubTypes(filterByPlatform: boolean = true, resourceType: ResourceType): void {
|
private getResourceSubTypes(resourceType: ResourceType): void {
|
||||||
const resourceSubTypes: ResourceSubType[] = [];
|
const resourceSubTypes: ResourceSubType[] = [];
|
||||||
vscode.extensions.all.forEach((extension) => {
|
vscode.extensions.all.forEach((extension) => {
|
||||||
const extensionResourceSubTypes = extension.packageJSON.contributes?.resourceDeploymentSubTypes as ResourceSubType[];
|
const extensionResourceSubTypes = extension.packageJSON.contributes?.resourceDeploymentSubTypes as ResourceSubType[];
|
||||||
@@ -155,7 +155,6 @@ export class ResourceTypeService implements IResourceTypeService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -64,8 +64,18 @@ export class ResourceTypeWizard {
|
|||||||
* Setting the first provider from the first value of the dropdowns.
|
* 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.
|
* If there are no options (dropdowns) then the resource type has only one provider which is set as default here.
|
||||||
*/
|
*/
|
||||||
|
let filteredOptions = resourceType.options;
|
||||||
|
const optionsFilter = this._optionValuesFilter?.[this.resourceType.name];
|
||||||
|
if (optionsFilter) {
|
||||||
|
filteredOptions.forEach(option => {
|
||||||
|
const optionValuesFilter = optionsFilter[option.name];
|
||||||
|
if (optionValuesFilter) {
|
||||||
|
option.values = option.values.filter(optionValue => optionValuesFilter.includes(optionValue.name));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
if (resourceType.options) {
|
if (resourceType.options) {
|
||||||
this.provider = this.resourceType.getProvider(resourceType.options.map(option => { return { option: option.name, value: option.values[0].name }; }))!;
|
this.provider = this.resourceType.getProvider(filteredOptions.map(option => { return { option: option.name, value: option.values[0].name }; }))!;
|
||||||
} else {
|
} else {
|
||||||
this.provider = this.resourceType.providers[0];
|
this.provider = this.resourceType.providers[0];
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user