mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Enabled dynamic options to use CategoryValue type. SQL MIAA deploy now up to parity with Portal. (#18279)
* Removed extra backup policy field in MIAA deploy. Re-ordered fields in MIAA deploy for parity. * Enabled dynamic options to work with categoryvalue type objects. * Removed defaultValue CategoryValue typing, fixed some type checks. * Added a clarifying comment to setModelValues and removed unnecessary type from defaultValue * Removed CategoryValue from selection * Undo parenthesis for single type
This commit is contained in:
@@ -438,7 +438,7 @@ async function hookUpDynamicOptions(context: WizardPageContext): Promise<void> {
|
||||
const updateOptions = async () => {
|
||||
const currentValue = await targetComponent.getValue();
|
||||
if (field.dynamicOptions && field.options && fieldComponent && fieldComponent.setOptions) {
|
||||
const targetValueFound = field.dynamicOptions.alternates.find(item => item.selection === currentValue);
|
||||
let targetValueFound = field.dynamicOptions.alternates.find(item => item.selection === currentValue);
|
||||
if (targetValueFound) {
|
||||
fieldComponent.setOptions(<OptionsInfo>{
|
||||
values: targetValueFound.alternateValues,
|
||||
@@ -1646,7 +1646,12 @@ export function getPasswordMismatchMessage(fieldName: string): string {
|
||||
export async function setModelValues(inputComponents: InputComponents, model: Model): Promise<void> {
|
||||
await Promise.all(Object.keys(inputComponents).map(async key => {
|
||||
const value = await inputComponents[key].getValue();
|
||||
model.setPropertyValue(key, value);
|
||||
// Check if value is of type CategoryValue. If so, we need to get the name from the CategoryValue object.
|
||||
if (typeof (value) === 'object') {
|
||||
model.setPropertyValue(key, value.name);
|
||||
} else {
|
||||
model.setPropertyValue(key, value);
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user