UI: Minor fixes
This commit is contained in:
parent
392edbae1a
commit
28d48933f2
@ -123,7 +123,7 @@ export class AliasController implements IAliasController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getAliasInfo(aliasId: string): Observable<AliasInfo> {
|
getAliasInfo(aliasId: string): Observable<AliasInfo> {
|
||||||
const aliasInfo = this.resolvedAliases[aliasId];
|
let aliasInfo = this.resolvedAliases[aliasId];
|
||||||
if (aliasInfo) {
|
if (aliasInfo) {
|
||||||
return of(aliasInfo);
|
return of(aliasInfo);
|
||||||
} else if (this.resolvedAliasesObservable[aliasId]) {
|
} else if (this.resolvedAliasesObservable[aliasId]) {
|
||||||
@ -159,9 +159,14 @@ export class AliasController implements IAliasController {
|
|||||||
delete this.resolvedAliasesObservable[aliasId];
|
delete this.resolvedAliasesObservable[aliasId];
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
aliasInfo = this.resolvedAliases[aliasId];
|
||||||
|
if (aliasInfo) {
|
||||||
|
return of(aliasInfo);
|
||||||
|
} else {
|
||||||
return this.resolvedAliasesObservable[aliasId];
|
return this.resolvedAliasesObservable[aliasId];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private resolveDatasource(datasource: Datasource, isSingle?: boolean): Observable<Array<Datasource>> {
|
private resolveDatasource(datasource: Datasource, isSingle?: boolean): Observable<Array<Datasource>> {
|
||||||
if (datasource.type === DatasourceType.entity) {
|
if (datasource.type === DatasourceType.entity) {
|
||||||
|
|||||||
@ -19,7 +19,7 @@ import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
|||||||
import { Store } from '@ngrx/store';
|
import { Store } from '@ngrx/store';
|
||||||
import { AppState } from '@core/core.state';
|
import { AppState } from '@core/core.state';
|
||||||
import { FormBuilder, FormGroup } from '@angular/forms';
|
import { FormBuilder, FormGroup } from '@angular/forms';
|
||||||
import { Observable, Subject } from 'rxjs';
|
import { Observable, ReplaySubject } from 'rxjs';
|
||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
import { DialogComponent } from '@app/shared/components/dialog.component';
|
import { DialogComponent } from '@app/shared/components/dialog.component';
|
||||||
import {
|
import {
|
||||||
@ -30,7 +30,7 @@ import {
|
|||||||
alarmStatusTranslations
|
alarmStatusTranslations
|
||||||
} from '@app/shared/models/alarm.models';
|
} from '@app/shared/models/alarm.models';
|
||||||
import { AlarmService } from '@core/http/alarm.service';
|
import { AlarmService } from '@core/http/alarm.service';
|
||||||
import { share, tap } from 'rxjs/operators';
|
import { tap } from 'rxjs/operators';
|
||||||
import { DatePipe } from '@angular/common';
|
import { DatePipe } from '@angular/common';
|
||||||
import { TranslateService } from '@ngx-translate/core';
|
import { TranslateService } from '@ngx-translate/core';
|
||||||
|
|
||||||
@ -54,10 +54,9 @@ export class AlarmDetailsDialogComponent extends DialogComponent<AlarmDetailsDia
|
|||||||
allowClear: boolean;
|
allowClear: boolean;
|
||||||
displayDetails: boolean;
|
displayDetails: boolean;
|
||||||
|
|
||||||
loadAlarmSubject = new Subject<AlarmInfo>();
|
loadAlarmSubject = new ReplaySubject<AlarmInfo>();
|
||||||
alarm$: Observable<AlarmInfo> = this.loadAlarmSubject.asObservable().pipe(
|
alarm$: Observable<AlarmInfo> = this.loadAlarmSubject.asObservable().pipe(
|
||||||
tap(alarm => this.loadAlarmFields(alarm)),
|
tap(alarm => this.loadAlarmFields(alarm))
|
||||||
share()
|
|
||||||
);
|
);
|
||||||
|
|
||||||
alarmSeverityColorsMap = alarmSeverityColors;
|
alarmSeverityColorsMap = alarmSeverityColors;
|
||||||
|
|||||||
@ -63,12 +63,16 @@ export class AliasesEntitySelectComponent implements OnInit, OnDestroy {
|
|||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
this.rxSubscriptions.push(this.aliasController.entityAliasesChanged.subscribe(
|
this.rxSubscriptions.push(this.aliasController.entityAliasesChanged.subscribe(
|
||||||
() => {
|
() => {
|
||||||
|
setTimeout(() => {
|
||||||
this.updateDisplayValue();
|
this.updateDisplayValue();
|
||||||
|
}, 0);
|
||||||
}
|
}
|
||||||
));
|
));
|
||||||
this.rxSubscriptions.push(this.aliasController.entityAliasResolved.subscribe(
|
this.rxSubscriptions.push(this.aliasController.entityAliasResolved.subscribe(
|
||||||
() => {
|
() => {
|
||||||
|
setTimeout(() => {
|
||||||
this.updateDisplayValue();
|
this.updateDisplayValue();
|
||||||
|
}, 0);
|
||||||
}
|
}
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|||||||
@ -389,7 +389,7 @@ export class DashboardWidget implements GridsterItem, IDashboardWidget {
|
|||||||
padding: this.padding,
|
padding: this.padding,
|
||||||
margin: this.margin};
|
margin: this.margin};
|
||||||
if (this.widget.config.widgetStyle) {
|
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 :
|
this.showWidgetTitlePanel = this.widgetContext.hideTitlePanel ? false :
|
||||||
|
|||||||
@ -93,7 +93,6 @@ export class BreadcrumbComponent implements OnInit, OnDestroy {
|
|||||||
const icon = breadcrumbConfig.icon || 'home';
|
const icon = breadcrumbConfig.icon || 'home';
|
||||||
const isMdiIcon = icon.startsWith('mdi:');
|
const isMdiIcon = icon.startsWith('mdi:');
|
||||||
const link = [ route.pathFromRoot.map(v => v.url.map(segment => segment.toString()).join('/')).join('/') ];
|
const link = [ route.pathFromRoot.map(v => v.url.map(segment => segment.toString()).join('/')).join('/') ];
|
||||||
const queryParams = route.queryParams;
|
|
||||||
const breadcrumb = {
|
const breadcrumb = {
|
||||||
label,
|
label,
|
||||||
labelFunction,
|
labelFunction,
|
||||||
@ -101,7 +100,7 @@ export class BreadcrumbComponent implements OnInit, OnDestroy {
|
|||||||
icon,
|
icon,
|
||||||
isMdiIcon,
|
isMdiIcon,
|
||||||
link,
|
link,
|
||||||
queryParams
|
queryParams: null
|
||||||
};
|
};
|
||||||
newBreadcrumbs = [...breadcrumbs, breadcrumb];
|
newBreadcrumbs = [...breadcrumbs, breadcrumb];
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user