mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Fixed default value for radio options builder if using resourceType displayName (#20070)
Co-authored-by: Candice Ye <canye@microsoft.com>
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
import * as azdata from 'azdata';
|
||||
import * as vscode from 'vscode';
|
||||
import { OptionsInfo, FieldInfo, instanceOfDynamicEnablementInfo } from '../interfaces';
|
||||
import { OptionsInfo, FieldInfo, instanceOfDynamicEnablementInfo, ResourceTypeOptionValue } from '../interfaces';
|
||||
import { getErrorMessage } from '../common/utils';
|
||||
|
||||
export class RadioGroupLoadingComponentBuilder implements azdata.ComponentBuilder<azdata.LoadingComponent, azdata.LoadingComponentProperties> {
|
||||
@@ -45,7 +45,14 @@ export class RadioGroupLoadingComponentBuilder implements azdata.ComponentBuilde
|
||||
}
|
||||
|
||||
let options: (string[] | azdata.CategoryValue[]) = optionsInfo.values!;
|
||||
let defaultValue: string = optionsInfo.defaultValue!;
|
||||
let defaultValue: string | ResourceTypeOptionValue = optionsInfo.defaultValue!;
|
||||
if (optionsInfo.defaultValue) {
|
||||
if ((<ResourceTypeOptionValue>optionsInfo.defaultValue).displayName) {
|
||||
defaultValue = (<ResourceTypeOptionValue>optionsInfo.defaultValue).displayName;
|
||||
} else {
|
||||
defaultValue = optionsInfo.defaultValue;
|
||||
}
|
||||
}
|
||||
options.forEach((op: string | azdata.CategoryValue) => {
|
||||
const option: azdata.CategoryValue = (typeof op === 'string')
|
||||
? { name: op, displayName: op }
|
||||
|
||||
Reference in New Issue
Block a user