Skip to content

Commit

Permalink
Merge pull request #2623 from swaterkamp/SeverityLevelAlertCondition
Browse files Browse the repository at this point in the history
Fix display of severity level change alert condition
  • Loading branch information
bjoernricks authored Dec 12, 2020
2 parents 2f7f20e + 66a1f7b commit f621d28
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Use <predefined> to disable feed object editing and filter creation on feed status page [#2398](https://github.com/greenbone/gsa/pull/2398)

### Fixed
- Fixed display of alert condition "Severity changed" [#2623](https://github.com/greenbone/gsa/pull/2623)
- Fixed sanity check for port ranges [#2566](https://github.com/greenbone/gsa/pull/2566)
- Allow to delete processes without having had edges in BPM [#2507](https://github.com/greenbone/gsa/pull/2507)
- Fixed TLS certificate download for users with permissions [#2496](https://github.com/greenbone/gsa/pull/2496)
Expand Down
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 f621d28

Please sign in to comment.