Commit 28d48933f21dda167268d866ac09cf9e58f46e1f

Authored by Igor Kulikov
1 parent 392edbae

UI: Minor fixes

... ... @@ -123,7 +123,7 @@ export class AliasController implements IAliasController {
123 123 }
124 124
125 125 getAliasInfo(aliasId: string): Observable<AliasInfo> {
126   - const aliasInfo = this.resolvedAliases[aliasId];
  126 + let aliasInfo = this.resolvedAliases[aliasId];
127 127 if (aliasInfo) {
128 128 return of(aliasInfo);
129 129 } else if (this.resolvedAliasesObservable[aliasId]) {
... ... @@ -159,7 +159,12 @@ export class AliasController implements IAliasController {
159 159 delete this.resolvedAliasesObservable[aliasId];
160 160 return res;
161 161 }
162   - return this.resolvedAliasesObservable[aliasId];
  162 + aliasInfo = this.resolvedAliases[aliasId];
  163 + if (aliasInfo) {
  164 + return of(aliasInfo);
  165 + } else {
  166 + return this.resolvedAliasesObservable[aliasId];
  167 + }
163 168 }
164 169 }
165 170
... ...
... ... @@ -19,7 +19,7 @@ import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
19 19 import { Store } from '@ngrx/store';
20 20 import { AppState } from '@core/core.state';
21 21 import { FormBuilder, FormGroup } from '@angular/forms';
22   -import { Observable, Subject } from 'rxjs';
  22 +import { Observable, ReplaySubject } from 'rxjs';
23 23 import { Router } from '@angular/router';
24 24 import { DialogComponent } from '@app/shared/components/dialog.component';
25 25 import {
... ... @@ -30,7 +30,7 @@ import {
30 30 alarmStatusTranslations
31 31 } from '@app/shared/models/alarm.models';
32 32 import { AlarmService } from '@core/http/alarm.service';
33   -import { share, tap } from 'rxjs/operators';
  33 +import { tap } from 'rxjs/operators';
34 34 import { DatePipe } from '@angular/common';
35 35 import { TranslateService } from '@ngx-translate/core';
36 36
... ... @@ -54,10 +54,9 @@ export class AlarmDetailsDialogComponent extends DialogComponent<AlarmDetailsDia
54 54 allowClear: boolean;
55 55 displayDetails: boolean;
56 56
57   - loadAlarmSubject = new Subject<AlarmInfo>();
  57 + loadAlarmSubject = new ReplaySubject<AlarmInfo>();
58 58 alarm$: Observable<AlarmInfo> = this.loadAlarmSubject.asObservable().pipe(
59   - tap(alarm => this.loadAlarmFields(alarm)),
60   - share()
  59 + tap(alarm => this.loadAlarmFields(alarm))
61 60 );
62 61
63 62 alarmSeverityColorsMap = alarmSeverityColors;
... ...
... ... @@ -63,12 +63,16 @@ export class AliasesEntitySelectComponent implements OnInit, OnDestroy {
63 63 ngOnInit(): void {
64 64 this.rxSubscriptions.push(this.aliasController.entityAliasesChanged.subscribe(
65 65 () => {
66   - this.updateDisplayValue();
  66 + setTimeout(() => {
  67 + this.updateDisplayValue();
  68 + }, 0);
67 69 }
68 70 ));
69 71 this.rxSubscriptions.push(this.aliasController.entityAliasResolved.subscribe(
70 72 () => {
71   - this.updateDisplayValue();
  73 + setTimeout(() => {
  74 + this.updateDisplayValue();
  75 + }, 0);
72 76 }
73 77 ));
74 78 }
... ...
... ... @@ -389,7 +389,7 @@ export class DashboardWidget implements GridsterItem, IDashboardWidget {
389 389 padding: this.padding,
390 390 margin: this.margin};
391 391 if (this.widget.config.widgetStyle) {
392   - this.style = {...this.widget.config.widgetStyle, ...this.style};
  392 + this.style = {...this.style, ...this.widget.config.widgetStyle};
393 393 }
394 394
395 395 this.showWidgetTitlePanel = this.widgetContext.hideTitlePanel ? false :
... ...
... ... @@ -93,7 +93,6 @@ export class BreadcrumbComponent implements OnInit, OnDestroy {
93 93 const icon = breadcrumbConfig.icon || 'home';
94 94 const isMdiIcon = icon.startsWith('mdi:');
95 95 const link = [ route.pathFromRoot.map(v => v.url.map(segment => segment.toString()).join('/')).join('/') ];
96   - const queryParams = route.queryParams;
97 96 const breadcrumb = {
98 97 label,
99 98 labelFunction,
... ... @@ -101,7 +100,7 @@ export class BreadcrumbComponent implements OnInit, OnDestroy {
101 100 icon,
102 101 isMdiIcon,
103 102 link,
104   - queryParams
  103 + queryParams: null
105 104 };
106 105 newBreadcrumbs = [...breadcrumbs, breadcrumb];
107 106 }
... ...