Skip to content

Commit f3f2ab5

Browse files
committed
feat: enhance playbook component with improved layout and functionality
Signed-off-by: Manuel Abascal <mjabascal10@gmail.com>
1 parent 00688f2 commit f3f2ab5

4 files changed

Lines changed: 20 additions & 9 deletions

File tree

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

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,11 @@ <h5 class="card-title mb-0 label-header">FLOWS</h5>
104104
</div>
105105
</div>
106106

107-
<div class="col-12 text-center py-5" *ngIf="playbookService.loading$ | async as loading" >
108-
<div *ngIf="playbookService.totalItems$ | async as totalItems" class="d-flex flex-column align-items-center justify-content-center">
109-
<ng-container *ngIf="!loading && totalItems === 0">
107+
<div class="col-12 text-center py-5">
108+
<ng-container *ngIf="{ loading: playbookService.loading$ | async,
109+
totalItems: playbookService.totalItems$ | async
110+
} as data">
111+
<ng-container *ngIf="!data.loading && data.totalItems === 0">
110112
<i class="icon-play text-muted mb-3" style="font-size: 48px;"></i>
111113
<h4 class="mb-1 font-weight-semibold text-muted">Start building</h4>
112114
<p class="text-muted mb-4">Begin with a template, or start from scratch.</p>
@@ -115,13 +117,18 @@ <h4 class="mb-1 font-weight-semibold text-muted">Start building</h4>
115117
New Flow
116118
</a>
117119
</ng-container>
118-
<app-utm-spinner class="position-absolute right-50" [height]="'110px'" [loading]="loading" [width]="'110px'"
119-
label="Loading playbooks">
120+
<app-utm-spinner
121+
class="position-absolute right-50"
122+
[height]="'110px'"
123+
[loading]="data.loading"
124+
[width]="'110px'"
125+
label="Loading playbooks">
120126
</app-utm-spinner>
121-
</div>
127+
</ng-container>
122128
</div>
123129

124130

131+
125132
<div *ngIf="playbookService.totalItems$ | async as totalItems" class="mt-3">
126133
<div class="row justify-content-center">
127134
<ngb-pagination (pageChange)="loadPage($event)"

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@
110110
gap: 1rem;
111111
align-items: stretch;
112112
overflow-y: auto;
113-
align-content: start;
113+
align-content: flex-start;
114114
}
115115

116116
.playbook-card {

frontend/src/app/incident-response/shared/component/action-sidebar/action-sidebar.component.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,11 @@ export class ActionSidebarComponent implements OnInit, OnDestroy {
3232
}
3333

3434
addToWorkFlow(action: any) {
35-
this.workFlowActionService.addActions(action);
35+
const actionToAdd = {
36+
...action,
37+
id: null
38+
};
39+
this.workFlowActionService.addActions(actionToAdd);
3640
}
3741

3842
searchReport($event: string ) {

frontend/src/app/incident-response/shared/component/new-playbook/new-playbook.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import {NgbActiveModal} from '@ng-bootstrap/ng-bootstrap';
44
import {Observable, of} from 'rxjs';
55
import {UtmToastService} from '../../../../shared/alert/utm-toast.service';
66
import {InputClassResolve} from '../../../../shared/util/input-class-resolve';
7-
import {PlaybookService} from '../../services/playbook.service';
87
import {IncidentResponseRuleService} from '../../services/incident-response-rule.service';
8+
import {PlaybookService} from '../../services/playbook.service';
99
import {IncidentActionType} from '../../type/incident-action.type';
1010

1111
@Component({

0 commit comments

Comments
 (0)