Update clear Events request
This commit is contained in:
		
							parent
							
								
									4d86a61580
								
							
						
					
					
						commit
						e718e31f63
					
				@ -46,10 +46,9 @@ export class EventService {
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  public clearEvents(entityId: EntityId, eventType: EventType | DebugEventType, filters: FilterEventBody, tenantId: string,
 | 
			
		||||
                     startTime?: number, endTime?: number, config?: RequestConfig) {
 | 
			
		||||
                     pageLink: TimePageLink, config?: RequestConfig) {
 | 
			
		||||
    return this.http.post(`/api/events/${entityId.entityType}/${entityId.id}/${eventType}/clear&tenantId=${tenantId}` +
 | 
			
		||||
      (startTime ? `&startTime=${startTime}` : ``) + (endTime ? `&endTime=${endTime}` : ``), {...filters, eventType},
 | 
			
		||||
      `${pageLink.toQuery()}`, {...filters, eventType},
 | 
			
		||||
      defaultHttpOptionsFromConfig(config));
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -84,7 +84,7 @@
 | 
			
		||||
                    [fxShow]="actionDescriptor.isEnabled()" *ngFor="let actionDescriptor of headerActionDescriptors"
 | 
			
		||||
                    matTooltip="{{ actionDescriptor.name }}"
 | 
			
		||||
                    matTooltipPosition="above"
 | 
			
		||||
                    (click)="actionDescriptor.onAction($event, entitiesTableConfig)">
 | 
			
		||||
                    (click)="actionDescriptor.onAction($event, entitiesTableConfig, pageLink)">
 | 
			
		||||
              <mat-icon *ngIf="actionDescriptor.isMdiIcon" [svgIcon]="actionDescriptor.icon"></mat-icon>
 | 
			
		||||
              <mat-icon *ngIf="!actionDescriptor.isMdiIcon">{{actionDescriptor.icon}}</mat-icon>
 | 
			
		||||
            </button>
 | 
			
		||||
 | 
			
		||||
@ -140,8 +140,8 @@ export class EventTableConfig extends EntityTableConfig<Event, TimePageLink> {
 | 
			
		||||
      name: this.translate.instant('event.clean-events'),
 | 
			
		||||
      icon: 'delete',
 | 
			
		||||
      isEnabled: () => true,
 | 
			
		||||
      onAction: ($event, entity) => {
 | 
			
		||||
        this.eventService.clearEvents(entity.entityId, entity.eventType, entity.filterParams, entity.tenantId, , ).subscribe();
 | 
			
		||||
      onAction: ($event, entity, pageLink: TimePageLink) => {
 | 
			
		||||
        this.eventService.clearEvents(entity.entityId, entity.eventType, entity.filterParams, entity.tenantId, pageLink).subscribe();
 | 
			
		||||
     }
 | 
			
		||||
    });
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
@ -75,7 +75,7 @@ export interface HeaderActionDescriptor {
 | 
			
		||||
  icon: string;
 | 
			
		||||
  isMdiIcon?: boolean;
 | 
			
		||||
  isEnabled: () => boolean;
 | 
			
		||||
  onAction: ($event: MouseEvent, entity?) => void;
 | 
			
		||||
  onAction: ($event: MouseEvent, entity?, pageLink?) => void;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export type EntityTableColumnType = 'content' | 'action';
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user