From 477ee90e50bce2d5412d3664942bd6913ddb2028 Mon Sep 17 00:00:00 2001 From: Vladyslav_Prykhodko Date: Fri, 26 Feb 2021 17:34:42 +0200 Subject: [PATCH] UI: Added the ability to get the value of a key that contains dots in the name to a table widgets --- ui-ngx/src/app/core/utils.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ui-ngx/src/app/core/utils.ts b/ui-ngx/src/app/core/utils.ts index ac79c0f04e..c03b10d4d1 100644 --- a/ui-ngx/src/app/core/utils.ts +++ b/ui-ngx/src/app/core/utils.ts @@ -324,6 +324,9 @@ export function snakeCase(name: string, separator: string): string { } export function getDescendantProp(obj: any, path: string): any { + if (obj.hasOwnProperty(path)) { + return obj[path]; + } return path.split('.').reduce((acc, part) => acc && acc[part], obj); }