Skip to content

Commit e51b75d

Browse files
committed
feat: enhance playbook UI and loading behavior, add new alert fields
Signed-off-by: Manuel Abascal <mjabascal10@gmail.com>
1 parent 5cc2ab7 commit e51b75d

4 files changed

Lines changed: 45 additions & 44 deletions

File tree

frontend/src/app/incident-response/playbooks/playbooks.component.html

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -102,20 +102,20 @@ <h5 class="card-title mb-0 label-header">FLOWS</h5>
102102
</div>
103103
</div>
104104
</div>
105-
</div>
106105

107-
<div class="col-12 text-center py-5">
108106
<ng-container *ngIf="{ loading: playbookService.loading$ | async,
109107
totalItems: playbookService.totalItems$ | async
110108
} as data">
111109
<ng-container *ngIf="!data.loading && data.totalItems === 0">
112-
<i class="icon-play text-muted mb-3" style="font-size: 48px;"></i>
113-
<h4 class="mb-1 font-weight-semibold text-muted">Start building</h4>
114-
<p class="text-muted mb-4">Begin with a template, or start from scratch.</p>
115-
<a (click)="newPlaybook()" class="btn utm-button utm-button-primary">
116-
<i class="icon-plus2 mr-1"></i>
117-
New Flow
118-
</a>
110+
<div class="d-flex flex-column align-items-center justify-content-center">
111+
<i class="icon-play text-muted mb-3" style="font-size: 48px;"></i>
112+
<h4 class="mb-1 font-weight-semibold text-muted">Start building</h4>
113+
<p class="text-muted mb-4">Begin with a template, or start from scratch.</p>
114+
<a (click)="newPlaybook()" class="btn utm-button utm-button-primary">
115+
<i class="icon-plus2 mr-1"></i>
116+
New Flow
117+
</a>
118+
</div>
119119
</ng-container>
120120
<app-utm-spinner
121121
class="position-absolute right-50"
@@ -129,6 +129,8 @@ <h4 class="mb-1 font-weight-semibold text-muted">Start building</h4>
129129

130130

131131

132+
133+
132134
<div *ngIf="playbookService.totalItems$ | async as totalItems" class="mt-3">
133135
<div class="row justify-content-center">
134136
<ngb-pagination (pageChange)="loadPage($event)"

frontend/src/app/incident-response/playbooks/playbooks.component.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@ export class PlaybooksComponent implements OnInit, AfterViewInit, OnDestroy {
3232
sort: '',
3333
'active.equals': null,
3434
'agentPlatform.equals': null,
35-
'createdBy.equals': null,
36-
'systemOwner.equals': false
35+
'createdBy.equals': null
3736
};
3837
platforms: string[];
3938
users: string[];

frontend/src/app/incident-response/shared/services/playbook.service.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export class PlaybookService {
2020
playbooks$ = this.request$.pipe(
2121
filter(request => !!request),
2222
switchMap(request => {
23-
this.loading.next(true);
23+
setTimeout(() => this.loading.next(true), 300);
2424
return this.incidentResponseRuleService.query(request).pipe(
2525
map(response => {
2626
this.totalItems.next(Number(response.headers.get('X-Total-Count')));
@@ -30,7 +30,7 @@ export class PlaybookService {
3030
this.utmToastService.showError('Error', 'An error occurred while fetching playbooks.');
3131
return of([]);
3232
}),
33-
finalize(() => this.loading.next(false))
33+
finalize(() => setTimeout(() => this.loading.next(false), 200))
3434
);
3535
})
3636
);

frontend/src/app/shared/constants/alert/alert-field.constant.ts

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -480,6 +480,36 @@ export const ALERT_FILTERS_FIELDS: UtmFieldType[] = [
480480
type: ElasticDataTypesEnum.STRING,
481481
visible: false,
482482
},
483+
{
484+
label: 'Category',
485+
field: ALERT_CATEGORY_FIELD,
486+
type: ElasticDataTypesEnum.STRING,
487+
visible: true,
488+
},
489+
{
490+
label: 'Sensor',
491+
field: ALERT_SENSOR_FIELD,
492+
type: ElasticDataTypesEnum.STRING,
493+
visible: true,
494+
},
495+
{
496+
label: 'Time',
497+
field: ALERT_TIMESTAMP_FIELD,
498+
type: ElasticDataTypesEnum.DATE,
499+
visible: false,
500+
},
501+
{
502+
label: 'Incident Name',
503+
field: ALERT_INCIDENT_NAME_FIELD,
504+
type: ElasticDataTypesEnum.STRING,
505+
visible: true,
506+
},
507+
{
508+
label: 'Tags',
509+
field: ALERT_TAGS_FIELD,
510+
type: ElasticDataTypesEnum.STRING,
511+
visible: true,
512+
},
483513
{
484514
label: 'Adversary IP',
485515
field: ALERT_ADVERSARY_IP_FIELD,
@@ -575,37 +605,7 @@ export const ALERT_FILTERS_FIELDS: UtmFieldType[] = [
575605
field: ALERT_TARGET_GEOLOCATION_LONGITUDE_FIELD,
576606
type: ElasticDataTypesEnum.STRING,
577607
visible: false,
578-
},
579-
{
580-
label: 'Category',
581-
field: ALERT_CATEGORY_FIELD,
582-
type: ElasticDataTypesEnum.STRING,
583-
visible: true,
584-
},
585-
{
586-
label: 'Sensor',
587-
field: ALERT_SENSOR_FIELD,
588-
type: ElasticDataTypesEnum.STRING,
589-
visible: true,
590-
},
591-
{
592-
label: 'Time',
593-
field: ALERT_TIMESTAMP_FIELD,
594-
type: ElasticDataTypesEnum.DATE,
595-
visible: false,
596-
},
597-
{
598-
label: 'Incident Name',
599-
field: ALERT_INCIDENT_NAME_FIELD,
600-
type: ElasticDataTypesEnum.STRING,
601-
visible: true,
602-
},
603-
{
604-
label: 'Tags',
605-
field: ALERT_TAGS_FIELD,
606-
type: ElasticDataTypesEnum.STRING,
607-
visible: true,
608-
},
608+
}
609609
];
610610

611611
export const EVENT_FIELDS: UtmFieldType[] = [

0 commit comments

Comments
 (0)