-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Convert notify.warning calls to use toastNotifications #20767
Changes from 15 commits
699cd0e
32d6cf7
e08de1c
d02d5ef
7bb60ce
b94c0fb
0e70114
c37c0b9
73e2399
8afc6dc
eaa5997
9e3267e
55a2a6e
6d83993
28a0bd3
20070bb
cedeae0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,10 +17,9 @@ | |
* under the License. | ||
*/ | ||
|
||
import { RequestFailure, SearchTimeout, ShardFailure } from '../../errors'; | ||
|
||
import { toastNotifications } from '../../notify'; | ||
import { RequestFailure } from '../../errors'; | ||
import { RequestStatus } from './req_status'; | ||
import { courierNotifier } from './notifier'; | ||
|
||
export function CallResponseHandlersProvider(Private, Promise) { | ||
const ABORTED = RequestStatus.ABORTED; | ||
|
@@ -35,11 +34,17 @@ export function CallResponseHandlersProvider(Private, Promise) { | |
const response = responses[index]; | ||
|
||
if (response.timed_out) { | ||
courierNotifier.warning(new SearchTimeout()); | ||
toastNotifications.addWarning({ | ||
title: 'The data shown may be incomplete', | ||
text: 'All or part of your request has timed out', | ||
}); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use a title only: Data might be incomplete because your request timed out |
||
} | ||
|
||
if (response._shards && response._shards.failed) { | ||
courierNotifier.warning(new ShardFailure(response)); | ||
toastNotifications.addWarning({ | ||
title: 'Shard failure', | ||
text: `${response._shards.failed} of ${response._shards.total} shards failed`, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. One of the most annoying things with shard failures currently is, that you don't get any insights into the actual failures, and that's very often a painpoint in discuss questions, since users need to check the actual browser request, and dig through that JSON. In the long run we definitely should build this notification in a way, that you can get a list of actual errors from the individual charts. Since you were anyway touching this place, I thought I mention that right now, in case you feel like we should do it within that PR. But I am also totally fine having that in a different PR (but I think we should take care of that rather sooner than later). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Great point Tim. I think this is outside of the scope for this PR, but I've updated #5957 with more information. Hopefully we can move on this sometime soon. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, it would be good to add more info about the shard failure. When you do, it might be good to put this information in something other than a toast because a toast times out after a few seconds. In the meantime, the toast can simply be one line: 3 of 6 shards failed |
||
}); | ||
} | ||
|
||
function progress() { | ||
|
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,7 @@ | |
* under the License. | ||
*/ | ||
|
||
import React, { Fragment } from 'react'; | ||
import _ from 'lodash'; | ||
import { SavedObjectNotFound, DuplicateField, IndexPatternMissingIndices } from '../errors'; | ||
import angular from 'angular'; | ||
|
@@ -120,13 +121,16 @@ export function IndexPatternProvider(Private, config, Promise, confirmModalPromi | |
|
||
if (indexPattern.isUnsupportedTimePattern()) { | ||
if (!isUserAwareOfUnsupportedTimePattern(indexPattern)) { | ||
const warning = ( | ||
'Support for time-intervals has been removed. ' + | ||
`View the ["${indexPattern.title}" index pattern in management](` + | ||
kbnUrl.getRouteHref(indexPattern, 'edit') + | ||
') for more information.' | ||
); | ||
notify.warning(warning, { lifetime: Infinity }); | ||
toastNotifications.addWarning({ | ||
title: 'Support for time-intervals has been removed', | ||
text: ( | ||
<Fragment> | ||
View the {' '} | ||
<a href={kbnUrl.getRouteHref(indexPattern, 'edit')}>{indexPattern.title} index pattern in management</a> | ||
{' '} for more information | ||
</Fragment> | ||
), | ||
}); | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Support for time intervals was removed For more information, view the log* index pattern. where "view the log* index pattern" is the link |
||
} | ||
|
||
|
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.
Unable to show 3 results on map
Ensure that each term matches a shape on that shape's join field.