Fix for reading "options" property from backend in manage dashboard (#11701)

Co-authored-by: Monica Gupta <mogupt@microsoft.com>
This commit is contained in:
Monica Gupta
2020-08-06 17:37:15 -07:00
committed by GitHub
parent 2b2c912135
commit dcd1a175e4

View File

@@ -132,10 +132,11 @@ export class PropertiesWidgetComponent extends DashboardWidget implements IDashb
});
}
private getValueOrDefault<T>(infoObject: ServerInfo | {}, propertyValue: string, defaultVal?: any): T {
private getValueOrDefault<T>(infoObject: ServerInfo | {}, propertyName: string, defaultVal?: any): T {
let val: T = undefined;
if (infoObject) {
val = infoObject[propertyValue];
let obj = propertyName in infoObject ? infoObject : ('options' in infoObject && propertyName in infoObject.options ? infoObject.options : undefined);
if (obj) {
val = obj[propertyName];
}
if (types.isUndefinedOrNull(val)) {
val = defaultVal;