Skip to content

Commit 2c1fe57

Browse files
committed
feat: add detail view for alerts in echoes component and improve alert display
Signed-off-by: Manuel Abascal <mjabascal10@gmail.com>
1 parent 33ec951 commit 2c1fe57

File tree

5 files changed

+40
-23
lines changed

5 files changed

+40
-23
lines changed

frontend/src/app/data-management/alert-management/shared/components/alert-description/alert-description.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div *ngIf="alertDetail" class="w-100 mt-2">
1+
<div *ngIf="alertDetail" class="w-100 mt-2 text-wrap">
22
<span class="font-weight-semibold">Summary:</span>
33
<p [innerHTML]="alertDetail" class="font-weight-light">
44
</p>

frontend/src/app/data-management/alert-management/shared/components/alert-echoes/alert-echoes.component.html

Lines changed: 32 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -15,29 +15,29 @@
1515
</tr>
1616
</thead>
1717
<tbody *ngIf="alerts && alerts.length > 0">
18-
<ng-container *ngFor="let alert of alerts">
19-
<ng-container *ngTemplateOutlet="alertRowTemplate; context: { $implicit: alert }"></ng-container>
20-
</ng-container>
18+
<ng-container *ngFor="let alert of alerts">
19+
<ng-container *ngTemplateOutlet="alertRowTemplate; context: { $implicit: alert }"></ng-container>
20+
</ng-container>
2121
</tbody>
2222
<tbody *ngIf="(alerts && alerts.length===0) && !loading">
23-
<tr>
24-
<td [attr.colspan]="fields.length +1">
25-
<app-no-data-found></app-no-data-found>
26-
</td>
27-
</tr>
23+
<tr>
24+
<td [attr.colspan]="fields.length +1">
25+
<app-no-data-found></app-no-data-found>
26+
</td>
27+
</tr>
2828
</tbody>
2929
<tbody *ngIf="loading">
30-
<tr>
31-
<td [attr.colspan]="fields.length + 1">
32-
<div class="p-5 d-flex justify-content-center align-items-center text-blue-800">
33-
<app-utm-spinner [height]="'35px'"
34-
[label]="'Loading...'"
35-
[loading]="loading"
36-
[width]="'35px'">
37-
</app-utm-spinner>
38-
</div>
39-
</td>
40-
</tr>
30+
<tr>
31+
<td [attr.colspan]="fields.length + 1">
32+
<div class="p-5 d-flex justify-content-center align-items-center text-blue-800">
33+
<app-utm-spinner [height]="'35px'"
34+
[label]="'Loading...'"
35+
[loading]="loading"
36+
[width]="'35px'">
37+
</app-utm-spinner>
38+
</div>
39+
</td>
40+
</tr>
4141
</tbody>
4242
</table>
4343
</div>
@@ -58,7 +58,7 @@
5858
</div>
5959

6060
<ng-template #alertRowTemplate let-alert>
61-
<tr class="cursor-pointer">
61+
<tr (click)="viewDetail(alert)" class="cursor-pointer">
6262
<ng-container *ngFor="let td of fields">
6363
<td *ngIf="td.visible"
6464
[ngClass]="{'min-width': td.field === ALERT_ADVERSARY_FIELD || td.field === ALERT_TARGET_FIELD}">
@@ -68,4 +68,16 @@
6868
</td>
6969
</ng-container>
7070
</tr>
71+
<ng-container *ngIf="alert.expanded">
72+
<tr>
73+
<td style="height: 500px" [attr.colspan]="fields.length + 2" >
74+
<app-alert-view-detail (refreshData)="onRefreshData($event)"
75+
[isEcho]=" true"
76+
[alert]="alert"
77+
[hideEmptyField]=" true"
78+
[dataType]="dataType">
79+
</app-alert-view-detail>
80+
</td>
81+
</tr>
82+
</ng-container>
7183
</ng-template>

frontend/src/app/data-management/alert-management/shared/components/alert-echoes/alert-echoes.component.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import {HttpResponse} from '@angular/common/http';
22
import {Component, Input, OnInit} from '@angular/core';
33
import {UtmToastService} from '../../../../../shared/alert/utm-toast.service';
44
import {
5-
ALERT_ADVERSARY_FIELD, ALERT_ECHOES_FIELDS, ALERT_PARENT_ID,
5+
ALERT_ADVERSARY_FIELD, ALERT_ECHOES_FIELDS, ALERT_FIELDS, ALERT_PARENT_ID,
66
ALERT_STATUS_FIELD_AUTO, ALERT_TAGS_FIELD,
77
ALERT_TARGET_FIELD, ALERT_TIMESTAMP_FIELD, FALSE_POSITIVE_OBJECT
88
} from '../../../../../shared/constants/alert/alert-field.constant';
@@ -94,4 +94,8 @@ export class AlertEchoesComponent implements OnInit {
9494
this.itemsPerPage = $event;
9595
this.loadChildrenAlerts();
9696
}
97+
98+
protected viewDetail(alert: UtmAlertType) {
99+
alert.expanded = !alert.expanded;
100+
}
97101
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@
9797
<app-alert-apply-note (applyNote)="refreshData.emit(true);" [alert]="alert"
9898
[showNote]="true"></app-alert-apply-note>
9999
</div>
100-
<div class="alert-details w-100 d-flex justify-content-start mb-2 ">
100+
<div *ngIf="!isEcho" class="alert-details w-100 d-flex justify-content-start mb-2 ">
101101
<span class="text-blue-800 font-weight-light has-minimum-width">Tags:</span>&nbsp;
102102
<app-alert-tags-apply (applyTagsEvent)="onApplyTags($event)"
103103
[alert]="alert"

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ export class AlertViewDetailComponent implements OnInit {
4040
@Input() hideEmptyField = false;
4141
@Input() dataType: EventDataTypeEnum;
4242
@Input() tags: AlertTags[];
43+
@Input() isEcho = false;
4344
@Input() timeFilter: ElasticFilterType;
4445
@Output() refreshData = new EventEmitter<boolean>();
4546
ALERT_NAME = ALERT_NAME_FIELD;

0 commit comments

Comments
 (0)