Skip to content

Commit 1ad4d0c

Browse files
authored
Fixed Incident-response-trigger-select-cause-modal-scroll (#402) (#412)
1 parent 656b505 commit 1ad4d0c

File tree

3 files changed

+20
-16
lines changed

3 files changed

+20
-16
lines changed

frontend/src/app/incident-response/shared/component/ir-create-rule/ir-create-rule.component.html

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@
4242
<span class="text-blue-800 font-weight-bold step-title">
4343
Summary
4444
</span>
45-
<div [ngClass]="isCompleted(4)?'step-success':step===3?'step-active':'step-inactive'"
45+
<div [ngClass]="isCompleted(4) ? 'step-success':step === 4 ?'step-active' : 'step-inactive'"
4646
class="round-indicator">
47-
<i class="step-icon" [ngClass]="isCompleted(4)?'icon-checkmark3':'icon-eye'"></i>
47+
<i class="step-icon" [ngClass]="isCompleted(4) ? 'icon-checkmark3' : 'icon-eye'"></i>
4848
</div>
4949
</div>
5050
</div>
@@ -126,7 +126,7 @@
126126
[loading]="loadingData(condition.get('field').value)"
127127
[multiple]="false"
128128
[searchable]="true"
129-
class="flex-grow-1"
129+
class="flex-grow-1 w-30"
130130
formControlName="value"
131131
id="values">
132132
</ng-select>
@@ -149,7 +149,7 @@
149149
</div>
150150
</div>
151151
<div class="d-flex mt-3 flex-column">
152-
<div class="col-12 p-0">
152+
<div class="col-6 p-0">
153153
<label class="pb-1" for="exclude">Agent platform is</label>
154154
<ng-select [clearable]="false"
155155
[items]="platforms"
@@ -179,13 +179,15 @@
179179
</div>-->
180180
</div>
181181
<div class="d-flex mt-3 flex-column">
182-
<div class="col-12">
183182
<app-utm-toggle (toggleChange)="formRule.get('agentType').setValue($event)"
184183
[active]="formRule.get('agentType').value"
185184
[emitAtStart]="false"
186185
[customClass]="'pl-3'"
187-
[label]="'Select the agent handling strategy for the automation. By default, commands won\'t run on specified agents, even if the trigger conditions match. Alternatively, choose a default agent to run the automation if no other agent matches the criteria.'" class="mb-3"></app-utm-toggle>
188-
</div>
186+
[label]="'Agent handling strategy for the automation'"></app-utm-toggle>
187+
<div class="alert alert-info alert-styled-right mt-1 info-dismissible">
188+
<span class="font-weight-semibold">Info! </span>
189+
<span>Select the agent handling strategy for the automation. By default, commands won't run on specified agents, even if the trigger conditions match. Alternatively, choose a default agent to run the automation if no other agent matches the criteria.</span>
190+
</div>
189191
</div>
190192
<div *ngIf="formRule.get('agentType').value" class="d-flex mt-3 flex-column">
191193
<div class="col-12 p-0">
@@ -294,7 +296,6 @@
294296

295297
<button (click)="createRule()"
296298
*ngIf="step===4"
297-
[disabled]="!command || command === ''"
298299
class="btn utm-button utm-button-primary ml-2">
299300
<i [ngClass]="creating?'icon-spinner2 spinner':'icon-terminal'"></i>
300301
{{rule ? 'Edit' : 'Create'}} automation&nbsp;

frontend/src/app/incident-response/shared/component/ir-create-rule/ir-create-rule.component.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ export class IrCreateRuleComponent implements OnInit {
215215
this.formRule.get('name').setValue(this.rulePrefix + this.formRule.get('name').value);
216216
}
217217

218-
clearAgentTypeSelection(){
218+
clearAgentTypeSelection() {
219219
if (!this.formRule.get('agentType').value) {
220220
this.formRule.get('excludedAgents').setValue([]);
221221
} else {
@@ -247,11 +247,13 @@ export class IrCreateRuleComponent implements OnInit {
247247
}
248248

249249
isDisable(step: number) {
250+
console.log((!this.formRule.get('agentType').value && this.formRule.get('defaultAgent').value === ''));
250251
switch (step) {
251252
case 1:
252253
return !this.formRule.get('name').valid || !this.formRule.get('description').valid || this.exist;
253254
case 2:
254-
return !this.formRule.get('agentPlatform').valid || this.ruleConditions.length === 0;
255+
return !this.formRule.get('agentPlatform').valid || this.ruleConditions.length === 0
256+
|| (!this.formRule.get('agentType').value && !this.formRule.get('defaultAgent').value);
255257
case 3:
256258
return !this.command || this.command === '';
257259
}

frontend/src/app/incident-response/shared/component/ir-summary/ir-summary.component.html

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@
66
It will evaluate the following conditions:
77
</p>
88

9-
<div class="alert-details mb-1 mt-1"
10-
*ngFor="let condition of conditions">
11-
<span class="text-blue-800 font-weight-light has-minimum-width">{{getFieldName(condition.field)}}</span>&nbsp;
12-
<span class="font-weight-light font-weight-semibold">{{getFilterName(condition.operator)}}</span>&nbsp;
13-
<span class="">{{condition.value}}</span>&nbsp;
14-
</div>
9+
<ul class="mb-1 mt-1">
10+
<li class="ml-2" *ngFor="let condition of conditions">
11+
<span class="text-blue-800 font-weight-light has-minimum-width">{{'- ' + getFieldName(condition.field)}}</span>&nbsp;
12+
<span class="font-weight-light font-weight-semibold">{{getFilterName(condition.operator)}}</span>&nbsp;
13+
<span class="">{{condition.value}}</span>&nbsp;
14+
</li>
15+
</ul>
1516

1617
<span>
1718
On agents operating on the <strong>{{ platform | capitalize }}</strong> platform.

0 commit comments

Comments
 (0)