Commit 08de78a86b594690c114438ad1d1f9892ee16ccd
Committed by
GitHub
Merge pull request #3767 from vvlladd28/bug/alarm-widget/alarm-fields
UI: fixed show alarm fields in data keys widget with unresolved alias
Showing
1 changed file
with
14 additions
and
2 deletions
... | ... | @@ -813,7 +813,7 @@ export class WidgetConfigComponent extends PageComponent implements OnInit, Cont |
813 | 813 | return dataKeys; |
814 | 814 | } |
815 | 815 | ), |
816 | - catchError(val => of([])) | |
816 | + catchError(() => of([])) | |
817 | 817 | )); |
818 | 818 | } |
819 | 819 | return forkJoin(fetchEntityTasks).pipe( |
... | ... | @@ -825,11 +825,23 @@ export class WidgetConfigComponent extends PageComponent implements OnInit, Cont |
825 | 825 | return result; |
826 | 826 | } |
827 | 827 | )); |
828 | + } else if (dataKeyTypes.includes(DataKeyType.alarm)) { | |
829 | + return this.entityService.getEntityKeys(null, query, DataKeyType.alarm).pipe( | |
830 | + map((keys) => { | |
831 | + const dataKeys: Array<DataKey> = []; | |
832 | + for (const key of keys) { | |
833 | + dataKeys.push({name: key, type: DataKeyType.alarm}); | |
834 | + } | |
835 | + return dataKeys; | |
836 | + } | |
837 | + ), | |
838 | + catchError(() => of([])) | |
839 | + ); | |
828 | 840 | } else { |
829 | 841 | return of([]); |
830 | 842 | } |
831 | 843 | }), |
832 | - catchError(val => of([] as Array<DataKey>)) | |
844 | + catchError(() => of([] as Array<DataKey>)) | |
833 | 845 | ); |
834 | 846 | } |
835 | 847 | ... | ... |