Skip to content

Commit

Permalink
Fix severity level change condition at alert row
Browse files Browse the repository at this point in the history
  • Loading branch information
swaterkamp committed Dec 11, 2020
1 parent 2f7f20e commit 5030ea5
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions gsa/src/web/pages/alerts/condition.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import {
CONDITION_TYPE_FILTER_COUNT_CHANGED,
CONDITION_TYPE_SEVERITY_AT_LEAST,
CONDITION_DIRECTION_DECREASED,
CONDITION_DIRECTION_INCREASED,
} from 'gmp/models/alert';

const Condition = ({condition = {}, event}) => {
Expand Down Expand Up @@ -85,10 +86,11 @@ const Condition = ({condition = {}, event}) => {
}

if (condition.type === 'Severity changed') {
if (isDefined(condition.data.direction)) {
if (condition.data.direction.value === CONDITION_DIRECTION_DECREASED) {
return _('Severity level decreased');
}
if (condition?.data?.direction?.value === CONDITION_DIRECTION_DECREASED) {
return _('Severity level decreased');
} else if (
condition?.data?.direction?.value === CONDITION_DIRECTION_INCREASED
) {
return _('Severity level increased');
}
return _('Severity level changed');
Expand Down

0 comments on commit 5030ea5

Please sign in to comment.