From 74ad98e5b7b99b50057fce575cb43d58a6e8e8af Mon Sep 17 00:00:00 2001 From: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Date: Tue, 9 Nov 2021 20:52:19 -0500 Subject: [PATCH] [data.search] Remove warning toast (#117252) (#118120) * [data.search] Remove toast notification for warnings * Update docs * Review feedback Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Lukas Olson --- src/plugins/data/common/search/types.ts | 2 +- .../data/public/search/fetch/handle_response.tsx | 12 +----------- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/src/plugins/data/common/search/types.ts b/src/plugins/data/common/search/types.ts index 68a25d4c4d69d..e9b6160c4a75a 100644 --- a/src/plugins/data/common/search/types.ts +++ b/src/plugins/data/common/search/types.ts @@ -71,7 +71,7 @@ export interface IKibanaSearchResponse { isRestored?: boolean; /** - * Optional warnings that should be surfaced to the end user + * Optional warnings returned from Elasticsearch (for example, deprecation warnings) */ warning?: string; diff --git a/src/plugins/data/public/search/fetch/handle_response.tsx b/src/plugins/data/public/search/fetch/handle_response.tsx index f4acebfb36060..9e68209af2b92 100644 --- a/src/plugins/data/public/search/fetch/handle_response.tsx +++ b/src/plugins/data/public/search/fetch/handle_response.tsx @@ -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({