|
|
|
@ -15,7 +15,7 @@ |
|
|
|
///
|
|
|
|
|
|
|
|
import { Component, Inject, InjectionToken } from '@angular/core'; |
|
|
|
import { FormBuilder, FormGroup } from '@angular/forms'; |
|
|
|
import { FormBuilder, FormGroup, Validators } from '@angular/forms'; |
|
|
|
import { OverlayRef } from '@angular/cdk/overlay'; |
|
|
|
import { EntityType } from '@shared/models/entity-type.models'; |
|
|
|
import { FilterEventBody } from '@shared/models/event.models'; |
|
|
|
@ -59,7 +59,11 @@ export class EventFilterPanelComponent { |
|
|
|
this.eventFilterFormGroup = this.fb.group({}); |
|
|
|
this.data.columns.forEach((column) => { |
|
|
|
this.showColumns.push(column); |
|
|
|
this.eventFilterFormGroup.addControl(column.key, this.fb.control(this.data.filterParams[column.key] || '')); |
|
|
|
const validators = []; |
|
|
|
if (this.isNumberFields(column.key)) { |
|
|
|
validators.push(Validators.min(0)); |
|
|
|
} |
|
|
|
this.eventFilterFormGroup.addControl(column.key, this.fb.control(this.data.filterParams[column.key] || '', validators)); |
|
|
|
if (column.key === 'isError') { |
|
|
|
this.conditionError = true; |
|
|
|
} |
|
|
|
@ -70,6 +74,10 @@ export class EventFilterPanelComponent { |
|
|
|
return ['msgDirectionType', 'status', 'entityName'].includes(key) ? key : ''; |
|
|
|
} |
|
|
|
|
|
|
|
isNumberFields(key: string): string { |
|
|
|
return ['messagesProcessed', 'errorsOccurred'].includes(key) ? key : ''; |
|
|
|
} |
|
|
|
|
|
|
|
selectorValues(key: string): string[] { |
|
|
|
switch (key) { |
|
|
|
case 'msgDirectionType': |
|
|
|
|