diff --git a/frontend/src/app/data-management/alert-management/shared/components/alert-actions/alert-apply-tags/alert-tags-apply.component.html b/frontend/src/app/data-management/alert-management/shared/components/alert-actions/alert-apply-tags/alert-tags-apply.component.html index 10901e8d7..1231f790e 100644 --- a/frontend/src/app/data-management/alert-management/shared/components/alert-actions/alert-apply-tags/alert-tags-apply.component.html +++ b/frontend/src/app/data-management/alert-management/shared/components/alert-actions/alert-apply-tags/alert-tags-apply.component.html @@ -1,4 +1,3 @@ -
- +   {{ action.label }} diff --git a/frontend/src/app/data-management/alert-management/shared/components/alert-actions/alert-apply-tags/alert-tags-apply.component.ts b/frontend/src/app/data-management/alert-management/shared/components/alert-actions/alert-apply-tags/alert-tags-apply.component.ts index 205809292..62eafca1d 100644 --- a/frontend/src/app/data-management/alert-management/shared/components/alert-actions/alert-apply-tags/alert-tags-apply.component.ts +++ b/frontend/src/app/data-management/alert-management/shared/components/alert-actions/alert-apply-tags/alert-tags-apply.component.ts @@ -4,6 +4,7 @@ import {AlertTags} from '../../../../../../shared/types/alert/alert-tag.type'; import {UtmAlertType} from '../../../../../../shared/types/alert/utm-alert.type'; import {AlertUpdateTagBehavior} from '../../../behavior/alert-update-tag.behavior'; import {AlertRuleCreateComponent} from '../../alert-rule-create/alert-rule-create.component'; +import { FALSE_POSITIVE_OBJECT } from 'src/app/shared/constants/alert/alert-field.constant'; @Component({ selector: 'app-alert-tags-apply', @@ -51,10 +52,11 @@ export class AlertTagsApplyComponent implements OnInit, OnChanges { } } - addNewTagRule() { + addNewTagRule(isFalsePositive: boolean = false) { const modalRef = this.modalService.open(AlertRuleCreateComponent, {centered: true, size: 'lg'}); modalRef.componentInstance.alert = this.alert; modalRef.componentInstance.action = 'select'; + modalRef.componentInstance.isFalsePositiveRule = isFalsePositive; modalRef.componentInstance.ruleAdd.subscribe((created) => { this.icon = this.getTagIcon(); this.color = this.getColor(); diff --git a/frontend/src/app/data-management/alert-management/shared/components/alert-rule-create/alert-rule-create.component.ts b/frontend/src/app/data-management/alert-management/shared/components/alert-rule-create/alert-rule-create.component.ts index dc5c87df9..a5e3e8cd0 100644 --- a/frontend/src/app/data-management/alert-management/shared/components/alert-rule-create/alert-rule-create.component.ts +++ b/frontend/src/app/data-management/alert-management/shared/components/alert-rule-create/alert-rule-create.component.ts @@ -63,6 +63,7 @@ import {AlertActionRefreshService} from "../../services/alert-action-refresh.ser export class AlertRuleCreateComponent implements OnInit, OnDestroy { @Input() alert: UtmAlertType; @Input() isForComplete = false; + @Input() isFalsePositiveRule = false; @Input() action: 'create' | 'update' | 'select' = 'create'; @Input() rule: AlertRuleType; @Output() ruleAdd = new EventEmitter(); @@ -159,10 +160,14 @@ export class AlertRuleCreateComponent implements OnInit, OnDestroy { }); if (this.rule) { - this.filters = [... this.rule.conditions]; + this.filters = [...this.rule.conditions]; this.selected = this.rule.tags.length > 0 ? [...this.rule.tags] : []; } + if (this.isFalsePositiveRule) { + this.selected.push(FALSE_POSITIVE_OBJECT); + } + this.alerts$ = this.alertService.onRefresh$ .pipe( takeUntil(this.destroy$), @@ -362,7 +367,7 @@ export class AlertRuleCreateComponent implements OnInit, OnDestroy { } isFalsePositive() { - return this.selected.findIndex(value => value.tagName.includes('False positive')) !== -1; + return this.isFalsePositiveRule || this.selected.findIndex(value => value.tagName.includes('False positive')) !== -1; } getOperators(conditionField: string) { diff --git a/frontend/src/environments/environment.ts b/frontend/src/environments/environment.ts index a9c376b4f..d1fff92cc 100644 --- a/frontend/src/environments/environment.ts +++ b/frontend/src/environments/environment.ts @@ -4,8 +4,8 @@ export const environment = { production: false, - //SERVER_API_URL: 'https://192.168.1.18/', - SERVER_API_URL: 'http://localhost:8080/', + SERVER_API_URL: 'https://192.168.1.18/', + // SERVER_API_URL: 'http://localhost:8080/', SERVER_API_CONTEXT: '', SESSION_AUTH_TOKEN: window.location.host.split(':')[0].toLocaleUpperCase(), WEBSOCKET_URL: '//localhost:8080',