diff --git a/ui-ngx/src/app/modules/home/components/event/event-filter-panel.component.html b/ui-ngx/src/app/modules/home/components/event/event-filter-panel.component.html index 0568a2d572..6a017f214e 100644 --- a/ui-ngx/src/app/modules/home/components/event/event-filter-panel.component.html +++ b/ui-ngx/src/app/modules/home/components/event/event-filter-panel.component.html @@ -29,6 +29,15 @@ + + + {{ column.title | translate}} + + + {{ 'event.min-value' | translate }} + + + {{ 'event.has-error' | translate }} diff --git a/ui-ngx/src/app/modules/home/components/event/event-filter-panel.component.ts b/ui-ngx/src/app/modules/home/components/event/event-filter-panel.component.ts index 3d016e361e..f60f7a09f7 100644 --- a/ui-ngx/src/app/modules/home/components/event/event-filter-panel.component.ts +++ b/ui-ngx/src/app/modules/home/components/event/event-filter-panel.component.ts @@ -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': diff --git a/ui-ngx/src/app/modules/home/components/event/event-table-config.ts b/ui-ngx/src/app/modules/home/components/event/event-table-config.ts index 3066de554b..1dc663684f 100644 --- a/ui-ngx/src/app/modules/home/components/event/event-table-config.ts +++ b/ui-ngx/src/app/modules/home/components/event/event-table-config.ts @@ -295,8 +295,8 @@ export class EventTableConfig extends EntityTableConfig { break; case EventType.STATS: this.filterColumns.push( - {key: 'messagesProcessed', title: 'event.messages-processed'}, - {key: 'errorsOccurred', title: 'event.errors-occurred'} + {key: 'messagesProcessed', title: 'event.min-messages-processed'}, + {key: 'errorsOccurred', title: 'event.min-errors-occurred'} ); break; case DebugEventType.DEBUG_RULE_NODE: diff --git a/ui-ngx/src/assets/locale/locale.constant-en_US.json b/ui-ngx/src/assets/locale/locale.constant-en_US.json index d028bf5158..a24bfd83ad 100644 --- a/ui-ngx/src/assets/locale/locale.constant-en_US.json +++ b/ui-ngx/src/assets/locale/locale.constant-en_US.json @@ -1641,7 +1641,10 @@ "success": "Success", "failed": "Failed", "messages-processed": "Messages processed", + "min-messages-processed": "Minimum messages processed", "errors-occurred": "Errors occurred", + "min-errors-occurred": "Minimum errors occurred", + "min-value": "Minimum value is 0.", "all-events": "All", "has-error": "Has error", "entity-id": "Entity Id",