From 97ef261ad2609f6364d014683a4075b1d8dd336b Mon Sep 17 00:00:00 2001 From: Vladyslav_Prykhodko Date: Tue, 24 Nov 2020 10:57:59 +0200 Subject: [PATCH] UI: fixed show alarm fields in data keys widget with unresolved alias --- .../components/widget/widget-config.component.ts | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/ui-ngx/src/app/modules/home/components/widget/widget-config.component.ts b/ui-ngx/src/app/modules/home/components/widget/widget-config.component.ts index ce37c46326..ba8cdaf5d2 100644 --- a/ui-ngx/src/app/modules/home/components/widget/widget-config.component.ts +++ b/ui-ngx/src/app/modules/home/components/widget/widget-config.component.ts @@ -813,7 +813,7 @@ export class WidgetConfigComponent extends PageComponent implements OnInit, Cont return dataKeys; } ), - catchError(val => of([])) + catchError(() => of([])) )); } return forkJoin(fetchEntityTasks).pipe( @@ -825,11 +825,23 @@ export class WidgetConfigComponent extends PageComponent implements OnInit, Cont return result; } )); + } else if (dataKeyTypes.includes(DataKeyType.alarm)) { + return this.entityService.getEntityKeys(null, query, DataKeyType.alarm).pipe( + map((keys) => { + const dataKeys: Array = []; + for (const key of keys) { + dataKeys.push({name: key, type: DataKeyType.alarm}); + } + return dataKeys; + } + ), + catchError(() => of([])) + ); } else { return of([]); } }), - catchError(val => of([] as Array)) + catchError(() => of([] as Array)) ); }