diff --git a/ui-ngx/src/app/core/api/alias-controller.ts b/ui-ngx/src/app/core/api/alias-controller.ts index b4e2754a42..848da23861 100644 --- a/ui-ngx/src/app/core/api/alias-controller.ts +++ b/ui-ngx/src/app/core/api/alias-controller.ts @@ -123,7 +123,7 @@ export class AliasController implements IAliasController { } getAliasInfo(aliasId: string): Observable { - const aliasInfo = this.resolvedAliases[aliasId]; + let aliasInfo = this.resolvedAliases[aliasId]; if (aliasInfo) { return of(aliasInfo); } else if (this.resolvedAliasesObservable[aliasId]) { @@ -159,7 +159,12 @@ export class AliasController implements IAliasController { delete this.resolvedAliasesObservable[aliasId]; return res; } - return this.resolvedAliasesObservable[aliasId]; + aliasInfo = this.resolvedAliases[aliasId]; + if (aliasInfo) { + return of(aliasInfo); + } else { + return this.resolvedAliasesObservable[aliasId]; + } } } diff --git a/ui-ngx/src/app/modules/home/components/alarm/alarm-details-dialog.component.ts b/ui-ngx/src/app/modules/home/components/alarm/alarm-details-dialog.component.ts index 52cd607167..cedbb36564 100644 --- a/ui-ngx/src/app/modules/home/components/alarm/alarm-details-dialog.component.ts +++ b/ui-ngx/src/app/modules/home/components/alarm/alarm-details-dialog.component.ts @@ -19,7 +19,7 @@ import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import { Store } from '@ngrx/store'; import { AppState } from '@core/core.state'; import { FormBuilder, FormGroup } from '@angular/forms'; -import { Observable, Subject } from 'rxjs'; +import { Observable, ReplaySubject } from 'rxjs'; import { Router } from '@angular/router'; import { DialogComponent } from '@app/shared/components/dialog.component'; import { @@ -30,7 +30,7 @@ import { alarmStatusTranslations } from '@app/shared/models/alarm.models'; import { AlarmService } from '@core/http/alarm.service'; -import { share, tap } from 'rxjs/operators'; +import { tap } from 'rxjs/operators'; import { DatePipe } from '@angular/common'; import { TranslateService } from '@ngx-translate/core'; @@ -54,10 +54,9 @@ export class AlarmDetailsDialogComponent extends DialogComponent(); + loadAlarmSubject = new ReplaySubject(); alarm$: Observable = this.loadAlarmSubject.asObservable().pipe( - tap(alarm => this.loadAlarmFields(alarm)), - share() + tap(alarm => this.loadAlarmFields(alarm)) ); alarmSeverityColorsMap = alarmSeverityColors; diff --git a/ui-ngx/src/app/modules/home/components/alias/aliases-entity-select.component.ts b/ui-ngx/src/app/modules/home/components/alias/aliases-entity-select.component.ts index d768071749..ef70a09690 100644 --- a/ui-ngx/src/app/modules/home/components/alias/aliases-entity-select.component.ts +++ b/ui-ngx/src/app/modules/home/components/alias/aliases-entity-select.component.ts @@ -63,12 +63,16 @@ export class AliasesEntitySelectComponent implements OnInit, OnDestroy { ngOnInit(): void { this.rxSubscriptions.push(this.aliasController.entityAliasesChanged.subscribe( () => { - this.updateDisplayValue(); + setTimeout(() => { + this.updateDisplayValue(); + }, 0); } )); this.rxSubscriptions.push(this.aliasController.entityAliasResolved.subscribe( () => { - this.updateDisplayValue(); + setTimeout(() => { + this.updateDisplayValue(); + }, 0); } )); } diff --git a/ui-ngx/src/app/modules/home/models/dashboard-component.models.ts b/ui-ngx/src/app/modules/home/models/dashboard-component.models.ts index 351dfadcab..5b6fee71c1 100644 --- a/ui-ngx/src/app/modules/home/models/dashboard-component.models.ts +++ b/ui-ngx/src/app/modules/home/models/dashboard-component.models.ts @@ -389,7 +389,7 @@ export class DashboardWidget implements GridsterItem, IDashboardWidget { padding: this.padding, margin: this.margin}; if (this.widget.config.widgetStyle) { - this.style = {...this.widget.config.widgetStyle, ...this.style}; + this.style = {...this.style, ...this.widget.config.widgetStyle}; } this.showWidgetTitlePanel = this.widgetContext.hideTitlePanel ? false : diff --git a/ui-ngx/src/app/shared/components/breadcrumb.component.ts b/ui-ngx/src/app/shared/components/breadcrumb.component.ts index 9ee6a8ab9d..a934e29093 100644 --- a/ui-ngx/src/app/shared/components/breadcrumb.component.ts +++ b/ui-ngx/src/app/shared/components/breadcrumb.component.ts @@ -93,7 +93,6 @@ export class BreadcrumbComponent implements OnInit, OnDestroy { const icon = breadcrumbConfig.icon || 'home'; const isMdiIcon = icon.startsWith('mdi:'); const link = [ route.pathFromRoot.map(v => v.url.map(segment => segment.toString()).join('/')).join('/') ]; - const queryParams = route.queryParams; const breadcrumb = { label, labelFunction, @@ -101,7 +100,7 @@ export class BreadcrumbComponent implements OnInit, OnDestroy { icon, isMdiIcon, link, - queryParams + queryParams: null }; newBreadcrumbs = [...breadcrumbs, breadcrumb]; }