Events clearing UI refactoring
This commit is contained in:
parent
13a74c784e
commit
6e2c1e3419
@ -84,7 +84,7 @@
|
|||||||
[fxShow]="actionDescriptor.isEnabled()" *ngFor="let actionDescriptor of headerActionDescriptors"
|
[fxShow]="actionDescriptor.isEnabled()" *ngFor="let actionDescriptor of headerActionDescriptors"
|
||||||
matTooltip="{{ actionDescriptor.name }}"
|
matTooltip="{{ actionDescriptor.name }}"
|
||||||
matTooltipPosition="above"
|
matTooltipPosition="above"
|
||||||
(click)="actionDescriptor.onAction($event, entitiesTableConfig, pageLink)">
|
(click)="actionDescriptor.onAction($event)">
|
||||||
<mat-icon *ngIf="actionDescriptor.isMdiIcon" [svgIcon]="actionDescriptor.icon"></mat-icon>
|
<mat-icon *ngIf="actionDescriptor.isMdiIcon" [svgIcon]="actionDescriptor.icon"></mat-icon>
|
||||||
<mat-icon *ngIf="!actionDescriptor.isMdiIcon">{{actionDescriptor.icon}}</mat-icon>
|
<mat-icon *ngIf="!actionDescriptor.isMdiIcon">{{actionDescriptor.icon}}</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@ -140,8 +140,8 @@ export class EventTableConfig extends EntityTableConfig<Event, TimePageLink> {
|
|||||||
name: this.translate.instant('event.clean-events'),
|
name: this.translate.instant('event.clean-events'),
|
||||||
icon: 'delete',
|
icon: 'delete',
|
||||||
isEnabled: () => true,
|
isEnabled: () => true,
|
||||||
onAction: ($event, entity, pageLink: TimePageLink) => {
|
onAction: ($event) => {
|
||||||
this.eventService.clearEvents(entity.entityId, entity.eventType, entity.filterParams, entity.tenantId, pageLink).subscribe(
|
this.eventService.clearEvents(this.entityId, this.eventType, this.filterParams, this.tenantId, this.table.pageLink as TimePageLink).subscribe(
|
||||||
() => {
|
() => {
|
||||||
this.table.paginator.pageIndex = 0;
|
this.table.paginator.pageIndex = 0;
|
||||||
this.table.updateData();
|
this.table.updateData();
|
||||||
|
|||||||
@ -25,7 +25,6 @@ import { EventService } from '@core/http/event.service';
|
|||||||
import { DialogService } from '@core/services/dialog.service';
|
import { DialogService } from '@core/services/dialog.service';
|
||||||
import { DebugEventType, EventType } from '@shared/models/event.models';
|
import { DebugEventType, EventType } from '@shared/models/event.models';
|
||||||
import { Overlay } from '@angular/cdk/overlay';
|
import { Overlay } from '@angular/cdk/overlay';
|
||||||
import { HttpClient } from '@angular/common/http';
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'tb-event-table',
|
selector: 'tb-event-table',
|
||||||
@ -85,8 +84,7 @@ export class EventTableComponent implements OnInit {
|
|||||||
private dialog: MatDialog,
|
private dialog: MatDialog,
|
||||||
private overlay: Overlay,
|
private overlay: Overlay,
|
||||||
private viewContainerRef: ViewContainerRef,
|
private viewContainerRef: ViewContainerRef,
|
||||||
private cd: ChangeDetectorRef,
|
private cd: ChangeDetectorRef) {
|
||||||
private http: HttpClient) {
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
|||||||
@ -25,7 +25,8 @@ import { EntityComponent } from '@home/components/entity/entity.component';
|
|||||||
import { Type } from '@angular/core';
|
import { Type } from '@angular/core';
|
||||||
import { EntityAction } from './entity-component.models';
|
import { EntityAction } from './entity-component.models';
|
||||||
import { HasUUID } from '@shared/models/id/has-uuid';
|
import { HasUUID } from '@shared/models/id/has-uuid';
|
||||||
import { PageLink } from '@shared/models/page/page-link';
|
import { PageLink, TimePageLink } from '@shared/models/page/page-link';
|
||||||
|
import { EntitiesTableComponent } from '@home/components/entity/entities-table.component';
|
||||||
import { EntityTableHeaderComponent } from '@home/components/entity/entity-table-header.component';
|
import { EntityTableHeaderComponent } from '@home/components/entity/entity-table-header.component';
|
||||||
import { ActivatedRoute } from '@angular/router';
|
import { ActivatedRoute } from '@angular/router';
|
||||||
import { EntityTabsComponent } from '../../components/entity/entity-tabs.component';
|
import { EntityTabsComponent } from '../../components/entity/entity-tabs.component';
|
||||||
@ -75,7 +76,7 @@ export interface HeaderActionDescriptor {
|
|||||||
icon: string;
|
icon: string;
|
||||||
isMdiIcon?: boolean;
|
isMdiIcon?: boolean;
|
||||||
isEnabled: () => boolean;
|
isEnabled: () => boolean;
|
||||||
onAction: ($event: MouseEvent, entity?, pageLink?) => void;
|
onAction: ($event: MouseEvent) => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
export type EntityTableColumnType = 'content' | 'action';
|
export type EntityTableColumnType = 'content' | 'action';
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user