Skip to content

Commit

Permalink
[data.search] Remove warning toast (#117252) (#118120)
Browse files Browse the repository at this point in the history
* [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 <olson.lukas@gmail.com>
  • Loading branch information
kibanamachine and lukasolson authored Nov 10, 2021
1 parent 4dc230c commit 74ad98e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/plugins/data/common/search/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
12 changes: 1 addition & 11 deletions src/plugins/data/public/search/fetch/handle_response.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down

0 comments on commit 74ad98e

Please sign in to comment.