-
Notifications
You must be signed in to change notification settings - Fork 8.1k
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
[ML] Notifications indicator #140944
[ML] Notifications indicator #140944
Conversation
Pinging @elastic/ml-ui (:ml) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good overall! Left some comments with suggestions. Did some local testing and was able to trigger the notifications icon including errors.
x-pack/plugins/ml/public/application/components/ml_page/notifications_indicator.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/ml/public/application/components/ml_page/notifications_indicator.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One comment on something that Walter has already spotted but I added a suggestion anyway. Otherwise UI text LGTM!
x-pack/plugins/ml/public/application/components/ml_page/notifications_indicator.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Latest changes LGTM.
if (globalState?.time || !lastCheckedAt) return; | ||
|
||
timeFilter.setTime({ | ||
from: moment(lastCheckedAt).toISOString(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be better to remember the last setting in the time picker rather than setting it to the time of the latest checked notification - for example I end up continually resetting to Last 24 hours
when I switch back to the page?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we could add an extra column to the table (8.6+) which indicates if a notification is 'new'? At that point it might be worth changing the behavior to preserve the time picker setting from the last visit to the page. Till then, this current behavior is a good way of showing the unread notifications.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, I implemented it like this initially but then decided to change to behaviour here.
Because imagine you have a time picker set to some time in the past (this can easily happen when you open anomaly explorer). And when you click the Notification link in the side nav, it's going to preserve this time range and it might be confusing for the user.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I wasn't thinking of using the time range from the global state, but stashing the last applied time range on the notifications page, where a common use case might be 'Last 1 hour' for example.
💚 Build Succeeded
Metrics [docs]Module Count
Async chunks
Unknown metric groupsESLint disabled line counts
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: cc @darnautov |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested and LGTM.
Let's wait for more feedback on how the time range is set in the page. Some way of indicating unread notifications is a possible for a follow-up in 8.6+.
Summary
Resolves #135417
Adds a notifications indicator to the side nav menu.
How it works
.ml-notifications*
index with an interval of 1 minute for new notifications that occurred after the stored timestampinfo
level, displays the generic notification indicatorHow to test
info
message, you can create any job or deploy model, start/stop datafeed, etc.error
, you can delete the source index of the anomaly detection job. Settingfrequency
for this job to something small should make it less time-consuming.Checklist