Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stream alerting overview (#5310) #5311

merged 3 commits into from Nov 23, 2018

Stream alerting overview (#5310) #5311

merged 3 commits into from Nov 23, 2018


Copy link

@edmundoa edmundoa commented Nov 23, 2018

Backport of #5310 into 2.5.

The original code required some changes to remove conflicts (mostly due to loadable components and the different way in which we require some components now), and to adapt to 2.5. As not all pages had the same page header buttons, I modified that as well to match the status in master, which is way less confusing.

edmundoa added 3 commits Nov 23, 2018
* Fix parameter description on API

* Prepare Stream components for changes

- Fix linter errors
- Remove unnecessary `preventDefault()` calls

* Add skeleton of stream alerts overview page

* Freshen up ConditionAlertNotifications

- Rename to the more appropriate StreamAlertNotifications, since
  notifications are fetched for a stream, and not a condition
- Move the component to alertnotifications
- Fix some texts in the component
- Fix linter errors

* Add stream notifications to stream alerts page

* Add list of stream conditions to stream alerts page

* Change page header actions

* Add link to create new notification

* Small code improvements

- Fix linter errors
- Clean and simplify some code

* Hide notification configuration by default

Make element more compact by hiding configuration by default. Let user
expand the configuration by clicking on a link, similar to how we do
with stream rules in the streams page.

* Fix linter errors

* Unify display of alert conditions

Use the same component to render an alert condition, regardless of the

We still need to customize some of the features through props, but this
is more consistent with notifications.

* Add a details view flag on AlertCondition

For now this only removes the link to go to the alert condition details.

* Update alert condition page after edit/delete

* Update conditions lists after update/delete

* Add link to see alerts of a stream

This allows users to see alerts, conditions, and notifications for a
single stream from within the alert page.

* Don't render alert conditions without a stream

After deleting an alert condition, it is possible to run into a race
condition that tries to render the alert condition that just got
deleted, throwing an error.

This change avoids that situation by not rendering alert conditions that
are not found in the stream list.

* Make Alert component more reusable

Move filtering out of the component, and require only the props it

* Add alerts information into stream alerts overview

* Fetch common alerts data only once

* Load available alert condition types explicitly

Before this information loaded when the store was loaded, but also
sometimes by hand. In the end we only need that information in a handful
of pages, so better let them load it manually when they need it.

* Prefill condition stream from stream alerts page

When creating a new condition from the stream alerts overview page,
pre-select the stream the user is seeing in the new alert condition form.
The user still has the possibility of editing that selection later on.

* Prefill notification stream from stream alerts page

When creating a new notificaiton from the stream alerts overview page,
pre-select the stream the user is seeing in the new alert notification
The user still has the possibility of editing that selection later

* Reload data after condition update or delete

* Display unresolved alerts in stream alerts page

This is only meant to give a short summary of the stream alerts,
displaying unresolved alerts should suffice for now.

* Remove unused exception

* Auto-reload alerts

* Avoid stream alerts page jumping on data reload

First load should set the loading state, but further reloads need to be
less intrusive. This avoids page jumps because content is replaced by

* Change workflow for new condition or notification

Conditions and notifications work with one another, and both in the
context of a stream. Redirecting the user to the stream alerts overview
page after creating a new condition or notification will give the most
context of the change that was just made.

* Improve descriptions

* Fix linter errors
- Include missing import
- Remove React.Fragment
@edmundoa edmundoa added this to the 2.5.0 milestone Nov 23, 2018
@edmundoa edmundoa requested a review from bernd Nov 23, 2018
@bernd bernd self-assigned this Nov 23, 2018
bernd approved these changes Nov 23, 2018
@bernd bernd merged commit 4a168f3 into 2.5 Nov 23, 2018
2 of 3 checks passed
2 of 3 checks passed
ci-web-linter Jenkins build graylog-pr-linter-check 3004 has failed
graylog-project/pr Jenkins build graylog-project-pr-snapshot 2263 has succeeded
license/cla Contributor License Agreement is signed.
@bernd bernd deleted the stream-alerts-overview-2.5 branch Nov 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants