Skip to content

Commit 7f8be24

Browse files
authored
Merge pull request #1328 from utmstack/backlog/fix_incident_response_automation
fix(alert_management): added redirection to flow creation on alert incident response automation
2 parents d874dca + d9d089d commit 7f8be24

4 files changed

Lines changed: 19 additions & 4 deletions

File tree

frontend/src/app/data-management/alert-management/alert-view/alert-view.component.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,14 +196,15 @@ <h5 class="card-title mb-0 text-uppercase label-header">
196196
container="body"
197197
placement="top"
198198
tooltipClass="utm-tooltip-top"></i>
199+
199200
<app-alert-apply-incident (markAsIncident)="onSuccessMarkAsIncident($event)"
200201
*ngIf="dataType !== eventDataTypeEnum.INCIDENT"
201202
[alert]="alert"
202203
[eventType]="dataType"
203204
[multiple]="false">
204205
</app-alert-apply-incident>
205206
<i (click)="openIncidentResponseAutomationModal(alert)"
206-
[ngbTooltip]="'Create incident response automation'"
207+
[ngbTooltip]="'Create Flow'"
207208
class="cursor-pointer icon-terminal text-blue-800"
208209
container="body"
209210
placement="top"

frontend/src/app/data-management/alert-management/alert-view/alert-view.component.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -554,8 +554,9 @@ export class AlertViewComponent implements OnInit, OnDestroy {
554554
}
555555

556556
openIncidentResponseAutomationModal(alert: UtmAlertType) {
557-
const modal = this.modalService.open(IrCreateRuleComponent, {size: 'lg', centered: true});
558-
modal.componentInstance.alert = alert;
557+
this.router.navigate(['soar/create-flow'], {
558+
queryParams:{alertName:alert.name}
559+
})
559560
}
560561

561562
getFilterTime() {

frontend/src/app/data-management/alert-management/shared/components/alert-actions/alert-apply-incident/alert-apply-incident.component.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import {UtmAlertType} from '../../../../../../shared/types/alert/utm-alert.type'
99
import {AlertUpdateHistoryBehavior} from '../../../behavior/alert-update-history.behavior';
1010
import {EventDataTypeEnum} from '../../../enums/event-data-type.enum';
1111
import {AlertManagementService} from '../../../services/alert-management.service';
12-
1312
@Component({
1413
selector: 'app-alert-apply-incident',
1514
templateUrl: './alert-apply-incident.component.html',

frontend/src/app/incident-response/playbook-builder/playbook-builder.component.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,11 +119,25 @@ export class PlaybookBuilderComponent implements OnInit, OnDestroy {
119119
this.utmToastService.showError('Error', 'An error has occurred while fetching a rule');
120120
});
121121

122+
this.route.queryParams
123+
.pipe(
124+
filter(params => !!params && !!params.alertName),
125+
map(params => params.alertName)).subscribe((alertName)=>{
126+
this.addRuleCondition();
127+
const rc = this.ruleConditions.at(this.ruleConditions.length-1);
128+
rc.patchValue({
129+
field: 'name',
130+
value: alertName,
131+
});
132+
});
133+
122134
this.formRule.get('name').valueChanges.pipe(debounceTime(1000)).subscribe(value => {
123135
this.searchRule(this.rulePrefix + value);
124136
});
125137
}
126138

139+
140+
127141
get ruleConditions() {
128142
return this.formRule.get('conditions') as FormArray;
129143
}

0 commit comments

Comments
 (0)