[data.search] Remove warning toast (#117252)

* [data.search] Remove toast notification for warnings

* Update docs

* Review feedback

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
Lukas Olson 2021-11-09 16:31:01 -07:00 committed by GitHub
parent 5ffec0bd2c
commit ed19a9c1a9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 12 deletions

View file

@ -71,7 +71,7 @@ export interface IKibanaSearchResponse<RawResponse = any> {
isRestored?: boolean;
/**
* Optional warnings that should be surfaced to the end user
* Optional warnings returned from Elasticsearch (for example, deprecation warnings)
*/
warning?: string;

View file

@ -16,17 +16,7 @@ import { getNotifications } from '../../services';
import { SearchRequest } from '..';
export function handleResponse(request: SearchRequest, response: IKibanaSearchResponse) {
const { rawResponse, warning } = response;
if (warning) {
getNotifications().toasts.addWarning({
title: i18n.translate('data.search.searchSource.fetch.warningMessage', {
defaultMessage: 'Warning: {warning}',
values: {
warning,
},
}),
});
}
const { rawResponse } = response;
if (rawResponse.timed_out) {
getNotifications().toasts.addWarning({