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> {
 | 
			
		||||
    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];
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -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<AlarmDetailsDia
 | 
			
		||||
  allowClear: boolean;
 | 
			
		||||
  displayDetails: boolean;
 | 
			
		||||
 | 
			
		||||
  loadAlarmSubject = new Subject<AlarmInfo>();
 | 
			
		||||
  loadAlarmSubject = new ReplaySubject<AlarmInfo>();
 | 
			
		||||
  alarm$: Observable<AlarmInfo> = this.loadAlarmSubject.asObservable().pipe(
 | 
			
		||||
    tap(alarm => this.loadAlarmFields(alarm)),
 | 
			
		||||
    share()
 | 
			
		||||
    tap(alarm => this.loadAlarmFields(alarm))
 | 
			
		||||
  );
 | 
			
		||||
 | 
			
		||||
  alarmSeverityColorsMap = alarmSeverityColors;
 | 
			
		||||
 | 
			
		||||
@ -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);
 | 
			
		||||
      }
 | 
			
		||||
    ));
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
@ -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 :
 | 
			
		||||
 | 
			
		||||
@ -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];
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user