|
|
@ -42,7 +42,7 @@ import cssjs from '@core/css/css'; |
|
|
import { sortItems } from '@shared/models/page/page-link'; |
|
|
import { sortItems } from '@shared/models/page/page-link'; |
|
|
import { Direction } from '@shared/models/page/sort-order'; |
|
|
import { Direction } from '@shared/models/page/sort-order'; |
|
|
import { CollectionViewer, DataSource, SelectionModel } from '@angular/cdk/collections'; |
|
|
import { CollectionViewer, DataSource, SelectionModel } from '@angular/cdk/collections'; |
|
|
import { BehaviorSubject, forkJoin, merge, Observable, Subject, Subscription } from 'rxjs'; |
|
|
import { BehaviorSubject, forkJoin, fromEvent, merge, Observable, Subject, Subscription } from 'rxjs'; |
|
|
import { emptyPageData, PageData } from '@shared/models/page/page-data'; |
|
|
import { emptyPageData, PageData } from '@shared/models/page/page-data'; |
|
|
import { debounceTime, distinctUntilChanged, map, take, takeUntil, tap } from 'rxjs/operators'; |
|
|
import { debounceTime, distinctUntilChanged, map, take, takeUntil, tap } from 'rxjs/operators'; |
|
|
import { MatPaginator } from '@angular/material/paginator'; |
|
|
import { MatPaginator } from '@angular/material/paginator'; |
|
|
@ -123,6 +123,7 @@ import { |
|
|
} from '@home/components/alarm/alarm-filter-config.component'; |
|
|
} from '@home/components/alarm/alarm-filter-config.component'; |
|
|
import { getCurrentAuthUser } from '@core/auth/auth.selectors'; |
|
|
import { getCurrentAuthUser } from '@core/auth/auth.selectors'; |
|
|
import { FormBuilder } from '@angular/forms'; |
|
|
import { FormBuilder } from '@angular/forms'; |
|
|
|
|
|
import { DEFAULT_OVERLAY_POSITIONS } from '@shared/components/popover.models'; |
|
|
|
|
|
|
|
|
interface AlarmsTableWidgetSettings extends TableWidgetSettings { |
|
|
interface AlarmsTableWidgetSettings extends TableWidgetSettings { |
|
|
alarmsTitle: string; |
|
|
alarmsTitle: string; |
|
|
@ -572,14 +573,9 @@ export class AlarmsTableWidgetComponent extends PageComponent implements OnInit, |
|
|
height: 'fit-content', |
|
|
height: 'fit-content', |
|
|
maxHeight: '75vh' |
|
|
maxHeight: '75vh' |
|
|
}); |
|
|
}); |
|
|
const connectedPosition: ConnectedPosition = { |
|
|
config.positionStrategy = this.overlay.position() |
|
|
originX: 'end', |
|
|
.flexibleConnectedTo(target as HTMLElement) |
|
|
originY: 'bottom', |
|
|
.withPositions(DEFAULT_OVERLAY_POSITIONS); |
|
|
overlayX: 'end', |
|
|
|
|
|
overlayY: 'top' |
|
|
|
|
|
}; |
|
|
|
|
|
config.positionStrategy = this.overlay.position().flexibleConnectedTo(target as HTMLElement) |
|
|
|
|
|
.withPositions([connectedPosition]); |
|
|
|
|
|
|
|
|
|
|
|
const overlayRef = this.overlay.create(config); |
|
|
const overlayRef = this.overlay.create(config); |
|
|
overlayRef.backdropClick().subscribe(() => { |
|
|
overlayRef.backdropClick().subscribe(() => { |
|
|
@ -614,10 +610,12 @@ export class AlarmsTableWidgetComponent extends PageComponent implements OnInit, |
|
|
const componentRef = overlayRef.attach(new ComponentPortal(AlarmFilterConfigComponent, |
|
|
const componentRef = overlayRef.attach(new ComponentPortal(AlarmFilterConfigComponent, |
|
|
this.viewContainerRef, injector)); |
|
|
this.viewContainerRef, injector)); |
|
|
|
|
|
|
|
|
const resizeWindows = this.utils.updateOverlayMaxHeigth(overlayRef, componentRef.location); |
|
|
const resizeWindows$ = fromEvent(window, 'resize').subscribe(() => { |
|
|
|
|
|
overlayRef.updatePosition(); |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
componentRef.onDestroy(() => { |
|
|
componentRef.onDestroy(() => { |
|
|
resizeWindows.unsubscribe(); |
|
|
resizeWindows$.unsubscribe(); |
|
|
if (componentRef.instance.panelResult) { |
|
|
if (componentRef.instance.panelResult) { |
|
|
const result = componentRef.instance.panelResult; |
|
|
const result = componentRef.instance.panelResult; |
|
|
const alarmFilter = this.entityService.resolveAlarmFilter(result, false); |
|
|
const alarmFilter = this.entityService.resolveAlarmFilter(result, false); |
|
|
|