From 5e883384230c4eec49669720ecb98bdcc646d306 Mon Sep 17 00:00:00 2001 From: Candice Ye Date: Tue, 19 Jul 2022 21:04:39 -0700 Subject: [PATCH] Reverted changes to Radio buttons default value (#20100) * Reverted resourcedeploy changes * Replaced the ! Co-authored-by: Candice Ye --- extensions/arc/package.json | 17 ++++------------- .../resource-deployment/src/interfaces.ts | 2 +- .../src/ui/radioGroupLoadingComponentBuilder.ts | 9 ++------- 3 files changed, 7 insertions(+), 21 deletions(-) diff --git a/extensions/arc/package.json b/extensions/arc/package.json index 0b006da6af..50278758fe 100644 --- a/extensions/arc/package.json +++ b/extensions/arc/package.json @@ -186,7 +186,7 @@ "displayName": "%arc.data.controller.direct.display.name%" } ], - "defaultValue": "indirect", + "defaultValue": "%arc.data.controller.indirect.display.name%", "optionsType": "radio" } }, @@ -1149,10 +1149,7 @@ "displayName": "%arc.sql.service.tier.general.purpose%" } ], - "defaultValue": { - "name": "BusinessCritical", - "displayName": "%arc.sql.service.tier.business.critical%" - }, + "defaultValue": "%arc.sql.service.tier.business.critical%", "optionsType": "radio" } }, @@ -1184,10 +1181,7 @@ "displayName": "%arc.sql.three.replicas%" } ], - "defaultValue": { - "name": "3", - "displayName": "%arc.sql.three.replicas%" - }, + "defaultValue": "%arc.sql.three.replicas%", "optionsType": "radio" }, "dynamicOptions": { @@ -1201,10 +1195,7 @@ "displayName": "%arc.sql.one.replica%" } ], - "defaultValue": { - "name": "1", - "displayName": "%arc.sql.one.replica%" - } + "defaultValue": "%arc.sql.one.replica%" } ] }, diff --git a/extensions/resource-deployment/src/interfaces.ts b/extensions/resource-deployment/src/interfaces.ts index 94d3ac7cfd..dbf0342604 100644 --- a/extensions/resource-deployment/src/interfaces.ts +++ b/extensions/resource-deployment/src/interfaces.ts @@ -285,7 +285,7 @@ export interface IOptionsSource { export interface OptionsInfo { values?: string[] | azdata.CategoryValue[], source?: IOptionsSource, - defaultValue: string | ResourceTypeOptionValue, + defaultValue: string, optionsType?: OptionsType } diff --git a/extensions/resource-deployment/src/ui/radioGroupLoadingComponentBuilder.ts b/extensions/resource-deployment/src/ui/radioGroupLoadingComponentBuilder.ts index 444369762a..c115dbdfed 100644 --- a/extensions/resource-deployment/src/ui/radioGroupLoadingComponentBuilder.ts +++ b/extensions/resource-deployment/src/ui/radioGroupLoadingComponentBuilder.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import * as azdata from 'azdata'; import * as vscode from 'vscode'; -import { OptionsInfo, FieldInfo, instanceOfDynamicEnablementInfo, ResourceTypeOptionValue } from '../interfaces'; +import { OptionsInfo, FieldInfo, instanceOfDynamicEnablementInfo } from '../interfaces'; import { getErrorMessage } from '../common/utils'; export class RadioGroupLoadingComponentBuilder implements azdata.ComponentBuilder { @@ -45,12 +45,7 @@ export class RadioGroupLoadingComponentBuilder implements azdata.ComponentBuilde } let options: (string[] | azdata.CategoryValue[]) = optionsInfo.values!; - let defaultValue: string | ResourceTypeOptionValue = optionsInfo.defaultValue!; - if (typeof optionsInfo.defaultValue === 'string') { - defaultValue = optionsInfo.defaultValue; - } else { - defaultValue = optionsInfo.defaultValue.displayName; - } + let defaultValue: string = optionsInfo.defaultValue!; options.forEach((op: string | azdata.CategoryValue) => { const option: azdata.CategoryValue = (typeof op === 'string') ? { name: op, displayName: op }