Skip to content
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

[search source] open incomplete response warning in inspector #167205

Merged
merged 30 commits into from
Oct 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
5418e5e
[search source] open incomplete response warning in inspector
nreese Sep 25, 2023
dc14303
[CI] Auto-commit changed files from 'node scripts/precommit_hook.js -…
kibanamachine Sep 25, 2023
5ba89fc
clean up
nreese Sep 26, 2023
8be7e78
remove older UIs
nreese Sep 26, 2023
b87abec
close popover when opening inspector
nreese Sep 26, 2023
8dc2a4f
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --…
kibanamachine Sep 26, 2023
7c9dff1
[CI] Auto-commit changed files from 'node scripts/eslint --no-cache -…
kibanamachine Sep 26, 2023
92a131a
Merge branch 'main' into open_in_inspector
kibanamachine Sep 27, 2023
19e48ae
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --…
kibanamachine Sep 27, 2023
b3ef76d
pass requestId to inspector open options
nreese Sep 27, 2023
cc15c68
open clusters tab
nreese Sep 27, 2023
b222181
tslint inspector plugin
nreese Sep 27, 2023
e387e92
[CI] Auto-commit changed files from 'node scripts/precommit_hook.js -…
kibanamachine Sep 27, 2023
654a01e
[CI] Auto-commit changed files from 'node scripts/eslint --no-cache -…
kibanamachine Sep 27, 2023
7481482
data plugin tslint
nreese Sep 27, 2023
060592b
fix tslint in extract_warnings.test
nreese Sep 27, 2023
fa046a6
tslint packates
nreese Sep 27, 2023
f957420
[CI] Auto-commit changed files from 'node scripts/eslint --no-cache -…
kibanamachine Sep 27, 2023
26c05cf
lens tslint
nreese Sep 28, 2023
e807b4c
merge with main
nreese Sep 28, 2023
1f797ec
fix extract_warnings tests
nreese Sep 28, 2023
69a31d8
update snapshot
nreese Sep 28, 2023
068bb68
i18n clean up
nreese Sep 28, 2023
cc7b01d
lint fixes
nreese Sep 28, 2023
a527ba1
Merge branch 'main' into open_in_inspector
kibanamachine Sep 28, 2023
e41e745
revert changes to tab names
nreese Sep 29, 2023
27579da
move logic for selecting next tab and add tests
nreese Sep 29, 2023
4d8fd88
[CI] Auto-commit changed files from 'node scripts/precommit_hook.js -…
kibanamachine Sep 29, 2023
648a601
Merge branch 'main' into open_in_inspector
stratoula Oct 2, 2023
2c47031
Merge branch 'main' into open_in_inspector
kibanamachine Oct 2, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,5 @@ export const searchResponseIncompleteWarningLocalCluster: SearchResponseWarning
],
},
},
openInInspector: () => {},
};
Original file line number Diff line number Diff line change
Expand Up @@ -36,49 +36,11 @@ describe('getSearchResponseInterceptedWarnings', () => {
expect(warnings.length).toBe(1);
expect(warnings[0].originalWarning).toEqual(searchResponseIncompleteWarningLocalCluster);
expect(warnings[0].action).toMatchInlineSnapshot(`
<OpenIncompleteResultsModalButton
<ViewWarningButton
color="primary"
getRequestMeta={[Function]}
isButtonEmpty={true}
onClick={[Function]}
size="s"
theme={
Object {
"theme$": Observable {
"_subscribe": [Function],
},
}
}
warning={
Object {
"clusters": Object {
"(local)": Object {
"_shards": Object {
"failed": 1,
"skipped": 0,
"successful": 3,
"total": 4,
},
"failures": Array [
Object {
"index": "sample-01-rollup",
"node": "VFTFJxpHSdaoiGxJFLSExQ",
"reason": Object {
"reason": "Field [kubernetes.container.memory.available.bytes] of type [aggregate_metric_double] is not supported for aggregation [percentiles]",
"type": "illegal_argument_exception",
},
"shard": 0,
},
],
"indices": "",
"status": "partial",
"timed_out": false,
"took": 25,
},
},
"message": "The data might be incomplete or wrong.",
"type": "incomplete",
}
}
/>
`);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,8 @@
*/

import React from 'react';
import {
type DataPublicPluginStart,
OpenIncompleteResultsModalButton,
} from '@kbn/data-plugin/public';
import { type DataPublicPluginStart, ViewWarningButton } from '@kbn/data-plugin/public';
import type { RequestAdapter } from '@kbn/inspector-plugin/common';
import type { CoreStart } from '@kbn/core-lifecycle-browser';
import type { SearchResponseInterceptedWarning } from '../types';

/**
Expand All @@ -27,28 +23,20 @@ export const getSearchResponseInterceptedWarnings = ({
}: {
services: {
data: DataPublicPluginStart;
theme: CoreStart['theme'];
};
adapter: RequestAdapter;
}): SearchResponseInterceptedWarning[] => {
const interceptedWarnings: SearchResponseInterceptedWarning[] = [];

services.data.search.showWarnings(adapter, (warning, meta) => {
const { request, response } = meta;

services.data.search.showWarnings(adapter, (warning) => {
interceptedWarnings.push({
originalWarning: warning,
action:
warning.type === 'incomplete' ? (
<OpenIncompleteResultsModalButton
theme={services.theme}
warning={warning}
size="s"
getRequestMeta={() => ({
request,
response,
})}
<ViewWarningButton
color="primary"
size="s"
onClick={warning.openInInspector}
isButtonEmpty={true}
/>
) : undefined,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ describe('hasUnsupportedDownsampledAggregationFailure', () => {
],
},
},
openInInspector: () => {},
})
).toBe(false);
});
Expand Down Expand Up @@ -74,6 +75,7 @@ describe('hasUnsupportedDownsampledAggregationFailure', () => {
],
},
},
openInInspector: () => {},
})
).toBe(true);
});
Expand Down
1 change: 0 additions & 1 deletion packages/kbn-search-response-warnings/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"@kbn/i18n",
"@kbn/inspector-plugin",
"@kbn/core",
"@kbn/core-lifecycle-browser",
],
"exclude": ["target/**/*"]
}
Loading
Loading