Skip to content

Commit

Permalink
Merge branch 'main' into 162768-update-rule-creation-form-design-thre…
Browse files Browse the repository at this point in the history
…shold-rule
  • Loading branch information
fkanout authored Aug 10, 2023
2 parents 0e9f8fe + c97d496 commit 386bbfc
Show file tree
Hide file tree
Showing 56 changed files with 2,037 additions and 184 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,7 @@ src/plugins/screenshot_mode @elastic/appex-sharedux
x-pack/examples/screenshotting_example @elastic/appex-sharedux
x-pack/plugins/screenshotting @elastic/kibana-reporting-services
examples/search_examples @elastic/kibana-data-discovery
packages/kbn-search-response-warnings @elastic/kibana-data-discovery
x-pack/plugins/searchprofiler @elastic/platform-deployment-management
x-pack/test/security_api_integration/packages/helpers @elastic/kibana-core
x-pack/plugins/security @elastic/kibana-security
Expand Down
1 change: 1 addition & 0 deletions .i18nrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
"server": "src/legacy/server",
"share": "src/plugins/share",
"sharedUXPackages": "packages/shared-ux",
"searchResponseWarnings": "packages/kbn-search-response-warnings",
"securitySolutionPackages": "x-pack/packages/security-solution",
"serverlessPackages": "packages/serverless",
"coloring": "packages/kbn-coloring/src",
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,7 @@
"@kbn/screenshotting-example-plugin": "link:x-pack/examples/screenshotting_example",
"@kbn/screenshotting-plugin": "link:x-pack/plugins/screenshotting",
"@kbn/search-examples-plugin": "link:examples/search_examples",
"@kbn/search-response-warnings": "link:packages/kbn-search-response-warnings",
"@kbn/searchprofiler-plugin": "link:x-pack/plugins/searchprofiler",
"@kbn/security-plugin": "link:x-pack/plugins/security",
"@kbn/security-solution-ess": "link:x-pack/plugins/security_solution_ess",
Expand Down
3 changes: 3 additions & 0 deletions packages/kbn-search-response-warnings/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# @kbn/search-response-warnings

Components and utils to render warnings which happen when executing search request. For example, shard failures and time outs.
19 changes: 19 additions & 0 deletions packages/kbn-search-response-warnings/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/

export type { SearchResponseInterceptedWarning } from './src/types';

export {
SearchResponseWarnings,
type SearchResponseWarningsProps,
} from './src/components/search_response_warnings';

export {
getSearchResponseInterceptedWarnings,
removeInterceptedWarningDuplicates,
} from './src/utils/get_search_response_intercepted_warnings';
13 changes: 13 additions & 0 deletions packages/kbn-search-response-warnings/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/

module.exports = {
preset: '@kbn/test',
rootDir: '../..',
roots: ['<rootDir>/packages/kbn-search-response-warnings'],
};
5 changes: 5 additions & 0 deletions packages/kbn-search-response-warnings/kibana.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"type": "shared-common",
"id": "@kbn/search-response-warnings",
"owner": "@elastic/kibana-data-discovery"
}
6 changes: 6 additions & 0 deletions packages/kbn-search-response-warnings/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": "@kbn/search-response-warnings",
"private": true,
"version": "1.0.0",
"license": "SSPL-1.0 OR Elastic License 2.0"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/

import type { SearchResponseWarning } from '@kbn/data-plugin/public';

export const searchResponseTimeoutWarningMock: SearchResponseWarning = {
type: 'timed_out',
message: 'Data might be incomplete because your request timed out',
reason: undefined,
};

export const searchResponseShardFailureWarningMock: SearchResponseWarning = {
type: 'shard_failure',
message: '3 of 4 shards failed',
text: 'The data might be incomplete or wrong.',
reason: {
type: 'illegal_argument_exception',
reason: 'Field [__anonymous_] of type [boolean] does not support custom formats',
},
};

export const searchResponseWarningsMock: SearchResponseWarning[] = [
searchResponseTimeoutWarningMock,
searchResponseShardFailureWarningMock,
{
type: 'shard_failure',
message: '3 of 4 shards failed',
text: 'The data might be incomplete or wrong.',
reason: {
type: 'query_shard_exception',
reason:
'failed to create query: [.ds-kibana_sample_data_logs-2023.07.11-000001][0] Testing shard failures!',
},
},
{
type: 'shard_failure',
message: '1 of 4 shards failed',
text: 'The data might be incomplete or wrong.',
reason: {
type: 'query_shard_exception',
reason:
'failed to create query: [.ds-kibana_sample_data_logs-2023.07.11-000001][0] Testing shard failures!',
},
},
];
Loading

0 comments on commit 386bbfc

Please sign in to comment.