|
|
|
@ -14,7 +14,7 @@ |
|
|
|
/// limitations under the License.
|
|
|
|
///
|
|
|
|
|
|
|
|
import { ChangeDetectorRef, Component, Input, OnInit, ViewChild, ViewContainerRef } from '@angular/core'; |
|
|
|
import { AfterViewInit, ChangeDetectorRef, Component, Input, OnInit, ViewChild, ViewContainerRef } from '@angular/core'; |
|
|
|
import { TranslateService } from '@ngx-translate/core'; |
|
|
|
import { DatePipe } from '@angular/common'; |
|
|
|
import { MatDialog } from '@angular/material/dialog'; |
|
|
|
@ -25,13 +25,14 @@ import { EventService } from '@core/http/event.service'; |
|
|
|
import { DialogService } from '@core/services/dialog.service'; |
|
|
|
import { DebugEventType, EventType } from '@shared/models/event.models'; |
|
|
|
import { Overlay } from '@angular/cdk/overlay'; |
|
|
|
import { Subscription } from 'rxjs'; |
|
|
|
|
|
|
|
@Component({ |
|
|
|
selector: 'tb-event-table', |
|
|
|
templateUrl: './event-table.component.html', |
|
|
|
styleUrls: ['./event-table.component.scss'] |
|
|
|
}) |
|
|
|
export class EventTableComponent implements OnInit { |
|
|
|
export class EventTableComponent implements OnInit, AfterViewInit { |
|
|
|
|
|
|
|
@Input() |
|
|
|
tenantId: string; |
|
|
|
@ -77,6 +78,8 @@ export class EventTableComponent implements OnInit { |
|
|
|
|
|
|
|
eventTableConfig: EventTableConfig; |
|
|
|
|
|
|
|
private isEmptyData$: Subscription; |
|
|
|
|
|
|
|
constructor(private eventService: EventService, |
|
|
|
private dialogService: DialogService, |
|
|
|
private translate: TranslateService, |
|
|
|
@ -106,4 +109,14 @@ export class EventTableComponent implements OnInit { |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
ngAfterViewInit() { |
|
|
|
this.isEmptyData$ = this.entitiesTable.dataSource.isEmpty().subscribe(value => this.eventTableConfig.hideClearEventAction = value); |
|
|
|
} |
|
|
|
|
|
|
|
ngOnDestroy() { |
|
|
|
if (this.isEmptyData$) { |
|
|
|
this.isEmptyData$.unsubscribe(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|