From 59508be5d71ead752b6154c01856f0bf2bf8fc53 Mon Sep 17 00:00:00 2001 From: Igor Kulikov Date: Tue, 14 Feb 2023 15:33:35 +0200 Subject: [PATCH] UI: Minor improvements --- .../components/alarm/alarm-table-config.ts | 4 ++-- ui-ngx/src/app/modules/home/home.component.ts | 19 ++++--------------- 2 files changed, 6 insertions(+), 17 deletions(-) diff --git a/ui-ngx/src/app/modules/home/components/alarm/alarm-table-config.ts b/ui-ngx/src/app/modules/home/components/alarm/alarm-table-config.ts index 320158900e..9982cd8328 100644 --- a/ui-ngx/src/app/modules/home/components/alarm/alarm-table-config.ts +++ b/ui-ngx/src/app/modules/home/components/alarm/alarm-table-config.ts @@ -33,7 +33,8 @@ import { AlarmQuery, AlarmSearchStatus, alarmSeverityColors, - alarmSeverityTranslations, AlarmsMode, + alarmSeverityTranslations, + AlarmsMode, alarmStatusTranslations } from '@app/shared/models/alarm.models'; import { AlarmService } from '@app/core/http/alarm.service'; @@ -48,7 +49,6 @@ import { Store } from '@ngrx/store'; import { AppState } from '@core/core.state'; import { getCurrentAuthUser } from '@core/auth/auth.selectors'; import { Authority } from '@shared/models/authority.enum'; -import { AuditLogMode } from '@shared/models/audit-log.models'; export class AlarmTableConfig extends EntityTableConfig { diff --git a/ui-ngx/src/app/modules/home/home.component.ts b/ui-ngx/src/app/modules/home/home.component.ts index a18a2150c5..7ff0531e27 100644 --- a/ui-ngx/src/app/modules/home/home.component.ts +++ b/ui-ngx/src/app/modules/home/home.component.ts @@ -15,15 +15,14 @@ /// import { AfterViewInit, Component, ElementRef, Inject, OnInit, ViewChild } from '@angular/core'; -import { fromEvent, Observable } from 'rxjs'; -import { select, Store } from '@ngrx/store'; -import { debounceTime, distinctUntilChanged, map, tap } from 'rxjs/operators'; +import { fromEvent } from 'rxjs'; +import { Store } from '@ngrx/store'; +import { debounceTime, distinctUntilChanged, tap } from 'rxjs/operators'; import { BreakpointObserver, BreakpointState } from '@angular/cdk/layout'; -import { User } from '@shared/models/user.model'; import { PageComponent } from '@shared/components/page.component'; import { AppState } from '@core/core.state'; -import { getCurrentAuthState, selectAuthUser, selectUserDetails } from '@core/auth/auth.selectors'; +import { getCurrentAuthState } from '@core/auth/auth.selectors'; import { MediaBreakpoints } from '@shared/models/constants'; import screenfull from 'screenfull'; import { MatSidenav } from '@angular/material/sidenav'; @@ -59,10 +58,6 @@ export class HomeComponent extends PageComponent implements AfterViewInit, OnIni fullscreenEnabled = screenfull.isEnabled; - authUser$: Observable; - userDetails$: Observable; - userDetailsString: Observable; - searchEnabled = false; showSearch = false; searchText = ''; @@ -78,12 +73,6 @@ export class HomeComponent extends PageComponent implements AfterViewInit, OnIni ngOnInit() { - this.authUser$ = this.store.pipe(select(selectAuthUser)); - this.userDetails$ = this.store.pipe(select(selectUserDetails)); - this.userDetailsString = this.userDetails$.pipe(map((user: User) => { - return JSON.stringify(user); - })); - const isGtSm = this.breakpointObserver.isMatched(MediaBreakpoints['gt-sm']); this.sidenavMode = isGtSm ? 'side' : 'over'; this.sidenavOpened = isGtSm;