import { PartitionInterval } from './partitionInterval' ; import { Pipe , Injectable , PipeTransform } from '@angular/core' ; export class Partition { constructor ( public topic , public partition , public status , public start , public end ) { } get isError ( ) : boolean { return this . status === 'ERR' ; } get isWarning ( ) : boolean { return this . status !== 'ERR' && this . status !== 'OK' ; } get isOkay ( ) : boolean { return this . status === 'OK' ; } } @ Pipe ( { name : 'partitionFilter' , pure : false } ) @ Injectable ( ) export class PartitionFilterPipe implements PipeTransform { transform ( items , args ) { return items . filter ( item => args . indexOf ( item . status ) !== - 1 ) ; } }