Browse Source

UI: fixed show alarm fields in data keys widget with unresolved alias

pull/3767/head
Vladyslav_Prykhodko 6 years ago
parent
commit
97ef261ad2
  1. 16
      ui-ngx/src/app/modules/home/components/widget/widget-config.component.ts

16
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; return dataKeys;
} }
), ),
catchError(val => of([])) catchError(() => of([]))
)); ));
} }
return forkJoin(fetchEntityTasks).pipe( return forkJoin(fetchEntityTasks).pipe(
@ -825,11 +825,23 @@ export class WidgetConfigComponent extends PageComponent implements OnInit, Cont
return result; return result;
} }
)); ));
} else if (dataKeyTypes.includes(DataKeyType.alarm)) {
return this.entityService.getEntityKeys(null, query, DataKeyType.alarm).pipe(
map((keys) => {
const dataKeys: Array<DataKey> = [];
for (const key of keys) {
dataKeys.push({name: key, type: DataKeyType.alarm});
}
return dataKeys;
}
),
catchError(() => of([]))
);
} else { } else {
return of([]); return of([]);
} }
}), }),
catchError(val => of([] as Array<DataKey>)) catchError(() => of([] as Array<DataKey>))
); );
} }

Loading…
Cancel
Save