diff --git a/.buildkite/disabled_jest_configs.json b/.buildkite/disabled_jest_configs.json index 0d7741e60b385..fe51488c7066f 100644 --- a/.buildkite/disabled_jest_configs.json +++ b/.buildkite/disabled_jest_configs.json @@ -1,3 +1 @@ -[ - "x-pack/plugins/index_management/jest.config.js" -] \ No newline at end of file +[] diff --git a/.buildkite/ftr_configs.yml b/.buildkite/ftr_configs.yml index d6ca99493ec5d..62ca848819d1c 100644 --- a/.buildkite/ftr_configs.yml +++ b/.buildkite/ftr_configs.yml @@ -341,6 +341,7 @@ enabled: - x-pack/test/observability_onboarding_api_integration/basic/config.ts - x-pack/test/observability_onboarding_api_integration/cloud/config.ts - x-pack/test/observability_ai_assistant_api_integration/enterprise/config.ts + - x-pack/test/observability_ai_assistant_functional/enterprise/config.ts - x-pack/test/plugin_api_integration/config.ts - x-pack/test/plugin_functional/config.ts - x-pack/test/reporting_api_integration/reporting_and_security.config.ts diff --git a/.buildkite/scripts/steps/artifacts/trigger.sh b/.buildkite/scripts/steps/artifacts/trigger.sh index aac0c7166bf94..15c93c4c68a0d 100755 --- a/.buildkite/scripts/steps/artifacts/trigger.sh +++ b/.buildkite/scripts/steps/artifacts/trigger.sh @@ -12,9 +12,5 @@ echo "--- Trigger artifact builds" if [ "$BEATS_MANIFEST_LATEST_URL" = "$KIBANA_BEATS_MANIFEST_URL" ]; then echo "Kibana has the latest version of beats, skipping trigger" else - # Staging builds are not necessary on main - if [[ "$BUILDKITE_BRANCH" != "main" ]]; then - ts-node .buildkite/scripts/steps/trigger_pipeline.ts kibana-artifacts-staging "$BUILDKITE_BRANCH" - fi - ts-node .buildkite/scripts/steps/trigger_pipeline.ts kibana-artifacts-snapshot "$BUILDKITE_BRANCH" + ts-node .buildkite/scripts/steps/trigger_pipeline.ts kibana-artifacts-staging "$BUILDKITE_BRANCH" fi diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index dda328bfa1bef..9ec0cc7fab0a4 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -87,6 +87,7 @@ x-pack/plugins/cloud_integrations/cloud_links @elastic/kibana-core x-pack/plugins/cloud @elastic/kibana-core x-pack/plugins/cloud_security_posture @elastic/kibana-cloud-security-posture packages/shared-ux/code_editor @elastic/appex-sharedux +packages/kbn-code-owners @elastic/appex-qa packages/kbn-coloring @elastic/kibana-visualizations packages/kbn-config @elastic/kibana-core packages/kbn-config-mocks @elastic/kibana-core @@ -425,6 +426,7 @@ packages/kbn-flot-charts @elastic/kibana-operations x-pack/test/ui_capabilities/common/plugins/foo_plugin @elastic/kibana-security src/plugins/ftr_apis @elastic/kibana-core packages/kbn-ftr-common-functional-services @elastic/kibana-operations @elastic/appex-qa +packages/kbn-ftr-common-functional-ui-services @elastic/appex-qa packages/kbn-ftr-screenshot-filename @elastic/kibana-operations @elastic/appex-qa x-pack/test/functional_with_es_ssl/plugins/cases @elastic/response-ops x-pack/examples/gen_ai_streaming_response_example @elastic/response-ops @@ -626,6 +628,7 @@ x-pack/test/plugin_functional/plugins/resolver_test @elastic/security-solution examples/response_stream @elastic/ml-ui packages/kbn-rison @elastic/kibana-operations x-pack/plugins/rollup @elastic/platform-deployment-management +packages/kbn-router-utils @elastic/obs-ux-logs-team examples/routing_example @elastic/kibana-core packages/kbn-rrule @elastic/response-ops packages/kbn-rule-data-utils @elastic/security-detections-response @elastic/response-ops @elastic/obs-ux-management-team @@ -691,7 +694,7 @@ packages/kbn-securitysolution-rules @elastic/security-detection-engine packages/kbn-securitysolution-t-grid @elastic/security-detection-engine packages/kbn-securitysolution-utils @elastic/security-detection-engine packages/kbn-server-http-tools @elastic/kibana-core -packages/kbn-server-route-repository @elastic/obs-knowledge-team @elastic/obs-ux-management-team +packages/kbn-server-route-repository @elastic/obs-knowledge-team x-pack/plugins/serverless @elastic/appex-sharedux packages/serverless/settings/common @elastic/appex-sharedux @elastic/platform-deployment-management x-pack/plugins/serverless_observability @elastic/appex-sharedux @elastic/obs-ux-management-team @@ -1251,8 +1254,37 @@ x-pack/plugins/cloud_integrations/cloud_full_story/server/config.ts @elastic/kib # AI assistant in Security Solution tests /x-pack/test/security_solution_cypress/cypress/e2e/ai_assistant @elastic/security-threat-hunting-investigations @elastic/security-detection-rule-management +# Security Solution cross teams ownership +/x-pack/test/security_solution_cypress/cypress/fixtures @elastic/security-detections-response @elastic/security-threat-hunting +/x-pack/test/security_solution_cypress/cypress/helpers @elastic/security-detections-response @elastic/security-threat-hunting +/x-pack/test/security_solution_cypress/cypress/objects @elastic/security-detections-response @elastic/security-threat-hunting +/x-pack/test/security_solution_cypress/cypress/plugins @elastic/security-detections-response @elastic/security-threat-hunting +/x-pack/test/security_solution_cypress/cypress/screens/common @elastic/security-detections-response @elastic/security-threat-hunting +/x-pack/test/security_solution_cypress/cypress/support @elastic/security-detections-response @elastic/security-threat-hunting +/x-pack/test/security_solution_cypress/cypress/urls @elastic/security-threat-hunting-investigations @elastic/security-detection-engine + +/x-pack/plugins/security_solution/common/ecs @elastic/security-threat-hunting-investigations +/x-pack/plugins/security_solution/common/test @elastic/security-detections-response @elastic/security-threat-hunting + +/x-pack/plugins/security_solution/public/common/components/callouts @elastic/security-detections-response +/x-pack/plugins/security_solution/public/common/components/hover_actions @elastic/security-threat-hunting-explore @elastic/security-threat-hunting-investigations + +/x-pack/plugins/security_solution/server/routes @elastic/security-detections-response @elastic/security-threat-hunting +/x-pack/plugins/security_solution/server/utils @elastic/security-detections-response @elastic/security-threat-hunting +x-pack/test/security_solution_api_integration/test_suites/detections_response/utils @elastic/security-detections-response +x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/telemetry @elastic/security-detections-response + # Security Solution sub teams +## Security Solution sub teams - security-engineering-productivity +## NOTE: It's important to keep this above other teams' sections because test automation doesn't process +## the CODEOWNERS file correctly. See https://github.com/elastic/kibana/issues/173307#issuecomment-1855858929 +/x-pack/test/security_solution_cypress/* @elastic/security-engineering-productivity +/x-pack/test/security_solution_cypress/cypress/* @elastic/security-engineering-productivity +/x-pack/test/security_solution_cypress/cypress/tasks/login.ts @elastic/security-engineering-productivity +/x-pack/test/security_solution_cypress/es_archives @elastic/security-engineering-productivity +/x-pack/plugins/security_solution/scripts/run_cypress @MadameSheema @patrykkopycinski @oatkiller @maximpn @banderror + ## Security Solution sub teams - Threat Hunting Investigations /x-pack/plugins/security_solution/common/api/timeline @elastic/security-threat-hunting-investigations @@ -1427,30 +1459,9 @@ x-pack/test/security_solution_api_integration/test_suites/detections_response/de /x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_delete/delete_rules.ts @elastic/security-detection-engine /x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_delete/delete_rules_ess.ts @elastic/security-detection-engine - ## Security Threat Intelligence - Under Security Platform /x-pack/plugins/security_solution/public/common/components/threat_match @elastic/security-detection-engine -## Security Solution cross teams ownership -/x-pack/test/security_solution_cypress/cypress/fixtures @elastic/security-detections-response @elastic/security-threat-hunting -/x-pack/test/security_solution_cypress/cypress/helpers @elastic/security-detections-response @elastic/security-threat-hunting -/x-pack/test/security_solution_cypress/cypress/objects @elastic/security-detections-response @elastic/security-threat-hunting -/x-pack/test/security_solution_cypress/cypress/plugins @elastic/security-detections-response @elastic/security-threat-hunting -/x-pack/test/security_solution_cypress/cypress/screens/common @elastic/security-detections-response @elastic/security-threat-hunting -/x-pack/test/security_solution_cypress/cypress/support @elastic/security-detections-response @elastic/security-threat-hunting -/x-pack/test/security_solution_cypress/cypress/urls @elastic/security-threat-hunting-investigations @elastic/security-detection-engine - -/x-pack/plugins/security_solution/common/ecs @elastic/security-threat-hunting-investigations -/x-pack/plugins/security_solution/common/test @elastic/security-detections-response @elastic/security-threat-hunting - -/x-pack/plugins/security_solution/public/common/components/callouts @elastic/security-detections-response -/x-pack/plugins/security_solution/public/common/components/hover_actions @elastic/security-threat-hunting-explore @elastic/security-threat-hunting-investigations - -/x-pack/plugins/security_solution/server/routes @elastic/security-detections-response @elastic/security-threat-hunting -/x-pack/plugins/security_solution/server/utils @elastic/security-detections-response @elastic/security-threat-hunting -x-pack/test/security_solution_api_integration/test_suites/detections_response/utils @elastic/security-detections-response -x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/telemetry @elastic/security-detections-response - ## Security Solution sub teams - security-defend-workflows /x-pack/plugins/security_solution/public/management/ @elastic/security-defend-workflows /x-pack/plugins/security_solution/public/common/lib/endpoint*/ @elastic/security-defend-workflows @@ -1474,13 +1485,6 @@ x-pack/plugins/security_solution/server/usage/ @elastic/security-data-analytics x-pack/plugins/security_solution/server/lib/telemetry/ @elastic/security-data-analytics x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/telemetry @elastic/security-data-analytics -## Security Solution sub teams - security-engineering-productivity -/x-pack/test/security_solution_cypress/* @elastic/security-engineering-productivity -/x-pack/test/security_solution_cypress/cypress/* @elastic/security-engineering-productivity -/x-pack/test/security_solution_cypress/cypress/tasks/login.ts @elastic/security-engineering-productivity -/x-pack/test/security_solution_cypress/es_archives @elastic/security-engineering-productivity -/x-pack/plugins/security_solution/scripts/run_cypress @MadameSheema @patrykkopycinski @oatkiller @maximpn @banderror - ## Security Solution sub teams - adaptive-workload-protection x-pack/plugins/security_solution/public/common/components/sessions_viewer @elastic/kibana-cloud-security-posture x-pack/plugins/security_solution/public/kubernetes @elastic/kibana-cloud-security-posture diff --git a/api_docs/actions.mdx b/api_docs/actions.mdx index d1449bb4f5442..4da6a11339828 100644 --- a/api_docs/actions.mdx +++ b/api_docs/actions.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/actions title: "actions" image: https://source.unsplash.com/400x175/?github description: API docs for the actions plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'actions'] --- import actionsObj from './actions.devdocs.json'; diff --git a/api_docs/advanced_settings.mdx b/api_docs/advanced_settings.mdx index e063bf6df4262..8b8ab9242a004 100644 --- a/api_docs/advanced_settings.mdx +++ b/api_docs/advanced_settings.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/advancedSettings title: "advancedSettings" image: https://source.unsplash.com/400x175/?github description: API docs for the advancedSettings plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'advancedSettings'] --- import advancedSettingsObj from './advanced_settings.devdocs.json'; diff --git a/api_docs/ai_assistant_management_observability.mdx b/api_docs/ai_assistant_management_observability.mdx index 2c3f3fe8ad821..4c7b626dd4597 100644 --- a/api_docs/ai_assistant_management_observability.mdx +++ b/api_docs/ai_assistant_management_observability.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/aiAssistantManagementObservability title: "aiAssistantManagementObservability" image: https://source.unsplash.com/400x175/?github description: API docs for the aiAssistantManagementObservability plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'aiAssistantManagementObservability'] --- import aiAssistantManagementObservabilityObj from './ai_assistant_management_observability.devdocs.json'; diff --git a/api_docs/ai_assistant_management_selection.mdx b/api_docs/ai_assistant_management_selection.mdx index cf78bd1b05f4f..8b2ab206b57c0 100644 --- a/api_docs/ai_assistant_management_selection.mdx +++ b/api_docs/ai_assistant_management_selection.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/aiAssistantManagementSelection title: "aiAssistantManagementSelection" image: https://source.unsplash.com/400x175/?github description: API docs for the aiAssistantManagementSelection plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'aiAssistantManagementSelection'] --- import aiAssistantManagementSelectionObj from './ai_assistant_management_selection.devdocs.json'; diff --git a/api_docs/aiops.devdocs.json b/api_docs/aiops.devdocs.json index 6649c83b16dfe..d8a0e3b50e293 100644 --- a/api_docs/aiops.devdocs.json +++ b/api_docs/aiops.devdocs.json @@ -587,8 +587,8 @@ "pluginId": "uiActions", "scope": "public", "docId": "kibUiActionsPluginApi", - "section": "def-public.UiActionsStart", - "text": "UiActionsStart" + "section": "def-public.UiActionsPublicStart", + "text": "UiActionsPublicStart" }, " | undefined" ], diff --git a/api_docs/aiops.mdx b/api_docs/aiops.mdx index fdf70ee454902..0cbb8e2642cda 100644 --- a/api_docs/aiops.mdx +++ b/api_docs/aiops.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/aiops title: "aiops" image: https://source.unsplash.com/400x175/?github description: API docs for the aiops plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'aiops'] --- import aiopsObj from './aiops.devdocs.json'; diff --git a/api_docs/alerting.devdocs.json b/api_docs/alerting.devdocs.json index b18468b7545fc..15f5fd2f156b5 100644 --- a/api_docs/alerting.devdocs.json +++ b/api_docs/alerting.devdocs.json @@ -3675,8 +3675,8 @@ "pluginId": "share", "scope": "server", "docId": "kibSharePluginApi", - "section": "def-server.SharePluginStart", - "text": "SharePluginStart" + "section": "def-server.SharePublicStart", + "text": "SharePublicStart" } ], "path": "x-pack/plugins/alerting/server/types.ts", @@ -4800,6 +4800,21 @@ "trackAdoption": false, "initialIsOpen": false }, + { + "parentPluginId": "alerting", + "id": "def-server.RULE_SAVED_OBJECT_TYPE", + "type": "string", + "tags": [], + "label": "RULE_SAVED_OBJECT_TYPE", + "description": [], + "signature": [ + "\"alert\"" + ], + "path": "x-pack/plugins/alerting/server/saved_objects/index.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, { "parentPluginId": "alerting", "id": "def-server.RuleActionParams", diff --git a/api_docs/alerting.mdx b/api_docs/alerting.mdx index d40ce5a71c17a..d02d81e0cf53a 100644 --- a/api_docs/alerting.mdx +++ b/api_docs/alerting.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/alerting title: "alerting" image: https://source.unsplash.com/400x175/?github description: API docs for the alerting plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'alerting'] --- import alertingObj from './alerting.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/response-ops](https://github.com/orgs/elastic/teams/response-o | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 822 | 1 | 791 | 51 | +| 823 | 1 | 792 | 51 | ## Client diff --git a/api_docs/apm.mdx b/api_docs/apm.mdx index bf2e4195bbde6..15b1a0c3b951b 100644 --- a/api_docs/apm.mdx +++ b/api_docs/apm.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/apm title: "apm" image: https://source.unsplash.com/400x175/?github description: API docs for the apm plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'apm'] --- import apmObj from './apm.devdocs.json'; diff --git a/api_docs/apm_data_access.mdx b/api_docs/apm_data_access.mdx index 3492827c5f164..96a3a875b6441 100644 --- a/api_docs/apm_data_access.mdx +++ b/api_docs/apm_data_access.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/apmDataAccess title: "apmDataAccess" image: https://source.unsplash.com/400x175/?github description: API docs for the apmDataAccess plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'apmDataAccess'] --- import apmDataAccessObj from './apm_data_access.devdocs.json'; diff --git a/api_docs/asset_manager.mdx b/api_docs/asset_manager.mdx index b99e057c430cf..e4c70128e283d 100644 --- a/api_docs/asset_manager.mdx +++ b/api_docs/asset_manager.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/assetManager title: "assetManager" image: https://source.unsplash.com/400x175/?github description: API docs for the assetManager plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'assetManager'] --- import assetManagerObj from './asset_manager.devdocs.json'; diff --git a/api_docs/banners.mdx b/api_docs/banners.mdx index 45ef7d3af1b42..1f141caf3c9a6 100644 --- a/api_docs/banners.mdx +++ b/api_docs/banners.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/banners title: "banners" image: https://source.unsplash.com/400x175/?github description: API docs for the banners plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'banners'] --- import bannersObj from './banners.devdocs.json'; diff --git a/api_docs/bfetch.mdx b/api_docs/bfetch.mdx index 34c44f5a72c88..afe008618a7c0 100644 --- a/api_docs/bfetch.mdx +++ b/api_docs/bfetch.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/bfetch title: "bfetch" image: https://source.unsplash.com/400x175/?github description: API docs for the bfetch plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'bfetch'] --- import bfetchObj from './bfetch.devdocs.json'; diff --git a/api_docs/canvas.mdx b/api_docs/canvas.mdx index 54443dab0bb19..8e4f9d8bfb14c 100644 --- a/api_docs/canvas.mdx +++ b/api_docs/canvas.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/canvas title: "canvas" image: https://source.unsplash.com/400x175/?github description: API docs for the canvas plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'canvas'] --- import canvasObj from './canvas.devdocs.json'; diff --git a/api_docs/cases.mdx b/api_docs/cases.mdx index f6ed79fed21c4..25c83c9f699ef 100644 --- a/api_docs/cases.mdx +++ b/api_docs/cases.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/cases title: "cases" image: https://source.unsplash.com/400x175/?github description: API docs for the cases plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'cases'] --- import casesObj from './cases.devdocs.json'; diff --git a/api_docs/charts.mdx b/api_docs/charts.mdx index 5922ea4676fff..506c4b022b916 100644 --- a/api_docs/charts.mdx +++ b/api_docs/charts.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/charts title: "charts" image: https://source.unsplash.com/400x175/?github description: API docs for the charts plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'charts'] --- import chartsObj from './charts.devdocs.json'; diff --git a/api_docs/cloud.mdx b/api_docs/cloud.mdx index 56e061837c347..3b1aedfce5c7c 100644 --- a/api_docs/cloud.mdx +++ b/api_docs/cloud.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/cloud title: "cloud" image: https://source.unsplash.com/400x175/?github description: API docs for the cloud plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'cloud'] --- import cloudObj from './cloud.devdocs.json'; diff --git a/api_docs/cloud_data_migration.mdx b/api_docs/cloud_data_migration.mdx index dfab273f2a8a1..deaabc42e8934 100644 --- a/api_docs/cloud_data_migration.mdx +++ b/api_docs/cloud_data_migration.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/cloudDataMigration title: "cloudDataMigration" image: https://source.unsplash.com/400x175/?github description: API docs for the cloudDataMigration plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'cloudDataMigration'] --- import cloudDataMigrationObj from './cloud_data_migration.devdocs.json'; diff --git a/api_docs/cloud_defend.mdx b/api_docs/cloud_defend.mdx index 6c2e123b2daad..f86194816d447 100644 --- a/api_docs/cloud_defend.mdx +++ b/api_docs/cloud_defend.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/cloudDefend title: "cloudDefend" image: https://source.unsplash.com/400x175/?github description: API docs for the cloudDefend plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'cloudDefend'] --- import cloudDefendObj from './cloud_defend.devdocs.json'; diff --git a/api_docs/cloud_experiments.mdx b/api_docs/cloud_experiments.mdx index 02a383a8bd04c..c869aae3dccab 100644 --- a/api_docs/cloud_experiments.mdx +++ b/api_docs/cloud_experiments.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/cloudExperiments title: "cloudExperiments" image: https://source.unsplash.com/400x175/?github description: API docs for the cloudExperiments plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'cloudExperiments'] --- import cloudExperimentsObj from './cloud_experiments.devdocs.json'; diff --git a/api_docs/cloud_security_posture.mdx b/api_docs/cloud_security_posture.mdx index fd3451cd8b25c..75e3ed2771370 100644 --- a/api_docs/cloud_security_posture.mdx +++ b/api_docs/cloud_security_posture.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/cloudSecurityPosture title: "cloudSecurityPosture" image: https://source.unsplash.com/400x175/?github description: API docs for the cloudSecurityPosture plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'cloudSecurityPosture'] --- import cloudSecurityPostureObj from './cloud_security_posture.devdocs.json'; diff --git a/api_docs/console.mdx b/api_docs/console.mdx index 0a88f9c0d6bbf..391457d5379b0 100644 --- a/api_docs/console.mdx +++ b/api_docs/console.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/console title: "console" image: https://source.unsplash.com/400x175/?github description: API docs for the console plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'console'] --- import consoleObj from './console.devdocs.json'; diff --git a/api_docs/content_management.mdx b/api_docs/content_management.mdx index 20b386f71265a..8036d0e2967dc 100644 --- a/api_docs/content_management.mdx +++ b/api_docs/content_management.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/contentManagement title: "contentManagement" image: https://source.unsplash.com/400x175/?github description: API docs for the contentManagement plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'contentManagement'] --- import contentManagementObj from './content_management.devdocs.json'; diff --git a/api_docs/controls.mdx b/api_docs/controls.mdx index 51d15d378ee8e..aed90aee8ba2b 100644 --- a/api_docs/controls.mdx +++ b/api_docs/controls.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/controls title: "controls" image: https://source.unsplash.com/400x175/?github description: API docs for the controls plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'controls'] --- import controlsObj from './controls.devdocs.json'; diff --git a/api_docs/custom_integrations.mdx b/api_docs/custom_integrations.mdx index bcf15e3402ff7..4f695b8a38375 100644 --- a/api_docs/custom_integrations.mdx +++ b/api_docs/custom_integrations.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/customIntegrations title: "customIntegrations" image: https://source.unsplash.com/400x175/?github description: API docs for the customIntegrations plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'customIntegrations'] --- import customIntegrationsObj from './custom_integrations.devdocs.json'; diff --git a/api_docs/dashboard.mdx b/api_docs/dashboard.mdx index 9f59b08b3f38f..39611988cf6b8 100644 --- a/api_docs/dashboard.mdx +++ b/api_docs/dashboard.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/dashboard title: "dashboard" image: https://source.unsplash.com/400x175/?github description: API docs for the dashboard plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'dashboard'] --- import dashboardObj from './dashboard.devdocs.json'; diff --git a/api_docs/dashboard_enhanced.devdocs.json b/api_docs/dashboard_enhanced.devdocs.json index 96cce4041b2bf..56c455e6df7ac 100644 --- a/api_docs/dashboard_enhanced.devdocs.json +++ b/api_docs/dashboard_enhanced.devdocs.json @@ -910,8 +910,8 @@ "pluginId": "uiActionsEnhanced", "scope": "server", "docId": "kibUiActionsEnhancedPluginApi", - "section": "def-server.SetupContract", - "text": "SetupContract" + "section": "def-server.UiActionsEnhancedServerSetup", + "text": "UiActionsEnhancedServerSetup" } ], "path": "x-pack/plugins/dashboard_enhanced/server/plugin.ts", diff --git a/api_docs/dashboard_enhanced.mdx b/api_docs/dashboard_enhanced.mdx index b7a5d18a76ff4..02869fa53800c 100644 --- a/api_docs/dashboard_enhanced.mdx +++ b/api_docs/dashboard_enhanced.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/dashboardEnhanced title: "dashboardEnhanced" image: https://source.unsplash.com/400x175/?github description: API docs for the dashboardEnhanced plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'dashboardEnhanced'] --- import dashboardEnhancedObj from './dashboard_enhanced.devdocs.json'; diff --git a/api_docs/data.mdx b/api_docs/data.mdx index 02c66c81bc712..f51bbd6816385 100644 --- a/api_docs/data.mdx +++ b/api_docs/data.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/data title: "data" image: https://source.unsplash.com/400x175/?github description: API docs for the data plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'data'] --- import dataObj from './data.devdocs.json'; diff --git a/api_docs/data_query.mdx b/api_docs/data_query.mdx index 86f96ae960121..48b82a61a2413 100644 --- a/api_docs/data_query.mdx +++ b/api_docs/data_query.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/data-query title: "data.query" image: https://source.unsplash.com/400x175/?github description: API docs for the data.query plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'data.query'] --- import dataQueryObj from './data_query.devdocs.json'; diff --git a/api_docs/data_search.mdx b/api_docs/data_search.mdx index dcd50dc9f7f3e..94b47782937b8 100644 --- a/api_docs/data_search.mdx +++ b/api_docs/data_search.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/data-search title: "data.search" image: https://source.unsplash.com/400x175/?github description: API docs for the data.search plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'data.search'] --- import dataSearchObj from './data_search.devdocs.json'; diff --git a/api_docs/data_view_editor.mdx b/api_docs/data_view_editor.mdx index 22d26ca448f35..cd8c70acb8218 100644 --- a/api_docs/data_view_editor.mdx +++ b/api_docs/data_view_editor.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/dataViewEditor title: "dataViewEditor" image: https://source.unsplash.com/400x175/?github description: API docs for the dataViewEditor plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'dataViewEditor'] --- import dataViewEditorObj from './data_view_editor.devdocs.json'; diff --git a/api_docs/data_view_field_editor.mdx b/api_docs/data_view_field_editor.mdx index 958f49dd1b01d..a5c2be2aa6634 100644 --- a/api_docs/data_view_field_editor.mdx +++ b/api_docs/data_view_field_editor.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/dataViewFieldEditor title: "dataViewFieldEditor" image: https://source.unsplash.com/400x175/?github description: API docs for the dataViewFieldEditor plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'dataViewFieldEditor'] --- import dataViewFieldEditorObj from './data_view_field_editor.devdocs.json'; diff --git a/api_docs/data_view_management.mdx b/api_docs/data_view_management.mdx index 3fcd74bf2db2b..fc36c8f6b817d 100644 --- a/api_docs/data_view_management.mdx +++ b/api_docs/data_view_management.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/dataViewManagement title: "dataViewManagement" image: https://source.unsplash.com/400x175/?github description: API docs for the dataViewManagement plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'dataViewManagement'] --- import dataViewManagementObj from './data_view_management.devdocs.json'; diff --git a/api_docs/data_views.mdx b/api_docs/data_views.mdx index 39ed6985bfed2..8620b0c7cd236 100644 --- a/api_docs/data_views.mdx +++ b/api_docs/data_views.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/dataViews title: "dataViews" image: https://source.unsplash.com/400x175/?github description: API docs for the dataViews plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'dataViews'] --- import dataViewsObj from './data_views.devdocs.json'; diff --git a/api_docs/data_visualizer.mdx b/api_docs/data_visualizer.mdx index 2390728196970..c98018e6f3792 100644 --- a/api_docs/data_visualizer.mdx +++ b/api_docs/data_visualizer.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/dataVisualizer title: "dataVisualizer" image: https://source.unsplash.com/400x175/?github description: API docs for the dataVisualizer plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'dataVisualizer'] --- import dataVisualizerObj from './data_visualizer.devdocs.json'; diff --git a/api_docs/dataset_quality.devdocs.json b/api_docs/dataset_quality.devdocs.json index 70ddd3bed1130..0d7e9842ff93f 100644 --- a/api_docs/dataset_quality.devdocs.json +++ b/api_docs/dataset_quality.devdocs.json @@ -113,18 +113,8 @@ "; }>, ", "PartialC", "<{ type: ", - "UnionC", - "<[", - "LiteralC", - "<\"logs\">, ", - "LiteralC", - "<\"metrics\">, ", - "LiteralC", - "<\"traces\">, ", - "LiteralC", - "<\"synthetics\">, ", - "LiteralC", - "<\"profiling\">]>; }>, ", + "KeyofC", + "<{ logs: null; metrics: null; traces: null; synthetics: null; profiling: null; }>; }>, ", "PartialC", "<{ datasetQuery: ", "StringC", @@ -139,28 +129,14 @@ "<[", "PartialC", "<{ type: ", - "UnionC", - "<[", - "LiteralC", - "<\"logs\">, ", - "LiteralC", - "<\"metrics\">, ", - "LiteralC", - "<\"traces\">, ", - "LiteralC", - "<\"synthetics\">, ", - "LiteralC", - "<\"profiling\">]>; }>, ", + "KeyofC", + "<{ logs: null; metrics: null; traces: null; synthetics: null; profiling: null; }>; }>, ", "PartialC", "<{ datasetQuery: ", "StringC", "; }>]>; }> | undefined; handler: ({}: ", "DatasetQualityRouteHandlerResources", - " & { params: { query: { type?: \"metrics\" | \"synthetics\" | \"traces\" | \"logs\" | \"profiling\" | undefined; } & { datasetQuery?: string | undefined; }; }; }) => Promise<{ dataStreamsStats: ", - "DataStreamStat", - "[]; integrations: ", - "Integration", - "[]; }>; } & ", + " & { params: { query: { type?: \"metrics\" | \"synthetics\" | \"traces\" | \"logs\" | \"profiling\" | undefined; } & { datasetQuery?: string | undefined; }; }; }) => Promise<{ dataStreamsStats: ({ name: string; } & { size?: string | undefined; sizeBytes?: number | undefined; lastActivity?: number | undefined; integration?: string | undefined; })[]; integrations: ({ name: string; } & { title?: string | undefined; version?: string | undefined; icons?: ({ path: string; src: string; } & { title?: string | undefined; size?: string | undefined; type?: string | undefined; })[] | undefined; datasets?: { [x: string]: string; } | undefined; })[]; }>; } & ", "DatasetQualityRouteCreateOptions", "; }[TEndpoint] extends { endpoint: any; params?: infer TRouteParamsRT | undefined; handler: ({}: any) => Promise; } & ", "ServerRouteCreateOptions", @@ -200,18 +176,8 @@ "; }>, ", "PartialC", "<{ type: ", - "UnionC", - "<[", - "LiteralC", - "<\"logs\">, ", - "LiteralC", - "<\"metrics\">, ", - "LiteralC", - "<\"traces\">, ", - "LiteralC", - "<\"synthetics\">, ", - "LiteralC", - "<\"profiling\">]>; }>, ", + "KeyofC", + "<{ logs: null; metrics: null; traces: null; synthetics: null; profiling: null; }>; }>, ", "PartialC", "<{ datasetQuery: ", "StringC", @@ -226,28 +192,14 @@ "<[", "PartialC", "<{ type: ", - "UnionC", - "<[", - "LiteralC", - "<\"logs\">, ", - "LiteralC", - "<\"metrics\">, ", - "LiteralC", - "<\"traces\">, ", - "LiteralC", - "<\"synthetics\">, ", - "LiteralC", - "<\"profiling\">]>; }>, ", + "KeyofC", + "<{ logs: null; metrics: null; traces: null; synthetics: null; profiling: null; }>; }>, ", "PartialC", "<{ datasetQuery: ", "StringC", "; }>]>; }> | undefined; handler: ({}: ", "DatasetQualityRouteHandlerResources", - " & { params: { query: { type?: \"metrics\" | \"synthetics\" | \"traces\" | \"logs\" | \"profiling\" | undefined; } & { datasetQuery?: string | undefined; }; }; }) => Promise<{ dataStreamsStats: ", - "DataStreamStat", - "[]; integrations: ", - "Integration", - "[]; }>; } & ", + " & { params: { query: { type?: \"metrics\" | \"synthetics\" | \"traces\" | \"logs\" | \"profiling\" | undefined; } & { datasetQuery?: string | undefined; }; }; }) => Promise<{ dataStreamsStats: ({ name: string; } & { size?: string | undefined; sizeBytes?: number | undefined; lastActivity?: number | undefined; integration?: string | undefined; })[]; integrations: ({ name: string; } & { title?: string | undefined; version?: string | undefined; icons?: ({ path: string; src: string; } & { title?: string | undefined; size?: string | undefined; type?: string | undefined; })[] | undefined; datasets?: { [x: string]: string; } | undefined; })[]; }>; } & ", "DatasetQualityRouteCreateOptions", "; }[TEndpoint] extends { endpoint: any; params?: any; handler: ({}: any) => Promise; } & ", "ServerRouteCreateOptions", diff --git a/api_docs/dataset_quality.mdx b/api_docs/dataset_quality.mdx index 81cc0ab9b84f1..c90839b3f515a 100644 --- a/api_docs/dataset_quality.mdx +++ b/api_docs/dataset_quality.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/datasetQuality title: "datasetQuality" image: https://source.unsplash.com/400x175/?github description: API docs for the datasetQuality plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'datasetQuality'] --- import datasetQualityObj from './dataset_quality.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/obs-ux-logs-team](https://github.com/orgs/elastic/teams/obs-ux | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 8 | 0 | 8 | 4 | +| 8 | 0 | 8 | 2 | ## Client diff --git a/api_docs/deprecations_by_api.mdx b/api_docs/deprecations_by_api.mdx index f4bea6a1ef33e..6149473692b9f 100644 --- a/api_docs/deprecations_by_api.mdx +++ b/api_docs/deprecations_by_api.mdx @@ -7,7 +7,7 @@ id: kibDevDocsDeprecationsByApi slug: /kibana-dev-docs/api-meta/deprecated-api-list-by-api title: Deprecated API usage by API description: A list of deprecated APIs, which plugins are still referencing them, and when they need to be removed by. -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana'] --- diff --git a/api_docs/deprecations_by_plugin.mdx b/api_docs/deprecations_by_plugin.mdx index a11224493d683..aea6a04dfd7a6 100644 --- a/api_docs/deprecations_by_plugin.mdx +++ b/api_docs/deprecations_by_plugin.mdx @@ -7,7 +7,7 @@ id: kibDevDocsDeprecationsByPlugin slug: /kibana-dev-docs/api-meta/deprecated-api-list-by-plugin title: Deprecated API usage by plugin description: A list of deprecated APIs, which plugins are still referencing them, and when they need to be removed by. -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana'] --- diff --git a/api_docs/deprecations_by_team.mdx b/api_docs/deprecations_by_team.mdx index ab3591dba2573..11a116cd2c798 100644 --- a/api_docs/deprecations_by_team.mdx +++ b/api_docs/deprecations_by_team.mdx @@ -7,7 +7,7 @@ id: kibDevDocsDeprecationsDueByTeam slug: /kibana-dev-docs/api-meta/deprecations-due-by-team title: Deprecated APIs due to be removed, by team description: Lists the teams that are referencing deprecated APIs with a remove by date. -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana'] --- diff --git a/api_docs/dev_tools.mdx b/api_docs/dev_tools.mdx index eeda4c2b542ee..3f980b57ee13c 100644 --- a/api_docs/dev_tools.mdx +++ b/api_docs/dev_tools.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/devTools title: "devTools" image: https://source.unsplash.com/400x175/?github description: API docs for the devTools plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'devTools'] --- import devToolsObj from './dev_tools.devdocs.json'; diff --git a/api_docs/discover.devdocs.json b/api_docs/discover.devdocs.json index ee434fed57833..222ba19a62be0 100644 --- a/api_docs/discover.devdocs.json +++ b/api_docs/discover.devdocs.json @@ -883,99 +883,6 @@ ], "initialIsOpen": false }, - { - "parentPluginId": "discover", - "id": "def-public.FlyoutContentActions", - "type": "Interface", - "tags": [], - "label": "FlyoutContentActions", - "description": [], - "path": "src/plugins/discover/public/customizations/customization_types/flyout_customization.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "discover", - "id": "def-public.FlyoutContentActions.addFilter", - "type": "Function", - "tags": [], - "label": "addFilter", - "description": [], - "signature": [ - "DocViewFilterFn", - " | undefined" - ], - "path": "src/plugins/discover/public/customizations/customization_types/flyout_customization.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "discover", - "id": "def-public.FlyoutContentActions.addColumn", - "type": "Function", - "tags": [], - "label": "addColumn", - "description": [], - "signature": [ - "(column: string) => void" - ], - "path": "src/plugins/discover/public/customizations/customization_types/flyout_customization.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "discover", - "id": "def-public.FlyoutContentActions.addColumn.$1", - "type": "string", - "tags": [], - "label": "column", - "description": [], - "signature": [ - "string" - ], - "path": "src/plugins/discover/public/customizations/customization_types/flyout_customization.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - } - ], - "returnComment": [] - }, - { - "parentPluginId": "discover", - "id": "def-public.FlyoutContentActions.removeColumn", - "type": "Function", - "tags": [], - "label": "removeColumn", - "description": [], - "signature": [ - "(column: string) => void" - ], - "path": "src/plugins/discover/public/customizations/customization_types/flyout_customization.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "discover", - "id": "def-public.FlyoutContentActions.removeColumn.$1", - "type": "string", - "tags": [], - "label": "column", - "description": [], - "signature": [ - "string" - ], - "path": "src/plugins/discover/public/customizations/customization_types/flyout_customization.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - } - ], - "returnComment": [] - } - ], - "initialIsOpen": false - }, { "parentPluginId": "discover", "id": "def-public.FlyoutContentProps", @@ -995,13 +902,9 @@ "label": "actions", "description": [], "signature": [ - { - "pluginId": "discover", - "scope": "public", - "docId": "kibDiscoverPluginApi", - "section": "def-public.FlyoutContentActions", - "text": "FlyoutContentActions" - } + "{ filter?: ", + "DocViewFilterFn", + " | undefined; onAddColumn?: ((columnName: string) => void) | undefined; onRemoveColumn?: ((columnName: string) => void) | undefined; }" ], "path": "src/plugins/discover/public/customizations/customization_types/flyout_customization.ts", "deprecated": false, @@ -1133,6 +1036,43 @@ "path": "src/plugins/discover/public/customizations/customization_types/flyout_customization.ts", "deprecated": false, "trackAdoption": false + }, + { + "parentPluginId": "discover", + "id": "def-public.FlyoutCustomization.docViewsRegistry", + "type": "CompoundType", + "tags": [], + "label": "docViewsRegistry", + "description": [], + "signature": [ + { + "pluginId": "@kbn/unified-doc-viewer", + "scope": "common", + "docId": "kibKbnUnifiedDocViewerPluginApi", + "section": "def-common.DocViewsRegistry", + "text": "DocViewsRegistry" + }, + " | ((prevRegistry: ", + { + "pluginId": "@kbn/unified-doc-viewer", + "scope": "common", + "docId": "kibKbnUnifiedDocViewerPluginApi", + "section": "def-common.DocViewsRegistry", + "text": "DocViewsRegistry" + }, + ") => ", + { + "pluginId": "@kbn/unified-doc-viewer", + "scope": "common", + "docId": "kibKbnUnifiedDocViewerPluginApi", + "section": "def-common.DocViewsRegistry", + "text": "DocViewsRegistry" + }, + ") | undefined" + ], + "path": "src/plugins/discover/public/customizations/customization_types/flyout_customization.ts", + "deprecated": false, + "trackAdoption": false } ], "initialIsOpen": false @@ -1243,8 +1183,8 @@ "pluginId": "share", "scope": "public", "docId": "kibSharePluginApi", - "section": "def-public.SharePluginStart", - "text": "SharePluginStart" + "section": "def-public.SharePublicStart", + "text": "SharePublicStart" }, " | undefined; }" ], diff --git a/api_docs/discover.mdx b/api_docs/discover.mdx index 50ed757f8e751..2cc3945fba056 100644 --- a/api_docs/discover.mdx +++ b/api_docs/discover.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/discover title: "discover" image: https://source.unsplash.com/400x175/?github description: API docs for the discover plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'discover'] --- import discoverObj from './discover.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/kibana-data-discovery](https://github.com/orgs/elastic/teams/k | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 141 | 0 | 96 | 21 | +| 136 | 0 | 91 | 21 | ## Client diff --git a/api_docs/discover_enhanced.devdocs.json b/api_docs/discover_enhanced.devdocs.json index f0194c72301a8..080bcfd52756d 100644 --- a/api_docs/discover_enhanced.devdocs.json +++ b/api_docs/discover_enhanced.devdocs.json @@ -622,8 +622,8 @@ "pluginId": "share", "scope": "public", "docId": "kibSharePluginApi", - "section": "def-public.SharePluginSetup", - "text": "SharePluginSetup" + "section": "def-public.SharePublicSetup", + "text": "SharePublicSetup" }, " | undefined" ], @@ -743,8 +743,8 @@ "pluginId": "share", "scope": "public", "docId": "kibSharePluginApi", - "section": "def-public.SharePluginStart", - "text": "SharePluginStart" + "section": "def-public.SharePublicStart", + "text": "SharePublicStart" }, " | undefined" ], diff --git a/api_docs/discover_enhanced.mdx b/api_docs/discover_enhanced.mdx index 338829c6ed471..16b1c3d808b2d 100644 --- a/api_docs/discover_enhanced.mdx +++ b/api_docs/discover_enhanced.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/discoverEnhanced title: "discoverEnhanced" image: https://source.unsplash.com/400x175/?github description: API docs for the discoverEnhanced plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'discoverEnhanced'] --- import discoverEnhancedObj from './discover_enhanced.devdocs.json'; diff --git a/api_docs/ecs_data_quality_dashboard.mdx b/api_docs/ecs_data_quality_dashboard.mdx index 8479686b3104a..7af190927d645 100644 --- a/api_docs/ecs_data_quality_dashboard.mdx +++ b/api_docs/ecs_data_quality_dashboard.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/ecsDataQualityDashboard title: "ecsDataQualityDashboard" image: https://source.unsplash.com/400x175/?github description: API docs for the ecsDataQualityDashboard plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'ecsDataQualityDashboard'] --- import ecsDataQualityDashboardObj from './ecs_data_quality_dashboard.devdocs.json'; diff --git a/api_docs/elastic_assistant.mdx b/api_docs/elastic_assistant.mdx index a2c2b504dfbef..cd65a2e37d323 100644 --- a/api_docs/elastic_assistant.mdx +++ b/api_docs/elastic_assistant.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/elasticAssistant title: "elasticAssistant" image: https://source.unsplash.com/400x175/?github description: API docs for the elasticAssistant plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'elasticAssistant'] --- import elasticAssistantObj from './elastic_assistant.devdocs.json'; diff --git a/api_docs/embeddable.mdx b/api_docs/embeddable.mdx index 8389a899ba227..057014b818dfc 100644 --- a/api_docs/embeddable.mdx +++ b/api_docs/embeddable.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/embeddable title: "embeddable" image: https://source.unsplash.com/400x175/?github description: API docs for the embeddable plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'embeddable'] --- import embeddableObj from './embeddable.devdocs.json'; diff --git a/api_docs/embeddable_enhanced.mdx b/api_docs/embeddable_enhanced.mdx index ff1e67822fa7b..22bbf44ebcf0f 100644 --- a/api_docs/embeddable_enhanced.mdx +++ b/api_docs/embeddable_enhanced.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/embeddableEnhanced title: "embeddableEnhanced" image: https://source.unsplash.com/400x175/?github description: API docs for the embeddableEnhanced plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'embeddableEnhanced'] --- import embeddableEnhancedObj from './embeddable_enhanced.devdocs.json'; diff --git a/api_docs/encrypted_saved_objects.mdx b/api_docs/encrypted_saved_objects.mdx index a47111610dcdf..fb06097287248 100644 --- a/api_docs/encrypted_saved_objects.mdx +++ b/api_docs/encrypted_saved_objects.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/encryptedSavedObjects title: "encryptedSavedObjects" image: https://source.unsplash.com/400x175/?github description: API docs for the encryptedSavedObjects plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'encryptedSavedObjects'] --- import encryptedSavedObjectsObj from './encrypted_saved_objects.devdocs.json'; diff --git a/api_docs/enterprise_search.mdx b/api_docs/enterprise_search.mdx index 7fd3eaca41e50..cf844ada379ce 100644 --- a/api_docs/enterprise_search.mdx +++ b/api_docs/enterprise_search.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/enterpriseSearch title: "enterpriseSearch" image: https://source.unsplash.com/400x175/?github description: API docs for the enterpriseSearch plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'enterpriseSearch'] --- import enterpriseSearchObj from './enterprise_search.devdocs.json'; diff --git a/api_docs/es_ui_shared.mdx b/api_docs/es_ui_shared.mdx index c2624f82921ba..90845ad4b2ed2 100644 --- a/api_docs/es_ui_shared.mdx +++ b/api_docs/es_ui_shared.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/esUiShared title: "esUiShared" image: https://source.unsplash.com/400x175/?github description: API docs for the esUiShared plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'esUiShared'] --- import esUiSharedObj from './es_ui_shared.devdocs.json'; diff --git a/api_docs/event_annotation.mdx b/api_docs/event_annotation.mdx index f571e4f8740f0..ae4a01bdc817c 100644 --- a/api_docs/event_annotation.mdx +++ b/api_docs/event_annotation.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/eventAnnotation title: "eventAnnotation" image: https://source.unsplash.com/400x175/?github description: API docs for the eventAnnotation plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'eventAnnotation'] --- import eventAnnotationObj from './event_annotation.devdocs.json'; diff --git a/api_docs/event_annotation_listing.mdx b/api_docs/event_annotation_listing.mdx index 15e6be951ac7b..88c5fa1cdbe06 100644 --- a/api_docs/event_annotation_listing.mdx +++ b/api_docs/event_annotation_listing.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/eventAnnotationListing title: "eventAnnotationListing" image: https://source.unsplash.com/400x175/?github description: API docs for the eventAnnotationListing plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'eventAnnotationListing'] --- import eventAnnotationListingObj from './event_annotation_listing.devdocs.json'; diff --git a/api_docs/event_log.mdx b/api_docs/event_log.mdx index e40a78ff75254..e2539a556c286 100644 --- a/api_docs/event_log.mdx +++ b/api_docs/event_log.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/eventLog title: "eventLog" image: https://source.unsplash.com/400x175/?github description: API docs for the eventLog plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'eventLog'] --- import eventLogObj from './event_log.devdocs.json'; diff --git a/api_docs/exploratory_view.devdocs.json b/api_docs/exploratory_view.devdocs.json index 9c86024cc4f65..5e286318a0344 100644 --- a/api_docs/exploratory_view.devdocs.json +++ b/api_docs/exploratory_view.devdocs.json @@ -460,10 +460,10 @@ "pluginId": "exploratoryView", "scope": "public", "docId": "kibExploratoryViewPluginApi", - "section": "def-public.AllSeries", - "text": "AllSeries" + "section": "def-public.SeriesUrl", + "text": "SeriesUrl" }, - " | undefined" + "[]" ], "path": "x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/embeddable/embeddable.tsx", "deprecated": false, @@ -525,20 +525,6 @@ "deprecated": false, "trackAdoption": false }, - { - "parentPluginId": "exploratoryView", - "id": "def-public.ExploratoryEmbeddableProps.customLensAttrs", - "type": "Any", - "tags": [], - "label": "customLensAttrs", - "description": [], - "signature": [ - "any" - ], - "path": "x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/embeddable/embeddable.tsx", - "deprecated": false, - "trackAdoption": false - }, { "parentPluginId": "exploratoryView", "id": "def-public.ExploratoryEmbeddableProps.customTimeRange", diff --git a/api_docs/exploratory_view.mdx b/api_docs/exploratory_view.mdx index bfe5801abe7b4..dce248fcf2062 100644 --- a/api_docs/exploratory_view.mdx +++ b/api_docs/exploratory_view.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/exploratoryView title: "exploratoryView" image: https://source.unsplash.com/400x175/?github description: API docs for the exploratoryView plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'exploratoryView'] --- import exploratoryViewObj from './exploratory_view.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/obs-ux-infra_services-team](https://github.com/orgs/elastic/te | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 131 | 1 | 131 | 14 | +| 130 | 0 | 130 | 14 | ## Client diff --git a/api_docs/expression_error.mdx b/api_docs/expression_error.mdx index e4ef7e053a2e7..e33e91622e2e9 100644 --- a/api_docs/expression_error.mdx +++ b/api_docs/expression_error.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionError title: "expressionError" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionError plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionError'] --- import expressionErrorObj from './expression_error.devdocs.json'; diff --git a/api_docs/expression_gauge.mdx b/api_docs/expression_gauge.mdx index f0ede837beaf2..09e404d5f40a3 100644 --- a/api_docs/expression_gauge.mdx +++ b/api_docs/expression_gauge.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionGauge title: "expressionGauge" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionGauge plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionGauge'] --- import expressionGaugeObj from './expression_gauge.devdocs.json'; diff --git a/api_docs/expression_heatmap.mdx b/api_docs/expression_heatmap.mdx index a5d6315c6626d..3ad875c6bfc50 100644 --- a/api_docs/expression_heatmap.mdx +++ b/api_docs/expression_heatmap.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionHeatmap title: "expressionHeatmap" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionHeatmap plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionHeatmap'] --- import expressionHeatmapObj from './expression_heatmap.devdocs.json'; diff --git a/api_docs/expression_image.mdx b/api_docs/expression_image.mdx index 90059d8cff950..4ef4283f8461c 100644 --- a/api_docs/expression_image.mdx +++ b/api_docs/expression_image.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionImage title: "expressionImage" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionImage plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionImage'] --- import expressionImageObj from './expression_image.devdocs.json'; diff --git a/api_docs/expression_legacy_metric_vis.mdx b/api_docs/expression_legacy_metric_vis.mdx index 168f800a0081d..196afb1a723dd 100644 --- a/api_docs/expression_legacy_metric_vis.mdx +++ b/api_docs/expression_legacy_metric_vis.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionLegacyMetricVis title: "expressionLegacyMetricVis" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionLegacyMetricVis plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionLegacyMetricVis'] --- import expressionLegacyMetricVisObj from './expression_legacy_metric_vis.devdocs.json'; diff --git a/api_docs/expression_metric.mdx b/api_docs/expression_metric.mdx index c56f4fa9d8e19..0d650df9ebfb6 100644 --- a/api_docs/expression_metric.mdx +++ b/api_docs/expression_metric.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionMetric title: "expressionMetric" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionMetric plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionMetric'] --- import expressionMetricObj from './expression_metric.devdocs.json'; diff --git a/api_docs/expression_metric_vis.mdx b/api_docs/expression_metric_vis.mdx index 98177c0300813..709fcff3d9d6f 100644 --- a/api_docs/expression_metric_vis.mdx +++ b/api_docs/expression_metric_vis.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionMetricVis title: "expressionMetricVis" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionMetricVis plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionMetricVis'] --- import expressionMetricVisObj from './expression_metric_vis.devdocs.json'; diff --git a/api_docs/expression_partition_vis.mdx b/api_docs/expression_partition_vis.mdx index 904f4cc1bce66..20adbc2af5fa0 100644 --- a/api_docs/expression_partition_vis.mdx +++ b/api_docs/expression_partition_vis.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionPartitionVis title: "expressionPartitionVis" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionPartitionVis plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionPartitionVis'] --- import expressionPartitionVisObj from './expression_partition_vis.devdocs.json'; diff --git a/api_docs/expression_repeat_image.mdx b/api_docs/expression_repeat_image.mdx index 298193a1737ad..fcf581dc2c59f 100644 --- a/api_docs/expression_repeat_image.mdx +++ b/api_docs/expression_repeat_image.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionRepeatImage title: "expressionRepeatImage" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionRepeatImage plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionRepeatImage'] --- import expressionRepeatImageObj from './expression_repeat_image.devdocs.json'; diff --git a/api_docs/expression_reveal_image.mdx b/api_docs/expression_reveal_image.mdx index 1e74209d0d395..26676f8e0aa79 100644 --- a/api_docs/expression_reveal_image.mdx +++ b/api_docs/expression_reveal_image.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionRevealImage title: "expressionRevealImage" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionRevealImage plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionRevealImage'] --- import expressionRevealImageObj from './expression_reveal_image.devdocs.json'; diff --git a/api_docs/expression_shape.mdx b/api_docs/expression_shape.mdx index fa44f87fa5b22..d6869a4d3e337 100644 --- a/api_docs/expression_shape.mdx +++ b/api_docs/expression_shape.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionShape title: "expressionShape" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionShape plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionShape'] --- import expressionShapeObj from './expression_shape.devdocs.json'; diff --git a/api_docs/expression_tagcloud.mdx b/api_docs/expression_tagcloud.mdx index 5108fc9808341..717f1e531aeda 100644 --- a/api_docs/expression_tagcloud.mdx +++ b/api_docs/expression_tagcloud.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionTagcloud title: "expressionTagcloud" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionTagcloud plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionTagcloud'] --- import expressionTagcloudObj from './expression_tagcloud.devdocs.json'; diff --git a/api_docs/expression_x_y.mdx b/api_docs/expression_x_y.mdx index d3c7f84749c5d..b3da4ddabb6f6 100644 --- a/api_docs/expression_x_y.mdx +++ b/api_docs/expression_x_y.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionXY title: "expressionXY" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionXY plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionXY'] --- import expressionXYObj from './expression_x_y.devdocs.json'; diff --git a/api_docs/expressions.mdx b/api_docs/expressions.mdx index b98eb7026244e..8430995eb24c2 100644 --- a/api_docs/expressions.mdx +++ b/api_docs/expressions.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressions title: "expressions" image: https://source.unsplash.com/400x175/?github description: API docs for the expressions plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressions'] --- import expressionsObj from './expressions.devdocs.json'; diff --git a/api_docs/features.mdx b/api_docs/features.mdx index 454c8f03367da..7ae1f4334dcfc 100644 --- a/api_docs/features.mdx +++ b/api_docs/features.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/features title: "features" image: https://source.unsplash.com/400x175/?github description: API docs for the features plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'features'] --- import featuresObj from './features.devdocs.json'; diff --git a/api_docs/field_formats.mdx b/api_docs/field_formats.mdx index 9dd0b97e64ec8..fc723632424c7 100644 --- a/api_docs/field_formats.mdx +++ b/api_docs/field_formats.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/fieldFormats title: "fieldFormats" image: https://source.unsplash.com/400x175/?github description: API docs for the fieldFormats plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'fieldFormats'] --- import fieldFormatsObj from './field_formats.devdocs.json'; diff --git a/api_docs/file_upload.mdx b/api_docs/file_upload.mdx index 4021ba58c7f20..be3c119ee0054 100644 --- a/api_docs/file_upload.mdx +++ b/api_docs/file_upload.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/fileUpload title: "fileUpload" image: https://source.unsplash.com/400x175/?github description: API docs for the fileUpload plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'fileUpload'] --- import fileUploadObj from './file_upload.devdocs.json'; diff --git a/api_docs/files.devdocs.json b/api_docs/files.devdocs.json index 12fa5d46818a4..691ce183b4985 100644 --- a/api_docs/files.devdocs.json +++ b/api_docs/files.devdocs.json @@ -524,10 +524,10 @@ "objects": [], "setup": { "parentPluginId": "files", - "id": "def-public.FilesSetup", + "id": "def-public.FilesPublicSetup", "type": "Interface", "tags": [], - "label": "FilesSetup", + "label": "FilesPublicSetup", "description": [ "\nPublic setup-phase contract" ], @@ -537,7 +537,7 @@ "children": [ { "parentPluginId": "files", - "id": "def-public.FilesSetup.filesClientFactory", + "id": "def-public.FilesPublicSetup.filesClientFactory", "type": "Object", "tags": [ "track-adoption" @@ -597,7 +597,7 @@ }, { "parentPluginId": "files", - "id": "def-public.FilesSetup.registerFileKind", + "id": "def-public.FilesPublicSetup.registerFileKind", "type": "Function", "tags": [], "label": "registerFileKind", @@ -621,7 +621,7 @@ "children": [ { "parentPluginId": "files", - "id": "def-public.FilesSetup.registerFileKind.$1", + "id": "def-public.FilesPublicSetup.registerFileKind.$1", "type": "Object", "tags": [], "label": "fileKind", @@ -651,10 +651,10 @@ }, "start": { "parentPluginId": "files", - "id": "def-public.FilesStart", + "id": "def-public.FilesPublicStart", "type": "Type", "tags": [], - "label": "FilesStart", + "label": "FilesPublicStart", "description": [], "signature": [ "Pick<", @@ -662,8 +662,8 @@ "pluginId": "files", "scope": "public", "docId": "kibFilesPluginApi", - "section": "def-public.FilesSetup", - "text": "FilesSetup" + "section": "def-public.FilesPublicSetup", + "text": "FilesPublicSetup" }, ", \"filesClientFactory\"> & { getFileKindDefinition: (id: string) => ", { @@ -5317,10 +5317,10 @@ "objects": [], "setup": { "parentPluginId": "files", - "id": "def-server.FilesSetup", + "id": "def-server.FilesServerSetup", "type": "Interface", "tags": [], - "label": "FilesSetup", + "label": "FilesServerSetup", "description": [ "\nFiles plugin setup contract" ], @@ -5330,7 +5330,7 @@ "children": [ { "parentPluginId": "files", - "id": "def-server.FilesSetup.registerFileKind", + "id": "def-server.FilesServerSetup.registerFileKind", "type": "Function", "tags": [ "track-adoption" @@ -5398,7 +5398,7 @@ "children": [ { "parentPluginId": "files", - "id": "def-server.FilesSetup.registerFileKind.$1", + "id": "def-server.FilesServerSetup.registerFileKind.$1", "type": "Object", "tags": [], "label": "fileKind", @@ -5428,10 +5428,10 @@ }, "start": { "parentPluginId": "files", - "id": "def-server.FilesStart", + "id": "def-server.FilesServerStart", "type": "Interface", "tags": [], - "label": "FilesStart", + "label": "FilesServerStart", "description": [ "\nFiles plugin start contract" ], @@ -5441,7 +5441,7 @@ "children": [ { "parentPluginId": "files", - "id": "def-server.FilesStart.fileServiceFactory", + "id": "def-server.FilesServerStart.fileServiceFactory", "type": "Object", "tags": [ "track-adoption" diff --git a/api_docs/files.mdx b/api_docs/files.mdx index 6c07fffc51ffe..4e18bd193ef2f 100644 --- a/api_docs/files.mdx +++ b/api_docs/files.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/files title: "files" image: https://source.unsplash.com/400x175/?github description: API docs for the files plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'files'] --- import filesObj from './files.devdocs.json'; diff --git a/api_docs/files_management.mdx b/api_docs/files_management.mdx index 68987d9cd7ac9..2f787e46e8292 100644 --- a/api_docs/files_management.mdx +++ b/api_docs/files_management.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/filesManagement title: "filesManagement" image: https://source.unsplash.com/400x175/?github description: API docs for the filesManagement plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'filesManagement'] --- import filesManagementObj from './files_management.devdocs.json'; diff --git a/api_docs/fleet.mdx b/api_docs/fleet.mdx index 73c4dee2f1277..a2529488fea50 100644 --- a/api_docs/fleet.mdx +++ b/api_docs/fleet.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/fleet title: "fleet" image: https://source.unsplash.com/400x175/?github description: API docs for the fleet plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'fleet'] --- import fleetObj from './fleet.devdocs.json'; diff --git a/api_docs/global_search.mdx b/api_docs/global_search.mdx index f1c3f3cc1a913..cfe38afe6f1e7 100644 --- a/api_docs/global_search.mdx +++ b/api_docs/global_search.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/globalSearch title: "globalSearch" image: https://source.unsplash.com/400x175/?github description: API docs for the globalSearch plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'globalSearch'] --- import globalSearchObj from './global_search.devdocs.json'; diff --git a/api_docs/guided_onboarding.mdx b/api_docs/guided_onboarding.mdx index c042e6144fe77..dd3d5c34517c0 100644 --- a/api_docs/guided_onboarding.mdx +++ b/api_docs/guided_onboarding.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/guidedOnboarding title: "guidedOnboarding" image: https://source.unsplash.com/400x175/?github description: API docs for the guidedOnboarding plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'guidedOnboarding'] --- import guidedOnboardingObj from './guided_onboarding.devdocs.json'; diff --git a/api_docs/home.mdx b/api_docs/home.mdx index a9abb45c37c85..371246b624db7 100644 --- a/api_docs/home.mdx +++ b/api_docs/home.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/home title: "home" image: https://source.unsplash.com/400x175/?github description: API docs for the home plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'home'] --- import homeObj from './home.devdocs.json'; diff --git a/api_docs/image_embeddable.mdx b/api_docs/image_embeddable.mdx index 674b8f7effddf..8c2cfc0e6478f 100644 --- a/api_docs/image_embeddable.mdx +++ b/api_docs/image_embeddable.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/imageEmbeddable title: "imageEmbeddable" image: https://source.unsplash.com/400x175/?github description: API docs for the imageEmbeddable plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'imageEmbeddable'] --- import imageEmbeddableObj from './image_embeddable.devdocs.json'; diff --git a/api_docs/index_lifecycle_management.mdx b/api_docs/index_lifecycle_management.mdx index b778b3382f0b5..df8a5fef4b6ff 100644 --- a/api_docs/index_lifecycle_management.mdx +++ b/api_docs/index_lifecycle_management.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/indexLifecycleManagement title: "indexLifecycleManagement" image: https://source.unsplash.com/400x175/?github description: API docs for the indexLifecycleManagement plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'indexLifecycleManagement'] --- import indexLifecycleManagementObj from './index_lifecycle_management.devdocs.json'; diff --git a/api_docs/index_management.mdx b/api_docs/index_management.mdx index c684d47e6b029..8ce83386a5629 100644 --- a/api_docs/index_management.mdx +++ b/api_docs/index_management.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/indexManagement title: "indexManagement" image: https://source.unsplash.com/400x175/?github description: API docs for the indexManagement plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'indexManagement'] --- import indexManagementObj from './index_management.devdocs.json'; diff --git a/api_docs/infra.mdx b/api_docs/infra.mdx index a919b307e6821..81ff97012c029 100644 --- a/api_docs/infra.mdx +++ b/api_docs/infra.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/infra title: "infra" image: https://source.unsplash.com/400x175/?github description: API docs for the infra plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'infra'] --- import infraObj from './infra.devdocs.json'; diff --git a/api_docs/inspector.mdx b/api_docs/inspector.mdx index 8fa62f4d2d670..e2c5b4b9d23ca 100644 --- a/api_docs/inspector.mdx +++ b/api_docs/inspector.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/inspector title: "inspector" image: https://source.unsplash.com/400x175/?github description: API docs for the inspector plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'inspector'] --- import inspectorObj from './inspector.devdocs.json'; diff --git a/api_docs/interactive_setup.mdx b/api_docs/interactive_setup.mdx index ac5f555034a95..252e160b616d4 100644 --- a/api_docs/interactive_setup.mdx +++ b/api_docs/interactive_setup.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/interactiveSetup title: "interactiveSetup" image: https://source.unsplash.com/400x175/?github description: API docs for the interactiveSetup plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'interactiveSetup'] --- import interactiveSetupObj from './interactive_setup.devdocs.json'; diff --git a/api_docs/kbn_ace.mdx b/api_docs/kbn_ace.mdx index 74dbf76765b6c..c756601989eeb 100644 --- a/api_docs/kbn_ace.mdx +++ b/api_docs/kbn_ace.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ace title: "@kbn/ace" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ace plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ace'] --- import kbnAceObj from './kbn_ace.devdocs.json'; diff --git a/api_docs/kbn_actions_types.mdx b/api_docs/kbn_actions_types.mdx index 171a14fb69ef5..8fe3b21f248a5 100644 --- a/api_docs/kbn_actions_types.mdx +++ b/api_docs/kbn_actions_types.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-actions-types title: "@kbn/actions-types" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/actions-types plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/actions-types'] --- import kbnActionsTypesObj from './kbn_actions_types.devdocs.json'; diff --git a/api_docs/kbn_aiops_components.mdx b/api_docs/kbn_aiops_components.mdx index e1f95801b3462..ed0a6db4ec0b7 100644 --- a/api_docs/kbn_aiops_components.mdx +++ b/api_docs/kbn_aiops_components.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-aiops-components title: "@kbn/aiops-components" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/aiops-components plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/aiops-components'] --- import kbnAiopsComponentsObj from './kbn_aiops_components.devdocs.json'; diff --git a/api_docs/kbn_aiops_utils.mdx b/api_docs/kbn_aiops_utils.mdx index c0c27ef3e91f6..fd698569ca494 100644 --- a/api_docs/kbn_aiops_utils.mdx +++ b/api_docs/kbn_aiops_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-aiops-utils title: "@kbn/aiops-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/aiops-utils plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/aiops-utils'] --- import kbnAiopsUtilsObj from './kbn_aiops_utils.devdocs.json'; diff --git a/api_docs/kbn_alerting_api_integration_helpers.mdx b/api_docs/kbn_alerting_api_integration_helpers.mdx index bb2aedd617e18..97a48ce9208ca 100644 --- a/api_docs/kbn_alerting_api_integration_helpers.mdx +++ b/api_docs/kbn_alerting_api_integration_helpers.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-alerting-api-integration-helpers title: "@kbn/alerting-api-integration-helpers" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/alerting-api-integration-helpers plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/alerting-api-integration-helpers'] --- import kbnAlertingApiIntegrationHelpersObj from './kbn_alerting_api_integration_helpers.devdocs.json'; diff --git a/api_docs/kbn_alerting_state_types.mdx b/api_docs/kbn_alerting_state_types.mdx index 056a90759df25..4c422b3bc080a 100644 --- a/api_docs/kbn_alerting_state_types.mdx +++ b/api_docs/kbn_alerting_state_types.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-alerting-state-types title: "@kbn/alerting-state-types" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/alerting-state-types plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/alerting-state-types'] --- import kbnAlertingStateTypesObj from './kbn_alerting_state_types.devdocs.json'; diff --git a/api_docs/kbn_alerting_types.mdx b/api_docs/kbn_alerting_types.mdx index 42af610a54bff..d8bdba5c8b581 100644 --- a/api_docs/kbn_alerting_types.mdx +++ b/api_docs/kbn_alerting_types.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-alerting-types title: "@kbn/alerting-types" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/alerting-types plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/alerting-types'] --- import kbnAlertingTypesObj from './kbn_alerting_types.devdocs.json'; diff --git a/api_docs/kbn_alerts_as_data_utils.mdx b/api_docs/kbn_alerts_as_data_utils.mdx index 55e03d25df5e5..c6c2e697f4043 100644 --- a/api_docs/kbn_alerts_as_data_utils.mdx +++ b/api_docs/kbn_alerts_as_data_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-alerts-as-data-utils title: "@kbn/alerts-as-data-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/alerts-as-data-utils plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/alerts-as-data-utils'] --- import kbnAlertsAsDataUtilsObj from './kbn_alerts_as_data_utils.devdocs.json'; diff --git a/api_docs/kbn_alerts_ui_shared.mdx b/api_docs/kbn_alerts_ui_shared.mdx index 22e5f87e5d944..24fa8ff68db43 100644 --- a/api_docs/kbn_alerts_ui_shared.mdx +++ b/api_docs/kbn_alerts_ui_shared.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-alerts-ui-shared title: "@kbn/alerts-ui-shared" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/alerts-ui-shared plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/alerts-ui-shared'] --- import kbnAlertsUiSharedObj from './kbn_alerts_ui_shared.devdocs.json'; diff --git a/api_docs/kbn_analytics.mdx b/api_docs/kbn_analytics.mdx index e0fb45d2a34e0..cbbcfa455aa75 100644 --- a/api_docs/kbn_analytics.mdx +++ b/api_docs/kbn_analytics.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-analytics title: "@kbn/analytics" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/analytics plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/analytics'] --- import kbnAnalyticsObj from './kbn_analytics.devdocs.json'; diff --git a/api_docs/kbn_analytics_client.devdocs.json b/api_docs/kbn_analytics_client.devdocs.json index 2ae989f1fbf2b..a940c2673439c 100644 --- a/api_docs/kbn_analytics_client.devdocs.json +++ b/api_docs/kbn_analytics_client.devdocs.json @@ -730,6 +730,10 @@ "plugin": "fleet", "path": "x-pack/plugins/fleet/server/services/telemetry/fleet_usage_sender.ts" }, + { + "plugin": "fleet", + "path": "x-pack/plugins/fleet/server/services/telemetry/fleet_usage_sender.ts" + }, { "plugin": "observabilityAIAssistant", "path": "x-pack/plugins/observability_ai_assistant/public/analytics/index.ts" diff --git a/api_docs/kbn_analytics_client.mdx b/api_docs/kbn_analytics_client.mdx index 27fad748961d3..416181f49c311 100644 --- a/api_docs/kbn_analytics_client.mdx +++ b/api_docs/kbn_analytics_client.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-analytics-client title: "@kbn/analytics-client" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/analytics-client plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/analytics-client'] --- import kbnAnalyticsClientObj from './kbn_analytics_client.devdocs.json'; diff --git a/api_docs/kbn_analytics_collection_utils.mdx b/api_docs/kbn_analytics_collection_utils.mdx index b332ba2f15077..dba58985f7e87 100644 --- a/api_docs/kbn_analytics_collection_utils.mdx +++ b/api_docs/kbn_analytics_collection_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-analytics-collection-utils title: "@kbn/analytics-collection-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/analytics-collection-utils plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/analytics-collection-utils'] --- import kbnAnalyticsCollectionUtilsObj from './kbn_analytics_collection_utils.devdocs.json'; diff --git a/api_docs/kbn_analytics_shippers_elastic_v3_browser.mdx b/api_docs/kbn_analytics_shippers_elastic_v3_browser.mdx index 4c05abf6d9069..24a7528cb02b3 100644 --- a/api_docs/kbn_analytics_shippers_elastic_v3_browser.mdx +++ b/api_docs/kbn_analytics_shippers_elastic_v3_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-analytics-shippers-elastic-v3-browser title: "@kbn/analytics-shippers-elastic-v3-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/analytics-shippers-elastic-v3-browser plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/analytics-shippers-elastic-v3-browser'] --- import kbnAnalyticsShippersElasticV3BrowserObj from './kbn_analytics_shippers_elastic_v3_browser.devdocs.json'; diff --git a/api_docs/kbn_analytics_shippers_elastic_v3_common.mdx b/api_docs/kbn_analytics_shippers_elastic_v3_common.mdx index b43c90a0540a5..e2d2380e865cf 100644 --- a/api_docs/kbn_analytics_shippers_elastic_v3_common.mdx +++ b/api_docs/kbn_analytics_shippers_elastic_v3_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-analytics-shippers-elastic-v3-common title: "@kbn/analytics-shippers-elastic-v3-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/analytics-shippers-elastic-v3-common plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/analytics-shippers-elastic-v3-common'] --- import kbnAnalyticsShippersElasticV3CommonObj from './kbn_analytics_shippers_elastic_v3_common.devdocs.json'; diff --git a/api_docs/kbn_analytics_shippers_elastic_v3_server.mdx b/api_docs/kbn_analytics_shippers_elastic_v3_server.mdx index 8ce9b7942e346..298857a4647f1 100644 --- a/api_docs/kbn_analytics_shippers_elastic_v3_server.mdx +++ b/api_docs/kbn_analytics_shippers_elastic_v3_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-analytics-shippers-elastic-v3-server title: "@kbn/analytics-shippers-elastic-v3-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/analytics-shippers-elastic-v3-server plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/analytics-shippers-elastic-v3-server'] --- import kbnAnalyticsShippersElasticV3ServerObj from './kbn_analytics_shippers_elastic_v3_server.devdocs.json'; diff --git a/api_docs/kbn_analytics_shippers_fullstory.mdx b/api_docs/kbn_analytics_shippers_fullstory.mdx index 2c4f25586b711..b1e2330a7995e 100644 --- a/api_docs/kbn_analytics_shippers_fullstory.mdx +++ b/api_docs/kbn_analytics_shippers_fullstory.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-analytics-shippers-fullstory title: "@kbn/analytics-shippers-fullstory" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/analytics-shippers-fullstory plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/analytics-shippers-fullstory'] --- import kbnAnalyticsShippersFullstoryObj from './kbn_analytics_shippers_fullstory.devdocs.json'; diff --git a/api_docs/kbn_analytics_shippers_gainsight.mdx b/api_docs/kbn_analytics_shippers_gainsight.mdx index 9c2c36886a075..0f41d84f92480 100644 --- a/api_docs/kbn_analytics_shippers_gainsight.mdx +++ b/api_docs/kbn_analytics_shippers_gainsight.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-analytics-shippers-gainsight title: "@kbn/analytics-shippers-gainsight" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/analytics-shippers-gainsight plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/analytics-shippers-gainsight'] --- import kbnAnalyticsShippersGainsightObj from './kbn_analytics_shippers_gainsight.devdocs.json'; diff --git a/api_docs/kbn_apm_config_loader.mdx b/api_docs/kbn_apm_config_loader.mdx index 35a46cc2c1e4f..11a93dcd52d3b 100644 --- a/api_docs/kbn_apm_config_loader.mdx +++ b/api_docs/kbn_apm_config_loader.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-apm-config-loader title: "@kbn/apm-config-loader" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/apm-config-loader plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/apm-config-loader'] --- import kbnApmConfigLoaderObj from './kbn_apm_config_loader.devdocs.json'; diff --git a/api_docs/kbn_apm_synthtrace.mdx b/api_docs/kbn_apm_synthtrace.mdx index b34e7d0b790f1..f83bb9f9b3466 100644 --- a/api_docs/kbn_apm_synthtrace.mdx +++ b/api_docs/kbn_apm_synthtrace.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-apm-synthtrace title: "@kbn/apm-synthtrace" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/apm-synthtrace plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/apm-synthtrace'] --- import kbnApmSynthtraceObj from './kbn_apm_synthtrace.devdocs.json'; diff --git a/api_docs/kbn_apm_synthtrace_client.devdocs.json b/api_docs/kbn_apm_synthtrace_client.devdocs.json index c3d0a4f306d85..ed09a5e431a2f 100644 --- a/api_docs/kbn_apm_synthtrace_client.devdocs.json +++ b/api_docs/kbn_apm_synthtrace_client.devdocs.json @@ -2510,9 +2510,11 @@ "signature": [ "{ '@timestamp'?: number | undefined; } & Partial<{ meta: { 'metricset.id': string; }; }> & Partial<{ 'timestamp.us'?: number | undefined; 'agent.name': string; 'agent.version': string; 'client.geo.city_name': string; 'client.geo.continent_name': string; 'client.geo.country_iso_code': string; 'client.geo.country_name': string; 'client.geo.location': ", "GeoLocation", - "; 'client.geo.region_iso_code': string; 'client.geo.region_name': string; 'client.ip': string; 'cloud.account.id': string; 'cloud.account.name': string; 'cloud.availability_zone': string; 'cloud.machine.type': string; 'cloud.project.id': string; 'cloud.project.name': string; 'cloud.provider': string; 'cloud.region': string; 'cloud.service.name': string; 'container.id': string; 'destination.address': string; 'destination.port': number; 'device.id': string; 'device.manufacturer': string; 'device.model.identifier': string; 'device.model.name': string; 'ecs.version': string; 'error.exception': ", + "; 'client.geo.region_iso_code': string; 'client.geo.region_name': string; 'client.ip': string; 'cloud.account.id': string; 'cloud.account.name': string; 'cloud.availability_zone': string; 'cloud.machine.type': string; 'cloud.project.id': string; 'cloud.project.name': string; 'cloud.provider': string; 'cloud.region': string; 'cloud.service.name': string; 'code.stacktrace': string; 'container.id': string; 'destination.address': string; 'destination.port': number; 'device.id': string; 'device.manufacturer': string; 'device.model.identifier': string; 'device.model.name': string; 'ecs.version': string; 'error.exception': ", "ApmException", - "[]; 'error.grouping_key': string; 'error.grouping_name': string; 'error.id': string; 'error.type': string; 'event.ingested': number; 'event.name': string; 'event.action': string; 'event.outcome': string; 'event.outcome_numeric': number | { sum: number; value_count: number; }; 'faas.coldstart': boolean; 'faas.execution': string; 'faas.id': string; 'faas.name': string; 'faas.trigger.type': string; 'faas.version': string; 'host.architecture': string; 'host.hostname': string; 'host.name': string; 'host.os.full': string; 'host.os.name': string; 'host.os.platform': string; 'host.os.type': string; 'host.os.version': string; 'http.request.method': string; 'http.response.status_code': number; 'kubernetes.pod.name': string; 'kubernetes.pod.uid': string; 'labels.name': string; 'labels.telemetry_auto_version': string; 'labels.lifecycle_state': string; 'metricset.name': string; 'network.carrier.icc': string; 'network.carrier.mcc': string; 'network.carrier.mnc': string; 'network.carrier.name': string; 'network.connection.subtype': string; 'network.connection.type': string; 'observer.type': string; 'observer.version_major': number; 'observer.version': string; 'parent.id': string; 'processor.event': string; 'processor.name': string; 'session.id': string; 'trace.id': string; 'transaction.aggregation.overflow_count': number; 'transaction.duration.us': number; 'transaction.id': string; 'transaction.name': string; 'transaction.type': string; 'transaction.duration.histogram': { values: number[]; counts: number[]; }; 'transaction.result': string; 'transaction.sampled': boolean; 'service.environment': string; 'service.framework.name': string; 'service.framework.version': string; 'service.language.name': string; 'service.language.version': string; 'service.name': string; 'service.node.name': string; 'service.runtime.name': string; 'service.runtime.version': string; 'service.target.name': string; 'service.target.type': string; 'service.version': string; 'span.action': string; 'span.destination.service.resource': string; 'span.destination.service.response_time.count': number; 'span.destination.service.response_time.sum.us': number; 'span.duration.us': number; 'span.id': string; 'span.name': string; 'span.self_time.count': number; 'span.self_time.sum.us': number; 'span.subtype': string; 'span.type': string; 'span.links': { trace: { id: string; }; span: { id: string; }; }[]; 'url.original': string; }> & Partial<{ 'system.process.memory.size': number; 'system.memory.actual.free': number; 'system.memory.total': number; 'system.process.cgroup.memory.mem.limit.bytes': number; 'system.process.cgroup.memory.mem.usage.bytes': number; 'system.cpu.total.norm.pct': number; 'system.process.memory.rss.bytes': number; 'system.process.cpu.total.norm.pct': number; 'jvm.memory.heap.used': number; 'jvm.memory.non_heap.used': number; 'jvm.thread.count': number; 'faas.billed_duration': number; 'faas.timeout': number; 'faas.coldstart_duration': number; 'faas.duration': number; 'application.launch.time': number; }> & Partial<{ 'metricset.interval': string; 'transaction.duration.summary': string; }>" + "[]; 'error.grouping_key': string; 'error.grouping_name': string; 'error.id': string; 'error.type': string; 'event.ingested': number; 'event.name': string; 'event.action': string; 'event.outcome': string; 'event.outcome_numeric': number | { sum: number; value_count: number; }; 'faas.coldstart': boolean; 'faas.execution': string; 'faas.id': string; 'faas.name': string; 'faas.trigger.type': string; 'faas.version': string; 'host.architecture': string; 'host.hostname': string; 'host.name': string; 'host.os.full': string; 'host.os.name': string; 'host.os.platform': string; 'host.os.type': string; 'host.os.version': string; 'http.request.method': string; 'http.response.status_code': number; 'kubernetes.pod.name': string; 'kubernetes.pod.uid': string; 'labels.name': string; 'labels.telemetry_auto_version': string; 'labels.lifecycle_state': string; 'metricset.name': string; 'network.carrier.icc': string; 'network.carrier.mcc': string; 'network.carrier.mnc': string; 'network.carrier.name': string; 'network.connection.subtype': string; 'network.connection.type': string; 'observer.type': string; 'observer.version_major': number; 'observer.version': string; 'parent.id': string; 'processor.event': string; 'processor.name': string; 'session.id': string; 'trace.id': string; 'transaction.aggregation.overflow_count': number; 'transaction.duration.us': number; 'transaction.id': string; 'transaction.name': string; 'transaction.type': string; 'transaction.duration.histogram': { values: number[]; counts: number[]; }; 'transaction.result': string; 'transaction.sampled': boolean; 'service.environment': string; 'service.framework.name': string; 'service.framework.version': string; 'service.language.name': string; 'service.language.version': string; 'service.name': string; 'service.node.name': string; 'service.runtime.name': string; 'service.runtime.version': string; 'service.target.name': string; 'service.target.type': string; 'service.version': string; 'span.action': string; 'span.destination.service.resource': string; 'span.destination.service.response_time.count': number; 'span.destination.service.response_time.sum.us': number; 'span.duration.us': number; 'span.id': string; 'span.name': string; 'span.stacktrace': ", + "APMStacktrace", + "[]; 'span.self_time.count': number; 'span.self_time.sum.us': number; 'span.subtype': string; 'span.type': string; 'span.links': { trace: { id: string; }; span: { id: string; }; }[]; 'url.original': string; }> & Partial<{ 'system.process.memory.size': number; 'system.memory.actual.free': number; 'system.memory.total': number; 'system.process.cgroup.memory.mem.limit.bytes': number; 'system.process.cgroup.memory.mem.usage.bytes': number; 'system.cpu.total.norm.pct': number; 'system.process.memory.rss.bytes': number; 'system.process.cpu.total.norm.pct': number; 'jvm.memory.heap.used': number; 'jvm.memory.non_heap.used': number; 'jvm.thread.count': number; 'faas.billed_duration': number; 'faas.timeout': number; 'faas.coldstart_duration': number; 'faas.duration': number; 'application.launch.time': number; }> & Partial<{ 'metricset.interval': string; 'transaction.duration.summary': string; }>" ], "path": "packages/kbn-apm-synthtrace-client/src/lib/apm/apm_fields.ts", "deprecated": false, diff --git a/api_docs/kbn_apm_synthtrace_client.mdx b/api_docs/kbn_apm_synthtrace_client.mdx index 3404635761839..2a391fff63155 100644 --- a/api_docs/kbn_apm_synthtrace_client.mdx +++ b/api_docs/kbn_apm_synthtrace_client.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-apm-synthtrace-client title: "@kbn/apm-synthtrace-client" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/apm-synthtrace-client plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/apm-synthtrace-client'] --- import kbnApmSynthtraceClientObj from './kbn_apm_synthtrace_client.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/obs-ux-infra_services-team](https://github.com/orgs/elastic/te | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 188 | 0 | 188 | 27 | +| 188 | 0 | 188 | 28 | ## Common diff --git a/api_docs/kbn_apm_utils.mdx b/api_docs/kbn_apm_utils.mdx index 2573d0417601e..33ce87aa5ab24 100644 --- a/api_docs/kbn_apm_utils.mdx +++ b/api_docs/kbn_apm_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-apm-utils title: "@kbn/apm-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/apm-utils plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/apm-utils'] --- import kbnApmUtilsObj from './kbn_apm_utils.devdocs.json'; diff --git a/api_docs/kbn_axe_config.mdx b/api_docs/kbn_axe_config.mdx index a91a5a8d1dff0..64d29795c1b8e 100644 --- a/api_docs/kbn_axe_config.mdx +++ b/api_docs/kbn_axe_config.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-axe-config title: "@kbn/axe-config" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/axe-config plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/axe-config'] --- import kbnAxeConfigObj from './kbn_axe_config.devdocs.json'; diff --git a/api_docs/kbn_bfetch_error.mdx b/api_docs/kbn_bfetch_error.mdx index 5d767b8ca8bc9..8031118be4078 100644 --- a/api_docs/kbn_bfetch_error.mdx +++ b/api_docs/kbn_bfetch_error.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-bfetch-error title: "@kbn/bfetch-error" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/bfetch-error plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/bfetch-error'] --- import kbnBfetchErrorObj from './kbn_bfetch_error.devdocs.json'; diff --git a/api_docs/kbn_calculate_auto.mdx b/api_docs/kbn_calculate_auto.mdx index fdba00611b817..4c905f367cdef 100644 --- a/api_docs/kbn_calculate_auto.mdx +++ b/api_docs/kbn_calculate_auto.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-calculate-auto title: "@kbn/calculate-auto" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/calculate-auto plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/calculate-auto'] --- import kbnCalculateAutoObj from './kbn_calculate_auto.devdocs.json'; diff --git a/api_docs/kbn_calculate_width_from_char_count.mdx b/api_docs/kbn_calculate_width_from_char_count.mdx index 5fdfc3d8a1f32..fdc76dd7fa26f 100644 --- a/api_docs/kbn_calculate_width_from_char_count.mdx +++ b/api_docs/kbn_calculate_width_from_char_count.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-calculate-width-from-char-count title: "@kbn/calculate-width-from-char-count" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/calculate-width-from-char-count plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/calculate-width-from-char-count'] --- import kbnCalculateWidthFromCharCountObj from './kbn_calculate_width_from_char_count.devdocs.json'; diff --git a/api_docs/kbn_cases_components.mdx b/api_docs/kbn_cases_components.mdx index 6089f4a18146a..6a59d149f5983 100644 --- a/api_docs/kbn_cases_components.mdx +++ b/api_docs/kbn_cases_components.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-cases-components title: "@kbn/cases-components" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/cases-components plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/cases-components'] --- import kbnCasesComponentsObj from './kbn_cases_components.devdocs.json'; diff --git a/api_docs/kbn_cell_actions.mdx b/api_docs/kbn_cell_actions.mdx index d69636b052b3b..c792dc3ef7526 100644 --- a/api_docs/kbn_cell_actions.mdx +++ b/api_docs/kbn_cell_actions.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-cell-actions title: "@kbn/cell-actions" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/cell-actions plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/cell-actions'] --- import kbnCellActionsObj from './kbn_cell_actions.devdocs.json'; diff --git a/api_docs/kbn_chart_expressions_common.mdx b/api_docs/kbn_chart_expressions_common.mdx index 0aa94786c7d48..48046c35959a4 100644 --- a/api_docs/kbn_chart_expressions_common.mdx +++ b/api_docs/kbn_chart_expressions_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-chart-expressions-common title: "@kbn/chart-expressions-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/chart-expressions-common plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/chart-expressions-common'] --- import kbnChartExpressionsCommonObj from './kbn_chart_expressions_common.devdocs.json'; diff --git a/api_docs/kbn_chart_icons.mdx b/api_docs/kbn_chart_icons.mdx index a40509d452432..e782250378ad5 100644 --- a/api_docs/kbn_chart_icons.mdx +++ b/api_docs/kbn_chart_icons.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-chart-icons title: "@kbn/chart-icons" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/chart-icons plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/chart-icons'] --- import kbnChartIconsObj from './kbn_chart_icons.devdocs.json'; diff --git a/api_docs/kbn_ci_stats_core.mdx b/api_docs/kbn_ci_stats_core.mdx index ca41d4b5ed87a..2e79dbdedfd6f 100644 --- a/api_docs/kbn_ci_stats_core.mdx +++ b/api_docs/kbn_ci_stats_core.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ci-stats-core title: "@kbn/ci-stats-core" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ci-stats-core plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ci-stats-core'] --- import kbnCiStatsCoreObj from './kbn_ci_stats_core.devdocs.json'; diff --git a/api_docs/kbn_ci_stats_performance_metrics.mdx b/api_docs/kbn_ci_stats_performance_metrics.mdx index a34f052404c56..39b5cc2616cb6 100644 --- a/api_docs/kbn_ci_stats_performance_metrics.mdx +++ b/api_docs/kbn_ci_stats_performance_metrics.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ci-stats-performance-metrics title: "@kbn/ci-stats-performance-metrics" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ci-stats-performance-metrics plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ci-stats-performance-metrics'] --- import kbnCiStatsPerformanceMetricsObj from './kbn_ci_stats_performance_metrics.devdocs.json'; diff --git a/api_docs/kbn_ci_stats_reporter.mdx b/api_docs/kbn_ci_stats_reporter.mdx index fcd17b60f9a7d..8864be86e08ac 100644 --- a/api_docs/kbn_ci_stats_reporter.mdx +++ b/api_docs/kbn_ci_stats_reporter.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ci-stats-reporter title: "@kbn/ci-stats-reporter" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ci-stats-reporter plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ci-stats-reporter'] --- import kbnCiStatsReporterObj from './kbn_ci_stats_reporter.devdocs.json'; diff --git a/api_docs/kbn_cli_dev_mode.mdx b/api_docs/kbn_cli_dev_mode.mdx index 5d4387186d935..f3a65737a8370 100644 --- a/api_docs/kbn_cli_dev_mode.mdx +++ b/api_docs/kbn_cli_dev_mode.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-cli-dev-mode title: "@kbn/cli-dev-mode" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/cli-dev-mode plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/cli-dev-mode'] --- import kbnCliDevModeObj from './kbn_cli_dev_mode.devdocs.json'; diff --git a/api_docs/kbn_code_editor.mdx b/api_docs/kbn_code_editor.mdx index c98e62ee39b2f..75a478ca85892 100644 --- a/api_docs/kbn_code_editor.mdx +++ b/api_docs/kbn_code_editor.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-code-editor title: "@kbn/code-editor" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/code-editor plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/code-editor'] --- import kbnCodeEditorObj from './kbn_code_editor.devdocs.json'; diff --git a/api_docs/kbn_code_owners.devdocs.json b/api_docs/kbn_code_owners.devdocs.json new file mode 100644 index 0000000000000..f36c551502821 --- /dev/null +++ b/api_docs/kbn_code_owners.devdocs.json @@ -0,0 +1,175 @@ +{ + "id": "@kbn/code-owners", + "client": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "server": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "common": { + "classes": [], + "functions": [ + { + "parentPluginId": "@kbn/code-owners", + "id": "def-common.getCodeOwnersForFile", + "type": "Function", + "tags": [], + "label": "getCodeOwnersForFile", + "description": [ + "\nGet the GitHub CODEOWNERS for a file in the repository" + ], + "signature": [ + "(filePath: string, reversedCodeowners: ", + { + "pluginId": "@kbn/code-owners", + "scope": "common", + "docId": "kibKbnCodeOwnersPluginApi", + "section": "def-common.PathWithOwners", + "text": "PathWithOwners" + }, + "[] | undefined) => string | undefined" + ], + "path": "packages/kbn-code-owners/src/file_code_owner.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/code-owners", + "id": "def-common.getCodeOwnersForFile.$1", + "type": "string", + "tags": [], + "label": "filePath", + "description": [ + "the file to get code owners for" + ], + "signature": [ + "string" + ], + "path": "packages/kbn-code-owners/src/file_code_owner.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/code-owners", + "id": "def-common.getCodeOwnersForFile.$2", + "type": "Array", + "tags": [], + "label": "reversedCodeowners", + "description": [ + "a cached reversed code owners list, use to speed up multiple requests" + ], + "signature": [ + { + "pluginId": "@kbn/code-owners", + "scope": "common", + "docId": "kibKbnCodeOwnersPluginApi", + "section": "def-common.PathWithOwners", + "text": "PathWithOwners" + }, + "[] | undefined" + ], + "path": "packages/kbn-code-owners/src/file_code_owner.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": false + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/code-owners", + "id": "def-common.getPathsWithOwnersReversed", + "type": "Function", + "tags": [], + "label": "getPathsWithOwnersReversed", + "description": [ + "\nGet the .github/CODEOWNERS entries, prepared for path matching.\nThe last matching CODEOWNERS entry has highest precedence:\nhttps://help.github.com/articles/about-codeowners/\nso entries are returned in reversed order to later search for the first match." + ], + "signature": [ + "() => ", + { + "pluginId": "@kbn/code-owners", + "scope": "common", + "docId": "kibKbnCodeOwnersPluginApi", + "section": "def-common.PathWithOwners", + "text": "PathWithOwners" + }, + "[]" + ], + "path": "packages/kbn-code-owners/src/file_code_owner.ts", + "deprecated": false, + "trackAdoption": false, + "children": [], + "returnComment": [], + "initialIsOpen": false + } + ], + "interfaces": [ + { + "parentPluginId": "@kbn/code-owners", + "id": "def-common.PathWithOwners", + "type": "Interface", + "tags": [], + "label": "PathWithOwners", + "description": [], + "path": "packages/kbn-code-owners/src/file_code_owner.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/code-owners", + "id": "def-common.PathWithOwners.path", + "type": "string", + "tags": [], + "label": "path", + "description": [], + "path": "packages/kbn-code-owners/src/file_code_owner.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/code-owners", + "id": "def-common.PathWithOwners.teams", + "type": "string", + "tags": [], + "label": "teams", + "description": [], + "path": "packages/kbn-code-owners/src/file_code_owner.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/code-owners", + "id": "def-common.PathWithOwners.ignorePattern", + "type": "Object", + "tags": [], + "label": "ignorePattern", + "description": [], + "signature": [ + "Ignore" + ], + "path": "packages/kbn-code-owners/src/file_code_owner.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + } + ], + "enums": [], + "misc": [], + "objects": [] + } +} \ No newline at end of file diff --git a/api_docs/kbn_code_owners.mdx b/api_docs/kbn_code_owners.mdx new file mode 100644 index 0000000000000..f7fa10cf12779 --- /dev/null +++ b/api_docs/kbn_code_owners.mdx @@ -0,0 +1,33 @@ +--- +#### +#### This document is auto-generated and is meant to be viewed inside our experimental, new docs system. +#### Reach out in #docs-engineering for more info. +#### +id: kibKbnCodeOwnersPluginApi +slug: /kibana-dev-docs/api/kbn-code-owners +title: "@kbn/code-owners" +image: https://source.unsplash.com/400x175/?github +description: API docs for the @kbn/code-owners plugin +date: 2023-12-19 +tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/code-owners'] +--- +import kbnCodeOwnersObj from './kbn_code_owners.devdocs.json'; + + + +Contact [@elastic/appex-qa](https://github.com/orgs/elastic/teams/appex-qa) for questions regarding this plugin. + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 8 | 0 | 4 | 0 | + +## Common + +### Functions + + +### Interfaces + + diff --git a/api_docs/kbn_coloring.mdx b/api_docs/kbn_coloring.mdx index b2bc50ba2d721..80f298a4632d1 100644 --- a/api_docs/kbn_coloring.mdx +++ b/api_docs/kbn_coloring.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-coloring title: "@kbn/coloring" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/coloring plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/coloring'] --- import kbnColoringObj from './kbn_coloring.devdocs.json'; diff --git a/api_docs/kbn_config.mdx b/api_docs/kbn_config.mdx index 6e9701c063df1..a0c3690b8183a 100644 --- a/api_docs/kbn_config.mdx +++ b/api_docs/kbn_config.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-config title: "@kbn/config" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/config plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/config'] --- import kbnConfigObj from './kbn_config.devdocs.json'; diff --git a/api_docs/kbn_config_mocks.mdx b/api_docs/kbn_config_mocks.mdx index c0b12cb8c73b0..f9cbc02ab134b 100644 --- a/api_docs/kbn_config_mocks.mdx +++ b/api_docs/kbn_config_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-config-mocks title: "@kbn/config-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/config-mocks plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/config-mocks'] --- import kbnConfigMocksObj from './kbn_config_mocks.devdocs.json'; diff --git a/api_docs/kbn_config_schema.mdx b/api_docs/kbn_config_schema.mdx index b23dc53cac326..67682b5517ef8 100644 --- a/api_docs/kbn_config_schema.mdx +++ b/api_docs/kbn_config_schema.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-config-schema title: "@kbn/config-schema" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/config-schema plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/config-schema'] --- import kbnConfigSchemaObj from './kbn_config_schema.devdocs.json'; diff --git a/api_docs/kbn_content_management_content_editor.mdx b/api_docs/kbn_content_management_content_editor.mdx index 0057ac674e793..a8a3928ed2857 100644 --- a/api_docs/kbn_content_management_content_editor.mdx +++ b/api_docs/kbn_content_management_content_editor.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-content-management-content-editor title: "@kbn/content-management-content-editor" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/content-management-content-editor plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/content-management-content-editor'] --- import kbnContentManagementContentEditorObj from './kbn_content_management_content_editor.devdocs.json'; diff --git a/api_docs/kbn_content_management_tabbed_table_list_view.mdx b/api_docs/kbn_content_management_tabbed_table_list_view.mdx index f7fc00555cde1..078ce66b2ad8c 100644 --- a/api_docs/kbn_content_management_tabbed_table_list_view.mdx +++ b/api_docs/kbn_content_management_tabbed_table_list_view.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-content-management-tabbed-table-list-view title: "@kbn/content-management-tabbed-table-list-view" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/content-management-tabbed-table-list-view plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/content-management-tabbed-table-list-view'] --- import kbnContentManagementTabbedTableListViewObj from './kbn_content_management_tabbed_table_list_view.devdocs.json'; diff --git a/api_docs/kbn_content_management_table_list_view.mdx b/api_docs/kbn_content_management_table_list_view.mdx index 648a85570a45e..d3ab52966796d 100644 --- a/api_docs/kbn_content_management_table_list_view.mdx +++ b/api_docs/kbn_content_management_table_list_view.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-content-management-table-list-view title: "@kbn/content-management-table-list-view" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/content-management-table-list-view plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/content-management-table-list-view'] --- import kbnContentManagementTableListViewObj from './kbn_content_management_table_list_view.devdocs.json'; diff --git a/api_docs/kbn_content_management_table_list_view_common.mdx b/api_docs/kbn_content_management_table_list_view_common.mdx index 077c1616ec586..6dd3efe5031de 100644 --- a/api_docs/kbn_content_management_table_list_view_common.mdx +++ b/api_docs/kbn_content_management_table_list_view_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-content-management-table-list-view-common title: "@kbn/content-management-table-list-view-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/content-management-table-list-view-common plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/content-management-table-list-view-common'] --- import kbnContentManagementTableListViewCommonObj from './kbn_content_management_table_list_view_common.devdocs.json'; diff --git a/api_docs/kbn_content_management_table_list_view_table.mdx b/api_docs/kbn_content_management_table_list_view_table.mdx index 9706c5a4ff2aa..f3b2fd099d98b 100644 --- a/api_docs/kbn_content_management_table_list_view_table.mdx +++ b/api_docs/kbn_content_management_table_list_view_table.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-content-management-table-list-view-table title: "@kbn/content-management-table-list-view-table" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/content-management-table-list-view-table plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/content-management-table-list-view-table'] --- import kbnContentManagementTableListViewTableObj from './kbn_content_management_table_list_view_table.devdocs.json'; diff --git a/api_docs/kbn_content_management_utils.mdx b/api_docs/kbn_content_management_utils.mdx index 5b682e687b1cc..5003fe1e61026 100644 --- a/api_docs/kbn_content_management_utils.mdx +++ b/api_docs/kbn_content_management_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-content-management-utils title: "@kbn/content-management-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/content-management-utils plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/content-management-utils'] --- import kbnContentManagementUtilsObj from './kbn_content_management_utils.devdocs.json'; diff --git a/api_docs/kbn_core_analytics_browser.mdx b/api_docs/kbn_core_analytics_browser.mdx index 0cd7d25af0936..47e8575d7c83b 100644 --- a/api_docs/kbn_core_analytics_browser.mdx +++ b/api_docs/kbn_core_analytics_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-analytics-browser title: "@kbn/core-analytics-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-analytics-browser plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-analytics-browser'] --- import kbnCoreAnalyticsBrowserObj from './kbn_core_analytics_browser.devdocs.json'; diff --git a/api_docs/kbn_core_analytics_browser_internal.mdx b/api_docs/kbn_core_analytics_browser_internal.mdx index 6bbcf077f9aef..e0e55eaf60e05 100644 --- a/api_docs/kbn_core_analytics_browser_internal.mdx +++ b/api_docs/kbn_core_analytics_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-analytics-browser-internal title: "@kbn/core-analytics-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-analytics-browser-internal plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-analytics-browser-internal'] --- import kbnCoreAnalyticsBrowserInternalObj from './kbn_core_analytics_browser_internal.devdocs.json'; diff --git a/api_docs/kbn_core_analytics_browser_mocks.mdx b/api_docs/kbn_core_analytics_browser_mocks.mdx index cdc49dcfff3dd..643a0a668358b 100644 --- a/api_docs/kbn_core_analytics_browser_mocks.mdx +++ b/api_docs/kbn_core_analytics_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-analytics-browser-mocks title: "@kbn/core-analytics-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-analytics-browser-mocks plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-analytics-browser-mocks'] --- import kbnCoreAnalyticsBrowserMocksObj from './kbn_core_analytics_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_analytics_server.mdx b/api_docs/kbn_core_analytics_server.mdx index 490bb46e56b1b..c1ae188448fd2 100644 --- a/api_docs/kbn_core_analytics_server.mdx +++ b/api_docs/kbn_core_analytics_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-analytics-server title: "@kbn/core-analytics-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-analytics-server plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-analytics-server'] --- import kbnCoreAnalyticsServerObj from './kbn_core_analytics_server.devdocs.json'; diff --git a/api_docs/kbn_core_analytics_server_internal.mdx b/api_docs/kbn_core_analytics_server_internal.mdx index bc499fc8a7831..1f94d2b8a7bf3 100644 --- a/api_docs/kbn_core_analytics_server_internal.mdx +++ b/api_docs/kbn_core_analytics_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-analytics-server-internal title: "@kbn/core-analytics-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-analytics-server-internal plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-analytics-server-internal'] --- import kbnCoreAnalyticsServerInternalObj from './kbn_core_analytics_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_analytics_server_mocks.mdx b/api_docs/kbn_core_analytics_server_mocks.mdx index 72b74fc3326a0..ed98cc7b3b552 100644 --- a/api_docs/kbn_core_analytics_server_mocks.mdx +++ b/api_docs/kbn_core_analytics_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-analytics-server-mocks title: "@kbn/core-analytics-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-analytics-server-mocks plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-analytics-server-mocks'] --- import kbnCoreAnalyticsServerMocksObj from './kbn_core_analytics_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_application_browser.mdx b/api_docs/kbn_core_application_browser.mdx index af44f2a45a210..f85047d0ffd55 100644 --- a/api_docs/kbn_core_application_browser.mdx +++ b/api_docs/kbn_core_application_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-application-browser title: "@kbn/core-application-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-application-browser plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-application-browser'] --- import kbnCoreApplicationBrowserObj from './kbn_core_application_browser.devdocs.json'; diff --git a/api_docs/kbn_core_application_browser_internal.mdx b/api_docs/kbn_core_application_browser_internal.mdx index 193c703933d07..49e15ca03242e 100644 --- a/api_docs/kbn_core_application_browser_internal.mdx +++ b/api_docs/kbn_core_application_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-application-browser-internal title: "@kbn/core-application-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-application-browser-internal plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-application-browser-internal'] --- import kbnCoreApplicationBrowserInternalObj from './kbn_core_application_browser_internal.devdocs.json'; diff --git a/api_docs/kbn_core_application_browser_mocks.mdx b/api_docs/kbn_core_application_browser_mocks.mdx index 79eeb48505030..9a1ad23e57b1d 100644 --- a/api_docs/kbn_core_application_browser_mocks.mdx +++ b/api_docs/kbn_core_application_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-application-browser-mocks title: "@kbn/core-application-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-application-browser-mocks plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-application-browser-mocks'] --- import kbnCoreApplicationBrowserMocksObj from './kbn_core_application_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_application_common.mdx b/api_docs/kbn_core_application_common.mdx index 3a854a2871a01..286d4523c5056 100644 --- a/api_docs/kbn_core_application_common.mdx +++ b/api_docs/kbn_core_application_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-application-common title: "@kbn/core-application-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-application-common plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-application-common'] --- import kbnCoreApplicationCommonObj from './kbn_core_application_common.devdocs.json'; diff --git a/api_docs/kbn_core_apps_browser_internal.mdx b/api_docs/kbn_core_apps_browser_internal.mdx index eeda2267135af..89be2a9efb8fc 100644 --- a/api_docs/kbn_core_apps_browser_internal.mdx +++ b/api_docs/kbn_core_apps_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-apps-browser-internal title: "@kbn/core-apps-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-apps-browser-internal plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-apps-browser-internal'] --- import kbnCoreAppsBrowserInternalObj from './kbn_core_apps_browser_internal.devdocs.json'; diff --git a/api_docs/kbn_core_apps_browser_mocks.mdx b/api_docs/kbn_core_apps_browser_mocks.mdx index fa553f51684a2..6faa5346f53f8 100644 --- a/api_docs/kbn_core_apps_browser_mocks.mdx +++ b/api_docs/kbn_core_apps_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-apps-browser-mocks title: "@kbn/core-apps-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-apps-browser-mocks plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-apps-browser-mocks'] --- import kbnCoreAppsBrowserMocksObj from './kbn_core_apps_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_apps_server_internal.mdx b/api_docs/kbn_core_apps_server_internal.mdx index 589c052b12b26..7d96c045c6039 100644 --- a/api_docs/kbn_core_apps_server_internal.mdx +++ b/api_docs/kbn_core_apps_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-apps-server-internal title: "@kbn/core-apps-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-apps-server-internal plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-apps-server-internal'] --- import kbnCoreAppsServerInternalObj from './kbn_core_apps_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_base_browser_mocks.mdx b/api_docs/kbn_core_base_browser_mocks.mdx index 51d1b3d091b1b..7a6cc1b5aadb0 100644 --- a/api_docs/kbn_core_base_browser_mocks.mdx +++ b/api_docs/kbn_core_base_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-base-browser-mocks title: "@kbn/core-base-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-base-browser-mocks plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-base-browser-mocks'] --- import kbnCoreBaseBrowserMocksObj from './kbn_core_base_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_base_common.mdx b/api_docs/kbn_core_base_common.mdx index ba6bf377dee27..debc0943aeec7 100644 --- a/api_docs/kbn_core_base_common.mdx +++ b/api_docs/kbn_core_base_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-base-common title: "@kbn/core-base-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-base-common plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-base-common'] --- import kbnCoreBaseCommonObj from './kbn_core_base_common.devdocs.json'; diff --git a/api_docs/kbn_core_base_server_internal.mdx b/api_docs/kbn_core_base_server_internal.mdx index be3ddc0ee7399..2f5bae5058eb1 100644 --- a/api_docs/kbn_core_base_server_internal.mdx +++ b/api_docs/kbn_core_base_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-base-server-internal title: "@kbn/core-base-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-base-server-internal plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-base-server-internal'] --- import kbnCoreBaseServerInternalObj from './kbn_core_base_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_base_server_mocks.mdx b/api_docs/kbn_core_base_server_mocks.mdx index fbd2ae1268939..1cb44d6ce2e9b 100644 --- a/api_docs/kbn_core_base_server_mocks.mdx +++ b/api_docs/kbn_core_base_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-base-server-mocks title: "@kbn/core-base-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-base-server-mocks plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-base-server-mocks'] --- import kbnCoreBaseServerMocksObj from './kbn_core_base_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_capabilities_browser_mocks.mdx b/api_docs/kbn_core_capabilities_browser_mocks.mdx index 3c38a19d6ed73..705dfbf807019 100644 --- a/api_docs/kbn_core_capabilities_browser_mocks.mdx +++ b/api_docs/kbn_core_capabilities_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-capabilities-browser-mocks title: "@kbn/core-capabilities-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-capabilities-browser-mocks plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-capabilities-browser-mocks'] --- import kbnCoreCapabilitiesBrowserMocksObj from './kbn_core_capabilities_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_capabilities_common.mdx b/api_docs/kbn_core_capabilities_common.mdx index 10e5c64016955..d90dd44ce789a 100644 --- a/api_docs/kbn_core_capabilities_common.mdx +++ b/api_docs/kbn_core_capabilities_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-capabilities-common title: "@kbn/core-capabilities-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-capabilities-common plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-capabilities-common'] --- import kbnCoreCapabilitiesCommonObj from './kbn_core_capabilities_common.devdocs.json'; diff --git a/api_docs/kbn_core_capabilities_server.mdx b/api_docs/kbn_core_capabilities_server.mdx index f3a196140ad0a..5c78e9036ec1c 100644 --- a/api_docs/kbn_core_capabilities_server.mdx +++ b/api_docs/kbn_core_capabilities_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-capabilities-server title: "@kbn/core-capabilities-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-capabilities-server plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-capabilities-server'] --- import kbnCoreCapabilitiesServerObj from './kbn_core_capabilities_server.devdocs.json'; diff --git a/api_docs/kbn_core_capabilities_server_mocks.mdx b/api_docs/kbn_core_capabilities_server_mocks.mdx index 2e0c62f61d634..31a59a220b3a3 100644 --- a/api_docs/kbn_core_capabilities_server_mocks.mdx +++ b/api_docs/kbn_core_capabilities_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-capabilities-server-mocks title: "@kbn/core-capabilities-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-capabilities-server-mocks plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-capabilities-server-mocks'] --- import kbnCoreCapabilitiesServerMocksObj from './kbn_core_capabilities_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_chrome_browser.mdx b/api_docs/kbn_core_chrome_browser.mdx index d6db51de343fb..2a3bb515fe78d 100644 --- a/api_docs/kbn_core_chrome_browser.mdx +++ b/api_docs/kbn_core_chrome_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-chrome-browser title: "@kbn/core-chrome-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-chrome-browser plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-chrome-browser'] --- import kbnCoreChromeBrowserObj from './kbn_core_chrome_browser.devdocs.json'; diff --git a/api_docs/kbn_core_chrome_browser_mocks.mdx b/api_docs/kbn_core_chrome_browser_mocks.mdx index 534948735f573..d68114c93573c 100644 --- a/api_docs/kbn_core_chrome_browser_mocks.mdx +++ b/api_docs/kbn_core_chrome_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-chrome-browser-mocks title: "@kbn/core-chrome-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-chrome-browser-mocks plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-chrome-browser-mocks'] --- import kbnCoreChromeBrowserMocksObj from './kbn_core_chrome_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_config_server_internal.mdx b/api_docs/kbn_core_config_server_internal.mdx index 27dcb84c32c5d..b8c610f43182d 100644 --- a/api_docs/kbn_core_config_server_internal.mdx +++ b/api_docs/kbn_core_config_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-config-server-internal title: "@kbn/core-config-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-config-server-internal plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-config-server-internal'] --- import kbnCoreConfigServerInternalObj from './kbn_core_config_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_custom_branding_browser.mdx b/api_docs/kbn_core_custom_branding_browser.mdx index 0962de3f43130..ec9042f9baa01 100644 --- a/api_docs/kbn_core_custom_branding_browser.mdx +++ b/api_docs/kbn_core_custom_branding_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-custom-branding-browser title: "@kbn/core-custom-branding-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-custom-branding-browser plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-custom-branding-browser'] --- import kbnCoreCustomBrandingBrowserObj from './kbn_core_custom_branding_browser.devdocs.json'; diff --git a/api_docs/kbn_core_custom_branding_browser_internal.mdx b/api_docs/kbn_core_custom_branding_browser_internal.mdx index adbb81c1fdfc4..3cc6a0cd5ca12 100644 --- a/api_docs/kbn_core_custom_branding_browser_internal.mdx +++ b/api_docs/kbn_core_custom_branding_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-custom-branding-browser-internal title: "@kbn/core-custom-branding-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-custom-branding-browser-internal plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-custom-branding-browser-internal'] --- import kbnCoreCustomBrandingBrowserInternalObj from './kbn_core_custom_branding_browser_internal.devdocs.json'; diff --git a/api_docs/kbn_core_custom_branding_browser_mocks.mdx b/api_docs/kbn_core_custom_branding_browser_mocks.mdx index 50fab91fc6366..b2c52617efb42 100644 --- a/api_docs/kbn_core_custom_branding_browser_mocks.mdx +++ b/api_docs/kbn_core_custom_branding_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-custom-branding-browser-mocks title: "@kbn/core-custom-branding-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-custom-branding-browser-mocks plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-custom-branding-browser-mocks'] --- import kbnCoreCustomBrandingBrowserMocksObj from './kbn_core_custom_branding_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_custom_branding_common.mdx b/api_docs/kbn_core_custom_branding_common.mdx index f1fa152c1c9b2..337d8d570fe75 100644 --- a/api_docs/kbn_core_custom_branding_common.mdx +++ b/api_docs/kbn_core_custom_branding_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-custom-branding-common title: "@kbn/core-custom-branding-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-custom-branding-common plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-custom-branding-common'] --- import kbnCoreCustomBrandingCommonObj from './kbn_core_custom_branding_common.devdocs.json'; diff --git a/api_docs/kbn_core_custom_branding_server.mdx b/api_docs/kbn_core_custom_branding_server.mdx index 0bae8ebbb61d0..c51f4fd899502 100644 --- a/api_docs/kbn_core_custom_branding_server.mdx +++ b/api_docs/kbn_core_custom_branding_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-custom-branding-server title: "@kbn/core-custom-branding-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-custom-branding-server plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-custom-branding-server'] --- import kbnCoreCustomBrandingServerObj from './kbn_core_custom_branding_server.devdocs.json'; diff --git a/api_docs/kbn_core_custom_branding_server_internal.mdx b/api_docs/kbn_core_custom_branding_server_internal.mdx index d80f5a1af49a3..fdb486f3a53db 100644 --- a/api_docs/kbn_core_custom_branding_server_internal.mdx +++ b/api_docs/kbn_core_custom_branding_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-custom-branding-server-internal title: "@kbn/core-custom-branding-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-custom-branding-server-internal plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-custom-branding-server-internal'] --- import kbnCoreCustomBrandingServerInternalObj from './kbn_core_custom_branding_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_custom_branding_server_mocks.mdx b/api_docs/kbn_core_custom_branding_server_mocks.mdx index fcd2d84585c96..4f85ec0782b46 100644 --- a/api_docs/kbn_core_custom_branding_server_mocks.mdx +++ b/api_docs/kbn_core_custom_branding_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-custom-branding-server-mocks title: "@kbn/core-custom-branding-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-custom-branding-server-mocks plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-custom-branding-server-mocks'] --- import kbnCoreCustomBrandingServerMocksObj from './kbn_core_custom_branding_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_deprecations_browser.mdx b/api_docs/kbn_core_deprecations_browser.mdx index 8a403979234e3..ffca83aec1c32 100644 --- a/api_docs/kbn_core_deprecations_browser.mdx +++ b/api_docs/kbn_core_deprecations_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-deprecations-browser title: "@kbn/core-deprecations-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-deprecations-browser plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-deprecations-browser'] --- import kbnCoreDeprecationsBrowserObj from './kbn_core_deprecations_browser.devdocs.json'; diff --git a/api_docs/kbn_core_deprecations_browser_internal.mdx b/api_docs/kbn_core_deprecations_browser_internal.mdx index 8caccd3ae2684..b881a26ed525c 100644 --- a/api_docs/kbn_core_deprecations_browser_internal.mdx +++ b/api_docs/kbn_core_deprecations_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-deprecations-browser-internal title: "@kbn/core-deprecations-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-deprecations-browser-internal plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-deprecations-browser-internal'] --- import kbnCoreDeprecationsBrowserInternalObj from './kbn_core_deprecations_browser_internal.devdocs.json'; diff --git a/api_docs/kbn_core_deprecations_browser_mocks.mdx b/api_docs/kbn_core_deprecations_browser_mocks.mdx index a756035b02840..abc6fcc53d83a 100644 --- a/api_docs/kbn_core_deprecations_browser_mocks.mdx +++ b/api_docs/kbn_core_deprecations_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-deprecations-browser-mocks title: "@kbn/core-deprecations-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-deprecations-browser-mocks plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-deprecations-browser-mocks'] --- import kbnCoreDeprecationsBrowserMocksObj from './kbn_core_deprecations_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_deprecations_common.mdx b/api_docs/kbn_core_deprecations_common.mdx index 23095669443b7..4b22619d5840f 100644 --- a/api_docs/kbn_core_deprecations_common.mdx +++ b/api_docs/kbn_core_deprecations_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-deprecations-common title: "@kbn/core-deprecations-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-deprecations-common plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-deprecations-common'] --- import kbnCoreDeprecationsCommonObj from './kbn_core_deprecations_common.devdocs.json'; diff --git a/api_docs/kbn_core_deprecations_server.mdx b/api_docs/kbn_core_deprecations_server.mdx index 646df9276fe7a..2af7281cc8c2a 100644 --- a/api_docs/kbn_core_deprecations_server.mdx +++ b/api_docs/kbn_core_deprecations_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-deprecations-server title: "@kbn/core-deprecations-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-deprecations-server plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-deprecations-server'] --- import kbnCoreDeprecationsServerObj from './kbn_core_deprecations_server.devdocs.json'; diff --git a/api_docs/kbn_core_deprecations_server_internal.mdx b/api_docs/kbn_core_deprecations_server_internal.mdx index 94771e15fac55..698a635c845cd 100644 --- a/api_docs/kbn_core_deprecations_server_internal.mdx +++ b/api_docs/kbn_core_deprecations_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-deprecations-server-internal title: "@kbn/core-deprecations-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-deprecations-server-internal plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-deprecations-server-internal'] --- import kbnCoreDeprecationsServerInternalObj from './kbn_core_deprecations_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_deprecations_server_mocks.mdx b/api_docs/kbn_core_deprecations_server_mocks.mdx index 2dba4fea20d06..f305ae0bb8554 100644 --- a/api_docs/kbn_core_deprecations_server_mocks.mdx +++ b/api_docs/kbn_core_deprecations_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-deprecations-server-mocks title: "@kbn/core-deprecations-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-deprecations-server-mocks plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-deprecations-server-mocks'] --- import kbnCoreDeprecationsServerMocksObj from './kbn_core_deprecations_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_doc_links_browser.mdx b/api_docs/kbn_core_doc_links_browser.mdx index 58e32b924d3c3..bccaa3af128c6 100644 --- a/api_docs/kbn_core_doc_links_browser.mdx +++ b/api_docs/kbn_core_doc_links_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-doc-links-browser title: "@kbn/core-doc-links-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-doc-links-browser plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-doc-links-browser'] --- import kbnCoreDocLinksBrowserObj from './kbn_core_doc_links_browser.devdocs.json'; diff --git a/api_docs/kbn_core_doc_links_browser_mocks.mdx b/api_docs/kbn_core_doc_links_browser_mocks.mdx index db09a6a8c8236..7d925496e3bfa 100644 --- a/api_docs/kbn_core_doc_links_browser_mocks.mdx +++ b/api_docs/kbn_core_doc_links_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-doc-links-browser-mocks title: "@kbn/core-doc-links-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-doc-links-browser-mocks plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-doc-links-browser-mocks'] --- import kbnCoreDocLinksBrowserMocksObj from './kbn_core_doc_links_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_doc_links_server.mdx b/api_docs/kbn_core_doc_links_server.mdx index c8cce322ea439..33c7d6131d6ba 100644 --- a/api_docs/kbn_core_doc_links_server.mdx +++ b/api_docs/kbn_core_doc_links_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-doc-links-server title: "@kbn/core-doc-links-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-doc-links-server plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-doc-links-server'] --- import kbnCoreDocLinksServerObj from './kbn_core_doc_links_server.devdocs.json'; diff --git a/api_docs/kbn_core_doc_links_server_mocks.mdx b/api_docs/kbn_core_doc_links_server_mocks.mdx index b9be5fd3e75ec..3f3944abb9137 100644 --- a/api_docs/kbn_core_doc_links_server_mocks.mdx +++ b/api_docs/kbn_core_doc_links_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-doc-links-server-mocks title: "@kbn/core-doc-links-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-doc-links-server-mocks plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-doc-links-server-mocks'] --- import kbnCoreDocLinksServerMocksObj from './kbn_core_doc_links_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_elasticsearch_client_server_internal.mdx b/api_docs/kbn_core_elasticsearch_client_server_internal.mdx index 199212f8e920d..472aea784f63b 100644 --- a/api_docs/kbn_core_elasticsearch_client_server_internal.mdx +++ b/api_docs/kbn_core_elasticsearch_client_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-elasticsearch-client-server-internal title: "@kbn/core-elasticsearch-client-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-elasticsearch-client-server-internal plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-elasticsearch-client-server-internal'] --- import kbnCoreElasticsearchClientServerInternalObj from './kbn_core_elasticsearch_client_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_elasticsearch_client_server_mocks.mdx b/api_docs/kbn_core_elasticsearch_client_server_mocks.mdx index 635b004bdc967..14730698e90fc 100644 --- a/api_docs/kbn_core_elasticsearch_client_server_mocks.mdx +++ b/api_docs/kbn_core_elasticsearch_client_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-elasticsearch-client-server-mocks title: "@kbn/core-elasticsearch-client-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-elasticsearch-client-server-mocks plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-elasticsearch-client-server-mocks'] --- import kbnCoreElasticsearchClientServerMocksObj from './kbn_core_elasticsearch_client_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_elasticsearch_server.mdx b/api_docs/kbn_core_elasticsearch_server.mdx index a6eaea88dff2e..a81aa8800a343 100644 --- a/api_docs/kbn_core_elasticsearch_server.mdx +++ b/api_docs/kbn_core_elasticsearch_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-elasticsearch-server title: "@kbn/core-elasticsearch-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-elasticsearch-server plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-elasticsearch-server'] --- import kbnCoreElasticsearchServerObj from './kbn_core_elasticsearch_server.devdocs.json'; diff --git a/api_docs/kbn_core_elasticsearch_server_internal.mdx b/api_docs/kbn_core_elasticsearch_server_internal.mdx index ee7dd336667ce..76ef47aa0136c 100644 --- a/api_docs/kbn_core_elasticsearch_server_internal.mdx +++ b/api_docs/kbn_core_elasticsearch_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-elasticsearch-server-internal title: "@kbn/core-elasticsearch-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-elasticsearch-server-internal plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-elasticsearch-server-internal'] --- import kbnCoreElasticsearchServerInternalObj from './kbn_core_elasticsearch_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_elasticsearch_server_mocks.mdx b/api_docs/kbn_core_elasticsearch_server_mocks.mdx index 2c8b091f78567..f3b0abae64318 100644 --- a/api_docs/kbn_core_elasticsearch_server_mocks.mdx +++ b/api_docs/kbn_core_elasticsearch_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-elasticsearch-server-mocks title: "@kbn/core-elasticsearch-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-elasticsearch-server-mocks plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-elasticsearch-server-mocks'] --- import kbnCoreElasticsearchServerMocksObj from './kbn_core_elasticsearch_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_environment_server_internal.mdx b/api_docs/kbn_core_environment_server_internal.mdx index b7be1fb84e52d..34e5ff99c8d5b 100644 --- a/api_docs/kbn_core_environment_server_internal.mdx +++ b/api_docs/kbn_core_environment_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-environment-server-internal title: "@kbn/core-environment-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-environment-server-internal plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-environment-server-internal'] --- import kbnCoreEnvironmentServerInternalObj from './kbn_core_environment_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_environment_server_mocks.mdx b/api_docs/kbn_core_environment_server_mocks.mdx index ed95ed6f07e61..49949886351d5 100644 --- a/api_docs/kbn_core_environment_server_mocks.mdx +++ b/api_docs/kbn_core_environment_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-environment-server-mocks title: "@kbn/core-environment-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-environment-server-mocks plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-environment-server-mocks'] --- import kbnCoreEnvironmentServerMocksObj from './kbn_core_environment_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_execution_context_browser.mdx b/api_docs/kbn_core_execution_context_browser.mdx index dc11b4273af32..94026d46f38ee 100644 --- a/api_docs/kbn_core_execution_context_browser.mdx +++ b/api_docs/kbn_core_execution_context_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-execution-context-browser title: "@kbn/core-execution-context-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-execution-context-browser plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-execution-context-browser'] --- import kbnCoreExecutionContextBrowserObj from './kbn_core_execution_context_browser.devdocs.json'; diff --git a/api_docs/kbn_core_execution_context_browser_internal.mdx b/api_docs/kbn_core_execution_context_browser_internal.mdx index d09ace31b27be..072c559b83818 100644 --- a/api_docs/kbn_core_execution_context_browser_internal.mdx +++ b/api_docs/kbn_core_execution_context_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-execution-context-browser-internal title: "@kbn/core-execution-context-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-execution-context-browser-internal plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-execution-context-browser-internal'] --- import kbnCoreExecutionContextBrowserInternalObj from './kbn_core_execution_context_browser_internal.devdocs.json'; diff --git a/api_docs/kbn_core_execution_context_browser_mocks.mdx b/api_docs/kbn_core_execution_context_browser_mocks.mdx index 06bc8e23c4ad0..2d6910df5140d 100644 --- a/api_docs/kbn_core_execution_context_browser_mocks.mdx +++ b/api_docs/kbn_core_execution_context_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-execution-context-browser-mocks title: "@kbn/core-execution-context-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-execution-context-browser-mocks plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-execution-context-browser-mocks'] --- import kbnCoreExecutionContextBrowserMocksObj from './kbn_core_execution_context_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_execution_context_common.mdx b/api_docs/kbn_core_execution_context_common.mdx index f383ae9420241..70f590ee65a44 100644 --- a/api_docs/kbn_core_execution_context_common.mdx +++ b/api_docs/kbn_core_execution_context_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-execution-context-common title: "@kbn/core-execution-context-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-execution-context-common plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-execution-context-common'] --- import kbnCoreExecutionContextCommonObj from './kbn_core_execution_context_common.devdocs.json'; diff --git a/api_docs/kbn_core_execution_context_server.mdx b/api_docs/kbn_core_execution_context_server.mdx index a3df7b87884c1..59f25bb7aa157 100644 --- a/api_docs/kbn_core_execution_context_server.mdx +++ b/api_docs/kbn_core_execution_context_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-execution-context-server title: "@kbn/core-execution-context-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-execution-context-server plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-execution-context-server'] --- import kbnCoreExecutionContextServerObj from './kbn_core_execution_context_server.devdocs.json'; diff --git a/api_docs/kbn_core_execution_context_server_internal.mdx b/api_docs/kbn_core_execution_context_server_internal.mdx index fe9c0e0574263..b2053822cb352 100644 --- a/api_docs/kbn_core_execution_context_server_internal.mdx +++ b/api_docs/kbn_core_execution_context_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-execution-context-server-internal title: "@kbn/core-execution-context-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-execution-context-server-internal plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-execution-context-server-internal'] --- import kbnCoreExecutionContextServerInternalObj from './kbn_core_execution_context_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_execution_context_server_mocks.mdx b/api_docs/kbn_core_execution_context_server_mocks.mdx index fb847974f362a..f6534ddf93234 100644 --- a/api_docs/kbn_core_execution_context_server_mocks.mdx +++ b/api_docs/kbn_core_execution_context_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-execution-context-server-mocks title: "@kbn/core-execution-context-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-execution-context-server-mocks plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-execution-context-server-mocks'] --- import kbnCoreExecutionContextServerMocksObj from './kbn_core_execution_context_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_fatal_errors_browser.mdx b/api_docs/kbn_core_fatal_errors_browser.mdx index 61673518293a3..23d3f869bf113 100644 --- a/api_docs/kbn_core_fatal_errors_browser.mdx +++ b/api_docs/kbn_core_fatal_errors_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-fatal-errors-browser title: "@kbn/core-fatal-errors-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-fatal-errors-browser plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-fatal-errors-browser'] --- import kbnCoreFatalErrorsBrowserObj from './kbn_core_fatal_errors_browser.devdocs.json'; diff --git a/api_docs/kbn_core_fatal_errors_browser_mocks.mdx b/api_docs/kbn_core_fatal_errors_browser_mocks.mdx index 84e3cfe7e45b3..0830813a4c17b 100644 --- a/api_docs/kbn_core_fatal_errors_browser_mocks.mdx +++ b/api_docs/kbn_core_fatal_errors_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-fatal-errors-browser-mocks title: "@kbn/core-fatal-errors-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-fatal-errors-browser-mocks plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-fatal-errors-browser-mocks'] --- import kbnCoreFatalErrorsBrowserMocksObj from './kbn_core_fatal_errors_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_http_browser.mdx b/api_docs/kbn_core_http_browser.mdx index 72f4da59ee099..beaed113982a8 100644 --- a/api_docs/kbn_core_http_browser.mdx +++ b/api_docs/kbn_core_http_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-browser title: "@kbn/core-http-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-browser plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-browser'] --- import kbnCoreHttpBrowserObj from './kbn_core_http_browser.devdocs.json'; diff --git a/api_docs/kbn_core_http_browser_internal.mdx b/api_docs/kbn_core_http_browser_internal.mdx index da9605c46a1a0..d81b97929f7d7 100644 --- a/api_docs/kbn_core_http_browser_internal.mdx +++ b/api_docs/kbn_core_http_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-browser-internal title: "@kbn/core-http-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-browser-internal plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-browser-internal'] --- import kbnCoreHttpBrowserInternalObj from './kbn_core_http_browser_internal.devdocs.json'; diff --git a/api_docs/kbn_core_http_browser_mocks.mdx b/api_docs/kbn_core_http_browser_mocks.mdx index a8b7284092e91..8923821b86b34 100644 --- a/api_docs/kbn_core_http_browser_mocks.mdx +++ b/api_docs/kbn_core_http_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-browser-mocks title: "@kbn/core-http-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-browser-mocks plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-browser-mocks'] --- import kbnCoreHttpBrowserMocksObj from './kbn_core_http_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_http_common.mdx b/api_docs/kbn_core_http_common.mdx index 777c1d21ff366..f8d9c4dda7248 100644 --- a/api_docs/kbn_core_http_common.mdx +++ b/api_docs/kbn_core_http_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-common title: "@kbn/core-http-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-common plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-common'] --- import kbnCoreHttpCommonObj from './kbn_core_http_common.devdocs.json'; diff --git a/api_docs/kbn_core_http_context_server_mocks.mdx b/api_docs/kbn_core_http_context_server_mocks.mdx index b32d6bbe4f133..c1d4d65e6b3bd 100644 --- a/api_docs/kbn_core_http_context_server_mocks.mdx +++ b/api_docs/kbn_core_http_context_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-context-server-mocks title: "@kbn/core-http-context-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-context-server-mocks plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-context-server-mocks'] --- import kbnCoreHttpContextServerMocksObj from './kbn_core_http_context_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_http_request_handler_context_server.mdx b/api_docs/kbn_core_http_request_handler_context_server.mdx index 97c584d234d87..ac23a8f4f8e41 100644 --- a/api_docs/kbn_core_http_request_handler_context_server.mdx +++ b/api_docs/kbn_core_http_request_handler_context_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-request-handler-context-server title: "@kbn/core-http-request-handler-context-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-request-handler-context-server plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-request-handler-context-server'] --- import kbnCoreHttpRequestHandlerContextServerObj from './kbn_core_http_request_handler_context_server.devdocs.json'; diff --git a/api_docs/kbn_core_http_resources_server.mdx b/api_docs/kbn_core_http_resources_server.mdx index cdd0ce8b821a6..eae57c259bf2b 100644 --- a/api_docs/kbn_core_http_resources_server.mdx +++ b/api_docs/kbn_core_http_resources_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-resources-server title: "@kbn/core-http-resources-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-resources-server plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-resources-server'] --- import kbnCoreHttpResourcesServerObj from './kbn_core_http_resources_server.devdocs.json'; diff --git a/api_docs/kbn_core_http_resources_server_internal.mdx b/api_docs/kbn_core_http_resources_server_internal.mdx index c8d46b9066dad..d856c895d875a 100644 --- a/api_docs/kbn_core_http_resources_server_internal.mdx +++ b/api_docs/kbn_core_http_resources_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-resources-server-internal title: "@kbn/core-http-resources-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-resources-server-internal plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-resources-server-internal'] --- import kbnCoreHttpResourcesServerInternalObj from './kbn_core_http_resources_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_http_resources_server_mocks.mdx b/api_docs/kbn_core_http_resources_server_mocks.mdx index abc7ff90c58f0..f8694b0d18e3b 100644 --- a/api_docs/kbn_core_http_resources_server_mocks.mdx +++ b/api_docs/kbn_core_http_resources_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-resources-server-mocks title: "@kbn/core-http-resources-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-resources-server-mocks plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-resources-server-mocks'] --- import kbnCoreHttpResourcesServerMocksObj from './kbn_core_http_resources_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_http_router_server_internal.mdx b/api_docs/kbn_core_http_router_server_internal.mdx index 26407c48aa55b..24950bd8422b3 100644 --- a/api_docs/kbn_core_http_router_server_internal.mdx +++ b/api_docs/kbn_core_http_router_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-router-server-internal title: "@kbn/core-http-router-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-router-server-internal plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-router-server-internal'] --- import kbnCoreHttpRouterServerInternalObj from './kbn_core_http_router_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_http_router_server_mocks.mdx b/api_docs/kbn_core_http_router_server_mocks.mdx index 00beedd62a1a9..d1928d54c4a26 100644 --- a/api_docs/kbn_core_http_router_server_mocks.mdx +++ b/api_docs/kbn_core_http_router_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-router-server-mocks title: "@kbn/core-http-router-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-router-server-mocks plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-router-server-mocks'] --- import kbnCoreHttpRouterServerMocksObj from './kbn_core_http_router_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_http_server.devdocs.json b/api_docs/kbn_core_http_server.devdocs.json index 975a532fe4dcb..9f2a3a12bdd55 100644 --- a/api_docs/kbn_core_http_server.devdocs.json +++ b/api_docs/kbn_core_http_server.devdocs.json @@ -14695,6 +14695,10 @@ "plugin": "canvas", "path": "x-pack/plugins/canvas/server/routes/workpad/import.ts" }, + { + "plugin": "cloudSecurityPosture", + "path": "x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/bulk_action/bulk_action.ts" + }, { "plugin": "ecsDataQualityDashboard", "path": "x-pack/plugins/ecs_data_quality_dashboard/server/routes/get_unallowed_field_values.ts" diff --git a/api_docs/kbn_core_http_server.mdx b/api_docs/kbn_core_http_server.mdx index 3f7cb307cc325..b098b3a6370de 100644 --- a/api_docs/kbn_core_http_server.mdx +++ b/api_docs/kbn_core_http_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-server title: "@kbn/core-http-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-server plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-server'] --- import kbnCoreHttpServerObj from './kbn_core_http_server.devdocs.json'; diff --git a/api_docs/kbn_core_http_server_internal.mdx b/api_docs/kbn_core_http_server_internal.mdx index e04e7d002b67d..5f363498c1328 100644 --- a/api_docs/kbn_core_http_server_internal.mdx +++ b/api_docs/kbn_core_http_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-server-internal title: "@kbn/core-http-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-server-internal plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-server-internal'] --- import kbnCoreHttpServerInternalObj from './kbn_core_http_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_http_server_mocks.mdx b/api_docs/kbn_core_http_server_mocks.mdx index 80b40ed18e0bf..a5c97a27bac39 100644 --- a/api_docs/kbn_core_http_server_mocks.mdx +++ b/api_docs/kbn_core_http_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-server-mocks title: "@kbn/core-http-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-server-mocks plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-server-mocks'] --- import kbnCoreHttpServerMocksObj from './kbn_core_http_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_i18n_browser.mdx b/api_docs/kbn_core_i18n_browser.mdx index 550bd8fda45d8..9110ceef27f95 100644 --- a/api_docs/kbn_core_i18n_browser.mdx +++ b/api_docs/kbn_core_i18n_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-i18n-browser title: "@kbn/core-i18n-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-i18n-browser plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-i18n-browser'] --- import kbnCoreI18nBrowserObj from './kbn_core_i18n_browser.devdocs.json'; diff --git a/api_docs/kbn_core_i18n_browser_mocks.mdx b/api_docs/kbn_core_i18n_browser_mocks.mdx index ad9ca0992b1b6..dac6807b16561 100644 --- a/api_docs/kbn_core_i18n_browser_mocks.mdx +++ b/api_docs/kbn_core_i18n_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-i18n-browser-mocks title: "@kbn/core-i18n-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-i18n-browser-mocks plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-i18n-browser-mocks'] --- import kbnCoreI18nBrowserMocksObj from './kbn_core_i18n_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_i18n_server.mdx b/api_docs/kbn_core_i18n_server.mdx index cb9f63f13b1a8..617a6da45d448 100644 --- a/api_docs/kbn_core_i18n_server.mdx +++ b/api_docs/kbn_core_i18n_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-i18n-server title: "@kbn/core-i18n-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-i18n-server plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-i18n-server'] --- import kbnCoreI18nServerObj from './kbn_core_i18n_server.devdocs.json'; diff --git a/api_docs/kbn_core_i18n_server_internal.mdx b/api_docs/kbn_core_i18n_server_internal.mdx index 76f8bd811d59a..826199c29a862 100644 --- a/api_docs/kbn_core_i18n_server_internal.mdx +++ b/api_docs/kbn_core_i18n_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-i18n-server-internal title: "@kbn/core-i18n-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-i18n-server-internal plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-i18n-server-internal'] --- import kbnCoreI18nServerInternalObj from './kbn_core_i18n_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_i18n_server_mocks.mdx b/api_docs/kbn_core_i18n_server_mocks.mdx index 6f10cbde93a11..67411f732c09e 100644 --- a/api_docs/kbn_core_i18n_server_mocks.mdx +++ b/api_docs/kbn_core_i18n_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-i18n-server-mocks title: "@kbn/core-i18n-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-i18n-server-mocks plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-i18n-server-mocks'] --- import kbnCoreI18nServerMocksObj from './kbn_core_i18n_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_injected_metadata_browser_mocks.mdx b/api_docs/kbn_core_injected_metadata_browser_mocks.mdx index 0727e0bd484c4..168f4843c6a12 100644 --- a/api_docs/kbn_core_injected_metadata_browser_mocks.mdx +++ b/api_docs/kbn_core_injected_metadata_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-injected-metadata-browser-mocks title: "@kbn/core-injected-metadata-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-injected-metadata-browser-mocks plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-injected-metadata-browser-mocks'] --- import kbnCoreInjectedMetadataBrowserMocksObj from './kbn_core_injected_metadata_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_integrations_browser_internal.mdx b/api_docs/kbn_core_integrations_browser_internal.mdx index 9e684933823f6..2d5d3338babf6 100644 --- a/api_docs/kbn_core_integrations_browser_internal.mdx +++ b/api_docs/kbn_core_integrations_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-integrations-browser-internal title: "@kbn/core-integrations-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-integrations-browser-internal plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-integrations-browser-internal'] --- import kbnCoreIntegrationsBrowserInternalObj from './kbn_core_integrations_browser_internal.devdocs.json'; diff --git a/api_docs/kbn_core_integrations_browser_mocks.mdx b/api_docs/kbn_core_integrations_browser_mocks.mdx index 658d527d3064e..959aa8177c7fc 100644 --- a/api_docs/kbn_core_integrations_browser_mocks.mdx +++ b/api_docs/kbn_core_integrations_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-integrations-browser-mocks title: "@kbn/core-integrations-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-integrations-browser-mocks plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-integrations-browser-mocks'] --- import kbnCoreIntegrationsBrowserMocksObj from './kbn_core_integrations_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_lifecycle_browser.mdx b/api_docs/kbn_core_lifecycle_browser.mdx index 91627cd136552..01e8592314438 100644 --- a/api_docs/kbn_core_lifecycle_browser.mdx +++ b/api_docs/kbn_core_lifecycle_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-lifecycle-browser title: "@kbn/core-lifecycle-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-lifecycle-browser plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-lifecycle-browser'] --- import kbnCoreLifecycleBrowserObj from './kbn_core_lifecycle_browser.devdocs.json'; diff --git a/api_docs/kbn_core_lifecycle_browser_mocks.mdx b/api_docs/kbn_core_lifecycle_browser_mocks.mdx index 60b9a17504815..1cf75966060d8 100644 --- a/api_docs/kbn_core_lifecycle_browser_mocks.mdx +++ b/api_docs/kbn_core_lifecycle_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-lifecycle-browser-mocks title: "@kbn/core-lifecycle-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-lifecycle-browser-mocks plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-lifecycle-browser-mocks'] --- import kbnCoreLifecycleBrowserMocksObj from './kbn_core_lifecycle_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_lifecycle_server.mdx b/api_docs/kbn_core_lifecycle_server.mdx index e2a82ec070989..4e868fc119569 100644 --- a/api_docs/kbn_core_lifecycle_server.mdx +++ b/api_docs/kbn_core_lifecycle_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-lifecycle-server title: "@kbn/core-lifecycle-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-lifecycle-server plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-lifecycle-server'] --- import kbnCoreLifecycleServerObj from './kbn_core_lifecycle_server.devdocs.json'; diff --git a/api_docs/kbn_core_lifecycle_server_mocks.mdx b/api_docs/kbn_core_lifecycle_server_mocks.mdx index 8b0f6a3397f91..2f240b4a17fb8 100644 --- a/api_docs/kbn_core_lifecycle_server_mocks.mdx +++ b/api_docs/kbn_core_lifecycle_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-lifecycle-server-mocks title: "@kbn/core-lifecycle-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-lifecycle-server-mocks plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-lifecycle-server-mocks'] --- import kbnCoreLifecycleServerMocksObj from './kbn_core_lifecycle_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_logging_browser_mocks.mdx b/api_docs/kbn_core_logging_browser_mocks.mdx index 76685a5bbbee8..2e9297cee4e2c 100644 --- a/api_docs/kbn_core_logging_browser_mocks.mdx +++ b/api_docs/kbn_core_logging_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-logging-browser-mocks title: "@kbn/core-logging-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-logging-browser-mocks plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-logging-browser-mocks'] --- import kbnCoreLoggingBrowserMocksObj from './kbn_core_logging_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_logging_common_internal.mdx b/api_docs/kbn_core_logging_common_internal.mdx index f13047197f085..581469cdbe353 100644 --- a/api_docs/kbn_core_logging_common_internal.mdx +++ b/api_docs/kbn_core_logging_common_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-logging-common-internal title: "@kbn/core-logging-common-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-logging-common-internal plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-logging-common-internal'] --- import kbnCoreLoggingCommonInternalObj from './kbn_core_logging_common_internal.devdocs.json'; diff --git a/api_docs/kbn_core_logging_server.mdx b/api_docs/kbn_core_logging_server.mdx index fe1ee0320fd29..96008363f31a6 100644 --- a/api_docs/kbn_core_logging_server.mdx +++ b/api_docs/kbn_core_logging_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-logging-server title: "@kbn/core-logging-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-logging-server plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-logging-server'] --- import kbnCoreLoggingServerObj from './kbn_core_logging_server.devdocs.json'; diff --git a/api_docs/kbn_core_logging_server_internal.mdx b/api_docs/kbn_core_logging_server_internal.mdx index 966a116622309..a35247cdb1aa4 100644 --- a/api_docs/kbn_core_logging_server_internal.mdx +++ b/api_docs/kbn_core_logging_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-logging-server-internal title: "@kbn/core-logging-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-logging-server-internal plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-logging-server-internal'] --- import kbnCoreLoggingServerInternalObj from './kbn_core_logging_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_logging_server_mocks.mdx b/api_docs/kbn_core_logging_server_mocks.mdx index 2f22f46f55040..b88510626306b 100644 --- a/api_docs/kbn_core_logging_server_mocks.mdx +++ b/api_docs/kbn_core_logging_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-logging-server-mocks title: "@kbn/core-logging-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-logging-server-mocks plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-logging-server-mocks'] --- import kbnCoreLoggingServerMocksObj from './kbn_core_logging_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_metrics_collectors_server_internal.mdx b/api_docs/kbn_core_metrics_collectors_server_internal.mdx index 7da73dd887ea1..14200348b8b20 100644 --- a/api_docs/kbn_core_metrics_collectors_server_internal.mdx +++ b/api_docs/kbn_core_metrics_collectors_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-metrics-collectors-server-internal title: "@kbn/core-metrics-collectors-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-metrics-collectors-server-internal plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-metrics-collectors-server-internal'] --- import kbnCoreMetricsCollectorsServerInternalObj from './kbn_core_metrics_collectors_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_metrics_collectors_server_mocks.mdx b/api_docs/kbn_core_metrics_collectors_server_mocks.mdx index 7c56b28aaa11f..e2a8d3af931fb 100644 --- a/api_docs/kbn_core_metrics_collectors_server_mocks.mdx +++ b/api_docs/kbn_core_metrics_collectors_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-metrics-collectors-server-mocks title: "@kbn/core-metrics-collectors-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-metrics-collectors-server-mocks plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-metrics-collectors-server-mocks'] --- import kbnCoreMetricsCollectorsServerMocksObj from './kbn_core_metrics_collectors_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_metrics_server.mdx b/api_docs/kbn_core_metrics_server.mdx index fea60539d0205..be61455546c4f 100644 --- a/api_docs/kbn_core_metrics_server.mdx +++ b/api_docs/kbn_core_metrics_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-metrics-server title: "@kbn/core-metrics-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-metrics-server plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-metrics-server'] --- import kbnCoreMetricsServerObj from './kbn_core_metrics_server.devdocs.json'; diff --git a/api_docs/kbn_core_metrics_server_internal.mdx b/api_docs/kbn_core_metrics_server_internal.mdx index 9636268421d9f..4bdfa09c0d314 100644 --- a/api_docs/kbn_core_metrics_server_internal.mdx +++ b/api_docs/kbn_core_metrics_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-metrics-server-internal title: "@kbn/core-metrics-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-metrics-server-internal plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-metrics-server-internal'] --- import kbnCoreMetricsServerInternalObj from './kbn_core_metrics_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_metrics_server_mocks.mdx b/api_docs/kbn_core_metrics_server_mocks.mdx index cbbc6f79e0a78..c595fa93a7e6a 100644 --- a/api_docs/kbn_core_metrics_server_mocks.mdx +++ b/api_docs/kbn_core_metrics_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-metrics-server-mocks title: "@kbn/core-metrics-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-metrics-server-mocks plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-metrics-server-mocks'] --- import kbnCoreMetricsServerMocksObj from './kbn_core_metrics_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_mount_utils_browser.mdx b/api_docs/kbn_core_mount_utils_browser.mdx index 249a9f243ad26..2361d996ddfe8 100644 --- a/api_docs/kbn_core_mount_utils_browser.mdx +++ b/api_docs/kbn_core_mount_utils_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-mount-utils-browser title: "@kbn/core-mount-utils-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-mount-utils-browser plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-mount-utils-browser'] --- import kbnCoreMountUtilsBrowserObj from './kbn_core_mount_utils_browser.devdocs.json'; diff --git a/api_docs/kbn_core_node_server.mdx b/api_docs/kbn_core_node_server.mdx index d3517d28baf76..d5d98acccdb4f 100644 --- a/api_docs/kbn_core_node_server.mdx +++ b/api_docs/kbn_core_node_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-node-server title: "@kbn/core-node-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-node-server plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-node-server'] --- import kbnCoreNodeServerObj from './kbn_core_node_server.devdocs.json'; diff --git a/api_docs/kbn_core_node_server_internal.mdx b/api_docs/kbn_core_node_server_internal.mdx index 2df4d8f0c36fa..4624e22edb25a 100644 --- a/api_docs/kbn_core_node_server_internal.mdx +++ b/api_docs/kbn_core_node_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-node-server-internal title: "@kbn/core-node-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-node-server-internal plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-node-server-internal'] --- import kbnCoreNodeServerInternalObj from './kbn_core_node_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_node_server_mocks.mdx b/api_docs/kbn_core_node_server_mocks.mdx index 6b4d7ab555b1a..1e4a6590b8066 100644 --- a/api_docs/kbn_core_node_server_mocks.mdx +++ b/api_docs/kbn_core_node_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-node-server-mocks title: "@kbn/core-node-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-node-server-mocks plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-node-server-mocks'] --- import kbnCoreNodeServerMocksObj from './kbn_core_node_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_notifications_browser.mdx b/api_docs/kbn_core_notifications_browser.mdx index d426d8d96cf4d..1c47750f19680 100644 --- a/api_docs/kbn_core_notifications_browser.mdx +++ b/api_docs/kbn_core_notifications_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-notifications-browser title: "@kbn/core-notifications-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-notifications-browser plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-notifications-browser'] --- import kbnCoreNotificationsBrowserObj from './kbn_core_notifications_browser.devdocs.json'; diff --git a/api_docs/kbn_core_notifications_browser_internal.mdx b/api_docs/kbn_core_notifications_browser_internal.mdx index 95720f9933108..5538ce7e1b470 100644 --- a/api_docs/kbn_core_notifications_browser_internal.mdx +++ b/api_docs/kbn_core_notifications_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-notifications-browser-internal title: "@kbn/core-notifications-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-notifications-browser-internal plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-notifications-browser-internal'] --- import kbnCoreNotificationsBrowserInternalObj from './kbn_core_notifications_browser_internal.devdocs.json'; diff --git a/api_docs/kbn_core_notifications_browser_mocks.mdx b/api_docs/kbn_core_notifications_browser_mocks.mdx index fda3e7897a309..b376982053f61 100644 --- a/api_docs/kbn_core_notifications_browser_mocks.mdx +++ b/api_docs/kbn_core_notifications_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-notifications-browser-mocks title: "@kbn/core-notifications-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-notifications-browser-mocks plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-notifications-browser-mocks'] --- import kbnCoreNotificationsBrowserMocksObj from './kbn_core_notifications_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_overlays_browser.mdx b/api_docs/kbn_core_overlays_browser.mdx index a20f89ef876d5..04569facbcbe7 100644 --- a/api_docs/kbn_core_overlays_browser.mdx +++ b/api_docs/kbn_core_overlays_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-overlays-browser title: "@kbn/core-overlays-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-overlays-browser plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-overlays-browser'] --- import kbnCoreOverlaysBrowserObj from './kbn_core_overlays_browser.devdocs.json'; diff --git a/api_docs/kbn_core_overlays_browser_internal.mdx b/api_docs/kbn_core_overlays_browser_internal.mdx index 482aac37947f4..1239c10d3978b 100644 --- a/api_docs/kbn_core_overlays_browser_internal.mdx +++ b/api_docs/kbn_core_overlays_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-overlays-browser-internal title: "@kbn/core-overlays-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-overlays-browser-internal plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-overlays-browser-internal'] --- import kbnCoreOverlaysBrowserInternalObj from './kbn_core_overlays_browser_internal.devdocs.json'; diff --git a/api_docs/kbn_core_overlays_browser_mocks.mdx b/api_docs/kbn_core_overlays_browser_mocks.mdx index 667b3de586bb2..842beedeb1994 100644 --- a/api_docs/kbn_core_overlays_browser_mocks.mdx +++ b/api_docs/kbn_core_overlays_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-overlays-browser-mocks title: "@kbn/core-overlays-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-overlays-browser-mocks plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-overlays-browser-mocks'] --- import kbnCoreOverlaysBrowserMocksObj from './kbn_core_overlays_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_plugins_browser.mdx b/api_docs/kbn_core_plugins_browser.mdx index b3c306763223d..08b2603bbc73a 100644 --- a/api_docs/kbn_core_plugins_browser.mdx +++ b/api_docs/kbn_core_plugins_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-plugins-browser title: "@kbn/core-plugins-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-plugins-browser plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-plugins-browser'] --- import kbnCorePluginsBrowserObj from './kbn_core_plugins_browser.devdocs.json'; diff --git a/api_docs/kbn_core_plugins_browser_mocks.mdx b/api_docs/kbn_core_plugins_browser_mocks.mdx index 9096726f6f872..372b522eb341b 100644 --- a/api_docs/kbn_core_plugins_browser_mocks.mdx +++ b/api_docs/kbn_core_plugins_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-plugins-browser-mocks title: "@kbn/core-plugins-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-plugins-browser-mocks plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-plugins-browser-mocks'] --- import kbnCorePluginsBrowserMocksObj from './kbn_core_plugins_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_plugins_contracts_browser.mdx b/api_docs/kbn_core_plugins_contracts_browser.mdx index eca2061e12448..4a65561a81a38 100644 --- a/api_docs/kbn_core_plugins_contracts_browser.mdx +++ b/api_docs/kbn_core_plugins_contracts_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-plugins-contracts-browser title: "@kbn/core-plugins-contracts-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-plugins-contracts-browser plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-plugins-contracts-browser'] --- import kbnCorePluginsContractsBrowserObj from './kbn_core_plugins_contracts_browser.devdocs.json'; diff --git a/api_docs/kbn_core_plugins_contracts_server.mdx b/api_docs/kbn_core_plugins_contracts_server.mdx index b30994cf53e77..034a346b6d354 100644 --- a/api_docs/kbn_core_plugins_contracts_server.mdx +++ b/api_docs/kbn_core_plugins_contracts_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-plugins-contracts-server title: "@kbn/core-plugins-contracts-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-plugins-contracts-server plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-plugins-contracts-server'] --- import kbnCorePluginsContractsServerObj from './kbn_core_plugins_contracts_server.devdocs.json'; diff --git a/api_docs/kbn_core_plugins_server.mdx b/api_docs/kbn_core_plugins_server.mdx index 69a197d409734..815fa4e7b7670 100644 --- a/api_docs/kbn_core_plugins_server.mdx +++ b/api_docs/kbn_core_plugins_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-plugins-server title: "@kbn/core-plugins-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-plugins-server plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-plugins-server'] --- import kbnCorePluginsServerObj from './kbn_core_plugins_server.devdocs.json'; diff --git a/api_docs/kbn_core_plugins_server_mocks.mdx b/api_docs/kbn_core_plugins_server_mocks.mdx index 2e51207839685..3016f85fc3314 100644 --- a/api_docs/kbn_core_plugins_server_mocks.mdx +++ b/api_docs/kbn_core_plugins_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-plugins-server-mocks title: "@kbn/core-plugins-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-plugins-server-mocks plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-plugins-server-mocks'] --- import kbnCorePluginsServerMocksObj from './kbn_core_plugins_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_preboot_server.mdx b/api_docs/kbn_core_preboot_server.mdx index e6e45078e109d..56d82e2e0de9e 100644 --- a/api_docs/kbn_core_preboot_server.mdx +++ b/api_docs/kbn_core_preboot_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-preboot-server title: "@kbn/core-preboot-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-preboot-server plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-preboot-server'] --- import kbnCorePrebootServerObj from './kbn_core_preboot_server.devdocs.json'; diff --git a/api_docs/kbn_core_preboot_server_mocks.mdx b/api_docs/kbn_core_preboot_server_mocks.mdx index 2b9c468a11b58..819fa334184ea 100644 --- a/api_docs/kbn_core_preboot_server_mocks.mdx +++ b/api_docs/kbn_core_preboot_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-preboot-server-mocks title: "@kbn/core-preboot-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-preboot-server-mocks plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-preboot-server-mocks'] --- import kbnCorePrebootServerMocksObj from './kbn_core_preboot_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_rendering_browser_mocks.mdx b/api_docs/kbn_core_rendering_browser_mocks.mdx index b469f1091e43c..8a3b2b4f5550b 100644 --- a/api_docs/kbn_core_rendering_browser_mocks.mdx +++ b/api_docs/kbn_core_rendering_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-rendering-browser-mocks title: "@kbn/core-rendering-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-rendering-browser-mocks plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-rendering-browser-mocks'] --- import kbnCoreRenderingBrowserMocksObj from './kbn_core_rendering_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_rendering_server_internal.mdx b/api_docs/kbn_core_rendering_server_internal.mdx index cb5397b159ba2..f9964d0ee0815 100644 --- a/api_docs/kbn_core_rendering_server_internal.mdx +++ b/api_docs/kbn_core_rendering_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-rendering-server-internal title: "@kbn/core-rendering-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-rendering-server-internal plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-rendering-server-internal'] --- import kbnCoreRenderingServerInternalObj from './kbn_core_rendering_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_rendering_server_mocks.mdx b/api_docs/kbn_core_rendering_server_mocks.mdx index b121cde27c778..b1e39adff3472 100644 --- a/api_docs/kbn_core_rendering_server_mocks.mdx +++ b/api_docs/kbn_core_rendering_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-rendering-server-mocks title: "@kbn/core-rendering-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-rendering-server-mocks plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-rendering-server-mocks'] --- import kbnCoreRenderingServerMocksObj from './kbn_core_rendering_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_root_server_internal.mdx b/api_docs/kbn_core_root_server_internal.mdx index 911005fcaf805..947e5d3c34900 100644 --- a/api_docs/kbn_core_root_server_internal.mdx +++ b/api_docs/kbn_core_root_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-root-server-internal title: "@kbn/core-root-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-root-server-internal plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-root-server-internal'] --- import kbnCoreRootServerInternalObj from './kbn_core_root_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_api_browser.mdx b/api_docs/kbn_core_saved_objects_api_browser.mdx index 38f164f47aa34..7c7f7370b4583 100644 --- a/api_docs/kbn_core_saved_objects_api_browser.mdx +++ b/api_docs/kbn_core_saved_objects_api_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-api-browser title: "@kbn/core-saved-objects-api-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-api-browser plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-api-browser'] --- import kbnCoreSavedObjectsApiBrowserObj from './kbn_core_saved_objects_api_browser.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_api_server.devdocs.json b/api_docs/kbn_core_saved_objects_api_server.devdocs.json index 3756940fe5518..cba6a38ce7957 100644 --- a/api_docs/kbn_core_saved_objects_api_server.devdocs.json +++ b/api_docs/kbn_core_saved_objects_api_server.devdocs.json @@ -2716,11 +2716,11 @@ }, { "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/saved_objects/geo_containment/migrations.ts" + "path": "x-pack/plugins/alerting/server/types.ts" }, { "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/saved_objects/geo_containment/migrations.ts" + "path": "x-pack/plugins/alerting/server/types.ts" }, { "plugin": "alerting", @@ -2748,11 +2748,11 @@ }, { "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/types.ts" + "path": "x-pack/plugins/alerting/server/saved_objects/geo_containment/migrations.ts" }, { "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/types.ts" + "path": "x-pack/plugins/alerting/server/saved_objects/geo_containment/migrations.ts" }, { "plugin": "savedSearch", diff --git a/api_docs/kbn_core_saved_objects_api_server.mdx b/api_docs/kbn_core_saved_objects_api_server.mdx index f85b2c9b20a4b..6373b694a6a6c 100644 --- a/api_docs/kbn_core_saved_objects_api_server.mdx +++ b/api_docs/kbn_core_saved_objects_api_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-api-server title: "@kbn/core-saved-objects-api-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-api-server plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-api-server'] --- import kbnCoreSavedObjectsApiServerObj from './kbn_core_saved_objects_api_server.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_api_server_mocks.mdx b/api_docs/kbn_core_saved_objects_api_server_mocks.mdx index 0526d4a6500e4..e8202b1e9bb87 100644 --- a/api_docs/kbn_core_saved_objects_api_server_mocks.mdx +++ b/api_docs/kbn_core_saved_objects_api_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-api-server-mocks title: "@kbn/core-saved-objects-api-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-api-server-mocks plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-api-server-mocks'] --- import kbnCoreSavedObjectsApiServerMocksObj from './kbn_core_saved_objects_api_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_base_server_internal.mdx b/api_docs/kbn_core_saved_objects_base_server_internal.mdx index 317849626b5ac..ca5d32d718b8b 100644 --- a/api_docs/kbn_core_saved_objects_base_server_internal.mdx +++ b/api_docs/kbn_core_saved_objects_base_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-base-server-internal title: "@kbn/core-saved-objects-base-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-base-server-internal plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-base-server-internal'] --- import kbnCoreSavedObjectsBaseServerInternalObj from './kbn_core_saved_objects_base_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_base_server_mocks.mdx b/api_docs/kbn_core_saved_objects_base_server_mocks.mdx index e2c07fc6e5fe1..288216bae9032 100644 --- a/api_docs/kbn_core_saved_objects_base_server_mocks.mdx +++ b/api_docs/kbn_core_saved_objects_base_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-base-server-mocks title: "@kbn/core-saved-objects-base-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-base-server-mocks plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-base-server-mocks'] --- import kbnCoreSavedObjectsBaseServerMocksObj from './kbn_core_saved_objects_base_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_browser.mdx b/api_docs/kbn_core_saved_objects_browser.mdx index 3ceaa17b078a0..eb82fe8ff1683 100644 --- a/api_docs/kbn_core_saved_objects_browser.mdx +++ b/api_docs/kbn_core_saved_objects_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-browser title: "@kbn/core-saved-objects-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-browser plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-browser'] --- import kbnCoreSavedObjectsBrowserObj from './kbn_core_saved_objects_browser.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_browser_internal.mdx b/api_docs/kbn_core_saved_objects_browser_internal.mdx index c09d453c23e5d..55e760b442b36 100644 --- a/api_docs/kbn_core_saved_objects_browser_internal.mdx +++ b/api_docs/kbn_core_saved_objects_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-browser-internal title: "@kbn/core-saved-objects-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-browser-internal plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-browser-internal'] --- import kbnCoreSavedObjectsBrowserInternalObj from './kbn_core_saved_objects_browser_internal.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_browser_mocks.mdx b/api_docs/kbn_core_saved_objects_browser_mocks.mdx index 6525aa51019df..281f642c8275c 100644 --- a/api_docs/kbn_core_saved_objects_browser_mocks.mdx +++ b/api_docs/kbn_core_saved_objects_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-browser-mocks title: "@kbn/core-saved-objects-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-browser-mocks plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-browser-mocks'] --- import kbnCoreSavedObjectsBrowserMocksObj from './kbn_core_saved_objects_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_common.mdx b/api_docs/kbn_core_saved_objects_common.mdx index 97a402c613fbd..999cf23787994 100644 --- a/api_docs/kbn_core_saved_objects_common.mdx +++ b/api_docs/kbn_core_saved_objects_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-common title: "@kbn/core-saved-objects-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-common plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-common'] --- import kbnCoreSavedObjectsCommonObj from './kbn_core_saved_objects_common.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_import_export_server_internal.mdx b/api_docs/kbn_core_saved_objects_import_export_server_internal.mdx index 161858bc9135b..2e1da87c202b4 100644 --- a/api_docs/kbn_core_saved_objects_import_export_server_internal.mdx +++ b/api_docs/kbn_core_saved_objects_import_export_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-import-export-server-internal title: "@kbn/core-saved-objects-import-export-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-import-export-server-internal plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-import-export-server-internal'] --- import kbnCoreSavedObjectsImportExportServerInternalObj from './kbn_core_saved_objects_import_export_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_import_export_server_mocks.mdx b/api_docs/kbn_core_saved_objects_import_export_server_mocks.mdx index a2e247ae7f0e9..b4b0d55d1e868 100644 --- a/api_docs/kbn_core_saved_objects_import_export_server_mocks.mdx +++ b/api_docs/kbn_core_saved_objects_import_export_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-import-export-server-mocks title: "@kbn/core-saved-objects-import-export-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-import-export-server-mocks plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-import-export-server-mocks'] --- import kbnCoreSavedObjectsImportExportServerMocksObj from './kbn_core_saved_objects_import_export_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_migration_server_internal.mdx b/api_docs/kbn_core_saved_objects_migration_server_internal.mdx index bf9bae4fcd9f3..5f1100e945c00 100644 --- a/api_docs/kbn_core_saved_objects_migration_server_internal.mdx +++ b/api_docs/kbn_core_saved_objects_migration_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-migration-server-internal title: "@kbn/core-saved-objects-migration-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-migration-server-internal plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-migration-server-internal'] --- import kbnCoreSavedObjectsMigrationServerInternalObj from './kbn_core_saved_objects_migration_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_migration_server_mocks.mdx b/api_docs/kbn_core_saved_objects_migration_server_mocks.mdx index d61def8d8ba8f..d85aa3a4b97ec 100644 --- a/api_docs/kbn_core_saved_objects_migration_server_mocks.mdx +++ b/api_docs/kbn_core_saved_objects_migration_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-migration-server-mocks title: "@kbn/core-saved-objects-migration-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-migration-server-mocks plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-migration-server-mocks'] --- import kbnCoreSavedObjectsMigrationServerMocksObj from './kbn_core_saved_objects_migration_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_server.devdocs.json b/api_docs/kbn_core_saved_objects_server.devdocs.json index 1f1ab10773d09..4625cbdfa68fb 100644 --- a/api_docs/kbn_core_saved_objects_server.devdocs.json +++ b/api_docs/kbn_core_saved_objects_server.devdocs.json @@ -6181,11 +6181,11 @@ }, { "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/saved_objects/geo_containment/migrations.ts" + "path": "x-pack/plugins/alerting/server/types.ts" }, { "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/saved_objects/geo_containment/migrations.ts" + "path": "x-pack/plugins/alerting/server/types.ts" }, { "plugin": "alerting", @@ -6213,11 +6213,11 @@ }, { "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/types.ts" + "path": "x-pack/plugins/alerting/server/saved_objects/geo_containment/migrations.ts" }, { "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/types.ts" + "path": "x-pack/plugins/alerting/server/saved_objects/geo_containment/migrations.ts" }, { "plugin": "savedSearch", diff --git a/api_docs/kbn_core_saved_objects_server.mdx b/api_docs/kbn_core_saved_objects_server.mdx index 517653f19d05e..74fd1b9b6d5ec 100644 --- a/api_docs/kbn_core_saved_objects_server.mdx +++ b/api_docs/kbn_core_saved_objects_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-server title: "@kbn/core-saved-objects-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-server plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-server'] --- import kbnCoreSavedObjectsServerObj from './kbn_core_saved_objects_server.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_server_internal.mdx b/api_docs/kbn_core_saved_objects_server_internal.mdx index e4a0a9b0f9f08..5e25cde7941e8 100644 --- a/api_docs/kbn_core_saved_objects_server_internal.mdx +++ b/api_docs/kbn_core_saved_objects_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-server-internal title: "@kbn/core-saved-objects-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-server-internal plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-server-internal'] --- import kbnCoreSavedObjectsServerInternalObj from './kbn_core_saved_objects_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_server_mocks.mdx b/api_docs/kbn_core_saved_objects_server_mocks.mdx index fb8e03f629b71..e87796cd6e71a 100644 --- a/api_docs/kbn_core_saved_objects_server_mocks.mdx +++ b/api_docs/kbn_core_saved_objects_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-server-mocks title: "@kbn/core-saved-objects-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-server-mocks plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-server-mocks'] --- import kbnCoreSavedObjectsServerMocksObj from './kbn_core_saved_objects_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_utils_server.mdx b/api_docs/kbn_core_saved_objects_utils_server.mdx index 39e153de04d62..be41a13834cf0 100644 --- a/api_docs/kbn_core_saved_objects_utils_server.mdx +++ b/api_docs/kbn_core_saved_objects_utils_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-utils-server title: "@kbn/core-saved-objects-utils-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-utils-server plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-utils-server'] --- import kbnCoreSavedObjectsUtilsServerObj from './kbn_core_saved_objects_utils_server.devdocs.json'; diff --git a/api_docs/kbn_core_status_common.mdx b/api_docs/kbn_core_status_common.mdx index a6551b34dd11f..fac78d294c1d5 100644 --- a/api_docs/kbn_core_status_common.mdx +++ b/api_docs/kbn_core_status_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-status-common title: "@kbn/core-status-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-status-common plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-status-common'] --- import kbnCoreStatusCommonObj from './kbn_core_status_common.devdocs.json'; diff --git a/api_docs/kbn_core_status_common_internal.mdx b/api_docs/kbn_core_status_common_internal.mdx index af785c9dcbae5..44c611d6ce25a 100644 --- a/api_docs/kbn_core_status_common_internal.mdx +++ b/api_docs/kbn_core_status_common_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-status-common-internal title: "@kbn/core-status-common-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-status-common-internal plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-status-common-internal'] --- import kbnCoreStatusCommonInternalObj from './kbn_core_status_common_internal.devdocs.json'; diff --git a/api_docs/kbn_core_status_server.mdx b/api_docs/kbn_core_status_server.mdx index cbc30a36bffe8..d0252260f1317 100644 --- a/api_docs/kbn_core_status_server.mdx +++ b/api_docs/kbn_core_status_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-status-server title: "@kbn/core-status-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-status-server plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-status-server'] --- import kbnCoreStatusServerObj from './kbn_core_status_server.devdocs.json'; diff --git a/api_docs/kbn_core_status_server_internal.mdx b/api_docs/kbn_core_status_server_internal.mdx index 7e47b960a041b..e1c22722c55a9 100644 --- a/api_docs/kbn_core_status_server_internal.mdx +++ b/api_docs/kbn_core_status_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-status-server-internal title: "@kbn/core-status-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-status-server-internal plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-status-server-internal'] --- import kbnCoreStatusServerInternalObj from './kbn_core_status_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_status_server_mocks.mdx b/api_docs/kbn_core_status_server_mocks.mdx index 0497b2a43ec07..6d5d58ba2ea8d 100644 --- a/api_docs/kbn_core_status_server_mocks.mdx +++ b/api_docs/kbn_core_status_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-status-server-mocks title: "@kbn/core-status-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-status-server-mocks plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-status-server-mocks'] --- import kbnCoreStatusServerMocksObj from './kbn_core_status_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_test_helpers_deprecations_getters.mdx b/api_docs/kbn_core_test_helpers_deprecations_getters.mdx index 9b3bf41851680..1d5f488286f36 100644 --- a/api_docs/kbn_core_test_helpers_deprecations_getters.mdx +++ b/api_docs/kbn_core_test_helpers_deprecations_getters.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-test-helpers-deprecations-getters title: "@kbn/core-test-helpers-deprecations-getters" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-test-helpers-deprecations-getters plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-test-helpers-deprecations-getters'] --- import kbnCoreTestHelpersDeprecationsGettersObj from './kbn_core_test_helpers_deprecations_getters.devdocs.json'; diff --git a/api_docs/kbn_core_test_helpers_http_setup_browser.mdx b/api_docs/kbn_core_test_helpers_http_setup_browser.mdx index 7a440fac8f33a..cc3818fb4532b 100644 --- a/api_docs/kbn_core_test_helpers_http_setup_browser.mdx +++ b/api_docs/kbn_core_test_helpers_http_setup_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-test-helpers-http-setup-browser title: "@kbn/core-test-helpers-http-setup-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-test-helpers-http-setup-browser plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-test-helpers-http-setup-browser'] --- import kbnCoreTestHelpersHttpSetupBrowserObj from './kbn_core_test_helpers_http_setup_browser.devdocs.json'; diff --git a/api_docs/kbn_core_test_helpers_kbn_server.mdx b/api_docs/kbn_core_test_helpers_kbn_server.mdx index 2eb7b79dbbeb2..27eb99418587e 100644 --- a/api_docs/kbn_core_test_helpers_kbn_server.mdx +++ b/api_docs/kbn_core_test_helpers_kbn_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-test-helpers-kbn-server title: "@kbn/core-test-helpers-kbn-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-test-helpers-kbn-server plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-test-helpers-kbn-server'] --- import kbnCoreTestHelpersKbnServerObj from './kbn_core_test_helpers_kbn_server.devdocs.json'; diff --git a/api_docs/kbn_core_test_helpers_model_versions.mdx b/api_docs/kbn_core_test_helpers_model_versions.mdx index bae058c2a2c5f..b3ff61e31f38c 100644 --- a/api_docs/kbn_core_test_helpers_model_versions.mdx +++ b/api_docs/kbn_core_test_helpers_model_versions.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-test-helpers-model-versions title: "@kbn/core-test-helpers-model-versions" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-test-helpers-model-versions plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-test-helpers-model-versions'] --- import kbnCoreTestHelpersModelVersionsObj from './kbn_core_test_helpers_model_versions.devdocs.json'; diff --git a/api_docs/kbn_core_test_helpers_so_type_serializer.mdx b/api_docs/kbn_core_test_helpers_so_type_serializer.mdx index b7fd7a7a19f55..6a2cb3129381f 100644 --- a/api_docs/kbn_core_test_helpers_so_type_serializer.mdx +++ b/api_docs/kbn_core_test_helpers_so_type_serializer.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-test-helpers-so-type-serializer title: "@kbn/core-test-helpers-so-type-serializer" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-test-helpers-so-type-serializer plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-test-helpers-so-type-serializer'] --- import kbnCoreTestHelpersSoTypeSerializerObj from './kbn_core_test_helpers_so_type_serializer.devdocs.json'; diff --git a/api_docs/kbn_core_test_helpers_test_utils.mdx b/api_docs/kbn_core_test_helpers_test_utils.mdx index 1d6dc02915b7f..1da3f33db7341 100644 --- a/api_docs/kbn_core_test_helpers_test_utils.mdx +++ b/api_docs/kbn_core_test_helpers_test_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-test-helpers-test-utils title: "@kbn/core-test-helpers-test-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-test-helpers-test-utils plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-test-helpers-test-utils'] --- import kbnCoreTestHelpersTestUtilsObj from './kbn_core_test_helpers_test_utils.devdocs.json'; diff --git a/api_docs/kbn_core_theme_browser.mdx b/api_docs/kbn_core_theme_browser.mdx index dcc9095057db1..2314addf03f47 100644 --- a/api_docs/kbn_core_theme_browser.mdx +++ b/api_docs/kbn_core_theme_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-theme-browser title: "@kbn/core-theme-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-theme-browser plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-theme-browser'] --- import kbnCoreThemeBrowserObj from './kbn_core_theme_browser.devdocs.json'; diff --git a/api_docs/kbn_core_theme_browser_mocks.mdx b/api_docs/kbn_core_theme_browser_mocks.mdx index ccdbc6c90818f..c77212f34cc23 100644 --- a/api_docs/kbn_core_theme_browser_mocks.mdx +++ b/api_docs/kbn_core_theme_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-theme-browser-mocks title: "@kbn/core-theme-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-theme-browser-mocks plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-theme-browser-mocks'] --- import kbnCoreThemeBrowserMocksObj from './kbn_core_theme_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_ui_settings_browser.mdx b/api_docs/kbn_core_ui_settings_browser.mdx index a89ca998f7e15..9377e25bca853 100644 --- a/api_docs/kbn_core_ui_settings_browser.mdx +++ b/api_docs/kbn_core_ui_settings_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-ui-settings-browser title: "@kbn/core-ui-settings-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-ui-settings-browser plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-ui-settings-browser'] --- import kbnCoreUiSettingsBrowserObj from './kbn_core_ui_settings_browser.devdocs.json'; diff --git a/api_docs/kbn_core_ui_settings_browser_internal.mdx b/api_docs/kbn_core_ui_settings_browser_internal.mdx index 97c2a7d1c4f69..01a53dbd7824e 100644 --- a/api_docs/kbn_core_ui_settings_browser_internal.mdx +++ b/api_docs/kbn_core_ui_settings_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-ui-settings-browser-internal title: "@kbn/core-ui-settings-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-ui-settings-browser-internal plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-ui-settings-browser-internal'] --- import kbnCoreUiSettingsBrowserInternalObj from './kbn_core_ui_settings_browser_internal.devdocs.json'; diff --git a/api_docs/kbn_core_ui_settings_browser_mocks.mdx b/api_docs/kbn_core_ui_settings_browser_mocks.mdx index 796fa4641bfb1..6e60ab9cc92a1 100644 --- a/api_docs/kbn_core_ui_settings_browser_mocks.mdx +++ b/api_docs/kbn_core_ui_settings_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-ui-settings-browser-mocks title: "@kbn/core-ui-settings-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-ui-settings-browser-mocks plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-ui-settings-browser-mocks'] --- import kbnCoreUiSettingsBrowserMocksObj from './kbn_core_ui_settings_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_ui_settings_common.mdx b/api_docs/kbn_core_ui_settings_common.mdx index 90261b6029ecf..e03f0506fc95d 100644 --- a/api_docs/kbn_core_ui_settings_common.mdx +++ b/api_docs/kbn_core_ui_settings_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-ui-settings-common title: "@kbn/core-ui-settings-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-ui-settings-common plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-ui-settings-common'] --- import kbnCoreUiSettingsCommonObj from './kbn_core_ui_settings_common.devdocs.json'; diff --git a/api_docs/kbn_core_ui_settings_server.mdx b/api_docs/kbn_core_ui_settings_server.mdx index 2e78bd4ecb952..5e188dd30ba4a 100644 --- a/api_docs/kbn_core_ui_settings_server.mdx +++ b/api_docs/kbn_core_ui_settings_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-ui-settings-server title: "@kbn/core-ui-settings-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-ui-settings-server plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-ui-settings-server'] --- import kbnCoreUiSettingsServerObj from './kbn_core_ui_settings_server.devdocs.json'; diff --git a/api_docs/kbn_core_ui_settings_server_internal.mdx b/api_docs/kbn_core_ui_settings_server_internal.mdx index b787fb372d072..f2275a15870c1 100644 --- a/api_docs/kbn_core_ui_settings_server_internal.mdx +++ b/api_docs/kbn_core_ui_settings_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-ui-settings-server-internal title: "@kbn/core-ui-settings-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-ui-settings-server-internal plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-ui-settings-server-internal'] --- import kbnCoreUiSettingsServerInternalObj from './kbn_core_ui_settings_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_ui_settings_server_mocks.mdx b/api_docs/kbn_core_ui_settings_server_mocks.mdx index f6ad6aeb00c6b..405235278cf43 100644 --- a/api_docs/kbn_core_ui_settings_server_mocks.mdx +++ b/api_docs/kbn_core_ui_settings_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-ui-settings-server-mocks title: "@kbn/core-ui-settings-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-ui-settings-server-mocks plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-ui-settings-server-mocks'] --- import kbnCoreUiSettingsServerMocksObj from './kbn_core_ui_settings_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_usage_data_server.mdx b/api_docs/kbn_core_usage_data_server.mdx index 5dc95c55c2e2f..670019d88384e 100644 --- a/api_docs/kbn_core_usage_data_server.mdx +++ b/api_docs/kbn_core_usage_data_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-usage-data-server title: "@kbn/core-usage-data-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-usage-data-server plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-usage-data-server'] --- import kbnCoreUsageDataServerObj from './kbn_core_usage_data_server.devdocs.json'; diff --git a/api_docs/kbn_core_usage_data_server_internal.mdx b/api_docs/kbn_core_usage_data_server_internal.mdx index 74e8ecc50a858..32738d7554817 100644 --- a/api_docs/kbn_core_usage_data_server_internal.mdx +++ b/api_docs/kbn_core_usage_data_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-usage-data-server-internal title: "@kbn/core-usage-data-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-usage-data-server-internal plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-usage-data-server-internal'] --- import kbnCoreUsageDataServerInternalObj from './kbn_core_usage_data_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_usage_data_server_mocks.mdx b/api_docs/kbn_core_usage_data_server_mocks.mdx index 401a6558c3cfe..a49b7080fd441 100644 --- a/api_docs/kbn_core_usage_data_server_mocks.mdx +++ b/api_docs/kbn_core_usage_data_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-usage-data-server-mocks title: "@kbn/core-usage-data-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-usage-data-server-mocks plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-usage-data-server-mocks'] --- import kbnCoreUsageDataServerMocksObj from './kbn_core_usage_data_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_user_settings_server.mdx b/api_docs/kbn_core_user_settings_server.mdx index a870f8df64b59..ea835caf267f0 100644 --- a/api_docs/kbn_core_user_settings_server.mdx +++ b/api_docs/kbn_core_user_settings_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-user-settings-server title: "@kbn/core-user-settings-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-user-settings-server plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-user-settings-server'] --- import kbnCoreUserSettingsServerObj from './kbn_core_user_settings_server.devdocs.json'; diff --git a/api_docs/kbn_core_user_settings_server_internal.mdx b/api_docs/kbn_core_user_settings_server_internal.mdx index 12f52963f12d2..149f43efb4bff 100644 --- a/api_docs/kbn_core_user_settings_server_internal.mdx +++ b/api_docs/kbn_core_user_settings_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-user-settings-server-internal title: "@kbn/core-user-settings-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-user-settings-server-internal plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-user-settings-server-internal'] --- import kbnCoreUserSettingsServerInternalObj from './kbn_core_user_settings_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_user_settings_server_mocks.mdx b/api_docs/kbn_core_user_settings_server_mocks.mdx index 76ead1f6cad73..ad0bbdb8ac59f 100644 --- a/api_docs/kbn_core_user_settings_server_mocks.mdx +++ b/api_docs/kbn_core_user_settings_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-user-settings-server-mocks title: "@kbn/core-user-settings-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-user-settings-server-mocks plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-user-settings-server-mocks'] --- import kbnCoreUserSettingsServerMocksObj from './kbn_core_user_settings_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_crypto.mdx b/api_docs/kbn_crypto.mdx index 1f49fc788d804..ed1d6b7ec9b20 100644 --- a/api_docs/kbn_crypto.mdx +++ b/api_docs/kbn_crypto.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-crypto title: "@kbn/crypto" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/crypto plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/crypto'] --- import kbnCryptoObj from './kbn_crypto.devdocs.json'; diff --git a/api_docs/kbn_crypto_browser.mdx b/api_docs/kbn_crypto_browser.mdx index 5de3db0711913..fc750253f1aaf 100644 --- a/api_docs/kbn_crypto_browser.mdx +++ b/api_docs/kbn_crypto_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-crypto-browser title: "@kbn/crypto-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/crypto-browser plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/crypto-browser'] --- import kbnCryptoBrowserObj from './kbn_crypto_browser.devdocs.json'; diff --git a/api_docs/kbn_custom_icons.mdx b/api_docs/kbn_custom_icons.mdx index 5db137898b87f..7e1b3b8b287c3 100644 --- a/api_docs/kbn_custom_icons.mdx +++ b/api_docs/kbn_custom_icons.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-custom-icons title: "@kbn/custom-icons" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/custom-icons plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/custom-icons'] --- import kbnCustomIconsObj from './kbn_custom_icons.devdocs.json'; diff --git a/api_docs/kbn_custom_integrations.mdx b/api_docs/kbn_custom_integrations.mdx index d722b995af198..53c0b5b8b26da 100644 --- a/api_docs/kbn_custom_integrations.mdx +++ b/api_docs/kbn_custom_integrations.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-custom-integrations title: "@kbn/custom-integrations" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/custom-integrations plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/custom-integrations'] --- import kbnCustomIntegrationsObj from './kbn_custom_integrations.devdocs.json'; diff --git a/api_docs/kbn_cypress_config.mdx b/api_docs/kbn_cypress_config.mdx index f92815983f176..89188e5435826 100644 --- a/api_docs/kbn_cypress_config.mdx +++ b/api_docs/kbn_cypress_config.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-cypress-config title: "@kbn/cypress-config" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/cypress-config plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/cypress-config'] --- import kbnCypressConfigObj from './kbn_cypress_config.devdocs.json'; diff --git a/api_docs/kbn_data_service.mdx b/api_docs/kbn_data_service.mdx index 21da5176decdd..f6629261e90ca 100644 --- a/api_docs/kbn_data_service.mdx +++ b/api_docs/kbn_data_service.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-data-service title: "@kbn/data-service" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/data-service plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/data-service'] --- import kbnDataServiceObj from './kbn_data_service.devdocs.json'; diff --git a/api_docs/kbn_datemath.mdx b/api_docs/kbn_datemath.mdx index 92377b2c836fe..e734d920e375f 100644 --- a/api_docs/kbn_datemath.mdx +++ b/api_docs/kbn_datemath.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-datemath title: "@kbn/datemath" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/datemath plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/datemath'] --- import kbnDatemathObj from './kbn_datemath.devdocs.json'; diff --git a/api_docs/kbn_deeplinks_analytics.mdx b/api_docs/kbn_deeplinks_analytics.mdx index 4b5d42f73f0fc..481a498ab4abb 100644 --- a/api_docs/kbn_deeplinks_analytics.mdx +++ b/api_docs/kbn_deeplinks_analytics.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-deeplinks-analytics title: "@kbn/deeplinks-analytics" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/deeplinks-analytics plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/deeplinks-analytics'] --- import kbnDeeplinksAnalyticsObj from './kbn_deeplinks_analytics.devdocs.json'; diff --git a/api_docs/kbn_deeplinks_devtools.mdx b/api_docs/kbn_deeplinks_devtools.mdx index b2bb609a91644..6714fd2602cb5 100644 --- a/api_docs/kbn_deeplinks_devtools.mdx +++ b/api_docs/kbn_deeplinks_devtools.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-deeplinks-devtools title: "@kbn/deeplinks-devtools" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/deeplinks-devtools plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/deeplinks-devtools'] --- import kbnDeeplinksDevtoolsObj from './kbn_deeplinks_devtools.devdocs.json'; diff --git a/api_docs/kbn_deeplinks_management.mdx b/api_docs/kbn_deeplinks_management.mdx index 0a855d60325aa..321247d98dbd3 100644 --- a/api_docs/kbn_deeplinks_management.mdx +++ b/api_docs/kbn_deeplinks_management.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-deeplinks-management title: "@kbn/deeplinks-management" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/deeplinks-management plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/deeplinks-management'] --- import kbnDeeplinksManagementObj from './kbn_deeplinks_management.devdocs.json'; diff --git a/api_docs/kbn_deeplinks_ml.mdx b/api_docs/kbn_deeplinks_ml.mdx index edb1f6c1ef122..fa4a891d8264f 100644 --- a/api_docs/kbn_deeplinks_ml.mdx +++ b/api_docs/kbn_deeplinks_ml.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-deeplinks-ml title: "@kbn/deeplinks-ml" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/deeplinks-ml plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/deeplinks-ml'] --- import kbnDeeplinksMlObj from './kbn_deeplinks_ml.devdocs.json'; diff --git a/api_docs/kbn_deeplinks_observability.mdx b/api_docs/kbn_deeplinks_observability.mdx index 5c408500376d8..76023dbad7e3e 100644 --- a/api_docs/kbn_deeplinks_observability.mdx +++ b/api_docs/kbn_deeplinks_observability.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-deeplinks-observability title: "@kbn/deeplinks-observability" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/deeplinks-observability plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/deeplinks-observability'] --- import kbnDeeplinksObservabilityObj from './kbn_deeplinks_observability.devdocs.json'; diff --git a/api_docs/kbn_deeplinks_search.mdx b/api_docs/kbn_deeplinks_search.mdx index 6be47aad55d28..759b2b92bf63a 100644 --- a/api_docs/kbn_deeplinks_search.mdx +++ b/api_docs/kbn_deeplinks_search.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-deeplinks-search title: "@kbn/deeplinks-search" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/deeplinks-search plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/deeplinks-search'] --- import kbnDeeplinksSearchObj from './kbn_deeplinks_search.devdocs.json'; diff --git a/api_docs/kbn_default_nav_analytics.mdx b/api_docs/kbn_default_nav_analytics.mdx index ed09ca48b930d..fc4ccb1dbcc9e 100644 --- a/api_docs/kbn_default_nav_analytics.mdx +++ b/api_docs/kbn_default_nav_analytics.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-default-nav-analytics title: "@kbn/default-nav-analytics" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/default-nav-analytics plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/default-nav-analytics'] --- import kbnDefaultNavAnalyticsObj from './kbn_default_nav_analytics.devdocs.json'; diff --git a/api_docs/kbn_default_nav_devtools.mdx b/api_docs/kbn_default_nav_devtools.mdx index 6a63269e63038..ba3b5a9b78f4d 100644 --- a/api_docs/kbn_default_nav_devtools.mdx +++ b/api_docs/kbn_default_nav_devtools.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-default-nav-devtools title: "@kbn/default-nav-devtools" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/default-nav-devtools plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/default-nav-devtools'] --- import kbnDefaultNavDevtoolsObj from './kbn_default_nav_devtools.devdocs.json'; diff --git a/api_docs/kbn_default_nav_management.mdx b/api_docs/kbn_default_nav_management.mdx index 095e294b197eb..08cdbe2a68571 100644 --- a/api_docs/kbn_default_nav_management.mdx +++ b/api_docs/kbn_default_nav_management.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-default-nav-management title: "@kbn/default-nav-management" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/default-nav-management plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/default-nav-management'] --- import kbnDefaultNavManagementObj from './kbn_default_nav_management.devdocs.json'; diff --git a/api_docs/kbn_default_nav_ml.mdx b/api_docs/kbn_default_nav_ml.mdx index 92e47c1e80ee2..6a1552f850131 100644 --- a/api_docs/kbn_default_nav_ml.mdx +++ b/api_docs/kbn_default_nav_ml.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-default-nav-ml title: "@kbn/default-nav-ml" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/default-nav-ml plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/default-nav-ml'] --- import kbnDefaultNavMlObj from './kbn_default_nav_ml.devdocs.json'; diff --git a/api_docs/kbn_dev_cli_errors.mdx b/api_docs/kbn_dev_cli_errors.mdx index b7821b359a6e2..b520779371260 100644 --- a/api_docs/kbn_dev_cli_errors.mdx +++ b/api_docs/kbn_dev_cli_errors.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-dev-cli-errors title: "@kbn/dev-cli-errors" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/dev-cli-errors plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/dev-cli-errors'] --- import kbnDevCliErrorsObj from './kbn_dev_cli_errors.devdocs.json'; diff --git a/api_docs/kbn_dev_cli_runner.mdx b/api_docs/kbn_dev_cli_runner.mdx index eb2197b02a7ea..1c85d879f5bb0 100644 --- a/api_docs/kbn_dev_cli_runner.mdx +++ b/api_docs/kbn_dev_cli_runner.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-dev-cli-runner title: "@kbn/dev-cli-runner" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/dev-cli-runner plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/dev-cli-runner'] --- import kbnDevCliRunnerObj from './kbn_dev_cli_runner.devdocs.json'; diff --git a/api_docs/kbn_dev_proc_runner.mdx b/api_docs/kbn_dev_proc_runner.mdx index e36223ee58a12..7797b8ab752f1 100644 --- a/api_docs/kbn_dev_proc_runner.mdx +++ b/api_docs/kbn_dev_proc_runner.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-dev-proc-runner title: "@kbn/dev-proc-runner" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/dev-proc-runner plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/dev-proc-runner'] --- import kbnDevProcRunnerObj from './kbn_dev_proc_runner.devdocs.json'; diff --git a/api_docs/kbn_dev_utils.mdx b/api_docs/kbn_dev_utils.mdx index 94c9efb39c80f..e331883830523 100644 --- a/api_docs/kbn_dev_utils.mdx +++ b/api_docs/kbn_dev_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-dev-utils title: "@kbn/dev-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/dev-utils plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/dev-utils'] --- import kbnDevUtilsObj from './kbn_dev_utils.devdocs.json'; diff --git a/api_docs/kbn_discover_utils.mdx b/api_docs/kbn_discover_utils.mdx index ed78fcf431945..12cb482ab3f17 100644 --- a/api_docs/kbn_discover_utils.mdx +++ b/api_docs/kbn_discover_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-discover-utils title: "@kbn/discover-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/discover-utils plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/discover-utils'] --- import kbnDiscoverUtilsObj from './kbn_discover_utils.devdocs.json'; diff --git a/api_docs/kbn_doc_links.mdx b/api_docs/kbn_doc_links.mdx index f257a84ee9df5..804d5929c2d42 100644 --- a/api_docs/kbn_doc_links.mdx +++ b/api_docs/kbn_doc_links.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-doc-links title: "@kbn/doc-links" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/doc-links plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/doc-links'] --- import kbnDocLinksObj from './kbn_doc_links.devdocs.json'; diff --git a/api_docs/kbn_docs_utils.mdx b/api_docs/kbn_docs_utils.mdx index fc140091aa73a..6f2e9e99e0b01 100644 --- a/api_docs/kbn_docs_utils.mdx +++ b/api_docs/kbn_docs_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-docs-utils title: "@kbn/docs-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/docs-utils plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/docs-utils'] --- import kbnDocsUtilsObj from './kbn_docs_utils.devdocs.json'; diff --git a/api_docs/kbn_dom_drag_drop.mdx b/api_docs/kbn_dom_drag_drop.mdx index 001bcabce3062..7a7f728b54a28 100644 --- a/api_docs/kbn_dom_drag_drop.mdx +++ b/api_docs/kbn_dom_drag_drop.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-dom-drag-drop title: "@kbn/dom-drag-drop" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/dom-drag-drop plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/dom-drag-drop'] --- import kbnDomDragDropObj from './kbn_dom_drag_drop.devdocs.json'; diff --git a/api_docs/kbn_ebt_tools.mdx b/api_docs/kbn_ebt_tools.mdx index 8d0379b73bffb..9826ad9790f46 100644 --- a/api_docs/kbn_ebt_tools.mdx +++ b/api_docs/kbn_ebt_tools.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ebt-tools title: "@kbn/ebt-tools" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ebt-tools plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ebt-tools'] --- import kbnEbtToolsObj from './kbn_ebt_tools.devdocs.json'; diff --git a/api_docs/kbn_ecs.mdx b/api_docs/kbn_ecs.mdx index 448c81776b53c..0e07f4b5e1639 100644 --- a/api_docs/kbn_ecs.mdx +++ b/api_docs/kbn_ecs.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ecs title: "@kbn/ecs" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ecs plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ecs'] --- import kbnEcsObj from './kbn_ecs.devdocs.json'; diff --git a/api_docs/kbn_ecs_data_quality_dashboard.mdx b/api_docs/kbn_ecs_data_quality_dashboard.mdx index 6b514df2f6ad8..38c474ed3963c 100644 --- a/api_docs/kbn_ecs_data_quality_dashboard.mdx +++ b/api_docs/kbn_ecs_data_quality_dashboard.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ecs-data-quality-dashboard title: "@kbn/ecs-data-quality-dashboard" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ecs-data-quality-dashboard plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ecs-data-quality-dashboard'] --- import kbnEcsDataQualityDashboardObj from './kbn_ecs_data_quality_dashboard.devdocs.json'; diff --git a/api_docs/kbn_elastic_agent_utils.mdx b/api_docs/kbn_elastic_agent_utils.mdx index d8736fe7fdbcb..255169e7b3e96 100644 --- a/api_docs/kbn_elastic_agent_utils.mdx +++ b/api_docs/kbn_elastic_agent_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-elastic-agent-utils title: "@kbn/elastic-agent-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/elastic-agent-utils plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/elastic-agent-utils'] --- import kbnElasticAgentUtilsObj from './kbn_elastic_agent_utils.devdocs.json'; diff --git a/api_docs/kbn_elastic_assistant.mdx b/api_docs/kbn_elastic_assistant.mdx index 0615538ed8aee..471b2f2e1d41b 100644 --- a/api_docs/kbn_elastic_assistant.mdx +++ b/api_docs/kbn_elastic_assistant.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-elastic-assistant title: "@kbn/elastic-assistant" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/elastic-assistant plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/elastic-assistant'] --- import kbnElasticAssistantObj from './kbn_elastic_assistant.devdocs.json'; diff --git a/api_docs/kbn_elastic_assistant_common.mdx b/api_docs/kbn_elastic_assistant_common.mdx index e9628df7b8716..598b1f66f7c66 100644 --- a/api_docs/kbn_elastic_assistant_common.mdx +++ b/api_docs/kbn_elastic_assistant_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-elastic-assistant-common title: "@kbn/elastic-assistant-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/elastic-assistant-common plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/elastic-assistant-common'] --- import kbnElasticAssistantCommonObj from './kbn_elastic_assistant_common.devdocs.json'; diff --git a/api_docs/kbn_es.mdx b/api_docs/kbn_es.mdx index b01bcd77a0723..4afb3cd6365b8 100644 --- a/api_docs/kbn_es.mdx +++ b/api_docs/kbn_es.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-es title: "@kbn/es" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/es plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/es'] --- import kbnEsObj from './kbn_es.devdocs.json'; diff --git a/api_docs/kbn_es_archiver.mdx b/api_docs/kbn_es_archiver.mdx index 716f5c753935d..8161fd4de58c5 100644 --- a/api_docs/kbn_es_archiver.mdx +++ b/api_docs/kbn_es_archiver.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-es-archiver title: "@kbn/es-archiver" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/es-archiver plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/es-archiver'] --- import kbnEsArchiverObj from './kbn_es_archiver.devdocs.json'; diff --git a/api_docs/kbn_es_errors.mdx b/api_docs/kbn_es_errors.mdx index f592656e15c5a..a9d715cdf3374 100644 --- a/api_docs/kbn_es_errors.mdx +++ b/api_docs/kbn_es_errors.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-es-errors title: "@kbn/es-errors" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/es-errors plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/es-errors'] --- import kbnEsErrorsObj from './kbn_es_errors.devdocs.json'; diff --git a/api_docs/kbn_es_query.mdx b/api_docs/kbn_es_query.mdx index 033e3da68c8f4..bc8a3db90c8ea 100644 --- a/api_docs/kbn_es_query.mdx +++ b/api_docs/kbn_es_query.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-es-query title: "@kbn/es-query" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/es-query plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/es-query'] --- import kbnEsQueryObj from './kbn_es_query.devdocs.json'; diff --git a/api_docs/kbn_es_types.mdx b/api_docs/kbn_es_types.mdx index 9679981a4ad50..d9654bacd4b93 100644 --- a/api_docs/kbn_es_types.mdx +++ b/api_docs/kbn_es_types.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-es-types title: "@kbn/es-types" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/es-types plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/es-types'] --- import kbnEsTypesObj from './kbn_es_types.devdocs.json'; diff --git a/api_docs/kbn_eslint_plugin_imports.mdx b/api_docs/kbn_eslint_plugin_imports.mdx index 80a5bb8c8d592..643a6c7091f59 100644 --- a/api_docs/kbn_eslint_plugin_imports.mdx +++ b/api_docs/kbn_eslint_plugin_imports.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-eslint-plugin-imports title: "@kbn/eslint-plugin-imports" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/eslint-plugin-imports plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/eslint-plugin-imports'] --- import kbnEslintPluginImportsObj from './kbn_eslint_plugin_imports.devdocs.json'; diff --git a/api_docs/kbn_event_annotation_common.mdx b/api_docs/kbn_event_annotation_common.mdx index 6047999634fa2..56e39d86973cd 100644 --- a/api_docs/kbn_event_annotation_common.mdx +++ b/api_docs/kbn_event_annotation_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-event-annotation-common title: "@kbn/event-annotation-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/event-annotation-common plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/event-annotation-common'] --- import kbnEventAnnotationCommonObj from './kbn_event_annotation_common.devdocs.json'; diff --git a/api_docs/kbn_event_annotation_components.mdx b/api_docs/kbn_event_annotation_components.mdx index 7b0110c1da11b..4563355191be4 100644 --- a/api_docs/kbn_event_annotation_components.mdx +++ b/api_docs/kbn_event_annotation_components.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-event-annotation-components title: "@kbn/event-annotation-components" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/event-annotation-components plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/event-annotation-components'] --- import kbnEventAnnotationComponentsObj from './kbn_event_annotation_components.devdocs.json'; diff --git a/api_docs/kbn_expandable_flyout.mdx b/api_docs/kbn_expandable_flyout.mdx index 4a53c6bc1be00..e74d01f85b3db 100644 --- a/api_docs/kbn_expandable_flyout.mdx +++ b/api_docs/kbn_expandable_flyout.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-expandable-flyout title: "@kbn/expandable-flyout" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/expandable-flyout plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/expandable-flyout'] --- import kbnExpandableFlyoutObj from './kbn_expandable_flyout.devdocs.json'; diff --git a/api_docs/kbn_field_types.mdx b/api_docs/kbn_field_types.mdx index 57ee7f9140690..094eb66a2d12c 100644 --- a/api_docs/kbn_field_types.mdx +++ b/api_docs/kbn_field_types.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-field-types title: "@kbn/field-types" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/field-types plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/field-types'] --- import kbnFieldTypesObj from './kbn_field_types.devdocs.json'; diff --git a/api_docs/kbn_field_utils.mdx b/api_docs/kbn_field_utils.mdx index b391dff8f787d..99bcb0504e83a 100644 --- a/api_docs/kbn_field_utils.mdx +++ b/api_docs/kbn_field_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-field-utils title: "@kbn/field-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/field-utils plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/field-utils'] --- import kbnFieldUtilsObj from './kbn_field_utils.devdocs.json'; diff --git a/api_docs/kbn_find_used_node_modules.mdx b/api_docs/kbn_find_used_node_modules.mdx index 981f39a78518b..750922c91ce4c 100644 --- a/api_docs/kbn_find_used_node_modules.mdx +++ b/api_docs/kbn_find_used_node_modules.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-find-used-node-modules title: "@kbn/find-used-node-modules" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/find-used-node-modules plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/find-used-node-modules'] --- import kbnFindUsedNodeModulesObj from './kbn_find_used_node_modules.devdocs.json'; diff --git a/api_docs/kbn_ftr_common_functional_services.mdx b/api_docs/kbn_ftr_common_functional_services.mdx index 36ae97691ed46..ab3dbe081ea1c 100644 --- a/api_docs/kbn_ftr_common_functional_services.mdx +++ b/api_docs/kbn_ftr_common_functional_services.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ftr-common-functional-services title: "@kbn/ftr-common-functional-services" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ftr-common-functional-services plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ftr-common-functional-services'] --- import kbnFtrCommonFunctionalServicesObj from './kbn_ftr_common_functional_services.devdocs.json'; diff --git a/api_docs/kbn_ftr_common_functional_ui_services.devdocs.json b/api_docs/kbn_ftr_common_functional_ui_services.devdocs.json new file mode 100644 index 0000000000000..79a57d84974d8 --- /dev/null +++ b/api_docs/kbn_ftr_common_functional_ui_services.devdocs.json @@ -0,0 +1,143 @@ +{ + "id": "@kbn/ftr-common-functional-ui-services", + "client": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "server": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "common": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [ + { + "parentPluginId": "@kbn/ftr-common-functional-ui-services", + "id": "def-common.FtrProviderContext", + "type": "Type", + "tags": [], + "label": "FtrProviderContext", + "description": [], + "signature": [ + { + "pluginId": "@kbn/test", + "scope": "common", + "docId": "kibKbnTestPluginApi", + "section": "def-common.GenericFtrProviderContext", + "text": "GenericFtrProviderContext" + }, + "<{ retryOnStale: ({ getService }: ", + { + "pluginId": "@kbn/ftr-common-functional-ui-services", + "scope": "common", + "docId": "kibKbnFtrCommonFunctionalUiServicesPluginApi", + "section": "def-common.FtrProviderContext", + "text": "FtrProviderContext" + }, + ") => { (fn: () => Promise): Promise; wrap(fn: (...args: Args) => Promise): (...args: Args) => Promise; }; }, {}, ProvidedTypeMap<{ retryOnStale: ({ getService }: ", + { + "pluginId": "@kbn/ftr-common-functional-ui-services", + "scope": "common", + "docId": "kibKbnFtrCommonFunctionalUiServicesPluginApi", + "section": "def-common.FtrProviderContext", + "text": "FtrProviderContext" + }, + ") => { (fn: () => Promise): Promise; wrap(fn: (...args: Args) => Promise): (...args: Args) => Promise; }; }>, ProvidedTypeMap<{}>>" + ], + "path": "packages/kbn-ftr-common-functional-ui-services/services/ftr_provider_context.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + } + ], + "objects": [ + { + "parentPluginId": "@kbn/ftr-common-functional-ui-services", + "id": "def-common.services", + "type": "Object", + "tags": [], + "label": "services", + "description": [], + "path": "packages/kbn-ftr-common-functional-ui-services/services/all.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/ftr-common-functional-ui-services", + "id": "def-common.services.retryOnStale", + "type": "Function", + "tags": [], + "label": "retryOnStale", + "description": [], + "signature": [ + "({ getService }: ", + { + "pluginId": "@kbn/ftr-common-functional-ui-services", + "scope": "common", + "docId": "kibKbnFtrCommonFunctionalUiServicesPluginApi", + "section": "def-common.FtrProviderContext", + "text": "FtrProviderContext" + }, + ") => { (fn: () => Promise): Promise; wrap(fn: (...args: Args) => Promise): (...args: Args) => Promise; }" + ], + "path": "packages/kbn-ftr-common-functional-ui-services/services/all.ts", + "deprecated": false, + "trackAdoption": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "@kbn/ftr-common-functional-ui-services", + "id": "def-common.services.retryOnStale.$1", + "type": "Object", + "tags": [], + "label": "__0", + "description": [], + "signature": [ + { + "pluginId": "@kbn/test", + "scope": "common", + "docId": "kibKbnTestPluginApi", + "section": "def-common.GenericFtrProviderContext", + "text": "GenericFtrProviderContext" + }, + "<{ retryOnStale: ({ getService }: ", + { + "pluginId": "@kbn/ftr-common-functional-ui-services", + "scope": "common", + "docId": "kibKbnFtrCommonFunctionalUiServicesPluginApi", + "section": "def-common.FtrProviderContext", + "text": "FtrProviderContext" + }, + ") => { (fn: () => Promise): Promise; wrap(fn: (...args: Args) => Promise): (...args: Args) => Promise; }; }, {}, ProvidedTypeMap<{ retryOnStale: ({ getService }: ", + { + "pluginId": "@kbn/ftr-common-functional-ui-services", + "scope": "common", + "docId": "kibKbnFtrCommonFunctionalUiServicesPluginApi", + "section": "def-common.FtrProviderContext", + "text": "FtrProviderContext" + }, + ") => { (fn: () => Promise): Promise; wrap(fn: (...args: Args) => Promise): (...args: Args) => Promise; }; }>, ProvidedTypeMap<{}>>" + ], + "path": "packages/kbn-ftr-common-functional-ui-services/services/retry_on_stale.ts", + "deprecated": false, + "trackAdoption": false + } + ] + } + ], + "initialIsOpen": false + } + ] + } +} \ No newline at end of file diff --git a/api_docs/kbn_ftr_common_functional_ui_services.mdx b/api_docs/kbn_ftr_common_functional_ui_services.mdx new file mode 100644 index 0000000000000..ddd5dd02a4b45 --- /dev/null +++ b/api_docs/kbn_ftr_common_functional_ui_services.mdx @@ -0,0 +1,33 @@ +--- +#### +#### This document is auto-generated and is meant to be viewed inside our experimental, new docs system. +#### Reach out in #docs-engineering for more info. +#### +id: kibKbnFtrCommonFunctionalUiServicesPluginApi +slug: /kibana-dev-docs/api/kbn-ftr-common-functional-ui-services +title: "@kbn/ftr-common-functional-ui-services" +image: https://source.unsplash.com/400x175/?github +description: API docs for the @kbn/ftr-common-functional-ui-services plugin +date: 2023-12-19 +tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ftr-common-functional-ui-services'] +--- +import kbnFtrCommonFunctionalUiServicesObj from './kbn_ftr_common_functional_ui_services.devdocs.json'; + + + +Contact [@elastic/appex-qa](https://github.com/orgs/elastic/teams/appex-qa) for questions regarding this plugin. + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 4 | 0 | 4 | 0 | + +## Common + +### Objects + + +### Consts, variables and types + + diff --git a/api_docs/kbn_generate.mdx b/api_docs/kbn_generate.mdx index bd5b0e7bd90d1..a6ddea7c9f3f5 100644 --- a/api_docs/kbn_generate.mdx +++ b/api_docs/kbn_generate.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-generate title: "@kbn/generate" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/generate plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/generate'] --- import kbnGenerateObj from './kbn_generate.devdocs.json'; diff --git a/api_docs/kbn_generate_console_definitions.mdx b/api_docs/kbn_generate_console_definitions.mdx index 3cc35fb60e45d..707af0569dc8c 100644 --- a/api_docs/kbn_generate_console_definitions.mdx +++ b/api_docs/kbn_generate_console_definitions.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-generate-console-definitions title: "@kbn/generate-console-definitions" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/generate-console-definitions plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/generate-console-definitions'] --- import kbnGenerateConsoleDefinitionsObj from './kbn_generate_console_definitions.devdocs.json'; diff --git a/api_docs/kbn_generate_csv.mdx b/api_docs/kbn_generate_csv.mdx index fb10b807484c7..1f6d69bf32d87 100644 --- a/api_docs/kbn_generate_csv.mdx +++ b/api_docs/kbn_generate_csv.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-generate-csv title: "@kbn/generate-csv" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/generate-csv plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/generate-csv'] --- import kbnGenerateCsvObj from './kbn_generate_csv.devdocs.json'; diff --git a/api_docs/kbn_guided_onboarding.mdx b/api_docs/kbn_guided_onboarding.mdx index f03fe4ef061fd..5c56eb1d7bcee 100644 --- a/api_docs/kbn_guided_onboarding.mdx +++ b/api_docs/kbn_guided_onboarding.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-guided-onboarding title: "@kbn/guided-onboarding" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/guided-onboarding plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/guided-onboarding'] --- import kbnGuidedOnboardingObj from './kbn_guided_onboarding.devdocs.json'; diff --git a/api_docs/kbn_handlebars.mdx b/api_docs/kbn_handlebars.mdx index 3b4f833c4efbd..0dfb572f2a3eb 100644 --- a/api_docs/kbn_handlebars.mdx +++ b/api_docs/kbn_handlebars.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-handlebars title: "@kbn/handlebars" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/handlebars plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/handlebars'] --- import kbnHandlebarsObj from './kbn_handlebars.devdocs.json'; diff --git a/api_docs/kbn_hapi_mocks.mdx b/api_docs/kbn_hapi_mocks.mdx index 4cd9e8e01d40d..1af65e34b65df 100644 --- a/api_docs/kbn_hapi_mocks.mdx +++ b/api_docs/kbn_hapi_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-hapi-mocks title: "@kbn/hapi-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/hapi-mocks plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/hapi-mocks'] --- import kbnHapiMocksObj from './kbn_hapi_mocks.devdocs.json'; diff --git a/api_docs/kbn_health_gateway_server.mdx b/api_docs/kbn_health_gateway_server.mdx index 949665759bd5c..8eec5c23269fc 100644 --- a/api_docs/kbn_health_gateway_server.mdx +++ b/api_docs/kbn_health_gateway_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-health-gateway-server title: "@kbn/health-gateway-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/health-gateway-server plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/health-gateway-server'] --- import kbnHealthGatewayServerObj from './kbn_health_gateway_server.devdocs.json'; diff --git a/api_docs/kbn_home_sample_data_card.mdx b/api_docs/kbn_home_sample_data_card.mdx index 1a7d7f457eef7..de0cfb3103d9d 100644 --- a/api_docs/kbn_home_sample_data_card.mdx +++ b/api_docs/kbn_home_sample_data_card.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-home-sample-data-card title: "@kbn/home-sample-data-card" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/home-sample-data-card plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/home-sample-data-card'] --- import kbnHomeSampleDataCardObj from './kbn_home_sample_data_card.devdocs.json'; diff --git a/api_docs/kbn_home_sample_data_tab.mdx b/api_docs/kbn_home_sample_data_tab.mdx index 253477e5882eb..cb585056dac1f 100644 --- a/api_docs/kbn_home_sample_data_tab.mdx +++ b/api_docs/kbn_home_sample_data_tab.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-home-sample-data-tab title: "@kbn/home-sample-data-tab" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/home-sample-data-tab plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/home-sample-data-tab'] --- import kbnHomeSampleDataTabObj from './kbn_home_sample_data_tab.devdocs.json'; diff --git a/api_docs/kbn_i18n.mdx b/api_docs/kbn_i18n.mdx index a6338ecff062a..27a1db78d7022 100644 --- a/api_docs/kbn_i18n.mdx +++ b/api_docs/kbn_i18n.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-i18n title: "@kbn/i18n" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/i18n plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/i18n'] --- import kbnI18nObj from './kbn_i18n.devdocs.json'; diff --git a/api_docs/kbn_i18n_react.mdx b/api_docs/kbn_i18n_react.mdx index 97671be1549ac..8bf4b62c49c27 100644 --- a/api_docs/kbn_i18n_react.mdx +++ b/api_docs/kbn_i18n_react.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-i18n-react title: "@kbn/i18n-react" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/i18n-react plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/i18n-react'] --- import kbnI18nReactObj from './kbn_i18n_react.devdocs.json'; diff --git a/api_docs/kbn_import_resolver.mdx b/api_docs/kbn_import_resolver.mdx index 48fddec56fc11..f3a990652d5e4 100644 --- a/api_docs/kbn_import_resolver.mdx +++ b/api_docs/kbn_import_resolver.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-import-resolver title: "@kbn/import-resolver" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/import-resolver plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/import-resolver'] --- import kbnImportResolverObj from './kbn_import_resolver.devdocs.json'; diff --git a/api_docs/kbn_infra_forge.mdx b/api_docs/kbn_infra_forge.mdx index 87ebdbf2a77af..32748299fda9c 100644 --- a/api_docs/kbn_infra_forge.mdx +++ b/api_docs/kbn_infra_forge.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-infra-forge title: "@kbn/infra-forge" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/infra-forge plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/infra-forge'] --- import kbnInfraForgeObj from './kbn_infra_forge.devdocs.json'; diff --git a/api_docs/kbn_interpreter.mdx b/api_docs/kbn_interpreter.mdx index 168779660e4b7..879922e915389 100644 --- a/api_docs/kbn_interpreter.mdx +++ b/api_docs/kbn_interpreter.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-interpreter title: "@kbn/interpreter" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/interpreter plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/interpreter'] --- import kbnInterpreterObj from './kbn_interpreter.devdocs.json'; diff --git a/api_docs/kbn_io_ts_utils.mdx b/api_docs/kbn_io_ts_utils.mdx index 641cf8d9596ab..a84c759b48ac6 100644 --- a/api_docs/kbn_io_ts_utils.mdx +++ b/api_docs/kbn_io_ts_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-io-ts-utils title: "@kbn/io-ts-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/io-ts-utils plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/io-ts-utils'] --- import kbnIoTsUtilsObj from './kbn_io_ts_utils.devdocs.json'; diff --git a/api_docs/kbn_jest_serializers.mdx b/api_docs/kbn_jest_serializers.mdx index e10faf6fa36f4..5974f9bac8231 100644 --- a/api_docs/kbn_jest_serializers.mdx +++ b/api_docs/kbn_jest_serializers.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-jest-serializers title: "@kbn/jest-serializers" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/jest-serializers plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/jest-serializers'] --- import kbnJestSerializersObj from './kbn_jest_serializers.devdocs.json'; diff --git a/api_docs/kbn_journeys.mdx b/api_docs/kbn_journeys.mdx index 6706a41f7f851..a26e26c22622a 100644 --- a/api_docs/kbn_journeys.mdx +++ b/api_docs/kbn_journeys.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-journeys title: "@kbn/journeys" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/journeys plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/journeys'] --- import kbnJourneysObj from './kbn_journeys.devdocs.json'; diff --git a/api_docs/kbn_json_ast.mdx b/api_docs/kbn_json_ast.mdx index ea53f8abcf641..d42b61c393e20 100644 --- a/api_docs/kbn_json_ast.mdx +++ b/api_docs/kbn_json_ast.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-json-ast title: "@kbn/json-ast" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/json-ast plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/json-ast'] --- import kbnJsonAstObj from './kbn_json_ast.devdocs.json'; diff --git a/api_docs/kbn_kibana_manifest_schema.mdx b/api_docs/kbn_kibana_manifest_schema.mdx index 71abef9698b94..cc4940d02ea80 100644 --- a/api_docs/kbn_kibana_manifest_schema.mdx +++ b/api_docs/kbn_kibana_manifest_schema.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-kibana-manifest-schema title: "@kbn/kibana-manifest-schema" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/kibana-manifest-schema plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/kibana-manifest-schema'] --- import kbnKibanaManifestSchemaObj from './kbn_kibana_manifest_schema.devdocs.json'; diff --git a/api_docs/kbn_language_documentation_popover.mdx b/api_docs/kbn_language_documentation_popover.mdx index b241fec416b97..61d980daa5ab2 100644 --- a/api_docs/kbn_language_documentation_popover.mdx +++ b/api_docs/kbn_language_documentation_popover.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-language-documentation-popover title: "@kbn/language-documentation-popover" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/language-documentation-popover plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/language-documentation-popover'] --- import kbnLanguageDocumentationPopoverObj from './kbn_language_documentation_popover.devdocs.json'; diff --git a/api_docs/kbn_lens_embeddable_utils.mdx b/api_docs/kbn_lens_embeddable_utils.mdx index 3e4e05f01392a..cd34b3605e894 100644 --- a/api_docs/kbn_lens_embeddable_utils.mdx +++ b/api_docs/kbn_lens_embeddable_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-lens-embeddable-utils title: "@kbn/lens-embeddable-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/lens-embeddable-utils plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/lens-embeddable-utils'] --- import kbnLensEmbeddableUtilsObj from './kbn_lens_embeddable_utils.devdocs.json'; diff --git a/api_docs/kbn_logging.mdx b/api_docs/kbn_logging.mdx index 29fa1180055ee..4d39edf82167b 100644 --- a/api_docs/kbn_logging.mdx +++ b/api_docs/kbn_logging.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-logging title: "@kbn/logging" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/logging plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/logging'] --- import kbnLoggingObj from './kbn_logging.devdocs.json'; diff --git a/api_docs/kbn_logging_mocks.mdx b/api_docs/kbn_logging_mocks.mdx index 85cc8998c837f..9e59b4eaa4544 100644 --- a/api_docs/kbn_logging_mocks.mdx +++ b/api_docs/kbn_logging_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-logging-mocks title: "@kbn/logging-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/logging-mocks plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/logging-mocks'] --- import kbnLoggingMocksObj from './kbn_logging_mocks.devdocs.json'; diff --git a/api_docs/kbn_managed_vscode_config.mdx b/api_docs/kbn_managed_vscode_config.mdx index bd9ea8ea80549..a415806e2b624 100644 --- a/api_docs/kbn_managed_vscode_config.mdx +++ b/api_docs/kbn_managed_vscode_config.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-managed-vscode-config title: "@kbn/managed-vscode-config" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/managed-vscode-config plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/managed-vscode-config'] --- import kbnManagedVscodeConfigObj from './kbn_managed_vscode_config.devdocs.json'; diff --git a/api_docs/kbn_management_cards_navigation.mdx b/api_docs/kbn_management_cards_navigation.mdx index 068f2d5f52f07..8ff85097e9b62 100644 --- a/api_docs/kbn_management_cards_navigation.mdx +++ b/api_docs/kbn_management_cards_navigation.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-management-cards-navigation title: "@kbn/management-cards-navigation" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/management-cards-navigation plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/management-cards-navigation'] --- import kbnManagementCardsNavigationObj from './kbn_management_cards_navigation.devdocs.json'; diff --git a/api_docs/kbn_management_settings_application.mdx b/api_docs/kbn_management_settings_application.mdx index 92b0090dce580..60ac8fdc3af92 100644 --- a/api_docs/kbn_management_settings_application.mdx +++ b/api_docs/kbn_management_settings_application.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-management-settings-application title: "@kbn/management-settings-application" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/management-settings-application plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/management-settings-application'] --- import kbnManagementSettingsApplicationObj from './kbn_management_settings_application.devdocs.json'; diff --git a/api_docs/kbn_management_settings_components_field_category.mdx b/api_docs/kbn_management_settings_components_field_category.mdx index 2bbd298328721..e2ef4ba774813 100644 --- a/api_docs/kbn_management_settings_components_field_category.mdx +++ b/api_docs/kbn_management_settings_components_field_category.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-management-settings-components-field-category title: "@kbn/management-settings-components-field-category" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/management-settings-components-field-category plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/management-settings-components-field-category'] --- import kbnManagementSettingsComponentsFieldCategoryObj from './kbn_management_settings_components_field_category.devdocs.json'; diff --git a/api_docs/kbn_management_settings_components_field_input.mdx b/api_docs/kbn_management_settings_components_field_input.mdx index b92019369c1f6..9cbeb04b5d450 100644 --- a/api_docs/kbn_management_settings_components_field_input.mdx +++ b/api_docs/kbn_management_settings_components_field_input.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-management-settings-components-field-input title: "@kbn/management-settings-components-field-input" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/management-settings-components-field-input plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/management-settings-components-field-input'] --- import kbnManagementSettingsComponentsFieldInputObj from './kbn_management_settings_components_field_input.devdocs.json'; diff --git a/api_docs/kbn_management_settings_components_field_row.mdx b/api_docs/kbn_management_settings_components_field_row.mdx index cef98e2186271..a8359188b8cb3 100644 --- a/api_docs/kbn_management_settings_components_field_row.mdx +++ b/api_docs/kbn_management_settings_components_field_row.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-management-settings-components-field-row title: "@kbn/management-settings-components-field-row" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/management-settings-components-field-row plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/management-settings-components-field-row'] --- import kbnManagementSettingsComponentsFieldRowObj from './kbn_management_settings_components_field_row.devdocs.json'; diff --git a/api_docs/kbn_management_settings_components_form.mdx b/api_docs/kbn_management_settings_components_form.mdx index e094de228e61d..e911f3598e4a3 100644 --- a/api_docs/kbn_management_settings_components_form.mdx +++ b/api_docs/kbn_management_settings_components_form.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-management-settings-components-form title: "@kbn/management-settings-components-form" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/management-settings-components-form plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/management-settings-components-form'] --- import kbnManagementSettingsComponentsFormObj from './kbn_management_settings_components_form.devdocs.json'; diff --git a/api_docs/kbn_management_settings_field_definition.mdx b/api_docs/kbn_management_settings_field_definition.mdx index e9cf3555aba3e..224c22d8ba304 100644 --- a/api_docs/kbn_management_settings_field_definition.mdx +++ b/api_docs/kbn_management_settings_field_definition.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-management-settings-field-definition title: "@kbn/management-settings-field-definition" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/management-settings-field-definition plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/management-settings-field-definition'] --- import kbnManagementSettingsFieldDefinitionObj from './kbn_management_settings_field_definition.devdocs.json'; diff --git a/api_docs/kbn_management_settings_ids.mdx b/api_docs/kbn_management_settings_ids.mdx index 6188476a963c7..79f89734866b6 100644 --- a/api_docs/kbn_management_settings_ids.mdx +++ b/api_docs/kbn_management_settings_ids.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-management-settings-ids title: "@kbn/management-settings-ids" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/management-settings-ids plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/management-settings-ids'] --- import kbnManagementSettingsIdsObj from './kbn_management_settings_ids.devdocs.json'; diff --git a/api_docs/kbn_management_settings_section_registry.mdx b/api_docs/kbn_management_settings_section_registry.mdx index 90340644d4c7b..516894009b711 100644 --- a/api_docs/kbn_management_settings_section_registry.mdx +++ b/api_docs/kbn_management_settings_section_registry.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-management-settings-section-registry title: "@kbn/management-settings-section-registry" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/management-settings-section-registry plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/management-settings-section-registry'] --- import kbnManagementSettingsSectionRegistryObj from './kbn_management_settings_section_registry.devdocs.json'; diff --git a/api_docs/kbn_management_settings_types.mdx b/api_docs/kbn_management_settings_types.mdx index c8b6f4b77fa88..a790b4a305bef 100644 --- a/api_docs/kbn_management_settings_types.mdx +++ b/api_docs/kbn_management_settings_types.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-management-settings-types title: "@kbn/management-settings-types" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/management-settings-types plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/management-settings-types'] --- import kbnManagementSettingsTypesObj from './kbn_management_settings_types.devdocs.json'; diff --git a/api_docs/kbn_management_settings_utilities.mdx b/api_docs/kbn_management_settings_utilities.mdx index 6a8e81ee1afde..f5e4a2148d822 100644 --- a/api_docs/kbn_management_settings_utilities.mdx +++ b/api_docs/kbn_management_settings_utilities.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-management-settings-utilities title: "@kbn/management-settings-utilities" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/management-settings-utilities plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/management-settings-utilities'] --- import kbnManagementSettingsUtilitiesObj from './kbn_management_settings_utilities.devdocs.json'; diff --git a/api_docs/kbn_management_storybook_config.mdx b/api_docs/kbn_management_storybook_config.mdx index 88d4e50eb4268..0c4d38b67b5ea 100644 --- a/api_docs/kbn_management_storybook_config.mdx +++ b/api_docs/kbn_management_storybook_config.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-management-storybook-config title: "@kbn/management-storybook-config" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/management-storybook-config plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/management-storybook-config'] --- import kbnManagementStorybookConfigObj from './kbn_management_storybook_config.devdocs.json'; diff --git a/api_docs/kbn_mapbox_gl.mdx b/api_docs/kbn_mapbox_gl.mdx index 4abeebd551b28..d2a931b730d5e 100644 --- a/api_docs/kbn_mapbox_gl.mdx +++ b/api_docs/kbn_mapbox_gl.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-mapbox-gl title: "@kbn/mapbox-gl" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/mapbox-gl plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/mapbox-gl'] --- import kbnMapboxGlObj from './kbn_mapbox_gl.devdocs.json'; diff --git a/api_docs/kbn_maps_vector_tile_utils.mdx b/api_docs/kbn_maps_vector_tile_utils.mdx index b13324dd0e5fb..953b186f4766d 100644 --- a/api_docs/kbn_maps_vector_tile_utils.mdx +++ b/api_docs/kbn_maps_vector_tile_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-maps-vector-tile-utils title: "@kbn/maps-vector-tile-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/maps-vector-tile-utils plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/maps-vector-tile-utils'] --- import kbnMapsVectorTileUtilsObj from './kbn_maps_vector_tile_utils.devdocs.json'; diff --git a/api_docs/kbn_ml_agg_utils.mdx b/api_docs/kbn_ml_agg_utils.mdx index e2be7f0976c3a..f44fe6ad4d1aa 100644 --- a/api_docs/kbn_ml_agg_utils.mdx +++ b/api_docs/kbn_ml_agg_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-agg-utils title: "@kbn/ml-agg-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-agg-utils plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-agg-utils'] --- import kbnMlAggUtilsObj from './kbn_ml_agg_utils.devdocs.json'; diff --git a/api_docs/kbn_ml_anomaly_utils.mdx b/api_docs/kbn_ml_anomaly_utils.mdx index 3627f26f72e31..059033e032f94 100644 --- a/api_docs/kbn_ml_anomaly_utils.mdx +++ b/api_docs/kbn_ml_anomaly_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-anomaly-utils title: "@kbn/ml-anomaly-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-anomaly-utils plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-anomaly-utils'] --- import kbnMlAnomalyUtilsObj from './kbn_ml_anomaly_utils.devdocs.json'; diff --git a/api_docs/kbn_ml_category_validator.mdx b/api_docs/kbn_ml_category_validator.mdx index bb670665d482d..60892c79dc3c1 100644 --- a/api_docs/kbn_ml_category_validator.mdx +++ b/api_docs/kbn_ml_category_validator.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-category-validator title: "@kbn/ml-category-validator" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-category-validator plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-category-validator'] --- import kbnMlCategoryValidatorObj from './kbn_ml_category_validator.devdocs.json'; diff --git a/api_docs/kbn_ml_chi2test.mdx b/api_docs/kbn_ml_chi2test.mdx index a0994c8ba1d78..a13bbfd0ef990 100644 --- a/api_docs/kbn_ml_chi2test.mdx +++ b/api_docs/kbn_ml_chi2test.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-chi2test title: "@kbn/ml-chi2test" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-chi2test plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-chi2test'] --- import kbnMlChi2testObj from './kbn_ml_chi2test.devdocs.json'; diff --git a/api_docs/kbn_ml_data_frame_analytics_utils.mdx b/api_docs/kbn_ml_data_frame_analytics_utils.mdx index 4fe327028ec1b..92d9facafe82d 100644 --- a/api_docs/kbn_ml_data_frame_analytics_utils.mdx +++ b/api_docs/kbn_ml_data_frame_analytics_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-data-frame-analytics-utils title: "@kbn/ml-data-frame-analytics-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-data-frame-analytics-utils plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-data-frame-analytics-utils'] --- import kbnMlDataFrameAnalyticsUtilsObj from './kbn_ml_data_frame_analytics_utils.devdocs.json'; diff --git a/api_docs/kbn_ml_data_grid.mdx b/api_docs/kbn_ml_data_grid.mdx index b2b8746710376..43d8172c0b13d 100644 --- a/api_docs/kbn_ml_data_grid.mdx +++ b/api_docs/kbn_ml_data_grid.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-data-grid title: "@kbn/ml-data-grid" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-data-grid plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-data-grid'] --- import kbnMlDataGridObj from './kbn_ml_data_grid.devdocs.json'; diff --git a/api_docs/kbn_ml_date_picker.mdx b/api_docs/kbn_ml_date_picker.mdx index c75f23a379ef5..d88c6395d4c16 100644 --- a/api_docs/kbn_ml_date_picker.mdx +++ b/api_docs/kbn_ml_date_picker.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-date-picker title: "@kbn/ml-date-picker" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-date-picker plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-date-picker'] --- import kbnMlDatePickerObj from './kbn_ml_date_picker.devdocs.json'; diff --git a/api_docs/kbn_ml_date_utils.mdx b/api_docs/kbn_ml_date_utils.mdx index 2098fdb2090ea..efea2c91a3da7 100644 --- a/api_docs/kbn_ml_date_utils.mdx +++ b/api_docs/kbn_ml_date_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-date-utils title: "@kbn/ml-date-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-date-utils plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-date-utils'] --- import kbnMlDateUtilsObj from './kbn_ml_date_utils.devdocs.json'; diff --git a/api_docs/kbn_ml_error_utils.mdx b/api_docs/kbn_ml_error_utils.mdx index a4873cc57aeae..ea604aa86091d 100644 --- a/api_docs/kbn_ml_error_utils.mdx +++ b/api_docs/kbn_ml_error_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-error-utils title: "@kbn/ml-error-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-error-utils plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-error-utils'] --- import kbnMlErrorUtilsObj from './kbn_ml_error_utils.devdocs.json'; diff --git a/api_docs/kbn_ml_in_memory_table.mdx b/api_docs/kbn_ml_in_memory_table.mdx index 279c4fc6dc828..7a1a2aaa9cb15 100644 --- a/api_docs/kbn_ml_in_memory_table.mdx +++ b/api_docs/kbn_ml_in_memory_table.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-in-memory-table title: "@kbn/ml-in-memory-table" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-in-memory-table plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-in-memory-table'] --- import kbnMlInMemoryTableObj from './kbn_ml_in_memory_table.devdocs.json'; diff --git a/api_docs/kbn_ml_is_defined.mdx b/api_docs/kbn_ml_is_defined.mdx index dc298e02da940..7ac72b537a8b3 100644 --- a/api_docs/kbn_ml_is_defined.mdx +++ b/api_docs/kbn_ml_is_defined.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-is-defined title: "@kbn/ml-is-defined" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-is-defined plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-is-defined'] --- import kbnMlIsDefinedObj from './kbn_ml_is_defined.devdocs.json'; diff --git a/api_docs/kbn_ml_is_populated_object.mdx b/api_docs/kbn_ml_is_populated_object.mdx index c6cf6204e8759..5921482756730 100644 --- a/api_docs/kbn_ml_is_populated_object.mdx +++ b/api_docs/kbn_ml_is_populated_object.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-is-populated-object title: "@kbn/ml-is-populated-object" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-is-populated-object plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-is-populated-object'] --- import kbnMlIsPopulatedObjectObj from './kbn_ml_is_populated_object.devdocs.json'; diff --git a/api_docs/kbn_ml_kibana_theme.mdx b/api_docs/kbn_ml_kibana_theme.mdx index 7ee4dfda97a3e..52b2bb6e96424 100644 --- a/api_docs/kbn_ml_kibana_theme.mdx +++ b/api_docs/kbn_ml_kibana_theme.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-kibana-theme title: "@kbn/ml-kibana-theme" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-kibana-theme plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-kibana-theme'] --- import kbnMlKibanaThemeObj from './kbn_ml_kibana_theme.devdocs.json'; diff --git a/api_docs/kbn_ml_local_storage.mdx b/api_docs/kbn_ml_local_storage.mdx index c6d7b9dce8d49..eb27f2dea70fa 100644 --- a/api_docs/kbn_ml_local_storage.mdx +++ b/api_docs/kbn_ml_local_storage.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-local-storage title: "@kbn/ml-local-storage" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-local-storage plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-local-storage'] --- import kbnMlLocalStorageObj from './kbn_ml_local_storage.devdocs.json'; diff --git a/api_docs/kbn_ml_nested_property.mdx b/api_docs/kbn_ml_nested_property.mdx index 57cddb7fd0ece..01f2bdfb887b7 100644 --- a/api_docs/kbn_ml_nested_property.mdx +++ b/api_docs/kbn_ml_nested_property.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-nested-property title: "@kbn/ml-nested-property" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-nested-property plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-nested-property'] --- import kbnMlNestedPropertyObj from './kbn_ml_nested_property.devdocs.json'; diff --git a/api_docs/kbn_ml_number_utils.mdx b/api_docs/kbn_ml_number_utils.mdx index 69c56d1eb05cd..ce90be4172809 100644 --- a/api_docs/kbn_ml_number_utils.mdx +++ b/api_docs/kbn_ml_number_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-number-utils title: "@kbn/ml-number-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-number-utils plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-number-utils'] --- import kbnMlNumberUtilsObj from './kbn_ml_number_utils.devdocs.json'; diff --git a/api_docs/kbn_ml_query_utils.mdx b/api_docs/kbn_ml_query_utils.mdx index efd1a6d6f880f..0ef6cbb135388 100644 --- a/api_docs/kbn_ml_query_utils.mdx +++ b/api_docs/kbn_ml_query_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-query-utils title: "@kbn/ml-query-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-query-utils plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-query-utils'] --- import kbnMlQueryUtilsObj from './kbn_ml_query_utils.devdocs.json'; diff --git a/api_docs/kbn_ml_random_sampler_utils.mdx b/api_docs/kbn_ml_random_sampler_utils.mdx index 1dc71b8d2ef86..eeb354c220342 100644 --- a/api_docs/kbn_ml_random_sampler_utils.mdx +++ b/api_docs/kbn_ml_random_sampler_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-random-sampler-utils title: "@kbn/ml-random-sampler-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-random-sampler-utils plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-random-sampler-utils'] --- import kbnMlRandomSamplerUtilsObj from './kbn_ml_random_sampler_utils.devdocs.json'; diff --git a/api_docs/kbn_ml_route_utils.mdx b/api_docs/kbn_ml_route_utils.mdx index 7939ad7cd1cff..bdc87845ab126 100644 --- a/api_docs/kbn_ml_route_utils.mdx +++ b/api_docs/kbn_ml_route_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-route-utils title: "@kbn/ml-route-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-route-utils plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-route-utils'] --- import kbnMlRouteUtilsObj from './kbn_ml_route_utils.devdocs.json'; diff --git a/api_docs/kbn_ml_runtime_field_utils.mdx b/api_docs/kbn_ml_runtime_field_utils.mdx index f709af3ccb7aa..1374b48496a2f 100644 --- a/api_docs/kbn_ml_runtime_field_utils.mdx +++ b/api_docs/kbn_ml_runtime_field_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-runtime-field-utils title: "@kbn/ml-runtime-field-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-runtime-field-utils plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-runtime-field-utils'] --- import kbnMlRuntimeFieldUtilsObj from './kbn_ml_runtime_field_utils.devdocs.json'; diff --git a/api_docs/kbn_ml_string_hash.mdx b/api_docs/kbn_ml_string_hash.mdx index 7e5eaa5d7622b..0db3b18eabec3 100644 --- a/api_docs/kbn_ml_string_hash.mdx +++ b/api_docs/kbn_ml_string_hash.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-string-hash title: "@kbn/ml-string-hash" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-string-hash plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-string-hash'] --- import kbnMlStringHashObj from './kbn_ml_string_hash.devdocs.json'; diff --git a/api_docs/kbn_ml_trained_models_utils.mdx b/api_docs/kbn_ml_trained_models_utils.mdx index 236d4a4b2f22c..687ecbb5086cb 100644 --- a/api_docs/kbn_ml_trained_models_utils.mdx +++ b/api_docs/kbn_ml_trained_models_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-trained-models-utils title: "@kbn/ml-trained-models-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-trained-models-utils plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-trained-models-utils'] --- import kbnMlTrainedModelsUtilsObj from './kbn_ml_trained_models_utils.devdocs.json'; diff --git a/api_docs/kbn_ml_ui_actions.mdx b/api_docs/kbn_ml_ui_actions.mdx index 23e90604f982b..07fa3f0f692f4 100644 --- a/api_docs/kbn_ml_ui_actions.mdx +++ b/api_docs/kbn_ml_ui_actions.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-ui-actions title: "@kbn/ml-ui-actions" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-ui-actions plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-ui-actions'] --- import kbnMlUiActionsObj from './kbn_ml_ui_actions.devdocs.json'; diff --git a/api_docs/kbn_ml_url_state.mdx b/api_docs/kbn_ml_url_state.mdx index 8d13454cb9a6e..8758bc9d405cf 100644 --- a/api_docs/kbn_ml_url_state.mdx +++ b/api_docs/kbn_ml_url_state.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-url-state title: "@kbn/ml-url-state" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-url-state plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-url-state'] --- import kbnMlUrlStateObj from './kbn_ml_url_state.devdocs.json'; diff --git a/api_docs/kbn_monaco.mdx b/api_docs/kbn_monaco.mdx index e5d7b0aa67eb5..097f6158a271a 100644 --- a/api_docs/kbn_monaco.mdx +++ b/api_docs/kbn_monaco.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-monaco title: "@kbn/monaco" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/monaco plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/monaco'] --- import kbnMonacoObj from './kbn_monaco.devdocs.json'; diff --git a/api_docs/kbn_object_versioning.mdx b/api_docs/kbn_object_versioning.mdx index 4d9378269c2aa..889b89f58b713 100644 --- a/api_docs/kbn_object_versioning.mdx +++ b/api_docs/kbn_object_versioning.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-object-versioning title: "@kbn/object-versioning" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/object-versioning plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/object-versioning'] --- import kbnObjectVersioningObj from './kbn_object_versioning.devdocs.json'; diff --git a/api_docs/kbn_observability_alert_details.mdx b/api_docs/kbn_observability_alert_details.mdx index 99a52143d6005..5267c6518f50c 100644 --- a/api_docs/kbn_observability_alert_details.mdx +++ b/api_docs/kbn_observability_alert_details.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-observability-alert-details title: "@kbn/observability-alert-details" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/observability-alert-details plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/observability-alert-details'] --- import kbnObservabilityAlertDetailsObj from './kbn_observability_alert_details.devdocs.json'; diff --git a/api_docs/kbn_observability_alerting_test_data.mdx b/api_docs/kbn_observability_alerting_test_data.mdx index 22fa9c9b32fb2..3534a0032efe7 100644 --- a/api_docs/kbn_observability_alerting_test_data.mdx +++ b/api_docs/kbn_observability_alerting_test_data.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-observability-alerting-test-data title: "@kbn/observability-alerting-test-data" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/observability-alerting-test-data plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/observability-alerting-test-data'] --- import kbnObservabilityAlertingTestDataObj from './kbn_observability_alerting_test_data.devdocs.json'; diff --git a/api_docs/kbn_observability_get_padded_alert_time_range_util.mdx b/api_docs/kbn_observability_get_padded_alert_time_range_util.mdx index 33c0d3eed4203..18baac91738b2 100644 --- a/api_docs/kbn_observability_get_padded_alert_time_range_util.mdx +++ b/api_docs/kbn_observability_get_padded_alert_time_range_util.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-observability-get-padded-alert-time-range-util title: "@kbn/observability-get-padded-alert-time-range-util" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/observability-get-padded-alert-time-range-util plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/observability-get-padded-alert-time-range-util'] --- import kbnObservabilityGetPaddedAlertTimeRangeUtilObj from './kbn_observability_get_padded_alert_time_range_util.devdocs.json'; diff --git a/api_docs/kbn_openapi_bundler.mdx b/api_docs/kbn_openapi_bundler.mdx index 113433523f147..1fe4c05337fc8 100644 --- a/api_docs/kbn_openapi_bundler.mdx +++ b/api_docs/kbn_openapi_bundler.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-openapi-bundler title: "@kbn/openapi-bundler" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/openapi-bundler plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/openapi-bundler'] --- import kbnOpenapiBundlerObj from './kbn_openapi_bundler.devdocs.json'; diff --git a/api_docs/kbn_openapi_generator.mdx b/api_docs/kbn_openapi_generator.mdx index 263e013d08d63..e91eb491c8099 100644 --- a/api_docs/kbn_openapi_generator.mdx +++ b/api_docs/kbn_openapi_generator.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-openapi-generator title: "@kbn/openapi-generator" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/openapi-generator plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/openapi-generator'] --- import kbnOpenapiGeneratorObj from './kbn_openapi_generator.devdocs.json'; diff --git a/api_docs/kbn_optimizer.mdx b/api_docs/kbn_optimizer.mdx index 720494699fe70..e03fda66b922f 100644 --- a/api_docs/kbn_optimizer.mdx +++ b/api_docs/kbn_optimizer.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-optimizer title: "@kbn/optimizer" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/optimizer plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/optimizer'] --- import kbnOptimizerObj from './kbn_optimizer.devdocs.json'; diff --git a/api_docs/kbn_optimizer_webpack_helpers.mdx b/api_docs/kbn_optimizer_webpack_helpers.mdx index 952a3340af2b2..a4d93490f23a5 100644 --- a/api_docs/kbn_optimizer_webpack_helpers.mdx +++ b/api_docs/kbn_optimizer_webpack_helpers.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-optimizer-webpack-helpers title: "@kbn/optimizer-webpack-helpers" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/optimizer-webpack-helpers plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/optimizer-webpack-helpers'] --- import kbnOptimizerWebpackHelpersObj from './kbn_optimizer_webpack_helpers.devdocs.json'; diff --git a/api_docs/kbn_osquery_io_ts_types.mdx b/api_docs/kbn_osquery_io_ts_types.mdx index 83dbb0c4a7a7c..0fc96187e5d1e 100644 --- a/api_docs/kbn_osquery_io_ts_types.mdx +++ b/api_docs/kbn_osquery_io_ts_types.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-osquery-io-ts-types title: "@kbn/osquery-io-ts-types" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/osquery-io-ts-types plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/osquery-io-ts-types'] --- import kbnOsqueryIoTsTypesObj from './kbn_osquery_io_ts_types.devdocs.json'; diff --git a/api_docs/kbn_panel_loader.mdx b/api_docs/kbn_panel_loader.mdx index e16600d18d7b2..95758f643a33d 100644 --- a/api_docs/kbn_panel_loader.mdx +++ b/api_docs/kbn_panel_loader.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-panel-loader title: "@kbn/panel-loader" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/panel-loader plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/panel-loader'] --- import kbnPanelLoaderObj from './kbn_panel_loader.devdocs.json'; diff --git a/api_docs/kbn_performance_testing_dataset_extractor.mdx b/api_docs/kbn_performance_testing_dataset_extractor.mdx index 7553359315d68..e485d9ce30585 100644 --- a/api_docs/kbn_performance_testing_dataset_extractor.mdx +++ b/api_docs/kbn_performance_testing_dataset_extractor.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-performance-testing-dataset-extractor title: "@kbn/performance-testing-dataset-extractor" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/performance-testing-dataset-extractor plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/performance-testing-dataset-extractor'] --- import kbnPerformanceTestingDatasetExtractorObj from './kbn_performance_testing_dataset_extractor.devdocs.json'; diff --git a/api_docs/kbn_plugin_generator.mdx b/api_docs/kbn_plugin_generator.mdx index 36f37f53d14e0..8e1fc68be9bf3 100644 --- a/api_docs/kbn_plugin_generator.mdx +++ b/api_docs/kbn_plugin_generator.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-plugin-generator title: "@kbn/plugin-generator" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/plugin-generator plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/plugin-generator'] --- import kbnPluginGeneratorObj from './kbn_plugin_generator.devdocs.json'; diff --git a/api_docs/kbn_plugin_helpers.mdx b/api_docs/kbn_plugin_helpers.mdx index 61c3e5d26adab..d4868ebec7e74 100644 --- a/api_docs/kbn_plugin_helpers.mdx +++ b/api_docs/kbn_plugin_helpers.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-plugin-helpers title: "@kbn/plugin-helpers" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/plugin-helpers plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/plugin-helpers'] --- import kbnPluginHelpersObj from './kbn_plugin_helpers.devdocs.json'; diff --git a/api_docs/kbn_profiling_utils.mdx b/api_docs/kbn_profiling_utils.mdx index 249bfc33eca40..75843c6fe0ce5 100644 --- a/api_docs/kbn_profiling_utils.mdx +++ b/api_docs/kbn_profiling_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-profiling-utils title: "@kbn/profiling-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/profiling-utils plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/profiling-utils'] --- import kbnProfilingUtilsObj from './kbn_profiling_utils.devdocs.json'; diff --git a/api_docs/kbn_random_sampling.mdx b/api_docs/kbn_random_sampling.mdx index c4b75d0550019..235821608a0d2 100644 --- a/api_docs/kbn_random_sampling.mdx +++ b/api_docs/kbn_random_sampling.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-random-sampling title: "@kbn/random-sampling" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/random-sampling plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/random-sampling'] --- import kbnRandomSamplingObj from './kbn_random_sampling.devdocs.json'; diff --git a/api_docs/kbn_react_field.mdx b/api_docs/kbn_react_field.mdx index 84afd18b92520..ecf8bf46eaac3 100644 --- a/api_docs/kbn_react_field.mdx +++ b/api_docs/kbn_react_field.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-react-field title: "@kbn/react-field" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/react-field plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/react-field'] --- import kbnReactFieldObj from './kbn_react_field.devdocs.json'; diff --git a/api_docs/kbn_react_kibana_context_common.mdx b/api_docs/kbn_react_kibana_context_common.mdx index ba6ba45c02e79..938283f794947 100644 --- a/api_docs/kbn_react_kibana_context_common.mdx +++ b/api_docs/kbn_react_kibana_context_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-react-kibana-context-common title: "@kbn/react-kibana-context-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/react-kibana-context-common plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/react-kibana-context-common'] --- import kbnReactKibanaContextCommonObj from './kbn_react_kibana_context_common.devdocs.json'; diff --git a/api_docs/kbn_react_kibana_context_render.mdx b/api_docs/kbn_react_kibana_context_render.mdx index ac88554558b28..961a2c2a84c4a 100644 --- a/api_docs/kbn_react_kibana_context_render.mdx +++ b/api_docs/kbn_react_kibana_context_render.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-react-kibana-context-render title: "@kbn/react-kibana-context-render" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/react-kibana-context-render plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/react-kibana-context-render'] --- import kbnReactKibanaContextRenderObj from './kbn_react_kibana_context_render.devdocs.json'; diff --git a/api_docs/kbn_react_kibana_context_root.mdx b/api_docs/kbn_react_kibana_context_root.mdx index 5b3aca108bdf4..c25271e33c22b 100644 --- a/api_docs/kbn_react_kibana_context_root.mdx +++ b/api_docs/kbn_react_kibana_context_root.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-react-kibana-context-root title: "@kbn/react-kibana-context-root" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/react-kibana-context-root plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/react-kibana-context-root'] --- import kbnReactKibanaContextRootObj from './kbn_react_kibana_context_root.devdocs.json'; diff --git a/api_docs/kbn_react_kibana_context_styled.mdx b/api_docs/kbn_react_kibana_context_styled.mdx index ceb1bae3f5e4f..dde8a04b2e3e8 100644 --- a/api_docs/kbn_react_kibana_context_styled.mdx +++ b/api_docs/kbn_react_kibana_context_styled.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-react-kibana-context-styled title: "@kbn/react-kibana-context-styled" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/react-kibana-context-styled plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/react-kibana-context-styled'] --- import kbnReactKibanaContextStyledObj from './kbn_react_kibana_context_styled.devdocs.json'; diff --git a/api_docs/kbn_react_kibana_context_theme.mdx b/api_docs/kbn_react_kibana_context_theme.mdx index eef506749eff1..d2cd397f9af52 100644 --- a/api_docs/kbn_react_kibana_context_theme.mdx +++ b/api_docs/kbn_react_kibana_context_theme.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-react-kibana-context-theme title: "@kbn/react-kibana-context-theme" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/react-kibana-context-theme plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/react-kibana-context-theme'] --- import kbnReactKibanaContextThemeObj from './kbn_react_kibana_context_theme.devdocs.json'; diff --git a/api_docs/kbn_react_kibana_mount.mdx b/api_docs/kbn_react_kibana_mount.mdx index 3d8430dacd6a9..0b90295b71a37 100644 --- a/api_docs/kbn_react_kibana_mount.mdx +++ b/api_docs/kbn_react_kibana_mount.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-react-kibana-mount title: "@kbn/react-kibana-mount" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/react-kibana-mount plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/react-kibana-mount'] --- import kbnReactKibanaMountObj from './kbn_react_kibana_mount.devdocs.json'; diff --git a/api_docs/kbn_repo_file_maps.mdx b/api_docs/kbn_repo_file_maps.mdx index b1e50a15e7ce2..00009a0d0ad8a 100644 --- a/api_docs/kbn_repo_file_maps.mdx +++ b/api_docs/kbn_repo_file_maps.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-repo-file-maps title: "@kbn/repo-file-maps" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/repo-file-maps plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/repo-file-maps'] --- import kbnRepoFileMapsObj from './kbn_repo_file_maps.devdocs.json'; diff --git a/api_docs/kbn_repo_linter.mdx b/api_docs/kbn_repo_linter.mdx index 5c87c85b8cacb..2ff0f304b2fe7 100644 --- a/api_docs/kbn_repo_linter.mdx +++ b/api_docs/kbn_repo_linter.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-repo-linter title: "@kbn/repo-linter" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/repo-linter plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/repo-linter'] --- import kbnRepoLinterObj from './kbn_repo_linter.devdocs.json'; diff --git a/api_docs/kbn_repo_path.mdx b/api_docs/kbn_repo_path.mdx index 36f750b73a827..82ec79a9e1db6 100644 --- a/api_docs/kbn_repo_path.mdx +++ b/api_docs/kbn_repo_path.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-repo-path title: "@kbn/repo-path" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/repo-path plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/repo-path'] --- import kbnRepoPathObj from './kbn_repo_path.devdocs.json'; diff --git a/api_docs/kbn_repo_source_classifier.mdx b/api_docs/kbn_repo_source_classifier.mdx index d6e8e3d8460e0..6fb8c317359bc 100644 --- a/api_docs/kbn_repo_source_classifier.mdx +++ b/api_docs/kbn_repo_source_classifier.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-repo-source-classifier title: "@kbn/repo-source-classifier" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/repo-source-classifier plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/repo-source-classifier'] --- import kbnRepoSourceClassifierObj from './kbn_repo_source_classifier.devdocs.json'; diff --git a/api_docs/kbn_reporting_common.mdx b/api_docs/kbn_reporting_common.mdx index 9bc687cb25d08..562b5c4ef320a 100644 --- a/api_docs/kbn_reporting_common.mdx +++ b/api_docs/kbn_reporting_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-reporting-common title: "@kbn/reporting-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/reporting-common plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/reporting-common'] --- import kbnReportingCommonObj from './kbn_reporting_common.devdocs.json'; diff --git a/api_docs/kbn_reporting_export_types_csv.mdx b/api_docs/kbn_reporting_export_types_csv.mdx index f9e334f8d409b..9e40723964917 100644 --- a/api_docs/kbn_reporting_export_types_csv.mdx +++ b/api_docs/kbn_reporting_export_types_csv.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-reporting-export-types-csv title: "@kbn/reporting-export-types-csv" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/reporting-export-types-csv plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/reporting-export-types-csv'] --- import kbnReportingExportTypesCsvObj from './kbn_reporting_export_types_csv.devdocs.json'; diff --git a/api_docs/kbn_reporting_export_types_csv_common.mdx b/api_docs/kbn_reporting_export_types_csv_common.mdx index 442aad29a0c58..8257679d30537 100644 --- a/api_docs/kbn_reporting_export_types_csv_common.mdx +++ b/api_docs/kbn_reporting_export_types_csv_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-reporting-export-types-csv-common title: "@kbn/reporting-export-types-csv-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/reporting-export-types-csv-common plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/reporting-export-types-csv-common'] --- import kbnReportingExportTypesCsvCommonObj from './kbn_reporting_export_types_csv_common.devdocs.json'; diff --git a/api_docs/kbn_reporting_export_types_pdf.mdx b/api_docs/kbn_reporting_export_types_pdf.mdx index 74f62c3d11483..f8513ca012ff7 100644 --- a/api_docs/kbn_reporting_export_types_pdf.mdx +++ b/api_docs/kbn_reporting_export_types_pdf.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-reporting-export-types-pdf title: "@kbn/reporting-export-types-pdf" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/reporting-export-types-pdf plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/reporting-export-types-pdf'] --- import kbnReportingExportTypesPdfObj from './kbn_reporting_export_types_pdf.devdocs.json'; diff --git a/api_docs/kbn_reporting_export_types_pdf_common.mdx b/api_docs/kbn_reporting_export_types_pdf_common.mdx index b9c1335e9a667..5ff8178af6b2c 100644 --- a/api_docs/kbn_reporting_export_types_pdf_common.mdx +++ b/api_docs/kbn_reporting_export_types_pdf_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-reporting-export-types-pdf-common title: "@kbn/reporting-export-types-pdf-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/reporting-export-types-pdf-common plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/reporting-export-types-pdf-common'] --- import kbnReportingExportTypesPdfCommonObj from './kbn_reporting_export_types_pdf_common.devdocs.json'; diff --git a/api_docs/kbn_reporting_export_types_png.mdx b/api_docs/kbn_reporting_export_types_png.mdx index 7ecfba370b97e..7be5c17cb9668 100644 --- a/api_docs/kbn_reporting_export_types_png.mdx +++ b/api_docs/kbn_reporting_export_types_png.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-reporting-export-types-png title: "@kbn/reporting-export-types-png" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/reporting-export-types-png plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/reporting-export-types-png'] --- import kbnReportingExportTypesPngObj from './kbn_reporting_export_types_png.devdocs.json'; diff --git a/api_docs/kbn_reporting_export_types_png_common.mdx b/api_docs/kbn_reporting_export_types_png_common.mdx index eaa2a48ba19c6..4d149b32aed94 100644 --- a/api_docs/kbn_reporting_export_types_png_common.mdx +++ b/api_docs/kbn_reporting_export_types_png_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-reporting-export-types-png-common title: "@kbn/reporting-export-types-png-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/reporting-export-types-png-common plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/reporting-export-types-png-common'] --- import kbnReportingExportTypesPngCommonObj from './kbn_reporting_export_types_png_common.devdocs.json'; diff --git a/api_docs/kbn_reporting_mocks_server.mdx b/api_docs/kbn_reporting_mocks_server.mdx index f8367a9d63640..21d70be5c4e41 100644 --- a/api_docs/kbn_reporting_mocks_server.mdx +++ b/api_docs/kbn_reporting_mocks_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-reporting-mocks-server title: "@kbn/reporting-mocks-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/reporting-mocks-server plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/reporting-mocks-server'] --- import kbnReportingMocksServerObj from './kbn_reporting_mocks_server.devdocs.json'; diff --git a/api_docs/kbn_reporting_public.mdx b/api_docs/kbn_reporting_public.mdx index 24a3960a1c0a8..a3378f717c3ca 100644 --- a/api_docs/kbn_reporting_public.mdx +++ b/api_docs/kbn_reporting_public.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-reporting-public title: "@kbn/reporting-public" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/reporting-public plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/reporting-public'] --- import kbnReportingPublicObj from './kbn_reporting_public.devdocs.json'; diff --git a/api_docs/kbn_reporting_server.mdx b/api_docs/kbn_reporting_server.mdx index 3c93dadb1bf79..ab219bdc011fd 100644 --- a/api_docs/kbn_reporting_server.mdx +++ b/api_docs/kbn_reporting_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-reporting-server title: "@kbn/reporting-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/reporting-server plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/reporting-server'] --- import kbnReportingServerObj from './kbn_reporting_server.devdocs.json'; diff --git a/api_docs/kbn_resizable_layout.mdx b/api_docs/kbn_resizable_layout.mdx index 513169c265ec9..e4769ec720f4b 100644 --- a/api_docs/kbn_resizable_layout.mdx +++ b/api_docs/kbn_resizable_layout.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-resizable-layout title: "@kbn/resizable-layout" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/resizable-layout plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/resizable-layout'] --- import kbnResizableLayoutObj from './kbn_resizable_layout.devdocs.json'; diff --git a/api_docs/kbn_rison.mdx b/api_docs/kbn_rison.mdx index f14474a85f18e..25d97621f0756 100644 --- a/api_docs/kbn_rison.mdx +++ b/api_docs/kbn_rison.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-rison title: "@kbn/rison" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/rison plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/rison'] --- import kbnRisonObj from './kbn_rison.devdocs.json'; diff --git a/api_docs/kbn_router_utils.devdocs.json b/api_docs/kbn_router_utils.devdocs.json new file mode 100644 index 0000000000000..a0649c6bc1ea3 --- /dev/null +++ b/api_docs/kbn_router_utils.devdocs.json @@ -0,0 +1,65 @@ +{ + "id": "@kbn/router-utils", + "client": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "server": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "common": { + "classes": [], + "functions": [ + { + "parentPluginId": "@kbn/router-utils", + "id": "def-common.getRouterLinkProps", + "type": "Function", + "tags": [], + "label": "getRouterLinkProps", + "description": [ + "\n\ngetRouterLinkProps is an util that enable HTML elements, such buttons, to\nbehave as links." + ], + "signature": [ + "({ href, onClick }: GetRouterLinkPropsDeps) => { href: string | undefined; onClick: (event: React.MouseEvent) => void; }" + ], + "path": "packages/kbn-router-utils/src/get_router_link_props/index.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/router-utils", + "id": "def-common.getRouterLinkProps.$1", + "type": "Object", + "tags": [], + "label": "{ href, onClick }", + "description": [], + "signature": [ + "GetRouterLinkPropsDeps" + ], + "path": "packages/kbn-router-utils/src/get_router_link_props/index.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [ + "An object that contains an href and a guardedClick handler that will\nmanage behaviours such as leftClickEvent and event with modifiers (Ctrl, Shift, etc)" + ], + "initialIsOpen": false + } + ], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + } +} \ No newline at end of file diff --git a/api_docs/kbn_router_utils.mdx b/api_docs/kbn_router_utils.mdx new file mode 100644 index 0000000000000..eca44a8cf7c24 --- /dev/null +++ b/api_docs/kbn_router_utils.mdx @@ -0,0 +1,30 @@ +--- +#### +#### This document is auto-generated and is meant to be viewed inside our experimental, new docs system. +#### Reach out in #docs-engineering for more info. +#### +id: kibKbnRouterUtilsPluginApi +slug: /kibana-dev-docs/api/kbn-router-utils +title: "@kbn/router-utils" +image: https://source.unsplash.com/400x175/?github +description: API docs for the @kbn/router-utils plugin +date: 2023-12-19 +tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/router-utils'] +--- +import kbnRouterUtilsObj from './kbn_router_utils.devdocs.json'; + + + +Contact [@elastic/obs-ux-logs-team](https://github.com/orgs/elastic/teams/obs-ux-logs-team) for questions regarding this plugin. + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 2 | 0 | 1 | 0 | + +## Common + +### Functions + + diff --git a/api_docs/kbn_rrule.mdx b/api_docs/kbn_rrule.mdx index 3180c43267a15..31ebc7aa11bdd 100644 --- a/api_docs/kbn_rrule.mdx +++ b/api_docs/kbn_rrule.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-rrule title: "@kbn/rrule" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/rrule plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/rrule'] --- import kbnRruleObj from './kbn_rrule.devdocs.json'; diff --git a/api_docs/kbn_rule_data_utils.mdx b/api_docs/kbn_rule_data_utils.mdx index cb60c7dd094c8..5bab0397cb28a 100644 --- a/api_docs/kbn_rule_data_utils.mdx +++ b/api_docs/kbn_rule_data_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-rule-data-utils title: "@kbn/rule-data-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/rule-data-utils plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/rule-data-utils'] --- import kbnRuleDataUtilsObj from './kbn_rule_data_utils.devdocs.json'; diff --git a/api_docs/kbn_saved_objects_settings.mdx b/api_docs/kbn_saved_objects_settings.mdx index 38f097fe924fd..d9b21510b3ab5 100644 --- a/api_docs/kbn_saved_objects_settings.mdx +++ b/api_docs/kbn_saved_objects_settings.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-saved-objects-settings title: "@kbn/saved-objects-settings" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/saved-objects-settings plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/saved-objects-settings'] --- import kbnSavedObjectsSettingsObj from './kbn_saved_objects_settings.devdocs.json'; diff --git a/api_docs/kbn_search_api_panels.mdx b/api_docs/kbn_search_api_panels.mdx index d41c0802256a5..7f271aac8b80e 100644 --- a/api_docs/kbn_search_api_panels.mdx +++ b/api_docs/kbn_search_api_panels.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-search-api-panels title: "@kbn/search-api-panels" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/search-api-panels plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/search-api-panels'] --- import kbnSearchApiPanelsObj from './kbn_search_api_panels.devdocs.json'; diff --git a/api_docs/kbn_search_connectors.mdx b/api_docs/kbn_search_connectors.mdx index 4233d24ba2e1b..0d004bcaccc8c 100644 --- a/api_docs/kbn_search_connectors.mdx +++ b/api_docs/kbn_search_connectors.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-search-connectors title: "@kbn/search-connectors" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/search-connectors plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/search-connectors'] --- import kbnSearchConnectorsObj from './kbn_search_connectors.devdocs.json'; diff --git a/api_docs/kbn_search_errors.mdx b/api_docs/kbn_search_errors.mdx index 2a3033823dc99..61fac6e4982b7 100644 --- a/api_docs/kbn_search_errors.mdx +++ b/api_docs/kbn_search_errors.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-search-errors title: "@kbn/search-errors" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/search-errors plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/search-errors'] --- import kbnSearchErrorsObj from './kbn_search_errors.devdocs.json'; diff --git a/api_docs/kbn_search_index_documents.mdx b/api_docs/kbn_search_index_documents.mdx index 51f9271840cdb..5a7c63aa4674e 100644 --- a/api_docs/kbn_search_index_documents.mdx +++ b/api_docs/kbn_search_index_documents.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-search-index-documents title: "@kbn/search-index-documents" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/search-index-documents plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/search-index-documents'] --- import kbnSearchIndexDocumentsObj from './kbn_search_index_documents.devdocs.json'; diff --git a/api_docs/kbn_search_response_warnings.mdx b/api_docs/kbn_search_response_warnings.mdx index e305b135925a1..340f50dfc6398 100644 --- a/api_docs/kbn_search_response_warnings.mdx +++ b/api_docs/kbn_search_response_warnings.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-search-response-warnings title: "@kbn/search-response-warnings" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/search-response-warnings plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/search-response-warnings'] --- import kbnSearchResponseWarningsObj from './kbn_search_response_warnings.devdocs.json'; diff --git a/api_docs/kbn_security_plugin_types_common.mdx b/api_docs/kbn_security_plugin_types_common.mdx index b104851d38d04..8bc2b68a4171d 100644 --- a/api_docs/kbn_security_plugin_types_common.mdx +++ b/api_docs/kbn_security_plugin_types_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-security-plugin-types-common title: "@kbn/security-plugin-types-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/security-plugin-types-common plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/security-plugin-types-common'] --- import kbnSecurityPluginTypesCommonObj from './kbn_security_plugin_types_common.devdocs.json'; diff --git a/api_docs/kbn_security_plugin_types_public.mdx b/api_docs/kbn_security_plugin_types_public.mdx index 565460d330f87..952aaa3d69a10 100644 --- a/api_docs/kbn_security_plugin_types_public.mdx +++ b/api_docs/kbn_security_plugin_types_public.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-security-plugin-types-public title: "@kbn/security-plugin-types-public" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/security-plugin-types-public plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/security-plugin-types-public'] --- import kbnSecurityPluginTypesPublicObj from './kbn_security_plugin_types_public.devdocs.json'; diff --git a/api_docs/kbn_security_plugin_types_server.mdx b/api_docs/kbn_security_plugin_types_server.mdx index 862232dddb45f..07507bdf6810f 100644 --- a/api_docs/kbn_security_plugin_types_server.mdx +++ b/api_docs/kbn_security_plugin_types_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-security-plugin-types-server title: "@kbn/security-plugin-types-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/security-plugin-types-server plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/security-plugin-types-server'] --- import kbnSecurityPluginTypesServerObj from './kbn_security_plugin_types_server.devdocs.json'; diff --git a/api_docs/kbn_security_solution_features.mdx b/api_docs/kbn_security_solution_features.mdx index f941c95b5492a..97bfe358dbfdb 100644 --- a/api_docs/kbn_security_solution_features.mdx +++ b/api_docs/kbn_security_solution_features.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-security-solution-features title: "@kbn/security-solution-features" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/security-solution-features plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/security-solution-features'] --- import kbnSecuritySolutionFeaturesObj from './kbn_security_solution_features.devdocs.json'; diff --git a/api_docs/kbn_security_solution_navigation.mdx b/api_docs/kbn_security_solution_navigation.mdx index f8e4514621e0d..2ea6cc41adc0a 100644 --- a/api_docs/kbn_security_solution_navigation.mdx +++ b/api_docs/kbn_security_solution_navigation.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-security-solution-navigation title: "@kbn/security-solution-navigation" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/security-solution-navigation plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/security-solution-navigation'] --- import kbnSecuritySolutionNavigationObj from './kbn_security_solution_navigation.devdocs.json'; diff --git a/api_docs/kbn_security_solution_side_nav.mdx b/api_docs/kbn_security_solution_side_nav.mdx index 8d88f8f766145..4c59b624135c1 100644 --- a/api_docs/kbn_security_solution_side_nav.mdx +++ b/api_docs/kbn_security_solution_side_nav.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-security-solution-side-nav title: "@kbn/security-solution-side-nav" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/security-solution-side-nav plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/security-solution-side-nav'] --- import kbnSecuritySolutionSideNavObj from './kbn_security_solution_side_nav.devdocs.json'; diff --git a/api_docs/kbn_security_solution_storybook_config.mdx b/api_docs/kbn_security_solution_storybook_config.mdx index 558a321b34c40..8a645d1ddbc8a 100644 --- a/api_docs/kbn_security_solution_storybook_config.mdx +++ b/api_docs/kbn_security_solution_storybook_config.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-security-solution-storybook-config title: "@kbn/security-solution-storybook-config" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/security-solution-storybook-config plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/security-solution-storybook-config'] --- import kbnSecuritySolutionStorybookConfigObj from './kbn_security_solution_storybook_config.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_autocomplete.mdx b/api_docs/kbn_securitysolution_autocomplete.mdx index f81cff1580b37..25a9b2bc1a650 100644 --- a/api_docs/kbn_securitysolution_autocomplete.mdx +++ b/api_docs/kbn_securitysolution_autocomplete.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-autocomplete title: "@kbn/securitysolution-autocomplete" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-autocomplete plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-autocomplete'] --- import kbnSecuritysolutionAutocompleteObj from './kbn_securitysolution_autocomplete.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_data_table.mdx b/api_docs/kbn_securitysolution_data_table.mdx index 0734c7895794a..727c6a574826d 100644 --- a/api_docs/kbn_securitysolution_data_table.mdx +++ b/api_docs/kbn_securitysolution_data_table.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-data-table title: "@kbn/securitysolution-data-table" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-data-table plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-data-table'] --- import kbnSecuritysolutionDataTableObj from './kbn_securitysolution_data_table.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_ecs.mdx b/api_docs/kbn_securitysolution_ecs.mdx index 1ddaf187b9405..f4a567a70eaff 100644 --- a/api_docs/kbn_securitysolution_ecs.mdx +++ b/api_docs/kbn_securitysolution_ecs.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-ecs title: "@kbn/securitysolution-ecs" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-ecs plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-ecs'] --- import kbnSecuritysolutionEcsObj from './kbn_securitysolution_ecs.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_es_utils.mdx b/api_docs/kbn_securitysolution_es_utils.mdx index 232cabc415b3e..4286c5b9c9648 100644 --- a/api_docs/kbn_securitysolution_es_utils.mdx +++ b/api_docs/kbn_securitysolution_es_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-es-utils title: "@kbn/securitysolution-es-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-es-utils plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-es-utils'] --- import kbnSecuritysolutionEsUtilsObj from './kbn_securitysolution_es_utils.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_exception_list_components.mdx b/api_docs/kbn_securitysolution_exception_list_components.mdx index f4ce5b2c33425..ddb253c6004f5 100644 --- a/api_docs/kbn_securitysolution_exception_list_components.mdx +++ b/api_docs/kbn_securitysolution_exception_list_components.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-exception-list-components title: "@kbn/securitysolution-exception-list-components" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-exception-list-components plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-exception-list-components'] --- import kbnSecuritysolutionExceptionListComponentsObj from './kbn_securitysolution_exception_list_components.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_grouping.mdx b/api_docs/kbn_securitysolution_grouping.mdx index b34092f1299da..f224c136aa720 100644 --- a/api_docs/kbn_securitysolution_grouping.mdx +++ b/api_docs/kbn_securitysolution_grouping.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-grouping title: "@kbn/securitysolution-grouping" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-grouping plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-grouping'] --- import kbnSecuritysolutionGroupingObj from './kbn_securitysolution_grouping.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_hook_utils.mdx b/api_docs/kbn_securitysolution_hook_utils.mdx index 2d709d970aab7..919cda06b8288 100644 --- a/api_docs/kbn_securitysolution_hook_utils.mdx +++ b/api_docs/kbn_securitysolution_hook_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-hook-utils title: "@kbn/securitysolution-hook-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-hook-utils plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-hook-utils'] --- import kbnSecuritysolutionHookUtilsObj from './kbn_securitysolution_hook_utils.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_io_ts_alerting_types.mdx b/api_docs/kbn_securitysolution_io_ts_alerting_types.mdx index 794f6994a43d9..be01eefef4e58 100644 --- a/api_docs/kbn_securitysolution_io_ts_alerting_types.mdx +++ b/api_docs/kbn_securitysolution_io_ts_alerting_types.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-io-ts-alerting-types title: "@kbn/securitysolution-io-ts-alerting-types" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-io-ts-alerting-types plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-io-ts-alerting-types'] --- import kbnSecuritysolutionIoTsAlertingTypesObj from './kbn_securitysolution_io_ts_alerting_types.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_io_ts_list_types.mdx b/api_docs/kbn_securitysolution_io_ts_list_types.mdx index 47e4d3d1698f7..e093e781ea1db 100644 --- a/api_docs/kbn_securitysolution_io_ts_list_types.mdx +++ b/api_docs/kbn_securitysolution_io_ts_list_types.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-io-ts-list-types title: "@kbn/securitysolution-io-ts-list-types" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-io-ts-list-types plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-io-ts-list-types'] --- import kbnSecuritysolutionIoTsListTypesObj from './kbn_securitysolution_io_ts_list_types.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_io_ts_types.mdx b/api_docs/kbn_securitysolution_io_ts_types.mdx index 5eeea34474fac..c86fc8aeae166 100644 --- a/api_docs/kbn_securitysolution_io_ts_types.mdx +++ b/api_docs/kbn_securitysolution_io_ts_types.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-io-ts-types title: "@kbn/securitysolution-io-ts-types" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-io-ts-types plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-io-ts-types'] --- import kbnSecuritysolutionIoTsTypesObj from './kbn_securitysolution_io_ts_types.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_io_ts_utils.mdx b/api_docs/kbn_securitysolution_io_ts_utils.mdx index 16b9039f15918..4add9df89302b 100644 --- a/api_docs/kbn_securitysolution_io_ts_utils.mdx +++ b/api_docs/kbn_securitysolution_io_ts_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-io-ts-utils title: "@kbn/securitysolution-io-ts-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-io-ts-utils plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-io-ts-utils'] --- import kbnSecuritysolutionIoTsUtilsObj from './kbn_securitysolution_io_ts_utils.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_list_api.mdx b/api_docs/kbn_securitysolution_list_api.mdx index e629a0f6eba7a..ca1fda2120a4b 100644 --- a/api_docs/kbn_securitysolution_list_api.mdx +++ b/api_docs/kbn_securitysolution_list_api.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-list-api title: "@kbn/securitysolution-list-api" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-list-api plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-list-api'] --- import kbnSecuritysolutionListApiObj from './kbn_securitysolution_list_api.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_list_constants.mdx b/api_docs/kbn_securitysolution_list_constants.mdx index 80b230c8d46e3..2ac4d1be857ed 100644 --- a/api_docs/kbn_securitysolution_list_constants.mdx +++ b/api_docs/kbn_securitysolution_list_constants.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-list-constants title: "@kbn/securitysolution-list-constants" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-list-constants plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-list-constants'] --- import kbnSecuritysolutionListConstantsObj from './kbn_securitysolution_list_constants.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_list_hooks.mdx b/api_docs/kbn_securitysolution_list_hooks.mdx index 152a29347baf4..4042efdb33501 100644 --- a/api_docs/kbn_securitysolution_list_hooks.mdx +++ b/api_docs/kbn_securitysolution_list_hooks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-list-hooks title: "@kbn/securitysolution-list-hooks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-list-hooks plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-list-hooks'] --- import kbnSecuritysolutionListHooksObj from './kbn_securitysolution_list_hooks.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_list_utils.mdx b/api_docs/kbn_securitysolution_list_utils.mdx index ce858771df565..f2da8062625f4 100644 --- a/api_docs/kbn_securitysolution_list_utils.mdx +++ b/api_docs/kbn_securitysolution_list_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-list-utils title: "@kbn/securitysolution-list-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-list-utils plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-list-utils'] --- import kbnSecuritysolutionListUtilsObj from './kbn_securitysolution_list_utils.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_rules.mdx b/api_docs/kbn_securitysolution_rules.mdx index 886d2450e6e87..f5e0ead135f7d 100644 --- a/api_docs/kbn_securitysolution_rules.mdx +++ b/api_docs/kbn_securitysolution_rules.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-rules title: "@kbn/securitysolution-rules" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-rules plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-rules'] --- import kbnSecuritysolutionRulesObj from './kbn_securitysolution_rules.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_t_grid.mdx b/api_docs/kbn_securitysolution_t_grid.mdx index 9a1683a04c3fe..c14208f53c527 100644 --- a/api_docs/kbn_securitysolution_t_grid.mdx +++ b/api_docs/kbn_securitysolution_t_grid.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-t-grid title: "@kbn/securitysolution-t-grid" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-t-grid plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-t-grid'] --- import kbnSecuritysolutionTGridObj from './kbn_securitysolution_t_grid.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_utils.mdx b/api_docs/kbn_securitysolution_utils.mdx index b46bd21aa7cbc..e2639d9d07fe7 100644 --- a/api_docs/kbn_securitysolution_utils.mdx +++ b/api_docs/kbn_securitysolution_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-utils title: "@kbn/securitysolution-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-utils plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-utils'] --- import kbnSecuritysolutionUtilsObj from './kbn_securitysolution_utils.devdocs.json'; diff --git a/api_docs/kbn_server_http_tools.mdx b/api_docs/kbn_server_http_tools.mdx index a73d0f0c940f9..45e895447d131 100644 --- a/api_docs/kbn_server_http_tools.mdx +++ b/api_docs/kbn_server_http_tools.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-server-http-tools title: "@kbn/server-http-tools" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/server-http-tools plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/server-http-tools'] --- import kbnServerHttpToolsObj from './kbn_server_http_tools.devdocs.json'; diff --git a/api_docs/kbn_server_route_repository.mdx b/api_docs/kbn_server_route_repository.mdx index 64b0c05e696e2..1f075b5381dde 100644 --- a/api_docs/kbn_server_route_repository.mdx +++ b/api_docs/kbn_server_route_repository.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-server-route-repository title: "@kbn/server-route-repository" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/server-route-repository plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/server-route-repository'] --- import kbnServerRouteRepositoryObj from './kbn_server_route_repository.devdocs.json'; diff --git a/api_docs/kbn_serverless_common_settings.mdx b/api_docs/kbn_serverless_common_settings.mdx index c0ed52337a806..df8244ef20d0e 100644 --- a/api_docs/kbn_serverless_common_settings.mdx +++ b/api_docs/kbn_serverless_common_settings.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-serverless-common-settings title: "@kbn/serverless-common-settings" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/serverless-common-settings plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/serverless-common-settings'] --- import kbnServerlessCommonSettingsObj from './kbn_serverless_common_settings.devdocs.json'; diff --git a/api_docs/kbn_serverless_observability_settings.mdx b/api_docs/kbn_serverless_observability_settings.mdx index 826f6bbd13786..203ac911d7a14 100644 --- a/api_docs/kbn_serverless_observability_settings.mdx +++ b/api_docs/kbn_serverless_observability_settings.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-serverless-observability-settings title: "@kbn/serverless-observability-settings" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/serverless-observability-settings plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/serverless-observability-settings'] --- import kbnServerlessObservabilitySettingsObj from './kbn_serverless_observability_settings.devdocs.json'; diff --git a/api_docs/kbn_serverless_project_switcher.mdx b/api_docs/kbn_serverless_project_switcher.mdx index c18a6016926af..a2d578fdfee3f 100644 --- a/api_docs/kbn_serverless_project_switcher.mdx +++ b/api_docs/kbn_serverless_project_switcher.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-serverless-project-switcher title: "@kbn/serverless-project-switcher" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/serverless-project-switcher plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/serverless-project-switcher'] --- import kbnServerlessProjectSwitcherObj from './kbn_serverless_project_switcher.devdocs.json'; diff --git a/api_docs/kbn_serverless_search_settings.mdx b/api_docs/kbn_serverless_search_settings.mdx index 8e71bae2f10c4..20f521277536d 100644 --- a/api_docs/kbn_serverless_search_settings.mdx +++ b/api_docs/kbn_serverless_search_settings.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-serverless-search-settings title: "@kbn/serverless-search-settings" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/serverless-search-settings plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/serverless-search-settings'] --- import kbnServerlessSearchSettingsObj from './kbn_serverless_search_settings.devdocs.json'; diff --git a/api_docs/kbn_serverless_security_settings.mdx b/api_docs/kbn_serverless_security_settings.mdx index 713af7177d262..0ad3c61e9debc 100644 --- a/api_docs/kbn_serverless_security_settings.mdx +++ b/api_docs/kbn_serverless_security_settings.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-serverless-security-settings title: "@kbn/serverless-security-settings" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/serverless-security-settings plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/serverless-security-settings'] --- import kbnServerlessSecuritySettingsObj from './kbn_serverless_security_settings.devdocs.json'; diff --git a/api_docs/kbn_serverless_storybook_config.mdx b/api_docs/kbn_serverless_storybook_config.mdx index 8a06726da63a5..1e658ebe23f4d 100644 --- a/api_docs/kbn_serverless_storybook_config.mdx +++ b/api_docs/kbn_serverless_storybook_config.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-serverless-storybook-config title: "@kbn/serverless-storybook-config" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/serverless-storybook-config plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/serverless-storybook-config'] --- import kbnServerlessStorybookConfigObj from './kbn_serverless_storybook_config.devdocs.json'; diff --git a/api_docs/kbn_shared_svg.mdx b/api_docs/kbn_shared_svg.mdx index 33d60f338abfa..f912adcc82687 100644 --- a/api_docs/kbn_shared_svg.mdx +++ b/api_docs/kbn_shared_svg.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-svg title: "@kbn/shared-svg" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-svg plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-svg'] --- import kbnSharedSvgObj from './kbn_shared_svg.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_avatar_solution.mdx b/api_docs/kbn_shared_ux_avatar_solution.mdx index 9d37c94515baa..e6d9946bf8510 100644 --- a/api_docs/kbn_shared_ux_avatar_solution.mdx +++ b/api_docs/kbn_shared_ux_avatar_solution.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-avatar-solution title: "@kbn/shared-ux-avatar-solution" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-avatar-solution plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-avatar-solution'] --- import kbnSharedUxAvatarSolutionObj from './kbn_shared_ux_avatar_solution.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_button_exit_full_screen.mdx b/api_docs/kbn_shared_ux_button_exit_full_screen.mdx index 6796d67826dbf..9cbfbb081b215 100644 --- a/api_docs/kbn_shared_ux_button_exit_full_screen.mdx +++ b/api_docs/kbn_shared_ux_button_exit_full_screen.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-button-exit-full-screen title: "@kbn/shared-ux-button-exit-full-screen" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-button-exit-full-screen plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-button-exit-full-screen'] --- import kbnSharedUxButtonExitFullScreenObj from './kbn_shared_ux_button_exit_full_screen.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_button_toolbar.mdx b/api_docs/kbn_shared_ux_button_toolbar.mdx index 3cfcbfe1cf56b..95271bebf4dbe 100644 --- a/api_docs/kbn_shared_ux_button_toolbar.mdx +++ b/api_docs/kbn_shared_ux_button_toolbar.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-button-toolbar title: "@kbn/shared-ux-button-toolbar" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-button-toolbar plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-button-toolbar'] --- import kbnSharedUxButtonToolbarObj from './kbn_shared_ux_button_toolbar.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_card_no_data.mdx b/api_docs/kbn_shared_ux_card_no_data.mdx index 7b82f8bf7a12f..676eba9a4c1a2 100644 --- a/api_docs/kbn_shared_ux_card_no_data.mdx +++ b/api_docs/kbn_shared_ux_card_no_data.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-card-no-data title: "@kbn/shared-ux-card-no-data" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-card-no-data plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-card-no-data'] --- import kbnSharedUxCardNoDataObj from './kbn_shared_ux_card_no_data.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_card_no_data_mocks.mdx b/api_docs/kbn_shared_ux_card_no_data_mocks.mdx index 73d5bd9822f40..daee8fd0085bf 100644 --- a/api_docs/kbn_shared_ux_card_no_data_mocks.mdx +++ b/api_docs/kbn_shared_ux_card_no_data_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-card-no-data-mocks title: "@kbn/shared-ux-card-no-data-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-card-no-data-mocks plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-card-no-data-mocks'] --- import kbnSharedUxCardNoDataMocksObj from './kbn_shared_ux_card_no_data_mocks.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_chrome_navigation.mdx b/api_docs/kbn_shared_ux_chrome_navigation.mdx index 13b0593b32f7f..7cdc585433437 100644 --- a/api_docs/kbn_shared_ux_chrome_navigation.mdx +++ b/api_docs/kbn_shared_ux_chrome_navigation.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-chrome-navigation title: "@kbn/shared-ux-chrome-navigation" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-chrome-navigation plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-chrome-navigation'] --- import kbnSharedUxChromeNavigationObj from './kbn_shared_ux_chrome_navigation.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_error_boundary.mdx b/api_docs/kbn_shared_ux_error_boundary.mdx index 770188c461e6b..84f922380955d 100644 --- a/api_docs/kbn_shared_ux_error_boundary.mdx +++ b/api_docs/kbn_shared_ux_error_boundary.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-error-boundary title: "@kbn/shared-ux-error-boundary" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-error-boundary plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-error-boundary'] --- import kbnSharedUxErrorBoundaryObj from './kbn_shared_ux_error_boundary.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_file_context.mdx b/api_docs/kbn_shared_ux_file_context.mdx index b6f213e2b889d..483783a2e113b 100644 --- a/api_docs/kbn_shared_ux_file_context.mdx +++ b/api_docs/kbn_shared_ux_file_context.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-file-context title: "@kbn/shared-ux-file-context" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-file-context plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-file-context'] --- import kbnSharedUxFileContextObj from './kbn_shared_ux_file_context.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_file_image.mdx b/api_docs/kbn_shared_ux_file_image.mdx index 62d8c13116cf4..773af38ee6262 100644 --- a/api_docs/kbn_shared_ux_file_image.mdx +++ b/api_docs/kbn_shared_ux_file_image.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-file-image title: "@kbn/shared-ux-file-image" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-file-image plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-file-image'] --- import kbnSharedUxFileImageObj from './kbn_shared_ux_file_image.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_file_image_mocks.mdx b/api_docs/kbn_shared_ux_file_image_mocks.mdx index 20a8cd1a7304d..e1f1d760777a7 100644 --- a/api_docs/kbn_shared_ux_file_image_mocks.mdx +++ b/api_docs/kbn_shared_ux_file_image_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-file-image-mocks title: "@kbn/shared-ux-file-image-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-file-image-mocks plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-file-image-mocks'] --- import kbnSharedUxFileImageMocksObj from './kbn_shared_ux_file_image_mocks.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_file_mocks.mdx b/api_docs/kbn_shared_ux_file_mocks.mdx index dda277828c555..fd53ddb6ee586 100644 --- a/api_docs/kbn_shared_ux_file_mocks.mdx +++ b/api_docs/kbn_shared_ux_file_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-file-mocks title: "@kbn/shared-ux-file-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-file-mocks plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-file-mocks'] --- import kbnSharedUxFileMocksObj from './kbn_shared_ux_file_mocks.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_file_picker.mdx b/api_docs/kbn_shared_ux_file_picker.mdx index 16303365d02de..41a1d82d91cdf 100644 --- a/api_docs/kbn_shared_ux_file_picker.mdx +++ b/api_docs/kbn_shared_ux_file_picker.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-file-picker title: "@kbn/shared-ux-file-picker" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-file-picker plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-file-picker'] --- import kbnSharedUxFilePickerObj from './kbn_shared_ux_file_picker.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_file_types.mdx b/api_docs/kbn_shared_ux_file_types.mdx index 4971654e8995c..aafebe07b6276 100644 --- a/api_docs/kbn_shared_ux_file_types.mdx +++ b/api_docs/kbn_shared_ux_file_types.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-file-types title: "@kbn/shared-ux-file-types" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-file-types plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-file-types'] --- import kbnSharedUxFileTypesObj from './kbn_shared_ux_file_types.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_file_upload.mdx b/api_docs/kbn_shared_ux_file_upload.mdx index 5a42c087ad818..6ae2f940ee5f5 100644 --- a/api_docs/kbn_shared_ux_file_upload.mdx +++ b/api_docs/kbn_shared_ux_file_upload.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-file-upload title: "@kbn/shared-ux-file-upload" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-file-upload plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-file-upload'] --- import kbnSharedUxFileUploadObj from './kbn_shared_ux_file_upload.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_file_util.mdx b/api_docs/kbn_shared_ux_file_util.mdx index 5d839db1ae2d3..83a3bc810a812 100644 --- a/api_docs/kbn_shared_ux_file_util.mdx +++ b/api_docs/kbn_shared_ux_file_util.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-file-util title: "@kbn/shared-ux-file-util" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-file-util plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-file-util'] --- import kbnSharedUxFileUtilObj from './kbn_shared_ux_file_util.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_link_redirect_app.mdx b/api_docs/kbn_shared_ux_link_redirect_app.mdx index 851638927b347..bda7c61a55595 100644 --- a/api_docs/kbn_shared_ux_link_redirect_app.mdx +++ b/api_docs/kbn_shared_ux_link_redirect_app.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-link-redirect-app title: "@kbn/shared-ux-link-redirect-app" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-link-redirect-app plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-link-redirect-app'] --- import kbnSharedUxLinkRedirectAppObj from './kbn_shared_ux_link_redirect_app.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_link_redirect_app_mocks.mdx b/api_docs/kbn_shared_ux_link_redirect_app_mocks.mdx index 1531e216ee8f0..f064dc1ce8c32 100644 --- a/api_docs/kbn_shared_ux_link_redirect_app_mocks.mdx +++ b/api_docs/kbn_shared_ux_link_redirect_app_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-link-redirect-app-mocks title: "@kbn/shared-ux-link-redirect-app-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-link-redirect-app-mocks plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-link-redirect-app-mocks'] --- import kbnSharedUxLinkRedirectAppMocksObj from './kbn_shared_ux_link_redirect_app_mocks.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_markdown.mdx b/api_docs/kbn_shared_ux_markdown.mdx index 056c8cfc8fe4b..813606d7fe4f6 100644 --- a/api_docs/kbn_shared_ux_markdown.mdx +++ b/api_docs/kbn_shared_ux_markdown.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-markdown title: "@kbn/shared-ux-markdown" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-markdown plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-markdown'] --- import kbnSharedUxMarkdownObj from './kbn_shared_ux_markdown.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_markdown_mocks.mdx b/api_docs/kbn_shared_ux_markdown_mocks.mdx index cd973e58175c4..35d32a35715e4 100644 --- a/api_docs/kbn_shared_ux_markdown_mocks.mdx +++ b/api_docs/kbn_shared_ux_markdown_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-markdown-mocks title: "@kbn/shared-ux-markdown-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-markdown-mocks plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-markdown-mocks'] --- import kbnSharedUxMarkdownMocksObj from './kbn_shared_ux_markdown_mocks.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_page_analytics_no_data.mdx b/api_docs/kbn_shared_ux_page_analytics_no_data.mdx index d28204f8e0ef1..334d5dedf331a 100644 --- a/api_docs/kbn_shared_ux_page_analytics_no_data.mdx +++ b/api_docs/kbn_shared_ux_page_analytics_no_data.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-page-analytics-no-data title: "@kbn/shared-ux-page-analytics-no-data" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-page-analytics-no-data plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-page-analytics-no-data'] --- import kbnSharedUxPageAnalyticsNoDataObj from './kbn_shared_ux_page_analytics_no_data.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_page_analytics_no_data_mocks.mdx b/api_docs/kbn_shared_ux_page_analytics_no_data_mocks.mdx index bf1d71aac2182..0f39ba0a6983a 100644 --- a/api_docs/kbn_shared_ux_page_analytics_no_data_mocks.mdx +++ b/api_docs/kbn_shared_ux_page_analytics_no_data_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-page-analytics-no-data-mocks title: "@kbn/shared-ux-page-analytics-no-data-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-page-analytics-no-data-mocks plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-page-analytics-no-data-mocks'] --- import kbnSharedUxPageAnalyticsNoDataMocksObj from './kbn_shared_ux_page_analytics_no_data_mocks.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_page_kibana_no_data.mdx b/api_docs/kbn_shared_ux_page_kibana_no_data.mdx index 76f5d2e4a7b83..9de368c36a62a 100644 --- a/api_docs/kbn_shared_ux_page_kibana_no_data.mdx +++ b/api_docs/kbn_shared_ux_page_kibana_no_data.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-page-kibana-no-data title: "@kbn/shared-ux-page-kibana-no-data" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-page-kibana-no-data plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-page-kibana-no-data'] --- import kbnSharedUxPageKibanaNoDataObj from './kbn_shared_ux_page_kibana_no_data.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_page_kibana_no_data_mocks.mdx b/api_docs/kbn_shared_ux_page_kibana_no_data_mocks.mdx index c96a252daac27..565e950e72b94 100644 --- a/api_docs/kbn_shared_ux_page_kibana_no_data_mocks.mdx +++ b/api_docs/kbn_shared_ux_page_kibana_no_data_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-page-kibana-no-data-mocks title: "@kbn/shared-ux-page-kibana-no-data-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-page-kibana-no-data-mocks plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-page-kibana-no-data-mocks'] --- import kbnSharedUxPageKibanaNoDataMocksObj from './kbn_shared_ux_page_kibana_no_data_mocks.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_page_kibana_template.mdx b/api_docs/kbn_shared_ux_page_kibana_template.mdx index d6942b6e883e7..5627b206928e1 100644 --- a/api_docs/kbn_shared_ux_page_kibana_template.mdx +++ b/api_docs/kbn_shared_ux_page_kibana_template.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-page-kibana-template title: "@kbn/shared-ux-page-kibana-template" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-page-kibana-template plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-page-kibana-template'] --- import kbnSharedUxPageKibanaTemplateObj from './kbn_shared_ux_page_kibana_template.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_page_kibana_template_mocks.mdx b/api_docs/kbn_shared_ux_page_kibana_template_mocks.mdx index 06b8260282c9c..c1362a374b242 100644 --- a/api_docs/kbn_shared_ux_page_kibana_template_mocks.mdx +++ b/api_docs/kbn_shared_ux_page_kibana_template_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-page-kibana-template-mocks title: "@kbn/shared-ux-page-kibana-template-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-page-kibana-template-mocks plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-page-kibana-template-mocks'] --- import kbnSharedUxPageKibanaTemplateMocksObj from './kbn_shared_ux_page_kibana_template_mocks.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_page_no_data.mdx b/api_docs/kbn_shared_ux_page_no_data.mdx index d8fb3c8e668fc..decb3cdf50bd0 100644 --- a/api_docs/kbn_shared_ux_page_no_data.mdx +++ b/api_docs/kbn_shared_ux_page_no_data.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-page-no-data title: "@kbn/shared-ux-page-no-data" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-page-no-data plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-page-no-data'] --- import kbnSharedUxPageNoDataObj from './kbn_shared_ux_page_no_data.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_page_no_data_config.mdx b/api_docs/kbn_shared_ux_page_no_data_config.mdx index d5811ca35d963..a76c44a23608f 100644 --- a/api_docs/kbn_shared_ux_page_no_data_config.mdx +++ b/api_docs/kbn_shared_ux_page_no_data_config.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-page-no-data-config title: "@kbn/shared-ux-page-no-data-config" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-page-no-data-config plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-page-no-data-config'] --- import kbnSharedUxPageNoDataConfigObj from './kbn_shared_ux_page_no_data_config.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_page_no_data_config_mocks.mdx b/api_docs/kbn_shared_ux_page_no_data_config_mocks.mdx index ec1df21af75ff..cc8e13ea7d642 100644 --- a/api_docs/kbn_shared_ux_page_no_data_config_mocks.mdx +++ b/api_docs/kbn_shared_ux_page_no_data_config_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-page-no-data-config-mocks title: "@kbn/shared-ux-page-no-data-config-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-page-no-data-config-mocks plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-page-no-data-config-mocks'] --- import kbnSharedUxPageNoDataConfigMocksObj from './kbn_shared_ux_page_no_data_config_mocks.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_page_no_data_mocks.mdx b/api_docs/kbn_shared_ux_page_no_data_mocks.mdx index 4c1ae63ef23d6..6e16f063ba754 100644 --- a/api_docs/kbn_shared_ux_page_no_data_mocks.mdx +++ b/api_docs/kbn_shared_ux_page_no_data_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-page-no-data-mocks title: "@kbn/shared-ux-page-no-data-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-page-no-data-mocks plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-page-no-data-mocks'] --- import kbnSharedUxPageNoDataMocksObj from './kbn_shared_ux_page_no_data_mocks.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_page_solution_nav.mdx b/api_docs/kbn_shared_ux_page_solution_nav.mdx index 1d60efdc319e1..e6e0947624f0b 100644 --- a/api_docs/kbn_shared_ux_page_solution_nav.mdx +++ b/api_docs/kbn_shared_ux_page_solution_nav.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-page-solution-nav title: "@kbn/shared-ux-page-solution-nav" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-page-solution-nav plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-page-solution-nav'] --- import kbnSharedUxPageSolutionNavObj from './kbn_shared_ux_page_solution_nav.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_prompt_no_data_views.mdx b/api_docs/kbn_shared_ux_prompt_no_data_views.mdx index d53224c0c6dd6..ab02252e8d617 100644 --- a/api_docs/kbn_shared_ux_prompt_no_data_views.mdx +++ b/api_docs/kbn_shared_ux_prompt_no_data_views.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-prompt-no-data-views title: "@kbn/shared-ux-prompt-no-data-views" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-prompt-no-data-views plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-prompt-no-data-views'] --- import kbnSharedUxPromptNoDataViewsObj from './kbn_shared_ux_prompt_no_data_views.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_prompt_no_data_views_mocks.mdx b/api_docs/kbn_shared_ux_prompt_no_data_views_mocks.mdx index 2ebfc1cab9d65..bb5321661e411 100644 --- a/api_docs/kbn_shared_ux_prompt_no_data_views_mocks.mdx +++ b/api_docs/kbn_shared_ux_prompt_no_data_views_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-prompt-no-data-views-mocks title: "@kbn/shared-ux-prompt-no-data-views-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-prompt-no-data-views-mocks plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-prompt-no-data-views-mocks'] --- import kbnSharedUxPromptNoDataViewsMocksObj from './kbn_shared_ux_prompt_no_data_views_mocks.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_prompt_not_found.mdx b/api_docs/kbn_shared_ux_prompt_not_found.mdx index 1d3d99307f263..f3eccad586b37 100644 --- a/api_docs/kbn_shared_ux_prompt_not_found.mdx +++ b/api_docs/kbn_shared_ux_prompt_not_found.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-prompt-not-found title: "@kbn/shared-ux-prompt-not-found" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-prompt-not-found plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-prompt-not-found'] --- import kbnSharedUxPromptNotFoundObj from './kbn_shared_ux_prompt_not_found.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_router.mdx b/api_docs/kbn_shared_ux_router.mdx index 0a0fbb25be8c2..bce53eb890e0c 100644 --- a/api_docs/kbn_shared_ux_router.mdx +++ b/api_docs/kbn_shared_ux_router.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-router title: "@kbn/shared-ux-router" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-router plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-router'] --- import kbnSharedUxRouterObj from './kbn_shared_ux_router.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_router_mocks.mdx b/api_docs/kbn_shared_ux_router_mocks.mdx index 3318844c77741..2e6de026b19f5 100644 --- a/api_docs/kbn_shared_ux_router_mocks.mdx +++ b/api_docs/kbn_shared_ux_router_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-router-mocks title: "@kbn/shared-ux-router-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-router-mocks plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-router-mocks'] --- import kbnSharedUxRouterMocksObj from './kbn_shared_ux_router_mocks.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_storybook_config.mdx b/api_docs/kbn_shared_ux_storybook_config.mdx index 16d54f2874c78..061d2ddb1ea0f 100644 --- a/api_docs/kbn_shared_ux_storybook_config.mdx +++ b/api_docs/kbn_shared_ux_storybook_config.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-storybook-config title: "@kbn/shared-ux-storybook-config" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-storybook-config plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-storybook-config'] --- import kbnSharedUxStorybookConfigObj from './kbn_shared_ux_storybook_config.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_storybook_mock.mdx b/api_docs/kbn_shared_ux_storybook_mock.mdx index 22d6951ee70df..517f964e39f11 100644 --- a/api_docs/kbn_shared_ux_storybook_mock.mdx +++ b/api_docs/kbn_shared_ux_storybook_mock.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-storybook-mock title: "@kbn/shared-ux-storybook-mock" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-storybook-mock plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-storybook-mock'] --- import kbnSharedUxStorybookMockObj from './kbn_shared_ux_storybook_mock.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_utility.mdx b/api_docs/kbn_shared_ux_utility.mdx index 5e8b55c98b511..fdf6ec6e67325 100644 --- a/api_docs/kbn_shared_ux_utility.mdx +++ b/api_docs/kbn_shared_ux_utility.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-utility title: "@kbn/shared-ux-utility" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-utility plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-utility'] --- import kbnSharedUxUtilityObj from './kbn_shared_ux_utility.devdocs.json'; diff --git a/api_docs/kbn_slo_schema.mdx b/api_docs/kbn_slo_schema.mdx index 2a4c1f6a65b60..11eed96017eea 100644 --- a/api_docs/kbn_slo_schema.mdx +++ b/api_docs/kbn_slo_schema.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-slo-schema title: "@kbn/slo-schema" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/slo-schema plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/slo-schema'] --- import kbnSloSchemaObj from './kbn_slo_schema.devdocs.json'; diff --git a/api_docs/kbn_some_dev_log.mdx b/api_docs/kbn_some_dev_log.mdx index 4091ee447146e..3d2f76883bdaa 100644 --- a/api_docs/kbn_some_dev_log.mdx +++ b/api_docs/kbn_some_dev_log.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-some-dev-log title: "@kbn/some-dev-log" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/some-dev-log plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/some-dev-log'] --- import kbnSomeDevLogObj from './kbn_some_dev_log.devdocs.json'; diff --git a/api_docs/kbn_std.mdx b/api_docs/kbn_std.mdx index cbfc7c80261a0..98af8c79666c6 100644 --- a/api_docs/kbn_std.mdx +++ b/api_docs/kbn_std.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-std title: "@kbn/std" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/std plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/std'] --- import kbnStdObj from './kbn_std.devdocs.json'; diff --git a/api_docs/kbn_stdio_dev_helpers.mdx b/api_docs/kbn_stdio_dev_helpers.mdx index effc39ee2bb8b..057088a6a4f06 100644 --- a/api_docs/kbn_stdio_dev_helpers.mdx +++ b/api_docs/kbn_stdio_dev_helpers.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-stdio-dev-helpers title: "@kbn/stdio-dev-helpers" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/stdio-dev-helpers plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/stdio-dev-helpers'] --- import kbnStdioDevHelpersObj from './kbn_stdio_dev_helpers.devdocs.json'; diff --git a/api_docs/kbn_storybook.mdx b/api_docs/kbn_storybook.mdx index 7182df0229b50..b4aea70a83c47 100644 --- a/api_docs/kbn_storybook.mdx +++ b/api_docs/kbn_storybook.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-storybook title: "@kbn/storybook" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/storybook plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/storybook'] --- import kbnStorybookObj from './kbn_storybook.devdocs.json'; diff --git a/api_docs/kbn_telemetry_tools.mdx b/api_docs/kbn_telemetry_tools.mdx index fc6aae98b33a9..8f05560bbf3f4 100644 --- a/api_docs/kbn_telemetry_tools.mdx +++ b/api_docs/kbn_telemetry_tools.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-telemetry-tools title: "@kbn/telemetry-tools" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/telemetry-tools plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/telemetry-tools'] --- import kbnTelemetryToolsObj from './kbn_telemetry_tools.devdocs.json'; diff --git a/api_docs/kbn_test.devdocs.json b/api_docs/kbn_test.devdocs.json index a5c463ee362ec..5b01c5762fe46 100644 --- a/api_docs/kbn_test.devdocs.json +++ b/api_docs/kbn_test.devdocs.json @@ -2548,6 +2548,23 @@ "returnComment": [], "initialIsOpen": false }, + { + "parentPluginId": "@kbn/test", + "id": "def-common.runCheckFtrCodeOwnersCli", + "type": "Function", + "tags": [], + "label": "runCheckFtrCodeOwnersCli", + "description": [], + "signature": [ + "() => Promise" + ], + "path": "packages/kbn-test/src/functional_test_runner/run_check_ftr_code_owners.ts", + "deprecated": false, + "trackAdoption": false, + "children": [], + "returnComment": [], + "initialIsOpen": false + }, { "parentPluginId": "@kbn/test", "id": "def-common.runCheckFtrConfigsCli", diff --git a/api_docs/kbn_test.mdx b/api_docs/kbn_test.mdx index 9333f4c683f64..448022835f596 100644 --- a/api_docs/kbn_test.mdx +++ b/api_docs/kbn_test.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-test title: "@kbn/test" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/test plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/test'] --- import kbnTestObj from './kbn_test.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/kibana-operations](https://github.com/orgs/elastic/teams/kiban | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 310 | 4 | 262 | 12 | +| 311 | 4 | 263 | 12 | ## Common diff --git a/api_docs/kbn_test_jest_helpers.mdx b/api_docs/kbn_test_jest_helpers.mdx index e7c4f9bf8301f..4e160b6370f4a 100644 --- a/api_docs/kbn_test_jest_helpers.mdx +++ b/api_docs/kbn_test_jest_helpers.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-test-jest-helpers title: "@kbn/test-jest-helpers" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/test-jest-helpers plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/test-jest-helpers'] --- import kbnTestJestHelpersObj from './kbn_test_jest_helpers.devdocs.json'; diff --git a/api_docs/kbn_test_subj_selector.mdx b/api_docs/kbn_test_subj_selector.mdx index 46748c575ba1b..ce2174dc13b0a 100644 --- a/api_docs/kbn_test_subj_selector.mdx +++ b/api_docs/kbn_test_subj_selector.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-test-subj-selector title: "@kbn/test-subj-selector" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/test-subj-selector plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/test-subj-selector'] --- import kbnTestSubjSelectorObj from './kbn_test_subj_selector.devdocs.json'; diff --git a/api_docs/kbn_text_based_editor.mdx b/api_docs/kbn_text_based_editor.mdx index 63832380c8aff..8ddb863af8150 100644 --- a/api_docs/kbn_text_based_editor.mdx +++ b/api_docs/kbn_text_based_editor.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-text-based-editor title: "@kbn/text-based-editor" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/text-based-editor plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/text-based-editor'] --- import kbnTextBasedEditorObj from './kbn_text_based_editor.devdocs.json'; diff --git a/api_docs/kbn_tooling_log.mdx b/api_docs/kbn_tooling_log.mdx index b1fa1491dc3d1..f1f81a9613b6a 100644 --- a/api_docs/kbn_tooling_log.mdx +++ b/api_docs/kbn_tooling_log.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-tooling-log title: "@kbn/tooling-log" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/tooling-log plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/tooling-log'] --- import kbnToolingLogObj from './kbn_tooling_log.devdocs.json'; diff --git a/api_docs/kbn_triggers_actions_ui_types.mdx b/api_docs/kbn_triggers_actions_ui_types.mdx index 3bde02022c6ec..d9721df8ef064 100644 --- a/api_docs/kbn_triggers_actions_ui_types.mdx +++ b/api_docs/kbn_triggers_actions_ui_types.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-triggers-actions-ui-types title: "@kbn/triggers-actions-ui-types" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/triggers-actions-ui-types plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/triggers-actions-ui-types'] --- import kbnTriggersActionsUiTypesObj from './kbn_triggers_actions_ui_types.devdocs.json'; diff --git a/api_docs/kbn_ts_projects.mdx b/api_docs/kbn_ts_projects.mdx index c11843d57cfea..48d52200d7b9b 100644 --- a/api_docs/kbn_ts_projects.mdx +++ b/api_docs/kbn_ts_projects.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ts-projects title: "@kbn/ts-projects" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ts-projects plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ts-projects'] --- import kbnTsProjectsObj from './kbn_ts_projects.devdocs.json'; diff --git a/api_docs/kbn_typed_react_router_config.mdx b/api_docs/kbn_typed_react_router_config.mdx index dfaa593b0ad1d..4b7075ff79d57 100644 --- a/api_docs/kbn_typed_react_router_config.mdx +++ b/api_docs/kbn_typed_react_router_config.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-typed-react-router-config title: "@kbn/typed-react-router-config" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/typed-react-router-config plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/typed-react-router-config'] --- import kbnTypedReactRouterConfigObj from './kbn_typed_react_router_config.devdocs.json'; diff --git a/api_docs/kbn_ui_actions_browser.mdx b/api_docs/kbn_ui_actions_browser.mdx index 5f14bcb010a03..6d9ee3960407e 100644 --- a/api_docs/kbn_ui_actions_browser.mdx +++ b/api_docs/kbn_ui_actions_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ui-actions-browser title: "@kbn/ui-actions-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ui-actions-browser plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ui-actions-browser'] --- import kbnUiActionsBrowserObj from './kbn_ui_actions_browser.devdocs.json'; diff --git a/api_docs/kbn_ui_shared_deps_src.mdx b/api_docs/kbn_ui_shared_deps_src.mdx index b636b1ac63633..42aa906ced28c 100644 --- a/api_docs/kbn_ui_shared_deps_src.mdx +++ b/api_docs/kbn_ui_shared_deps_src.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ui-shared-deps-src title: "@kbn/ui-shared-deps-src" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ui-shared-deps-src plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ui-shared-deps-src'] --- import kbnUiSharedDepsSrcObj from './kbn_ui_shared_deps_src.devdocs.json'; diff --git a/api_docs/kbn_ui_theme.mdx b/api_docs/kbn_ui_theme.mdx index fc6d26b343b07..61ded720e8839 100644 --- a/api_docs/kbn_ui_theme.mdx +++ b/api_docs/kbn_ui_theme.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ui-theme title: "@kbn/ui-theme" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ui-theme plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ui-theme'] --- import kbnUiThemeObj from './kbn_ui_theme.devdocs.json'; diff --git a/api_docs/kbn_unified_data_table.mdx b/api_docs/kbn_unified_data_table.mdx index c787f2b04a6c0..ed071e5d18601 100644 --- a/api_docs/kbn_unified_data_table.mdx +++ b/api_docs/kbn_unified_data_table.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-unified-data-table title: "@kbn/unified-data-table" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/unified-data-table plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/unified-data-table'] --- import kbnUnifiedDataTableObj from './kbn_unified_data_table.devdocs.json'; diff --git a/api_docs/kbn_unified_doc_viewer.devdocs.json b/api_docs/kbn_unified_doc_viewer.devdocs.json index da1c2b438bd70..297fa3033699f 100644 --- a/api_docs/kbn_unified_doc_viewer.devdocs.json +++ b/api_docs/kbn_unified_doc_viewer.devdocs.json @@ -31,18 +31,75 @@ "children": [ { "parentPluginId": "@kbn/unified-doc-viewer", - "id": "def-common.DocViewsRegistry.addDocView", + "id": "def-common.DocViewsRegistry.Unnamed", "type": "Function", "tags": [], - "label": "addDocView", - "description": [ - "\nExtends and adds the given doc view to the registry array" + "label": "Constructor", + "description": [], + "signature": [ + "any" + ], + "path": "packages/kbn-unified-doc-viewer/src/services/doc_views_registry.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/unified-doc-viewer", + "id": "def-common.DocViewsRegistry.Unnamed.$1", + "type": "CompoundType", + "tags": [], + "label": "initialValue", + "description": [], + "signature": [ + { + "pluginId": "@kbn/unified-doc-viewer", + "scope": "common", + "docId": "kibKbnUnifiedDocViewerPluginApi", + "section": "def-common.DocViewsRegistry", + "text": "DocViewsRegistry" + }, + " | ", + "DocView", + "[] | undefined" + ], + "path": "packages/kbn-unified-doc-viewer/src/services/doc_views_registry.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": false + } ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/unified-doc-viewer", + "id": "def-common.DocViewsRegistry.getAll", + "type": "Function", + "tags": [], + "label": "getAll", + "description": [], + "signature": [ + "() => ", + "DocView", + "[]" + ], + "path": "packages/kbn-unified-doc-viewer/src/services/doc_views_registry.ts", + "deprecated": false, + "trackAdoption": false, + "children": [], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/unified-doc-viewer", + "id": "def-common.DocViewsRegistry.add", + "type": "Function", + "tags": [], + "label": "add", + "description": [], "signature": [ "(docViewRaw: ", - "DocViewInput", + "DocView", " | ", - "DocViewInputFn", + "DocViewFactory", ") => void" ], "path": "packages/kbn-unified-doc-viewer/src/services/doc_views_registry.ts", @@ -51,15 +108,15 @@ "children": [ { "parentPluginId": "@kbn/unified-doc-viewer", - "id": "def-common.DocViewsRegistry.addDocView.$1", + "id": "def-common.DocViewsRegistry.add.$1", "type": "CompoundType", "tags": [], "label": "docViewRaw", "description": [], "signature": [ - "DocViewInput", + "DocView", " | ", - "DocViewInputFn" + "DocViewFactory" ], "path": "packages/kbn-unified-doc-viewer/src/services/doc_views_registry.ts", "deprecated": false, @@ -71,19 +128,13 @@ }, { "parentPluginId": "@kbn/unified-doc-viewer", - "id": "def-common.DocViewsRegistry.getDocViewsSorted", + "id": "def-common.DocViewsRegistry.removeById", "type": "Function", "tags": [], - "label": "getDocViewsSorted", - "description": [ - "\nReturns a sorted array of doc_views for rendering tabs" - ], + "label": "removeById", + "description": [], "signature": [ - "(hit: ", - "DataTableRecord", - ") => ", - "DocView", - "[]" + "(id: string) => void" ], "path": "packages/kbn-unified-doc-viewer/src/services/doc_views_registry.ts", "deprecated": false, @@ -91,13 +142,13 @@ "children": [ { "parentPluginId": "@kbn/unified-doc-viewer", - "id": "def-common.DocViewsRegistry.getDocViewsSorted.$1", - "type": "Object", + "id": "def-common.DocViewsRegistry.removeById.$1", + "type": "string", "tags": [], - "label": "hit", + "label": "id", "description": [], "signature": [ - "DataTableRecord" + "string" ], "path": "packages/kbn-unified-doc-viewer/src/services/doc_views_registry.ts", "deprecated": false, @@ -106,6 +157,29 @@ } ], "returnComment": [] + }, + { + "parentPluginId": "@kbn/unified-doc-viewer", + "id": "def-common.DocViewsRegistry.clone", + "type": "Function", + "tags": [], + "label": "clone", + "description": [], + "signature": [ + "() => ", + { + "pluginId": "@kbn/unified-doc-viewer", + "scope": "common", + "docId": "kibKbnUnifiedDocViewerPluginApi", + "section": "def-common.DocViewsRegistry", + "text": "DocViewsRegistry" + } + ], + "path": "packages/kbn-unified-doc-viewer/src/services/doc_views_registry.ts", + "deprecated": false, + "trackAdoption": false, + "children": [], + "returnComment": [] } ], "initialIsOpen": false diff --git a/api_docs/kbn_unified_doc_viewer.mdx b/api_docs/kbn_unified_doc_viewer.mdx index 9f077fa04a2e1..5a0dc633d1edd 100644 --- a/api_docs/kbn_unified_doc_viewer.mdx +++ b/api_docs/kbn_unified_doc_viewer.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-unified-doc-viewer title: "@kbn/unified-doc-viewer" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/unified-doc-viewer plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/unified-doc-viewer'] --- import kbnUnifiedDocViewerObj from './kbn_unified_doc_viewer.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/kibana-data-discovery](https://github.com/orgs/elastic/teams/k | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 10 | 0 | 7 | 7 | +| 14 | 0 | 13 | 6 | ## Common diff --git a/api_docs/kbn_unified_field_list.devdocs.json b/api_docs/kbn_unified_field_list.devdocs.json index 35da28a598da8..541b20f210c13 100644 --- a/api_docs/kbn_unified_field_list.devdocs.json +++ b/api_docs/kbn_unified_field_list.devdocs.json @@ -648,8 +648,8 @@ "pluginId": "uiActions", "scope": "public", "docId": "kibUiActionsPluginApi", - "section": "def-public.UiActionsStart", - "text": "UiActionsStart" + "section": "def-public.UiActionsPublicStart", + "text": "UiActionsPublicStart" }, ", field: ", { @@ -701,8 +701,8 @@ "pluginId": "uiActions", "scope": "public", "docId": "kibUiActionsPluginApi", - "section": "def-public.UiActionsStart", - "text": "UiActionsStart" + "section": "def-public.UiActionsPublicStart", + "text": "UiActionsPublicStart" } ], "path": "packages/kbn-unified-field-list/src/components/field_visualize_button/visualize_trigger_utils.ts", @@ -979,8 +979,8 @@ "pluginId": "uiActions", "scope": "public", "docId": "kibUiActionsPluginApi", - "section": "def-public.UiActionsStart", - "text": "UiActionsStart" + "section": "def-public.UiActionsPublicStart", + "text": "UiActionsPublicStart" }, ", field: ", { @@ -1016,8 +1016,8 @@ "pluginId": "uiActions", "scope": "public", "docId": "kibUiActionsPluginApi", - "section": "def-public.UiActionsStart", - "text": "UiActionsStart" + "section": "def-public.UiActionsPublicStart", + "text": "UiActionsPublicStart" } ], "path": "packages/kbn-unified-field-list/src/components/field_visualize_button/visualize_trigger_utils.ts", @@ -1115,8 +1115,8 @@ "pluginId": "uiActions", "scope": "public", "docId": "kibUiActionsPluginApi", - "section": "def-public.UiActionsStart", - "text": "UiActionsStart" + "section": "def-public.UiActionsPublicStart", + "text": "UiActionsPublicStart" }, ", contextualFields: string[], originatingApp: string, dataView: ", { @@ -1152,8 +1152,8 @@ "pluginId": "uiActions", "scope": "public", "docId": "kibUiActionsPluginApi", - "section": "def-public.UiActionsStart", - "text": "UiActionsStart" + "section": "def-public.UiActionsPublicStart", + "text": "UiActionsPublicStart" } ], "path": "packages/kbn-unified-field-list/src/components/field_visualize_button/visualize_trigger_utils.ts", @@ -1270,8 +1270,8 @@ "pluginId": "uiActions", "scope": "public", "docId": "kibUiActionsPluginApi", - "section": "def-public.UiActionsStart", - "text": "UiActionsStart" + "section": "def-public.UiActionsPublicStart", + "text": "UiActionsPublicStart" }, " | undefined; } & { dataViewFieldEditor?: ", { @@ -5419,8 +5419,8 @@ "pluginId": "uiActions", "scope": "public", "docId": "kibUiActionsPluginApi", - "section": "def-public.UiActionsStart", - "text": "UiActionsStart" + "section": "def-public.UiActionsPublicStart", + "text": "UiActionsPublicStart" }, " | undefined; } & { dataViewFieldEditor?: ", { diff --git a/api_docs/kbn_unified_field_list.mdx b/api_docs/kbn_unified_field_list.mdx index fa90e68b0eeef..697396ee7d6cc 100644 --- a/api_docs/kbn_unified_field_list.mdx +++ b/api_docs/kbn_unified_field_list.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-unified-field-list title: "@kbn/unified-field-list" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/unified-field-list plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/unified-field-list'] --- import kbnUnifiedFieldListObj from './kbn_unified_field_list.devdocs.json'; diff --git a/api_docs/kbn_unsaved_changes_badge.mdx b/api_docs/kbn_unsaved_changes_badge.mdx index 800253d53a2af..722bb74668663 100644 --- a/api_docs/kbn_unsaved_changes_badge.mdx +++ b/api_docs/kbn_unsaved_changes_badge.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-unsaved-changes-badge title: "@kbn/unsaved-changes-badge" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/unsaved-changes-badge plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/unsaved-changes-badge'] --- import kbnUnsavedChangesBadgeObj from './kbn_unsaved_changes_badge.devdocs.json'; diff --git a/api_docs/kbn_url_state.mdx b/api_docs/kbn_url_state.mdx index 328404b2c8a82..941ef48209ce6 100644 --- a/api_docs/kbn_url_state.mdx +++ b/api_docs/kbn_url_state.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-url-state title: "@kbn/url-state" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/url-state plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/url-state'] --- import kbnUrlStateObj from './kbn_url_state.devdocs.json'; diff --git a/api_docs/kbn_use_tracked_promise.mdx b/api_docs/kbn_use_tracked_promise.mdx index a732165ddef17..39ff4379240a1 100644 --- a/api_docs/kbn_use_tracked_promise.mdx +++ b/api_docs/kbn_use_tracked_promise.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-use-tracked-promise title: "@kbn/use-tracked-promise" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/use-tracked-promise plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/use-tracked-promise'] --- import kbnUseTrackedPromiseObj from './kbn_use_tracked_promise.devdocs.json'; diff --git a/api_docs/kbn_user_profile_components.mdx b/api_docs/kbn_user_profile_components.mdx index 5ab3bb80c3ab4..3fa957596dd5c 100644 --- a/api_docs/kbn_user_profile_components.mdx +++ b/api_docs/kbn_user_profile_components.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-user-profile-components title: "@kbn/user-profile-components" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/user-profile-components plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/user-profile-components'] --- import kbnUserProfileComponentsObj from './kbn_user_profile_components.devdocs.json'; diff --git a/api_docs/kbn_utility_types.mdx b/api_docs/kbn_utility_types.mdx index 502f2daeb8a49..28a91f585e883 100644 --- a/api_docs/kbn_utility_types.mdx +++ b/api_docs/kbn_utility_types.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-utility-types title: "@kbn/utility-types" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/utility-types plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/utility-types'] --- import kbnUtilityTypesObj from './kbn_utility_types.devdocs.json'; diff --git a/api_docs/kbn_utility_types_jest.mdx b/api_docs/kbn_utility_types_jest.mdx index ee0c0b15f8306..4a068cbca3973 100644 --- a/api_docs/kbn_utility_types_jest.mdx +++ b/api_docs/kbn_utility_types_jest.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-utility-types-jest title: "@kbn/utility-types-jest" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/utility-types-jest plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/utility-types-jest'] --- import kbnUtilityTypesJestObj from './kbn_utility_types_jest.devdocs.json'; diff --git a/api_docs/kbn_utils.mdx b/api_docs/kbn_utils.mdx index 817bbbbb73542..a76610e6ee9f2 100644 --- a/api_docs/kbn_utils.mdx +++ b/api_docs/kbn_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-utils title: "@kbn/utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/utils plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/utils'] --- import kbnUtilsObj from './kbn_utils.devdocs.json'; diff --git a/api_docs/kbn_visualization_ui_components.mdx b/api_docs/kbn_visualization_ui_components.mdx index b019dbd181e30..6f58db9e72165 100644 --- a/api_docs/kbn_visualization_ui_components.mdx +++ b/api_docs/kbn_visualization_ui_components.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-visualization-ui-components title: "@kbn/visualization-ui-components" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/visualization-ui-components plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/visualization-ui-components'] --- import kbnVisualizationUiComponentsObj from './kbn_visualization_ui_components.devdocs.json'; diff --git a/api_docs/kbn_visualization_utils.mdx b/api_docs/kbn_visualization_utils.mdx index ea803dbe48088..4fb2e91f6f3c2 100644 --- a/api_docs/kbn_visualization_utils.mdx +++ b/api_docs/kbn_visualization_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-visualization-utils title: "@kbn/visualization-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/visualization-utils plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/visualization-utils'] --- import kbnVisualizationUtilsObj from './kbn_visualization_utils.devdocs.json'; diff --git a/api_docs/kbn_xstate_utils.mdx b/api_docs/kbn_xstate_utils.mdx index 16f190685441b..bfebbfd19bc91 100644 --- a/api_docs/kbn_xstate_utils.mdx +++ b/api_docs/kbn_xstate_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-xstate-utils title: "@kbn/xstate-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/xstate-utils plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/xstate-utils'] --- import kbnXstateUtilsObj from './kbn_xstate_utils.devdocs.json'; diff --git a/api_docs/kbn_yarn_lock_validator.mdx b/api_docs/kbn_yarn_lock_validator.mdx index 74399577dc23d..eeec2e6e6dd73 100644 --- a/api_docs/kbn_yarn_lock_validator.mdx +++ b/api_docs/kbn_yarn_lock_validator.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-yarn-lock-validator title: "@kbn/yarn-lock-validator" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/yarn-lock-validator plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/yarn-lock-validator'] --- import kbnYarnLockValidatorObj from './kbn_yarn_lock_validator.devdocs.json'; diff --git a/api_docs/kbn_zod_helpers.mdx b/api_docs/kbn_zod_helpers.mdx index ddffd9447c909..6f8f072bac598 100644 --- a/api_docs/kbn_zod_helpers.mdx +++ b/api_docs/kbn_zod_helpers.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-zod-helpers title: "@kbn/zod-helpers" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/zod-helpers plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/zod-helpers'] --- import kbnZodHelpersObj from './kbn_zod_helpers.devdocs.json'; diff --git a/api_docs/kibana_overview.mdx b/api_docs/kibana_overview.mdx index 4678f399d55f6..7a76aba27b04d 100644 --- a/api_docs/kibana_overview.mdx +++ b/api_docs/kibana_overview.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kibanaOverview title: "kibanaOverview" image: https://source.unsplash.com/400x175/?github description: API docs for the kibanaOverview plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'kibanaOverview'] --- import kibanaOverviewObj from './kibana_overview.devdocs.json'; diff --git a/api_docs/kibana_react.mdx b/api_docs/kibana_react.mdx index a342e8b7d4044..eab29c588112f 100644 --- a/api_docs/kibana_react.mdx +++ b/api_docs/kibana_react.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kibanaReact title: "kibanaReact" image: https://source.unsplash.com/400x175/?github description: API docs for the kibanaReact plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'kibanaReact'] --- import kibanaReactObj from './kibana_react.devdocs.json'; diff --git a/api_docs/kibana_utils.devdocs.json b/api_docs/kibana_utils.devdocs.json index a0c1a249a615d..96bf6a42450b0 100644 --- a/api_docs/kibana_utils.devdocs.json +++ b/api_docs/kibana_utils.devdocs.json @@ -6943,10 +6943,10 @@ ], "setup": { "parentPluginId": "kibanaUtils", - "id": "def-public.KibanaUtilsSetup", + "id": "def-public.KibanaUtilsPublicSetup", "type": "Interface", "tags": [], - "label": "KibanaUtilsSetup", + "label": "KibanaUtilsPublicSetup", "description": [], "path": "src/plugins/kibana_utils/public/plugin.ts", "deprecated": false, @@ -6954,7 +6954,7 @@ "children": [ { "parentPluginId": "kibanaUtils", - "id": "def-public.KibanaUtilsSetup.setVersion", + "id": "def-public.KibanaUtilsPublicSetup.setVersion", "type": "Function", "tags": [], "label": "setVersion", @@ -6970,7 +6970,7 @@ "children": [ { "parentPluginId": "kibanaUtils", - "id": "def-public.KibanaUtilsSetup.setVersion.$1", + "id": "def-public.KibanaUtilsPublicSetup.setVersion.$1", "type": "Object", "tags": [], "label": "history", @@ -6991,6 +6991,22 @@ ], "lifecycle": "setup", "initialIsOpen": true + }, + "start": { + "parentPluginId": "kibanaUtils", + "id": "def-public.KibanaUtilsPublicStart", + "type": "Type", + "tags": [], + "label": "KibanaUtilsPublicStart", + "description": [], + "signature": [ + "undefined" + ], + "path": "src/plugins/kibana_utils/public/plugin.ts", + "deprecated": false, + "trackAdoption": false, + "lifecycle": "start", + "initialIsOpen": true } }, "server": { diff --git a/api_docs/kibana_utils.mdx b/api_docs/kibana_utils.mdx index 75a7a3908353f..35e1ab28fb3d4 100644 --- a/api_docs/kibana_utils.mdx +++ b/api_docs/kibana_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kibanaUtils title: "kibanaUtils" image: https://source.unsplash.com/400x175/?github description: API docs for the kibanaUtils plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'kibanaUtils'] --- import kibanaUtilsObj from './kibana_utils.devdocs.json'; @@ -21,13 +21,16 @@ Contact [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sh | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 610 | 3 | 417 | 9 | +| 611 | 3 | 418 | 9 | ## Client ### Setup +### Start + + ### Objects diff --git a/api_docs/kubernetes_security.mdx b/api_docs/kubernetes_security.mdx index bde43df0d53ec..e58be7d1de896 100644 --- a/api_docs/kubernetes_security.mdx +++ b/api_docs/kubernetes_security.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kubernetesSecurity title: "kubernetesSecurity" image: https://source.unsplash.com/400x175/?github description: API docs for the kubernetesSecurity plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'kubernetesSecurity'] --- import kubernetesSecurityObj from './kubernetes_security.devdocs.json'; diff --git a/api_docs/lens.mdx b/api_docs/lens.mdx index 11acbc519f439..90ff074e5a001 100644 --- a/api_docs/lens.mdx +++ b/api_docs/lens.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/lens title: "lens" image: https://source.unsplash.com/400x175/?github description: API docs for the lens plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'lens'] --- import lensObj from './lens.devdocs.json'; diff --git a/api_docs/license_api_guard.mdx b/api_docs/license_api_guard.mdx index 024969d0aafdd..708df91eb5225 100644 --- a/api_docs/license_api_guard.mdx +++ b/api_docs/license_api_guard.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/licenseApiGuard title: "licenseApiGuard" image: https://source.unsplash.com/400x175/?github description: API docs for the licenseApiGuard plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'licenseApiGuard'] --- import licenseApiGuardObj from './license_api_guard.devdocs.json'; diff --git a/api_docs/license_management.mdx b/api_docs/license_management.mdx index 1b665d40c71be..9e2867ab3824e 100644 --- a/api_docs/license_management.mdx +++ b/api_docs/license_management.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/licenseManagement title: "licenseManagement" image: https://source.unsplash.com/400x175/?github description: API docs for the licenseManagement plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'licenseManagement'] --- import licenseManagementObj from './license_management.devdocs.json'; diff --git a/api_docs/licensing.mdx b/api_docs/licensing.mdx index c6171915c0fd4..fbe6b1f0194e6 100644 --- a/api_docs/licensing.mdx +++ b/api_docs/licensing.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/licensing title: "licensing" image: https://source.unsplash.com/400x175/?github description: API docs for the licensing plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'licensing'] --- import licensingObj from './licensing.devdocs.json'; diff --git a/api_docs/links.mdx b/api_docs/links.mdx index 727d5b321ebd4..39df2f5ed8f19 100644 --- a/api_docs/links.mdx +++ b/api_docs/links.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/links title: "links" image: https://source.unsplash.com/400x175/?github description: API docs for the links plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'links'] --- import linksObj from './links.devdocs.json'; diff --git a/api_docs/lists.mdx b/api_docs/lists.mdx index 1271ee5b3b8b7..00ede0d7442de 100644 --- a/api_docs/lists.mdx +++ b/api_docs/lists.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/lists title: "lists" image: https://source.unsplash.com/400x175/?github description: API docs for the lists plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'lists'] --- import listsObj from './lists.devdocs.json'; diff --git a/api_docs/log_explorer.devdocs.json b/api_docs/log_explorer.devdocs.json index 3ee4d7802eefa..77158fcd0051b 100644 --- a/api_docs/log_explorer.devdocs.json +++ b/api_docs/log_explorer.devdocs.json @@ -50,6 +50,80 @@ "returnComment": [], "initialIsOpen": false }, + { + "parentPluginId": "logExplorer", + "id": "def-public.getDiscoverFiltersFromState", + "type": "Function", + "tags": [], + "label": "getDiscoverFiltersFromState", + "description": [], + "signature": [ + "(filters?: ", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, + "[], controls?: ", + "ControlOptions", + " | undefined) => ", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, + "[]" + ], + "path": "x-pack/plugins/log_explorer/public/utils/convert_discover_app_state.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "logExplorer", + "id": "def-public.getDiscoverFiltersFromState.$1", + "type": "Array", + "tags": [], + "label": "filters", + "description": [], + "signature": [ + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, + "[]" + ], + "path": "x-pack/plugins/log_explorer/public/utils/convert_discover_app_state.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "logExplorer", + "id": "def-public.getDiscoverFiltersFromState.$2", + "type": "Object", + "tags": [], + "label": "controls", + "description": [], + "signature": [ + "ControlOptions", + " | undefined" + ], + "path": "x-pack/plugins/log_explorer/public/utils/convert_discover_app_state.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": false + } + ], + "returnComment": [], + "initialIsOpen": false + }, { "parentPluginId": "logExplorer", "id": "def-public.getDiscoverGridFromDisplayOptions", @@ -470,27 +544,26 @@ "tags": [], "label": "LogExplorerFlyoutContentProps", "description": [], - "signature": [ - { - "pluginId": "logExplorer", - "scope": "public", - "docId": "kibLogExplorerPluginApi", - "section": "def-public.LogExplorerFlyoutContentProps", - "text": "LogExplorerFlyoutContentProps" - }, - " extends ", - { - "pluginId": "discover", - "scope": "public", - "docId": "kibDiscoverPluginApi", - "section": "def-public.FlyoutContentProps", - "text": "FlyoutContentProps" - } - ], "path": "x-pack/plugins/log_explorer/public/controller/controller_customizations.ts", "deprecated": false, "trackAdoption": false, "children": [ + { + "parentPluginId": "logExplorer", + "id": "def-public.LogExplorerFlyoutContentProps.actions", + "type": "Object", + "tags": [], + "label": "actions", + "description": [], + "signature": [ + "{ addFilter: ", + "DocViewFilterFn", + " | undefined; addColumn: ((columnName: string) => void) | undefined; removeColumn: ((columnName: string) => void) | undefined; }" + ], + "path": "x-pack/plugins/log_explorer/public/controller/controller_customizations.ts", + "deprecated": false, + "trackAdoption": false + }, { "parentPluginId": "logExplorer", "id": "def-public.LogExplorerFlyoutContentProps.dataView", diff --git a/api_docs/log_explorer.mdx b/api_docs/log_explorer.mdx index 62b3f02d1a52a..cdee6cfd13309 100644 --- a/api_docs/log_explorer.mdx +++ b/api_docs/log_explorer.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/logExplorer title: "logExplorer" image: https://source.unsplash.com/400x175/?github description: API docs for the logExplorer plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'logExplorer'] --- import logExplorerObj from './log_explorer.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/obs-ux-logs-team](https://github.com/orgs/elastic/teams/obs-ux | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 83 | 0 | 83 | 16 | +| 87 | 0 | 87 | 16 | ## Client diff --git a/api_docs/logs_shared.mdx b/api_docs/logs_shared.mdx index 73a6f09dbe7be..4516bb866f0a3 100644 --- a/api_docs/logs_shared.mdx +++ b/api_docs/logs_shared.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/logsShared title: "logsShared" image: https://source.unsplash.com/400x175/?github description: API docs for the logsShared plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'logsShared'] --- import logsSharedObj from './logs_shared.devdocs.json'; diff --git a/api_docs/management.mdx b/api_docs/management.mdx index 0e7a46b2926ca..27b0ec442692c 100644 --- a/api_docs/management.mdx +++ b/api_docs/management.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/management title: "management" image: https://source.unsplash.com/400x175/?github description: API docs for the management plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'management'] --- import managementObj from './management.devdocs.json'; diff --git a/api_docs/maps.mdx b/api_docs/maps.mdx index 7708bef15b7d5..d9aa39d149115 100644 --- a/api_docs/maps.mdx +++ b/api_docs/maps.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/maps title: "maps" image: https://source.unsplash.com/400x175/?github description: API docs for the maps plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'maps'] --- import mapsObj from './maps.devdocs.json'; diff --git a/api_docs/maps_ems.mdx b/api_docs/maps_ems.mdx index 27824a7e12d07..6dac20d0d9caa 100644 --- a/api_docs/maps_ems.mdx +++ b/api_docs/maps_ems.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/mapsEms title: "mapsEms" image: https://source.unsplash.com/400x175/?github description: API docs for the mapsEms plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'mapsEms'] --- import mapsEmsObj from './maps_ems.devdocs.json'; diff --git a/api_docs/metrics_data_access.mdx b/api_docs/metrics_data_access.mdx index 02a467b414ac0..f5d983b5b3dfd 100644 --- a/api_docs/metrics_data_access.mdx +++ b/api_docs/metrics_data_access.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/metricsDataAccess title: "metricsDataAccess" image: https://source.unsplash.com/400x175/?github description: API docs for the metricsDataAccess plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'metricsDataAccess'] --- import metricsDataAccessObj from './metrics_data_access.devdocs.json'; diff --git a/api_docs/ml.mdx b/api_docs/ml.mdx index 56b3df8851f4f..f7b212e4bec46 100644 --- a/api_docs/ml.mdx +++ b/api_docs/ml.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/ml title: "ml" image: https://source.unsplash.com/400x175/?github description: API docs for the ml plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'ml'] --- import mlObj from './ml.devdocs.json'; diff --git a/api_docs/mock_idp_plugin.mdx b/api_docs/mock_idp_plugin.mdx index 3ce4cf69e8a85..555309035859b 100644 --- a/api_docs/mock_idp_plugin.mdx +++ b/api_docs/mock_idp_plugin.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/mockIdpPlugin title: "mockIdpPlugin" image: https://source.unsplash.com/400x175/?github description: API docs for the mockIdpPlugin plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'mockIdpPlugin'] --- import mockIdpPluginObj from './mock_idp_plugin.devdocs.json'; diff --git a/api_docs/monitoring.mdx b/api_docs/monitoring.mdx index 9e618b572418d..9757bd03e27d5 100644 --- a/api_docs/monitoring.mdx +++ b/api_docs/monitoring.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/monitoring title: "monitoring" image: https://source.unsplash.com/400x175/?github description: API docs for the monitoring plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'monitoring'] --- import monitoringObj from './monitoring.devdocs.json'; diff --git a/api_docs/monitoring_collection.mdx b/api_docs/monitoring_collection.mdx index e7ea0c1dd72f2..f3df3d670f0b3 100644 --- a/api_docs/monitoring_collection.mdx +++ b/api_docs/monitoring_collection.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/monitoringCollection title: "monitoringCollection" image: https://source.unsplash.com/400x175/?github description: API docs for the monitoringCollection plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'monitoringCollection'] --- import monitoringCollectionObj from './monitoring_collection.devdocs.json'; diff --git a/api_docs/navigation.devdocs.json b/api_docs/navigation.devdocs.json index 85f8e5da18cc9..245711ed0a0e7 100644 --- a/api_docs/navigation.devdocs.json +++ b/api_docs/navigation.devdocs.json @@ -30,18 +30,22 @@ "pluginId": "navigation", "scope": "public", "docId": "kibNavigationPluginApi", - "section": "def-public.NavigationPublicPluginSetup", - "text": "NavigationPublicPluginSetup" + "section": "def-public.NavigationPublicSetup", + "text": "NavigationPublicSetup" }, ", ", { "pluginId": "navigation", "scope": "public", "docId": "kibNavigationPluginApi", - "section": "def-public.NavigationPublicPluginStart", - "text": "NavigationPublicPluginStart" + "section": "def-public.NavigationPublicStart", + "text": "NavigationPublicStart" }, - ", object, object>" + ", ", + "NavigationPublicSetupDependencies", + ", ", + "NavigationPublicStartDependencies", + ">" ], "path": "src/plugins/navigation/public/plugin.ts", "deprecated": false, @@ -66,7 +70,7 @@ "id": "def-public.NavigationPublicPlugin.Unnamed.$1", "type": "Object", "tags": [], - "label": "initializerContext", + "label": "_initializerContext", "description": [], "signature": [ { @@ -94,7 +98,7 @@ "label": "setup", "description": [], "signature": [ - "(core: ", + "(_core: ", { "pluginId": "@kbn/core-lifecycle-browser", "scope": "common", @@ -107,8 +111,8 @@ "pluginId": "navigation", "scope": "public", "docId": "kibNavigationPluginApi", - "section": "def-public.NavigationPublicPluginSetup", - "text": "NavigationPublicPluginSetup" + "section": "def-public.NavigationPublicSetup", + "text": "NavigationPublicSetup" } ], "path": "src/plugins/navigation/public/plugin.ts", @@ -120,7 +124,7 @@ "id": "def-public.NavigationPublicPlugin.setup.$1", "type": "Object", "tags": [], - "label": "core", + "label": "_core", "description": [], "signature": [ { @@ -148,7 +152,7 @@ "label": "start", "description": [], "signature": [ - "(core: ", + "(_core: ", { "pluginId": "@kbn/core-lifecycle-browser", "scope": "common", @@ -157,14 +161,14 @@ "text": "CoreStart" }, ", { unifiedSearch }: ", - "NavigationPluginStartDependencies", + "NavigationPublicStartDependencies", ") => ", { "pluginId": "navigation", "scope": "public", "docId": "kibNavigationPluginApi", - "section": "def-public.NavigationPublicPluginStart", - "text": "NavigationPublicPluginStart" + "section": "def-public.NavigationPublicStart", + "text": "NavigationPublicStart" } ], "path": "src/plugins/navigation/public/plugin.ts", @@ -176,7 +180,7 @@ "id": "def-public.NavigationPublicPlugin.start.$1", "type": "Object", "tags": [], - "label": "core", + "label": "_core", "description": [], "signature": [ { @@ -200,7 +204,7 @@ "label": "{ unifiedSearch }", "description": [], "signature": [ - "NavigationPluginStartDependencies" + "NavigationPublicStartDependencies" ], "path": "src/plugins/navigation/public/plugin.ts", "deprecated": false, @@ -883,10 +887,10 @@ "objects": [], "setup": { "parentPluginId": "navigation", - "id": "def-public.NavigationPublicPluginSetup", + "id": "def-public.NavigationPublicSetup", "type": "Interface", "tags": [], - "label": "NavigationPublicPluginSetup", + "label": "NavigationPublicSetup", "description": [], "path": "src/plugins/navigation/public/types.ts", "deprecated": false, @@ -894,7 +898,7 @@ "children": [ { "parentPluginId": "navigation", - "id": "def-public.NavigationPublicPluginSetup.registerMenuItem", + "id": "def-public.NavigationPublicSetup.registerMenuItem", "type": "Function", "tags": [], "label": "registerMenuItem", @@ -911,7 +915,7 @@ "children": [ { "parentPluginId": "navigation", - "id": "def-public.NavigationPublicPluginSetup.registerMenuItem.$1", + "id": "def-public.NavigationPublicSetup.registerMenuItem.$1", "type": "Object", "tags": [], "label": "menuItem", @@ -931,10 +935,10 @@ }, "start": { "parentPluginId": "navigation", - "id": "def-public.NavigationPublicPluginStart", + "id": "def-public.NavigationPublicStart", "type": "Interface", "tags": [], - "label": "NavigationPublicPluginStart", + "label": "NavigationPublicStart", "description": [], "path": "src/plugins/navigation/public/types.ts", "deprecated": false, @@ -942,7 +946,7 @@ "children": [ { "parentPluginId": "navigation", - "id": "def-public.NavigationPublicPluginStart.ui", + "id": "def-public.NavigationPublicStart.ui", "type": "Object", "tags": [], "label": "ui", diff --git a/api_docs/navigation.mdx b/api_docs/navigation.mdx index ab2a77788ac6e..c03f835f59531 100644 --- a/api_docs/navigation.mdx +++ b/api_docs/navigation.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/navigation title: "navigation" image: https://source.unsplash.com/400x175/?github description: API docs for the navigation plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'navigation'] --- import navigationObj from './navigation.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sh | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 42 | 0 | 42 | 2 | +| 42 | 0 | 42 | 3 | ## Client diff --git a/api_docs/newsfeed.mdx b/api_docs/newsfeed.mdx index ed8e5d9b0f237..5a97365c2f929 100644 --- a/api_docs/newsfeed.mdx +++ b/api_docs/newsfeed.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/newsfeed title: "newsfeed" image: https://source.unsplash.com/400x175/?github description: API docs for the newsfeed plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'newsfeed'] --- import newsfeedObj from './newsfeed.devdocs.json'; diff --git a/api_docs/no_data_page.devdocs.json b/api_docs/no_data_page.devdocs.json index 0bbeb2e20defc..6820a673cb7a9 100644 --- a/api_docs/no_data_page.devdocs.json +++ b/api_docs/no_data_page.devdocs.json @@ -7,26 +7,26 @@ "enums": [], "misc": [], "objects": [], - "setup": { + "start": { "parentPluginId": "noDataPage", - "id": "def-public.NoDataPagePluginStart", + "id": "def-public.NoDataPagePublicStart", "type": "Type", "tags": [], - "label": "NoDataPagePluginStart", + "label": "NoDataPagePublicStart", "description": [], "signature": [ { "pluginId": "noDataPage", "scope": "public", "docId": "kibNoDataPagePluginApi", - "section": "def-public.NoDataPagePluginSetup", - "text": "NoDataPagePluginSetup" + "section": "def-public.NoDataPagePublicSetup", + "text": "NoDataPagePublicSetup" } ], "path": "src/plugins/no_data_page/public/types.ts", "deprecated": false, "trackAdoption": false, - "lifecycle": "setup", + "lifecycle": "start", "initialIsOpen": true } }, diff --git a/api_docs/no_data_page.mdx b/api_docs/no_data_page.mdx index 9d2d22a9d3d82..d157b958d0b5e 100644 --- a/api_docs/no_data_page.mdx +++ b/api_docs/no_data_page.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/noDataPage title: "noDataPage" image: https://source.unsplash.com/400x175/?github description: API docs for the noDataPage plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'noDataPage'] --- import noDataPageObj from './no_data_page.devdocs.json'; @@ -25,6 +25,6 @@ Contact [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sh ## Client -### Setup - +### Start + diff --git a/api_docs/notifications.devdocs.json b/api_docs/notifications.devdocs.json index f7508b16dcdba..0e43337827072 100644 --- a/api_docs/notifications.devdocs.json +++ b/api_docs/notifications.devdocs.json @@ -17,10 +17,10 @@ "objects": [], "start": { "parentPluginId": "notifications", - "id": "def-server.NotificationsPluginStart", + "id": "def-server.NotificationsServerStart", "type": "Type", "tags": [], - "label": "NotificationsPluginStart", + "label": "NotificationsServerStart", "description": [], "signature": [ "EmailServiceStart" diff --git a/api_docs/notifications.mdx b/api_docs/notifications.mdx index 889a602b716e9..385dacb9c00bf 100644 --- a/api_docs/notifications.mdx +++ b/api_docs/notifications.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/notifications title: "notifications" image: https://source.unsplash.com/400x175/?github description: API docs for the notifications plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'notifications'] --- import notificationsObj from './notifications.devdocs.json'; diff --git a/api_docs/observability.mdx b/api_docs/observability.mdx index 9f09249d454ad..d78e87accec3f 100644 --- a/api_docs/observability.mdx +++ b/api_docs/observability.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/observability title: "observability" image: https://source.unsplash.com/400x175/?github description: API docs for the observability plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'observability'] --- import observabilityObj from './observability.devdocs.json'; diff --git a/api_docs/observability_a_i_assistant.devdocs.json b/api_docs/observability_a_i_assistant.devdocs.json index bde01c0fbede4..e8ddc39eb1e86 100644 --- a/api_docs/observability_a_i_assistant.devdocs.json +++ b/api_docs/observability_a_i_assistant.devdocs.json @@ -1671,8 +1671,8 @@ "pluginId": "share", "scope": "public", "docId": "kibSharePluginApi", - "section": "def-public.SharePluginStart", - "text": "SharePluginStart" + "section": "def-public.SharePublicStart", + "text": "SharePublicStart" } ], "path": "x-pack/plugins/observability_ai_assistant/public/types.ts", @@ -4031,8 +4031,8 @@ "pluginId": "share", "scope": "public", "docId": "kibSharePluginApi", - "section": "def-public.SharePluginStart", - "text": "SharePluginStart" + "section": "def-public.SharePublicStart", + "text": "SharePublicStart" } ], "path": "x-pack/plugins/observability_ai_assistant/public/utils/storybook_decorator.tsx", diff --git a/api_docs/observability_a_i_assistant.mdx b/api_docs/observability_a_i_assistant.mdx index 5fdf528c1314e..90ad0891e3516 100644 --- a/api_docs/observability_a_i_assistant.mdx +++ b/api_docs/observability_a_i_assistant.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/observabilityAIAssistant title: "observabilityAIAssistant" image: https://source.unsplash.com/400x175/?github description: API docs for the observabilityAIAssistant plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'observabilityAIAssistant'] --- import observabilityAIAssistantObj from './observability_a_i_assistant.devdocs.json'; diff --git a/api_docs/observability_log_explorer.mdx b/api_docs/observability_log_explorer.mdx index 00ffdc1bb040a..81d42a1361eec 100644 --- a/api_docs/observability_log_explorer.mdx +++ b/api_docs/observability_log_explorer.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/observabilityLogExplorer title: "observabilityLogExplorer" image: https://source.unsplash.com/400x175/?github description: API docs for the observabilityLogExplorer plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'observabilityLogExplorer'] --- import observabilityLogExplorerObj from './observability_log_explorer.devdocs.json'; diff --git a/api_docs/observability_onboarding.mdx b/api_docs/observability_onboarding.mdx index a68cc0e1298d3..f87755100a6d4 100644 --- a/api_docs/observability_onboarding.mdx +++ b/api_docs/observability_onboarding.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/observabilityOnboarding title: "observabilityOnboarding" image: https://source.unsplash.com/400x175/?github description: API docs for the observabilityOnboarding plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'observabilityOnboarding'] --- import observabilityOnboardingObj from './observability_onboarding.devdocs.json'; diff --git a/api_docs/observability_shared.devdocs.json b/api_docs/observability_shared.devdocs.json index 5c0c77dba50b7..a347d6029067f 100644 --- a/api_docs/observability_shared.devdocs.json +++ b/api_docs/observability_shared.devdocs.json @@ -461,8 +461,8 @@ "pluginId": "uiActions", "scope": "public", "docId": "kibUiActionsPluginApi", - "section": "def-public.UiActionsStart", - "text": "UiActionsStart" + "section": "def-public.UiActionsPublicStart", + "text": "UiActionsPublicStart" }, "; triggerId: ", { diff --git a/api_docs/observability_shared.mdx b/api_docs/observability_shared.mdx index 58f3c99e86bf3..5334dab9e511c 100644 --- a/api_docs/observability_shared.mdx +++ b/api_docs/observability_shared.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/observabilityShared title: "observabilityShared" image: https://source.unsplash.com/400x175/?github description: API docs for the observabilityShared plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'observabilityShared'] --- import observabilitySharedObj from './observability_shared.devdocs.json'; diff --git a/api_docs/osquery.mdx b/api_docs/osquery.mdx index 833d6ba89b409..49504c2b52e39 100644 --- a/api_docs/osquery.mdx +++ b/api_docs/osquery.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/osquery title: "osquery" image: https://source.unsplash.com/400x175/?github description: API docs for the osquery plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'osquery'] --- import osqueryObj from './osquery.devdocs.json'; diff --git a/api_docs/painless_lab.mdx b/api_docs/painless_lab.mdx index f947ef7c14321..e2c31190e4daf 100644 --- a/api_docs/painless_lab.mdx +++ b/api_docs/painless_lab.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/painlessLab title: "painlessLab" image: https://source.unsplash.com/400x175/?github description: API docs for the painlessLab plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'painlessLab'] --- import painlessLabObj from './painless_lab.devdocs.json'; diff --git a/api_docs/plugin_directory.mdx b/api_docs/plugin_directory.mdx index d830e5d207c89..5b4629b0ff00c 100644 --- a/api_docs/plugin_directory.mdx +++ b/api_docs/plugin_directory.mdx @@ -7,7 +7,7 @@ id: kibDevDocsPluginDirectory slug: /kibana-dev-docs/api-meta/plugin-api-directory title: Directory description: Directory of public APIs available through plugins or packages. -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana'] --- @@ -15,13 +15,13 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | Count | Plugins or Packages with a
public API | Number of teams | |--------------|----------|------------------------| -| 735 | 625 | 40 | +| 738 | 628 | 41 | ### Public API health stats | API Count | Any Count | Missing comments | Missing exports | |--------------|----------|-----------------|--------| -| 77928 | 235 | 66650 | 1632 | +| 77945 | 234 | 66664 | 1632 | ## Plugin Directory @@ -32,7 +32,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@elastic/obs-knowledge-team](https://github.com/orgs/elastic/teams/obs-knowledge-team) | - | 2 | 0 | 2 | 0 | | | [@elastic/obs-knowledge-team](https://github.com/orgs/elastic/teams/obs-knowledge-team) | - | 2 | 0 | 2 | 0 | | | [@elastic/ml-ui](https://github.com/orgs/elastic/teams/ml-ui) | AIOps plugin maintained by ML team. | 70 | 1 | 4 | 1 | -| | [@elastic/response-ops](https://github.com/orgs/elastic/teams/response-ops) | - | 822 | 1 | 791 | 51 | +| | [@elastic/response-ops](https://github.com/orgs/elastic/teams/response-ops) | - | 823 | 1 | 792 | 51 | | | [@elastic/obs-ux-infra_services-team](https://github.com/orgs/elastic/teams/obs-ux-infra_services-team) | The user interface for Elastic APM | 29 | 0 | 29 | 125 | | | [@elastic/obs-knowledge-team](https://github.com/orgs/elastic/teams/obs-knowledge-team) | - | 9 | 0 | 9 | 0 | | | [@elastic/obs-knowledge-team](https://github.com/orgs/elastic/teams/obs-knowledge-team) | Asset manager plugin for entity assets (inventory, topology, etc) | 9 | 0 | 9 | 2 | @@ -64,9 +64,9 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@elastic/kibana-data-discovery](https://github.com/orgs/elastic/teams/kibana-data-discovery) | Data view management app | 2 | 0 | 2 | 0 | | | [@elastic/kibana-data-discovery](https://github.com/orgs/elastic/teams/kibana-data-discovery) | Data services are useful for searching and querying data from Elasticsearch. Helpful utilities include: a re-usable react query bar, KQL autocomplete, async search, Data Views (Index Patterns) and field formatters. | 922 | 0 | 257 | 4 | | | [@elastic/ml-ui](https://github.com/orgs/elastic/teams/ml-ui) | The Data Visualizer tools help you understand your data, by analyzing the metrics and fields in a log file or an existing Elasticsearch index. | 31 | 3 | 25 | 1 | -| | [@elastic/obs-ux-logs-team](https://github.com/orgs/elastic/teams/obs-ux-logs-team) | This plugin introduces the concept of dataset quality, where users can easily get an overview on the datasets they have. | 8 | 0 | 8 | 4 | +| | [@elastic/obs-ux-logs-team](https://github.com/orgs/elastic/teams/obs-ux-logs-team) | This plugin introduces the concept of dataset quality, where users can easily get an overview on the datasets they have. | 8 | 0 | 8 | 2 | | | [@elastic/platform-deployment-management](https://github.com/orgs/elastic/teams/platform-deployment-management) | - | 12 | 0 | 10 | 3 | -| | [@elastic/kibana-data-discovery](https://github.com/orgs/elastic/teams/kibana-data-discovery) | This plugin contains the Discover application and the saved search embeddable. | 141 | 0 | 96 | 21 | +| | [@elastic/kibana-data-discovery](https://github.com/orgs/elastic/teams/kibana-data-discovery) | This plugin contains the Discover application and the saved search embeddable. | 136 | 0 | 91 | 21 | | | [@elastic/kibana-data-discovery](https://github.com/orgs/elastic/teams/kibana-data-discovery) | - | 37 | 0 | 35 | 2 | | | [@elastic/security-threat-hunting-investigations](https://github.com/orgs/elastic/teams/security-threat-hunting-investigations) | APIs used to assess the quality of data in Elasticsearch indexes | 2 | 0 | 0 | 0 | | | [@elastic/security-solution](https://github.com/orgs/elastic/teams/security-solution) | Server APIs for the Elastic AI Assistant | 36 | 0 | 28 | 0 | @@ -78,7 +78,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/kibana-visualizations) | The Event Annotation service contains expressions for event annotations | 201 | 0 | 201 | 6 | | | [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/kibana-visualizations) | The listing page for event annotations. | 15 | 0 | 15 | 0 | | | [@elastic/response-ops](https://github.com/orgs/elastic/teams/response-ops) | - | 111 | 0 | 111 | 11 | -| | [@elastic/obs-ux-infra_services-team](https://github.com/orgs/elastic/teams/obs-ux-infra_services-team) | - | 131 | 1 | 131 | 14 | +| | [@elastic/obs-ux-infra_services-team](https://github.com/orgs/elastic/teams/obs-ux-infra_services-team) | - | 130 | 0 | 130 | 14 | | | [@elastic/kibana-presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | Adds 'error' renderer to expressions | 17 | 0 | 15 | 2 | | | [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/kibana-visualizations) | Expression Gauge plugin adds a `gauge` renderer and function to the expression plugin. The renderer will display the `gauge` chart. | 59 | 0 | 59 | 2 | | | [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/kibana-visualizations) | Expression Heatmap plugin adds a `heatmap` renderer and function to the expression plugin. The renderer will display the `heatmap` chart. | 112 | 0 | 108 | 2 | @@ -118,7 +118,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | - | 6 | 0 | 6 | 0 | | | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | - | 161 | 0 | 127 | 3 | | kibanaUsageCollection | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 0 | 0 | 0 | 0 | -| | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | - | 610 | 3 | 417 | 9 | +| | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | - | 611 | 3 | 418 | 9 | | | [@elastic/kibana-cloud-security-posture](https://github.com/orgs/elastic/teams/kibana-cloud-security-posture) | - | 5 | 0 | 5 | 1 | | | [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/kibana-visualizations) | Visualization editor allowing to quickly and easily configure compelling visualizations to use on dashboards and canvas workpads. Exposes components to embed visualizations and link into the Lens editor from within other apps in Kibana. | 642 | 0 | 543 | 60 | | | [@elastic/platform-deployment-management](https://github.com/orgs/elastic/teams/platform-deployment-management) | - | 8 | 0 | 8 | 0 | @@ -126,7 +126,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 117 | 0 | 42 | 10 | | | [@elastic/kibana-presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | A dashboard panel for creating links to dashboards or external links. | 57 | 0 | 57 | 6 | | | [@elastic/security-detection-engine](https://github.com/orgs/elastic/teams/security-detection-engine) | - | 224 | 0 | 96 | 51 | -| | [@elastic/obs-ux-logs-team](https://github.com/orgs/elastic/teams/obs-ux-logs-team) | This plugin provides a LogExplorer component using the Discover customization framework, offering several affordances specifically designed for log consumption. | 83 | 0 | 83 | 16 | +| | [@elastic/obs-ux-logs-team](https://github.com/orgs/elastic/teams/obs-ux-logs-team) | This plugin provides a LogExplorer component using the Discover customization framework, offering several affordances specifically designed for log consumption. | 87 | 0 | 87 | 16 | | | [@elastic/obs-ux-logs-team](https://github.com/orgs/elastic/teams/obs-ux-logs-team) | Exposes the shared components and APIs to access and visualize logs. | 289 | 11 | 274 | 27 | | logstash | [@elastic/logstash](https://github.com/orgs/elastic/teams/logstash) | - | 0 | 0 | 0 | 0 | | | [@elastic/platform-deployment-management](https://github.com/orgs/elastic/teams/platform-deployment-management) | - | 45 | 0 | 45 | 7 | @@ -137,7 +137,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@elastic/kibana-security](https://github.com/orgs/elastic/teams/kibana-security) | - | 25 | 0 | 19 | 0 | | | [@elastic/obs-ux-infra_services-team](https://github.com/orgs/elastic/teams/obs-ux-infra_services-team) | - | 15 | 3 | 13 | 1 | | | [@elastic/obs-ux-infra_services-team](https://github.com/orgs/elastic/teams/obs-ux-infra_services-team) | - | 9 | 0 | 9 | 0 | -| | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | - | 42 | 0 | 42 | 2 | +| | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | - | 42 | 0 | 42 | 3 | | | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 17 | 0 | 17 | 0 | | | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | - | 3 | 0 | 3 | 0 | | | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | - | 2 | 0 | 2 | 1 | @@ -191,8 +191,8 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | translations | [@elastic/kibana-localization](https://github.com/orgs/elastic/teams/kibana-localization) | - | 0 | 0 | 0 | 0 | | | [@elastic/response-ops](https://github.com/orgs/elastic/teams/response-ops) | - | 592 | 1 | 566 | 58 | | | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | Adds UI Actions service to Kibana | 135 | 0 | 93 | 9 | -| | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | Extends UI Actions plugin with more functionality | 212 | 0 | 145 | 10 | -| | [@elastic/kibana-data-discovery](https://github.com/orgs/elastic/teams/kibana-data-discovery) | This plugin contains services reliant on the plugin lifecycle for the unified doc viewer component (see @kbn/unified-doc-viewer). | 12 | 0 | 9 | 2 | +| | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | Extends UI Actions plugin with more functionality | 212 | 0 | 145 | 11 | +| | [@elastic/kibana-data-discovery](https://github.com/orgs/elastic/teams/kibana-data-discovery) | This plugin contains services reliant on the plugin lifecycle for the unified doc viewer component (see @kbn/unified-doc-viewer). | 10 | 0 | 7 | 2 | | | [@elastic/kibana-data-discovery](https://github.com/orgs/elastic/teams/kibana-data-discovery) | The `unifiedHistogram` plugin provides UI components to create a layout including a resizable histogram and a main display. | 55 | 0 | 23 | 2 | | | [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/kibana-visualizations) | Contains all the key functionality of Kibana's unified search experience.Contains all the key functionality of Kibana's unified search experience. | 148 | 2 | 110 | 23 | | upgradeAssistant | [@elastic/platform-deployment-management](https://github.com/orgs/elastic/teams/platform-deployment-management) | - | 0 | 0 | 0 | 0 | @@ -240,7 +240,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 18 | 0 | 2 | 0 | | | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 17 | 0 | 17 | 0 | | | [@elastic/obs-ux-infra_services-team](https://github.com/orgs/elastic/teams/obs-ux-infra_services-team) | - | 34 | 0 | 34 | 8 | -| | [@elastic/obs-ux-infra_services-team](https://github.com/orgs/elastic/teams/obs-ux-infra_services-team) | - | 188 | 0 | 188 | 27 | +| | [@elastic/obs-ux-infra_services-team](https://github.com/orgs/elastic/teams/obs-ux-infra_services-team) | - | 188 | 0 | 188 | 28 | | | [@elastic/obs-ux-infra_services-team](https://github.com/orgs/elastic/teams/obs-ux-infra_services-team) | - | 11 | 0 | 11 | 0 | | | [@elastic/kibana-qa](https://github.com/orgs/elastic/teams/kibana-qa) | - | 12 | 0 | 12 | 0 | | | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | - | 4 | 0 | 1 | 0 | @@ -255,6 +255,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@elastic/kibana-operations](https://github.com/orgs/elastic/teams/kibana-operations) | - | 62 | 0 | 17 | 1 | | | [@elastic/kibana-operations](https://github.com/orgs/elastic/teams/kibana-operations) | - | 2 | 0 | 2 | 0 | | | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | - | 26 | 0 | 9 | 0 | +| | [@elastic/appex-qa](https://github.com/orgs/elastic/teams/appex-qa) | - | 8 | 0 | 4 | 0 | | | [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/kibana-visualizations) | - | 206 | 0 | 169 | 8 | | | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 76 | 0 | 47 | 9 | | | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 24 | 0 | 24 | 0 | @@ -468,6 +469,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@elastic/kibana-data-discovery](https://github.com/orgs/elastic/teams/kibana-data-discovery) | - | 37 | 0 | 29 | 1 | | | [@elastic/kibana-operations](https://github.com/orgs/elastic/teams/kibana-operations) | - | 2 | 0 | 0 | 0 | | | [@elastic/kibana-operations](https://github.com/orgs/elastic/teams/kibana-operations) | - | 29 | 0 | 29 | 1 | +| | [@elastic/appex-qa](https://github.com/orgs/elastic/teams/appex-qa) | - | 4 | 0 | 4 | 0 | | | [@elastic/kibana-operations](https://github.com/orgs/elastic/teams/kibana-operations) | - | 1 | 0 | 0 | 0 | | | [@elastic/platform-deployment-management](https://github.com/orgs/elastic/teams/platform-deployment-management) | - | 1 | 0 | 1 | 0 | | | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | - | 10 | 0 | 10 | 1 | @@ -569,6 +571,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | - | 78 | 0 | 77 | 0 | | | [@elastic/kibana-data-discovery](https://github.com/orgs/elastic/teams/kibana-data-discovery) | A component for creating resizable layouts containing a fixed width panel and a flexible panel, with support for horizontal and vertical layouts. | 18 | 0 | 5 | 0 | | | [@elastic/kibana-operations](https://github.com/orgs/elastic/teams/kibana-operations) | - | 13 | 2 | 8 | 0 | +| | [@elastic/obs-ux-logs-team](https://github.com/orgs/elastic/teams/obs-ux-logs-team) | - | 2 | 0 | 1 | 0 | | | [@elastic/response-ops](https://github.com/orgs/elastic/teams/response-ops) | - | 16 | 0 | 16 | 1 | | | [@elastic/security-detections-response](https://github.com/orgs/elastic/teams/security-detections-response) | - | 119 | 0 | 116 | 0 | | | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | - | 2 | 0 | 2 | 0 | @@ -655,7 +658,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@elastic/kibana-operations](https://github.com/orgs/elastic/teams/kibana-operations) | - | 4 | 0 | 2 | 0 | | | [@elastic/kibana-operations](https://github.com/orgs/elastic/teams/kibana-operations) | - | 41 | 2 | 21 | 0 | | | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 7 | 0 | 5 | 1 | -| | [@elastic/kibana-operations](https://github.com/orgs/elastic/teams/kibana-operations) | - | 310 | 4 | 262 | 12 | +| | [@elastic/kibana-operations](https://github.com/orgs/elastic/teams/kibana-operations) | - | 311 | 4 | 263 | 12 | | | [@elastic/kibana-operations](https://github.com/orgs/elastic/teams/kibana-operations) | - | 137 | 5 | 105 | 2 | | | [@elastic/kibana-operations](https://github.com/orgs/elastic/teams/kibana-operations) | - | 2 | 0 | 1 | 0 | | | [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/kibana-visualizations) | - | 25 | 0 | 10 | 0 | @@ -667,7 +670,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@elastic/kibana-operations](https://github.com/orgs/elastic/teams/kibana-operations) | - | 54 | 0 | 45 | 0 | | | [@elastic/kibana-operations](https://github.com/orgs/elastic/teams/kibana-operations) | - | 7 | 0 | 6 | 0 | | | [@elastic/kibana-data-discovery](https://github.com/orgs/elastic/teams/kibana-data-discovery) | Contains functionality for the unified data table which can be integrated into apps | 109 | 0 | 49 | 1 | -| | [@elastic/kibana-data-discovery](https://github.com/orgs/elastic/teams/kibana-data-discovery) | - | 10 | 0 | 7 | 7 | +| | [@elastic/kibana-data-discovery](https://github.com/orgs/elastic/teams/kibana-data-discovery) | - | 14 | 0 | 13 | 6 | | | [@elastic/kibana-data-discovery](https://github.com/orgs/elastic/teams/kibana-data-discovery) | Contains functionality for the field list and field stats which can be integrated into apps | 285 | 0 | 261 | 9 | | | [@elastic/kibana-data-discovery](https://github.com/orgs/elastic/teams/kibana-data-discovery) | - | 13 | 0 | 9 | 0 | | | [@elastic/security-threat-hunting-investigations](https://github.com/orgs/elastic/teams/security-threat-hunting-investigations) | - | 3 | 0 | 0 | 0 | diff --git a/api_docs/presentation_util.mdx b/api_docs/presentation_util.mdx index 56d411f372a83..ed057a0b4f5aa 100644 --- a/api_docs/presentation_util.mdx +++ b/api_docs/presentation_util.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/presentationUtil title: "presentationUtil" image: https://source.unsplash.com/400x175/?github description: API docs for the presentationUtil plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'presentationUtil'] --- import presentationUtilObj from './presentation_util.devdocs.json'; diff --git a/api_docs/profiling.mdx b/api_docs/profiling.mdx index cd5f9aef06137..c836cb04e869c 100644 --- a/api_docs/profiling.mdx +++ b/api_docs/profiling.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/profiling title: "profiling" image: https://source.unsplash.com/400x175/?github description: API docs for the profiling plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'profiling'] --- import profilingObj from './profiling.devdocs.json'; diff --git a/api_docs/profiling_data_access.mdx b/api_docs/profiling_data_access.mdx index 82f2fba2ab656..6a589ce2676af 100644 --- a/api_docs/profiling_data_access.mdx +++ b/api_docs/profiling_data_access.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/profilingDataAccess title: "profilingDataAccess" image: https://source.unsplash.com/400x175/?github description: API docs for the profilingDataAccess plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'profilingDataAccess'] --- import profilingDataAccessObj from './profiling_data_access.devdocs.json'; diff --git a/api_docs/remote_clusters.mdx b/api_docs/remote_clusters.mdx index 843201c2c9bd7..30269acaa86c2 100644 --- a/api_docs/remote_clusters.mdx +++ b/api_docs/remote_clusters.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/remoteClusters title: "remoteClusters" image: https://source.unsplash.com/400x175/?github description: API docs for the remoteClusters plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'remoteClusters'] --- import remoteClustersObj from './remote_clusters.devdocs.json'; diff --git a/api_docs/reporting.mdx b/api_docs/reporting.mdx index aadfbb6835041..7b80f41e0e5fe 100644 --- a/api_docs/reporting.mdx +++ b/api_docs/reporting.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/reporting title: "reporting" image: https://source.unsplash.com/400x175/?github description: API docs for the reporting plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'reporting'] --- import reportingObj from './reporting.devdocs.json'; diff --git a/api_docs/rollup.mdx b/api_docs/rollup.mdx index ab6692138298d..e7dda68fbad27 100644 --- a/api_docs/rollup.mdx +++ b/api_docs/rollup.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/rollup title: "rollup" image: https://source.unsplash.com/400x175/?github description: API docs for the rollup plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'rollup'] --- import rollupObj from './rollup.devdocs.json'; diff --git a/api_docs/rule_registry.mdx b/api_docs/rule_registry.mdx index 187729bd86d62..939baee853ff3 100644 --- a/api_docs/rule_registry.mdx +++ b/api_docs/rule_registry.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/ruleRegistry title: "ruleRegistry" image: https://source.unsplash.com/400x175/?github description: API docs for the ruleRegistry plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'ruleRegistry'] --- import ruleRegistryObj from './rule_registry.devdocs.json'; diff --git a/api_docs/runtime_fields.mdx b/api_docs/runtime_fields.mdx index 792383846db51..7ef0873198097 100644 --- a/api_docs/runtime_fields.mdx +++ b/api_docs/runtime_fields.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/runtimeFields title: "runtimeFields" image: https://source.unsplash.com/400x175/?github description: API docs for the runtimeFields plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'runtimeFields'] --- import runtimeFieldsObj from './runtime_fields.devdocs.json'; diff --git a/api_docs/saved_objects.mdx b/api_docs/saved_objects.mdx index ad12abf48f4ec..be4b9ffc5ce5e 100644 --- a/api_docs/saved_objects.mdx +++ b/api_docs/saved_objects.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/savedObjects title: "savedObjects" image: https://source.unsplash.com/400x175/?github description: API docs for the savedObjects plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'savedObjects'] --- import savedObjectsObj from './saved_objects.devdocs.json'; diff --git a/api_docs/saved_objects_finder.mdx b/api_docs/saved_objects_finder.mdx index eaccbc443819c..cfed8116573df 100644 --- a/api_docs/saved_objects_finder.mdx +++ b/api_docs/saved_objects_finder.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/savedObjectsFinder title: "savedObjectsFinder" image: https://source.unsplash.com/400x175/?github description: API docs for the savedObjectsFinder plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'savedObjectsFinder'] --- import savedObjectsFinderObj from './saved_objects_finder.devdocs.json'; diff --git a/api_docs/saved_objects_management.mdx b/api_docs/saved_objects_management.mdx index f4977b8f11824..aa70fd180d11a 100644 --- a/api_docs/saved_objects_management.mdx +++ b/api_docs/saved_objects_management.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/savedObjectsManagement title: "savedObjectsManagement" image: https://source.unsplash.com/400x175/?github description: API docs for the savedObjectsManagement plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'savedObjectsManagement'] --- import savedObjectsManagementObj from './saved_objects_management.devdocs.json'; diff --git a/api_docs/saved_objects_tagging.mdx b/api_docs/saved_objects_tagging.mdx index b1618e20483af..59754589c9032 100644 --- a/api_docs/saved_objects_tagging.mdx +++ b/api_docs/saved_objects_tagging.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/savedObjectsTagging title: "savedObjectsTagging" image: https://source.unsplash.com/400x175/?github description: API docs for the savedObjectsTagging plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'savedObjectsTagging'] --- import savedObjectsTaggingObj from './saved_objects_tagging.devdocs.json'; diff --git a/api_docs/saved_objects_tagging_oss.mdx b/api_docs/saved_objects_tagging_oss.mdx index 7d9a91de7914e..abfa72674be23 100644 --- a/api_docs/saved_objects_tagging_oss.mdx +++ b/api_docs/saved_objects_tagging_oss.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/savedObjectsTaggingOss title: "savedObjectsTaggingOss" image: https://source.unsplash.com/400x175/?github description: API docs for the savedObjectsTaggingOss plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'savedObjectsTaggingOss'] --- import savedObjectsTaggingOssObj from './saved_objects_tagging_oss.devdocs.json'; diff --git a/api_docs/saved_search.mdx b/api_docs/saved_search.mdx index 36f043d93a37c..ccb907e95990f 100644 --- a/api_docs/saved_search.mdx +++ b/api_docs/saved_search.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/savedSearch title: "savedSearch" image: https://source.unsplash.com/400x175/?github description: API docs for the savedSearch plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'savedSearch'] --- import savedSearchObj from './saved_search.devdocs.json'; diff --git a/api_docs/screenshot_mode.devdocs.json b/api_docs/screenshot_mode.devdocs.json index 322f5e1d73132..d5c687d0c57e0 100644 --- a/api_docs/screenshot_mode.devdocs.json +++ b/api_docs/screenshot_mode.devdocs.json @@ -55,26 +55,26 @@ } ], "objects": [], - "setup": { + "start": { "parentPluginId": "screenshotMode", - "id": "def-public.ScreenshotModePluginStart", + "id": "def-public.ScreenshotModePublicStart", "type": "Type", "tags": [], - "label": "ScreenshotModePluginStart", + "label": "ScreenshotModePublicStart", "description": [], "signature": [ { "pluginId": "screenshotMode", "scope": "public", "docId": "kibScreenshotModePluginApi", - "section": "def-public.ScreenshotModePluginSetup", - "text": "ScreenshotModePluginSetup" + "section": "def-public.ScreenshotModePublicSetup", + "text": "ScreenshotModePublicSetup" } ], "path": "src/plugins/screenshot_mode/public/types.ts", "deprecated": false, "trackAdoption": false, - "lifecycle": "setup", + "lifecycle": "start", "initialIsOpen": true } }, @@ -157,26 +157,26 @@ "objects": [], "setup": { "parentPluginId": "screenshotMode", - "id": "def-server.ScreenshotModePluginSetup", + "id": "def-server.ScreenshotModeServerSetup", "type": "Interface", "tags": [], - "label": "ScreenshotModePluginSetup", + "label": "ScreenshotModeServerSetup", "description": [], "signature": [ { "pluginId": "screenshotMode", "scope": "server", "docId": "kibScreenshotModePluginApi", - "section": "def-server.ScreenshotModePluginSetup", - "text": "ScreenshotModePluginSetup" + "section": "def-server.ScreenshotModeServerSetup", + "text": "ScreenshotModeServerSetup" }, " extends ", { "pluginId": "screenshotMode", "scope": "server", "docId": "kibScreenshotModePluginApi", - "section": "def-server.ScreenshotModePluginStart", - "text": "ScreenshotModePluginStart" + "section": "def-server.ScreenshotModeServerStart", + "text": "ScreenshotModeServerStart" } ], "path": "src/plugins/screenshot_mode/server/types.ts", @@ -185,7 +185,7 @@ "children": [ { "parentPluginId": "screenshotMode", - "id": "def-server.ScreenshotModePluginSetup.setScreenshotContext", + "id": "def-server.ScreenshotModeServerSetup.setScreenshotContext", "type": "Function", "tags": [], "label": "setScreenshotContext", @@ -201,7 +201,7 @@ "children": [ { "parentPluginId": "screenshotMode", - "id": "def-server.ScreenshotModePluginSetup.setScreenshotContext.$1", + "id": "def-server.ScreenshotModeServerSetup.setScreenshotContext.$1", "type": "string", "tags": [], "label": "key", @@ -218,7 +218,7 @@ }, { "parentPluginId": "screenshotMode", - "id": "def-server.ScreenshotModePluginSetup.setScreenshotContext.$2", + "id": "def-server.ScreenshotModeServerSetup.setScreenshotContext.$2", "type": "Uncategorized", "tags": [], "label": "value", @@ -238,7 +238,7 @@ }, { "parentPluginId": "screenshotMode", - "id": "def-server.ScreenshotModePluginSetup.setScreenshotModeEnabled", + "id": "def-server.ScreenshotModeServerSetup.setScreenshotModeEnabled", "type": "Function", "tags": [], "label": "setScreenshotModeEnabled", @@ -260,10 +260,10 @@ }, "start": { "parentPluginId": "screenshotMode", - "id": "def-server.ScreenshotModePluginStart", + "id": "def-server.ScreenshotModeServerStart", "type": "Interface", "tags": [], - "label": "ScreenshotModePluginStart", + "label": "ScreenshotModeServerStart", "description": [], "path": "src/plugins/screenshot_mode/server/types.ts", "deprecated": false, @@ -271,7 +271,7 @@ "children": [ { "parentPluginId": "screenshotMode", - "id": "def-server.ScreenshotModePluginStart.isScreenshotMode", + "id": "def-server.ScreenshotModeServerStart.isScreenshotMode", "type": "Function", "tags": [], "label": "isScreenshotMode", @@ -295,7 +295,7 @@ "children": [ { "parentPluginId": "screenshotMode", - "id": "def-server.ScreenshotModePluginStart.isScreenshotMode.$1", + "id": "def-server.ScreenshotModeServerStart.isScreenshotMode.$1", "type": "Object", "tags": [], "label": "request", diff --git a/api_docs/screenshot_mode.mdx b/api_docs/screenshot_mode.mdx index 7628d91c6364e..a5ac9e386f2af 100644 --- a/api_docs/screenshot_mode.mdx +++ b/api_docs/screenshot_mode.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/screenshotMode title: "screenshotMode" image: https://source.unsplash.com/400x175/?github description: API docs for the screenshotMode plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'screenshotMode'] --- import screenshotModeObj from './screenshot_mode.devdocs.json'; @@ -25,8 +25,8 @@ Contact [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sh ## Client -### Setup - +### Start + ### Functions diff --git a/api_docs/screenshotting.mdx b/api_docs/screenshotting.mdx index 89ff7204e4f85..4387682d42e00 100644 --- a/api_docs/screenshotting.mdx +++ b/api_docs/screenshotting.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/screenshotting title: "screenshotting" image: https://source.unsplash.com/400x175/?github description: API docs for the screenshotting plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'screenshotting'] --- import screenshottingObj from './screenshotting.devdocs.json'; diff --git a/api_docs/security.mdx b/api_docs/security.mdx index 640d6981eec03..382f2f708ec20 100644 --- a/api_docs/security.mdx +++ b/api_docs/security.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/security title: "security" image: https://source.unsplash.com/400x175/?github description: API docs for the security plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'security'] --- import securityObj from './security.devdocs.json'; diff --git a/api_docs/security_solution.mdx b/api_docs/security_solution.mdx index ff60d373990aa..11de42d6c6e15 100644 --- a/api_docs/security_solution.mdx +++ b/api_docs/security_solution.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/securitySolution title: "securitySolution" image: https://source.unsplash.com/400x175/?github description: API docs for the securitySolution plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'securitySolution'] --- import securitySolutionObj from './security_solution.devdocs.json'; diff --git a/api_docs/security_solution_ess.mdx b/api_docs/security_solution_ess.mdx index 825eda7748872..3d3df5185d3e4 100644 --- a/api_docs/security_solution_ess.mdx +++ b/api_docs/security_solution_ess.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/securitySolutionEss title: "securitySolutionEss" image: https://source.unsplash.com/400x175/?github description: API docs for the securitySolutionEss plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'securitySolutionEss'] --- import securitySolutionEssObj from './security_solution_ess.devdocs.json'; diff --git a/api_docs/security_solution_serverless.mdx b/api_docs/security_solution_serverless.mdx index 3b7b945f26c6e..c56836a2b3f9e 100644 --- a/api_docs/security_solution_serverless.mdx +++ b/api_docs/security_solution_serverless.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/securitySolutionServerless title: "securitySolutionServerless" image: https://source.unsplash.com/400x175/?github description: API docs for the securitySolutionServerless plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'securitySolutionServerless'] --- import securitySolutionServerlessObj from './security_solution_serverless.devdocs.json'; diff --git a/api_docs/serverless.devdocs.json b/api_docs/serverless.devdocs.json index a3e8cfec129a8..53843f88f7fdf 100644 --- a/api_docs/serverless.devdocs.json +++ b/api_docs/serverless.devdocs.json @@ -290,10 +290,10 @@ "objects": [], "setup": { "parentPluginId": "serverless", - "id": "def-server.ServerlessPluginSetup", + "id": "def-server.ServerlessServerSetup", "type": "Interface", "tags": [], - "label": "ServerlessPluginSetup", + "label": "ServerlessServerSetup", "description": [], "path": "x-pack/plugins/serverless/server/types.ts", "deprecated": false, @@ -301,7 +301,7 @@ "children": [ { "parentPluginId": "serverless", - "id": "def-server.ServerlessPluginSetup.setupProjectSettings", + "id": "def-server.ServerlessServerSetup.setupProjectSettings", "type": "Function", "tags": [], "label": "setupProjectSettings", @@ -315,7 +315,7 @@ "children": [ { "parentPluginId": "serverless", - "id": "def-server.ServerlessPluginSetup.setupProjectSettings.$1", + "id": "def-server.ServerlessServerSetup.setupProjectSettings.$1", "type": "Array", "tags": [], "label": "keys", @@ -337,10 +337,10 @@ }, "start": { "parentPluginId": "serverless", - "id": "def-server.ServerlessPluginStart", + "id": "def-server.ServerlessServerStart", "type": "Interface", "tags": [], - "label": "ServerlessPluginStart", + "label": "ServerlessServerStart", "description": [], "path": "x-pack/plugins/serverless/server/types.ts", "deprecated": false, diff --git a/api_docs/serverless.mdx b/api_docs/serverless.mdx index 685489e4d6fa9..66d91140c9a82 100644 --- a/api_docs/serverless.mdx +++ b/api_docs/serverless.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/serverless title: "serverless" image: https://source.unsplash.com/400x175/?github description: API docs for the serverless plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'serverless'] --- import serverlessObj from './serverless.devdocs.json'; diff --git a/api_docs/serverless_observability.devdocs.json b/api_docs/serverless_observability.devdocs.json index caecd1a34bae8..27cfb7e4ed1a4 100644 --- a/api_docs/serverless_observability.devdocs.json +++ b/api_docs/serverless_observability.devdocs.json @@ -9,10 +9,10 @@ "objects": [], "setup": { "parentPluginId": "serverlessObservability", - "id": "def-public.ServerlessObservabilityPluginSetup", + "id": "def-public.ServerlessObservabilityPublicSetup", "type": "Interface", "tags": [], - "label": "ServerlessObservabilityPluginSetup", + "label": "ServerlessObservabilityPublicSetup", "description": [], "path": "x-pack/plugins/serverless_observability/public/types.ts", "deprecated": false, @@ -23,10 +23,10 @@ }, "start": { "parentPluginId": "serverlessObservability", - "id": "def-public.ServerlessObservabilityPluginStart", + "id": "def-public.ServerlessObservabilityPublicStart", "type": "Interface", "tags": [], - "label": "ServerlessObservabilityPluginStart", + "label": "ServerlessObservabilityPublicStart", "description": [], "path": "x-pack/plugins/serverless_observability/public/types.ts", "deprecated": false, diff --git a/api_docs/serverless_observability.mdx b/api_docs/serverless_observability.mdx index 7c49f7f5e65be..bff7ebf553d98 100644 --- a/api_docs/serverless_observability.mdx +++ b/api_docs/serverless_observability.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/serverlessObservability title: "serverlessObservability" image: https://source.unsplash.com/400x175/?github description: API docs for the serverlessObservability plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'serverlessObservability'] --- import serverlessObservabilityObj from './serverless_observability.devdocs.json'; diff --git a/api_docs/serverless_search.mdx b/api_docs/serverless_search.mdx index fa626da1593ef..2eaf6275c8683 100644 --- a/api_docs/serverless_search.mdx +++ b/api_docs/serverless_search.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/serverlessSearch title: "serverlessSearch" image: https://source.unsplash.com/400x175/?github description: API docs for the serverlessSearch plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'serverlessSearch'] --- import serverlessSearchObj from './serverless_search.devdocs.json'; diff --git a/api_docs/session_view.mdx b/api_docs/session_view.mdx index d5c6cdc62f49f..4dd9c30b26cd7 100644 --- a/api_docs/session_view.mdx +++ b/api_docs/session_view.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/sessionView title: "sessionView" image: https://source.unsplash.com/400x175/?github description: API docs for the sessionView plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'sessionView'] --- import sessionViewObj from './session_view.devdocs.json'; diff --git a/api_docs/share.devdocs.json b/api_docs/share.devdocs.json index 53e4bd286a6ac..3446a1bec0580 100644 --- a/api_docs/share.devdocs.json +++ b/api_docs/share.devdocs.json @@ -1379,10 +1379,10 @@ "objects": [], "setup": { "parentPluginId": "share", - "id": "def-public.SharePluginSetup", + "id": "def-public.SharePublicSetup", "type": "Type", "tags": [], - "label": "SharePluginSetup", + "label": "SharePublicSetup", "description": [], "signature": [ "{ register: (shareMenuProvider: ", @@ -1429,10 +1429,10 @@ }, "start": { "parentPluginId": "share", - "id": "def-public.SharePluginStart", + "id": "def-public.SharePublicStart", "type": "Type", "tags": [], - "label": "SharePluginStart", + "label": "SharePublicStart", "description": [], "signature": [ "{ toggleShareContextMenu: (options: ", @@ -1510,10 +1510,10 @@ "objects": [], "setup": { "parentPluginId": "share", - "id": "def-server.SharePluginSetup", + "id": "def-server.SharePublicSetup", "type": "Interface", "tags": [], - "label": "SharePluginSetup", + "label": "SharePublicSetup", "description": [], "path": "src/plugins/share/server/plugin.ts", "deprecated": false, @@ -1521,7 +1521,7 @@ "children": [ { "parentPluginId": "share", - "id": "def-server.SharePluginSetup.url", + "id": "def-server.SharePublicSetup.url", "type": "Object", "tags": [], "label": "url", @@ -1544,10 +1544,10 @@ }, "start": { "parentPluginId": "share", - "id": "def-server.SharePluginStart", + "id": "def-server.SharePublicStart", "type": "Interface", "tags": [], - "label": "SharePluginStart", + "label": "SharePublicStart", "description": [], "path": "src/plugins/share/server/plugin.ts", "deprecated": false, @@ -1555,7 +1555,7 @@ "children": [ { "parentPluginId": "share", - "id": "def-server.SharePluginStart.url", + "id": "def-server.SharePublicStart.url", "type": "Object", "tags": [], "label": "url", diff --git a/api_docs/share.mdx b/api_docs/share.mdx index 23d7dc5446c36..cace61074af40 100644 --- a/api_docs/share.mdx +++ b/api_docs/share.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/share title: "share" image: https://source.unsplash.com/400x175/?github description: API docs for the share plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'share'] --- import shareObj from './share.devdocs.json'; diff --git a/api_docs/snapshot_restore.mdx b/api_docs/snapshot_restore.mdx index 5fcf16314ab22..2b9c2b1c5ba2e 100644 --- a/api_docs/snapshot_restore.mdx +++ b/api_docs/snapshot_restore.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/snapshotRestore title: "snapshotRestore" image: https://source.unsplash.com/400x175/?github description: API docs for the snapshotRestore plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'snapshotRestore'] --- import snapshotRestoreObj from './snapshot_restore.devdocs.json'; diff --git a/api_docs/spaces.mdx b/api_docs/spaces.mdx index f8b794b4fd474..85cc6c588b490 100644 --- a/api_docs/spaces.mdx +++ b/api_docs/spaces.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/spaces title: "spaces" image: https://source.unsplash.com/400x175/?github description: API docs for the spaces plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'spaces'] --- import spacesObj from './spaces.devdocs.json'; diff --git a/api_docs/stack_alerts.mdx b/api_docs/stack_alerts.mdx index 4ad95ad4213ed..da709cb8a10f7 100644 --- a/api_docs/stack_alerts.mdx +++ b/api_docs/stack_alerts.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/stackAlerts title: "stackAlerts" image: https://source.unsplash.com/400x175/?github description: API docs for the stackAlerts plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'stackAlerts'] --- import stackAlertsObj from './stack_alerts.devdocs.json'; diff --git a/api_docs/stack_connectors.mdx b/api_docs/stack_connectors.mdx index cdb64355fe080..245fd16ac6034 100644 --- a/api_docs/stack_connectors.mdx +++ b/api_docs/stack_connectors.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/stackConnectors title: "stackConnectors" image: https://source.unsplash.com/400x175/?github description: API docs for the stackConnectors plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'stackConnectors'] --- import stackConnectorsObj from './stack_connectors.devdocs.json'; diff --git a/api_docs/task_manager.mdx b/api_docs/task_manager.mdx index 3ecebb2ca3ab6..6c9bb7b1dc5ca 100644 --- a/api_docs/task_manager.mdx +++ b/api_docs/task_manager.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/taskManager title: "taskManager" image: https://source.unsplash.com/400x175/?github description: API docs for the taskManager plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'taskManager'] --- import taskManagerObj from './task_manager.devdocs.json'; diff --git a/api_docs/telemetry.mdx b/api_docs/telemetry.mdx index 11b9cacaf47c6..8846f5ba1a25f 100644 --- a/api_docs/telemetry.mdx +++ b/api_docs/telemetry.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/telemetry title: "telemetry" image: https://source.unsplash.com/400x175/?github description: API docs for the telemetry plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'telemetry'] --- import telemetryObj from './telemetry.devdocs.json'; diff --git a/api_docs/telemetry_collection_manager.mdx b/api_docs/telemetry_collection_manager.mdx index 96056c8d85239..aa3e1742b08f1 100644 --- a/api_docs/telemetry_collection_manager.mdx +++ b/api_docs/telemetry_collection_manager.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/telemetryCollectionManager title: "telemetryCollectionManager" image: https://source.unsplash.com/400x175/?github description: API docs for the telemetryCollectionManager plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'telemetryCollectionManager'] --- import telemetryCollectionManagerObj from './telemetry_collection_manager.devdocs.json'; diff --git a/api_docs/telemetry_collection_xpack.mdx b/api_docs/telemetry_collection_xpack.mdx index cdb82ee2be71b..cd71b1a1ca109 100644 --- a/api_docs/telemetry_collection_xpack.mdx +++ b/api_docs/telemetry_collection_xpack.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/telemetryCollectionXpack title: "telemetryCollectionXpack" image: https://source.unsplash.com/400x175/?github description: API docs for the telemetryCollectionXpack plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'telemetryCollectionXpack'] --- import telemetryCollectionXpackObj from './telemetry_collection_xpack.devdocs.json'; diff --git a/api_docs/telemetry_management_section.mdx b/api_docs/telemetry_management_section.mdx index e208be5033030..8b3d7d8194850 100644 --- a/api_docs/telemetry_management_section.mdx +++ b/api_docs/telemetry_management_section.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/telemetryManagementSection title: "telemetryManagementSection" image: https://source.unsplash.com/400x175/?github description: API docs for the telemetryManagementSection plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'telemetryManagementSection'] --- import telemetryManagementSectionObj from './telemetry_management_section.devdocs.json'; diff --git a/api_docs/text_based_languages.mdx b/api_docs/text_based_languages.mdx index 0bcece016430a..92f7b53ebb2c7 100644 --- a/api_docs/text_based_languages.mdx +++ b/api_docs/text_based_languages.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/textBasedLanguages title: "textBasedLanguages" image: https://source.unsplash.com/400x175/?github description: API docs for the textBasedLanguages plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'textBasedLanguages'] --- import textBasedLanguagesObj from './text_based_languages.devdocs.json'; diff --git a/api_docs/threat_intelligence.mdx b/api_docs/threat_intelligence.mdx index d2f28f9420611..5942395bbc829 100644 --- a/api_docs/threat_intelligence.mdx +++ b/api_docs/threat_intelligence.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/threatIntelligence title: "threatIntelligence" image: https://source.unsplash.com/400x175/?github description: API docs for the threatIntelligence plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'threatIntelligence'] --- import threatIntelligenceObj from './threat_intelligence.devdocs.json'; diff --git a/api_docs/timelines.mdx b/api_docs/timelines.mdx index 9278473f3ceae..8d1f14dc7e667 100644 --- a/api_docs/timelines.mdx +++ b/api_docs/timelines.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/timelines title: "timelines" image: https://source.unsplash.com/400x175/?github description: API docs for the timelines plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'timelines'] --- import timelinesObj from './timelines.devdocs.json'; diff --git a/api_docs/transform.mdx b/api_docs/transform.mdx index 215cdbb85dafc..337d19283987e 100644 --- a/api_docs/transform.mdx +++ b/api_docs/transform.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/transform title: "transform" image: https://source.unsplash.com/400x175/?github description: API docs for the transform plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'transform'] --- import transformObj from './transform.devdocs.json'; diff --git a/api_docs/triggers_actions_ui.mdx b/api_docs/triggers_actions_ui.mdx index eaa39b0f255e6..4ebd2dbdbb494 100644 --- a/api_docs/triggers_actions_ui.mdx +++ b/api_docs/triggers_actions_ui.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/triggersActionsUi title: "triggersActionsUi" image: https://source.unsplash.com/400x175/?github description: API docs for the triggersActionsUi plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'triggersActionsUi'] --- import triggersActionsUiObj from './triggers_actions_ui.devdocs.json'; diff --git a/api_docs/ui_actions.devdocs.json b/api_docs/ui_actions.devdocs.json index bf583998fc74e..95d88333a2d23 100644 --- a/api_docs/ui_actions.devdocs.json +++ b/api_docs/ui_actions.devdocs.json @@ -2517,10 +2517,10 @@ ], "setup": { "parentPluginId": "uiActions", - "id": "def-public.UiActionsSetup", + "id": "def-public.UiActionsPublicSetup", "type": "Type", "tags": [], - "label": "UiActionsSetup", + "label": "UiActionsPublicSetup", "description": [], "signature": [ "{ readonly registerTrigger: (trigger: ", @@ -2565,10 +2565,10 @@ }, "start": { "parentPluginId": "uiActions", - "id": "def-public.UiActionsStart", + "id": "def-public.UiActionsPublicStart", "type": "Type", "tags": [], - "label": "UiActionsStart", + "label": "UiActionsPublicStart", "description": [], "signature": [ "{ readonly registerTrigger: (trigger: ", diff --git a/api_docs/ui_actions.mdx b/api_docs/ui_actions.mdx index ee1e01cb9cd16..4be2c7d874ecc 100644 --- a/api_docs/ui_actions.mdx +++ b/api_docs/ui_actions.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/uiActions title: "uiActions" image: https://source.unsplash.com/400x175/?github description: API docs for the uiActions plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'uiActions'] --- import uiActionsObj from './ui_actions.devdocs.json'; diff --git a/api_docs/ui_actions_enhanced.devdocs.json b/api_docs/ui_actions_enhanced.devdocs.json index 83c71b1e3e655..7eeb5a7446abf 100644 --- a/api_docs/ui_actions_enhanced.devdocs.json +++ b/api_docs/ui_actions_enhanced.devdocs.json @@ -3698,8 +3698,8 @@ "pluginId": "uiActions", "scope": "public", "docId": "kibUiActionsPluginApi", - "section": "def-public.UiActionsSetup", - "text": "UiActionsSetup" + "section": "def-public.UiActionsPublicSetup", + "text": "UiActionsPublicSetup" }, ",Pick<", "UiActionsServiceEnhancements", @@ -3732,8 +3732,8 @@ "pluginId": "uiActions", "scope": "public", "docId": "kibUiActionsPluginApi", - "section": "def-public.UiActionsStart", - "text": "UiActionsStart" + "section": "def-public.UiActionsPublicStart", + "text": "UiActionsPublicStart" }, ",Pick<", "UiActionsServiceEnhancements", @@ -3825,10 +3825,12 @@ "pluginId": "uiActionsEnhanced", "scope": "server", "docId": "kibUiActionsEnhancedPluginApi", - "section": "def-server.SetupContract", - "text": "SetupContract" + "section": "def-server.UiActionsEnhancedServerSetup", + "text": "UiActionsEnhancedServerSetup" }, - ", void, SetupDependencies, object>" + ", void, UiActionsEnhancedServerSetupDependencies, ", + "UiActionsEnhancedServerStartDependencies", + ">" ], "path": "src/plugins/ui_actions_enhanced/server/plugin.ts", "deprecated": false, @@ -3888,7 +3890,7 @@ "label": "setup", "description": [], "signature": [ - "(core: ", + "(_core: ", { "pluginId": "@kbn/core-lifecycle-server", "scope": "common", @@ -3896,7 +3898,7 @@ "section": "def-common.CoreSetup", "text": "CoreSetup" }, - ", { embeddable }: SetupDependencies) => { registerActionFactory: (definition: ", + ", { embeddable }: UiActionsEnhancedServerSetupDependencies) => { registerActionFactory: (definition: ", { "pluginId": "uiActionsEnhanced", "scope": "server", @@ -3923,7 +3925,7 @@ "id": "def-server.AdvancedUiActionsServerPlugin.setup.$1", "type": "Object", "tags": [], - "label": "core", + "label": "_core", "description": [], "signature": [ { @@ -3948,7 +3950,7 @@ "label": "{ embeddable }", "description": [], "signature": [ - "SetupDependencies" + "UiActionsEnhancedServerSetupDependencies" ], "path": "src/plugins/ui_actions_enhanced/server/plugin.ts", "deprecated": false, @@ -4246,10 +4248,10 @@ "objects": [], "setup": { "parentPluginId": "uiActionsEnhanced", - "id": "def-server.SetupContract", + "id": "def-server.UiActionsEnhancedServerSetup", "type": "Interface", "tags": [], - "label": "SetupContract", + "label": "UiActionsEnhancedServerSetup", "description": [], "path": "src/plugins/ui_actions_enhanced/server/plugin.ts", "deprecated": false, @@ -4257,7 +4259,7 @@ "children": [ { "parentPluginId": "uiActionsEnhanced", - "id": "def-server.SetupContract.registerActionFactory", + "id": "def-server.UiActionsEnhancedServerSetup.registerActionFactory", "type": "Function", "tags": [], "label": "registerActionFactory", @@ -4287,7 +4289,7 @@ "children": [ { "parentPluginId": "uiActionsEnhanced", - "id": "def-server.SetupContract.registerActionFactory.$1", + "id": "def-server.UiActionsEnhancedServerSetup.registerActionFactory.$1", "type": "Object", "tags": [], "label": "definition", @@ -4324,10 +4326,10 @@ }, "start": { "parentPluginId": "uiActionsEnhanced", - "id": "def-server.StartContract", + "id": "def-server.UiActionsEnhancedServerStart", "type": "Type", "tags": [], - "label": "StartContract", + "label": "UiActionsEnhancedServerStart", "description": [], "signature": [ "void" diff --git a/api_docs/ui_actions_enhanced.mdx b/api_docs/ui_actions_enhanced.mdx index 4eb8145503466..5120a5a6eb086 100644 --- a/api_docs/ui_actions_enhanced.mdx +++ b/api_docs/ui_actions_enhanced.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/uiActionsEnhanced title: "uiActionsEnhanced" image: https://source.unsplash.com/400x175/?github description: API docs for the uiActionsEnhanced plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'uiActionsEnhanced'] --- import uiActionsEnhancedObj from './ui_actions_enhanced.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sh | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 212 | 0 | 145 | 10 | +| 212 | 0 | 145 | 11 | ## Client diff --git a/api_docs/unified_doc_viewer.devdocs.json b/api_docs/unified_doc_viewer.devdocs.json index 28e674ad58441..a72cb5053802f 100644 --- a/api_docs/unified_doc_viewer.devdocs.json +++ b/api_docs/unified_doc_viewer.devdocs.json @@ -152,40 +152,23 @@ "children": [ { "parentPluginId": "unifiedDocViewer", - "id": "def-public.UnifiedDocViewerSetup.addDocView", - "type": "Function", + "id": "def-public.UnifiedDocViewerSetup.registry", + "type": "Object", "tags": [], - "label": "addDocView", + "label": "registry", "description": [], "signature": [ - "(docViewRaw: ", - "DocViewInput", - " | ", - "DocViewInputFn", - ") => void" + { + "pluginId": "@kbn/unified-doc-viewer", + "scope": "common", + "docId": "kibKbnUnifiedDocViewerPluginApi", + "section": "def-common.DocViewsRegistry", + "text": "DocViewsRegistry" + } ], "path": "src/plugins/unified_doc_viewer/public/plugin.tsx", "deprecated": false, - "trackAdoption": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "unifiedDocViewer", - "id": "def-public.UnifiedDocViewerSetup.addDocView.$1", - "type": "CompoundType", - "tags": [], - "label": "docViewRaw", - "description": [], - "signature": [ - "DocViewInput", - " | ", - "DocViewInputFn" - ], - "path": "packages/kbn-unified-doc-viewer/src/services/doc_views_registry.ts", - "deprecated": false, - "trackAdoption": false - } - ] + "trackAdoption": false } ], "lifecycle": "setup", @@ -204,38 +187,23 @@ "children": [ { "parentPluginId": "unifiedDocViewer", - "id": "def-public.UnifiedDocViewerStart.getDocViews", - "type": "Function", + "id": "def-public.UnifiedDocViewerStart.registry", + "type": "Object", "tags": [], - "label": "getDocViews", + "label": "registry", "description": [], "signature": [ - "(hit: ", - "DataTableRecord", - ") => ", - "DocView", - "[]" + { + "pluginId": "@kbn/unified-doc-viewer", + "scope": "common", + "docId": "kibKbnUnifiedDocViewerPluginApi", + "section": "def-common.DocViewsRegistry", + "text": "DocViewsRegistry" + } ], "path": "src/plugins/unified_doc_viewer/public/plugin.tsx", "deprecated": false, - "trackAdoption": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "unifiedDocViewer", - "id": "def-public.UnifiedDocViewerStart.getDocViews.$1", - "type": "Object", - "tags": [], - "label": "hit", - "description": [], - "signature": [ - "DataTableRecord" - ], - "path": "packages/kbn-unified-doc-viewer/src/services/doc_views_registry.ts", - "deprecated": false, - "trackAdoption": false - } - ] + "trackAdoption": false } ], "lifecycle": "start", diff --git a/api_docs/unified_doc_viewer.mdx b/api_docs/unified_doc_viewer.mdx index ae96e33156eb0..28f070fe36038 100644 --- a/api_docs/unified_doc_viewer.mdx +++ b/api_docs/unified_doc_viewer.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/unifiedDocViewer title: "unifiedDocViewer" image: https://source.unsplash.com/400x175/?github description: API docs for the unifiedDocViewer plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'unifiedDocViewer'] --- import unifiedDocViewerObj from './unified_doc_viewer.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/kibana-data-discovery](https://github.com/orgs/elastic/teams/k | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 12 | 0 | 9 | 2 | +| 10 | 0 | 7 | 2 | ## Client diff --git a/api_docs/unified_histogram.mdx b/api_docs/unified_histogram.mdx index 0e29b844faa71..697fbffe5c3b7 100644 --- a/api_docs/unified_histogram.mdx +++ b/api_docs/unified_histogram.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/unifiedHistogram title: "unifiedHistogram" image: https://source.unsplash.com/400x175/?github description: API docs for the unifiedHistogram plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'unifiedHistogram'] --- import unifiedHistogramObj from './unified_histogram.devdocs.json'; diff --git a/api_docs/unified_search.mdx b/api_docs/unified_search.mdx index 4f447ab053d20..b898a070d1924 100644 --- a/api_docs/unified_search.mdx +++ b/api_docs/unified_search.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/unifiedSearch title: "unifiedSearch" image: https://source.unsplash.com/400x175/?github description: API docs for the unifiedSearch plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'unifiedSearch'] --- import unifiedSearchObj from './unified_search.devdocs.json'; diff --git a/api_docs/unified_search_autocomplete.mdx b/api_docs/unified_search_autocomplete.mdx index 0047bfc6cabdd..9b68141f8522f 100644 --- a/api_docs/unified_search_autocomplete.mdx +++ b/api_docs/unified_search_autocomplete.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/unifiedSearch-autocomplete title: "unifiedSearch.autocomplete" image: https://source.unsplash.com/400x175/?github description: API docs for the unifiedSearch.autocomplete plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'unifiedSearch.autocomplete'] --- import unifiedSearchAutocompleteObj from './unified_search_autocomplete.devdocs.json'; diff --git a/api_docs/uptime.mdx b/api_docs/uptime.mdx index 09abfa73cbb71..82eec26d156ba 100644 --- a/api_docs/uptime.mdx +++ b/api_docs/uptime.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/uptime title: "uptime" image: https://source.unsplash.com/400x175/?github description: API docs for the uptime plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'uptime'] --- import uptimeObj from './uptime.devdocs.json'; diff --git a/api_docs/url_forwarding.mdx b/api_docs/url_forwarding.mdx index 51e9fadf1012f..bff9ba3c43a1b 100644 --- a/api_docs/url_forwarding.mdx +++ b/api_docs/url_forwarding.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/urlForwarding title: "urlForwarding" image: https://source.unsplash.com/400x175/?github description: API docs for the urlForwarding plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'urlForwarding'] --- import urlForwardingObj from './url_forwarding.devdocs.json'; diff --git a/api_docs/usage_collection.mdx b/api_docs/usage_collection.mdx index fe81d5d23f5cf..7aea5969874bc 100644 --- a/api_docs/usage_collection.mdx +++ b/api_docs/usage_collection.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/usageCollection title: "usageCollection" image: https://source.unsplash.com/400x175/?github description: API docs for the usageCollection plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'usageCollection'] --- import usageCollectionObj from './usage_collection.devdocs.json'; diff --git a/api_docs/ux.mdx b/api_docs/ux.mdx index 77f941dd5a728..f8873435bea7a 100644 --- a/api_docs/ux.mdx +++ b/api_docs/ux.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/ux title: "ux" image: https://source.unsplash.com/400x175/?github description: API docs for the ux plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'ux'] --- import uxObj from './ux.devdocs.json'; diff --git a/api_docs/vis_default_editor.mdx b/api_docs/vis_default_editor.mdx index 6e291caca1dc0..2b8600f50197c 100644 --- a/api_docs/vis_default_editor.mdx +++ b/api_docs/vis_default_editor.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/visDefaultEditor title: "visDefaultEditor" image: https://source.unsplash.com/400x175/?github description: API docs for the visDefaultEditor plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visDefaultEditor'] --- import visDefaultEditorObj from './vis_default_editor.devdocs.json'; diff --git a/api_docs/vis_type_gauge.mdx b/api_docs/vis_type_gauge.mdx index cb9aa5567950b..f79890da6271f 100644 --- a/api_docs/vis_type_gauge.mdx +++ b/api_docs/vis_type_gauge.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/visTypeGauge title: "visTypeGauge" image: https://source.unsplash.com/400x175/?github description: API docs for the visTypeGauge plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypeGauge'] --- import visTypeGaugeObj from './vis_type_gauge.devdocs.json'; diff --git a/api_docs/vis_type_heatmap.mdx b/api_docs/vis_type_heatmap.mdx index f7c8606da3860..c03a6f74fe8cc 100644 --- a/api_docs/vis_type_heatmap.mdx +++ b/api_docs/vis_type_heatmap.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/visTypeHeatmap title: "visTypeHeatmap" image: https://source.unsplash.com/400x175/?github description: API docs for the visTypeHeatmap plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypeHeatmap'] --- import visTypeHeatmapObj from './vis_type_heatmap.devdocs.json'; diff --git a/api_docs/vis_type_pie.mdx b/api_docs/vis_type_pie.mdx index 07f993dba7cb1..442d2d5f72c74 100644 --- a/api_docs/vis_type_pie.mdx +++ b/api_docs/vis_type_pie.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/visTypePie title: "visTypePie" image: https://source.unsplash.com/400x175/?github description: API docs for the visTypePie plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypePie'] --- import visTypePieObj from './vis_type_pie.devdocs.json'; diff --git a/api_docs/vis_type_table.mdx b/api_docs/vis_type_table.mdx index 57c3308879c83..ed6a569057afe 100644 --- a/api_docs/vis_type_table.mdx +++ b/api_docs/vis_type_table.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/visTypeTable title: "visTypeTable" image: https://source.unsplash.com/400x175/?github description: API docs for the visTypeTable plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypeTable'] --- import visTypeTableObj from './vis_type_table.devdocs.json'; diff --git a/api_docs/vis_type_timelion.mdx b/api_docs/vis_type_timelion.mdx index 500d2dbfbcf43..87bfde401b952 100644 --- a/api_docs/vis_type_timelion.mdx +++ b/api_docs/vis_type_timelion.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/visTypeTimelion title: "visTypeTimelion" image: https://source.unsplash.com/400x175/?github description: API docs for the visTypeTimelion plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypeTimelion'] --- import visTypeTimelionObj from './vis_type_timelion.devdocs.json'; diff --git a/api_docs/vis_type_timeseries.mdx b/api_docs/vis_type_timeseries.mdx index e65f58f5a38b7..b7a9e411e74d6 100644 --- a/api_docs/vis_type_timeseries.mdx +++ b/api_docs/vis_type_timeseries.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/visTypeTimeseries title: "visTypeTimeseries" image: https://source.unsplash.com/400x175/?github description: API docs for the visTypeTimeseries plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypeTimeseries'] --- import visTypeTimeseriesObj from './vis_type_timeseries.devdocs.json'; diff --git a/api_docs/vis_type_vega.mdx b/api_docs/vis_type_vega.mdx index 0c3aabf3cf038..4108de2dd9ff4 100644 --- a/api_docs/vis_type_vega.mdx +++ b/api_docs/vis_type_vega.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/visTypeVega title: "visTypeVega" image: https://source.unsplash.com/400x175/?github description: API docs for the visTypeVega plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypeVega'] --- import visTypeVegaObj from './vis_type_vega.devdocs.json'; diff --git a/api_docs/vis_type_vislib.mdx b/api_docs/vis_type_vislib.mdx index dc9b21c52fa71..753c3bfe5e715 100644 --- a/api_docs/vis_type_vislib.mdx +++ b/api_docs/vis_type_vislib.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/visTypeVislib title: "visTypeVislib" image: https://source.unsplash.com/400x175/?github description: API docs for the visTypeVislib plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypeVislib'] --- import visTypeVislibObj from './vis_type_vislib.devdocs.json'; diff --git a/api_docs/vis_type_xy.mdx b/api_docs/vis_type_xy.mdx index bf0c5ff50627b..76b4076f2d5ab 100644 --- a/api_docs/vis_type_xy.mdx +++ b/api_docs/vis_type_xy.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/visTypeXy title: "visTypeXy" image: https://source.unsplash.com/400x175/?github description: API docs for the visTypeXy plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypeXy'] --- import visTypeXyObj from './vis_type_xy.devdocs.json'; diff --git a/api_docs/visualizations.mdx b/api_docs/visualizations.mdx index 3b7a0e17af6b8..d3a0ca23afaab 100644 --- a/api_docs/visualizations.mdx +++ b/api_docs/visualizations.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/visualizations title: "visualizations" image: https://source.unsplash.com/400x175/?github description: API docs for the visualizations plugin -date: 2023-12-18 +date: 2023-12-19 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visualizations'] --- import visualizationsObj from './visualizations.devdocs.json'; diff --git a/examples/discover_customization_examples/public/plugin.tsx b/examples/discover_customization_examples/public/plugin.tsx index 5eefb4932cc43..9368c943532a4 100644 --- a/examples/discover_customization_examples/public/plugin.tsx +++ b/examples/discover_customization_examples/public/plugin.tsx @@ -213,7 +213,6 @@ export class DiscoverCustomizationExamplesPlugin implements Plugin { {currentSavedSearch.title ?? 'None selected'} } - anchorClassName="eui-fullWidth" isOpen={isPopoverOpen} panelPaddingSize="none" closePopover={closePopover} @@ -280,7 +279,6 @@ export class DiscoverCustomizationExamplesPlugin implements Plugin { {currentSavedSearch.title ?? 'None selected'} } - anchorClassName="eui-fullWidth" isOpen={isPopoverOpen} panelPaddingSize="none" closePopover={closePopover} diff --git a/package.json b/package.json index d85136a35d99b..f2446fc5c27a0 100644 --- a/package.json +++ b/package.json @@ -102,7 +102,7 @@ "@elastic/datemath": "5.0.3", "@elastic/elasticsearch": "npm:@elastic/elasticsearch-canary@8.9.1-canary.1", "@elastic/ems-client": "8.5.1", - "@elastic/eui": "90.0.1-backport.0", + "@elastic/eui": "91.0.0-backport.0", "@elastic/filesaver": "1.1.2", "@elastic/node-crypto": "1.2.1", "@elastic/numeral": "^2.5.1", @@ -629,6 +629,7 @@ "@kbn/response-stream-plugin": "link:examples/response_stream", "@kbn/rison": "link:packages/kbn-rison", "@kbn/rollup-plugin": "link:x-pack/plugins/rollup", + "@kbn/router-utils": "link:packages/kbn-router-utils", "@kbn/routing-example-plugin": "link:examples/routing_example", "@kbn/rrule": "link:packages/kbn-rrule", "@kbn/rule-data-utils": "link:packages/kbn-rule-data-utils", @@ -905,7 +906,7 @@ "compare-versions": "3.5.1", "constate": "^3.3.2", "copy-to-clipboard": "^3.0.8", - "core-js": "^3.31.0", + "core-js": "^3.34.0", "cronstrue": "^1.51.0", "css-box-model": "^1.2.1", "css.escape": "^1.5.1", @@ -1176,6 +1177,7 @@ "@kbn/ci-stats-reporter": "link:packages/kbn-ci-stats-reporter", "@kbn/ci-stats-shipper-cli": "link:packages/kbn-ci-stats-shipper-cli", "@kbn/cli-dev-mode": "link:packages/kbn-cli-dev-mode", + "@kbn/code-owners": "link:packages/kbn-code-owners", "@kbn/core-analytics-browser-mocks": "link:packages/core/analytics/core-analytics-browser-mocks", "@kbn/core-analytics-server-mocks": "link:packages/core/analytics/core-analytics-server-mocks", "@kbn/core-application-browser-mocks": "link:packages/core/application/core-application-browser-mocks", @@ -1249,6 +1251,7 @@ "@kbn/failed-test-reporter-cli": "link:packages/kbn-failed-test-reporter-cli", "@kbn/find-used-node-modules": "link:packages/kbn-find-used-node-modules", "@kbn/ftr-common-functional-services": "link:packages/kbn-ftr-common-functional-services", + "@kbn/ftr-common-functional-ui-services": "link:packages/kbn-ftr-common-functional-ui-services", "@kbn/ftr-screenshot-filename": "link:packages/kbn-ftr-screenshot-filename", "@kbn/generate": "link:packages/kbn-generate", "@kbn/get-repo-files": "link:packages/kbn-get-repo-files", @@ -1445,7 +1448,7 @@ "@types/redux-logger": "^3.0.8", "@types/resolve": "^1.20.1", "@types/seedrandom": ">=2.0.0 <4.0.0", - "@types/selenium-webdriver": "^4.1.20", + "@types/selenium-webdriver": "^4.1.21", "@types/semver": "^7", "@types/set-value": "^2.0.0", "@types/sharp": "^0.30.4", @@ -1499,7 +1502,7 @@ "blob-polyfill": "^7.0.20220408", "callsites": "^3.1.0", "chance": "1.0.18", - "chromedriver": "^119.0.1", + "chromedriver": "^120.0.0", "clean-webpack-plugin": "^3.0.0", "cli-progress": "^3.12.0", "cli-table3": "^0.6.1", @@ -1548,7 +1551,7 @@ "file-loader": "^4.2.0", "find-cypress-specs": "^1.35.1", "form-data": "^4.0.0", - "geckodriver": "^4.2.1", + "geckodriver": "^4.3.0", "gulp-brotli": "^3.0.0", "gulp-postcss": "^9.0.1", "gulp-sourcemaps": "2.6.5", @@ -1558,6 +1561,7 @@ "html": "1.0.0", "html-loader": "^1.3.2", "http-proxy": "^1.18.1", + "ignore": "^5.3.0", "is-path-inside": "^3.0.2", "jest": "^29.6.1", "jest-axe": "^5.0.0", @@ -1623,7 +1627,7 @@ "resolve": "^1.22.0", "rxjs-marbles": "^7.0.1", "sass-loader": "^10.4.1", - "selenium-webdriver": "^4.15.0", + "selenium-webdriver": "^4.16.0", "simple-git": "^3.16.0", "sinon": "^7.4.2", "sort-package-json": "^1.53.1", @@ -1640,7 +1644,7 @@ "table": "^6.8.1", "tape": "^5.0.1", "tempy": "^0.3.0", - "terser": "^5.16.5", + "terser": "^5.26.0", "terser-webpack-plugin": "^4.2.3", "tough-cookie": "^4.1.2", "tree-kill": "^1.2.2", diff --git a/packages/core/chrome/core-chrome-browser-internal/src/ui/header/__snapshots__/collapsible_nav.test.tsx.snap b/packages/core/chrome/core-chrome-browser-internal/src/ui/header/__snapshots__/collapsible_nav.test.tsx.snap index 416ce39bbf9ba..f505901f37abb 100644 --- a/packages/core/chrome/core-chrome-browser-internal/src/ui/header/__snapshots__/collapsible_nav.test.tsx.snap +++ b/packages/core/chrome/core-chrome-browser-internal/src/ui/header/__snapshots__/collapsible_nav.test.tsx.snap @@ -157,7 +157,7 @@ Array [ aria-labelledby="generated-id" class="euiAccordion__childWrapper emotion-euiAccordion__childWrapper-isOpen" id="generated-id" - role="region" + role="group" style="block-size: 0;" tabindex="-1" > @@ -281,7 +281,7 @@ Array [ aria-labelledby="generated-id" class="euiAccordion__childWrapper emotion-euiAccordion__childWrapper-isOpen" id="generated-id" - role="region" + role="group" style="block-size: 0;" tabindex="-1" > @@ -412,7 +412,7 @@ Array [ aria-labelledby="generated-id" class="euiAccordion__childWrapper emotion-euiAccordion__childWrapper-isOpen" id="generated-id" - role="region" + role="group" style="block-size: 0;" tabindex="-1" > @@ -526,7 +526,7 @@ Array [ aria-labelledby="generated-id" class="euiAccordion__childWrapper emotion-euiAccordion__childWrapper-isOpen" id="generated-id" - role="region" + role="group" style="block-size: 0;" tabindex="-1" > @@ -623,7 +623,7 @@ Array [ aria-labelledby="generated-id" class="euiAccordion__childWrapper emotion-euiAccordion__childWrapper-isOpen" id="generated-id" - role="region" + role="group" style="block-size: 0;" tabindex="-1" > diff --git a/packages/core/chrome/core-chrome-browser-internal/src/ui/header/__snapshots__/header.test.tsx.snap b/packages/core/chrome/core-chrome-browser-internal/src/ui/header/__snapshots__/header.test.tsx.snap index 689888d4d82a5..209e2f1d0c113 100644 --- a/packages/core/chrome/core-chrome-browser-internal/src/ui/header/__snapshots__/header.test.tsx.snap +++ b/packages/core/chrome/core-chrome-browser-internal/src/ui/header/__snapshots__/header.test.tsx.snap @@ -108,37 +108,33 @@ Array [ class="euiHeaderSectionItem emotion-euiHeaderSectionItem" >
- + +
{ ), 'euiAbsoluteTab.dateFormatError': ({ dateFormat }: EuiValues) => i18n.translate('core.euiAbsoluteTab.dateFormatError', { - defaultMessage: 'Expected format: {dateFormat}', + defaultMessage: 'Allowed formats: {dateFormat}, ISO 8601, RFC 2822, or Unix timestamp.', values: { dateFormat }, }), 'euiRelativeTab.fullDescription': ({ unit }: EuiValues) => @@ -1454,6 +1454,9 @@ export const getEuiContextMapping = (): EuiTokensObject => { 'euiRelativeTab.dateInputError': i18n.translate('core.euiRelativeTab.dateInputError', { defaultMessage: 'Must be a valid range', }), + 'euiAbsoluteTab.dateFormatHint': i18n.translate('core.euiAbsoluteTab.dateFormatHint', { + defaultMessage: 'Press the Enter key to parse as a date.', + }), 'euiResizableButton.horizontalResizerAriaLabel': i18n.translate( 'core.euiResizableButton.horizontalResizerAriaLabel', { diff --git a/packages/home/sample_data_card/src/__snapshots__/sample_data_card.test.tsx.snap b/packages/home/sample_data_card/src/__snapshots__/sample_data_card.test.tsx.snap index 9f397dc7ccbd7..269499f65547a 100644 --- a/packages/home/sample_data_card/src/__snapshots__/sample_data_card.test.tsx.snap +++ b/packages/home/sample_data_card/src/__snapshots__/sample_data_card.test.tsx.snap @@ -83,33 +83,29 @@ exports[`SampleDataCard installed renders with app links 1`] = ` class="euiFlexItem emotion-euiFlexItem-growZero" >
-
- -
+ + +
diff --git a/packages/home/sample_data_card/src/footer/__snapshots__/view_button.test.tsx.snap b/packages/home/sample_data_card/src/footer/__snapshots__/view_button.test.tsx.snap index ca5d1ccce0739..472852006ca26 100644 --- a/packages/home/sample_data_card/src/footer/__snapshots__/view_button.test.tsx.snap +++ b/packages/home/sample_data_card/src/footer/__snapshots__/view_button.test.tsx.snap @@ -2,65 +2,57 @@ exports[`should render popover when appLinks is not empty 1`] = `
-
- -
+ + +
`; exports[`should render popover with ordered appLinks 1`] = `
-
- -
+ + +
`; diff --git a/packages/kbn-apm-synthtrace-client/src/lib/apm/apm_fields.ts b/packages/kbn-apm-synthtrace-client/src/lib/apm/apm_fields.ts index 7c3ab2c2b1e3a..3ee43dc63f04f 100644 --- a/packages/kbn-apm-synthtrace-client/src/lib/apm/apm_fields.ts +++ b/packages/kbn-apm-synthtrace-client/src/lib/apm/apm_fields.ts @@ -50,6 +50,35 @@ export interface GeoLocation { type: string; } +export interface APMStacktrace { + abs_path?: string; + classname?: string; + context?: { + post?: string[]; + pre?: string[]; + }; + exclude_from_grouping?: boolean; + filename?: string; + function?: string; + module?: string; + library_frame?: boolean; + line?: + | { + column?: number; + number: number; + } + | { + context?: string; + }; + sourcemap?: { + error?: string; + updated?: boolean; + }; + vars?: { + [key: string]: unknown; + }; +} + type ExperimentalFields = Partial<{ 'metricset.interval': string; 'transaction.duration.summary': string; @@ -80,6 +109,8 @@ export type ApmFields = Fields<{ 'cloud.provider': string; 'cloud.region': string; 'cloud.service.name': string; + // otel + 'code.stacktrace': string; 'container.id': string; 'destination.address': string; 'destination.port': number; @@ -169,6 +200,7 @@ export type ApmFields = Fields<{ 'span.duration.us': number; 'span.id': string; 'span.name': string; + 'span.stacktrace': APMStacktrace[]; 'span.self_time.count': number; 'span.self_time.sum.us': number; 'span.subtype': string; diff --git a/packages/kbn-babel-preset/node_preset.js b/packages/kbn-babel-preset/node_preset.js index 6cd89bdcdecbe..a0c5a0114873c 100644 --- a/packages/kbn-babel-preset/node_preset.js +++ b/packages/kbn-babel-preset/node_preset.js @@ -31,7 +31,7 @@ module.exports = (_, options = {}) => { // Because of that we should use for that value the same version we install // in the package.json in order to have the same polyfills between the environment // and the tests - corejs: '3.31.0', + corejs: '3.34.0', bugfixes: true, ...(options['@babel/preset-env'] || {}), diff --git a/packages/kbn-babel-preset/webpack_preset.js b/packages/kbn-babel-preset/webpack_preset.js index 75dd1b642c29f..84f3771816dfa 100644 --- a/packages/kbn-babel-preset/webpack_preset.js +++ b/packages/kbn-babel-preset/webpack_preset.js @@ -19,7 +19,7 @@ module.exports = (api, options = {}) => { modules: false, // Please read the explanation for this // in node_preset.js - corejs: '3.31.0', + corejs: '3.34.0', bugfixes: true, browserslistEnv: api.env('production') ? 'production' : 'dev', }, diff --git a/packages/kbn-check-mappings-update-cli/current_fields.json b/packages/kbn-check-mappings-update-cli/current_fields.json index 7f7c317f7f63a..c745e4886cde9 100644 --- a/packages/kbn-check-mappings-update-cli/current_fields.json +++ b/packages/kbn-check-mappings-update-cli/current_fields.json @@ -968,5 +968,8 @@ "kuery", "serviceEnvironmentFilterEnabled", "serviceNameFilterEnabled" + ], + "cloud-security-posture-settings": [ + "rules" ] } diff --git a/packages/kbn-check-mappings-update-cli/current_mappings.json b/packages/kbn-check-mappings-update-cli/current_mappings.json index fe4b3dba0940d..7f5c94647b941 100644 --- a/packages/kbn-check-mappings-update-cli/current_mappings.json +++ b/packages/kbn-check-mappings-update-cli/current_mappings.json @@ -2349,6 +2349,10 @@ } } }, + "cloud-security-posture-settings": { + "dynamic": false, + "properties": {} + }, "slo": { "dynamic": false, "properties": { diff --git a/packages/kbn-code-owners/README.md b/packages/kbn-code-owners/README.md new file mode 100644 index 0000000000000..b25944e2efbe6 --- /dev/null +++ b/packages/kbn-code-owners/README.md @@ -0,0 +1,3 @@ +# @kbn/code-owners + +This package contains utility methods to determine GitHub code ownership for files in the repository. diff --git a/packages/kbn-code-owners/index.ts b/packages/kbn-code-owners/index.ts new file mode 100644 index 0000000000000..0b2cd53a0b3a9 --- /dev/null +++ b/packages/kbn-code-owners/index.ts @@ -0,0 +1,10 @@ +/* + * 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 { PathWithOwners } from './src/file_code_owner'; +export { getPathsWithOwnersReversed, getCodeOwnersForFile } from './src/file_code_owner'; diff --git a/packages/kbn-code-owners/jest.config.js b/packages/kbn-code-owners/jest.config.js new file mode 100644 index 0000000000000..471e87b73b161 --- /dev/null +++ b/packages/kbn-code-owners/jest.config.js @@ -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/jest_node', + rootDir: '../..', + roots: ['/packages/kbn-code-owners'], +}; diff --git a/packages/kbn-code-owners/kibana.jsonc b/packages/kbn-code-owners/kibana.jsonc new file mode 100644 index 0000000000000..66d2e57ca15c1 --- /dev/null +++ b/packages/kbn-code-owners/kibana.jsonc @@ -0,0 +1,6 @@ +{ + "type": "shared-common", + "id": "@kbn/code-owners", + "owner": "@elastic/appex-qa", + "devOnly": true +} diff --git a/packages/kbn-code-owners/package.json b/packages/kbn-code-owners/package.json new file mode 100644 index 0000000000000..38a7c77800d0e --- /dev/null +++ b/packages/kbn-code-owners/package.json @@ -0,0 +1,6 @@ +{ + "name": "@kbn/code-owners", + "private": true, + "version": "1.0.0", + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/kbn-code-owners/src/file_code_owner.ts b/packages/kbn-code-owners/src/file_code_owner.ts new file mode 100644 index 0000000000000..56f3c54ef1603 --- /dev/null +++ b/packages/kbn-code-owners/src/file_code_owner.ts @@ -0,0 +1,67 @@ +/* + * 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 { REPO_ROOT } from '@kbn/repo-info'; +import { createFailError } from '@kbn/dev-cli-errors'; +import { join as joinPath } from 'path'; +import { existsSync, readFileSync } from 'fs'; + +import type { Ignore } from 'ignore'; +import ignore from 'ignore'; + +export interface PathWithOwners { + path: string; + teams: string; + ignorePattern: Ignore; +} + +/** + * Get the .github/CODEOWNERS entries, prepared for path matching. + * The last matching CODEOWNERS entry has highest precedence: + * https://help.github.com/articles/about-codeowners/ + * so entries are returned in reversed order to later search for the first match. + */ +export function getPathsWithOwnersReversed(): PathWithOwners[] { + const codeownersPath = joinPath(REPO_ROOT, '.github', 'CODEOWNERS'); + if (existsSync(codeownersPath) === false) { + throw createFailError(`Unable to determine code owners: file ${codeownersPath} not found`); + } + const codeownersContent = readFileSync(codeownersPath, { encoding: 'utf8', flag: 'r' }); + const codeownersLines = codeownersContent.split(/\r?\n/); + const codeowners = codeownersLines + .map((line) => line.trim()) + .filter((line) => line && line[0] !== '#'); + + const pathsWithOwners: PathWithOwners[] = codeowners.map((c) => { + const [path, ...ghTeams] = c.split(/\s+/); + return { + path, + teams: ghTeams.map((t) => t.replace('@', '')).join(), + // register CODEOWNERS entries with the `ignores` lib for later path matching + ignorePattern: ignore().add([path]), + }; + }); + + return pathsWithOwners.reverse(); +} + +/** + * Get the GitHub CODEOWNERS for a file in the repository + * @param filePath the file to get code owners for + * @param reversedCodeowners a cached reversed code owners list, use to speed up multiple requests + */ +export function getCodeOwnersForFile( + filePath: string, + reversedCodeowners?: PathWithOwners[] +): string | undefined { + const pathsWithOwners = reversedCodeowners ?? getPathsWithOwnersReversed(); + + const match = pathsWithOwners.find((p) => p.ignorePattern.test(filePath).ignored); + + return match?.teams; +} diff --git a/packages/kbn-code-owners/tsconfig.json b/packages/kbn-code-owners/tsconfig.json new file mode 100644 index 0000000000000..e97f927147d73 --- /dev/null +++ b/packages/kbn-code-owners/tsconfig.json @@ -0,0 +1,20 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types", + "types": [ + "jest", + "node" + ] + }, + "include": [ + "**/*.ts", + ], + "exclude": [ + "target/**/*" + ], + "kbn_references": [ + "@kbn/repo-info", + "@kbn/dev-cli-errors" + ] +} diff --git a/packages/kbn-doc-links/src/get_doc_links.ts b/packages/kbn-doc-links/src/get_doc_links.ts index a697000bbebbf..57ae1cc9f6e4a 100644 --- a/packages/kbn-doc-links/src/get_doc_links.ts +++ b/packages/kbn-doc-links/src/get_doc_links.ts @@ -39,6 +39,7 @@ export const getDocLinks = ({ kibanaBranch, buildFlavor }: GetDocLinkOptions): D const SERVERLESS_DOCS = `${DOCS_WEBSITE_URL}serverless/`; const SERVERLESS_ELASTICSEARCH_DOCS = `${SERVERLESS_DOCS}elasticsearch/`; const SEARCH_LABS_REPO = `${ELASTIC_GITHUB}elasticsearch-labs/`; + const isServerless = buildFlavor === 'serverless'; return deepFreeze({ settings: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/settings.html`, @@ -316,7 +317,7 @@ export const getDocLinks = ({ kibanaBranch, buildFlavor }: GetDocLinkOptions): D luceneExpressions: `${ELASTICSEARCH_DOCS}modules-scripting-expression.html`, }, indexPatterns: { - introduction: `${KIBANA_DOCS}data-views.html`, + introduction: isServerless ? `${SERVERLESS_DOCS}data-views` : `${KIBANA_DOCS}data-views.html`, fieldFormattersNumber: `${KIBANA_DOCS}numeral.html`, fieldFormattersString: `${KIBANA_DOCS}managing-data-views.html#string-field-formatters`, runtimeFields: `${KIBANA_DOCS}managing-data-views.html#runtime-fields`, @@ -486,7 +487,9 @@ export const getDocLinks = ({ kibanaBranch, buildFlavor }: GetDocLinkOptions): D }, management: { dashboardSettings: `${KIBANA_DOCS}advanced-options.html#kibana-dashboard-settings`, - indexManagement: `${ELASTICSEARCH_DOCS}index-mgmt.html`, + indexManagement: isServerless + ? `${SERVERLESS_DOCS}index-management` + : `${ELASTICSEARCH_DOCS}index-mgmt.html`, kibanaSearchSettings: `${KIBANA_DOCS}advanced-options.html#kibana-search-settings`, discoverSettings: `${KIBANA_DOCS}advanced-options.html#kibana-discover-settings`, visualizationSettings: `${KIBANA_DOCS}advanced-options.html#kibana-visualization-settings`, @@ -529,7 +532,7 @@ export const getDocLinks = ({ kibanaBranch, buildFlavor }: GetDocLinkOptions): D nlpImportModel: `${MACHINE_LEARNING_DOCS}ml-nlp-import-model.html`, }, transforms: { - guide: `${ELASTICSEARCH_DOCS}transforms.html`, + guide: isServerless ? `${SERVERLESS_DOCS}transforms` : `${ELASTICSEARCH_DOCS}transforms.html`, alertingRules: `${ELASTICSEARCH_DOCS}transform-alerts.html`, }, visualize: { @@ -562,8 +565,12 @@ export const getDocLinks = ({ kibanaBranch, buildFlavor }: GetDocLinkOptions): D sloBurnRateRule: `${ELASTIC_WEBSITE_URL}guide/en/observability/${DOC_LINK_VERSION}/slo-burn-rate-alert.html`, }, alerting: { - guide: `${KIBANA_DOCS}create-and-manage-rules.html`, - actionTypes: `${KIBANA_DOCS}action-types.html`, + guide: isServerless + ? `${SERVERLESS_DOCS}rules` + : `${KIBANA_DOCS}create-and-manage-rules.html`, + actionTypes: isServerless + ? `${SERVERLESS_DOCS}action-connectors` + : `${KIBANA_DOCS}action-types.html`, apmRules: `${KIBANA_DOCS}apm-alerts.html`, emailAction: `${KIBANA_DOCS}email-action-type.html`, emailActionConfig: `${KIBANA_DOCS}email-action-type.html`, @@ -573,7 +580,9 @@ export const getDocLinks = ({ kibanaBranch, buildFlavor }: GetDocLinkOptions): D indexAction: `${KIBANA_DOCS}index-action-type.html`, esQuery: `${KIBANA_DOCS}rule-type-es-query.html`, indexThreshold: `${KIBANA_DOCS}rule-type-index-threshold.html`, - maintenanceWindows: `${KIBANA_DOCS}maintenance-windows.html`, + maintenanceWindows: isServerless + ? `${SERVERLESS_DOCS}maintenance-windows` + : `${KIBANA_DOCS}maintenance-windows.html`, pagerDutyAction: `${KIBANA_DOCS}pagerduty-action-type.html`, preconfiguredConnectors: `${KIBANA_DOCS}pre-configured-connectors.html`, preconfiguredAlertHistoryConnector: `${KIBANA_DOCS}pre-configured-connectors.html#preconfigured-connector-alert-history`, @@ -590,7 +599,7 @@ export const getDocLinks = ({ kibanaBranch, buildFlavor }: GetDocLinkOptions): D }, maps: { connectToEms: `${KIBANA_DOCS}maps-connect-to-ems.html`, - guide: `${KIBANA_DOCS}maps.html`, + guide: isServerless ? `${SERVERLESS_DOCS}maps` : `${KIBANA_DOCS}maps.html`, importGeospatialPrivileges: `${KIBANA_DOCS}import-geospatial-data.html#import-geospatial-privileges`, gdalTutorial: `${ELASTIC_WEBSITE_URL}blog/how-to-ingest-geospatial-data-into-elasticsearch-with-gdal`, termJoinsExample: `${KIBANA_DOCS}terms-join.html#_example_term_join`, @@ -730,7 +739,9 @@ export const getDocLinks = ({ kibanaBranch, buildFlavor }: GetDocLinkOptions): D kv: `${ELASTICSEARCH_DOCS}kv-processor.html`, lowercase: `${ELASTICSEARCH_DOCS}lowercase-processor.html`, pipeline: `${ELASTICSEARCH_DOCS}pipeline-processor.html`, - pipelines: `${ELASTICSEARCH_DOCS}ingest.html`, + pipelines: isServerless + ? `${SERVERLESS_DOCS}ingest-pipelines` + : `${ELASTICSEARCH_DOCS}ingest.html`, csvPipelines: `${ELASTIC_WEBSITE_URL}guide/en/ecs/${DOC_LINK_VERSION}/ecs-converting.html`, pipelineFailure: `${ELASTICSEARCH_DOCS}ingest.html#handling-pipeline-failures`, processors: `${ELASTICSEARCH_DOCS}processors.html`, @@ -770,7 +781,7 @@ export const getDocLinks = ({ kibanaBranch, buildFlavor }: GetDocLinkOptions): D installElasticAgentStandalone: `${FLEET_DOCS}install-standalone-elastic-agent.html`, upgradeElasticAgent: `${FLEET_DOCS}upgrade-elastic-agent.html`, learnMoreBlog: `${ELASTIC_WEBSITE_URL}blog/elastic-agent-and-fleet-make-it-easier-to-integrate-your-systems-with-elastic`, - apiKeysLearnMore: `${KIBANA_DOCS}api-keys.html`, + apiKeysLearnMore: isServerless ? `${SERVERLESS_DOCS}api-keys` : `${KIBANA_DOCS}api-keys.html`, onPremRegistry: `${FLEET_DOCS}air-gapped.html`, packageSignatures: `${FLEET_DOCS}package-signatures.html`, secureLogstash: `${FLEET_DOCS}secure-logstash-connections.html`, diff --git a/packages/kbn-ftr-common-functional-ui-services/README.md b/packages/kbn-ftr-common-functional-ui-services/README.md new file mode 100644 index 0000000000000..b6fbe963d099b --- /dev/null +++ b/packages/kbn-ftr-common-functional-ui-services/README.md @@ -0,0 +1,3 @@ +# @kbn/ftr-common-functional-ui-services + +Common test services for ui actions. diff --git a/packages/kbn-ftr-common-functional-ui-services/index.ts b/packages/kbn-ftr-common-functional-ui-services/index.ts new file mode 100644 index 0000000000000..5fe8ae6fd0164 --- /dev/null +++ b/packages/kbn-ftr-common-functional-ui-services/index.ts @@ -0,0 +1,10 @@ +/* + * 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 { services as commonFunctionalUIServices } from './services/all'; +export type { FtrProviderContext } from './services/ftr_provider_context'; diff --git a/packages/kbn-ftr-common-functional-ui-services/jest.config.js b/packages/kbn-ftr-common-functional-ui-services/jest.config.js new file mode 100644 index 0000000000000..afd295ad81883 --- /dev/null +++ b/packages/kbn-ftr-common-functional-ui-services/jest.config.js @@ -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/jest_node', + rootDir: '../..', + roots: ['/packages/kbn-ftr-common-functional-ui-services'], +}; diff --git a/packages/kbn-ftr-common-functional-ui-services/kibana.jsonc b/packages/kbn-ftr-common-functional-ui-services/kibana.jsonc new file mode 100644 index 0000000000000..5437a12260a9c --- /dev/null +++ b/packages/kbn-ftr-common-functional-ui-services/kibana.jsonc @@ -0,0 +1,6 @@ +{ + "type": "shared-common", + "id": "@kbn/ftr-common-functional-ui-services", + "owner": "@elastic/appex-qa", + "devOnly": true +} diff --git a/packages/kbn-ftr-common-functional-ui-services/package.json b/packages/kbn-ftr-common-functional-ui-services/package.json new file mode 100644 index 0000000000000..4fad67bc28fa0 --- /dev/null +++ b/packages/kbn-ftr-common-functional-ui-services/package.json @@ -0,0 +1,6 @@ +{ + "name": "@kbn/ftr-common-functional-ui-services", + "private": true, + "version": "1.0.0", + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/kbn-ftr-common-functional-ui-services/services/all.ts b/packages/kbn-ftr-common-functional-ui-services/services/all.ts new file mode 100644 index 0000000000000..8c8a723660117 --- /dev/null +++ b/packages/kbn-ftr-common-functional-ui-services/services/all.ts @@ -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. + */ + +import { RetryOnStaleProvider } from './retry_on_stale'; + +export const services = { + retryOnStale: RetryOnStaleProvider, +}; diff --git a/packages/kbn-ftr-common-functional-ui-services/services/ftr_provider_context.ts b/packages/kbn-ftr-common-functional-ui-services/services/ftr_provider_context.ts new file mode 100644 index 0000000000000..979658fbd8edd --- /dev/null +++ b/packages/kbn-ftr-common-functional-ui-services/services/ftr_provider_context.ts @@ -0,0 +1,16 @@ +/* + * 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 { GenericFtrProviderContext, GenericFtrService } from '@kbn/test'; + +import type { services } from './all'; + +type Services = typeof services; + +export type FtrProviderContext = GenericFtrProviderContext; +export class FtrService extends GenericFtrService {} diff --git a/test/functional/services/common/retry_on_stale.ts b/packages/kbn-ftr-common-functional-ui-services/services/retry_on_stale.ts similarity index 95% rename from test/functional/services/common/retry_on_stale.ts rename to packages/kbn-ftr-common-functional-ui-services/services/retry_on_stale.ts index 4a190266458ec..8f4b374a8b3cd 100644 --- a/test/functional/services/common/retry_on_stale.ts +++ b/packages/kbn-ftr-common-functional-ui-services/services/retry_on_stale.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { FtrProviderContext } from '../../ftr_provider_context'; +import { FtrProviderContext } from './ftr_provider_context'; const MAX_ATTEMPTS = 10; diff --git a/packages/kbn-ftr-common-functional-ui-services/tsconfig.json b/packages/kbn-ftr-common-functional-ui-services/tsconfig.json new file mode 100644 index 0000000000000..0c77cc5d6b917 --- /dev/null +++ b/packages/kbn-ftr-common-functional-ui-services/tsconfig.json @@ -0,0 +1,19 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types", + "types": [ + "jest", + "node" + ] + }, + "include": [ + "**/*.ts", + ], + "exclude": [ + "target/**/*" + ], + "kbn_references": [ + "@kbn/test", + ] +} diff --git a/packages/kbn-optimizer/limits.yml b/packages/kbn-optimizer/limits.yml index 764fe35dd759d..1e4c82b5226df 100644 --- a/packages/kbn-optimizer/limits.yml +++ b/packages/kbn-optimizer/limits.yml @@ -23,7 +23,7 @@ pageLoadAssetSize: cloudSecurityPosture: 19109 console: 46091 contentManagement: 16254 - controls: 40000 + controls: 55082 core: 435325 crossClusterReplication: 65408 customIntegrations: 22034 diff --git a/packages/kbn-router-utils/README.md b/packages/kbn-router-utils/README.md new file mode 100644 index 0000000000000..e5dcb4cdb4fe4 --- /dev/null +++ b/packages/kbn-router-utils/README.md @@ -0,0 +1,34 @@ +# @kbn/router-utils + +This package provides util functions when working with the router. + +## getRouterLinkProps + +Useful to generate link component properties for HTML elements, this link properties will allow them to behave as native links and handle events such as open in a new tab, or client-side navigation without refreshing the whole page. + +### Example + +We want a button to both navigate to Discover client-side or open on a new window. + +```ts +const DiscoverLink = (discoverLinkParams) => { + const discoverUrl = discover.locator?.getRedirectUrl(discoverLinkParams); + + const navigateToDiscover = () => { + discover.locator?.navigate(discoverLinkParams); + }; + + const linkProps = getRouterLinkProps({ + href: discoverUrl, + onClick: navigateToDiscover, + }); + + return ( + <> + + {discoverLinkTitle} + + + ); +}; +``` diff --git a/packages/kbn-router-utils/index.ts b/packages/kbn-router-utils/index.ts new file mode 100644 index 0000000000000..f5ed5ed7e7604 --- /dev/null +++ b/packages/kbn-router-utils/index.ts @@ -0,0 +1,9 @@ +/* + * 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 { getRouterLinkProps } from './src/get_router_link_props'; diff --git a/packages/kbn-router-utils/jest.config.js b/packages/kbn-router-utils/jest.config.js new file mode 100644 index 0000000000000..32497360f9419 --- /dev/null +++ b/packages/kbn-router-utils/jest.config.js @@ -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: ['/packages/kbn-router-utils'], +}; diff --git a/packages/kbn-router-utils/kibana.jsonc b/packages/kbn-router-utils/kibana.jsonc new file mode 100644 index 0000000000000..c255dacb11c70 --- /dev/null +++ b/packages/kbn-router-utils/kibana.jsonc @@ -0,0 +1,5 @@ +{ + "type": "shared-common", + "id": "@kbn/router-utils", + "owner": "@elastic/obs-ux-logs-team" +} diff --git a/packages/kbn-router-utils/package.json b/packages/kbn-router-utils/package.json new file mode 100644 index 0000000000000..d84ddd2c06bc2 --- /dev/null +++ b/packages/kbn-router-utils/package.json @@ -0,0 +1,6 @@ +{ + "name": "@kbn/router-utils", + "private": true, + "version": "1.0.0", + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/x-pack/plugins/observability_log_explorer/public/utils/get_router_link_props.ts b/packages/kbn-router-utils/src/get_router_link_props/index.ts similarity index 57% rename from x-pack/plugins/observability_log_explorer/public/utils/get_router_link_props.ts rename to packages/kbn-router-utils/src/get_router_link_props/index.ts index a325df1a7e86f..f3def2e88650b 100644 --- a/x-pack/plugins/observability_log_explorer/public/utils/get_router_link_props.ts +++ b/packages/kbn-router-utils/src/get_router_link_props/index.ts @@ -1,8 +1,9 @@ /* * 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; you may not use this file except in compliance with the Elastic License - * 2.0. + * 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. */ interface GetRouterLinkPropsDeps { @@ -15,6 +16,18 @@ const isModifiedEvent = (event: React.MouseEvent) => const isLeftClickEvent = (event: React.MouseEvent) => event.button === 0; +/** + * + * getRouterLinkProps is an util that enable HTML elements, such buttons, to + * behave as links. + * @example + * const linkProps = getRouterLinkProps({ href: 'https://my-link', onClick: () => {console.log('click event')} }); + * My custom link + * @param href target url + * @param onClick onClick callback + * @returns An object that contains an href and a guardedClick handler that will + * manage behaviours such as leftClickEvent and event with modifiers (Ctrl, Shift, etc) + */ export const getRouterLinkProps = ({ href, onClick }: GetRouterLinkPropsDeps) => { const guardedClickHandler = (event: React.MouseEvent) => { if (event.defaultPrevented) { diff --git a/packages/kbn-router-utils/tsconfig.json b/packages/kbn-router-utils/tsconfig.json new file mode 100644 index 0000000000000..87f865132f4b4 --- /dev/null +++ b/packages/kbn-router-utils/tsconfig.json @@ -0,0 +1,19 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types", + "types": [ + "jest", + "node", + "react" + ] + }, + "include": [ + "**/*.ts", + "**/*.tsx", + ], + "exclude": [ + "target/**/*" + ], + "kbn_references": [] +} diff --git a/packages/kbn-securitysolution-autocomplete/src/field/__tests__/__snapshots__/index.test.tsx.snap b/packages/kbn-securitysolution-autocomplete/src/field/__tests__/__snapshots__/index.test.tsx.snap index 8cc75ec2beab8..1a4c9076a20d6 100644 --- a/packages/kbn-securitysolution-autocomplete/src/field/__tests__/__snapshots__/index.test.tsx.snap +++ b/packages/kbn-securitysolution-autocomplete/src/field/__tests__/__snapshots__/index.test.tsx.snap @@ -10,90 +10,7 @@ Object { data-test-subj="fieldAutocompleteComboBox" >
-
-
-
-
- - - machine.os.raw - - - -
-
- - -
-
-
-
-
- - - , - "container":
-
-
-
- - - machine.os.raw - -
+ , + "container":
+
+
+
+
+
+ +
+
+ + +
+
+
+
+
, "debug": [Function], "findAllByAltText": [Function], @@ -227,46 +199,32 @@ Object { data-test-subj="fieldAutocompleteComboBox" >
-
- - - machine.os.raw - - - -
+
@@ -280,46 +238,32 @@ Object { data-test-subj="fieldAutocompleteComboBox" >
-
- - - machine.os.raw - - - -
+
@@ -390,79 +334,7 @@ Object { data-test-subj="fieldAutocompleteComboBox" >
-
-
-
-
- - - machine.os.raw - - - -
-
- -
-
-
-
-
-
-
- , - "container":
-
-
-
- - - machine.os.raw - -
+ , + "container":
+
+
+
+
+
+ +
+
+ +
+
+
+
+
, "debug": [Function], "findAllByAltText": [Function], @@ -585,72 +501,7 @@ Object { data-test-subj="fieldAutocompleteComboBox" >
-
-
-
-
- - - machine.os.raw - - - -
-
- -
-
-
-
-
-
-
- , - "container":
-
-
-
- - - machine.os.raw - -
+ , + "container":
+
+
+
+
+
+ +
+
+ +
+
+
+
+
, "debug": [Function], "findAllByAltText": [Function], diff --git a/packages/kbn-securitysolution-autocomplete/src/field/__tests__/index.test.tsx b/packages/kbn-securitysolution-autocomplete/src/field/__tests__/index.test.tsx index 48f7a109646f0..9ac7d9e58ee8b 100644 --- a/packages/kbn-securitysolution-autocomplete/src/field/__tests__/index.test.tsx +++ b/packages/kbn-securitysolution-autocomplete/src/field/__tests__/index.test.tsx @@ -7,7 +7,7 @@ */ import React from 'react'; -import { fireEvent, render, waitFor } from '@testing-library/react'; +import { fireEvent, render, waitFor, within } from '@testing-library/react'; import '@testing-library/jest-dom'; import { FieldComponent } from '..'; @@ -31,7 +31,9 @@ describe('FieldComponent', () => { /> ); expect(wrapper).toMatchSnapshot(); - expect(wrapper.getByTestId('fieldAutocompleteComboBox')).toHaveTextContent('machine.os.raw'); + const comboBox = wrapper.getByTestId('fieldAutocompleteComboBox'); + const input = within(comboBox).getByRole('combobox'); + expect(input).toHaveAttribute('value', 'machine.os.raw'); }); it('should render the component disabled if isDisabled is true', () => { const wrapper = render( diff --git a/packages/kbn-securitysolution-autocomplete/src/field_value_lists/index.test.tsx b/packages/kbn-securitysolution-autocomplete/src/field_value_lists/index.test.tsx index acd1a315d2c48..733e111fb4dd5 100644 --- a/packages/kbn-securitysolution-autocomplete/src/field_value_lists/index.test.tsx +++ b/packages/kbn-securitysolution-autocomplete/src/field_value_lists/index.test.tsx @@ -182,9 +182,9 @@ describe('AutocompleteFieldListsComponent', () => { expect( wrapper - .find(`[data-test-subj="valuesAutocompleteComboBox listsComboxBox"] EuiComboBoxPill`) + .find(`[data-test-subj="valuesAutocompleteComboBox listsComboxBox"] input`) .at(0) - .text() + .props().value ).toEqual('some name'); }); diff --git a/packages/kbn-securitysolution-autocomplete/src/field_value_match/index.test.tsx b/packages/kbn-securitysolution-autocomplete/src/field_value_match/index.test.tsx index 24bb72c3058ac..5d4f8cd89f1cc 100644 --- a/packages/kbn-securitysolution-autocomplete/src/field_value_match/index.test.tsx +++ b/packages/kbn-securitysolution-autocomplete/src/field_value_match/index.test.tsx @@ -166,7 +166,7 @@ describe('AutocompleteFieldMatchComponent', () => { ); expect( - wrapper.find('[data-test-subj="valuesAutocompleteMatch"] EuiComboBoxPill').at(0).text() + wrapper.find('[data-test-subj="valuesAutocompleteMatch"] input').at(0).props().value ).toEqual('127.0.0.1'); }); diff --git a/packages/kbn-securitysolution-autocomplete/src/field_value_wildcard/index.test.tsx b/packages/kbn-securitysolution-autocomplete/src/field_value_wildcard/index.test.tsx index 9eab42f5cec73..ec442385a1fd3 100644 --- a/packages/kbn-securitysolution-autocomplete/src/field_value_wildcard/index.test.tsx +++ b/packages/kbn-securitysolution-autocomplete/src/field_value_wildcard/index.test.tsx @@ -168,7 +168,7 @@ describe('AutocompleteFieldWildcardComponent', () => { ); expect( - wrapper.find('[data-test-subj="valuesAutocompleteWildcard"] EuiComboBoxPill').at(0).text() + wrapper.find('[data-test-subj="valuesAutocompleteWildcard"] input').at(0).props().value ).toEqual('/opt/*/app.dmg'); }); diff --git a/packages/kbn-securitysolution-autocomplete/src/operator/index.test.tsx b/packages/kbn-securitysolution-autocomplete/src/operator/index.test.tsx index 954b14a8ea244..21ed99dce4b72 100644 --- a/packages/kbn-securitysolution-autocomplete/src/operator/index.test.tsx +++ b/packages/kbn-securitysolution-autocomplete/src/operator/index.test.tsx @@ -152,7 +152,7 @@ describe('operator', () => { ); expect( - wrapper.find(`[data-test-subj="operatorAutocompleteComboBox"] EuiComboBoxPill`).at(0).text() + wrapper.find('[data-test-subj="operatorAutocompleteComboBox"] input').at(0).props().value ).toEqual('is'); }); diff --git a/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/comments/__snapshots__/comments.test.tsx.snap b/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/comments/__snapshots__/comments.test.tsx.snap index ff7dddd2da950..eecc554cd4e00 100644 --- a/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/comments/__snapshots__/comments.test.tsx.snap +++ b/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/comments/__snapshots__/comments.test.tsx.snap @@ -101,7 +101,7 @@ Object { class="euiAccordion__childWrapper emotion-euiAccordion__childWrapper-isClosed" id="exceptionItemCardComments" inert="" - role="region" + role="group" style="block-size: 0;" tabindex="-1" > @@ -239,7 +239,7 @@ Object { class="euiAccordion__childWrapper emotion-euiAccordion__childWrapper-isClosed" id="exceptionItemCardComments" inert="" - role="region" + role="group" style="block-size: 0;" tabindex="-1" > @@ -433,7 +433,7 @@ Object { aria-labelledby="generated-id" class="euiAccordion__childWrapper emotion-euiAccordion__childWrapper-isOpen" id="exceptionItemCardComments" - role="region" + role="group" style="block-size: 0;" tabindex="-1" > @@ -570,7 +570,7 @@ Object { aria-labelledby="generated-id" class="euiAccordion__childWrapper emotion-euiAccordion__childWrapper-isOpen" id="exceptionItemCardComments" - role="region" + role="group" style="block-size: 0;" tabindex="-1" > diff --git a/packages/kbn-securitysolution-exception-list-components/src/header_menu/__snapshots__/header_menu.test.tsx.snap b/packages/kbn-securitysolution-exception-list-components/src/header_menu/__snapshots__/header_menu.test.tsx.snap index dae6c05236001..5f87fe1383634 100644 --- a/packages/kbn-securitysolution-exception-list-components/src/header_menu/__snapshots__/header_menu.test.tsx.snap +++ b/packages/kbn-securitysolution-exception-list-components/src/header_menu/__snapshots__/header_menu.test.tsx.snap @@ -9,40 +9,8 @@ Object { class="euiFlexGroup emotion-euiFlexGroup-responsive-l-flexStart-stretch-row" >
-
- -
-
-
-
- , - "container":
-
-
-
+ , + "container":
+
+
+ +
+
, "debug": [Function], "findAllByAltText": [Function], @@ -124,26 +116,22 @@ Object { class="euiFlexGroup emotion-euiFlexGroup-responsive-l-flexStart-stretch-row" >
-
- -
+
@@ -157,7 +145,7 @@ Object { aria-describedby="generated-id" aria-live="off" aria-modal="true" - class="euiPanel euiPanel--plain euiPanel--paddingSmall euiPopover__panel emotion-euiPanel-grow-m-s-plain-euiPopover__panel-hasTransform" + class="euiPanel euiPanel--plain euiPanel--paddingSmall euiPopover__panel emotion-euiPanel-grow-m-s-plain-euiPopover__panel-light-hasTransform" data-popover-panel="true" role="dialog" style="top: 16px; left: -22px; will-change: transform, opacity; z-index: 2000;" @@ -226,26 +214,22 @@ Object { class="euiFlexGroup emotion-euiFlexGroup-responsive-l-flexStart-stretch-row" >
-
- -
+
, @@ -312,40 +296,8 @@ Object { class="euiFlexGroup emotion-euiFlexGroup-responsive-l-flexStart-stretch-row" >
-
- -
-
-
-
- , - "container":
-
-
-
+ , + "container":
+
+
+ +
+
, "debug": [Function], "findAllByAltText": [Function], @@ -427,45 +403,8 @@ Object { class="euiFlexGroup emotion-euiFlexGroup-responsive-l-flexStart-stretch-row" >
-
- -
-
-
-
- , - "container":
-
-
-
+ , + "container":
+
+
+ +
+
, "debug": [Function], "findAllByAltText": [Function], @@ -552,45 +520,8 @@ Object { class="euiFlexGroup emotion-euiFlexGroup-responsive-l-flexStart-stretch-row" >
-
- -
-
-
-
- , - "container":
-
-
-
+ , + "container":
+
+
+ +
+
, "debug": [Function], "findAllByAltText": [Function], @@ -677,46 +637,8 @@ Object { class="euiFlexGroup emotion-euiFlexGroup-responsive-l-flexStart-stretch-row" >
-
- -
-
-
-
- , - "container":
-
-
-
+ , + "container":
+
+
+ +
+
, "debug": [Function], "findAllByAltText": [Function], @@ -804,45 +756,8 @@ Object { class="euiFlexGroup emotion-euiFlexGroup-responsive-l-flexStart-stretch-row" >
-
- -
-
-
-
- , - "container":
-
-
-
+ , + "container":
+
+
+ +
+
, "debug": [Function], "findAllByAltText": [Function], diff --git a/packages/kbn-securitysolution-exception-list-components/src/list_header/__snapshots__/list_header.test.tsx.snap b/packages/kbn-securitysolution-exception-list-components/src/list_header/__snapshots__/list_header.test.tsx.snap index a458aa90dbedc..c83f098c6d090 100644 --- a/packages/kbn-securitysolution-exception-list-components/src/list_header/__snapshots__/list_header.test.tsx.snap +++ b/packages/kbn-securitysolution-exception-list-components/src/list_header/__snapshots__/list_header.test.tsx.snap @@ -197,26 +197,22 @@ Object { class="euiFlexGroup emotion-euiFlexGroup-responsive-l-flexStart-stretch-row" >
-
- -
+
@@ -584,26 +580,22 @@ Object { class="euiFlexGroup emotion-euiFlexGroup-responsive-l-flexStart-stretch-row" >
-
- -
+
@@ -867,26 +859,22 @@ Object { class="euiFlexGroup emotion-euiFlexGroup-responsive-l-flexStart-stretch-row" >
-
- -
+
@@ -1093,26 +1081,22 @@ Object { class="euiFlexGroup emotion-euiFlexGroup-responsive-l-flexStart-stretch-row" >
-
- -
+
@@ -1348,27 +1332,23 @@ Object { class="euiFlexGroup emotion-euiFlexGroup-responsive-l-flexStart-stretch-row" >
-
- -
+
@@ -1547,27 +1527,23 @@ Object { class="euiFlexGroup emotion-euiFlexGroup-responsive-l-flexStart-stretch-row" >
-
- -
+
@@ -1784,26 +1760,22 @@ Object { class="euiFlexGroup emotion-euiFlexGroup-responsive-l-flexStart-stretch-row" >
-
- -
+
@@ -1826,7 +1798,7 @@ Object { aria-describedby="generated-id" aria-live="off" aria-modal="true" - class="euiPanel euiPanel--plain euiPanel--paddingSmall euiPopover__panel emotion-euiPanel-grow-m-s-plain-euiPopover__panel-hasTransform" + class="euiPanel euiPanel--plain euiPanel--paddingSmall euiPopover__panel emotion-euiPanel-grow-m-s-plain-euiPopover__panel-light-hasTransform" data-popover-panel="true" role="dialog" style="top: 16px; left: -22px; will-change: transform, opacity; z-index: 2000;" @@ -2053,26 +2025,22 @@ Object { class="euiFlexGroup emotion-euiFlexGroup-responsive-l-flexStart-stretch-row" >
-
- -
+
diff --git a/packages/kbn-securitysolution-exception-list-components/src/list_header/menu_items/__snapshots__/menu_items.test.tsx.snap b/packages/kbn-securitysolution-exception-list-components/src/list_header/menu_items/__snapshots__/menu_items.test.tsx.snap index 90c90a4f3eea5..a58f4a042bca3 100644 --- a/packages/kbn-securitysolution-exception-list-components/src/list_header/menu_items/__snapshots__/menu_items.test.tsx.snap +++ b/packages/kbn-securitysolution-exception-list-components/src/list_header/menu_items/__snapshots__/menu_items.test.tsx.snap @@ -16,33 +16,29 @@ Object { class="euiFlexGroup emotion-euiFlexGroup-responsive-l-flexStart-stretch-row" >
-
- -
+ + +
@@ -53,26 +49,22 @@ Object { class="euiFlexGroup emotion-euiFlexGroup-responsive-l-flexStart-stretch-row" >
-
- -
+
@@ -91,33 +83,29 @@ Object { class="euiFlexGroup emotion-euiFlexGroup-responsive-l-flexStart-stretch-row" >
-
- -
+ + +
@@ -128,26 +116,22 @@ Object { class="euiFlexGroup emotion-euiFlexGroup-responsive-l-flexStart-stretch-row" >
-
- -
+
@@ -252,26 +236,22 @@ Object { class="euiFlexGroup emotion-euiFlexGroup-responsive-l-flexStart-stretch-row" >
-
- -
+
@@ -319,26 +299,22 @@ Object { class="euiFlexGroup emotion-euiFlexGroup-responsive-l-flexStart-stretch-row" >
-
- -
+
@@ -443,26 +419,22 @@ Object { class="euiFlexGroup emotion-euiFlexGroup-responsive-l-flexStart-stretch-row" >
-
- -
+
@@ -478,7 +450,7 @@ Object { aria-describedby="generated-id" aria-live="off" aria-modal="true" - class="euiPanel euiPanel--plain euiPanel--paddingSmall euiPopover__panel emotion-euiPanel-grow-m-s-plain-euiPopover__panel-hasTransform" + class="euiPanel euiPanel--plain euiPanel--paddingSmall euiPopover__panel emotion-euiPanel-grow-m-s-plain-euiPopover__panel-light-hasTransform" data-popover-panel="true" role="dialog" style="top: 16px; left: -22px; will-change: transform, opacity; z-index: 2000;" @@ -598,26 +570,22 @@ Object { class="euiFlexGroup emotion-euiFlexGroup-responsive-l-flexStart-stretch-row" >
-
- -
+
@@ -693,33 +661,29 @@ Object { class="euiFlexGroup emotion-euiFlexGroup-responsive-l-flexStart-stretch-row" >
-
- -
+ + +
@@ -730,26 +694,22 @@ Object { class="euiFlexGroup emotion-euiFlexGroup-responsive-l-flexStart-stretch-row" >
-
- -
+
@@ -765,7 +725,7 @@ Object { aria-describedby="generated-id" aria-live="off" aria-modal="true" - class="euiPanel euiPanel--plain euiPanel--paddingSmall euiPopover__panel emotion-euiPanel-grow-m-s-plain-euiPopover__panel-hasTransform" + class="euiPanel euiPanel--plain euiPanel--paddingSmall euiPopover__panel emotion-euiPanel-grow-m-s-plain-euiPopover__panel-light-hasTransform" data-popover-panel="true" role="dialog" style="top: 16px; left: -22px; will-change: transform, opacity; z-index: 2000;" @@ -858,33 +818,29 @@ Object { class="euiFlexGroup emotion-euiFlexGroup-responsive-l-flexStart-stretch-row" >
-
- -
+ + +
@@ -895,26 +851,22 @@ Object { class="euiFlexGroup emotion-euiFlexGroup-responsive-l-flexStart-stretch-row" >
-
- -
+
@@ -990,33 +942,29 @@ Object { class="euiFlexGroup emotion-euiFlexGroup-responsive-l-flexStart-stretch-row" >
-
- -
+ + +
@@ -1046,26 +994,22 @@ Object { class="euiFlexGroup emotion-euiFlexGroup-responsive-l-flexStart-stretch-row" >
-
- -
+
@@ -1084,33 +1028,29 @@ Object { class="euiFlexGroup emotion-euiFlexGroup-responsive-l-flexStart-stretch-row" >
-
- -
+ + +
@@ -1140,26 +1080,22 @@ Object { class="euiFlexGroup emotion-euiFlexGroup-responsive-l-flexStart-stretch-row" >
-
- -
+
diff --git a/packages/kbn-server-route-repository/kibana.jsonc b/packages/kbn-server-route-repository/kibana.jsonc index dbf7fc396428c..c10021164c722 100644 --- a/packages/kbn-server-route-repository/kibana.jsonc +++ b/packages/kbn-server-route-repository/kibana.jsonc @@ -1,5 +1,5 @@ { "type": "shared-common", "id": "@kbn/server-route-repository", - "owner": ["@elastic/obs-knowledge-team", "@elastic/obs-ux-management-team"] + "owner": ["@elastic/obs-knowledge-team"] } diff --git a/packages/kbn-server-route-repository/src/register_routes.ts b/packages/kbn-server-route-repository/src/register_routes.ts index 6698f40b2d5c6..e80d7a4d8cddf 100644 --- a/packages/kbn-server-route-repository/src/register_routes.ts +++ b/packages/kbn-server-route-repository/src/register_routes.ts @@ -63,6 +63,7 @@ export function registerRoutes({ request, context, params: validatedParams, + logger, ...dependencies, }).then((value) => { return { diff --git a/packages/kbn-test/index.ts b/packages/kbn-test/index.ts index 1b092f1fdd25e..e5409ee6ee485 100644 --- a/packages/kbn-test/index.ts +++ b/packages/kbn-test/index.ts @@ -52,6 +52,8 @@ export { getUrl } from './src/jest/get_url'; export { runCheckJestConfigsCli } from './src/jest/run_check_jest_configs_cli'; +export { runCheckFtrCodeOwnersCli } from './src/functional_test_runner/run_check_ftr_code_owners'; + export { runJest } from './src/jest/run'; export * from './src/kbn_archiver_cli'; diff --git a/packages/kbn-test/src/functional_test_runner/run_check_ftr_code_owners.ts b/packages/kbn-test/src/functional_test_runner/run_check_ftr_code_owners.ts new file mode 100644 index 0000000000000..91a6ded43dbac --- /dev/null +++ b/packages/kbn-test/src/functional_test_runner/run_check_ftr_code_owners.ts @@ -0,0 +1,63 @@ +/* + * 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 { run } from '@kbn/dev-cli-runner'; +import { createFailError } from '@kbn/dev-cli-errors'; +import { getRepoFiles } from '@kbn/get-repo-files'; +import { getCodeOwnersForFile, getPathsWithOwnersReversed } from '@kbn/code-owners'; + +const TEST_DIRECTORIES = ['test', 'x-pack/test', 'x-pack/test_serverless']; + +const fmtMs = (ms: number) => { + if (ms < 1000) { + return `${Math.round(ms)} ms`; + } + + return `${(Math.round(ms) / 1000).toFixed(2)} s`; +}; + +const fmtList = (list: Iterable) => [...list].map((i) => ` - ${i}`).join('\n'); + +export async function runCheckFtrCodeOwnersCli() { + run( + async ({ log }) => { + const start = performance.now(); + + const missingOwners = new Set(); + + // cache codeowners for quicker lookup + const reversedCodeowners = getPathsWithOwnersReversed(); + + const testFiles = await getRepoFiles(TEST_DIRECTORIES); + for (const { repoRel } of testFiles) { + const owners = getCodeOwnersForFile(repoRel, reversedCodeowners); + if (owners === undefined) { + missingOwners.add(repoRel); + } + } + + const timeSpent = fmtMs(performance.now() - start); + + if (missingOwners.size) { + log.error( + `The following test files do not have a GitHub code owner:\n${fmtList(missingOwners)}` + ); + throw createFailError( + `Found ${missingOwners.size} test files without code owner (checked ${testFiles.length} test files in ${timeSpent})` + ); + } + + log.success( + `All test files have a code owner (checked ${testFiles.length} test files in ${timeSpent})` + ); + }, + { + description: 'Check that all test files are covered by GitHub CODEOWNERS', + } + ); +} diff --git a/packages/kbn-test/tsconfig.json b/packages/kbn-test/tsconfig.json index abf0a35c4438a..fa22159f0b387 100644 --- a/packages/kbn-test/tsconfig.json +++ b/packages/kbn-test/tsconfig.json @@ -33,5 +33,6 @@ "@kbn/repo-packages", "@kbn/core-saved-objects-api-server", "@kbn/mock-idp-plugin", + "@kbn/code-owners", ] } diff --git a/packages/kbn-unified-data-table/src/components/data_table.test.tsx b/packages/kbn-unified-data-table/src/components/data_table.test.tsx index f898c4707717e..e69d1a88200ba 100644 --- a/packages/kbn-unified-data-table/src/components/data_table.test.tsx +++ b/packages/kbn-unified-data-table/src/components/data_table.test.tsx @@ -308,7 +308,7 @@ describe('UnifiedDataTable', () => { columns: ['message'], }); - expect(component.find(EuiDataGrid).prop('sorting')).toMatchInlineSnapshot(` + expect(component.find(EuiDataGrid).last().prop('sorting')).toMatchInlineSnapshot(` Object { "columns": Array [ Object { @@ -332,7 +332,7 @@ describe('UnifiedDataTable', () => { columns: ['bytes', 'message'], }); - expect(component.find(EuiDataGrid).prop('sorting')).toMatchInlineSnapshot(` + expect(component.find(EuiDataGrid).last().prop('sorting')).toMatchInlineSnapshot(` Object { "columns": Array [ Object { @@ -359,7 +359,7 @@ describe('UnifiedDataTable', () => { onUpdateRowHeight: jest.fn(), }); - expect(component.find(EuiDataGrid).prop('toolbarVisibility')).toMatchInlineSnapshot(` + expect(component.find(EuiDataGrid).first().prop('toolbarVisibility')).toMatchInlineSnapshot(` Object { "additionalControls": null, "showColumnSelector": false, @@ -385,7 +385,7 @@ describe('UnifiedDataTable', () => { onUpdateRowHeight: jest.fn(), }); - expect(component.find(EuiDataGrid).prop('toolbarVisibility')).toMatchInlineSnapshot(` + expect(component.find(EuiDataGrid).first().prop('toolbarVisibility')).toMatchInlineSnapshot(` Object { "additionalControls": null, "showColumnSelector": false, @@ -406,7 +406,7 @@ describe('UnifiedDataTable', () => { onUpdateSampleSize: undefined, }); - expect(component.find(EuiDataGrid).prop('toolbarVisibility')).toMatchInlineSnapshot(` + expect(component.find(EuiDataGrid).first().prop('toolbarVisibility')).toMatchInlineSnapshot(` Object { "additionalControls": null, "showColumnSelector": false, diff --git a/packages/kbn-unsaved-changes-badge/src/components/unsaved_changes_badge/__snapshots__/unsaved_changes_badge.test.tsx.snap b/packages/kbn-unsaved-changes-badge/src/components/unsaved_changes_badge/__snapshots__/unsaved_changes_badge.test.tsx.snap index 441d85d917ef3..141a8c7b437b8 100644 --- a/packages/kbn-unsaved-changes-badge/src/components/unsaved_changes_badge/__snapshots__/unsaved_changes_badge.test.tsx.snap +++ b/packages/kbn-unsaved-changes-badge/src/components/unsaved_changes_badge/__snapshots__/unsaved_changes_badge.test.tsx.snap @@ -3,34 +3,30 @@ exports[` should show all menu items 1`] = `
-
- -
+ + +
`; diff --git a/packages/kbn-unsaved-changes-badge/src/utils/__snapshots__/get_top_nav_unsaved_changes_badge.test.tsx.snap b/packages/kbn-unsaved-changes-badge/src/utils/__snapshots__/get_top_nav_unsaved_changes_badge.test.tsx.snap index eafe487e0265c..a2cca8a1cc1e3 100644 --- a/packages/kbn-unsaved-changes-badge/src/utils/__snapshots__/get_top_nav_unsaved_changes_badge.test.tsx.snap +++ b/packages/kbn-unsaved-changes-badge/src/utils/__snapshots__/get_top_nav_unsaved_changes_badge.test.tsx.snap @@ -3,34 +3,30 @@ exports[`getTopNavUnsavedChangesBadge() should work correctly 1`] = `
-
- -
+ + +
`; diff --git a/packages/kbn-visualization-ui-components/components/query_input/filter_query_input.tsx b/packages/kbn-visualization-ui-components/components/query_input/filter_query_input.tsx index e998e48eefe99..ac24f7bb81860 100644 --- a/packages/kbn-visualization-ui-components/components/query_input/filter_query_input.tsx +++ b/packages/kbn-visualization-ui-components/components/query_input/filter_query_input.tsx @@ -101,7 +101,7 @@ export function FilterQueryInput({ is rendered 1`] = `
-
- -
+ + +
`; diff --git a/scripts/check_ftr_code_owners.js b/scripts/check_ftr_code_owners.js new file mode 100644 index 0000000000000..67161a997e0bc --- /dev/null +++ b/scripts/check_ftr_code_owners.js @@ -0,0 +1,10 @@ +/* + * 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. + */ + +require('../src/setup_node_env'); +require('@kbn/test').runCheckFtrCodeOwnersCli(); diff --git a/src/core/server/integration_tests/ci_checks/saved_objects/check_registered_types.test.ts b/src/core/server/integration_tests/ci_checks/saved_objects/check_registered_types.test.ts index a2235b0f77812..f02dd54f791b4 100644 --- a/src/core/server/integration_tests/ci_checks/saved_objects/check_registered_types.test.ts +++ b/src/core/server/integration_tests/ci_checks/saved_objects/check_registered_types.test.ts @@ -76,6 +76,7 @@ describe('checking migration metadata changes on all registered SO types', () => "cases-connector-mappings": "f9d1ac57e484e69506c36a8051e4d61f4a8cfd25", "cases-telemetry": "f219eb7e26772884342487fc9602cfea07b3cedc", "cases-user-actions": "483f10db9b3bd1617948d7032a98b7791bf87414", + "cloud-security-posture-settings": "675e47dd958fbce6c70a20baac12af3145e7c0ef", "config": "179b3e2bc672626aafce3cf92093a113f456af38", "config-global": "8e8a134a2952df700d7d4ec51abb794bbd4cf6da", "connector_token": "5a9ac29fe9c740eb114e9c40517245c71706b005", diff --git a/src/core/server/integration_tests/saved_objects/migrations/group3/type_registrations.test.ts b/src/core/server/integration_tests/saved_objects/migrations/group3/type_registrations.test.ts index 2cef3801868bd..99e2692523f6d 100644 --- a/src/core/server/integration_tests/saved_objects/migrations/group3/type_registrations.test.ts +++ b/src/core/server/integration_tests/saved_objects/migrations/group3/type_registrations.test.ts @@ -29,6 +29,7 @@ const previouslyRegisteredTypes = [ 'canvas-element', 'canvas-workpad', 'canvas-workpad-template', + 'cloud-security-posture-settings', 'cases', 'cases-comments', 'cases-configure', diff --git a/src/core/server/integration_tests/saved_objects/migrations/group5/dot_kibana_split.test.ts b/src/core/server/integration_tests/saved_objects/migrations/group5/dot_kibana_split.test.ts index c39ceaf30da69..9f9c3a3c7bd58 100644 --- a/src/core/server/integration_tests/saved_objects/migrations/group5/dot_kibana_split.test.ts +++ b/src/core/server/integration_tests/saved_objects/migrations/group5/dot_kibana_split.test.ts @@ -197,6 +197,7 @@ describe('split .kibana index into multiple system indices', () => { "cases-connector-mappings", "cases-telemetry", "cases-user-actions", + "cloud-security-posture-settings", "config", "config-global", "connector_token", diff --git a/src/dev/license_checker/config.ts b/src/dev/license_checker/config.ts index 08d4267e52b63..b0919d0ab6141 100644 --- a/src/dev/license_checker/config.ts +++ b/src/dev/license_checker/config.ts @@ -85,7 +85,7 @@ export const LICENSE_OVERRIDES = { 'jsts@1.6.2': ['Eclipse Distribution License - v 1.0'], // cf. https://github.com/bjornharrtell/jsts '@mapbox/jsonlint-lines-primitives@2.0.2': ['MIT'], // license in readme https://github.com/tmcw/jsonlint '@elastic/ems-client@8.5.1': ['Elastic License 2.0'], - '@elastic/eui@90.0.1-backport.0': ['SSPL-1.0 OR Elastic License 2.0'], + '@elastic/eui@91.0.0-backport.0': ['SSPL-1.0 OR Elastic License 2.0'], 'language-subtag-registry@0.3.21': ['CC-BY-4.0'], // retired ODC‑By license https://github.com/mattcg/language-subtag-registry 'buffers@0.1.1': ['MIT'], // license in importing module https://www.npmjs.com/package/binary }; diff --git a/src/plugins/ai_assistant_management/observability/public/helpers/test_helper.tsx b/src/plugins/ai_assistant_management/observability/public/helpers/test_helper.tsx index 2e1b8e0def9b4..b03b1fd8a37d8 100644 --- a/src/plugins/ai_assistant_management/observability/public/helpers/test_helper.tsx +++ b/src/plugins/ai_assistant_management/observability/public/helpers/test_helper.tsx @@ -13,8 +13,7 @@ import { render as testLibRender } from '@testing-library/react'; import { coreMock } from '@kbn/core/public/mocks'; import { __IntlProvider as IntlProvider } from '@kbn/i18n-react'; import translations from '@kbn/translations-plugin/translations/ja-JP.json'; - -import { mockObservabilityAIAssistantService } from '@kbn/observability-ai-assistant-plugin/public'; +import { observabilityAIAssistantPluginMock } from '@kbn/observability-ai-assistant-plugin/public/mock'; import { RouterProvider } from '@kbn/typed-react-router-config'; import { AppContextProvider } from '../context/app_context'; import { RedirectToHomeIfUnauthorized } from '../routes/components/redirect_to_home_if_unauthorized'; @@ -62,14 +61,7 @@ export const render = (component: React.ReactNode, params?: { show: boolean }) = http: coreStart.http, application: coreStart.application, notifications: coreStart.notifications, - observabilityAIAssistant: { - service: mockObservabilityAIAssistantService, - useGenAIConnectors: () => ({ - loading: false, - selectConnector: () => {}, - reloadConnectors: () => {}, - }), - }, + observabilityAIAssistant: observabilityAIAssistantPluginMock.createStartContract(), uiSettings: coreStart.uiSettings, setBreadcrumbs: () => {}, }} diff --git a/src/plugins/content_management/server/plugin.ts b/src/plugins/content_management/server/plugin.ts index 4913c5cac08f6..6a276147687c1 100755 --- a/src/plugins/content_management/server/plugin.ts +++ b/src/plugins/content_management/server/plugin.ts @@ -19,13 +19,20 @@ import type { Context as RpcContext } from './rpc'; import { ContentManagementServerSetup, ContentManagementServerStart, - SetupDependencies, + ContentManagementServerSetupDependencies, + ContentManagementServerStartDependencies, } from './types'; import { EventStreamService } from './event_stream'; import { procedureNames } from '../common/rpc'; export class ContentManagementPlugin - implements Plugin + implements + Plugin< + ContentManagementServerSetup, + ContentManagementServerStart, + ContentManagementServerSetupDependencies, + ContentManagementServerStartDependencies + > { private readonly logger: Logger; private readonly core: Core; diff --git a/src/plugins/content_management/server/types.ts b/src/plugins/content_management/server/types.ts index 3d11f487fbe7d..79251838b1a56 100644 --- a/src/plugins/content_management/server/types.ts +++ b/src/plugins/content_management/server/types.ts @@ -9,7 +9,10 @@ import { CoreApi } from './core'; // eslint-disable-next-line @typescript-eslint/no-empty-interface -export interface SetupDependencies {} +export interface ContentManagementServerSetupDependencies {} + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface ContentManagementServerStartDependencies {} // eslint-disable-next-line @typescript-eslint/no-empty-interface export interface ContentManagementServerSetup extends CoreApi {} diff --git a/src/plugins/controls/common/options_list/ip_search.ts b/src/plugins/controls/common/options_list/ip_search.ts index f371fbb1f6506..565c2ed2a1df6 100644 --- a/src/plugins/controls/common/options_list/ip_search.ts +++ b/src/plugins/controls/common/options_list/ip_search.ts @@ -17,6 +17,10 @@ interface IpSegments { type: 'ipv4' | 'ipv6' | 'unknown'; } +export const getIsValidFullIp = (searchString: string) => { + return ipaddr.IPv4.isValidFourPartDecimal(searchString) || ipaddr.IPv6.isValid(searchString); +}; + export const getIpSegments = (searchString: string): IpSegments => { if (searchString.indexOf('.') !== -1) { // ipv4 takes priority - so if search string contains both `.` and `:` then it will just be an invalid ipv4 search diff --git a/src/plugins/controls/common/options_list/is_valid_search.test.ts b/src/plugins/controls/common/options_list/is_valid_search.test.ts new file mode 100644 index 0000000000000..0334e1eb809e7 --- /dev/null +++ b/src/plugins/controls/common/options_list/is_valid_search.test.ts @@ -0,0 +1,118 @@ +/* + * 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 { isValidSearch } from './is_valid_search'; + +describe('test validity of search strings', () => { + describe('number field', () => { + it('valid search - basic integer', () => { + expect(isValidSearch({ searchString: '123', fieldType: 'number' })).toBe(true); + }); + + it('valid search - floating point number', () => { + expect(isValidSearch({ searchString: '12.34', fieldType: 'number' })).toBe(true); + }); + + it('valid search - negative number', () => { + expect(isValidSearch({ searchString: '-42', fieldType: 'number' })).toBe(true); + }); + + it('invalid search - invalid character search string', () => { + expect(isValidSearch({ searchString: '1!a23', fieldType: 'number' })).toBe(false); + }); + }); + + // we do not currently support searching date fields, so they will always be invalid + describe('date field', () => { + it('invalid search - formatted date', () => { + expect(isValidSearch({ searchString: 'December 12, 2023', fieldType: 'date' })).toBe(false); + }); + + it('invalid search - invalid character search string', () => { + expect(isValidSearch({ searchString: '!!12/12/23?', fieldType: 'date' })).toBe(false); + }); + }); + + // only testing exact match validity here - the remainder of testing is covered by ./ip_search.test.ts + describe('ip field', () => { + it('valid search - ipv4', () => { + expect( + isValidSearch({ + searchString: '1.2.3.4', + fieldType: 'ip', + searchTechnique: 'exact', + }) + ).toBe(true); + }); + + it('valid search - full ipv6', () => { + expect( + isValidSearch({ + searchString: 'fbbe:a363:9e14:987c:49cf:d4d0:d8c8:bc42', + fieldType: 'ip', + searchTechnique: 'exact', + }) + ).toBe(true); + }); + + it('valid search - partial ipv6', () => { + expect( + isValidSearch({ + searchString: 'fbbe:a363::', + fieldType: 'ip', + searchTechnique: 'exact', + }) + ).toBe(true); + }); + + it('invalid search - invalid character search string', () => { + expect( + isValidSearch({ + searchString: '!!123.abc?', + fieldType: 'ip', + searchTechnique: 'exact', + }) + ).toBe(false); + }); + + it('invalid search - ipv4', () => { + expect( + isValidSearch({ + searchString: '1.2.3.256', + fieldType: 'ip', + searchTechnique: 'exact', + }) + ).toBe(false); + }); + + it('invalid search - ipv6', () => { + expect( + isValidSearch({ + searchString: '::fbbe:a363::', + fieldType: 'ip', + searchTechnique: 'exact', + }) + ).toBe(false); + }); + }); + + // string field searches can never be invalid + describe('string field', () => { + it('valid search - basic search string', () => { + expect(isValidSearch({ searchString: 'abc', fieldType: 'string' })).toBe(true); + }); + + it('valid search - numeric search string', () => { + expect(isValidSearch({ searchString: '123', fieldType: 'string' })).toBe(true); + }); + + it('valid search - complex search string', () => { + expect(isValidSearch({ searchString: '!+@abc*&[]', fieldType: 'string' })).toBe(true); + }); + }); +}); diff --git a/src/plugins/controls/common/options_list/is_valid_search.ts b/src/plugins/controls/common/options_list/is_valid_search.ts new file mode 100644 index 0000000000000..2d69271f991fc --- /dev/null +++ b/src/plugins/controls/common/options_list/is_valid_search.ts @@ -0,0 +1,52 @@ +/* + * 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 { getIpRangeQuery, getIsValidFullIp } from './ip_search'; +import { OptionsListSearchTechnique } from './suggestions_searching'; + +/** + * ipaddr is a fairly large library - therefore, this function needs to be separate from + * the `suggestions_searching` file (which is used in the OptionsListEditorOptions component, + * which is in the factory and not async imported) + */ + +export const isValidSearch = ({ + searchString, + fieldType, + searchTechnique, +}: { + searchString?: string; + fieldType?: string; + searchTechnique?: OptionsListSearchTechnique; +}): boolean => { + if (!searchString || searchString.length === 0) return true; + + switch (fieldType) { + case 'number': { + return !isNaN(Number(searchString)); + } + case 'date': { + /** searching is not currently supported for date fields */ + return false; + } + case 'ip': { + if (searchTechnique === 'exact') { + /** + * exact match searching will throw an error if the search string isn't a **full** IP, + * so we need a slightly different validity check here than for other search techniques + */ + return getIsValidFullIp(searchString); + } + return getIpRangeQuery(searchString).validSearch; + } + default: { + /** string searches are always considered to be valid */ + return true; + } + } +}; diff --git a/src/plugins/controls/common/options_list/suggestions_searching.ts b/src/plugins/controls/common/options_list/suggestions_searching.ts new file mode 100644 index 0000000000000..a68788bba322e --- /dev/null +++ b/src/plugins/controls/common/options_list/suggestions_searching.ts @@ -0,0 +1,31 @@ +/* + * 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 OptionsListSearchTechnique = 'prefix' | 'wildcard' | 'exact'; + +export const getDefaultSearchTechnique = (type: string): OptionsListSearchTechnique | undefined => { + const compatibleSearchTechniques = getCompatibleSearchTechniques(type); + return compatibleSearchTechniques.length > 0 ? compatibleSearchTechniques[0] : undefined; +}; + +export const getCompatibleSearchTechniques = (type?: string): OptionsListSearchTechnique[] => { + switch (type) { + case 'string': { + return ['prefix', 'wildcard', 'exact']; + } + case 'ip': { + return ['prefix', 'exact']; + } + case 'number': { + return ['exact']; + } + default: { + return []; + } + } +}; diff --git a/src/plugins/controls/common/options_list/types.ts b/src/plugins/controls/common/options_list/types.ts index 460f7df080a88..d7f75d5c268c2 100644 --- a/src/plugins/controls/common/options_list/types.ts +++ b/src/plugins/controls/common/options_list/types.ts @@ -6,17 +6,15 @@ * Side Public License, v 1. */ -import { FieldSpec, DataView, RuntimeFieldSpec } from '@kbn/data-views-plugin/common'; -import type { Filter, Query, BoolQuery, TimeRange } from '@kbn/es-query'; +import { DataView, FieldSpec, RuntimeFieldSpec } from '@kbn/data-views-plugin/common'; +import type { BoolQuery, Filter, Query, TimeRange } from '@kbn/es-query'; -import type { OptionsListSortingType } from './suggestions_sorting'; import type { DataControlInput } from '../types'; +import { OptionsListSearchTechnique } from './suggestions_searching'; +import type { OptionsListSortingType } from './suggestions_sorting'; export const OPTIONS_LIST_CONTROL = 'optionsListControl'; -export type OptionsListSearchTechnique = 'prefix' | 'wildcard'; -export const OPTIONS_LIST_DEFAULT_SEARCH_TECHNIQUE: OptionsListSearchTechnique = 'prefix'; - export interface OptionsListEmbeddableInput extends DataControlInput { searchTechnique?: OptionsListSearchTechnique; sort?: OptionsListSortingType; diff --git a/src/plugins/controls/common/range_slider/mocks.tsx b/src/plugins/controls/common/range_slider/mocks.tsx index 049e882a32681..d656102c26cf9 100644 --- a/src/plugins/controls/common/range_slider/mocks.tsx +++ b/src/plugins/controls/common/range_slider/mocks.tsx @@ -5,8 +5,15 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ - import { RangeSliderEmbeddableInput } from '..'; +import { + ControlFactory, + ControlOutput, + RangeSliderEmbeddable, + RangeSliderEmbeddableFactory, +} from '../../public'; +import * as rangeSliderStateModule from '../../public/range_slider/range_slider_reducers'; +import { RangeSliderComponentState } from '../../public/range_slider/types'; export const mockRangeSliderEmbeddableInput = { id: 'sample options list', @@ -14,3 +21,40 @@ export const mockRangeSliderEmbeddableInput = { dataViewId: 'sample id', value: ['0', '10'], } as RangeSliderEmbeddableInput; + +const mockRangeSliderComponentState = { + field: { name: 'bytes', type: 'number', aggregatable: true }, + min: undefined, + max: undefined, + error: undefined, + isInvalid: false, +} as RangeSliderComponentState; + +const mockRangeSliderOutput = { + loading: false, +} as ControlOutput; + +export const mockRangeSliderEmbeddable = async (partialState?: { + explicitInput?: Partial; + componentState?: Partial; +}) => { + const rangeSliderFactoryStub = new RangeSliderEmbeddableFactory(); + const rangeSliderControlFactory = rangeSliderFactoryStub as unknown as ControlFactory; + rangeSliderControlFactory.getDefaultInput = () => ({}); + + // initial component state can be provided by overriding the defaults. + const initialComponentState = { + ...mockRangeSliderComponentState, + ...partialState?.componentState, + }; + jest + .spyOn(rangeSliderStateModule, 'getDefaultComponentState') + .mockImplementation(() => initialComponentState); + + const mockEmbeddable = (await rangeSliderControlFactory.create({ + ...mockRangeSliderEmbeddableInput, + ...partialState?.explicitInput, + })) as RangeSliderEmbeddable; + mockEmbeddable.getOutput = jest.fn().mockReturnValue(mockRangeSliderOutput); + return mockEmbeddable; +}; diff --git a/src/plugins/controls/public/control_group/component/control_error_component.tsx b/src/plugins/controls/public/control_group/component/control_error_component.tsx index 409455f0e304e..6cdd1b5fc1fff 100644 --- a/src/plugins/controls/public/control_group/component/control_error_component.tsx +++ b/src/plugins/controls/public/control_group/component/control_error_component.tsx @@ -43,7 +43,6 @@ export const ControlError = ({ error }: ControlErrorProps) => { button={popoverButton} isOpen={isPopoverOpen} className="errorEmbeddableCompact__popover" - anchorClassName="errorEmbeddableCompact__popoverAnchor" closePopover={() => setPopoverOpen(false)} > - i18n.translate('controls.controlGroup.manageControl.dataSource.noControlTypeMessage', { - defaultMessage: 'No field selected yet', - }), getFieldTitle: () => i18n.translate('controls.controlGroup.manageControl.dataSource.fieldTitle', { defaultMessage: 'Field', @@ -47,6 +44,46 @@ export const ControlGroupStrings = { i18n.translate('controls.controlGroup.manageControl.dataSource.controlTypesTitle', { defaultMessage: 'Control type', }), + getControlTypeErrorMessage: ({ + fieldSelected, + controlType, + }: { + fieldSelected?: boolean; + controlType?: string; + }) => { + if (!fieldSelected) { + return i18n.translate( + 'controls.controlGroup.manageControl.dataSource.controlTypErrorMessage.noField', + { + defaultMessage: 'Select a field first.', + } + ); + } + + switch (controlType) { + /** + * Note that options list controls are currently compatible with every field type; so, there is no + * need to have a special error message for these. + */ + case RANGE_SLIDER_CONTROL: { + return i18n.translate( + 'controls.controlGroup.manageControl.dataSource.controlTypeErrorMessage.rangeSlider', + { + defaultMessage: 'Range sliders are only compatible with number fields.', + } + ); + } + default: { + /** This shouldn't ever happen - but, adding just in case as a fallback. */ + return i18n.translate( + 'controls.controlGroup.manageControl.dataSource.controlTypeErrorMessage.default', + { + defaultMessage: 'Select a compatible control type.', + } + ); + } + } + }, }, displaySettings: { getFormGroupTitle: () => @@ -231,6 +268,7 @@ export const ControlGroupStrings = { 'Selections in one control narrow down available options in the next. Controls are chained from left to right.', }), }, + /** TODO: These translations aren't used but they will be once https://github.com/elastic/kibana/issues/162985 is resolved */ querySync: { getQuerySettingsTitle: () => i18n.translate('controls.controlGroup.management.query.searchSettingsTitle', { diff --git a/src/plugins/controls/public/control_group/editor/control_editor.test.tsx b/src/plugins/controls/public/control_group/editor/control_editor.test.tsx index 33c627df20460..d6e079261e183 100644 --- a/src/plugins/controls/public/control_group/editor/control_editor.test.tsx +++ b/src/plugins/controls/public/control_group/editor/control_editor.test.tsx @@ -6,29 +6,33 @@ * Side Public License, v 1. */ -import React from 'react'; import { ReactWrapper } from 'enzyme'; +import React from 'react'; import { act } from 'react-dom/test-utils'; -import { findTestSubject, mountWithIntl } from '@kbn/test-jest-helpers'; import { stubDataView } from '@kbn/data-views-plugin/common/data_view.stub'; +import { findTestSubject, mountWithIntl } from '@kbn/test-jest-helpers'; -import { ControlGroupInput } from '../types'; -import { pluginServices } from '../../services'; -import { ControlEditor, EditControlProps } from './control_editor'; import { OptionsListEmbeddableFactory } from '../..'; +import { + OptionsListEmbeddableInput, + OPTIONS_LIST_CONTROL, + RANGE_SLIDER_CONTROL, +} from '../../../common'; import { DEFAULT_CONTROL_GROW, DEFAULT_CONTROL_WIDTH, } from '../../../common/control_group/control_group_constants'; -import { mockControlGroupContainer, mockOptionsListEmbeddable } from '../../../common/mocks'; +import { + mockControlGroupContainer, + mockOptionsListEmbeddable, + mockRangeSliderEmbeddable, +} from '../../../common/mocks'; import { RangeSliderEmbeddableFactory } from '../../range_slider'; +import { pluginServices } from '../../services'; import { ControlGroupContainerContext } from '../embeddable/control_group_container'; -import { - OptionsListEmbeddableInput, - OPTIONS_LIST_CONTROL, - RANGE_SLIDER_CONTROL, -} from '../../../common'; +import { ControlGroupInput } from '../types'; +import { ControlEditor, EditControlProps } from './control_editor'; describe('Data control editor', () => { interface MountOptions { @@ -96,10 +100,13 @@ describe('Data control editor', () => { await selectField('machine.os.raw'); }); - test('creates an options list control', async () => { - expect(findTestSubject(controlEditor, 'control-editor-type').text()).toEqual( - 'Options list' - ); + test('can only create an options list control', async () => { + expect( + findTestSubject(controlEditor, 'create__optionsListControl').instance() + ).toBeEnabled(); + expect( + findTestSubject(controlEditor, 'create__rangeSliderControl').instance() + ).not.toBeEnabled(); }); test('has custom settings', async () => { @@ -113,6 +120,8 @@ describe('Data control editor', () => { 'optionsListControl__searchOptionsRadioGroup' ); expect(searchOptions.exists()).toBe(true); + const options = searchOptions.find('div.euiRadioGroup__item'); + expect(options.length).toBe(3); }); }); @@ -122,18 +131,23 @@ describe('Data control editor', () => { await selectField('clientip'); }); - test('creates an options list control', async () => { - expect(findTestSubject(controlEditor, 'control-editor-type').text()).toEqual( - 'Options list' - ); + test('can only create an options list control', async () => { + expect( + findTestSubject(controlEditor, 'create__optionsListControl').instance() + ).toBeEnabled(); + expect( + findTestSubject(controlEditor, 'create__rangeSliderControl').instance() + ).not.toBeEnabled(); }); - test('does not have custom search options', async () => { + test('has custom search options', async () => { const searchOptions = findTestSubject( controlEditor, 'optionsListControl__searchOptionsRadioGroup' ); - expect(searchOptions.exists()).toBe(false); + expect(searchOptions.exists()).toBe(true); + const options = searchOptions.find('div.euiRadioGroup__item'); + expect(options.length).toBe(2); }); }); @@ -143,13 +157,38 @@ describe('Data control editor', () => { await selectField('bytes'); }); - test('creates a range slider control', async () => { - expect(findTestSubject(controlEditor, 'control-editor-type').text()).toEqual( - 'Range slider' + test('can create an options list or range slider control', async () => { + expect( + findTestSubject(controlEditor, 'create__optionsListControl').instance() + ).toBeEnabled(); + expect( + findTestSubject(controlEditor, 'create__rangeSliderControl').instance() + ).toBeEnabled(); + }); + + test('defaults to options list creation', async () => { + expect( + findTestSubject(controlEditor, 'create__optionsListControl').prop('aria-pressed') + ).toBe(true); + }); + + test('when creating options list, has custom settings', async () => { + findTestSubject(controlEditor, 'create__optionsListControl').simulate('click'); + const customSettings = findTestSubject(controlEditor, 'control-editor-custom-settings'); + expect(customSettings.exists()).toBe(true); + }); + + test('when creating options list, does not have custom search options', async () => { + findTestSubject(controlEditor, 'create__optionsListControl').simulate('click'); + const searchOptions = findTestSubject( + controlEditor, + 'optionsListControl__searchOptionsRadioGroup' ); + expect(searchOptions.exists()).toBe(false); }); - test('does not have any custom settings', async () => { + test('when creating range slider, does not have custom settings', async () => { + findTestSubject(controlEditor, 'create__rangeSliderControl').simulate('click'); const searchOptions = findTestSubject(controlEditor, 'control-editor-custom-settings'); expect(searchOptions.exists()).toBe(false); }); @@ -174,15 +213,28 @@ describe('Data control editor', () => { }); describe('editing existing options list control', () => { - const openOptionsListEditor = async (explicitInput?: Partial) => { - const control = await mockOptionsListEmbeddable({ - explicitInput: { - title: 'machine.os.raw', - dataViewId: stubDataView.id, - fieldName: 'machine.os.raw', - ...explicitInput, - }, - }); + const openEditor = async ( + type: string, + explicitInput?: Partial + ) => { + const control = + type === 'optionsList' + ? await mockOptionsListEmbeddable({ + explicitInput: { + title: 'machine.os.raw', + dataViewId: stubDataView.id, + fieldName: 'machine.os.raw', + ...explicitInput, + }, + }) + : await mockRangeSliderEmbeddable({ + explicitInput: { + title: 'bytes', + dataViewId: stubDataView.id, + fieldName: 'bytes', + ...explicitInput, + }, + }); await mountComponent({ componentOptions: { isCreate: false, embeddable: control }, }); @@ -190,23 +242,45 @@ describe('Data control editor', () => { describe('control title', () => { test('auto-fills default', async () => { - await openOptionsListEditor(); + await openEditor('optionsList'); const titleInput = findTestSubject(controlEditor, 'control-editor-title-input'); expect(titleInput.prop('value')).toBe('machine.os.raw'); expect(titleInput.prop('placeholder')).toBe('machine.os.raw'); }); test('auto-fills custom title', async () => { - await openOptionsListEditor({ title: 'Custom Title' }); + await openEditor('optionsList', { title: 'Custom Title' }); const titleInput = findTestSubject(controlEditor, 'control-editor-title-input'); expect(titleInput.prop('value')).toBe('Custom Title'); expect(titleInput.prop('placeholder')).toBe('machine.os.raw'); }); }); + describe('control type', () => { + test('selects the default control type', async () => { + await openEditor('optionsList', { fieldName: 'bytes' }); + expect( + findTestSubject(controlEditor, 'create__optionsListControl').prop('aria-pressed') + ).toBe(true); + expect( + findTestSubject(controlEditor, 'create__rangeSliderControl').prop('aria-pressed') + ).toBe(false); + }); + + test('selects the given, non-default control type', async () => { + await openEditor('rangeSlider', { fieldName: 'bytes' }); + expect( + findTestSubject(controlEditor, 'create__optionsListControl').prop('aria-pressed') + ).toBe(false); + expect( + findTestSubject(controlEditor, 'create__rangeSliderControl').prop('aria-pressed') + ).toBe(true); + }); + }); + describe('selection options', () => { test('selects default', async () => { - await openOptionsListEditor(); + await openEditor('optionsList'); const radioGroup = findTestSubject( controlEditor, 'optionsListControl__selectionOptionsRadioGroup' @@ -216,7 +290,7 @@ describe('Data control editor', () => { }); test('selects given', async () => { - await openOptionsListEditor({ singleSelect: true }); + await openEditor('optionsList', { singleSelect: true }); const radioGroup = findTestSubject( controlEditor, 'optionsListControl__selectionOptionsRadioGroup' @@ -228,7 +302,7 @@ describe('Data control editor', () => { describe('search techniques', () => { test('selects default', async () => { - await openOptionsListEditor(); + await openEditor('optionsList'); const radioGroup = findTestSubject( controlEditor, 'optionsListControl__searchOptionsRadioGroup' @@ -238,7 +312,7 @@ describe('Data control editor', () => { }); test('selects given', async () => { - await openOptionsListEditor({ searchTechnique: 'wildcard' }); + await openEditor('optionsList', { searchTechnique: 'wildcard' }); const radioGroup = findTestSubject( controlEditor, 'optionsListControl__searchOptionsRadioGroup' diff --git a/src/plugins/controls/public/control_group/editor/control_editor.tsx b/src/plugins/controls/public/control_group/editor/control_editor.tsx index 0860f19e506e3..aa9f505075426 100644 --- a/src/plugins/controls/public/control_group/editor/control_editor.tsx +++ b/src/plugins/controls/public/control_group/editor/control_editor.tsx @@ -14,29 +14,31 @@ * Side Public License, v 1. */ +import deepEqual from 'fast-deep-equal'; import React, { useEffect, useMemo, useRef, useState } from 'react'; -import useMount from 'react-use/lib/useMount'; import useAsync from 'react-use/lib/useAsync'; -import deepEqual from 'fast-deep-equal'; +import useMount from 'react-use/lib/useMount'; import { - EuiFlyoutHeader, + EuiButton, + EuiButtonEmpty, EuiButtonGroup, - EuiFlyoutBody, + EuiDescribedFormGroup, + EuiFieldText, EuiFlexGroup, EuiFlexItem, - EuiTitle, - EuiFieldText, + EuiFlyoutBody, EuiFlyoutFooter, - EuiButton, - EuiFormRow, + EuiFlyoutHeader, EuiForm, - EuiButtonEmpty, - EuiSpacer, + EuiFormRow, EuiIcon, + EuiKeyPadMenu, + EuiKeyPadMenuItem, + EuiSpacer, EuiSwitch, - EuiTextColor, - EuiDescribedFormGroup, + EuiTitle, + EuiToolTip, } from '@elastic/eui'; import { DataViewField } from '@kbn/data-views-plugin/common'; import { @@ -45,7 +47,8 @@ import { withSuspense, } from '@kbn/presentation-util-plugin/public'; -import { ControlGroupStrings } from '../control_group_strings'; +import { TIME_SLIDER_CONTROL } from '../../../common'; +import { pluginServices } from '../../services'; import { ControlEmbeddable, ControlInput, @@ -54,10 +57,10 @@ import { DataControlInput, IEditableControlFactory, } from '../../types'; -import { CONTROL_WIDTH_OPTIONS } from './editor_constants'; -import { pluginServices } from '../../services'; -import { getDataControlFieldRegistry } from './data_control_editor_tools'; +import { ControlGroupStrings } from '../control_group_strings'; import { useControlGroupContainer } from '../embeddable/control_group_container'; +import { getDataControlFieldRegistry } from './data_control_editor_tools'; +import { CONTROL_WIDTH_OPTIONS } from './editor_constants'; export interface EditControlProps { embeddable?: ControlEmbeddable; @@ -87,7 +90,7 @@ export const ControlEditor = ({ }: EditControlProps) => { const { dataViews: { getIdsWithTitle, getDefaultId, get }, - controls: { getControlFactory }, + controls: { getControlFactory, getControlTypes }, } = pluginServices.getServices(); const controlGroup = useControlGroupContainer(); @@ -102,6 +105,9 @@ export const ControlEditor = ({ const [selectedField, setSelectedField] = useState( embeddable ? embeddable.getInput().fieldName : undefined ); + const [selectedControlType, setSelectedControlType] = useState( + embeddable ? embeddable.type : undefined + ); const [customSettings, setCustomSettings] = useState>(); const currentInput: Partial = useMemo( @@ -157,15 +163,93 @@ export const ControlEditor = ({ }, [selectedDataViewId]); useEffect( - () => setControlEditorValid(Boolean(selectedField) && Boolean(selectedDataView)), - [selectedField, setControlEditorValid, selectedDataView] + () => + setControlEditorValid( + Boolean(selectedField) && Boolean(selectedDataView) && Boolean(selectedControlType) + ), + [selectedField, setControlEditorValid, selectedDataView, selectedControlType] ); - const controlType = - selectedField && fieldRegistry && fieldRegistry[selectedField].compatibleControlTypes[0]; - const factory = controlType && getControlFactory(controlType); - const CustomSettings = - factory && (factory as IEditableControlFactory).controlEditorOptionsComponent; + const CompatibleControlTypesComponent = useMemo(() => { + const allDataControlTypes = getControlTypes().filter((type) => type !== TIME_SLIDER_CONTROL); + return ( + + {allDataControlTypes.map((controlType) => { + const factory = getControlFactory(controlType); + + const disabled = + fieldRegistry && selectedField + ? !fieldRegistry[selectedField].compatibleControlTypes.includes(controlType) + : true; + const keyPadMenuItem = ( + setSelectedControlType(controlType)} + label={factory.getDisplayName()} + > + + + ); + + return disabled ? ( + + {keyPadMenuItem} + + ) : ( + keyPadMenuItem + ); + })} + + ); + }, [selectedField, fieldRegistry, getControlFactory, getControlTypes, selectedControlType]); + + const CustomSettingsComponent = useMemo(() => { + if (!selectedControlType || !selectedField || !fieldRegistry) return; + + const controlFactory = getControlFactory(selectedControlType); + const CustomSettings = (controlFactory as IEditableControlFactory) + .controlEditorOptionsComponent; + + if (!CustomSettings) return; + + return ( + + {ControlGroupStrings.manageControl.controlTypeSettings.getFormGroupTitle( + controlFactory.getDisplayName() + )} + + } + description={ControlGroupStrings.manageControl.controlTypeSettings.getFormGroupDescription( + controlFactory.getDisplayName() + )} + data-test-subj="control-editor-custom-settings" + > + setCustomSettings(settings)} + initialInput={embeddable?.getInput()} + fieldType={fieldRegistry[selectedField].field.type} + /> + + ); + }, [selectedControlType, selectedField, getControlFactory, fieldRegistry, embeddable]); + return ( <> @@ -216,6 +300,9 @@ export const ControlEditor = ({ const newDefaultTitle = field.displayName ?? field.name; setDefaultTitle(newDefaultTitle); setSelectedField(field.name); + setSelectedControlType( + fieldRegistry?.[field.displayName].compatibleControlTypes[0] + ); if (!currentTitle || currentTitle === defaultTitle) { setCurrentTitle(newDefaultTitle); } @@ -224,20 +311,7 @@ export const ControlEditor = ({ /> - {factory ? ( - - - - - - {factory.getDisplayName()} - - - ) : ( - - {ControlGroupStrings.manageControl.dataSource.noControlTypeMessage()} - - )} + {CompatibleControlTypesComponent} )} - {!editorConfig?.hideAdditionalSettings && - CustomSettings && - (factory as IEditableControlFactory).controlEditorOptionsComponent && ( - - {ControlGroupStrings.manageControl.controlTypeSettings.getFormGroupTitle( - factory.getDisplayName() - )} - - } - description={ControlGroupStrings.manageControl.controlTypeSettings.getFormGroupDescription( - factory.getDisplayName() - )} - data-test-subj="control-editor-custom-settings" - > - setCustomSettings(settings)} - initialInput={embeddable?.getInput()} - fieldType={fieldRegistry?.[selectedField].field.type} - /> - - )} + {!editorConfig?.hideAdditionalSettings ? CustomSettingsComponent : null} {removeControl && ( <> @@ -350,7 +401,10 @@ export const ControlEditor = ({ color="primary" disabled={!controlEditorValid} onClick={() => - onSave({ input: currentInput, grow: currentGrow, width: currentWidth }, controlType) + onSave( + { input: currentInput, grow: currentGrow, width: currentWidth }, + selectedControlType + ) } > {ControlGroupStrings.manageControl.getSaveChangesTitle()} diff --git a/src/plugins/controls/public/options_list/components/options_list_editor_options.tsx b/src/plugins/controls/public/options_list/components/options_list_editor_options.tsx index 403a2b941a586..74e8d61ed218c 100644 --- a/src/plugins/controls/public/options_list/components/options_list_editor_options.tsx +++ b/src/plugins/controls/public/options_list/components/options_list_editor_options.tsx @@ -6,33 +6,33 @@ * Side Public License, v 1. */ +import React, { useEffect, useMemo, useState } from 'react'; import useAsync from 'react-use/lib/useAsync'; -import React, { useEffect, useState } from 'react'; import { + Direction, EuiFlexGroup, EuiFlexItem, EuiFormRow, EuiIconTip, - EuiSwitch, - Direction, - EuiRadioGroup, EuiLoadingSpinner, + EuiRadioGroup, + EuiSwitch, } from '@elastic/eui'; import { css } from '@emotion/react'; -import { pluginServices } from '../../services'; +import { ControlEditorProps, OptionsListEmbeddableInput } from '../..'; +import { + getCompatibleSearchTechniques, + OptionsListSearchTechnique, +} from '../../../common/options_list/suggestions_searching'; import { - OptionsListSortBy, getCompatibleSortingTypes, + OptionsListSortBy, OPTIONS_LIST_DEFAULT_SORT, } from '../../../common/options_list/suggestions_sorting'; +import { pluginServices } from '../../services'; import { OptionsListStrings } from './options_list_strings'; -import { ControlEditorProps, OptionsListEmbeddableInput } from '../..'; -import { - OptionsListSearchTechnique, - OPTIONS_LIST_DEFAULT_SEARCH_TECHNIQUE, -} from '../../../common/options_list/types'; const TooltipText = ({ label, tooltip }: { label: string; tooltip: string }) => ( @@ -61,7 +61,7 @@ const selectionOptions = [ }, ]; -const searchOptions = [ +const allSearchOptions = [ { id: 'prefix', label: ( @@ -82,6 +82,16 @@ const searchOptions = [ ), 'data-test-subj': 'optionsListControl__wildcardSearchOptionAdditionalSetting', }, + { + id: 'exact', + label: ( + + ), + 'data-test-subj': 'optionsListControl__exactSearchOptionAdditionalSetting', + }, ]; interface OptionsListEditorState { @@ -117,6 +127,17 @@ export const OptionsListEditorOptions = ({ return optionsListService.getAllowExpensiveQueries(); }, []); + const compatibleSearchTechniques = useMemo( + () => getCompatibleSearchTechniques(fieldType), + [fieldType] + ); + + const searchOptions = useMemo(() => { + return allSearchOptions.filter((searchOption) => { + return compatibleSearchTechniques.includes(searchOption.id as OptionsListSearchTechnique); + }); + }, [compatibleSearchTechniques]); + useEffect(() => { // when field type changes, ensure that the selected sort type is still valid if (!getCompatibleSortingTypes(fieldType).includes(state.sortBy)) { @@ -129,6 +150,21 @@ export const OptionsListEditorOptions = ({ } }, [fieldType, onChange, state.sortBy]); + useEffect(() => { + // when field type changes, ensure that the selected search technique is still valid; + // if the selected search technique **isn't** valid, reset to the default + const searchTechnique = + initialInput?.searchTechnique && + compatibleSearchTechniques.includes(initialInput.searchTechnique) + ? initialInput.searchTechnique + : compatibleSearchTechniques[0]; + onChange({ searchTechnique }); + setState((s) => ({ + ...s, + searchTechnique, + })); + }, [compatibleSearchTechniques, onChange, initialInput]); + return ( <> ) : ( allowExpensiveQueries && - !['ip', 'date'].includes(fieldType) && ( + compatibleSearchTechniques.length > 1 && ( { const searchTechnique = id as OptionsListSearchTechnique; onChange({ searchTechnique }); diff --git a/src/plugins/controls/public/options_list/components/options_list_popover.test.tsx b/src/plugins/controls/public/options_list/components/options_list_popover.test.tsx index 6263cdff192fc..59f1c9f2b058c 100644 --- a/src/plugins/controls/public/options_list/components/options_list_popover.test.tsx +++ b/src/plugins/controls/public/options_list/components/options_list_popover.test.tsx @@ -67,241 +67,269 @@ describe('Options list popover', () => { expect(noOptionsDiv.exists()).toBeTruthy(); }); - test('display error message when the show only selected toggle is true but there are no selections', async () => { - const popover = await mountComponent(); - clickShowOnlySelections(popover); - const availableOptionsDiv = findTestSubject(popover, 'optionsList-control-available-options'); - const noSelectionsDiv = findTestSubject( - availableOptionsDiv, - 'optionsList-control-selectionsEmptyMessage' - ); - expect(noSelectionsDiv.exists()).toBeTruthy(); - }); - - test('show only selected options', async () => { - const selections = ['woof', 'bark']; - const popover = await mountComponent({ - explicitInput: { selectedOptions: selections }, + describe('show only selected', () => { + test('display error message when the show only selected toggle is true but there are no selections', async () => { + const popover = await mountComponent(); + clickShowOnlySelections(popover); + const availableOptionsDiv = findTestSubject(popover, 'optionsList-control-available-options'); + const noSelectionsDiv = findTestSubject( + availableOptionsDiv, + 'optionsList-control-selectionsEmptyMessage' + ); + expect(noSelectionsDiv.exists()).toBeTruthy(); }); - clickShowOnlySelections(popover); - const availableOptions = popover.find( - '[data-test-subj="optionsList-control-available-options"] ul' - ); - availableOptions.children().forEach((child, i) => { - expect(child.text()).toBe(`${selections[i]}. Checked option.`); - }); - }); - test('disable search and sort when show only selected toggle is true', async () => { - const selections = ['woof', 'bark']; - const popover = await mountComponent({ - explicitInput: { selectedOptions: selections }, + test('show only selected options', async () => { + const selections = ['woof', 'bark']; + const popover = await mountComponent({ + explicitInput: { selectedOptions: selections }, + }); + clickShowOnlySelections(popover); + const availableOptions = popover.find( + '[data-test-subj="optionsList-control-available-options"] ul' + ); + availableOptions.children().forEach((child, i) => { + expect(child.text()).toBe(`${selections[i]}. Checked option.`); + }); }); - let searchBox = findTestSubject(popover, 'optionsList-control-search-input'); - let sortButton = findTestSubject(popover, 'optionsListControl__sortingOptionsButton'); - expect(searchBox.prop('disabled')).toBeFalsy(); - expect(sortButton.prop('disabled')).toBeFalsy(); - - clickShowOnlySelections(popover); - searchBox = findTestSubject(popover, 'optionsList-control-search-input'); - sortButton = findTestSubject(popover, 'optionsListControl__sortingOptionsButton'); - expect(searchBox.prop('disabled')).toBe(true); - expect(sortButton.prop('disabled')).toBe(true); - }); - test('test single invalid selection', async () => { - const popover = await mountComponent({ - explicitInput: { - selectedOptions: ['bark', 'woof'], - }, - componentState: { - availableOptions: [{ value: 'bark', docCount: 75 }], - validSelections: ['bark'], - invalidSelections: ['woof'], - }, + test('disable search and sort when show only selected toggle is true', async () => { + const selections = ['woof', 'bark']; + const popover = await mountComponent({ + explicitInput: { selectedOptions: selections }, + componentState: { field: { type: 'string' } as any as FieldSpec }, + }); + let searchBox = findTestSubject(popover, 'optionsList-control-search-input'); + let sortButton = findTestSubject(popover, 'optionsListControl__sortingOptionsButton'); + expect(searchBox.prop('disabled')).toBeFalsy(); + expect(sortButton.prop('disabled')).toBeFalsy(); + + clickShowOnlySelections(popover); + searchBox = findTestSubject(popover, 'optionsList-control-search-input'); + sortButton = findTestSubject(popover, 'optionsListControl__sortingOptionsButton'); + expect(searchBox.prop('disabled')).toBe(true); + expect(sortButton.prop('disabled')).toBe(true); }); - const validSelection = findTestSubject(popover, 'optionsList-control-selection-bark'); - expect(validSelection.find('.euiSelectableListItem__text').text()).toEqual( - 'bark. Checked option.' - ); - expect( - validSelection.find('div[data-test-subj="optionsList-document-count-badge"]').text().trim() - ).toEqual('75'); - const title = findTestSubject(popover, 'optionList__ignoredSelectionLabel').text(); - expect(title).toEqual('Ignored selection'); - const invalidSelection = findTestSubject(popover, 'optionsList-control-ignored-selection-woof'); - expect(invalidSelection.find('.euiSelectableListItem__text').text()).toEqual( - 'woof. Checked option.' - ); - expect(invalidSelection.hasClass('optionsList__selectionInvalid')).toBe(true); }); - test('test title when multiple invalid selections', async () => { - const popover = await mountComponent({ - explicitInput: { selectedOptions: ['bark', 'woof', 'meow'] }, - componentState: { - availableOptions: [{ value: 'bark', docCount: 75 }], - validSelections: ['bark'], - invalidSelections: ['woof', 'meow'], - }, + describe('invalid selections', () => { + test('test single invalid selection', async () => { + const popover = await mountComponent({ + explicitInput: { + selectedOptions: ['bark', 'woof'], + }, + componentState: { + availableOptions: [{ value: 'bark', docCount: 75 }], + validSelections: ['bark'], + invalidSelections: ['woof'], + }, + }); + const validSelection = findTestSubject(popover, 'optionsList-control-selection-bark'); + expect(validSelection.find('.euiSelectableListItem__text').text()).toEqual( + 'bark. Checked option.' + ); + expect( + validSelection.find('div[data-test-subj="optionsList-document-count-badge"]').text().trim() + ).toEqual('75'); + const title = findTestSubject(popover, 'optionList__ignoredSelectionLabel').text(); + expect(title).toEqual('Ignored selection'); + const invalidSelection = findTestSubject( + popover, + 'optionsList-control-ignored-selection-woof' + ); + expect(invalidSelection.find('.euiSelectableListItem__text').text()).toEqual( + 'woof. Checked option.' + ); + expect(invalidSelection.hasClass('optionsList__selectionInvalid')).toBe(true); }); - const title = findTestSubject(popover, 'optionList__ignoredSelectionLabel').text(); - expect(title).toEqual('Ignored selections'); - }); - test('should default to exclude = false', async () => { - const popover = await mountComponent(); - const includeButton = findTestSubject(popover, 'optionsList__includeResults'); - const excludeButton = findTestSubject(popover, 'optionsList__excludeResults'); - expect(includeButton.prop('checked')).toBe(true); - expect(excludeButton.prop('checked')).toBeFalsy(); - }); - - test('if exclude = true, select appropriate button in button group', async () => { - const popover = await mountComponent({ - explicitInput: { exclude: true }, + test('test title when multiple invalid selections', async () => { + const popover = await mountComponent({ + explicitInput: { selectedOptions: ['bark', 'woof', 'meow'] }, + componentState: { + availableOptions: [{ value: 'bark', docCount: 75 }], + validSelections: ['bark'], + invalidSelections: ['woof', 'meow'], + }, + }); + const title = findTestSubject(popover, 'optionList__ignoredSelectionLabel').text(); + expect(title).toEqual('Ignored selections'); }); - const includeButton = findTestSubject(popover, 'optionsList__includeResults'); - const excludeButton = findTestSubject(popover, 'optionsList__excludeResults'); - expect(includeButton.prop('checked')).toBeFalsy(); - expect(excludeButton.prop('checked')).toBe(true); }); - test('clicking another option unselects "Exists"', async () => { - const popover = await mountComponent({ - explicitInput: { existsSelected: true }, + describe('include/exclude toggle', () => { + test('should default to exclude = false', async () => { + const popover = await mountComponent(); + const includeButton = findTestSubject(popover, 'optionsList__includeResults'); + const excludeButton = findTestSubject(popover, 'optionsList__excludeResults'); + expect(includeButton.prop('aria-pressed')).toBe(true); + expect(excludeButton.prop('aria-pressed')).toBe(false); }); - const woofOption = findTestSubject(popover, 'optionsList-control-selection-woof'); - woofOption.simulate('click'); - const availableOptionsDiv = findTestSubject(popover, 'optionsList-control-available-options'); - availableOptionsDiv.children().forEach((child, i) => { - if (child.text() === 'woof') expect(child.prop('checked')).toBe('on'); - else expect(child.prop('checked')).toBeFalsy(); + test('if exclude = true, select appropriate button in button group', async () => { + const popover = await mountComponent({ + explicitInput: { exclude: true }, + }); + const includeButton = findTestSubject(popover, 'optionsList__includeResults'); + const excludeButton = findTestSubject(popover, 'optionsList__excludeResults'); + expect(includeButton.prop('aria-pressed')).toBe(false); + expect(excludeButton.prop('aria-pressed')).toBe(true); }); }); - test('clicking "Exists" unselects all other selections', async () => { - const selections = ['woof', 'bark']; - const popover = await mountComponent({ - explicitInput: { existsSelected: false, selectedOptions: selections }, - }); - const existsOption = findTestSubject(popover, 'optionsList-control-selection-exists'); - let availableOptionsDiv = findTestSubject(popover, 'optionsList-control-available-options'); - availableOptionsDiv.children().forEach((child, i) => { - if (selections.includes(child.text())) expect(child.prop('checked')).toBe('on'); - else expect(child.prop('checked')).toBeFalsy(); + describe('"Exists" option', () => { + test('clicking another option unselects "Exists"', async () => { + const popover = await mountComponent({ + explicitInput: { existsSelected: true }, + }); + const woofOption = findTestSubject(popover, 'optionsList-control-selection-woof'); + woofOption.simulate('click'); + + const availableOptionsDiv = findTestSubject(popover, 'optionsList-control-available-options'); + availableOptionsDiv.children().forEach((child, i) => { + if (child.text() === 'woof') expect(child.prop('aria-pressed')).toBe(true); + else expect(child.prop('aria-pressed')).toBeFalsy(); + }); }); - existsOption.simulate('click'); - availableOptionsDiv = findTestSubject(popover, 'optionsList-control-available-options'); - availableOptionsDiv.children().forEach((child, i) => { - if (child.text() === 'Exists (*)') expect(child.prop('checked')).toBe('on'); - else expect(child.prop('checked')).toBeFalsy(); + test('clicking "Exists" unselects all other selections', async () => { + const selections = ['woof', 'bark']; + const popover = await mountComponent({ + explicitInput: { existsSelected: false, selectedOptions: selections }, + }); + const existsOption = findTestSubject(popover, 'optionsList-control-selection-exists'); + let availableOptionsDiv = findTestSubject(popover, 'optionsList-control-available-options'); + availableOptionsDiv.children().forEach((child, i) => { + if (selections.includes(child.text())) expect(child.prop('aria-pressed')).toBe(true); + else expect(child.prop('aria-pressed')).toBeFalsy(); + }); + + existsOption.simulate('click'); + availableOptionsDiv = findTestSubject(popover, 'optionsList-control-available-options'); + availableOptionsDiv.children().forEach((child, i) => { + if (child.text() === 'Exists (*)') expect(child.prop('aria-pressed')).toBe(true); + else expect(child.prop('aria-pressed')).toBeFalsy(); + }); }); - }); - test('if existsSelected = false and no suggestions, then "Exists" does not show up', async () => { - const popover = await mountComponent({ - componentState: { availableOptions: [] }, - explicitInput: { existsSelected: false }, + test('if existsSelected = false and no suggestions, then "Exists" does not show up', async () => { + const popover = await mountComponent({ + componentState: { availableOptions: [] }, + explicitInput: { existsSelected: false }, + }); + const existsOption = findTestSubject(popover, 'optionsList-control-selection-exists'); + expect(existsOption.exists()).toBeFalsy(); }); - const existsOption = findTestSubject(popover, 'optionsList-control-selection-exists'); - expect(existsOption.exists()).toBeFalsy(); - }); - test('if existsSelected = true, "Exists" is the only option when "Show only selected options" is toggled', async () => { - const popover = await mountComponent({ - explicitInput: { existsSelected: true }, + test('if existsSelected = true, "Exists" is the only option when "Show only selected options" is toggled', async () => { + const popover = await mountComponent({ + explicitInput: { existsSelected: true }, + }); + clickShowOnlySelections(popover); + const availableOptions = popover.find( + '[data-test-subj="optionsList-control-available-options"] ul' + ); + expect(availableOptions.text()).toBe('Exists. Checked option.'); }); - clickShowOnlySelections(popover); - const availableOptions = popover.find( - '[data-test-subj="optionsList-control-available-options"] ul' - ); - expect(availableOptions.text()).toBe('Exists. Checked option.'); }); - test('when sorting suggestions, show both sorting types for keyword field', async () => { - const popover = await mountComponent({ - componentState: { - field: { name: 'Test keyword field', type: 'keyword' } as FieldSpec, - }, + describe('sorting suggestions', () => { + test('when sorting suggestions, show both sorting types for keyword field', async () => { + const popover = await mountComponent({ + componentState: { + field: { name: 'Test keyword field', type: 'keyword' } as FieldSpec, + }, + }); + const sortButton = findTestSubject(popover, 'optionsListControl__sortingOptionsButton'); + sortButton.simulate('click'); + + const sortingOptionsDiv = findTestSubject(popover, 'optionsListControl__sortingOptions'); + const optionsText = sortingOptionsDiv.find('ul li').map((element) => element.text().trim()); + expect(optionsText).toEqual(['By document count. Checked option.', 'Alphabetically']); }); - const sortButton = findTestSubject(popover, 'optionsListControl__sortingOptionsButton'); - sortButton.simulate('click'); - const sortingOptionsDiv = findTestSubject(popover, 'optionsListControl__sortingOptions'); - const optionsText = sortingOptionsDiv.find('ul li').map((element) => element.text().trim()); - expect(optionsText).toEqual(['By document count. Checked option.', 'Alphabetically']); - }); + test('sorting popover selects appropriate sorting type on load', async () => { + const popover = await mountComponent({ + explicitInput: { sort: { by: '_key', direction: 'asc' } }, + componentState: { + field: { name: 'Test keyword field', type: 'keyword' } as FieldSpec, + }, + }); + const sortButton = findTestSubject(popover, 'optionsListControl__sortingOptionsButton'); + sortButton.simulate('click'); - test('sorting popover selects appropriate sorting type on load', async () => { - const popover = await mountComponent({ - explicitInput: { sort: { by: '_key', direction: 'asc' } }, - componentState: { - field: { name: 'Test keyword field', type: 'keyword' } as FieldSpec, - }, - }); - const sortButton = findTestSubject(popover, 'optionsListControl__sortingOptionsButton'); - sortButton.simulate('click'); + const sortingOptionsDiv = findTestSubject(popover, 'optionsListControl__sortingOptions'); + const optionsText = sortingOptionsDiv.find('ul li').map((element) => element.text().trim()); + expect(optionsText).toEqual(['By document count', 'Alphabetically. Checked option.']); - const sortingOptionsDiv = findTestSubject(popover, 'optionsListControl__sortingOptions'); - const optionsText = sortingOptionsDiv.find('ul li').map((element) => element.text().trim()); - expect(optionsText).toEqual(['By document count', 'Alphabetically. Checked option.']); + const ascendingButton = findTestSubject(popover, 'optionsList__sortOrder_asc').instance(); + expect(ascendingButton).toHaveClass('euiButtonGroupButton-isSelected'); + const descendingButton = findTestSubject(popover, 'optionsList__sortOrder_desc').instance(); + expect(descendingButton).not.toHaveClass('euiButtonGroupButton-isSelected'); + }); - const ascendingButton = findTestSubject(popover, 'optionsList__sortOrder_asc').instance(); - expect(ascendingButton).toHaveClass('euiButtonGroupButton-isSelected'); - const descendingButton = findTestSubject(popover, 'optionsList__sortOrder_desc').instance(); - expect(descendingButton).not.toHaveClass('euiButtonGroupButton-isSelected'); - }); + test('when sorting suggestions, only show document count sorting for IP fields', async () => { + const popover = await mountComponent({ + componentState: { field: { name: 'Test IP field', type: 'ip' } as FieldSpec }, + }); + const sortButton = findTestSubject(popover, 'optionsListControl__sortingOptionsButton'); + sortButton.simulate('click'); - test('when sorting suggestions, only show document count sorting for IP fields', async () => { - const popover = await mountComponent({ - componentState: { field: { name: 'Test IP field', type: 'ip' } as FieldSpec }, + const sortingOptionsDiv = findTestSubject(popover, 'optionsListControl__sortingOptions'); + const optionsText = sortingOptionsDiv.find('ul li').map((element) => element.text().trim()); + expect(optionsText).toEqual(['By document count. Checked option.']); }); - const sortButton = findTestSubject(popover, 'optionsListControl__sortingOptionsButton'); - sortButton.simulate('click'); - const sortingOptionsDiv = findTestSubject(popover, 'optionsListControl__sortingOptions'); - const optionsText = sortingOptionsDiv.find('ul li').map((element) => element.text().trim()); - expect(optionsText).toEqual(['By document count. Checked option.']); - }); + test('when sorting suggestions, show "By date" sorting option for date fields', async () => { + const popover = await mountComponent({ + componentState: { field: { name: 'Test date field', type: 'date' } as FieldSpec }, + }); + const sortButton = findTestSubject(popover, 'optionsListControl__sortingOptionsButton'); + sortButton.simulate('click'); - test('when sorting suggestions, show "By date" sorting option for date fields', async () => { - const popover = await mountComponent({ - componentState: { field: { name: 'Test date field', type: 'date' } as FieldSpec }, + const sortingOptionsDiv = findTestSubject(popover, 'optionsListControl__sortingOptions'); + const optionsText = sortingOptionsDiv.find('ul li').map((element) => element.text().trim()); + expect(optionsText).toEqual(['By document count. Checked option.', 'By date']); }); - const sortButton = findTestSubject(popover, 'optionsListControl__sortingOptionsButton'); - sortButton.simulate('click'); - const sortingOptionsDiv = findTestSubject(popover, 'optionsListControl__sortingOptions'); - const optionsText = sortingOptionsDiv.find('ul li').map((element) => element.text().trim()); - expect(optionsText).toEqual(['By document count. Checked option.', 'By date']); - }); + test('when sorting suggestions, show "Numerically" sorting option for number fields', async () => { + const popover = await mountComponent({ + componentState: { field: { name: 'Test number field', type: 'number' } as FieldSpec }, + }); + const sortButton = findTestSubject(popover, 'optionsListControl__sortingOptionsButton'); + sortButton.simulate('click'); - test('ensure warning icon does not show up when testAllowExpensiveQueries = true/undefined', async () => { - const popover = await mountComponent({ - componentState: { field: { name: 'Test keyword field', type: 'keyword' } as FieldSpec }, + const sortingOptionsDiv = findTestSubject(popover, 'optionsListControl__sortingOptions'); + const optionsText = sortingOptionsDiv.find('ul li').map((element) => element.text().trim()); + expect(optionsText).toEqual(['By document count. Checked option.', 'Numerically']); }); - const warning = findTestSubject(popover, 'optionsList-allow-expensive-queries-warning'); - expect(warning).toEqual({}); }); - test('ensure warning icon shows up when testAllowExpensiveQueries = false', async () => { - pluginServices.getServices().optionsList.getAllowExpensiveQueries = jest.fn(() => - Promise.resolve(false) - ); - const popover = await mountComponent({ - componentState: { - field: { name: 'Test keyword field', type: 'keyword' } as FieldSpec, - allowExpensiveQueries: false, - }, + describe('allow expensive queries warning', () => { + test('ensure warning icon does not show up when testAllowExpensiveQueries = true/undefined', async () => { + const popover = await mountComponent({ + componentState: { field: { name: 'Test keyword field', type: 'keyword' } as FieldSpec }, + }); + const warning = findTestSubject(popover, 'optionsList-allow-expensive-queries-warning'); + expect(warning).toEqual({}); + }); + + test('ensure warning icon shows up when testAllowExpensiveQueries = false', async () => { + pluginServices.getServices().optionsList.getAllowExpensiveQueries = jest.fn(() => + Promise.resolve(false) + ); + const popover = await mountComponent({ + componentState: { + field: { name: 'Test keyword field', type: 'keyword' } as FieldSpec, + allowExpensiveQueries: false, + }, + }); + const warning = findTestSubject(popover, 'optionsList-allow-expensive-queries-warning'); + expect(warning.getDOMNode()).toBeInstanceOf(HTMLDivElement); }); - const warning = findTestSubject(popover, 'optionsList-allow-expensive-queries-warning'); - expect(warning.getDOMNode()).toBeInstanceOf(HTMLDivElement); }); - describe('Test advanced settings', () => { + describe('advanced settings', () => { const ensureComponentIsHidden = async ({ explicitInput, testSubject, diff --git a/src/plugins/controls/public/options_list/components/options_list_popover_action_bar.tsx b/src/plugins/controls/public/options_list/components/options_list_popover_action_bar.tsx index 8e890350f4d40..a6754a50ecaff 100644 --- a/src/plugins/controls/public/options_list/components/options_list_popover_action_bar.tsx +++ b/src/plugins/controls/public/options_list/components/options_list_popover_action_bar.tsx @@ -6,22 +6,22 @@ * Side Public License, v 1. */ -import React from 'react'; +import React, { useMemo } from 'react'; import { - EuiFieldSearch, EuiButtonIcon, + EuiFieldSearch, EuiFlexGroup, EuiFlexItem, EuiFormRow, - EuiToolTip, EuiText, + EuiToolTip, } from '@elastic/eui'; -import { OptionsListStrings } from './options_list_strings'; +import { getCompatibleSearchTechniques } from '../../../common/options_list/suggestions_searching'; import { useOptionsList } from '../embeddable/options_list_embeddable'; import { OptionsListPopoverSortingButton } from './options_list_popover_sorting_button'; -import { OPTIONS_LIST_DEFAULT_SEARCH_TECHNIQUE } from '../../../common/options_list/types'; +import { OptionsListStrings } from './options_list_strings'; interface OptionsListPopoverProps { showOnlySelected: boolean; @@ -38,20 +38,29 @@ export const OptionsListPopoverActionBar = ({ const totalCardinality = optionsList.select((state) => state.componentState.totalCardinality) ?? 0; - const searchString = optionsList.select((state) => state.componentState.searchString); const fieldSpec = optionsList.select((state) => state.componentState.field); + const searchString = optionsList.select((state) => state.componentState.searchString); const invalidSelections = optionsList.select((state) => state.componentState.invalidSelections); + const allowExpensiveQueries = optionsList.select( + (state) => state.componentState.allowExpensiveQueries + ); const hideSort = optionsList.select((state) => state.explicitInput.hideSort); const searchTechnique = optionsList.select((state) => state.explicitInput.searchTechnique); - const allowExpensiveQueries = optionsList.select( - (state) => state.componentState.allowExpensiveQueries + const compatibleSearchTechniques = useMemo(() => { + if (!fieldSpec) return []; + return getCompatibleSearchTechniques(fieldSpec.type); + }, [fieldSpec]); + + const defaultSearchTechnique = useMemo( + () => searchTechnique ?? compatibleSearchTechniques[0], + [searchTechnique, compatibleSearchTechniques] ); return (
- {fieldSpec?.type !== 'date' && ( + {compatibleSearchTechniques.length > 0 && ( updateSearchString(event.target.value)} value={searchString.value} data-test-subj="optionsList-control-search-input" - placeholder={OptionsListStrings.popover.searchPlaceholder[ - searchTechnique ?? OPTIONS_LIST_DEFAULT_SEARCH_TECHNIQUE - ].getPlaceholderText()} + placeholder={OptionsListStrings.popover.getSearchPlaceholder( + allowExpensiveQueries ? defaultSearchTechnique : 'exact' + )} /> )} diff --git a/src/plugins/controls/public/options_list/components/options_list_popover_empty_message.tsx b/src/plugins/controls/public/options_list/components/options_list_popover_empty_message.tsx index 379a8da7040b4..c4e4918f97714 100644 --- a/src/plugins/controls/public/options_list/components/options_list_popover_empty_message.tsx +++ b/src/plugins/controls/public/options_list/components/options_list_popover_empty_message.tsx @@ -6,9 +6,11 @@ * Side Public License, v 1. */ -import React from 'react'; -import { EuiSelectableMessage, EuiIcon, EuiSpacer } from '@elastic/eui'; +import React, { useMemo } from 'react'; +import { EuiIcon, EuiSelectableMessage, EuiSpacer } from '@elastic/eui'; + +import { useOptionsList } from '../embeddable/options_list_embeddable'; import { OptionsListStrings } from './options_list_strings'; export const OptionsListPopoverEmptyMessage = ({ @@ -16,17 +18,35 @@ export const OptionsListPopoverEmptyMessage = ({ }: { showOnlySelected: boolean; }) => { + const optionsList = useOptionsList(); + + const searchString = optionsList.select((state) => state.componentState.searchString); + const fieldSpec = optionsList.select((state) => state.componentState.field); + const searchTechnique = optionsList.select((state) => state.explicitInput.searchTechnique); + + const noResultsMessage = useMemo(() => { + if (showOnlySelected) { + return OptionsListStrings.popover.getSelectionsEmptyMessage(); + } + if (!searchString.valid && fieldSpec && searchTechnique) { + return OptionsListStrings.popover.getInvalidSearchMessage(fieldSpec.type); + } + return OptionsListStrings.popover.getEmptyMessage(); + }, [showOnlySelected, fieldSpec, searchString.valid, searchTechnique]); + return ( - + - {showOnlySelected - ? OptionsListStrings.popover.getSelectionsEmptyMessage() - : OptionsListStrings.popover.getEmptyMessage()} + {noResultsMessage} ); }; diff --git a/src/plugins/controls/public/options_list/components/options_list_popover_invalid_selections.tsx b/src/plugins/controls/public/options_list/components/options_list_popover_invalid_selections.tsx index 2b6dbdc3b9507..7ff64482b2c60 100644 --- a/src/plugins/controls/public/options_list/components/options_list_popover_invalid_selections.tsx +++ b/src/plugins/controls/public/options_list/components/options_list_popover_invalid_selections.tsx @@ -77,7 +77,7 @@ export const OptionsListPopoverInvalidSelections = () => { listProps={{ onFocusBadge: false, isVirtualized: false }} onChange={(newSuggestions, _, changedOption) => { setSelectableOptions(newSuggestions); - optionsList.dispatch.deselectOption(changedOption.label); + optionsList.dispatch.deselectOption(changedOption.key ?? changedOption.label); }} > {(list) => list} diff --git a/src/plugins/controls/public/options_list/components/options_list_popover_sorting_button.tsx b/src/plugins/controls/public/options_list/components/options_list_popover_sorting_button.tsx index d1cad0bb97c81..d246e631fba84 100644 --- a/src/plugins/controls/public/options_list/components/options_list_popover_sorting_button.tsx +++ b/src/plugins/controls/public/options_list/components/options_list_popover_sorting_button.tsx @@ -119,7 +119,6 @@ export const OptionsListPopoverSortingButton = ({ aria-labelledby="optionsList_sortingOptions" closePopover={() => setIsSortingPopoverOpen(false)} panelClassName={'optionsList--sortPopover'} - anchorClassName={'optionsList__sortButtonPopoverAnchor'} > diff --git a/src/plugins/controls/public/options_list/components/options_list_popover_suggestions.tsx b/src/plugins/controls/public/options_list/components/options_list_popover_suggestions.tsx index a7efc79825b86..097660a55a540 100644 --- a/src/plugins/controls/public/options_list/components/options_list_popover_suggestions.tsx +++ b/src/plugins/controls/public/options_list/components/options_list_popover_suggestions.tsx @@ -30,17 +30,21 @@ export const OptionsListPopoverSuggestions = ({ }: OptionsListPopoverSuggestionsProps) => { const optionsList = useOptionsList(); + const fieldSpec = optionsList.select((state) => state.componentState.field); const searchString = optionsList.select((state) => state.componentState.searchString); const availableOptions = optionsList.select((state) => state.componentState.availableOptions); const totalCardinality = optionsList.select((state) => state.componentState.totalCardinality); const invalidSelections = optionsList.select((state) => state.componentState.invalidSelections); - const fieldSpec = optionsList.select((state) => state.componentState.field); + const allowExpensiveQueries = optionsList.select( + (state) => state.componentState.allowExpensiveQueries + ); const sort = optionsList.select((state) => state.explicitInput.sort); const fieldName = optionsList.select((state) => state.explicitInput.fieldName); const hideExists = optionsList.select((state) => state.explicitInput.hideExists); const singleSelect = optionsList.select((state) => state.explicitInput.singleSelect); const existsSelected = optionsList.select((state) => state.explicitInput.existsSelected); + const searchTechnique = optionsList.select((state) => state.explicitInput.searchTechnique); const selectedOptions = optionsList.select((state) => state.explicitInput.selectedOptions); const dataViewId = optionsList.select((state) => state.output.dataViewId); @@ -52,11 +56,11 @@ export const OptionsListPopoverSuggestions = ({ const canLoadMoreSuggestions = useMemo( () => - totalCardinality + allowExpensiveQueries && searchString.valid && totalCardinality && !showOnlySelected ? (availableOptions ?? []).length < Math.min(totalCardinality, MAX_OPTIONS_LIST_REQUEST_SIZE) : false, - [availableOptions, totalCardinality] + [availableOptions, totalCardinality, searchString, showOnlySelected, allowExpensiveQueries] ); // track selectedOptions and invalidSelections in sets for more efficient lookup @@ -85,7 +89,7 @@ export const OptionsListPopoverSuggestions = ({ useEffect(() => { /* This useEffect makes selectableOptions responsive to search, show only selected, and clear selections */ const options: EuiSelectableOption[] = (suggestions ?? []).map((suggestion) => { - if (typeof suggestion === 'string') { + if (typeof suggestion !== 'object') { // this means that `showOnlySelected` is true, and doc count is not known when this is the case suggestion = { value: suggestion }; } @@ -145,6 +149,19 @@ export const OptionsListPopoverSuggestions = ({ } }, [loadMoreSuggestions, totalCardinality]); + const renderOption = useCallback( + (option, searchStringValue) => { + if (!allowExpensiveQueries || searchTechnique === 'exact') return option.label; + + return ( + + {option.label} + + ); + }, + [searchTechnique, allowExpensiveQueries] + ); + useEffect(() => { const container = listRef.current; if (!isLoading && canLoadMoreSuggestions) { @@ -166,13 +183,7 @@ export const OptionsListPopoverSuggestions = ({
{ - return ( - - {option.label} - - ); - }} + renderOption={(option) => renderOption(option, searchString.value)} listProps={{ onFocusBadge: false }} aria-label={OptionsListStrings.popover.getSuggestionsAriaLabel( fieldName, diff --git a/src/plugins/controls/public/options_list/components/options_list_strings.ts b/src/plugins/controls/public/options_list/components/options_list_strings.ts index 2977bb9f1cbb3..1e1401918f61d 100644 --- a/src/plugins/controls/public/options_list/components/options_list_strings.ts +++ b/src/plugins/controls/public/options_list/components/options_list_strings.ts @@ -7,11 +7,12 @@ */ import { i18n } from '@kbn/i18n'; +import { OptionsListSearchTechnique } from '../../../common/options_list/suggestions_searching'; export const OptionsListStrings = { control: { getSeparator: (type?: string) => { - if (type === 'date') { + if (['date', 'number'].includes(type ?? '')) { return i18n.translate('controls.optionsList.control.dateSeparator', { defaultMessage: '; ', }); @@ -78,6 +79,17 @@ export const OptionsListStrings = { 'Matches values that contain the given search string. Results might take longer to populate.', }), }, + exact: { + getLabel: () => + i18n.translate('controls.optionsList.editor.exactSearchLabel', { + defaultMessage: 'Exact', + }), + getTooltip: () => + i18n.translate('controls.optionsList.editor.exactSearchTooltip', { + defaultMessage: + 'Matches values that are equal to the given search string. Returns results quickly.', + }), + }, }, getAdditionalSettingsTitle: () => i18n.translate('controls.optionsList.editor.additionalSettingsTitle', { @@ -127,6 +139,26 @@ export const OptionsListStrings = { i18n.translate('controls.optionsList.popover.selectionsEmpty', { defaultMessage: 'You have no selections', }), + getInvalidSearchMessage: (fieldType: string) => { + switch (fieldType) { + case 'ip': { + return i18n.translate('controls.optionsList.popover.invalidSearch.ip', { + defaultMessage: 'Your search is not a valid IP address.', + }); + } + case 'number': { + return i18n.translate('controls.optionsList.popover.invalidSearch.number', { + defaultMessage: 'Your search is not a valid number.', + }); + } + default: { + // this shouldn't happen, but giving a fallback error message just in case + return i18n.translate('controls.optionsList.popover.invalidSearch.invalidCharacters', { + defaultMessage: 'Your search contains invalid characters.', + }); + } + } + }, getAllOptionsButtonTitle: () => i18n.translate('controls.optionsList.popover.allOptionsTitle', { defaultMessage: 'Show all options', @@ -135,19 +167,24 @@ export const OptionsListStrings = { i18n.translate('controls.optionsList.popover.selectedOptionsTitle', { defaultMessage: 'Show only selected options', }), - searchPlaceholder: { - prefix: { - getPlaceholderText: () => - i18n.translate('controls.optionsList.popover.prefixSearchPlaceholder', { + getSearchPlaceholder: (searchTechnique?: OptionsListSearchTechnique) => { + switch (searchTechnique) { + case 'prefix': { + return i18n.translate('controls.optionsList.popover.prefixSearchPlaceholder', { defaultMessage: 'Starts with...', - }), - }, - wildcard: { - getPlaceholderText: () => - i18n.translate('controls.optionsList.popover.wildcardSearchPlaceholder', { + }); + } + case 'wildcard': { + return i18n.translate('controls.optionsList.popover.wildcardSearchPlaceholder', { defaultMessage: 'Contains...', - }), - }, + }); + } + case 'exact': { + return i18n.translate('controls.optionsList.popover.exactSearchPlaceholder', { + defaultMessage: 'Equals...', + }); + } + } }, getCardinalityLabel: (totalOptions: number) => i18n.translate('controls.optionsList.popover.cardinalityLabel', { @@ -234,14 +271,22 @@ export const OptionsListStrings = { }), }, _key: { - getSortByLabel: (type?: string) => - type === 'date' - ? i18n.translate('controls.optionsList.popover.sortBy.date', { + getSortByLabel: (type?: string) => { + switch (type) { + case 'date': + return i18n.translate('controls.optionsList.popover.sortBy.date', { defaultMessage: 'By date', - }) - : i18n.translate('controls.optionsList.popover.sortBy.alphabetical', { + }); + case 'number': + return i18n.translate('controls.optionsList.popover.sortBy.numeric', { + defaultMessage: 'Numerically', + }); + default: + return i18n.translate('controls.optionsList.popover.sortBy.alphabetical', { defaultMessage: 'Alphabetically', - }), + }); + } + }, }, }, sortOrder: { diff --git a/src/plugins/controls/public/options_list/embeddable/options_list_embeddable_factory.tsx b/src/plugins/controls/public/options_list/embeddable/options_list_embeddable_factory.tsx index a3fecb46442a1..395499bb882c8 100644 --- a/src/plugins/controls/public/options_list/embeddable/options_list_embeddable_factory.tsx +++ b/src/plugins/controls/public/options_list/embeddable/options_list_embeddable_factory.tsx @@ -62,7 +62,7 @@ export class OptionsListEmbeddableFactory return ( !field.spec.scripted && field.aggregatable && - ['string', 'boolean', 'ip', 'date'].includes(field.type) + ['string', 'boolean', 'ip', 'date', 'number'].includes(field.type) ); }; diff --git a/src/plugins/controls/public/options_list/options_list_reducers.ts b/src/plugins/controls/public/options_list/options_list_reducers.ts index 9791e91198e0b..3300072c089f9 100644 --- a/src/plugins/controls/public/options_list/options_list_reducers.ts +++ b/src/plugins/controls/public/options_list/options_list_reducers.ts @@ -8,15 +8,15 @@ import { PayloadAction } from '@reduxjs/toolkit'; import { WritableDraft } from 'immer/dist/types/types-external'; -import { Filter } from '@kbn/es-query'; import { FieldSpec } from '@kbn/data-views-plugin/common'; +import { Filter } from '@kbn/es-query'; -import { OptionsListReduxState, OptionsListComponentState } from './types'; -import { getIpRangeQuery } from '../../common/options_list/ip_search'; +import { isValidSearch } from '../../common/options_list/is_valid_search'; import { - OPTIONS_LIST_DEFAULT_SORT, OptionsListSortingType, + OPTIONS_LIST_DEFAULT_SORT, } from '../../common/options_list/suggestions_sorting'; +import { OptionsListComponentState, OptionsListReduxState } from './types'; export const getDefaultComponentState = (): OptionsListReduxState['componentState'] => ({ popoverOpen: false, @@ -36,12 +36,13 @@ export const optionsListReducers = { }, setSearchString: (state: WritableDraft, action: PayloadAction) => { state.componentState.searchString.value = action.payload; - if ( - action.payload !== '' && // empty string search is never invalid - state.componentState.field?.type === 'ip' // only IP searches can currently be invalid - ) { - state.componentState.searchString.valid = getIpRangeQuery(action.payload).validSearch; - } + state.componentState.searchString.valid = isValidSearch({ + searchString: action.payload, + fieldType: state.componentState.field?.type, + searchTechnique: state.componentState.allowExpensiveQueries + ? state.explicitInput.searchTechnique + : 'exact', // only exact match searching is supported when allowExpensiveQueries is false + }); }, setAllowExpensiveQueries: ( state: WritableDraft, diff --git a/src/plugins/controls/server/options_list/options_list_cheap_suggestion_queries.test.ts b/src/plugins/controls/server/options_list/options_list_cheap_suggestion_queries.test.ts deleted file mode 100644 index d364027a55d9b..0000000000000 --- a/src/plugins/controls/server/options_list/options_list_cheap_suggestion_queries.test.ts +++ /dev/null @@ -1,690 +0,0 @@ -/* - * 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 { FieldSpec } from '@kbn/data-views-plugin/common'; -import { SearchResponse } from '@elastic/elasticsearch/lib/api/types'; - -import { getCheapSuggestionAggregationBuilder } from './options_list_cheap_suggestion_queries'; -import { OptionsListRequestBody } from '../../common/options_list/types'; - -describe('options list cheap queries', () => { - let rawSearchResponseMock: SearchResponse = {} as SearchResponse; - - beforeEach(() => { - rawSearchResponseMock = { - hits: { - total: 10, - max_score: 10, - hits: [], - }, - took: 10, - timed_out: false, - _shards: { - failed: 0, - successful: 1, - total: 1, - skipped: 0, - }, - aggregations: {}, - }; - }); - - describe('suggestion aggregation', () => { - describe('keyword or text+keyword field', () => { - test('without a search string, creates keyword aggregation', () => { - const optionsListRequestBodyMock: OptionsListRequestBody = { - size: 10, - allowExpensiveQueries: false, - fieldName: 'coolTestField.keyword', - sort: { by: '_count', direction: 'asc' }, - fieldSpec: { aggregatable: true } as unknown as FieldSpec, - }; - const suggestionAggBuilder = getCheapSuggestionAggregationBuilder( - optionsListRequestBodyMock - ); - expect(suggestionAggBuilder.buildAggregation(optionsListRequestBodyMock)) - .toMatchInlineSnapshot(` - Object { - "suggestions": Object { - "terms": Object { - "field": "coolTestField.keyword", - "order": Object { - "_count": "asc", - }, - "shard_size": 10, - }, - }, - } - `); - }); - - test('with a search string, creates case sensitive keyword aggregation', () => { - const optionsListRequestBodyMock: OptionsListRequestBody = { - size: 10, - searchString: 'cooool', - allowExpensiveQueries: false, - fieldName: 'coolTestField.keyword', - fieldSpec: { aggregatable: true } as unknown as FieldSpec, - }; - const suggestionAggBuilder = getCheapSuggestionAggregationBuilder( - optionsListRequestBodyMock - ); - expect(suggestionAggBuilder.buildAggregation(optionsListRequestBodyMock)) - .toMatchInlineSnapshot(` - Object { - "suggestions": Object { - "terms": Object { - "field": "coolTestField.keyword", - "include": "cooool.*", - "order": Object { - "_count": "desc", - }, - "shard_size": 10, - }, - }, - } - `); - }); - }); - - test('creates nested aggregation for nested field', () => { - const optionsListRequestBodyMock: OptionsListRequestBody = { - size: 10, - searchString: 'cooool', - allowExpensiveQueries: false, - fieldName: 'coolNestedField', - sort: { by: '_key', direction: 'asc' }, - fieldSpec: { subType: { nested: { path: 'path.to.nested' } } } as unknown as FieldSpec, - }; - const suggestionAggBuilder = getCheapSuggestionAggregationBuilder(optionsListRequestBodyMock); - expect(suggestionAggBuilder.buildAggregation(optionsListRequestBodyMock)) - .toMatchInlineSnapshot(` - Object { - "nestedSuggestions": Object { - "aggs": Object { - "suggestions": Object { - "terms": Object { - "field": "coolNestedField", - "include": "cooool.*", - "order": Object { - "_key": "asc", - }, - "shard_size": 10, - }, - }, - }, - "nested": Object { - "path": "path.to.nested", - }, - }, - } - `); - }); - - describe('boolean field', () => { - test('creates boolean aggregation for boolean field', () => { - const optionsListRequestBodyMock: OptionsListRequestBody = { - size: 10, - fieldName: 'coolean', - allowExpensiveQueries: false, - sort: { by: '_key', direction: 'desc' }, - fieldSpec: { type: 'boolean' } as unknown as FieldSpec, - }; - const suggestionAggBuilder = getCheapSuggestionAggregationBuilder( - optionsListRequestBodyMock - ); - expect(suggestionAggBuilder.buildAggregation(optionsListRequestBodyMock)) - .toMatchInlineSnapshot(` - Object { - "suggestions": Object { - "terms": Object { - "field": "coolean", - "order": Object { - "_key": "desc", - }, - "shard_size": 10, - }, - }, - } - `); - }); - }); - - describe('date field field', () => { - test('creates date aggregation for date field', () => { - const optionsListRequestBodyMock: OptionsListRequestBody = { - size: 10, - fieldName: '@timestamp', - allowExpensiveQueries: false, - sort: { by: '_key', direction: 'desc' }, - fieldSpec: { type: 'date' } as unknown as FieldSpec, - }; - const suggestionAggBuilder = getCheapSuggestionAggregationBuilder( - optionsListRequestBodyMock - ); - expect(suggestionAggBuilder.buildAggregation(optionsListRequestBodyMock)) - .toMatchInlineSnapshot(` - Object { - "suggestions": Object { - "terms": Object { - "field": "@timestamp", - "order": Object { - "_key": "desc", - }, - "shard_size": 10, - }, - }, - } - `); - }); - }); - - describe('IP field', () => { - test('without a search string, creates IP range aggregation with default range', () => { - const optionsListRequestBodyMock: OptionsListRequestBody = { - size: 10, - fieldName: 'clientip', - allowExpensiveQueries: false, - sort: { by: '_count', direction: 'asc' }, - fieldSpec: { type: 'ip' } as unknown as FieldSpec, - }; - const suggestionAggBuilder = getCheapSuggestionAggregationBuilder( - optionsListRequestBodyMock - ); - expect(suggestionAggBuilder.buildAggregation(optionsListRequestBodyMock)) - .toMatchInlineSnapshot(` - Object { - "suggestions": Object { - "aggs": Object { - "filteredSuggestions": Object { - "terms": Object { - "field": "clientip", - "order": Object { - "_count": "asc", - }, - "shard_size": 10, - }, - }, - }, - "ip_range": Object { - "field": "clientip", - "keyed": true, - "ranges": Array [ - Object { - "from": "::", - "key": "ipv6", - "to": "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", - }, - ], - }, - }, - } - `); - }); - - test('full IPv4 in the search string, creates IP range aggregation with CIDR mask', () => { - const optionsListRequestBodyMock: OptionsListRequestBody = { - size: 10, - fieldName: 'clientip', - allowExpensiveQueries: false, - searchString: '41.77.243.255', - sort: { by: '_key', direction: 'desc' }, - fieldSpec: { type: 'ip' } as unknown as FieldSpec, - }; - const suggestionAggBuilder = getCheapSuggestionAggregationBuilder( - optionsListRequestBodyMock - ); - expect(suggestionAggBuilder.buildAggregation(optionsListRequestBodyMock)) - .toMatchInlineSnapshot(` - Object { - "suggestions": Object { - "aggs": Object { - "filteredSuggestions": Object { - "terms": Object { - "field": "clientip", - "order": Object { - "_key": "desc", - }, - "shard_size": 10, - }, - }, - }, - "ip_range": Object { - "field": "clientip", - "keyed": true, - "ranges": Array [ - Object { - "key": "ipv4", - "mask": "41.77.243.255/32", - }, - ], - }, - }, - } - `); - }); - - test('full IPv6 in the search string, creates IP range aggregation with CIDR mask', () => { - const optionsListRequestBodyMock: OptionsListRequestBody = { - size: 10, - fieldName: 'clientip', - allowExpensiveQueries: false, - sort: { by: '_key', direction: 'asc' }, - fieldSpec: { type: 'ip' } as unknown as FieldSpec, - searchString: 'f688:fb50:6433:bba2:604:f2c:194a:d3c5', - }; - const suggestionAggBuilder = getCheapSuggestionAggregationBuilder( - optionsListRequestBodyMock - ); - expect(suggestionAggBuilder.buildAggregation(optionsListRequestBodyMock)) - .toMatchInlineSnapshot(` - Object { - "suggestions": Object { - "aggs": Object { - "filteredSuggestions": Object { - "terms": Object { - "field": "clientip", - "order": Object { - "_key": "asc", - }, - "shard_size": 10, - }, - }, - }, - "ip_range": Object { - "field": "clientip", - "keyed": true, - "ranges": Array [ - Object { - "key": "ipv6", - "mask": "f688:fb50:6433:bba2:604:f2c:194a:d3c5/128", - }, - ], - }, - }, - } - `); - }); - - test('partial IPv4 in the search string, creates IP range aggregation with min and max', () => { - const optionsListRequestBodyMock: OptionsListRequestBody = { - size: 10, - fieldName: 'clientip', - searchString: '41.77', - allowExpensiveQueries: false, - fieldSpec: { type: 'ip' } as unknown as FieldSpec, - }; - const suggestionAggBuilder = getCheapSuggestionAggregationBuilder( - optionsListRequestBodyMock - ); - expect(suggestionAggBuilder.buildAggregation(optionsListRequestBodyMock)) - .toMatchInlineSnapshot(` - Object { - "suggestions": Object { - "aggs": Object { - "filteredSuggestions": Object { - "terms": Object { - "field": "clientip", - "order": Object { - "_count": "desc", - }, - "shard_size": 10, - }, - }, - }, - "ip_range": Object { - "field": "clientip", - "keyed": true, - "ranges": Array [ - Object { - "from": "41.77.0.0", - "key": "ipv4", - "to": "41.77.255.255", - }, - ], - }, - }, - } - `); - }); - - test('partial IPv46 in the search string, creates IP range aggregation with min and max', () => { - const optionsListRequestBodyMock: OptionsListRequestBody = { - size: 10, - fieldName: 'clientip', - searchString: 'cdb6:', - allowExpensiveQueries: false, - sort: { by: '_count', direction: 'desc' }, - fieldSpec: { type: 'ip' } as unknown as FieldSpec, - }; - const suggestionAggBuilder = getCheapSuggestionAggregationBuilder( - optionsListRequestBodyMock - ); - expect(suggestionAggBuilder.buildAggregation(optionsListRequestBodyMock)) - .toMatchInlineSnapshot(` - Object { - "suggestions": Object { - "aggs": Object { - "filteredSuggestions": Object { - "terms": Object { - "field": "clientip", - "order": Object { - "_count": "desc", - }, - "shard_size": 10, - }, - }, - }, - "ip_range": Object { - "field": "clientip", - "keyed": true, - "ranges": Array [ - Object { - "from": "cdb6::", - "key": "ipv6", - "to": "cdb6:ffff:ffff:ffff:ffff:ffff:ffff:ffff", - }, - ], - }, - }, - } - `); - }); - }); - }); - - describe('suggestion parsing', () => { - test('parses keyword / text result', () => { - const optionsListRequestBodyMock: OptionsListRequestBody = { - size: 10, - searchString: 'cooool', - allowExpensiveQueries: false, - fieldName: 'coolTestField.keyword', - fieldSpec: { aggregatable: true } as unknown as FieldSpec, - }; - const suggestionAggBuilder = getCheapSuggestionAggregationBuilder(optionsListRequestBodyMock); - rawSearchResponseMock.aggregations = { - suggestions: { - buckets: [ - { doc_count: 5, key: 'cool1' }, - { doc_count: 15, key: 'cool2' }, - { doc_count: 10, key: 'cool3' }, - ], - }, - }; - expect( - suggestionAggBuilder.parse(rawSearchResponseMock, optionsListRequestBodyMock).suggestions - ).toMatchInlineSnapshot(` - Array [ - Object { - "docCount": 5, - "value": "cool1", - }, - Object { - "docCount": 15, - "value": "cool2", - }, - Object { - "docCount": 10, - "value": "cool3", - }, - ] - `); - }); - - test('parses boolean result', () => { - const optionsListRequestBodyMock: OptionsListRequestBody = { - size: 10, - fieldName: 'coolean', - allowExpensiveQueries: false, - fieldSpec: { type: 'boolean' } as unknown as FieldSpec, - }; - const suggestionAggBuilder = getCheapSuggestionAggregationBuilder(optionsListRequestBodyMock); - rawSearchResponseMock.aggregations = { - suggestions: { - buckets: [ - { doc_count: 55, key_as_string: 'false' }, - { doc_count: 155, key_as_string: 'true' }, - ], - }, - }; - expect( - suggestionAggBuilder.parse(rawSearchResponseMock, optionsListRequestBodyMock).suggestions - ).toMatchInlineSnapshot(` - Array [ - Object { - "docCount": 55, - "value": "false", - }, - Object { - "docCount": 155, - "value": "true", - }, - ] - `); - }); - - test('parses nested result', () => { - const optionsListRequestBodyMock: OptionsListRequestBody = { - size: 10, - searchString: 'cooool', - fieldName: 'coolNestedField', - allowExpensiveQueries: false, - fieldSpec: { subType: { nested: { path: 'path.to.nested' } } } as unknown as FieldSpec, - }; - const suggestionAggBuilder = getCheapSuggestionAggregationBuilder(optionsListRequestBodyMock); - rawSearchResponseMock.aggregations = { - nestedSuggestions: { - suggestions: { - buckets: [ - { doc_count: 5, key: 'cool1' }, - { doc_count: 15, key: 'cool2' }, - { doc_count: 10, key: 'cool3' }, - ], - }, - }, - }; - expect( - suggestionAggBuilder.parse(rawSearchResponseMock, optionsListRequestBodyMock).suggestions - ).toMatchInlineSnapshot(` - Array [ - Object { - "docCount": 5, - "value": "cool1", - }, - Object { - "docCount": 15, - "value": "cool2", - }, - Object { - "docCount": 10, - "value": "cool3", - }, - ] - `); - }); - - test('parses keyword only result', () => { - const optionsListRequestBodyMock: OptionsListRequestBody = { - size: 10, - searchString: 'cooool', - allowExpensiveQueries: false, - fieldName: 'coolTestField.keyword', - fieldSpec: { aggregatable: true } as unknown as FieldSpec, - }; - const suggestionAggBuilder = getCheapSuggestionAggregationBuilder(optionsListRequestBodyMock); - rawSearchResponseMock.aggregations = { - suggestions: { - buckets: [ - { doc_count: 5, key: 'cool1' }, - { doc_count: 15, key: 'cool2' }, - { doc_count: 10, key: 'cool3' }, - ], - }, - }; - expect( - suggestionAggBuilder.parse(rawSearchResponseMock, optionsListRequestBodyMock).suggestions - ).toMatchInlineSnapshot(` - Array [ - Object { - "docCount": 5, - "value": "cool1", - }, - Object { - "docCount": 15, - "value": "cool2", - }, - Object { - "docCount": 10, - "value": "cool3", - }, - ] - `); - }); - - test('parses mixed IPv4 and IPv6 result', () => { - const optionsListRequestBodyMock: OptionsListRequestBody = { - size: 10, - fieldName: 'clientip', - allowExpensiveQueries: false, - fieldSpec: { type: 'ip' } as unknown as FieldSpec, - }; - const suggestionAggBuilder = getCheapSuggestionAggregationBuilder(optionsListRequestBodyMock); - rawSearchResponseMock.aggregations = { - suggestions: { - buckets: { - ipv4: { - from: '0.0.0.0', - to: '255.255.255.255', - filteredSuggestions: { - buckets: [ - { doc_count: 8, key: '21.35.91.62' }, - { doc_count: 8, key: '21.35.91.61' }, - { doc_count: 11, key: '111.52.174.2' }, - { doc_count: 1, key: '56.73.58.63' }, - { doc_count: 9, key: '23.216.241.120' }, - { doc_count: 10, key: '196.162.13.39' }, - { doc_count: 7, key: '203.88.33.151' }, - ], - }, - }, - ipv6: { - from: '::', - to: 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff', - filteredSuggestions: { - buckets: [ - { doc_count: 12, key: '52:ae76:5947:5e2a:551:fe6a:712a:c72' }, - { doc_count: 1, key: 'fd:4aa0:c27c:b04:997f:2de1:51b4:8418' }, - { doc_count: 9, key: '28c7:c9a4:42fd:16b0:4de5:e41e:28d9:9172' }, - { doc_count: 6, key: '1ec:aa98:b0a6:d07c:590:18a0:8a33:2eb8' }, - { doc_count: 10, key: 'f7a9:640b:b5a0:1219:8d75:ed94:3c3e:2e63' }, - ], - }, - }, - }, - }, - }; - - const parsed = suggestionAggBuilder.parse( - rawSearchResponseMock, - optionsListRequestBodyMock - ).suggestions; - - expect(parsed).toMatchInlineSnapshot(` - Array [ - Object { - "docCount": 12, - "value": "52:ae76:5947:5e2a:551:fe6a:712a:c72", - }, - Object { - "docCount": 11, - "value": "111.52.174.2", - }, - Object { - "docCount": 10, - "value": "196.162.13.39", - }, - Object { - "docCount": 10, - "value": "f7a9:640b:b5a0:1219:8d75:ed94:3c3e:2e63", - }, - Object { - "docCount": 9, - "value": "23.216.241.120", - }, - Object { - "docCount": 9, - "value": "28c7:c9a4:42fd:16b0:4de5:e41e:28d9:9172", - }, - Object { - "docCount": 8, - "value": "21.35.91.62", - }, - Object { - "docCount": 8, - "value": "21.35.91.61", - }, - Object { - "docCount": 7, - "value": "203.88.33.151", - }, - Object { - "docCount": 6, - "value": "1ec:aa98:b0a6:d07c:590:18a0:8a33:2eb8", - }, - ] - `); - }); - - test('parses date result', () => { - const optionsListRequestBodyMock: OptionsListRequestBody = { - size: 10, - fieldName: '@timestamp', - allowExpensiveQueries: false, - fieldSpec: { type: 'date' } as unknown as FieldSpec, - }; - const suggestionAggBuilder = getCheapSuggestionAggregationBuilder(optionsListRequestBodyMock); - rawSearchResponseMock.aggregations = { - suggestions: { - buckets: [ - { doc_count: 20, key: 1696824675 }, - { doc_count: 13, key: 1686086625 }, - { doc_count: 4, key: 1703684229 }, - { doc_count: 34, key: 1688603684 }, - ], - }, - }; - - const parsed = suggestionAggBuilder.parse( - rawSearchResponseMock, - optionsListRequestBodyMock - ).suggestions; - - expect(parsed).toMatchInlineSnapshot(` - Array [ - Object { - "docCount": 20, - "value": 1696824675, - }, - Object { - "docCount": 13, - "value": 1686086625, - }, - Object { - "docCount": 4, - "value": 1703684229, - }, - Object { - "docCount": 34, - "value": 1688603684, - }, - ] - `); - }); - }); -}); diff --git a/src/plugins/controls/server/options_list/options_list_cheap_suggestion_queries.ts b/src/plugins/controls/server/options_list/options_list_cheap_suggestion_queries.ts deleted file mode 100644 index cba08877607d7..0000000000000 --- a/src/plugins/controls/server/options_list/options_list_cheap_suggestion_queries.ts +++ /dev/null @@ -1,207 +0,0 @@ -/* - * 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 { get } from 'lodash'; -import { getFieldSubtypeNested } from '@kbn/data-views-plugin/common'; - -import { OptionsListRequestBody, OptionsListSuggestions } from '../../common/options_list/types'; -import { getIpRangeQuery, type IpRangeQuery } from '../../common/options_list/ip_search'; -import { EsBucket, OptionsListSuggestionAggregationBuilder } from './types'; -import { - getEscapedRegexQuery, - getIpBuckets, - getSortType, -} from './options_list_suggestion_query_helpers'; - -/** - * Suggestion aggregations - */ -export const getCheapSuggestionAggregationBuilder = ({ fieldSpec }: OptionsListRequestBody) => { - if (fieldSpec?.type === 'boolean') { - return cheapSuggestionAggSubtypes.boolean; - } - if (fieldSpec?.type === 'ip') { - return cheapSuggestionAggSubtypes.ip; - } - if (fieldSpec && getFieldSubtypeNested(fieldSpec)) { - return cheapSuggestionAggSubtypes.subtypeNested; - } - return cheapSuggestionAggSubtypes.keywordOrText; -}; - -const cheapSuggestionAggSubtypes: { [key: string]: OptionsListSuggestionAggregationBuilder } = { - /** - * The "textOrKeyword" query / parser should be used whenever the field is built on some type non-nested string field - * (such as a keyword field or a keyword+text multi-field) - */ - keywordOrText: { - buildAggregation: ({ fieldName, fieldSpec, searchString, sort }: OptionsListRequestBody) => ({ - suggestions: { - terms: { - field: fieldName, - // disabling for date fields because applying a search string will return an error - ...(fieldSpec?.type !== 'date' && searchString && searchString.length > 0 - ? { include: `${getEscapedRegexQuery(searchString)}.*` } - : {}), - shard_size: 10, - order: getSortType(sort), - }, - }, - }), - parse: (rawEsResult) => ({ - suggestions: get(rawEsResult, 'aggregations.suggestions.buckets')?.reduce( - (acc: OptionsListSuggestions, suggestion: EsBucket) => { - acc.push({ value: suggestion.key, docCount: suggestion.doc_count }); - return acc; - }, - [] - ), - }), - }, - - /** - * the "Boolean" query / parser should be used when the options list is built on a field of type boolean. The query is slightly different than a keyword query. - */ - boolean: { - buildAggregation: ({ fieldName, sort }: OptionsListRequestBody) => ({ - suggestions: { - terms: { - field: fieldName, - shard_size: 10, - order: getSortType(sort), - }, - }, - }), - parse: (rawEsResult) => ({ - suggestions: get(rawEsResult, 'aggregations.suggestions.buckets')?.reduce( - (acc: OptionsListSuggestions, suggestion: EsBucket & { key_as_string: string }) => { - acc.push({ value: suggestion.key_as_string, docCount: suggestion.doc_count }); - return acc; - }, - [] - ), - }), - }, - - /** - * the "IP" query / parser should be used when the options list is built on a field of type IP. - */ - ip: { - buildAggregation: ({ fieldName, searchString, sort }: OptionsListRequestBody) => { - let ipRangeQuery: IpRangeQuery = { - validSearch: true, - rangeQuery: [ - { - key: 'ipv6', - from: '::', - to: 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff', - }, - ], - }; - - if (searchString && searchString.length > 0) { - ipRangeQuery = getIpRangeQuery(searchString); - if (!ipRangeQuery.validSearch) { - // ideally should be prevented on the client side but, if somehow an invalid search gets through to the server, - // simply don't return an aggregation query for the ES search request - return undefined; - } - } - - return { - suggestions: { - ip_range: { - field: fieldName, - ranges: ipRangeQuery.rangeQuery, - keyed: true, - }, - aggs: { - filteredSuggestions: { - terms: { - field: fieldName, - shard_size: 10, - order: getSortType(sort), - }, - }, - }, - }, - }; - }, - parse: (rawEsResult, { sort }) => { - if (!Boolean(rawEsResult.aggregations?.suggestions)) { - // if this is happens, that means there is an invalid search that snuck through to the server side code; - // so, might as well early return with no suggestions - return { suggestions: [] }; - } - - const buckets: EsBucket[] = []; - getIpBuckets(rawEsResult, buckets, 'ipv4'); // modifies buckets array directly, i.e. "by reference" - getIpBuckets(rawEsResult, buckets, 'ipv6'); - - const sortedSuggestions = - sort?.direction === 'asc' - ? buckets.sort( - (bucketA: EsBucket, bucketB: EsBucket) => bucketA.doc_count - bucketB.doc_count - ) - : buckets.sort( - (bucketA: EsBucket, bucketB: EsBucket) => bucketB.doc_count - bucketA.doc_count - ); - - return { - suggestions: sortedSuggestions - .slice(0, 10) // only return top 10 results - .reduce((acc: OptionsListSuggestions, suggestion: EsBucket) => { - acc.push({ value: suggestion.key, docCount: suggestion.doc_count }); - return acc; - }, []), - }; - }, - }, - - /** - * the "Subtype Nested" query / parser should be used when the options list is built on a field with subtype nested. - */ - subtypeNested: { - buildAggregation: (req: OptionsListRequestBody) => { - const { fieldSpec, fieldName, searchString, sort } = req; - const subTypeNested = fieldSpec && getFieldSubtypeNested(fieldSpec); - if (!subTypeNested) { - // if this field is not subtype nested, fall back to keywordOnly - return cheapSuggestionAggSubtypes.keywordOnly.buildAggregation(req); - } - return { - nestedSuggestions: { - nested: { - path: subTypeNested.nested.path, - }, - aggs: { - suggestions: { - terms: { - field: fieldName, - ...(searchString && searchString.length > 0 - ? { include: `${getEscapedRegexQuery(searchString)}.*` } - : {}), - shard_size: 10, - order: getSortType(sort), - }, - }, - }, - }, - }; - }, - parse: (rawEsResult) => ({ - suggestions: get(rawEsResult, 'aggregations.nestedSuggestions.suggestions.buckets')?.reduce( - (acc: OptionsListSuggestions, suggestion: EsBucket) => { - acc.push({ value: suggestion.key, docCount: suggestion.doc_count }); - return acc; - }, - [] - ), - }), - }, -}; diff --git a/src/plugins/controls/server/options_list/options_list_suggestions_route.ts b/src/plugins/controls/server/options_list/options_list_suggestions_route.ts index b2a42fa0b3b19..310a04874f7fb 100644 --- a/src/plugins/controls/server/options_list/options_list_suggestions_route.ts +++ b/src/plugins/controls/server/options_list/options_list_suggestions_route.ts @@ -8,17 +8,15 @@ import { Observable } from 'rxjs'; -import { PluginSetup as UnifiedSearchPluginSetup } from '@kbn/unified-search-plugin/server'; -import { getKbnServerError, reportServerError } from '@kbn/kibana-utils-plugin/server'; +import { schema } from '@kbn/config-schema'; import { CoreSetup, ElasticsearchClient } from '@kbn/core/server'; import { SearchRequest } from '@kbn/data-plugin/common'; -import { schema } from '@kbn/config-schema'; +import { getKbnServerError, reportServerError } from '@kbn/kibana-utils-plugin/server'; +import { PluginSetup as UnifiedSearchPluginSetup } from '@kbn/unified-search-plugin/server'; import { OptionsListRequestBody, OptionsListResponse } from '../../common/options_list/types'; import { getValidationAggregationBuilder } from './options_list_validation_queries'; -import { getExpensiveSuggestionAggregationBuilder } from './options_list_expensive_suggestion_queries'; -import { getCheapSuggestionAggregationBuilder } from './options_list_cheap_suggestion_queries'; -import { OptionsListSuggestionAggregationBuilder } from './types'; +import { getSuggestionAggregationBuilder } from './suggestion_queries'; export const setupOptionsListSuggestionsRoute = ( { http }: CoreSetup, @@ -51,6 +49,13 @@ export const setupOptionsListSuggestionsRoute = ( fieldSpec: schema.maybe(schema.any()), allowExpensiveQueries: schema.boolean(), searchString: schema.maybe(schema.string()), + searchTechnique: schema.maybe( + schema.oneOf([ + schema.literal('exact'), + schema.literal('prefix'), + schema.literal('wildcard'), + ]) + ), selectedOptions: schema.maybe( schema.oneOf([schema.arrayOf(schema.string()), schema.arrayOf(schema.number())]) ), @@ -97,18 +102,13 @@ export const setupOptionsListSuggestionsRoute = ( /** * Build ES Query */ - const { runPastTimeout, filters, runtimeFieldMap, allowExpensiveQueries } = request; + const { runPastTimeout, filters, runtimeFieldMap } = request; const { terminateAfter, timeout } = getAutocompleteSettings(); const timeoutSettings = runPastTimeout ? {} : { timeout: `${timeout}ms`, terminate_after: terminateAfter }; - let suggestionBuilder: OptionsListSuggestionAggregationBuilder; - if (allowExpensiveQueries) { - suggestionBuilder = getExpensiveSuggestionAggregationBuilder(request); - } else { - suggestionBuilder = getCheapSuggestionAggregationBuilder(request); - } + const suggestionBuilder = getSuggestionAggregationBuilder(request); const validationBuilder = getValidationAggregationBuilder(); const suggestionAggregation: any = suggestionBuilder.buildAggregation(request) ?? {}; @@ -134,6 +134,7 @@ export const setupOptionsListSuggestionsRoute = ( ...runtimeFieldMap, }, }; + /** * Run ES query */ diff --git a/src/plugins/controls/server/options_list/suggestion_queries/index.ts b/src/plugins/controls/server/options_list/suggestion_queries/index.ts new file mode 100644 index 0000000000000..5474873ed5385 --- /dev/null +++ b/src/plugins/controls/server/options_list/suggestion_queries/index.ts @@ -0,0 +1,9 @@ +/* + * 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 { getSuggestionAggregationBuilder } from './options_list_suggestion_queries'; diff --git a/src/plugins/controls/server/options_list/suggestion_queries/options_list_all_suggestions.test.ts b/src/plugins/controls/server/options_list/suggestion_queries/options_list_all_suggestions.test.ts new file mode 100644 index 0000000000000..6b785c8c0bdb3 --- /dev/null +++ b/src/plugins/controls/server/options_list/suggestion_queries/options_list_all_suggestions.test.ts @@ -0,0 +1,142 @@ +/* + * 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 { FieldSpec } from '@kbn/data-views-plugin/common'; +import { OptionsListRequestBody } from '../../../common/options_list/types'; +import { getAllSuggestionsAggregationBuilder } from './options_list_all_suggestions'; + +describe('options list fetch all suggestions query', () => { + describe('suggestion aggregation', () => { + test('number field', () => { + const optionsListRequestBodyMock: OptionsListRequestBody = { + size: 10, + fieldName: 'bytes', + allowExpensiveQueries: true, + fieldSpec: { + type: 'number', + } as unknown as FieldSpec, + sort: { + by: '_key', + direction: 'asc', + }, + }; + const aggregationBuilder = getAllSuggestionsAggregationBuilder(); + const aggregation = aggregationBuilder.buildAggregation(optionsListRequestBodyMock); + + expect(aggregation).toMatchObject({ + suggestions: { + terms: { + size: 10, + shard_size: 10, + field: 'bytes', + order: { + _key: 'asc', + }, + }, + }, + unique_terms: { + cardinality: { + field: 'bytes', + }, + }, + }); + }); + + test('nested string (keyword, text+keyword) field', () => { + const optionsListRequestBodyMock: OptionsListRequestBody = { + size: 10, + fieldName: 'testField', + allowExpensiveQueries: true, + fieldSpec: { + type: 'string', + subType: { nested: { path: 'path.to.nested' } }, + } as unknown as FieldSpec, + }; + const aggregationBuilder = getAllSuggestionsAggregationBuilder(); + const aggregation = aggregationBuilder.buildAggregation(optionsListRequestBodyMock); + + expect(aggregation).toMatchObject({ + nestedSuggestions: { + nested: { + path: 'path.to.nested', + }, + aggs: { + suggestions: { + terms: { + size: 10, + shard_size: 10, + field: 'testField', + order: { + _count: 'desc', + }, + }, + }, + unique_terms: { + cardinality: { + field: 'testField', + }, + }, + }, + }, + }); + }); + }); + + test('suggestion parsing', () => { + const optionsListRequestBodyMock: OptionsListRequestBody = { + size: 10, + fieldName: 'bytes', + allowExpensiveQueries: true, + fieldSpec: { + type: 'number', + } as unknown as FieldSpec, + sort: { + by: '_key', + direction: 'asc', + }, + }; + const aggregationBuilder = getAllSuggestionsAggregationBuilder(); + const searchResponseMock = { + hits: { + total: 10, + max_score: 10, + hits: [], + }, + took: 10, + timed_out: false, + _shards: { + failed: 0, + successful: 1, + total: 1, + skipped: 0, + }, + aggregations: { + suggestions: { + buckets: [ + { doc_count: 5, key: '1' }, + { doc_count: 4, key: '2' }, + { doc_count: 3, key: '3' }, + ], + }, + unique_terms: { + value: 3, + }, + }, + }; + + const parsed = aggregationBuilder.parse(searchResponseMock, optionsListRequestBodyMock); + expect(parsed).toMatchObject({ + suggestions: [ + { value: '1', docCount: 5 }, + { value: '2', docCount: 4 }, + { value: '3', docCount: 3 }, + ], + totalCardinality: 3, + }); + }); +}); diff --git a/src/plugins/controls/server/options_list/suggestion_queries/options_list_all_suggestions.ts b/src/plugins/controls/server/options_list/suggestion_queries/options_list_all_suggestions.ts new file mode 100644 index 0000000000000..e3f82bd4a9baf --- /dev/null +++ b/src/plugins/controls/server/options_list/suggestion_queries/options_list_all_suggestions.ts @@ -0,0 +1,90 @@ +/* + * 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 { getFieldSubtypeNested } from '@kbn/data-views-plugin/common'; +import { get } from 'lodash'; + +import { OptionsListRequestBody, OptionsListSuggestions } from '../../../common/options_list/types'; +import { EsBucket, OptionsListSuggestionAggregationBuilder } from '../types'; +import { getSortType } from './options_list_suggestion_query_helpers'; + +/** + * Fetch all suggestions without any additional searching/filtering. + * This query will be more-or-less the same for **all** field types, + */ +export const getAllSuggestionsAggregationBuilder: () => OptionsListSuggestionAggregationBuilder = + () => allSuggestionsAggregationBuilder; + +const allSuggestionsAggregationBuilder: OptionsListSuggestionAggregationBuilder = { + buildAggregation: ({ + fieldName, + fieldSpec, + sort, + size, + allowExpensiveQueries, + }: OptionsListRequestBody) => { + let suggestionsAgg: { suggestions: any; unique_terms?: any } = { + suggestions: { + terms: { + size, + field: fieldName, + shard_size: 10, + order: getSortType(sort), + }, + }, + }; + + if (allowExpensiveQueries) { + suggestionsAgg = { + ...suggestionsAgg, + unique_terms: { + cardinality: { + field: fieldName, + }, + }, + }; + } + + const subTypeNested = fieldSpec && getFieldSubtypeNested(fieldSpec); + if (subTypeNested) { + return { + nestedSuggestions: { + nested: { + path: subTypeNested.nested.path, + }, + aggs: { + ...suggestionsAgg, + }, + }, + }; + } + + return suggestionsAgg; + }, + parse: (rawEsResult, { fieldSpec, allowExpensiveQueries }: OptionsListRequestBody) => { + const subTypeNested = fieldSpec && getFieldSubtypeNested(fieldSpec); + const suggestions = get( + rawEsResult, + `aggregations.${subTypeNested ? 'nestedSuggestions.suggestions' : 'suggestions'}.buckets` + )?.reduce((acc: OptionsListSuggestions, suggestion: EsBucket) => { + acc.push({ value: suggestion.key, docCount: suggestion.doc_count }); + return acc; + }, []); + return { + suggestions, + totalCardinality: allowExpensiveQueries + ? get( + rawEsResult, + `aggregations.${ + subTypeNested ? 'nestedSuggestions.unique_terms' : 'unique_terms' + }.value` + ) + : undefined, + }; + }, +}; diff --git a/src/plugins/controls/server/options_list/suggestion_queries/options_list_exact_match.test.ts b/src/plugins/controls/server/options_list/suggestion_queries/options_list_exact_match.test.ts new file mode 100644 index 0000000000000..77ec137e0dbe7 --- /dev/null +++ b/src/plugins/controls/server/options_list/suggestion_queries/options_list_exact_match.test.ts @@ -0,0 +1,180 @@ +/* + * 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 { SearchResponse } from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; +import { FieldSpec } from '@kbn/data-views-plugin/common'; +import { OptionsListRequestBody } from '../../../common/options_list/types'; +import { getExactMatchAggregationBuilder } from './options_list_exact_match'; + +describe('options list exact match search query', () => { + test('returns empty result when given invalid search', () => { + const optionsListRequestBodyMock: OptionsListRequestBody = { + size: 10, + fieldName: 'bytes', + allowExpensiveQueries: true, + sort: { by: '_key', direction: 'desc' }, + searchString: '1a2b3c', + fieldSpec: { type: 'number' } as unknown as FieldSpec, + }; + const aggregationBuilder = getExactMatchAggregationBuilder(); + const aggregation = aggregationBuilder.buildAggregation(optionsListRequestBodyMock); + expect(aggregation).toEqual({}); + const parsed = aggregationBuilder.parse( + {} as any as SearchResponse, + optionsListRequestBodyMock + ); + expect(parsed).toEqual({ suggestions: [], totalCardinality: 0 }); + }); + + describe('suggestion aggregation', () => { + test('string (keyword, text+keyword) field', () => { + const optionsListRequestBodyMock: OptionsListRequestBody = { + size: 10, + fieldName: 'testField', + allowExpensiveQueries: true, + searchString: 'searchForMe', + fieldSpec: { type: 'string' } as unknown as FieldSpec, + }; + const aggregationBuilder = getExactMatchAggregationBuilder(); + const aggregation = aggregationBuilder.buildAggregation(optionsListRequestBodyMock); + expect(aggregation).toMatchObject({ + suggestions: { + filter: { + term: { + testField: { + value: 'searchForMe', + case_insensitive: true, + }, + }, + }, + aggs: { + filteredSuggestions: { + terms: { + field: 'testField', + shard_size: 10, + }, + }, + }, + }, + }); + }); + + test('nested string (keyword, text+keyword) field', () => { + const optionsListRequestBodyMock: OptionsListRequestBody = { + size: 10, + fieldName: 'testField', + allowExpensiveQueries: true, + searchString: 'searchForMe', + fieldSpec: { + type: 'string', + subType: { nested: { path: 'path.to.nested' } }, + } as unknown as FieldSpec, + }; + const aggregationBuilder = getExactMatchAggregationBuilder(); + const aggregation = aggregationBuilder.buildAggregation(optionsListRequestBodyMock); + + expect(aggregation).toMatchObject({ + nestedSuggestions: { + nested: { + path: 'path.to.nested', + }, + aggs: { + suggestions: { + filter: { + term: { + testField: { + value: 'searchForMe', + case_insensitive: true, + }, + }, + }, + aggs: { + filteredSuggestions: { + terms: { + field: 'testField', + shard_size: 10, + }, + }, + }, + }, + }, + }, + }); + }); + + test('number field', () => { + const optionsListRequestBodyMock: OptionsListRequestBody = { + size: 10, + fieldName: 'bytes', + allowExpensiveQueries: true, + searchString: '123', + fieldSpec: { type: 'number' } as unknown as FieldSpec, + }; + const aggregationBuilder = getExactMatchAggregationBuilder(); + const aggregation = aggregationBuilder.buildAggregation(optionsListRequestBodyMock); + expect(aggregation).toMatchObject({ + suggestions: { + filter: { + term: { + bytes: { + value: '123', + case_insensitive: false, // this is the only part that is dependent on field type + }, + }, + }, + aggs: { + filteredSuggestions: { + terms: { + field: 'bytes', + shard_size: 10, + }, + }, + }, + }, + }); + }); + }); + + test('suggestion parsing', () => { + const optionsListRequestBodyMock: OptionsListRequestBody = { + size: 10, + searchString: 'cool', + allowExpensiveQueries: true, + fieldName: 'coolTestField.keyword', + fieldSpec: { type: 'string' } as unknown as FieldSpec, + }; + const aggregationBuilder = getExactMatchAggregationBuilder(); + + const searchResponseMock = { + hits: { + total: 1, + max_score: 1, + hits: [], + }, + took: 10, + timed_out: false, + _shards: { + failed: 0, + successful: 1, + total: 1, + skipped: 0, + }, + aggregations: { + suggestions: { + filteredSuggestions: { + buckets: [{ doc_count: 5, key: 'cool1' }], + }, + }, + }, + }; + expect(aggregationBuilder.parse(searchResponseMock, optionsListRequestBodyMock)).toMatchObject({ + suggestions: [{ docCount: 5, value: 'cool1' }], + totalCardinality: 1, + }); + }); +}); diff --git a/src/plugins/controls/server/options_list/suggestion_queries/options_list_exact_match.ts b/src/plugins/controls/server/options_list/suggestion_queries/options_list_exact_match.ts new file mode 100644 index 0000000000000..e9da0c029418f --- /dev/null +++ b/src/plugins/controls/server/options_list/suggestion_queries/options_list_exact_match.ts @@ -0,0 +1,91 @@ +/* + * 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 { getFieldSubtypeNested } from '@kbn/data-views-plugin/common'; +import { get } from 'lodash'; + +import { isValidSearch } from '../../../common/options_list/is_valid_search'; +import { OptionsListRequestBody, OptionsListSuggestions } from '../../../common/options_list/types'; +import { EsBucket, OptionsListSuggestionAggregationBuilder } from '../types'; + +/** + * Search for an exact match based on the provided search string. + * This query will be more-or-less the same for **all** field types, and it should only ever return + * 0 (if no match) or 1 (if a match was found) results. + */ +export const getExactMatchAggregationBuilder: () => OptionsListSuggestionAggregationBuilder = () => + exactMatchAggregationBuilder; + +const exactMatchAggregationBuilder: OptionsListSuggestionAggregationBuilder = { + buildAggregation: ({ fieldName, fieldSpec, searchString }: OptionsListRequestBody) => { + if (!isValidSearch({ searchString, fieldType: fieldSpec?.type, searchTechnique: 'exact' })) { + return {}; + } + + const suggestionsAgg = { + suggestions: { + filter: { + term: { + [fieldName]: { + value: searchString, + case_insensitive: fieldSpec?.type === 'string', + }, + }, + }, + aggs: { + filteredSuggestions: { + terms: { + field: fieldName, + shard_size: 10, + }, + }, + }, + }, + }; + + const subTypeNested = fieldSpec && getFieldSubtypeNested(fieldSpec); + if (subTypeNested) { + return { + nestedSuggestions: { + nested: { + path: subTypeNested.nested.path, + }, + aggs: { + ...suggestionsAgg, + }, + }, + }; + } + + return suggestionsAgg; + }, + parse: (rawEsResult, { searchString, fieldSpec }) => { + if (!isValidSearch({ searchString, fieldType: fieldSpec?.type, searchTechnique: 'exact' })) { + // if this is happens, that means there is an invalid search that snuck through to the server side code; + // so, might as well early return with no suggestions + return { suggestions: [], totalCardinality: 0 }; + } + + const subTypeNested = fieldSpec && getFieldSubtypeNested(fieldSpec); + + const suggestions = get( + rawEsResult, + `aggregations.${ + subTypeNested ? 'nestedSuggestions.suggestions' : 'suggestions' + }.filteredSuggestions.buckets` + )?.reduce((acc: OptionsListSuggestions, suggestion: EsBucket) => { + acc.push({ value: suggestion.key, docCount: suggestion.doc_count }); + return acc; + }, []); + + return { + suggestions, + totalCardinality: suggestions.length, // should only be 0 or 1, so it's safe to use length here + }; + }, +}; diff --git a/src/plugins/controls/server/options_list/options_list_expensive_suggestion_queries.test.ts b/src/plugins/controls/server/options_list/suggestion_queries/options_list_search_suggestions.test.ts similarity index 66% rename from src/plugins/controls/server/options_list/options_list_expensive_suggestion_queries.test.ts rename to src/plugins/controls/server/options_list/suggestion_queries/options_list_search_suggestions.test.ts index a5d6f32f63377..b2ddb699ebaad 100644 --- a/src/plugins/controls/server/options_list/options_list_expensive_suggestion_queries.test.ts +++ b/src/plugins/controls/server/options_list/suggestion_queries/options_list_search_suggestions.test.ts @@ -6,13 +6,18 @@ * Side Public License, v 1. */ -import { FieldSpec } from '@kbn/data-views-plugin/common'; import { SearchResponse } from '@elastic/elasticsearch/lib/api/types'; +import { FieldSpec } from '@kbn/data-views-plugin/common'; + +import { OptionsListRequestBody } from '../../../common/options_list/types'; +import { getExactMatchAggregationBuilder } from './options_list_exact_match'; +import { getSearchSuggestionsAggregationBuilder } from './options_list_search_suggestions'; -import { getExpensiveSuggestionAggregationBuilder } from './options_list_expensive_suggestion_queries'; -import { OptionsListRequestBody } from '../../common/options_list/types'; +jest.mock('./options_list_exact_match', () => ({ + getExactMatchAggregationBuilder: jest.fn(), +})); -describe('options list expensive queries', () => { +describe('options list type-specific search queries', () => { let rawSearchResponseMock: SearchResponse = {} as SearchResponse; beforeEach(() => { @@ -35,40 +40,19 @@ describe('options list expensive queries', () => { }); describe('suggestion aggregation', () => { - describe('string (keyword, text+keyword, or nested) field', () => { - test('test keyword field, without a search string', () => { - const optionsListRequestBodyMock: OptionsListRequestBody = { - size: 10, - allowExpensiveQueries: true, - fieldName: 'coolTestField.keyword', - sort: { by: '_key', direction: 'asc' }, - fieldSpec: { aggregatable: true } as unknown as FieldSpec, - }; - const suggestionAggBuilder = getExpensiveSuggestionAggregationBuilder( - optionsListRequestBodyMock - ); - expect(suggestionAggBuilder.buildAggregation(optionsListRequestBodyMock)) - .toMatchInlineSnapshot(` - Object { - "suggestions": Object { - "terms": Object { - "field": "coolTestField.keyword", - "order": Object { - "_key": "asc", - }, - "shard_size": 10, - "size": 10, - }, - }, - "unique_terms": Object { - "cardinality": Object { - "field": "coolTestField.keyword", - }, - }, - } - `); - }); + test('for unsupported field types, return exact match search instead', () => { + const optionsListRequestBodyMock: OptionsListRequestBody = { + size: 10, + fieldName: 'success', + allowExpensiveQueries: true, + sort: { by: '_key', direction: 'desc' }, + fieldSpec: { type: 'boolean' } as unknown as FieldSpec, + }; + getSearchSuggestionsAggregationBuilder(optionsListRequestBodyMock); + expect(getExactMatchAggregationBuilder).toBeCalled(); + }); + describe('string (keyword, text+keyword, or nested) field', () => { test('test keyword field, with a search string', () => { const optionsListRequestBodyMock: OptionsListRequestBody = { size: 10, @@ -76,9 +60,9 @@ describe('options list expensive queries', () => { allowExpensiveQueries: true, fieldName: 'coolTestField.keyword', sort: { by: '_key', direction: 'desc' }, - fieldSpec: { aggregatable: true } as unknown as FieldSpec, + fieldSpec: { type: 'string' } as unknown as FieldSpec, }; - const suggestionAggBuilder = getExpensiveSuggestionAggregationBuilder( + const suggestionAggBuilder = getSearchSuggestionsAggregationBuilder( optionsListRequestBodyMock ); expect(suggestionAggBuilder.buildAggregation(optionsListRequestBodyMock)) @@ -123,9 +107,9 @@ describe('options list expensive queries', () => { allowExpensiveQueries: true, fieldName: 'coolTestField.keyword', sort: { by: '_key', direction: 'desc' }, - fieldSpec: { aggregatable: true } as unknown as FieldSpec, + fieldSpec: { type: 'string' } as unknown as FieldSpec, }; - const suggestionAggBuilder = getExpensiveSuggestionAggregationBuilder( + const suggestionAggBuilder = getSearchSuggestionsAggregationBuilder( optionsListRequestBodyMock ); expect(suggestionAggBuilder.buildAggregation(optionsListRequestBodyMock)) @@ -170,9 +154,9 @@ describe('options list expensive queries', () => { allowExpensiveQueries: true, fieldName: 'coolTestField.keyword', sort: { by: '_key', direction: 'desc' }, - fieldSpec: { aggregatable: true } as unknown as FieldSpec, + fieldSpec: { type: 'string' } as unknown as FieldSpec, }; - const suggestionAggBuilder = getExpensiveSuggestionAggregationBuilder( + const suggestionAggBuilder = getSearchSuggestionsAggregationBuilder( optionsListRequestBodyMock ); expect(suggestionAggBuilder.buildAggregation(optionsListRequestBodyMock)) @@ -216,9 +200,12 @@ describe('options list expensive queries', () => { allowExpensiveQueries: true, fieldName: 'coolNestedField', sort: { by: '_count', direction: 'asc' }, - fieldSpec: { subType: { nested: { path: 'path.to.nested' } } } as unknown as FieldSpec, + fieldSpec: { + type: 'string', + subType: { nested: { path: 'path.to.nested' } }, + } as unknown as FieldSpec, }; - const suggestionAggBuilder = getExpensiveSuggestionAggregationBuilder( + const suggestionAggBuilder = getSearchSuggestionsAggregationBuilder( optionsListRequestBodyMock ); expect(suggestionAggBuilder.buildAggregation(optionsListRequestBodyMock)) @@ -263,151 +250,20 @@ describe('options list expensive queries', () => { }); }); - describe('boolean field', () => { - test('creates boolean aggregation for boolean field', () => { - const optionsListRequestBodyMock: OptionsListRequestBody = { - size: 10, - fieldName: 'coolean', - allowExpensiveQueries: true, - sort: { by: '_key', direction: 'desc' }, - fieldSpec: { type: 'boolean' } as unknown as FieldSpec, - }; - const suggestionAggBuilder = getExpensiveSuggestionAggregationBuilder( - optionsListRequestBodyMock - ); - expect(suggestionAggBuilder.buildAggregation(optionsListRequestBodyMock)) - .toMatchInlineSnapshot(` - Object { - "suggestions": Object { - "terms": Object { - "field": "coolean", - "order": Object { - "_key": "desc", - }, - "shard_size": 10, - }, - }, - } - `); - }); - }); - - describe('date field field', () => { - test('creates date aggregation for date field', () => { - const optionsListRequestBodyMock: OptionsListRequestBody = { - size: 10, - fieldName: '@timestamp', - allowExpensiveQueries: true, - sort: { by: '_key', direction: 'desc' }, - fieldSpec: { type: 'date' } as unknown as FieldSpec, - }; - const suggestionAggBuilder = getExpensiveSuggestionAggregationBuilder( - optionsListRequestBodyMock - ); - expect(suggestionAggBuilder.buildAggregation(optionsListRequestBodyMock)) - .toMatchInlineSnapshot(` - Object { - "suggestions": Object { - "terms": Object { - "field": "@timestamp", - "order": Object { - "_key": "desc", - }, - "shard_size": 10, - "size": 10, - }, - }, - "unique_terms": Object { - "cardinality": Object { - "field": "@timestamp", - }, - }, - } - `); - }); - - test('does not throw error when receiving search string', () => { - const optionsListRequestBodyMock: OptionsListRequestBody = { - size: 10, - fieldName: '@timestamp', - allowExpensiveQueries: true, - sort: { by: '_key', direction: 'desc' }, - searchString: '2023', - fieldSpec: { type: 'date' } as unknown as FieldSpec, - }; - const suggestionAggBuilder = getExpensiveSuggestionAggregationBuilder( - optionsListRequestBodyMock - ); - expect(suggestionAggBuilder.buildAggregation(optionsListRequestBodyMock)) - .toMatchInlineSnapshot(` - Object { - "suggestions": Object { - "terms": Object { - "field": "@timestamp", - "order": Object { - "_key": "desc", - }, - "shard_size": 10, - "size": 10, - }, - }, - "unique_terms": Object { - "cardinality": Object { - "field": "@timestamp", - }, - }, - } - `); - }); - }); - describe('IP field', () => { - test('without a search string, creates IP range aggregation with default range', () => { + test('handles an invalid search', () => { const optionsListRequestBodyMock: OptionsListRequestBody = { size: 10, fieldName: 'clientip', allowExpensiveQueries: true, sort: { by: '_key', direction: 'asc' }, + searchString: '1.a.2.b.3.z', fieldSpec: { type: 'ip' } as unknown as FieldSpec, }; - const suggestionAggBuilder = getExpensiveSuggestionAggregationBuilder( + const suggestionAggBuilder = getSearchSuggestionsAggregationBuilder( optionsListRequestBodyMock ); - expect(suggestionAggBuilder.buildAggregation(optionsListRequestBodyMock)) - .toMatchInlineSnapshot(` - Object { - "suggestions": Object { - "aggs": Object { - "filteredSuggestions": Object { - "terms": Object { - "field": "clientip", - "order": Object { - "_key": "asc", - }, - "shard_size": 10, - "size": 10, - }, - }, - "unique_terms": Object { - "cardinality": Object { - "field": "clientip", - }, - }, - }, - "ip_range": Object { - "field": "clientip", - "keyed": true, - "ranges": Array [ - Object { - "from": "::", - "key": "ipv6", - "to": "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", - }, - ], - }, - }, - } - `); + expect(suggestionAggBuilder.buildAggregation(optionsListRequestBodyMock)).toEqual({}); }); test('full IPv4 in the search string, creates IP range aggregation with CIDR mask', () => { @@ -419,7 +275,7 @@ describe('options list expensive queries', () => { sort: { by: '_count', direction: 'asc' }, fieldSpec: { type: 'ip' } as unknown as FieldSpec, }; - const suggestionAggBuilder = getExpensiveSuggestionAggregationBuilder( + const suggestionAggBuilder = getSearchSuggestionsAggregationBuilder( optionsListRequestBodyMock ); expect(suggestionAggBuilder.buildAggregation(optionsListRequestBodyMock)) @@ -467,7 +323,7 @@ describe('options list expensive queries', () => { fieldSpec: { type: 'ip' } as unknown as FieldSpec, searchString: 'f688:fb50:6433:bba2:604:f2c:194a:d3c5', }; - const suggestionAggBuilder = getExpensiveSuggestionAggregationBuilder( + const suggestionAggBuilder = getSearchSuggestionsAggregationBuilder( optionsListRequestBodyMock ); expect(suggestionAggBuilder.buildAggregation(optionsListRequestBodyMock)) @@ -514,7 +370,7 @@ describe('options list expensive queries', () => { allowExpensiveQueries: true, fieldSpec: { type: 'ip' } as unknown as FieldSpec, }; - const suggestionAggBuilder = getExpensiveSuggestionAggregationBuilder( + const suggestionAggBuilder = getSearchSuggestionsAggregationBuilder( optionsListRequestBodyMock ); expect(suggestionAggBuilder.buildAggregation(optionsListRequestBodyMock)) @@ -563,7 +419,7 @@ describe('options list expensive queries', () => { sort: { by: '_count', direction: 'desc' }, fieldSpec: { type: 'ip' } as unknown as FieldSpec, }; - const suggestionAggBuilder = getExpensiveSuggestionAggregationBuilder( + const suggestionAggBuilder = getSearchSuggestionsAggregationBuilder( optionsListRequestBodyMock ); expect(suggestionAggBuilder.buildAggregation(optionsListRequestBodyMock)) @@ -606,26 +462,29 @@ describe('options list expensive queries', () => { }); describe('suggestion parsing', () => { - test('parses string (keyword, text+keyword, or nested) result', () => { + test('parses string (keyword, text+keyword) result', () => { const optionsListRequestBodyMock: OptionsListRequestBody = { size: 10, + searchString: 'cool', allowExpensiveQueries: true, fieldName: 'coolTestField.keyword', - fieldSpec: { aggregatable: true } as unknown as FieldSpec, + fieldSpec: { type: 'string' } as unknown as FieldSpec, }; - const suggestionAggBuilder = getExpensiveSuggestionAggregationBuilder( + const suggestionAggBuilder = getSearchSuggestionsAggregationBuilder( optionsListRequestBodyMock ); rawSearchResponseMock.aggregations = { - suggestions: { - buckets: [ - { doc_count: 5, key: 'cool1' }, - { doc_count: 15, key: 'cool2' }, - { doc_count: 10, key: 'cool3' }, - ], - }, - unique_terms: { - value: 3, + filteredSuggestions: { + suggestions: { + buckets: [ + { doc_count: 5, key: 'cool1' }, + { doc_count: 15, key: 'cool2' }, + { doc_count: 10, key: 'cool3' }, + ], + }, + unique_terms: { + value: 3, + }, }, }; expect(suggestionAggBuilder.parse(rawSearchResponseMock, optionsListRequestBodyMock)) @@ -650,51 +509,18 @@ describe('options list expensive queries', () => { `); }); - test('parses boolean result', () => { - const optionsListRequestBodyMock: OptionsListRequestBody = { - size: 10, - fieldName: 'coolean', - allowExpensiveQueries: true, - fieldSpec: { type: 'boolean' } as unknown as FieldSpec, - }; - const suggestionAggBuilder = getExpensiveSuggestionAggregationBuilder( - optionsListRequestBodyMock - ); - rawSearchResponseMock.aggregations = { - suggestions: { - buckets: [ - { doc_count: 55, key_as_string: 'false' }, - { doc_count: 155, key_as_string: 'true' }, - ], - }, - }; - expect(suggestionAggBuilder.parse(rawSearchResponseMock, optionsListRequestBodyMock)) - .toMatchInlineSnapshot(` - Object { - "suggestions": Array [ - Object { - "docCount": 55, - "value": "false", - }, - Object { - "docCount": 155, - "value": "true", - }, - ], - "totalCardinality": 2, - } - `); - }); - - test('parses nested result', () => { + test('parses string nested result', () => { const optionsListRequestBodyMock: OptionsListRequestBody = { size: 10, searchString: 'co', fieldName: 'coolNestedField', allowExpensiveQueries: true, - fieldSpec: { subType: { nested: { path: 'path.to.nested' } } } as unknown as FieldSpec, + fieldSpec: { + type: 'string', + subType: { type: 'string', nested: { path: 'path.to.nested' } }, + } as unknown as FieldSpec, }; - const suggestionAggBuilder = getExpensiveSuggestionAggregationBuilder( + const suggestionAggBuilder = getSearchSuggestionsAggregationBuilder( optionsListRequestBodyMock ); rawSearchResponseMock.aggregations = { @@ -738,11 +564,12 @@ describe('options list expensive queries', () => { test('parses mixed IPv4 and IPv6 result', () => { const optionsListRequestBodyMock: OptionsListRequestBody = { size: 10, + searchString: '21', fieldName: 'clientip', allowExpensiveQueries: true, fieldSpec: { type: 'ip' } as unknown as FieldSpec, }; - const suggestionAggBuilder = getExpensiveSuggestionAggregationBuilder( + const suggestionAggBuilder = getSearchSuggestionsAggregationBuilder( optionsListRequestBodyMock ); rawSearchResponseMock.aggregations = { @@ -840,53 +667,5 @@ describe('options list expensive queries', () => { ] `); }); - - test('parses date result', () => { - const optionsListRequestBodyMock: OptionsListRequestBody = { - size: 10, - fieldName: '@timestamp', - allowExpensiveQueries: true, - fieldSpec: { type: 'date' } as unknown as FieldSpec, - }; - const suggestionAggBuilder = getExpensiveSuggestionAggregationBuilder( - optionsListRequestBodyMock - ); - rawSearchResponseMock.aggregations = { - suggestions: { - buckets: [ - { doc_count: 20, key: 1696824675 }, - { doc_count: 13, key: 1686086625 }, - { doc_count: 4, key: 1703684229 }, - { doc_count: 34, key: 1688603684 }, - ], - }, - }; - - const parsed = suggestionAggBuilder.parse( - rawSearchResponseMock, - optionsListRequestBodyMock - ).suggestions; - - expect(parsed).toMatchInlineSnapshot(` - Array [ - Object { - "docCount": 20, - "value": 1696824675, - }, - Object { - "docCount": 13, - "value": 1686086625, - }, - Object { - "docCount": 4, - "value": 1703684229, - }, - Object { - "docCount": 34, - "value": 1688603684, - }, - ] - `); - }); }); }); diff --git a/src/plugins/controls/server/options_list/options_list_expensive_suggestion_queries.ts b/src/plugins/controls/server/options_list/suggestion_queries/options_list_search_suggestions.ts similarity index 57% rename from src/plugins/controls/server/options_list/options_list_expensive_suggestion_queries.ts rename to src/plugins/controls/server/options_list/suggestion_queries/options_list_search_suggestions.ts index 156a966f6a482..47f1fe5f696dc 100644 --- a/src/plugins/controls/server/options_list/options_list_expensive_suggestion_queries.ts +++ b/src/plugins/controls/server/options_list/suggestion_queries/options_list_search_suggestions.ts @@ -6,16 +6,15 @@ * Side Public License, v 1. */ -import { get } from 'lodash'; import { getFieldSubtypeNested } from '@kbn/data-views-plugin/common'; +import { get } from 'lodash'; -import { - OptionsListRequestBody, - OptionsListSuggestions, - OPTIONS_LIST_DEFAULT_SEARCH_TECHNIQUE, -} from '../../common/options_list/types'; -import { getIpRangeQuery, type IpRangeQuery } from '../../common/options_list/ip_search'; -import { EsBucket, OptionsListSuggestionAggregationBuilder } from './types'; +import { getIpRangeQuery } from '../../../common/options_list/ip_search'; +import { isValidSearch } from '../../../common/options_list/is_valid_search'; +import { getDefaultSearchTechnique } from '../../../common/options_list/suggestions_searching'; +import { OptionsListRequestBody, OptionsListSuggestions } from '../../../common/options_list/types'; +import { EsBucket, OptionsListSuggestionAggregationBuilder } from '../types'; +import { getExactMatchAggregationBuilder } from './options_list_exact_match'; import { getEscapedWildcardQuery, getIpBuckets, @@ -23,19 +22,28 @@ import { } from './options_list_suggestion_query_helpers'; /** - * Suggestion aggregations + * Type-specific search suggestion aggregations. These queries are highly impacted by the field type. */ -export const getExpensiveSuggestionAggregationBuilder = ({ fieldSpec }: OptionsListRequestBody) => { - if (fieldSpec?.type === 'boolean') { - return expensiveSuggestionAggSubtypes.boolean; - } - if (fieldSpec?.type === 'ip') { - return expensiveSuggestionAggSubtypes.ip; +export const getSearchSuggestionsAggregationBuilder = (request: OptionsListRequestBody) => { + const { fieldSpec } = request; + + // note that date and boolean fields are non-searchable, so type-specific search aggs are not necessary; + // number fields, on the other hand, only support exact match searching - so, this also does not need a + // type-specific agg because it will be handled by `exactMatchSearchAggregation` + switch (fieldSpec?.type) { + case 'ip': { + return suggestionAggSubtypes.ip; + } + case 'string': { + return suggestionAggSubtypes.textOrKeywordOrNested; + } + default: + // safe guard just in case an invalid/unsupported field type somehow got through + return getExactMatchAggregationBuilder(); } - return expensiveSuggestionAggSubtypes.textOrKeywordOrNested; }; -const expensiveSuggestionAggSubtypes: { [key: string]: OptionsListSuggestionAggregationBuilder } = { +const suggestionAggSubtypes: { [key: string]: OptionsListSuggestionAggregationBuilder } = { /** * The "textOrKeywordOrNested" query / parser should be used whenever the field is built on some type of string field, * regardless of if it is keyword only, keyword+text, or some nested keyword/keyword+text field. @@ -49,28 +57,19 @@ const expensiveSuggestionAggSubtypes: { [key: string]: OptionsListSuggestionAggr sort, size, }: OptionsListRequestBody) => { + const hasSearchString = searchString && searchString.length > 0; + if (!hasSearchString || fieldSpec?.type === 'date') { + // we can assume that this is only ever called with a search string, and date fields are not + // currently searchable; so, if any of these things is true, this is invalid. + return undefined; + } + const subTypeNested = fieldSpec && getFieldSubtypeNested(fieldSpec); let textOrKeywordQuery: any = { - suggestions: { - terms: { - size, - field: fieldName, - shard_size: 10, - order: getSortType(sort), - }, - }, - unique_terms: { - cardinality: { - field: fieldName, - }, - }, - }; - // disabling for date fields because applying a search string will return an error - if (fieldSpec?.type !== 'date' && searchString && searchString.length > 0) { - textOrKeywordQuery = { - filteredSuggestions: { - filter: { - [(searchTechnique ?? OPTIONS_LIST_DEFAULT_SEARCH_TECHNIQUE) as string]: { + filteredSuggestions: { + filter: { + [(searchTechnique ?? getDefaultSearchTechnique(fieldSpec?.type ?? 'string')) as string]: + { [fieldName]: { value: searchTechnique === 'wildcard' @@ -79,11 +78,25 @@ const expensiveSuggestionAggSubtypes: { [key: string]: OptionsListSuggestionAggr case_insensitive: true, }, }, + }, + aggs: { + suggestions: { + terms: { + size, + field: fieldName, + shard_size: 10, + order: getSortType(sort), + }, + }, + unique_terms: { + cardinality: { + field: fieldName, + }, }, - aggs: { ...textOrKeywordQuery }, }, - }; - } + }, + }; + if (subTypeNested) { textOrKeywordQuery = { nestedSuggestions: { @@ -98,11 +111,10 @@ const expensiveSuggestionAggSubtypes: { [key: string]: OptionsListSuggestionAggr } return textOrKeywordQuery; }, - parse: (rawEsResult, request) => { + parse: (rawEsResult, { fieldSpec }) => { let basePath = 'aggregations'; - const isNested = request.fieldSpec && getFieldSubtypeNested(request.fieldSpec); - basePath += isNested ? '.nestedSuggestions' : ''; - basePath += request.searchString ? '.filteredSuggestions' : ''; + const isNested = fieldSpec && getFieldSubtypeNested(fieldSpec); + basePath += isNested ? '.nestedSuggestions.filteredSuggestions' : '.filteredSuggestions'; const suggestions = get(rawEsResult, `${basePath}.suggestions.buckets`)?.reduce( (acc: OptionsListSuggestions, suggestion: EsBucket) => { @@ -119,55 +131,23 @@ const expensiveSuggestionAggSubtypes: { [key: string]: OptionsListSuggestionAggr }, /** - * the "Boolean" query / parser should be used when the options list is built on a field of type boolean. The query is slightly different than a keyword query. + * the "IP" query / parser should be used when the options list is built on a field of type IP. */ - boolean: { - buildAggregation: ({ fieldName, sort }: OptionsListRequestBody) => ({ - suggestions: { + ip: { + buildAggregation: ({ fieldName, searchString, sort, size }: OptionsListRequestBody) => { + const filteredSuggestions = { terms: { + size, field: fieldName, shard_size: 10, order: getSortType(sort), }, - }, - }), - parse: (rawEsResult) => { - const suggestions = get(rawEsResult, 'aggregations.suggestions.buckets')?.reduce( - (acc: OptionsListSuggestions, suggestion: EsBucket & { key_as_string: string }) => { - acc.push({ value: suggestion.key_as_string, docCount: suggestion.doc_count }); - return acc; - }, - [] - ); - return { suggestions, totalCardinality: suggestions.length }; // cardinality is only ever 0, 1, or 2 so safe to use length here - }, - }, - - /** - * the "IP" query / parser should be used when the options list is built on a field of type IP. - */ - ip: { - buildAggregation: ({ fieldName, searchString, sort, size }: OptionsListRequestBody) => { - let ipRangeQuery: IpRangeQuery = { - validSearch: true, - rangeQuery: [ - { - key: 'ipv6', - from: '::', - to: 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff', - }, - ], }; - if (searchString && searchString.length > 0) { - ipRangeQuery = getIpRangeQuery(searchString); - if (!ipRangeQuery.validSearch) { - // ideally should be prevented on the client side but, if somehow an invalid search gets through to the server, - // simply don't return an aggregation query for the ES search request - return undefined; - } + const ipRangeQuery = getIpRangeQuery(searchString ?? ''); + if (!ipRangeQuery.validSearch) { + return {}; } - return { suggestions: { ip_range: { @@ -176,14 +156,7 @@ const expensiveSuggestionAggSubtypes: { [key: string]: OptionsListSuggestionAggr keyed: true, }, aggs: { - filteredSuggestions: { - terms: { - size, - field: fieldName, - shard_size: 10, - order: getSortType(sort), - }, - }, + filteredSuggestions, unique_terms: { cardinality: { field: fieldName, @@ -193,18 +166,22 @@ const expensiveSuggestionAggSubtypes: { [key: string]: OptionsListSuggestionAggr }, }; }, - parse: (rawEsResult, request) => { - if (!Boolean(rawEsResult.aggregations?.suggestions)) { + parse: (rawEsResult, { searchString, sort, fieldSpec, size, searchTechnique }) => { + if ( + !searchString || + !isValidSearch({ searchString, fieldType: fieldSpec?.type, searchTechnique }) + ) { // if this is happens, that means there is an invalid search that snuck through to the server side code; // so, might as well early return with no suggestions return { suggestions: [], totalCardinality: 0 }; } + const buckets: EsBucket[] = []; getIpBuckets(rawEsResult, buckets, 'ipv4'); // modifies buckets array directly, i.e. "by reference" getIpBuckets(rawEsResult, buckets, 'ipv6'); const sortedSuggestions = - request.sort?.direction === 'asc' + sort?.direction === 'asc' ? buckets.sort( (bucketA: EsBucket, bucketB: EsBucket) => bucketA.doc_count - bucketB.doc_count ) @@ -213,7 +190,7 @@ const expensiveSuggestionAggSubtypes: { [key: string]: OptionsListSuggestionAggr ); const suggestions = sortedSuggestions - .slice(0, request.size) + .slice(0, size) .reduce((acc: OptionsListSuggestions, suggestion: EsBucket) => { acc.push({ value: suggestion.key, docCount: suggestion.doc_count }); return acc; diff --git a/src/plugins/controls/server/options_list/suggestion_queries/options_list_suggestion_queries.test.ts b/src/plugins/controls/server/options_list/suggestion_queries/options_list_suggestion_queries.test.ts new file mode 100644 index 0000000000000..46f0af574f775 --- /dev/null +++ b/src/plugins/controls/server/options_list/suggestion_queries/options_list_suggestion_queries.test.ts @@ -0,0 +1,94 @@ +/* + * 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 { FieldSpec } from '@kbn/data-views-plugin/common'; +import { OptionsListRequestBody } from '../../../common/options_list/types'; +import { getAllSuggestionsAggregationBuilder } from './options_list_all_suggestions'; +import { getExactMatchAggregationBuilder } from './options_list_exact_match'; +import { getSearchSuggestionsAggregationBuilder } from './options_list_search_suggestions'; +import { getSuggestionAggregationBuilder } from './options_list_suggestion_queries'; + +jest.mock('./options_list_all_suggestions', () => ({ + getAllSuggestionsAggregationBuilder: jest.fn(), +})); + +jest.mock('./options_list_exact_match', () => ({ + getExactMatchAggregationBuilder: jest.fn(), +})); + +jest.mock('./options_list_search_suggestions', () => ({ + getSearchSuggestionsAggregationBuilder: jest.fn(), +})); + +describe('options list suggestion queries', () => { + beforeEach(() => { + jest.resetAllMocks(); + }); + + test('returns generic fetch all aggregation when no search string is provided', () => { + const optionsListRequestBodyMock: OptionsListRequestBody = { + size: 10, + fieldName: '@timestamp', + allowExpensiveQueries: true, + sort: { by: '_key', direction: 'desc' }, + fieldSpec: { type: 'date' } as unknown as FieldSpec, + }; + getSuggestionAggregationBuilder(optionsListRequestBodyMock); + expect(getAllSuggestionsAggregationBuilder).toBeCalled(); + expect(getExactMatchAggregationBuilder).not.toBeCalled(); + expect(getSearchSuggestionsAggregationBuilder).not.toBeCalled(); + }); + + test('returns generic exact match search query when search technique is `exact`', () => { + const optionsListRequestBodyMock: OptionsListRequestBody = { + size: 10, + fieldName: 'bytes', + allowExpensiveQueries: true, + searchTechnique: 'exact', + searchString: 'searchForMe', + sort: { by: '_key', direction: 'asc' }, + fieldSpec: { type: 'number' } as unknown as FieldSpec, + }; + getSuggestionAggregationBuilder(optionsListRequestBodyMock); + expect(getAllSuggestionsAggregationBuilder).not.toBeCalled(); + expect(getExactMatchAggregationBuilder).toBeCalled(); + expect(getSearchSuggestionsAggregationBuilder).not.toBeCalled(); + }); + + test('returns generic exact match search query when allowExpensiveQueries is `false`', () => { + const optionsListRequestBodyMock: OptionsListRequestBody = { + size: 10, + fieldName: 'bytes', + allowExpensiveQueries: false, + searchTechnique: 'prefix', + searchString: 'searchForMe', + sort: { by: '_key', direction: 'asc' }, + fieldSpec: { type: 'number' } as unknown as FieldSpec, + }; + getSuggestionAggregationBuilder(optionsListRequestBodyMock); + expect(getAllSuggestionsAggregationBuilder).not.toBeCalled(); + expect(getExactMatchAggregationBuilder).toBeCalled(); + expect(getSearchSuggestionsAggregationBuilder).not.toBeCalled(); + }); + + test('returns type-specific search query only when absolutely necessary', () => { + const optionsListRequestBodyMock: OptionsListRequestBody = { + size: 10, + fieldName: 'bytes', + allowExpensiveQueries: true, + searchTechnique: 'prefix', + searchString: 'searchForMe', + sort: { by: '_key', direction: 'asc' }, + fieldSpec: { type: 'keyword' } as unknown as FieldSpec, + }; + getSuggestionAggregationBuilder(optionsListRequestBodyMock); + expect(getAllSuggestionsAggregationBuilder).not.toBeCalled(); + expect(getExactMatchAggregationBuilder).not.toBeCalled(); + expect(getSearchSuggestionsAggregationBuilder).toBeCalled(); + }); +}); diff --git a/src/plugins/controls/server/options_list/suggestion_queries/options_list_suggestion_queries.ts b/src/plugins/controls/server/options_list/suggestion_queries/options_list_suggestion_queries.ts new file mode 100644 index 0000000000000..56e7820c8260e --- /dev/null +++ b/src/plugins/controls/server/options_list/suggestion_queries/options_list_suggestion_queries.ts @@ -0,0 +1,32 @@ +/* + * 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 { OptionsListRequestBody } from '../../../common/options_list/types'; +import { getAllSuggestionsAggregationBuilder } from './options_list_all_suggestions'; +import { getExactMatchAggregationBuilder } from './options_list_exact_match'; +import { getSearchSuggestionsAggregationBuilder } from './options_list_search_suggestions'; + +/** + * Suggestion aggregations + */ +export const getSuggestionAggregationBuilder = (request: OptionsListRequestBody) => { + const { searchString, searchTechnique, allowExpensiveQueries } = request; + const hasSearchString = searchString && searchString.length > 0; + if (!hasSearchString) { + // the field type only matters when there is a search string; so, if no search string, + // return generic "fetch all" aggregation builder + return getAllSuggestionsAggregationBuilder(); + } else if (!allowExpensiveQueries || searchTechnique === 'exact') { + // if `allowExpensiveQueries` is false, only support exact match searching; also, field type + // once again does not matter when building an exact match aggregation + return getExactMatchAggregationBuilder(); + } else { + // at this point, the type of the field matters - so, fetch the type-specific search agg + return getSearchSuggestionsAggregationBuilder(request); + } +}; diff --git a/src/plugins/controls/server/options_list/options_list_suggestion_query_helpers.ts b/src/plugins/controls/server/options_list/suggestion_queries/options_list_suggestion_query_helpers.ts similarity index 92% rename from src/plugins/controls/server/options_list/options_list_suggestion_query_helpers.ts rename to src/plugins/controls/server/options_list/suggestion_queries/options_list_suggestion_query_helpers.ts index 437450cc8ecf1..5986420f21f91 100644 --- a/src/plugins/controls/server/options_list/options_list_suggestion_query_helpers.ts +++ b/src/plugins/controls/server/options_list/suggestion_queries/options_list_suggestion_query_helpers.ts @@ -8,11 +8,11 @@ import { get } from 'lodash'; -import { EsBucket } from './types'; import { - OPTIONS_LIST_DEFAULT_SORT, OptionsListSortingType, -} from '../../common/options_list/suggestions_sorting'; + OPTIONS_LIST_DEFAULT_SORT, +} from '../../../common/options_list/suggestions_sorting'; +import { EsBucket } from '../types'; export const getSortType = (sort?: OptionsListSortingType) => { return sort diff --git a/src/plugins/data/public/utils/table_inspector_view/components/__snapshots__/data_view.test.tsx.snap b/src/plugins/data/public/utils/table_inspector_view/components/__snapshots__/data_view.test.tsx.snap index 06a402fd47567..8bd049df006fc 100644 --- a/src/plugins/data/public/utils/table_inspector_view/components/__snapshots__/data_view.test.tsx.snap +++ b/src/plugins/data/public/utils/table_inspector_view/components/__snapshots__/data_view.test.tsx.snap @@ -176,27 +176,23 @@ Array [ class="euiFlexItem emotion-euiFlexItem-growZero" >
-
- -
+ color="inherit" + data-euiicon-type="arrowDown" + /> + +
, @@ -224,30 +220,26 @@ Array [ class="euiTableSortMobile" >
-
- -
+ + +
@@ -339,31 +331,27 @@ Array [ class="euiFlexItem emotion-euiFlexItem-growZero" >
-
- -
+ + +
-
- -
+ + +
@@ -515,27 +499,23 @@ Array [ class="euiFlexItem emotion-euiFlexItem-growZero" >
-
- -
+ color="inherit" + data-euiicon-type="arrowDown" + /> + +
, @@ -563,30 +543,26 @@ Array [ class="euiTableSortMobile" >
-
- -
+ + +
@@ -679,31 +655,27 @@ Array [ class="euiFlexItem emotion-euiFlexItem-growZero" >
-
- -
+ + +
{ 'Matching sources' ); - findTestSubject(component, 'allIndices').simulate('change', { - target: { - value: true, - }, - }); + findTestSubject(component, 'allIndices').simulate('click'); await component.update(); @@ -109,11 +105,7 @@ describe('DataViewEditor PreviewPanel', () => { expect(component.find('.euiButtonGroupButton-isSelected').first().text()).toBe('All sources'); - findTestSubject(component, 'onlyMatchingIndices').simulate('change', { - target: { - value: true, - }, - }); + findTestSubject(component, 'onlyMatchingIndices').simulate('click'); await component.update(); diff --git a/src/plugins/embeddable/public/lib/embeddables/error_embeddable.scss b/src/plugins/embeddable/public/lib/embeddables/error_embeddable.scss index cc8d7f9698221..739d6930001e9 100644 --- a/src/plugins/embeddable/public/lib/embeddables/error_embeddable.scss +++ b/src/plugins/embeddable/public/lib/embeddables/error_embeddable.scss @@ -1,9 +1,6 @@ .errorEmbeddableCompact__popover { height: 100%; -} - -.errorEmbeddableCompact__popoverAnchor { max-width: 100%; } diff --git a/src/plugins/files/public/index.ts b/src/plugins/files/public/index.ts index d4970fe4f3bff..1f01fc2835fee 100644 --- a/src/plugins/files/public/index.ts +++ b/src/plugins/files/public/index.ts @@ -7,7 +7,9 @@ */ import { FilesPlugin } from './plugin'; -export type { FilesSetup, FilesStart } from './plugin'; + +export type { FilesPublicSetup as FilesSetup, FilesPublicStart as FilesStart } from './plugin'; + export type { FilesClient, ScopedFilesClient, diff --git a/src/plugins/files/public/mocks.ts b/src/plugins/files/public/mocks.ts index 447f8c2b85d54..c60c3e5803803 100644 --- a/src/plugins/files/public/mocks.ts +++ b/src/plugins/files/public/mocks.ts @@ -8,7 +8,7 @@ import { createMockFilesClient as createBaseMocksFilesClient } from '@kbn/shared-ux-file-mocks'; import type { DeeplyMockedKeys } from '@kbn/utility-types-jest'; -import { FilesSetup } from '.'; +import { FilesPublicSetup } from './plugin'; import type { FilesClient, FilesClientFactory } from './types'; export const createMockFilesClient = (): DeeplyMockedKeys => ({ @@ -17,7 +17,7 @@ export const createMockFilesClient = (): DeeplyMockedKeys => ({ publicDownload: jest.fn(), }); -export const createMockFilesSetup = (): DeeplyMockedKeys => { +export const createMockFilesSetup = (): DeeplyMockedKeys => { return { filesClientFactory: createMockFilesClientFactory(), registerFileKind: jest.fn(), diff --git a/src/plugins/files/public/plugin.ts b/src/plugins/files/public/plugin.ts index 13828d0ee366c..9234e6da8baf4 100644 --- a/src/plugins/files/public/plugin.ts +++ b/src/plugins/files/public/plugin.ts @@ -7,7 +7,12 @@ */ import type { CoreSetup, CoreStart, Plugin } from '@kbn/core/public'; -import type { FilesClient, FilesClientFactory } from './types'; +import type { + FilesClient, + FilesClientFactory, + FilesPublicSetupDependencies, + FilesPublicStartDependencies, +} from './types'; import { FileKindsRegistryImpl } from '../common/file_kinds_registry'; import { createFilesClient } from './files_client'; import { FileKindBrowser } from '../common'; @@ -17,7 +22,7 @@ import * as DefaultImageFileKind from '../common/default_image_file_kind'; /** * Public setup-phase contract */ -export interface FilesSetup { +export interface FilesPublicSetup { /** * A factory for creating an {@link FilesClient} instance. This requires a * registered {@link FileKindBrowser}. @@ -35,7 +40,7 @@ export interface FilesSetup { registerFileKind(fileKind: FileKindBrowser): void; } -export type FilesStart = Pick & { +export type FilesPublicStart = Pick & { getFileKindDefinition: (id: string) => FileKindBrowser; getAllFindKindDefinitions: () => FileKindBrowser[]; }; @@ -43,11 +48,19 @@ export type FilesStart = Pick & { /** * Bringing files to Kibana */ -export class FilesPlugin implements Plugin { +export class FilesPlugin + implements + Plugin< + FilesPublicSetup, + FilesPublicStart, + FilesPublicSetupDependencies, + FilesPublicStartDependencies + > +{ private registry = new FileKindsRegistryImpl(); private filesClientFactory?: FilesClientFactory; - setup(core: CoreSetup): FilesSetup { + setup(core: CoreSetup): FilesPublicSetup { this.registry.register({ ...DefaultImageFileKind.kind, maxSizeBytes: DefaultImageFileKind.maxSize, @@ -77,7 +90,7 @@ export class FilesPlugin implements Plugin { }; } - start(core: CoreStart): FilesStart { + start(core: CoreStart): FilesPublicStart { return { filesClientFactory: this.filesClientFactory!, getFileKindDefinition: (id: string): FileKindBrowser => { diff --git a/src/plugins/files/public/types.ts b/src/plugins/files/public/types.ts index ee4f622a8ddbb..35923bb224a14 100644 --- a/src/plugins/files/public/types.ts +++ b/src/plugins/files/public/types.ts @@ -12,3 +12,9 @@ export type { FilesClientFactory, FilesClientResponses, } from '../common/files_client'; + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface FilesPublicSetupDependencies {} + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface FilesPublicStartDependencies {} diff --git a/src/plugins/files/server/index.ts b/src/plugins/files/server/index.ts index f02a0164b1f69..757ff4fc19fd8 100755 --- a/src/plugins/files/server/index.ts +++ b/src/plugins/files/server/index.ts @@ -23,7 +23,7 @@ export { createEsFileClient } from './file_client'; export { createFileHashTransform } from './file_client/stream_transforms/file_hash_transform'; -export type { FilesSetup, FilesStart } from './types'; +export type { FilesServerSetup as FilesSetup, FilesServerStart as FilesStart } from './types'; export type { FileShareServiceStart, CreateShareArgs, diff --git a/src/plugins/files/server/plugin.ts b/src/plugins/files/server/plugin.ts index 9e608d8f38a59..19addde116d02 100755 --- a/src/plugins/files/server/plugin.ts +++ b/src/plugins/files/server/plugin.ts @@ -25,10 +25,10 @@ import { import { BlobStorageService } from './blob_storage_service'; import { FileServiceFactory } from './file_service'; import type { - FilesPluginSetupDependencies, - FilesPluginStartDependencies, - FilesSetup, - FilesStart, + FilesServerSetupDependencies, + FilesServerStartDependencies, + FilesServerSetup, + FilesServerStart, } from './types'; import type { FilesRequestHandlerContext, FilesRouter } from './routes/types'; @@ -36,12 +36,20 @@ import { registerRoutes, registerFileKindRoutes } from './routes'; import { Counters, registerUsageCollector } from './usage'; import * as DefaultImageKind from '../common/default_image_file_kind'; -export class FilesPlugin implements Plugin { +export class FilesPlugin + implements + Plugin< + FilesServerSetup, + FilesServerStart, + FilesServerSetupDependencies, + FilesServerStartDependencies + > +{ private static analytics?: AnalyticsServiceStart; private readonly logger: Logger; private fileServiceFactory: undefined | FileServiceFactory; - private securitySetup: FilesPluginSetupDependencies['security']; - private securityStart: FilesPluginStartDependencies['security']; + private securitySetup: FilesServerSetupDependencies['security']; + private securityStart: FilesServerStartDependencies['security']; constructor(initializerContext: PluginInitializerContext) { this.logger = initializerContext.logger.get(); @@ -57,8 +65,8 @@ export class FilesPlugin implements Plugin { ); await loadTutorialPromise; component.update(); - component.find('#onPremElasticCloud').first().find('input').simulate('change'); + component.find('button[data-test-subj="onCloudTutorial"]').simulate('click'); component.update(); expect(component.state('visibleInstructions')).toBe('onPremElasticCloud'); }); diff --git a/src/plugins/inspector/public/ui/__snapshots__/inspector_panel.test.tsx.snap b/src/plugins/inspector/public/ui/__snapshots__/inspector_panel.test.tsx.snap index 3ebb9ee096fc5..11e7964056745 100644 --- a/src/plugins/inspector/public/ui/__snapshots__/inspector_panel.test.tsx.snap +++ b/src/plugins/inspector/public/ui/__snapshots__/inspector_panel.test.tsx.snap @@ -21,32 +21,28 @@ Array [ class="euiFlexItem emotion-euiFlexItem-growZero" >
-
- -
+ + +
diff --git a/src/plugins/kibana_utils/public/index.ts b/src/plugins/kibana_utils/public/index.ts index a33a1f5e7e64f..9a717953d60f8 100644 --- a/src/plugins/kibana_utils/public/index.ts +++ b/src/plugins/kibana_utils/public/index.ts @@ -112,7 +112,7 @@ export { } from './history'; export { applyDiff } from './state_management/utils/diff_object'; -export type { KibanaUtilsSetup } from './plugin'; +export type { KibanaUtilsPublicSetup as KibanaUtilsSetup, KibanaUtilsPublicStart } from './plugin'; export function plugin(initializerContext: PluginInitializerContext) { return new KibanaUtilsPublicPlugin(initializerContext); diff --git a/src/plugins/kibana_utils/public/mocks.ts b/src/plugins/kibana_utils/public/mocks.ts index a537c2fc74e90..cb872838af4b4 100644 --- a/src/plugins/kibana_utils/public/mocks.ts +++ b/src/plugins/kibana_utils/public/mocks.ts @@ -6,10 +6,10 @@ * Side Public License, v 1. */ -import { KibanaUtilsSetup, KibanaUtilsStart } from './plugin'; +import { KibanaUtilsPublicSetup, KibanaUtilsPublicStart } from './plugin'; -export type Setup = jest.Mocked; -export type Start = jest.Mocked; +export type Setup = jest.Mocked; +export type Start = jest.Mocked; const createSetupContract = (): Setup => { return { diff --git a/src/plugins/kibana_utils/public/plugin.ts b/src/plugins/kibana_utils/public/plugin.ts index d483754da5b22..05d8ede256498 100644 --- a/src/plugins/kibana_utils/public/plugin.ts +++ b/src/plugins/kibana_utils/public/plugin.ts @@ -10,26 +10,40 @@ import { PluginInitializerContext, CoreSetup, CoreStart, Plugin } from '@kbn/cor import { History } from 'history'; import { setVersion } from './set_version'; -export interface KibanaUtilsSetup { +export interface KibanaUtilsPublicSetup { setVersion: (history: Pick) => void; } -export type KibanaUtilsStart = undefined; +export type KibanaUtilsPublicStart = undefined; -export class KibanaUtilsPublicPlugin implements Plugin { +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface KibanaUtilsPublicSetupDependencies {} + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface KibanaUtilsPublicStartDependencies {} + +export class KibanaUtilsPublicPlugin + implements + Plugin< + KibanaUtilsPublicSetup, + KibanaUtilsPublicStart, + KibanaUtilsPublicSetupDependencies, + KibanaUtilsPublicStartDependencies + > +{ private readonly version: string; constructor(initializerContext: PluginInitializerContext) { this.version = initializerContext.env.packageInfo.version; } - public setup(core: CoreSetup): KibanaUtilsSetup { + public setup(_core: CoreSetup): KibanaUtilsPublicSetup { return { setVersion: this.setVersion, }; } - public start(core: CoreStart): KibanaUtilsStart { + public start(_core: CoreStart): KibanaUtilsPublicStart { return undefined; } diff --git a/src/plugins/navigation/public/index.ts b/src/plugins/navigation/public/index.ts index 65b8851a39ac2..a68f8f2bbcdbd 100644 --- a/src/plugins/navigation/public/index.ts +++ b/src/plugins/navigation/public/index.ts @@ -16,7 +16,10 @@ export function plugin(initializerContext: PluginInitializerContext) { export type { TopNavMenuData, TopNavMenuProps, TopNavMenuBadgeProps } from './top_nav_menu'; export { TopNavMenu, TopNavMenuItems, TopNavMenuBadges } from './top_nav_menu'; -export type { NavigationPublicPluginSetup, NavigationPublicPluginStart } from './types'; +export type { + NavigationPublicSetup as NavigationPublicPluginSetup, + NavigationPublicStart as NavigationPublicPluginStart, +} from './types'; // Export plugin after all other imports import { NavigationPublicPlugin } from './plugin'; diff --git a/src/plugins/navigation/public/plugin.ts b/src/plugins/navigation/public/plugin.ts index 3be546918cdc2..58e21e4a99f13 100644 --- a/src/plugins/navigation/public/plugin.ts +++ b/src/plugins/navigation/public/plugin.ts @@ -9,22 +9,29 @@ import { PluginInitializerContext, CoreSetup, CoreStart, Plugin } from '@kbn/core/public'; import { UnifiedSearchPublicPluginStart } from '@kbn/unified-search-plugin/public'; import { - NavigationPublicPluginSetup, - NavigationPublicPluginStart, - NavigationPluginStartDependencies, + NavigationPublicSetup, + NavigationPublicStart, + NavigationPublicSetupDependencies, + NavigationPublicStartDependencies, } from './types'; import { TopNavMenuExtensionsRegistry, createTopNav } from './top_nav_menu'; import { RegisteredTopNavMenuData } from './top_nav_menu/top_nav_menu_data'; export class NavigationPublicPlugin - implements Plugin + implements + Plugin< + NavigationPublicSetup, + NavigationPublicStart, + NavigationPublicSetupDependencies, + NavigationPublicStartDependencies + > { private readonly topNavMenuExtensionsRegistry: TopNavMenuExtensionsRegistry = new TopNavMenuExtensionsRegistry(); - constructor(initializerContext: PluginInitializerContext) {} + constructor(_initializerContext: PluginInitializerContext) {} - public setup(core: CoreSetup): NavigationPublicPluginSetup { + public setup(_core: CoreSetup): NavigationPublicSetup { return { registerMenuItem: this.topNavMenuExtensionsRegistry.register.bind( this.topNavMenuExtensionsRegistry @@ -33,9 +40,9 @@ export class NavigationPublicPlugin } public start( - core: CoreStart, - { unifiedSearch }: NavigationPluginStartDependencies - ): NavigationPublicPluginStart { + _core: CoreStart, + { unifiedSearch }: NavigationPublicStartDependencies + ): NavigationPublicStart { const extensions = this.topNavMenuExtensionsRegistry.getAll(); /* diff --git a/src/plugins/navigation/public/types.ts b/src/plugins/navigation/public/types.ts index 8958aa91d5ff6..9dea8415ca874 100644 --- a/src/plugins/navigation/public/types.ts +++ b/src/plugins/navigation/public/types.ts @@ -11,11 +11,11 @@ import { UnifiedSearchPublicPluginStart } from '@kbn/unified-search-plugin/publi import { TopNavMenuProps, TopNavMenuExtensionsRegistrySetup, createTopNav } from './top_nav_menu'; import { RegisteredTopNavMenuData } from './top_nav_menu/top_nav_menu_data'; -export interface NavigationPublicPluginSetup { +export interface NavigationPublicSetup { registerMenuItem: TopNavMenuExtensionsRegistrySetup['register']; } -export interface NavigationPublicPluginStart { +export interface NavigationPublicStart { ui: { TopNavMenu: (props: TopNavMenuProps) => React.ReactElement; AggregateQueryTopNavMenu: (props: TopNavMenuProps) => React.ReactElement; @@ -26,6 +26,9 @@ export interface NavigationPublicPluginStart { }; } -export interface NavigationPluginStartDependencies { +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface NavigationPublicSetupDependencies {} + +export interface NavigationPublicStartDependencies { unifiedSearch: UnifiedSearchPublicPluginStart; } diff --git a/src/plugins/no_data_page/public/index.ts b/src/plugins/no_data_page/public/index.ts index 28dfcd6044403..4d6c72c34ef85 100644 --- a/src/plugins/no_data_page/public/index.ts +++ b/src/plugins/no_data_page/public/index.ts @@ -13,4 +13,7 @@ export function plugin(ctx: PluginInitializerContext) { return new NoDataPagePlugin(ctx); } -export type { NoDataPagePluginSetup, NoDataPagePluginStart } from './types'; +export type { + NoDataPagePublicSetup as NoDataPagePluginSetup, + NoDataPagePublicStart as NoDataPagePluginStart, +} from './types'; diff --git a/src/plugins/no_data_page/public/plugin.ts b/src/plugins/no_data_page/public/plugin.ts index 740f796f4f395..a9f5dd0fe1f95 100644 --- a/src/plugins/no_data_page/public/plugin.ts +++ b/src/plugins/no_data_page/public/plugin.ts @@ -7,13 +7,26 @@ */ import type { CoreSetup, CoreStart, Plugin, PluginInitializerContext } from '@kbn/core/public'; -import type { NoDataPagePluginSetup, NoDataPagePluginStart } from './types'; +import type { + NoDataPagePublicSetup, + NoDataPagePublicSetupDependencies, + NoDataPagePublicStart, + NoDataPagePublicStartDependencies, +} from './types'; import type { NoDataPageConfig } from '../config'; -export class NoDataPagePlugin implements Plugin { +export class NoDataPagePlugin + implements + Plugin< + NoDataPagePublicSetup, + NoDataPagePublicStart, + NoDataPagePublicSetupDependencies, + NoDataPagePublicStartDependencies + > +{ constructor(private initializerContext: PluginInitializerContext) {} - public setup(core: CoreSetup): NoDataPagePluginSetup { + public setup(_core: CoreSetup): NoDataPagePublicSetup { return { getAnalyticsNoDataPageFlavor: () => { return this.initializerContext.config.get().analyticsNoDataPageFlavor; @@ -21,7 +34,7 @@ export class NoDataPagePlugin implements Plugin { }; } - public start(core: CoreStart): NoDataPagePluginStart { + public start(_core: CoreStart): NoDataPagePublicStart { return { getAnalyticsNoDataPageFlavor: () => { return this.initializerContext.config.get().analyticsNoDataPageFlavor; diff --git a/src/plugins/no_data_page/public/types.ts b/src/plugins/no_data_page/public/types.ts index 2e33170ec06bf..43761d946af87 100644 --- a/src/plugins/no_data_page/public/types.ts +++ b/src/plugins/no_data_page/public/types.ts @@ -6,8 +6,14 @@ * Side Public License, v 1. */ -export interface NoDataPagePluginSetup { +export interface NoDataPagePublicSetup { getAnalyticsNoDataPageFlavor: () => 'kibana' | 'serverless_search' | 'serverless_observability'; } -export type NoDataPagePluginStart = NoDataPagePluginSetup; +export type NoDataPagePublicStart = NoDataPagePublicSetup; + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface NoDataPagePublicSetupDependencies {} + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface NoDataPagePublicStartDependencies {} diff --git a/src/plugins/presentation_util/public/types.ts b/src/plugins/presentation_util/public/types.ts index 589d4101bdf80..dfc81ad4a0a27 100644 --- a/src/plugins/presentation_util/public/types.ts +++ b/src/plugins/presentation_util/public/types.ts @@ -8,7 +8,7 @@ import { ContentManagementPublicStart } from '@kbn/content-management-plugin/public'; import { DataViewsPublicPluginStart } from '@kbn/data-views-plugin/public'; -import { UiActionsStart } from '@kbn/ui-actions-plugin/public/plugin'; +import { UiActionsStart } from '@kbn/ui-actions-plugin/public'; import { registerExpressionsLanguage } from '.'; import { PresentationLabsService } from './services/labs/types'; diff --git a/src/plugins/screenshot_mode/public/index.ts b/src/plugins/screenshot_mode/public/index.ts index 591ddbfdf49c5..9a5b0203fdcdc 100644 --- a/src/plugins/screenshot_mode/public/index.ts +++ b/src/plugins/screenshot_mode/public/index.ts @@ -18,4 +18,7 @@ export { KBN_SCREENSHOT_MODE_ENABLED_KEY, } from '../common'; -export type { ScreenshotModePluginSetup, ScreenshotModePluginStart } from './types'; +export type { + ScreenshotModePublicSetup as ScreenshotModePluginSetup, + ScreenshotModePublicStart as ScreenshotModePluginStart, +} from './types'; diff --git a/src/plugins/screenshot_mode/public/mocks.ts b/src/plugins/screenshot_mode/public/mocks.ts index 1d3e226a83b6b..4f7157b8ae84e 100644 --- a/src/plugins/screenshot_mode/public/mocks.ts +++ b/src/plugins/screenshot_mode/public/mocks.ts @@ -7,14 +7,14 @@ */ import type { DeeplyMockedKeys } from '@kbn/utility-types-jest'; -import type { ScreenshotModePluginSetup, ScreenshotModePluginStart } from './types'; +import type { ScreenshotModePublicSetup, ScreenshotModePublicStart } from './types'; export const screenshotModePluginMock = { - createSetupContract: (): DeeplyMockedKeys => ({ + createSetupContract: (): DeeplyMockedKeys => ({ getScreenshotContext: jest.fn(), isScreenshotMode: jest.fn(() => false), }), - createStartContract: (): DeeplyMockedKeys => ({ + createStartContract: (): DeeplyMockedKeys => ({ getScreenshotContext: jest.fn(), isScreenshotMode: jest.fn(() => false), }), diff --git a/src/plugins/screenshot_mode/public/plugin.ts b/src/plugins/screenshot_mode/public/plugin.ts index 2008e46e9b2d6..aa55049128a05 100644 --- a/src/plugins/screenshot_mode/public/plugin.ts +++ b/src/plugins/screenshot_mode/public/plugin.ts @@ -8,19 +8,32 @@ import type { CoreSetup, CoreStart, Plugin } from '@kbn/core/public'; import { getScreenshotContext, getScreenshotMode } from '../common'; -import type { ScreenshotModePluginSetup, ScreenshotModePluginStart } from './types'; +import type { + ScreenshotModePublicSetup, + ScreenshotModePublicSetupDependencies, + ScreenshotModePublicStart, + ScreenshotModePublicStartDependencies, +} from './types'; -export class ScreenshotModePlugin implements Plugin { +export class ScreenshotModePlugin + implements + Plugin< + ScreenshotModePublicSetup, + ScreenshotModePublicStart, + ScreenshotModePublicSetupDependencies, + ScreenshotModePublicStartDependencies + > +{ private publicContract = Object.freeze({ getScreenshotContext, isScreenshotMode: () => getScreenshotMode() === true, }); - public setup(core: CoreSetup): ScreenshotModePluginSetup { + public setup(_core: CoreSetup): ScreenshotModePublicSetup { return this.publicContract; } - public start(core: CoreStart): ScreenshotModePluginStart { + public start(_core: CoreStart): ScreenshotModePublicStart { return this.publicContract; } diff --git a/src/plugins/screenshot_mode/public/types.ts b/src/plugins/screenshot_mode/public/types.ts index 9de538bc9f8fb..b25a4a0f35dcb 100644 --- a/src/plugins/screenshot_mode/public/types.ts +++ b/src/plugins/screenshot_mode/public/types.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -export interface ScreenshotModePluginSetup { +export interface ScreenshotModePublicSetup { /** * Retrieves a value from the screenshotting context. * @param key Context key to get. @@ -22,4 +22,10 @@ export interface ScreenshotModePluginSetup { isScreenshotMode(): boolean; } -export type ScreenshotModePluginStart = ScreenshotModePluginSetup; +export type ScreenshotModePublicStart = ScreenshotModePublicSetup; + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface ScreenshotModePublicSetupDependencies {} + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface ScreenshotModePublicStartDependencies {} diff --git a/src/plugins/screenshot_mode/server/index.ts b/src/plugins/screenshot_mode/server/index.ts index 55dfd3967f4e4..cde13072badc3 100644 --- a/src/plugins/screenshot_mode/server/index.ts +++ b/src/plugins/screenshot_mode/server/index.ts @@ -14,8 +14,8 @@ export { export type { ScreenshotModeRequestHandlerContext, - ScreenshotModePluginSetup, - ScreenshotModePluginStart, + ScreenshotModeServerSetup as ScreenshotModePluginSetup, + ScreenshotModeServerStart as ScreenshotModePluginStart, } from './types'; export async function plugin() { diff --git a/src/plugins/screenshot_mode/server/plugin.ts b/src/plugins/screenshot_mode/server/plugin.ts index fc900170f7a83..4a2e05ff78740 100644 --- a/src/plugins/screenshot_mode/server/plugin.ts +++ b/src/plugins/screenshot_mode/server/plugin.ts @@ -9,15 +9,23 @@ import type { Plugin, CoreSetup } from '@kbn/core/server'; import type { ScreenshotModeRequestHandlerContext, - ScreenshotModePluginSetup, - ScreenshotModePluginStart, + ScreenshotModeServerSetup, + ScreenshotModeServerStart, + ScreenshotModeServerSetupDependencies, + ScreenshotModeServerStartDependencies, } from './types'; import { isScreenshotMode } from './is_screenshot_mode'; export class ScreenshotModePlugin - implements Plugin + implements + Plugin< + ScreenshotModeServerSetup, + ScreenshotModeServerStart, + ScreenshotModeServerSetupDependencies, + ScreenshotModeServerStartDependencies + > { - public setup(core: CoreSetup): ScreenshotModePluginSetup { + public setup(core: CoreSetup): ScreenshotModeServerSetup { core.http.registerRouteHandlerContext( 'screenshotMode', (ctx, req) => { @@ -39,7 +47,7 @@ export class ScreenshotModePlugin }; } - public start(): ScreenshotModePluginStart { + public start(): ScreenshotModeServerStart { return { isScreenshotMode, }; diff --git a/src/plugins/screenshot_mode/server/types.ts b/src/plugins/screenshot_mode/server/types.ts index 08655d2f0118d..15d4afb4ace3a 100644 --- a/src/plugins/screenshot_mode/server/types.ts +++ b/src/plugins/screenshot_mode/server/types.ts @@ -8,7 +8,7 @@ import type { CustomRequestHandlerContext, KibanaRequest } from '@kbn/core/server'; -export interface ScreenshotModePluginStart { +export interface ScreenshotModeServerStart { /** * Any context that requires access to the screenshot mode flag but does not have access * to request context {@link ScreenshotModeRequestHandlerContext}, for instance if they are pre-context, @@ -17,7 +17,7 @@ export interface ScreenshotModePluginStart { isScreenshotMode(request: KibanaRequest): boolean; } -export interface ScreenshotModePluginSetup extends ScreenshotModePluginStart { +export interface ScreenshotModeServerSetup extends ScreenshotModeServerStart { /** * Stores a value in the screenshotting context. * @param key Context key to set. @@ -32,6 +32,12 @@ export interface ScreenshotModePluginSetup extends ScreenshotModePluginStart { setScreenshotModeEnabled(): void; } +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface ScreenshotModeServerSetupDependencies {} + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface ScreenshotModeServerStartDependencies {} + export type ScreenshotModeRequestHandlerContext = CustomRequestHandlerContext<{ screenshotMode: { isScreenshot: boolean; diff --git a/src/plugins/share/public/index.ts b/src/plugins/share/public/index.ts index d33e4110ff3a4..d01e7df655f51 100644 --- a/src/plugins/share/public/index.ts +++ b/src/plugins/share/public/index.ts @@ -12,7 +12,10 @@ export { CSV_QUOTE_VALUES_SETTING, CSV_SEPARATOR_SETTING } from '../common/const export type { LocatorDefinition, LocatorPublic, KibanaLocation } from '../common/url_service'; -export type { SharePluginSetup, SharePluginStart } from './plugin'; +export type { + SharePublicSetup as SharePluginSetup, + SharePublicStart as SharePluginStart, +} from './plugin'; export type { ShareContext, diff --git a/src/plugins/share/public/mocks.ts b/src/plugins/share/public/mocks.ts index 7406dbb12f883..f7fd6b8aa0734 100644 --- a/src/plugins/share/public/mocks.ts +++ b/src/plugins/share/public/mocks.ts @@ -7,13 +7,13 @@ */ import { SerializableRecord } from '@kbn/utility-types'; -import { SharePluginSetup, SharePluginStart } from '.'; +import { SharePublicSetup, SharePublicStart } from './plugin'; import { LocatorPublic, UrlService } from '../common/url_service'; import { BrowserShortUrlClient } from './url_service/short_urls/short_url_client'; import type { BrowserShortUrlClientFactoryCreateParams } from './url_service/short_urls/short_url_client_factory'; -export type Setup = jest.Mocked; -export type Start = jest.Mocked; +export type Setup = jest.Mocked; +export type Start = jest.Mocked; const url = new UrlService({ navigate: async () => {}, diff --git a/src/plugins/share/public/plugin.ts b/src/plugins/share/public/plugin.ts index 6a04e4cd1b12c..41666a692cb90 100644 --- a/src/plugins/share/public/plugin.ts +++ b/src/plugins/share/public/plugin.ts @@ -26,7 +26,7 @@ import { registrations } from './lib/registrations'; import type { BrowserUrlService } from './types'; /** @public */ -export type SharePluginSetup = ShareMenuRegistrySetup & { +export type SharePublicSetup = ShareMenuRegistrySetup & { /** * Utilities to work with URL locators and short URLs. */ @@ -45,7 +45,7 @@ export type SharePluginSetup = ShareMenuRegistrySetup & { }; /** @public */ -export type SharePluginStart = ShareMenuManagerStart & { +export type SharePublicStart = ShareMenuManagerStart & { /** * Utilities to work with URL locators and short URLs. */ @@ -58,7 +58,21 @@ export type SharePluginStart = ShareMenuManagerStart & { navigate(options: RedirectOptions): void; }; -export class SharePlugin implements Plugin { +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface SharePublicSetupDependencies {} + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface SharePublicStartDependencies {} + +export class SharePlugin + implements + Plugin< + SharePublicSetup, + SharePublicStart, + SharePublicSetupDependencies, + SharePublicStartDependencies + > +{ private readonly shareMenuRegistry = new ShareMenuRegistry(); private readonly shareContextMenu = new ShareMenuManager(); @@ -68,7 +82,7 @@ export class SharePlugin implements Plugin { constructor(private readonly initializerContext: PluginInitializerContext) {} - public setup(core: CoreSetup): SharePluginSetup { + public setup(core: CoreSetup): SharePublicSetup { const { analytics, http } = core; const { basePath } = http; @@ -122,7 +136,7 @@ export class SharePlugin implements Plugin { }; } - public start(core: CoreStart): SharePluginStart { + public start(core: CoreStart): SharePublicStart { const disableEmbed = this.initializerContext.env.packageInfo.buildFlavor === 'serverless'; const sharingContextMenuStart = this.shareContextMenu.start( core, diff --git a/src/plugins/share/server/index.ts b/src/plugins/share/server/index.ts index d38575a3b7cd4..3105e5f57282f 100644 --- a/src/plugins/share/server/index.ts +++ b/src/plugins/share/server/index.ts @@ -8,7 +8,10 @@ import { PluginInitializerContext } from '@kbn/core/server'; -export type { SharePluginSetup, SharePluginStart } from './plugin'; +export type { + SharePublicSetup as SharePluginSetup, + SharePublicStart as SharePluginStart, +} from './plugin'; export { CSV_QUOTE_VALUES_SETTING, CSV_SEPARATOR_SETTING } from '../common/constants'; diff --git a/src/plugins/share/server/plugin.ts b/src/plugins/share/server/plugin.ts index 437257704501c..228a1fc09b1f9 100644 --- a/src/plugins/share/server/plugin.ts +++ b/src/plugins/share/server/plugin.ts @@ -21,16 +21,30 @@ import { LegacyShortUrlLocatorDefinition } from '../common/url_service/locators/ import { ShortUrlRedirectLocatorDefinition } from '../common/url_service/locators/short_url_redirect_locator'; /** @public */ -export interface SharePluginSetup { +export interface SharePublicSetup { url: ServerUrlService; } /** @public */ -export interface SharePluginStart { +export interface SharePublicStart { url: ServerUrlService; } -export class SharePlugin implements Plugin { +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface SharePublicSetupDependencies {} + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface SharePublicStartDependencies {} + +export class SharePlugin + implements + Plugin< + SharePublicSetup, + SharePublicStart, + SharePublicSetupDependencies, + SharePublicStartDependencies + > +{ private url?: ServerUrlService; private version: string; diff --git a/src/plugins/ui_actions/kibana.jsonc b/src/plugins/ui_actions/kibana.jsonc index 396f5b82faf01..66ccaa6917d0b 100644 --- a/src/plugins/ui_actions/kibana.jsonc +++ b/src/plugins/ui_actions/kibana.jsonc @@ -7,9 +7,7 @@ "id": "uiActions", "server": false, "browser": true, - "requiredPlugins": [ - "dataViews" - ], + "requiredPlugins": [], "requiredBundles": [ "kibanaUtils", "kibanaReact" diff --git a/src/plugins/ui_actions/public/index.ts b/src/plugins/ui_actions/public/index.ts index d996b6b4e2cdc..37f92d6962d48 100644 --- a/src/plugins/ui_actions/public/index.ts +++ b/src/plugins/ui_actions/public/index.ts @@ -13,7 +13,10 @@ export function plugin(initializerContext: PluginInitializerContext) { return new UiActionsPlugin(initializerContext); } -export type { UiActionsSetup, UiActionsStart } from './plugin'; +export type { + UiActionsPublicSetup as UiActionsSetup, + UiActionsPublicStart as UiActionsStart, +} from './plugin'; export type { UiActionsServiceParams } from './service'; export { UiActionsService } from './service'; export type { Action, ActionDefinition as UiActionsActionDefinition } from './actions'; diff --git a/src/plugins/ui_actions/public/mocks.ts b/src/plugins/ui_actions/public/mocks.ts index 57474bbf6ff3b..c184e6e021122 100644 --- a/src/plugins/ui_actions/public/mocks.ts +++ b/src/plugins/ui_actions/public/mocks.ts @@ -8,11 +8,12 @@ import { CoreSetup, CoreStart } from '@kbn/core/public'; import { coreMock } from '@kbn/core/public/mocks'; -import { Action, UiActionsSetup, UiActionsStart } from '.'; +import { Action } from '.'; +import { UiActionsPublicSetup, UiActionsPublicStart } from './plugin'; import { plugin as pluginInitializer } from '.'; -export type Setup = jest.Mocked; -export type Start = jest.Mocked; +export type Setup = jest.Mocked; +export type Start = jest.Mocked; const createSetupContract = (): Setup => { const setupContract: Setup = { diff --git a/src/plugins/ui_actions/public/plugin.ts b/src/plugins/ui_actions/public/plugin.ts index 16060d4bf3435..1a0e45612c831 100644 --- a/src/plugins/ui_actions/public/plugin.ts +++ b/src/plugins/ui_actions/public/plugin.ts @@ -16,7 +16,7 @@ import { import { UiActionsService } from './service'; import { setTheme } from './services'; -export type UiActionsSetup = Pick< +export type UiActionsPublicSetup = Pick< UiActionsService, | 'addTriggerAction' | 'attachAction' @@ -26,14 +26,28 @@ export type UiActionsSetup = Pick< | 'unregisterAction' >; -export type UiActionsStart = PublicMethodsOf; +export type UiActionsPublicStart = PublicMethodsOf; -export class UiActionsPlugin implements Plugin { +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface UiActionsPublicSetupDependencies {} + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface UiActionsPublicStartDependencies {} + +export class UiActionsPlugin + implements + Plugin< + UiActionsPublicSetup, + UiActionsPublicStart, + UiActionsPublicSetupDependencies, + UiActionsPublicStartDependencies + > +{ private readonly service = new UiActionsService(); - constructor(initializerContext: PluginInitializerContext) {} + constructor(_initializerContext: PluginInitializerContext) {} - public setup(core: CoreSetup): UiActionsSetup { + public setup(core: CoreSetup): UiActionsPublicSetup { setTheme(core.theme); this.service.registerTrigger(rowClickTrigger); this.service.registerTrigger(visualizeFieldTrigger); @@ -41,7 +55,7 @@ export class UiActionsPlugin implements Plugin { return this.service; } - public start(core: CoreStart): UiActionsStart { + public start(_core: CoreStart): UiActionsPublicStart { return this.service; } diff --git a/src/plugins/ui_actions_enhanced/server/index.ts b/src/plugins/ui_actions_enhanced/server/index.ts index bb62e2b86a19c..51076054e2eb0 100644 --- a/src/plugins/ui_actions_enhanced/server/index.ts +++ b/src/plugins/ui_actions_enhanced/server/index.ts @@ -13,8 +13,8 @@ export async function plugin() { export type { AdvancedUiActionsServerPlugin as Plugin, - SetupContract as AdvancedUiActionsSetup, - StartContract as AdvancedUiActionsStart, + UiActionsEnhancedServerSetup as AdvancedUiActionsSetup, + UiActionsEnhancedServerStart as AdvancedUiActionsStart, } from './plugin'; export type { diff --git a/src/plugins/ui_actions_enhanced/server/plugin.ts b/src/plugins/ui_actions_enhanced/server/plugin.ts index 272657ec84f0b..8d5c12c4312c4 100644 --- a/src/plugins/ui_actions_enhanced/server/plugin.ts +++ b/src/plugins/ui_actions_enhanced/server/plugin.ts @@ -12,24 +12,33 @@ import { EmbeddableSetup } from '@kbn/embeddable-plugin/server'; import { dynamicActionEnhancement } from './dynamic_action_enhancement'; import { ActionFactoryRegistry, SerializedEvent, ActionFactoryDefinition } from './types'; -export interface SetupContract { +export interface UiActionsEnhancedServerSetup { registerActionFactory: (definition: ActionFactoryDefinition) => void; } -export type StartContract = void; +export type UiActionsEnhancedServerStart = void; -interface SetupDependencies { +interface UiActionsEnhancedServerSetupDependencies { embeddable: EmbeddableSetup; // Embeddable are needed because they register basic triggers/actions. } +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface UiActionsEnhancedServerStartDependencies {} + export class AdvancedUiActionsServerPlugin - implements Plugin + implements + Plugin< + UiActionsEnhancedServerSetup, + UiActionsEnhancedServerStart, + UiActionsEnhancedServerSetupDependencies, + UiActionsEnhancedServerStartDependencies + > { protected readonly actionFactories: ActionFactoryRegistry = new Map(); constructor() {} - public setup(core: CoreSetup, { embeddable }: SetupDependencies) { + public setup(_core: CoreSetup, { embeddable }: UiActionsEnhancedServerSetupDependencies) { const getActionFactory = (actionFactoryId: string) => this.actionFactories.get(actionFactoryId); embeddable.registerEnhancement(dynamicActionEnhancement(getActionFactory)); diff --git a/src/plugins/unified_search/public/filter_bar/filter_item/filter_item.scss b/src/plugins/unified_search/public/filter_bar/filter_item/filter_item.scss index 787376fac0490..1c16adbfc8c13 100644 --- a/src/plugins/unified_search/public/filter_bar/filter_item/filter_item.scss +++ b/src/plugins/unified_search/public/filter_bar/filter_item/filter_item.scss @@ -73,11 +73,6 @@ padding: $euiSizeM; } -.globalFilterItem__popover, -.globalFilterItem__popoverAnchor { - display: block; -} - .globalFilterItem__readonlyPanel { min-width: auto; padding: $euiSizeM; diff --git a/src/plugins/unified_search/public/filter_bar/filter_item/filter_item.tsx b/src/plugins/unified_search/public/filter_bar/filter_item/filter_item.tsx index d29529f59a3c9..596a32ea0a2f5 100644 --- a/src/plugins/unified_search/public/filter_bar/filter_item/filter_item.tsx +++ b/src/plugins/unified_search/public/filter_bar/filter_item/filter_item.tsx @@ -367,8 +367,7 @@ function FilterItemComponent(props: FilterItemProps) { const popoverProps: FilterPopoverProps = { id: `popoverFor_filter${id}`, - className: `globalFilterItem__popover`, - anchorClassName: `globalFilterItem__popoverAnchor`, + display: 'block', isOpen: isPopoverOpen, closePopover, button: , diff --git a/src/plugins/unified_search/public/query_string_input/no_data_popover.tsx b/src/plugins/unified_search/public/query_string_input/no_data_popover.tsx index 7e9760486bb93..8fde7a52e6bd5 100644 --- a/src/plugins/unified_search/public/query_string_input/no_data_popover.tsx +++ b/src/plugins/unified_search/public/query_string_input/no_data_popover.tsx @@ -67,7 +67,6 @@ export function NoDataPopover({ } minWidth={300} anchorPosition="downCenter" - anchorClassName="eui-displayBlock" step={1} stepsTotal={1} isStepOpen={noDataPopoverVisible} diff --git a/src/plugins/vis_types/vislib/public/vislib/components/legend/__snapshots__/legend.test.tsx.snap b/src/plugins/vis_types/vislib/public/vislib/components/legend/__snapshots__/legend.test.tsx.snap index cc95e272d54f7..d23c14423efbb 100644 --- a/src/plugins/vis_types/vislib/public/vislib/components/legend/__snapshots__/legend.test.tsx.snap +++ b/src/plugins/vis_types/vislib/public/vislib/components/legend/__snapshots__/legend.test.tsx.snap @@ -2,4 +2,4 @@ exports[`VisLegend Component Legend closed should match the snapshot 1`] = `"
"`; -exports[`VisLegend Component Legend open should match the snapshot 1`] = `"
"`; +exports[`VisLegend Component Legend open should match the snapshot 1`] = `"
"`; diff --git a/test/examples/content_management/todo_app.ts b/test/examples/content_management/todo_app.ts index 5c5739c962e2d..7812f1fcf6646 100644 --- a/test/examples/content_management/todo_app.ts +++ b/test/examples/content_management/todo_app.ts @@ -28,17 +28,17 @@ export default function ({ getService, getPageObjects }: PluginFunctionalProvide expect(todos.length).to.be(2); // check that filters work - await (await find.byCssSelector('label[title="Completed"]')).click(); + await (await find.byButtonText('Completed')).click(); await testSubjects.missingOrFail(`todoPending`); todos = await testSubjects.findAll(`~todoItem`); expect(todos.length).to.be(1); - await (await find.byCssSelector('label[title="Todo"]')).click(); + await (await find.byButtonText('Todo')).click(); await testSubjects.missingOrFail(`todoPending`); todos = await testSubjects.findAll(`~todoItem`); expect(todos.length).to.be(1); - await (await find.byCssSelector('label[title="All"]')).click(); + await (await find.byButtonText('All')).click(); await testSubjects.missingOrFail(`todoPending`); todos = await testSubjects.findAll(`~todoItem`); expect(todos.length).to.be(2); @@ -56,9 +56,10 @@ export default function ({ getService, getPageObjects }: PluginFunctionalProvide let newTodoCheckbox = await newTodo.findByTestSubject('~todoCheckbox'); expect(await newTodoCheckbox.isSelected()).to.be(false); await (await newTodo.findByTagName('label')).click(); + await newTodo.click(); await testSubjects.missingOrFail(`todoPending`); - await (await find.byCssSelector('label[title="Completed"]')).click(); + await (await find.byButtonText('Completed')).click(); await testSubjects.missingOrFail(`todoPending`); todos = await testSubjects.findAll(`~todoItem`); expect(todos.length).to.be(2); diff --git a/test/functional/apps/dashboard_elements/controls/common/range_slider.ts b/test/functional/apps/dashboard_elements/controls/common/range_slider.ts index 17a1873ed098f..e088066533250 100644 --- a/test/functional/apps/dashboard_elements/controls/common/range_slider.ts +++ b/test/functional/apps/dashboard_elements/controls/common/range_slider.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { RANGE_SLIDER_CONTROL } from '@kbn/controls-plugin/common'; +import { OPTIONS_LIST_CONTROL, RANGE_SLIDER_CONTROL } from '@kbn/controls-plugin/common'; import expect from '@kbn/expect'; import { FtrProviderContext } from '../../../../ftr_provider_context'; @@ -112,6 +112,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const secondId = (await dashboardControls.getAllControlIds())[1]; const newTitle = 'Average ticket price'; await dashboardControls.editExistingControl(secondId); + await dashboardControls.controlsEditorVerifySupportedControlTypes({ + supportedTypes: [OPTIONS_LIST_CONTROL, RANGE_SLIDER_CONTROL], + selectedType: RANGE_SLIDER_CONTROL, + }); await dashboardControls.controlEditorSetTitle(newTitle); await dashboardControls.controlEditorSetWidth('large'); await dashboardControls.controlEditorSave(); @@ -128,7 +132,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { expect(await saveButton.isEnabled()).to.be(true); await dashboardControls.controlsEditorSetDataView('kibana_sample_data_flights'); expect(await saveButton.isEnabled()).to.be(false); - await dashboardControls.controlsEditorSetfield('dayOfWeek', RANGE_SLIDER_CONTROL); + await dashboardControls.controlsEditorSetfield('dayOfWeek'); + await dashboardControls.controlsEditorSetControlType(RANGE_SLIDER_CONTROL); await dashboardControls.controlEditorSave(); await dashboardControls.rangeSliderWaitForLoading(firstId); await dashboardControls.validateRange('placeholder', firstId, '0', '6'); diff --git a/test/functional/apps/dashboard_elements/controls/common/replace_controls.ts b/test/functional/apps/dashboard_elements/controls/common/replace_controls.ts index d3019a34b8802..974f5e942d42a 100644 --- a/test/functional/apps/dashboard_elements/controls/common/replace_controls.ts +++ b/test/functional/apps/dashboard_elements/controls/common/replace_controls.ts @@ -26,9 +26,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const DASHBOARD_NAME = 'Test Replace Controls'; - const changeFieldType = async (controlId: string, newField: string, expectedType?: string) => { + const changeFieldType = async (controlId: string, newField: string, type: string) => { await dashboardControls.editExistingControl(controlId); - await dashboardControls.controlsEditorSetfield(newField, expectedType); + await dashboardControls.controlsEditorSetfield(newField); + await dashboardControls.controlsEditorSetControlType(type); await dashboardControls.controlEditorSave(); }; diff --git a/test/functional/apps/dashboard_elements/controls/options_list/options_list_allow_expensive_queries_off.ts b/test/functional/apps/dashboard_elements/controls/options_list/options_list_allow_expensive_queries_off.ts index 91774aee02f2d..344143f7a0cc6 100644 --- a/test/functional/apps/dashboard_elements/controls/options_list/options_list_allow_expensive_queries_off.ts +++ b/test/functional/apps/dashboard_elements/controls/options_list/options_list_allow_expensive_queries_off.ts @@ -69,9 +69,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); }); - it('Can search options list for available options', async () => { + it('Can search options list for available options - exact match, case insensitive', async () => { await dashboardControls.optionsListOpenPopover(controlId); - await dashboardControls.optionsListPopoverSearchForOption('meo'); + await dashboardControls.optionsListPopoverSearchForOption('mEOw'); await dashboardControls.ensureAvailableOptionsEqual( controlId, { @@ -84,9 +84,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await dashboardControls.optionsListEnsurePopoverIsClosed(controlId); }); - it('Can search options list for available options - case sensitive', async () => { + it('Can search options list for available options - does not find partial match', async () => { await dashboardControls.optionsListOpenPopover(controlId); - await dashboardControls.optionsListPopoverSearchForOption('MEO'); + await dashboardControls.optionsListPopoverSearchForOption('meo'); const cardinality = await dashboardControls.optionsListPopoverGetAvailableOptionsCount(); expect(cardinality).to.be(0); await dashboardControls.optionsListPopoverClearSearch(); diff --git a/test/functional/apps/dashboard_elements/controls/options_list/options_list_creation_and_editing.ts b/test/functional/apps/dashboard_elements/controls/options_list/options_list_creation_and_editing.ts index 06dcfb6961f82..a19d5bfee82bb 100644 --- a/test/functional/apps/dashboard_elements/controls/options_list/options_list_creation_and_editing.ts +++ b/test/functional/apps/dashboard_elements/controls/options_list/options_list_creation_and_editing.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { OPTIONS_LIST_CONTROL } from '@kbn/controls-plugin/common'; +import { OPTIONS_LIST_CONTROL, RANGE_SLIDER_CONTROL } from '@kbn/controls-plugin/common'; import expect from '@kbn/expect'; import { FtrProviderContext } from '../../../../ftr_provider_context'; @@ -106,7 +106,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { expect(await saveButton.isEnabled()).to.be(true); await dashboardControls.controlsEditorSetDataView('animals-*'); expect(await saveButton.isEnabled()).to.be(false); - await dashboardControls.controlsEditorSetfield('animal.keyword', OPTIONS_LIST_CONTROL); + await dashboardControls.controlsEditorSetfield('animal.keyword'); + await dashboardControls.controlsEditorSetControlType(OPTIONS_LIST_CONTROL); await dashboardControls.controlEditorSave(); const selectionString = await dashboardControls.optionsListGetSelectionsString(firstId); @@ -141,6 +142,17 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await dashboard.clearUnsavedChanges(); }); + it('can change an existing control to a number field', async () => { + const firstId = (await dashboardControls.getAllControlIds())[0]; + await dashboardControls.editExistingControl(firstId); + await dashboardControls.controlsEditorSetfield('weightLbs'); + await dashboardControls.controlsEditorVerifySupportedControlTypes({ + supportedTypes: [OPTIONS_LIST_CONTROL, RANGE_SLIDER_CONTROL], + selectedType: OPTIONS_LIST_CONTROL, + }); + await dashboardControls.controlEditorSave(); + }); + it('deletes an existing control', async () => { const firstId = (await dashboardControls.getAllControlIds())[0]; diff --git a/test/functional/apps/dashboard_elements/controls/options_list/options_list_suggestions.ts b/test/functional/apps/dashboard_elements/controls/options_list/options_list_suggestions.ts index b6c27ece900ab..0b2dda536d41c 100644 --- a/test/functional/apps/dashboard_elements/controls/options_list/options_list_suggestions.ts +++ b/test/functional/apps/dashboard_elements/controls/options_list/options_list_suggestions.ts @@ -7,9 +7,10 @@ */ import { OPTIONS_LIST_CONTROL } from '@kbn/controls-plugin/common'; +import expect from '@kbn/expect'; -import { OPTIONS_LIST_ANIMAL_SOUND_SUGGESTIONS } from '../../../../page_objects/dashboard_page_controls'; import { FtrProviderContext } from '../../../../ftr_provider_context'; +import { OPTIONS_LIST_ANIMAL_SOUND_SUGGESTIONS } from '../../../../page_objects/dashboard_page_controls'; export default function ({ getService, getPageObjects }: FtrProviderContext) { const testSubjects = getService('testSubjects'); @@ -143,42 +144,57 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await dashboardControls.optionsListPopoverClearSearch(); await dashboardControls.optionsListEnsurePopoverIsClosed(controlId); }); - }); - it('wildcard searching causes unsaved changes', async () => { - await dashboardControls.editExistingControl(controlId); - await dashboardControls.optionsListSetAdditionalSettings({ searchTechnique: 'wildcard' }); - await dashboardControls.controlEditorSave(); - await testSubjects.existOrFail('dashboardUnsavedChangesBadge'); - }); + it('wildcard searching causes unsaved changes', async () => { + await dashboardControls.editExistingControl(controlId); + await dashboardControls.optionsListSetAdditionalSettings({ searchTechnique: 'wildcard' }); + await dashboardControls.controlEditorSave(); + await testSubjects.existOrFail('dashboardUnsavedChangesBadge'); + }); - it('wildcard searching works as expected', async () => { - await dashboardControls.optionsListOpenPopover(controlId); - await dashboardControls.optionsListPopoverSearchForOption('r'); - const containsR = Object.entries(OPTIONS_LIST_ANIMAL_SOUND_SUGGESTIONS).reduce( - (result, [key, docCount]) => { - if (key.includes('r')) return { ...result, [key]: docCount }; - return { ...result }; - }, - {} - ); - await dashboardControls.ensureAvailableOptionsEqual( - controlId, - { - suggestions: containsR, - invalidSelections: [], - }, - true - ); - await dashboardControls.optionsListPopoverClearSearch(); - await dashboardControls.optionsListEnsurePopoverIsClosed(controlId); - }); + it('wildcard searching works as expected', async () => { + await dashboardControls.optionsListOpenPopover(controlId); + await dashboardControls.optionsListPopoverSearchForOption('r'); + const containsR = Object.entries(OPTIONS_LIST_ANIMAL_SOUND_SUGGESTIONS).reduce( + (result, [key, docCount]) => { + if (key.includes('r')) return { ...result, [key]: docCount }; + return { ...result }; + }, + {} + ); + await dashboardControls.ensureAvailableOptionsEqual( + controlId, + { + suggestions: containsR, + invalidSelections: [], + }, + true + ); + await dashboardControls.optionsListPopoverClearSearch(); + await dashboardControls.optionsListEnsurePopoverIsClosed(controlId); + }); + + it('exact match searching works as expected', async () => { + await dashboardControls.editExistingControl(controlId); + await dashboardControls.optionsListSetAdditionalSettings({ searchTechnique: 'exact' }); + await dashboardControls.controlEditorSave(); - it('returning to default search technqiue should remove unsaved changes', async () => { - await dashboardControls.editExistingControl(controlId); - await dashboardControls.optionsListSetAdditionalSettings({ searchTechnique: 'prefix' }); - await dashboardControls.controlEditorSave(); - await testSubjects.missingOrFail('dashboardUnsavedChangesBadge'); + await dashboardControls.optionsListOpenPopover(controlId); + await dashboardControls.optionsListPopoverSearchForOption('R'); + expect(await dashboardControls.optionsListPopoverGetAvailableOptionsCount()).to.be(0); + await dashboardControls.optionsListPopoverSearchForOption('RuFf'); + expect(await dashboardControls.optionsListPopoverGetAvailableOptionsCount()).to.be(1); + + await dashboardControls.optionsListPopoverClearSearch(); + await dashboardControls.optionsListEnsurePopoverIsClosed(controlId); + }); + + it('returning to default search technique should remove unsaved changes', async () => { + await dashboardControls.editExistingControl(controlId); + await dashboardControls.optionsListSetAdditionalSettings({ searchTechnique: 'prefix' }); + await dashboardControls.controlEditorSave(); + await testSubjects.missingOrFail('dashboardUnsavedChangesBadge'); + }); }); }); } diff --git a/test/functional/page_objects/dashboard_page_controls.ts b/test/functional/page_objects/dashboard_page_controls.ts index effac6f9fbdf9..4e1e9c1ccfdc1 100644 --- a/test/functional/page_objects/dashboard_page_controls.ts +++ b/test/functional/page_objects/dashboard_page_controls.ts @@ -6,24 +6,19 @@ * Side Public License, v 1. */ -import expect from '@kbn/expect'; import { + ControlWidth, OPTIONS_LIST_CONTROL, RANGE_SLIDER_CONTROL, - ControlWidth, } from '@kbn/controls-plugin/common'; -import { OptionsListSearchTechnique } from '@kbn/controls-plugin/common/options_list/types'; import { ControlGroupChainingSystem } from '@kbn/controls-plugin/common/control_group/types'; +import { OptionsListSearchTechnique } from '@kbn/controls-plugin/common/options_list/suggestions_searching'; import { OptionsListSortingType } from '@kbn/controls-plugin/common/options_list/suggestions_sorting'; +import expect from '@kbn/expect'; +import { asyncForEach } from '@kbn/std'; -import { WebElementWrapper } from '../services/lib/web_element_wrapper'; import { FtrService } from '../ftr_provider_context'; - -const CONTROL_DISPLAY_NAMES: { [key: string]: string } = { - default: 'No field selected yet', - [OPTIONS_LIST_CONTROL]: 'Options list', - [RANGE_SLIDER_CONTROL]: 'Range slider', -}; +import { WebElementWrapper } from '../services/lib/web_element_wrapper'; interface OptionsListAdditionalSettings { searchTechnique?: OptionsListSearchTechnique; @@ -112,7 +107,14 @@ export class DashboardPageControls extends FtrService { await this.retry.try(async () => { await this.testSubjects.existOrFail('control-editor-flyout'); }); - await this.controlEditorVerifyType('default'); + + /** All control type options should be disabled until a field is selected */ + const controlTypeOptions = await this.find.allByCssSelector( + '[data-test-subj="controlTypeMenu"] > li > button' + ); + await asyncForEach(controlTypeOptions, async (controlTypeOption) => { + expect(await controlTypeOption.isEnabled()).to.be(false); + }); } /* ----------------------------------------------------------- @@ -270,7 +272,10 @@ export class DashboardPageControls extends FtrService { await this.openCreateControlFlyout(); if (dataViewTitle) await this.controlsEditorSetDataView(dataViewTitle); - if (fieldName) await this.controlsEditorSetfield(fieldName, controlType); + if (fieldName) { + await this.controlsEditorSetfield(fieldName); + await this.controlsEditorSetControlType(controlType); + } if (title) await this.controlEditorSetTitle(title); if (width) await this.controlEditorSetWidth(width); if (grow !== undefined) await this.controlEditorSetGrow(grow); @@ -601,11 +606,7 @@ export class DashboardPageControls extends FtrService { await this.testSubjects.click(`data-view-picker-${dataViewTitle}`); } - public async controlsEditorSetfield( - fieldName: string, - expectedType?: string, - shouldSearch: boolean = true - ) { + public async controlsEditorSetfield(fieldName: string, shouldSearch: boolean = true) { this.log.debug(`Setting control field to ${fieldName}`); if (shouldSearch) { await this.testSubjects.setValue('field-search-input', fieldName); @@ -614,13 +615,31 @@ export class DashboardPageControls extends FtrService { await this.testSubjects.existOrFail(`field-picker-select-${fieldName}`); }); await this.testSubjects.click(`field-picker-select-${fieldName}`); - if (expectedType) await this.controlEditorVerifyType(expectedType); } - public async controlEditorVerifyType(type: string) { - this.log.debug(`Verifying that the control editor picked the type ${type}`); - const autoSelectedType = await this.testSubjects.getVisibleText('control-editor-type'); - expect(autoSelectedType).to.equal(CONTROL_DISPLAY_NAMES[type]); + public async controlsEditorVerifySupportedControlTypes({ + supportedTypes, + selectedType = OPTIONS_LIST_CONTROL, + }: { + supportedTypes: string[]; + selectedType?: string; + }) { + this.log.debug(`Verifying that control types match what is expected for the selected field`); + asyncForEach(supportedTypes, async (type) => { + const controlTypeItem = await this.testSubjects.find(`create__${type}`); + expect(await controlTypeItem.isEnabled()).to.be(true); + if (type === selectedType) { + expect(await controlTypeItem.getAttribute('aria-pressed')).to.be('true'); + } + }); + } + + public async controlsEditorSetControlType(type: string) { + this.log.debug(`Setting control type to ${type}`); + const controlTypeItem = await this.testSubjects.find(`create__${type}`); + expect(await controlTypeItem.isEnabled()).to.be(true); + await controlTypeItem.click(); + expect(await controlTypeItem.getAttribute('aria-pressed')).to.be('true'); } // Options List editor functions diff --git a/test/functional/page_objects/time_picker.ts b/test/functional/page_objects/time_picker.ts index 1566c15533810..aa8832f28848a 100644 --- a/test/functional/page_objects/time_picker.ts +++ b/test/functional/page_objects/time_picker.ts @@ -107,6 +107,8 @@ export class TimePickerPageObject extends FtrService { } else { await this.testSubjects.setValue(dataTestSubj, value); } + + await this.testSubjects.pressEnter(dataTestSubj); } private async showStartEndTimes() { diff --git a/test/functional/services/combo_box.ts b/test/functional/services/combo_box.ts index 78c36a87636f7..4b23dd3bd8b98 100644 --- a/test/functional/services/combo_box.ts +++ b/test/functional/services/combo_box.ts @@ -6,6 +6,7 @@ * Side Public License, v 1. */ +import expect from '@kbn/expect'; import { FtrService } from '../ftr_provider_context'; import { WebElementWrapper } from './lib/web_element_wrapper'; @@ -84,6 +85,7 @@ export class ComboBoxService extends FtrService { const isOptionSelected = await this.isOptionSelected(comboBoxElement, trimmedValue); if (isOptionSelected) { + this.log.debug(`value is already selected. returning`); return; } @@ -116,7 +118,7 @@ export class ComboBoxService extends FtrService { const [alternate] = alternateTitle ? await this.find.allByCssSelector( - `.euiFilterSelectItem[title="${alternateTitle}"]`, + `.euiFilterSelectItem[title="${alternateTitle}" i]`, this.WAIT_FOR_EXISTS_TIME ) : []; @@ -177,15 +179,28 @@ export class ComboBoxService extends FtrService { * @param comboBoxElement element that wraps up EuiComboBox * @param filterValue text */ - private async setFilterValue( + public async setFilterValue( comboBoxElement: WebElementWrapper, filterValue: string ): Promise { const input = await comboBoxElement.findByTagName('input'); - await input.clearValue(); - await this.waitForOptionsListLoading(comboBoxElement); - await input.type(filterValue); - await this.waitForOptionsListLoading(comboBoxElement); + + await this.retry.try(async () => { + // Wait for the input to not be disabled before typing into it (otherwise + // typing will sometimes trigger the global search bar instead) + expect(await input.isEnabled()).to.equal(true); + + // Some Kibana comboboxes force state to not be clearable, so we can't use `input.clearValue()`. + // This is not-great production UX and shouldn't be happening, but for now we're going to + // work around it in FTR tests by selecting all existing text and typing to replace + if (!!(await input.getAttribute('value'))) { + await input.selectValueWithKeyboard(); + } + await input.type(filterValue); + await this.waitForOptionsListLoading(comboBoxElement); + + expect(await input.getAttribute('value')).to.equal(filterValue); + }); } /** @@ -241,9 +256,29 @@ export class ComboBoxService extends FtrService { this.log.debug(`comboBox.getComboBoxSelectedOptions, comboBoxSelector: ${comboBoxSelector}`); const comboBox = await this.testSubjects.find(comboBoxSelector); const $ = await comboBox.parseDomContent(); - return $('.euiComboBoxPill') + + if (await this.isSingleSelectionPlainText(comboBox)) { + const input = $('[data-test-subj="comboBoxSearchInput"]'); + this.log.debug('Single selection value: ', input.val()); + + const isValid = input.attr('aria-invalid') !== 'true'; + + if (isValid) { + const value = input.val(); + return value ? [value] : []; // Don't return empty strings + } else { + this.log.debug( + 'Single selection value is not valid and thus not selected - returning empty array' + ); + return []; + } + } + + const options = $('.euiComboBoxPill') .toArray() .map((option) => $(option).text()); + + return options; } /** @@ -315,8 +350,8 @@ export class ComboBoxService extends FtrService { if (!isOptionsListOpen) { await this.retry.try(async () => { - const toggleBtn = await comboBoxElement.findByTestSubject('comboBoxInput'); - await toggleBtn.click(); + const inputWrapper = await this.getComboBoxInputWrapper(comboBoxElement); + await inputWrapper.click(); }); } } @@ -333,9 +368,21 @@ export class ComboBoxService extends FtrService { ): Promise { this.log.debug(`comboBox.isOptionSelected, value: ${value}`); const $ = await comboBoxElement.parseDomContent(); + + if (await this.isSingleSelectionPlainText(comboBoxElement)) { + const input = $('input[role="combobox"]'); + + const hasValidValue = + input.attr('aria-invalid') !== 'true' && + value.toLowerCase().trim() === input.val().toLowerCase().trim(); // Normalizing text here for Firefox driver shenanigans + + return !!hasValidValue; + } + const selectedOptions = $('.euiComboBoxPill') .toArray() .map((option) => $(option).text()); + return ( selectedOptions.length === 1 && selectedOptions[0].toLowerCase().trim() === value.toLowerCase().trim() @@ -369,4 +416,26 @@ export class ComboBoxService extends FtrService { this.log.debug(`isDisabled:${isDisabled}`); return isDisabled?.toLowerCase() === 'true'; } + + /** + * Single selection plain text comboboxes do not render pill text, but instead render + * selected as well as search values in the child + */ + private async isSingleSelectionPlainText(comboBoxElement: WebElementWrapper): Promise { + const inputWrapper = await this.getComboBoxInputWrapper(comboBoxElement); + return await inputWrapper.elementHasClass('euiComboBox__inputWrap--plainText'); + } + + /** + * Kibana devs sometimes pass in the `comboBoxInput` element and not the parent wrapper 🤷 + * This util accounts for that and returns the `data-test-subj="comboBoxInput"` element no matter what + */ + private async getComboBoxInputWrapper( + comboBoxElement: WebElementWrapper + ): Promise { + const isInputWrapper = await comboBoxElement.elementHasClass('euiComboBox__inputWrap'); + return isInputWrapper + ? comboBoxElement + : await comboBoxElement.findByTestSubject('comboBoxInput'); + } } diff --git a/test/functional/services/common/index.ts b/test/functional/services/common/index.ts index 54c9e5a1ee54c..b7b8c67a4280d 100644 --- a/test/functional/services/common/index.ts +++ b/test/functional/services/common/index.ts @@ -14,4 +14,3 @@ export { PngService } from './png'; export { ScreenshotsService } from './screenshots'; export { SnapshotsService } from './snapshots'; export { TestSubjects } from './test_subjects'; -export { RetryOnStaleProvider } from './retry_on_stale'; diff --git a/test/functional/services/index.ts b/test/functional/services/index.ts index 11975f560e2d7..dc151f1b243e3 100644 --- a/test/functional/services/index.ts +++ b/test/functional/services/index.ts @@ -6,6 +6,7 @@ * Side Public License, v 1. */ +import { commonFunctionalUIServices } from '@kbn/ftr-common-functional-ui-services'; import { services as commonServiceProviders } from '../../common/services'; import { AppsMenuService } from './apps_menu'; @@ -17,7 +18,6 @@ import { ScreenshotsService, SnapshotsService, TestSubjects, - RetryOnStaleProvider, } from './common'; import { ComboBoxService } from './combo_box'; import { @@ -60,7 +60,7 @@ import { DashboardSettingsProvider } from './dashboard/dashboard_settings'; export const services = { ...commonServiceProviders, - + ...commonFunctionalUIServices, __webdriver__: RemoteProvider, filterBar: FilterBarService, queryBar: QueryBarService, @@ -101,7 +101,6 @@ export const services = { managementMenu: ManagementMenuService, monacoEditor: MonacoEditorService, menuToggle: MenuToggleService, - retryOnStale: RetryOnStaleProvider, usageCollection: UsageCollectionService, savedObjectsFinder: SavedObjectsFinderService, }; diff --git a/test/functional/services/lib/web_element_wrapper/web_element_wrapper.ts b/test/functional/services/lib/web_element_wrapper/web_element_wrapper.ts index 70df204b1de03..6a914c7273ba3 100644 --- a/test/functional/services/lib/web_element_wrapper/web_element_wrapper.ts +++ b/test/functional/services/lib/web_element_wrapper/web_element_wrapper.ts @@ -261,28 +261,28 @@ export class WebElementWrapper { * @default { charByChar: false } */ async clearValueWithKeyboard(options: TypeOptions = { charByChar: false }) { + const value = await this.getAttribute('value'); + if (!value.length) { + return; + } + if (options.charByChar === true) { - const value = await this.getAttribute('value'); for (let i = 0; i <= value.length; i++) { await this.pressKeys(this.Keys.BACK_SPACE); await setTimeoutAsync(100); } } else { - if (this.isChromium) { - // https://bugs.chromium.org/p/chromedriver/issues/detail?id=30 - await this.retryCall(async function clearValueWithKeyboard(wrapper) { - await wrapper.driver.executeScript(`arguments[0].select();`, wrapper._webElement); - }); - await this.pressKeys(this.Keys.BACK_SPACE); - } else { - const selectionKey = this.Keys[process.platform === 'darwin' ? 'COMMAND' : 'CONTROL']; - await this.pressKeys([selectionKey, 'a']); - await this.pressKeys(this.Keys.NULL); // Release modifier keys - await this.pressKeys(this.Keys.BACK_SPACE); // Delete all content - } + await this.selectValueWithKeyboard(); + await this.pressKeys(this.Keys.BACK_SPACE); } } + async selectValueWithKeyboard() { + const selectionKey = this.Keys[process.platform === 'darwin' ? 'COMMAND' : 'CONTROL']; + await this.pressKeys([selectionKey, 'a']); + await this.pressKeys(this.Keys.NULL); // Release modifier keys + } + /** * Types a key sequence on the DOM element represented by this instance. Modifier keys * (SHIFT, CONTROL, ALT, META) are stateful; once a modifier is processed in the key sequence, diff --git a/test/tsconfig.json b/test/tsconfig.json index a763d6f6a44d6..d451e64e6329b 100644 --- a/test/tsconfig.json +++ b/test/tsconfig.json @@ -71,5 +71,6 @@ "@kbn/event-annotation-plugin", "@kbn/event-annotation-common", "@kbn/links-plugin", + "@kbn/ftr-common-functional-ui-services", ] } diff --git a/tsconfig.base.json b/tsconfig.base.json index e634fe61248a1..178f70c927e28 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -168,6 +168,8 @@ "@kbn/cloud-security-posture-plugin/*": ["x-pack/plugins/cloud_security_posture/*"], "@kbn/code-editor": ["packages/shared-ux/code_editor"], "@kbn/code-editor/*": ["packages/shared-ux/code_editor/*"], + "@kbn/code-owners": ["packages/kbn-code-owners"], + "@kbn/code-owners/*": ["packages/kbn-code-owners/*"], "@kbn/coloring": ["packages/kbn-coloring"], "@kbn/coloring/*": ["packages/kbn-coloring/*"], "@kbn/config": ["packages/kbn-config"], @@ -844,6 +846,8 @@ "@kbn/ftr-apis-plugin/*": ["src/plugins/ftr_apis/*"], "@kbn/ftr-common-functional-services": ["packages/kbn-ftr-common-functional-services"], "@kbn/ftr-common-functional-services/*": ["packages/kbn-ftr-common-functional-services/*"], + "@kbn/ftr-common-functional-ui-services": ["packages/kbn-ftr-common-functional-ui-services"], + "@kbn/ftr-common-functional-ui-services/*": ["packages/kbn-ftr-common-functional-ui-services/*"], "@kbn/ftr-screenshot-filename": ["packages/kbn-ftr-screenshot-filename"], "@kbn/ftr-screenshot-filename/*": ["packages/kbn-ftr-screenshot-filename/*"], "@kbn/functional-with-es-ssl-cases-test-plugin": ["x-pack/test/functional_with_es_ssl/plugins/cases"], @@ -1246,6 +1250,8 @@ "@kbn/rison/*": ["packages/kbn-rison/*"], "@kbn/rollup-plugin": ["x-pack/plugins/rollup"], "@kbn/rollup-plugin/*": ["x-pack/plugins/rollup/*"], + "@kbn/router-utils": ["packages/kbn-router-utils"], + "@kbn/router-utils/*": ["packages/kbn-router-utils/*"], "@kbn/routing-example-plugin": ["examples/routing_example"], "@kbn/routing-example-plugin/*": ["examples/routing_example/*"], "@kbn/rrule": ["packages/kbn-rrule"], diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/conversations/conversation_selector/index.test.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/conversations/conversation_selector/index.test.tsx index 8cd7c1dd0bd64..4ab45c10b021a 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/conversations/conversation_selector/index.test.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/conversations/conversation_selector/index.test.tsx @@ -58,7 +58,7 @@ describe('Conversation selector', () => { ); expect(getByTestId('conversation-selector')).toBeInTheDocument(); - expect(getByTestId('euiComboBoxPill')).toHaveTextContent(welcomeConvo.id); + expect(getByTestId('comboBoxSearchInput')).toHaveValue(welcomeConvo.id); }); it('On change, selects new item', () => { const { getByTestId } = render( @@ -78,7 +78,7 @@ describe('Conversation selector', () => { expect(onConversationSelected).toHaveBeenCalledWith(alertConvo.id); }); it('On clear input, clears selected options', () => { - const { getByText, queryByText, getByTestId, queryByTestId } = render( + const { getByPlaceholderText, queryByPlaceholderText, getByTestId, queryByTestId } = render( ({ @@ -90,10 +90,10 @@ describe('Conversation selector', () => { ); - expect(getByTestId('euiComboBoxPill')).toBeInTheDocument(); - expect(queryByText(CONVERSATION_SELECTOR_PLACE_HOLDER)).not.toBeInTheDocument(); + expect(getByTestId('comboBoxSearchInput')).toBeInTheDocument(); + expect(queryByPlaceholderText(CONVERSATION_SELECTOR_PLACE_HOLDER)).not.toBeInTheDocument(); fireEvent.click(getByTestId('comboBoxClearButton')); - expect(getByText(CONVERSATION_SELECTOR_PLACE_HOLDER)).toBeInTheDocument(); + expect(getByPlaceholderText(CONVERSATION_SELECTOR_PLACE_HOLDER)).toBeInTheDocument(); expect(queryByTestId('euiComboBoxPill')).not.toBeInTheDocument(); }); diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/conversations/conversation_selector_settings/index.test.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/conversations/conversation_selector_settings/index.test.tsx index afe6ede592910..150784d9db4cf 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/conversations/conversation_selector_settings/index.test.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/conversations/conversation_selector_settings/index.test.tsx @@ -30,7 +30,7 @@ describe('ConversationSelectorSettings', () => { }); it('Selects an existing conversation', () => { const { getByTestId } = render(); - expect(getByTestId('comboBoxInput')).toHaveTextContent(welcomeConvo.id); + expect(getByTestId('comboBoxSearchInput')).toHaveValue(welcomeConvo.id); fireEvent.click(getByTestId('comboBoxToggleListButton')); fireEvent.click(getByTestId(alertConvo.id)); expect(onConversationSelectionChange).toHaveBeenCalledWith(alertConvo); diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/prompt_editor/system_prompt/system_prompt_modal/system_prompt_selector/system_prompt_selector.test.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/prompt_editor/system_prompt/system_prompt_modal/system_prompt_selector/system_prompt_selector.test.tsx index ea16553e71c6e..d8d14a8ffebe0 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/prompt_editor/system_prompt/system_prompt_modal/system_prompt_selector/system_prompt_selector.test.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/prompt_editor/system_prompt/system_prompt_modal/system_prompt_selector/system_prompt_selector.test.tsx @@ -25,7 +25,7 @@ describe('SystemPromptSelector', () => { }); it('Selects an existing quick prompt', () => { const { getByTestId } = render(); - expect(getByTestId('euiComboBoxPill')).toHaveTextContent(mockSystemPrompts[0].name); + expect(getByTestId('comboBoxSearchInput')).toHaveValue(mockSystemPrompts[0].name); fireEvent.click(getByTestId('comboBoxToggleListButton')); fireEvent.click(getByTestId(`systemPromptSelector-${mockSystemPrompts[1].id}`)); expect(onSystemPromptSelectionChange).toHaveBeenCalledWith(mockSystemPrompts[1]); diff --git a/x-pack/packages/kbn-elastic-assistant/impl/connectorland/models/model_selector/model_selector.test.tsx b/x-pack/packages/kbn-elastic-assistant/impl/connectorland/models/model_selector/model_selector.test.tsx index 459dfd3426584..9138c02381eb4 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/connectorland/models/model_selector/model_selector.test.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/connectorland/models/model_selector/model_selector.test.tsx @@ -15,7 +15,7 @@ describe('ModelSelector', () => { const { getByTestId } = render( ); - expect(getByTestId('euiComboBoxPill')).toHaveTextContent(MODEL_GPT_3_5_TURBO); + expect(getByTestId('comboBoxSearchInput')).toHaveValue(MODEL_GPT_3_5_TURBO); }); it('should call onModelSelectionChange when custom option', () => { const onModelSelectionChange = jest.fn(); diff --git a/x-pack/plugins/alerting/public/pages/maintenance_windows/components/create_maintenance_windows_form.test.tsx b/x-pack/plugins/alerting/public/pages/maintenance_windows/components/create_maintenance_windows_form.test.tsx index 3fea6d6611f08..a354e47975baf 100644 --- a/x-pack/plugins/alerting/public/pages/maintenance_windows/components/create_maintenance_windows_form.test.tsx +++ b/x-pack/plugins/alerting/public/pages/maintenance_windows/components/create_maintenance_windows_form.test.tsx @@ -131,7 +131,9 @@ describe('CreateMaintenanceWindowForm', () => { 'Press the down key to open a popover containing a calendar.' ); const recurringInput = within(result.getByTestId('recurring-field')).getByTestId('input'); - const timezoneInput = within(result.getByTestId('timezone-field')).getByTestId('input'); + const timezoneInput = within(result.getByTestId('timezone-field')).getByTestId( + 'comboBoxSearchInput' + ); await waitFor(() => { expect( @@ -156,7 +158,7 @@ describe('CreateMaintenanceWindowForm', () => { expect(dateInputs[0]).toHaveValue('03/23/2023 09:00 PM'); expect(dateInputs[1]).toHaveValue('03/25/2023 09:00 PM'); expect(recurringInput).toBeChecked(); - expect(timezoneInput).toHaveTextContent('America/Los_Angeles'); + expect(timezoneInput).toHaveValue('America/Los_Angeles'); }); it('should initialize MWs without category ids properly', async () => { diff --git a/x-pack/plugins/alerting/public/pages/maintenance_windows/components/recurring_schedule_form/recurring_schedule.test.tsx b/x-pack/plugins/alerting/public/pages/maintenance_windows/components/recurring_schedule_form/recurring_schedule.test.tsx index 6422d285db7ef..76390aea7ef18 100644 --- a/x-pack/plugins/alerting/public/pages/maintenance_windows/components/recurring_schedule_form/recurring_schedule.test.tsx +++ b/x-pack/plugins/alerting/public/pages/maintenance_windows/components/recurring_schedule_form/recurring_schedule.test.tsx @@ -94,7 +94,7 @@ describe('RecurringSchedule', () => { const endsInput = within(result.getByTestId('ends-field')).getByTestId('never'); expect(frequencyInput).toHaveValue('3'); - expect(endsInput).toBeChecked(); + expect(endsInput).toHaveAttribute('aria-pressed', 'true'); }); it('should prefill the form when provided with initialValue', () => { @@ -119,7 +119,7 @@ describe('RecurringSchedule', () => { 'Press the down key to open a popover containing a calendar.' ); expect(frequencyInput).toHaveValue('1'); - expect(endsInput).toBeChecked(); + expect(endsInput).toHaveAttribute('aria-pressed', 'true'); expect(untilInput).toHaveValue('03/24/2023'); }); }); diff --git a/x-pack/plugins/alerting/server/application/rule/methods/aggregate/aggregate_rules.test.ts b/x-pack/plugins/alerting/server/application/rule/methods/aggregate/aggregate_rules.test.ts index 31df2212bb5b5..d230f18f7ea60 100644 --- a/x-pack/plugins/alerting/server/application/rule/methods/aggregate/aggregate_rules.test.ts +++ b/x-pack/plugins/alerting/server/application/rule/methods/aggregate/aggregate_rules.test.ts @@ -26,6 +26,7 @@ import { fromKueryExpression, nodeTypes } from '@kbn/es-query'; import { RecoveredActionGroup } from '../../../../../common'; import { DefaultRuleAggregationResult } from '../../../../routes/rule/apis/aggregate/types'; import { defaultRuleAggregationFactory } from '.'; +import { RULE_SAVED_OBJECT_TYPE } from '../../../../saved_objects'; const taskManager = taskManagerMock.createStart(); const ruleTypeRegistry = ruleTypeRegistryMock.create(); @@ -289,7 +290,7 @@ describe('aggregate()', () => { filter: undefined, page: 1, perPage: 0, - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, aggs: { status: { terms: { field: 'alert.attributes.executionStatus.status' }, @@ -350,7 +351,7 @@ describe('aggregate()', () => { ]), page: 1, perPage: 0, - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, aggs: { status: { terms: { field: 'alert.attributes.executionStatus.status' }, diff --git a/x-pack/plugins/alerting/server/application/rule/methods/bulk_delete/bulk_delete_rules.test.ts b/x-pack/plugins/alerting/server/application/rule/methods/bulk_delete/bulk_delete_rules.test.ts index d5f18db2f1065..c3cbfd340984c 100644 --- a/x-pack/plugins/alerting/server/application/rule/methods/bulk_delete/bulk_delete_rules.test.ts +++ b/x-pack/plugins/alerting/server/application/rule/methods/bulk_delete/bulk_delete_rules.test.ts @@ -30,6 +30,7 @@ import { siemRuleForBulkOps1, } from '../../../../rules_client/tests/test_helpers'; import { migrateLegacyActions } from '../../../../rules_client/lib'; +import { RULE_SAVED_OBJECT_TYPE } from '../../../../saved_objects'; jest.mock('../../../../rules_client/lib/siem_legacy_actions/migrate_legacy_actions', () => { return { @@ -85,7 +86,7 @@ const rulesClientParams: jest.Mocked = { const getBulkOperationStatusErrorResponse = (statusCode: number) => ({ id: 'id2', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, success: false, error: { error: '', @@ -164,9 +165,9 @@ describe('bulkDelete', () => { test('should try to delete rules, two successful and one with 500 error', async () => { unsecuredSavedObjectsClient.bulkDelete.mockResolvedValue({ statuses: [ - { id: 'id1', type: 'alert', success: true }, + { id: 'id1', type: RULE_SAVED_OBJECT_TYPE, success: true }, getBulkOperationStatusErrorResponse(500), - { id: 'id3', type: 'alert', success: true }, + { id: 'id3', type: RULE_SAVED_OBJECT_TYPE, success: true }, ], }); @@ -176,7 +177,7 @@ describe('bulkDelete', () => { expect(unsecuredSavedObjectsClient.bulkDelete).toHaveBeenCalledWith( [enabledRuleForBulkOps1, enabledRuleForBulkOps2, enabledRuleForBulkOps3].map(({ id }) => ({ id, - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, })), undefined ); @@ -201,7 +202,7 @@ describe('bulkDelete', () => { unsecuredSavedObjectsClient.bulkDelete .mockResolvedValueOnce({ statuses: [ - { id: 'id1', type: 'alert', success: true }, + { id: 'id1', type: RULE_SAVED_OBJECT_TYPE, success: true }, getBulkOperationStatusErrorResponse(409), ], }) @@ -265,7 +266,7 @@ describe('bulkDelete', () => { unsecuredSavedObjectsClient.bulkDelete .mockResolvedValueOnce({ statuses: [ - { id: 'id1', type: 'alert', success: true }, + { id: 'id1', type: RULE_SAVED_OBJECT_TYPE, success: true }, getBulkOperationStatusErrorResponse(409), ], }) @@ -273,7 +274,7 @@ describe('bulkDelete', () => { statuses: [ { id: 'id2', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, success: true, }, ], @@ -356,9 +357,9 @@ describe('bulkDelete', () => { test('should not mark API keys for invalidation if the user is authenticated using an api key', async () => { unsecuredSavedObjectsClient.bulkDelete.mockResolvedValue({ statuses: [ - { id: 'id3', type: 'alert', success: true }, - { id: 'id1', type: 'alert', success: true }, - { id: 'id2', type: 'alert', success: true }, + { id: 'id3', type: RULE_SAVED_OBJECT_TYPE, success: true }, + { id: 'id1', type: RULE_SAVED_OBJECT_TYPE, success: true }, + { id: 'id2', type: RULE_SAVED_OBJECT_TYPE, success: true }, ], }); @@ -376,15 +377,15 @@ describe('bulkDelete', () => { test('should return task id if deleting task failed', async () => { unsecuredSavedObjectsClient.bulkDelete.mockResolvedValue({ statuses: [ - { id: 'id1', type: 'alert', success: true }, - { id: 'id2', type: 'alert', success: true }, + { id: 'id1', type: RULE_SAVED_OBJECT_TYPE, success: true }, + { id: 'id2', type: RULE_SAVED_OBJECT_TYPE, success: true }, ], }); taskManager.bulkRemove.mockImplementation(async () => ({ statuses: [ { id: 'id1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, success: true, }, getBulkOperationStatusErrorResponse(500), @@ -404,8 +405,8 @@ describe('bulkDelete', () => { test('should not throw an error if taskManager throw an error', async () => { unsecuredSavedObjectsClient.bulkDelete.mockResolvedValue({ statuses: [ - { id: 'id1', type: 'alert', success: true }, - { id: 'id2', type: 'alert', success: true }, + { id: 'id1', type: RULE_SAVED_OBJECT_TYPE, success: true }, + { id: 'id2', type: RULE_SAVED_OBJECT_TYPE, success: true }, ], }); taskManager.bulkRemove.mockImplementation(() => { @@ -424,20 +425,20 @@ describe('bulkDelete', () => { mockCreatePointInTimeFinderAsInternalUser(); unsecuredSavedObjectsClient.bulkDelete.mockResolvedValue({ statuses: [ - { id: 'id1', type: 'alert', success: true }, - { id: 'id2', type: 'alert', success: true }, + { id: 'id1', type: RULE_SAVED_OBJECT_TYPE, success: true }, + { id: 'id2', type: RULE_SAVED_OBJECT_TYPE, success: true }, ], }); taskManager.bulkRemove.mockImplementation(async () => ({ statuses: [ { id: 'id1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, success: true, }, { id: 'id2', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, success: true, }, ], @@ -468,9 +469,9 @@ describe('bulkDelete', () => { unsecuredSavedObjectsClient.bulkDelete.mockResolvedValue({ statuses: [ - { id: enabledRuleForBulkOps1.id, type: 'alert', success: true }, - { id: enabledRuleForBulkOps2.id, type: 'alert', success: true }, - { id: siemRuleForBulkOps1.id, type: 'alert', success: true }, + { id: enabledRuleForBulkOps1.id, type: RULE_SAVED_OBJECT_TYPE, success: true }, + { id: enabledRuleForBulkOps2.id, type: RULE_SAVED_OBJECT_TYPE, success: true }, + { id: siemRuleForBulkOps1.id, type: RULE_SAVED_OBJECT_TYPE, success: true }, ], }); @@ -501,8 +502,8 @@ describe('bulkDelete', () => { test('logs audit event when deleting rules', async () => { unsecuredSavedObjectsClient.bulkDelete.mockResolvedValue({ statuses: [ - { id: 'id1', type: 'alert', success: true }, - { id: 'id2', type: 'alert', success: true }, + { id: 'id1', type: RULE_SAVED_OBJECT_TYPE, success: true }, + { id: 'id2', type: RULE_SAVED_OBJECT_TYPE, success: true }, ], }); @@ -511,12 +512,12 @@ describe('bulkDelete', () => { expect(auditLogger.log.mock.calls[0][0]?.event?.action).toEqual('rule_delete'); expect(auditLogger.log.mock.calls[0][0]?.event?.outcome).toEqual('unknown'); expect(auditLogger.log.mock.calls[0][0]?.kibana).toEqual({ - saved_object: { id: 'id1', type: 'alert' }, + saved_object: { id: 'id1', type: RULE_SAVED_OBJECT_TYPE }, }); expect(auditLogger.log.mock.calls[1][0]?.event?.action).toEqual('rule_delete'); expect(auditLogger.log.mock.calls[1][0]?.event?.outcome).toEqual('unknown'); expect(auditLogger.log.mock.calls[1][0]?.kibana).toEqual({ - saved_object: { id: 'id2', type: 'alert' }, + saved_object: { id: 'id2', type: RULE_SAVED_OBJECT_TYPE }, }); }); @@ -525,7 +526,7 @@ describe('bulkDelete', () => { throw new Error('Unauthorized'); }); unsecuredSavedObjectsClient.bulkDelete.mockResolvedValue({ - statuses: [{ id: 'id1', type: 'alert', success: true }], + statuses: [{ id: 'id1', type: RULE_SAVED_OBJECT_TYPE, success: true }], }); await expect(rulesClient.bulkDeleteRules({ filter: 'fake_filter' })).rejects.toThrowError( @@ -541,7 +542,7 @@ describe('bulkDelete', () => { throw new Error('Error'); }); unsecuredSavedObjectsClient.bulkDelete.mockResolvedValue({ - statuses: [{ id: 'id1', type: 'alert', success: true }], + statuses: [{ id: 'id1', type: RULE_SAVED_OBJECT_TYPE, success: true }], }); await expect(rulesClient.bulkDeleteRules({ filter: 'fake_filter' })).rejects.toThrowError( diff --git a/x-pack/plugins/alerting/server/application/rule/methods/bulk_delete/bulk_delete_rules.ts b/x-pack/plugins/alerting/server/application/rule/methods/bulk_delete/bulk_delete_rules.ts index 33da0fd6b2e07..429afed34926c 100644 --- a/x-pack/plugins/alerting/server/application/rule/methods/bulk_delete/bulk_delete_rules.ts +++ b/x-pack/plugins/alerting/server/application/rule/methods/bulk_delete/bulk_delete_rules.ts @@ -9,6 +9,7 @@ import Boom from '@hapi/boom'; import { KueryNode, nodeBuilder } from '@kbn/es-query'; import { SavedObjectsBulkUpdateObject } from '@kbn/core/server'; import { withSpan } from '@kbn/apm-utils'; +import { RULE_SAVED_OBJECT_TYPE } from '../../../../saved_objects'; import { convertRuleIdsToKueryNode } from '../../../../lib'; import { bulkMarkApiKeysForInvalidation } from '../../../../invalidate_pending_api_keys/bulk_mark_api_keys_for_invalidation'; import { ruleAuditEvent, RuleAuditAction } from '../../../../rules_client/common/audit_events'; @@ -136,7 +137,7 @@ const bulkDeleteWithOCC = async ( context.encryptedSavedObjectsClient.createPointInTimeFinderDecryptedAsInternalUser( { filter, - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, perPage: 100, ...(context.namespace ? { namespaces: [context.namespace] } : undefined), } @@ -168,7 +169,7 @@ const bulkDeleteWithOCC = async ( ruleAuditEvent({ action: RuleAuditAction.DELETE, outcome: 'unknown', - savedObject: { type: 'alert', id: rule.id }, + savedObject: { type: RULE_SAVED_OBJECT_TYPE, id: rule.id }, }) ); } diff --git a/x-pack/plugins/alerting/server/application/rule/methods/bulk_disable/bulk_disable_rules.test.ts b/x-pack/plugins/alerting/server/application/rule/methods/bulk_disable/bulk_disable_rules.test.ts index f7e8eff33591f..2b7c72fd4c51b 100644 --- a/x-pack/plugins/alerting/server/application/rule/methods/bulk_disable/bulk_disable_rules.test.ts +++ b/x-pack/plugins/alerting/server/application/rule/methods/bulk_disable/bulk_disable_rules.test.ts @@ -35,6 +35,7 @@ import { siemRuleForBulkOps2, } from '../../../../rules_client/tests/test_helpers'; import { migrateLegacyActions } from '../../../../rules_client/lib'; +import { RULE_SAVED_OBJECT_TYPE } from '../../../../saved_objects'; jest.mock('../../../../task_runner/alert_task_instance', () => ({ taskInstanceToAlertTaskInstance: jest.fn(), @@ -428,8 +429,8 @@ describe('bulkDisableRules', () => { taskManager.bulkRemove.mockResolvedValue({ statuses: [ - { id: 'id1', type: 'alert', success: true }, - { id: 'id2', type: 'alert', success: false }, + { id: 'id1', type: RULE_SAVED_OBJECT_TYPE, success: true }, + { id: 'id2', type: RULE_SAVED_OBJECT_TYPE, success: false }, ], }); @@ -543,12 +544,12 @@ describe('bulkDisableRules', () => { expect(auditLogger.log.mock.calls[0][0]?.event?.action).toEqual('rule_disable'); expect(auditLogger.log.mock.calls[0][0]?.event?.outcome).toEqual('unknown'); expect(auditLogger.log.mock.calls[0][0]?.kibana).toEqual({ - saved_object: { id: 'id1', type: 'alert' }, + saved_object: { id: 'id1', type: RULE_SAVED_OBJECT_TYPE }, }); expect(auditLogger.log.mock.calls[1][0]?.event?.action).toEqual('rule_disable'); expect(auditLogger.log.mock.calls[1][0]?.event?.outcome).toEqual('unknown'); expect(auditLogger.log.mock.calls[1][0]?.kibana).toEqual({ - saved_object: { id: 'id2', type: 'alert' }, + saved_object: { id: 'id2', type: RULE_SAVED_OBJECT_TYPE }, }); }); diff --git a/x-pack/plugins/alerting/server/application/rule/methods/bulk_disable/bulk_disable_rules.ts b/x-pack/plugins/alerting/server/application/rule/methods/bulk_disable/bulk_disable_rules.ts index e981a30181a49..0ac84ce2ef6d7 100644 --- a/x-pack/plugins/alerting/server/application/rule/methods/bulk_disable/bulk_disable_rules.ts +++ b/x-pack/plugins/alerting/server/application/rule/methods/bulk_disable/bulk_disable_rules.ts @@ -11,6 +11,7 @@ import { withSpan } from '@kbn/apm-utils'; import pMap from 'p-map'; import { Logger } from '@kbn/core/server'; import { TaskManagerStartContract } from '@kbn/task-manager-plugin/server'; +import { RULE_SAVED_OBJECT_TYPE } from '../../../../saved_objects'; import type { RawRule, SanitizedRule, RawRuleAction } from '../../../../types'; import { convertRuleIdsToKueryNode } from '../../../../lib'; import { ruleAuditEvent, RuleAuditAction } from '../../../../rules_client/common/audit_events'; @@ -132,7 +133,7 @@ const bulkDisableRulesWithOCC = async ( context.encryptedSavedObjectsClient.createPointInTimeFinderDecryptedAsInternalUser( { filter: filter ? nodeBuilder.and([filter, additionalFilter]) : additionalFilter, - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, perPage: 100, ...(context.namespace ? { namespaces: [context.namespace] } : undefined), } @@ -200,7 +201,7 @@ const bulkDisableRulesWithOCC = async ( ruleAuditEvent({ action: RuleAuditAction.DISABLE, outcome: 'unknown', - savedObject: { type: 'alert', id: rule.id }, + savedObject: { type: RULE_SAVED_OBJECT_TYPE, id: rule.id }, }) ); } catch (error) { diff --git a/x-pack/plugins/alerting/server/application/rule/methods/bulk_edit/bulk_edit_rules.test.ts b/x-pack/plugins/alerting/server/application/rule/methods/bulk_edit/bulk_edit_rules.test.ts index 38a04fbd76c76..dbd056bb1df30 100644 --- a/x-pack/plugins/alerting/server/application/rule/methods/bulk_edit/bulk_edit_rules.test.ts +++ b/x-pack/plugins/alerting/server/application/rule/methods/bulk_edit/bulk_edit_rules.test.ts @@ -35,6 +35,7 @@ import { } from '../../../../rules_client/tests/test_helpers'; import { migrateLegacyActions } from '../../../../rules_client/lib'; import { migrateLegacyActionsMock } from '../../../../rules_client/lib/siem_legacy_actions/retrieve_migrated_legacy_actions.mock'; +import { RULE_SAVED_OBJECT_TYPE } from '../../../../saved_objects'; jest.mock('../../../../rules_client/lib/siem_legacy_actions/migrate_legacy_actions', () => { return { @@ -121,7 +122,7 @@ describe('bulkEdit()', () => { let actionsClient: jest.Mocked; const existingRule = { id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { enabled: false, tags: ['foo'], @@ -269,7 +270,7 @@ describe('bulkEdit()', () => { saved_objects: [ { id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { enabled: true, tags: ['foo', 'test-1'], @@ -314,7 +315,7 @@ describe('bulkEdit()', () => { [ expect.objectContaining({ id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: expect.objectContaining({ tags: ['foo', 'test-1'], revision: 1, @@ -330,7 +331,7 @@ describe('bulkEdit()', () => { saved_objects: [ { id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { enabled: true, tags: [], @@ -371,7 +372,7 @@ describe('bulkEdit()', () => { [ expect.objectContaining({ id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: expect.objectContaining({ tags: [], revision: 1, @@ -387,7 +388,7 @@ describe('bulkEdit()', () => { saved_objects: [ { id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { enabled: true, tags: ['test-1', 'test-2'], @@ -429,7 +430,7 @@ describe('bulkEdit()', () => { [ expect.objectContaining({ id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: expect.objectContaining({ tags: ['test-1', 'test-2'], revision: 1, @@ -931,7 +932,7 @@ describe('bulkEdit()', () => { saved_objects: [ { id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { enabled: true, tags: ['foo'], @@ -982,7 +983,7 @@ describe('bulkEdit()', () => { [ expect.objectContaining({ id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: expect.objectContaining({ params: expect.objectContaining({ index: ['test-1', 'test-2', 'test-4', 'test-5'], @@ -1000,7 +1001,7 @@ describe('bulkEdit()', () => { saved_objects: [ { id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { enabled: true, tags: ['foo'], @@ -1046,7 +1047,7 @@ describe('bulkEdit()', () => { [ expect.objectContaining({ id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: expect.objectContaining({ params: expect.objectContaining({ index: ['test-1'], @@ -1104,7 +1105,7 @@ describe('bulkEdit()', () => { saved_objects: [ { id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { enabled: true, tags: ['foo', 'test-1'], @@ -1149,7 +1150,7 @@ describe('bulkEdit()', () => { [ expect.objectContaining({ id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: expect.objectContaining({ snoozeSchedule: [snoozePayload], revision: 0, @@ -1180,7 +1181,7 @@ describe('bulkEdit()', () => { [ expect.objectContaining({ id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: expect.objectContaining({ revision: 0, snoozeSchedule: [snoozePayload], @@ -1226,7 +1227,7 @@ describe('bulkEdit()', () => { [ expect.objectContaining({ id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: expect.objectContaining({ revision: 0, snoozeSchedule: [...existingSnooze, snoozePayload], @@ -1271,7 +1272,7 @@ describe('bulkEdit()', () => { [ expect.objectContaining({ id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: expect.objectContaining({ muteAll: true, revision: 0, @@ -1316,7 +1317,7 @@ describe('bulkEdit()', () => { [ expect.objectContaining({ id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: expect.objectContaining({ revision: 0, snoozeSchedule: [existingSnooze[1], existingSnooze[2]], @@ -1361,7 +1362,7 @@ describe('bulkEdit()', () => { [ expect.objectContaining({ id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: expect.objectContaining({ revision: 0, snoozeSchedule: [], @@ -1406,7 +1407,7 @@ describe('bulkEdit()', () => { [ expect.objectContaining({ id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: expect.objectContaining({ revision: 0, snoozeSchedule: [existingSnooze[0]], @@ -1525,7 +1526,7 @@ describe('bulkEdit()', () => { saved_objects: [ { id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { enabled: true, tags: ['foo', 'test-1'], @@ -1578,7 +1579,7 @@ describe('bulkEdit()', () => { [ expect.objectContaining({ id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: expect.objectContaining({ tags: ['foo', 'test-1'], params: { @@ -1597,7 +1598,7 @@ describe('bulkEdit()', () => { saved_objects: [ { id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { enabled: true, tags: ['foo', 'test-1'], @@ -1651,7 +1652,7 @@ describe('bulkEdit()', () => { [ expect.objectContaining({ id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: expect.objectContaining({ tags: ['foo', 'test-1'], params: { @@ -1670,7 +1671,7 @@ describe('bulkEdit()', () => { saved_objects: [ { id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { enabled: true, tags: ['foo'], @@ -1724,7 +1725,7 @@ describe('bulkEdit()', () => { [ expect.objectContaining({ id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: expect.objectContaining({ tags: ['foo'], params: { @@ -1814,7 +1815,7 @@ describe('bulkEdit()', () => { }, page: 1, perPage: 0, - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, }); }); test('should call unsecuredSavedObjectsClient.find for aggregations when called with ids options', async () => { @@ -1884,7 +1885,7 @@ describe('bulkEdit()', () => { }, page: 1, perPage: 0, - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, }); }); test('should throw if number of matched rules greater than 10_000', async () => { @@ -2032,7 +2033,7 @@ describe('bulkEdit()', () => { type: 'function', }, perPage: 100, - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, namespaces: ['default'], }); }); @@ -2087,7 +2088,7 @@ describe('bulkEdit()', () => { saved_objects: [ { id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { enabled: true, tags: ['foo'], @@ -2228,7 +2229,7 @@ describe('bulkEdit()', () => { saved_objects: [ { id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { enabled: true, tags: ['foo'], @@ -2489,7 +2490,7 @@ describe('bulkEdit()', () => { saved_objects: [ { id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { enabled: true, tags: ['foo', 'test-1'], @@ -2551,7 +2552,7 @@ describe('bulkEdit()', () => { saved_objects: [ { id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { enabled: true, tags: ['foo'], @@ -2593,7 +2594,7 @@ describe('bulkEdit()', () => { [ expect.objectContaining({ id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: expect.objectContaining({ params: expect.objectContaining({ index: ['test-index-*'], @@ -2632,7 +2633,7 @@ describe('bulkEdit()', () => { saved_objects: [ { id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { enabled: true, tags: ['foo'], @@ -2675,7 +2676,7 @@ describe('bulkEdit()', () => { saved_objects: [ { id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { enabled: true, tags: ['foo'], diff --git a/x-pack/plugins/alerting/server/application/rule/methods/bulk_edit/bulk_edit_rules.ts b/x-pack/plugins/alerting/server/application/rule/methods/bulk_edit/bulk_edit_rules.ts index 996f67448c7f8..d9ff12bf9d3f3 100644 --- a/x-pack/plugins/alerting/server/application/rule/methods/bulk_edit/bulk_edit_rules.ts +++ b/x-pack/plugins/alerting/server/application/rule/methods/bulk_edit/bulk_edit_rules.ts @@ -15,6 +15,7 @@ import { SavedObjectsFindResult, SavedObjectsUpdateResponse, } from '@kbn/core/server'; +import { RULE_SAVED_OBJECT_TYPE } from '../../../../saved_objects'; import { BulkActionSkipResult } from '../../../../../common/bulk_edit'; import { RuleTypeRegistry } from '../../../../types'; import { @@ -279,7 +280,7 @@ async function bulkEditRulesOcc( await context.encryptedSavedObjectsClient.createPointInTimeFinderDecryptedAsInternalUser( { filter, - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, perPage: 100, ...(context.namespace ? { namespaces: [context.namespace] } : undefined), } diff --git a/x-pack/plugins/alerting/server/application/rule/methods/create/create_rule.test.ts b/x-pack/plugins/alerting/server/application/rule/methods/create/create_rule.test.ts index 4fcb2b0d55716..ca2ccc98ea292 100644 --- a/x-pack/plugins/alerting/server/application/rule/methods/create/create_rule.test.ts +++ b/x-pack/plugins/alerting/server/application/rule/methods/create/create_rule.test.ts @@ -27,6 +27,7 @@ import { getBeforeSetup, setGlobalDate } from '../../../../rules_client/tests/li import { RecoveredActionGroup } from '../../../../../common'; import { bulkMarkApiKeysForInvalidation } from '../../../../invalidate_pending_api_keys/bulk_mark_api_keys_for_invalidation'; import { getRuleExecutionStatusPending, getDefaultMonitoring } from '../../../../lib'; +import { RULE_SAVED_OBJECT_TYPE } from '../../../../saved_objects'; jest.mock('../../../../invalidate_pending_api_keys/bulk_mark_api_keys_for_invalidation', () => ({ bulkMarkApiKeysForInvalidation: jest.fn(), @@ -174,7 +175,7 @@ describe('create()', () => { ): Promise { unsecuredSavedObjectsClient.create.mockResolvedValueOnce({ id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { alertTypeId: '123', schedule: { interval: '1m' }, @@ -206,7 +207,7 @@ describe('create()', () => { }); unsecuredSavedObjectsClient.create.mockResolvedValueOnce({ id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { actions: [], scheduledTaskId: 'task-123', @@ -270,7 +271,7 @@ describe('create()', () => { }); unsecuredSavedObjectsClient.create.mockResolvedValueOnce({ id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { ...data, executionStatus: getRuleExecutionStatusPending('2019-02-12T21:01:22.479Z'), @@ -285,7 +286,7 @@ describe('create()', () => { action: 'rule_create', outcome: 'unknown', }), - kibana: { saved_object: { id: 'mock-saved-object-id', type: 'alert' } }, + kibana: { saved_object: { id: 'mock-saved-object-id', type: RULE_SAVED_OBJECT_TYPE } }, }) ); }); @@ -310,7 +311,7 @@ describe('create()', () => { kibana: { saved_object: { id: 'mock-saved-object-id', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, }, }, error: { @@ -351,7 +352,7 @@ describe('create()', () => { }; unsecuredSavedObjectsClient.create.mockResolvedValueOnce({ id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { ...createdAttributes, running: false, @@ -367,7 +368,7 @@ describe('create()', () => { }); unsecuredSavedObjectsClient.create.mockResolvedValueOnce({ id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { ...createdAttributes, running: false, @@ -433,7 +434,7 @@ describe('create()', () => { `); expect(unsecuredSavedObjectsClient.create).toHaveBeenCalledTimes(1); expect(unsecuredSavedObjectsClient.create.mock.calls[0]).toHaveLength(3); - expect(unsecuredSavedObjectsClient.create.mock.calls[0][0]).toEqual('alert'); + expect(unsecuredSavedObjectsClient.create.mock.calls[0][0]).toEqual(RULE_SAVED_OBJECT_TYPE); expect(unsecuredSavedObjectsClient.create.mock.calls[0][1]).toMatchInlineSnapshot(` Object { "actions": Array [ @@ -543,7 +544,7 @@ describe('create()', () => { `); expect(unsecuredSavedObjectsClient.update).toHaveBeenCalledTimes(1); expect(unsecuredSavedObjectsClient.update.mock.calls[0]).toHaveLength(4); - expect(unsecuredSavedObjectsClient.update.mock.calls[0][0]).toEqual('alert'); + expect(unsecuredSavedObjectsClient.update.mock.calls[0][0]).toEqual(RULE_SAVED_OBJECT_TYPE); expect(unsecuredSavedObjectsClient.update.mock.calls[0][1]).toEqual('1'); expect(unsecuredSavedObjectsClient.update.mock.calls[0][2]).toMatchInlineSnapshot(` Object { @@ -582,7 +583,7 @@ describe('create()', () => { }; unsecuredSavedObjectsClient.create.mockResolvedValueOnce({ id: '123', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { ...createdAttributes, running: false, @@ -646,7 +647,7 @@ describe('create()', () => { }; unsecuredSavedObjectsClient.create.mockResolvedValueOnce({ id: '123', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { ...createdAttributes, running: false, @@ -798,7 +799,7 @@ describe('create()', () => { ]); unsecuredSavedObjectsClient.create.mockResolvedValueOnce({ id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { running: false, executionStatus: getRuleExecutionStatusPending('2019-02-12T21:01:22.479Z'), @@ -857,7 +858,7 @@ describe('create()', () => { }); unsecuredSavedObjectsClient.create.mockResolvedValueOnce({ id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { actions: [], scheduledTaskId: 'task-123', @@ -1000,7 +1001,7 @@ describe('create()', () => { actionsClient.isPreconfigured.mockReturnValueOnce(false); unsecuredSavedObjectsClient.create.mockResolvedValueOnce({ id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { executionStatus: getRuleExecutionStatusPending('2019-02-12T21:01:22.479Z'), alertTypeId: '123', @@ -1054,7 +1055,7 @@ describe('create()', () => { }); unsecuredSavedObjectsClient.create.mockResolvedValueOnce({ id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { actions: [], scheduledTaskId: 'task-123', @@ -1110,7 +1111,7 @@ describe('create()', () => { } `); expect(unsecuredSavedObjectsClient.create).toHaveBeenCalledWith( - 'alert', + RULE_SAVED_OBJECT_TYPE, { actions: [ { @@ -1261,7 +1262,7 @@ describe('create()', () => { unsecuredSavedObjectsClient.create.mockResolvedValueOnce({ id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { executionStatus: getRuleExecutionStatusPending('2019-02-12T21:01:22.479Z'), alertTypeId: '123', @@ -1314,7 +1315,7 @@ describe('create()', () => { unsecuredSavedObjectsClient.create.mockResolvedValueOnce({ id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { actions: [], scheduledTaskId: 'task-123', @@ -1371,7 +1372,7 @@ describe('create()', () => { `); expect(unsecuredSavedObjectsClient.create).toHaveBeenCalledWith( - 'alert', + RULE_SAVED_OBJECT_TYPE, { actions: [ { @@ -1444,7 +1445,7 @@ describe('create()', () => { const data = getMockData({ enabled: false }); unsecuredSavedObjectsClient.create.mockResolvedValueOnce({ id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { enabled: false, alertTypeId: '123', @@ -1561,7 +1562,7 @@ describe('create()', () => { }); unsecuredSavedObjectsClient.create.mockResolvedValueOnce({ id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { alertTypeId: '123', schedule: { interval: '1m' }, @@ -1600,7 +1601,7 @@ describe('create()', () => { }); unsecuredSavedObjectsClient.create.mockResolvedValueOnce({ id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { actions: [], scheduledTaskId: 'task-123', @@ -1611,7 +1612,7 @@ describe('create()', () => { expect(extractReferencesFn).toHaveBeenCalledWith(ruleParams); expect(unsecuredSavedObjectsClient.create).toHaveBeenCalledWith( - 'alert', + RULE_SAVED_OBJECT_TYPE, { actions: [ { @@ -1750,7 +1751,7 @@ describe('create()', () => { }); unsecuredSavedObjectsClient.create.mockResolvedValueOnce({ id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { alertTypeId: '123', schedule: { interval: '1m' }, @@ -1789,7 +1790,7 @@ describe('create()', () => { }); unsecuredSavedObjectsClient.create.mockResolvedValueOnce({ id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { actions: [], scheduledTaskId: 'task-123', @@ -1800,7 +1801,7 @@ describe('create()', () => { expect(extractReferencesFn).toHaveBeenCalledWith(ruleParams); expect(unsecuredSavedObjectsClient.create).toHaveBeenCalledWith( - 'alert', + RULE_SAVED_OBJECT_TYPE, { actions: [ { @@ -1894,7 +1895,7 @@ describe('create()', () => { const data = getMockData({ name: ' my alert name ' }); unsecuredSavedObjectsClient.create.mockResolvedValueOnce({ id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { enabled: false, name: ' my alert name ', @@ -1963,7 +1964,7 @@ describe('create()', () => { }; unsecuredSavedObjectsClient.create.mockResolvedValueOnce({ id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: createdAttributes, references: [ { @@ -1975,7 +1976,7 @@ describe('create()', () => { }); const result = await rulesClient.create({ data }); expect(unsecuredSavedObjectsClient.create).toHaveBeenCalledWith( - 'alert', + RULE_SAVED_OBJECT_TYPE, { actions: [ { @@ -2104,7 +2105,7 @@ describe('create()', () => { }; unsecuredSavedObjectsClient.create.mockResolvedValueOnce({ id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: createdAttributes, references: [ { @@ -2116,7 +2117,7 @@ describe('create()', () => { }); const result = await rulesClient.create({ data }); expect(unsecuredSavedObjectsClient.create).toHaveBeenCalledWith( - 'alert', + RULE_SAVED_OBJECT_TYPE, { actions: [ { @@ -2245,7 +2246,7 @@ describe('create()', () => { }; unsecuredSavedObjectsClient.create.mockResolvedValueOnce({ id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: createdAttributes, references: [ { @@ -2257,7 +2258,7 @@ describe('create()', () => { }); const result = await rulesClient.create({ data }); expect(unsecuredSavedObjectsClient.create).toHaveBeenCalledWith( - 'alert', + RULE_SAVED_OBJECT_TYPE, { actions: [ { @@ -2394,7 +2395,7 @@ describe('create()', () => { }; unsecuredSavedObjectsClient.create.mockResolvedValueOnce({ id: '123', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: createdAttributes, references: [ { @@ -2408,7 +2409,7 @@ describe('create()', () => { const result = await rulesClient.create({ data }); expect(unsecuredSavedObjectsClient.create).toHaveBeenCalledWith( - 'alert', + RULE_SAVED_OBJECT_TYPE, { enabled: true, name: 'abc', @@ -2607,7 +2608,7 @@ describe('create()', () => { const data = getMockData(); unsecuredSavedObjectsClient.create.mockResolvedValueOnce({ id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { alertTypeId: '123', schedule: { interval: '1m' }, @@ -2656,7 +2657,7 @@ describe('create()', () => { const data = getMockData(); unsecuredSavedObjectsClient.create.mockResolvedValueOnce({ id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { alertTypeId: '123', schedule: { interval: '1m' }, @@ -2703,7 +2704,7 @@ describe('create()', () => { const data = getMockData(); unsecuredSavedObjectsClient.create.mockResolvedValueOnce({ id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { alertTypeId: '123', schedule: { interval: '1m' }, @@ -2761,7 +2762,7 @@ describe('create()', () => { }); unsecuredSavedObjectsClient.create.mockResolvedValueOnce({ id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { alertTypeId: '123', schedule: { interval: '1m' }, @@ -2791,7 +2792,7 @@ describe('create()', () => { }); unsecuredSavedObjectsClient.create.mockResolvedValueOnce({ id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { actions: [], scheduledTaskId: 'task-123', @@ -2808,7 +2809,7 @@ describe('create()', () => { expect(rulesClientParams.createAPIKey).toHaveBeenCalledTimes(1); expect(unsecuredSavedObjectsClient.create).toHaveBeenCalledWith( - 'alert', + RULE_SAVED_OBJECT_TYPE, { actions: [ { @@ -2866,7 +2867,7 @@ describe('create()', () => { const data = getMockData({ enabled: false }); unsecuredSavedObjectsClient.create.mockResolvedValueOnce({ id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { alertTypeId: '123', schedule: { interval: '1m' }, @@ -2896,7 +2897,7 @@ describe('create()', () => { }); unsecuredSavedObjectsClient.create.mockResolvedValueOnce({ id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { actions: [], scheduledTaskId: 'task-123', @@ -2913,7 +2914,7 @@ describe('create()', () => { expect(rulesClientParams.createAPIKey).not.toHaveBeenCalled(); expect(unsecuredSavedObjectsClient.create).toHaveBeenCalledWith( - 'alert', + RULE_SAVED_OBJECT_TYPE, { actions: [ { @@ -3070,7 +3071,7 @@ describe('create()', () => { }; unsecuredSavedObjectsClient.create.mockResolvedValueOnce({ id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: createdAttributes, references: [ { @@ -3534,7 +3535,7 @@ describe('create()', () => { ]); unsecuredSavedObjectsClient.create.mockResolvedValueOnce({ id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { alertTypeId: '123', schedule: { interval: '1m' }, @@ -3576,7 +3577,7 @@ describe('create()', () => { }); unsecuredSavedObjectsClient.create.mockResolvedValueOnce({ id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { actions: [], scheduledTaskId: 'task-123', @@ -3744,7 +3745,7 @@ describe('create()', () => { rulesClientParams.isAuthenticationTypeAPIKey.mockReturnValueOnce(true); unsecuredSavedObjectsClient.create.mockResolvedValueOnce({ id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { alertTypeId: '123', schedule: { interval: '1m' }, @@ -3774,7 +3775,7 @@ describe('create()', () => { }); unsecuredSavedObjectsClient.create.mockResolvedValueOnce({ id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { actions: [], scheduledTaskId: 'task-123', @@ -3792,7 +3793,7 @@ describe('create()', () => { expect(rulesClientParams.isAuthenticationTypeAPIKey).toHaveBeenCalledTimes(1); expect(rulesClientParams.getAuthenticationAPIKey).toHaveBeenCalledTimes(1); expect(unsecuredSavedObjectsClient.create).toHaveBeenCalledWith( - 'alert', + RULE_SAVED_OBJECT_TYPE, { actions: [ { diff --git a/x-pack/plugins/alerting/server/application/rule/methods/create/create_rule.ts b/x-pack/plugins/alerting/server/application/rule/methods/create/create_rule.ts index 74dd0775d0c22..bdd11da2483f7 100644 --- a/x-pack/plugins/alerting/server/application/rule/methods/create/create_rule.ts +++ b/x-pack/plugins/alerting/server/application/rule/methods/create/create_rule.ts @@ -8,6 +8,7 @@ import Semver from 'semver'; import Boom from '@hapi/boom'; import { SavedObject, SavedObjectsUtils } from '@kbn/core/server'; import { withSpan } from '@kbn/apm-utils'; +import { RULE_SAVED_OBJECT_TYPE } from '../../../../saved_objects'; import { parseDuration, getRuleCircuitBreakerErrorMessage } from '../../../../../common'; import { WriteOperations, AlertingAuthorizationEntity } from '../../../../authorization'; import { @@ -101,7 +102,7 @@ export async function createRule( context.auditLogger?.log( ruleAuditEvent({ action: RuleAuditAction.CREATE, - savedObject: { type: 'alert', id }, + savedObject: { type: RULE_SAVED_OBJECT_TYPE, id }, error, }) ); diff --git a/x-pack/plugins/alerting/server/application/rule/methods/get_schedule_frequency/get_schedule_frequency.ts b/x-pack/plugins/alerting/server/application/rule/methods/get_schedule_frequency/get_schedule_frequency.ts index b670adeccae8a..d30d172113248 100644 --- a/x-pack/plugins/alerting/server/application/rule/methods/get_schedule_frequency/get_schedule_frequency.ts +++ b/x-pack/plugins/alerting/server/application/rule/methods/get_schedule_frequency/get_schedule_frequency.ts @@ -4,6 +4,7 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ +import { RULE_SAVED_OBJECT_TYPE } from '../../../../saved_objects'; import { RulesClientContext } from '../../../../rules_client/types'; import { RuleDomain } from '../../types'; import { convertDurationToFrequency } from '../../../../../common/parse_duration'; @@ -41,7 +42,7 @@ export const getScheduleFrequency = async ( RuleDomain, SchedulesIntervalAggregationResult >({ - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, filter: 'alert.attributes.enabled: true', namespaces: ['*'], aggs: { diff --git a/x-pack/plugins/alerting/server/application/rule/methods/mute_alert/mute_instance.ts b/x-pack/plugins/alerting/server/application/rule/methods/mute_alert/mute_instance.ts index 8adbdf7ae58c9..5758794b550fb 100644 --- a/x-pack/plugins/alerting/server/application/rule/methods/mute_alert/mute_instance.ts +++ b/x-pack/plugins/alerting/server/application/rule/methods/mute_alert/mute_instance.ts @@ -6,6 +6,7 @@ */ import Boom from '@hapi/boom'; +import { RULE_SAVED_OBJECT_TYPE } from '../../../../saved_objects'; import { updateRuleSo } from '../../../../data/rule/methods/update_rule_so'; import { muteAlertParamsSchema } from './schemas'; import type { MuteAlertParams } from './types'; @@ -38,7 +39,7 @@ async function muteInstanceWithOCC( { alertId, alertInstanceId }: MuteAlertParams ) { const { attributes, version } = await context.unsecuredSavedObjectsClient.get( - 'alert', + RULE_SAVED_OBJECT_TYPE, alertId ); @@ -57,7 +58,7 @@ async function muteInstanceWithOCC( context.auditLogger?.log( ruleAuditEvent({ action: RuleAuditAction.MUTE_ALERT, - savedObject: { type: 'alert', id: alertId }, + savedObject: { type: RULE_SAVED_OBJECT_TYPE, id: alertId }, error, }) ); @@ -68,7 +69,7 @@ async function muteInstanceWithOCC( ruleAuditEvent({ action: RuleAuditAction.MUTE_ALERT, outcome: 'unknown', - savedObject: { type: 'alert', id: alertId }, + savedObject: { type: RULE_SAVED_OBJECT_TYPE, id: alertId }, }) ); diff --git a/x-pack/plugins/alerting/server/application/rule/methods/resolve/resolve_rule.ts b/x-pack/plugins/alerting/server/application/rule/methods/resolve/resolve_rule.ts index cbde52a44b1fe..de9f421a95924 100644 --- a/x-pack/plugins/alerting/server/application/rule/methods/resolve/resolve_rule.ts +++ b/x-pack/plugins/alerting/server/application/rule/methods/resolve/resolve_rule.ts @@ -7,6 +7,7 @@ import Boom from '@hapi/boom'; import { withSpan } from '@kbn/apm-utils'; import { AlertConsumers } from '@kbn/rule-data-utils'; +import { RULE_SAVED_OBJECT_TYPE } from '../../../../saved_objects'; import { resolveRuleSavedObject } from '../../../../rules_client/lib'; import { ruleAuditEvent, RuleAuditAction } from '../../../../rules_client/common/audit_events'; import { RuleTypeParams } from '../../../../types'; @@ -52,7 +53,7 @@ Promise> { context.auditLogger?.log( ruleAuditEvent({ action: RuleAuditAction.RESOLVE, - savedObject: { type: 'alert', id }, + savedObject: { type: RULE_SAVED_OBJECT_TYPE, id }, error, }) ); @@ -61,7 +62,7 @@ Promise> { context.auditLogger?.log( ruleAuditEvent({ action: RuleAuditAction.RESOLVE, - savedObject: { type: 'alert', id }, + savedObject: { type: RULE_SAVED_OBJECT_TYPE, id }, }) ); diff --git a/x-pack/plugins/alerting/server/application/rule/methods/snooze/snooze_rule.ts b/x-pack/plugins/alerting/server/application/rule/methods/snooze/snooze_rule.ts index b10df195e5b77..162fe98d31f04 100644 --- a/x-pack/plugins/alerting/server/application/rule/methods/snooze/snooze_rule.ts +++ b/x-pack/plugins/alerting/server/application/rule/methods/snooze/snooze_rule.ts @@ -7,6 +7,7 @@ import Boom from '@hapi/boom'; import { withSpan } from '@kbn/apm-utils'; +import { RULE_SAVED_OBJECT_TYPE } from '../../../../saved_objects'; import { getRuleSavedObject } from '../../../../rules_client/lib'; import { ruleAuditEvent, RuleAuditAction } from '../../../../rules_client/common/audit_events'; import { WriteOperations, AlertingAuthorizationEntity } from '../../../../authorization'; @@ -71,7 +72,7 @@ async function snoozeWithOCC( context.auditLogger?.log( ruleAuditEvent({ action: RuleAuditAction.SNOOZE, - savedObject: { type: 'alert', id }, + savedObject: { type: RULE_SAVED_OBJECT_TYPE, id }, error, }) ); @@ -82,7 +83,7 @@ async function snoozeWithOCC( ruleAuditEvent({ action: RuleAuditAction.SNOOZE, outcome: 'unknown', - savedObject: { type: 'alert', id }, + savedObject: { type: RULE_SAVED_OBJECT_TYPE, id }, }) ); diff --git a/x-pack/plugins/alerting/server/application/rule/methods/tags/get_rule_tags.test.ts b/x-pack/plugins/alerting/server/application/rule/methods/tags/get_rule_tags.test.ts index dd1f3150d0a08..28e9fc08c3b8a 100644 --- a/x-pack/plugins/alerting/server/application/rule/methods/tags/get_rule_tags.test.ts +++ b/x-pack/plugins/alerting/server/application/rule/methods/tags/get_rule_tags.test.ts @@ -22,6 +22,7 @@ import { auditLoggerMock } from '@kbn/security-plugin/server/audit/mocks'; import { getBeforeSetup } from '../../../../rules_client/tests/lib'; import { RecoveredActionGroup } from '../../../../../common'; import { RegistryRuleType } from '../../../../rule_type_registry'; +import { RULE_SAVED_OBJECT_TYPE } from '../../../../saved_objects'; const taskManager = taskManagerMock.createStart(); const ruleTypeRegistry = ruleTypeRegistryMock.create(); @@ -147,7 +148,7 @@ describe('getTags()', () => { tags: { terms: { field: 'alert.attributes.tags', order: { _key: 'asc' }, size: 10000 } }, }, filter: undefined, - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, }); expect(result.data).toEqual(['a', 'b', 'c']); diff --git a/x-pack/plugins/alerting/server/application/rule/methods/unsnooze/unsnooze_rule.ts b/x-pack/plugins/alerting/server/application/rule/methods/unsnooze/unsnooze_rule.ts index c47b39f28aedb..b5cb6f8f29e33 100644 --- a/x-pack/plugins/alerting/server/application/rule/methods/unsnooze/unsnooze_rule.ts +++ b/x-pack/plugins/alerting/server/application/rule/methods/unsnooze/unsnooze_rule.ts @@ -7,6 +7,7 @@ import Boom from '@hapi/boom'; import { withSpan } from '@kbn/apm-utils'; +import { RULE_SAVED_OBJECT_TYPE } from '../../../../saved_objects'; import { ruleAuditEvent, RuleAuditAction } from '../../../../rules_client/common/audit_events'; import { getRuleSavedObject } from '../../../../rules_client/lib'; import { WriteOperations, AlertingAuthorizationEntity } from '../../../../authorization'; @@ -62,7 +63,7 @@ async function unsnoozeWithOCC(context: RulesClientContext, { id, scheduleIds }: context.auditLogger?.log( ruleAuditEvent({ action: RuleAuditAction.UNSNOOZE, - savedObject: { type: 'alert', id }, + savedObject: { type: RULE_SAVED_OBJECT_TYPE, id }, error, }) ); @@ -73,7 +74,7 @@ async function unsnoozeWithOCC(context: RulesClientContext, { id, scheduleIds }: ruleAuditEvent({ action: RuleAuditAction.UNSNOOZE, outcome: 'unknown', - savedObject: { type: 'alert', id }, + savedObject: { type: RULE_SAVED_OBJECT_TYPE, id }, }) ); diff --git a/x-pack/plugins/alerting/server/data/rule/methods/bulk_delete_rules_so.ts b/x-pack/plugins/alerting/server/data/rule/methods/bulk_delete_rules_so.ts index 7f3568f76cf98..15449dc003cd2 100644 --- a/x-pack/plugins/alerting/server/data/rule/methods/bulk_delete_rules_so.ts +++ b/x-pack/plugins/alerting/server/data/rule/methods/bulk_delete_rules_so.ts @@ -10,6 +10,7 @@ import { SavedObjectsBulkDeleteOptions, SavedObjectsBulkDeleteResponse, } from '@kbn/core/server'; +import { RULE_SAVED_OBJECT_TYPE } from '../../../saved_objects'; export interface BulkDeleteRulesSoParams { savedObjectsClient: SavedObjectsClientContract; @@ -23,7 +24,7 @@ export const bulkDeleteRulesSo = ( const { savedObjectsClient, ids, savedObjectsBulkDeleteOptions } = params; return savedObjectsClient.bulkDelete( - ids.map((id) => ({ id, type: 'alert' })), + ids.map((id) => ({ id, type: RULE_SAVED_OBJECT_TYPE })), savedObjectsBulkDeleteOptions ); }; diff --git a/x-pack/plugins/alerting/server/data/rule/methods/create_rule_so.ts b/x-pack/plugins/alerting/server/data/rule/methods/create_rule_so.ts index 7574e9aca1608..b276bb0e2e10d 100644 --- a/x-pack/plugins/alerting/server/data/rule/methods/create_rule_so.ts +++ b/x-pack/plugins/alerting/server/data/rule/methods/create_rule_so.ts @@ -10,6 +10,7 @@ import { SavedObjectsCreateOptions, SavedObject, } from '@kbn/core/server'; +import { RULE_SAVED_OBJECT_TYPE } from '../../../saved_objects'; import { RuleAttributes } from '../types'; export interface CreateRuleSoParams { @@ -21,5 +22,9 @@ export interface CreateRuleSoParams { export const createRuleSo = (params: CreateRuleSoParams): Promise> => { const { savedObjectsClient, ruleAttributes, savedObjectsCreateOptions } = params; - return savedObjectsClient.create('alert', ruleAttributes, savedObjectsCreateOptions); + return savedObjectsClient.create( + RULE_SAVED_OBJECT_TYPE, + ruleAttributes, + savedObjectsCreateOptions + ); }; diff --git a/x-pack/plugins/alerting/server/data/rule/methods/delete_rule_so.ts b/x-pack/plugins/alerting/server/data/rule/methods/delete_rule_so.ts index e3428cfc78f63..7c15fd847303f 100644 --- a/x-pack/plugins/alerting/server/data/rule/methods/delete_rule_so.ts +++ b/x-pack/plugins/alerting/server/data/rule/methods/delete_rule_so.ts @@ -6,6 +6,7 @@ */ import { SavedObjectsClientContract, SavedObjectsDeleteOptions } from '@kbn/core/server'; +import { RULE_SAVED_OBJECT_TYPE } from '../../../saved_objects'; export interface DeleteRuleSoParams { savedObjectsClient: SavedObjectsClientContract; @@ -16,5 +17,5 @@ export interface DeleteRuleSoParams { export const deleteRuleSo = (params: DeleteRuleSoParams): Promise<{}> => { const { savedObjectsClient, id, savedObjectsDeleteOptions } = params; - return savedObjectsClient.delete('alert', id, savedObjectsDeleteOptions); + return savedObjectsClient.delete(RULE_SAVED_OBJECT_TYPE, id, savedObjectsDeleteOptions); }; diff --git a/x-pack/plugins/alerting/server/data/rule/methods/find_rules_so.ts b/x-pack/plugins/alerting/server/data/rule/methods/find_rules_so.ts index 1362c2406dbae..e929ccf019205 100644 --- a/x-pack/plugins/alerting/server/data/rule/methods/find_rules_so.ts +++ b/x-pack/plugins/alerting/server/data/rule/methods/find_rules_so.ts @@ -10,6 +10,7 @@ import { SavedObjectsFindOptions, SavedObjectsFindResponse, } from '@kbn/core/server'; +import { RULE_SAVED_OBJECT_TYPE } from '../../../saved_objects'; import { RuleAttributes } from '../types'; export interface FindRulesSoParams { @@ -24,6 +25,6 @@ export const findRulesSo = >( return savedObjectsClient.find({ ...savedObjectsFindOptions, - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, }); }; diff --git a/x-pack/plugins/alerting/server/data/rule/methods/get_rule_so.ts b/x-pack/plugins/alerting/server/data/rule/methods/get_rule_so.ts index c8777afef3f78..051644bab56f2 100644 --- a/x-pack/plugins/alerting/server/data/rule/methods/get_rule_so.ts +++ b/x-pack/plugins/alerting/server/data/rule/methods/get_rule_so.ts @@ -7,6 +7,7 @@ import { SavedObjectsClientContract, SavedObject } from '@kbn/core/server'; import { SavedObjectsGetOptions } from '@kbn/core-saved-objects-api-server'; +import { RULE_SAVED_OBJECT_TYPE } from '../../../saved_objects'; import { RuleAttributes } from '../types'; export interface GetRuleSoParams { @@ -18,5 +19,5 @@ export interface GetRuleSoParams { export const getRuleSo = (params: GetRuleSoParams): Promise> => { const { savedObjectsClient, id, savedObjectsGetOptions } = params; - return savedObjectsClient.get('alert', id, savedObjectsGetOptions); + return savedObjectsClient.get(RULE_SAVED_OBJECT_TYPE, id, savedObjectsGetOptions); }; diff --git a/x-pack/plugins/alerting/server/data/rule/methods/resolve_rule_so.ts b/x-pack/plugins/alerting/server/data/rule/methods/resolve_rule_so.ts index b8061cc6e3c3c..d0429b4166d8e 100644 --- a/x-pack/plugins/alerting/server/data/rule/methods/resolve_rule_so.ts +++ b/x-pack/plugins/alerting/server/data/rule/methods/resolve_rule_so.ts @@ -7,6 +7,7 @@ import { SavedObjectsClientContract, SavedObjectsResolveResponse } from '@kbn/core/server'; import { SavedObjectsResolveOptions } from '@kbn/core-saved-objects-api-server'; +import { RULE_SAVED_OBJECT_TYPE } from '../../../saved_objects'; import { RuleAttributes } from '../types'; export interface ResolveRuleSoParams { @@ -20,5 +21,5 @@ export const resolveRuleSo = ( ): Promise> => { const { savedObjectsClient, id, savedObjectsResolveOptions } = params; - return savedObjectsClient.resolve('alert', id, savedObjectsResolveOptions); + return savedObjectsClient.resolve(RULE_SAVED_OBJECT_TYPE, id, savedObjectsResolveOptions); }; diff --git a/x-pack/plugins/alerting/server/data/rule/methods/update_rule_so.ts b/x-pack/plugins/alerting/server/data/rule/methods/update_rule_so.ts index 8739202c237ea..dfb8b6b5c1e7e 100644 --- a/x-pack/plugins/alerting/server/data/rule/methods/update_rule_so.ts +++ b/x-pack/plugins/alerting/server/data/rule/methods/update_rule_so.ts @@ -10,6 +10,7 @@ import { SavedObjectsUpdateOptions, SavedObjectsUpdateResponse, } from '@kbn/core/server'; +import { RULE_SAVED_OBJECT_TYPE } from '../../../saved_objects'; import { RuleAttributes } from '../types'; export interface UpdateRuleSoParams { @@ -25,7 +26,7 @@ export const updateRuleSo = ( const { savedObjectsClient, id, updateRuleAttributes, savedObjectsUpdateOptions } = params; return savedObjectsClient.update( - 'alert', + RULE_SAVED_OBJECT_TYPE, id, updateRuleAttributes, savedObjectsUpdateOptions diff --git a/x-pack/plugins/alerting/server/health/get_health.test.ts b/x-pack/plugins/alerting/server/health/get_health.test.ts index 3715113c84232..51e03dc890e98 100644 --- a/x-pack/plugins/alerting/server/health/get_health.test.ts +++ b/x-pack/plugins/alerting/server/health/get_health.test.ts @@ -6,6 +6,7 @@ */ import { savedObjectsRepositoryMock, savedObjectsServiceMock } from '@kbn/core/server/mocks'; +import { RULE_SAVED_OBJECT_TYPE } from '../saved_objects'; import { RuleExecutionStatusErrorReasons, HealthStatus } from '../types'; import { getAlertingHealthStatus, getHealth } from './get_health'; @@ -22,7 +23,7 @@ describe('getHealth()', () => { saved_objects: [ { id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { alertTypeId: 'myType', schedule: { interval: '10s' }, @@ -80,7 +81,7 @@ describe('getHealth()', () => { saved_objects: [ { id: '2', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { alertTypeId: 'myType', schedule: { interval: '1s' }, @@ -134,7 +135,7 @@ describe('getHealth()', () => { saved_objects: [ { id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { alertTypeId: 'myType', schedule: { interval: '10s' }, @@ -185,7 +186,7 @@ describe('getHealth()', () => { saved_objects: [ { id: '2', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { alertTypeId: 'myType', schedule: { interval: '1s' }, @@ -233,7 +234,7 @@ describe('getAlertingHealthStatus()', () => { saved_objects: [ { id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { alertTypeId: 'myType', schedule: { interval: '10s' }, diff --git a/x-pack/plugins/alerting/server/health/get_health.ts b/x-pack/plugins/alerting/server/health/get_health.ts index 5d2c43fe69182..f4b727170a4b9 100644 --- a/x-pack/plugins/alerting/server/health/get_health.ts +++ b/x-pack/plugins/alerting/server/health/get_health.ts @@ -6,6 +6,7 @@ */ import { ISavedObjectsRepository, SavedObjectsServiceStart } from '@kbn/core/server'; +import { RULE_SAVED_OBJECT_TYPE } from '../saved_objects'; import { AlertsHealth, HealthStatus, RawRule, RuleExecutionStatusErrorReasons } from '../types'; import type { LatestTaskStateSchema } from './task_state'; @@ -30,7 +31,7 @@ export const getHealth = async ( const { saved_objects: decryptErrorData } = await internalSavedObjectsRepository.find({ filter: `alert.attributes.executionStatus.status:error and alert.attributes.executionStatus.error.reason:${RuleExecutionStatusErrorReasons.Decrypt}`, fields: ['executionStatus'], - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, sortField: 'executionStatus.lastExecutionDate', sortOrder: 'desc', page: 1, @@ -48,7 +49,7 @@ export const getHealth = async ( const { saved_objects: executeErrorData } = await internalSavedObjectsRepository.find({ filter: `alert.attributes.executionStatus.status:error and alert.attributes.executionStatus.error.reason:${RuleExecutionStatusErrorReasons.Execute}`, fields: ['executionStatus'], - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, sortField: 'executionStatus.lastExecutionDate', sortOrder: 'desc', page: 1, @@ -66,7 +67,7 @@ export const getHealth = async ( const { saved_objects: readErrorData } = await internalSavedObjectsRepository.find({ filter: `alert.attributes.executionStatus.status:error and alert.attributes.executionStatus.error.reason:${RuleExecutionStatusErrorReasons.Read}`, fields: ['executionStatus'], - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, sortField: 'executionStatus.lastExecutionDate', sortOrder: 'desc', page: 1, @@ -84,7 +85,7 @@ export const getHealth = async ( const { saved_objects: noErrorData } = await internalSavedObjectsRepository.find({ filter: 'not alert.attributes.executionStatus.status:error', fields: ['executionStatus'], - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, sortField: 'executionStatus.lastExecutionDate', sortOrder: 'desc', namespaces: ['*'], @@ -107,7 +108,9 @@ export const getAlertingHealthStatus = async ( savedObjects: SavedObjectsServiceStart, stateRuns: number ) => { - const alertingHealthStatus = await getHealth(savedObjects.createInternalRepository(['alert'])); + const alertingHealthStatus = await getHealth( + savedObjects.createInternalRepository([RULE_SAVED_OBJECT_TYPE]) + ); const state: LatestTaskStateSchema = { runs: stateRuns + 1, health_status: alertingHealthStatus.decryptionHealth.status, diff --git a/x-pack/plugins/alerting/server/index.ts b/x-pack/plugins/alerting/server/index.ts index 04c48ab77c8aa..5be648354e61f 100644 --- a/x-pack/plugins/alerting/server/index.ts +++ b/x-pack/plugins/alerting/server/index.ts @@ -34,6 +34,7 @@ export type { GetViewInAppRelativeUrlFnOpts, DataStreamAdapter, } from './types'; +export { RULE_SAVED_OBJECT_TYPE } from './saved_objects'; export { RuleNotifyWhen } from '../common'; export { DEFAULT_MAX_EPHEMERAL_ACTIONS_PER_ALERT } from './config'; export type { PluginSetupContract, PluginStartContract } from './plugin'; diff --git a/x-pack/plugins/alerting/server/lib/alerting_event_logger/alerting_event_logger.ts b/x-pack/plugins/alerting/server/lib/alerting_event_logger/alerting_event_logger.ts index f3fdcec752def..680279f5dbac7 100644 --- a/x-pack/plugins/alerting/server/lib/alerting_event_logger/alerting_event_logger.ts +++ b/x-pack/plugins/alerting/server/lib/alerting_event_logger/alerting_event_logger.ts @@ -13,6 +13,7 @@ import { } from '@kbn/event-log-plugin/server'; import { EVENT_LOG_ACTIONS } from '../../plugin'; import { UntypedNormalizedRuleType } from '../../rule_type_registry'; +import { RULE_SAVED_OBJECT_TYPE } from '../../saved_objects'; import { TaskRunnerTimings } from '../../task_runner/task_runner_timer'; import { AlertInstanceState, RuleExecutionStatus } from '../../types'; import { createAlertEventLogRecordObject } from '../create_alert_event_log_record_object'; @@ -259,7 +260,7 @@ export function createAlertRecord(context: RuleContextOpts, alert: AlertOpts) { savedObjects: [ { id: context.ruleId, - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, typeId: context.ruleType.id, relation: SAVED_OBJECT_REL_PRIMARY, }, @@ -286,7 +287,7 @@ export function createActionExecuteRecord(context: RuleContextOpts, action: Acti savedObjects: [ { id: context.ruleId, - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, typeId: context.ruleType.id, relation: SAVED_OBJECT_REL_PRIMARY, }, @@ -319,7 +320,7 @@ export function createExecuteTimeoutRecord(context: RuleContextOpts) { savedObjects: [ { id: context.ruleId, - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, typeId: context.ruleType.id, relation: SAVED_OBJECT_REL_PRIMARY, }, @@ -346,7 +347,7 @@ export function initializeExecuteRecord(context: RuleContext) { savedObjects: [ { id: context.ruleId, - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, typeId: context.ruleType.id, relation: SAVED_OBJECT_REL_PRIMARY, }, diff --git a/x-pack/plugins/alerting/server/lib/is_alerting_error.test.ts b/x-pack/plugins/alerting/server/lib/is_alerting_error.test.ts index 2c4a40efb05f0..f197a8e7424de 100644 --- a/x-pack/plugins/alerting/server/lib/is_alerting_error.test.ts +++ b/x-pack/plugins/alerting/server/lib/is_alerting_error.test.ts @@ -10,10 +10,11 @@ import { ErrorWithReason } from './error_with_reason'; import { SavedObjectsErrorHelpers } from '@kbn/core/server'; import { v4 as uuidv4 } from 'uuid'; import { RuleExecutionStatusErrorReasons } from '../types'; +import { RULE_SAVED_OBJECT_TYPE } from '../saved_objects'; describe('isAlertSavedObjectNotFoundError', () => { const id = uuidv4(); - const errorSONF = SavedObjectsErrorHelpers.createGenericNotFoundError('alert', id); + const errorSONF = SavedObjectsErrorHelpers.createGenericNotFoundError(RULE_SAVED_OBJECT_TYPE, id); test('identifies SavedObjects Not Found errors', () => { // ensure the error created by SO parses as a string with the format we expect @@ -34,7 +35,10 @@ describe('isAlertSavedObjectNotFoundError', () => { describe('isEsUnavailableError', () => { const id = uuidv4(); - const errorSONF = SavedObjectsErrorHelpers.createGenericNotFoundEsUnavailableError('alert', id); + const errorSONF = SavedObjectsErrorHelpers.createGenericNotFoundEsUnavailableError( + RULE_SAVED_OBJECT_TYPE, + id + ); test('identifies es unavailable errors', () => { // ensure the error created by SO parses as a string with the format we expect diff --git a/x-pack/plugins/alerting/server/lib/retry_if_conflicts.test.ts b/x-pack/plugins/alerting/server/lib/retry_if_conflicts.test.ts index 8cce79e22fe88..d1af51e179233 100644 --- a/x-pack/plugins/alerting/server/lib/retry_if_conflicts.test.ts +++ b/x-pack/plugins/alerting/server/lib/retry_if_conflicts.test.ts @@ -8,6 +8,7 @@ import { SavedObjectsErrorHelpers } from '@kbn/core/server'; import { retryIfConflicts, RetryForConflictsAttempts } from './retry_if_conflicts'; import { loggingSystemMock } from '@kbn/core/server/mocks'; +import { RULE_SAVED_OBJECT_TYPE } from '../saved_objects'; describe('retry_if_conflicts', () => { beforeEach(() => { @@ -47,7 +48,9 @@ describe('retry_if_conflicts', () => { MockOperationName, getOperationConflictsTimes(RetryForConflictsAttempts + 1) ) - ).rejects.toThrowError(SavedObjectsErrorHelpers.createConflictError('alert', MockAlertId)); + ).rejects.toThrowError( + SavedObjectsErrorHelpers.createConflictError(RULE_SAVED_OBJECT_TYPE, MockAlertId) + ); expect(MockLogger.debug).toBeCalledTimes(RetryForConflictsAttempts); expect(MockLogger.warn).toBeCalledTimes(1); expect(MockLogger.warn).toBeCalledWith(`${MockOperationName} conflict, exceeded retries`); @@ -71,7 +74,7 @@ function getOperationConflictsTimes(times: number) { return async function OperationConflictsTimes() { times--; if (times >= 0) { - throw SavedObjectsErrorHelpers.createConflictError('alert', MockAlertId); + throw SavedObjectsErrorHelpers.createConflictError(RULE_SAVED_OBJECT_TYPE, MockAlertId); } return MockResult; diff --git a/x-pack/plugins/alerting/server/plugin.ts b/x-pack/plugins/alerting/server/plugin.ts index 64bc8ca05281f..87f6e4c3a3979 100644 --- a/x-pack/plugins/alerting/server/plugin.ts +++ b/x-pack/plugins/alerting/server/plugin.ts @@ -77,7 +77,7 @@ import { } from './types'; import { registerAlertingUsageCollector } from './usage'; import { initializeAlertingTelemetry, scheduleAlertingTelemetry } from './usage/task'; -import { setupSavedObjects, getLatestRuleVersion } from './saved_objects'; +import { setupSavedObjects, getLatestRuleVersion, RULE_SAVED_OBJECT_TYPE } from './saved_objects'; import { initializeApiKeyInvalidator, scheduleApiKeyInvalidatorTask, @@ -463,7 +463,7 @@ export class AlertingPlugin { licenseState?.setNotifyUsage(plugins.licensing.featureUsage.notifyUsage); const encryptedSavedObjectsClient = plugins.encryptedSavedObjects.getClient({ - includedHiddenTypes: ['alert'], + includedHiddenTypes: [RULE_SAVED_OBJECT_TYPE], }); const spaceIdToNamespace = (spaceId?: string) => { @@ -491,7 +491,9 @@ export class AlertingPlugin { taskManager: plugins.taskManager, securityPluginSetup: security, securityPluginStart: plugins.security, - internalSavedObjectsRepository: core.savedObjects.createInternalRepository(['alert']), + internalSavedObjectsRepository: core.savedObjects.createInternalRepository([ + RULE_SAVED_OBJECT_TYPE, + ]), encryptedSavedObjectsClient, spaceIdToNamespace, getSpaceId(request: KibanaRequest) { @@ -556,7 +558,9 @@ export class AlertingPlugin { encryptedSavedObjectsClient, basePathService: core.http.basePath, eventLogger: this.eventLogger!, - internalSavedObjectsRepository: core.savedObjects.createInternalRepository(['alert']), + internalSavedObjectsRepository: core.savedObjects.createInternalRepository([ + RULE_SAVED_OBJECT_TYPE, + ]), executionContext: core.executionContext, ruleTypeRegistry: this.ruleTypeRegistry!, alertsService: this.alertsService, @@ -571,7 +575,7 @@ export class AlertingPlugin { getMaintenanceWindowClientWithRequest, }); - this.eventLogService!.registerSavedObjectProvider('alert', (request) => { + this.eventLogService!.registerSavedObjectProvider(RULE_SAVED_OBJECT_TYPE, (request) => { const client = getRulesClientWithRequest(request); return (objects?: SavedObjectsBulkGetObject[]) => objects @@ -594,7 +598,7 @@ export class AlertingPlugin { getAlertingAuthorizationWithRequest, getRulesClientWithRequest, getFrameworkHealth: async () => - await getHealth(core.savedObjects.createInternalRepository(['alert'])), + await getHealth(core.savedObjects.createInternalRepository([RULE_SAVED_OBJECT_TYPE])), }; } @@ -621,7 +625,7 @@ export class AlertingPlugin { }, listTypes: ruleTypeRegistry!.list.bind(ruleTypeRegistry!), getFrameworkHealth: async () => - await getHealth(savedObjects.createInternalRepository(['alert'])), + await getHealth(savedObjects.createInternalRepository([RULE_SAVED_OBJECT_TYPE])), areApiKeysEnabled: async () => { const [, { security }] = await core.getStartServices(); return security?.authc.apiKeys.areAPIKeysEnabled() ?? false; diff --git a/x-pack/plugins/alerting/server/routes/get_action_error_log.test.ts b/x-pack/plugins/alerting/server/routes/get_action_error_log.test.ts index 414d2e8b54122..408ed049044c6 100644 --- a/x-pack/plugins/alerting/server/routes/get_action_error_log.test.ts +++ b/x-pack/plugins/alerting/server/routes/get_action_error_log.test.ts @@ -11,6 +11,7 @@ import { licenseStateMock } from '../lib/license_state.mock'; import { mockHandlerArguments } from './_mock_handler_arguments'; import { SavedObjectsErrorHelpers } from '@kbn/core/server'; import { rulesClientMock } from '../rules_client.mock'; +import { RULE_SAVED_OBJECT_TYPE } from '../saved_objects'; const rulesClient = rulesClientMock.create(); jest.mock('../lib/license_api_access', () => ({ @@ -99,7 +100,9 @@ describe('getActionErrorLogRoute', () => { rulesClient.getActionErrorLog = jest .fn() - .mockRejectedValueOnce(SavedObjectsErrorHelpers.createGenericNotFoundError('alert', '1')); + .mockRejectedValueOnce( + SavedObjectsErrorHelpers.createGenericNotFoundError(RULE_SAVED_OBJECT_TYPE, '1') + ); const [context, req, res] = mockHandlerArguments( { rulesClient }, diff --git a/x-pack/plugins/alerting/server/routes/get_rule_alert_summary.test.ts b/x-pack/plugins/alerting/server/routes/get_rule_alert_summary.test.ts index f7fe1a3406e9c..5eca11c27a4b2 100644 --- a/x-pack/plugins/alerting/server/routes/get_rule_alert_summary.test.ts +++ b/x-pack/plugins/alerting/server/routes/get_rule_alert_summary.test.ts @@ -12,6 +12,7 @@ import { mockHandlerArguments } from './_mock_handler_arguments'; import { SavedObjectsErrorHelpers } from '@kbn/core/server'; import { rulesClientMock } from '../rules_client.mock'; import { AlertSummary } from '../types'; +import { RULE_SAVED_OBJECT_TYPE } from '../saved_objects'; const rulesClient = rulesClientMock.create(); jest.mock('../lib/license_api_access', () => ({ @@ -98,7 +99,9 @@ describe('getRuleAlertSummaryRoute', () => { rulesClient.getAlertSummary = jest .fn() - .mockRejectedValueOnce(SavedObjectsErrorHelpers.createGenericNotFoundError('alert', '1')); + .mockRejectedValueOnce( + SavedObjectsErrorHelpers.createGenericNotFoundError(RULE_SAVED_OBJECT_TYPE, '1') + ); const [context, req, res] = mockHandlerArguments( { rulesClient }, diff --git a/x-pack/plugins/alerting/server/routes/get_rule_execution_kpi.test.ts b/x-pack/plugins/alerting/server/routes/get_rule_execution_kpi.test.ts index ff15a60623168..e92b54769d329 100644 --- a/x-pack/plugins/alerting/server/routes/get_rule_execution_kpi.test.ts +++ b/x-pack/plugins/alerting/server/routes/get_rule_execution_kpi.test.ts @@ -11,6 +11,7 @@ import { mockHandlerArguments } from './_mock_handler_arguments'; import { SavedObjectsErrorHelpers } from '@kbn/core/server'; import { rulesClientMock } from '../rules_client.mock'; import { getRuleExecutionKPIRoute } from './get_rule_execution_kpi'; +import { RULE_SAVED_OBJECT_TYPE } from '../saved_objects'; const rulesClient = rulesClientMock.create(); jest.mock('../lib/license_api_access', () => ({ @@ -83,7 +84,9 @@ describe('getRuleExecutionKPIRoute', () => { rulesClient.getRuleExecutionKPI = jest .fn() - .mockRejectedValueOnce(SavedObjectsErrorHelpers.createGenericNotFoundError('alert', '1')); + .mockRejectedValueOnce( + SavedObjectsErrorHelpers.createGenericNotFoundError(RULE_SAVED_OBJECT_TYPE, '1') + ); const [context, req, res] = mockHandlerArguments( { rulesClient }, diff --git a/x-pack/plugins/alerting/server/routes/get_rule_state.test.ts b/x-pack/plugins/alerting/server/routes/get_rule_state.test.ts index d84c6fe73b616..b68d751147ebe 100644 --- a/x-pack/plugins/alerting/server/routes/get_rule_state.test.ts +++ b/x-pack/plugins/alerting/server/routes/get_rule_state.test.ts @@ -11,6 +11,7 @@ import { licenseStateMock } from '../lib/license_state.mock'; import { mockHandlerArguments } from './_mock_handler_arguments'; import { SavedObjectsErrorHelpers } from '@kbn/core/server'; import { rulesClientMock } from '../rules_client.mock'; +import { RULE_SAVED_OBJECT_TYPE } from '../saved_objects'; const rulesClient = rulesClientMock.create(); jest.mock('../lib/license_api_access', () => ({ @@ -124,7 +125,9 @@ describe('getRuleStateRoute', () => { rulesClient.getAlertState = jest .fn() - .mockResolvedValueOnce(SavedObjectsErrorHelpers.createGenericNotFoundError('alert', '1')); + .mockResolvedValueOnce( + SavedObjectsErrorHelpers.createGenericNotFoundError(RULE_SAVED_OBJECT_TYPE, '1') + ); const [context, req, res] = mockHandlerArguments( { rulesClient }, diff --git a/x-pack/plugins/alerting/server/routes/legacy/get_alert_instance_summary.test.ts b/x-pack/plugins/alerting/server/routes/legacy/get_alert_instance_summary.test.ts index a78fcd7f86f65..c04aa0b39c022 100644 --- a/x-pack/plugins/alerting/server/routes/legacy/get_alert_instance_summary.test.ts +++ b/x-pack/plugins/alerting/server/routes/legacy/get_alert_instance_summary.test.ts @@ -13,6 +13,7 @@ import { SavedObjectsErrorHelpers } from '@kbn/core/server'; import { rulesClientMock } from '../../rules_client.mock'; import { AlertSummary } from '../../types'; import { trackLegacyRouteUsage } from '../../lib/track_legacy_route_usage'; +import { RULE_SAVED_OBJECT_TYPE } from '../../saved_objects'; const rulesClient = rulesClientMock.create(); jest.mock('../../lib/license_api_access', () => ({ @@ -98,7 +99,9 @@ describe('getAlertInstanceSummaryRoute', () => { rulesClient.getAlertSummary = jest .fn() - .mockResolvedValueOnce(SavedObjectsErrorHelpers.createGenericNotFoundError('alert', '1')); + .mockResolvedValueOnce( + SavedObjectsErrorHelpers.createGenericNotFoundError(RULE_SAVED_OBJECT_TYPE, '1') + ); const [context, req, res] = mockHandlerArguments( { rulesClient }, diff --git a/x-pack/plugins/alerting/server/routes/legacy/get_alert_state.test.ts b/x-pack/plugins/alerting/server/routes/legacy/get_alert_state.test.ts index 67fd50a965ea4..eab550ee4b304 100644 --- a/x-pack/plugins/alerting/server/routes/legacy/get_alert_state.test.ts +++ b/x-pack/plugins/alerting/server/routes/legacy/get_alert_state.test.ts @@ -12,6 +12,7 @@ import { mockHandlerArguments } from '../_mock_handler_arguments'; import { SavedObjectsErrorHelpers } from '@kbn/core/server'; import { rulesClientMock } from '../../rules_client.mock'; import { trackLegacyRouteUsage } from '../../lib/track_legacy_route_usage'; +import { RULE_SAVED_OBJECT_TYPE } from '../../saved_objects'; const rulesClient = rulesClientMock.create(); jest.mock('../../lib/license_api_access', () => ({ @@ -129,7 +130,9 @@ describe('getAlertStateRoute', () => { rulesClient.getAlertState = jest .fn() - .mockResolvedValueOnce(SavedObjectsErrorHelpers.createGenericNotFoundError('alert', '1')); + .mockResolvedValueOnce( + SavedObjectsErrorHelpers.createGenericNotFoundError(RULE_SAVED_OBJECT_TYPE, '1') + ); const [context, req, res] = mockHandlerArguments( { rulesClient }, diff --git a/x-pack/plugins/alerting/server/rules_client/common/audit_events.test.ts b/x-pack/plugins/alerting/server/rules_client/common/audit_events.test.ts index 781b8fe1f4715..6d42be630ffd1 100644 --- a/x-pack/plugins/alerting/server/rules_client/common/audit_events.test.ts +++ b/x-pack/plugins/alerting/server/rules_client/common/audit_events.test.ts @@ -5,6 +5,7 @@ * 2.0. */ +import { RULE_SAVED_OBJECT_TYPE } from '../../saved_objects'; import { RuleAuditAction, ruleAuditEvent } from './audit_events'; describe('#ruleAuditEvent', () => { @@ -13,7 +14,7 @@ describe('#ruleAuditEvent', () => { ruleAuditEvent({ action: RuleAuditAction.CREATE, outcome: 'unknown', - savedObject: { type: 'alert', id: 'ALERT_ID' }, + savedObject: { type: RULE_SAVED_OBJECT_TYPE, id: 'ALERT_ID' }, }) ).toMatchInlineSnapshot(` Object { @@ -43,7 +44,7 @@ describe('#ruleAuditEvent', () => { expect( ruleAuditEvent({ action: RuleAuditAction.CREATE, - savedObject: { type: 'alert', id: 'ALERT_ID' }, + savedObject: { type: RULE_SAVED_OBJECT_TYPE, id: 'ALERT_ID' }, }) ).toMatchInlineSnapshot(` Object { @@ -73,7 +74,7 @@ describe('#ruleAuditEvent', () => { expect( ruleAuditEvent({ action: RuleAuditAction.CREATE, - savedObject: { type: 'alert', id: 'ALERT_ID' }, + savedObject: { type: RULE_SAVED_OBJECT_TYPE, id: 'ALERT_ID' }, error: new Error('ERROR_MESSAGE'), }) ).toMatchInlineSnapshot(` diff --git a/x-pack/plugins/alerting/server/rules_client/common/retry_if_bulk_edit_conflicts.test.ts b/x-pack/plugins/alerting/server/rules_client/common/retry_if_bulk_edit_conflicts.test.ts index c5570a7422d02..d099ba8693c3f 100644 --- a/x-pack/plugins/alerting/server/rules_client/common/retry_if_bulk_edit_conflicts.test.ts +++ b/x-pack/plugins/alerting/server/rules_client/common/retry_if_bulk_edit_conflicts.test.ts @@ -10,6 +10,7 @@ import { retryIfBulkEditConflicts } from './retry_if_bulk_edit_conflicts'; import { RETRY_IF_CONFLICTS_ATTEMPTS } from './wait_before_next_retry'; import { loggingSystemMock } from '@kbn/core/server/mocks'; import { BulkEditSkipReason } from '../../../common/bulk_edit'; +import { RULE_SAVED_OBJECT_TYPE } from '../../saved_objects'; const mockFilter: KueryNode = { type: 'function', @@ -21,12 +22,12 @@ const mockLogger = loggingSystemMock.create().get(); const mockSuccessfulResult = { apiKeysToInvalidate: [], rules: [ - { id: '1', type: 'alert', attributes: {} }, - { id: '2', type: 'alert', attributes: { name: 'Test rule 2' } }, + { id: '1', type: RULE_SAVED_OBJECT_TYPE, attributes: {} }, + { id: '2', type: RULE_SAVED_OBJECT_TYPE, attributes: { name: 'Test rule 2' } }, ], resultSavedObjects: [ - { id: '1', type: 'alert', attributes: {}, references: [] }, - { id: '2', type: 'alert', attributes: { name: 'Test rule 2' }, references: [] }, + { id: '1', type: RULE_SAVED_OBJECT_TYPE, attributes: {}, references: [] }, + { id: '2', type: RULE_SAVED_OBJECT_TYPE, attributes: { name: 'Test rule 2' }, references: [] }, ], errors: [], skipped: [ @@ -50,10 +51,10 @@ function getOperationConflictsTimes(times: number) { return { ...mockSuccessfulResult, resultSavedObjects: [ - { id: '1', type: 'alert', attributes: {}, references: [] }, + { id: '1', type: RULE_SAVED_OBJECT_TYPE, attributes: {}, references: [] }, { id: '2', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: {}, references: [], error: { @@ -94,7 +95,7 @@ describe('retryIfBulkEditConflicts', () => { attributes: {}, id: '1', references: [], - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, }, { attributes: { @@ -102,7 +103,7 @@ describe('retryIfBulkEditConflicts', () => { }, id: '2', references: [], - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, }, ], }); diff --git a/x-pack/plugins/alerting/server/rules_client/common/retry_if_bulk_edit_conflicts.ts b/x-pack/plugins/alerting/server/rules_client/common/retry_if_bulk_edit_conflicts.ts index 1a506b1b3fa86..86e3897183849 100644 --- a/x-pack/plugins/alerting/server/rules_client/common/retry_if_bulk_edit_conflicts.ts +++ b/x-pack/plugins/alerting/server/rules_client/common/retry_if_bulk_edit_conflicts.ts @@ -14,6 +14,7 @@ import { convertRuleIdsToKueryNode } from '../../lib'; import { BulkOperationError } from '../types'; import { RuleAttributes } from '../../data/rule/types'; import { waitBeforeNextRetry, RETRY_IF_CONFLICTS_ATTEMPTS } from './wait_before_next_retry'; +import { RULE_SAVED_OBJECT_TYPE } from '../../saved_objects'; // max number of failed SO ids in one retry filter const MaxIdsNumberInRetryFilter = 1000; @@ -70,7 +71,7 @@ export const retryIfBulkEditConflicts = async ( const conflictErrorMap = resultSavedObjects.reduce>( (acc, item) => { - if (item.type === 'alert' && item?.error?.statusCode === 409) { + if (item.type === RULE_SAVED_OBJECT_TYPE && item?.error?.statusCode === 409) { return acc.set(item.id, { message: item.error.message }); } return acc; diff --git a/x-pack/plugins/alerting/server/rules_client/common/validate_attributes.ts b/x-pack/plugins/alerting/server/rules_client/common/validate_attributes.ts index 80353ad0f6055..b58cc453d5800 100644 --- a/x-pack/plugins/alerting/server/rules_client/common/validate_attributes.ts +++ b/x-pack/plugins/alerting/server/rules_client/common/validate_attributes.ts @@ -8,6 +8,7 @@ import { KueryNode } from '@kbn/es-query'; import { get, isEmpty } from 'lodash'; import { alertMappings } from '../../../common/saved_objects/rules/mappings'; +import { RULE_SAVED_OBJECT_TYPE } from '../../saved_objects'; const astFunctionType = ['is', 'range', 'nested']; @@ -137,7 +138,10 @@ export const validateFilterKueryNode = ({ }: ValidateFilterKueryNodeParams) => { const action = ({ index, fieldName }: IterateActionProps) => { if (index === 0) { - const firstAttribute = getFieldNameAttribute(fieldName, ['alert', 'attributes']); + const firstAttribute = getFieldNameAttribute(fieldName, [ + RULE_SAVED_OBJECT_TYPE, + 'attributes', + ]); if (excludedFieldNames.includes(firstAttribute)) { throw new Error(`Filter is not supported on this field ${fieldName}`); } diff --git a/x-pack/plugins/alerting/server/rules_client/lib/check_authorization_and_get_total.ts b/x-pack/plugins/alerting/server/rules_client/lib/check_authorization_and_get_total.ts index 4327176841ad4..a4e75c58bde4b 100644 --- a/x-pack/plugins/alerting/server/rules_client/lib/check_authorization_and_get_total.ts +++ b/x-pack/plugins/alerting/server/rules_client/lib/check_authorization_and_get_total.ts @@ -18,6 +18,7 @@ import { } from '../common/constants'; import { RulesClientContext } from '../types'; import { ruleAuditEvent, RuleAuditAction } from '../common/audit_events'; +import { RULE_SAVED_OBJECT_TYPE } from '../../saved_objects'; export const checkAuthorizationAndGetTotal = async ( context: RulesClientContext, @@ -54,7 +55,7 @@ export const checkAuthorizationAndGetTotal = async ( filter, page: 1, perPage: 0, - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, aggs: { alertTypeId: { multi_terms: { diff --git a/x-pack/plugins/alerting/server/rules_client/lib/create_rule_saved_object.ts b/x-pack/plugins/alerting/server/rules_client/lib/create_rule_saved_object.ts index 14662953ba73b..cc0d6a895dcc0 100644 --- a/x-pack/plugins/alerting/server/rules_client/lib/create_rule_saved_object.ts +++ b/x-pack/plugins/alerting/server/rules_client/lib/create_rule_saved_object.ts @@ -17,6 +17,7 @@ import { updateMeta } from './update_meta'; import { scheduleTask } from './schedule_task'; import { getAlertFromRaw } from './get_alert_from_raw'; import { createRuleSo, deleteRuleSo, updateRuleSo } from '../../data/rule'; +import { RULE_SAVED_OBJECT_TYPE } from '../../saved_objects'; interface CreateRuleSavedObjectParams { intervalInMs: number; @@ -56,7 +57,7 @@ export async function createRuleSavedObject { const currentRule: SavedObject = { id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { enabled: true, name: 'rule-name', diff --git a/x-pack/plugins/alerting/server/rules_client/lib/resolve_rule_saved_object.ts b/x-pack/plugins/alerting/server/rules_client/lib/resolve_rule_saved_object.ts index 101f846ae9ba9..f133aea9035a0 100644 --- a/x-pack/plugins/alerting/server/rules_client/lib/resolve_rule_saved_object.ts +++ b/x-pack/plugins/alerting/server/rules_client/lib/resolve_rule_saved_object.ts @@ -11,6 +11,7 @@ import { ruleAuditEvent, RuleAuditAction } from '../common/audit_events'; import { RulesClientContext } from '../types'; import { resolveRuleSo } from '../../data/rule'; import { RuleAttributes } from '../../data/rule/types'; +import { RULE_SAVED_OBJECT_TYPE } from '../../saved_objects'; interface ResolveRuleSavedObjectParams { ruleId: string; @@ -26,7 +27,7 @@ export async function resolveRuleSavedObject( ruleAuditEvent({ action: RuleAuditAction.RESOLVE, outcome: 'unknown', - savedObject: { type: 'alert', id: ruleId }, + savedObject: { type: RULE_SAVED_OBJECT_TYPE, id: ruleId }, }) ); diff --git a/x-pack/plugins/alerting/server/rules_client/lib/siem_legacy_actions/format_legacy_actions.test.ts b/x-pack/plugins/alerting/server/rules_client/lib/siem_legacy_actions/format_legacy_actions.test.ts index 072a1e98cc3de..8830ce96a6c43 100644 --- a/x-pack/plugins/alerting/server/rules_client/lib/siem_legacy_actions/format_legacy_actions.test.ts +++ b/x-pack/plugins/alerting/server/rules_client/lib/siem_legacy_actions/format_legacy_actions.test.ts @@ -5,6 +5,7 @@ * 2.0. */ +import { RULE_SAVED_OBJECT_TYPE } from '../../../saved_objects'; import type { SavedObjectsFindResult, SavedObjectAttribute } from '@kbn/core/server'; import { loggingSystemMock, savedObjectsClientMock } from '@kbn/core/server/mocks'; @@ -37,7 +38,7 @@ describe('legacyGetBulkRuleActionsSavedObject', () => { test('calls "savedObjectsClient.find" with the expected "hasReferences"', async () => { await legacyGetBulkRuleActionsSavedObject({ alertIds: ['123'], savedObjectsClient, logger }); expect(savedObjectsClient.find).toHaveBeenCalledWith({ - hasReference: [{ id: '123', type: 'alert' }], + hasReference: [{ id: '123', type: RULE_SAVED_OBJECT_TYPE }], perPage: 10000, type: legacyRuleActionsSavedObjectType, }); @@ -70,7 +71,7 @@ describe('legacyGetBulkRuleActionsSavedObject', () => { { name: 'alert_0', id: 'alert-123', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, }, { name: 'action_0', @@ -134,7 +135,7 @@ describe('legacyGetBulkRuleActionsSavedObject', () => { { name: 'alert_0', id: 'alert-123', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, }, { name: 'action_0', @@ -163,7 +164,7 @@ describe('legacyGetBulkRuleActionsSavedObject', () => { { name: 'alert_0', id: 'alert-456', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, }, { name: 'action_0', @@ -244,7 +245,7 @@ describe('legacyGetBulkRuleActionsSavedObject', () => { { name: 'alert_0', id: 'alert-123', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, }, { name: 'action_0', @@ -330,7 +331,7 @@ describe('legacyGetBulkRuleActionsSavedObject', () => { { name: 'alert_0', id: 'alert-123', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, }, { name: 'action_0', @@ -401,7 +402,7 @@ describe('legacyGetBulkRuleActionsSavedObject', () => { { name: 'alert_0', id: 'alert-123', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, }, { name: 'action_0', @@ -468,7 +469,7 @@ describe('legacyGetBulkRuleActionsSavedObject', () => { id: '123', type: legacyRuleActionsSavedObjectType, references: [ - // Missing the "alert_0" of { name: 'alert_0', id: 'alert-123', type: 'alert', }, + // Missing the "alert_0" of { name: 'alert_0', id: 'alert-123', type: RULE_SAVED_OBJECT_TYPE, }, { name: 'action_0', id: 'action-123', @@ -539,7 +540,7 @@ describe('formatLegacyActions', () => { { name: 'alert_0', id: 'alert-123', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, }, { name: 'action_0', diff --git a/x-pack/plugins/alerting/server/rules_client/lib/siem_legacy_actions/format_legacy_actions.ts b/x-pack/plugins/alerting/server/rules_client/lib/siem_legacy_actions/format_legacy_actions.ts index a0aa3286f1f6d..74a56d1964ada 100644 --- a/x-pack/plugins/alerting/server/rules_client/lib/siem_legacy_actions/format_legacy_actions.ts +++ b/x-pack/plugins/alerting/server/rules_client/lib/siem_legacy_actions/format_legacy_actions.ts @@ -8,6 +8,7 @@ import { chunk } from 'lodash'; import type { SavedObjectsFindOptionsReference, Logger } from '@kbn/core/server'; import pMap from 'p-map'; +import { RULE_SAVED_OBJECT_TYPE } from '../../../saved_objects'; import { RuleAction, Rule } from '../../../types'; import type { RuleExecutorServices } from '../../..'; import { injectReferencesIntoActions } from '../../common'; @@ -49,7 +50,7 @@ export const legacyGetBulkRuleActionsSavedObject = async ({ }: LegacyGetBulkRuleActionsSavedObject): Promise> => { const references = alertIds.map((alertId) => ({ id: alertId, - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, })); const errors: unknown[] = []; const results = await pMap( @@ -82,7 +83,7 @@ export const legacyGetBulkRuleActionsSavedObject = async ({ return actionSavedObjects.reduce((acc: { [key: string]: LegacyActionsObj }, savedObject) => { const ruleAlertId = savedObject.references.find((reference) => { // Find the first rule alert and assume that is the one we want since we should only ever have 1. - return reference.type === 'alert'; + return reference.type === RULE_SAVED_OBJECT_TYPE; }); // We check to ensure we have found a "ruleAlertId" and hopefully we have. const ruleAlertIdKey = ruleAlertId != null ? ruleAlertId.id : undefined; diff --git a/x-pack/plugins/alerting/server/rules_client/lib/siem_legacy_actions/retrieve_migrated_legacy_actions.mock.ts b/x-pack/plugins/alerting/server/rules_client/lib/siem_legacy_actions/retrieve_migrated_legacy_actions.mock.ts index d45c86c3f05a5..6a1a554655a3c 100644 --- a/x-pack/plugins/alerting/server/rules_client/lib/siem_legacy_actions/retrieve_migrated_legacy_actions.mock.ts +++ b/x-pack/plugins/alerting/server/rules_client/lib/siem_legacy_actions/retrieve_migrated_legacy_actions.mock.ts @@ -5,6 +5,7 @@ * 2.0. */ +import { RULE_SAVED_OBJECT_TYPE } from '../../../saved_objects'; import type { SavedObjectsFindResponse, SavedObjectsFindResult, @@ -179,7 +180,7 @@ export const legacyGetSiemNotificationRuleNoActionsSOResult = ( ruleThrottle: 'no_actions', alertThrottle: null, }, - references: [{ id: ruleId, type: 'alert', name: 'alert_0' }], + references: [{ id: ruleId, type: RULE_SAVED_OBJECT_TYPE, name: 'alert_0' }], migrationVersion: { 'siem-detection-engine-rule-actions': '7.11.2', }, @@ -214,7 +215,7 @@ export const legacyGetSiemNotificationRuleEveryRunSOResult = ( ruleThrottle: 'rule', alertThrottle: null, }, - references: [{ id: ruleId, type: 'alert', name: 'alert_0' }], + references: [{ id: ruleId, type: RULE_SAVED_OBJECT_TYPE, name: 'alert_0' }], migrationVersion: { 'siem-detection-engine-rule-actions': '7.11.2', }, @@ -251,7 +252,7 @@ export const legacyGetSiemNotificationRuleHourlyActionsSOResult = ( alertThrottle: '1h', }, references: [ - { id: ruleId, type: 'alert', name: 'alert_0' }, + { id: ruleId, type: RULE_SAVED_OBJECT_TYPE, name: 'alert_0' }, { id: connectorId, type: 'action', name: 'action_0' }, ], migrationVersion: { @@ -290,7 +291,7 @@ export const legacyGetSiemNotificationRuleDailyActionsSOResult = ( alertThrottle: '1d', }, references: [ - { id: ruleId, type: 'alert', name: 'alert_0' }, + { id: ruleId, type: RULE_SAVED_OBJECT_TYPE, name: 'alert_0' }, { id: connectorId, type: 'action', name: 'action_0' }, ], migrationVersion: { @@ -329,7 +330,7 @@ export const legacyGetSiemNotificationRuleWeeklyActionsSOResult = ( alertThrottle: '7d', }, references: [ - { id: ruleId, type: 'alert', name: 'alert_0' }, + { id: ruleId, type: RULE_SAVED_OBJECT_TYPE, name: 'alert_0' }, { id: connectorId, type: 'action', name: 'action_0' }, ], migrationVersion: { diff --git a/x-pack/plugins/alerting/server/rules_client/lib/siem_legacy_actions/retrieve_migrated_legacy_actions.ts b/x-pack/plugins/alerting/server/rules_client/lib/siem_legacy_actions/retrieve_migrated_legacy_actions.ts index 9678dff6898c8..fe4bb56713861 100644 --- a/x-pack/plugins/alerting/server/rules_client/lib/siem_legacy_actions/retrieve_migrated_legacy_actions.ts +++ b/x-pack/plugins/alerting/server/rules_client/lib/siem_legacy_actions/retrieve_migrated_legacy_actions.ts @@ -6,6 +6,7 @@ */ import type { SavedObjectReference } from '@kbn/core/server'; +import { RULE_SAVED_OBJECT_TYPE } from '../../../saved_objects'; import type { RulesClientContext } from '../..'; import { RawRuleAction } from '../../../types'; import { find } from '../../methods/find'; @@ -52,7 +53,7 @@ export const retrieveMigratedLegacyActions: RetrieveMigratedLegacyActions = asyn options: { filter: 'alert.attributes.alertTypeId:(siem.notifications)', hasReference: { - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, id: ruleId, }, }, @@ -60,7 +61,7 @@ export const retrieveMigratedLegacyActions: RetrieveMigratedLegacyActions = asyn unsecuredSavedObjectsClient.find({ type: legacyRuleActionsSavedObjectType, hasReference: { - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, id: ruleId, }, }), diff --git a/x-pack/plugins/alerting/server/rules_client/lib/siem_legacy_actions/transform_legacy_actions.test.ts b/x-pack/plugins/alerting/server/rules_client/lib/siem_legacy_actions/transform_legacy_actions.test.ts index cea32ce3e1913..f7d9a70a3c53c 100644 --- a/x-pack/plugins/alerting/server/rules_client/lib/siem_legacy_actions/transform_legacy_actions.test.ts +++ b/x-pack/plugins/alerting/server/rules_client/lib/siem_legacy_actions/transform_legacy_actions.test.ts @@ -5,6 +5,7 @@ * 2.0. */ +import { RULE_SAVED_OBJECT_TYPE } from '../../../saved_objects'; import type { SavedObjectReference } from '@kbn/core/server'; import { transformFromLegacyActions } from './transform_legacy_actions'; @@ -48,7 +49,7 @@ describe('transformFromLegacyActions', () => { { name: 'alert_0', id: 'alert-1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, }, ]); diff --git a/x-pack/plugins/alerting/server/rules_client/lib/untrack_rule_alerts.ts b/x-pack/plugins/alerting/server/rules_client/lib/untrack_rule_alerts.ts index 17794aeb4ebdf..d69d84c7fd8c7 100644 --- a/x-pack/plugins/alerting/server/rules_client/lib/untrack_rule_alerts.ts +++ b/x-pack/plugins/alerting/server/rules_client/lib/untrack_rule_alerts.ts @@ -15,6 +15,7 @@ import { EVENT_LOG_ACTIONS } from '../../plugin'; import { createAlertEventLogRecordObject } from '../../lib/create_alert_event_log_record_object'; import { RulesClientContext } from '../types'; import { RuleAttributes } from '../../data/rule/types'; +import { RULE_SAVED_OBJECT_TYPE } from '../../saved_objects'; export const untrackRuleAlerts = async ( context: RulesClientContext, @@ -67,7 +68,7 @@ export const untrackRuleAlerts = async ( savedObjects: [ { id, - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, typeId: attributes.alertTypeId, relation: SAVED_OBJECT_REL_PRIMARY, }, diff --git a/x-pack/plugins/alerting/server/rules_client/methods/bulk_enable.ts b/x-pack/plugins/alerting/server/rules_client/methods/bulk_enable.ts index cac39ccb367d4..0f01e88cfaa12 100644 --- a/x-pack/plugins/alerting/server/rules_client/methods/bulk_enable.ts +++ b/x-pack/plugins/alerting/server/rules_client/methods/bulk_enable.ts @@ -32,6 +32,7 @@ import { import { RulesClientContext, BulkOperationError, BulkOptions } from '../types'; import { validateScheduleLimit } from '../../application/rule/methods/get_schedule_frequency'; import { RuleAttributes } from '../../data/rule/types'; +import { RULE_SAVED_OBJECT_TYPE } from '../../saved_objects'; const getShouldScheduleTask = async ( context: RulesClientContext, @@ -118,7 +119,7 @@ const bulkEnableRulesWithOCC = async ( await context.encryptedSavedObjectsClient.createPointInTimeFinderDecryptedAsInternalUser( { filter: filter ? nodeBuilder.and([filter, additionalFilter]) : additionalFilter, - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, perPage: 100, ...(context.namespace ? { namespaces: [context.namespace] } : undefined), } @@ -241,7 +242,7 @@ const bulkEnableRulesWithOCC = async ( ruleAuditEvent({ action: RuleAuditAction.ENABLE, outcome: 'unknown', - savedObject: { type: 'alert', id: rule.id }, + savedObject: { type: RULE_SAVED_OBJECT_TYPE, id: rule.id }, }) ); } catch (error) { diff --git a/x-pack/plugins/alerting/server/rules_client/methods/clear_expired_snoozes.ts b/x-pack/plugins/alerting/server/rules_client/methods/clear_expired_snoozes.ts index 90156246331f0..70f0e8a29eac2 100644 --- a/x-pack/plugins/alerting/server/rules_client/methods/clear_expired_snoozes.ts +++ b/x-pack/plugins/alerting/server/rules_client/methods/clear_expired_snoozes.ts @@ -6,7 +6,7 @@ */ import { RuleTypeParams, SanitizedRule } from '../../../common'; -import { partiallyUpdateAlert } from '../../saved_objects'; +import { partiallyUpdateRule } from '../../saved_objects'; import { isSnoozeExpired } from '../../lib'; import { RulesClientContext } from '../types'; import { updateMeta } from '../lib'; @@ -39,7 +39,7 @@ export async function clearExpiredSnoozes( const updateOptions = { version, refresh: false }; - await partiallyUpdateAlert( + await partiallyUpdateRule( context.unsecuredSavedObjectsClient, rule.id, updateAttributes, diff --git a/x-pack/plugins/alerting/server/rules_client/methods/clone.ts b/x-pack/plugins/alerting/server/rules_client/methods/clone.ts index f11b5c69012c4..acc8b66d6fde8 100644 --- a/x-pack/plugins/alerting/server/rules_client/methods/clone.ts +++ b/x-pack/plugins/alerting/server/rules_client/methods/clone.ts @@ -19,6 +19,7 @@ import { getRuleExecutionStatusPendingAttributes } from '../../lib/rule_executio import { isDetectionEngineAADRuleType } from '../../saved_objects/migrations/utils'; import { createNewAPIKeySet, createRuleSavedObject } from '../lib'; import { RulesClientContext } from '../types'; +import { RULE_SAVED_OBJECT_TYPE } from '../../saved_objects'; export type CloneArguments = [string, { newId?: string }]; @@ -33,9 +34,13 @@ export async function clone( ruleSavedObject = await withSpan( { name: 'encryptedSavedObjectsClient.getDecryptedAsInternalUser', type: 'rules' }, () => - context.encryptedSavedObjectsClient.getDecryptedAsInternalUser('alert', id, { - namespace: context.namespace, - }) + context.encryptedSavedObjectsClient.getDecryptedAsInternalUser( + RULE_SAVED_OBJECT_TYPE, + id, + { + namespace: context.namespace, + } + ) ); } catch (e) { // We'll skip invalidating the API key since we failed to load the decrypted saved object @@ -45,7 +50,7 @@ export async function clone( // Still attempt to load the object using SOC ruleSavedObject = await withSpan( { name: 'unsecuredSavedObjectsClient.get', type: 'rules' }, - () => context.unsecuredSavedObjectsClient.get('alert', id) + () => context.unsecuredSavedObjectsClient.get(RULE_SAVED_OBJECT_TYPE, id) ); } @@ -80,7 +85,7 @@ export async function clone( context.auditLogger?.log( ruleAuditEvent({ action: RuleAuditAction.CREATE, - savedObject: { type: 'alert', id }, + savedObject: { type: RULE_SAVED_OBJECT_TYPE, id }, error, }) ); @@ -125,7 +130,7 @@ export async function clone( ruleAuditEvent({ action: RuleAuditAction.CREATE, outcome: 'unknown', - savedObject: { type: 'alert', id }, + savedObject: { type: RULE_SAVED_OBJECT_TYPE, id }, }) ); diff --git a/x-pack/plugins/alerting/server/rules_client/methods/delete.ts b/x-pack/plugins/alerting/server/rules_client/methods/delete.ts index 566945f0357fc..53baa548d783c 100644 --- a/x-pack/plugins/alerting/server/rules_client/methods/delete.ts +++ b/x-pack/plugins/alerting/server/rules_client/methods/delete.ts @@ -14,6 +14,7 @@ import { ruleAuditEvent, RuleAuditAction } from '../common/audit_events'; import { RulesClientContext } from '../types'; import { untrackRuleAlerts, migrateLegacyActions } from '../lib'; import { RuleAttributes } from '../../data/rule/types'; +import { RULE_SAVED_OBJECT_TYPE } from '../../saved_objects'; export async function deleteRule(context: RulesClientContext, { id }: { id: string }) { return await retryIfConflicts( @@ -31,9 +32,13 @@ async function deleteWithOCC(context: RulesClientContext, { id }: { id: string } try { const decryptedAlert = - await context.encryptedSavedObjectsClient.getDecryptedAsInternalUser('alert', id, { - namespace: context.namespace, - }); + await context.encryptedSavedObjectsClient.getDecryptedAsInternalUser( + RULE_SAVED_OBJECT_TYPE, + id, + { + namespace: context.namespace, + } + ); apiKeyToInvalidate = decryptedAlert.attributes.apiKey; apiKeyCreatedByUser = decryptedAlert.attributes.apiKeyCreatedByUser; taskIdToRemove = decryptedAlert.attributes.scheduledTaskId; @@ -44,7 +49,10 @@ async function deleteWithOCC(context: RulesClientContext, { id }: { id: string } `delete(): Failed to load API key to invalidate on alert ${id}: ${e.message}` ); // Still attempt to load the scheduledTaskId using SOC - const alert = await context.unsecuredSavedObjectsClient.get('alert', id); + const alert = await context.unsecuredSavedObjectsClient.get( + RULE_SAVED_OBJECT_TYPE, + id + ); taskIdToRemove = alert.attributes.scheduledTaskId; attributes = alert.attributes; } @@ -60,7 +68,7 @@ async function deleteWithOCC(context: RulesClientContext, { id }: { id: string } context.auditLogger?.log( ruleAuditEvent({ action: RuleAuditAction.DELETE, - savedObject: { type: 'alert', id }, + savedObject: { type: RULE_SAVED_OBJECT_TYPE, id }, error, }) ); @@ -78,10 +86,10 @@ async function deleteWithOCC(context: RulesClientContext, { id }: { id: string } ruleAuditEvent({ action: RuleAuditAction.DELETE, outcome: 'unknown', - savedObject: { type: 'alert', id }, + savedObject: { type: RULE_SAVED_OBJECT_TYPE, id }, }) ); - const removeResult = await context.unsecuredSavedObjectsClient.delete('alert', id); + const removeResult = await context.unsecuredSavedObjectsClient.delete(RULE_SAVED_OBJECT_TYPE, id); await Promise.all([ taskIdToRemove ? context.taskManager.removeIfExists(taskIdToRemove) : null, diff --git a/x-pack/plugins/alerting/server/rules_client/methods/disable.ts b/x-pack/plugins/alerting/server/rules_client/methods/disable.ts index d51a5793371f0..38b0dcc7e17d6 100644 --- a/x-pack/plugins/alerting/server/rules_client/methods/disable.ts +++ b/x-pack/plugins/alerting/server/rules_client/methods/disable.ts @@ -13,6 +13,7 @@ import { ruleAuditEvent, RuleAuditAction } from '../common/audit_events'; import { RulesClientContext } from '../types'; import { untrackRuleAlerts, updateMeta, migrateLegacyActions } from '../lib'; import { RuleAttributes } from '../../data/rule/types'; +import { RULE_SAVED_OBJECT_TYPE } from '../../saved_objects'; export async function disable(context: RulesClientContext, { id }: { id: string }): Promise { return await retryIfConflicts( @@ -29,16 +30,23 @@ async function disableWithOCC(context: RulesClientContext, { id }: { id: string try { const decryptedAlert = - await context.encryptedSavedObjectsClient.getDecryptedAsInternalUser('alert', id, { - namespace: context.namespace, - }); + await context.encryptedSavedObjectsClient.getDecryptedAsInternalUser( + RULE_SAVED_OBJECT_TYPE, + id, + { + namespace: context.namespace, + } + ); attributes = decryptedAlert.attributes; version = decryptedAlert.version; references = decryptedAlert.references; } catch (e) { context.logger.error(`disable(): Failed to load API key of alert ${id}: ${e.message}`); // Still attempt to load the attributes and version using SOC - const alert = await context.unsecuredSavedObjectsClient.get('alert', id); + const alert = await context.unsecuredSavedObjectsClient.get( + RULE_SAVED_OBJECT_TYPE, + id + ); attributes = alert.attributes; version = alert.version; references = alert.references; @@ -55,7 +63,7 @@ async function disableWithOCC(context: RulesClientContext, { id }: { id: string context.auditLogger?.log( ruleAuditEvent({ action: RuleAuditAction.DISABLE, - savedObject: { type: 'alert', id }, + savedObject: { type: RULE_SAVED_OBJECT_TYPE, id }, error, }) ); @@ -68,7 +76,7 @@ async function disableWithOCC(context: RulesClientContext, { id }: { id: string ruleAuditEvent({ action: RuleAuditAction.DISABLE, outcome: 'unknown', - savedObject: { type: 'alert', id }, + savedObject: { type: RULE_SAVED_OBJECT_TYPE, id }, }) ); @@ -83,7 +91,7 @@ async function disableWithOCC(context: RulesClientContext, { id }: { id: string }); await context.unsecuredSavedObjectsClient.update( - 'alert', + RULE_SAVED_OBJECT_TYPE, id, updateMeta(context, { ...attributes, diff --git a/x-pack/plugins/alerting/server/rules_client/methods/enable.ts b/x-pack/plugins/alerting/server/rules_client/methods/enable.ts index 53df42f012ad8..995e989121802 100644 --- a/x-pack/plugins/alerting/server/rules_client/methods/enable.ts +++ b/x-pack/plugins/alerting/server/rules_client/methods/enable.ts @@ -16,6 +16,7 @@ import { RulesClientContext } from '../types'; import { updateMeta, createNewAPIKeySet, scheduleTask, migrateLegacyActions } from '../lib'; import { validateScheduleLimit } from '../../application/rule/methods/get_schedule_frequency'; import { getRuleCircuitBreakerErrorMessage } from '../../../common'; +import { RULE_SAVED_OBJECT_TYPE } from '../../saved_objects'; export async function enable(context: RulesClientContext, { id }: { id: string }): Promise { return await retryIfConflicts( @@ -33,9 +34,13 @@ async function enableWithOCC(context: RulesClientContext, { id }: { id: string } try { const decryptedAlert = - await context.encryptedSavedObjectsClient.getDecryptedAsInternalUser('alert', id, { - namespace: context.namespace, - }); + await context.encryptedSavedObjectsClient.getDecryptedAsInternalUser( + RULE_SAVED_OBJECT_TYPE, + id, + { + namespace: context.namespace, + } + ); existingApiKey = decryptedAlert.attributes.apiKey; attributes = decryptedAlert.attributes; version = decryptedAlert.version; @@ -43,7 +48,10 @@ async function enableWithOCC(context: RulesClientContext, { id }: { id: string } } catch (e) { context.logger.error(`enable(): Failed to load API key of alert ${id}: ${e.message}`); // Still attempt to load the attributes and version using SOC - const alert = await context.unsecuredSavedObjectsClient.get('alert', id); + const alert = await context.unsecuredSavedObjectsClient.get( + RULE_SAVED_OBJECT_TYPE, + id + ); attributes = alert.attributes; version = alert.version; references = alert.references; @@ -80,7 +88,7 @@ async function enableWithOCC(context: RulesClientContext, { id }: { id: string } context.auditLogger?.log( ruleAuditEvent({ action: RuleAuditAction.ENABLE, - savedObject: { type: 'alert', id }, + savedObject: { type: RULE_SAVED_OBJECT_TYPE, id }, error, }) ); @@ -91,7 +99,7 @@ async function enableWithOCC(context: RulesClientContext, { id }: { id: string } ruleAuditEvent({ action: RuleAuditAction.ENABLE, outcome: 'unknown', - savedObject: { type: 'alert', id }, + savedObject: { type: RULE_SAVED_OBJECT_TYPE, id }, }) ); @@ -140,7 +148,7 @@ async function enableWithOCC(context: RulesClientContext, { id }: { id: string } // we call create with overwrite=true if (migratedActions.hasLegacyActions) { await context.unsecuredSavedObjectsClient.create( - 'alert', + RULE_SAVED_OBJECT_TYPE, { ...updateAttributes, actions: migratedActions.resultedActions, @@ -155,9 +163,14 @@ async function enableWithOCC(context: RulesClientContext, { id }: { id: string } } ); } else { - await context.unsecuredSavedObjectsClient.update('alert', id, updateAttributes, { - version, - }); + await context.unsecuredSavedObjectsClient.update( + RULE_SAVED_OBJECT_TYPE, + id, + updateAttributes, + { + version, + } + ); } } catch (e) { throw e; @@ -193,7 +206,7 @@ async function enableWithOCC(context: RulesClientContext, { id }: { id: string } schedule: attributes.schedule as IntervalSchedule, throwOnConflict: false, }); - await context.unsecuredSavedObjectsClient.update('alert', id, { + await context.unsecuredSavedObjectsClient.update(RULE_SAVED_OBJECT_TYPE, id, { scheduledTaskId: scheduledTask.id, }); } else { diff --git a/x-pack/plugins/alerting/server/rules_client/methods/find.ts b/x-pack/plugins/alerting/server/rules_client/methods/find.ts index 537dfef55aff0..7ca51bcb16f19 100644 --- a/x-pack/plugins/alerting/server/rules_client/methods/find.ts +++ b/x-pack/plugins/alerting/server/rules_client/methods/find.ts @@ -29,6 +29,7 @@ import { alertingAuthorizationFilterOpts } from '../common/constants'; import { getAlertFromRaw } from '../lib/get_alert_from_raw'; import type { IndexType, RulesClientContext } from '../types'; import { formatLegacyActions } from '../lib'; +import { RULE_SAVED_OBJECT_TYPE } from '../../saved_objects'; export interface FindParams { options?: FindOptions; @@ -133,7 +134,7 @@ export async function find( ? nodeBuilder.and([filterKueryNode, authorizationFilter as KueryNode]) : authorizationFilter) ?? filterKueryNode, fields: fields ? includeFieldsRequiredForAuthentication(fields) : fields, - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, }); const siemRules: Rule[] = []; @@ -149,7 +150,7 @@ export async function find( context.auditLogger?.log( ruleAuditEvent({ action: RuleAuditAction.FIND, - savedObject: { type: 'alert', id }, + savedObject: { type: RULE_SAVED_OBJECT_TYPE, id }, error, }) ); @@ -179,7 +180,7 @@ export async function find( context.auditLogger?.log( ruleAuditEvent({ action: RuleAuditAction.FIND, - savedObject: { type: 'alert', id }, + savedObject: { type: RULE_SAVED_OBJECT_TYPE, id }, }) ) ); diff --git a/x-pack/plugins/alerting/server/rules_client/methods/get.ts b/x-pack/plugins/alerting/server/rules_client/methods/get.ts index 8b25f990d3cf1..3fb3a9e2e43c6 100644 --- a/x-pack/plugins/alerting/server/rules_client/methods/get.ts +++ b/x-pack/plugins/alerting/server/rules_client/methods/get.ts @@ -12,6 +12,7 @@ import { ruleAuditEvent, RuleAuditAction } from '../common/audit_events'; import { getAlertFromRaw } from '../lib/get_alert_from_raw'; import { RulesClientContext } from '../types'; import { formatLegacyActions } from '../lib'; +import { RULE_SAVED_OBJECT_TYPE } from '../../saved_objects'; export interface GetParams { id: string; @@ -29,7 +30,7 @@ export async function get( excludeFromPublicApi = false, }: GetParams ): Promise | SanitizedRuleWithLegacyId> { - const result = await context.unsecuredSavedObjectsClient.get('alert', id); + const result = await context.unsecuredSavedObjectsClient.get(RULE_SAVED_OBJECT_TYPE, id); try { await context.authorization.ensureAuthorized({ ruleTypeId: result.attributes.alertTypeId, @@ -41,7 +42,7 @@ export async function get( context.auditLogger?.log( ruleAuditEvent({ action: RuleAuditAction.GET, - savedObject: { type: 'alert', id }, + savedObject: { type: RULE_SAVED_OBJECT_TYPE, id }, error, }) ); @@ -50,7 +51,7 @@ export async function get( context.auditLogger?.log( ruleAuditEvent({ action: RuleAuditAction.GET, - savedObject: { type: 'alert', id }, + savedObject: { type: RULE_SAVED_OBJECT_TYPE, id }, }) ); const rule = getAlertFromRaw( diff --git a/x-pack/plugins/alerting/server/rules_client/methods/get_action_error_log.ts b/x-pack/plugins/alerting/server/rules_client/methods/get_action_error_log.ts index ebd1862d6b3f6..9ff65893da3a0 100644 --- a/x-pack/plugins/alerting/server/rules_client/methods/get_action_error_log.ts +++ b/x-pack/plugins/alerting/server/rules_client/methods/get_action_error_log.ts @@ -20,6 +20,7 @@ import { formatExecutionErrorsResult } from '../../lib/format_execution_log_erro import { parseDate } from '../common'; import { RulesClientContext } from '../types'; import { get } from './get'; +import { RULE_SAVED_OBJECT_TYPE } from '../../saved_objects'; const actionErrorLogDefaultFilter = 'event.provider:actions AND ((event.action:execute AND (event.outcome:failure OR kibana.alerting.status:warning)) OR (event.action:execute-timeout))'; @@ -53,7 +54,7 @@ export async function getActionErrorLog( context.auditLogger?.log( ruleAuditEvent({ action: RuleAuditAction.GET_ACTION_ERROR_LOG, - savedObject: { type: 'alert', id }, + savedObject: { type: RULE_SAVED_OBJECT_TYPE, id }, error, }) ); @@ -63,7 +64,7 @@ export async function getActionErrorLog( context.auditLogger?.log( ruleAuditEvent({ action: RuleAuditAction.GET_ACTION_ERROR_LOG, - savedObject: { type: 'alert', id }, + savedObject: { type: RULE_SAVED_OBJECT_TYPE, id }, }) ); @@ -76,7 +77,7 @@ export async function getActionErrorLog( try { const errorResult = await eventLogClient.findEventsBySavedObjectIds( - 'alert', + RULE_SAVED_OBJECT_TYPE, [id], { start: parsedDateStart.toISOString(), @@ -130,7 +131,7 @@ export async function getActionErrorLogWithAuth( context.auditLogger?.log( ruleAuditEvent({ action: RuleAuditAction.GET_ACTION_ERROR_LOG, - savedObject: { type: 'alert', id }, + savedObject: { type: RULE_SAVED_OBJECT_TYPE, id }, }) ); @@ -143,7 +144,7 @@ export async function getActionErrorLogWithAuth( try { const errorResult = await eventLogClient.findEventsWithAuthFilter( - 'alert', + RULE_SAVED_OBJECT_TYPE, [id], authorizationTuple.filter as KueryNode, namespace, diff --git a/x-pack/plugins/alerting/server/rules_client/methods/get_alert_summary.ts b/x-pack/plugins/alerting/server/rules_client/methods/get_alert_summary.ts index 8d194b850816b..7739b03372007 100644 --- a/x-pack/plugins/alerting/server/rules_client/methods/get_alert_summary.ts +++ b/x-pack/plugins/alerting/server/rules_client/methods/get_alert_summary.ts @@ -13,6 +13,7 @@ import { parseDuration } from '../../../common/parse_duration'; import { parseDate } from '../common'; import { RulesClientContext } from '../types'; import { get } from './get'; +import { RULE_SAVED_OBJECT_TYPE } from '../../saved_objects'; export interface GetAlertSummaryParams { id: string; @@ -48,7 +49,7 @@ export async function getAlertSummary( try { const [queryResults, executionResults] = await Promise.all([ eventLogClient.findEventsBySavedObjectIds( - 'alert', + RULE_SAVED_OBJECT_TYPE, [id], { page: 1, @@ -62,7 +63,7 @@ export async function getAlertSummary( rule.legacyId !== null ? [rule.legacyId] : undefined ), eventLogClient.findEventsBySavedObjectIds( - 'alert', + RULE_SAVED_OBJECT_TYPE, [id], { page: 1, diff --git a/x-pack/plugins/alerting/server/rules_client/methods/get_execution_kpi.ts b/x-pack/plugins/alerting/server/rules_client/methods/get_execution_kpi.ts index 734df53c9cb29..c063b8f90c614 100644 --- a/x-pack/plugins/alerting/server/rules_client/methods/get_execution_kpi.ts +++ b/x-pack/plugins/alerting/server/rules_client/methods/get_execution_kpi.ts @@ -20,6 +20,7 @@ import { import { RulesClientContext } from '../types'; import { parseDate } from '../common'; import { get } from './get'; +import { RULE_SAVED_OBJECT_TYPE } from '../../saved_objects'; export interface GetRuleExecutionKPIParams { id: string; @@ -54,7 +55,7 @@ export async function getRuleExecutionKPI( context.auditLogger?.log( ruleAuditEvent({ action: RuleAuditAction.GET_RULE_EXECUTION_KPI, - savedObject: { type: 'alert', id }, + savedObject: { type: RULE_SAVED_OBJECT_TYPE, id }, error, }) ); @@ -64,7 +65,7 @@ export async function getRuleExecutionKPI( context.auditLogger?.log( ruleAuditEvent({ action: RuleAuditAction.GET_RULE_EXECUTION_KPI, - savedObject: { type: 'alert', id }, + savedObject: { type: RULE_SAVED_OBJECT_TYPE, id }, }) ); @@ -77,7 +78,7 @@ export async function getRuleExecutionKPI( try { const aggResult = await eventLogClient.aggregateEventsBySavedObjectIds( - 'alert', + RULE_SAVED_OBJECT_TYPE, [id], { start: parsedDateStart.toISOString(), @@ -138,7 +139,7 @@ export async function getGlobalExecutionKpiWithAuth( try { const aggResult = await eventLogClient.aggregateEventsWithAuthFilter( - 'alert', + RULE_SAVED_OBJECT_TYPE, authorizationTuple.filter as KueryNode, { start: parsedDateStart.toISOString(), diff --git a/x-pack/plugins/alerting/server/rules_client/methods/get_execution_log.ts b/x-pack/plugins/alerting/server/rules_client/methods/get_execution_log.ts index 006109d71b4b5..f240b257bae6e 100644 --- a/x-pack/plugins/alerting/server/rules_client/methods/get_execution_log.ts +++ b/x-pack/plugins/alerting/server/rules_client/methods/get_execution_log.ts @@ -22,6 +22,7 @@ import { IExecutionLogResult } from '../../../common'; import { parseDate } from '../common'; import { RulesClientContext } from '../types'; import { get } from './get'; +import { RULE_SAVED_OBJECT_TYPE } from '../../saved_objects'; export interface GetExecutionLogByIdParams { id: string; @@ -62,7 +63,7 @@ export async function getExecutionLogForRule( context.auditLogger?.log( ruleAuditEvent({ action: RuleAuditAction.GET_EXECUTION_LOG, - savedObject: { type: 'alert', id }, + savedObject: { type: RULE_SAVED_OBJECT_TYPE, id }, error, }) ); @@ -72,7 +73,7 @@ export async function getExecutionLogForRule( context.auditLogger?.log( ruleAuditEvent({ action: RuleAuditAction.GET_EXECUTION_LOG, - savedObject: { type: 'alert', id }, + savedObject: { type: RULE_SAVED_OBJECT_TYPE, id }, }) ); @@ -85,7 +86,7 @@ export async function getExecutionLogForRule( try { const aggResult = await eventLogClient.aggregateEventsBySavedObjectIds( - 'alert', + RULE_SAVED_OBJECT_TYPE, [id], { start: parsedDateStart.toISOString(), @@ -151,7 +152,7 @@ export async function getGlobalExecutionLogWithAuth( try { const aggResult = await eventLogClient.aggregateEventsWithAuthFilter( - 'alert', + RULE_SAVED_OBJECT_TYPE, authorizationTuple.filter as KueryNode, { start: parsedDateStart.toISOString(), diff --git a/x-pack/plugins/alerting/server/rules_client/methods/mute_all.ts b/x-pack/plugins/alerting/server/rules_client/methods/mute_all.ts index 72a693aace7ac..273d794a52dc8 100644 --- a/x-pack/plugins/alerting/server/rules_client/methods/mute_all.ts +++ b/x-pack/plugins/alerting/server/rules_client/methods/mute_all.ts @@ -8,7 +8,7 @@ import { RawRule } from '../../types'; import { WriteOperations, AlertingAuthorizationEntity } from '../../authorization'; import { retryIfConflicts } from '../../lib/retry_if_conflicts'; -import { partiallyUpdateAlert } from '../../saved_objects'; +import { partiallyUpdateRule, RULE_SAVED_OBJECT_TYPE } from '../../saved_objects'; import { ruleAuditEvent, RuleAuditAction } from '../common/audit_events'; import { RulesClientContext } from '../types'; import { updateMetaAttributes } from '../lib'; @@ -25,7 +25,7 @@ export async function muteAll(context: RulesClientContext, { id }: { id: string async function muteAllWithOCC(context: RulesClientContext, { id }: { id: string }) { const { attributes, version } = await context.unsecuredSavedObjectsClient.get( - 'alert', + RULE_SAVED_OBJECT_TYPE, id ); @@ -44,7 +44,7 @@ async function muteAllWithOCC(context: RulesClientContext, { id }: { id: string context.auditLogger?.log( ruleAuditEvent({ action: RuleAuditAction.MUTE, - savedObject: { type: 'alert', id }, + savedObject: { type: RULE_SAVED_OBJECT_TYPE, id }, error, }) ); @@ -55,7 +55,7 @@ async function muteAllWithOCC(context: RulesClientContext, { id }: { id: string ruleAuditEvent({ action: RuleAuditAction.MUTE, outcome: 'unknown', - savedObject: { type: 'alert', id }, + savedObject: { type: RULE_SAVED_OBJECT_TYPE, id }, }) ); @@ -70,7 +70,7 @@ async function muteAllWithOCC(context: RulesClientContext, { id }: { id: string }); const updateOptions = { version }; - await partiallyUpdateAlert( + await partiallyUpdateRule( context.unsecuredSavedObjectsClient, id, updateAttributes, diff --git a/x-pack/plugins/alerting/server/rules_client/methods/run_soon.ts b/x-pack/plugins/alerting/server/rules_client/methods/run_soon.ts index 106f12ef50f6f..8f2d605f500dc 100644 --- a/x-pack/plugins/alerting/server/rules_client/methods/run_soon.ts +++ b/x-pack/plugins/alerting/server/rules_client/methods/run_soon.ts @@ -11,9 +11,13 @@ import { Rule } from '../../types'; import { ReadOperations, AlertingAuthorizationEntity } from '../../authorization'; import { ruleAuditEvent, RuleAuditAction } from '../common/audit_events'; import { RulesClientContext } from '../types'; +import { RULE_SAVED_OBJECT_TYPE } from '../../saved_objects'; export async function runSoon(context: RulesClientContext, { id }: { id: string }) { - const { attributes } = await context.unsecuredSavedObjectsClient.get('alert', id); + const { attributes } = await context.unsecuredSavedObjectsClient.get( + RULE_SAVED_OBJECT_TYPE, + id + ); try { await context.authorization.ensureAuthorized({ ruleTypeId: attributes.alertTypeId, @@ -29,7 +33,7 @@ export async function runSoon(context: RulesClientContext, { id }: { id: string context.auditLogger?.log( ruleAuditEvent({ action: RuleAuditAction.RUN_SOON, - savedObject: { type: 'alert', id }, + savedObject: { type: RULE_SAVED_OBJECT_TYPE, id }, error, }) ); @@ -40,7 +44,7 @@ export async function runSoon(context: RulesClientContext, { id }: { id: string ruleAuditEvent({ action: RuleAuditAction.RUN_SOON, outcome: 'unknown', - savedObject: { type: 'alert', id }, + savedObject: { type: RULE_SAVED_OBJECT_TYPE, id }, }) ); diff --git a/x-pack/plugins/alerting/server/rules_client/methods/unmute_all.ts b/x-pack/plugins/alerting/server/rules_client/methods/unmute_all.ts index 52403e2d8f70e..675387e0a600a 100644 --- a/x-pack/plugins/alerting/server/rules_client/methods/unmute_all.ts +++ b/x-pack/plugins/alerting/server/rules_client/methods/unmute_all.ts @@ -8,7 +8,7 @@ import { RawRule } from '../../types'; import { WriteOperations, AlertingAuthorizationEntity } from '../../authorization'; import { retryIfConflicts } from '../../lib/retry_if_conflicts'; -import { partiallyUpdateAlert } from '../../saved_objects'; +import { partiallyUpdateRule, RULE_SAVED_OBJECT_TYPE } from '../../saved_objects'; import { ruleAuditEvent, RuleAuditAction } from '../common/audit_events'; import { RulesClientContext } from '../types'; import { updateMetaAttributes } from '../lib'; @@ -28,7 +28,7 @@ export async function unmuteAll( async function unmuteAllWithOCC(context: RulesClientContext, { id }: { id: string }) { const { attributes, version } = await context.unsecuredSavedObjectsClient.get( - 'alert', + RULE_SAVED_OBJECT_TYPE, id ); @@ -47,7 +47,7 @@ async function unmuteAllWithOCC(context: RulesClientContext, { id }: { id: strin context.auditLogger?.log( ruleAuditEvent({ action: RuleAuditAction.UNMUTE, - savedObject: { type: 'alert', id }, + savedObject: { type: RULE_SAVED_OBJECT_TYPE, id }, error, }) ); @@ -58,7 +58,7 @@ async function unmuteAllWithOCC(context: RulesClientContext, { id }: { id: strin ruleAuditEvent({ action: RuleAuditAction.UNMUTE, outcome: 'unknown', - savedObject: { type: 'alert', id }, + savedObject: { type: RULE_SAVED_OBJECT_TYPE, id }, }) ); @@ -73,7 +73,7 @@ async function unmuteAllWithOCC(context: RulesClientContext, { id }: { id: strin }); const updateOptions = { version }; - await partiallyUpdateAlert( + await partiallyUpdateRule( context.unsecuredSavedObjectsClient, id, updateAttributes, diff --git a/x-pack/plugins/alerting/server/rules_client/methods/unmute_instance.ts b/x-pack/plugins/alerting/server/rules_client/methods/unmute_instance.ts index 86c894a7babd0..0b8e422f1a946 100644 --- a/x-pack/plugins/alerting/server/rules_client/methods/unmute_instance.ts +++ b/x-pack/plugins/alerting/server/rules_client/methods/unmute_instance.ts @@ -12,6 +12,7 @@ import { ruleAuditEvent, RuleAuditAction } from '../common/audit_events'; import { MuteOptions } from '../types'; import { RulesClientContext } from '../types'; import { updateMeta } from '../lib'; +import { RULE_SAVED_OBJECT_TYPE } from '../../saved_objects'; export async function unmuteInstance( context: RulesClientContext, @@ -35,7 +36,7 @@ async function unmuteInstanceWithOCC( } ) { const { attributes, version } = await context.unsecuredSavedObjectsClient.get( - 'alert', + RULE_SAVED_OBJECT_TYPE, alertId ); @@ -53,7 +54,7 @@ async function unmuteInstanceWithOCC( context.auditLogger?.log( ruleAuditEvent({ action: RuleAuditAction.UNMUTE_ALERT, - savedObject: { type: 'alert', id: alertId }, + savedObject: { type: RULE_SAVED_OBJECT_TYPE, id: alertId }, error, }) ); @@ -64,7 +65,7 @@ async function unmuteInstanceWithOCC( ruleAuditEvent({ action: RuleAuditAction.UNMUTE_ALERT, outcome: 'unknown', - savedObject: { type: 'alert', id: alertId }, + savedObject: { type: RULE_SAVED_OBJECT_TYPE, id: alertId }, }) ); @@ -73,7 +74,7 @@ async function unmuteInstanceWithOCC( const mutedInstanceIds = attributes.mutedInstanceIds || []; if (!attributes.muteAll && mutedInstanceIds.includes(alertInstanceId)) { await context.unsecuredSavedObjectsClient.update( - 'alert', + RULE_SAVED_OBJECT_TYPE, alertId, updateMeta(context, { updatedBy: await context.getUserName(), diff --git a/x-pack/plugins/alerting/server/rules_client/methods/update.ts b/x-pack/plugins/alerting/server/rules_client/methods/update.ts index e302b02a0e163..8fb0de5f3519c 100644 --- a/x-pack/plugins/alerting/server/rules_client/methods/update.ts +++ b/x-pack/plugins/alerting/server/rules_client/methods/update.ts @@ -37,6 +37,7 @@ import { validateScheduleLimit, ValidateScheduleLimitResult, } from '../../application/rule/methods/get_schedule_frequency'; +import { RULE_SAVED_OBJECT_TYPE } from '../../saved_objects'; type ShouldIncrementRevision = (params?: RuleTypeParams) => boolean; @@ -80,16 +81,23 @@ async function updateWithOCC( try { alertSavedObject = - await context.encryptedSavedObjectsClient.getDecryptedAsInternalUser('alert', id, { - namespace: context.namespace, - }); + await context.encryptedSavedObjectsClient.getDecryptedAsInternalUser( + RULE_SAVED_OBJECT_TYPE, + id, + { + namespace: context.namespace, + } + ); } catch (e) { // We'll skip invalidating the API key since we failed to load the decrypted saved object context.logger.error( `update(): Failed to load API key to invalidate on alert ${id}: ${e.message}` ); // Still attempt to load the object using SOC - alertSavedObject = await context.unsecuredSavedObjectsClient.get('alert', id); + alertSavedObject = await context.unsecuredSavedObjectsClient.get( + RULE_SAVED_OBJECT_TYPE, + id + ); } const { @@ -127,7 +135,7 @@ async function updateWithOCC( context.auditLogger?.log( ruleAuditEvent({ action: RuleAuditAction.UPDATE, - savedObject: { type: 'alert', id }, + savedObject: { type: RULE_SAVED_OBJECT_TYPE, id }, error, }) ); @@ -138,7 +146,7 @@ async function updateWithOCC( ruleAuditEvent({ action: RuleAuditAction.UPDATE, outcome: 'unknown', - savedObject: { type: 'alert', id }, + savedObject: { type: RULE_SAVED_OBJECT_TYPE, id }, }) ); @@ -277,7 +285,7 @@ async function updateAlert( try { updatedObject = await context.unsecuredSavedObjectsClient.create( - 'alert', + RULE_SAVED_OBJECT_TYPE, createAttributes, { id, diff --git a/x-pack/plugins/alerting/server/rules_client/methods/update_api_key.ts b/x-pack/plugins/alerting/server/rules_client/methods/update_api_key.ts index d8d78264c448b..ae9367b13963d 100644 --- a/x-pack/plugins/alerting/server/rules_client/methods/update_api_key.ts +++ b/x-pack/plugins/alerting/server/rules_client/methods/update_api_key.ts @@ -12,6 +12,7 @@ import { bulkMarkApiKeysForInvalidation } from '../../invalidate_pending_api_key import { ruleAuditEvent, RuleAuditAction } from '../common/audit_events'; import { createNewAPIKeySet, updateMeta } from '../lib'; import { RulesClientContext } from '../types'; +import { RULE_SAVED_OBJECT_TYPE } from '../../saved_objects'; export async function updateApiKey( context: RulesClientContext, @@ -32,9 +33,13 @@ async function updateApiKeyWithOCC(context: RulesClientContext, { id }: { id: st try { const decryptedAlert = - await context.encryptedSavedObjectsClient.getDecryptedAsInternalUser('alert', id, { - namespace: context.namespace, - }); + await context.encryptedSavedObjectsClient.getDecryptedAsInternalUser( + RULE_SAVED_OBJECT_TYPE, + id, + { + namespace: context.namespace, + } + ); oldApiKeyToInvalidate = decryptedAlert.attributes.apiKey; oldApiKeyCreatedByUser = decryptedAlert.attributes.apiKeyCreatedByUser; attributes = decryptedAlert.attributes; @@ -45,7 +50,10 @@ async function updateApiKeyWithOCC(context: RulesClientContext, { id }: { id: st `updateApiKey(): Failed to load API key to invalidate on alert ${id}: ${e.message}` ); // Still attempt to load the attributes and version using SOC - const alert = await context.unsecuredSavedObjectsClient.get('alert', id); + const alert = await context.unsecuredSavedObjectsClient.get( + RULE_SAVED_OBJECT_TYPE, + id + ); attributes = alert.attributes; version = alert.version; } @@ -64,7 +72,7 @@ async function updateApiKeyWithOCC(context: RulesClientContext, { id }: { id: st context.auditLogger?.log( ruleAuditEvent({ action: RuleAuditAction.UPDATE_API_KEY, - savedObject: { type: 'alert', id }, + savedObject: { type: RULE_SAVED_OBJECT_TYPE, id }, error, }) ); @@ -92,14 +100,16 @@ async function updateApiKeyWithOCC(context: RulesClientContext, { id }: { id: st ruleAuditEvent({ action: RuleAuditAction.UPDATE_API_KEY, outcome: 'unknown', - savedObject: { type: 'alert', id }, + savedObject: { type: RULE_SAVED_OBJECT_TYPE, id }, }) ); context.ruleTypeRegistry.ensureRuleTypeEnabled(attributes.alertTypeId); try { - await context.unsecuredSavedObjectsClient.update('alert', id, updateAttributes, { version }); + await context.unsecuredSavedObjectsClient.update(RULE_SAVED_OBJECT_TYPE, id, updateAttributes, { + version, + }); } catch (e) { // Avoid unused API key await bulkMarkApiKeysForInvalidation( diff --git a/x-pack/plugins/alerting/server/rules_client/tests/bulk_enable.test.ts b/x-pack/plugins/alerting/server/rules_client/tests/bulk_enable.test.ts index af03c5908daff..e9317972474cd 100644 --- a/x-pack/plugins/alerting/server/rules_client/tests/bulk_enable.test.ts +++ b/x-pack/plugins/alerting/server/rules_client/tests/bulk_enable.test.ts @@ -34,6 +34,7 @@ import { } from './test_helpers'; import { TaskStatus } from '@kbn/task-manager-plugin/server'; import { migrateLegacyActions } from '../lib'; +import { RULE_SAVED_OBJECT_TYPE } from '../../saved_objects'; jest.mock('../lib/siem_legacy_actions/migrate_legacy_actions', () => { return { @@ -767,12 +768,12 @@ describe('bulkEnableRules', () => { expect(auditLogger.log.mock.calls[0][0]?.event?.action).toEqual('rule_enable'); expect(auditLogger.log.mock.calls[0][0]?.event?.outcome).toEqual('unknown'); expect(auditLogger.log.mock.calls[0][0]?.kibana).toEqual({ - saved_object: { id: 'id1', type: 'alert' }, + saved_object: { id: 'id1', type: RULE_SAVED_OBJECT_TYPE }, }); expect(auditLogger.log.mock.calls[1][0]?.event?.action).toEqual('rule_enable'); expect(auditLogger.log.mock.calls[1][0]?.event?.outcome).toEqual('unknown'); expect(auditLogger.log.mock.calls[1][0]?.kibana).toEqual({ - saved_object: { id: 'id2', type: 'alert' }, + saved_object: { id: 'id2', type: RULE_SAVED_OBJECT_TYPE }, }); }); diff --git a/x-pack/plugins/alerting/server/rules_client/tests/clear_expired_snoozes.test.ts b/x-pack/plugins/alerting/server/rules_client/tests/clear_expired_snoozes.test.ts index b64f192045511..59dbfd8c87998 100644 --- a/x-pack/plugins/alerting/server/rules_client/tests/clear_expired_snoozes.test.ts +++ b/x-pack/plugins/alerting/server/rules_client/tests/clear_expired_snoozes.test.ts @@ -25,6 +25,7 @@ import { getBeforeSetup, mockedDateString } from './lib'; import { eventLoggerMock } from '@kbn/event-log-plugin/server/event_logger.mock'; import { TaskStatus } from '@kbn/task-manager-plugin/server'; import { RuleSnooze } from '../../types'; +import { RULE_SAVED_OBJECT_TYPE } from '../../saved_objects'; jest.mock('../../invalidate_pending_api_keys/bulk_mark_api_keys_for_invalidation', () => ({ bulkMarkApiKeysForInvalidation: jest.fn(), @@ -113,7 +114,7 @@ describe('clearExpiredSnoozes()', () => { ]); await rulesClient.clearExpiredSnoozes({ rule: { ...attributes, id } }); expect(unsecuredSavedObjectsClient.update).toHaveBeenCalledWith( - 'alert', + RULE_SAVED_OBJECT_TYPE, '1', { updatedAt: '2019-02-12T21:01:22.479Z', @@ -158,7 +159,7 @@ describe('clearExpiredSnoozes()', () => { ]); await rulesClient.clearExpiredSnoozes({ rule: { ...attributes, id } }); expect(unsecuredSavedObjectsClient.update).toHaveBeenCalledWith( - 'alert', + RULE_SAVED_OBJECT_TYPE, '1', { updatedAt: '2019-02-12T21:01:22.479Z', @@ -208,7 +209,7 @@ describe('clearExpiredSnoozes()', () => { function setupTestWithSnoozeSchedule(snoozeSchedule: RuleSnooze) { const rule = { id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { name: 'name', consumer: 'myApp', diff --git a/x-pack/plugins/alerting/server/rules_client/tests/delete.test.ts b/x-pack/plugins/alerting/server/rules_client/tests/delete.test.ts index a4e581414744a..dbdfea132e2ef 100644 --- a/x-pack/plugins/alerting/server/rules_client/tests/delete.test.ts +++ b/x-pack/plugins/alerting/server/rules_client/tests/delete.test.ts @@ -24,6 +24,7 @@ import { auditLoggerMock } from '@kbn/security-plugin/server/audit/mocks'; import { getBeforeSetup } from './lib'; import { bulkMarkApiKeysForInvalidation } from '../../invalidate_pending_api_keys/bulk_mark_api_keys_for_invalidation'; import { migrateLegacyActions } from '../lib'; +import { RULE_SAVED_OBJECT_TYPE } from '../../saved_objects'; jest.mock('../lib/siem_legacy_actions/migrate_legacy_actions', () => { return { @@ -84,7 +85,7 @@ describe('delete()', () => { let rulesClient: RulesClient; const existingAlert = { id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { alertTypeId: 'myType', consumer: 'myApp', @@ -132,7 +133,7 @@ describe('delete()', () => { test('successfully removes an alert', async () => { const result = await rulesClient.delete({ id: '1' }); expect(result).toEqual({ success: true }); - expect(unsecuredSavedObjectsClient.delete).toHaveBeenCalledWith('alert', '1'); + expect(unsecuredSavedObjectsClient.delete).toHaveBeenCalledWith(RULE_SAVED_OBJECT_TYPE, '1'); expect(taskManager.removeIfExists).toHaveBeenCalledWith('task-123'); expect(bulkMarkApiKeysForInvalidation).toHaveBeenCalledTimes(1); expect(bulkMarkApiKeysForInvalidation).toHaveBeenCalledWith( @@ -140,9 +141,13 @@ describe('delete()', () => { expect.any(Object), expect.any(Object) ); - expect(encryptedSavedObjects.getDecryptedAsInternalUser).toHaveBeenCalledWith('alert', '1', { - namespace: 'default', - }); + expect(encryptedSavedObjects.getDecryptedAsInternalUser).toHaveBeenCalledWith( + RULE_SAVED_OBJECT_TYPE, + '1', + { + namespace: 'default', + } + ); expect(unsecuredSavedObjectsClient.get).not.toHaveBeenCalled(); }); @@ -151,10 +156,10 @@ describe('delete()', () => { const result = await rulesClient.delete({ id: '1' }); expect(result).toEqual({ success: true }); - expect(unsecuredSavedObjectsClient.delete).toHaveBeenCalledWith('alert', '1'); + expect(unsecuredSavedObjectsClient.delete).toHaveBeenCalledWith(RULE_SAVED_OBJECT_TYPE, '1'); expect(taskManager.removeIfExists).toHaveBeenCalledWith('task-123'); expect(unsecuredSavedObjectsClient.create).not.toHaveBeenCalled(); - expect(unsecuredSavedObjectsClient.get).toHaveBeenCalledWith('alert', '1'); + expect(unsecuredSavedObjectsClient.get).toHaveBeenCalledWith(RULE_SAVED_OBJECT_TYPE, '1'); expect(rulesClientParams.logger.error).toHaveBeenCalledWith( 'delete(): Failed to load API key to invalidate on alert 1: Fail' ); @@ -298,7 +303,7 @@ describe('delete()', () => { action: 'rule_delete', outcome: 'unknown', }), - kibana: { saved_object: { id: '1', type: 'alert' } }, + kibana: { saved_object: { id: '1', type: RULE_SAVED_OBJECT_TYPE } }, }) ); }); @@ -316,7 +321,7 @@ describe('delete()', () => { kibana: { saved_object: { id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, }, }, error: { diff --git a/x-pack/plugins/alerting/server/rules_client/tests/disable.test.ts b/x-pack/plugins/alerting/server/rules_client/tests/disable.test.ts index ca6c242539a9a..01b9d551174cf 100644 --- a/x-pack/plugins/alerting/server/rules_client/tests/disable.test.ts +++ b/x-pack/plugins/alerting/server/rules_client/tests/disable.test.ts @@ -25,6 +25,7 @@ import { eventLoggerMock } from '@kbn/event-log-plugin/server/event_logger.mock' import { TaskStatus } from '@kbn/task-manager-plugin/server'; import { migrateLegacyActions } from '../lib'; import { migrateLegacyActionsMock } from '../lib/siem_legacy_actions/retrieve_migrated_legacy_actions.mock'; +import { RULE_SAVED_OBJECT_TYPE } from '../../saved_objects'; jest.mock('../lib/siem_legacy_actions/migrate_legacy_actions', () => { return { @@ -103,7 +104,7 @@ describe('disable()', () => { let rulesClient: RulesClient; const existingRule = { id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { consumer: 'myApp', schedule: { interval: '10s' }, @@ -187,7 +188,7 @@ describe('disable()', () => { action: 'rule_disable', outcome: 'unknown', }), - kibana: { saved_object: { id: '1', type: 'alert' } }, + kibana: { saved_object: { id: '1', type: RULE_SAVED_OBJECT_TYPE } }, }) ); }); @@ -205,7 +206,7 @@ describe('disable()', () => { kibana: { saved_object: { id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, }, }, error: { @@ -220,11 +221,15 @@ describe('disable()', () => { test('disables an rule', async () => { await rulesClient.disable({ id: '1' }); expect(unsecuredSavedObjectsClient.get).not.toHaveBeenCalled(); - expect(encryptedSavedObjects.getDecryptedAsInternalUser).toHaveBeenCalledWith('alert', '1', { - namespace: 'default', - }); + expect(encryptedSavedObjects.getDecryptedAsInternalUser).toHaveBeenCalledWith( + RULE_SAVED_OBJECT_TYPE, + '1', + { + namespace: 'default', + } + ); expect(unsecuredSavedObjectsClient.update).toHaveBeenCalledWith( - 'alert', + RULE_SAVED_OBJECT_TYPE, '1', { consumer: 'myApp', @@ -294,11 +299,15 @@ describe('disable()', () => { }); await rulesClient.disable({ id: '1' }); expect(unsecuredSavedObjectsClient.get).not.toHaveBeenCalled(); - expect(encryptedSavedObjects.getDecryptedAsInternalUser).toHaveBeenCalledWith('alert', '1', { - namespace: 'default', - }); + expect(encryptedSavedObjects.getDecryptedAsInternalUser).toHaveBeenCalledWith( + RULE_SAVED_OBJECT_TYPE, + '1', + { + namespace: 'default', + } + ); expect(unsecuredSavedObjectsClient.update).toHaveBeenCalledWith( - 'alert', + RULE_SAVED_OBJECT_TYPE, '1', { consumer: 'myApp', @@ -339,7 +348,7 @@ describe('disable()', () => { event: { action: 'untracked-instance', category: ['alerts'], - kind: 'alert', + kind: RULE_SAVED_OBJECT_TYPE, }, kibana: { alert: { @@ -359,7 +368,7 @@ describe('disable()', () => { id: '1', namespace: 'default', rel: 'primary', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, type_id: 'myType', }, ], @@ -379,11 +388,15 @@ describe('disable()', () => { taskManager.get.mockRejectedValueOnce(new Error('Fail')); await rulesClient.disable({ id: '1' }); expect(unsecuredSavedObjectsClient.get).not.toHaveBeenCalled(); - expect(encryptedSavedObjects.getDecryptedAsInternalUser).toHaveBeenCalledWith('alert', '1', { - namespace: 'default', - }); + expect(encryptedSavedObjects.getDecryptedAsInternalUser).toHaveBeenCalledWith( + RULE_SAVED_OBJECT_TYPE, + '1', + { + namespace: 'default', + } + ); expect(unsecuredSavedObjectsClient.update).toHaveBeenCalledWith( - 'alert', + RULE_SAVED_OBJECT_TYPE, '1', { consumer: 'myApp', @@ -428,12 +441,16 @@ describe('disable()', () => { test('falls back when getDecryptedAsInternalUser throws an error', async () => { encryptedSavedObjects.getDecryptedAsInternalUser.mockRejectedValueOnce(new Error('Fail')); await rulesClient.disable({ id: '1' }); - expect(unsecuredSavedObjectsClient.get).toHaveBeenCalledWith('alert', '1'); - expect(encryptedSavedObjects.getDecryptedAsInternalUser).toHaveBeenCalledWith('alert', '1', { - namespace: 'default', - }); + expect(unsecuredSavedObjectsClient.get).toHaveBeenCalledWith(RULE_SAVED_OBJECT_TYPE, '1'); + expect(encryptedSavedObjects.getDecryptedAsInternalUser).toHaveBeenCalledWith( + RULE_SAVED_OBJECT_TYPE, + '1', + { + namespace: 'default', + } + ); expect(unsecuredSavedObjectsClient.update).toHaveBeenCalledWith( - 'alert', + RULE_SAVED_OBJECT_TYPE, '1', { consumer: 'myApp', @@ -522,11 +539,15 @@ describe('disable()', () => { }); await rulesClient.disable({ id: '1' }); expect(unsecuredSavedObjectsClient.get).not.toHaveBeenCalled(); - expect(encryptedSavedObjects.getDecryptedAsInternalUser).toHaveBeenCalledWith('alert', '1', { - namespace: 'default', - }); + expect(encryptedSavedObjects.getDecryptedAsInternalUser).toHaveBeenCalledWith( + RULE_SAVED_OBJECT_TYPE, + '1', + { + namespace: 'default', + } + ); expect(unsecuredSavedObjectsClient.update).toHaveBeenCalledWith( - 'alert', + RULE_SAVED_OBJECT_TYPE, '1', { consumer: 'myApp', @@ -571,11 +592,15 @@ describe('disable()', () => { `"Failed to remove task"` ); expect(unsecuredSavedObjectsClient.get).not.toHaveBeenCalled(); - expect(encryptedSavedObjects.getDecryptedAsInternalUser).toHaveBeenCalledWith('alert', '1', { - namespace: 'default', - }); + expect(encryptedSavedObjects.getDecryptedAsInternalUser).toHaveBeenCalledWith( + RULE_SAVED_OBJECT_TYPE, + '1', + { + namespace: 'default', + } + ); expect(unsecuredSavedObjectsClient.update).toHaveBeenCalledWith( - 'alert', + RULE_SAVED_OBJECT_TYPE, '1', { consumer: 'myApp', diff --git a/x-pack/plugins/alerting/server/rules_client/tests/enable.test.ts b/x-pack/plugins/alerting/server/rules_client/tests/enable.test.ts index 9ab3a919f01a5..aa587dfb99bfa 100644 --- a/x-pack/plugins/alerting/server/rules_client/tests/enable.test.ts +++ b/x-pack/plugins/alerting/server/rules_client/tests/enable.test.ts @@ -24,6 +24,7 @@ import { auditLoggerMock } from '@kbn/security-plugin/server/audit/mocks'; import { getBeforeSetup, setGlobalDate } from './lib'; import { migrateLegacyActions } from '../lib'; import { migrateLegacyActionsMock } from '../lib/siem_legacy_actions/retrieve_migrated_legacy_actions.mock'; +import { RULE_SAVED_OBJECT_TYPE } from '../../saved_objects'; jest.mock('../lib/siem_legacy_actions/migrate_legacy_actions', () => { return { @@ -81,7 +82,7 @@ describe('enable()', () => { const existingRule = { id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { name: 'name', consumer: 'myApp', @@ -191,7 +192,7 @@ describe('enable()', () => { action: 'rule_enable', outcome: 'unknown', }), - kibana: { saved_object: { id: '1', type: 'alert' } }, + kibana: { saved_object: { id: '1', type: RULE_SAVED_OBJECT_TYPE } }, }) ); }); @@ -209,7 +210,7 @@ describe('enable()', () => { kibana: { saved_object: { id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, }, }, error: { @@ -224,12 +225,16 @@ describe('enable()', () => { test('enables a rule', async () => { await rulesClient.enable({ id: '1' }); expect(unsecuredSavedObjectsClient.get).not.toHaveBeenCalled(); - expect(encryptedSavedObjects.getDecryptedAsInternalUser).toHaveBeenCalledWith('alert', '1', { - namespace: 'default', - }); + expect(encryptedSavedObjects.getDecryptedAsInternalUser).toHaveBeenCalledWith( + RULE_SAVED_OBJECT_TYPE, + '1', + { + namespace: 'default', + } + ); expect(unsecuredSavedObjectsClient.create).not.toBeCalledWith('api_key_pending_invalidation'); expect(unsecuredSavedObjectsClient.update).toHaveBeenCalledWith( - 'alert', + RULE_SAVED_OBJECT_TYPE, '1', { name: 'name', @@ -280,13 +285,17 @@ describe('enable()', () => { }); await rulesClient.enable({ id: '1' }); expect(unsecuredSavedObjectsClient.get).not.toHaveBeenCalled(); - expect(encryptedSavedObjects.getDecryptedAsInternalUser).toHaveBeenCalledWith('alert', '1', { - namespace: 'default', - }); + expect(encryptedSavedObjects.getDecryptedAsInternalUser).toHaveBeenCalledWith( + RULE_SAVED_OBJECT_TYPE, + '1', + { + namespace: 'default', + } + ); expect(unsecuredSavedObjectsClient.create).not.toBeCalledWith('api_key_pending_invalidation'); expect(rulesClientParams.createAPIKey).toHaveBeenCalledWith('Alerting: myType/name'); expect(unsecuredSavedObjectsClient.update).toHaveBeenCalledWith( - 'alert', + RULE_SAVED_OBJECT_TYPE, '1', { name: 'name', @@ -353,7 +362,7 @@ describe('enable()', () => { await rulesClient.enable({ id: '1' }); expect(unsecuredSavedObjectsClient.update).toHaveBeenCalledWith( - 'alert', + RULE_SAVED_OBJECT_TYPE, '1', { name: 'name', @@ -412,7 +421,7 @@ describe('enable()', () => { encryptedSavedObjects.getDecryptedAsInternalUser.mockRejectedValue(new Error('Fail')); await rulesClient.enable({ id: '1' }); - expect(unsecuredSavedObjectsClient.get).toHaveBeenCalledWith('alert', '1'); + expect(unsecuredSavedObjectsClient.get).toHaveBeenCalledWith(RULE_SAVED_OBJECT_TYPE, '1'); expect(rulesClientParams.logger.error).toHaveBeenCalledWith( 'enable(): Failed to load API key of alert 1: Fail' ); @@ -451,9 +460,13 @@ describe('enable()', () => { test('enables task when scheduledTaskId is defined and task exists', async () => { await rulesClient.enable({ id: '1' }); expect(unsecuredSavedObjectsClient.get).not.toHaveBeenCalled(); - expect(encryptedSavedObjects.getDecryptedAsInternalUser).toHaveBeenCalledWith('alert', '1', { - namespace: 'default', - }); + expect(encryptedSavedObjects.getDecryptedAsInternalUser).toHaveBeenCalledWith( + RULE_SAVED_OBJECT_TYPE, + '1', + { + namespace: 'default', + } + ); expect(unsecuredSavedObjectsClient.update).toHaveBeenCalled(); expect(taskManager.bulkEnable).toHaveBeenCalledWith(['task-123']); }); @@ -464,9 +477,13 @@ describe('enable()', () => { `"Failed to enable task"` ); expect(unsecuredSavedObjectsClient.get).not.toHaveBeenCalled(); - expect(encryptedSavedObjects.getDecryptedAsInternalUser).toHaveBeenCalledWith('alert', '1', { - namespace: 'default', - }); + expect(encryptedSavedObjects.getDecryptedAsInternalUser).toHaveBeenCalledWith( + RULE_SAVED_OBJECT_TYPE, + '1', + { + namespace: 'default', + } + ); expect(unsecuredSavedObjectsClient.update).toHaveBeenCalled(); }); @@ -487,9 +504,13 @@ describe('enable()', () => { taskManager.get.mockRejectedValueOnce(new Error('Failed to get task!')); await rulesClient.enable({ id: '1' }); expect(unsecuredSavedObjectsClient.get).not.toHaveBeenCalled(); - expect(encryptedSavedObjects.getDecryptedAsInternalUser).toHaveBeenCalledWith('alert', '1', { - namespace: 'default', - }); + expect(encryptedSavedObjects.getDecryptedAsInternalUser).toHaveBeenCalledWith( + RULE_SAVED_OBJECT_TYPE, + '1', + { + namespace: 'default', + } + ); expect(unsecuredSavedObjectsClient.update).toHaveBeenCalledTimes(2); expect(taskManager.bulkEnable).not.toHaveBeenCalled(); expect(taskManager.schedule).toHaveBeenCalledWith({ @@ -511,9 +532,14 @@ describe('enable()', () => { }, scope: ['alerting'], }); - expect(unsecuredSavedObjectsClient.update).toHaveBeenNthCalledWith(2, 'alert', '1', { - scheduledTaskId: '1', - }); + expect(unsecuredSavedObjectsClient.update).toHaveBeenNthCalledWith( + 2, + RULE_SAVED_OBJECT_TYPE, + '1', + { + scheduledTaskId: '1', + } + ); }); test('schedules task when scheduledTaskId is not defined', async () => { @@ -536,9 +562,13 @@ describe('enable()', () => { }); await rulesClient.enable({ id: '1' }); expect(unsecuredSavedObjectsClient.get).not.toHaveBeenCalled(); - expect(encryptedSavedObjects.getDecryptedAsInternalUser).toHaveBeenCalledWith('alert', '1', { - namespace: 'default', - }); + expect(encryptedSavedObjects.getDecryptedAsInternalUser).toHaveBeenCalledWith( + RULE_SAVED_OBJECT_TYPE, + '1', + { + namespace: 'default', + } + ); expect(unsecuredSavedObjectsClient.update).toHaveBeenCalledTimes(2); expect(taskManager.bulkEnable).not.toHaveBeenCalled(); expect(taskManager.schedule).toHaveBeenCalledWith({ @@ -560,9 +590,14 @@ describe('enable()', () => { }, scope: ['alerting'], }); - expect(unsecuredSavedObjectsClient.update).toHaveBeenNthCalledWith(2, 'alert', '1', { - scheduledTaskId: '1', - }); + expect(unsecuredSavedObjectsClient.update).toHaveBeenNthCalledWith( + 2, + RULE_SAVED_OBJECT_TYPE, + '1', + { + scheduledTaskId: '1', + } + ); }); test('schedules task when task with scheduledTaskId exists but is unrecognized', async () => { @@ -582,9 +617,13 @@ describe('enable()', () => { taskManager.get.mockResolvedValue({ ...mockTask, status: TaskStatus.Unrecognized }); await rulesClient.enable({ id: '1' }); expect(unsecuredSavedObjectsClient.get).not.toHaveBeenCalled(); - expect(encryptedSavedObjects.getDecryptedAsInternalUser).toHaveBeenCalledWith('alert', '1', { - namespace: 'default', - }); + expect(encryptedSavedObjects.getDecryptedAsInternalUser).toHaveBeenCalledWith( + RULE_SAVED_OBJECT_TYPE, + '1', + { + namespace: 'default', + } + ); expect(unsecuredSavedObjectsClient.update).toHaveBeenCalledTimes(2); expect(taskManager.bulkEnable).not.toHaveBeenCalled(); expect(taskManager.removeIfExists).toHaveBeenCalledWith('task-123'); @@ -607,9 +646,14 @@ describe('enable()', () => { }, scope: ['alerting'], }); - expect(unsecuredSavedObjectsClient.update).toHaveBeenNthCalledWith(2, 'alert', '1', { - scheduledTaskId: '1', - }); + expect(unsecuredSavedObjectsClient.update).toHaveBeenNthCalledWith( + 2, + RULE_SAVED_OBJECT_TYPE, + '1', + { + scheduledTaskId: '1', + } + ); }); test('throws error when scheduling task fails', async () => { @@ -637,9 +681,13 @@ describe('enable()', () => { ); await rulesClient.enable({ id: '1' }); expect(unsecuredSavedObjectsClient.get).not.toHaveBeenCalled(); - expect(encryptedSavedObjects.getDecryptedAsInternalUser).toHaveBeenCalledWith('alert', '1', { - namespace: 'default', - }); + expect(encryptedSavedObjects.getDecryptedAsInternalUser).toHaveBeenCalledWith( + RULE_SAVED_OBJECT_TYPE, + '1', + { + namespace: 'default', + } + ); expect(unsecuredSavedObjectsClient.update).toHaveBeenCalledTimes(2); expect(taskManager.bulkEnable).not.toHaveBeenCalled(); expect(taskManager.schedule).toHaveBeenCalled(); @@ -681,9 +729,14 @@ describe('enable()', () => { expect(unsecuredSavedObjectsClient.update).toHaveBeenCalledTimes(2); expect(taskManager.schedule).toHaveBeenCalled(); expect(taskManager.bulkEnable).not.toHaveBeenCalled(); - expect(unsecuredSavedObjectsClient.update).toHaveBeenNthCalledWith(2, 'alert', '1', { - scheduledTaskId: '1', - }); + expect(unsecuredSavedObjectsClient.update).toHaveBeenNthCalledWith( + 2, + RULE_SAVED_OBJECT_TYPE, + '1', + { + scheduledTaskId: '1', + } + ); }); describe('legacy actions migration for SIEM', () => { @@ -722,7 +775,7 @@ describe('enable()', () => { }); // to mitigate AAD issues, we call create with overwrite=true and actions related props expect(unsecuredSavedObjectsClient.create).toHaveBeenCalledWith( - 'alert', + RULE_SAVED_OBJECT_TYPE, expect.objectContaining({ ...existingDecryptedSiemRule.attributes, actions: ['fake-action-1'], diff --git a/x-pack/plugins/alerting/server/rules_client/tests/find.test.ts b/x-pack/plugins/alerting/server/rules_client/tests/find.test.ts index 3aea832752dfa..a6fa751469625 100644 --- a/x-pack/plugins/alerting/server/rules_client/tests/find.test.ts +++ b/x-pack/plugins/alerting/server/rules_client/tests/find.test.ts @@ -26,6 +26,7 @@ import { RegistryRuleType } from '../../rule_type_registry'; import { schema } from '@kbn/config-schema'; import { enabledRule1, enabledRule2, siemRule1, siemRule2 } from './test_helpers'; import { formatLegacyActions } from '../lib'; +import { RULE_SAVED_OBJECT_TYPE } from '../../saved_objects'; jest.mock('../lib/siem_legacy_actions/format_legacy_actions', () => { return { @@ -108,7 +109,7 @@ describe('find()', () => { saved_objects: [ { id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { alertTypeId: 'myType', schedule: { interval: '10s' }, @@ -221,7 +222,7 @@ describe('find()', () => { saved_objects: [ { id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { alertTypeId: 'myType', schedule: { interval: '10s' }, @@ -322,7 +323,7 @@ describe('find()', () => { saved_objects: [ { id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { alertTypeId: 'myType', schedule: { interval: '10s' }, @@ -524,7 +525,7 @@ describe('find()', () => { saved_objects: [ { id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { alertTypeId: 'myType', schedule: { interval: '10s' }, @@ -555,7 +556,7 @@ describe('find()', () => { }, { id: '2', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { alertTypeId: '123', schedule: { interval: '20s' }, @@ -738,7 +739,7 @@ describe('find()', () => { saved_objects: [ { id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { alertTypeId: 'myType', schedule: { interval: '10s' }, @@ -769,7 +770,7 @@ describe('find()', () => { }, { id: '2', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { alertTypeId: '123', schedule: { interval: '20s' }, @@ -854,7 +855,7 @@ describe('find()', () => { saved_objects: [ { id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { actions: [], alertTypeId: 'myType', @@ -893,7 +894,7 @@ describe('find()', () => { fields: ['tags', 'alertTypeId', 'consumer'], filter: null, sortField: undefined, - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, }); expect(ensureRuleTypeIsAuthorized).toHaveBeenCalledWith('myType', 'myApp', 'rule'); }); @@ -909,7 +910,7 @@ describe('find()', () => { action: 'rule_find', outcome: 'success', }), - kibana: { saved_object: { id: '1', type: 'alert' } }, + kibana: { saved_object: { id: '1', type: RULE_SAVED_OBJECT_TYPE } }, }) ); }); @@ -948,7 +949,7 @@ describe('find()', () => { action: 'rule_find', outcome: 'failure', }), - kibana: { saved_object: { id: '1', type: 'alert' } }, + kibana: { saved_object: { id: '1', type: RULE_SAVED_OBJECT_TYPE } }, error: { code: 'Error', message: 'Unauthorized', diff --git a/x-pack/plugins/alerting/server/rules_client/tests/get.test.ts b/x-pack/plugins/alerting/server/rules_client/tests/get.test.ts index 0d29a3fc402d1..c8eaa3eb319ec 100644 --- a/x-pack/plugins/alerting/server/rules_client/tests/get.test.ts +++ b/x-pack/plugins/alerting/server/rules_client/tests/get.test.ts @@ -23,6 +23,7 @@ import { auditLoggerMock } from '@kbn/security-plugin/server/audit/mocks'; import { getBeforeSetup, setGlobalDate } from './lib'; import { RecoveredActionGroup } from '../../../common'; import { formatLegacyActions } from '../lib'; +import { RULE_SAVED_OBJECT_TYPE } from '../../saved_objects'; jest.mock('../lib/siem_legacy_actions/format_legacy_actions', () => { return { @@ -76,7 +77,7 @@ describe('get()', () => { const rulesClient = new RulesClient(rulesClientParams); unsecuredSavedObjectsClient.get.mockResolvedValueOnce({ id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { alertTypeId: '123', schedule: { interval: '10s' }, @@ -143,7 +144,7 @@ describe('get()', () => { const rulesClient = new RulesClient(rulesClientParams); unsecuredSavedObjectsClient.get.mockResolvedValueOnce({ id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { alertTypeId: '123', schedule: { interval: '10s' }, @@ -224,7 +225,7 @@ describe('get()', () => { const rulesClient = new RulesClient(rulesClientParams); unsecuredSavedObjectsClient.get.mockResolvedValueOnce({ id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { alertTypeId: '123', schedule: { interval: '10s' }, @@ -327,7 +328,7 @@ describe('get()', () => { const rulesClient = new RulesClient(rulesClientParams); unsecuredSavedObjectsClient.get.mockResolvedValueOnce({ id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { alertTypeId: '123', schedule: { interval: '10s' }, @@ -402,7 +403,7 @@ describe('get()', () => { const rulesClient = new RulesClient(rulesClientParams); unsecuredSavedObjectsClient.get.mockResolvedValueOnce({ id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { alertTypeId: '123', schedule: { interval: '10s' }, @@ -455,7 +456,7 @@ describe('get()', () => { const rulesClient = new RulesClient(rulesClientParams); unsecuredSavedObjectsClient.get.mockResolvedValueOnce({ id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { alertTypeId: '123', schedule: { interval: '10s' }, @@ -498,7 +499,7 @@ describe('get()', () => { beforeEach(() => { unsecuredSavedObjectsClient.get.mockResolvedValueOnce({ id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { alertTypeId: 'myType', consumer: 'myApp', @@ -561,7 +562,7 @@ describe('get()', () => { beforeEach(() => { unsecuredSavedObjectsClient.get.mockResolvedValueOnce({ id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { alertTypeId: '123', schedule: { interval: '10s' }, @@ -583,7 +584,7 @@ describe('get()', () => { action: 'rule_get', outcome: 'success', }), - kibana: { saved_object: { id: '1', type: 'alert' } }, + kibana: { saved_object: { id: '1', type: RULE_SAVED_OBJECT_TYPE } }, }) ); }); @@ -602,7 +603,7 @@ describe('get()', () => { kibana: { saved_object: { id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, }, }, error: { @@ -617,7 +618,7 @@ describe('get()', () => { describe('legacy actions migration for SIEM', () => { const rule = { id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { alertTypeId: '123', schedule: { interval: '10s' }, diff --git a/x-pack/plugins/alerting/server/rules_client/tests/get_action_error_log.test.ts b/x-pack/plugins/alerting/server/rules_client/tests/get_action_error_log.test.ts index 0fe46a07e4e7f..d6c8f0a0df3ec 100644 --- a/x-pack/plugins/alerting/server/rules_client/tests/get_action_error_log.test.ts +++ b/x-pack/plugins/alerting/server/rules_client/tests/get_action_error_log.test.ts @@ -25,6 +25,7 @@ import { SavedObject } from '@kbn/core/server'; import { RawRule } from '../../types'; import { auditLoggerMock } from '@kbn/security-plugin/server/audit/mocks'; import { getBeforeSetup, mockedDateString, setGlobalDate } from './lib'; +import { RULE_SAVED_OBJECT_TYPE } from '../../saved_objects'; const taskManager = taskManagerMock.createStart(); const ruleTypeRegistry = ruleTypeRegistryMock.create(); @@ -74,7 +75,7 @@ const RuleIntervalSeconds = 1; const BaseRuleSavedObject: SavedObject = { id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { enabled: true, name: 'rule-name', @@ -139,7 +140,7 @@ const findResults = { }, { rel: 'primary', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, id: 'a348a740-9e2c-11ec-bd64-774ed95c43ef', type_id: 'example.always-firing', }, @@ -188,7 +189,7 @@ const findResults = { }, { rel: 'primary', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, id: 'a348a740-9e2c-11ec-bd64-774ed95c43ef', type_id: 'example.always-firing', }, @@ -237,7 +238,7 @@ const findResults = { }, { rel: 'primary', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, id: 'a348a740-9e2c-11ec-bd64-774ed95c43ef', type_id: 'example.always-firing', }, @@ -286,7 +287,7 @@ const findResults = { }, { rel: 'primary', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, id: 'a348a740-9e2c-11ec-bd64-774ed95c43ef', type_id: 'example.always-firing', }, @@ -335,7 +336,7 @@ const findResults = { }, { rel: 'primary', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, id: 'a348a740-9e2c-11ec-bd64-774ed95c43ef', type_id: 'example.always-firing', }, @@ -450,7 +451,7 @@ describe('getActionErrorLog()', () => { expect(unsecuredSavedObjectsClient.get).toHaveBeenCalledTimes(1); expect(eventLogClient.findEventsBySavedObjectIds).toHaveBeenCalledTimes(1); expect(eventLogClient.findEventsBySavedObjectIds.mock.calls[0]).toEqual([ - 'alert', + RULE_SAVED_OBJECT_TYPE, ['1'], { page: 1, @@ -480,7 +481,7 @@ describe('getActionErrorLog()', () => { expect(eventLogClient.findEventsBySavedObjectIds).toHaveBeenCalledTimes(1); expect(eventLogClient.findEventsBySavedObjectIds.mock.calls[0]).toEqual([ - 'alert', + RULE_SAVED_OBJECT_TYPE, ['1'], { page: 3, @@ -554,7 +555,7 @@ describe('getActionErrorLog()', () => { action: 'rule_get_action_error_log', outcome: 'success', }), - kibana: { saved_object: { id: '1', type: 'alert' } }, + kibana: { saved_object: { id: '1', type: RULE_SAVED_OBJECT_TYPE } }, }) ); }); @@ -576,7 +577,7 @@ describe('getActionErrorLog()', () => { kibana: { saved_object: { id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, }, }, error: { diff --git a/x-pack/plugins/alerting/server/rules_client/tests/get_alert_state.test.ts b/x-pack/plugins/alerting/server/rules_client/tests/get_alert_state.test.ts index dee5cb2ab9a81..671dcc59c886f 100644 --- a/x-pack/plugins/alerting/server/rules_client/tests/get_alert_state.test.ts +++ b/x-pack/plugins/alerting/server/rules_client/tests/get_alert_state.test.ts @@ -20,6 +20,7 @@ import { actionsAuthorizationMock } from '@kbn/actions-plugin/server/mocks'; import { AlertingAuthorization } from '../../authorization/alerting_authorization'; import { ActionsAuthorization } from '@kbn/actions-plugin/server'; import { getBeforeSetup } from './lib'; +import { RULE_SAVED_OBJECT_TYPE } from '../../saved_objects'; const taskManager = taskManagerMock.createStart(); const ruleTypeRegistry = ruleTypeRegistryMock.create(); @@ -64,7 +65,7 @@ describe('getAlertState()', () => { const rulesClient = new RulesClient(rulesClientParams); unsecuredSavedObjectsClient.get.mockResolvedValueOnce({ id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { alertTypeId: '123', schedule: { interval: '10s' }, @@ -121,7 +122,7 @@ describe('getAlertState()', () => { unsecuredSavedObjectsClient.get.mockResolvedValueOnce({ id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { alertTypeId: '123', schedule: { interval: '10s' }, @@ -176,7 +177,7 @@ describe('getAlertState()', () => { beforeEach(() => { unsecuredSavedObjectsClient.get.mockResolvedValueOnce({ id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { alertTypeId: 'myType', consumer: 'myApp', diff --git a/x-pack/plugins/alerting/server/rules_client/tests/get_alert_summary.test.ts b/x-pack/plugins/alerting/server/rules_client/tests/get_alert_summary.test.ts index 1521dfdefced3..ba0e2d7a1a485 100644 --- a/x-pack/plugins/alerting/server/rules_client/tests/get_alert_summary.test.ts +++ b/x-pack/plugins/alerting/server/rules_client/tests/get_alert_summary.test.ts @@ -25,6 +25,7 @@ import { SavedObject } from '@kbn/core/server'; import { EventsFactory } from '../../lib/alert_summary_from_event_log.test'; import { RawRule } from '../../types'; import { getBeforeSetup, mockedDateString, setGlobalDate } from './lib'; +import { RULE_SAVED_OBJECT_TYPE } from '../../saved_objects'; const taskManager = taskManagerMock.createStart(); const ruleTypeRegistry = ruleTypeRegistryMock.create(); @@ -78,7 +79,7 @@ const RuleIntervalSeconds = 1; const BaseRuleSavedObject: SavedObject = { id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { enabled: true, name: 'rule-name', diff --git a/x-pack/plugins/alerting/server/rules_client/tests/get_execution_log.test.ts b/x-pack/plugins/alerting/server/rules_client/tests/get_execution_log.test.ts index f1d2dbcacf8fd..c4419ef8386a5 100644 --- a/x-pack/plugins/alerting/server/rules_client/tests/get_execution_log.test.ts +++ b/x-pack/plugins/alerting/server/rules_client/tests/get_execution_log.test.ts @@ -26,6 +26,7 @@ import { auditLoggerMock } from '@kbn/security-plugin/server/audit/mocks'; import { getBeforeSetup, mockedDateString, setGlobalDate } from './lib'; import { getExecutionLogAggregation } from '../../lib/get_execution_log_aggregation'; import { fromKueryExpression } from '@kbn/es-query'; +import { RULE_SAVED_OBJECT_TYPE } from '../../saved_objects'; const taskManager = taskManagerMock.createStart(); const ruleTypeRegistry = ruleTypeRegistryMock.create(); @@ -75,7 +76,7 @@ const RuleIntervalSeconds = 1; const BaseRuleSavedObject: SavedObject = { id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { enabled: true, name: 'rule-name', @@ -444,7 +445,7 @@ describe('getExecutionLogForRule()', () => { expect(unsecuredSavedObjectsClient.get).toHaveBeenCalledTimes(1); expect(eventLogClient.aggregateEventsBySavedObjectIds).toHaveBeenCalledTimes(1); expect(eventLogClient.aggregateEventsBySavedObjectIds.mock.calls[0]).toEqual([ - 'alert', + RULE_SAVED_OBJECT_TYPE, ['1'], { aggs: getExecutionLogAggregation({ @@ -470,7 +471,7 @@ describe('getExecutionLogForRule()', () => { expect(unsecuredSavedObjectsClient.get).toHaveBeenCalledTimes(1); expect(eventLogClient.aggregateEventsBySavedObjectIds).toHaveBeenCalledTimes(1); expect(eventLogClient.aggregateEventsBySavedObjectIds.mock.calls[0]).toEqual([ - 'alert', + RULE_SAVED_OBJECT_TYPE, ['1'], { aggs: getExecutionLogAggregation({ @@ -496,7 +497,7 @@ describe('getExecutionLogForRule()', () => { expect(unsecuredSavedObjectsClient.get).toHaveBeenCalledTimes(1); expect(eventLogClient.aggregateEventsBySavedObjectIds).toHaveBeenCalledTimes(1); expect(eventLogClient.aggregateEventsBySavedObjectIds.mock.calls[0]).toEqual([ - 'alert', + RULE_SAVED_OBJECT_TYPE, ['1'], { aggs: getExecutionLogAggregation({ @@ -522,7 +523,7 @@ describe('getExecutionLogForRule()', () => { expect(unsecuredSavedObjectsClient.get).toHaveBeenCalledTimes(1); expect(eventLogClient.aggregateEventsBySavedObjectIds).toHaveBeenCalledTimes(1); expect(eventLogClient.aggregateEventsBySavedObjectIds.mock.calls[0]).toEqual([ - 'alert', + RULE_SAVED_OBJECT_TYPE, ['1'], { aggs: getExecutionLogAggregation({ @@ -662,7 +663,7 @@ describe('getExecutionLogForRule()', () => { action: 'rule_get_execution_log', outcome: 'success', }), - kibana: { saved_object: { id: '1', type: 'alert' } }, + kibana: { saved_object: { id: '1', type: RULE_SAVED_OBJECT_TYPE } }, }) ); }); @@ -684,7 +685,7 @@ describe('getExecutionLogForRule()', () => { kibana: { saved_object: { id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, }, }, error: { diff --git a/x-pack/plugins/alerting/server/rules_client/tests/lib.ts b/x-pack/plugins/alerting/server/rules_client/tests/lib.ts index 12da7211fdc12..20c0759e1d628 100644 --- a/x-pack/plugins/alerting/server/rules_client/tests/lib.ts +++ b/x-pack/plugins/alerting/server/rules_client/tests/lib.ts @@ -13,6 +13,7 @@ import { TaskStatus } from '@kbn/task-manager-plugin/server'; import { ConstructorOptions } from '../rules_client'; import { RuleTypeRegistry } from '../../rule_type_registry'; import { RecoveredActionGroup } from '../../../common'; +import { RULE_SAVED_OBJECT_TYPE } from '../../saved_objects'; export const mockedDateString = '2019-02-12T21:01:22.479Z'; @@ -69,7 +70,7 @@ export function getBeforeSetup( enabled: false, }); taskManager.bulkRemove.mockResolvedValue({ - statuses: [{ id: 'taskId', type: 'alert', success: true }], + statuses: [{ id: 'taskId', type: RULE_SAVED_OBJECT_TYPE, success: true }], }); const actionsClient = actionsClientMock.create(); diff --git a/x-pack/plugins/alerting/server/rules_client/tests/mute_all.test.ts b/x-pack/plugins/alerting/server/rules_client/tests/mute_all.test.ts index 2b6e2793aa648..cf585cc67a417 100644 --- a/x-pack/plugins/alerting/server/rules_client/tests/mute_all.test.ts +++ b/x-pack/plugins/alerting/server/rules_client/tests/mute_all.test.ts @@ -20,6 +20,7 @@ import { AlertingAuthorization } from '../../authorization/alerting_authorizatio import { ActionsAuthorization } from '@kbn/actions-plugin/server'; import { auditLoggerMock } from '@kbn/security-plugin/server/audit/mocks'; import { getBeforeSetup, setGlobalDate } from './lib'; +import { RULE_SAVED_OBJECT_TYPE } from '../../saved_objects'; const taskManager = taskManagerMock.createStart(); const ruleTypeRegistry = ruleTypeRegistryMock.create(); @@ -67,7 +68,7 @@ describe('muteAll()', () => { const rulesClient = new RulesClient(rulesClientParams); unsecuredSavedObjectsClient.get.mockResolvedValueOnce({ id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { actions: [ { @@ -88,7 +89,7 @@ describe('muteAll()', () => { await rulesClient.muteAll({ id: '1' }); expect(unsecuredSavedObjectsClient.update).toHaveBeenCalledWith( - 'alert', + RULE_SAVED_OBJECT_TYPE, '1', { muteAll: true, @@ -107,7 +108,7 @@ describe('muteAll()', () => { beforeEach(() => { unsecuredSavedObjectsClient.get.mockResolvedValueOnce({ id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { actions: [ { @@ -171,7 +172,7 @@ describe('muteAll()', () => { const rulesClient = new RulesClient({ ...rulesClientParams, auditLogger }); unsecuredSavedObjectsClient.get.mockResolvedValueOnce({ id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { actions: [ { @@ -196,7 +197,7 @@ describe('muteAll()', () => { action: 'rule_mute', outcome: 'unknown', }), - kibana: { saved_object: { id: '1', type: 'alert' } }, + kibana: { saved_object: { id: '1', type: RULE_SAVED_OBJECT_TYPE } }, }) ); }); @@ -205,7 +206,7 @@ describe('muteAll()', () => { const rulesClient = new RulesClient({ ...rulesClientParams, auditLogger }); unsecuredSavedObjectsClient.get.mockResolvedValueOnce({ id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { actions: [ { @@ -235,7 +236,7 @@ describe('muteAll()', () => { kibana: { saved_object: { id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, }, }, error: { diff --git a/x-pack/plugins/alerting/server/rules_client/tests/mute_instance.test.ts b/x-pack/plugins/alerting/server/rules_client/tests/mute_instance.test.ts index 4d7f1a52699cc..3aae21df3133d 100644 --- a/x-pack/plugins/alerting/server/rules_client/tests/mute_instance.test.ts +++ b/x-pack/plugins/alerting/server/rules_client/tests/mute_instance.test.ts @@ -20,6 +20,7 @@ import { AlertingAuthorization } from '../../authorization/alerting_authorizatio import { ActionsAuthorization } from '@kbn/actions-plugin/server'; import { auditLoggerMock } from '@kbn/security-plugin/server/audit/mocks'; import { getBeforeSetup, setGlobalDate } from './lib'; +import { RULE_SAVED_OBJECT_TYPE } from '../../saved_objects'; const taskManager = taskManagerMock.createStart(); const ruleTypeRegistry = ruleTypeRegistryMock.create(); @@ -67,7 +68,7 @@ describe('muteInstance()', () => { const rulesClient = new RulesClient(rulesClientParams); unsecuredSavedObjectsClient.get.mockResolvedValueOnce({ id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { actions: [], schedule: { interval: '10s' }, @@ -82,7 +83,7 @@ describe('muteInstance()', () => { await rulesClient.muteInstance({ alertId: '1', alertInstanceId: '2' }); expect(unsecuredSavedObjectsClient.update).toHaveBeenCalledWith( - 'alert', + RULE_SAVED_OBJECT_TYPE, '1', { mutedInstanceIds: ['2'], @@ -99,7 +100,7 @@ describe('muteInstance()', () => { const rulesClient = new RulesClient(rulesClientParams); unsecuredSavedObjectsClient.get.mockResolvedValueOnce({ id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { actions: [], schedule: { interval: '10s' }, @@ -119,7 +120,7 @@ describe('muteInstance()', () => { const rulesClient = new RulesClient(rulesClientParams); unsecuredSavedObjectsClient.get.mockResolvedValueOnce({ id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { actions: [], schedule: { interval: '10s' }, @@ -140,7 +141,7 @@ describe('muteInstance()', () => { beforeEach(() => { unsecuredSavedObjectsClient.get.mockResolvedValueOnce({ id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { actions: [ { @@ -204,7 +205,7 @@ describe('muteInstance()', () => { const rulesClient = new RulesClient({ ...rulesClientParams, auditLogger }); unsecuredSavedObjectsClient.get.mockResolvedValueOnce({ id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { actions: [], schedule: { interval: '10s' }, @@ -223,7 +224,7 @@ describe('muteInstance()', () => { action: 'rule_alert_mute', outcome: 'unknown', }), - kibana: { saved_object: { id: '1', type: 'alert' } }, + kibana: { saved_object: { id: '1', type: RULE_SAVED_OBJECT_TYPE } }, }) ); }); @@ -232,7 +233,7 @@ describe('muteInstance()', () => { const rulesClient = new RulesClient({ ...rulesClientParams, auditLogger }); unsecuredSavedObjectsClient.get.mockResolvedValueOnce({ id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { actions: [], schedule: { interval: '10s' }, @@ -258,7 +259,7 @@ describe('muteInstance()', () => { kibana: { saved_object: { id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, }, }, error: { diff --git a/x-pack/plugins/alerting/server/rules_client/tests/resolve.test.ts b/x-pack/plugins/alerting/server/rules_client/tests/resolve.test.ts index 70c6388c41ff4..13ab4778f82bc 100644 --- a/x-pack/plugins/alerting/server/rules_client/tests/resolve.test.ts +++ b/x-pack/plugins/alerting/server/rules_client/tests/resolve.test.ts @@ -23,6 +23,7 @@ import { auditLoggerMock } from '@kbn/security-plugin/server/audit/mocks'; import { getBeforeSetup, setGlobalDate } from './lib'; import { RecoveredActionGroup } from '../../../common'; import { formatLegacyActions } from '../lib'; +import { RULE_SAVED_OBJECT_TYPE } from '../../saved_objects'; jest.mock('../lib/siem_legacy_actions/format_legacy_actions', () => { return { @@ -77,7 +78,7 @@ describe('resolve()', () => { unsecuredSavedObjectsClient.resolve.mockResolvedValueOnce({ saved_object: { id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { alertTypeId: '123', schedule: { interval: '10s' }, @@ -160,7 +161,7 @@ describe('resolve()', () => { unsecuredSavedObjectsClient.resolve.mockResolvedValueOnce({ saved_object: { id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { legacyId: 'some-legacy-id', alertTypeId: '123', @@ -243,7 +244,7 @@ describe('resolve()', () => { unsecuredSavedObjectsClient.resolve.mockResolvedValueOnce({ saved_object: { id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { alertTypeId: '123', schedule: { interval: '10s' }, @@ -333,7 +334,7 @@ describe('resolve()', () => { unsecuredSavedObjectsClient.resolve.mockResolvedValueOnce({ saved_object: { id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { alertTypeId: '123', schedule: { interval: '10s' }, @@ -395,7 +396,7 @@ describe('resolve()', () => { unsecuredSavedObjectsClient.resolve.mockResolvedValueOnce({ saved_object: { id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { alertTypeId: '123', schedule: { interval: '10s' }, @@ -442,7 +443,7 @@ describe('resolve()', () => { unsecuredSavedObjectsClient.resolve.mockResolvedValueOnce({ saved_object: { id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { alertTypeId: 'myType', consumer: 'myApp', @@ -514,7 +515,7 @@ describe('resolve()', () => { unsecuredSavedObjectsClient.resolve.mockResolvedValueOnce({ saved_object: { id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { alertTypeId: '123', schedule: { interval: '10s' }, @@ -544,7 +545,7 @@ describe('resolve()', () => { action: 'rule_resolve', outcome: 'success', }), - kibana: { saved_object: { id: '1', type: 'alert' } }, + kibana: { saved_object: { id: '1', type: RULE_SAVED_OBJECT_TYPE } }, }) ); }); @@ -563,7 +564,7 @@ describe('resolve()', () => { kibana: { saved_object: { id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, }, }, error: { @@ -578,7 +579,7 @@ describe('resolve()', () => { describe('legacy actions migration for SIEM', () => { const rule = { id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { alertTypeId: '123', schedule: { interval: '10s' }, diff --git a/x-pack/plugins/alerting/server/rules_client/tests/run_soon.test.ts b/x-pack/plugins/alerting/server/rules_client/tests/run_soon.test.ts index 9040096eba8b0..b156838704e0b 100644 --- a/x-pack/plugins/alerting/server/rules_client/tests/run_soon.test.ts +++ b/x-pack/plugins/alerting/server/rules_client/tests/run_soon.test.ts @@ -21,6 +21,7 @@ import { ActionsAuthorization } from '@kbn/actions-plugin/server'; import { TaskStatus } from '@kbn/task-manager-plugin/server'; import { auditLoggerMock } from '@kbn/security-plugin/server/audit/mocks'; import { getBeforeSetup, setGlobalDate } from './lib'; +import { RULE_SAVED_OBJECT_TYPE } from '../../saved_objects'; const taskManager = taskManagerMock.createStart(); const ruleTypeRegistry = ruleTypeRegistryMock.create(); @@ -64,7 +65,7 @@ describe('runSoon()', () => { const existingRule = { id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { name: 'name', consumer: 'myApp', @@ -154,7 +155,7 @@ describe('runSoon()', () => { action: 'rule_run_soon', outcome: 'unknown', }), - kibana: { saved_object: { id: '1', type: 'alert' } }, + kibana: { saved_object: { id: '1', type: RULE_SAVED_OBJECT_TYPE } }, }) ); }); @@ -172,7 +173,7 @@ describe('runSoon()', () => { kibana: { saved_object: { id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, }, }, error: { diff --git a/x-pack/plugins/alerting/server/rules_client/tests/test_helpers.ts b/x-pack/plugins/alerting/server/rules_client/tests/test_helpers.ts index 8b2db34686577..f060187775a8e 100644 --- a/x-pack/plugins/alerting/server/rules_client/tests/test_helpers.ts +++ b/x-pack/plugins/alerting/server/rules_client/tests/test_helpers.ts @@ -7,6 +7,7 @@ import { AlertConsumers } from '@kbn/rule-data-utils'; import type { SavedObject } from '@kbn/core-saved-objects-server'; +import { RULE_SAVED_OBJECT_TYPE } from '../../saved_objects'; export const savedObjectWith500Error = { id: 'id2', @@ -30,7 +31,7 @@ export const savedObjectWith409Error = { export const defaultRule = { id: 'id1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { name: 'fakeName', consumer: 'fakeConsumer', @@ -44,7 +45,7 @@ export const defaultRule = { export const defaultRuleForBulkDelete = { id: 'id1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { tags: ['ups'], params: { param: 1 }, diff --git a/x-pack/plugins/alerting/server/rules_client/tests/unmute_all.test.ts b/x-pack/plugins/alerting/server/rules_client/tests/unmute_all.test.ts index c8cb134b129d7..f8329f20fc432 100644 --- a/x-pack/plugins/alerting/server/rules_client/tests/unmute_all.test.ts +++ b/x-pack/plugins/alerting/server/rules_client/tests/unmute_all.test.ts @@ -20,6 +20,7 @@ import { AlertingAuthorization } from '../../authorization/alerting_authorizatio import { ActionsAuthorization } from '@kbn/actions-plugin/server'; import { auditLoggerMock } from '@kbn/security-plugin/server/audit/mocks'; import { getBeforeSetup, setGlobalDate } from './lib'; +import { RULE_SAVED_OBJECT_TYPE } from '../../saved_objects'; const taskManager = taskManagerMock.createStart(); const ruleTypeRegistry = ruleTypeRegistryMock.create(); @@ -67,7 +68,7 @@ describe('unmuteAll()', () => { const rulesClient = new RulesClient(rulesClientParams); unsecuredSavedObjectsClient.get.mockResolvedValueOnce({ id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { actions: [ { @@ -88,7 +89,7 @@ describe('unmuteAll()', () => { await rulesClient.unmuteAll({ id: '1' }); expect(unsecuredSavedObjectsClient.update).toHaveBeenCalledWith( - 'alert', + RULE_SAVED_OBJECT_TYPE, '1', { muteAll: false, @@ -107,7 +108,7 @@ describe('unmuteAll()', () => { beforeEach(() => { unsecuredSavedObjectsClient.get.mockResolvedValueOnce({ id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { actions: [ { @@ -171,7 +172,7 @@ describe('unmuteAll()', () => { const rulesClient = new RulesClient({ ...rulesClientParams, auditLogger }); unsecuredSavedObjectsClient.get.mockResolvedValueOnce({ id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { actions: [ { @@ -196,7 +197,7 @@ describe('unmuteAll()', () => { action: 'rule_unmute', outcome: 'unknown', }), - kibana: { saved_object: { id: '1', type: 'alert' } }, + kibana: { saved_object: { id: '1', type: RULE_SAVED_OBJECT_TYPE } }, }) ); }); @@ -205,7 +206,7 @@ describe('unmuteAll()', () => { const rulesClient = new RulesClient({ ...rulesClientParams, auditLogger }); unsecuredSavedObjectsClient.get.mockResolvedValueOnce({ id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { actions: [ { @@ -235,7 +236,7 @@ describe('unmuteAll()', () => { kibana: { saved_object: { id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, }, }, error: { diff --git a/x-pack/plugins/alerting/server/rules_client/tests/unmute_instance.test.ts b/x-pack/plugins/alerting/server/rules_client/tests/unmute_instance.test.ts index 4df037b8728f0..8d9232c4381c3 100644 --- a/x-pack/plugins/alerting/server/rules_client/tests/unmute_instance.test.ts +++ b/x-pack/plugins/alerting/server/rules_client/tests/unmute_instance.test.ts @@ -20,6 +20,7 @@ import { AlertingAuthorization } from '../../authorization/alerting_authorizatio import { ActionsAuthorization } from '@kbn/actions-plugin/server'; import { auditLoggerMock } from '@kbn/security-plugin/server/audit/mocks'; import { getBeforeSetup, setGlobalDate } from './lib'; +import { RULE_SAVED_OBJECT_TYPE } from '../../saved_objects'; const taskManager = taskManagerMock.createStart(); const ruleTypeRegistry = ruleTypeRegistryMock.create(); @@ -67,7 +68,7 @@ describe('unmuteInstance()', () => { const rulesClient = new RulesClient(rulesClientParams); unsecuredSavedObjectsClient.get.mockResolvedValueOnce({ id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { actions: [], schedule: { interval: '10s' }, @@ -82,7 +83,7 @@ describe('unmuteInstance()', () => { await rulesClient.unmuteInstance({ alertId: '1', alertInstanceId: '2' }); expect(unsecuredSavedObjectsClient.update).toHaveBeenCalledWith( - 'alert', + RULE_SAVED_OBJECT_TYPE, '1', { mutedInstanceIds: [], @@ -97,7 +98,7 @@ describe('unmuteInstance()', () => { const rulesClient = new RulesClient(rulesClientParams); unsecuredSavedObjectsClient.get.mockResolvedValueOnce({ id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { actions: [], schedule: { interval: '10s' }, @@ -117,7 +118,7 @@ describe('unmuteInstance()', () => { const rulesClient = new RulesClient(rulesClientParams); unsecuredSavedObjectsClient.get.mockResolvedValueOnce({ id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { actions: [], schedule: { interval: '10s' }, @@ -138,7 +139,7 @@ describe('unmuteInstance()', () => { beforeEach(() => { unsecuredSavedObjectsClient.get.mockResolvedValueOnce({ id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { actions: [ { @@ -202,7 +203,7 @@ describe('unmuteInstance()', () => { const rulesClient = new RulesClient({ ...rulesClientParams, auditLogger }); unsecuredSavedObjectsClient.get.mockResolvedValueOnce({ id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { actions: [], schedule: { interval: '10s' }, @@ -221,7 +222,7 @@ describe('unmuteInstance()', () => { action: 'rule_alert_unmute', outcome: 'unknown', }), - kibana: { saved_object: { id: '1', type: 'alert' } }, + kibana: { saved_object: { id: '1', type: RULE_SAVED_OBJECT_TYPE } }, }) ); }); @@ -230,7 +231,7 @@ describe('unmuteInstance()', () => { const rulesClient = new RulesClient({ ...rulesClientParams, auditLogger }); unsecuredSavedObjectsClient.get.mockResolvedValueOnce({ id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { actions: [], schedule: { interval: '10s' }, @@ -256,7 +257,7 @@ describe('unmuteInstance()', () => { kibana: { saved_object: { id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, }, }, error: { diff --git a/x-pack/plugins/alerting/server/rules_client/tests/update.test.ts b/x-pack/plugins/alerting/server/rules_client/tests/update.test.ts index c151e4f75e99e..aa03a71d93e14 100644 --- a/x-pack/plugins/alerting/server/rules_client/tests/update.test.ts +++ b/x-pack/plugins/alerting/server/rules_client/tests/update.test.ts @@ -28,6 +28,7 @@ import { auditLoggerMock } from '@kbn/security-plugin/server/audit/mocks'; import { getBeforeSetup, setGlobalDate } from './lib'; import { bulkMarkApiKeysForInvalidation } from '../../invalidate_pending_api_keys/bulk_mark_api_keys_for_invalidation'; import { migrateLegacyActions } from '../lib'; +import { RULE_SAVED_OBJECT_TYPE } from '../../saved_objects'; jest.mock('../lib/siem_legacy_actions/migrate_legacy_actions', () => { return { @@ -106,7 +107,7 @@ describe('update()', () => { let actionsClient: jest.Mocked; const existingAlert = { id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { enabled: true, tags: ['foo'], @@ -238,7 +239,7 @@ describe('update()', () => { ]); unsecuredSavedObjectsClient.create.mockResolvedValueOnce({ id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { enabled: true, schedule: { interval: '1m' }, @@ -376,14 +377,18 @@ describe('update()', () => { "updatedAt": 2019-02-12T21:01:22.479Z, } `); - expect(encryptedSavedObjects.getDecryptedAsInternalUser).toHaveBeenCalledWith('alert', '1', { - namespace: 'default', - }); + expect(encryptedSavedObjects.getDecryptedAsInternalUser).toHaveBeenCalledWith( + RULE_SAVED_OBJECT_TYPE, + '1', + { + namespace: 'default', + } + ); expect(unsecuredSavedObjectsClient.get).not.toHaveBeenCalled(); expect(unsecuredSavedObjectsClient.create).toHaveBeenCalledTimes(1); expect(bulkMarkApiKeysForInvalidationMock).toHaveBeenCalledTimes(1); expect(unsecuredSavedObjectsClient.create.mock.calls[0]).toHaveLength(3); - expect(unsecuredSavedObjectsClient.create.mock.calls[0][0]).toEqual('alert'); + expect(unsecuredSavedObjectsClient.create.mock.calls[0][0]).toEqual(RULE_SAVED_OBJECT_TYPE); expect(unsecuredSavedObjectsClient.create.mock.calls[0][1]).toMatchInlineSnapshot(` Object { "actions": Array [ @@ -537,7 +542,7 @@ describe('update()', () => { actionsClient.isPreconfigured.mockReturnValueOnce(true); unsecuredSavedObjectsClient.create.mockResolvedValueOnce({ id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { enabled: true, schedule: { interval: '1m' }, @@ -628,7 +633,7 @@ describe('update()', () => { expect(unsecuredSavedObjectsClient.create).toHaveBeenNthCalledWith( 1, - 'alert', + RULE_SAVED_OBJECT_TYPE, { actions: [ { @@ -728,9 +733,13 @@ describe('update()', () => { "updatedAt": 2019-02-12T21:01:22.479Z, } `); - expect(encryptedSavedObjects.getDecryptedAsInternalUser).toHaveBeenCalledWith('alert', '1', { - namespace: 'default', - }); + expect(encryptedSavedObjects.getDecryptedAsInternalUser).toHaveBeenCalledWith( + RULE_SAVED_OBJECT_TYPE, + '1', + { + namespace: 'default', + } + ); expect(unsecuredSavedObjectsClient.get).not.toHaveBeenCalled(); expect(actionsClient.isPreconfigured).toHaveBeenCalledTimes(3); }); @@ -789,7 +798,7 @@ describe('update()', () => { actionsClient.isSystemAction.mockReturnValueOnce(true); unsecuredSavedObjectsClient.create.mockResolvedValueOnce({ id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { enabled: true, schedule: { interval: '1m' }, @@ -872,7 +881,7 @@ describe('update()', () => { expect(unsecuredSavedObjectsClient.create).toHaveBeenNthCalledWith( 1, - 'alert', + RULE_SAVED_OBJECT_TYPE, { actions: [ { @@ -964,9 +973,13 @@ describe('update()', () => { "updatedAt": 2019-02-12T21:01:22.479Z, } `); - expect(encryptedSavedObjects.getDecryptedAsInternalUser).toHaveBeenCalledWith('alert', '1', { - namespace: 'default', - }); + expect(encryptedSavedObjects.getDecryptedAsInternalUser).toHaveBeenCalledWith( + RULE_SAVED_OBJECT_TYPE, + '1', + { + namespace: 'default', + } + ); expect(unsecuredSavedObjectsClient.get).not.toHaveBeenCalled(); expect(actionsClient.isSystemAction).toHaveBeenCalledTimes(3); }); @@ -1017,7 +1030,7 @@ describe('update()', () => { })); unsecuredSavedObjectsClient.create.mockResolvedValueOnce({ id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { enabled: true, schedule: { interval: '1m' }, @@ -1077,7 +1090,7 @@ describe('update()', () => { expect(extractReferencesFn).toHaveBeenCalledWith(ruleParams); expect(unsecuredSavedObjectsClient.create).toHaveBeenCalledWith( - 'alert', + RULE_SAVED_OBJECT_TYPE, { actions: [ { @@ -1161,7 +1174,7 @@ describe('update()', () => { }); unsecuredSavedObjectsClient.create.mockResolvedValueOnce({ id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { enabled: true, schedule: { interval: '1m' }, @@ -1254,7 +1267,7 @@ describe('update()', () => { expect.any(Object) ); expect(unsecuredSavedObjectsClient.create.mock.calls[0]).toHaveLength(3); - expect(unsecuredSavedObjectsClient.create.mock.calls[0][0]).toEqual('alert'); + expect(unsecuredSavedObjectsClient.create.mock.calls[0][0]).toEqual(RULE_SAVED_OBJECT_TYPE); expect(unsecuredSavedObjectsClient.create.mock.calls[0][1]).toMatchInlineSnapshot(` Object { "actions": Array [ @@ -1321,7 +1334,7 @@ describe('update()', () => { }); unsecuredSavedObjectsClient.create.mockResolvedValueOnce({ id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { enabled: false, schedule: { interval: '1m' }, @@ -1407,7 +1420,7 @@ describe('update()', () => { `); expect(unsecuredSavedObjectsClient.create).toHaveBeenCalledTimes(1); expect(unsecuredSavedObjectsClient.create.mock.calls[0]).toHaveLength(3); - expect(unsecuredSavedObjectsClient.create.mock.calls[0][0]).toEqual('alert'); + expect(unsecuredSavedObjectsClient.create.mock.calls[0][0]).toEqual(RULE_SAVED_OBJECT_TYPE); expect(unsecuredSavedObjectsClient.create.mock.calls[0][1]).toMatchInlineSnapshot(` Object { "actions": Array [ @@ -1563,7 +1576,7 @@ describe('update()', () => { it('should trim alert name in the API key name', async () => { unsecuredSavedObjectsClient.create.mockResolvedValueOnce({ id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { enabled: false, name: ' my alert name ', @@ -1613,7 +1626,7 @@ describe('update()', () => { it('swallows error when invalidate API key throws', async () => { unsecuredSavedObjectsClient.create.mockResolvedValueOnce({ id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { enabled: true, schedule: { interval: '1m' }, @@ -1721,7 +1734,7 @@ describe('update()', () => { ]); unsecuredSavedObjectsClient.create.mockResolvedValueOnce({ id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { enabled: true, schedule: { interval: '1m' }, @@ -1840,7 +1853,7 @@ describe('update()', () => { ], }, }); - expect(unsecuredSavedObjectsClient.get).toHaveBeenCalledWith('alert', '1'); + expect(unsecuredSavedObjectsClient.get).toHaveBeenCalledWith(RULE_SAVED_OBJECT_TYPE, '1'); expect(rulesClientParams.logger.error).toHaveBeenCalledWith( 'update(): Failed to load API key to invalidate on alert 1: Fail' ); @@ -1920,7 +1933,7 @@ describe('update()', () => { }); encryptedSavedObjects.getDecryptedAsInternalUser.mockResolvedValueOnce({ id: alertId, - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { actions: [], enabled: true, @@ -1947,7 +1960,7 @@ describe('update()', () => { }); unsecuredSavedObjectsClient.create.mockResolvedValueOnce({ id: alertId, - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { enabled: true, schedule: updatedSchedule, @@ -2374,7 +2387,7 @@ describe('update()', () => { actionsClient.isPreconfigured.mockReturnValueOnce(true); unsecuredSavedObjectsClient.create.mockResolvedValueOnce({ id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { enabled: true, schedule: { interval: '1m' }, @@ -2436,7 +2449,7 @@ describe('update()', () => { expect(unsecuredSavedObjectsClient.create).toHaveBeenNthCalledWith( 1, - 'alert', + RULE_SAVED_OBJECT_TYPE, { actions: [ { @@ -2502,9 +2515,13 @@ describe('update()', () => { "updatedAt": 2019-02-12T21:01:22.479Z, } `); - expect(encryptedSavedObjects.getDecryptedAsInternalUser).toHaveBeenCalledWith('alert', '1', { - namespace: 'default', - }); + expect(encryptedSavedObjects.getDecryptedAsInternalUser).toHaveBeenCalledWith( + RULE_SAVED_OBJECT_TYPE, + '1', + { + namespace: 'default', + } + ); expect(unsecuredSavedObjectsClient.get).not.toHaveBeenCalled(); expect(actionsClient.isPreconfigured).toHaveBeenCalledTimes(1); }); @@ -2549,7 +2566,7 @@ describe('update()', () => { ]); unsecuredSavedObjectsClient.create.mockResolvedValueOnce({ id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { enabled: true, schedule: { interval: '1m' }, @@ -2700,7 +2717,7 @@ describe('update()', () => { beforeEach(() => { unsecuredSavedObjectsClient.create.mockResolvedValueOnce({ id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { alertTypeId: 'myType', consumer: 'myApp', @@ -2779,7 +2796,7 @@ describe('update()', () => { beforeEach(() => { unsecuredSavedObjectsClient.create.mockResolvedValueOnce({ id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { enabled: true, schedule: { interval: '1m' }, @@ -2817,7 +2834,7 @@ describe('update()', () => { action: 'rule_update', outcome: 'unknown', }), - kibana: { saved_object: { id: '1', type: 'alert' } }, + kibana: { saved_object: { id: '1', type: RULE_SAVED_OBJECT_TYPE } }, }) ); }); @@ -2850,7 +2867,7 @@ describe('update()', () => { kibana: { saved_object: { id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, }, }, error: { @@ -2885,7 +2902,7 @@ describe('update()', () => { ]); unsecuredSavedObjectsClient.create.mockResolvedValueOnce({ id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { enabled: true, schedule: { interval: '1m' }, @@ -2980,7 +2997,7 @@ describe('update()', () => { }, }); expect(unsecuredSavedObjectsClient.create).toHaveBeenCalledWith( - 'alert', + RULE_SAVED_OBJECT_TYPE, { actions: [ { @@ -3031,7 +3048,7 @@ describe('update()', () => { beforeEach(() => { unsecuredSavedObjectsClient.create.mockResolvedValueOnce({ id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { enabled: true, schedule: { interval: '1m' }, @@ -3093,7 +3110,7 @@ describe('update()', () => { }); unsecuredSavedObjectsClient.create.mockResolvedValueOnce({ id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { enabled: true, schedule: { interval: '1m' }, @@ -3190,7 +3207,7 @@ describe('update()', () => { expect(bulkMarkApiKeysForInvalidationMock).not.toHaveBeenCalled(); expect(unsecuredSavedObjectsClient.create.mock.calls[0]).toHaveLength(3); - expect(unsecuredSavedObjectsClient.create.mock.calls[0][0]).toEqual('alert'); + expect(unsecuredSavedObjectsClient.create.mock.calls[0][0]).toEqual(RULE_SAVED_OBJECT_TYPE); expect(unsecuredSavedObjectsClient.create.mock.calls[0][1]).toMatchInlineSnapshot(` Object { "actions": Array [ diff --git a/x-pack/plugins/alerting/server/rules_client/tests/update_api_key.test.ts b/x-pack/plugins/alerting/server/rules_client/tests/update_api_key.test.ts index f9cd570afa430..de54ab9f8d5f1 100644 --- a/x-pack/plugins/alerting/server/rules_client/tests/update_api_key.test.ts +++ b/x-pack/plugins/alerting/server/rules_client/tests/update_api_key.test.ts @@ -21,6 +21,7 @@ import { ActionsAuthorization } from '@kbn/actions-plugin/server'; import { auditLoggerMock } from '@kbn/security-plugin/server/audit/mocks'; import { getBeforeSetup, setGlobalDate } from './lib'; import { bulkMarkApiKeysForInvalidation } from '../../invalidate_pending_api_keys/bulk_mark_api_keys_for_invalidation'; +import { RULE_SAVED_OBJECT_TYPE } from '../../saved_objects'; jest.mock('../../invalidate_pending_api_keys/bulk_mark_api_keys_for_invalidation', () => ({ bulkMarkApiKeysForInvalidation: jest.fn(), @@ -73,7 +74,7 @@ describe('updateApiKey()', () => { let rulesClient: RulesClient; const existingAlert = { id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { revision: 0, schedule: { interval: '10s' }, @@ -117,11 +118,15 @@ describe('updateApiKey()', () => { }); await rulesClient.updateApiKey({ id: '1' }); expect(unsecuredSavedObjectsClient.get).not.toHaveBeenCalled(); - expect(encryptedSavedObjects.getDecryptedAsInternalUser).toHaveBeenCalledWith('alert', '1', { - namespace: 'default', - }); + expect(encryptedSavedObjects.getDecryptedAsInternalUser).toHaveBeenCalledWith( + RULE_SAVED_OBJECT_TYPE, + '1', + { + namespace: 'default', + } + ); expect(unsecuredSavedObjectsClient.update).toHaveBeenCalledWith( - 'alert', + RULE_SAVED_OBJECT_TYPE, '1', { schedule: { interval: '10s' }, @@ -174,11 +179,15 @@ describe('updateApiKey()', () => { }); await rulesClient.updateApiKey({ id: '1' }); expect(unsecuredSavedObjectsClient.get).not.toHaveBeenCalled(); - expect(encryptedSavedObjects.getDecryptedAsInternalUser).toHaveBeenCalledWith('alert', '1', { - namespace: 'default', - }); + expect(encryptedSavedObjects.getDecryptedAsInternalUser).toHaveBeenCalledWith( + RULE_SAVED_OBJECT_TYPE, + '1', + { + namespace: 'default', + } + ); expect(unsecuredSavedObjectsClient.update).toHaveBeenCalledWith( - 'alert', + RULE_SAVED_OBJECT_TYPE, '1', { schedule: { interval: '10s' }, @@ -226,11 +235,15 @@ describe('updateApiKey()', () => { }); await rulesClient.updateApiKey({ id: '1' }); expect(unsecuredSavedObjectsClient.get).not.toHaveBeenCalled(); - expect(encryptedSavedObjects.getDecryptedAsInternalUser).toHaveBeenCalledWith('alert', '1', { - namespace: 'default', - }); + expect(encryptedSavedObjects.getDecryptedAsInternalUser).toHaveBeenCalledWith( + RULE_SAVED_OBJECT_TYPE, + '1', + { + namespace: 'default', + } + ); expect(unsecuredSavedObjectsClient.update).toHaveBeenCalledWith( - 'alert', + RULE_SAVED_OBJECT_TYPE, '1', { schedule: { interval: '10s' }, @@ -282,12 +295,16 @@ describe('updateApiKey()', () => { encryptedSavedObjects.getDecryptedAsInternalUser.mockRejectedValueOnce(new Error('Fail')); await rulesClient.updateApiKey({ id: '1' }); - expect(unsecuredSavedObjectsClient.get).toHaveBeenCalledWith('alert', '1'); - expect(encryptedSavedObjects.getDecryptedAsInternalUser).toHaveBeenCalledWith('alert', '1', { - namespace: 'default', - }); + expect(unsecuredSavedObjectsClient.get).toHaveBeenCalledWith(RULE_SAVED_OBJECT_TYPE, '1'); + expect(encryptedSavedObjects.getDecryptedAsInternalUser).toHaveBeenCalledWith( + RULE_SAVED_OBJECT_TYPE, + '1', + { + namespace: 'default', + } + ); expect(unsecuredSavedObjectsClient.update).toHaveBeenCalledWith( - 'alert', + RULE_SAVED_OBJECT_TYPE, '1', { schedule: { interval: '10s' }, @@ -401,7 +418,7 @@ describe('updateApiKey()', () => { action: 'rule_update_api_key', outcome: 'unknown', }), - kibana: { saved_object: { id: '1', type: 'alert' } }, + kibana: { saved_object: { id: '1', type: RULE_SAVED_OBJECT_TYPE } }, }) ); }); @@ -419,7 +436,7 @@ describe('updateApiKey()', () => { kibana: { saved_object: { id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, }, }, error: { diff --git a/x-pack/plugins/alerting/server/rules_client_conflict_retries.test.ts b/x-pack/plugins/alerting/server/rules_client_conflict_retries.test.ts index d36c4a72d2bd2..821a04601c62d 100644 --- a/x-pack/plugins/alerting/server/rules_client_conflict_retries.test.ts +++ b/x-pack/plugins/alerting/server/rules_client_conflict_retries.test.ts @@ -24,6 +24,7 @@ import { SavedObjectsErrorHelpers } from '@kbn/core/server'; import { RetryForConflictsAttempts } from './lib/retry_if_conflicts'; import { TaskStatus } from '@kbn/task-manager-plugin/server/task'; import { RecoveredActionGroup } from '../common'; +import { RULE_SAVED_OBJECT_TYPE } from './saved_objects'; jest.mock('./application/rule/methods/get_schedule_frequency', () => ({ validateScheduleLimit: jest.fn(), @@ -227,7 +228,7 @@ function expectSuccess( // tests to run when the method is expected to fail function expectConflict(success: boolean, err: Error, method: 'update' | 'create' = 'update') { const conflictErrorMessage = SavedObjectsErrorHelpers.createConflictError( - 'alert', + RULE_SAVED_OBJECT_TYPE, MockAlertId ).message; @@ -249,7 +250,7 @@ function mockSavedObjectUpdateConflictErrorTimes(times: number) { // default success value const mockUpdateValue = { id: MockAlertId, - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { actions: [], scheduledTaskId: 'scheduled-task-id', @@ -263,10 +264,10 @@ function mockSavedObjectUpdateConflictErrorTimes(times: number) { // queue up specified number of errors before a success call for (let i = 0; i < times; i++) { unsecuredSavedObjectsClient.update.mockRejectedValueOnce( - SavedObjectsErrorHelpers.createConflictError('alert', MockAlertId) + SavedObjectsErrorHelpers.createConflictError(RULE_SAVED_OBJECT_TYPE, MockAlertId) ); unsecuredSavedObjectsClient.create.mockRejectedValueOnce( - SavedObjectsErrorHelpers.createConflictError('alert', MockAlertId) + SavedObjectsErrorHelpers.createConflictError(RULE_SAVED_OBJECT_TYPE, MockAlertId) ); } } @@ -276,9 +277,9 @@ function setupRawAlertMocks( overrides: Record = {}, attributeOverrides: Record = {} ) { - const rawAlert = { + const rawRule = { id: MockAlertId, - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { enabled: true, tags: ['foo'], @@ -297,10 +298,10 @@ function setupRawAlertMocks( version: '123', ...overrides, }; - const decryptedRawAlert = { - ...rawAlert, + const decryptedRawRule = { + ...rawRule, attributes: { - ...rawAlert.attributes, + ...rawRule.attributes, apiKey: Buffer.from('123:abc').toString('base64'), }, }; @@ -310,11 +311,11 @@ function setupRawAlertMocks( // splitting this out as it's easier to set a breakpoint :-) unsecuredSavedObjectsClient.get.mockImplementation(async () => { - return cloneDeep(rawAlert); + return cloneDeep(rawRule); }); encryptedSavedObjects.getDecryptedAsInternalUser.mockImplementation(async () => { - return cloneDeep(decryptedRawAlert); + return cloneDeep(decryptedRawRule); }); } diff --git a/x-pack/plugins/alerting/server/rules_client_factory.test.ts b/x-pack/plugins/alerting/server/rules_client_factory.test.ts index 0532a48be01e1..76f4943172a4b 100644 --- a/x-pack/plugins/alerting/server/rules_client_factory.test.ts +++ b/x-pack/plugins/alerting/server/rules_client_factory.test.ts @@ -26,6 +26,7 @@ import { AlertingAuthorization } from './authorization'; import { AlertingAuthorizationClientFactory } from './alerting_authorization_client_factory'; import { SECURITY_EXTENSION_ID } from '@kbn/core-saved-objects-server'; import { mockRouter } from '@kbn/core-http-router-server-mocks'; +import { RULE_SAVED_OBJECT_TYPE } from './saved_objects'; jest.mock('./rules_client'); jest.mock('./authorization/alerting_authorization'); @@ -85,7 +86,7 @@ test('creates a rules client with proper constructor arguments when security is expect(savedObjectsService.getScopedClient).toHaveBeenCalledWith(request, { excludedExtensions: [SECURITY_EXTENSION_ID], - includedHiddenTypes: ['alert', 'api_key_pending_invalidation'], + includedHiddenTypes: [RULE_SAVED_OBJECT_TYPE, 'api_key_pending_invalidation'], }); expect(alertingAuthorizationClientFactory.create).toHaveBeenCalledWith(request); @@ -133,7 +134,7 @@ test('creates a rules client with proper constructor arguments', async () => { expect(savedObjectsService.getScopedClient).toHaveBeenCalledWith(request, { excludedExtensions: [SECURITY_EXTENSION_ID], - includedHiddenTypes: ['alert', 'api_key_pending_invalidation'], + includedHiddenTypes: [RULE_SAVED_OBJECT_TYPE, 'api_key_pending_invalidation'], }); expect(alertingAuthorizationClientFactory.create).toHaveBeenCalledWith(request); diff --git a/x-pack/plugins/alerting/server/rules_client_factory.ts b/x-pack/plugins/alerting/server/rules_client_factory.ts index 6f2930429256e..6b637eed5cd1f 100644 --- a/x-pack/plugins/alerting/server/rules_client_factory.ts +++ b/x-pack/plugins/alerting/server/rules_client_factory.ts @@ -28,6 +28,7 @@ import { AlertingAuthorizationClientFactory } from './alerting_authorization_cli import { AlertingRulesConfig } from './config'; import { GetAlertIndicesAlias } from './lib'; import { AlertsService } from './alerts_service/alerts_service'; +import { RULE_SAVED_OBJECT_TYPE } from './saved_objects'; export interface RulesClientFactoryOpts { logger: Logger; taskManager: TaskManagerStartContract; @@ -113,7 +114,7 @@ export class RulesClientFactory { maxScheduledPerMinute: this.maxScheduledPerMinute, unsecuredSavedObjectsClient: savedObjects.getScopedClient(request, { excludedExtensions: [SECURITY_EXTENSION_ID], - includedHiddenTypes: ['alert', 'api_key_pending_invalidation'], + includedHiddenTypes: [RULE_SAVED_OBJECT_TYPE, 'api_key_pending_invalidation'], }), authorization: this.authorization.create(request), actionsAuthorization: actions.getActionsAuthorizationWithRequest(request), diff --git a/x-pack/plugins/alerting/server/saved_objects/get_import_warnings.test.ts b/x-pack/plugins/alerting/server/saved_objects/get_import_warnings.test.ts index 1eff02d732231..85c35693b2b6a 100644 --- a/x-pack/plugins/alerting/server/saved_objects/get_import_warnings.test.ts +++ b/x-pack/plugins/alerting/server/saved_objects/get_import_warnings.test.ts @@ -6,6 +6,7 @@ */ import { SavedObject } from '@kbn/core/server'; +import { RULE_SAVED_OBJECT_TYPE } from '.'; import { RawRule } from '../types'; import { getImportWarnings } from './get_import_warnings'; @@ -14,7 +15,7 @@ describe('getImportWarnings', () => { const savedObjectRules = [ { id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { enabled: true, name: 'rule-name1', @@ -43,7 +44,7 @@ describe('getImportWarnings', () => { }, { id: '2', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { enabled: true, name: 'rule-name2', diff --git a/x-pack/plugins/alerting/server/saved_objects/index.ts b/x-pack/plugins/alerting/server/saved_objects/index.ts index 9006bf1cab1b6..385a5dd25d6bf 100644 --- a/x-pack/plugins/alerting/server/saved_objects/index.ts +++ b/x-pack/plugins/alerting/server/saved_objects/index.ts @@ -23,7 +23,7 @@ import { RawRule } from '../types'; import { getImportWarnings } from './get_import_warnings'; import { isRuleExportable } from './is_rule_exportable'; import { RuleTypeRegistry } from '../rule_type_registry'; -export { partiallyUpdateAlert } from './partially_update_alert'; +export { partiallyUpdateRule } from './partially_update_rule'; export { getLatestRuleVersion, getMinimumCompatibleVersion } from './rule_model_versions'; import { RULES_SETTINGS_SAVED_OBJECT_TYPE, @@ -31,10 +31,12 @@ import { } from '../../common'; import { ruleModelVersions } from './rule_model_versions'; +export const RULE_SAVED_OBJECT_TYPE = 'alert'; + // Use caution when removing items from this array! Any field which has // ever existed in the rule SO must be included in this array to prevent // decryption failures during migration. -export const AlertAttributesExcludedFromAAD = [ +export const RuleAttributesExcludedFromAAD = [ 'scheduledTaskId', 'muteAll', 'mutedInstanceIds', @@ -51,11 +53,11 @@ export const AlertAttributesExcludedFromAAD = [ 'running', ]; -// useful for Pick which is a +// useful for Pick which is a // type which is a subset of RawAlert with just attributes excluded from AAD -// useful for Pick -export type AlertAttributesExcludedFromAADType = +// useful for Pick +export type RuleAttributesExcludedFromAADType = | 'scheduledTaskId' | 'muteAll' | 'mutedInstanceIds' @@ -80,7 +82,7 @@ export function setupSavedObjects( getSearchSourceMigrations: () => MigrateFunctionsObject ) { savedObjects.registerType({ - name: 'alert', + name: RULE_SAVED_OBJECT_TYPE, indexPattern: ALERTING_CASES_SAVED_OBJECT_INDEX, hidden: true, namespaceType: 'multiple-isolated', @@ -146,9 +148,9 @@ export function setupSavedObjects( // Encrypted attributes encryptedSavedObjects.registerType({ - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributesToEncrypt: new Set(['apiKey']), - attributesToExcludeFromAAD: new Set(AlertAttributesExcludedFromAAD), + attributesToExcludeFromAAD: new Set(RuleAttributesExcludedFromAAD), }); // Encrypted attributes diff --git a/x-pack/plugins/alerting/server/saved_objects/is_rule_exportable.test.ts b/x-pack/plugins/alerting/server/saved_objects/is_rule_exportable.test.ts index bf330be87257a..7ed188915c869 100644 --- a/x-pack/plugins/alerting/server/saved_objects/is_rule_exportable.test.ts +++ b/x-pack/plugins/alerting/server/saved_objects/is_rule_exportable.test.ts @@ -16,6 +16,7 @@ import { isRuleExportable } from './is_rule_exportable'; import { inMemoryMetricsMock } from '../monitoring/in_memory_metrics.mock'; import { loggingSystemMock } from '@kbn/core/server/mocks'; import { AlertingConfig } from '../config'; +import { RULE_SAVED_OBJECT_TYPE } from '.'; let ruleTypeRegistryParams: ConstructorOptions; let logger: MockedLogger; @@ -67,7 +68,7 @@ describe('isRuleExportable', () => { isRuleExportable( { id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { enabled: true, name: 'rule-name', @@ -127,7 +128,7 @@ describe('isRuleExportable', () => { isRuleExportable( { id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { enabled: true, name: 'rule-name', @@ -190,7 +191,7 @@ describe('isRuleExportable', () => { isRuleExportable( { id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { enabled: true, name: 'rule-name', diff --git a/x-pack/plugins/alerting/server/saved_objects/migrations/7.16/index.ts b/x-pack/plugins/alerting/server/saved_objects/migrations/7.16/index.ts index bf2870eb613bb..3984f3e5fb96e 100644 --- a/x-pack/plugins/alerting/server/saved_objects/migrations/7.16/index.ts +++ b/x-pack/plugins/alerting/server/saved_objects/migrations/7.16/index.ts @@ -9,6 +9,7 @@ import { SavedObjectAttribute, SavedObjectReference } from '@kbn/core-saved-obje import { SavedObjectUnsanitizedDoc } from '@kbn/core-saved-objects-server'; import { EncryptedSavedObjectsPluginSetup } from '@kbn/encrypted-saved-objects-plugin/server'; import { isString } from 'lodash/fp'; +import { RULE_SAVED_OBJECT_TYPE } from '../..'; import { RawRule, RawRuleAction } from '../../../types'; import { extractRefsFromGeoContainmentAlert } from '../../geo_containment/migrations'; import { createEsoMigration, isSecuritySolutionLegacyNotification, pipeMigrations } from '../utils'; @@ -126,7 +127,7 @@ function addRuleIdsToLegacyNotificationReferences( } else { const existingReferences = references ?? []; const existingReferenceFound = existingReferences.find((reference) => { - return reference.id === ruleAlertId && reference.type === 'alert'; + return reference.id === ruleAlertId && reference.type === RULE_SAVED_OBJECT_TYPE; }); if (existingReferenceFound) { // skip this if the references already exists for some uncommon reason so we do not add an additional one. @@ -135,7 +136,7 @@ function addRuleIdsToLegacyNotificationReferences( const savedObjectReference: SavedObjectReference = { id: ruleAlertId, name: 'param:alert_0', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, }; const newReferences = [...existingReferences, savedObjectReference]; return { ...doc, references: newReferences }; diff --git a/x-pack/plugins/alerting/server/saved_objects/migrations/index.test.ts b/x-pack/plugins/alerting/server/saved_objects/migrations/index.test.ts index 93b8c647f7154..566911f00171d 100644 --- a/x-pack/plugins/alerting/server/saved_objects/migrations/index.test.ts +++ b/x-pack/plugins/alerting/server/saved_objects/migrations/index.test.ts @@ -15,6 +15,7 @@ import { migrationMocks } from '@kbn/core/server/mocks'; import { SavedObjectsUtils } from '@kbn/core-saved-objects-utils-server'; import { RuleType, ruleTypeMappings } from '@kbn/securitysolution-rules'; import { isAnyActionSupportIncidents } from './7.11'; +import { RULE_SAVED_OBJECT_TYPE } from '..'; const migrationContext = migrationMocks.createContext(); const encryptedSavedObjectsSetup = encryptedSavedObjectsMock.createSetup(); @@ -1811,7 +1812,7 @@ describe('successful migrations', () => { { name: 'param:alert_0', id: '123', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, }, ], }); @@ -1867,7 +1868,7 @@ describe('successful migrations', () => { { name: 'param:alert_0', id: '123', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, }, ], }; @@ -1882,7 +1883,7 @@ describe('successful migrations', () => { { name: 'param:alert_0', id: '123', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, }, ], }); @@ -1923,7 +1924,7 @@ describe('successful migrations', () => { { name: 'param:alert_0', id: '123', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, }, ], }); @@ -1944,7 +1945,7 @@ describe('successful migrations', () => { { name: 'param:alert_0', id: '123', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, }, ], }; @@ -1959,7 +1960,7 @@ describe('successful migrations', () => { { name: 'param:alert_0', id: '123', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, }, ], }); @@ -2002,7 +2003,7 @@ describe('successful migrations', () => { { name: 'param:alert_0', id: '123', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, }, ], }; @@ -2017,7 +2018,7 @@ describe('successful migrations', () => { { name: 'param:alert_0', id: '123', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, }, ], }); @@ -3208,6 +3209,6 @@ function getMockData( references: [], updated_at: withSavedObjectUpdatedAt ? getUpdatedAt() : undefined, id: uuidv4(), - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, }; } diff --git a/x-pack/plugins/alerting/server/saved_objects/partially_update_alert.test.ts b/x-pack/plugins/alerting/server/saved_objects/partially_update_rule.test.ts similarity index 61% rename from x-pack/plugins/alerting/server/saved_objects/partially_update_alert.test.ts rename to x-pack/plugins/alerting/server/saved_objects/partially_update_rule.test.ts index 7560632d12e5a..2cdcd14d2dea5 100644 --- a/x-pack/plugins/alerting/server/saved_objects/partially_update_alert.test.ts +++ b/x-pack/plugins/alerting/server/saved_objects/partially_update_rule.test.ts @@ -11,14 +11,15 @@ import { SavedObjectsErrorHelpers, } from '@kbn/core/server'; -import { partiallyUpdateAlert, PartiallyUpdateableAlertAttributes } from './partially_update_alert'; +import { partiallyUpdateRule, PartiallyUpdateableRuleAttributes } from './partially_update_rule'; import { savedObjectsClientMock } from '@kbn/core/server/mocks'; +import { RULE_SAVED_OBJECT_TYPE } from '.'; const MockSavedObjectsClientContract = savedObjectsClientMock.create(); const MockISavedObjectsRepository = MockSavedObjectsClientContract as unknown as jest.Mocked; -describe('partially_update_alert', () => { +describe('partially_update_rule', () => { beforeEach(() => { jest.resetAllMocks(); }); @@ -28,52 +29,77 @@ describe('partially_update_alert', () => { test('should work with no options', async () => { soClient.update.mockResolvedValueOnce(MockUpdateValue); - await partiallyUpdateAlert(soClient, MockAlertId, DefaultAttributes); - expect(soClient.update).toHaveBeenCalledWith('alert', MockAlertId, DefaultAttributes, {}); + await partiallyUpdateRule(soClient, MockRuleId, DefaultAttributes); + expect(soClient.update).toHaveBeenCalledWith( + RULE_SAVED_OBJECT_TYPE, + MockRuleId, + DefaultAttributes, + {} + ); }); test('should work with extraneous attributes ', async () => { - const attributes = InvalidAttributes as unknown as PartiallyUpdateableAlertAttributes; + const attributes = InvalidAttributes as unknown as PartiallyUpdateableRuleAttributes; soClient.update.mockResolvedValueOnce(MockUpdateValue); - await partiallyUpdateAlert(soClient, MockAlertId, attributes); - expect(soClient.update).toHaveBeenCalledWith('alert', MockAlertId, DefaultAttributes, {}); + await partiallyUpdateRule(soClient, MockRuleId, attributes); + expect(soClient.update).toHaveBeenCalledWith( + RULE_SAVED_OBJECT_TYPE, + MockRuleId, + DefaultAttributes, + {} + ); }); test('should handle SO errors', async () => { soClient.update.mockRejectedValueOnce(new Error('wops')); await expect( - partiallyUpdateAlert(soClient, MockAlertId, DefaultAttributes) + partiallyUpdateRule(soClient, MockRuleId, DefaultAttributes) ).rejects.toThrowError('wops'); }); test('should handle the version option', async () => { soClient.update.mockResolvedValueOnce(MockUpdateValue); - await partiallyUpdateAlert(soClient, MockAlertId, DefaultAttributes, { version: '1.2.3' }); - expect(soClient.update).toHaveBeenCalledWith('alert', MockAlertId, DefaultAttributes, { - version: '1.2.3', - }); + await partiallyUpdateRule(soClient, MockRuleId, DefaultAttributes, { version: '1.2.3' }); + expect(soClient.update).toHaveBeenCalledWith( + RULE_SAVED_OBJECT_TYPE, + MockRuleId, + DefaultAttributes, + { + version: '1.2.3', + } + ); }); test('should handle the ignore404 option', async () => { const err = SavedObjectsErrorHelpers.createGenericNotFoundError(); soClient.update.mockRejectedValueOnce(err); - await partiallyUpdateAlert(soClient, MockAlertId, DefaultAttributes, { ignore404: true }); - expect(soClient.update).toHaveBeenCalledWith('alert', MockAlertId, DefaultAttributes, {}); + await partiallyUpdateRule(soClient, MockRuleId, DefaultAttributes, { ignore404: true }); + expect(soClient.update).toHaveBeenCalledWith( + RULE_SAVED_OBJECT_TYPE, + MockRuleId, + DefaultAttributes, + {} + ); }); test('should handle the namespace option', async () => { soClient.update.mockResolvedValueOnce(MockUpdateValue); - await partiallyUpdateAlert(soClient, MockAlertId, DefaultAttributes, { - namespace: 'bat.cave', - }); - expect(soClient.update).toHaveBeenCalledWith('alert', MockAlertId, DefaultAttributes, { + await partiallyUpdateRule(soClient, MockRuleId, DefaultAttributes, { namespace: 'bat.cave', }); + expect(soClient.update).toHaveBeenCalledWith( + RULE_SAVED_OBJECT_TYPE, + MockRuleId, + DefaultAttributes, + { + namespace: 'bat.cave', + } + ); }); }); }); @@ -100,11 +126,11 @@ const DefaultAttributes = { const InvalidAttributes = { ...DefaultAttributes, foo: 'bar' }; -const MockAlertId = 'alert-id'; +const MockRuleId = 'rule-id'; const MockUpdateValue = { - id: MockAlertId, - type: 'alert', + id: MockRuleId, + type: RULE_SAVED_OBJECT_TYPE, attributes: { actions: [], scheduledTaskId: 'scheduled-task-id', diff --git a/x-pack/plugins/alerting/server/saved_objects/partially_update_alert.ts b/x-pack/plugins/alerting/server/saved_objects/partially_update_rule.ts similarity index 63% rename from x-pack/plugins/alerting/server/saved_objects/partially_update_alert.ts rename to x-pack/plugins/alerting/server/saved_objects/partially_update_rule.ts index 2c275a5f602fc..8d79fe300c7e9 100644 --- a/x-pack/plugins/alerting/server/saved_objects/partially_update_alert.ts +++ b/x-pack/plugins/alerting/server/saved_objects/partially_update_rule.ts @@ -13,13 +13,17 @@ import { } from '@kbn/core/server'; import { RawRule } from '../types'; -import { AlertAttributesExcludedFromAAD, AlertAttributesExcludedFromAADType } from '.'; +import { + RuleAttributesExcludedFromAAD, + RuleAttributesExcludedFromAADType, + RULE_SAVED_OBJECT_TYPE, +} from '.'; -export type PartiallyUpdateableAlertAttributes = Partial< - Pick +export type PartiallyUpdateableRuleAttributes = Partial< + Pick >; -export interface PartiallyUpdateAlertSavedObjectOptions { +interface PartiallyUpdateRuleSavedObjectOptions { refresh?: SavedObjectsUpdateOptions['refresh']; version?: string; ignore404?: boolean; @@ -29,16 +33,16 @@ export interface PartiallyUpdateAlertSavedObjectOptions { // typed this way so we can send a SavedObjectClient or SavedObjectRepository type SavedObjectClientForUpdate = Pick; -// direct, partial update to an alert saved object via scoped SavedObjectsClient +// direct, partial update to a rule saved object via scoped SavedObjectsClient // using namespace set in the client -export async function partiallyUpdateAlert( +export async function partiallyUpdateRule( savedObjectsClient: SavedObjectClientForUpdate, id: string, - attributes: PartiallyUpdateableAlertAttributes, - options: PartiallyUpdateAlertSavedObjectOptions = {} + attributes: PartiallyUpdateableRuleAttributes, + options: PartiallyUpdateRuleSavedObjectOptions = {} ): Promise { // ensure we only have the valid attributes excluded from AAD - const attributeUpdates = pick(attributes, AlertAttributesExcludedFromAAD); + const attributeUpdates = pick(attributes, RuleAttributesExcludedFromAAD); const updateOptions: SavedObjectsUpdateOptions = pick( options, 'namespace', @@ -47,7 +51,12 @@ export async function partiallyUpdateAlert( ); try { - await savedObjectsClient.update('alert', id, attributeUpdates, updateOptions); + await savedObjectsClient.update( + RULE_SAVED_OBJECT_TYPE, + id, + attributeUpdates, + updateOptions + ); } catch (err) { if (options?.ignore404 && SavedObjectsErrorHelpers.isNotFoundError(err)) { return; diff --git a/x-pack/plugins/alerting/server/saved_objects/transform_rule_for_export.test.ts b/x-pack/plugins/alerting/server/saved_objects/transform_rule_for_export.test.ts index 1269a9a776307..7b11ab75f868d 100644 --- a/x-pack/plugins/alerting/server/saved_objects/transform_rule_for_export.test.ts +++ b/x-pack/plugins/alerting/server/saved_objects/transform_rule_for_export.test.ts @@ -5,6 +5,7 @@ * 2.0. */ +import { RULE_SAVED_OBJECT_TYPE } from '.'; import { transformRulesForExport } from './transform_rule_for_export'; jest.mock('../lib/rule_execution_status', () => ({ getRuleExecutionStatusPendingAttributes: () => ({ @@ -18,7 +19,7 @@ describe('transform rule for export', () => { const mockRules = [ { id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { enabled: true, name: 'rule-name', @@ -51,7 +52,7 @@ describe('transform rule for export', () => { }, { id: '2', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, attributes: { enabled: false, name: 'disabled-rule', diff --git a/x-pack/plugins/alerting/server/task_runner/execution_handler.test.ts b/x-pack/plugins/alerting/server/task_runner/execution_handler.test.ts index 2fbb7132e0a6f..c08fb5490fbb9 100644 --- a/x-pack/plugins/alerting/server/task_runner/execution_handler.test.ts +++ b/x-pack/plugins/alerting/server/task_runner/execution_handler.test.ts @@ -36,6 +36,7 @@ import { mockAAD } from './fixtures'; import { schema } from '@kbn/config-schema'; import { alertsClientMock } from '../alerts_client/alerts_client.mock'; import { ExecutionResponseType } from '@kbn/actions-plugin/server/create_execute_function'; +import { RULE_SAVED_OBJECT_TYPE } from '../saved_objects'; jest.mock('./inject_action_params', () => ({ injectActionParams: jest.fn(), @@ -359,13 +360,13 @@ describe('Execution Handler', () => { }, source: asSavedObjectExecutionSource({ id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, }), relatedSavedObjects: [ { id: '1', namespace: 'test1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, typeId: 'test', }, ], @@ -1683,8 +1684,10 @@ describe('Execution Handler', () => { executionId: '5f6aa57d-3e22-484e-bae8-cbed868f4d28', id: '1', params: {}, - relatedSavedObjects: [{ id: '1', namespace: 'test1', type: 'alert', typeId: 'test' }], - source: { source: { id: '1', type: 'alert' }, type: 'SAVED_OBJECT' }, + relatedSavedObjects: [ + { id: '1', namespace: 'test1', type: RULE_SAVED_OBJECT_TYPE, typeId: 'test' }, + ], + source: { source: { id: '1', type: RULE_SAVED_OBJECT_TYPE }, type: 'SAVED_OBJECT' }, spaceId: 'test1', }, ]); diff --git a/x-pack/plugins/alerting/server/task_runner/execution_handler.ts b/x-pack/plugins/alerting/server/task_runner/execution_handler.ts index e5fbe92238a0c..29f56b630eaf8 100644 --- a/x-pack/plugins/alerting/server/task_runner/execution_handler.ts +++ b/x-pack/plugins/alerting/server/task_runner/execution_handler.ts @@ -51,6 +51,7 @@ import { isSummaryActionOnInterval, isSummaryActionThrottled, } from './rule_action_helper'; +import { RULE_SAVED_OBJECT_TYPE } from '../saved_objects'; enum Reasons { MUTED = 'muted', @@ -554,13 +555,13 @@ export class ExecutionHandler< consumer: ruleConsumer, source: asSavedObjectExecutionSource({ id: ruleId, - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, }), executionId, relatedSavedObjects: [ { id: ruleId, - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, namespace: namespace.namespace, typeId: this.ruleType.id, }, diff --git a/x-pack/plugins/alerting/server/task_runner/fixtures.ts b/x-pack/plugins/alerting/server/task_runner/fixtures.ts index c1c4b442de13e..b975f21304013 100644 --- a/x-pack/plugins/alerting/server/task_runner/fixtures.ts +++ b/x-pack/plugins/alerting/server/task_runner/fixtures.ts @@ -20,6 +20,7 @@ import { getDefaultMonitoring } from '../lib/monitoring'; import { UntypedNormalizedRuleType } from '../rule_type_registry'; import { EVENT_LOG_ACTIONS } from '../plugin'; import { RawRule } from '../types'; +import { RULE_SAVED_OBJECT_TYPE } from '../saved_objects'; interface GeneratorParams { [key: string]: string | number | boolean | undefined | object[] | boolean[] | object; @@ -81,7 +82,7 @@ export const generateSavedObjectParams = ({ history?: RuleMonitoring['run']['history']; alertsCount?: Record; }) => [ - 'alert', + RULE_SAVED_OBJECT_TYPE, '1', { monitoring: { @@ -213,7 +214,7 @@ export const mockedRuleTypeSavedObject: Rule = { export const mockedRawRuleSO: SavedObject = { id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, references: [], attributes: { legacyId: '1', @@ -419,14 +420,14 @@ export const generateEnqueueFunctionInput = ({ { id: '1', namespace: undefined, - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, typeId: RULE_TYPE_ID, }, ], source: { source: { id: '1', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, }, type: 'SAVED_OBJECT', }, diff --git a/x-pack/plugins/alerting/server/task_runner/rule_loader.test.ts b/x-pack/plugins/alerting/server/task_runner/rule_loader.test.ts index 5371e56ff07b2..380d436c95e65 100644 --- a/x-pack/plugins/alerting/server/task_runner/rule_loader.test.ts +++ b/x-pack/plugins/alerting/server/task_runner/rule_loader.test.ts @@ -18,6 +18,7 @@ import { MONITORING_HISTORY_LIMIT, RuleExecutionStatusErrorReasons } from '../.. import { ErrorWithReason, getReasonFromError } from '../lib/error_with_reason'; import { alertingEventLoggerMock } from '../lib/alerting_event_logger/alerting_event_logger.mock'; import { mockedRawRuleSO, mockedRule } from './fixtures'; +import { RULE_SAVED_OBJECT_TYPE } from '../saved_objects'; // create mocks const rulesClient = rulesClientMock.create(); @@ -199,7 +200,7 @@ describe('rule_loader', () => { expect(contextMock.spaceIdToNamespace.mock.calls[0]).toEqual(['default']); const esoArgs = encryptedSavedObjects.getDecryptedAsInternalUser.mock.calls[0]; - expect(esoArgs).toEqual(['alert', ruleId, { namespace: undefined }]); + expect(esoArgs).toEqual([RULE_SAVED_OBJECT_TYPE, ruleId, { namespace: undefined }]); }); test('succeeds with non-default space', async () => { @@ -218,7 +219,7 @@ describe('rule_loader', () => { }); const esoArgs = encryptedSavedObjects.getDecryptedAsInternalUser.mock.calls[0]; - expect(esoArgs).toEqual(['alert', ruleId, { namespace: spaceId }]); + expect(esoArgs).toEqual([RULE_SAVED_OBJECT_TYPE, ruleId, { namespace: spaceId }]); }); test('fails', async () => { diff --git a/x-pack/plugins/alerting/server/task_runner/rule_loader.ts b/x-pack/plugins/alerting/server/task_runner/rule_loader.ts index f6bb71aef7453..fb037b802ec9b 100644 --- a/x-pack/plugins/alerting/server/task_runner/rule_loader.ts +++ b/x-pack/plugins/alerting/server/task_runner/rule_loader.ts @@ -24,6 +24,7 @@ import { } from '../types'; import { MONITORING_HISTORY_LIMIT, RuleTypeParams } from '../../common'; import { AlertingEventLogger } from '../lib/alerting_event_logger/alerting_event_logger'; +import { RULE_SAVED_OBJECT_TYPE } from '../saved_objects'; export interface RuleData extends LoadedIndirectParams { indirectParams: RawRule; @@ -114,7 +115,7 @@ export async function getRuleAttributes( const namespace = context.spaceIdToNamespace(spaceId); const rawRule = await context.encryptedSavedObjectsClient.getDecryptedAsInternalUser( - 'alert', + RULE_SAVED_OBJECT_TYPE, ruleId, { namespace } ); diff --git a/x-pack/plugins/alerting/server/task_runner/running_handler.test.ts b/x-pack/plugins/alerting/server/task_runner/running_handler.test.ts index ce3a3c6680e7b..3ebb122b3a19a 100644 --- a/x-pack/plugins/alerting/server/task_runner/running_handler.test.ts +++ b/x-pack/plugins/alerting/server/task_runner/running_handler.test.ts @@ -6,11 +6,11 @@ */ import { ISavedObjectsRepository, Logger } from '@kbn/core/server'; -import { partiallyUpdateAlert } from '../saved_objects/partially_update_alert'; +import { partiallyUpdateRule } from '../saved_objects/partially_update_rule'; import { RunningHandler } from './running_handler'; -jest.mock('../saved_objects/partially_update_alert', () => ({ - partiallyUpdateAlert: jest.fn(), +jest.mock('../saved_objects/partially_update_rule', () => ({ + partiallyUpdateRule: jest.fn(), })); describe('isRunning handler', () => { @@ -20,7 +20,7 @@ describe('isRunning handler', () => { } as unknown as Logger; const ruleTypeId = 'myType'; beforeEach(() => { - (partiallyUpdateAlert as jest.Mock).mockClear(); + (partiallyUpdateRule as jest.Mock).mockClear(); (logger.error as jest.Mock).mockClear(); jest.useFakeTimers(); }); @@ -29,23 +29,23 @@ describe('isRunning handler', () => { }); test('Should resolve if nothing got started', async () => { - (partiallyUpdateAlert as jest.Mock).mockImplementation(() => Promise.resolve('resolve')); + (partiallyUpdateRule as jest.Mock).mockImplementation(() => Promise.resolve('resolve')); const runHandler = new RunningHandler(soClient, logger, ruleTypeId); const resp = await runHandler.waitFor(); - expect(partiallyUpdateAlert).toHaveBeenCalledTimes(0); + expect(partiallyUpdateRule).toHaveBeenCalledTimes(0); expect(logger.error).toHaveBeenCalledTimes(0); expect(resp).toBe(undefined); }); - test('Should return the promise from partiallyUpdateAlert when the update isRunning has been a success', async () => { - (partiallyUpdateAlert as jest.Mock).mockImplementation(() => Promise.resolve('resolve')); + test('Should return the promise from partiallyUpdateRule when the update isRunning has been a success', async () => { + (partiallyUpdateRule as jest.Mock).mockImplementation(() => Promise.resolve('resolve')); const runHandler = new RunningHandler(soClient, logger, ruleTypeId); runHandler.start('9876543210'); jest.runAllTimers(); const resp = await runHandler.waitFor(); - expect(partiallyUpdateAlert).toHaveBeenCalledTimes(1); - expect((partiallyUpdateAlert as jest.Mock).mock.calls[0]).toMatchInlineSnapshot(` + expect(partiallyUpdateRule).toHaveBeenCalledTimes(1); + expect((partiallyUpdateRule as jest.Mock).mock.calls[0]).toMatchInlineSnapshot(` Array [ [MockFunction], "9876543210", @@ -64,15 +64,13 @@ describe('isRunning handler', () => { }); test('Should reject when the update isRunning has been a failure', async () => { - (partiallyUpdateAlert as jest.Mock).mockImplementation(() => - Promise.reject(new Error('error')) - ); + (partiallyUpdateRule as jest.Mock).mockImplementation(() => Promise.reject(new Error('error'))); const runHandler = new RunningHandler(soClient, logger, ruleTypeId); runHandler.start('9876543210'); jest.runAllTimers(); await expect(runHandler.waitFor()).rejects.toThrow(); - expect(partiallyUpdateAlert).toHaveBeenCalledTimes(1); + expect(partiallyUpdateRule).toHaveBeenCalledTimes(1); expect(logger.error).toHaveBeenCalledTimes(1); }); }); diff --git a/x-pack/plugins/alerting/server/task_runner/running_handler.ts b/x-pack/plugins/alerting/server/task_runner/running_handler.ts index 118f13ab6eed9..1602e9421ecef 100644 --- a/x-pack/plugins/alerting/server/task_runner/running_handler.ts +++ b/x-pack/plugins/alerting/server/task_runner/running_handler.ts @@ -6,7 +6,7 @@ */ import { ISavedObjectsRepository, Logger } from '@kbn/core/server'; -import { partiallyUpdateAlert } from '../saved_objects/partially_update_alert'; +import { partiallyUpdateRule } from '../saved_objects/partially_update_rule'; const TIME_TO_WAIT = 2000; @@ -45,7 +45,7 @@ export class RunningHandler { private setRunning(ruleId: string, namespace?: string) { this.isUpdating = true; - this.runningPromise = partiallyUpdateAlert( + this.runningPromise = partiallyUpdateRule( this.client, ruleId, { running: true }, diff --git a/x-pack/plugins/alerting/server/task_runner/task_runner.test.ts b/x-pack/plugins/alerting/server/task_runner/task_runner.test.ts index ee55378d08795..23d5d5f576ce3 100644 --- a/x-pack/plugins/alerting/server/task_runner/task_runner.test.ts +++ b/x-pack/plugins/alerting/server/task_runner/task_runner.test.ts @@ -82,6 +82,7 @@ import { alertsServiceMock } from '../alerts_service/alerts_service.mock'; import { getMockMaintenanceWindow } from '../data/maintenance_window/test_helpers'; import { alertsClientMock } from '../alerts_client/alerts_client.mock'; import { MaintenanceWindow } from '../application/maintenance_window/types'; +import { RULE_SAVED_OBJECT_TYPE } from '../saved_objects'; jest.mock('uuid', () => ({ v4: () => '5f6aa57d-3e22-484e-bae8-cbed868f4d28', @@ -2101,7 +2102,10 @@ describe('Task Runner', () => { test('reschedules for smaller interval if es connectivity error encountered and schedule interval is greater than connectivity retry', async () => { rulesClient.getAlertFromRaw.mockImplementation(() => { - throw SavedObjectsErrorHelpers.createGenericNotFoundEsUnavailableError('alert', '1'); + throw SavedObjectsErrorHelpers.createGenericNotFoundEsUnavailableError( + RULE_SAVED_OBJECT_TYPE, + '1' + ); }); const taskRunner = new TaskRunner({ diff --git a/x-pack/plugins/alerting/server/task_runner/task_runner.ts b/x-pack/plugins/alerting/server/task_runner/task_runner.ts index 4a1245f29ee82..532dd7b1e12ba 100644 --- a/x-pack/plugins/alerting/server/task_runner/task_runner.ts +++ b/x-pack/plugins/alerting/server/task_runner/task_runner.ts @@ -43,7 +43,7 @@ import { import { asErr, asOk, isErr, isOk, map, resolveErr, Result } from '../lib/result_type'; import { taskInstanceToAlertTaskInstance } from './alert_task_instance'; import { isAlertSavedObjectNotFoundError, isEsUnavailableError } from '../lib/is_alerting_error'; -import { partiallyUpdateAlert } from '../saved_objects'; +import { partiallyUpdateRule, RULE_SAVED_OBJECT_TYPE } from '../saved_objects'; import { AlertInstanceContext, AlertInstanceState, @@ -221,7 +221,7 @@ export class TaskRunner< // eslint-disable-next-line no-empty } catch {} try { - await partiallyUpdateAlert( + await partiallyUpdateRule( client, ruleId, { ...attributes, running: false }, @@ -473,7 +473,7 @@ export class TaskRunner< }; const savedObjectsClient = this.context.savedObjects.getScopedClient(fakeRequest, { - includedHiddenTypes: ['alert', 'action'], + includedHiddenTypes: [RULE_SAVED_OBJECT_TYPE, 'action'], }); const dataViews = await this.context.dataViews.dataViewsServiceFactory( diff --git a/x-pack/plugins/alerting/server/task_runner/task_runner_cancel.test.ts b/x-pack/plugins/alerting/server/task_runner/task_runner_cancel.test.ts index 46783154a6a4a..0ce2f758ade39 100644 --- a/x-pack/plugins/alerting/server/task_runner/task_runner_cancel.test.ts +++ b/x-pack/plugins/alerting/server/task_runner/task_runner_cancel.test.ts @@ -58,6 +58,7 @@ import { dataViewPluginMocks } from '@kbn/data-views-plugin/public/mocks'; import { rulesSettingsClientMock } from '../rules_settings_client.mock'; import { maintenanceWindowClientMock } from '../maintenance_window_client.mock'; import { alertsServiceMock } from '../alerts_service/alerts_service.mock'; +import { RULE_SAVED_OBJECT_TYPE } from '../saved_objects'; jest.mock('uuid', () => ({ v4: () => '5f6aa57d-3e22-484e-bae8-cbed868f4d28', @@ -222,7 +223,7 @@ describe('Task Runner Cancel', () => { expect( taskRunnerFactoryInitializerParams.internalSavedObjectsRepository.update ).toHaveBeenCalledWith( - 'alert', + RULE_SAVED_OBJECT_TYPE, '1', { executionStatus: { diff --git a/x-pack/plugins/alerting/server/usage/task.ts b/x-pack/plugins/alerting/server/usage/task.ts index e7008056677d0..507970d436d6f 100644 --- a/x-pack/plugins/alerting/server/usage/task.ts +++ b/x-pack/plugins/alerting/server/usage/task.ts @@ -20,6 +20,7 @@ import { getExecutionTimeoutsPerDayCount, } from './lib/get_telemetry_from_event_log'; import { stateSchemaByVersion, emptyState, type LatestTaskStateSchema } from './task_state'; +import { RULE_SAVED_OBJECT_TYPE } from '../saved_objects'; export const TELEMETRY_TASK_TYPE = 'alerting_telemetry'; @@ -90,7 +91,7 @@ export function telemetryTaskRunner( const getAlertIndex = () => core .getStartServices() - .then(([coreStart]) => coreStart.savedObjects.getIndexForType('alert')); + .then(([coreStart]) => coreStart.savedObjects.getIndexForType(RULE_SAVED_OBJECT_TYPE)); return { async run() { diff --git a/x-pack/plugins/apm/ftr_e2e/cypress/e2e/service_groups/service_groups.cy.ts b/x-pack/plugins/apm/ftr_e2e/cypress/e2e/service_groups/service_groups.cy.ts index bc7e7d331cceb..731149159b681 100644 --- a/x-pack/plugins/apm/ftr_e2e/cypress/e2e/service_groups/service_groups.cy.ts +++ b/x-pack/plugins/apm/ftr_e2e/cypress/e2e/service_groups/service_groups.cy.ts @@ -82,7 +82,7 @@ describe('Service groups', () => { it('creates a service group', () => { cy.getByTestSubj('apmCreateServiceGroupButton').click(); - cy.getByTestSubj('apmGroupNameInput').type('go services'); + cy.getByTestSubj('apmGroupNameInput').type('go services{enter}'); cy.contains('Select services').click(); cy.getByTestSubj('headerFilterKuerybar').type('agent.name:"go"{enter}'); cy.contains('synth-go-1'); diff --git a/x-pack/plugins/apm/ftr_e2e/cypress/e2e/service_overview/alerts_table.cy.ts b/x-pack/plugins/apm/ftr_e2e/cypress/e2e/service_overview/alerts_table.cy.ts index 0bce81a620a51..19c07645fb37f 100644 --- a/x-pack/plugins/apm/ftr_e2e/cypress/e2e/service_overview/alerts_table.cy.ts +++ b/x-pack/plugins/apm/ftr_e2e/cypress/e2e/service_overview/alerts_table.cy.ts @@ -38,7 +38,9 @@ describe('Errors table', () => { it('Alerts table with the search bar is populated', () => { cy.visitKibana(serviceOverviewHref); cy.contains('opbeans-java'); - cy.contains('All'); + cy.get( + '[data-test-subj="environmentFilter"] [data-test-subj="comboBoxSearchInput"]' + ).should('have.value', 'All'); cy.contains('Active'); cy.contains('Recovered'); cy.getByTestSubj('globalQueryBar').should('exist'); diff --git a/x-pack/plugins/apm/ftr_e2e/cypress/e2e/service_overview/service_overview.cy.ts b/x-pack/plugins/apm/ftr_e2e/cypress/e2e/service_overview/service_overview.cy.ts index 35184a59880d7..7508612d0acc5 100644 --- a/x-pack/plugins/apm/ftr_e2e/cypress/e2e/service_overview/service_overview.cy.ts +++ b/x-pack/plugins/apm/ftr_e2e/cypress/e2e/service_overview/service_overview.cy.ts @@ -226,9 +226,9 @@ describe('Service Overview', () => { 'suggestionsRequest' ); - cy.getByTestSubj('environmentFilter').find('input').type('production', { - force: true, - }); + cy.getByTestSubj('environmentFilter') + .find('input') + .type('{selectall}production', { force: true }); cy.expectAPIsToHaveBeenCalledWith({ apisIntercepted: ['@suggestionsRequest'], diff --git a/x-pack/plugins/apm/ftr_e2e/cypress/e2e/settings/agent_configurations.cy.ts b/x-pack/plugins/apm/ftr_e2e/cypress/e2e/settings/agent_configurations.cy.ts index e0ca47df79996..1d9d34d7b9a2d 100644 --- a/x-pack/plugins/apm/ftr_e2e/cypress/e2e/settings/agent_configurations.cy.ts +++ b/x-pack/plugins/apm/ftr_e2e/cypress/e2e/settings/agent_configurations.cy.ts @@ -107,7 +107,10 @@ describe('Agent configuration', () => { cy.contains('Create configuration'); cy.contains('Edit').click(); cy.wait('@serviceEnvironmentApi'); - cy.contains('production'); + cy.getByTestSubj('serviceEnviromentComboBox') + .find('input') + .invoke('val') + .should('contain', 'production'); }); it('displays All label when selecting all option', () => { cy.intercept( @@ -129,6 +132,9 @@ describe('Agent configuration', () => { cy.contains('Environment All'); cy.contains('Edit').click(); cy.wait('@serviceEnvironmentApi'); - cy.contains('All'); + cy.getByTestSubj('serviceEnviromentComboBox') + .find('input') + .invoke('val') + .should('contain', 'All'); }); }); diff --git a/x-pack/plugins/apm/ftr_e2e/cypress/e2e/storage_explorer/storage_explorer.cy.ts b/x-pack/plugins/apm/ftr_e2e/cypress/e2e/storage_explorer/storage_explorer.cy.ts index bfa0aaa79d987..11025b29dd0e7 100644 --- a/x-pack/plugins/apm/ftr_e2e/cypress/e2e/storage_explorer/storage_explorer.cy.ts +++ b/x-pack/plugins/apm/ftr_e2e/cypress/e2e/storage_explorer/storage_explorer.cy.ts @@ -130,7 +130,7 @@ describe('Storage Explorer', () => { it('with the correct environment when changing the environment', () => { cy.wait(mainAliasNames); - cy.getByTestSubj('environmentFilter').type('production'); + cy.getByTestSubj('environmentFilter').type('{selectall}production'); cy.contains('button', 'production').click({ force: true }); diff --git a/x-pack/plugins/apm/ftr_e2e/cypress/e2e/transaction_details/generate_span_stacktrace_data.ts b/x-pack/plugins/apm/ftr_e2e/cypress/e2e/transaction_details/generate_span_stacktrace_data.ts new file mode 100644 index 0000000000000..85eeb2cd456ef --- /dev/null +++ b/x-pack/plugins/apm/ftr_e2e/cypress/e2e/transaction_details/generate_span_stacktrace_data.ts @@ -0,0 +1,106 @@ +/* + * 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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import { apm, timerange } from '@kbn/apm-synthtrace-client'; +import { synthtrace } from '../../../synthtrace'; + +function getAPMGeneratedStacktrace() { + const apmGeneratedStacktrace = apm + .service({ + name: 'apm-generated', + environment: 'production', + agentName: 'java', + }) + .instance('instance a'); + + return Array.from( + timerange( + new Date('2022-01-01T00:00:00.000Z'), + new Date('2022-01-01T00:01:00.000Z') + ) + .interval('1m') + .rate(1) + .generator((timestamp) => { + return apmGeneratedStacktrace + .transaction({ transactionName: `Transaction A` }) + .defaults({ + 'service.language.name': 'java', + }) + .timestamp(timestamp) + .duration(1000) + .success() + .children( + apmGeneratedStacktrace + .span({ + spanName: `Span A`, + spanType: 'internal', + 'span.stacktrace': [ + { + library_frame: false, + exclude_from_grouping: false, + filename: 'OutputBuffer.java', + classname: 'org.apache.catalina.connector.OutputBuffer', + line: { number: 825 }, + module: 'org.apache.catalina.connector', + function: 'flushByteBuffer', + }, + ], + }) + .timestamp(timestamp + 50) + .duration(100) + .failure() + ); + }) + ); +} + +function getOtelGeneratedStacktrace() { + const apmGeneratedStacktrace = apm + .service({ + name: 'otel-generated', + environment: 'production', + agentName: 'java', + }) + .instance('instance a'); + + return Array.from( + timerange( + new Date('2022-01-01T00:00:00.000Z'), + new Date('2022-01-01T00:01:00.000Z') + ) + .interval('1m') + .rate(1) + .generator((timestamp) => { + return apmGeneratedStacktrace + .transaction({ transactionName: `Transaction A` }) + .timestamp(timestamp) + .duration(1000) + .defaults({ + 'service.language.name': 'java', + }) + .success() + .children( + apmGeneratedStacktrace + .span({ + spanName: `Span A`, + spanType: 'internal', + 'code.stacktrace': + 'java.lang.Throwable\n\tat co.elastic.otel.ElasticSpanProcessor.captureStackTrace(ElasticSpanProcessor.java:81)', + }) + .timestamp(timestamp + 50) + .duration(100) + .failure() + ); + }) + ); +} + +export function generateSpanStacktraceData() { + const apmGeneratedStacktrace = getAPMGeneratedStacktrace(); + const otelGeneratedStacktrace = getOtelGeneratedStacktrace(); + + synthtrace.index([...apmGeneratedStacktrace, ...otelGeneratedStacktrace]); +} diff --git a/x-pack/plugins/apm/ftr_e2e/cypress/e2e/transaction_details/span_stacktrace.cy.ts b/x-pack/plugins/apm/ftr_e2e/cypress/e2e/transaction_details/span_stacktrace.cy.ts new file mode 100644 index 0000000000000..dbc4a1072ffa0 --- /dev/null +++ b/x-pack/plugins/apm/ftr_e2e/cypress/e2e/transaction_details/span_stacktrace.cy.ts @@ -0,0 +1,63 @@ +/* + * 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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import url from 'url'; +import { synthtrace } from '../../../synthtrace'; +import { generateSpanStacktraceData } from './generate_span_stacktrace_data'; + +const start = '2022-01-01T00:00:00.000Z'; +const end = '2022-01-01T00:15:00.000Z'; + +function getServiceInventoryUrl({ serviceName }: { serviceName: string }) { + return url.format({ + pathname: `/app/apm/services/${serviceName}`, + query: { + rangeFrom: start, + rangeTo: end, + environment: 'ENVIRONMENT_ALL', + kuery: '', + serviceGroup: '', + transactionType: 'request', + comparisonEnabled: true, + offset: '1d', + }, + }); +} + +describe('Span stacktrace', () => { + beforeEach(() => { + cy.loginAsViewerUser(); + }); + describe('span flyout', () => { + before(() => { + generateSpanStacktraceData(); + }); + + after(() => { + synthtrace.clean(); + }); + it('Shows APM agent generated stacktrace', () => { + cy.visitKibana(getServiceInventoryUrl({ serviceName: 'apm-generated' })); + cy.contains('Transaction A').click(); + cy.contains('Span A').click(); + cy.getByTestSubj('spanStacktraceTab').click(); + cy.contains( + 'at org.apache.catalina.connector.OutputBuffer.flushByteBuffer(OutputBuffer.java:825)' + ); + }); + + it('Shows Otel generated stacktrace', () => { + cy.visitKibana(getServiceInventoryUrl({ serviceName: 'otel-generated' })); + cy.contains('Transaction A').click(); + cy.contains('Span A').click(); + cy.getByTestSubj('spanStacktraceTab').click(); + cy.contains( + `java.lang.Throwable at co.elastic.otel.ElasticSpanProcessor.captureStackTrace(ElasticSpanProcessor.java:81)` + ); + }); + }); +}); diff --git a/x-pack/plugins/apm/ftr_e2e/cypress/support/commands.ts b/x-pack/plugins/apm/ftr_e2e/cypress/support/commands.ts index da8b1d418f3a6..f4341fe938092 100644 --- a/x-pack/plugins/apm/ftr_e2e/cypress/support/commands.ts +++ b/x-pack/plugins/apm/ftr_e2e/cypress/support/commands.ts @@ -94,14 +94,16 @@ Cypress.Commands.add( .nextAll() .find('[data-test-subj="superDatePickerAbsoluteDateInput"]') .clear({ force: true }) - .type(moment(start).format(format), { force: true }); + .type(moment(start).format(format), { force: true }) + .type('{enter}'); cy.getByTestSubj('superDatePickerendDatePopoverButton').click(); cy.contains('End date') .nextAll() .find('[data-test-subj="superDatePickerAbsoluteDateInput"]') .clear({ force: true }) - .type(moment(end).format(format), { force: true }); + .type(moment(end).format(format), { force: true }) + .type('{enter}'); } ); diff --git a/x-pack/plugins/apm/public/components/app/error_group_details/error_sampler/error_sample_contextual_insight.tsx b/x-pack/plugins/apm/public/components/app/error_group_details/error_sampler/error_sample_contextual_insight.tsx index bf50eec3afb96..701050302da2a 100644 --- a/x-pack/plugins/apm/public/components/app/error_group_details/error_sampler/error_sample_contextual_insight.tsx +++ b/x-pack/plugins/apm/public/components/app/error_group_details/error_sampler/error_sample_contextual_insight.tsx @@ -7,12 +7,11 @@ import { EuiFlexItem, EuiSpacer } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { - useObservabilityAIAssistant, - ContextualInsight, type Message, MessageRole, } from '@kbn/observability-ai-assistant-plugin/public'; import React, { useMemo, useState } from 'react'; +import { useApmPluginContext } from '../../../../context/apm_plugin/use_apm_plugin_context'; import { APMError } from '../../../../../typings/es_schemas/ui/apm_error'; import { Transaction } from '../../../../../typings/es_schemas/ui/transaction'; import { ErrorSampleDetailTabContent } from './error_sample_detail'; @@ -25,7 +24,9 @@ export function ErrorSampleContextualInsight({ error: APMError; transaction?: Transaction; }) { - const aiAssistant = useObservabilityAIAssistant(); + const { + observabilityAIAssistant: { ObservabilityAIAssistantContextualInsight }, + } = useApmPluginContext(); const [logStacktrace, setLogStacktrace] = useState(''); const [exceptionStacktrace, setExceptionStacktrace] = useState(''); @@ -72,10 +73,10 @@ ${exceptionStacktrace}` ]; }, [error, transaction, logStacktrace, exceptionStacktrace]); - return aiAssistant.isEnabled() && messages ? ( + return ObservabilityAIAssistantContextualInsight && messages ? ( <> - ), }, - ...(!isEmpty(stackframes) + ...(!isEmpty(stackframes) || !isEmpty(plaintextStacktrace) ? [ { id: 'stack-trace', + 'data-test-subj': 'spanStacktraceTab', name: i18n.translate( 'xpack.apm.transactionDetails.spanFlyout.stackTraceTabLabel', { @@ -245,10 +248,17 @@ function SpanFlyoutBody({ content: ( - + {stackframes ? ( + + ) : ( + + )} ), }, diff --git a/x-pack/plugins/apm/public/components/routing/app_root/apm_header_action_menu/index.tsx b/x-pack/plugins/apm/public/components/routing/app_root/apm_header_action_menu/index.tsx index fefcbcaf3bb54..9be079fe43c52 100644 --- a/x-pack/plugins/apm/public/components/routing/app_root/apm_header_action_menu/index.tsx +++ b/x-pack/plugins/apm/public/components/routing/app_root/apm_header_action_menu/index.tsx @@ -14,7 +14,6 @@ import { import { apmLabsButton } from '@kbn/observability-plugin/common'; import { i18n } from '@kbn/i18n'; import React from 'react'; -import { ObservabilityAIAssistantActionMenuItem } from '@kbn/observability-ai-assistant-plugin/public'; import { getAlertingCapabilities } from '../../../alerting/utils/get_alerting_capabilities'; import { getLegacyApmHref } from '../../../shared/links/apm/apm_link'; import { useApmPluginContext } from '../../../../context/apm_plugin/use_apm_plugin_context'; @@ -24,7 +23,12 @@ import { InspectorHeaderLink } from './inspector_header_link'; import { Labs } from './labs'; export function ApmHeaderActionMenu() { - const { core, plugins, config } = useApmPluginContext(); + const { + core, + plugins, + config, + observabilityAIAssistant: { ObservabilityAIAssistantActionMenuItem }, + } = useApmPluginContext(); const { search } = window.location; const { application, http } = core; const { basePath } = http; @@ -97,7 +101,9 @@ export function ApmHeaderActionMenu() { })} - + {ObservabilityAIAssistantActionMenuItem ? ( + + ) : null} ); } diff --git a/x-pack/plugins/apm/public/components/routing/app_root/index.tsx b/x-pack/plugins/apm/public/components/routing/app_root/index.tsx index 8021fe3c6c88e..85df672363ce1 100644 --- a/x-pack/plugins/apm/public/components/routing/app_root/index.tsx +++ b/x-pack/plugins/apm/public/components/routing/app_root/index.tsx @@ -12,7 +12,6 @@ import { } from '@kbn/kibana-react-plugin/public'; import { RedirectAppLinks } from '@kbn/shared-ux-link-redirect-app'; import { Storage } from '@kbn/kibana-utils-plugin/public'; -import { ObservabilityAIAssistantProvider } from '@kbn/observability-ai-assistant-plugin/public'; import { HeaderMenuPortal, InspectorContextProvider, @@ -75,48 +74,44 @@ export function ApmAppRoot({ services={{ ...core, ...pluginsStart, storage, ...apmServices }} > - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + diff --git a/x-pack/plugins/apm/public/components/shared/stacktrace/index.tsx b/x-pack/plugins/apm/public/components/shared/stacktrace/index.tsx index 4a3646dbb78c1..379dd5700406e 100644 --- a/x-pack/plugins/apm/public/components/shared/stacktrace/index.tsx +++ b/x-pack/plugins/apm/public/components/shared/stacktrace/index.tsx @@ -17,6 +17,7 @@ import { Stackframe as StackframeComponent } from './stackframe'; interface Props { stackframes?: Stackframe[]; codeLanguage?: string; + stackTrace?: string; } export function Stacktrace({ stackframes = [], codeLanguage }: Props) { diff --git a/x-pack/plugins/apm/public/components/shared/transaction_action_menu/__snapshots__/transaction_action_menu.test.tsx.snap b/x-pack/plugins/apm/public/components/shared/transaction_action_menu/__snapshots__/transaction_action_menu.test.tsx.snap index 17f22a43a1c43..02ed85e387ecb 100644 --- a/x-pack/plugins/apm/public/components/shared/transaction_action_menu/__snapshots__/transaction_action_menu.test.tsx.snap +++ b/x-pack/plugins/apm/public/components/shared/transaction_action_menu/__snapshots__/transaction_action_menu.test.tsx.snap @@ -3,32 +3,28 @@ exports[`TransactionActionMenu component matches the snapshot 1`] = `
-
- -
+ + +
`; diff --git a/x-pack/plugins/apm/public/components/shared/transaction_action_menu/transaction_action_menu.test.tsx b/x-pack/plugins/apm/public/components/shared/transaction_action_menu/transaction_action_menu.test.tsx index 20e3d2ad0c948..764f2a11c02cc 100644 --- a/x-pack/plugins/apm/public/components/shared/transaction_action_menu/transaction_action_menu.test.tsx +++ b/x-pack/plugins/apm/public/components/shared/transaction_action_menu/transaction_action_menu.test.tsx @@ -419,9 +419,9 @@ describe('TransactionActionMenu component', () => { component .getByTestId(`${key}.value`) .querySelector( - '[data-test-subj="comboBoxInput"] span' - ) as HTMLSpanElement - ).textContent, + '[data-test-subj="comboBoxSearchInput"]' + ) as HTMLInputElement + ).value, }; }; expect(getFilterKeyValue('service.name')).toEqual({ diff --git a/x-pack/plugins/apm/public/tutorial/config_agent/index.test.tsx b/x-pack/plugins/apm/public/tutorial/config_agent/index.test.tsx index edae01e0b6043..8ef39fcbc8c73 100644 --- a/x-pack/plugins/apm/public/tutorial/config_agent/index.test.tsx +++ b/x-pack/plugins/apm/public/tutorial/config_agent/index.test.tsx @@ -4,7 +4,7 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { fireEvent, render, screen } from '@testing-library/react'; +import { fireEvent, render, screen, within } from '@testing-library/react'; import { HttpStart } from '@kbn/core/public'; import React from 'react'; import { @@ -80,9 +80,17 @@ describe('TutorialConfigAgent', () => { kibanaVersion="8.0.0" /> ); - expect( - await screen.findByText('Default Standalone configuration') - ).toBeInTheDocument(); + + const policySelectorWrapper = await screen.findByTestId( + 'policySelector_onPrem' + ); + expect(policySelectorWrapper).toBeInTheDocument(); + + const input = within(policySelectorWrapper).getByTestId( + 'comboBoxSearchInput' + ); + expect(input).toHaveValue('Default Standalone configuration'); + let commands = component.getByTestId('commands').innerHTML; expect(commands).not.toEqual(''); expect(commands).toMatchInlineSnapshot(` @@ -128,12 +136,17 @@ describe('TutorialConfigAgent', () => { kibanaVersion="8.0.0" /> ); - expect( - await screen.findByText('Default Standalone configuration') - ).toBeInTheDocument(); - expect( - component.getByTestId('policySelector_onPrem') - ).toBeInTheDocument(); + + const policySelectorWrapper = await screen.findByTestId( + 'policySelector_onPrem' + ); + expect(policySelectorWrapper).toBeInTheDocument(); + + const input = within(policySelectorWrapper).getByTestId( + 'comboBoxSearchInput' + ); + expect(input).toHaveValue('Default Standalone configuration'); + const commands = component.getByTestId('commands').innerHTML; expect(commands).not.toEqual(''); expect(commands).toMatchInlineSnapshot(` @@ -164,12 +177,17 @@ describe('TutorialConfigAgent', () => { kibanaVersion="8.0.0" /> ); - expect( - await screen.findByText('Default Standalone configuration') - ).toBeInTheDocument(); - expect( - component.getByTestId('policySelector_onPrem') - ).toBeInTheDocument(); + + const policySelectorWrapper = await screen.findByTestId( + 'policySelector_onPrem' + ); + expect(policySelectorWrapper).toBeInTheDocument(); + + const input = within(policySelectorWrapper).getByTestId( + 'comboBoxSearchInput' + ); + expect(input).toHaveValue('Default Standalone configuration'); + const commands = component.getByTestId('commands').innerHTML; expect(commands).not.toEqual(''); expect(commands).toMatchInlineSnapshot(` @@ -206,12 +224,17 @@ describe('TutorialConfigAgent', () => { kibanaVersion="8.0.0" /> ); - expect( - await screen.findByText('Default Standalone configuration') - ).toBeInTheDocument(); - expect( - component.getByTestId('policySelector_cloud') - ).toBeInTheDocument(); + + const policySelectorWrapper = await screen.findByTestId( + 'policySelector_cloud' + ); + expect(policySelectorWrapper).toBeInTheDocument(); + + const input = within(policySelectorWrapper).getByTestId( + 'comboBoxSearchInput' + ); + expect(input).toHaveValue('Default Standalone configuration'); + const commands = component.getByTestId('commands').innerHTML; expect(commands).not.toEqual(''); expect(commands).toMatchInlineSnapshot(` @@ -245,12 +268,17 @@ describe('TutorialConfigAgent', () => { kibanaVersion="8.0.0" /> ); - expect( - await screen.findByText('Elastic Cloud agent policy') - ).toBeInTheDocument(); - expect( - component.getByTestId('policySelector_policy-elastic-agent-on-cloud') - ).toBeInTheDocument(); + + const policySelectorWrapper = await screen.findByTestId( + 'policySelector_policy-elastic-agent-on-cloud' + ); + expect(policySelectorWrapper).toBeInTheDocument(); + + const input = within(policySelectorWrapper).getByTestId( + 'comboBoxSearchInput' + ); + expect(input).toHaveValue('Elastic Cloud agent policy'); + const commands = component.getByTestId('commands').innerHTML; expect(commands).not.toEqual(''); expect(commands).toMatchInlineSnapshot(` @@ -280,9 +308,17 @@ describe('TutorialConfigAgent', () => { kibanaVersion="8.0.0" /> ); - expect( - await screen.findByText('Default Standalone configuration') - ).toBeInTheDocument(); + + const policySelectorWrapper = await screen.findByTestId( + 'policySelector_onPrem' + ); + expect(policySelectorWrapper).toBeInTheDocument(); + + const input = within(policySelectorWrapper).getByTestId( + 'comboBoxSearchInput' + ); + expect(input).toHaveValue('Default Standalone configuration'); + const commands = component.getByTestId('commands').innerHTML; expect(commands).not.toEqual(''); expect(commands).toMatchInlineSnapshot(` @@ -340,12 +376,17 @@ describe('TutorialConfigAgent', () => { kibanaVersion="8.0.0" /> ); - expect( - await screen.findByText('Default Standalone configuration') - ).toBeInTheDocument(); - expect( - component.getByTestId('policySelector_onPrem') - ).toBeInTheDocument(); + + const policySelectorWrapper = await screen.findByTestId( + 'policySelector_onPrem' + ); + expect(policySelectorWrapper).toBeInTheDocument(); + + const input = within(policySelectorWrapper).getByTestId( + 'comboBoxSearchInput' + ); + expect(input).toHaveValue('Default Standalone configuration'); + const commands = component.getByTestId('commands').innerHTML; expect(commands).not.toEqual(''); expect(commands).toMatchInlineSnapshot(` @@ -379,10 +420,16 @@ describe('TutorialConfigAgent', () => { kibanaVersion="8.0.0" /> ); - expect( - await screen.findByText('Default Standalone configuration') - ).toBeInTheDocument(); - expect(component.getByTestId('policySelector_cloud')).toBeInTheDocument(); + const policySelectorWrapper = await screen.findByTestId( + 'policySelector_cloud' + ); + expect(policySelectorWrapper).toBeInTheDocument(); + + const input = within(policySelectorWrapper).getByTestId( + 'comboBoxSearchInput' + ); + expect(input).toHaveValue('Default Standalone configuration'); + const commands = component.getByTestId('commands').innerHTML; expect(commands).not.toEqual(''); expect(commands).toMatchInlineSnapshot(` diff --git a/x-pack/plugins/apm/server/routes/historical_data/has_historical_agent_data.ts b/x-pack/plugins/apm/server/routes/historical_data/has_historical_agent_data.ts index befd25abb22f2..4968ceba47e68 100644 --- a/x-pack/plugins/apm/server/routes/historical_data/has_historical_agent_data.ts +++ b/x-pack/plugins/apm/server/routes/historical_data/has_historical_agent_data.ts @@ -8,10 +8,29 @@ import { ProcessorEvent } from '@kbn/observability-plugin/common'; import { APMEventClient } from '../../lib/helpers/create_es_client/create_apm_event_client'; -// Note: this logic is duplicated in tutorials/apm/envs/on_prem export async function hasHistoricalAgentData(apmEventClient: APMEventClient) { + const hasDataInWarmOrHotDataTiers = await hasDataRequest(apmEventClient, [ + 'data_hot', + 'data_warm', + ]); + + if (hasDataInWarmOrHotDataTiers) { + return true; + } + + const hasDataUnbounded = await hasDataRequest(apmEventClient); + + return hasDataUnbounded; +} + +type DataTier = 'data_hot' | 'data_warm' | 'data_cold' | 'data_frozen'; +async function hasDataRequest( + apmEventClient: APMEventClient, + dataTiers?: DataTier[] +) { + const query = dataTiers ? { terms: { _tier: dataTiers } } : undefined; + const params = { - terminate_after: 1, apm: { events: [ ProcessorEvent.error, @@ -20,8 +39,10 @@ export async function hasHistoricalAgentData(apmEventClient: APMEventClient) { ], }, body: { + terminate_after: 1, track_total_hits: 1, size: 0, + query, }, }; diff --git a/x-pack/plugins/apm/server/routes/services/__snapshots__/queries.test.ts.snap b/x-pack/plugins/apm/server/routes/services/__snapshots__/queries.test.ts.snap deleted file mode 100644 index 03c3f038ad311..0000000000000 --- a/x-pack/plugins/apm/server/routes/services/__snapshots__/queries.test.ts.snap +++ /dev/null @@ -1,313 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`services queries fetches the agent status 1`] = ` -Object { - "apm": Object { - "events": Array [ - "error", - "metric", - "transaction", - ], - }, - "body": Object { - "size": 0, - "track_total_hits": 1, - }, - "terminate_after": 1, -} -`; - -exports[`services queries fetches the service agent name 1`] = ` -Object { - "apm": Object { - "events": Array [ - "error", - "transaction", - "metric", - ], - }, - "body": Object { - "_source": Array [ - "agent.name", - "service.runtime.name", - "cloud.provider", - "cloud.service.name", - ], - "query": Object { - "bool": Object { - "filter": Array [ - Object { - "term": Object { - "service.name": "foo", - }, - }, - Object { - "range": Object { - "@timestamp": Object { - "format": "epoch_millis", - "gte": 0, - "lte": 50000, - }, - }, - }, - Object { - "exists": Object { - "field": "agent.name", - }, - }, - ], - "should": Array [ - Object { - "exists": Object { - "field": "service.runtime.name", - }, - }, - Object { - "exists": Object { - "field": "cloud.provider", - }, - }, - Object { - "exists": Object { - "field": "cloud.service.name", - }, - }, - ], - }, - }, - "size": 1, - "sort": Object { - "_score": Object { - "order": "desc", - }, - }, - "track_total_hits": 1, - }, - "terminate_after": 1, -} -`; - -exports[`services queries fetches the service items 1`] = ` -Array [ - Object { - "apm": Object { - "sources": Array [ - Object { - "documentType": "transactionEvent", - "rollupInterval": "none", - }, - ], - }, - "body": Object { - "aggs": Object { - "sample": Object { - "aggs": Object { - "overflowCount": Object { - "sum": Object { - "field": "service_transaction.aggregation.overflow_count", - }, - }, - "services": Object { - "aggs": Object { - "transactionType": Object { - "aggs": Object { - "avg_duration": Object { - "avg": Object { - "field": "transaction.duration.us", - }, - }, - "environments": Object { - "terms": Object { - "field": "service.environment", - }, - }, - "sample": Object { - "top_metrics": Object { - "metrics": Array [ - Object { - "field": "agent.name", - }, - ], - "sort": Object { - "@timestamp": "desc", - }, - }, - }, - "successful": Object { - "filter": Object { - "bool": Object { - "filter": Array [ - Object { - "terms": Object { - "event.outcome": Array [ - "success", - ], - }, - }, - ], - }, - }, - }, - "successful_or_failed": Object { - "filter": Object { - "bool": Object { - "filter": Array [ - Object { - "terms": Object { - "event.outcome": Array [ - "failure", - "success", - ], - }, - }, - ], - }, - }, - }, - }, - "terms": Object { - "field": "transaction.type", - }, - }, - }, - "terms": Object { - "field": "service.name", - "size": 1000, - }, - }, - }, - "random_sampler": Object { - "probability": 1, - "seed": 0, - }, - }, - }, - "query": Object { - "bool": Object { - "filter": Array [ - Object { - "range": Object { - "@timestamp": Object { - "format": "epoch_millis", - "gte": 0, - "lte": 50000, - }, - }, - }, - ], - }, - }, - "size": 0, - "track_total_hits": false, - }, - }, - Object { - "apm": Object { - "events": Array [ - "metric", - "error", - ], - }, - "body": Object { - "aggs": Object { - "sample": Object { - "aggs": Object { - "services": Object { - "aggs": Object { - "environments": Object { - "terms": Object { - "field": "service.environment", - }, - }, - "latest": Object { - "top_metrics": Object { - "metrics": Array [ - Object { - "field": "agent.name", - }, - ], - "sort": Object { - "@timestamp": "desc", - }, - }, - }, - }, - "terms": Object { - "field": "service.name", - "size": 1000, - }, - }, - }, - "random_sampler": Object { - "probability": 1, - "seed": 0, - }, - }, - }, - "query": Object { - "bool": Object { - "filter": Array [ - Object { - "range": Object { - "@timestamp": Object { - "format": "epoch_millis", - "gte": 0, - "lte": 50000, - }, - }, - }, - ], - }, - }, - "size": 0, - "track_total_hits": false, - }, - }, - undefined, -] -`; - -exports[`services queries fetches the service transaction types 1`] = ` -Object { - "apm": Object { - "sources": Array [ - Object { - "documentType": "transactionMetric", - "rollupInterval": "1m", - }, - ], - }, - "body": Object { - "aggs": Object { - "types": Object { - "terms": Object { - "field": "transaction.type", - "size": 100, - }, - }, - }, - "query": Object { - "bool": Object { - "filter": Array [ - Object { - "term": Object { - "service.name": "foo", - }, - }, - Object { - "range": Object { - "@timestamp": Object { - "format": "epoch_millis", - "gte": 0, - "lte": 50000, - }, - }, - }, - ], - }, - }, - "size": 0, - "track_total_hits": false, - }, -} -`; diff --git a/x-pack/plugins/apm/server/routes/services/queries.test.ts b/x-pack/plugins/apm/server/routes/services/queries.test.ts deleted file mode 100644 index 7d45899aa84c0..0000000000000 --- a/x-pack/plugins/apm/server/routes/services/queries.test.ts +++ /dev/null @@ -1,90 +0,0 @@ -/* - * 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; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { ApmDocumentType } from '../../../common/document_type'; -import { ENVIRONMENT_ALL } from '../../../common/environment_filter_values'; -import { RollupInterval } from '../../../common/rollup'; -import { - inspectSearchParams, - SearchParamsMock, -} from '../../utils/test_helpers'; -import { hasHistoricalAgentData } from '../historical_data/has_historical_agent_data'; -import { getServicesItems } from './get_services/get_services_items'; -import { getServiceAgent } from './get_service_agent'; -import { getServiceTransactionTypes } from './get_service_transaction_types'; - -describe('services queries', () => { - let mock: SearchParamsMock; - - afterEach(() => { - mock.teardown(); - }); - - it('fetches the service agent name', async () => { - mock = await inspectSearchParams(({ mockApmEventClient }) => - getServiceAgent({ - serviceName: 'foo', - apmEventClient: mockApmEventClient, - start: 0, - end: 50000, - }) - ); - - expect(mock.params).toMatchSnapshot(); - }); - - it('fetches the service transaction types', async () => { - mock = await inspectSearchParams(({ mockApmEventClient }) => - getServiceTransactionTypes({ - serviceName: 'foo', - apmEventClient: mockApmEventClient, - start: 0, - end: 50000, - documentType: ApmDocumentType.TransactionMetric, - rollupInterval: RollupInterval.OneMinute, - }) - ); - - expect(mock.params).toMatchSnapshot(); - }); - - it('fetches the service items', async () => { - mock = await inspectSearchParams( - ({ mockApmEventClient, mockApmAlertsClient }) => - getServicesItems({ - mlClient: undefined, - apmEventClient: mockApmEventClient, - documentType: ApmDocumentType.TransactionEvent, - rollupInterval: RollupInterval.None, - logger: {} as any, - environment: ENVIRONMENT_ALL.value, - kuery: '', - start: 0, - end: 50000, - serviceGroup: null, - randomSampler: { - probability: 1, - seed: 0, - }, - apmAlertsClient: mockApmAlertsClient, - useDurationSummary: false, - }) - ); - - const allParams = mock.spy.mock.calls.map((call) => call[1]); - - expect(allParams).toMatchSnapshot(); - }); - - it('fetches the agent status', async () => { - mock = await inspectSearchParams(({ mockApmEventClient }) => - hasHistoricalAgentData(mockApmEventClient) - ); - - expect(mock.params).toMatchSnapshot(); - }); -}); diff --git a/x-pack/plugins/apm/typings/es_schemas/raw/span_raw.ts b/x-pack/plugins/apm/typings/es_schemas/raw/span_raw.ts index 1cac68f74b8b7..301a4c96dfa35 100644 --- a/x-pack/plugins/apm/typings/es_schemas/raw/span_raw.ts +++ b/x-pack/plugins/apm/typings/es_schemas/raw/span_raw.ts @@ -71,6 +71,9 @@ export interface SpanRaw extends APMBaseDoc { id: string; }; child?: { id: string[] }; + code?: { + stacktrace?: string; + }; http?: Http; url?: Url; } diff --git a/x-pack/plugins/canvas/public/components/popover/popover.tsx b/x-pack/plugins/canvas/public/components/popover/popover.tsx index 2ef1d4efc10d3..85bf9520b2758 100644 --- a/x-pack/plugins/canvas/public/components/popover/popover.tsx +++ b/x-pack/plugins/canvas/public/components/popover/popover.tsx @@ -17,7 +17,6 @@ interface Props { ownFocus?: boolean; tooltip?: string; panelClassName?: string; - anchorClassName?: string; anchorPosition?: string; panelPaddingSize?: 'none' | 's' | 'm' | 'l'; id?: string; diff --git a/x-pack/plugins/canvas/shareable_runtime/components/__snapshots__/app.test.tsx.snap b/x-pack/plugins/canvas/shareable_runtime/components/__snapshots__/app.test.tsx.snap index 5d2efe2903bf3..b661ee6e992e7 100644 --- a/x-pack/plugins/canvas/shareable_runtime/components/__snapshots__/app.test.tsx.snap +++ b/x-pack/plugins/canvas/shareable_runtime/components/__snapshots__/app.test.tsx.snap @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[` App renders properly 1`] = `"
markdown mock
markdown mock

Page level controls

My Canvas Workpad

There is a new region landmark with page level controls at the end of the document.

"`; +exports[` App renders properly 1`] = `"
markdown mock
markdown mock

Page level controls

My Canvas Workpad

There is a new region landmark with page level controls at the end of the document.

"`; diff --git a/x-pack/plugins/canvas/shareable_runtime/components/footer/settings/__snapshots__/settings.test.tsx.snap b/x-pack/plugins/canvas/shareable_runtime/components/footer/settings/__snapshots__/settings.test.tsx.snap index db2b294c9074a..da3ad71c3f034 100644 --- a/x-pack/plugins/canvas/shareable_runtime/components/footer/settings/__snapshots__/settings.test.tsx.snap +++ b/x-pack/plugins/canvas/shareable_runtime/components/footer/settings/__snapshots__/settings.test.tsx.snap @@ -9,7 +9,7 @@ exports[` can navigate Autoplay Settings 1`] = ` aria-describedby="generated-id" aria-live="off" aria-modal="true" - class="euiPanel euiPanel--plain euiPopover__panel emotion-euiPanel-grow-m-plain-euiPopover__panel-hasTransform" + class="euiPanel euiPanel--plain euiPopover__panel emotion-euiPanel-grow-m-plain-euiPopover__panel-light-hasTransform" data-popover-panel="true" role="dialog" style="top: -16px; left: -22px; will-change: transform, opacity; z-index: 2000;" @@ -102,7 +102,7 @@ exports[` can navigate Autoplay Settings 2`] = ` aria-describedby="generated-id" aria-live="off" aria-modal="true" - class="euiPanel euiPanel--plain euiPopover__panel emotion-euiPanel-grow-m-plain-euiPopover__panel-isOpen-hasTransform-top" + class="euiPanel euiPanel--plain euiPopover__panel emotion-euiPanel-grow-m-plain-euiPopover__panel-light-isOpen-hasTransform-top" data-popover-open="true" data-popover-panel="true" role="dialog" @@ -345,7 +345,7 @@ exports[` can navigate Toolbar Settings, closes when activated 1`] = aria-describedby="generated-id" aria-live="off" aria-modal="true" - class="euiPanel euiPanel--plain euiPopover__panel emotion-euiPanel-grow-m-plain-euiPopover__panel-hasTransform" + class="euiPanel euiPanel--plain euiPopover__panel emotion-euiPanel-grow-m-plain-euiPopover__panel-light-hasTransform" data-popover-panel="true" role="dialog" style="top: -16px; left: -22px; will-change: transform, opacity; z-index: 2000;" @@ -438,7 +438,7 @@ exports[` can navigate Toolbar Settings, closes when activated 2`] = aria-describedby="generated-id" aria-live="off" aria-modal="true" - class="euiPanel euiPanel--plain euiPopover__panel emotion-euiPanel-grow-m-plain-euiPopover__panel-isOpen-hasTransform-top" + class="euiPanel euiPanel--plain euiPopover__panel emotion-euiPanel-grow-m-plain-euiPopover__panel-light-isOpen-hasTransform-top" data-popover-open="true" data-popover-panel="true" role="dialog" @@ -615,7 +615,7 @@ exports[` can navigate Toolbar Settings, closes when activated 3`] = aria-describedby="generated-id" aria-live="off" aria-modal="true" - class="euiPanel euiPanel--plain euiPopover__panel emotion-euiPanel-grow-m-plain-euiPopover__panel-hasTransform" + class="euiPanel euiPanel--plain euiPopover__panel emotion-euiPanel-grow-m-plain-euiPopover__panel-light-hasTransform" data-popover-panel="true" role="dialog" style="top: -16px; left: -22px; z-index: 2000;" diff --git a/x-pack/plugins/cases/public/components/all_cases/use_actions.test.tsx b/x-pack/plugins/cases/public/components/all_cases/use_actions.test.tsx index dcec2558aad46..e88b5e52c0848 100644 --- a/x-pack/plugins/cases/public/components/all_cases/use_actions.test.tsx +++ b/x-pack/plugins/cases/public/components/all_cases/use_actions.test.tsx @@ -8,6 +8,10 @@ import userEvent from '@testing-library/user-event'; import { waitFor } from '@testing-library/react'; import { renderHook } from '@testing-library/react-hooks/dom'; +import { + waitForEuiPopoverOpen, + waitForEuiContextMenuPanelTransition, +} from '@elastic/eui/lib/test/rtl'; import { useActions } from './use_actions'; import { basicCase } from '../../containers/mock'; @@ -69,13 +73,12 @@ describe('useActions', () => { const res = appMockRender.render(comp); userEvent.click(res.getByTestId(`case-action-popover-button-${basicCase.id}`)); + await waitForEuiPopoverOpen(); - await waitFor(() => { - expect(res.getByText('Actions')).toBeInTheDocument(); - expect(res.getByTestId(`case-action-status-panel-${basicCase.id}`)).toBeInTheDocument(); - expect(res.getByTestId('cases-bulk-action-delete')).toBeInTheDocument(); - expect(res.getByTestId('cases-action-copy-id')).toBeInTheDocument(); - }); + expect(res.getByText('Actions')).toBeInTheDocument(); + expect(res.getByTestId(`case-action-status-panel-${basicCase.id}`)).toBeInTheDocument(); + expect(res.getByTestId('cases-bulk-action-delete')).toBeInTheDocument(); + expect(res.getByTestId('cases-action-copy-id')).toBeInTheDocument(); }); it('change the status of the case', async () => { @@ -89,24 +92,16 @@ describe('useActions', () => { const res = appMockRender.render(comp); userEvent.click(res.getByTestId(`case-action-popover-button-${basicCase.id}`)); + await waitForEuiPopoverOpen(); - await waitFor(() => { - expect(res.getByTestId(`case-action-status-panel-${basicCase.id}`)).toBeInTheDocument(); - }); + userEvent.click(res.getByTestId(`case-action-status-panel-${basicCase.id}`)); + await waitForEuiContextMenuPanelTransition(); - userEvent.click(res.getByTestId(`case-action-status-panel-${basicCase.id}`), undefined, { - skipPointerEventsCheck: true, - }); + expect(res.getByTestId('cases-bulk-action-status-open')).toBeInTheDocument(); + expect(res.getByTestId('cases-bulk-action-status-in-progress')).toBeInTheDocument(); + expect(res.getByTestId('cases-bulk-action-status-closed')).toBeInTheDocument(); - await waitFor(() => { - expect(res.getByTestId('cases-bulk-action-status-open')).toBeInTheDocument(); - expect(res.getByTestId('cases-bulk-action-status-in-progress')).toBeInTheDocument(); - expect(res.getByTestId('cases-bulk-action-status-closed')).toBeInTheDocument(); - }); - - userEvent.click(res.getByTestId('cases-bulk-action-status-in-progress'), undefined, { - skipPointerEventsCheck: true, - }); + userEvent.click(res.getByTestId('cases-bulk-action-status-in-progress')); await waitFor(() => { expect(updateCasesSpy).toHaveBeenCalled(); @@ -124,25 +119,17 @@ describe('useActions', () => { const res = appMockRender.render(comp); userEvent.click(res.getByTestId(`case-action-popover-button-${basicCase.id}`)); + await waitForEuiPopoverOpen(); - await waitFor(() => { - expect(res.getByTestId(`case-action-severity-panel-${basicCase.id}`)).toBeInTheDocument(); - }); - - userEvent.click(res.getByTestId(`case-action-severity-panel-${basicCase.id}`), undefined, { - skipPointerEventsCheck: true, - }); + userEvent.click(res.getByTestId(`case-action-severity-panel-${basicCase.id}`)); + await waitForEuiContextMenuPanelTransition(); - await waitFor(() => { - expect(res.getByTestId('cases-bulk-action-severity-low')).toBeInTheDocument(); - expect(res.getByTestId('cases-bulk-action-severity-medium')).toBeInTheDocument(); - expect(res.getByTestId('cases-bulk-action-severity-high')).toBeInTheDocument(); - expect(res.getByTestId('cases-bulk-action-severity-critical')).toBeInTheDocument(); - }); + expect(res.getByTestId('cases-bulk-action-severity-low')).toBeInTheDocument(); + expect(res.getByTestId('cases-bulk-action-severity-medium')).toBeInTheDocument(); + expect(res.getByTestId('cases-bulk-action-severity-high')).toBeInTheDocument(); + expect(res.getByTestId('cases-bulk-action-severity-critical')).toBeInTheDocument(); - userEvent.click(res.getByTestId('cases-bulk-action-severity-medium'), undefined, { - skipPointerEventsCheck: true, - }); + userEvent.click(res.getByTestId('cases-bulk-action-severity-medium')); await waitFor(() => { expect(updateCasesSpy).toHaveBeenCalled(); @@ -167,14 +154,9 @@ describe('useActions', () => { const res = appMockRender.render(comp); userEvent.click(res.getByTestId(`case-action-popover-button-${basicCase.id}`)); + await waitForEuiPopoverOpen(); - await waitFor(() => { - expect(res.getByTestId('cases-action-copy-id')).toBeInTheDocument(); - }); - - userEvent.click(res.getByTestId('cases-action-copy-id'), undefined, { - skipPointerEventsCheck: true, - }); + userEvent.click(res.getByTestId('cases-action-copy-id')); expect(navigator.clipboard.writeText).toHaveBeenCalledWith(basicCase.id); @@ -195,14 +177,9 @@ describe('useActions', () => { const res = appMockRender.render(comp); userEvent.click(res.getByTestId(`case-action-popover-button-${basicCase.id}`)); + await waitForEuiPopoverOpen(); - await waitFor(() => { - expect(res.getByTestId('cases-bulk-action-delete')).toBeInTheDocument(); - }); - - userEvent.click(res.getByTestId('cases-bulk-action-delete'), undefined, { - skipPointerEventsCheck: true, - }); + userEvent.click(res.getByTestId('cases-bulk-action-delete')); await waitFor(() => { expect(res.getByTestId('confirm-delete-case-modal')).toBeInTheDocument(); @@ -224,22 +201,15 @@ describe('useActions', () => { const res = appMockRender.render(comp); userEvent.click(res.getByTestId(`case-action-popover-button-${basicCase.id}`)); + await waitForEuiPopoverOpen(); - await waitFor(() => { - expect(res.getByTestId('cases-bulk-action-delete')).toBeInTheDocument(); - }); - - userEvent.click(res.getByTestId('cases-bulk-action-delete'), undefined, { - skipPointerEventsCheck: true, - }); + userEvent.click(res.getByTestId('cases-bulk-action-delete')); await waitFor(() => { expect(res.getByTestId('confirm-delete-case-modal')).toBeInTheDocument(); }); - userEvent.click(res.getByTestId('confirmModalCancelButton'), undefined, { - skipPointerEventsCheck: true, - }); + userEvent.click(res.getByTestId('confirmModalCancelButton')); expect(res.queryByTestId('confirm-delete-case-modal')).toBeFalsy(); }); @@ -257,14 +227,9 @@ describe('useActions', () => { const res = appMockRender.render(comp); userEvent.click(res.getByTestId(`case-action-popover-button-${basicCase.id}`)); + await waitForEuiPopoverOpen(); - await waitFor(() => { - expect(res.getByTestId('cases-bulk-action-tags')).toBeInTheDocument(); - }); - - userEvent.click(res.getByTestId('cases-bulk-action-tags'), undefined, { - skipPointerEventsCheck: true, - }); + userEvent.click(res.getByTestId('cases-bulk-action-tags')); await waitFor(() => { expect(res.getByTestId('cases-edit-tags-flyout')).toBeInTheDocument(); @@ -297,14 +262,9 @@ describe('useActions', () => { const res = appMockRender.render(comp); userEvent.click(res.getByTestId(`case-action-popover-button-${basicCase.id}`)); + await waitForEuiPopoverOpen(); - await waitFor(() => { - expect(res.getByTestId('cases-bulk-action-assignees')).toBeInTheDocument(); - }); - - userEvent.click(res.getByTestId('cases-bulk-action-assignees'), undefined, { - skipPointerEventsCheck: true, - }); + userEvent.click(res.getByTestId('cases-bulk-action-assignees')); await waitFor(() => { expect(res.getByTestId('cases-edit-assignees-flyout')).toBeInTheDocument(); @@ -338,14 +298,13 @@ describe('useActions', () => { const res = appMockRender.render(comp); userEvent.click(res.getByTestId(`case-action-popover-button-${basicCase.id}`)); + await waitForEuiPopoverOpen(); - await waitFor(() => { - expect(res.getByTestId(`case-action-status-panel-${basicCase.id}`)).toBeInTheDocument(); - expect(res.getByTestId(`case-action-severity-panel-${basicCase.id}`)).toBeInTheDocument(); - expect(res.getByTestId('cases-bulk-action-delete')).toBeInTheDocument(); - expect(res.getByTestId(`actions-separator-${basicCase.id}`)).toBeInTheDocument(); - expect(res.getByTestId('cases-action-copy-id')).toBeInTheDocument(); - }); + expect(res.getByTestId(`case-action-status-panel-${basicCase.id}`)).toBeInTheDocument(); + expect(res.getByTestId(`case-action-severity-panel-${basicCase.id}`)).toBeInTheDocument(); + expect(res.getByTestId('cases-bulk-action-delete')).toBeInTheDocument(); + expect(res.getByTestId(`actions-separator-${basicCase.id}`)).toBeInTheDocument(); + expect(res.getByTestId('cases-action-copy-id')).toBeInTheDocument(); }); it('shows the correct actions with no delete permissions', async () => { @@ -358,14 +317,13 @@ describe('useActions', () => { const res = appMockRender.render(comp); userEvent.click(res.getByTestId(`case-action-popover-button-${basicCase.id}`)); + await waitForEuiPopoverOpen(); - await waitFor(() => { - expect(res.getByTestId(`case-action-status-panel-${basicCase.id}`)).toBeInTheDocument(); - expect(res.getByTestId(`case-action-severity-panel-${basicCase.id}`)).toBeInTheDocument(); - expect(res.getByTestId('cases-action-copy-id')).toBeInTheDocument(); - expect(res.queryByTestId('cases-bulk-action-delete')).toBeFalsy(); - expect(res.queryByTestId(`actions-separator-${basicCase.id}`)).toBeFalsy(); - }); + expect(res.getByTestId(`case-action-status-panel-${basicCase.id}`)).toBeInTheDocument(); + expect(res.getByTestId(`case-action-severity-panel-${basicCase.id}`)).toBeInTheDocument(); + expect(res.getByTestId('cases-action-copy-id')).toBeInTheDocument(); + expect(res.queryByTestId('cases-bulk-action-delete')).toBeFalsy(); + expect(res.queryByTestId(`actions-separator-${basicCase.id}`)).toBeFalsy(); }); it('shows the correct actions with only delete permissions', async () => { @@ -378,14 +336,13 @@ describe('useActions', () => { const res = appMockRender.render(comp); userEvent.click(res.getByTestId(`case-action-popover-button-${basicCase.id}`)); + await waitForEuiPopoverOpen(); - await waitFor(() => { - expect(res.queryByTestId(`case-action-status-panel-${basicCase.id}`)).toBeFalsy(); - expect(res.queryByTestId(`case-action-severity-panel-${basicCase.id}`)).toBeFalsy(); - expect(res.getByTestId('cases-action-copy-id')).toBeInTheDocument(); - expect(res.getByTestId('cases-bulk-action-delete')).toBeInTheDocument(); - expect(res.queryByTestId(`actions-separator-${basicCase.id}`)).toBeFalsy(); - }); + expect(res.queryByTestId(`case-action-status-panel-${basicCase.id}`)).toBeFalsy(); + expect(res.queryByTestId(`case-action-severity-panel-${basicCase.id}`)).toBeFalsy(); + expect(res.getByTestId('cases-action-copy-id')).toBeInTheDocument(); + expect(res.getByTestId('cases-bulk-action-delete')).toBeInTheDocument(); + expect(res.queryByTestId(`actions-separator-${basicCase.id}`)).toBeFalsy(); }); it('returns null if the user does not have update or delete permissions', async () => { diff --git a/x-pack/plugins/cases/public/components/case_view/components/edit_category.test.tsx b/x-pack/plugins/cases/public/components/case_view/components/edit_category.test.tsx index 33c893d6f6b46..16804fb9580a3 100644 --- a/x-pack/plugins/cases/public/components/case_view/components/edit_category.test.tsx +++ b/x-pack/plugins/cases/public/components/case_view/components/edit_category.test.tsx @@ -242,7 +242,7 @@ describe('EditCategory ', () => { await waitFor(() => { expect(screen.getByTestId('categories-list')).toBeInTheDocument(); - expect(screen.getByText('My category')).toBeInTheDocument(); + expect(screen.getByTestId('comboBoxSearchInput')).toHaveValue('My category'); }); expect(screen.getByTestId('edit-category-submit')).toBeDisabled(); @@ -265,7 +265,7 @@ describe('EditCategory ', () => { await waitFor(() => { expect(screen.getByTestId('categories-list')).toBeInTheDocument(); - expect(screen.getByText('My category')).toBeInTheDocument(); + expect(screen.getByTestId('comboBoxSearchInput')).toHaveValue('My category'); }); userEvent.click(screen.getByTestId('edit-category-cancel')); @@ -276,7 +276,7 @@ describe('EditCategory ', () => { await waitFor(() => { expect(screen.getByTestId('categories-list')).toBeInTheDocument(); - expect(screen.getByText('category from the API')).toBeInTheDocument(); + expect(screen.getByTestId('comboBoxSearchInput')).toHaveValue('category from the API'); }); }); diff --git a/x-pack/plugins/cases/public/components/category/category_component.test.tsx b/x-pack/plugins/cases/public/components/category/category_component.test.tsx index 2b0d7ef39007b..6eb95600cd58c 100644 --- a/x-pack/plugins/cases/public/components/category/category_component.test.tsx +++ b/x-pack/plugins/cases/public/components/category/category_component.test.tsx @@ -47,7 +47,7 @@ describe('Category ', () => { it('renders category correctly', () => { render(); - expect(screen.getByText('new-category')).toBeInTheDocument(); + expect(screen.getByRole('combobox')).toHaveValue('new-category'); }); it('renders allow to add new category option', async () => { @@ -56,7 +56,7 @@ describe('Category ', () => { userEvent.type(screen.getByRole('combobox'), 'new{enter}'); expect(onChange).toBeCalledWith('new'); - expect(screen.getByText('new')).toBeInTheDocument(); + expect(screen.getByRole('combobox')).toHaveValue('new'); }); it('renders current option list', async () => { @@ -97,10 +97,10 @@ describe('Category ', () => { expect(onChange).toHaveBeenCalledWith('hi'); }); - userEvent.type(screen.getByRole('combobox'), 'Hi{enter}'); + userEvent.type(screen.getByRole('combobox'), ' there{enter}'); await waitFor(() => { - expect(onChange).toHaveBeenCalledWith('Hi'); + expect(onChange).toHaveBeenCalledWith('hi there'); }); }); }); diff --git a/x-pack/plugins/cases/public/components/create/assignees.test.tsx b/x-pack/plugins/cases/public/components/create/assignees.test.tsx index 9a32ab5f1ffd9..002cd2976f605 100644 --- a/x-pack/plugins/cases/public/components/create/assignees.test.tsx +++ b/x-pack/plugins/cases/public/components/create/assignees.test.tsx @@ -198,7 +198,7 @@ describe('Assignees', () => { }); act(() => { - userEvent.click(screen.getByText('Turtle')); + userEvent.click(screen.getByText('Turtle'), undefined, { skipPointerEventsCheck: true }); }); // ensure that the similar user is still available for selection diff --git a/x-pack/plugins/cloud_security_posture/common/constants.ts b/x-pack/plugins/cloud_security_posture/common/constants.ts index 5e56b1131f10f..7f4f8c796f4c1 100644 --- a/x-pack/plugins/cloud_security_posture/common/constants.ts +++ b/x-pack/plugins/cloud_security_posture/common/constants.ts @@ -26,11 +26,14 @@ export const BENCHMARKS_API_CURRENT_VERSION = '1'; export const FIND_CSP_BENCHMARK_RULE_ROUTE_PATH = '/internal/cloud_security_posture/rules/_find'; export const FIND_CSP_BENCHMARK_RULE_API_CURRENT_VERSION = '1'; -export const DETECTION_RULE_ALERTS_STATUS_API_CURRENT_VERSION = '1'; -export const DETECTION_RULE_RULES_API_CURRENT_VERSION = '2023-10-31'; +export const CSP_BENCHMARK_RULES_BULK_ACTION_ROUTE_PATH = + '/internal/cloud_security_posture/rules/_bulk_action'; +export const CSP_BENCHMARK_RULES_BULK_ACTION_API_CURRENT_VERSION = '1'; export const GET_DETECTION_RULE_ALERTS_STATUS_PATH = '/internal/cloud_security_posture/detection_engine_rules/alerts/_status'; +export const DETECTION_RULE_ALERTS_STATUS_API_CURRENT_VERSION = '1'; +export const DETECTION_RULE_RULES_API_CURRENT_VERSION = '2023-10-31'; export const CLOUD_SECURITY_POSTURE_PACKAGE_NAME = 'cloud_security_posture'; // TODO: REMOVE CSP_LATEST_FINDINGS_DATA_VIEW and replace it with LATEST_FINDINGS_INDEX_PATTERN @@ -88,6 +91,8 @@ export const INTERNAL_FEATURE_FLAGS = { } as const; export const CSP_BENCHMARK_RULE_SAVED_OBJECT_TYPE = 'csp-rule-template'; +export const INTERNAL_CSP_SETTINGS_SAVED_OBJECT_TYPE = 'cloud-security-posture-settings'; +export const INTERNAL_CSP_SETTINGS_SAVED_OBJECT_ID = 'csp-internal-settings'; export const CLOUDBEAT_VANILLA = 'cloudbeat/cis_k8s'; export const CLOUDBEAT_EKS = 'cloudbeat/cis_eks'; diff --git a/x-pack/plugins/cloud_security_posture/common/types/rules/v3.ts b/x-pack/plugins/cloud_security_posture/common/types/rules/v3.ts index 0b7b90339dff1..cef3e445b91a8 100644 --- a/x-pack/plugins/cloud_security_posture/common/types/rules/v3.ts +++ b/x-pack/plugins/cloud_security_posture/common/types/rules/v3.ts @@ -129,3 +129,36 @@ export interface FindCspBenchmarkRuleResponse { page: number; perPage: number; } + +export const cspBenchmarkRules = schema.arrayOf( + schema.object({ + benchmark_id: schema.string(), + benchmark_version: schema.string(), + rule_number: schema.string(), + }) +); + +export const cspBenchmarkRulesBulkActionRequestSchema = schema.object({ + action: schema.oneOf([schema.literal('mute'), schema.literal('unmute')]), + rules: cspBenchmarkRules, +}); + +export type CspBenchmarkRules = TypeOf; + +export type CspBenchmarkRulesBulkActionRequestSchema = TypeOf< + typeof cspBenchmarkRulesBulkActionRequestSchema +>; + +const rulesStates = schema.recordOf( + schema.string(), + schema.object({ + muted: schema.boolean(), + }) +); + +export const cspSettingsSchema = schema.object({ + rules: rulesStates, +}); + +export type CspBenchmarkRulesStates = TypeOf; +export type CspSettings = TypeOf; diff --git a/x-pack/plugins/cloud_security_posture/server/plugin.ts b/x-pack/plugins/cloud_security_posture/server/plugin.ts index 8b77581efd39d..58a143b220857 100755 --- a/x-pack/plugins/cloud_security_posture/server/plugin.ts +++ b/x-pack/plugins/cloud_security_posture/server/plugin.ts @@ -35,7 +35,7 @@ import type { CspServerPluginStartServices, } from './types'; import { setupRoutes } from './routes/setup_routes'; -import { setupSavedObjects } from './saved_objects'; +import { cspBenchmarkRule, cspSettings } from './saved_objects'; import { initializeCspIndices } from './create_indices/create_indices'; import { initializeCspTransforms } from './create_transforms/create_transforms'; import { @@ -50,6 +50,7 @@ import { } from './tasks/findings_stats_task'; import { registerCspmUsageCollector } from './lib/telemetry/collectors/register'; import { CloudSecurityPostureConfig } from './config'; +import { CspBenchmarkRule, CspSettings } from '../common/types/latest'; export class CspPlugin implements @@ -80,7 +81,8 @@ export class CspPlugin core: CoreSetup, plugins: CspServerPluginSetupDeps ): CspServerPluginSetup { - setupSavedObjects(core.savedObjects); + core.savedObjects.registerType(cspBenchmarkRule); + core.savedObjects.registerType(cspSettings); setupRoutes({ core, diff --git a/x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/bulk_action/bulk_action.test.ts b/x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/bulk_action/bulk_action.test.ts new file mode 100644 index 0000000000000..1bb2232d2834d --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/bulk_action/bulk_action.test.ts @@ -0,0 +1,36 @@ +/* + * 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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import expect from 'expect'; +import { setRulesStates, buildRuleKey } from './utils'; + +describe('CSP Rule State Management', () => { + beforeEach(() => { + jest.clearAllMocks(); + }); + + it('should set rules states correctly', () => { + const ruleIds = ['rule1', 'rule3']; + const newState = true; + + const updatedRulesStates = setRulesStates(ruleIds, newState); + + expect(updatedRulesStates).toEqual({ + rule1: { muted: true }, + rule3: { muted: true }, + }); + }); + + it('should build a rule key with the provided benchmarkId, benchmarkVersion, and ruleNumber', () => { + const benchmarkId = 'randomId'; + const benchmarkVersion = 'v1'; + const ruleNumber = '001'; + + const result = buildRuleKey(benchmarkId, benchmarkVersion, ruleNumber); + + expect(result).toBe(`${benchmarkId};${benchmarkVersion};${ruleNumber}`); + }); +}); diff --git a/x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/bulk_action/bulk_action.ts b/x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/bulk_action/bulk_action.ts new file mode 100644 index 0000000000000..a87df39341741 --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/bulk_action/bulk_action.ts @@ -0,0 +1,68 @@ +/* + * 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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { transformError } from '@kbn/securitysolution-es-utils'; +import { + CspBenchmarkRulesBulkActionRequestSchema, + CspBenchmarkRulesStates, + cspBenchmarkRulesBulkActionRequestSchema, +} from '../../../../common/types/rules/v3'; +import { CspRouter } from '../../../types'; + +import { CSP_BENCHMARK_RULES_BULK_ACTION_ROUTE_PATH } from '../../../../common/constants'; +import { bulkActionBenchmarkRulesHandler } from './v1'; + +export const defineBulkActionCspBenchmarkRulesRoute = (router: CspRouter) => + router.versioned + .post({ + access: 'internal', + path: CSP_BENCHMARK_RULES_BULK_ACTION_ROUTE_PATH, + }) + .addVersion( + { + version: '1', + validate: { + request: { + body: cspBenchmarkRulesBulkActionRequestSchema, + }, + }, + }, + async (context, request, response) => { + if (!(await context.fleet).authz.fleet.all) { + return response.forbidden(); + } + const cspContext = await context.csp; + + try { + const requestBody: CspBenchmarkRulesBulkActionRequestSchema = request.body; + + const benchmarkRulesToUpdate = requestBody.rules; + + const handlerResponse = await bulkActionBenchmarkRulesHandler( + cspContext.encryptedSavedObjects, + benchmarkRulesToUpdate, + requestBody.action + ); + + const updatedBenchmarkRules: CspBenchmarkRulesStates = handlerResponse; + return response.ok({ + body: { + updated_benchmark_rules: updatedBenchmarkRules, + message: 'The bulk operation has been executed successfully.', + }, + }); + } catch (err) { + const error = transformError(err); + + cspContext.logger.error(`Bulk action failed: ${error.message}`); + return response.customError({ + body: { message: error.message }, + statusCode: error.statusCode || 500, // Default to 500 if no specific status code is provided + }); + } + } + ); diff --git a/x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/bulk_action/utils.ts b/x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/bulk_action/utils.ts new file mode 100644 index 0000000000000..3442b3f050b90 --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/bulk_action/utils.ts @@ -0,0 +1,42 @@ +/* + * 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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import type { + SavedObjectsClientContract, + SavedObjectsUpdateResponse, +} from '@kbn/core-saved-objects-api-server'; +import { CspBenchmarkRulesStates, CspSettings } from '../../../../common/types/rules/v3'; + +import { + INTERNAL_CSP_SETTINGS_SAVED_OBJECT_ID, + INTERNAL_CSP_SETTINGS_SAVED_OBJECT_TYPE, +} from '../../../../common/constants'; + +export const updateRulesStates = async ( + encryptedSoClient: SavedObjectsClientContract, + newRulesStates: CspBenchmarkRulesStates +): Promise> => { + return await encryptedSoClient.update( + INTERNAL_CSP_SETTINGS_SAVED_OBJECT_TYPE, + INTERNAL_CSP_SETTINGS_SAVED_OBJECT_ID, + { rules: newRulesStates }, + // if there is no saved object yet, insert a new SO + { upsert: { rules: newRulesStates } } + ); +}; + +export const setRulesStates = (ruleIds: string[], state: boolean): CspBenchmarkRulesStates => { + const rulesStates: CspBenchmarkRulesStates = {}; + ruleIds.forEach((ruleId) => { + rulesStates[ruleId] = { muted: state }; + }); + return rulesStates; +}; + +export const buildRuleKey = (benchmarkId: string, benchmarkVersion: string, ruleNumber: string) => { + return `${benchmarkId};${benchmarkVersion};${ruleNumber}`; +}; diff --git a/x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/bulk_action/v1.ts b/x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/bulk_action/v1.ts new file mode 100644 index 0000000000000..42895b5eb694d --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/bulk_action/v1.ts @@ -0,0 +1,30 @@ +/* + * 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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import { SavedObjectsClientContract } from '@kbn/core-saved-objects-api-server'; +import { CspBenchmarkRules, CspBenchmarkRulesStates } from '../../../../common/types/rules/v3'; +import { buildRuleKey, setRulesStates, updateRulesStates } from './utils'; + +const muteStatesMap = { + mute: true, + unmute: false, +}; + +export const bulkActionBenchmarkRulesHandler = async ( + encryptedSoClient: SavedObjectsClientContract, + rulesToUpdate: CspBenchmarkRules, + action: 'mute' | 'unmute' +): Promise => { + const ruleKeys = rulesToUpdate.map((rule) => + buildRuleKey(rule.benchmark_id, rule.benchmark_version, rule.rule_number) + ); + + const newRulesStates = setRulesStates(ruleKeys, muteStatesMap[action]); + + const newCspSettings = await updateRulesStates(encryptedSoClient, newRulesStates); + + return newCspSettings.attributes.rules!; +}; diff --git a/x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/find/find.test.ts b/x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/find/find.test.ts index ffec7d5b9b261..2a0130c0f0fd7 100644 --- a/x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/find/find.test.ts +++ b/x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/find/find.test.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { getSortedCspBenchmarkRulesTemplates } from './v1'; +import { getSortedCspBenchmarkRulesTemplates } from './utils'; import { CspBenchmarkRule } from '../../../../common/types/latest'; describe('getSortedCspBenchmarkRules', () => { diff --git a/x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/find/find.ts b/x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/find/find.ts index aa4856fd9bada..728fca1c0ae7c 100644 --- a/x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/find/find.ts +++ b/x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/find/find.ts @@ -9,11 +9,10 @@ import { FindCspBenchmarkRuleRequest, FindCspBenchmarkRuleResponse, findCspBenchmarkRuleRequestSchema, -} from '../../../../common/types/latest'; - +} from '../../../../common/types/rules/v3'; import { FIND_CSP_BENCHMARK_RULE_ROUTE_PATH } from '../../../../common/constants'; import { CspRouter } from '../../../types'; -import { findRuleHandler as findRuleHandlerV1 } from './v1'; +import { findBenchmarkRuleHandler as findRuleHandlerV1 } from './v1'; export const defineFindCspBenchmarkRuleRoute = (router: CspRouter) => router.versioned diff --git a/x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/find/utils.ts b/x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/find/utils.ts new file mode 100644 index 0000000000000..0601a4eb25577 --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/find/utils.ts @@ -0,0 +1,41 @@ +/* + * 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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import semverValid from 'semver/functions/valid'; +import semverCompare from 'semver/functions/compare'; +import { NewPackagePolicy } from '@kbn/fleet-plugin/common'; +import { SavedObjectsClientContract } from '@kbn/core-saved-objects-api-server'; +import { PACKAGE_POLICY_SAVED_OBJECT_TYPE } from '../../benchmarks/benchmarks'; +import { getBenchmarkFromPackagePolicy } from '../../../../common/utils/helpers'; + +import type { CspBenchmarkRule } from '../../../../common/types/latest'; + +export const getSortedCspBenchmarkRulesTemplates = (cspBenchmarkRules: CspBenchmarkRule[]) => { + return cspBenchmarkRules.slice().sort((a, b) => { + const ruleNumberA = a?.metadata?.benchmark?.rule_number; + const ruleNumberB = b?.metadata?.benchmark?.rule_number; + + const versionA = semverValid(ruleNumberA); + const versionB = semverValid(ruleNumberB); + + if (versionA !== null && versionB !== null) { + return semverCompare(versionA, versionB); + } else { + return String(ruleNumberA).localeCompare(String(ruleNumberB)); + } + }); +}; + +export const getBenchmarkIdFromPackagePolicyId = async ( + soClient: SavedObjectsClientContract, + packagePolicyId: string +): Promise => { + const res = await soClient.get( + PACKAGE_POLICY_SAVED_OBJECT_TYPE, + packagePolicyId + ); + return getBenchmarkFromPackagePolicy(res.attributes.inputs); +}; diff --git a/x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/find/v1.ts b/x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/find/v1.ts index 6bd0d14a2f540..4971098cb8067 100644 --- a/x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/find/v1.ts +++ b/x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/find/v1.ts @@ -4,49 +4,17 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import semverValid from 'semver/functions/valid'; -import semverCompare from 'semver/functions/compare'; -import { NewPackagePolicy } from '@kbn/fleet-plugin/common'; import { SavedObjectsClientContract } from '@kbn/core-saved-objects-api-server'; import { getBenchmarkFilter } from '../../../../common/utils/helpers'; import { CSP_BENCHMARK_RULE_SAVED_OBJECT_TYPE } from '../../../../common/constants'; -import { PACKAGE_POLICY_SAVED_OBJECT_TYPE } from '../../benchmarks/benchmarks'; -import { getBenchmarkFromPackagePolicy } from '../../../../common/utils/helpers'; - +import { getBenchmarkIdFromPackagePolicyId, getSortedCspBenchmarkRulesTemplates } from './utils'; +import type { CspBenchmarkRule } from '../../../../common/types/latest'; import type { - CspBenchmarkRule, FindCspBenchmarkRuleRequest, FindCspBenchmarkRuleResponse, -} from '../../../../common/types/latest'; - -export const getSortedCspBenchmarkRulesTemplates = (cspBenchmarkRules: CspBenchmarkRule[]) => { - return cspBenchmarkRules.slice().sort((a, b) => { - const ruleNumberA = a?.metadata?.benchmark?.rule_number; - const ruleNumberB = b?.metadata?.benchmark?.rule_number; - - const versionA = semverValid(ruleNumberA); - const versionB = semverValid(ruleNumberB); - - if (versionA !== null && versionB !== null) { - return semverCompare(versionA, versionB); - } else { - return String(ruleNumberA).localeCompare(String(ruleNumberB)); - } - }); -}; - -export const getBenchmarkIdFromPackagePolicyId = async ( - soClient: SavedObjectsClientContract, - packagePolicyId: string -): Promise => { - const res = await soClient.get( - PACKAGE_POLICY_SAVED_OBJECT_TYPE, - packagePolicyId - ); - return getBenchmarkFromPackagePolicy(res.attributes.inputs); -}; +} from '../../../../common/types/rules/v3'; -export const findRuleHandler = async ( +export const findBenchmarkRuleHandler = async ( soClient: SavedObjectsClientContract, options: FindCspBenchmarkRuleRequest ): Promise => { diff --git a/x-pack/plugins/cloud_security_posture/server/routes/setup_routes.ts b/x-pack/plugins/cloud_security_posture/server/routes/setup_routes.ts index 49022dd1f5fe6..88570781ed066 100644 --- a/x-pack/plugins/cloud_security_posture/server/routes/setup_routes.ts +++ b/x-pack/plugins/cloud_security_posture/server/routes/setup_routes.ts @@ -7,6 +7,7 @@ import type { CoreSetup, Logger } from '@kbn/core/server'; import type { AuthenticatedUser } from '@kbn/security-plugin/common'; +import { INTERNAL_CSP_SETTINGS_SAVED_OBJECT_TYPE } from '../../common/constants'; import type { CspRequestHandlerContext, CspServerPluginStart, @@ -19,6 +20,7 @@ import { defineGetBenchmarksRoute } from './benchmarks/benchmarks'; import { defineGetCspStatusRoute } from './status/status'; import { defineFindCspBenchmarkRuleRoute } from './benchmark_rules/find/find'; import { defineGetDetectionEngineAlertsStatus } from './detection_engine/get_detection_engine_alerts_count_by_rule_tags'; +import { defineBulkActionCspBenchmarkRulesRoute } from './benchmark_rules/bulk_action/bulk_action'; /** * 1. Registers routes @@ -40,6 +42,7 @@ export async function setupRoutes({ defineGetCspStatusRoute(router); defineFindCspBenchmarkRuleRoute(router); defineGetDetectionEngineAlertsStatus(router); + defineBulkActionCspBenchmarkRulesRoute(router); core.http.registerRouteHandlerContext( PLUGIN_ID, @@ -61,6 +64,9 @@ export async function setupRoutes({ logger, esClient: coreContext.elasticsearch.client, soClient: coreContext.savedObjects.client, + encryptedSavedObjects: coreContext.savedObjects.getClient({ + includedHiddenTypes: [INTERNAL_CSP_SETTINGS_SAVED_OBJECT_TYPE], + }), agentPolicyService: fleet.agentPolicyService, agentService: fleet.agentService, packagePolicyService: fleet.packagePolicyService, diff --git a/x-pack/plugins/cloud_security_posture/server/saved_objects/csp_settings.ts b/x-pack/plugins/cloud_security_posture/server/saved_objects/csp_settings.ts new file mode 100644 index 0000000000000..d163ca6e26f05 --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/server/saved_objects/csp_settings.ts @@ -0,0 +1,23 @@ +/* + * 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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { SavedObjectsType } from '@kbn/core/server'; +import { SECURITY_SOLUTION_SAVED_OBJECT_INDEX } from '@kbn/core-saved-objects-server'; +import { cspSettingsSchema } from '../../common/types/rules/v3'; +import { cspSettingsSavedObjectMapping } from './mappings'; +import { INTERNAL_CSP_SETTINGS_SAVED_OBJECT_TYPE } from '../../common/constants'; + +export const cspSettings: SavedObjectsType = { + name: INTERNAL_CSP_SETTINGS_SAVED_OBJECT_TYPE, + indexPattern: SECURITY_SOLUTION_SAVED_OBJECT_INDEX, + hidden: true, + namespaceType: 'agnostic', + schemas: { + '8.12.0': cspSettingsSchema, + }, + mappings: cspSettingsSavedObjectMapping, +}; diff --git a/x-pack/plugins/cloud_security_posture/server/saved_objects/index.ts b/x-pack/plugins/cloud_security_posture/server/saved_objects/index.ts index 7217fd8606ed9..98b08c2fad402 100644 --- a/x-pack/plugins/cloud_security_posture/server/saved_objects/index.ts +++ b/x-pack/plugins/cloud_security_posture/server/saved_objects/index.ts @@ -5,4 +5,5 @@ * 2.0. */ -export { setupSavedObjects } from './saved_objects'; +export { cspBenchmarkRule } from './csp_benchmark_rule'; +export { cspSettings } from './csp_settings'; diff --git a/x-pack/plugins/cloud_security_posture/server/saved_objects/mappings.ts b/x-pack/plugins/cloud_security_posture/server/saved_objects/mappings.ts index f672d271c8b5f..e2e880f72a7c9 100644 --- a/x-pack/plugins/cloud_security_posture/server/saved_objects/mappings.ts +++ b/x-pack/plugins/cloud_security_posture/server/saved_objects/mappings.ts @@ -60,3 +60,8 @@ export const cspBenchmarkRuleSavedObjectMapping: SavedObjectsTypeMappingDefiniti }, }, }; + +export const cspSettingsSavedObjectMapping: SavedObjectsTypeMappingDefinition = { + dynamic: false, + properties: {}, +}; diff --git a/x-pack/plugins/cloud_security_posture/server/saved_objects/saved_objects.ts b/x-pack/plugins/cloud_security_posture/server/saved_objects/saved_objects.ts deleted file mode 100644 index eed21b5b91916..0000000000000 --- a/x-pack/plugins/cloud_security_posture/server/saved_objects/saved_objects.ts +++ /dev/null @@ -1,36 +0,0 @@ -/* - * 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; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { SavedObjectsServiceSetup } from '@kbn/core/server'; -import { SECURITY_SOLUTION_SAVED_OBJECT_INDEX } from '@kbn/core-saved-objects-server'; -import { rulesV1, rulesV2, rulesV3 } from '../../common/types'; -import { cspBenchmarkRuleSavedObjectMapping } from './mappings'; -import { cspBenchmarkRuleMigrations } from './migrations'; - -import { CspBenchmarkRule } from '../../common/types/latest'; - -import { CSP_BENCHMARK_RULE_SAVED_OBJECT_TYPE } from '../../common/constants'; - -export function setupSavedObjects(savedObjects: SavedObjectsServiceSetup) { - savedObjects.registerType({ - name: CSP_BENCHMARK_RULE_SAVED_OBJECT_TYPE, - indexPattern: SECURITY_SOLUTION_SAVED_OBJECT_INDEX, - hidden: false, - namespaceType: 'agnostic', - management: { - importableAndExportable: true, - visibleInManagement: true, - }, - schemas: { - '8.3.0': rulesV1.cspBenchmarkRuleSchema, - '8.4.0': rulesV2.cspBenchmarkRuleSchema, - '8.7.0': rulesV3.cspBenchmarkRuleSchema, - }, - migrations: cspBenchmarkRuleMigrations, - mappings: cspBenchmarkRuleSavedObjectMapping, - }); -} diff --git a/x-pack/plugins/cloud_security_posture/server/types.ts b/x-pack/plugins/cloud_security_posture/server/types.ts index 3c84de12decf6..b6e83939b6ca7 100644 --- a/x-pack/plugins/cloud_security_posture/server/types.ts +++ b/x-pack/plugins/cloud_security_posture/server/types.ts @@ -69,6 +69,7 @@ export interface CspApiRequestHandlerContext { logger: Logger; esClient: IScopedClusterClient; soClient: SavedObjectsClientContract; + encryptedSavedObjects: SavedObjectsClientContract; agentPolicyService: AgentPolicyServiceInterface; agentService: AgentService; packagePolicyService: PackagePolicyClient; diff --git a/x-pack/plugins/custom_branding/public/plugin.ts b/x-pack/plugins/custom_branding/public/plugin.ts index fdf6c48d72275..64ba0213d2934 100644 --- a/x-pack/plugins/custom_branding/public/plugin.ts +++ b/x-pack/plugins/custom_branding/public/plugin.ts @@ -5,17 +5,28 @@ * 2.0. */ -import { CoreSetup, CoreStart, Plugin } from '@kbn/core/public'; -import { CustomBrandingPluginSetup, CustomBrandingPluginStart } from './types'; +import { Plugin } from '@kbn/core/public'; +import type { + CustomBrandingPublicSetup, + CustomBrandingPublicStart, + CustomBrandingPublicSetupDependencies, + CustomBrandingPublicStartDependencies, +} from './types'; export class CustomBrandingPlugin - implements Plugin + implements + Plugin< + CustomBrandingPublicSetup, + CustomBrandingPublicStart, + CustomBrandingPublicSetupDependencies, + CustomBrandingPublicStartDependencies + > { - public setup(core: CoreSetup): CustomBrandingPluginSetup { + public setup(): CustomBrandingPublicSetup { return {}; } - public start(core: CoreStart): CustomBrandingPluginStart { + public start(): CustomBrandingPublicStart { return {}; } diff --git a/x-pack/plugins/custom_branding/public/types.ts b/x-pack/plugins/custom_branding/public/types.ts index 398b585a9b99b..bb4ff4c85f854 100644 --- a/x-pack/plugins/custom_branding/public/types.ts +++ b/x-pack/plugins/custom_branding/public/types.ts @@ -5,6 +5,13 @@ * 2.0. */ // eslint-disable-next-line @typescript-eslint/no-empty-interface -export interface CustomBrandingPluginSetup {} +export interface CustomBrandingPublicSetup {} + // eslint-disable-next-line @typescript-eslint/no-empty-interface -export interface CustomBrandingPluginStart {} +export interface CustomBrandingPublicStart {} + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface CustomBrandingPublicSetupDependencies {} + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface CustomBrandingPublicStartDependencies {} diff --git a/x-pack/plugins/custom_branding/server/plugin.ts b/x-pack/plugins/custom_branding/server/plugin.ts index c4f88dff41c64..81bab17d432f5 100755 --- a/x-pack/plugins/custom_branding/server/plugin.ts +++ b/x-pack/plugins/custom_branding/server/plugin.ts @@ -20,7 +20,12 @@ import { License } from '@kbn/license-api-guard-plugin/server'; import { CustomBranding } from '@kbn/core-custom-branding-common'; import { Subscription } from 'rxjs'; import { PLUGIN } from '../common/constants'; -import { Dependencies } from './types'; +import type { + CustomBrandingServerSetup, + CustomBrandingServerStart, + CustomBrandingServerStartDependencies, + CustomBrandingServerSetupDependencies, +} from './types'; import { registerUiSettings } from './ui_settings'; const settingsKeys: Array = [ @@ -31,7 +36,15 @@ const settingsKeys: Array = [ 'pageTitle', ]; -export class CustomBrandingPlugin implements Plugin { +export class CustomBrandingPlugin + implements + Plugin< + CustomBrandingServerSetup, + CustomBrandingServerStart, + CustomBrandingServerSetupDependencies, + CustomBrandingServerStartDependencies + > +{ private readonly license: License; private readonly logger: Logger; private licensingSubscription?: Subscription; @@ -73,7 +86,7 @@ export class CustomBrandingPlugin implements Plugin { return {}; } - public start(core: CoreStart, { licensing }: Dependencies) { + public start(_core: CoreStart, { licensing }: CustomBrandingServerStartDependencies) { this.logger.debug('customBranding: Started'); this.license.start({ pluginId: PLUGIN.ID, diff --git a/x-pack/plugins/custom_branding/server/types.ts b/x-pack/plugins/custom_branding/server/types.ts index c40f49ef1acba..ca9edfc13b23a 100755 --- a/x-pack/plugins/custom_branding/server/types.ts +++ b/x-pack/plugins/custom_branding/server/types.ts @@ -12,7 +12,16 @@ import { import { CustomRequestHandlerContext } from '@kbn/core-http-request-handler-context-server'; import { IRouter } from '@kbn/core/server'; -export interface Dependencies { +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface CustomBrandingServerSetup {} + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface CustomBrandingServerStart {} + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface CustomBrandingServerSetupDependencies {} + +export interface CustomBrandingServerStartDependencies { licensing: LicensingPluginStart; } diff --git a/x-pack/plugins/dataset_quality/common/api_types.ts b/x-pack/plugins/dataset_quality/common/api_types.ts index 4f9936d65e014..70a5c3e597148 100644 --- a/x-pack/plugins/dataset_quality/common/api_types.ts +++ b/x-pack/plugins/dataset_quality/common/api_types.ts @@ -7,7 +7,7 @@ import * as rt from 'io-ts'; -export const datasetStatRt = rt.intersection([ +export const dataStreamStatRt = rt.intersection([ rt.type({ name: rt.string, }), @@ -19,6 +19,8 @@ export const datasetStatRt = rt.intersection([ }), ]); +export type DataStreamStat = rt.TypeOf; + export const integrationIconRt = rt.intersection([ rt.type({ path: rt.string, @@ -39,9 +41,12 @@ export const integrationRt = rt.intersection([ title: rt.string, version: rt.string, icons: rt.array(integrationIconRt), + datasets: rt.record(rt.string, rt.string), }), ]); +export type Integration = rt.TypeOf; + export const degradedDocsRt = rt.type({ dataset: rt.string, percentage: rt.number, @@ -52,7 +57,7 @@ export type DegradedDocs = rt.TypeOf; export const getDataStreamsStatsResponseRt = rt.exact( rt.intersection([ rt.type({ - dataStreamsStats: rt.array(datasetStatRt), + dataStreamsStats: rt.array(dataStreamStatRt), }), rt.type({ integrations: rt.array(integrationRt), diff --git a/x-pack/plugins/dataset_quality/common/data_streams_stats/data_stream_stat.ts b/x-pack/plugins/dataset_quality/common/data_streams_stats/data_stream_stat.ts index 2456284eb3cdc..0f48ae45aac7e 100644 --- a/x-pack/plugins/dataset_quality/common/data_streams_stats/data_stream_stat.ts +++ b/x-pack/plugins/dataset_quality/common/data_streams_stats/data_stream_stat.ts @@ -9,17 +9,21 @@ import { Integration } from './integration'; import { DataStreamStatType, IntegrationType } from './types'; export class DataStreamStat { + rawName: string; name: DataStreamStatType['name']; + namespace: string; title: string; size?: DataStreamStatType['size']; - sizeBytes?: DataStreamStatType['size_bytes']; - lastActivity?: DataStreamStatType['last_activity']; + sizeBytes?: DataStreamStatType['sizeBytes']; + lastActivity?: DataStreamStatType['lastActivity']; integration?: IntegrationType; degradedDocs?: number; private constructor(dataStreamStat: DataStreamStat) { + this.rawName = dataStreamStat.name; this.name = dataStreamStat.name; this.title = dataStreamStat.title ?? dataStreamStat.name; + this.namespace = dataStreamStat.namespace; this.size = dataStreamStat.size; this.sizeBytes = dataStreamStat.sizeBytes; this.lastActivity = dataStreamStat.lastActivity; @@ -31,11 +35,13 @@ export class DataStreamStat { const [_type, dataset, namespace] = dataStreamStat.name.split('-'); const dataStreamStatProps = { - name: dataStreamStat.name, - title: `${dataset}-${namespace}`, + rawName: dataStreamStat.name, + name: dataset, + title: dataStreamStat.integration?.datasets?.[dataset] ?? dataset, + namespace, size: dataStreamStat.size, - sizeBytes: dataStreamStat.size_bytes, - lastActivity: dataStreamStat.last_activity, + sizeBytes: dataStreamStat.sizeBytes, + lastActivity: dataStreamStat.lastActivity, integration: dataStreamStat.integration ? Integration.create(dataStreamStat.integration) : undefined, diff --git a/x-pack/plugins/dataset_quality/public/components/dataset_quality/columns.tsx b/x-pack/plugins/dataset_quality/public/components/dataset_quality/columns.tsx index 94223e10f316f..cdda4dfa004b1 100644 --- a/x-pack/plugins/dataset_quality/public/components/dataset_quality/columns.tsx +++ b/x-pack/plugins/dataset_quality/public/components/dataset_quality/columns.tsx @@ -5,34 +5,39 @@ * 2.0. */ -import React from 'react'; import { + EuiBadge, EuiBasicTableColumn, EuiCode, EuiFlexGroup, EuiFlexItem, EuiIcon, EuiSkeletonRectangle, - EuiText, EuiToolTip, } from '@elastic/eui'; -import { i18n } from '@kbn/i18n'; -import { PackageIcon } from '@kbn/fleet-plugin/public'; -import { ES_FIELD_TYPES, KBN_FIELD_TYPES } from '@kbn/field-types'; import { FieldFormatsStart } from '@kbn/field-formats-plugin/public'; +import { ES_FIELD_TYPES, KBN_FIELD_TYPES } from '@kbn/field-types'; +import { PackageIcon } from '@kbn/fleet-plugin/public'; +import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n-react'; +import React from 'react'; import { DEGRADED_QUALITY_MINIMUM_PERCENTAGE, POOR_QUALITY_MINIMUM_PERCENTAGE, } from '../../../common/constants'; import { DataStreamStat } from '../../../common/data_streams_stats/data_stream_stat'; import loggingIcon from '../../icons/logging.svg'; +import { LogExplorerLink } from '../log_explorer_link'; import { QualityIndicator, QualityPercentageIndicator } from '../quality_indicator'; const nameColumnName = i18n.translate('xpack.datasetQuality.nameColumnName', { defaultMessage: 'Dataset Name', }); +const namespaceColumnName = i18n.translate('xpack.datasetQuality.namespaceColumnName', { + defaultMessage: 'Namespace', +}); + const sizeColumnName = i18n.translate('xpack.datasetQuality.sizeColumnName', { defaultMessage: 'Size', }); @@ -41,6 +46,17 @@ const degradedDocsColumnName = i18n.translate('xpack.datasetQuality.degradedDocs defaultMessage: 'Degraded Docs', }); +const lastActivityColumnName = i18n.translate('xpack.datasetQuality.lastActivityColumnName', { + defaultMessage: 'Last Activity', +}); + +const actionsColumnName = i18n.translate('xpack.datasetQuality.actionsColumnName', { + defaultMessage: 'Actions', +}); +const openActionName = i18n.translate('xpack.datasetQuality.openActionName', { + defaultMessage: 'Open', +}); + const degradedDocsDescription = (minimimPercentage: number) => i18n.translate('xpack.datasetQuality.degradedDocsQualityDescription', { defaultMessage: 'greater than {minimimPercentage}%', @@ -60,22 +76,19 @@ const degradedDocsColumnTooltip = ( visualQueue: ( - - - {` ${degradedDocsDescription(POOR_QUALITY_MINIMUM_PERCENTAGE)}`} - + - - - {` ${degradedDocsDescription(DEGRADED_QUALITY_MINIMUM_PERCENTAGE)}`} - + - - - {' 0%'} - + ), @@ -83,10 +96,6 @@ const degradedDocsColumnTooltip = ( /> ); -const lastActivityColumnName = i18n.translate('xpack.datasetQuality.lastActivityColumnName', { - defaultMessage: 'Last Activity', -}); - export const getDatasetQualitTableColumns = ({ fieldFormats, loadingDegradedStats, @@ -122,6 +131,14 @@ export const getDatasetQualitTableColumns = ({ ); }, }, + { + name: namespaceColumnName, + field: 'namespace', + sortable: true, + render: (_, dataStreamStat: DataStreamStat) => ( + {dataStreamStat.namespace} + ), + }, { name: sizeColumnName, field: 'size', @@ -147,10 +164,7 @@ export const getDatasetQualitTableColumns = ({ contentAriaLabel="Example description" > - - - - {`${dataStreamStat.degradedDocs ?? 0}%`} + ), @@ -164,5 +178,12 @@ export const getDatasetQualitTableColumns = ({ .convert(timestamp), sortable: true, }, + { + name: actionsColumnName, + render: (dataStreamStat: DataStreamStat) => ( + + ), + width: '100px', + }, ]; }; diff --git a/x-pack/plugins/dataset_quality/public/components/log_explorer_link.tsx b/x-pack/plugins/dataset_quality/public/components/log_explorer_link.tsx new file mode 100644 index 0000000000000..11227d0a6bd3a --- /dev/null +++ b/x-pack/plugins/dataset_quality/public/components/log_explorer_link.tsx @@ -0,0 +1,54 @@ +/* + * 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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { EuiLink } from '@elastic/eui'; +import React from 'react'; +import { getRouterLinkProps } from '@kbn/router-utils'; +import { + SingleDatasetLocatorParams, + SINGLE_DATASET_LOCATOR_ID, +} from '@kbn/deeplinks-observability'; +import { DataStreamStat } from '../../common/data_streams_stats/data_stream_stat'; +import { useKibanaContextForPlugin } from '../utils'; + +export const LogExplorerLink = React.memo( + ({ dataStreamStat, title }: { dataStreamStat: DataStreamStat; title: string }) => { + const { + services: { share }, + } = useKibanaContextForPlugin(); + const params: SingleDatasetLocatorParams = { + dataset: dataStreamStat.name, + timeRange: { + from: 'now-1d', + to: 'now', + }, + integration: dataStreamStat.integration?.name, + filterControls: { + namespace: { + mode: 'include', + values: [dataStreamStat.namespace], + }, + }, + }; + + const singleDatasetLocator = + share.url.locators.get(SINGLE_DATASET_LOCATOR_ID); + + const urlToLogExplorer = singleDatasetLocator?.getRedirectUrl(params); + + const navigateToLogExplorer = () => { + singleDatasetLocator?.navigate(params) as Promise; + }; + + const logExplorerLinkProps = getRouterLinkProps({ + href: urlToLogExplorer, + onClick: navigateToLogExplorer, + }); + + return {title}; + } +); diff --git a/x-pack/plugins/dataset_quality/public/components/quality_indicator/indicator.tsx b/x-pack/plugins/dataset_quality/public/components/quality_indicator/indicator.tsx index a356ff204425f..8344f046e0210 100644 --- a/x-pack/plugins/dataset_quality/public/components/quality_indicator/indicator.tsx +++ b/x-pack/plugins/dataset_quality/public/components/quality_indicator/indicator.tsx @@ -5,17 +5,21 @@ * 2.0. */ -import { EuiIcon, useEuiTheme } from '@elastic/eui'; -import React from 'react'; - -export function QualityIndicator({ quality }: { quality: 'good' | 'degraded' | 'poor' }) { - const { euiTheme } = useEuiTheme(); +import { EuiHealth } from '@elastic/eui'; +import React, { ReactNode } from 'react'; +export function QualityIndicator({ + quality, + description, +}: { + quality: 'good' | 'degraded' | 'poor'; + description: string | ReactNode; +}) { const qualityColors = { - poor: euiTheme.colors.dangerText, - degraded: euiTheme.colors.warningText, - good: euiTheme.colors.successText, + poor: 'danger', + degraded: 'warning', + good: 'success', }; - return ; + return {description}; } diff --git a/x-pack/plugins/dataset_quality/public/components/quality_indicator/percentage_indicator.tsx b/x-pack/plugins/dataset_quality/public/components/quality_indicator/percentage_indicator.tsx index b3f9d8e3b852c..f5034bddab8c2 100644 --- a/x-pack/plugins/dataset_quality/public/components/quality_indicator/percentage_indicator.tsx +++ b/x-pack/plugins/dataset_quality/public/components/quality_indicator/percentage_indicator.tsx @@ -5,6 +5,8 @@ * 2.0. */ +import { EuiText } from '@elastic/eui'; +import { FormattedNumber } from '@kbn/i18n-react'; import React from 'react'; import { DEGRADED_QUALITY_MINIMUM_PERCENTAGE, @@ -20,5 +22,11 @@ export function QualityPercentageIndicator({ percentage = 0 }: { percentage?: nu ? 'degraded' : 'good'; - return ; + const description = ( + + % + + ); + + return ; } diff --git a/x-pack/plugins/dataset_quality/server/routes/data_streams/get_data_streams/index.ts b/x-pack/plugins/dataset_quality/server/routes/data_streams/get_data_streams/index.ts index 6154e3bc11a24..b79b4eeec0116 100644 --- a/x-pack/plugins/dataset_quality/server/routes/data_streams/get_data_streams/index.ts +++ b/x-pack/plugins/dataset_quality/server/routes/data_streams/get_data_streams/index.ts @@ -6,8 +6,8 @@ */ import type { ElasticsearchClient } from '@kbn/core/server'; +import { DataStreamTypes } from '../../../types/default_api_types'; import { dataStreamService } from '../../../services'; -import { DataStreamTypes } from '../../../types/data_stream'; export async function getDataStreams(options: { esClient: ElasticsearchClient; diff --git a/x-pack/plugins/dataset_quality/server/routes/data_streams/get_data_streams_stats/get_data_streams_stats.test.ts b/x-pack/plugins/dataset_quality/server/routes/data_streams/get_data_streams_stats/get_data_streams_stats.test.ts index 830c3b162573f..a0104afc1d5fe 100644 --- a/x-pack/plugins/dataset_quality/server/routes/data_streams/get_data_streams_stats/get_data_streams_stats.test.ts +++ b/x-pack/plugins/dataset_quality/server/routes/data_streams/get_data_streams_stats/get_data_streams_stats.test.ts @@ -79,32 +79,32 @@ describe('getDataStreams', () => { { name: 'logs-elastic_agent-default', size: '1gb', - size_bytes: 1170805528, - last_activity: 1698916071000, + sizeBytes: 1170805528, + lastActivity: 1698916071000, }, { name: 'logs-elastic_agent.filebeat-default', size: '1.3mb', - size_bytes: 1459100, - last_activity: 1698902209996, + sizeBytes: 1459100, + lastActivity: 1698902209996, }, { name: 'logs-elastic_agent.fleet_server-default', size: '2.9mb', - size_bytes: 3052148, - last_activity: 1698914110010, + sizeBytes: 3052148, + lastActivity: 1698914110010, }, { name: 'logs-elastic_agent.metricbeat-default', size: '1.6mb', - size_bytes: 1704807, - last_activity: 1698672046707, + sizeBytes: 1704807, + lastActivity: 1698672046707, }, { name: 'logs-test.test-default', size: '6.2mb', - size_bytes: 6570447, - last_activity: 1698913802000, + sizeBytes: 6570447, + lastActivity: 1698913802000, }, ]); }); diff --git a/x-pack/plugins/dataset_quality/server/routes/data_streams/get_data_streams_stats/index.ts b/x-pack/plugins/dataset_quality/server/routes/data_streams/get_data_streams_stats/index.ts index 9ec252d096357..a78f2fec53e29 100644 --- a/x-pack/plugins/dataset_quality/server/routes/data_streams/get_data_streams_stats/index.ts +++ b/x-pack/plugins/dataset_quality/server/routes/data_streams/get_data_streams_stats/index.ts @@ -6,8 +6,8 @@ */ import type { ElasticsearchClient } from '@kbn/core/server'; +import { DataStreamTypes } from '../../../types/default_api_types'; import { dataStreamService } from '../../../services'; -import { DataStreamTypes } from '../../../types/data_stream'; export async function getDataStreamsStats(options: { esClient: ElasticsearchClient; @@ -24,9 +24,9 @@ export async function getDataStreamsStats(options: { const mappedDataStreams = matchingDataStreamsStats.map((dataStream) => { return { name: dataStream.data_stream, - size: dataStream.store_size, - size_bytes: dataStream.store_size_bytes, - last_activity: dataStream.maximum_timestamp, + size: dataStream.store_size?.toString(), + sizeBytes: dataStream.store_size_bytes, + lastActivity: dataStream.maximum_timestamp, }; }); diff --git a/x-pack/plugins/dataset_quality/server/routes/data_streams/get_degraded_docs.ts b/x-pack/plugins/dataset_quality/server/routes/data_streams/get_degraded_docs.ts index 4bbe01d219322..1af5a603f3638 100644 --- a/x-pack/plugins/dataset_quality/server/routes/data_streams/get_degraded_docs.ts +++ b/x-pack/plugins/dataset_quality/server/routes/data_streams/get_degraded_docs.ts @@ -14,7 +14,7 @@ import { DATA_STREAM_TYPE, _IGNORED, } from '../../../common/es_fields'; -import { DataStreamTypes } from '../../types/data_stream'; +import { DataStreamTypes } from '../../types/default_api_types'; import { createDatasetQualityESClient, wildcardQuery } from '../../utils'; export async function getDegradedDocsPaginated(options: { diff --git a/x-pack/plugins/dataset_quality/server/routes/data_streams/get_integrations.ts b/x-pack/plugins/dataset_quality/server/routes/data_streams/get_integrations.ts new file mode 100644 index 0000000000000..7871571b607b6 --- /dev/null +++ b/x-pack/plugins/dataset_quality/server/routes/data_streams/get_integrations.ts @@ -0,0 +1,53 @@ +/* + * 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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { PackageClient } from '@kbn/fleet-plugin/server'; +import { DataStreamStat, Integration } from '../../../common/api_types'; + +export async function getIntegrations(options: { + packageClient: PackageClient; + dataStreams: DataStreamStat[]; +}): Promise { + const { packageClient, dataStreams } = options; + + const packages = await packageClient.getPackages(); + const installedPackages = dataStreams.map((item) => item.integration); + + return Promise.all( + packages + .filter((pkg) => installedPackages.includes(pkg.name)) + .map(async (p) => ({ + name: p.name, + title: p.title, + version: p.version, + icons: p.icons, + datasets: await getDatasets({ + packageClient, + name: p.name, + version: p.version, + }), + })) + ); +} + +const getDatasets = async (options: { + packageClient: PackageClient; + name: string; + version: string; +}) => { + const { packageClient, name, version } = options; + + const pkg = await packageClient.getPackage(name, version); + + return pkg.packageInfo.data_streams?.reduce( + (acc, curr) => ({ + ...acc, + [curr.dataset]: curr.title, + }), + {} + ); +}; diff --git a/x-pack/plugins/dataset_quality/server/routes/data_streams/routes.ts b/x-pack/plugins/dataset_quality/server/routes/data_streams/routes.ts index 7be8c102060d6..4f95331d97651 100644 --- a/x-pack/plugins/dataset_quality/server/routes/data_streams/routes.ts +++ b/x-pack/plugins/dataset_quality/server/routes/data_streams/routes.ts @@ -7,20 +7,19 @@ import * as t from 'io-ts'; import { keyBy, merge, values } from 'lodash'; -import { DataStreamStat } from '../../types/data_stream'; -import { dataStreamTypesRt, rangeRt } from '../../types/default_api_types'; -import { Integration } from '../../types/integration'; +import { typeRt, rangeRt } from '../../types/default_api_types'; import { createDatasetQualityServerRoute } from '../create_datasets_quality_server_route'; import { getDataStreams } from './get_data_streams'; import { getDataStreamsStats } from './get_data_streams_stats'; import { getDegradedDocsPaginated } from './get_degraded_docs'; -import { DegradedDocs } from '../../../common/api_types'; +import { DegradedDocs, DataStreamStat, Integration } from '../../../common/api_types'; +import { getIntegrations } from './get_integrations'; const statsRoute = createDatasetQualityServerRoute({ endpoint: 'GET /internal/dataset_quality/data_streams/stats', params: t.type({ query: t.intersection([ - dataStreamTypesRt, + typeRt, t.partial({ datasetQuery: t.string, }), @@ -41,7 +40,6 @@ const statsRoute = createDatasetQualityServerRoute({ const fleetPluginStart = await plugins.fleet.start(); const packageClient = fleetPluginStart.packageService.asInternalUser; - const packages = await packageClient.getPackages(); const [dataStreams, dataStreamsStats] = await Promise.all([ getDataStreams({ @@ -52,22 +50,11 @@ const statsRoute = createDatasetQualityServerRoute({ getDataStreamsStats({ esClient, ...params.query }), ]); - const installedPackages = dataStreams.items.map((item) => item.integration); - - const integrations = packages - .filter((pkg) => installedPackages.includes(pkg.name)) - .map((p) => ({ - name: p.name, - title: p.title, - version: p.version, - icons: p.icons, - })); - return { dataStreamsStats: values( merge(keyBy(dataStreams.items, 'name'), keyBy(dataStreamsStats.items, 'name')) ), - integrations, + integrations: await getIntegrations({ packageClient, dataStreams: dataStreams.items }), }; }, }); @@ -77,7 +64,7 @@ const degradedDocsRoute = createDatasetQualityServerRoute({ params: t.type({ query: t.intersection([ rangeRt, - dataStreamTypesRt, + typeRt, t.partial({ datasetQuery: t.string, }), diff --git a/x-pack/plugins/dataset_quality/server/types/data_stream.ts b/x-pack/plugins/dataset_quality/server/types/data_stream.ts deleted file mode 100644 index 1ccac8199a8b6..0000000000000 --- a/x-pack/plugins/dataset_quality/server/types/data_stream.ts +++ /dev/null @@ -1,18 +0,0 @@ -/* - * 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; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { ByteSize } from '@elastic/elasticsearch/lib/api/types'; -import { Integration } from './integration'; -export interface DataStreamStat { - name: string; - size?: ByteSize; - size_bytes?: number; - last_activity?: number; - integration?: Integration; -} - -export type DataStreamTypes = 'logs' | 'metrics' | 'traces' | 'synthetics' | 'profiling'; diff --git a/x-pack/plugins/dataset_quality/server/types/default_api_types.ts b/x-pack/plugins/dataset_quality/server/types/default_api_types.ts index e36bb1e58f65a..6148832dad140 100644 --- a/x-pack/plugins/dataset_quality/server/types/default_api_types.ts +++ b/x-pack/plugins/dataset_quality/server/types/default_api_types.ts @@ -8,16 +8,21 @@ import * as t from 'io-ts'; import { isoToEpochRt } from '@kbn/io-ts-utils'; -export const dataStreamTypesRt = t.partial({ - type: t.union([ - t.literal('logs'), - t.literal('metrics'), - t.literal('traces'), - t.literal('synthetics'), - t.literal('profiling'), - ]), +// https://github.com/gcanti/io-ts/blob/master/index.md#union-of-string-literals +export const dataStreamTypesRt = t.keyof({ + logs: null, + metrics: null, + traces: null, + synthetics: null, + profiling: null, }); +export const typeRt = t.partial({ + type: dataStreamTypesRt, +}); + +export type DataStreamTypes = t.TypeOf; + export const rangeRt = t.type({ start: isoToEpochRt, end: isoToEpochRt, diff --git a/x-pack/plugins/dataset_quality/tsconfig.json b/x-pack/plugins/dataset_quality/tsconfig.json index 5d1bf785b81ad..65f77bac100aa 100644 --- a/x-pack/plugins/dataset_quality/tsconfig.json +++ b/x-pack/plugins/dataset_quality/tsconfig.json @@ -25,7 +25,9 @@ "@kbn/field-types", "@kbn/io-ts-utils", "@kbn/observability-plugin", - "@kbn/es-types" + "@kbn/es-types", + "@kbn/deeplinks-observability", + "@kbn/router-utils", ], "exclude": [ "target/**/*", diff --git a/x-pack/plugins/drilldowns/url_drilldown/kibana.jsonc b/x-pack/plugins/drilldowns/url_drilldown/kibana.jsonc index f201cea6502e9..a7d0217c4e2ee 100644 --- a/x-pack/plugins/drilldowns/url_drilldown/kibana.jsonc +++ b/x-pack/plugins/drilldowns/url_drilldown/kibana.jsonc @@ -9,13 +9,13 @@ "browser": true, "requiredPlugins": [ "embeddable", - "uiActions", "uiActionsEnhanced" ], "requiredBundles": [ "kibanaUtils", "kibanaReact", - "imageEmbeddable" + "imageEmbeddable", + "uiActions" ] } } diff --git a/x-pack/plugins/enterprise_search/public/applications/elasticsearch/components/elasticsearch_guide/elasticsearch_guide.tsx b/x-pack/plugins/enterprise_search/public/applications/elasticsearch/components/elasticsearch_guide/elasticsearch_guide.tsx index e4a08654199de..dd82686a31405 100644 --- a/x-pack/plugins/enterprise_search/public/applications/elasticsearch/components/elasticsearch_guide/elasticsearch_guide.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/elasticsearch/components/elasticsearch_guide/elasticsearch_guide.tsx @@ -15,18 +15,13 @@ import { i18n } from '@kbn/i18n'; import { LanguageDefinitionSnippetArguments } from '@kbn/search-api-panels'; import { ELASTICSEARCH_URL_PLACEHOLDER } from '@kbn/search-api-panels/constants'; -import { Status } from '../../../../../common/types/api'; - -import { CreateApiKeyAPILogic } from '../../../enterprise_search_overview/api/create_elasticsearch_api_key_logic'; import { FetchApiKeysAPILogic } from '../../../enterprise_search_overview/api/fetch_api_keys_logic'; import { CreateApiKeyFlyout } from '../../../shared/api_key/create_api_key_flyout'; import { useCloudDetails } from '../../../shared/cloud_details/cloud_details'; import { GettingStarted } from '../../../shared/getting_started/getting_started'; -import { KibanaLogic } from '../../../shared/kibana/kibana_logic'; import { EnterpriseSearchElasticsearchPageTemplate } from '../layout'; export const ElasticsearchGuide = () => { - const { user } = useValues(KibanaLogic); const cloudContext = useCloudDetails(); const [isFlyoutOpen, setIsFlyoutOpen] = useState(false); @@ -36,8 +31,6 @@ export const ElasticsearchGuide = () => { url: cloudContext.elasticsearchUrl || ELASTICSEARCH_URL_PLACEHOLDER, }; const { makeRequest } = useActions(FetchApiKeysAPILogic); - const { makeRequest: saveApiKey } = useActions(CreateApiKeyAPILogic); - const { error, status } = useValues(CreateApiKeyAPILogic); const { data } = useValues(FetchApiKeysAPILogic); const apiKeys = data?.api_keys || []; @@ -45,15 +38,7 @@ export const ElasticsearchGuide = () => { return ( - {isFlyoutOpen && ( - setIsFlyoutOpen(false)} - setApiKey={saveApiKey} - username={user?.full_name || user?.username || ''} - /> - )} + {isFlyoutOpen && setIsFlyoutOpen(false)} />}

{i18n.translate('xpack.enterpriseSearch.content.overview.gettingStarted.pageTitle', { diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/connectors/connectors.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/connectors/connectors.tsx index 6fb1e2b873eb9..b5b87aa7e2bc3 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/connectors/connectors.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/connectors/connectors.tsx @@ -116,7 +116,7 @@ export const Connectors: React.FC = ({ isCrawler }) => { > {i18n.translate( 'xpack.enterpriseSearch.connectors.newConnectorsClientButtonLabel', - { defaultMessage: 'New Connectors Client' } + { defaultMessage: 'New Connector Client' } )} , ] diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/new_index/select_connector/connector_checkable.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/new_index/select_connector/connector_checkable.tsx index d2f5fd7e13fb3..d225f8175721c 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/new_index/select_connector/connector_checkable.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/new_index/select_connector/connector_checkable.tsx @@ -12,16 +12,16 @@ import { css } from '@emotion/react'; import { EuiBadge, EuiButtonIcon, - EuiCard, EuiContextMenuItem, EuiContextMenuPanel, EuiFlexGroup, EuiFlexItem, EuiIcon, EuiLink, + EuiPanel, EuiPopover, - EuiSpacer, EuiText, + EuiThemeComputed, EuiTitle, useEuiTheme, } from '@elastic/eui'; @@ -30,7 +30,6 @@ import { i18n } from '@kbn/i18n'; import { BETA_LABEL, NATIVE_LABEL, CONNECTOR_CLIENT_LABEL } from '../../../../shared/constants'; -import './connector_checkable.scss'; import { PlatinumLicensePopover } from '../../shared/platinum_license_popover/platinum_license_popover'; export interface ConnectorCheckableProps { @@ -45,6 +44,22 @@ export interface ConnectorCheckableProps { showNativeBadge: boolean; } +const getCss = ( + euiTheme: EuiThemeComputed, + isDisabled: ConnectorCheckableProps['isDisabled'], + showNativeBadge: ConnectorCheckableProps['showNativeBadge'] +) => { + return css` + ${showNativeBadge && + `box-shadow: 8px 9px 0px -1px ${euiTheme.colors.lightestShade}, + 8px 9px 0px 0px ${euiTheme.colors.lightShade};`} + ${isDisabled && + `background-color: ${euiTheme.colors.lightestShade}; + color: ${euiTheme.colors.disabledText}; + `} + `; +}; + export const ConnectorCheckable: React.FC = ({ isDisabled, documentationUrl, @@ -60,175 +75,176 @@ export const ConnectorCheckable: React.FC = ({ const [isLicensePopoverOpen, setIsLicensePopoverOpen] = useState(false); const [isNativePopoverOpen, setIsNativePopoverOpen] = useState(false); return ( - { - if (isDisabled) return; - onConnectorSelect(showNativeBadge); - }, - } - : {})} - hasBorder + { + if (isDisabled && showNativeBadge) return; + onConnectorSelect(showNativeBadge); + }} id={`checkableCard-${serviceType}`} - css={ - showNativeBadge - ? css` - box-shadow: 8px 9px 0px -1px ${euiTheme.colors.lightestShade}, - 8px 9px 0px 0px ${euiTheme.colors.lightShade}; - ` - : undefined - } - layout="horizontal" + css={getCss(euiTheme, isDisabled, showNativeBadge)} + hasBorder data-telemetry-id={`entSearchContent-connector-selectConnector-${serviceType}-select`} - icon={iconType ? : undefined} - title={ - - - - - {isDisabled ? ( - -

{name}

-
- ) : ( - -

{name}

-
- )} -
- {isDisabled && ( - - + + + {iconType ? : null} + + + + + + + + + {isDisabled ? ( + +

{name}

+
+ ) : ( + +

{name}

+
+ )} +
+ {isDisabled && ( + + { + event.preventDefault(); + event.stopPropagation(); + setIsLicensePopoverOpen(!isLicensePopoverOpen); + }} + /> } - )} - iconType="questionInCircle" - onClick={() => setIsLicensePopoverOpen(!isLicensePopoverOpen)} - /> - } - closePopover={() => setIsLicensePopoverOpen(false)} - isPopoverOpen={isLicensePopoverOpen} - /> + closePopover={() => setIsLicensePopoverOpen(false)} + isPopoverOpen={isLicensePopoverOpen} + /> + + )} +
- )} -
-
- {showNativeBadge && ( - - { - e.stopPropagation(); - e.preventDefault(); - setIsNativePopoverOpen(true); - }} - /> - } - isOpen={isNativePopoverOpen} - closePopover={() => { - setIsNativePopoverOpen(false); - }} - > - { - e.stopPropagation(); - onConnectorSelect(true); - }} - > - {i18n.translate( - 'xpack.enterpriseSearch.connectorCheckable.setupANativeConnectorContextMenuItemLabel', - { defaultMessage: 'Setup a Native Connector' } - )} - , - { - e.stopPropagation(); - onConnectorSelect(false); + {showNativeBadge && ( + + { + e.stopPropagation(); + e.preventDefault(); + setIsNativePopoverOpen(true); + }} + /> + } + isOpen={isNativePopoverOpen} + closePopover={() => { + setIsNativePopoverOpen(false); }} > - {i18n.translate( - 'xpack.enterpriseSearch.connectorCheckable.setupAConnectorClientContextMenuItemLabel', - { defaultMessage: 'Setup a Connector Client' } - )} - , - ]} - /> - - - )} -
- } - > - - - - - - - - {showNativeBadge ? NATIVE_LABEL : CONNECTOR_CLIENT_LABEL} - - + { + e.stopPropagation(); + onConnectorSelect(true); + }} + > + {i18n.translate( + 'xpack.enterpriseSearch.connectorCheckable.setupANativeConnectorContextMenuItemLabel', + { defaultMessage: 'Setup a Native Connector' } + )} + , + { + e.stopPropagation(); + onConnectorSelect(false); + }} + > + {i18n.translate( + 'xpack.enterpriseSearch.connectorCheckable.setupAConnectorClientContextMenuItemLabel', + { defaultMessage: 'Setup a Connector Client' } + )} + , + ]} + /> + + + )} + - {isBeta && ( - - - {BETA_LABEL} - - - )} - {isTechPreview && ( - - - - {i18n.translate( - 'xpack.enterpriseSearch.content.indices.selectConnector.connectorCheckable.techPreviewLabel', - { - defaultMessage: 'Tech preview', - } + + + + + + + + {showNativeBadge ? NATIVE_LABEL : CONNECTOR_CLIENT_LABEL} + + + + {isBeta && ( + + + {BETA_LABEL} + + )} - - - - )} + {isTechPreview && ( + + + + {i18n.translate( + 'xpack.enterpriseSearch.content.indices.selectConnector.connectorCheckable.techPreviewLabel', + { + defaultMessage: 'Tech preview', + } + )} + + + + )} + +
+ {documentationUrl && ( + + + + {i18n.translate( + 'xpack.enterpriseSearch.content.indices.selectConnector.connectorCheckable.documentationLinkLabel', + { + defaultMessage: 'Documentation', + } + )} + + + + )} +
+
- {documentationUrl && ( - - - - {i18n.translate( - 'xpack.enterpriseSearch.content.indices.selectConnector.connectorCheckable.documentationLinkLabel', - { - defaultMessage: 'Documentation', - } - )} - - - - )}
-
+ ); }; diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/new_index/select_connector/connector_description_badge_popout.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/new_index/select_connector/connector_description_badge_popout.tsx new file mode 100644 index 0000000000000..7b1d9bbee5e95 --- /dev/null +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/new_index/select_connector/connector_description_badge_popout.tsx @@ -0,0 +1,153 @@ +/* + * 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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import React, { useState } from 'react'; + +import { + EuiBadge, + EuiFlexGroup, + EuiFlexItem, + EuiIcon, + EuiPanel, + EuiPopover, + EuiText, +} from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; + +import connectorLogo from '../../../../../assets/source_icons/network_drive.svg'; + +const nativePopoverPanels = [ + { + description: i18n.translate( + 'xpack.enterpriseSearch.connectorDescriptionBadge.native.chooseADataSourceLabel', + { defaultMessage: "Choose a data source you'd like to sync" } + ), + icons: [], + id: 'native-choose-source', + }, + { + description: i18n.translate( + 'xpack.enterpriseSearch.connectorDescriptionBadge.native.configureConnectorLabel', + { defaultMessage: 'Configure your connector using our Kibana UI' } + ), + icons: [, ], + id: 'native-configure-connector', + }, +]; + +const connectorClientPopoverPanels = [ + { + description: i18n.translate( + 'xpack.enterpriseSearch.connectorDescriptionBadge.client.chooseADataSourceLabel', + { defaultMessage: "Choose a data source you'd like to sync" } + ), + icons: [], + id: 'client-choose-source', + }, + { + description: i18n.translate( + 'xpack.enterpriseSearch.connectorDescriptionBadge.client.configureConnectorLabel', + { + defaultMessage: + 'Deploy connector code on your own infrastructure by running from source, or using Docker', + } + ), + icons: [ + , + , + , + ], + id: 'client-deploy', + }, + { + description: i18n.translate( + 'xpack.enterpriseSearch.connectorDescriptionBadge.client.enterDetailsLabel', + { + defaultMessage: 'Enter access and connection details for your data source', + } + ), + icons: [ + , + , + , + , + , + ], + id: 'client-configure-connector', + }, +]; + +export interface ConnectorDescriptionBadgeProps { + isNative: boolean; +} + +export const ConnectorDescriptionBadge: React.FC = ({ + isNative, +}) => { + const [isPopoverOpen, setIsPopoverOpen] = useState(false); + const panels = isNative ? nativePopoverPanels : connectorClientPopoverPanels; + return ( + setIsPopoverOpen(true)} + onClickAriaLabel={i18n.translate( + 'xpack.enterpriseSearch.selectConnector.badgeOnClick.ariaLabel', + { + defaultMessage: 'Click to open connector explanation popover', + } + )} + > + {isNative + ? i18n.translate('xpack.enterpriseSearch.selectConnector.nativeBadgeLabel', { + defaultMessage: 'Native', + }) + : i18n.translate('xpack.enterpriseSearch.selectConnector.connectorClientBadgeLabel', { + defaultMessage: 'Connector client', + })} + + } + isOpen={isPopoverOpen} + closePopover={() => { + setIsPopoverOpen(false); + }} + > + + + {panels.map((panel) => { + return ( + + + + + {panel.icons.map((icon, index) => ( + + {icon} + + ))} + + + + +

{panel.description}

+
+
+
+
+ ); + })} +
+
+
+ ); +}; diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/new_index/select_connector/select_connector.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/new_index/select_connector/select_connector.tsx index 764d3ac0d8242..31c4f9cc7a71b 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/new_index/select_connector/select_connector.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/new_index/select_connector/select_connector.tsx @@ -13,8 +13,8 @@ import { css } from '@emotion/react'; import { useValues } from 'kea'; import { - EuiBadge, EuiButton, + EuiCallOut, EuiFacetButton, EuiFacetGroup, EuiFieldSearch, @@ -32,6 +32,7 @@ import { } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; +import { FormattedMessage } from '@kbn/i18n-react'; import { CONNECTOR_CLIENTS_TYPE, @@ -55,6 +56,7 @@ import { CONNECTORS } from '../../search_index/connector/constants'; import { baseBreadcrumbs } from '../../search_indices'; import { ConnectorCheckable } from './connector_checkable'; +import { ConnectorDescriptionBadge } from './connector_description_badge_popout'; export type ConnectorFilter = typeof CONNECTOR_NATIVE_TYPE | typeof CONNECTOR_CLIENTS_TYPE; @@ -108,7 +110,12 @@ export const SelectConnector: React.FC = () => { return ( { - - {i18n.translate('xpack.enterpriseSearch.selectConnector.nativeBadgeLabel', { - defaultMessage: 'Native', - })} - +

@@ -248,12 +251,7 @@ export const SelectConnector: React.FC = () => { - - {i18n.translate( - 'xpack.enterpriseSearch.selectConnector.connectorClientBadgeLabel', - { defaultMessage: 'Connector client' } - )} - +

@@ -327,6 +325,41 @@ export const SelectConnector: React.FC = () => { ))} + {!hasNativeAccess && useNativeFilter && ( + <> + + +

+ +

+ + + + + + )} diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/components/product_selector/ingestion_selector.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/components/product_selector/ingestion_selector.tsx index d2f2173a2d9a3..af8ffe36172f2 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/components/product_selector/ingestion_selector.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/components/product_selector/ingestion_selector.tsx @@ -30,7 +30,7 @@ import { INGESTION_METHOD_IDS, } from '../../../../../common/constants'; -import apiLogo from '../../../../assets/images/api_cloud.svg'; +import apiLogo from '../../../../assets/images/api_image.png'; import fileUploadLogo from '../../../../assets/images/file_upload_logo.svg'; import sampleDataLogo from '../../../../assets/images/sample_data_logo.svg'; import connectorLogo from '../../../../assets/images/search_connector.svg'; diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/components/product_selector/product_selector.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/components/product_selector/product_selector.tsx index d03c220e16cb0..f6762e0e59bab 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/components/product_selector/product_selector.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/components/product_selector/product_selector.tsx @@ -59,7 +59,7 @@ export const ProductSelector: React.FC = () => { - +

diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/api_key/api_key_panel.tsx b/x-pack/plugins/enterprise_search/public/applications/shared/api_key/api_key_panel.tsx index c69976f178495..5556b284d8d4a 100644 --- a/x-pack/plugins/enterprise_search/public/applications/shared/api_key/api_key_panel.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/shared/api_key/api_key_panel.tsx @@ -26,29 +26,19 @@ import { import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n-react'; import { ELASTICSEARCH_URL_PLACEHOLDER } from '@kbn/search-api-panels/constants'; -import { AuthenticatedUser } from '@kbn/security-plugin/common'; -import { Status } from '../../../../common/types/api'; - -import { CreateApiKeyAPILogic } from '../../enterprise_search_overview/api/create_elasticsearch_api_key_logic'; import { FetchApiKeysAPILogic } from '../../enterprise_search_overview/api/fetch_api_keys_logic'; import { KibanaLogic } from '../kibana'; import { CreateApiKeyFlyout } from './create_api_key_flyout'; -interface ApiKeyPanelProps { - user: AuthenticatedUser | null; -} - const COPIED_LABEL = i18n.translate('xpack.enterpriseSearch.overview.apiKey.copied', { defaultMessage: 'Copied', }); -export const ApiKeyPanel: React.FC = ({ user }) => { +export const ApiKeyPanel: React.FC = () => { const { cloud, navigateToUrl } = useValues(KibanaLogic); const { makeRequest } = useActions(FetchApiKeysAPILogic); - const { makeRequest: saveApiKey } = useActions(CreateApiKeyAPILogic); - const { error, status } = useValues(CreateApiKeyAPILogic); const { data } = useValues(FetchApiKeysAPILogic); const [isFlyoutOpen, setIsFlyoutOpen] = useState(false); @@ -60,15 +50,7 @@ export const ApiKeyPanel: React.FC = ({ user }) => { return ( <> - {isFlyoutOpen && ( - setIsFlyoutOpen(false)} - setApiKey={saveApiKey} - username={user?.full_name || user?.username || ''} - /> - )} + {isFlyoutOpen && setIsFlyoutOpen(false)} />} {Boolean(cloud) && ( diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/api_key/create_api_key_flyout.tsx b/x-pack/plugins/enterprise_search/public/applications/shared/api_key/create_api_key_flyout.tsx index 8641070a5a88a..fe298fbd98f4b 100644 --- a/x-pack/plugins/enterprise_search/public/applications/shared/api_key/create_api_key_flyout.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/shared/api_key/create_api_key_flyout.tsx @@ -4,10 +4,12 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import React, { useState } from 'react'; +import React, { useEffect, useRef, useState } from 'react'; import { css } from '@emotion/react'; +import { useValues, useActions } from 'kea'; + import { useEuiTheme, EuiAccordion, @@ -31,12 +33,14 @@ import { EuiText, EuiTitle, } from '@elastic/eui'; + import { i18n } from '@kbn/i18n'; -import { - CreateAPIKeyArgs, - CreateApiKeyResponse, -} from '../../enterprise_search_overview/api/create_elasticsearch_api_key_logic'; +import { Status } from '../../../../common/types/api'; + +import { CreateApiKeyAPILogic } from '../../enterprise_search_overview/api/create_elasticsearch_api_key_logic'; + +import { KibanaLogic } from '../kibana'; import { BasicSetupForm, DEFAULT_EXPIRES_VALUE } from './basic_setup_form'; import { MetadataForm } from './metadata_form'; @@ -57,12 +61,7 @@ const DEFAULT_METADATA = `{ }`; interface CreateApiKeyFlyoutProps { - createdApiKey?: CreateApiKeyResponse; - error?: string; - isLoading: boolean; onClose: () => void; - setApiKey: (apiKey: CreateAPIKeyArgs) => void; - username: string; } export const CANCEL_LABEL: string = i18n.translate('xpack.enterpriseSearch.cancel', { @@ -93,14 +92,7 @@ const INVALID_JSON_ERROR: string = i18n.translate('xpack.enterpriseSearch.invali defaultMessage: 'Invalid JSON', }); -export const CreateApiKeyFlyout: React.FC = ({ - createdApiKey, - error, - isLoading, - onClose, - username, - setApiKey, -}) => { +export const CreateApiKeyFlyout: React.FC = ({ onClose }) => { const { euiTheme } = useEuiTheme(); const [name, setName] = useState(''); const [expires, setExpires] = useState(DEFAULT_EXPIRES_VALUE); @@ -113,6 +105,14 @@ export const CreateApiKeyFlyout: React.FC = ({ const [metadataEnabled, setMetadataEnabled] = useState(false); const [metadataOpen, setMetadataOpen] = useState<'open' | 'closed'>('closed'); + const { user } = useValues(KibanaLogic); + const { makeRequest: saveApiKey, apiReset } = useActions(CreateApiKeyAPILogic); + const { data: createdApiKey, error, status } = useValues(CreateApiKeyAPILogic); + + const isLoading = status === Status.LOADING; + + const username = user?.full_name || user?.username || user?.email || ''; + const togglePrivileges = (e: EuiSwitchEvent) => { const enabled = e.target.checked; setPrivilegesEnabled(enabled); @@ -151,7 +151,7 @@ export const CreateApiKeyFlyout: React.FC = ({ if (metadataError) setMetadataError(undefined); const expiration = expires !== null ? `${expires}d` : undefined; - setApiKey({ + saveApiKey({ expiration, metadata: parsedMetadata, name, @@ -159,9 +159,22 @@ export const CreateApiKeyFlyout: React.FC = ({ }); }; + const apiKeyRef = useRef(null); + + useEffect(() => { + if (createdApiKey && apiKeyRef) { + apiKeyRef.current?.scrollIntoView(); + } + }, [createdApiKey, apiKeyRef]); + + const closeFlyOut = () => { + apiReset(); + onClose(); + }; + return ( = ({ +
{createdApiKey && ( <> - + + = ({ })} data-test-subj="create-api-key-error-callout" > - {error} + {error.body?.message} )} @@ -384,7 +394,7 @@ export const CreateApiKeyFlyout: React.FC = ({ {CANCEL_LABEL} diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/getting_started/languages/console.ts b/x-pack/plugins/enterprise_search/public/applications/shared/getting_started/languages/console.ts index 9d395b0a68c67..6f1877ed57ddd 100644 --- a/x-pack/plugins/enterprise_search/public/applications/shared/getting_started/languages/console.ts +++ b/x-pack/plugins/enterprise_search/public/applications/shared/getting_started/languages/console.ts @@ -7,10 +7,14 @@ import { LanguageDefinition } from '@kbn/search-api-panels'; +import { INDEX_NAME_PLACEHOLDER } from './constants'; + import { ingestKeysToJSON } from './helpers'; export const consoleDefinition: Partial = { - buildSearchQuery: ({ indexName }) => `POST /${indexName ?? 'books'}/_search?pretty + buildSearchQuery: ({ indexName = INDEX_NAME_PLACEHOLDER }) => `POST /${ + indexName ?? 'books' + }/_search?pretty { "query": { "query_string": { @@ -18,7 +22,11 @@ export const consoleDefinition: Partial = { } } }`, - ingestData: ({ indexName, ingestPipeline, extraIngestDocumentValues }) => { + ingestData: ({ + indexName = INDEX_NAME_PLACEHOLDER, + ingestPipeline, + extraIngestDocumentValues, + }) => { const ingestDocumentKeys = ingestPipeline ? ingestKeysToJSON(extraIngestDocumentValues) : ''; return `POST _bulk?pretty${ingestPipeline ? `&pipeline=${ingestPipeline}` : ''} { "index" : { "_index" : "${indexName}" } } diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/getting_started/languages/curl.ts b/x-pack/plugins/enterprise_search/public/applications/shared/getting_started/languages/curl.ts index 726052211f765..4670d58deac2e 100644 --- a/x-pack/plugins/enterprise_search/public/applications/shared/getting_started/languages/curl.ts +++ b/x-pack/plugins/enterprise_search/public/applications/shared/getting_started/languages/curl.ts @@ -10,10 +10,14 @@ import { Languages, LanguageDefinition } from '@kbn/search-api-panels'; import { docLinks } from '../../doc_links'; +import { INDEX_NAME_PLACEHOLDER } from './constants'; + import { ingestKeysToJSON } from './helpers'; export const curlDefinition: LanguageDefinition = { - buildSearchQuery: ({ indexName }) => `curl -X POST "\$\{ES_URL\}/${indexName}/_search?pretty" \\ + buildSearchQuery: ({ + indexName = INDEX_NAME_PLACEHOLDER, + }) => `curl -X POST "\$\{ES_URL\}/${indexName}/_search?pretty" \\ -H "Authorization: ApiKey "\$\{API_KEY\}"" \\ -H "Content-Type: application/json" \\ -d' @@ -35,7 +39,11 @@ export API_KEY="${apiKey}"`, }, iconType: 'curl.svg', id: Languages.CURL, - ingestData: ({ indexName, ingestPipeline, extraIngestDocumentValues }) => { + ingestData: ({ + indexName = INDEX_NAME_PLACEHOLDER, + ingestPipeline, + extraIngestDocumentValues, + }) => { const ingestDocumentKeys = ingestPipeline ? ingestKeysToJSON(extraIngestDocumentValues) : ''; return `curl -X POST "\$\{ES_URL\}/_bulk?pretty${ ingestPipeline ? `&pipeline=${ingestPipeline}` : '' @@ -67,7 +75,7 @@ brew install curl`, defaultMessage: 'cURL', }), languageStyling: 'shell', - testConnection: ({ indexName }) => `curl "\$\{ES_URL\}/${indexName}" \\ + testConnection: ({ indexName = INDEX_NAME_PLACEHOLDER }) => `curl "\$\{ES_URL\}/${indexName}" \\ -H "Authorization: ApiKey "\$\{API_KEY\}"" \\ -H "Content-Type: application/json"`, }; diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/getting_started/languages/go.ts b/x-pack/plugins/enterprise_search/public/applications/shared/getting_started/languages/go.ts index 7591ed942247c..9d5853664fc92 100644 --- a/x-pack/plugins/enterprise_search/public/applications/shared/getting_started/languages/go.ts +++ b/x-pack/plugins/enterprise_search/public/applications/shared/getting_started/languages/go.ts @@ -10,10 +10,12 @@ import { Languages, LanguageDefinition } from '@kbn/search-api-panels'; import { docLinks } from '../../doc_links'; +import { INDEX_NAME_PLACEHOLDER } from './constants'; + import { ingestKeysToJSON } from './helpers'; export const goDefinition: LanguageDefinition = { - buildSearchQuery: ({ indexName }) => `searchResp, err := es.Search( + buildSearchQuery: ({ indexName = INDEX_NAME_PLACEHOLDER }) => `searchResp, err := es.Search( es.Search.WithContext(context.Background()), es.Search.WithIndex("${indexName}"), es.Search.WithQuery("snow"), @@ -58,7 +60,11 @@ if err != nil { }, iconType: 'go.svg', id: Languages.GO, - ingestData: ({ indexName, ingestPipeline, extraIngestDocumentValues }) => { + ingestData: ({ + indexName = INDEX_NAME_PLACEHOLDER, + ingestPipeline, + extraIngestDocumentValues, + }) => { const ingestDocumentKeys = ingestPipeline ? ingestKeysToJSON(extraIngestDocumentValues) : ''; return `buf := bytes.NewBufferString(\` {"index":{"_id":"9780553351927"}} diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/getting_started/languages/javascript.ts b/x-pack/plugins/enterprise_search/public/applications/shared/getting_started/languages/javascript.ts index fa90ed6ca6c62..f0d9758f25657 100644 --- a/x-pack/plugins/enterprise_search/public/applications/shared/getting_started/languages/javascript.ts +++ b/x-pack/plugins/enterprise_search/public/applications/shared/getting_started/languages/javascript.ts @@ -10,10 +10,12 @@ import { Languages, LanguageDefinition } from '@kbn/search-api-panels'; import { docLinks } from '../../doc_links'; +import { INDEX_NAME_PLACEHOLDER } from './constants'; + import { ingestKeysToJSON } from './helpers'; export const javascriptDefinition: LanguageDefinition = { - buildSearchQuery: ({ indexName }) => `// Let's search! + buildSearchQuery: ({ indexName = INDEX_NAME_PLACEHOLDER }) => `// Let's search! const searchResult = await client.search({ index: '${indexName}', q: 'snow' @@ -37,7 +39,11 @@ const client = new Client({ }, iconType: 'javascript.svg', id: Languages.JAVASCRIPT, - ingestData: ({ indexName, ingestPipeline, extraIngestDocumentValues }) => { + ingestData: ({ + indexName = INDEX_NAME_PLACEHOLDER, + ingestPipeline, + extraIngestDocumentValues, + }) => { const ingestDocumentKeys = ingestPipeline ? ingestKeysToJSON(extraIngestDocumentValues) : ''; return `// Sample data books const dataset = [ diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/getting_started/languages/php.ts b/x-pack/plugins/enterprise_search/public/applications/shared/getting_started/languages/php.ts index 6851cdca14e8c..ace1bcfa4cb75 100644 --- a/x-pack/plugins/enterprise_search/public/applications/shared/getting_started/languages/php.ts +++ b/x-pack/plugins/enterprise_search/public/applications/shared/getting_started/languages/php.ts @@ -10,10 +10,12 @@ import { Languages, LanguageDefinition } from '@kbn/search-api-panels'; import { docLinks } from '../../doc_links'; +import { INDEX_NAME_PLACEHOLDER } from './constants'; + import { ingestKeysToPHP } from './helpers'; export const phpDefinition: LanguageDefinition = { - buildSearchQuery: ({ indexName }) => `$params = [ + buildSearchQuery: ({ indexName = INDEX_NAME_PLACEHOLDER }) => `$params = [ 'index' => '${indexName}', 'body' => [ 'q' => 'snow' @@ -35,7 +37,11 @@ print_r($response->asArray());`, }, iconType: 'php.svg', id: Languages.PHP, - ingestData: ({ indexName, ingestPipeline, extraIngestDocumentValues }) => { + ingestData: ({ + indexName = INDEX_NAME_PLACEHOLDER, + ingestPipeline, + extraIngestDocumentValues, + }) => { const ingestDocumentKeys = ingestPipeline ? ingestKeysToPHP(extraIngestDocumentValues) : ''; return `$params = [${ingestPipeline ? `\n 'pipeline' => '${ingestPipeline}',` : ''} 'body' => [ diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/getting_started/languages/python.ts b/x-pack/plugins/enterprise_search/public/applications/shared/getting_started/languages/python.ts index 5be06e06d5831..74d7e3a0236c8 100644 --- a/x-pack/plugins/enterprise_search/public/applications/shared/getting_started/languages/python.ts +++ b/x-pack/plugins/enterprise_search/public/applications/shared/getting_started/languages/python.ts @@ -10,10 +10,13 @@ import { Languages, LanguageDefinition } from '@kbn/search-api-panels'; import { docLinks } from '../../doc_links'; +import { INDEX_NAME_PLACEHOLDER } from './constants'; + import { ingestKeysToJSON } from './helpers'; export const pythonDefinition: LanguageDefinition = { - buildSearchQuery: ({ indexName }) => `client.search(index="${indexName}", q="snow")`, + buildSearchQuery: ({ indexName = INDEX_NAME_PLACEHOLDER }) => + `client.search(index="${indexName}", q="snow")`, configureClient: ({ url, apiKey }) => `from elasticsearch import Elasticsearch client = Elasticsearch( @@ -29,7 +32,11 @@ client = Elasticsearch( }, iconType: 'python.svg', id: Languages.PYTHON, - ingestData: ({ indexName, ingestPipeline, extraIngestDocumentValues }) => { + ingestData: ({ + indexName = INDEX_NAME_PLACEHOLDER, + ingestPipeline, + extraIngestDocumentValues, + }) => { const ingestDocumentKeys = ingestPipeline ? ingestKeysToJSON(extraIngestDocumentValues) : ''; return `documents = [ { "index": { "_index": "${indexName}", "_id": "9780553351927"}}, diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/getting_started/languages/ruby.ts b/x-pack/plugins/enterprise_search/public/applications/shared/getting_started/languages/ruby.ts index d2a2ac7d84c45..3fa860baa0396 100644 --- a/x-pack/plugins/enterprise_search/public/applications/shared/getting_started/languages/ruby.ts +++ b/x-pack/plugins/enterprise_search/public/applications/shared/getting_started/languages/ruby.ts @@ -10,10 +10,13 @@ import { Languages, LanguageDefinition } from '@kbn/search-api-panels'; import { docLinks } from '../../doc_links'; +import { INDEX_NAME_PLACEHOLDER } from './constants'; + import { ingestKeysToRuby } from './helpers'; export const rubyDefinition: LanguageDefinition = { - buildSearchQuery: ({ indexName }) => `client.search(index: '${indexName}', q: 'snow')`, + buildSearchQuery: ({ indexName = INDEX_NAME_PLACEHOLDER }) => + `client.search(index: '${indexName}', q: 'snow')`, configureClient: ({ url, apiKey, cloudId }) => `client = Elasticsearch::Client.new( api_key: '${apiKey}', ${cloudId ? `cloud_id: ${cloudId},` : `url: '${url}',`} @@ -28,7 +31,11 @@ export const rubyDefinition: LanguageDefinition = { }, iconType: 'ruby.svg', id: Languages.RUBY, - ingestData: ({ indexName, ingestPipeline, extraIngestDocumentValues }) => { + ingestData: ({ + indexName = INDEX_NAME_PLACEHOLDER, + ingestPipeline, + extraIngestDocumentValues, + }) => { const ingestDocumentKeys = ingestPipeline ? ingestKeysToRuby(extraIngestDocumentValues) : ''; return `documents = [ { index: { _index: '${indexName}', data: {name: "Snow Crash", author: "Neal Stephenson", release_date: "1992-06-01", page_count: 470${ingestDocumentKeys}} } }, diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/getting_started/panels/add_data_panel_content.tsx b/x-pack/plugins/enterprise_search/public/applications/shared/getting_started/panels/add_data_panel_content.tsx index 7ab9053c765db..e834e9ff45fe5 100644 --- a/x-pack/plugins/enterprise_search/public/applications/shared/getting_started/panels/add_data_panel_content.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/shared/getting_started/panels/add_data_panel_content.tsx @@ -37,8 +37,8 @@ export const AddDataPanelContent: React.FC = ({ return ( { const { makeRequest } = useActions(FetchApiKeysAPILogic); const { data } = useValues(FetchApiKeysAPILogic); const [isFlyoutOpen, setIsFlyoutOpen] = useState(false); - const { user } = useValues(KibanaLogic); - const { makeRequest: saveApiKey } = useActions(CreateApiKeyAPILogic); - const { data: apiKey, error, status } = useValues(CreateApiKeyAPILogic); + const { euiTheme } = useEuiTheme(); useEffect(() => makeRequest({}), []); @@ -75,16 +72,7 @@ export const EndpointsHeaderAction: React.FC = ({ children }) => { {Boolean(children) && {children}} - {isFlyoutOpen && ( - setIsFlyoutOpen(false)} - setApiKey={saveApiKey} - username={user?.full_name || user?.username || ''} - /> - )} + {isFlyoutOpen && setIsFlyoutOpen(false)} />} { anchorPosition="downLeft" > @@ -107,7 +98,13 @@ export const EndpointsHeaderAction: React.FC = ({ children }) => { - {elasticsearchEndpoint} + + {elasticsearchEndpoint} + @@ -139,7 +136,13 @@ export const EndpointsHeaderAction: React.FC = ({ children }) => { - {cloudId} + + {cloudId} + diff --git a/x-pack/plugins/enterprise_search/public/assets/images/api_image.png b/x-pack/plugins/enterprise_search/public/assets/images/api_image.png new file mode 100644 index 0000000000000..dfc31f24813a3 Binary files /dev/null and b/x-pack/plugins/enterprise_search/public/assets/images/api_image.png differ diff --git a/x-pack/plugins/enterprise_search/server/lib/ml/fetch_ml_models.ts b/x-pack/plugins/enterprise_search/server/lib/ml/fetch_ml_models.ts index 1062356a5dbeb..8807eabe14da7 100644 --- a/x-pack/plugins/enterprise_search/server/lib/ml/fetch_ml_models.ts +++ b/x-pack/plugins/enterprise_search/server/lib/ml/fetch_ml_models.ts @@ -6,6 +6,7 @@ */ import { MlTrainedModelConfig, MlTrainedModelStats } from '@elastic/elasticsearch/lib/api/types'; +import { i18n } from '@kbn/i18n'; import { MlTrainedModels } from '@kbn/ml-plugin/server'; import { MlModelDeploymentState, MlModel } from '../../../common/types/ml'; @@ -207,7 +208,9 @@ const getUserFriendlyTitle = (modelId: string, modelType: string) => { return MODEL_TITLES_BY_TYPE[modelType] !== undefined ? MODEL_TITLES_BY_TYPE[modelType]! : modelId === LANG_IDENT_MODEL_ID - ? 'Lanugage Identification' + ? i18n.translate('xpack.enterpriseSearch.content.ml_inference.lang_ident', { + defaultMessage: 'Language Identification', + }) : modelId; }; diff --git a/x-pack/plugins/exploratory_view/e2e/journeys/step_duration.journey.ts b/x-pack/plugins/exploratory_view/e2e/journeys/step_duration.journey.ts index a109740d74496..86291929afcc3 100644 --- a/x-pack/plugins/exploratory_view/e2e/journeys/step_duration.journey.ts +++ b/x-pack/plugins/exploratory_view/e2e/journeys/step_duration.journey.ts @@ -59,9 +59,7 @@ journey('Step Duration series', async ({ page, params }) => { await page.click(byTestId('seriesBreakdown')); await page.click('button[role="option"]:has-text("Step name")'); await page.click('.euiComboBox__inputWrap'); - await page.click( - 'text=Search Monitor nameCombo box. Selected. Combo box input. Search Monitor name. Ty' - ); + await page.click('[role="combobox"][placeholder="Search Monitor name"]'); await page.click('button[role="option"]:has-text("test-monitor - inline")'); await page.click('button:has-text("Apply changes")'); }); diff --git a/x-pack/plugins/exploratory_view/public/application/application.test.tsx b/x-pack/plugins/exploratory_view/public/application/application.test.tsx index 23203930616e4..a0adaca0dbded 100644 --- a/x-pack/plugins/exploratory_view/public/application/application.test.tsx +++ b/x-pack/plugins/exploratory_view/public/application/application.test.tsx @@ -13,7 +13,7 @@ import { AppMountParameters, CoreStart } from '@kbn/core/public'; import { themeServiceMock } from '@kbn/core/public/mocks'; import { ExploratoryViewPublicPluginsStart } from '../plugin'; import { renderApp } from '.'; -import { mockObservabilityAIAssistantService } from '@kbn/observability-ai-assistant-plugin/public'; +import { mockService } from '@kbn/observability-ai-assistant-plugin/public/mock'; describe('renderApp', () => { const originalConsole = global.console; @@ -43,7 +43,7 @@ describe('renderApp', () => { }, }, usageCollection: { reportUiCounter: noop }, - observabilityAIAssistant: { service: mockObservabilityAIAssistantService }, + observabilityAIAssistant: { service: mockService }, } as unknown as ExploratoryViewPublicPluginsStart; const core = { diff --git a/x-pack/plugins/exploratory_view/public/application/index.tsx b/x-pack/plugins/exploratory_view/public/application/index.tsx index c59aa090f75b7..f3189e7cf660b 100644 --- a/x-pack/plugins/exploratory_view/public/application/index.tsx +++ b/x-pack/plugins/exploratory_view/public/application/index.tsx @@ -16,7 +16,6 @@ import { KibanaContextProvider, KibanaThemeProvider } from '@kbn/kibana-react-pl import { RedirectAppLinks } from '@kbn/shared-ux-link-redirect-app'; import { Storage } from '@kbn/kibana-utils-plugin/public'; import { UsageCollectionSetup } from '@kbn/usage-collection-plugin/public'; -import { ObservabilityAIAssistantProvider } from '@kbn/observability-ai-assistant-plugin/public'; import { PluginContext } from '../context/plugin_context'; import { routes } from '../routes'; import { ExploratoryViewPublicPluginsStart } from '../plugin'; @@ -68,47 +67,43 @@ export const renderApp = ({ const ApplicationUsageTrackingProvider = usageCollection?.components.ApplicationUsageTrackingProvider ?? React.Fragment; - const aiAssistantService = plugins.observabilityAIAssistant.service; - ReactDOM.render( - - + - - - - -
+ + +
+ - - - -
-
-
- - - - + + +
+
+
+
+
+
, diff --git a/x-pack/plugins/exploratory_view/public/application/types.ts b/x-pack/plugins/exploratory_view/public/application/types.ts index 7d6cc14dfe771..3cdaee088db7a 100644 --- a/x-pack/plugins/exploratory_view/public/application/types.ts +++ b/x-pack/plugins/exploratory_view/public/application/types.ts @@ -20,6 +20,7 @@ import { EmbeddableStateTransfer } from '@kbn/embeddable-plugin/public'; import { NavigationPublicPluginStart } from '@kbn/navigation-plugin/public'; import { IStorageWrapper } from '@kbn/kibana-utils-plugin/public'; import { DataPublicPluginStart } from '@kbn/data-plugin/public'; +import type { ObservabilityAIAssistantPluginStart } from '@kbn/observability-ai-assistant-plugin/public'; import { DataViewsPublicPluginStart } from '@kbn/data-views-plugin/public'; import { LensPublicStart } from '@kbn/lens-plugin/public'; import { SharePluginStart } from '@kbn/share-plugin/public'; @@ -41,6 +42,7 @@ export interface ObservabilityAppServices { lens: LensPublicStart; navigation: NavigationPublicPluginStart; notifications: NotificationsStart; + observabilityAIAssistant: ObservabilityAIAssistantPluginStart; overlays: OverlayStart; savedObjectsClient: SavedObjectsStart['client']; share: SharePluginStart; diff --git a/x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/components/action_menu/action_menu.test.tsx b/x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/components/action_menu/action_menu.test.tsx index 5d43f5bd1e6df..0070517a81ca4 100644 --- a/x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/components/action_menu/action_menu.test.tsx +++ b/x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/components/action_menu/action_menu.test.tsx @@ -12,6 +12,7 @@ import { sampleAttribute } from '../../configurations/test_data/sample_attribute import * as pluginHook from '../../../../../hooks/use_plugin_context'; import { TypedLensByValueInput } from '@kbn/lens-plugin/public'; import { ExpViewActionMenuContent } from './action_menu'; +import { observabilityAIAssistantPluginMock } from '@kbn/observability-ai-assistant-plugin/public/mock'; jest.spyOn(pluginHook, 'usePluginContext').mockReturnValue({ appMountParameters: { @@ -19,6 +20,24 @@ jest.spyOn(pluginHook, 'usePluginContext').mockReturnValue({ }, } as any); +const mockObservabilityAIAssistant = observabilityAIAssistantPluginMock.createStartContract(); + +jest.mock('../../hooks/use_kibana', () => { + const originalModule = jest.requireActual('../../hooks/use_kibana'); + return { + ...originalModule, + useKibana: () => { + const { services } = originalModule.useKibana(); + return { + services: { + ...services, + observabilityAIAssistant: mockObservabilityAIAssistant, + }, + }; + }, + }; +}); + describe('Action Menu', function () { afterAll(() => { jest.clearAllMocks(); diff --git a/x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/components/action_menu/action_menu.tsx b/x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/components/action_menu/action_menu.tsx index f8e86388131aa..f0e387a1554df 100644 --- a/x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/components/action_menu/action_menu.tsx +++ b/x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/components/action_menu/action_menu.tsx @@ -9,14 +9,9 @@ import React, { useState } from 'react'; import { EuiButton, EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { LensEmbeddableInput, TypedLensByValueInput } from '@kbn/lens-plugin/public'; -import { - ObservabilityAIAssistantActionMenuItem, - useObservabilityAIAssistantOptional, -} from '@kbn/observability-ai-assistant-plugin/public'; -import { useKibana } from '@kbn/kibana-react-plugin/public'; import { EmbedAction } from '../../header/embed_action'; -import { ObservabilityAppServices } from '../../../../../application/types'; import { AddToCaseAction } from '../../header/add_to_case_action'; +import { useKibana } from '../../hooks/use_kibana'; export function ExpViewActionMenuContent({ timeRange, @@ -25,16 +20,16 @@ export function ExpViewActionMenuContent({ timeRange?: { from: string; to: string }; lensAttributes: TypedLensByValueInput['attributes'] | null; }) { - const kServices = useKibana().services; - - const { lens, isDev } = kServices; + const { + lens, + isDev, + observabilityAIAssistant: { ObservabilityAIAssistantActionMenuItem }, + } = useKibana().services; const [isSaveOpen, setIsSaveOpen] = useState(false); const LensSaveModalComponent = lens.SaveModalComponent; - const service = useObservabilityAIAssistantOptional(); - return ( <>
- {service?.isEnabled() ? ( + {ObservabilityAIAssistantActionMenuItem ? ( diff --git a/x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/embeddable/embeddable.test.tsx b/x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/embeddable/embeddable.test.tsx index 5f451e6e7c86b..e8f6ee48dc206 100644 --- a/x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/embeddable/embeddable.test.tsx +++ b/x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/embeddable/embeddable.test.tsx @@ -11,12 +11,14 @@ import { DataViewState } from '../hooks/use_app_data_view'; import { render } from '../rtl_helpers'; import { AddToCaseAction } from '../header/add_to_case_action'; import { ActionTypes } from './use_actions'; +import * as lensHook from './use_embeddable_attributes'; jest.mock('../header/add_to_case_action', () => ({ AddToCaseAction: jest.fn(() =>
mockAddToCaseAction
), })); const mockLensAttrs = { + title: '', hidePanelTitles: true, description: '', visualizationType: 'lnsMetric', @@ -102,17 +104,19 @@ describe('Embeddable', () => { jest.clearAllMocks(); }); + jest.spyOn(lensHook, 'useEmbeddableAttributes').mockReturnValue(mockLensAttrs as any); + it('renders title', async () => { const { container, getByText } = render( ); expect(container.querySelector(`[data-test-subj="exploratoryView-title"]`)).toBeInTheDocument(); @@ -123,12 +127,12 @@ describe('Embeddable', () => { const { container } = render( ); expect( @@ -140,12 +144,12 @@ describe('Embeddable', () => { const { container } = render( ); @@ -174,13 +178,13 @@ describe('Embeddable', () => { render( ); diff --git a/x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/embeddable/embeddable.tsx b/x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/embeddable/embeddable.tsx index c3405225b2e01..ed06d786124f3 100644 --- a/x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/embeddable/embeddable.tsx +++ b/x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/embeddable/embeddable.tsx @@ -4,6 +4,7 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ +import { i18n } from '@kbn/i18n'; import { Position } from '@elastic/charts'; import React, { useState } from 'react'; @@ -17,28 +18,22 @@ import { import { ViewMode } from '@kbn/embeddable-plugin/common'; import { observabilityFeatureId } from '@kbn/observability-shared-plugin/public'; import styled from 'styled-components'; -import { useTheme, useKibanaSpace } from '@kbn/observability-shared-plugin/public'; -import { HeatMapLensAttributes } from '../configurations/lens_attributes/heatmap_attributes'; -import { SingleMetricLensAttributes } from '../configurations/lens_attributes/single_metric_attributes'; -import { AllSeries, ReportTypes } from '../../../..'; -import { LayerConfig, LensAttributes } from '../configurations/lens_attributes'; +import { AllSeries } from '../../../..'; import { AppDataType, ReportViewType } from '../types'; -import { getLayerConfigs } from '../hooks/use_lens_attributes'; import { OperationTypeComponent } from '../series_editor/columns/operation_type_select'; import { DataViewState } from '../hooks/use_app_data_view'; import { ReportConfigMap } from '../contexts/exploratory_view_config'; -import { obsvReportConfigMap } from '../obsv_exploratory_view'; import { ActionTypes, useActions } from './use_actions'; import { AddToCaseAction } from '../header/add_to_case_action'; +import { useEmbeddableAttributes } from './use_embeddable_attributes'; export interface ExploratoryEmbeddableProps { id?: string; appendTitle?: JSX.Element; - attributes?: AllSeries; + attributes: AllSeries; axisTitlesVisibility?: XYState['axisTitlesVisibilitySettings']; gridlinesVisibilitySettings?: XYState['gridlinesVisibilitySettings']; customHeight?: string; - customLensAttrs?: any; // Takes LensAttributes customTimeRange?: { from: string; to: string }; // required if rendered with LensAttributes dataTypesIndexPatterns?: Partial>; isSingleMetric?: boolean; @@ -69,77 +64,42 @@ export interface ExploratoryEmbeddableComponentProps extends ExploratoryEmbeddab } // eslint-disable-next-line import/no-default-export -export default function Embeddable({ - appendTitle, - attributes = [], - axisTitlesVisibility, - gridlinesVisibilitySettings, - customHeight, - customLensAttrs, - customTimeRange, - dataViewState, - legendIsVisible, - legendPosition, - lens, - onBrushEnd, - caseOwner = observabilityFeatureId, - reportConfigMap = {}, - reportType, - showCalculationMethod = false, - title, - withActions = true, - lensFormulaHelper, - hideTicks, - align, - noLabel, - fontSize = 27, - lineHeight = 32, - searchSessionId, - onLoad, -}: ExploratoryEmbeddableComponentProps) { +export default function Embeddable(props: ExploratoryEmbeddableComponentProps) { + const { + appendTitle, + attributes = [], + axisTitlesVisibility, + gridlinesVisibilitySettings, + customHeight, + customTimeRange, + legendIsVisible, + legendPosition, + lens, + onBrushEnd, + caseOwner = observabilityFeatureId, + reportType, + showCalculationMethod = false, + title, + withActions = true, + hideTicks, + align, + noLabel, + fontSize = 27, + lineHeight = 32, + searchSessionId, + onLoad, + } = props; const LensComponent = lens?.EmbeddableComponent; const LensSaveModalComponent = lens?.SaveModalComponent; const [isSaveOpen, setIsSaveOpen] = useState(false); const [isAddToCaseOpen, setAddToCaseOpen] = useState(false); - const spaceId = useKibanaSpace(); - const series = Object.entries(attributes)[0]?.[1]; const [operationType, setOperationType] = useState(series?.operationType); - const theme = useTheme(); - - const layerConfigs: LayerConfig[] = getLayerConfigs( - attributes, - reportType, - theme, - dataViewState, - { ...reportConfigMap, ...obsvReportConfigMap }, - spaceId.space?.id - ); - let lensAttributes; - let attributesJSON = customLensAttrs; - if (!customLensAttrs) { - try { - if (reportType === ReportTypes.SINGLE_METRIC) { - lensAttributes = new SingleMetricLensAttributes( - layerConfigs, - reportType, - lensFormulaHelper! - ); - attributesJSON = lensAttributes?.getJSON('lnsLegacyMetric'); - } else if (reportType === ReportTypes.HEATMAP) { - lensAttributes = new HeatMapLensAttributes(layerConfigs, reportType, lensFormulaHelper!); - attributesJSON = lensAttributes?.getJSON('lnsHeatmap'); - } else { - lensAttributes = new LensAttributes(layerConfigs, reportType, lensFormulaHelper); - attributesJSON = lensAttributes?.getJSON(); - } - // eslint-disable-next-line no-empty - } catch (error) {} - } + const attributesJSON = useEmbeddableAttributes(props); const timeRange = customTimeRange ?? series?.time; @@ -182,17 +142,20 @@ export default function Embeddable({ }; } - if (!attributesJSON && layerConfigs.length < 1) { + if (!attributesJSON) { return null; } if (!LensComponent) { - return No lens component; + return ( + + {i18n.translate('xpack.exploratoryView.embeddable.noLensComponentTextLabel', { + defaultMessage: 'No lens component', + })} + + ); } - attributesJSON.state.searchSessionId = searchSessionId; - attributesJSON.searchSessionId = searchSessionId; - return ( { + const spaceId = useKibanaSpace(); + const theme = useTheme(); + + return useMemo(() => { + try { + const layerConfigs: LayerConfig[] = getLayerConfigs( + attributes, + reportType, + theme, + dataViewState, + { ...reportConfigMap, ...obsvReportConfigMap }, + spaceId.space?.id + ); + + if (reportType === ReportTypes.SINGLE_METRIC) { + const lensAttributes = new SingleMetricLensAttributes( + layerConfigs, + reportType, + lensFormulaHelper! + ); + return lensAttributes?.getJSON('lnsLegacyMetric'); + } else if (reportType === ReportTypes.HEATMAP) { + const lensAttributes = new HeatMapLensAttributes( + layerConfigs, + reportType, + lensFormulaHelper! + ); + return lensAttributes?.getJSON('lnsHeatmap'); + } else { + const lensAttributes = new LensAttributes(layerConfigs, reportType, lensFormulaHelper); + return lensAttributes?.getJSON(); + } + } catch (error) { + console.error(error); + } + }, [ + attributes, + dataViewState, + lensFormulaHelper, + reportConfigMap, + reportType, + spaceId.space?.id, + theme, + ]); +}; diff --git a/x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/exploratory_view.test.tsx b/x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/exploratory_view.test.tsx index 83cae3e8b4ebb..e8b01b10316c3 100644 --- a/x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/exploratory_view.test.tsx +++ b/x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/exploratory_view.test.tsx @@ -12,6 +12,7 @@ import { ExploratoryView } from './exploratory_view'; import * as obsvDataViews from '../../../utils/observability_data_views/observability_data_views'; import * as pluginHook from '../../../hooks/use_plugin_context'; import { createStubIndexPattern } from '@kbn/data-plugin/common/stubs'; +import { observabilityAIAssistantPluginMock } from '@kbn/observability-ai-assistant-plugin/public/mock'; jest.spyOn(pluginHook, 'usePluginContext').mockReturnValue({ appMountParameters: { @@ -19,6 +20,24 @@ jest.spyOn(pluginHook, 'usePluginContext').mockReturnValue({ }, } as any); +const mockObservabilityAIAssistant = observabilityAIAssistantPluginMock.createStartContract(); + +jest.mock('./hooks/use_kibana', () => { + const originalModule = jest.requireActual('./hooks/use_kibana'); + return { + ...originalModule, + useKibana: () => { + const { services } = originalModule.useKibana(); + return { + services: { + ...services, + observabilityAIAssistant: mockObservabilityAIAssistant, + }, + }; + }, + }; +}); + describe('ExploratoryView', () => { mockAppDataView(); diff --git a/x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/exploratory_view.tsx b/x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/exploratory_view.tsx index a67618cf5f93c..9b5fadb9c1bf8 100644 --- a/x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/exploratory_view.tsx +++ b/x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/exploratory_view.tsx @@ -16,9 +16,8 @@ import { EuiFlexItem, } from '@elastic/eui'; import { PanelDirection } from '@elastic/eui/src/components/resizable_container/types'; -import { useKibana } from '@kbn/kibana-react-plugin/public'; import { TypedLensByValueInput } from '@kbn/lens-plugin/public'; -import { ExploratoryViewPublicPluginsStart } from '../../../plugin'; +import { useKibana } from './hooks/use_kibana'; import { useSeriesStorage } from './hooks/use_series_storage'; import { useLensAttributes } from './hooks/use_lens_attributes'; import { useAppDataViewContext } from './hooks/use_app_data_view'; @@ -38,7 +37,7 @@ export function ExploratoryView({ }) { const { services: { lens }, - } = useKibana(); + } = useKibana(); const seriesBuilderRef = useRef(null); const wrapperRef = useRef(null); diff --git a/x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/hooks/use_kibana.ts b/x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/hooks/use_kibana.ts new file mode 100644 index 0000000000000..57c0c731d4245 --- /dev/null +++ b/x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/hooks/use_kibana.ts @@ -0,0 +1,20 @@ +/* + * 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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { CoreStart } from '@kbn/core/public'; +import { useKibana } from '@kbn/kibana-react-plugin/public'; +import { ExploratoryViewPublicPluginsStart } from '../../../../plugin'; + +export type StartServices = CoreStart & + ExploratoryViewPublicPluginsStart & + AdditionalServices & { + isDev: boolean; + }; +const useTypedKibana = () => + useKibana>(); + +export { useTypedKibana as useKibana }; diff --git a/x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/index.tsx b/x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/index.tsx index 152593abaf06a..392420ee547f8 100644 --- a/x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/index.tsx +++ b/x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/index.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { i18n } from '@kbn/i18n'; import { useHistory } from 'react-router-dom'; -import { useKibana } from '@kbn/kibana-react-plugin/public'; + import { createKbnUrlStateStorage, withNotifyOnErrors, @@ -17,7 +17,7 @@ import { import { TypedLensByValueInput } from '@kbn/lens-plugin/public'; import { useBreadcrumbs, useTrackPageview } from '@kbn/observability-shared-plugin/public'; import { ExploratoryView } from './exploratory_view'; -import { ExploratoryViewPublicPluginsStart } from '../../../plugin'; +import { useKibana } from './hooks/use_kibana'; import { DataViewContextProvider } from './hooks/use_app_data_view'; import { UrlStorageContextProvider } from './hooks/use_series_storage'; import { RefreshButton } from './header/refresh_button'; @@ -39,7 +39,7 @@ export function ExploratoryViewPage({ }: ExploratoryViewPageProps) { const { services: { uiSettings, notifications, observabilityShared }, - } = useKibana(); + } = useKibana(); const history = useHistory(); diff --git a/x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/lens_embeddable.tsx b/x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/lens_embeddable.tsx index 6ec631403b229..2613d39e79391 100644 --- a/x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/lens_embeddable.tsx +++ b/x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/lens_embeddable.tsx @@ -9,10 +9,9 @@ import { i18n } from '@kbn/i18n'; import React, { Dispatch, SetStateAction, useCallback, useState } from 'react'; import styled from 'styled-components'; import { LensEmbeddableInput, TypedLensByValueInput } from '@kbn/lens-plugin/public'; -import { useKibana } from '@kbn/kibana-react-plugin/public'; import { useUiTracker } from '@kbn/observability-shared-plugin/public'; import { useSeriesStorage } from './hooks/use_series_storage'; -import { ExploratoryViewPublicPluginsStart } from '../../../plugin'; +import { useKibana } from './hooks/use_kibana'; import { useExpViewTimeRange } from './hooks/use_time_range'; import { parseRelativeDate } from './components/date_range_picker'; import { trackTelemetryOnLoad } from './utils/telemetry'; @@ -30,7 +29,7 @@ export function LensEmbeddable(props: Props) { const { lensAttributes, setChartTimeRangeContext } = props; const { services: { lens, notifications }, - } = useKibana(); + } = useKibana(); const LensComponent = lens?.EmbeddableComponent; const LensSaveModalComponent = lens?.SaveModalComponent; diff --git a/x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/report_definition_col.test.tsx b/x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/report_definition_col.test.tsx index 980c02a0ab153..17f62937812ee 100644 --- a/x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/report_definition_col.test.tsx +++ b/x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/report_definition_col.test.tsx @@ -39,7 +39,7 @@ describe('Series Builder ReportDefinitionCol', function () { await waitFor(() => { expect(screen.getByText('Web Application')).toBeInTheDocument(); expect(screen.getByText('Environment')).toBeInTheDocument(); - expect(screen.getByText('Search Environment')).toBeInTheDocument(); + expect(screen.getByPlaceholderText('Search Environment')).toBeInTheDocument(); }); }); diff --git a/x-pack/plugins/exploratory_view/public/components/shared/field_value_suggestions/field_value_selection.tsx b/x-pack/plugins/exploratory_view/public/components/shared/field_value_suggestions/field_value_selection.tsx index 888033d8183cd..4cf81e2a9976d 100644 --- a/x-pack/plugins/exploratory_view/public/components/shared/field_value_suggestions/field_value_selection.tsx +++ b/x-pack/plugins/exploratory_view/public/components/shared/field_value_suggestions/field_value_selection.tsx @@ -175,7 +175,7 @@ export function FieldValueSelection({ isOpen={isPopoverOpen || forceOpen} closePopover={closePopover} anchorPosition={anchorPosition} - style={{ width: '100%' }} + display="block" > - p.package?.name === FLEET_APM_PACKAGE || p.package?.name === FLEET_SERVER_PACKAGE || - p.package?.name === FLEET_SYNTHETICS_PACKAGE + p.package?.name === FLEET_SYNTHETICS_PACKAGE || + p.package?.name === FLEET_APM_PACKAGE ); if (isRestrictedToSameClusterES) { diff --git a/x-pack/plugins/fleet/cypress/e2e/package_policy_pipelines_and_mappings_real.cy.ts b/x-pack/plugins/fleet/cypress/e2e/package_policy_pipelines_and_mappings_real.cy.ts index c1cf0ef4e0b09..6cbf5a881f5d5 100644 --- a/x-pack/plugins/fleet/cypress/e2e/package_policy_pipelines_and_mappings_real.cy.ts +++ b/x-pack/plugins/fleet/cypress/e2e/package_policy_pipelines_and_mappings_real.cy.ts @@ -100,7 +100,7 @@ describe('Input package create and edit package policy', () => { editPackagePolicyandShowAdvanced(INPUT_TEST_PACKAGE, packagePolicyName); cy.getBySel(POLICY_EDITOR.EDIT_MAPPINGS_BTN).click(); cy.getBySel(CONFIRM_MODAL.CONFIRM_BUTTON).click(); - cy.get('body').should('contain', `logs-${datasetName}@custom`); + cy.get('body').should('contain', `logs${datasetName}@custom`); }); }); diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/components/agent_policy_advanced_fields/hooks.test.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/components/agent_policy_advanced_fields/hooks.test.tsx index e027317bf621a..8c2983ee9fd83 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/components/agent_policy_advanced_fields/hooks.test.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/components/agent_policy_advanced_fields/hooks.test.tsx @@ -533,7 +533,7 @@ describe('useOutputOptions', () => { `); }); - it('should only enable remote es output for monitoring output', async () => { + it('should enable remote es output for data and monitoring output', async () => { const testRenderer = createFleetTestRendererMock(); mockedUseLicence.mockReturnValue({ hasAtLeast: () => true, @@ -545,7 +545,8 @@ describe('useOutputOptions', () => { expect(result.current.isLoading).toBeTruthy(); await waitForNextUpdate(); - expect(result.current.dataOutputOptions.length).toEqual(1); + expect(result.current.dataOutputOptions.length).toEqual(2); + expect(result.current.dataOutputOptions[1].value).toEqual('remote1'); expect(result.current.monitoringOutputOptions.length).toEqual(2); expect(result.current.monitoringOutputOptions[1].value).toEqual('remote1'); }); diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/components/agent_policy_advanced_fields/hooks.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/components/agent_policy_advanced_fields/hooks.tsx index 9ee8b1f225735..15681ea1dfbb6 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/components/agent_policy_advanced_fields/hooks.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/components/agent_policy_advanced_fields/hooks.tsx @@ -16,7 +16,7 @@ import { useGetDownloadSources, useGetFleetServerHosts, } from '../../../../hooks'; -import { LICENCE_FOR_PER_POLICY_OUTPUT, outputType } from '../../../../../../../common/constants'; +import { LICENCE_FOR_PER_POLICY_OUTPUT } from '../../../../../../../common/constants'; import { getAllowedOutputTypeForPolicy, policyHasFleetServer, @@ -99,28 +99,26 @@ export function useOutputOptions(agentPolicy: Partial item.type !== outputType.RemoteElasticsearch) - .map((item) => { - const isOutputTypeUnsupported = !allowedOutputTypes.includes(item.type); + ...outputsRequest.data.items.map((item) => { + const isOutputTypeUnsupported = !allowedOutputTypes.includes(item.type); - return { - value: item.id, - inputDisplay: getOutputLabel( - item.name, - isOutputTypeUnsupported ? ( - - ) : undefined - ), - disabled: !isPolicyPerOutputAllowed || isOutputTypeUnsupported, - }; - }), + return { + value: item.id, + inputDisplay: getOutputLabel( + item.name, + isOutputTypeUnsupported ? ( + + ) : undefined + ), + disabled: !isPolicyPerOutputAllowed || isOutputTypeUnsupported, + }; + }), ]; }, [outputsRequest, isPolicyPerOutputAllowed, allowedOutputTypes]); diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/components/agent_upgrade_modal/index.test.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/components/agent_upgrade_modal/index.test.tsx index 7850ae3a3128d..1a18b6e27f5eb 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/components/agent_upgrade_modal/index.test.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/components/agent_upgrade_modal/index.test.tsx @@ -7,7 +7,7 @@ import React from 'react'; -import { act, fireEvent, waitFor } from '@testing-library/react'; +import { act, fireEvent, waitFor, within } from '@testing-library/react'; import { createFleetTestRendererMock } from '../../../../../../mock'; @@ -54,8 +54,9 @@ describe('AgentUpgradeAgentModal', () => { agentCount: 3, }); - const el = utils.getByTestId('agentUpgradeModal.MaintenanceCombobox'); - expect(el?.textContent).toBe('Immediately'); + const container = utils.getByTestId('agentUpgradeModal.MaintenanceCombobox'); + const input = within(container).getByRole('combobox'); + expect(input?.value).toBe('Immediately'); }); it('should set the default to Immediately if there is less than 10 agents using selected agents', async () => { @@ -64,8 +65,9 @@ describe('AgentUpgradeAgentModal', () => { agentCount: 3, }); - const el = utils.getByTestId('agentUpgradeModal.MaintenanceCombobox'); - expect(el?.textContent).toBe('Immediately'); + const container = utils.getByTestId('agentUpgradeModal.MaintenanceCombobox'); + const input = within(container).getByRole('combobox'); + expect(input?.value).toBe('Immediately'); }); it('should set the default to 1 hour if there is more than 10 agents', async () => { @@ -74,8 +76,9 @@ describe('AgentUpgradeAgentModal', () => { agentCount: 13, }); - const el = utils.getByTestId('agentUpgradeModal.MaintenanceCombobox'); - expect(el?.textContent).toBe('1 hour'); + const container = utils.getByTestId('agentUpgradeModal.MaintenanceCombobox'); + const input = within(container).getByRole('combobox'); + expect(input?.value).toBe('1 hour'); }); }); @@ -98,9 +101,11 @@ describe('AgentUpgradeAgentModal', () => { agentCount: 1, }); - const el = utils.getByTestId('agentUpgradeModal.VersionCombobox'); + const container = utils.getByTestId('agentUpgradeModal.VersionCombobox'); + const input = within(container).getByRole('combobox'); + await waitFor(() => { - expect(el.textContent).toEqual('8.10.2'); + expect(input?.value).toEqual('8.10.2'); }); }); diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/edit_output_flyout/index.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/edit_output_flyout/index.tsx index 511af850cab46..daebac615d6eb 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/edit_output_flyout/index.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/edit_output_flyout/index.tsx @@ -542,7 +542,6 @@ export const EditOutputFlyout: React.FunctionComponent = }} /> } - disabled={isRemoteESOutput} /> diff --git a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/components/package_list_grid/grid.tsx b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/components/package_list_grid/grid.tsx index 0e85390a4b327..214ce24463e54 100644 --- a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/components/package_list_grid/grid.tsx +++ b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/components/package_list_grid/grid.tsx @@ -125,8 +125,7 @@ export const GridColumn = ({ // Ensure that cards wrapped in EuiTours/EuiPopovers correctly inherit the full grid row height css={css` & > .euiPopover, - & > .euiPopover > .euiPopover__anchor, - & > .euiPopover > .euiPopover__anchor > .euiCard { + & > .euiPopover > .euiCard { height: 100%; } `} diff --git a/x-pack/plugins/fleet/server/collectors/agent_collectors.ts b/x-pack/plugins/fleet/server/collectors/agent_collectors.ts index 09a4986e0e6f0..391114aa992b3 100644 --- a/x-pack/plugins/fleet/server/collectors/agent_collectors.ts +++ b/x-pack/plugins/fleet/server/collectors/agent_collectors.ts @@ -75,6 +75,12 @@ export interface AgentData { version: string; count: number; }>; + upgrade_details: Array<{ + target_version: string; + state: string; + error_msg: string; + agent_count: number; + }>; } const DEFAULT_AGENT_DATA = { @@ -82,6 +88,7 @@ const DEFAULT_AGENT_DATA = { agents_per_policy: [], agents_per_version: [], agents_per_os: [], + upgrade_details: [], }; export const getAgentData = async ( @@ -135,6 +142,23 @@ export const getAgentData = async ( ], }, }, + upgrade_details: { + multi_terms: { + size: 1000, + terms: [ + { + field: 'upgrade_details.target_version.keyword', + }, + { + field: 'upgrade_details.state', + }, + { + field: 'upgrade_details.metadata.error_msg.keyword', + missing: '', + }, + ], + }, + }, }, }, { signal: abortController.signal } @@ -190,11 +214,21 @@ export const getAgentData = async ( count: bucket.doc_count, })); + const upgradeDetails = ((response?.aggregations?.upgrade_details as any).buckets ?? []).map( + (bucket: any) => ({ + target_version: bucket.key[0], + state: bucket.key[1], + error_msg: bucket.key[2], + agent_count: bucket.doc_count, + }) + ); + return { agent_checkin_status: statuses, agents_per_policy: agentsPerPolicy, agents_per_version: agentsPerVersion, agents_per_os: agentsPerOS, + upgrade_details: upgradeDetails, }; } catch (error) { if (error.statusCode === 404) { diff --git a/x-pack/plugins/fleet/server/collectors/agents_per_output.ts b/x-pack/plugins/fleet/server/collectors/agents_per_output.ts index b7ed480fc61fc..5090b1530bc02 100644 --- a/x-pack/plugins/fleet/server/collectors/agents_per_output.ts +++ b/x-pack/plugins/fleet/server/collectors/agents_per_output.ts @@ -83,7 +83,9 @@ export async function getAgentsPerOutput( if (!outputTypeSupportPresets(output.type)) { return; } - + if (!outputTypes[output.type]) { + return; + } const outputTelemetryRecord = outputTypes[output.type]; if (!outputTelemetryRecord.preset_counts) { diff --git a/x-pack/plugins/fleet/server/integration_tests/fleet_usage_telemetry.test.ts b/x-pack/plugins/fleet/server/integration_tests/fleet_usage_telemetry.test.ts index 19eb7aa750658..430dc6f745ad9 100644 --- a/x-pack/plugins/fleet/server/integration_tests/fleet_usage_telemetry.test.ts +++ b/x-pack/plugins/fleet/server/integration_tests/fleet_usage_telemetry.test.ts @@ -146,6 +146,13 @@ describe('fleet usage telemetry', () => { status: 'HEALTHY', }, ], + upgrade_details: { + target_version: '8.12.0', + state: 'UPG_FAILED', + metadata: { + error_msg: 'Download failed', + }, + }, }, { create: { @@ -176,6 +183,13 @@ describe('fleet usage telemetry', () => { status: 'HEALTHY', }, ], + upgrade_details: { + target_version: '8.12.0', + state: 'UPG_FAILED', + metadata: { + error_msg: 'Agent crash detected', + }, + }, }, { create: { @@ -220,6 +234,11 @@ describe('fleet usage telemetry', () => { last_checkin: new Date(Date.now() - 1000 * 60 * 6).toISOString(), active: true, policy_id: 'policy2', + upgrade_details: { + target_version: '8.11.0', + state: 'UPG_ROLLBACK', + metadata: {}, + }, }, { create: { @@ -557,5 +576,24 @@ describe('fleet usage telemetry', () => { fleet_server_logs_top_errors: ['failed to unenroll offline agents'], }) ); + expect(usage?.upgrade_details.length).toBe(3); + expect(usage?.upgrade_details).toContainEqual({ + target_version: '8.12.0', + state: 'UPG_FAILED', + error_msg: 'Download failed', + agent_count: 1, + }); + expect(usage?.upgrade_details).toContainEqual({ + target_version: '8.12.0', + state: 'UPG_FAILED', + error_msg: 'Agent crash detected', + agent_count: 1, + }); + expect(usage?.upgrade_details).toContainEqual({ + target_version: '8.11.0', + state: 'UPG_ROLLBACK', + error_msg: '', + agent_count: 1, + }); }); }); diff --git a/x-pack/plugins/fleet/server/routes/uninstall_token/handlers.ts b/x-pack/plugins/fleet/server/routes/uninstall_token/handlers.ts index 804b90ab1aa2f..50dc1263ddf07 100644 --- a/x-pack/plugins/fleet/server/routes/uninstall_token/handlers.ts +++ b/x-pack/plugins/fleet/server/routes/uninstall_token/handlers.ts @@ -34,7 +34,12 @@ export const getUninstallTokensMetadataHandler: FleetRequestHandler< try { const { page = 1, perPage = 20, policyId } = request.query; - const body = await uninstallTokenService.getTokenMetadata(policyId?.trim(), page, perPage); + const body = await uninstallTokenService.getTokenMetadata( + policyId?.trim(), + page, + perPage, + 'policy-elastic-agent-on-cloud' + ); return response.ok({ body }); } catch (error) { diff --git a/x-pack/plugins/fleet/server/services/output.test.ts b/x-pack/plugins/fleet/server/services/output.test.ts index c17cf9d3af210..8c2fee196d8d8 100644 --- a/x-pack/plugins/fleet/server/services/output.test.ts +++ b/x-pack/plugins/fleet/server/services/output.test.ts @@ -705,12 +705,12 @@ describe('Output Service', () => { ); }); - it('should throw when a remote es output is attempted to be created as default data output', async () => { + it('should not throw when a remote es output is attempted to be created as default data output', async () => { const soClient = getMockedSoClient({ defaultOutputId: 'output-test', }); - await expect( + expect( outputService.create( soClient, esClientMock, @@ -722,9 +722,7 @@ describe('Output Service', () => { }, { id: 'output-1' } ) - ).rejects.toThrow( - `Remote elasticsearch output cannot be set as default output for integration data. Please set "is_default" to false.` - ); + ).resolves.not.toThrow(); }); it('should set preset: balanced by default when creating a new ES output', async () => { @@ -1644,21 +1642,19 @@ describe('Output Service', () => { ); }); - it('should throw when a remote es output is attempted to be updated as default data output', async () => { + it('should not throw when a remote es output is attempted to be updated as default data output', async () => { const soClient = getMockedSoClient({ defaultOutputId: 'output-test', }); - await expect( + expect( outputService.update(soClient, esClientMock, 'output-test', { is_default: true, is_default_monitoring: false, name: 'Test', type: 'remote_elasticsearch', }) - ).rejects.toThrow( - `Remote elasticsearch output cannot be set as default output for integration data. Please set "is_default" to false.` - ); + ).resolves.not.toThrow(); }); }); diff --git a/x-pack/plugins/fleet/server/services/output.ts b/x-pack/plugins/fleet/server/services/output.ts index 7b838d9b9b0a5..e73a070a54965 100644 --- a/x-pack/plugins/fleet/server/services/output.ts +++ b/x-pack/plugins/fleet/server/services/output.ts @@ -441,13 +441,6 @@ class OutputService { logger.debug(`Creating new output`); const data: OutputSOAttributes = { ...omit(output, ['ssl', 'secrets']) }; - if (output.type === outputType.RemoteElasticsearch) { - if (data.is_default) { - throw new OutputInvalidError( - 'Remote elasticsearch output cannot be set as default output for integration data. Please set "is_default" to false.' - ); - } - } if (outputTypeSupportPresets(data.type)) { if ( @@ -767,14 +760,6 @@ class OutputService { const logger = appContextService.getLogger(); logger.debug(`Updating output ${id}`); - if (data.type === outputType.RemoteElasticsearch) { - if (data.is_default) { - throw new OutputInvalidError( - 'Remote elasticsearch output cannot be set as default output for integration data. Please set "is_default" to false.' - ); - } - } - let secretsToDelete: PolicySecretReference[] = []; const originalOutput = await this.get(soClient, id); diff --git a/x-pack/plugins/fleet/server/services/security/uninstall_token_service/index.ts b/x-pack/plugins/fleet/server/services/security/uninstall_token_service/index.ts index 7a2bdedffcdc8..330007e23963d 100644 --- a/x-pack/plugins/fleet/server/services/security/uninstall_token_service/index.ts +++ b/x-pack/plugins/fleet/server/services/security/uninstall_token_service/index.ts @@ -25,7 +25,10 @@ import type { KibanaRequest } from '@kbn/core-http-server'; import { SECURITY_EXTENSION_ID } from '@kbn/core-saved-objects-server'; import { asyncForEach } from '@kbn/std'; -import type { AggregationsTermsInclude } from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; +import type { + AggregationsTermsInclude, + AggregationsTermsExclude, +} from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import { UninstallTokenError } from '../../../../common/errors'; @@ -74,12 +77,14 @@ export interface UninstallTokenServiceInterface { * @param policyIdFilter a string for partial matching the policyId * @param page * @param perPage + * @param policyIdExcludeFilter * @returns Uninstall Tokens Metadata Response */ getTokenMetadata( policyIdFilter?: string, page?: number, - perPage?: number + perPage?: number, + policyIdExcludeFilter?: string ): Promise; /** @@ -170,11 +175,15 @@ export class UninstallTokenService implements UninstallTokenServiceInterface { public async getTokenMetadata( policyIdFilter?: string, page = 1, - perPage = 20 + perPage = 20, + policyIdExcludeFilter?: string ): Promise { const includeFilter = policyIdFilter ? `.*${policyIdFilter}.*` : undefined; - const tokenObjects = await this.getTokenObjectsByIncludeFilter(includeFilter); + const tokenObjects = await this.getTokenObjectsByIncludeFilter( + includeFilter, + policyIdExcludeFilter + ); const items: UninstallTokenMetadata[] = tokenObjects .slice((page - 1) * perPage, page * perPage) @@ -250,7 +259,8 @@ export class UninstallTokenService implements UninstallTokenServiceInterface { }; private async getTokenObjectsByIncludeFilter( - include?: AggregationsTermsInclude + include?: AggregationsTermsInclude, + exclude?: AggregationsTermsExclude ): Promise>> { const bucketSize = 10000; @@ -263,7 +273,7 @@ export class UninstallTokenService implements UninstallTokenServiceInterface { field: `${UNINSTALL_TOKENS_SAVED_OBJECT_TYPE}.attributes.policy_id`, size: bucketSize, include, - exclude: 'policy-elastic-agent-on-cloud', // todo: find a better way to not return or even generate token for managed policies + exclude, }, aggs: { latest: { diff --git a/x-pack/plugins/fleet/server/services/telemetry/fleet_usage_sender.ts b/x-pack/plugins/fleet/server/services/telemetry/fleet_usage_sender.ts index 4ee0a7dac4f89..1b90fe6d01e0b 100644 --- a/x-pack/plugins/fleet/server/services/telemetry/fleet_usage_sender.ts +++ b/x-pack/plugins/fleet/server/services/telemetry/fleet_usage_sender.ts @@ -24,7 +24,7 @@ const FLEET_AGENTS_EVENT_TYPE = 'fleet_agents'; export class FleetUsageSender { private taskManager?: TaskManagerStartContract; - private taskVersion = '1.1.3'; + private taskVersion = '1.1.4'; private taskType = 'Fleet-Usage-Sender'; private wasStarted: boolean = false; private interval = '1h'; @@ -83,6 +83,7 @@ export class FleetUsageSender { const { agents_per_version: agentsPerVersion, agents_per_output_type: agentsPerOutputType, + upgrade_details: upgradeDetails, ...fleetUsageData } = usageData; appContextService @@ -106,6 +107,13 @@ export class FleetUsageSender { agents_per_output_type: byOutputType, }); }); + + appContextService + .getLogger() + .debug('Agents upgrade details telemetry: ' + JSON.stringify(upgradeDetails)); + upgradeDetails.forEach((upgradeDetailsObj) => { + core.analytics.reportEvent(FLEET_AGENTS_EVENT_TYPE, { upgrade_details: upgradeDetailsObj }); + }); } catch (error) { appContextService .getLogger() diff --git a/x-pack/plugins/fleet/server/services/telemetry/fleet_usages_schema.ts b/x-pack/plugins/fleet/server/services/telemetry/fleet_usages_schema.ts index fa7d2d769b900..6bfbf1c794b52 100644 --- a/x-pack/plugins/fleet/server/services/telemetry/fleet_usages_schema.ts +++ b/x-pack/plugins/fleet/server/services/telemetry/fleet_usages_schema.ts @@ -76,9 +76,10 @@ export const fleetAgentsSchema: RootSchema = { description: 'Output type used by agent', }, }, - presets_counts: { + preset_counts: { _meta: { description: 'Count of agents per preset', + optional: true, }, properties: { balanced: { @@ -117,6 +118,7 @@ export const fleetAgentsSchema: RootSchema = { type: 'keyword', _meta: { description: 'Output preset used by agent, if applicable', + optional: true, }, }, count_as_data: { @@ -133,6 +135,38 @@ export const fleetAgentsSchema: RootSchema = { }, }, }, + upgrade_details: { + _meta: { + description: 'Agent upgrade details telemetry', + optional: true, + }, + properties: { + target_version: { + type: 'keyword', + _meta: { + description: 'Target version of the agent upgrade', + }, + }, + state: { + type: 'keyword', + _meta: { + description: 'State of the agent upgrade', + }, + }, + error_msg: { + type: 'keyword', + _meta: { + description: 'Error message of the agent upgrade if failed', + }, + }, + agent_count: { + type: 'long', + _meta: { + description: 'How many agents have this upgrade details', + }, + }, + }, + }, }; export const fleetUsagesSchema: RootSchema = { diff --git a/x-pack/plugins/global_search_bar/public/plugin.tsx b/x-pack/plugins/global_search_bar/public/plugin.tsx index cf421202a4864..12f15036886c4 100644 --- a/x-pack/plugins/global_search_bar/public/plugin.tsx +++ b/x-pack/plugins/global_search_bar/public/plugin.tsx @@ -22,7 +22,7 @@ export interface GlobalSearchBarPluginStartDeps { usageCollection?: UsageCollectionSetup; } -export class GlobalSearchBarPlugin implements Plugin<{}, {}> { +export class GlobalSearchBarPlugin implements Plugin<{}, {}, {}, GlobalSearchBarPluginStartDeps> { public setup({ analytics }: CoreSetup) { eventTypes.forEach((eventType) => { analytics.registerEventType(eventType); diff --git a/x-pack/plugins/index_lifecycle_management/integration_tests/helpers/actions/toggle_phase_action.ts b/x-pack/plugins/index_lifecycle_management/integration_tests/helpers/actions/toggle_phase_action.ts index fc89332e47a67..7af36c2fb4f1d 100644 --- a/x-pack/plugins/index_lifecycle_management/integration_tests/helpers/actions/toggle_phase_action.ts +++ b/x-pack/plugins/index_lifecycle_management/integration_tests/helpers/actions/toggle_phase_action.ts @@ -27,7 +27,7 @@ const toggleDeletePhase = async (testBed: TestBed) => { if (action === 'disable') { button.simulate('click'); } else { - button.find('input').simulate('change'); + button.find('button').simulate('click'); } }); component.update(); diff --git a/x-pack/plugins/index_management/__jest__/client_integration/index_template_wizard/template_create.test.tsx b/x-pack/plugins/index_management/__jest__/client_integration/index_template_wizard/template_create.test.tsx index fd373efb6d17d..367437e5c5346 100644 --- a/x-pack/plugins/index_management/__jest__/client_integration/index_template_wizard/template_create.test.tsx +++ b/x-pack/plugins/index_management/__jest__/client_integration/index_template_wizard/template_create.test.tsx @@ -100,14 +100,10 @@ describe('', () => { httpRequestsMockHelpers.setLoadComponentTemplatesResponse(componentTemplates); httpRequestsMockHelpers.setLoadNodesPluginsResponse([]); - - // disable all react-beautiful-dnd development warnings - (window as any)['__@hello-pangea/dnd-disable-dev-warnings'] = true; }); afterAll(() => { jest.useRealTimers(); - (window as any)['__@hello-pangea/dnd-disable-dev-warnings'] = false; }); describe('composable index template', () => { @@ -533,11 +529,6 @@ describe('', () => { name: TEMPLATE_NAME, indexPatterns: DEFAULT_INDEX_PATTERNS, dataStream: {}, - lifecycle: { - enabled: true, - value: 1, - unit: 'd', - }, allowAutoCreate: true, }); // Component templates @@ -551,13 +542,14 @@ describe('', () => { }); it('should send the correct payload', async () => { - const { actions, find } = testBed; + const { component, actions, find } = testBed; expect(find('stepTitle').text()).toEqual(`Review details for '${TEMPLATE_NAME}'`); await act(async () => { actions.clickNextButton(); }); + component.update(); expect(httpSetup.post).toHaveBeenLastCalledWith( `${API_BASE_PATH}/index_templates`, @@ -589,10 +581,6 @@ describe('', () => { }, }, aliases: ALIASES, - lifecycle: { - enabled: true, - data_retention: '1d', - }, }, }), }) @@ -620,44 +608,59 @@ describe('', () => { }); }); - test('preview data stream', async () => { - await act(async () => { - testBed = await setup(httpSetup); - }); - testBed.component.update(); - - const { actions } = testBed; - // Logistics - await actions.completeStepOne({ - name: TEMPLATE_NAME, - indexPatterns: DEFAULT_INDEX_PATTERNS, - dataStream: {}, - lifecycle: { - enabled: true, - value: 1, - unit: 'd', - }, + describe('DSL', () => { + beforeEach(async () => { + await act(async () => { + testBed = await setup(httpSetup); + }); + testBed.component.update(); + + await testBed.actions.completeStepOne({ + name: TEMPLATE_NAME, + indexPatterns: DEFAULT_INDEX_PATTERNS, + dataStream: {}, + lifecycle: { + enabled: true, + value: 1, + unit: 'd', + }, + }); }); - await act(async () => { - await actions.previewTemplate(); + test('should include DSL in summary when set in step 1', async () => { + const { find, component } = testBed; + + await act(async () => { + testBed.find('formWizardStep-5').simulate('click'); + }); + component.update(); + + expect(find('lifecycleValue').text()).toContain('1 day'); }); - expect(httpSetup.post).toHaveBeenLastCalledWith( - `${API_BASE_PATH}/index_templates/simulate`, - expect.objectContaining({ - body: JSON.stringify({ - template: { - lifecycle: { - enabled: true, - data_retention: '1d', + test('preview data stream', async () => { + const { actions } = testBed; + + await act(async () => { + await actions.previewTemplate(); + }); + + expect(httpSetup.post).toHaveBeenLastCalledWith( + `${API_BASE_PATH}/index_templates/simulate`, + expect.objectContaining({ + body: JSON.stringify({ + template: { + lifecycle: { + enabled: true, + data_retention: '1d', + }, }, - }, - index_patterns: DEFAULT_INDEX_PATTERNS, - data_stream: {}, - allow_auto_create: false, - }), - }) - ); + index_patterns: DEFAULT_INDEX_PATTERNS, + data_stream: {}, + allow_auto_create: false, + }), + }) + ); + }); }); }); diff --git a/x-pack/plugins/index_management/__jest__/client_integration/index_template_wizard/template_form.helpers.ts b/x-pack/plugins/index_management/__jest__/client_integration/index_template_wizard/template_form.helpers.ts index 8b98fb769959f..88cee63b0e693 100644 --- a/x-pack/plugins/index_management/__jest__/client_integration/index_template_wizard/template_form.helpers.ts +++ b/x-pack/plugins/index_management/__jest__/client_integration/index_template_wizard/template_form.helpers.ts @@ -185,27 +185,24 @@ export const formSetup = async (initTestBed: SetupFunc) => { if (version) { form.setInputValue('versionField.input', JSON.stringify(version)); } + + if (allowAutoCreate) { + form.toggleEuiSwitch('allowAutoCreateField.input'); + } }); component.update(); if (lifecycle && lifecycle.enabled) { - act(() => { + await act(async () => { form.toggleEuiSwitch('dataRetentionToggle.input'); }); component.update(); - act(() => { - form.setInputValue('valueDataRetentionField', String(lifecycle.value)); - }); + form.setInputValue('valueDataRetentionField', String(lifecycle.value)); } await act(async () => { - if (allowAutoCreate) { - form.toggleEuiSwitch('allowAutoCreateField.input'); - } - clickNextButton(); - jest.advanceTimersByTime(0); }); component.update(); @@ -378,6 +375,8 @@ export type TestSubjects = | 'settingsEditor' | 'versionField.input' | 'valueDataRetentionField' + | 'formWizardStep-5' + | 'lifecycleValue' | 'mappingsEditor.formTab' | 'mappingsEditor.advancedConfiguration.sizeEnabledToggle' | 'previewIndexTemplate'; diff --git a/x-pack/plugins/index_management/public/application/sections/home/data_stream_list/data_stream_list.tsx b/x-pack/plugins/index_management/public/application/sections/home/data_stream_list/data_stream_list.tsx index 04a5a4a20f491..fa4efa61bf548 100644 --- a/x-pack/plugins/index_management/public/application/sections/home/data_stream_list/data_stream_list.tsx +++ b/x-pack/plugins/index_management/public/application/sections/home/data_stream_list/data_stream_list.tsx @@ -128,7 +128,7 @@ export const DataStreamList: React.FunctionComponent = ({ rule, alert }) => { const { services } = useKibanaContextForPlugin(); - const { dataViews, logsShared } = services; + const { + dataViews, + logsShared, + observabilityAIAssistant: { ObservabilityAIAssistantContextualInsight }, + } = services; const [dataView, setDataView] = useState(); const [esSearchQuery, setEsSearchQuery] = useState(); const [logRateAnalysisParams, setLogRateAnalysisParams] = useState< @@ -180,8 +179,6 @@ export const LogRateAnalysis: FC = ({ r ); }; - const aiAssistant = useObservabilityAIAssistant(); - const messages = useMemo(() => { const hasLogRateAnalysisParams = logRateAnalysisParams && logRateAnalysisParams.significantFieldValues?.length > 0; @@ -290,9 +287,12 @@ export const LogRateAnalysis: FC = ({ r
- {aiAssistant.isEnabled() && messages ? ( + {ObservabilityAIAssistantContextualInsight && messages ? ( - + ) : null} diff --git a/x-pack/plugins/infra/public/alerting/log_threshold/components/alert_details_app_section/index.tsx b/x-pack/plugins/infra/public/alerting/log_threshold/components/alert_details_app_section/index.tsx index e730767ee0d76..055039091e074 100644 --- a/x-pack/plugins/infra/public/alerting/log_threshold/components/alert_details_app_section/index.tsx +++ b/x-pack/plugins/infra/public/alerting/log_threshold/components/alert_details_app_section/index.tsx @@ -20,7 +20,6 @@ import { EuiTitle } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { getPaddedAlertTimeRange } from '@kbn/observability-get-padded-alert-time-range-util'; import { get, identity } from 'lodash'; -import { ObservabilityAIAssistantProvider } from '@kbn/observability-ai-assistant-plugin/public'; import { useLogView } from '@kbn/logs-shared-plugin/public'; import { useKibanaContextForPlugin } from '../../../../hooks/use_kibana'; import { @@ -44,10 +43,7 @@ const AlertDetailsAppSection = ({ alert, setAlertSummaryFields, }: AlertDetailsAppSectionProps) => { - const { - logsShared, - observabilityAIAssistant: { service: observabilityAIAssistantService }, - } = useKibanaContextForPlugin().services; + const { logsShared } = useKibanaContextForPlugin().services; const theme = useTheme(); const timeRange = getPaddedAlertTimeRange(alert.fields[ALERT_START]!, alert.fields[ALERT_END]); const alertEnd = alert.fields[ALERT_END] ? moment(alert.fields[ALERT_END]).valueOf() : undefined; @@ -245,14 +241,12 @@ const AlertDetailsAppSection = ({ }; return ( - - - {getLogRatioChart()} - {getLogCountChart()} - {getLogRateAnalysisSection()} - {getLogsHistoryChart()} - - + + {getLogRatioChart()} + {getLogCountChart()} + {getLogRateAnalysisSection()} + {getLogsHistoryChart()} + ); }; diff --git a/x-pack/plugins/infra/public/apps/common_providers.tsx b/x-pack/plugins/infra/public/apps/common_providers.tsx index 67c13bad48c96..158e0b95293e9 100644 --- a/x-pack/plugins/infra/public/apps/common_providers.tsx +++ b/x-pack/plugins/infra/public/apps/common_providers.tsx @@ -9,10 +9,7 @@ import { AppMountParameters, CoreStart } from '@kbn/core/public'; import React from 'react'; import { EuiThemeProvider } from '@kbn/kibana-react-plugin/common'; import { KibanaContextProvider, KibanaThemeProvider } from '@kbn/kibana-react-plugin/public'; -import { - ObservabilityAIAssistantProvider, - ObservabilityAIAssistantPluginStart, -} from '@kbn/observability-ai-assistant-plugin/public'; +import type { ObservabilityAIAssistantPluginStart } from '@kbn/observability-ai-assistant-plugin/public'; import { Storage } from '@kbn/kibana-utils-plugin/public'; import { NavigationWarningPromptProvider } from '@kbn/observability-shared-plugin/public'; import { TriggersAndActionsUIPublicPluginStart } from '@kbn/triggers-actions-ui-plugin/public'; @@ -44,11 +41,9 @@ export const CommonInfraProviders: React.FC<{ - - - {children} - - + + {children} + diff --git a/x-pack/plugins/infra/public/components/asset_details/__stories__/decorator.tsx b/x-pack/plugins/infra/public/components/asset_details/__stories__/decorator.tsx index a0f2a34df8f36..58eb37f58de71 100644 --- a/x-pack/plugins/infra/public/components/asset_details/__stories__/decorator.tsx +++ b/x-pack/plugins/infra/public/components/asset_details/__stories__/decorator.tsx @@ -28,8 +28,6 @@ import type { AlertSummaryWidgetProps } from '@kbn/triggers-actions-ui-plugin/pu import { defaultLogViewAttributes } from '@kbn/logs-shared-plugin/common'; import { DataView, DataViewField } from '@kbn/data-views-plugin/common'; import { MemoryRouter } from 'react-router-dom'; -import { ObservabilityAIAssistantProvider } from '@kbn/observability-ai-assistant-plugin/public'; -import { ObservabilityAIAssistantService } from '@kbn/observability-ai-assistant-plugin/public/types'; import { PluginConfigProvider } from '../../../containers/plugin_config_context'; import type { PluginKibanaContextValue } from '../../../hooks/use_kibana'; import { SourceProvider } from '../../../containers/metrics_source'; @@ -198,20 +196,7 @@ export const DecorateWithKibanaContext: DecoratorFn = (story) => { - true, - callApi: () => {}, - getCurrentUser: () => {}, - getLicense: () => {}, - getLicenseManagementLocator: () => {}, - start: {}, - } as unknown as ObservabilityAIAssistantService - } - > - {story()} - + {story()} diff --git a/x-pack/plugins/infra/public/components/asset_details/tabs/processes/process_row.tsx b/x-pack/plugins/infra/public/components/asset_details/tabs/processes/process_row.tsx index a874e071e6c23..c6f98c6d1422c 100644 --- a/x-pack/plugins/infra/public/components/asset_details/tabs/processes/process_row.tsx +++ b/x-pack/plugins/infra/public/components/asset_details/tabs/processes/process_row.tsx @@ -23,12 +23,8 @@ import { } from '@elastic/eui'; import { euiStyled } from '@kbn/kibana-react-plugin/common'; import useToggle from 'react-use/lib/useToggle'; -import { - useObservabilityAIAssistant, - type Message, - MessageRole, - ContextualInsight, -} from '@kbn/observability-ai-assistant-plugin/public'; +import { type Message, MessageRole } from '@kbn/observability-ai-assistant-plugin/public'; +import { useKibanaContextForPlugin } from '../../../../hooks/use_kibana'; import { Process } from './types'; import { ProcessRowCharts } from './process_row_charts'; @@ -38,7 +34,10 @@ interface Props { supportAIAssistant?: boolean; } export const ContextualInsightProcessRow = ({ command }: { command: string }) => { - const aiAssistant = useObservabilityAIAssistant(); + const { + observabilityAIAssistant: { ObservabilityAIAssistantContextualInsight }, + } = useKibanaContextForPlugin().services; + const explainProcessMessages = useMemo(() => { if (!command) { return undefined; @@ -98,11 +97,11 @@ export const ContextualInsightProcessRow = ({ command }: { command: string }) => }, [command]); return ( <> - {aiAssistant.isEnabled() && explainProcessMessages ? ( + {ObservabilityAIAssistantContextualInsight && explainProcessMessages ? ( - diff --git a/x-pack/plugins/infra/public/pages/logs/page_content.tsx b/x-pack/plugins/infra/public/pages/logs/page_content.tsx index ca6c281a47309..39868c74797d4 100644 --- a/x-pack/plugins/infra/public/pages/logs/page_content.tsx +++ b/x-pack/plugins/infra/public/pages/logs/page_content.tsx @@ -11,9 +11,9 @@ import React, { useContext } from 'react'; import { Routes, Route } from '@kbn/shared-ux-router'; import { useKibana } from '@kbn/kibana-react-plugin/public'; import { HeaderMenuPortal, useLinkProps } from '@kbn/observability-shared-plugin/public'; -import { ObservabilityAIAssistantActionMenuItem } from '@kbn/observability-ai-assistant-plugin/public'; import { LazyAlertDropdownWrapper } from '../../alerting/log_threshold'; import { HelpCenterContent } from '../../components/help_center_content'; +import { useKibanaContextForPlugin } from '../../hooks/use_kibana'; import { useReadOnlyBadge } from '../../hooks/use_readonly_badge'; import { HeaderActionMenuContext } from '../../utils/header_action_menu_provider'; import { RedirectWithQueryParams } from '../../utils/redirect_with_query_params'; @@ -26,11 +26,15 @@ import { StateMachinePlayground } from '../../observability_logs/xstate_helpers' import { NotFoundPage } from '../404'; export const LogsPageContent: React.FunctionComponent = () => { - const enableDeveloperRoutes = isDevMode(); const uiCapabilities = useKibana().services.application?.capabilities; const { setHeaderActionMenu, theme$ } = useContext(HeaderActionMenuContext); - const kibana = useKibana(); + const { + application: { getUrlForApp }, + observabilityAIAssistant: { ObservabilityAIAssistantActionMenuItem }, + } = useKibanaContextForPlugin().services; + + const enableDeveloperRoutes = isDevMode(); useReadOnlyBadge(!uiCapabilities?.logs?.save); @@ -76,13 +80,15 @@ export const LogsPageContent: React.FunctionComponent = () => { {ADD_DATA_LABEL} - + {ObservabilityAIAssistantActionMenuItem ? ( + + ) : null} )} diff --git a/x-pack/plugins/infra/public/pages/metrics/hosts/hooks/use_host_count.ts b/x-pack/plugins/infra/public/pages/metrics/hosts/hooks/use_host_count.ts index d261b4ec2e45d..134e651ed7a64 100644 --- a/x-pack/plugins/infra/public/pages/metrics/hosts/hooks/use_host_count.ts +++ b/x-pack/plugins/infra/public/pages/metrics/hosts/hooks/use_host_count.ts @@ -7,10 +7,11 @@ import * as rt from 'io-ts'; import { ES_SEARCH_STRATEGY, IKibanaSearchResponse } from '@kbn/data-plugin/common'; -import { useCallback, useEffect } from 'react'; -import { catchError, map, Observable, of, startWith } from 'rxjs'; +import { useCallback, useEffect, useMemo } from 'react'; +import { catchError, map, Observable, of, startWith, tap } from 'rxjs'; import createContainer from 'constate'; import type { QueryDslQueryContainer, SearchResponse } from '@elastic/elasticsearch/lib/api/types'; +import type { ITelemetryClient } from '../../../../services/telemetry'; import { useKibanaContextForPlugin } from '../../../../hooks/use_kibana'; import { decodeOrThrow } from '../../../../../common/runtime_types'; import { useDataSearch, useLatestPartialDataSearchResponse } from '../../../../utils/data_search'; @@ -79,7 +80,23 @@ export const useHostCount = () => { searchCriteria.dateRange.from, searchCriteria.dateRange.to, ]), - parseResponses: normalizeDataSearchResponse, + parseResponses: useMemo( + () => + normalizeDataSearchResponse({ + telemetry, + telemetryData: { + withQuery: !!searchCriteria.query.query, + withFilters: + searchCriteria.filters.length > 0 || searchCriteria.panelFilters.length > 0, + }, + }), + [ + searchCriteria.filters.length, + searchCriteria.panelFilters.length, + searchCriteria.query.query, + telemetry, + ] + ), }); const { isRequestRunning, isResponsePartial, latestResponseData, latestResponseErrors } = @@ -89,14 +106,6 @@ export const useHostCount = () => { fetchHostCount(); }, [fetchHostCount]); - useEffect(() => { - if (latestResponseData) { - telemetry.reportHostsViewTotalHostCountRetrieved({ - total: latestResponseData.count.value, - }); - } - }, [latestResponseData, telemetry]); - return { errors: latestResponseErrors, isRequestRunning, @@ -116,27 +125,42 @@ const INITIAL_STATE = { loaded: 0, total: undefined, }; -const normalizeDataSearchResponse = ( - response$: Observable>>> -) => - response$.pipe( - map((response) => ({ - data: decodeOrThrow(HostCountResponseRT)(response.rawResponse.aggregations), - errors: [], - isPartial: response.isPartial ?? false, - isRunning: response.isRunning ?? false, - loaded: response.loaded, - total: response.total, - })), - startWith(INITIAL_STATE), - catchError((error) => - of({ - ...INITIAL_STATE, - errors: [error.message ?? error], - isRunning: false, - }) - ) - ); + +const normalizeDataSearchResponse = + ({ + telemetry, + telemetryData, + }: { + telemetry: ITelemetryClient; + telemetryData: { withQuery: boolean; withFilters: boolean }; + }) => + (response$: Observable>>>) => { + return response$.pipe( + map((response) => ({ + data: decodeOrThrow(HostCountResponseRT)(response.rawResponse.aggregations), + errors: [], + isPartial: response.isPartial ?? false, + isRunning: response.isRunning ?? false, + loaded: response.loaded, + total: response.total, + })), + tap(({ data }) => { + telemetry.reportHostsViewTotalHostCountRetrieved({ + total: data.count.value, + with_query: telemetryData.withQuery, + with_filters: telemetryData.withFilters, + }); + }), + startWith(INITIAL_STATE), + catchError((error) => + of({ + ...INITIAL_STATE, + errors: [error.message ?? error], + isRunning: false, + }) + ) + ); + }; const HostCountResponseRT = rt.type({ count: rt.type({ diff --git a/x-pack/plugins/infra/public/pages/metrics/index.tsx b/x-pack/plugins/infra/public/pages/metrics/index.tsx index 46f2f1c124767..e617edcebf965 100644 --- a/x-pack/plugins/infra/public/pages/metrics/index.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/index.tsx @@ -13,8 +13,8 @@ import { Routes, Route } from '@kbn/shared-ux-router'; import { EuiErrorBoundary, EuiHeaderLinks, EuiHeaderLink } from '@elastic/eui'; import { useKibana, useUiSetting } from '@kbn/kibana-react-plugin/public'; import { HeaderMenuPortal, useLinkProps } from '@kbn/observability-shared-plugin/public'; -import { ObservabilityAIAssistantActionMenuItem } from '@kbn/observability-ai-assistant-plugin/public'; import { enableInfrastructureHostsView } from '@kbn/observability-plugin/common'; +import { useKibanaContextForPlugin } from '../../hooks/use_kibana'; import { MetricsSourceConfigurationProperties } from '../../../common/metrics_sources'; import { HelpCenterContent } from '../../components/help_center_content'; import { useReadOnlyBadge } from '../../hooks/use_readonly_badge'; @@ -44,6 +44,9 @@ const ADD_DATA_LABEL = i18n.translate('xpack.infra.metricsHeaderAddDataButtonLab }); export const InfrastructurePage = () => { + const { + observabilityAIAssistant: { ObservabilityAIAssistantActionMenuItem }, + } = useKibanaContextForPlugin().services; const config = usePluginConfig(); const uiCapabilities = useKibana().services.application?.capabilities; const { setHeaderActionMenu, theme$ } = useContext(HeaderActionMenuContext); @@ -95,7 +98,9 @@ export const InfrastructurePage = () => { > {ADD_DATA_LABEL} - + {ObservabilityAIAssistantActionMenuItem ? ( + + ) : null} )} diff --git a/x-pack/plugins/infra/public/services/telemetry/telemetry_events.ts b/x-pack/plugins/infra/public/services/telemetry/telemetry_events.ts index 6ce2d2b827623..b83cbfe262e63 100644 --- a/x-pack/plugins/infra/public/services/telemetry/telemetry_events.ts +++ b/x-pack/plugins/infra/public/services/telemetry/telemetry_events.ts @@ -109,6 +109,20 @@ const hostViewTotalHostCountRetrieved: InfraTelemetryEvent = { optional: false, }, }, + with_query: { + type: 'boolean', + _meta: { + description: 'Has KQL query', + optional: false, + }, + }, + with_filters: { + type: 'boolean', + _meta: { + description: 'Has filters', + optional: false, + }, + }, }, }; diff --git a/x-pack/plugins/infra/public/services/telemetry/telemetry_service.test.ts b/x-pack/plugins/infra/public/services/telemetry/telemetry_service.test.ts index ac450df7dd162..3fa8a9b447111 100644 --- a/x-pack/plugins/infra/public/services/telemetry/telemetry_service.test.ts +++ b/x-pack/plugins/infra/public/services/telemetry/telemetry_service.test.ts @@ -172,6 +172,8 @@ describe('TelemetryService', () => { telemetry.reportHostsViewTotalHostCountRetrieved({ total: 300, + with_filters: true, + with_query: false, }); expect(setupParams.analytics.reportEvent).toHaveBeenCalledTimes(1); @@ -179,6 +181,8 @@ describe('TelemetryService', () => { InfraTelemetryEventTypes.HOST_VIEW_TOTAL_HOST_COUNT_RETRIEVED, { total: 300, + with_filters: true, + with_query: false, } ); }); diff --git a/x-pack/plugins/infra/public/services/telemetry/types.ts b/x-pack/plugins/infra/public/services/telemetry/types.ts index 3b1665078ee3a..769cc303def50 100644 --- a/x-pack/plugins/infra/public/services/telemetry/types.ts +++ b/x-pack/plugins/infra/public/services/telemetry/types.ts @@ -41,6 +41,8 @@ export interface HostFlyoutFilterActionParams { export interface HostsViewQueryHostsCountRetrievedParams { total: number; + with_query: boolean; + with_filters: boolean; } export interface AssetDetailsFlyoutViewedParams { diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/test_pipeline.test.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/test_pipeline.test.tsx index 9102d2b5e307f..3698d07018c71 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/test_pipeline.test.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/test_pipeline.test.tsx @@ -377,7 +377,9 @@ describe('Test pipeline', () => { // Click the "Configuration" tab await actions.clickProcessorConfigurationTab(); // Verify type selector has not changed - expect(find('processorTypeSelector.input').text()).toBe('Set'); + expect(find('processorTypeSelector.input').find('[role="combobox"]').props().value).toBe( + 'Set' + ); }); }); diff --git a/x-pack/plugins/kubernetes_security/public/components/tree_view_container/tree_nav/index.test.tsx b/x-pack/plugins/kubernetes_security/public/components/tree_view_container/tree_nav/index.test.tsx index 554f34325016f..155f4236f8107 100644 --- a/x-pack/plugins/kubernetes_security/public/components/tree_view_container/tree_nav/index.test.tsx +++ b/x-pack/plugins/kubernetes_security/public/components/tree_view_container/tree_nav/index.test.tsx @@ -40,24 +40,26 @@ describe('TreeNav component', () => { it('mount with Logical View selected by default', async () => { renderResult = mockedContext.render(); - const elemLabel = await renderResult.getByDisplayValue(/logical/i); - expect(elemLabel).toBeChecked(); + const elemLabel = await renderResult.getByTestId('treeNavType_generated-idlogical'); + expect(elemLabel).toHaveAttribute('aria-pressed', 'true'); }); it('shows the tree path according with the selected view type', async () => { renderResult = mockedContext.render(); const logicalViewPath = 'cluster / namespace / pod / container image'; - const logicViewRadio = await renderResult.getByDisplayValue(/logical/i); - expect(logicViewRadio).toBeChecked(); + const logicViewButton = renderResult.getByTestId('treeNavType_generated-idlogical'); + expect(logicViewButton).toHaveAttribute('aria-pressed', 'true'); expect(renderResult.getByText(logicalViewPath)).toBeInTheDocument(); - const infraStructureViewRadio = await renderResult.getByDisplayValue(/infrastructure/i); + const infraStructureViewRadio = renderResult.getByTestId( + 'treeNavType_generated-idinfrastructure' + ); infraStructureViewRadio.click(); expect(renderResult.getByText('cluster / node / pod / container image')).toBeInTheDocument(); - logicViewRadio.click(); + logicViewButton.click(); expect(renderResult.getByText(logicalViewPath)).toBeInTheDocument(); }); diff --git a/x-pack/plugins/lens/public/app_plugin/shared/edit_on_the_fly/lens_configuration_flyout.tsx b/x-pack/plugins/lens/public/app_plugin/shared/edit_on_the_fly/lens_configuration_flyout.tsx index a5de3e7ef8052..4c361f37029c6 100644 --- a/x-pack/plugins/lens/public/app_plugin/shared/edit_on_the_fly/lens_configuration_flyout.tsx +++ b/x-pack/plugins/lens/public/app_plugin/shared/edit_on_the_fly/lens_configuration_flyout.tsx @@ -72,11 +72,13 @@ export function LensEditConfigurationFlyout({ const [isLayerAccordionOpen, setIsLayerAccordionOpen] = useState(true); const [isSuggestionsAccordionOpen, setIsSuggestionsAccordionOpen] = useState(false); const datasourceState = attributes.state.datasourceStates[datasourceId]; - const activeVisualization = visualizationMap[attributes.visualizationType]; const activeDatasource = datasourceMap[datasourceId]; const { datasourceStates, visualization, isLoading, annotationGroups } = useLensSelector( (state) => state.lens ); + // use the latest activeId, but fallback to attributes + const activeVisualization = + visualizationMap[visualization.activeId ?? attributes.visualizationType]; const framePublicAPI = useLensSelector((state) => selectFramePublicAPI(state, datasourceMap)); const suggestsLimitedColumns = activeDatasource?.suggestsLimitedColumns?.(datasourceState); diff --git a/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/filters/filter_popover.tsx b/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/filters/filter_popover.tsx index 4e3fe6336be9e..35327fb91b678 100644 --- a/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/filters/filter_popover.tsx +++ b/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/filters/filter_popover.tsx @@ -53,7 +53,6 @@ export const FilterPopover = ({ return ( selectFramePublicAPI(state, datasourceMap)); const changesApplied = useLensSelector(selectChangesApplied); // get user's selection from localStorage, this key defines if the suggestions panel will be hidden or not - const initialAccordionStatusValue = - typeof isAccordionOpen !== 'undefined' ? !Boolean(isAccordionOpen) : false; + const initialAccordionStatusValue = isAccordionOpen != null ? !Boolean(isAccordionOpen) : false; const [hideSuggestions, setHideSuggestions] = useLocalStorage( LOCAL_STORAGE_SUGGESTIONS_PANEL, initialAccordionStatusValue ); useEffect(() => { - if (typeof isAccordionOpen !== 'undefined') { + if (isAccordionOpen != null) { setHideSuggestions(!Boolean(isAccordionOpen)); } }, [isAccordionOpen, setHideSuggestions]); diff --git a/x-pack/plugins/lens/public/visualizations/metric/dimension_editor.test.tsx b/x-pack/plugins/lens/public/visualizations/metric/dimension_editor.test.tsx index 9fc42f01a9302..429a681027e63 100644 --- a/x-pack/plugins/lens/public/visualizations/metric/dimension_editor.test.tsx +++ b/x-pack/plugins/lens/public/visualizations/metric/dimension_editor.test.tsx @@ -245,9 +245,9 @@ describe('dimension editor', () => { userEvent.type(customPrefixTextbox, prefix); }; return { - settingNone: screen.getByLabelText(/none/i), - settingAuto: screen.getByLabelText(/auto/i), - settingCustom: screen.getByLabelText(/custom/i), + settingNone: screen.getByTitle(/none/i), + settingAuto: screen.getByTitle(/auto/i), + settingCustom: screen.getByTitle(/custom/i), customPrefixTextbox, typePrefix, ...rtlRender, @@ -276,9 +276,9 @@ describe('dimension editor', () => { state: localState, }); - expect(settingAuto).toBeChecked(); - expect(settingNone).not.toBeChecked(); - expect(settingCustom).not.toBeChecked(); + expect(settingAuto).toHaveAttribute('aria-pressed', 'true'); + expect(settingNone).toHaveAttribute('aria-pressed', 'false'); + expect(settingCustom).toHaveAttribute('aria-pressed', 'false'); expect(customPrefixTextbox).not.toBeInTheDocument(); }); @@ -286,9 +286,9 @@ describe('dimension editor', () => { const { settingAuto, settingCustom, settingNone, customPrefixTextbox } = renderSecondaryMetricEditor({ state: { ...localState, secondaryPrefix: NONE_PREFIX } }); - expect(settingNone).toBeChecked(); - expect(settingAuto).not.toBeChecked(); - expect(settingCustom).not.toBeChecked(); + expect(settingNone).toHaveAttribute('aria-pressed', 'true'); + expect(settingAuto).toHaveAttribute('aria-pressed', 'false'); + expect(settingCustom).toHaveAttribute('aria-pressed', 'false'); expect(customPrefixTextbox).not.toBeInTheDocument(); }); @@ -297,9 +297,9 @@ describe('dimension editor', () => { const { settingAuto, settingCustom, settingNone, customPrefixTextbox } = renderSecondaryMetricEditor({ state: customPrefixState }); - expect(settingAuto).not.toBeChecked(); - expect(settingNone).not.toBeChecked(); - expect(settingCustom).toBeChecked(); + expect(settingAuto).toHaveAttribute('aria-pressed', 'false'); + expect(settingNone).toHaveAttribute('aria-pressed', 'false'); + expect(settingCustom).toHaveAttribute('aria-pressed', 'true'); expect(customPrefixTextbox).toHaveValue(customPrefixState.secondaryPrefix); }); @@ -454,11 +454,10 @@ describe('dimension editor', () => { ); const supportingVisOptions = { - none: screen.queryByLabelText(/none/i), + none: screen.queryByTitle(/none/i), // in eui when bar or line become disabled they change from input to button so we have to do this weird check - bar: screen.queryByLabelText(/bar/i) || screen.queryByRole('button', { name: /bar/i }), - trendline: - screen.queryByLabelText(/line/i) || screen.queryByRole('button', { name: /line/i }), + bar: screen.queryByTitle(/bar/i) || screen.queryByRole('button', { name: /bar/i }), + trendline: screen.queryByTitle(/line/i) || screen.queryByRole('button', { name: /line/i }), }; const clickOnSupportingVis = (type: SupportingVisType) => { @@ -472,8 +471,8 @@ describe('dimension editor', () => { return { progressDirectionShowing: screen.queryByTestId('lnsMetric_progress_direction_buttons'), progressOptions: { - vertical: screen.queryByLabelText(/vertical/i), - horizontal: screen.queryByLabelText(/horizontal/i), + vertical: screen.queryByTitle(/vertical/i), + horizontal: screen.queryByTitle(/horizontal/i), }, supportingVisOptions, clickOnSupportingVis, @@ -501,21 +500,21 @@ describe('dimension editor', () => { const { supportingVisOptions } = renderAdditionalSectionEditor({ state: { ...stateWOTrend, showBar: false, maxAccessor: undefined }, }); - expect(supportingVisOptions.none).toBeChecked(); + expect(supportingVisOptions.none).toHaveAttribute('aria-pressed', 'true'); }); it('when `showBar` is true and maximum value is not defined, bar should be selected', () => { const { supportingVisOptions } = renderAdditionalSectionEditor({ state: { ...stateWOTrend, showBar: true }, }); - expect(supportingVisOptions.bar).toBeChecked(); + expect(supportingVisOptions.bar).toHaveAttribute('aria-pressed', 'true'); }); it('when `showBar` is true and trendline is defined, line should be selected', () => { const { supportingVisOptions } = renderAdditionalSectionEditor({ state: metricAccessorState, }); - expect(supportingVisOptions.trendline).toBeChecked(); + expect(supportingVisOptions.trendline).toHaveAttribute('aria-pressed', 'true'); }); it('should enable bar when max dimension exists', () => { @@ -633,10 +632,10 @@ describe('dimension editor', () => { state: metricAccessorState, }); - expect(progressOptions.vertical).toBeChecked(); - expect(progressOptions.horizontal).not.toBeChecked(); + expect(progressOptions.vertical).toHaveAttribute('aria-pressed', 'true'); + expect(progressOptions.horizontal).toHaveAttribute('aria-pressed', 'false'); if (progressOptions.horizontal === null) { - throw new Error('horizontal radio button not found'); + throw new Error('horizontal button not found'); } userEvent.click(progressOptions.horizontal); diff --git a/x-pack/plugins/lists/public/exceptions/components/builder/entry_renderer.test.tsx b/x-pack/plugins/lists/public/exceptions/components/builder/entry_renderer.test.tsx index 5c2bfb9045688..f6b8bff8c09ab 100644 --- a/x-pack/plugins/lists/public/exceptions/components/builder/entry_renderer.test.tsx +++ b/x-pack/plugins/lists/public/exceptions/components/builder/entry_renderer.test.tsx @@ -264,11 +264,15 @@ describe('BuilderEntryItem', () => { /> ); - expect(wrapper.find('[data-test-subj="exceptionBuilderEntryField"]').text()).toEqual('ip'); - expect(wrapper.find('[data-test-subj="exceptionBuilderEntryOperator"]').text()).toEqual('is'); - expect(wrapper.find('[data-test-subj="exceptionBuilderEntryFieldMatch"]').text()).toEqual( - '1234' - ); + expect( + wrapper.find('[data-test-subj="exceptionBuilderEntryField"] input').props().value + ).toEqual('ip'); + expect( + wrapper.find('[data-test-subj="operatorAutocompleteComboBox"] input').props().value + ).toEqual('is'); + expect( + wrapper.find('[data-test-subj="valuesAutocompleteMatchLabel"] input').props().value + ).toEqual('1234'); }); test('it renders field values correctly when operator is "isNotOperator"', () => { @@ -299,13 +303,15 @@ describe('BuilderEntryItem', () => { /> ); - expect(wrapper.find('[data-test-subj="exceptionBuilderEntryField"]').text()).toEqual('ip'); - expect(wrapper.find('[data-test-subj="exceptionBuilderEntryOperator"]').text()).toEqual( - 'is not' - ); - expect(wrapper.find('[data-test-subj="exceptionBuilderEntryFieldMatch"]').text()).toEqual( - '1234' - ); + expect( + wrapper.find('[data-test-subj="exceptionBuilderEntryField"] input').props().value + ).toEqual('ip'); + expect( + wrapper.find('[data-test-subj="operatorAutocompleteComboBox"] input').props().value + ).toEqual('is not'); + expect( + wrapper.find('[data-test-subj="valuesAutocompleteMatchLabel"] input').props().value + ).toEqual('1234'); }); test('it renders field values correctly when operator is "isOneOfOperator"', () => { @@ -336,11 +342,13 @@ describe('BuilderEntryItem', () => { /> ); - expect(wrapper.find('[data-test-subj="exceptionBuilderEntryField"]').text()).toEqual('ip'); - expect(wrapper.find('[data-test-subj="exceptionBuilderEntryOperator"]').text()).toEqual( - 'is one of' - ); - expect(wrapper.find('[data-test-subj="exceptionBuilderEntryFieldMatchAny"]').text()).toEqual( + expect( + wrapper.find('[data-test-subj="exceptionBuilderEntryField"] input').props().value + ).toEqual('ip'); + expect( + wrapper.find('[data-test-subj="operatorAutocompleteComboBox"] input').props().value + ).toEqual('is one of'); + expect(wrapper.find('[data-test-subj="valuesAutocompleteMatchAny"]').first().text()).toEqual( '1234' ); }); @@ -373,10 +381,12 @@ describe('BuilderEntryItem', () => { /> ); - expect(wrapper.find('[data-test-subj="exceptionBuilderEntryField"]').text()).toEqual('ip'); - expect(wrapper.find('[data-test-subj="exceptionBuilderEntryOperator"]').text()).toEqual( - 'is not one of' - ); + expect( + wrapper.find('[data-test-subj="exceptionBuilderEntryField"] input').props().value + ).toEqual('ip'); + expect( + wrapper.find('[data-test-subj="operatorAutocompleteComboBox"] input').props().value + ).toEqual('is not one of'); expect(wrapper.find('[data-test-subj="exceptionBuilderEntryFieldMatchAny"]').text()).toEqual( '1234' ); @@ -411,12 +421,15 @@ describe('BuilderEntryItem', () => { /> ); - expect(wrapper.find('[data-test-subj="exceptionBuilderEntryField"]').text()).toEqual('ip'); - expect(wrapper.find('[data-test-subj="exceptionBuilderEntryOperator"]').text()).toEqual( - 'is in list' - ); expect( - wrapper.find('[data-test-subj="valuesAutocompleteComboBox listsComboxBox"]').at(1).text() + wrapper.find('[data-test-subj="exceptionBuilderEntryField"] input').props().value + ).toEqual('ip'); + expect( + wrapper.find('[data-test-subj="operatorAutocompleteComboBox"] input').props().value + ).toEqual('is in list'); + expect( + wrapper.find('[data-test-subj="valuesAutocompleteComboBox listsComboxBox"] input').props() + .value ).toEqual('some name'); }); @@ -449,12 +462,15 @@ describe('BuilderEntryItem', () => { /> ); - expect(wrapper.find('[data-test-subj="exceptionBuilderEntryField"]').text()).toEqual('ip'); - expect(wrapper.find('[data-test-subj="exceptionBuilderEntryOperator"]').text()).toEqual( - 'is not in list' - ); expect( - wrapper.find('[data-test-subj="valuesAutocompleteComboBox listsComboxBox"]').at(1).text() + wrapper.find('[data-test-subj="exceptionBuilderEntryField"] input').props().value + ).toEqual('ip'); + expect( + wrapper.find('[data-test-subj="operatorAutocompleteComboBox"] input').props().value + ).toEqual('is not in list'); + expect( + wrapper.find('[data-test-subj="valuesAutocompleteComboBox listsComboxBox"] input').props() + .value ).toEqual('some name'); }); @@ -486,11 +502,16 @@ describe('BuilderEntryItem', () => { /> ); - expect(wrapper.find('[data-test-subj="exceptionBuilderEntryField"]').text()).toEqual('ip'); - expect(wrapper.find('[data-test-subj="exceptionBuilderEntryOperator"]').text()).toEqual( - 'exists' - ); - expect(wrapper.find('[data-test-subj="exceptionBuilderEntryFieldExists"]').text()).toEqual('—'); + expect( + wrapper.find('[data-test-subj="exceptionBuilderEntryField"] input').props().value + ).toEqual('ip'); + expect( + wrapper.find('[data-test-subj="exceptionBuilderEntryOperator"] input').props().value + ).toEqual('exists'); + expect( + wrapper.find('[data-test-subj="valuesAutocompleteComboBox existsComboxBox"] input').props() + .placeholder + ).toEqual('—'); expect( wrapper.find('[data-test-subj="exceptionBuilderEntryFieldExists"] input').props().disabled ).toBeTruthy(); @@ -524,11 +545,16 @@ describe('BuilderEntryItem', () => { /> ); - expect(wrapper.find('[data-test-subj="exceptionBuilderEntryField"]').text()).toEqual('ip'); - expect(wrapper.find('[data-test-subj="exceptionBuilderEntryOperator"]').text()).toEqual( - 'does not exist' - ); - expect(wrapper.find('[data-test-subj="exceptionBuilderEntryFieldExists"]').text()).toEqual('—'); + expect( + wrapper.find('[data-test-subj="exceptionBuilderEntryField"] input').props().value + ).toEqual('ip'); + expect( + wrapper.find('[data-test-subj="exceptionBuilderEntryOperator"] input').props().value + ).toEqual('does not exist'); + expect( + wrapper.find('[data-test-subj="valuesAutocompleteComboBox existsComboxBox"] input').props() + .placeholder + ).toEqual('—'); expect( wrapper.find('[data-test-subj="exceptionBuilderEntryFieldExists"] input').props().disabled ).toBeTruthy(); @@ -562,13 +588,15 @@ describe('BuilderEntryItem', () => { /> ); - expect(wrapper.find('[data-test-subj="exceptionBuilderEntryField"]').text()).toEqual('@tags'); - expect(wrapper.find('[data-test-subj="exceptionBuilderEntryOperator"]').text()).toEqual( - 'matches' - ); - expect(wrapper.find('[data-test-subj="exceptionBuilderEntryFieldWildcard"]').text()).toEqual( - '1234*' - ); + expect( + wrapper.find('[data-test-subj="exceptionBuilderEntryField"] input').props().value + ).toEqual('@tags'); + expect( + wrapper.find('[data-test-subj="exceptionBuilderEntryOperator"] input').props().value + ).toEqual('matches'); + expect( + wrapper.find('[data-test-subj="valuesAutocompleteWildcard"] input').props().value + ).toEqual('1234*'); // doesnt show warning label for non endpoint exception items expect( wrapper.find('[data-test-subj="valuesAutocompleteWildcardLabel"] .euiFormHelpText') @@ -637,13 +665,15 @@ describe('BuilderEntryItem', () => { /> ); - expect(wrapper.find('[data-test-subj="exceptionBuilderEntryField"]').text()).toEqual('@tags'); - expect(wrapper.find('[data-test-subj="exceptionBuilderEntryOperator"]').text()).toEqual( - 'does not match' - ); - expect(wrapper.find('[data-test-subj="exceptionBuilderEntryFieldWildcard"]').text()).toEqual( - '1234*' - ); + expect( + wrapper.find('[data-test-subj="exceptionBuilderEntryField"] input').props().value + ).toEqual('@tags'); + expect( + wrapper.find('[data-test-subj="exceptionBuilderEntryOperator"] input').props().value + ).toEqual('does not match'); + expect( + wrapper.find('[data-test-subj="valuesAutocompleteWildcard"] input').props().value + ).toEqual('1234*'); }); test('it uses "correspondingKeywordField" if it exists', () => { diff --git a/x-pack/plugins/lists/public/exceptions/components/builder/exception_items_renderer.test.tsx b/x-pack/plugins/lists/public/exceptions/components/builder/exception_items_renderer.test.tsx index 37262749ce55a..2bb1ebc275b08 100644 --- a/x-pack/plugins/lists/public/exceptions/components/builder/exception_items_renderer.test.tsx +++ b/x-pack/plugins/lists/public/exceptions/components/builder/exception_items_renderer.test.tsx @@ -58,18 +58,20 @@ describe('ExceptionBuilderComponent', () => { ); + // console.log(wrapper.find('[data-test-subj="valuesAutocompleteMatch"] input').html()); + expect(wrapper.find('EuiFlexGroup[data-test-subj="exceptionItemEntryContainer"]')).toHaveLength( 1 ); - expect(wrapper.find('[data-test-subj="exceptionBuilderEntryField"]').at(0).text()).toEqual( - 'Search' - ); - expect(wrapper.find('[data-test-subj="operatorAutocompleteComboBox"]').at(0).text()).toEqual( - 'is' - ); - expect(wrapper.find('[data-test-subj="valuesAutocompleteMatch"]').at(0).text()).toEqual( - 'Please select a field first...' - ); + expect( + wrapper.find('[data-test-subj="fieldAutocompleteComboBox"] input').props().placeholder + ).toEqual('Search'); + expect( + wrapper.find('[data-test-subj="operatorAutocompleteComboBox"] input').props().value + ).toEqual('is'); + expect( + wrapper.find('[data-test-subj="valuesAutocompleteMatch"] input').props().placeholder + ).toEqual('Please select a field first...'); }); test('it displays "exceptionListItems" that are passed in', async () => { @@ -103,15 +105,16 @@ describe('ExceptionBuilderComponent', () => { /> ); + expect(wrapper.find('EuiFlexGroup[data-test-subj="exceptionItemEntryContainer"]')).toHaveLength( 1 ); - expect(wrapper.find('[data-test-subj="exceptionBuilderEntryField"]').at(0).text()).toEqual( - 'ip' - ); - expect(wrapper.find('[data-test-subj="operatorAutocompleteComboBox"]').at(0).text()).toEqual( - 'is one of' - ); + expect( + wrapper.find('[data-test-subj="fieldAutocompleteComboBox"] input').props().value + ).toEqual('ip'); + expect( + wrapper.find('[data-test-subj="operatorAutocompleteComboBox"] input').props().value + ).toEqual('is one of'); expect(wrapper.find('[data-test-subj="valuesAutocompleteMatchAny"]').at(0).text()).toEqual( 'some ip' ); @@ -263,25 +266,27 @@ describe('ExceptionBuilderComponent', () => { expect( wrapper.find('EuiFlexGroup[data-test-subj="exceptionItemEntryContainer"]') ).toHaveLength(2); - expect(wrapper.find('[data-test-subj="exceptionBuilderEntryField"]').at(0).text()).toEqual( - 'Search' - ); - expect(wrapper.find('[data-test-subj="operatorAutocompleteComboBox"]').at(0).text()).toEqual( - 'is' - ); - expect(wrapper.find('[data-test-subj="valuesAutocompleteMatch"]').at(0).text()).toEqual( - 'Please select a field first...' - ); + expect( + wrapper.find('[data-test-subj="exceptionBuilderEntryField"] input').at(0).props() + .placeholder + ).toEqual('Search'); + expect( + wrapper.find('[data-test-subj="operatorAutocompleteComboBox"] input').at(0).props().value + ).toEqual('is'); + expect( + wrapper.find('[data-test-subj="valuesAutocompleteMatch"] input').at(0).props().placeholder + ).toEqual('Please select a field first...'); - expect(wrapper.find('[data-test-subj="exceptionBuilderEntryField"]').at(1).text()).toEqual( - 'Search' - ); - expect(wrapper.find('[data-test-subj="operatorAutocompleteComboBox"]').at(1).text()).toEqual( - 'is' - ); - expect(wrapper.find('[data-test-subj="valuesAutocompleteMatch"]').at(1).text()).toEqual( - 'Please select a field first...' - ); + expect( + wrapper.find('[data-test-subj="exceptionBuilderEntryField"] input').at(1).props() + .placeholder + ).toEqual('Search'); + expect( + wrapper.find('[data-test-subj="operatorAutocompleteComboBox"] input').at(1).props().value + ).toEqual('is'); + expect( + wrapper.find('[data-test-subj="valuesAutocompleteMatch"] input').at(1).props().placeholder + ).toEqual('Please select a field first...'); }); }); @@ -324,25 +329,25 @@ describe('ExceptionBuilderComponent', () => { const item1 = wrapper.find('EuiFlexGroup[data-test-subj="exceptionEntriesContainer"]').at(0); const item2 = wrapper.find('EuiFlexGroup[data-test-subj="exceptionEntriesContainer"]').at(1); - expect(item1.find('[data-test-subj="exceptionBuilderEntryField"]').at(0).text()).toEqual( - 'Search' - ); - expect(item1.find('[data-test-subj="operatorAutocompleteComboBox"]').at(0).text()).toEqual( - 'is' - ); - expect(item1.find('[data-test-subj="valuesAutocompleteMatch"]').at(0).text()).toEqual( - 'Please select a field first...' - ); + expect( + item1.find('[data-test-subj="exceptionBuilderEntryField"] input').at(0).props().placeholder + ).toEqual('Search'); + expect( + item1.find('[data-test-subj="operatorAutocompleteComboBox"] input').at(0).props().value + ).toEqual('is'); + expect( + item1.find('[data-test-subj="valuesAutocompleteMatch"] input').at(0).props().placeholder + ).toEqual('Please select a field first...'); - expect(item2.find('[data-test-subj="exceptionBuilderEntryField"]').at(0).text()).toEqual( - 'Search' - ); - expect(item2.find('[data-test-subj="operatorAutocompleteComboBox"]').at(0).text()).toEqual( - 'is' - ); - expect(item2.find('[data-test-subj="valuesAutocompleteMatch"]').at(0).text()).toEqual( - 'Please select a field first...' - ); + expect( + item2.find('[data-test-subj="exceptionBuilderEntryField"] input').at(0).props().placeholder + ).toEqual('Search'); + expect( + item2.find('[data-test-subj="operatorAutocompleteComboBox"] input').at(0).props().value + ).toEqual('is'); + expect( + item2.find('[data-test-subj="valuesAutocompleteMatch"] input').at(0).props().placeholder + ).toEqual('Please select a field first...'); }); }); @@ -378,27 +383,27 @@ describe('ExceptionBuilderComponent', () => { ); - expect(wrapper.find('[data-test-subj="exceptionBuilderEntryField"]').at(0).text()).toEqual( - 'ip' - ); - expect(wrapper.find('[data-test-subj="operatorAutocompleteComboBox"]').at(0).text()).toEqual( - 'is one of' - ); + expect( + wrapper.find('[data-test-subj="exceptionBuilderEntryField"] input').props().value + ).toEqual('ip'); + expect( + wrapper.find('[data-test-subj="operatorAutocompleteComboBox"] input').at(0).props().value + ).toEqual('is one of'); expect(wrapper.find('[data-test-subj="valuesAutocompleteMatchAny"]').at(0).text()).toEqual( 'some ip' ); wrapper.find('[data-test-subj="firstRowBuilderDeleteButton"] button').simulate('click'); - expect(wrapper.find('[data-test-subj="exceptionBuilderEntryField"]').at(0).text()).toEqual( - 'Search' - ); - expect(wrapper.find('[data-test-subj="operatorAutocompleteComboBox"]').at(0).text()).toEqual( - 'is' - ); - expect(wrapper.find('[data-test-subj="valuesAutocompleteMatch"]').at(0).text()).toEqual( - 'Please select a field first...' - ); + expect( + wrapper.find('[data-test-subj="exceptionBuilderEntryField"] input').at(0).props().placeholder + ).toEqual('Search'); + expect( + wrapper.find('[data-test-subj="operatorAutocompleteComboBox"] input').at(0).props().value + ).toEqual('is'); + expect( + wrapper.find('[data-test-subj="valuesAutocompleteMatch"] input').at(0).props().placeholder + ).toEqual('Please select a field first...'); }); test('it displays "and" badge if at least one exception item includes more than one entry', () => { @@ -507,14 +512,17 @@ describe('ExceptionBuilderComponent', () => { const entry2 = wrapper .find('EuiFlexGroup[data-test-subj="exceptionItemEntryContainer"]') .at(1); - expect(entry2.find('[data-test-subj="exceptionBuilderEntryField"]').at(0).text()).toEqual( - 'Search nested field' - ); - expect(entry2.find('[data-test-subj="operatorAutocompleteComboBox"]').at(0).text()).toEqual( - 'is' - ); + + expect( + entry2.find('[data-test-subj="exceptionBuilderEntryField"] input').at(0).props() + .placeholder + ).toEqual('Search nested field'); + expect( + entry2.find('[data-test-subj="operatorAutocompleteComboBox"] input').at(0).props().value + ).toEqual('is'); expect( - entry2.find('[data-test-subj="exceptionBuilderEntryFieldExists"]').at(0).text() + entry2.find('[data-test-subj="exceptionBuilderEntryFieldExists"] input').at(0).props() + .placeholder ).toEqual(getEmptyValue()); }); }); diff --git a/x-pack/plugins/log_explorer/public/components/dataset_selector/sub_components/esql_selector.tsx b/x-pack/plugins/log_explorer/public/components/dataset_selector/sub_components/esql_selector.tsx index fec07114d939d..65ca1f1fd22e8 100644 --- a/x-pack/plugins/log_explorer/public/components/dataset_selector/sub_components/esql_selector.tsx +++ b/x-pack/plugins/log_explorer/public/components/dataset_selector/sub_components/esql_selector.tsx @@ -7,7 +7,7 @@ import { EuiBadge, EuiButton, EuiHorizontalRule } from '@elastic/eui'; import React from 'react'; -import { getRouterLinkProps } from '../../../utils/get_router_link_props'; +import { getRouterLinkProps } from '@kbn/router-utils'; import { DiscoverEsqlUrlProps } from '../../../hooks/use_esql'; import { technicalPreview, tryEsql } from '../constants'; diff --git a/x-pack/plugins/log_explorer/public/controller/public_state.ts b/x-pack/plugins/log_explorer/public/controller/public_state.ts index 04c12160a8809..5f4aad892bcb9 100644 --- a/x-pack/plugins/log_explorer/public/controller/public_state.ts +++ b/x-pack/plugins/log_explorer/public/controller/public_state.ts @@ -15,11 +15,7 @@ import { DEFAULT_CONTEXT, LogExplorerControllerContext, } from '../state_machines/log_explorer_controller'; -import { - LogExplorerPublicState, - LogExplorerPublicStateUpdate, - OptionsListControlOption, -} from './types'; +import { LogExplorerPublicState, LogExplorerPublicStateUpdate, OptionsListControl } from './types'; export const getPublicStateFromContext = ( context: LogExplorerControllerContext @@ -80,7 +76,7 @@ const getPublicControlsStateFromControlPanels = ( const getOptionsListPublicControlStateFromControlPanel = ( optionsListControlPanel: ControlPanels[string] -): OptionsListControlOption => ({ +): OptionsListControl => ({ mode: optionsListControlPanel.explicitInput.exclude ? 'exclude' : 'include', selection: optionsListControlPanel.explicitInput.existsSelected ? { type: 'exists' } @@ -113,7 +109,7 @@ const getControlPanelsFromPublicControlsState = ( const getControlPanelFromOptionsListPublicControlState = ( controlId: string, - publicControlState: OptionsListControlOption + publicControlState: OptionsListControl ): ControlPanels[string] => { const defaultControlPanelConfig = controlPanelConfigs[controlId]; diff --git a/x-pack/plugins/log_explorer/public/controller/types.ts b/x-pack/plugins/log_explorer/public/controller/types.ts index 50eb259d38cb3..5947051ad2518 100644 --- a/x-pack/plugins/log_explorer/public/controller/types.ts +++ b/x-pack/plugins/log_explorer/public/controller/types.ts @@ -41,19 +41,21 @@ export type LogExplorerDiscoverServices = Pick< }; export interface OptionsListControlOption { + type: 'options'; + selectedOptions: string[]; +} + +export interface OptionsListControlExists { + type: 'exists'; +} + +export interface OptionsListControl { mode: 'include' | 'exclude'; - selection: - | { - type: 'options'; - selectedOptions: string[]; - } - | { - type: 'exists'; - }; + selection: OptionsListControlOption | OptionsListControlExists; } export interface ControlOptions { - [availableControlsPanels.NAMESPACE]?: OptionsListControlOption; + [availableControlsPanels.NAMESPACE]?: OptionsListControl; } // we might want to wrap this into an object that has a "state value" laster diff --git a/x-pack/plugins/log_explorer/public/index.ts b/x-pack/plugins/log_explorer/public/index.ts index 005b5cca07a14..efd337234ffc6 100644 --- a/x-pack/plugins/log_explorer/public/index.ts +++ b/x-pack/plugins/log_explorer/public/index.ts @@ -21,6 +21,7 @@ export type { LogExplorerPluginSetup, LogExplorerPluginStart } from './types'; export { getDiscoverColumnsFromDisplayOptions, getDiscoverGridFromDisplayOptions, + getDiscoverFiltersFromState, } from './utils/convert_discover_app_state'; export function plugin(context: PluginInitializerContext) { diff --git a/x-pack/plugins/log_explorer/public/utils/convert_discover_app_state.ts b/x-pack/plugins/log_explorer/public/utils/convert_discover_app_state.ts index dea02a0bec002..90d51f75e8c7c 100644 --- a/x-pack/plugins/log_explorer/public/utils/convert_discover_app_state.ts +++ b/x-pack/plugins/log_explorer/public/utils/convert_discover_app_state.ts @@ -7,6 +7,8 @@ import { QueryState } from '@kbn/data-plugin/public'; import { DiscoverAppState } from '@kbn/discover-plugin/public'; +import { ExistsFilter, Filter, FILTERS, PhrasesFilter } from '@kbn/es-query'; +import { PhraseFilterValue } from '@kbn/es-query/src/filters/build_filters'; import { cloneDeep } from 'lodash'; import { ChartDisplayOptions, @@ -14,6 +16,7 @@ import { GridColumnDisplayOptions, GridRowsDisplayOptions, } from '../../common'; +import { ControlOptions, OptionsListControlOption } from '../controller'; export const getGridColumnDisplayOptionsFromDiscoverAppState = ( discoverAppState: DiscoverAppState @@ -71,3 +74,60 @@ export const getDiscoverGridFromDisplayOptions = ( return gridColumns; }, {}), }); + +const createDiscoverPhrasesFilter = ({ + key, + values, + negate, +}: { + values: PhraseFilterValue[]; + key: string; + negate?: boolean; +}): PhrasesFilter => + ({ + meta: { + key, + negate, + type: FILTERS.PHRASES, + params: values, + }, + query: { + bool: { + should: values.map((value) => ({ match_phrase: { [key]: value.toString() } })), + minimum_should_match: 1, + }, + }, + } as PhrasesFilter); + +const createDiscoverExistsFilter = ({ + key, + negate, +}: { + key: string; + negate?: boolean; +}): ExistsFilter => ({ + meta: { + key, + negate, + type: FILTERS.EXISTS, + }, + query: { exists: { field: key } }, +}); + +export const getDiscoverFiltersFromState = (filters: Filter[] = [], controls?: ControlOptions) => [ + ...filters, + ...(controls + ? (Object.keys(controls) as Array).map((key) => + controls[key as keyof ControlOptions]?.selection.type === 'exists' + ? createDiscoverExistsFilter({ + key, + negate: controls[key]?.mode === 'exclude', + }) + : createDiscoverPhrasesFilter({ + key, + values: (controls[key]?.selection as OptionsListControlOption).selectedOptions, + negate: controls[key]?.mode === 'exclude', + }) + ) + : []), +]; diff --git a/x-pack/plugins/log_explorer/public/utils/get_router_link_props.ts b/x-pack/plugins/log_explorer/public/utils/get_router_link_props.ts deleted file mode 100644 index a325df1a7e86f..0000000000000 --- a/x-pack/plugins/log_explorer/public/utils/get_router_link_props.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * 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; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -interface GetRouterLinkPropsDeps { - href?: string; - onClick(): void; -} - -const isModifiedEvent = (event: React.MouseEvent) => - !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey); - -const isLeftClickEvent = (event: React.MouseEvent) => event.button === 0; - -export const getRouterLinkProps = ({ href, onClick }: GetRouterLinkPropsDeps) => { - const guardedClickHandler = (event: React.MouseEvent) => { - if (event.defaultPrevented) { - return; - } - - if (isModifiedEvent(event) || !isLeftClickEvent(event)) { - return; - } - - // Prevent regular link behavior, which causes a browser refresh. - event.preventDefault(); - - onClick(); - }; - - return { href, onClick: guardedClickHandler }; -}; diff --git a/x-pack/plugins/log_explorer/tsconfig.json b/x-pack/plugins/log_explorer/tsconfig.json index 15f3a94065197..05cdd888eba1f 100644 --- a/x-pack/plugins/log_explorer/tsconfig.json +++ b/x-pack/plugins/log_explorer/tsconfig.json @@ -35,12 +35,13 @@ "@kbn/kibana-utils-plugin", "@kbn/navigation-plugin", "@kbn/react-field", + "@kbn/router-utils", "@kbn/share-plugin", "@kbn/unified-data-table", "@kbn/unified-doc-viewer", "@kbn/unified-field-list", "@kbn/unified-search-plugin", - "@kbn/xstate-utils" + "@kbn/xstate-utils", ], "exclude": [ "target/**/*" diff --git a/x-pack/plugins/logs_shared/public/components/log_ai_assistant/index.tsx b/x-pack/plugins/logs_shared/public/components/log_ai_assistant/index.tsx index 0bfb9f516209c..78b696388e165 100644 --- a/x-pack/plugins/logs_shared/public/components/log_ai_assistant/index.tsx +++ b/x-pack/plugins/logs_shared/public/components/log_ai_assistant/index.tsx @@ -4,25 +4,18 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import React, { ComponentType } from 'react'; -import { Optional } from '@kbn/utility-types'; +import { ObservabilityAIAssistantPluginStart } from '@kbn/observability-ai-assistant-plugin/public'; +import React from 'react'; import { dynamic } from '../../../common/dynamic'; -import type { LogAIAssistantDeps } from './log_ai_assistant'; export const LogAIAssistant = dynamic(() => import('./log_ai_assistant')); -interface LogAIAssistantFactoryDeps { - observabilityAIAssistant: LogAIAssistantDeps['observabilityAIAssistant']; -} - -export type LogAIAssistantComponent = ComponentType< - Optional ->; - export function createLogAIAssistant({ - observabilityAIAssistant: aiAssistantService, -}: LogAIAssistantFactoryDeps): LogAIAssistantComponent { - return ({ observabilityAIAssistant = aiAssistantService, ...props }) => ( + observabilityAIAssistant, +}: { + observabilityAIAssistant: ObservabilityAIAssistantPluginStart; +}) { + return ({ ...props }) => ( ); } diff --git a/x-pack/plugins/logs_shared/public/components/log_ai_assistant/log_ai_assistant.tsx b/x-pack/plugins/logs_shared/public/components/log_ai_assistant/log_ai_assistant.tsx index 8a8c755d70ff7..79adfde85540e 100644 --- a/x-pack/plugins/logs_shared/public/components/log_ai_assistant/log_ai_assistant.tsx +++ b/x-pack/plugins/logs_shared/public/components/log_ai_assistant/log_ai_assistant.tsx @@ -8,12 +8,9 @@ import React, { useMemo } from 'react'; import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; import { - ContextualInsight, type Message, - ObservabilityAIAssistantPluginStart, MessageRole, - ObservabilityAIAssistantProvider, - useObservabilityAIAssistant, + type ObservabilityAIAssistantPluginStart, } from '@kbn/observability-ai-assistant-plugin/public'; import { LogEntryField } from '../../../common'; import { explainLogMessageTitle, similarLogMessagesTitle } from './translations'; @@ -23,16 +20,14 @@ export interface LogAIAssistantDocument { } export interface LogAIAssistantProps { + observabilityAIAssistant: ObservabilityAIAssistantPluginStart; doc: LogAIAssistantDocument | undefined; } -export interface LogAIAssistantDeps extends LogAIAssistantProps { - observabilityAIAssistant: ObservabilityAIAssistantPluginStart['service']; -} - -export const LogAIAssistant = withProviders(({ doc }: LogAIAssistantProps) => { - const aiAssistant = useObservabilityAIAssistant(); - +export const LogAIAssistant = ({ + doc, + observabilityAIAssistant: { ObservabilityAIAssistantContextualInsight }, +}: LogAIAssistantProps) => { const explainLogMessageMessages = useMemo(() => { if (!doc) { return undefined; @@ -75,18 +70,18 @@ export const LogAIAssistant = withProviders(({ doc }: LogAIAssistantProps) => { return ( - {aiAssistant.isEnabled() && explainLogMessageMessages ? ( + {ObservabilityAIAssistantContextualInsight && explainLogMessageMessages ? ( - ) : null} - {aiAssistant.isEnabled() && similarLogMessageMessages ? ( + {ObservabilityAIAssistantContextualInsight && similarLogMessageMessages ? ( - { ) : null} ); -}); +}; // eslint-disable-next-line import/no-default-export export default LogAIAssistant; - -function withProviders(Component: React.FunctionComponent) { - return function ComponentWithProviders({ - observabilityAIAssistant: observabilityAIAssistantService, - ...props - }: LogAIAssistantDeps) { - return ( - - - - ); - }; -} diff --git a/x-pack/plugins/logs_shared/public/components/logging/log_entry_flyout/log_entry_flyout.tsx b/x-pack/plugins/logs_shared/public/components/logging/log_entry_flyout/log_entry_flyout.tsx index 2c5913d282e1d..aca2638a6120c 100644 --- a/x-pack/plugins/logs_shared/public/components/logging/log_entry_flyout/log_entry_flyout.tsx +++ b/x-pack/plugins/logs_shared/public/components/logging/log_entry_flyout/log_entry_flyout.tsx @@ -100,12 +100,6 @@ export const LogEntryFlyout = ({ onSetFieldFilter, logViewReference, }: LogEntryFlyoutProps) => { - const { - services: { - observabilityAIAssistant: { service: observabilityAIAssistantService }, - }, - } = useKibanaContextForPlugin(); - const { cancelRequest: cancelLogEntryRequest, errors: logEntryErrors, @@ -119,6 +113,8 @@ export const LogEntryFlyout = ({ logEntryId, }); + const { observabilityAIAssistant } = useKibanaContextForPlugin().services; + useEffect(() => { if (logViewReference && logEntryId) { fetchLogEntry(); @@ -186,10 +182,7 @@ export const LogEntryFlyout = ({ > - + diff --git a/x-pack/plugins/logs_shared/public/plugin.ts b/x-pack/plugins/logs_shared/public/plugin.ts index 372ca2c124bcc..092e95570db7f 100644 --- a/x-pack/plugins/logs_shared/public/plugin.ts +++ b/x-pack/plugins/logs_shared/public/plugin.ts @@ -33,9 +33,7 @@ export class LogsSharedPlugin implements LogsSharedClientPluginClass { search: data.search, }); - const LogAIAssistant = createLogAIAssistant({ - observabilityAIAssistant: observabilityAIAssistant.service, - }); + const LogAIAssistant = createLogAIAssistant({ observabilityAIAssistant }); return { logViews, diff --git a/x-pack/plugins/logs_shared/public/types.ts b/x-pack/plugins/logs_shared/public/types.ts index c0379c6fc21fb..2a2e9c1cf742d 100644 --- a/x-pack/plugins/logs_shared/public/types.ts +++ b/x-pack/plugins/logs_shared/public/types.ts @@ -17,7 +17,7 @@ import type { DataPublicPluginStart } from '@kbn/data-plugin/public'; import type { DataViewsPublicPluginStart } from '@kbn/data-views-plugin/public'; import { ObservabilityAIAssistantPluginStart } from '@kbn/observability-ai-assistant-plugin/public'; import { UiActionsStart } from '@kbn/ui-actions-plugin/public'; -import { LogAIAssistantComponent } from './components/log_ai_assistant'; +import type { LogAIAssistantProps } from './components/log_ai_assistant/log_ai_assistant'; // import type { OsqueryPluginStart } from '../../osquery/public'; import { LogViewsServiceSetup, LogViewsServiceStart } from './services/log_views'; @@ -28,7 +28,7 @@ export interface LogsSharedClientSetupExports { export interface LogsSharedClientStartExports { logViews: LogViewsServiceStart; - LogAIAssistant: LogAIAssistantComponent; + LogAIAssistant: (props: Omit) => JSX.Element; } // eslint-disable-next-line @typescript-eslint/no-empty-interface diff --git a/x-pack/plugins/maps/public/connected_components/right_side_controls/layer_control/layer_toc/toc_entry/_toc_entry.scss b/x-pack/plugins/maps/public/connected_components/right_side_controls/layer_control/layer_toc/toc_entry/_toc_entry.scss index 959176547dfb2..c88f343f7dbfa 100644 --- a/x-pack/plugins/maps/public/connected_components/right_side_controls/layer_control/layer_toc/toc_entry/_toc_entry.scss +++ b/x-pack/plugins/maps/public/connected_components/right_side_controls/layer_control/layer_toc/toc_entry/_toc_entry.scss @@ -81,7 +81,6 @@ flex-grow: 1; } -.mapLayTocActions__popoverAnchor, .mapLayTocActions__tooltipAnchor { max-width: 100%; } diff --git a/x-pack/plugins/maps/public/connected_components/right_side_controls/layer_control/layer_toc/toc_entry/toc_entry_actions_popover/__snapshots__/toc_entry_actions_popover.test.tsx.snap b/x-pack/plugins/maps/public/connected_components/right_side_controls/layer_control/layer_toc/toc_entry/toc_entry_actions_popover/__snapshots__/toc_entry_actions_popover.test.tsx.snap index dfa4200c8508e..47171e8bbe871 100644 --- a/x-pack/plugins/maps/public/connected_components/right_side_controls/layer_control/layer_toc/toc_entry/toc_entry_actions_popover/__snapshots__/toc_entry_actions_popover.test.tsx.snap +++ b/x-pack/plugins/maps/public/connected_components/right_side_controls/layer_control/layer_toc/toc_entry/toc_entry_actions_popover/__snapshots__/toc_entry_actions_popover.test.tsx.snap @@ -3,7 +3,6 @@ exports[`TOCEntryActionsPopover is rendered 1`] = ` { closePopover={this._closePopover} panelPaddingSize="none" anchorPosition="leftUp" - anchorClassName="mapLayTocActions__popoverAnchor" > { // Check the Single Metric Viewer element exists in the selector, and that it is checked. expect(getByTestId('mlAnomalyResultsViewSelectorSingleMetricViewer')).toBeInTheDocument(); - expect( - getByTestId('mlAnomalyResultsViewSelectorSingleMetricViewer') - .querySelector('input')! - .hasAttribute('checked') - ).toBe(true); + expect(getByTestId('mlAnomalyResultsViewSelectorSingleMetricViewer')).toHaveAttribute( + 'aria-pressed', + 'true' + ); }); }); diff --git a/x-pack/plugins/monitoring/public/components/elasticsearch/nodes/__snapshots__/cells.test.js.snap b/x-pack/plugins/monitoring/public/components/elasticsearch/nodes/__snapshots__/cells.test.js.snap index b5cc6f0e7ecc0..aadc12d246169 100644 --- a/x-pack/plugins/monitoring/public/components/elasticsearch/nodes/__snapshots__/cells.test.js.snap +++ b/x-pack/plugins/monitoring/public/components/elasticsearch/nodes/__snapshots__/cells.test.js.snap @@ -26,26 +26,22 @@ exports[`Node Listing Metric Cell should format a non-percentage metric 1`] = ` class="euiFlexItem emotion-euiFlexItem-growZero" >
-
- -
+
-
- -
+
= { @@ -19,7 +19,7 @@ const createEmailServiceMock = () => { return emailServiceMock; }; -const startMock: jest.Mocked = { +const startMock: jest.Mocked = { isEmailServiceAvailable: jest.fn(), getEmailService: jest.fn(createEmailServiceMock), }; @@ -30,7 +30,7 @@ const createStartMock = () => { const notificationsPluginMock: jest.Mocked> = { setup: jest.fn(), - start: jest.fn(createStartMock) as jest.Mock, + start: jest.fn(createStartMock) as jest.Mock, stop: jest.fn(), }; diff --git a/x-pack/plugins/notifications/server/plugin.ts b/x-pack/plugins/notifications/server/plugin.ts index 562db1977a73c..542eaeb0ba23b 100755 --- a/x-pack/plugins/notifications/server/plugin.ts +++ b/x-pack/plugins/notifications/server/plugin.ts @@ -7,14 +7,23 @@ import type { PluginInitializerContext, CoreSetup, CoreStart, Plugin } from '@kbn/core/server'; import type { - NotificationsPluginSetupDeps, - NotificationsPluginStartDeps, - NotificationsPluginStart, + NotificationsServerSetupDependencies, + NotificationsServerStartDependencies, + NotificationsServerStart, + NotificationsServerSetup, } from './types'; import type { NotificationsConfigType } from './config'; import { EmailServiceProvider } from './services/connectors_email_service_provider'; -export class NotificationsPlugin implements Plugin { +export class NotificationsPlugin + implements + Plugin< + NotificationsServerSetup, + NotificationsServerStart, + NotificationsServerSetupDependencies, + NotificationsServerStartDependencies + > +{ private emailServiceProvider: EmailServiceProvider; constructor(initializerContext: PluginInitializerContext) { @@ -24,11 +33,11 @@ export class NotificationsPlugin implements Plugin { const originalConsole = global.console; @@ -51,7 +51,7 @@ describe('renderApp', () => { }, }, usageCollection: { reportUiCounter: noop }, - observabilityAIAssistant: { service: mockObservabilityAIAssistantService }, + observabilityAIAssistant: { service: mockService }, } as unknown as ObservabilityPublicPluginsStart; const core = { diff --git a/x-pack/plugins/observability/public/application/index.tsx b/x-pack/plugins/observability/public/application/index.tsx index 5eb3fa65849cd..7081005487fc3 100644 --- a/x-pack/plugins/observability/public/application/index.tsx +++ b/x-pack/plugins/observability/public/application/index.tsx @@ -19,7 +19,6 @@ import { KibanaThemeProvider } from '@kbn/react-kibana-context-theme'; import { RedirectAppLinks } from '@kbn/shared-ux-link-redirect-app'; import { Storage } from '@kbn/kibana-utils-plugin/public'; import { UsageCollectionSetup } from '@kbn/usage-collection-plugin/public'; -import { ObservabilityAIAssistantProvider } from '@kbn/observability-ai-assistant-plugin/public'; import { PluginContext } from '../context/plugin_context/plugin_context'; import { ConfigSchema, ObservabilityPublicPluginsStart } from '../plugin'; import { routes } from '../routes/routes'; @@ -101,32 +100,30 @@ export const renderApp = ({ isServerless, }} > - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + diff --git a/x-pack/plugins/observability/public/context/plugin_context/plugin_context.tsx b/x-pack/plugins/observability/public/context/plugin_context/plugin_context.tsx index d9ae99760a7ad..11d2b05fc235b 100644 --- a/x-pack/plugins/observability/public/context/plugin_context/plugin_context.tsx +++ b/x-pack/plugins/observability/public/context/plugin_context/plugin_context.tsx @@ -5,11 +5,11 @@ * 2.0. */ -import { AppMountParameters } from '@kbn/core/public'; import { createContext } from 'react'; +import type { AppMountParameters } from '@kbn/core/public'; import type { LazyObservabilityPageTemplateProps } from '@kbn/observability-shared-plugin/public'; -import { ObservabilityRuleTypeRegistry } from '../../rules/create_observability_rule_type_registry'; -import { ConfigSchema } from '../../plugin'; +import type { ObservabilityRuleTypeRegistry } from '../../rules/create_observability_rule_type_registry'; +import type { ConfigSchema } from '../../plugin'; export interface PluginContextValue { config: ConfigSchema; diff --git a/x-pack/plugins/observability/public/embeddable/slo/overview/slo_overview.tsx b/x-pack/plugins/observability/public/embeddable/slo/overview/slo_overview.tsx index 0bd1b7048dcc0..cb0a6492ed310 100644 --- a/x-pack/plugins/observability/public/embeddable/slo/overview/slo_overview.tsx +++ b/x-pack/plugins/observability/public/embeddable/slo/overview/slo_overview.tsx @@ -112,7 +112,7 @@ export function SloOverview({ return (
- + ; export function useCloneSlo() { const { - http, - notifications: { toasts }, + http: { basePath }, + application: { navigateToUrl }, } = useKibana().services; - const queryClient = useQueryClient(); - return useMutation< - CreateSLOResponse, - ServerError, - { slo: CreateSLOInput; originalSloId?: string }, - { previousData?: FindSLOResponse; queryKey?: QueryKey } - >( - ['cloneSlo'], - ({ slo }: { slo: CreateSLOInput; originalSloId?: string }) => { - const body = JSON.stringify(slo); - return http.post(`/api/observability/slos`, { body }); + return useCallback( + (slo: SLOWithSummaryResponse) => { + navigateToUrl( + basePath.prepend( + paths.observability.sloCreateWithEncodedForm( + encode({ ...slo, name: `[Copy] ${slo.name}`, id: undefined }) + ) + ) + ); }, - { - onMutate: async ({ slo, originalSloId }) => { - await queryClient.cancelQueries({ queryKey: sloKeys.lists(), exact: false }); - - const queriesData = queryClient.getQueriesData({ - queryKey: sloKeys.lists(), - exact: false, - }); - const [queryKey, previousData] = queriesData?.at(0) ?? []; - - const originalSlo = previousData?.results?.find((el) => el.id === originalSloId); - const optimisticUpdate = { - page: previousData?.page ?? 1, - perPage: previousData?.perPage ?? 25, - total: previousData?.total ? previousData.total + 1 : 1, - results: [ - ...(previousData?.results ?? []), - { ...originalSlo, name: slo.name, id: uuidv4(), summary: undefined }, - ], - }; - - if (queryKey) { - queryClient.setQueryData(queryKey, optimisticUpdate); - } - - return { queryKey, previousData }; - }, - // If the mutation fails, use the context returned from onMutate to roll back - onError: (error, { slo }, context) => { - if (context?.previousData && context?.queryKey) { - queryClient.setQueryData(context.queryKey, context.previousData); - } - - toasts.addError(new Error(error.body?.message ?? error.message), { - title: i18n.translate('xpack.observability.slo.clone.errorNotification', { - defaultMessage: 'Failed to clone {name}', - values: { name: slo.name }, - }), - }); - }, - onSuccess: (_data, { slo }) => { - toasts.addSuccess( - i18n.translate('xpack.observability.slo.clone.successNotification', { - defaultMessage: 'Successfully created {name}', - values: { name: slo.name }, - }) - ); - queryClient.invalidateQueries({ queryKey: sloKeys.lists(), exact: false }); - }, - } + [navigateToUrl, basePath] ); } diff --git a/x-pack/plugins/observability/public/hooks/slo/use_fetch_group_by_cardinality.ts b/x-pack/plugins/observability/public/hooks/slo/use_fetch_group_by_cardinality.ts new file mode 100644 index 0000000000000..928eb7e92482d --- /dev/null +++ b/x-pack/plugins/observability/public/hooks/slo/use_fetch_group_by_cardinality.ts @@ -0,0 +1,69 @@ +/* + * 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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { ALL_VALUE } from '@kbn/slo-schema'; +import { useQuery } from '@tanstack/react-query'; +import { lastValueFrom } from 'rxjs'; +import { useKibana } from '../../utils/kibana_react'; + +export interface UseFetchIndexPatternFieldsResponse { + isLoading: boolean; + isSuccess: boolean; + isError: boolean; + data?: { cardinality: number; isHighCardinality: boolean }; +} + +const HIGH_CARDINALITY_THRESHOLD = 1000; + +export function useFetchGroupByCardinality( + indexPattern: string, + timestampField: string, + groupBy: string +): UseFetchIndexPatternFieldsResponse { + const { data: dataService } = useKibana().services; + + const { isLoading, isError, isSuccess, data } = useQuery({ + queryKey: ['fetchGroupByCardinality', indexPattern, timestampField, groupBy], + queryFn: async ({ signal }) => { + try { + const result = await lastValueFrom( + dataService.search.search({ + params: { + index: indexPattern, + body: { + query: { + bool: { + filter: [{ range: { [timestampField]: { gte: 'now-24h' } } }], + }, + }, + aggs: { + groupByCardinality: { + cardinality: { + field: groupBy, + }, + }, + }, + }, + }, + }) + ); + + // @ts-expect-error Property 'value' does not exist on type 'AggregationsAggregate' + const cardinality = result.rawResponse?.aggregations?.groupByCardinality?.value ?? 0; + return { cardinality, isHighCardinality: cardinality > HIGH_CARDINALITY_THRESHOLD }; + } catch (error) { + throw new Error(`Something went wrong. Error: ${error}`); + } + }, + retry: false, + refetchOnWindowFocus: false, + enabled: + Boolean(indexPattern) && Boolean(timestampField) && Boolean(groupBy) && groupBy !== ALL_VALUE, + }); + + return { isLoading, isError, isSuccess, data }; +} diff --git a/x-pack/plugins/observability/public/hooks/slo/use_fetch_index_pattern_fields.ts b/x-pack/plugins/observability/public/hooks/slo/use_fetch_index_pattern_fields.ts index 3363d501fae22..5aedb92219da6 100644 --- a/x-pack/plugins/observability/public/hooks/slo/use_fetch_index_pattern_fields.ts +++ b/x-pack/plugins/observability/public/hooks/slo/use_fetch_index_pattern_fields.ts @@ -5,6 +5,7 @@ * 2.0. */ +import { FieldSpec } from '@kbn/data-views-plugin/common'; import { useQuery } from '@tanstack/react-query'; import { useKibana } from '../../utils/kibana_react'; @@ -12,14 +13,7 @@ export interface UseFetchIndexPatternFieldsResponse { isLoading: boolean; isSuccess: boolean; isError: boolean; - data: Field[] | undefined; -} - -export interface Field { - name: string; - type: string; - aggregatable: boolean; - searchable: boolean; + data: FieldSpec[] | undefined; } export function useFetchIndexPatternFields( diff --git a/x-pack/plugins/observability/public/pages/alert_details/alert_details.test.tsx b/x-pack/plugins/observability/public/pages/alert_details/alert_details.test.tsx index f2a7a4d72d66f..9d537453d4ead 100644 --- a/x-pack/plugins/observability/public/pages/alert_details/alert_details.test.tsx +++ b/x-pack/plugins/observability/public/pages/alert_details/alert_details.test.tsx @@ -13,6 +13,9 @@ import { casesPluginMock } from '@kbn/cases-plugin/public/mocks'; import { __IntlProvider as IntlProvider } from '@kbn/i18n-react'; import * as useUiSettingHook from '@kbn/kibana-react-plugin/public/ui_settings/use_ui_setting'; import { useBreadcrumbs } from '@kbn/observability-shared-plugin/public'; +import { observabilityAIAssistantPluginMock } from '@kbn/observability-ai-assistant-plugin/public/mock'; +import { ruleTypeRegistryMock } from '@kbn/triggers-actions-ui-plugin/public/application/rule_type_registry.mock'; +import { RuleTypeModel, ValidationResult } from '@kbn/triggers-actions-ui-plugin/public'; import { Subset } from '../../typings'; import { render } from '../../utils/test_helper'; @@ -22,8 +25,6 @@ import { useFetchAlertDetail } from '../../hooks/use_fetch_alert_detail'; import { AlertDetails } from './alert_details'; import { ConfigSchema } from '../../plugin'; import { alert, alertWithNoData } from './mock/alert'; -import { ruleTypeRegistryMock } from '@kbn/triggers-actions-ui-plugin/public/application/rule_type_registry.mock'; -import { RuleTypeModel, ValidationResult } from '@kbn/triggers-actions-ui-plugin/public'; jest.mock('react-router-dom', () => ({ ...jest.requireActual('react-router-dom'), @@ -45,17 +46,20 @@ const ruleTypeRegistry = ruleTypeRegistryMock.create(); const useKibanaMock = useKibana as jest.Mock; +const mockObservabilityAIAssistant = observabilityAIAssistantPluginMock.createStartContract(); + const mockKibana = () => { useKibanaMock.mockReturnValue({ services: { ...kibanaStartMock.startContract(), - theme: {}, cases: casesPluginMock.createStartContract(), http: { basePath: { prepend: jest.fn(), }, }, + observabilityAIAssistant: mockObservabilityAIAssistant, + theme: {}, triggersActionsUi: { ruleTypeRegistry, }, diff --git a/x-pack/plugins/observability/public/pages/alert_details/components/page_title.test.tsx b/x-pack/plugins/observability/public/pages/alert_details/components/page_title.test.tsx index 88492df63acf6..62438d5208504 100644 --- a/x-pack/plugins/observability/public/pages/alert_details/components/page_title.test.tsx +++ b/x-pack/plugins/observability/public/pages/alert_details/components/page_title.test.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { render } from '@testing-library/react'; import { __IntlProvider as IntlProvider } from '@kbn/i18n-react'; -import { ALERT_RULE_CATEGORY } from '@kbn/rule-data-utils'; +import { ALERT_RULE_CATEGORY, ALERT_STATUS } from '@kbn/rule-data-utils'; import { PageTitle, PageTitleProps } from './page_title'; import { alert } from '../mock/alert'; @@ -66,16 +66,40 @@ describe('Page Title', () => { expect(getByTestId('ruleTypeId').textContent).toContain('Inventory threshold breached'); }); - it('should display an active badge when active is true', async () => { + it('should display an active badge when alert is active', async () => { const { getByText } = renderComp(defaultProps); expect(getByText('Active')).toBeTruthy(); }); - it('should display an inactive badge when active is false', async () => { - const updatedProps = { alert, dataTestSubj: defaultProps.dataTestSubj }; - updatedProps.alert.active = false; + it('should display a recovered badge when alert is recovered', async () => { + const updatedProps = { + alert: { + ...defaultProps.alert, + fields: { + ...defaultProps.alert.fields, + [ALERT_STATUS]: 'recovered', + }, + }, + dataTestSubj: defaultProps.dataTestSubj, + }; const { getByText } = renderComp({ ...updatedProps }); expect(getByText('Recovered')).toBeTruthy(); }); + + it('should display an untracked badge when alert is untracked', async () => { + const updatedProps = { + alert: { + ...defaultProps.alert, + fields: { + ...defaultProps.alert.fields, + [ALERT_STATUS]: 'untracked', + }, + }, + dataTestSubj: defaultProps.dataTestSubj, + }; + + const { getByText } = renderComp({ ...updatedProps }); + expect(getByText('Untracked')).toBeTruthy(); + }); }); diff --git a/x-pack/plugins/observability/public/pages/alert_details/components/page_title.tsx b/x-pack/plugins/observability/public/pages/alert_details/components/page_title.tsx index b5756e6db3edc..4216c49642272 100644 --- a/x-pack/plugins/observability/public/pages/alert_details/components/page_title.tsx +++ b/x-pack/plugins/observability/public/pages/alert_details/components/page_title.tsx @@ -22,8 +22,10 @@ import { ALERT_FLAPPING, ALERT_RULE_CATEGORY, ALERT_RULE_TYPE_ID, + ALERT_STATUS, ALERT_STATUS_ACTIVE, ALERT_STATUS_RECOVERED, + ALERT_STATUS_UNTRACKED, TIMESTAMP, } from '@kbn/rule-data-utils'; import moment from 'moment'; @@ -70,7 +72,13 @@ export function PageTitle({ alert, dataTestSubj }: PageTitleProps) { diff --git a/x-pack/plugins/observability/public/pages/alerts/alerts.test.tsx b/x-pack/plugins/observability/public/pages/alerts/alerts.test.tsx index cf59af003a788..8977e9ae3e4f0 100644 --- a/x-pack/plugins/observability/public/pages/alerts/alerts.test.tsx +++ b/x-pack/plugins/observability/public/pages/alerts/alerts.test.tsx @@ -15,6 +15,7 @@ import { RUNNING_MAINTENANCE_WINDOW_1 } from '@kbn/alerts-ui-shared/src/maintena import { KibanaPageTemplate } from '@kbn/shared-ux-page-kibana-template'; import { __IntlProvider as IntlProvider } from '@kbn/i18n-react'; import { MAINTENANCE_WINDOW_FEATURE_ID } from '@kbn/alerting-plugin/common/maintenance_window'; +import { observabilityAIAssistantPluginMock } from '@kbn/observability-ai-assistant-plugin/public/mock'; import { ObservabilityPublicPluginsStart } from '../../plugin'; import { AlertsPage } from './alerts'; @@ -35,10 +36,19 @@ mockUseKibanaReturnValue.services.application.capabilities = { }, }; +const mockObservabilityAIAssistant = observabilityAIAssistantPluginMock.createStartContract(); + jest.mock('../../utils/kibana_react', () => ({ __esModule: true, - useKibana: jest.fn(() => mockUseKibanaReturnValue), + useKibana: jest.fn(() => ({ + ...mockUseKibanaReturnValue, + services: { + ...mockUseKibanaReturnValue.services, + observabilityAIAssistant: mockObservabilityAIAssistant, + }, + })), })); + jest.mock('@kbn/kibana-react-plugin/public', () => ({ __esModule: true, useKibana: jest.fn(() => mockUseKibanaReturnValue), diff --git a/x-pack/plugins/observability/public/pages/alerts/components/alert_actions.test.tsx b/x-pack/plugins/observability/public/pages/alerts/components/alert_actions.test.tsx index b8e216ded52fb..ab7080e1d6d60 100644 --- a/x-pack/plugins/observability/public/pages/alerts/components/alert_actions.test.tsx +++ b/x-pack/plugins/observability/public/pages/alerts/components/alert_actions.test.tsx @@ -4,11 +4,12 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ +import React from 'react'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import { act } from '@testing-library/react-hooks'; -import { kibanaStartMock } from '../../../utils/kibana_react.mock'; -import React from 'react'; import { mountWithIntl, nextTick } from '@kbn/test-jest-helpers'; +import { kibanaStartMock } from '../../../utils/kibana_react.mock'; +import { observabilityAIAssistantPluginMock } from '@kbn/observability-ai-assistant-plugin/public/mock'; import { AlertActions, ObservabilityAlertActionsProps } from './alert_actions'; import { inventoryThresholdAlertEs } from '../../../rules/fixtures/example_alerts'; import { RULE_DETAILS_PAGE_ID } from '../../rule_details/constants'; @@ -42,6 +43,9 @@ mockUseKibanaReturnValue.services.cases.hooks.useCasesAddToExistingCaseModal.moc mockUseKibanaReturnValue.services.cases.helpers.canUseCases.mockReturnValue(allCasesPermissions()); +const { ObservabilityAIAssistantActionMenuItem, ObservabilityAIAssistantContextualInsight } = + observabilityAIAssistantPluginMock.createStartContract(); + jest.mock('../../../utils/kibana_react', () => ({ __esModule: true, useKibana: jest.fn(() => mockUseKibanaReturnValue), @@ -72,6 +76,8 @@ jest.spyOn(pluginContext, 'usePluginContext').mockImplementation(() => ({ plugins: {} as ObservabilityPublicPluginsStart, observabilityRuleTypeRegistry: createObservabilityRuleTypeRegistryMock(), ObservabilityPageTemplate: KibanaPageTemplate, + ObservabilityAIAssistantActionMenuItem, + ObservabilityAIAssistantContextualInsight, })); describe('ObservabilityActions component', () => { diff --git a/x-pack/plugins/observability/public/pages/overview/components/header_menu/header_menu.tsx b/x-pack/plugins/observability/public/pages/overview/components/header_menu/header_menu.tsx index 111acb054e163..b57c512565fc1 100644 --- a/x-pack/plugins/observability/public/pages/overview/components/header_menu/header_menu.tsx +++ b/x-pack/plugins/observability/public/pages/overview/components/header_menu/header_menu.tsx @@ -8,22 +8,22 @@ import { EuiHeaderLink, EuiHeaderLinks } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import React from 'react'; -import { - ObservabilityAIAssistantActionMenuItem, - useObservabilityAIAssistantOptional, -} from '@kbn/observability-ai-assistant-plugin/public'; + import { useKibana } from '../../../../utils/kibana_react'; import { usePluginContext } from '../../../../hooks/use_plugin_context'; import HeaderMenuPortal from './header_menu_portal'; export function HeaderMenu(): React.ReactElement | null { - const { http, theme } = useKibana().services; + const { + http, + theme, + observabilityAIAssistant: { ObservabilityAIAssistantActionMenuItem }, + } = useKibana().services; + const { appMountParameters: { setHeaderActionMenu }, } = usePluginContext(); - const aiAssistant = useObservabilityAIAssistantOptional(); - return ( @@ -34,7 +34,7 @@ export function HeaderMenu(): React.ReactElement | null { > {addDataLinkText} - {aiAssistant?.isEnabled() ? : null} + {ObservabilityAIAssistantActionMenuItem ? : null} ); diff --git a/x-pack/plugins/observability/public/pages/overview/components/sections/apm/apm_section.test.tsx b/x-pack/plugins/observability/public/pages/overview/components/sections/apm/apm_section.test.tsx index 23d3af1167b99..b5befe3c3083d 100644 --- a/x-pack/plugins/observability/public/pages/overview/components/sections/apm/apm_section.test.tsx +++ b/x-pack/plugins/observability/public/pages/overview/components/sections/apm/apm_section.test.tsx @@ -7,6 +7,7 @@ import React from 'react'; import * as fetcherHook from '@kbn/observability-shared-plugin/public/hooks/use_fetcher'; +import { observabilityAIAssistantPluginMock } from '@kbn/observability-ai-assistant-plugin/public/mock'; import { render, data as dataMock } from '../../../../../utils/test_helper'; import { CoreStart } from '@kbn/core/public'; import { ConfigSchema, ObservabilityPublicPluginsStart } from '../../../../../plugin'; @@ -27,6 +28,9 @@ jest.mock('react-router-dom', () => ({ useHistory: jest.fn(), })); +const { ObservabilityAIAssistantActionMenuItem, ObservabilityAIAssistantContextualInsight } = + observabilityAIAssistantPluginMock.createStartContract(); + describe('APMSection', () => { const bucketSize = { intervalString: '60s', bucketSize: 60, dateFormat: 'YYYY-MM-DD HH:mm' }; @@ -61,6 +65,8 @@ describe('APMSection', () => { plugins: {} as ObservabilityPublicPluginsStart, observabilityRuleTypeRegistry: createObservabilityRuleTypeRegistryMock(), ObservabilityPageTemplate: KibanaPageTemplate, + ObservabilityAIAssistantActionMenuItem, + ObservabilityAIAssistantContextualInsight, })); }); diff --git a/x-pack/plugins/observability/public/pages/rules/rules.test.tsx b/x-pack/plugins/observability/public/pages/rules/rules.test.tsx index 6f18d308780ad..904578fe75a03 100644 --- a/x-pack/plugins/observability/public/pages/rules/rules.test.tsx +++ b/x-pack/plugins/observability/public/pages/rules/rules.test.tsx @@ -8,6 +8,7 @@ import React from 'react'; import { render } from '@testing-library/react'; import { CoreStart } from '@kbn/core/public'; +import { observabilityAIAssistantPluginMock } from '@kbn/observability-ai-assistant-plugin/public/mock'; import { __IntlProvider as IntlProvider } from '@kbn/i18n-react'; import { ObservabilityPublicPluginsStart } from '../../plugin'; import { RulesPage } from './rules'; @@ -19,10 +20,17 @@ import { AppMountParameters } from '@kbn/core/public'; import { ALERTS_FEATURE_ID } from '@kbn/alerting-plugin/common'; const mockUseKibanaReturnValue = kibanaStartMock.startContract(); +const mockObservabilityAIAssistant = observabilityAIAssistantPluginMock.createStartContract(); jest.mock('../../utils/kibana_react', () => ({ __esModule: true, - useKibana: jest.fn(() => mockUseKibanaReturnValue), + useKibana: jest.fn(() => ({ + ...mockUseKibanaReturnValue, + services: { + ...mockUseKibanaReturnValue.services, + observabilityAIAssistant: mockObservabilityAIAssistant, + }, + })), })); jest.mock('@kbn/observability-shared-plugin/public'); diff --git a/x-pack/plugins/observability/public/pages/slo_details/components/header_control.tsx b/x-pack/plugins/observability/public/pages/slo_details/components/header_control.tsx index 615edf3ef65f3..34eb1f278e7a3 100644 --- a/x-pack/plugins/observability/public/pages/slo_details/components/header_control.tsx +++ b/x-pack/plugins/observability/public/pages/slo_details/components/header_control.tsx @@ -10,20 +10,16 @@ import { i18n } from '@kbn/i18n'; import { EuiButton, EuiContextMenuItem, EuiContextMenuPanel, EuiPopover } from '@elastic/eui'; import { SLOWithSummaryResponse } from '@kbn/slo-schema'; +import { useCloneSlo } from '../../../hooks/slo/use_clone_slo'; import { SloDeleteConfirmationModal } from '../../../components/slo/delete_confirmation_modal/slo_delete_confirmation_modal'; import { useCapabilities } from '../../../hooks/slo/use_capabilities'; import { useKibana } from '../../../utils/kibana_react'; -import { useCloneSlo } from '../../../hooks/slo/use_clone_slo'; import { useDeleteSlo } from '../../../hooks/slo/use_delete_slo'; import { isApmIndicatorType } from '../../../utils/slo/indicator'; import { convertSliApmParamsToApmAppDeeplinkUrl } from '../../../utils/slo/convert_sli_apm_params_to_apm_app_deeplink_url'; import { SLO_BURN_RATE_RULE_TYPE_ID } from '../../../../common/constants'; import { rulesLocatorID, sloFeatureId } from '../../../../common'; import { paths } from '../../../../common/locators/paths'; -import { - transformSloResponseToCreateSloForm, - transformCreateSLOFormToCreateSLOInput, -} from '../../slo_edit/helpers/process_slo_form_values'; import type { RulesParams } from '../../../locators/rules'; export interface Props { @@ -47,7 +43,6 @@ export function HeaderControl({ isLoading, slo }: Props) { const [isRuleFlyoutVisible, setRuleFlyoutVisibility] = useState(false); const [isDeleteConfirmationModalOpen, setDeleteConfirmationModalOpen] = useState(false); - const { mutate: cloneSlo } = useCloneSlo(); const { mutate: deleteSlo } = useDeleteSlo(); const handleActionsClick = () => setIsPopoverOpen((value) => !value); @@ -101,17 +96,12 @@ export function HeaderControl({ isLoading, slo }: Props) { } }; + const navigateToClone = useCloneSlo(); + const handleClone = async () => { if (slo) { setIsPopoverOpen(false); - - const newSlo = transformCreateSLOFormToCreateSLOInput( - transformSloResponseToCreateSloForm({ ...slo, name: `[Copy] ${slo.name}` })! - ); - - cloneSlo({ slo: newSlo, originalSloId: slo.id }); - - navigate(basePath.prepend(paths.observability.slos)); + navigateToClone(slo); } }; diff --git a/x-pack/plugins/observability/public/pages/slo_details/slo_details.test.tsx b/x-pack/plugins/observability/public/pages/slo_details/slo_details.test.tsx index c9b04fee85eb2..22691aaa2b49c 100644 --- a/x-pack/plugins/observability/public/pages/slo_details/slo_details.test.tsx +++ b/x-pack/plugins/observability/public/pages/slo_details/slo_details.test.tsx @@ -8,6 +8,7 @@ import React from 'react'; import { fireEvent, screen, waitFor } from '@testing-library/react'; import type { Capabilities } from '@kbn/core/public'; +import { observabilityAIAssistantPluginMock } from '@kbn/observability-ai-assistant-plugin/public/mock'; import { useKibana } from '../../utils/kibana_react'; import { useParams, useLocation } from 'react-router-dom'; @@ -17,7 +18,6 @@ import { useFetchSloDetails } from '../../hooks/slo/use_fetch_slo_details'; import { useFetchHistoricalSummary } from '../../hooks/slo/use_fetch_historical_summary'; import { useFetchActiveAlerts } from '../../hooks/slo/use_fetch_active_alerts'; import { ActiveAlerts } from '../../hooks/slo/active_alerts'; -import { useCloneSlo } from '../../hooks/slo/use_clone_slo'; import { useDeleteSlo } from '../../hooks/slo/use_delete_slo'; import { render } from '../../utils/test_helper'; import { SloDetailsPage } from './slo_details'; @@ -30,6 +30,7 @@ import { import { chartPluginMock } from '@kbn/charts-plugin/public/mocks'; import { buildApmAvailabilityIndicator } from '../../data/slo/indicator'; import { ALL_VALUE } from '@kbn/slo-schema'; +import { encode } from '@kbn/rison'; jest.mock('react-router-dom', () => ({ ...jest.requireActual('react-router-dom'), @@ -44,7 +45,6 @@ jest.mock('../../hooks/slo/use_capabilities'); jest.mock('../../hooks/slo/use_fetch_active_alerts'); jest.mock('../../hooks/slo/use_fetch_slo_details'); jest.mock('../../hooks/slo/use_fetch_historical_summary'); -jest.mock('../../hooks/slo/use_clone_slo'); jest.mock('../../hooks/slo/use_delete_slo'); const useKibanaMock = useKibana as jest.Mock; @@ -55,12 +55,10 @@ const useCapabilitiesMock = useCapabilities as jest.Mock; const useFetchActiveAlertsMock = useFetchActiveAlerts as jest.Mock; const useFetchSloDetailsMock = useFetchSloDetails as jest.Mock; const useFetchHistoricalSummaryMock = useFetchHistoricalSummary as jest.Mock; -const useCloneSloMock = useCloneSlo as jest.Mock; const useDeleteSloMock = useDeleteSlo as jest.Mock; const mockNavigate = jest.fn(); const mockLocator = jest.fn(); -const mockClone = jest.fn(); const mockDelete = jest.fn(); const mockCapabilities = { apm: { show: true }, @@ -87,6 +85,7 @@ const mockKibana = () => { addError: jest.fn(), }, }, + observabilityAIAssistant: observabilityAIAssistantPluginMock.createStartContract(), share: { url: { locators: { @@ -120,7 +119,6 @@ describe('SLO Details Page', () => { data: historicalSummaryData, }); useFetchActiveAlertsMock.mockReturnValue({ isLoading: false, data: new ActiveAlerts() }); - useCloneSloMock.mockReturnValue({ mutate: mockClone }); useDeleteSloMock.mockReturnValue({ mutate: mockDelete }); useLocationMock.mockReturnValue({ search: '' }); }); @@ -248,29 +246,12 @@ describe('SLO Details Page', () => { fireEvent.click(button!); - const { - id, - createdAt, - enabled, - revision, - summary, - settings, - updatedAt, - instanceId, - version, - ...newSlo - } = slo; - - expect(mockClone).toBeCalledWith({ - originalSloId: slo.id, - slo: { - ...newSlo, - name: `[Copy] ${newSlo.name}`, - }, - }); - await waitFor(() => { - expect(mockNavigate).toBeCalledWith(paths.observability.slos); + expect(mockNavigate).toBeCalledWith( + paths.observability.sloCreateWithEncodedForm( + encode({ ...slo, name: `[Copy] ${slo.name}`, id: undefined }) + ) + ); }); }); diff --git a/x-pack/plugins/observability/public/pages/slo_edit/components/apm_availability/apm_availability_indicator_type_form.tsx b/x-pack/plugins/observability/public/pages/slo_edit/components/apm_availability/apm_availability_indicator_type_form.tsx index c877d1de173c1..78afcc71cae58 100644 --- a/x-pack/plugins/observability/public/pages/slo_edit/components/apm_availability/apm_availability_indicator_type_form.tsx +++ b/x-pack/plugins/observability/public/pages/slo_edit/components/apm_availability/apm_availability_indicator_type_form.tsx @@ -5,11 +5,12 @@ * 2.0. */ -import { EuiFlexGroup, EuiFlexItem, EuiIconTip } from '@elastic/eui'; +import { EuiCallOut, EuiFlexGroup, EuiFlexItem, EuiIconTip } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { ALL_VALUE } from '@kbn/slo-schema/src/schema/common'; import React, { useEffect } from 'react'; import { useFormContext } from 'react-hook-form'; +import { useFetchGroupByCardinality } from '../../../../hooks/slo/use_fetch_group_by_cardinality'; import { useFetchApmIndex } from '../../../../hooks/slo/use_fetch_apm_indices'; import { useFetchIndexPatternFields } from '../../../../hooks/slo/use_fetch_index_pattern_fields'; import { CreateSLOForm } from '../../types'; @@ -27,9 +28,14 @@ export function ApmAvailabilityIndicatorTypeForm() { setValue('indicator.params.index', apmIndex); } }, [setValue, apmIndex]); + const timestampField = watch('indicator.params.timestampField'); + const groupByField = watch('groupBy'); const { isLoading: isIndexFieldsLoading, data: indexFields = [] } = useFetchIndexPatternFields(apmIndex); + + const { isLoading: isGroupByCardinalityLoading, data: groupByCardinality } = + useFetchGroupByCardinality(apmIndex, timestampField, groupByField); const groupByFields = indexFields.filter((field) => field.aggregatable); return ( @@ -158,6 +164,19 @@ export function ApmAvailabilityIndicatorTypeForm() { isDisabled={!apmIndex} /> + {!isGroupByCardinalityLoading && !!groupByCardinality && ( + + )} + ); diff --git a/x-pack/plugins/observability/public/pages/slo_edit/components/apm_latency/apm_latency_indicator_type_form.tsx b/x-pack/plugins/observability/public/pages/slo_edit/components/apm_latency/apm_latency_indicator_type_form.tsx index b75c9fd8d110c..dcb4be69d272d 100644 --- a/x-pack/plugins/observability/public/pages/slo_edit/components/apm_latency/apm_latency_indicator_type_form.tsx +++ b/x-pack/plugins/observability/public/pages/slo_edit/components/apm_latency/apm_latency_indicator_type_form.tsx @@ -5,11 +5,19 @@ * 2.0. */ -import { EuiFieldNumber, EuiFlexGroup, EuiFlexItem, EuiFormRow, EuiIconTip } from '@elastic/eui'; +import { + EuiCallOut, + EuiFieldNumber, + EuiFlexGroup, + EuiFlexItem, + EuiFormRow, + EuiIconTip, +} from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { ALL_VALUE } from '@kbn/slo-schema/src/schema/common'; import React, { useEffect } from 'react'; import { Controller, useFormContext } from 'react-hook-form'; +import { useFetchGroupByCardinality } from '../../../../hooks/slo/use_fetch_group_by_cardinality'; import { useFetchApmIndex } from '../../../../hooks/slo/use_fetch_apm_indices'; import { useFetchIndexPatternFields } from '../../../../hooks/slo/use_fetch_index_pattern_fields'; import { CreateSLOForm } from '../../types'; @@ -28,8 +36,14 @@ export function ApmLatencyIndicatorTypeForm() { } }, [setValue, apmIndex]); + const timestampField = watch('indicator.params.timestampField'); + const groupByField = watch('groupBy'); + const { isLoading: isIndexFieldsLoading, data: indexFields = [] } = useFetchIndexPatternFields(apmIndex); + + const { isLoading: isGroupByCardinalityLoading, data: groupByCardinality } = + useFetchGroupByCardinality(apmIndex, timestampField, groupByField); const groupByFields = indexFields.filter((field) => field.aggregatable); return ( @@ -201,6 +215,19 @@ export function ApmLatencyIndicatorTypeForm() { isDisabled={!apmIndex} /> + {!isGroupByCardinalityLoading && !!groupByCardinality && ( + + )} + ); diff --git a/x-pack/plugins/observability/public/pages/slo_edit/components/common/index_field_selector.tsx b/x-pack/plugins/observability/public/pages/slo_edit/components/common/index_field_selector.tsx index 367ff255edde0..0a07515a8915f 100644 --- a/x-pack/plugins/observability/public/pages/slo_edit/components/common/index_field_selector.tsx +++ b/x-pack/plugins/observability/public/pages/slo_edit/components/common/index_field_selector.tsx @@ -6,14 +6,14 @@ */ import { EuiComboBox, EuiComboBoxOptionOption, EuiFlexItem, EuiFormRow } from '@elastic/eui'; +import { FieldSpec } from '@kbn/data-views-plugin/common'; import React, { useEffect, useState } from 'react'; import { Controller, useFormContext } from 'react-hook-form'; -import { Field } from '../../../../hooks/slo/use_fetch_index_pattern_fields'; import { createOptionsFromFields, Option } from '../../helpers/create_options'; import { CreateSLOForm } from '../../types'; interface Props { - indexFields: Field[]; + indexFields: FieldSpec[]; name: 'groupBy' | 'indicator.params.timestampField'; label: React.ReactNode | string; placeholder: string; diff --git a/x-pack/plugins/observability/public/pages/slo_edit/components/custom_kql/custom_kql_indicator_type_form.tsx b/x-pack/plugins/observability/public/pages/slo_edit/components/custom_kql/custom_kql_indicator_type_form.tsx index 33b8a2eb6def3..42130cf204df6 100644 --- a/x-pack/plugins/observability/public/pages/slo_edit/components/custom_kql/custom_kql_indicator_type_form.tsx +++ b/x-pack/plugins/observability/public/pages/slo_edit/components/custom_kql/custom_kql_indicator_type_form.tsx @@ -5,11 +5,12 @@ * 2.0. */ -import { EuiFlexGroup, EuiFlexItem, EuiIconTip } from '@elastic/eui'; +import { EuiCallOut, EuiFlexGroup, EuiFlexItem, EuiIconTip } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { ALL_VALUE } from '@kbn/slo-schema/src/schema/common'; import React from 'react'; import { useFormContext } from 'react-hook-form'; +import { useFetchGroupByCardinality } from '../../../../hooks/slo/use_fetch_group_by_cardinality'; import { useFetchIndexPatternFields } from '../../../../hooks/slo/use_fetch_index_pattern_fields'; import { CreateSLOForm } from '../../types'; import { DataPreviewChart } from '../common/data_preview_chart'; @@ -20,11 +21,17 @@ import { IndexSelection } from '../custom_common/index_selection'; export function CustomKqlIndicatorTypeForm() { const { watch } = useFormContext(); const index = watch('indicator.params.index'); + const timestampField = watch('indicator.params.timestampField'); + const groupByField = watch('groupBy'); + const { isLoading: isIndexFieldsLoading, data: indexFields = [] } = useFetchIndexPatternFields(index); const timestampFields = indexFields.filter((field) => field.type === 'date'); const groupByFields = indexFields.filter((field) => field.aggregatable); + const { isLoading: isGroupByCardinalityLoading, data: groupByCardinality } = + useFetchGroupByCardinality(index, timestampField, groupByField); + return ( @@ -158,6 +165,19 @@ export function CustomKqlIndicatorTypeForm() { isDisabled={!index} /> + {!isGroupByCardinalityLoading && !!groupByCardinality && ( + + )} + ); diff --git a/x-pack/plugins/observability/public/pages/slo_edit/components/custom_metric/custom_metric_type_form.tsx b/x-pack/plugins/observability/public/pages/slo_edit/components/custom_metric/custom_metric_type_form.tsx index c7a180d59cfbe..2db17479ffd2d 100644 --- a/x-pack/plugins/observability/public/pages/slo_edit/components/custom_metric/custom_metric_type_form.tsx +++ b/x-pack/plugins/observability/public/pages/slo_edit/components/custom_metric/custom_metric_type_form.tsx @@ -6,6 +6,7 @@ */ import { + EuiCallOut, EuiFlexGroup, EuiFlexItem, EuiHorizontalRule, @@ -18,6 +19,7 @@ import { FormattedMessage } from '@kbn/i18n-react'; import { ALL_VALUE } from '@kbn/slo-schema/src/schema/common'; import React from 'react'; import { useFormContext } from 'react-hook-form'; +import { useFetchGroupByCardinality } from '../../../../hooks/slo/use_fetch_group_by_cardinality'; import { useFetchIndexPatternFields } from '../../../../hooks/slo/use_fetch_index_pattern_fields'; import { CreateSLOForm } from '../../types'; import { DataPreviewChart } from '../common/data_preview_chart'; @@ -33,8 +35,14 @@ const SUPPORTED_METRIC_FIELD_TYPES = ['number', 'histogram']; export function CustomMetricIndicatorTypeForm() { const { watch } = useFormContext(); const index = watch('indicator.params.index'); + const timestampField = watch('indicator.params.timestampField'); + const groupByField = watch('groupBy'); + const { isLoading: isIndexFieldsLoading, data: indexFields = [] } = useFetchIndexPatternFields(index); + const { isLoading: isGroupByCardinalityLoading, data: groupByCardinality } = + useFetchGroupByCardinality(index, timestampField, groupByField); + const timestampFields = indexFields.filter((field) => field.type === 'date'); const groupByFields = indexFields.filter((field) => field.aggregatable); const metricFields = indexFields.filter((field) => @@ -175,6 +183,19 @@ export function CustomMetricIndicatorTypeForm() { isDisabled={!index} /> + {!isGroupByCardinalityLoading && !!groupByCardinality && ( + + )} + diff --git a/x-pack/plugins/observability/public/pages/slo_edit/components/custom_metric/metric_indicator.tsx b/x-pack/plugins/observability/public/pages/slo_edit/components/custom_metric/metric_indicator.tsx index 262e6e6d2249a..3e077ab2280a6 100644 --- a/x-pack/plugins/observability/public/pages/slo_edit/components/custom_metric/metric_indicator.tsx +++ b/x-pack/plugins/observability/public/pages/slo_edit/components/custom_metric/metric_indicator.tsx @@ -16,12 +16,12 @@ import { EuiIconTip, EuiSpacer, } from '@elastic/eui'; +import { FieldSpec } from '@kbn/data-views-plugin/common'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n-react'; import { first, range, xor } from 'lodash'; import React, { useEffect, useState } from 'react'; import { Controller, useFieldArray, useFormContext } from 'react-hook-form'; -import { Field } from '../../../../hooks/slo/use_fetch_index_pattern_fields'; import { aggValueToLabel, CUSTOM_METRIC_AGGREGATION_OPTIONS, @@ -32,7 +32,7 @@ import { QueryBuilder } from '../common/query_builder'; interface MetricIndicatorProps { type: 'good' | 'total'; - metricFields: Field[]; + metricFields: FieldSpec[]; isLoadingIndex: boolean; } diff --git a/x-pack/plugins/observability/public/pages/slo_edit/components/histogram/histogram_indicator.tsx b/x-pack/plugins/observability/public/pages/slo_edit/components/histogram/histogram_indicator.tsx index 1362674828d74..4efcc1bfb5b8b 100644 --- a/x-pack/plugins/observability/public/pages/slo_edit/components/histogram/histogram_indicator.tsx +++ b/x-pack/plugins/observability/public/pages/slo_edit/components/histogram/histogram_indicator.tsx @@ -15,17 +15,17 @@ import { EuiIconTip, EuiSpacer, } from '@elastic/eui'; +import { FieldSpec } from '@kbn/data-views-plugin/common'; import { i18n } from '@kbn/i18n'; import React, { Fragment, useEffect, useState } from 'react'; import { Controller, useFormContext } from 'react-hook-form'; -import { Field } from '../../../../hooks/slo/use_fetch_index_pattern_fields'; import { createOptionsFromFields, Option } from '../../helpers/create_options'; import { CreateSLOForm } from '../../types'; import { QueryBuilder } from '../common/query_builder'; interface HistogramIndicatorProps { type: 'good' | 'total'; - histogramFields: Field[]; + histogramFields: FieldSpec[]; isLoadingIndex: boolean; } diff --git a/x-pack/plugins/observability/public/pages/slo_edit/components/histogram/histogram_indicator_type_form.tsx b/x-pack/plugins/observability/public/pages/slo_edit/components/histogram/histogram_indicator_type_form.tsx index 9f8831fa9dfab..992547dc2802f 100644 --- a/x-pack/plugins/observability/public/pages/slo_edit/components/histogram/histogram_indicator_type_form.tsx +++ b/x-pack/plugins/observability/public/pages/slo_edit/components/histogram/histogram_indicator_type_form.tsx @@ -6,6 +6,7 @@ */ import { + EuiCallOut, EuiFlexGroup, EuiFlexItem, EuiHorizontalRule, @@ -18,6 +19,7 @@ import { FormattedMessage } from '@kbn/i18n-react'; import { ALL_VALUE } from '@kbn/slo-schema/src/schema/common'; import React from 'react'; import { useFormContext } from 'react-hook-form'; +import { useFetchGroupByCardinality } from '../../../../hooks/slo/use_fetch_group_by_cardinality'; import { useFetchIndexPatternFields } from '../../../../hooks/slo/use_fetch_index_pattern_fields'; import { CreateSLOForm } from '../../types'; import { DataPreviewChart } from '../common/data_preview_chart'; @@ -29,9 +31,14 @@ import { HistogramIndicator } from './histogram_indicator'; export function HistogramIndicatorTypeForm() { const { watch } = useFormContext(); const index = watch('indicator.params.index'); + const timestampField = watch('indicator.params.timestampField'); + const groupByField = watch('groupBy'); const { isLoading: isIndexFieldsLoading, data: indexFields = [] } = useFetchIndexPatternFields(index); + const { isLoading: isGroupByCardinalityLoading, data: groupByCardinality } = + useFetchGroupByCardinality(index, timestampField, groupByField); + const histogramFields = indexFields.filter((field) => field.type === 'histogram'); const timestampFields = indexFields.filter((field) => field.type === 'date'); const groupByFields = indexFields.filter((field) => field.aggregatable); @@ -162,6 +169,19 @@ export function HistogramIndicatorTypeForm() { isDisabled={!index} /> + {!isGroupByCardinalityLoading && !!groupByCardinality && ( + + )} + diff --git a/x-pack/plugins/observability/public/pages/slo_edit/components/slo_edit_form.tsx b/x-pack/plugins/observability/public/pages/slo_edit/components/slo_edit_form.tsx index 6627f910a7c27..e5f8e9b02ce2a 100644 --- a/x-pack/plugins/observability/public/pages/slo_edit/components/slo_edit_form.tsx +++ b/x-pack/plugins/observability/public/pages/slo_edit/components/slo_edit_form.tsx @@ -18,8 +18,7 @@ import { i18n } from '@kbn/i18n'; import type { GetSLOResponse } from '@kbn/slo-schema'; import React, { useCallback, useEffect, useState } from 'react'; import { FormProvider, useForm } from 'react-hook-form'; -import { sloFeatureId } from '../../../../common'; -import { SLO_BURN_RATE_RULE_TYPE_ID } from '../../../../common/constants'; +import { BurnRateRuleFlyout } from '../../slos/components/common/burn_rate_rule_flyout'; import { paths } from '../../../../common/locators/paths'; import { useCreateSlo } from '../../../hooks/slo/use_create_slo'; import { useFetchRulesForSlo } from '../../../hooks/slo/use_fetch_rules_for_slo'; @@ -54,7 +53,6 @@ export function SloEditForm({ slo }: Props) { const { application: { navigateToUrl }, http: { basePath }, - triggersActionsUi: { getAddRuleFlyout: AddRuleFlyout }, } = useKibana().services; const isEditMode = slo !== undefined; @@ -146,10 +144,6 @@ export function SloEditForm({ slo }: Props) { setIsCreateRuleCheckboxChecked(!isCreateRuleCheckboxChecked); }; - const handleCloseRuleFlyout = async () => { - navigateToUrl(basePath.prepend(paths.observability.slos)); - }; - return ( <> @@ -256,17 +250,11 @@ export function SloEditForm({ slo }: Props) { - {isAddRuleFlyoutOpen && slo ? ( - - ) : null} + ); } diff --git a/x-pack/plugins/observability/public/pages/slo_edit/components/timeslice_metric/metric_indicator.tsx b/x-pack/plugins/observability/public/pages/slo_edit/components/timeslice_metric/metric_indicator.tsx index 14cce99bb5d86..b8105814b852e 100644 --- a/x-pack/plugins/observability/public/pages/slo_edit/components/timeslice_metric/metric_indicator.tsx +++ b/x-pack/plugins/observability/public/pages/slo_edit/components/timeslice_metric/metric_indicator.tsx @@ -17,18 +17,18 @@ import { EuiSpacer, EuiText, } from '@elastic/eui'; +import { FieldSpec } from '@kbn/data-views-plugin/common'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n-react'; import { first, range, xor } from 'lodash'; import React from 'react'; import { Controller, useFieldArray, useFormContext } from 'react-hook-form'; -import { Field } from '../../../../hooks/slo/use_fetch_index_pattern_fields'; import { COMPARATOR_OPTIONS } from '../../constants'; import { CreateSLOForm } from '../../types'; import { MetricInput } from './metric_input'; interface MetricIndicatorProps { - indexFields: Field[]; + indexFields: FieldSpec[]; isLoadingIndex: boolean; } diff --git a/x-pack/plugins/observability/public/pages/slo_edit/components/timeslice_metric/metric_input.tsx b/x-pack/plugins/observability/public/pages/slo_edit/components/timeslice_metric/metric_input.tsx index 95cc277556020..22cbc42366baa 100644 --- a/x-pack/plugins/observability/public/pages/slo_edit/components/timeslice_metric/metric_input.tsx +++ b/x-pack/plugins/observability/public/pages/slo_edit/components/timeslice_metric/metric_input.tsx @@ -12,10 +12,10 @@ import { EuiFormRow, EuiIconTip, } from '@elastic/eui'; +import { FieldSpec } from '@kbn/data-views-plugin/common'; import { i18n } from '@kbn/i18n'; import React, { useEffect, useState } from 'react'; import { Controller, useFormContext } from 'react-hook-form'; -import { Field } from '../../../../hooks/slo/use_fetch_index_pattern_fields'; import { AGGREGATION_OPTIONS, aggValueToLabel } from '../../helpers/aggregation_options'; import { createOptionsFromFields, Option } from '../../helpers/create_options'; import { CreateSLOForm } from '../../types'; @@ -55,7 +55,7 @@ interface MetricInputProps { metricIndex: number; indexPattern: string; isLoadingIndex: boolean; - indexFields: Field[]; + indexFields: FieldSpec[]; } export function MetricInput({ diff --git a/x-pack/plugins/observability/public/pages/slo_edit/components/timeslice_metric/timeslice_metric_indicator.tsx b/x-pack/plugins/observability/public/pages/slo_edit/components/timeslice_metric/timeslice_metric_indicator.tsx index 2fde2468d78ec..1c01219ffe1a2 100644 --- a/x-pack/plugins/observability/public/pages/slo_edit/components/timeslice_metric/timeslice_metric_indicator.tsx +++ b/x-pack/plugins/observability/public/pages/slo_edit/components/timeslice_metric/timeslice_metric_indicator.tsx @@ -6,6 +6,7 @@ */ import { + EuiCallOut, EuiFlexGroup, EuiFlexItem, EuiHorizontalRule, @@ -19,6 +20,7 @@ import { FormattedMessage } from '@kbn/i18n-react'; import React from 'react'; import { useFormContext } from 'react-hook-form'; import { ALL_VALUE } from '@kbn/slo-schema/src/schema/common'; +import { useFetchGroupByCardinality } from '../../../../hooks/slo/use_fetch_group_by_cardinality'; import { useFetchIndexPatternFields } from '../../../../hooks/slo/use_fetch_index_pattern_fields'; import { CreateSLOForm } from '../../types'; import { DataPreviewChart } from '../common/data_preview_chart'; @@ -34,8 +36,14 @@ export { NEW_TIMESLICE_METRIC } from './metric_indicator'; export function TimesliceMetricIndicatorTypeForm() { const { watch } = useFormContext(); const index = watch('indicator.params.index'); + const timestampField = watch('indicator.params.timestampField'); + const groupByField = watch('groupBy'); + const { isLoading: isIndexFieldsLoading, data: indexFields = [] } = useFetchIndexPatternFields(index); + const { isLoading: isGroupByCardinalityLoading, data: groupByCardinality } = + useFetchGroupByCardinality(index, timestampField, groupByField); + const timestampFields = indexFields.filter((field) => field.type === 'date'); const groupByFields = indexFields.filter((field) => field.aggregatable); const { uiSettings } = useKibana().services; @@ -152,6 +160,19 @@ export function TimesliceMetricIndicatorTypeForm() { isDisabled={!index} /> + {!isGroupByCardinalityLoading && !!groupByCardinality && ( + + )} + boolean ): Option[] { const options = fields diff --git a/x-pack/plugins/observability/public/pages/slo_edit/slo_edit.test.tsx b/x-pack/plugins/observability/public/pages/slo_edit/slo_edit.test.tsx index 857cbdc7338a3..553969637129d 100644 --- a/x-pack/plugins/observability/public/pages/slo_edit/slo_edit.test.tsx +++ b/x-pack/plugins/observability/public/pages/slo_edit/slo_edit.test.tsx @@ -9,6 +9,7 @@ import { fireEvent, waitFor, cleanup } from '@testing-library/react'; import { createBrowserHistory } from 'history'; import React from 'react'; import Router from 'react-router-dom'; +import { observabilityAIAssistantPluginMock } from '@kbn/observability-ai-assistant-plugin/public/mock'; import { paths } from '../../../common/locators/paths'; import { buildSlo } from '../../data/slo/slo'; @@ -102,6 +103,7 @@ const mockKibana = () => { addSuccess: mockAddSuccess, }, }, + observabilityAIAssistant: observabilityAIAssistantPluginMock.createStartContract(), storage: { get: () => {}, }, diff --git a/x-pack/plugins/observability/public/pages/slo_edit/slo_edit.tsx b/x-pack/plugins/observability/public/pages/slo_edit/slo_edit.tsx index 27fda5cfc61fa..485ee068fc6f7 100644 --- a/x-pack/plugins/observability/public/pages/slo_edit/slo_edit.tsx +++ b/x-pack/plugins/observability/public/pages/slo_edit/slo_edit.tsx @@ -33,7 +33,7 @@ export function SloEditPage() { const { sloId } = useParams<{ sloId: string | undefined }>(); const { hasAtLeast } = useLicense(); const hasRightLicense = hasAtLeast('platinum'); - const { data: slo, isInitialLoading } = useFetchSloDetails({ sloId }); + const { data: slo } = useFetchSloDetails({ sloId }); useBreadcrumbs([ { @@ -66,10 +66,6 @@ export function SloEditPage() { navigateToUrl(basePath.prepend(paths.observability.slos)); } - if (sloId && isInitialLoading) { - return null; - } - return ( { +const getSubTitle = (slo: SLOWithSummaryResponse) => { return slo.groupBy && slo.groupBy !== ALL_VALUE ? `${slo.groupBy}: ${slo.instanceId}` : ''; }; @@ -88,14 +89,14 @@ export function SloCardItem({ slo, rules, activeAlerts, historicalSummary, cards } }} paddingSize="none" - style={{ - height: '182px', - overflow: 'hidden', - position: 'relative', - }} + css={css` + height: 182px; + overflow: hidden; + position: relative; + `} title={slo.summary.status} > - + {(isMouseOver || isActionsPopoverOpen) && ( ; }) { const { @@ -147,7 +146,7 @@ export function SloCardChart({ } = useKibana().services; const cardColor = useSloCardColor(slo.summary.status); - const subTitle = getSubTitle(slo, cardsPerRow); + const subTitle = getSubTitle(slo); const { sliValue, sloTarget, sloDetailsUrl } = useSloFormattedSummary(slo); return ( diff --git a/x-pack/plugins/observability/public/pages/slos/components/card_view/slos_card_view.tsx b/x-pack/plugins/observability/public/pages/slos/components/card_view/slos_card_view.tsx index a8d43c35217d1..3e1a80f147f2e 100644 --- a/x-pack/plugins/observability/public/pages/slos/components/card_view/slos_card_view.tsx +++ b/x-pack/plugins/observability/public/pages/slos/components/card_view/slos_card_view.tsx @@ -68,27 +68,29 @@ export function SloListCardView({ } return ( - - {sloList.map((slo) => ( - - - historicalSummary.sloId === slo.id && - historicalSummary.instanceId === (slo.instanceId ?? ALL_VALUE) - )?.data - } - historicalSummaryLoading={historicalSummaryLoading} - cardsPerRow={Number(cardsPerRow)} - /> - - ))} + + {sloList + .filter((slo) => slo.summary) + .map((slo) => ( + + + historicalSummary.sloId === slo.id && + historicalSummary.instanceId === (slo.instanceId ?? ALL_VALUE) + )?.data + } + historicalSummaryLoading={historicalSummaryLoading} + cardsPerRow={Number(cardsPerRow)} + /> + + ))} ); } diff --git a/x-pack/plugins/observability/public/pages/slos/components/common/burn_rate_rule_flyout.tsx b/x-pack/plugins/observability/public/pages/slos/components/common/burn_rate_rule_flyout.tsx index a02730231ae5f..871c11d39bdde 100644 --- a/x-pack/plugins/observability/public/pages/slos/components/common/burn_rate_rule_flyout.tsx +++ b/x-pack/plugins/observability/public/pages/slos/components/common/burn_rate_rule_flyout.tsx @@ -8,6 +8,7 @@ import React from 'react'; import { SLOWithSummaryResponse } from '@kbn/slo-schema'; import { useQueryClient } from '@tanstack/react-query'; +import { paths } from '../../../../../common/locators/paths'; import { useGetFilteredRuleTypes } from '../../../../hooks/use_get_filtered_rule_types'; import { sloKeys } from '../../../../hooks/slo/query_key_factory'; import { useKibana } from '../../../../utils/kibana_react'; @@ -17,13 +18,17 @@ import { sloFeatureId } from '../../../../../common'; export function BurnRateRuleFlyout({ slo, isAddRuleFlyoutOpen, + canChangeTrigger, setIsAddRuleFlyoutOpen, }: { - slo: SLOWithSummaryResponse; + slo?: SLOWithSummaryResponse; isAddRuleFlyoutOpen: boolean; - setIsAddRuleFlyoutOpen: (value: boolean) => void; + canChangeTrigger?: boolean; + setIsAddRuleFlyoutOpen?: (value: boolean) => void; }) { const { + application: { navigateToUrl }, + http: { basePath }, triggersActionsUi: { getAddRuleFlyout: AddRuleFlyout }, } = useKibana().services; @@ -32,19 +37,30 @@ export function BurnRateRuleFlyout({ const queryClient = useQueryClient(); const handleSavedRule = async () => { - queryClient.invalidateQueries({ queryKey: sloKeys.rules(), exact: false }); + if (setIsAddRuleFlyoutOpen) { + queryClient.invalidateQueries({ queryKey: sloKeys.rules(), exact: false }); + } else { + navigateToUrl(basePath.prepend(paths.observability.slos)); + } }; - return isAddRuleFlyoutOpen ? ( + const handleCloseRuleFlyout = async () => { + if (setIsAddRuleFlyoutOpen) { + setIsAddRuleFlyoutOpen(false); + } else { + navigateToUrl(basePath.prepend(paths.observability.slos)); + } + }; + + return isAddRuleFlyoutOpen && slo ? ( { - setIsAddRuleFlyoutOpen(false); - }} + onClose={handleCloseRuleFlyout} useRuleProducer /> ) : null; diff --git a/x-pack/plugins/observability/public/pages/slos/components/compact_view/slo_list_compact_view.tsx b/x-pack/plugins/observability/public/pages/slos/components/compact_view/slo_list_compact_view.tsx index d7e1c78d117e6..d884de55aed54 100644 --- a/x-pack/plugins/observability/public/pages/slos/components/compact_view/slo_list_compact_view.tsx +++ b/x-pack/plugins/observability/public/pages/slos/components/compact_view/slo_list_compact_view.tsx @@ -19,6 +19,7 @@ import { i18n } from '@kbn/i18n'; import { ALL_VALUE, SLOWithSummaryResponse } from '@kbn/slo-schema'; import { useQueryClient } from '@tanstack/react-query'; import React, { useState } from 'react'; +import { useCloneSlo } from '../../../../hooks/slo/use_clone_slo'; import { rulesLocatorID, sloFeatureId } from '../../../../../common'; import { SLO_BURN_RATE_RULE_TYPE_ID } from '../../../../../common/constants'; import { NOT_AVAILABLE_LABEL } from '../../../../../common/i18n'; @@ -28,7 +29,6 @@ import { SloStatusBadge } from '../../../../components/slo/slo_status_badge'; import { SloActiveAlertsBadge } from '../../../../components/slo/slo_status_badge/slo_active_alerts_badge'; import { sloKeys } from '../../../../hooks/slo/query_key_factory'; import { useCapabilities } from '../../../../hooks/slo/use_capabilities'; -import { useCloneSlo } from '../../../../hooks/slo/use_clone_slo'; import { useDeleteSlo } from '../../../../hooks/slo/use_delete_slo'; import { useFetchActiveAlerts } from '../../../../hooks/slo/use_fetch_active_alerts'; import { useFetchHistoricalSummary } from '../../../../hooks/slo/use_fetch_historical_summary'; @@ -37,10 +37,6 @@ import { useGetFilteredRuleTypes } from '../../../../hooks/use_get_filtered_rule import { RulesParams } from '../../../../locators/rules'; import { useKibana } from '../../../../utils/kibana_react'; import { formatHistoricalData } from '../../../../utils/slo/chart_data_formatter'; -import { - transformCreateSLOFormToCreateSLOInput, - transformSloResponseToCreateSloForm, -} from '../../../slo_edit/helpers/process_slo_form_values'; import { SloRulesBadge } from '../badges/slo_rules_badge'; import { SloListEmpty } from '../slo_list_empty'; import { SloListError } from '../slo_list_error'; @@ -72,7 +68,6 @@ export function SloListCompactView({ sloList, loading, error }: Props) { const filteredRuleTypes = useGetFilteredRuleTypes(); const queryClient = useQueryClient(); - const { mutate: cloneSlo } = useCloneSlo(); const { mutate: deleteSlo } = useDeleteSlo(); const [sloToAddRule, setSloToAddRule] = useState(undefined); @@ -102,6 +97,8 @@ export function SloListCompactView({ sloList, loading, error }: Props) { list: sloList.map((slo) => ({ sloId: slo.id, instanceId: slo.instanceId ?? ALL_VALUE })), }); + const navigateToClone = useCloneSlo(); + const actions: Array> = [ { type: 'icon', @@ -180,11 +177,7 @@ export function SloListCompactView({ sloList, loading, error }: Props) { 'data-test-subj': 'sloActionsClone', enabled: (_) => hasWriteCapabilities, onClick: (slo: SLOWithSummaryResponse) => { - const newSlo = transformCreateSLOFormToCreateSLOInput( - transformSloResponseToCreateSloForm({ ...slo, name: `[Copy] ${slo.name}` })! - ); - - cloneSlo({ slo: newSlo, originalSloId: slo.id }); + navigateToClone(slo); }, }, { diff --git a/x-pack/plugins/observability/public/pages/slos/components/slo_item_actions.tsx b/x-pack/plugins/observability/public/pages/slos/components/slo_item_actions.tsx index 4fb03968d40a0..51652abe13542 100644 --- a/x-pack/plugins/observability/public/pages/slos/components/slo_item_actions.tsx +++ b/x-pack/plugins/observability/public/pages/slos/components/slo_item_actions.tsx @@ -17,16 +17,12 @@ import { i18n } from '@kbn/i18n'; import React from 'react'; import { ALL_VALUE, SLOWithSummaryResponse } from '@kbn/slo-schema'; import styled from 'styled-components'; -import { useCapabilities } from '../../../hooks/slo/use_capabilities'; import { useCloneSlo } from '../../../hooks/slo/use_clone_slo'; +import { useCapabilities } from '../../../hooks/slo/use_capabilities'; import { useKibana } from '../../../utils/kibana_react'; import { paths } from '../../../../common/locators/paths'; import { RulesParams } from '../../../locators/rules'; import { rulesLocatorID } from '../../../../common'; -import { - transformCreateSLOFormToCreateSLOInput, - transformSloResponseToCreateSloForm, -} from '../../slo_edit/helpers/process_slo_form_values'; interface Props { slo: SLOWithSummaryResponse; @@ -73,7 +69,6 @@ export function SloItemActions({ }, } = useKibana().services; const { hasWriteCapabilities } = useCapabilities(); - const { mutate: cloneSlo } = useCloneSlo(); const sloDetailsUrl = basePath.prepend( paths.observability.sloDetails( @@ -94,18 +89,15 @@ export function SloItemActions({ navigateToUrl(basePath.prepend(paths.observability.sloEdit(slo.id))); }; - const handleNavigateToRules = async () => { - const locator = locators.get(rulesLocatorID); - locator?.navigate({ params: { sloId: slo.id } }, { replace: false }); - }; + const navigateToClone = useCloneSlo(); const handleClone = () => { - const newSlo = transformCreateSLOFormToCreateSLOInput( - transformSloResponseToCreateSloForm({ ...slo, name: `[Copy] ${slo.name}` })! - ); + navigateToClone(slo); + }; - cloneSlo({ slo: newSlo, originalSloId: slo.id }); - setIsActionsPopoverOpen(false); + const handleNavigateToRules = async () => { + const locator = locators.get(rulesLocatorID); + locator?.navigate({ params: { sloId: slo.id } }, { replace: false }); }; const handleDelete = () => { diff --git a/x-pack/plugins/observability/public/pages/slos/slos.test.tsx b/x-pack/plugins/observability/public/pages/slos/slos.test.tsx index 40fd12d4b003e..61e6190b79956 100644 --- a/x-pack/plugins/observability/public/pages/slos/slos.test.tsx +++ b/x-pack/plugins/observability/public/pages/slos/slos.test.tsx @@ -7,7 +7,7 @@ import { act, fireEvent, screen, waitFor } from '@testing-library/react'; import React from 'react'; - +import { observabilityAIAssistantPluginMock } from '@kbn/observability-ai-assistant-plugin/public/mock'; import { waitForEuiPopoverOpen } from '@elastic/eui/lib/test/rtl'; import { chartPluginMock } from '@kbn/charts-plugin/public/mocks'; @@ -15,7 +15,6 @@ import { paths } from '../../../common/locators/paths'; import { historicalSummaryData } from '../../data/slo/historical_summary_data'; import { emptySloList, sloList } from '../../data/slo/slo'; import { useCapabilities } from '../../hooks/slo/use_capabilities'; -import { useCloneSlo } from '../../hooks/slo/use_clone_slo'; import { useCreateSlo } from '../../hooks/slo/use_create_slo'; import { useDeleteSlo } from '../../hooks/slo/use_delete_slo'; import { useFetchHistoricalSummary } from '../../hooks/slo/use_fetch_historical_summary'; @@ -24,6 +23,7 @@ import { useLicense } from '../../hooks/use_license'; import { useKibana } from '../../utils/kibana_react'; import { render } from '../../utils/test_helper'; import { SlosPage } from './slos'; +import { encode } from '@kbn/rison'; jest.mock('react-router-dom', () => ({ ...jest.requireActual('react-router-dom'), @@ -35,7 +35,6 @@ jest.mock('../../utils/kibana_react'); jest.mock('../../hooks/use_license'); jest.mock('../../hooks/slo/use_fetch_slo_list'); jest.mock('../../hooks/slo/use_create_slo'); -jest.mock('../../hooks/slo/use_clone_slo'); jest.mock('../../hooks/slo/use_delete_slo'); jest.mock('../../hooks/slo/use_fetch_historical_summary'); jest.mock('../../hooks/slo/use_capabilities'); @@ -44,17 +43,14 @@ const useKibanaMock = useKibana as jest.Mock; const useLicenseMock = useLicense as jest.Mock; const useFetchSloListMock = useFetchSloList as jest.Mock; const useCreateSloMock = useCreateSlo as jest.Mock; -const useCloneSloMock = useCloneSlo as jest.Mock; const useDeleteSloMock = useDeleteSlo as jest.Mock; const useFetchHistoricalSummaryMock = useFetchHistoricalSummary as jest.Mock; const useCapabilitiesMock = useCapabilities as jest.Mock; const mockCreateSlo = jest.fn(); -const mockCloneSlo = jest.fn(); const mockDeleteSlo = jest.fn(); useCreateSloMock.mockReturnValue({ mutate: mockCreateSlo }); -useCloneSloMock.mockReturnValue({ mutate: mockCloneSlo }); useDeleteSloMock.mockReturnValue({ mutate: mockDeleteSlo }); const mockNavigate = jest.fn(); @@ -94,6 +90,7 @@ const mockKibana = () => { addError: mockAddError, }, }, + observabilityAIAssistant: observabilityAIAssistantPluginMock.createStartContract(), share: { url: { locators: { @@ -358,7 +355,14 @@ describe('SLOs Page', () => { button.click(); - expect(mockCloneSlo).toBeCalled(); + await waitFor(() => { + const slo = sloList.results.at(0); + expect(mockNavigate).toBeCalledWith( + paths.observability.sloCreateWithEncodedForm( + encode({ ...slo, name: `[Copy] ${slo!.name}`, id: undefined }) + ) + ); + }); }); }); }); diff --git a/x-pack/plugins/observability/public/pages/slos_welcome/slos_welcome.test.tsx b/x-pack/plugins/observability/public/pages/slos_welcome/slos_welcome.test.tsx index a6b4f671d306c..8290ecc2988be 100644 --- a/x-pack/plugins/observability/public/pages/slos_welcome/slos_welcome.test.tsx +++ b/x-pack/plugins/observability/public/pages/slos_welcome/slos_welcome.test.tsx @@ -17,6 +17,7 @@ import { SlosWelcomePage } from './slos_welcome'; import { emptySloList, sloList } from '../../data/slo/slo'; import { useCapabilities } from '../../hooks/slo/use_capabilities'; import { paths } from '../../../common/locators/paths'; +import { observabilityAIAssistantPluginMock } from '@kbn/observability-ai-assistant-plugin/public/mock'; jest.mock('@kbn/observability-shared-plugin/public'); jest.mock('../../utils/kibana_react'); @@ -33,16 +34,19 @@ const useGlobalDiagnosisMock = useFetchSloGlobalDiagnosis as jest.Mock; const mockNavigate = jest.fn(); +const mockObservabilityAIAssistant = observabilityAIAssistantPluginMock.createStartContract(); + const mockKibana = () => { useKibanaMock.mockReturnValue({ services: { - theme: {}, application: { navigateToUrl: mockNavigate }, + theme: {}, http: { basePath: { prepend: (url: string) => url, }, }, + observabilityAIAssistant: mockObservabilityAIAssistant, }, }); }; diff --git a/x-pack/plugins/observability/public/utils/test_helper.tsx b/x-pack/plugins/observability/public/utils/test_helper.tsx index 9428f887ed93c..61fb7bbade53f 100644 --- a/x-pack/plugins/observability/public/utils/test_helper.tsx +++ b/x-pack/plugins/observability/public/utils/test_helper.tsx @@ -62,6 +62,7 @@ export const render = (component: React.ReactNode, config: Subset exploratoryView: { createExploratoryViewUrl: jest.fn(), getAppDataView: jest.fn(), + // eslint-disable-next-line @kbn/i18n/strings_should_be_translated_with_i18n ExploratoryViewEmbeddable: () =>
Embeddable exploratory view
, }, }} diff --git a/x-pack/plugins/observability/server/lib/rules/slo_burn_rate/executor.ts b/x-pack/plugins/observability/server/lib/rules/slo_burn_rate/executor.ts index ddcd3b244dbb6..e1891e68af58b 100644 --- a/x-pack/plugins/observability/server/lib/rules/slo_burn_rate/executor.ts +++ b/x-pack/plugins/observability/server/lib/rules/slo_burn_rate/executor.ts @@ -98,7 +98,6 @@ export const getRuleExecutor = ({ const alertLimit = alertFactory.alertLimit.getValue(); let hasReachedLimit = false; let scheduledActionsCount = 0; - for (const result of results) { const { instanceId, @@ -172,40 +171,40 @@ export const getRuleExecutor = ({ scheduledActionsCount++; } } + alertFactory.alertLimit.setLimitReached(hasReachedLimit); + } - const { getRecoveredAlerts } = alertFactory.done(); - const recoveredAlerts = getRecoveredAlerts(); - for (const recoveredAlert of recoveredAlerts) { - const alertId = recoveredAlert.getId(); - const indexedStartedAt = getAlertStartedDate(alertId) ?? startedAt.toISOString(); - const alertUuid = recoveredAlert.getUuid(); - const alertDetailsUrl = await getAlertUrl( - alertUuid, - spaceId, - indexedStartedAt, - alertsLocator, - basePath.publicBaseUrl - ); + const { getRecoveredAlerts } = alertFactory.done(); + const recoveredAlerts = getRecoveredAlerts(); + for (const recoveredAlert of recoveredAlerts) { + const alertId = recoveredAlert.getId(); + const indexedStartedAt = getAlertStartedDate(alertId) ?? startedAt.toISOString(); + const alertUuid = recoveredAlert.getUuid(); + const alertDetailsUrl = await getAlertUrl( + alertUuid, + spaceId, + indexedStartedAt, + alertsLocator, + basePath.publicBaseUrl + ); - const urlQuery = alertId === ALL_VALUE ? '' : `?instanceId=${alertId}`; - const viewInAppUrl = addSpaceIdToPath( - basePath.publicBaseUrl, - spaceId, - `/app/observability/slos/${slo.id}${urlQuery}` - ); + const urlQuery = alertId === ALL_VALUE ? '' : `?instanceId=${alertId}`; + const viewInAppUrl = addSpaceIdToPath( + basePath.publicBaseUrl, + spaceId, + `/app/observability/slos/${slo.id}${urlQuery}` + ); - const context = { - timestamp: startedAt.toISOString(), - viewInAppUrl, - alertDetailsUrl, - sloId: slo.id, - sloName: slo.name, - sloInstanceId: alertId, - }; + const context = { + timestamp: startedAt.toISOString(), + viewInAppUrl, + alertDetailsUrl, + sloId: slo.id, + sloName: slo.name, + sloInstanceId: alertId, + }; - recoveredAlert.setContext(context); - } - alertFactory.alertLimit.setLimitReached(hasReachedLimit); + recoveredAlert.setContext(context); } return { state: {} }; diff --git a/x-pack/plugins/observability_ai_assistant/public/application.tsx b/x-pack/plugins/observability_ai_assistant/public/application.tsx index 15ed0243bd921..10e5403bba436 100644 --- a/x-pack/plugins/observability_ai_assistant/public/application.tsx +++ b/x-pack/plugins/observability_ai_assistant/public/application.tsx @@ -20,6 +20,8 @@ import type { ObservabilityAIAssistantService, } from './types'; +// This is the Conversation application. + export function Application({ coreStart, history, @@ -36,6 +38,7 @@ export function Application({ const theme = useMemo(() => { return { theme$ }; }, [theme$]); + return ( diff --git a/x-pack/plugins/observability_ai_assistant/public/components/chat/chat_body.tsx b/x-pack/plugins/observability_ai_assistant/public/components/chat/chat_body.tsx index 60aa56c15dda8..c38d328a87bcb 100644 --- a/x-pack/plugins/observability_ai_assistant/public/components/chat/chat_body.tsx +++ b/x-pack/plugins/observability_ai_assistant/public/components/chat/chat_body.tsx @@ -14,6 +14,8 @@ import { EuiHorizontalRule, EuiPanel, EuiSpacer, + useEuiTheme, + euiScrollBarStyles, } from '@elastic/eui'; import type { AuthenticatedUser } from '@kbn/security-plugin/common'; import { euiThemeVars } from '@kbn/ui-theme'; @@ -40,8 +42,9 @@ const fullHeightClassName = css` height: 100%; `; -const timelineClassName = css` +const timelineClassName = (scrollBarStyles: string) => css` overflow-y: auto; + ${scrollBarStyles} `; const promptEditorClassname = css` @@ -104,6 +107,8 @@ export function ChatBody({ }) { const license = useLicense(); const hasCorrectLicense = license?.hasAtLeast('enterprise'); + const euiTheme = useEuiTheme(); + const scrollBarStyles = euiScrollBarStyles(euiTheme); const chatService = useObservabilityAIAssistantChatService(); @@ -217,7 +222,7 @@ export function ChatBody({ } else { footer = ( <> - +
css` overflow-y: auto; + ${scrollBarStyles} `; const newChatButtonWrapperClassName = css` @@ -56,10 +59,12 @@ export function ConversationList({ onClickNewChat: () => void; onClickDeleteConversation: (id: string) => void; }) { + const euiTheme = useEuiTheme(); + const scrollBarStyles = euiScrollBarStyles(euiTheme); return ( - + diff --git a/x-pack/plugins/observability_ai_assistant/public/components/chat/welcome_message.test.tsx b/x-pack/plugins/observability_ai_assistant/public/components/chat/welcome_message.test.tsx index ce18f0fb0878d..56dd52c417a3b 100644 --- a/x-pack/plugins/observability_ai_assistant/public/components/chat/welcome_message.test.tsx +++ b/x-pack/plugins/observability_ai_assistant/public/components/chat/welcome_message.test.tsx @@ -97,17 +97,23 @@ const render = (component: React.ReactElement) => { return rtlRender({component}); }; -describe('Welcome Message', () => { - beforeEach(() => { - useKibanaMock.mockReturnValue({ - services: { - application: { navigateToApp, capabilities: {} }, - http: { basePath: { prepend: jest.fn((path: string) => `/${path}`) } }, +const defaultMockServices = { + services: { + application: { navigateToApp, capabilities: {} }, + http: { basePath: { prepend: jest.fn((path: string) => `/${path}`) } }, + plugins: { + start: { triggersActionsUi: { getAddConnectorFlyout: () => , }, }, - }); + }, + }, +}; + +describe('Welcome Message', () => { + beforeEach(() => { + useKibanaMock.mockReturnValue(defaultMockServices); }); describe('when no connectors are available', () => { @@ -159,8 +165,14 @@ describe('Welcome Message', () => { }, }, }, - triggersActionsUi: { - getAddConnectorFlyout: () => , + plugins: { + start: { + triggersActionsUi: { + getAddConnectorFlyout: () => ( + + ), + }, + }, }, }, }); diff --git a/x-pack/plugins/observability_ai_assistant/public/components/chat/welcome_message.tsx b/x-pack/plugins/observability_ai_assistant/public/components/chat/welcome_message.tsx index afd9cbdf0e76e..bae4cf0d5a92e 100644 --- a/x-pack/plugins/observability_ai_assistant/public/components/chat/welcome_message.tsx +++ b/x-pack/plugins/observability_ai_assistant/public/components/chat/welcome_message.tsx @@ -45,7 +45,11 @@ export function WelcomeMessage({ const { application: { navigateToApp, capabilities }, - triggersActionsUi: { getAddConnectorFlyout: ConnectorFlyout }, + plugins: { + start: { + triggersActionsUi: { getAddConnectorFlyout: ConnectorFlyout }, + }, + }, } = useKibana().services; const [connectorFlyoutOpen, setConnectorFlyoutOpen] = useState(false); diff --git a/x-pack/plugins/observability_ai_assistant/public/components/chat/welcome_message_connectors.tsx b/x-pack/plugins/observability_ai_assistant/public/components/chat/welcome_message_connectors.tsx index 314a1f853bb7a..4456abdf3c13c 100644 --- a/x-pack/plugins/observability_ai_assistant/public/components/chat/welcome_message_connectors.tsx +++ b/x-pack/plugins/observability_ai_assistant/public/components/chat/welcome_message_connectors.tsx @@ -7,9 +7,18 @@ import React from 'react'; import { css, keyframes } from '@emotion/css'; -import { EuiBetaBadge, EuiButton, EuiSpacer, EuiText } from '@elastic/eui'; +import { + EuiBetaBadge, + EuiButton, + EuiFlexGroup, + EuiFlexItem, + EuiIcon, + EuiSpacer, + EuiText, +} from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { euiThemeVars } from '@kbn/ui-theme'; +import { isHttpFetchError } from '@kbn/core-http-browser'; import type { UseGenAIConnectorsResult } from '../../hooks/use_genai_connectors'; const fadeInAnimation = keyframes` @@ -32,6 +41,34 @@ export function WelcomeMessageConnectors({ connectors: UseGenAIConnectorsResult; onSetupConnectorClick?: () => void; }) { + if (connectors.error) { + const isForbiddenError = + isHttpFetchError(connectors.error) && + (connectors.error.body as { statusCode: number }).statusCode === 403; + + return ( +
+ + + + + + + {isForbiddenError + ? i18n.translate( + 'xpack.observabilityAiAssistant.welcomeMessageConnectors.connectorsForbiddenTextLabel', + { defaultMessage: 'Required privileges to get connectors are missing' } + ) + : i18n.translate( + 'xpack.observabilityAiAssistant.welcomeMessageConnectors.connectorsErrorTextLabel', + { defaultMessage: 'Could not load connectors' } + )} + + + +
+ ); + } return !connectors.loading && connectors.connectors?.length === 0 && onSetupConnectorClick ? (
diff --git a/x-pack/plugins/observability_ai_assistant/public/components/insight/insight.tsx b/x-pack/plugins/observability_ai_assistant/public/components/insight/insight.tsx index 4ae3c685a4c97..bfe01db7fb49f 100644 --- a/x-pack/plugins/observability_ai_assistant/public/components/insight/insight.tsx +++ b/x-pack/plugins/observability_ai_assistant/public/components/insight/insight.tsx @@ -122,15 +122,13 @@ function ChatContent({ ); } -export function Insight({ - messages, - title, - dataTestSubj, -}: { +export interface InsightProps { messages: Message[]; title: string; dataTestSubj?: string; -}) { +} + +export function Insight({ messages, title, dataTestSubj }: InsightProps) { const [hasOpened, setHasOpened] = useState(false); const connectors = useGenAIConnectors(); diff --git a/x-pack/plugins/observability_ai_assistant/public/hooks/use_chat.ts b/x-pack/plugins/observability_ai_assistant/public/hooks/use_chat.ts index 92dab013aa067..e8759f2507340 100644 --- a/x-pack/plugins/observability_ai_assistant/public/hooks/use_chat.ts +++ b/x-pack/plugins/observability_ai_assistant/public/hooks/use_chat.ts @@ -53,7 +53,7 @@ export interface UseChatProps { export function useChat({ initialMessages, - initialConversationId: initialConversationIdFromProps, + initialConversationId, chatService, connectorId, onConversationUpdate, @@ -68,7 +68,9 @@ export function useChat({ useOnce(initialMessages); - const initialConversationId = useOnce(initialConversationIdFromProps); + useOnce(initialConversationId); + + const [conversationId, setConversationId] = useState(initialConversationId); const [messages, setMessages] = useState(initialMessages); @@ -127,7 +129,7 @@ export function useChat({ messages: getWithSystemMessage(nextMessages, systemMessage), persist, signal: abortControllerRef.current.signal, - conversationId: initialConversationId, + conversationId, }); function getPendingMessages() { @@ -188,6 +190,9 @@ export function useChat({ break; case StreamingChatResponseEventType.ConversationCreate: + setConversationId(event.conversation.id); + onConversationUpdateRef.current?.(event); + break; case StreamingChatResponseEventType.ConversationUpdate: onConversationUpdateRef.current?.(event); break; @@ -220,7 +225,7 @@ export function useChat({ systemMessage, handleError, persist, - initialConversationId, + conversationId, ] ); diff --git a/x-pack/plugins/observability_ai_assistant/public/hooks/use_kibana.ts b/x-pack/plugins/observability_ai_assistant/public/hooks/use_kibana.ts index 0362415d7a232..af2a06e010552 100644 --- a/x-pack/plugins/observability_ai_assistant/public/hooks/use_kibana.ts +++ b/x-pack/plugins/observability_ai_assistant/public/hooks/use_kibana.ts @@ -9,10 +9,9 @@ import { useKibana } from '@kbn/kibana-react-plugin/public'; import type { CoreStart } from '@kbn/core/public'; import type { ObservabilityAIAssistantPluginStartDependencies } from '../types'; -export type StartServices = CoreStart & - ObservabilityAIAssistantPluginStartDependencies & { - plugins: { start: ObservabilityAIAssistantPluginStartDependencies }; - } & TAdditionalServices & {}; +export type StartServices = CoreStart & { + plugins: { start: ObservabilityAIAssistantPluginStartDependencies }; +} & TAdditionalServices & {}; const useTypedKibana = () => useKibana>(); diff --git a/x-pack/plugins/observability_ai_assistant/public/index.ts b/x-pack/plugins/observability_ai_assistant/public/index.ts index fb77855d8898f..a5e33a8433861 100644 --- a/x-pack/plugins/observability_ai_assistant/public/index.ts +++ b/x-pack/plugins/observability_ai_assistant/public/index.ts @@ -5,8 +5,6 @@ * 2.0. */ import type { PluginInitializer, PluginInitializerContext } from '@kbn/core/public'; -import { lazy } from 'react'; -import { withSuspense } from '@kbn/shared-ux-utility'; import { ObservabilityAIAssistantPlugin } from './plugin'; import type { ObservabilityAIAssistantPluginSetup, @@ -16,21 +14,6 @@ import type { ConfigSchema, ObservabilityAIAssistantService, } from './types'; -export { mockService as mockObservabilityAIAssistantService } from './utils/storybook_decorator'; - -export const ContextualInsight = withSuspense( - lazy(() => import('./components/insight/insight').then((m) => ({ default: m.Insight }))) -); - -export const ObservabilityAIAssistantActionMenuItem = withSuspense( - lazy(() => - import('./components/action_menu_item/action_menu_item').then((m) => ({ - default: m.ObservabilityAIAssistantActionMenuItem, - })) - ) -); - -export { ObservabilityAIAssistantProvider } from './context/observability_ai_assistant_provider'; export type { ObservabilityAIAssistantPluginSetup, @@ -38,11 +21,6 @@ export type { ObservabilityAIAssistantService, }; -export { - useObservabilityAIAssistant, - useObservabilityAIAssistantOptional, -} from './hooks/use_observability_ai_assistant'; - export type { Conversation, Message, KnowledgeBaseEntry } from '../common'; export { MessageRole, KnowledgeBaseEntryRole } from '../common'; diff --git a/x-pack/plugins/observability_ai_assistant/public/mock.tsx b/x-pack/plugins/observability_ai_assistant/public/mock.tsx new file mode 100644 index 0000000000000..54dbd1d06c610 --- /dev/null +++ b/x-pack/plugins/observability_ai_assistant/public/mock.tsx @@ -0,0 +1,97 @@ +/* + * 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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import React from 'react'; +import { Observable } from 'rxjs'; +import { i18n } from '@kbn/i18n'; +import { AuthenticatedUser } from '@kbn/security-plugin-types-common'; +import { SharePluginStart } from '@kbn/share-plugin/public'; +import { StreamingChatResponseEvent } from '../common/conversation_complete'; +import { ObservabilityAIAssistantAPIClient } from './api'; +import type { + ObservabilityAIAssistantChatService, + ObservabilityAIAssistantPluginSetup, + ObservabilityAIAssistantPluginStart, + ObservabilityAIAssistantService, + PendingMessage, +} from './types'; +import { buildFunctionElasticsearch, buildFunctionServiceSummary } from './utils/builders'; + +export const mockChatService: ObservabilityAIAssistantChatService = { + analytics: { + optIn: () => {}, + reportEvent: () => {}, + telemetryCounter$: new Observable(), + }, + chat: (options) => new Observable(), + complete: (options) => new Observable(), + getContexts: () => [], + getFunctions: () => [buildFunctionElasticsearch(), buildFunctionServiceSummary()], + renderFunction: (name) => ( +
+ {i18n.translate('xpack.observabilityAiAssistant.chatService.div.helloLabel', { + defaultMessage: 'Hello', + })} + {name} +
+ ), + hasFunction: () => true, + hasRenderFunction: () => true, +}; + +export const mockService: ObservabilityAIAssistantService = { + isEnabled: () => true, + start: async () => { + return mockChatService; + }, + callApi: {} as ObservabilityAIAssistantAPIClient, + getCurrentUser: async (): Promise => ({ + username: 'user', + roles: [], + enabled: true, + authentication_realm: { name: 'foo', type: '' }, + lookup_realm: { name: 'foo', type: '' }, + authentication_provider: { name: '', type: '' }, + authentication_type: '', + elastic_cloud_user: false, + }), + getLicense: () => new Observable(), + getLicenseManagementLocator: () => + ({ + url: {}, + navigate: () => {}, + } as unknown as SharePluginStart), + register: () => {}, +}; + +function createSetupContract(): ObservabilityAIAssistantPluginSetup { + return {}; +} + +function createStartContract(): ObservabilityAIAssistantPluginStart { + return { + service: mockService, + + ObservabilityAIAssistantActionMenuItem: (() => ( + // eslint-disable-next-line @kbn/i18n/strings_should_be_translated_with_i18n +
Im a button
+ )) as unknown as ObservabilityAIAssistantPluginStart['ObservabilityAIAssistantActionMenuItem'], + ObservabilityAIAssistantContextualInsight: ( + // eslint-disable-next-line @kbn/i18n/strings_should_be_translated_with_i18n +
I give insight
+ ) as unknown as ObservabilityAIAssistantPluginStart['ObservabilityAIAssistantContextualInsight'], + useGenAIConnectors: () => ({ + loading: false, + selectConnector: () => {}, + reloadConnectors: () => {}, + }), + }; +} + +export const observabilityAIAssistantPluginMock = { + createSetupContract, + createStartContract, +}; diff --git a/x-pack/plugins/observability_ai_assistant/public/plugin.tsx b/x-pack/plugins/observability_ai_assistant/public/plugin.tsx index 64a1f4ae8d2fa..5ee13a1c5b6e8 100644 --- a/x-pack/plugins/observability_ai_assistant/public/plugin.tsx +++ b/x-pack/plugins/observability_ai_assistant/public/plugin.tsx @@ -4,7 +4,7 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import React from 'react'; +import React, { ComponentType, lazy, Ref } from 'react'; import ReactDOM from 'react-dom'; import { AppNavLinkStatus, @@ -17,6 +17,8 @@ import { } from '@kbn/core/public'; import { i18n } from '@kbn/i18n'; import type { Logger } from '@kbn/logging'; +import { KibanaContextProvider } from '@kbn/kibana-react-plugin/public'; +import { withSuspense } from '@kbn/shared-ux-utility'; import { createService } from './service/create_service'; import { useGenAIConnectorsWithoutContext } from './hooks/use_genai_connectors'; import type { @@ -28,6 +30,7 @@ import type { ObservabilityAIAssistantService, } from './types'; import { registerTelemetryEventTypes } from './analytics'; +import { ObservabilityAIAssistantProvider } from './context/observability_ai_assistant_provider'; export class ObservabilityAIAssistantPlugin implements @@ -117,9 +120,54 @@ export class ObservabilityAIAssistantPlugin }); }); + const withProviders =

( + Component: ComponentType

, + services: Omit & { + plugins: { start: ObservabilityAIAssistantPluginStartDependencies }; + } + ) => + React.forwardRef((props: P, ref: Ref) => ( + + + + + + )); + + const services = { + ...coreStart, + plugins: { + start: pluginsStart, + }, + }; + + const isEnabled = service.isEnabled(); + return { service, useGenAIConnectors: () => useGenAIConnectorsWithoutContext(service), + ObservabilityAIAssistantContextualInsight: isEnabled + ? withSuspense( + withProviders( + lazy(() => + import('./components/insight/insight').then((m) => ({ default: m.Insight })) + ), + services + ) + ) + : null, + ObservabilityAIAssistantActionMenuItem: isEnabled + ? withSuspense( + withProviders( + lazy(() => + import('./components/action_menu_item/action_menu_item').then((m) => ({ + default: m.ObservabilityAIAssistantActionMenuItem, + })) + ), + services + ) + ) + : null, }; } } diff --git a/x-pack/plugins/observability_ai_assistant/public/types.ts b/x-pack/plugins/observability_ai_assistant/public/types.ts index a664638365eaf..3c53243ffd48f 100644 --- a/x-pack/plugins/observability_ai_assistant/public/types.ts +++ b/x-pack/plugins/observability_ai_assistant/public/types.ts @@ -28,6 +28,8 @@ import type { } from '@kbn/data-views-plugin/public'; import type { LicensingPluginStart, ILicense } from '@kbn/licensing-plugin/public'; import type { SharePluginStart } from '@kbn/share-plugin/public'; +import { ForwardRefExoticComponent, RefAttributes } from 'react'; +import { WithSuspenseExtendedDeps } from '@kbn/shared-ux-utility'; import type { ContextDefinition, FunctionDefinition, @@ -38,6 +40,7 @@ import type { ObservabilityAIAssistantAPIClient } from './api'; import type { PendingMessage } from '../common/types'; import type { StreamingChatResponseEvent } from '../common/conversation_complete'; import type { UseGenAIConnectorsResult } from './hooks/use_genai_connectors'; +import type { InsightProps } from './components/insight/insight'; /* eslint-disable @typescript-eslint/no-empty-interface*/ @@ -92,12 +95,10 @@ export type ChatRegistrationRenderFunction = ({}: { registerRenderFunction: RegisterRenderFunctionDefinition; }) => Promise; -export interface ObservabilityAIAssistantPluginStart { - service: ObservabilityAIAssistantService; - useGenAIConnectors: () => UseGenAIConnectorsResult; -} +export interface ConfigSchema {} + +export type { PendingMessage }; -export interface ObservabilityAIAssistantPluginSetup {} export interface ObservabilityAIAssistantPluginSetupDependencies { dataViews: DataViewsPublicPluginSetup; features: FeaturesPluginSetup; @@ -106,6 +107,7 @@ export interface ObservabilityAIAssistantPluginSetupDependencies { security: SecurityPluginSetup; triggersActionsUi: TriggersAndActionsUIPublicPluginSetup; } + export interface ObservabilityAIAssistantPluginStartDependencies { dataViews: DataViewsPublicPluginStart; features: FeaturesPluginStart; @@ -117,6 +119,14 @@ export interface ObservabilityAIAssistantPluginStartDependencies { triggersActionsUi: TriggersAndActionsUIPublicPluginStart; } -export interface ConfigSchema {} +export interface ObservabilityAIAssistantPluginSetup {} -export type { PendingMessage }; +export interface ObservabilityAIAssistantPluginStart { + service: ObservabilityAIAssistantService; + ObservabilityAIAssistantContextualInsight: React.ForwardRefExoticComponent | null; + ObservabilityAIAssistantActionMenuItem: ForwardRefExoticComponent< + Pick & WithSuspenseExtendedDeps, 'css' | 'key' | 'analytics'> & + RefAttributes<{}> + > | null; + useGenAIConnectors: () => UseGenAIConnectorsResult; +} diff --git a/x-pack/plugins/observability_ai_assistant/public/utils/storybook_decorator.tsx b/x-pack/plugins/observability_ai_assistant/public/utils/storybook_decorator.tsx index 04a30ce53059d..0914bedbf82f2 100644 --- a/x-pack/plugins/observability_ai_assistant/public/utils/storybook_decorator.tsx +++ b/x-pack/plugins/observability_ai_assistant/public/utils/storybook_decorator.tsx @@ -4,69 +4,12 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { i18n } from '@kbn/i18n'; import { KibanaContextProvider } from '@kbn/kibana-react-plugin/public'; -import type { AuthenticatedUser } from '@kbn/security-plugin/common'; -import type { SharePluginStart } from '@kbn/share-plugin/public'; import React, { ComponentType } from 'react'; -import { Observable } from 'rxjs'; -import type { StreamingChatResponseEvent } from '../../common/conversation_complete'; -import { ObservabilityAIAssistantAPIClient } from '../api'; import { ObservabilityAIAssistantChatServiceProvider } from '../context/observability_ai_assistant_chat_service_provider'; import { ObservabilityAIAssistantProvider } from '../context/observability_ai_assistant_provider'; -import type { - ObservabilityAIAssistantChatService, - ObservabilityAIAssistantService, - PendingMessage, -} from '../types'; -import { buildFunctionElasticsearch, buildFunctionServiceSummary } from './builders'; - -const chatService: ObservabilityAIAssistantChatService = { - analytics: { - optIn: () => {}, - reportEvent: () => {}, - telemetryCounter$: new Observable(), - }, - chat: (options) => new Observable(), - complete: (options) => new Observable(), - getContexts: () => [], - getFunctions: () => [buildFunctionElasticsearch(), buildFunctionServiceSummary()], - renderFunction: (name) => ( -

- {i18n.translate('xpack.observabilityAiAssistant.chatService.div.helloLabel', { - defaultMessage: 'Hello', - })} - {name} -
- ), - hasFunction: () => true, - hasRenderFunction: () => true, -}; - -export const mockService: ObservabilityAIAssistantService = { - isEnabled: () => true, - start: async () => { - return chatService; - }, - callApi: {} as ObservabilityAIAssistantAPIClient, - getCurrentUser: async (): Promise => ({ - username: 'user', - roles: [], - enabled: true, - authentication_realm: { name: 'foo', type: '' }, - lookup_realm: { name: 'foo', type: '' }, - authentication_provider: { name: '', type: '' }, - authentication_type: '', - elastic_cloud_user: false, - }), - getLicense: () => new Observable(), - getLicenseManagementLocator: () => - ({ - url: {}, - navigate: () => {}, - } as unknown as SharePluginStart), - register: () => {}, -}; +// eslint-disable-next-line @kbn/imports/no_boundary_crossing +import { mockChatService, mockService } from '../mock'; export function KibanaReactStorybookDecorator(Story: ComponentType) { return ( @@ -83,7 +26,7 @@ export function KibanaReactStorybookDecorator(Story: ComponentType) { }} > - + diff --git a/x-pack/plugins/observability_ai_assistant/server/service/index.ts b/x-pack/plugins/observability_ai_assistant/server/service/index.ts index 595217bc69e5c..1068f1bd90cc5 100644 --- a/x-pack/plugins/observability_ai_assistant/server/service/index.ts +++ b/x-pack/plugins/observability_ai_assistant/server/service/index.ts @@ -312,7 +312,10 @@ export class ObservabilityAIAssistantService { }; await Promise.all( this.registrations.map((fn) => - fn({ signal, registerContext, registerFunction, resources, client }) + fn({ signal, registerContext, registerFunction, resources, client }).catch((error) => { + this.logger.error(`Error registering functions`); + this.logger.error(error); + }) ) ); diff --git a/x-pack/plugins/observability_ai_assistant/tsconfig.json b/x-pack/plugins/observability_ai_assistant/tsconfig.json index fdac7a82d4df2..7a4c5d24d8f34 100644 --- a/x-pack/plugins/observability_ai_assistant/tsconfig.json +++ b/x-pack/plugins/observability_ai_assistant/tsconfig.json @@ -53,7 +53,9 @@ "@kbn/tooling-log", "@kbn/babel-register", "@kbn/dev-cli-runner", - "@kbn/core-analytics-browser" + "@kbn/core-analytics-browser", + "@kbn/core-http-browser", + "@kbn/security-plugin-types-common" ], "exclude": ["target/**/*"] } diff --git a/x-pack/plugins/observability_log_explorer/public/components/discover_link.tsx b/x-pack/plugins/observability_log_explorer/public/components/discover_link.tsx index 2d12de11731c0..d2195124bc292 100644 --- a/x-pack/plugins/observability_log_explorer/public/components/discover_link.tsx +++ b/x-pack/plugins/observability_log_explorer/public/components/discover_link.tsx @@ -9,7 +9,11 @@ import { EuiHeaderLink } from '@elastic/eui'; import { DiscoverAppLocatorParams } from '@kbn/discover-plugin/common'; import { DiscoverStart } from '@kbn/discover-plugin/public'; import { hydrateDatasetSelection } from '@kbn/log-explorer-plugin/common'; -import { getDiscoverColumnsFromDisplayOptions } from '@kbn/log-explorer-plugin/public'; +import { + getDiscoverColumnsFromDisplayOptions, + getDiscoverFiltersFromState, +} from '@kbn/log-explorer-plugin/public'; +import { getRouterLinkProps } from '@kbn/router-utils'; import { MatchedStateFromActor } from '@kbn/xstate-utils'; import { useActor } from '@xstate/react'; import React, { useMemo } from 'react'; @@ -18,7 +22,6 @@ import { ObservabilityLogExplorerService, useObservabilityLogExplorerPageStateContext, } from '../state_machines/observability_log_explorer/src'; -import { getRouterLinkProps } from '../utils/get_router_link_props'; import { useKibanaContextForPlugin } from '../utils/use_kibana'; export const ConnectedDiscoverLink = React.memo(() => { @@ -54,7 +57,7 @@ export const DiscoverLinkForValidState = React.memo( () => ({ breakdownField: logExplorerState.chart.breakdownField ?? undefined, columns: getDiscoverColumnsFromDisplayOptions(logExplorerState), - filters: logExplorerState.filters, + filters: getDiscoverFiltersFromState(logExplorerState.filters, logExplorerState.controls), query: logExplorerState.query, refreshInterval: logExplorerState.refreshInterval, timeRange: logExplorerState.time, diff --git a/x-pack/plugins/observability_log_explorer/public/components/onboarding_link.tsx b/x-pack/plugins/observability_log_explorer/public/components/onboarding_link.tsx index abdc585c22768..261405c766024 100644 --- a/x-pack/plugins/observability_log_explorer/public/components/onboarding_link.tsx +++ b/x-pack/plugins/observability_log_explorer/public/components/onboarding_link.tsx @@ -10,10 +10,10 @@ import { ObservabilityOnboardingLocatorParams, OBSERVABILITY_ONBOARDING_LOCATOR, } from '@kbn/deeplinks-observability/locators'; +import { getRouterLinkProps } from '@kbn/router-utils'; import { BrowserUrlService } from '@kbn/share-plugin/public'; import React from 'react'; import { onboardingLinkTitle } from '../../common/translations'; -import { getRouterLinkProps } from '../utils/get_router_link_props'; import { useKibanaContextForPlugin } from '../utils/use_kibana'; export const ConnectedOnboardingLink = React.memo(() => { diff --git a/x-pack/plugins/observability_log_explorer/tsconfig.json b/x-pack/plugins/observability_log_explorer/tsconfig.json index be61fb9926a8c..0c03040b4203b 100644 --- a/x-pack/plugins/observability_log_explorer/tsconfig.json +++ b/x-pack/plugins/observability_log_explorer/tsconfig.json @@ -35,7 +35,8 @@ "@kbn/shared-ux-router", "@kbn/shared-ux-utility", "@kbn/ui-theme", - "@kbn/xstate-utils" + "@kbn/xstate-utils", + "@kbn/router-utils", ], "exclude": [ "target/**/*" diff --git a/x-pack/plugins/observability_shared/common/utils/get_inspect_response.ts b/x-pack/plugins/observability_shared/common/utils/get_inspect_response.ts index 85f6624225e5a..fbcb053acdc52 100644 --- a/x-pack/plugins/observability_shared/common/utils/get_inspect_response.ts +++ b/x-pack/plugins/observability_shared/common/utils/get_inspect_response.ts @@ -6,6 +6,7 @@ */ import { i18n } from '@kbn/i18n'; +import { v4 as uuidv4 } from 'uuid'; import type { KibanaRequest } from '@kbn/core/server'; import type { RequestStatistics, RequestStatus } from '@kbn/inspector-plugin/common'; import { Request } from '@kbn/inspector-plugin/common'; @@ -157,12 +158,13 @@ export function getInspectResponse({ operationName: string; startTime: number; }): InspectResponse[0] { - const id = `${operationName} (${kibanaRequest.route.path})`; + const name = `${operationName} (${kibanaRequest.route.path})`; + const id = `${name} ${uuidv4()}`; return { id, json: esRequestParams.body ?? esRequestParams, - name: id, + name, response: { json: esError ? esError.originalError : esResponse, }, diff --git a/x-pack/plugins/observability_shared/public/contexts/inspector/inspector_context.tsx b/x-pack/plugins/observability_shared/public/contexts/inspector/inspector_context.tsx index a595c6bd67a8e..0b87f0e4a5476 100644 --- a/x-pack/plugins/observability_shared/public/contexts/inspector/inspector_context.tsx +++ b/x-pack/plugins/observability_shared/public/contexts/inspector/inspector_context.tsx @@ -49,7 +49,7 @@ export function InspectorContextProvider({ children }: { children: ReactNode }) const requestParams = { id, name }; const requestResponder = inspectorAdapters.requests.start( - id, + name, requestParams, operation.startTime ); diff --git a/x-pack/plugins/osquery/cypress/e2e/all/alerts_linked_apps.cy.ts b/x-pack/plugins/osquery/cypress/e2e/all/alerts_linked_apps.cy.ts index 1c932435d8173..97dedb2ca6a2b 100644 --- a/x-pack/plugins/osquery/cypress/e2e/all/alerts_linked_apps.cy.ts +++ b/x-pack/plugins/osquery/cypress/e2e/all/alerts_linked_apps.cy.ts @@ -54,7 +54,7 @@ describe( cy.getBySel(RESPONSE_ACTIONS_ITEM_0).within(() => { cy.contains("SELECT * FROM os_version where name='{{host.os.name}}';"); - cy.contains('host.os.platform'); + cy.get('input[value="host.os.platform"]').should('exist'); cy.contains('platform'); }); cy.getBySel(RESPONSE_ACTIONS_ITEM_1).within(() => { diff --git a/x-pack/plugins/osquery/cypress/e2e/all/alerts_multiple_agents.cy.ts b/x-pack/plugins/osquery/cypress/e2e/all/alerts_multiple_agents.cy.ts index afea9bb8c0adf..ca10dc80fe6b6 100644 --- a/x-pack/plugins/osquery/cypress/e2e/all/alerts_multiple_agents.cy.ts +++ b/x-pack/plugins/osquery/cypress/e2e/all/alerts_multiple_agents.cy.ts @@ -49,7 +49,7 @@ describe( // This is probably due to the tokenization of the fields when it's inactive cy.get(OSQUERY_FLYOUT_BODY_EDITOR).click(); cy.getBySel('flyout-body-osquery').contains("SELECT * FROM os_version where name='Ubuntu';"); - cy.getBySel('flyout-body-osquery').contains('host.os.platform'); + cy.getBySel('flyout-body-osquery').find('input[value="host.os.platform"]').should('exist'); cy.getBySel('flyout-body-osquery').contains('platform'); }); diff --git a/x-pack/plugins/osquery/cypress/e2e/all/alerts_response_actions_form.cy.ts b/x-pack/plugins/osquery/cypress/e2e/all/alerts_response_actions_form.cy.ts index f0d3c3468f16c..0591e650cc560 100644 --- a/x-pack/plugins/osquery/cypress/e2e/all/alerts_response_actions_form.cy.ts +++ b/x-pack/plugins/osquery/cypress/e2e/all/alerts_response_actions_form.cy.ts @@ -157,8 +157,8 @@ describe('Alert Event Details - Response Actions Form', { tags: ['@ess', '@serve cy.contains('Days of uptime'); }); cy.getBySel(RESPONSE_ACTIONS_ITEM_1).within(() => { - cy.contains(packName); - cy.getBySel('comboBoxInput').type('{backspace}{enter}'); + cy.getBySel('comboBoxSearchInput').should('have.value', packName); + cy.getBySel('comboBoxInput').type('{selectall}{backspace}{enter}'); }); cy.getBySel(RESPONSE_ACTIONS_ITEM_0).within(() => { cy.contains('select * from uptime1'); @@ -166,6 +166,7 @@ describe('Alert Event Details - Response Actions Form', { tags: ['@ess', '@serve }); cy.getBySel(RESPONSE_ACTIONS_ITEM_0) .within(() => { + cy.getBySel('comboBoxSearchInput').click(); cy.contains('Search for a pack to run'); cy.contains('Pack is a required field'); cy.getBySel('comboBoxInput').type(`${packName}{downArrow}{enter}`); @@ -201,8 +202,10 @@ describe('Alert Event Details - Response Actions Form', { tags: ['@ess', '@serve cy.getBySel('edit-rule-actions-tab').click(); cy.getBySel(RESPONSE_ACTIONS_ITEM_0) .within(() => { - cy.contains(packName); - cy.getBySel('comboBoxInput').type(`${multiQueryPackName}{downArrow}{enter}`); + cy.getBySel('comboBoxSearchInput').should('have.value', packName); + cy.getBySel('comboBoxInput').type( + `{selectall}{backspace}${multiQueryPackName}{downArrow}{enter}` + ); cy.contains('SELECT * FROM memory_info;'); cy.contains('SELECT * FROM system_info;'); }) diff --git a/x-pack/plugins/osquery/cypress/e2e/all/packs_integration.cy.ts b/x-pack/plugins/osquery/cypress/e2e/all/packs_integration.cy.ts index 9e10e1eb0d889..8a972405015c9 100644 --- a/x-pack/plugins/osquery/cypress/e2e/all/packs_integration.cy.ts +++ b/x-pack/plugins/osquery/cypress/e2e/all/packs_integration.cy.ts @@ -86,7 +86,7 @@ describe('ALL - Packs', { tags: ['@ess', '@serverless'] }, () => { cy.visit(FLEET_AGENT_POLICIES); cy.contains(AGENT_POLICY_NAME).click(); cy.get('.euiTableCellContent') - .get('.euiPopover__anchor') + .get('.euiPopover') .get(`[aria-label="Open"]`) .first() .click(); @@ -308,14 +308,12 @@ describe('ALL - Packs', { tags: ['@ess', '@serverless'] }, () => { cy.getBySel(EDIT_PACK_HEADER_BUTTON).click(); cy.get('#shardsPercentage0').should('have.value', '15'); cy.getBySel('packShardsForm-1').within(() => { - cy.getBySel('shards-field-policy').contains(OSQUERY_POLICY); + cy.getBySel('shards-field-policy').find('input').should('value', OSQUERY_POLICY); cy.get('#shardsPercentage1').should('have.value', '0'); }); - cy.getBySel(POLICY_SELECT_COMBOBOX).within(() => { - cy.contains(OSQUERY_POLICY).should('not.exist'); - }); + cy.getBySel(POLICY_SELECT_COMBOBOX).find('input').should('not.have.value', OSQUERY_POLICY); - cy.getBySel('comboBoxInput').contains(OSQUERY_POLICY).should('exist'); + cy.getBySel('shards-field-policy').find(`input[value="${OSQUERY_POLICY}"]`).should('exist'); cy.getBySel(POLICY_SELECT_COMBOBOX).click(); cy.get('[data-test-subj="packShardsForm-1"]').within(() => { cy.get(`[aria-label="Delete shards row"]`).click(); diff --git a/x-pack/plugins/osquery/cypress/e2e/roles/t1_and_t2_analyst.cy.ts b/x-pack/plugins/osquery/cypress/e2e/roles/t1_and_t2_analyst.cy.ts index d512f5d5df5bb..afa0482c90a26 100644 --- a/x-pack/plugins/osquery/cypress/e2e/roles/t1_and_t2_analyst.cy.ts +++ b/x-pack/plugins/osquery/cypress/e2e/roles/t1_and_t2_analyst.cy.ts @@ -79,7 +79,9 @@ describe(`T1 and T2 analysts`, { tags: ['@ess', '@serverless'] }, () => { cy.contains(liveQueryQuery); cy.get(`[aria-label="Run query"]`).first().should('not.be.disabled'); cy.get(`[aria-label="Run query"]`).first().click(); - cy.contains(savedQueryName); + cy.get('[data-test-subj="savedQuerySelect"]') + .find('input') + .should('have.value', savedQueryName); submitQuery(); checkResults(); }); diff --git a/x-pack/plugins/profiling/public/app.tsx b/x-pack/plugins/profiling/public/app.tsx index 2d5dd828c18b0..e91c2eef4ec72 100644 --- a/x-pack/plugins/profiling/public/app.tsx +++ b/x-pack/plugins/profiling/public/app.tsx @@ -13,7 +13,6 @@ import { RouteRenderer, RouterProvider } from '@kbn/typed-react-router-config'; import React, { useMemo } from 'react'; import ReactDOM from 'react-dom'; import { HeaderMenuPortal } from '@kbn/observability-shared-plugin/public'; -import { ObservabilityAIAssistantProvider } from '@kbn/observability-ai-assistant-plugin/public'; import { CheckSetup } from './components/check_setup'; import { ProfilingDependenciesContextProvider } from './components/contexts/profiling_dependencies/profiling_dependencies_context'; import { RouteBreadcrumbsContextProvider } from './components/contexts/route_breadcrumbs_context'; @@ -84,35 +83,33 @@ function App({ - - - - - - - - - <> - - - - - - - - - - - - - - - - - + + + + + + + + <> + + + + + + + + + + + + + + + + diff --git a/x-pack/plugins/profiling/public/components/frame_information_window/frame_information_ai_assistant.tsx b/x-pack/plugins/profiling/public/components/frame_information_window/frame_information_ai_assistant.tsx index 9175115432f81..b82d8e2693a18 100644 --- a/x-pack/plugins/profiling/public/components/frame_information_window/frame_information_ai_assistant.tsx +++ b/x-pack/plugins/profiling/public/components/frame_information_window/frame_information_ai_assistant.tsx @@ -5,22 +5,20 @@ * 2.0. */ -import { i18n } from '@kbn/i18n'; -import { - ContextualInsight, - Message, - MessageRole, - useObservabilityAIAssistant, -} from '@kbn/observability-ai-assistant-plugin/public'; import React, { useMemo } from 'react'; +import { i18n } from '@kbn/i18n'; +import { Message, MessageRole } from '@kbn/observability-ai-assistant-plugin/public'; import { Frame } from '.'; +import { useProfilingDependencies } from '../contexts/profiling_dependencies/use_profiling_dependencies'; interface Props { frame?: Frame; } export function FrameInformationAIAssistant({ frame }: Props) { - const aiAssistant = useObservabilityAIAssistant(); + const { + observabilityAIAssistant: { ObservabilityAIAssistantContextualInsight }, + } = useProfilingDependencies().start; const promptMessages = useMemo(() => { if (frame?.functionName && frame.exeFileName) { @@ -91,8 +89,8 @@ export function FrameInformationAIAssistant({ frame }: Props) { return ( <> - {aiAssistant.isEnabled() && promptMessages ? ( - - + {ObservabilityAIAssistantActionMenuItem ? : null} ); } diff --git a/x-pack/plugins/profiling/public/embeddables/profiling_embeddable_provider.tsx b/x-pack/plugins/profiling/public/embeddables/profiling_embeddable_provider.tsx index 15e4af7bedb94..52000e4783620 100644 --- a/x-pack/plugins/profiling/public/embeddables/profiling_embeddable_provider.tsx +++ b/x-pack/plugins/profiling/public/embeddables/profiling_embeddable_provider.tsx @@ -6,7 +6,6 @@ */ import { KibanaContextProvider } from '@kbn/kibana-react-plugin/public'; -import { ObservabilityAIAssistantProvider } from '@kbn/observability-ai-assistant-plugin/public'; import React, { ReactChild, useMemo } from 'react'; import { CoreSetup, CoreStart } from '@kbn/core/public'; import { Storage } from '@kbn/kibana-utils-plugin/public'; @@ -53,11 +52,7 @@ export function ProfilingEmbeddableProvider({ deps, children }: Props) { - - {children} - + {children} diff --git a/x-pack/plugins/reporting/kibana.jsonc b/x-pack/plugins/reporting/kibana.jsonc index 55518519a5898..729a3f21b6ad8 100644 --- a/x-pack/plugins/reporting/kibana.jsonc +++ b/x-pack/plugins/reporting/kibana.jsonc @@ -15,13 +15,11 @@ "data", "discover", "fieldFormats", - "esUiShared", "home", "management", "licensing", "uiActions", "taskManager", - "embeddable", "screenshotMode", "share", "features" @@ -33,8 +31,10 @@ "screenshotting" ], "requiredBundles": [ - "kibanaReact", - "discover" + "discover", + "embeddable", + "esUiShared", + "kibanaReact" ] } } diff --git a/x-pack/plugins/reporting/public/share_context_menu/__snapshots__/screen_capture_panel_content.test.tsx.snap b/x-pack/plugins/reporting/public/share_context_menu/__snapshots__/screen_capture_panel_content.test.tsx.snap index 06ae63fee3128..16b666d519c46 100644 --- a/x-pack/plugins/reporting/public/share_context_menu/__snapshots__/screen_capture_panel_content.test.tsx.snap +++ b/x-pack/plugins/reporting/public/share_context_menu/__snapshots__/screen_capture_panel_content.test.tsx.snap @@ -134,7 +134,7 @@ exports[`ScreenCapturePanelContent properly renders a view with "canvas" layout class="euiAccordion__childWrapper emotion-euiAccordion__childWrapper-isClosed" id="advanced-options" inert="" - role="region" + role="group" style="block-size: 0;" tabindex="-1" > @@ -331,7 +331,7 @@ exports[`ScreenCapturePanelContent properly renders a view with "print" layout o class="euiAccordion__childWrapper emotion-euiAccordion__childWrapper-isClosed" id="advanced-options" inert="" - role="region" + role="group" style="block-size: 0;" tabindex="-1" > @@ -469,7 +469,7 @@ exports[`ScreenCapturePanelContent renders the default view properly 1`] = ` class="euiAccordion__childWrapper emotion-euiAccordion__childWrapper-isClosed" id="advanced-options" inert="" - role="region" + role="group" style="block-size: 0;" tabindex="-1" > diff --git a/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/simple_privilege_section/simple_privilege_section.test.tsx b/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/simple_privilege_section/simple_privilege_section.test.tsx index e336d75969246..e0b0156db7568 100644 --- a/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/simple_privilege_section/simple_privilege_section.test.tsx +++ b/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/simple_privilege_section/simple_privilege_section.test.tsx @@ -197,7 +197,7 @@ describe('', () => { const featurePrivilegeToggles = wrapper.find(EuiButtonGroup); expect(featurePrivilegeToggles).toHaveLength(1); - expect(featurePrivilegeToggles.find('input')).toHaveLength(3); + expect(featurePrivilegeToggles.find('button')).toHaveLength(3); (featurePrivilegeToggles.props() as EuiButtonGroupProps).onChange('feature1_all', null); diff --git a/x-pack/plugins/security/public/nav_control/nav_control_service.test.ts b/x-pack/plugins/security/public/nav_control/nav_control_service.test.ts index 6350641bf5da3..d2fa41f6d1c1f 100644 --- a/x-pack/plugins/security/public/nav_control/nav_control_service.test.ts +++ b/x-pack/plugins/security/public/nav_control/nav_control_service.test.ts @@ -80,41 +80,37 @@ describe('SecurityNavControlService', () => { data-test-subj="kbnRedirectAppLink" >
- + +
diff --git a/x-pack/plugins/security_solution/common/entity_analytics/risk_engine/constants.ts b/x-pack/plugins/security_solution/common/entity_analytics/risk_engine/constants.ts index 563fa4aa199b7..d876e2ebae11b 100644 --- a/x-pack/plugins/security_solution/common/entity_analytics/risk_engine/constants.ts +++ b/x-pack/plugins/security_solution/common/entity_analytics/risk_engine/constants.ts @@ -12,7 +12,9 @@ export const RISK_ENGINE_REQUIRED_ES_CLUSTER_PRIVILEGES = [ 'manage_transform', ] as ClusterPrivilege[]; +export const RISK_SCORE_INDEX_PATTERN = 'risk-score.risk-score-*'; + type RiskEngineIndexPrivilege = 'read' | 'write'; export const RISK_ENGINE_REQUIRED_ES_INDEX_PRIVILEGES = Object.freeze({ - 'risk-score.risk-score-*': ['read', 'write'] as RiskEngineIndexPrivilege[], + [RISK_SCORE_INDEX_PATTERN]: ['read', 'write'] as RiskEngineIndexPrivilege[], }); diff --git a/x-pack/plugins/security_solution/public/common/components/event_details/overview/__snapshots__/index.test.tsx.snap b/x-pack/plugins/security_solution/public/common/components/event_details/overview/__snapshots__/index.test.tsx.snap index c676809c3c2a5..d22fb49ab6627 100644 --- a/x-pack/plugins/security_solution/public/common/components/event_details/overview/__snapshots__/index.test.tsx.snap +++ b/x-pack/plugins/security_solution/public/common/components/event_details/overview/__snapshots__/index.test.tsx.snap @@ -82,33 +82,29 @@ exports[`Event Details Overview Cards renders rows and spacers correctly 1`] = ` class="c2" >
-
- -
+ + +
{ ); expect(wrapper.find('EuiFlexGroup[data-test-subj="itemEntryContainer"]')).toHaveLength(1); - expect(wrapper.find('[data-test-subj="entryField"]').text()).toEqual('Search'); - expect(wrapper.find('[data-test-subj="threatEntryField"]').text()).toEqual('Search'); + expect(wrapper.find('[data-test-subj="entryField"] input').props().placeholder).toEqual( + 'Search' + ); + expect(wrapper.find('[data-test-subj="threatEntryField"] input').props().placeholder).toEqual( + 'Search' + ); }); test('it displays "Search" for "listItems" that are passed in', async () => { @@ -108,7 +112,9 @@ describe('ThreatMatchComponent', () => { ); expect(wrapper.find('EuiFlexGroup[data-test-subj="itemEntryContainer"]')).toHaveLength(1); - expect(wrapper.find('[data-test-subj="entryField"]').at(0).text()).toEqual('Search'); + expect(wrapper.find('[data-test-subj="entryField"] input').at(0).props().placeholder).toEqual( + 'Search' + ); wrapper.unmount(); }); @@ -171,10 +177,18 @@ describe('ThreatMatchComponent', () => { await waitFor(() => { expect(wrapper.find('EuiFlexGroup[data-test-subj="itemEntryContainer"]')).toHaveLength(2); - expect(wrapper.find('[data-test-subj="entryField"]').at(0).text()).toEqual('Search'); - expect(wrapper.find('[data-test-subj="threatEntryField"]').at(0).text()).toEqual('Search'); - expect(wrapper.find('[data-test-subj="entryField"]').at(1).text()).toEqual('Search'); - expect(wrapper.find('[data-test-subj="threatEntryField"]').at(1).text()).toEqual('Search'); + expect(wrapper.find('[data-test-subj="entryField"] input').at(0).props().placeholder).toEqual( + 'Search' + ); + expect( + wrapper.find('[data-test-subj="threatEntryField"] input').at(0).props().placeholder + ).toEqual('Search'); + expect(wrapper.find('[data-test-subj="entryField"] input').at(1).props().placeholder).toEqual( + 'Search' + ); + expect( + wrapper.find('[data-test-subj="threatEntryField"] input').at(1).props().placeholder + ).toEqual('Search'); }); }); @@ -208,10 +222,18 @@ describe('ThreatMatchComponent', () => { await waitFor(() => { expect(wrapper.find('EuiFlexGroup[data-test-subj="entriesContainer"]')).toHaveLength(2); - expect(wrapper.find('[data-test-subj="entryField"]').at(0).text()).toEqual('Search'); - expect(wrapper.find('[data-test-subj="threatEntryField"]').at(0).text()).toEqual('Search'); - expect(wrapper.find('[data-test-subj="entryField"]').at(1).text()).toEqual('Search'); - expect(wrapper.find('[data-test-subj="threatEntryField"]').at(1).text()).toEqual('Search'); + expect(wrapper.find('[data-test-subj="entryField"] input').at(0).props().placeholder).toEqual( + 'Search' + ); + expect( + wrapper.find('[data-test-subj="threatEntryField"] input').at(0).props().placeholder + ).toEqual('Search'); + expect(wrapper.find('[data-test-subj="entryField"] input').at(1).props().placeholder).toEqual( + 'Search' + ); + expect( + wrapper.find('[data-test-subj="threatEntryField"] input').at(1).props().placeholder + ).toEqual('Search'); }); }); diff --git a/x-pack/plugins/security_solution/public/common/components/use_combo_box_reset/index.test.tsx b/x-pack/plugins/security_solution/public/common/components/use_combo_box_reset/index.test.tsx index e9082e2ca72a9..24f813cf81a5c 100644 --- a/x-pack/plugins/security_solution/public/common/components/use_combo_box_reset/index.test.tsx +++ b/x-pack/plugins/security_solution/public/common/components/use_combo_box_reset/index.test.tsx @@ -65,21 +65,21 @@ describe('useEuiComboBoxReset', () => { render(); - const initialValue = screen.getByTestId('comboBoxInput'); // EuiComboBox does NOT render the current selection via it's input; it uses this div - expect(initialValue).toHaveTextContent(options[0].label); + const initialValue = screen.getByRole('combobox'); + expect(initialValue).toHaveValue(options[0].label); // update the EuiComboBox input to an invalid value: - const searchInput = screen.getByTestId('comboBoxSearchInput'); // the actual controlled by EuiComboBox + const searchInput = screen.getByRole('combobox'); // the actual controlled by EuiComboBox fireEvent.change(searchInput, { target: { value: invalidValue } }); - const afterInvalidInput = screen.getByTestId('comboBoxInput'); + const afterInvalidInput = screen.getByRole('combobox'); expect(searchInput).toHaveValue(invalidValue); // the EuiComboBox is now in the "error state" expect(afterInvalidInput).not.toHaveTextContent(invalidValue); // Value should not have been applied const resetButton = screen.getByRole('button', { name: 'Reset' }); fireEvent.click(resetButton); // clicking invokes onReset() - const afterReset = screen.getByTestId('comboBoxInput'); - expect(afterReset).toHaveTextContent(options[0].label); // back to the default + const afterReset = screen.getByRole('combobox'); + expect(afterReset).toHaveValue(options[0].label); // back to the default }); }); diff --git a/x-pack/plugins/security_solution/public/common/components/with_hover_actions/index.tsx b/x-pack/plugins/security_solution/public/common/components/with_hover_actions/index.tsx index 85b1def4c4101..509d7610cb0fb 100644 --- a/x-pack/plugins/security_solution/public/common/components/with_hover_actions/index.tsx +++ b/x-pack/plugins/security_solution/public/common/components/with_hover_actions/index.tsx @@ -11,20 +11,12 @@ import { IS_DRAGGING_CLASS_NAME, } from '@kbn/securitysolution-t-grid'; import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'; -import styled from 'styled-components'; /** * To avoid expensive changes to the DOM, delay showing the popover menu */ const HOVER_INTENT_DELAY = 100; // ms -// eslint-disable-next-line @typescript-eslint/no-explicit-any -const WithHoverActionsPopover = styled(EuiPopover as any)` - .euiPopover__anchor { - width: 100%; - } -` as unknown as typeof EuiPopover; - interface Props { /** * Always show the hover menu contents (default: false) @@ -157,7 +149,7 @@ export const WithHoverActions = React.memo( className={alwaysShow ? HOVER_ACTIONS_ALWAYS_SHOW_CLASS_NAME : ''} onMouseLeave={onMouseLeave} > - ( repositionOnScroll={true} > {isOpen ?
{hoverContent}
: null} -
+
); } diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_table_filters/rule_search_field.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_table_filters/rule_search_field.tsx index 75d132b761654..b23786f07f379 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_table_filters/rule_search_field.tsx +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_table_filters/rule_search_field.tsx @@ -14,8 +14,7 @@ import * as i18n from '../../../../../detections/pages/detection_engine/rules/tr const SearchBarWrapper = styled(EuiFlexItem)` min-width: 200px; - & .euiPopover, - & .euiPopover__anchor { + & .euiPopover { // This is needed to "cancel" styles passed down from EuiTourStep that // interfere with EuiFieldSearch and don't allow it to take the full width display: block; diff --git a/x-pack/plugins/security_solution/public/detections/components/rules/step_about_rule_details/index.test.tsx b/x-pack/plugins/security_solution/public/detections/components/rules/step_about_rule_details/index.test.tsx index 8ec9c52e0b773..e1a6440edd0d0 100644 --- a/x-pack/plugins/security_solution/public/detections/components/rules/step_about_rule_details/index.test.tsx +++ b/x-pack/plugins/security_solution/public/detections/components/rules/step_about_rule_details/index.test.tsx @@ -148,11 +148,7 @@ describe('StepAboutRuleToggleDetails', () => { expect(wrapper.find('[idSelected="details"]').exists()).toBeTruthy(); expect(wrapper.find('[idSelected="notes"]').exists()).toBeFalsy(); - wrapper - .find('[title="Investigation guide"]') - .at(0) - .find('input') - .simulate('change', { target: { value: 'notes' } }); + wrapper.find('button[title="Investigation guide"]').simulate('click'); expect(wrapper.find('[idSelected="details"]').exists()).toBeFalsy(); expect(wrapper.find('[idSelected="notes"]').exists()).toBeTruthy(); @@ -174,11 +170,7 @@ describe('StepAboutRuleToggleDetails', () => { ); - wrapper - .find('[title="Investigation guide"]') - .at(0) - .find('input') - .simulate('change', { target: { value: 'notes' } }); + wrapper.find('button[title="Investigation guide"]').simulate('click'); expect(wrapper.find('EuiButtonGroup[idSelected="notes"]').exists()).toBeTruthy(); expect(wrapper.find('div.euiMarkdownFormat').text()).toEqual( @@ -254,11 +246,7 @@ describe('StepAboutRuleToggleDetails', () => { expect(wrapper.find('[idSelected="notes"]').exists()).toBeFalsy(); expect(wrapper.find('[idSelected="setup"]').exists()).toBeFalsy(); - wrapper - .find('[title="Setup guide"]') - .at(0) - .find('input') - .simulate('change', { target: { value: 'setup' } }); + wrapper.find('button[title="Setup guide"]').simulate('click'); expect(wrapper.find('[idSelected="details"]').exists()).toBeFalsy(); expect(wrapper.find('[idSelected="notes"]').exists()).toBeFalsy(); @@ -281,11 +269,7 @@ describe('StepAboutRuleToggleDetails', () => { ); - wrapper - .find('[title="Setup guide"]') - .at(0) - .find('input') - .simulate('change', { target: { value: 'setup' } }); + wrapper.find('button[title="Setup guide"]').simulate('click'); expect(wrapper.find('EuiButtonGroup[idSelected="setup"]').exists()).toBeTruthy(); expect(wrapper.find('div.euiMarkdownFormat').text()).toEqual( diff --git a/x-pack/plugins/security_solution/public/detections/components/rules/step_define_rule/index.test.tsx b/x-pack/plugins/security_solution/public/detections/components/rules/step_define_rule/index.test.tsx index b38f10994eb13..c8707897d18a8 100644 --- a/x-pack/plugins/security_solution/public/detections/components/rules/step_define_rule/index.test.tsx +++ b/x-pack/plugins/security_solution/public/detections/components/rules/step_define_rule/index.test.tsx @@ -393,16 +393,15 @@ describe('StepDefineRule', () => { ); expect(getByTestId(`eqlQueryBarTextInput`).textContent).toEqual(eqlQuery.queryBar.query.query); fireEvent.click(getByTestId(`eql-settings-trigger`)); - expect( - within(getByTestId(`eql-event-category-field`)).queryByText( - eqlQuery.eqlOptions.eventCategoryField - ) - ).toBeInTheDocument(); - expect( - within(getByTestId(`eql-tiebreaker-field`)).queryByText(eqlQuery.eqlOptions.tiebreakerField) - ).toBeInTheDocument(); - expect( - within(getByTestId(`eql-timestamp-field`)).queryByText(eqlQuery.eqlOptions.timestampField) - ).toBeInTheDocument(); + + expect(within(getByTestId(`eql-event-category-field`)).queryByRole('combobox')).toHaveValue( + eqlQuery.eqlOptions.eventCategoryField + ); + expect(within(getByTestId(`eql-tiebreaker-field`)).queryByRole('combobox')).toHaveValue( + eqlQuery.eqlOptions.tiebreakerField + ); + expect(within(getByTestId(`eql-timestamp-field`)).queryByRole('combobox')).toHaveValue( + eqlQuery.eqlOptions.timestampField + ); }); }); diff --git a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/chart_panels/chart_select/index.test.tsx b/x-pack/plugins/security_solution/public/detections/pages/detection_engine/chart_panels/chart_select/index.test.tsx index d5e956da14c0e..4d7798a4fcbe6 100644 --- a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/chart_panels/chart_select/index.test.tsx +++ b/x-pack/plugins/security_solution/public/detections/pages/detection_engine/chart_panels/chart_select/index.test.tsx @@ -62,23 +62,33 @@ describe('ChartSelect', () => { ); expect(screen.getByTestId('chart-select-tabs')).toBeInTheDocument(); - expect(screen.getByTestId('trend')).toBeChecked(); + expect(screen.getByTitle('Trend')).toHaveAttribute('aria-pressed', 'true'); }); - test('changing selection render correctly when alertsPageChartsEnabled is true', async () => { + test('changing selection render correctly when alertsPageChartsEnabled is true', () => { mockUseIsExperimentalFeatureEnabled.mockReturnValue(true); const setAlertViewSelection = jest.fn(); - const { container } = render( + const { rerender } = render( ); - const button = container.querySelector('input[value="treemap"]'); - if (button) { - fireEvent.change(button, { target: { checked: true, type: 'radio' } }); - } - expect(screen.getByTestId('treemap')).toBeChecked(); - expect(screen.getByTestId('trend')).not.toBeChecked(); + expect(screen.getByTitle('Trend')).toHaveAttribute('aria-pressed', 'true'); + + const treemapButton = screen.getByTitle('Treemap'); + expect(treemapButton).toHaveAttribute('aria-pressed', 'false'); + + fireEvent.click(treemapButton); + expect(setAlertViewSelection).toHaveBeenCalledWith('treemap'); + + rerender( + + + + ); + + expect(screen.getByTitle('Treemap')).toHaveAttribute('aria-pressed', 'true'); + expect(screen.getByTitle('Trend')).toHaveAttribute('aria-pressed', 'false'); }); }); diff --git a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/chart_panels/index.test.tsx b/x-pack/plugins/security_solution/public/detections/pages/detection_engine/chart_panels/index.test.tsx index 07f07df47d888..feb8b0ead2be4 100644 --- a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/chart_panels/index.test.tsx +++ b/x-pack/plugins/security_solution/public/detections/pages/detection_engine/chart_panels/index.test.tsx @@ -245,22 +245,21 @@ describe('ChartPanels', () => { ); - const initialValue = screen.getAllByTestId('comboBoxInput')[0]; // EuiComboBox does NOT render the current selection via it's input; it uses this div - expect(initialValue).toHaveTextContent(defaultValue); + const initialInput = screen.getAllByTestId('comboBoxSearchInput')[0]; + expect(initialInput).toHaveValue(defaultValue); // update the EuiComboBox input to an invalid value: - const searchInput = screen.getAllByTestId('comboBoxSearchInput')[0]; // the actual controlled by EuiComboBox - fireEvent.change(searchInput, { target: { value: invalidValue } }); + fireEvent.change(initialInput, { target: { value: invalidValue } }); - const afterInvalidInput = screen.getAllByTestId('comboBoxInput')[0]; - expect(searchInput).toHaveValue(invalidValue); // the 'Group by' EuiComboBox is now in the "error state" - expect(afterInvalidInput).not.toHaveTextContent(invalidValue); // Value should not have been applied + const afterInvalidInput = screen.getAllByTestId('comboBoxSearchInput')[0]; + expect(afterInvalidInput).toHaveValue(invalidValue); // the 'Group by' EuiComboBox is now in the "error state" + expect(afterInvalidInput).toBeInvalid(); resetGroupByFields(); // invoke the `Reset group by fields` context menu action await waitFor(() => { - const afterReset = screen.getAllByTestId('comboBoxInput')[0]; - expect(afterReset).toHaveTextContent(defaultValue); // back to the default + const afterReset = screen.getAllByTestId('comboBoxSearchInput')[0]; + expect(afterReset).toHaveValue(defaultValue); // back to the default }); }); }); @@ -285,22 +284,21 @@ describe('ChartPanels', () => { ); - const initialValue = screen.getAllByTestId('comboBoxInput')[1]; // EuiComboBox does NOT render the current selection via it's input; it uses this div - expect(initialValue).toHaveTextContent(defaultValue); + const initialInput = screen.getAllByTestId('comboBoxSearchInput')[1]; + expect(initialInput).toHaveValue(defaultValue); // update the EuiComboBox input to an invalid value: - const searchInput = screen.getAllByTestId('comboBoxSearchInput')[1]; // the actual controlled by EuiComboBox - fireEvent.change(searchInput, { target: { value: invalidValue } }); + fireEvent.change(initialInput, { target: { value: invalidValue } }); - const afterInvalidInput = screen.getAllByTestId('comboBoxInput')[1]; - expect(searchInput).toHaveValue(invalidValue); // the 'Group by top' EuiComboBox is now in the "error state" - expect(afterInvalidInput).not.toHaveTextContent(invalidValue); // Value should not have been applied + const afterInvalidInput = screen.getAllByTestId('comboBoxSearchInput')[1]; + expect(afterInvalidInput).toHaveValue(invalidValue); // the 'Group by top' EuiComboBox is now in the "error state" + expect(afterInvalidInput).toBeInvalid(); resetGroupByFields(); // invoke the `Reset group by fields` context menu action await waitFor(() => { - const afterReset = screen.getAllByTestId('comboBoxInput')[1]; - expect(afterReset).toHaveTextContent(defaultValue); // back to the default + const afterReset = screen.getAllByTestId('comboBoxSearchInput')[1]; + expect(afterReset).toHaveValue(defaultValue); // back to the default }); }); }); diff --git a/x-pack/plugins/security_solution/public/entity_analytics/common/index.ts b/x-pack/plugins/security_solution/public/entity_analytics/common/index.ts new file mode 100644 index 0000000000000..354e46ff63074 --- /dev/null +++ b/x-pack/plugins/security_solution/public/entity_analytics/common/index.ts @@ -0,0 +1,9 @@ +/* + * 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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +export { userHasRiskEngineReadPermissions } from './user_has_risk_engine_read_permissions'; +export * from './utils'; diff --git a/x-pack/plugins/security_solution/public/entity_analytics/common/user_has_risk_engine_read_permissions.test.ts b/x-pack/plugins/security_solution/public/entity_analytics/common/user_has_risk_engine_read_permissions.test.ts new file mode 100644 index 0000000000000..6425b68175935 --- /dev/null +++ b/x-pack/plugins/security_solution/public/entity_analytics/common/user_has_risk_engine_read_permissions.test.ts @@ -0,0 +1,57 @@ +/* + * 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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { userHasRiskEngineReadPermissions } from './user_has_risk_engine_read_permissions'; + +describe('userHasRiskEngineReadPermissions', () => { + it('returns false if isLoading is true', () => { + expect(userHasRiskEngineReadPermissions({ isLoading: true })).toEqual(false); + }); + it('returns true if hasAllRequiredPrivileges is true', () => { + expect( + userHasRiskEngineReadPermissions({ isLoading: false, hasAllRequiredPrivileges: true }) + ).toEqual(true); + }); + it('returns false if hasAllRequiredPrivileges is false and user is missing read permissions', () => { + expect( + userHasRiskEngineReadPermissions({ + isLoading: false, + hasAllRequiredPrivileges: false, + missingPrivileges: { + clusterPrivileges: [], + indexPrivileges: [['risk-score.risk-score-*', ['read']]], + }, + }) + ).toEqual(false); + }); + + it('returns true if hasAllRequiredPrivileges is false and user is missing read permissions for other index', () => { + expect( + userHasRiskEngineReadPermissions({ + isLoading: false, + hasAllRequiredPrivileges: false, + missingPrivileges: { + clusterPrivileges: [], + indexPrivileges: [['other-index.other-index-*', ['read']]], + }, + }) + ).toEqual(true); + }); + + it('returns true if hasAllRequiredPrivileges is false and user is not missing read permissions', () => { + expect( + userHasRiskEngineReadPermissions({ + isLoading: false, + hasAllRequiredPrivileges: false, + missingPrivileges: { + clusterPrivileges: [], + indexPrivileges: [['risk-score.risk-score-*', ['write']]], + }, + }) + ).toEqual(true); + }); +}); diff --git a/x-pack/plugins/security_solution/public/entity_analytics/common/user_has_risk_engine_read_permissions.ts b/x-pack/plugins/security_solution/public/entity_analytics/common/user_has_risk_engine_read_permissions.ts new file mode 100644 index 0000000000000..dac6f723da1dd --- /dev/null +++ b/x-pack/plugins/security_solution/public/entity_analytics/common/user_has_risk_engine_read_permissions.ts @@ -0,0 +1,30 @@ +/* + * 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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { RISK_SCORE_INDEX_PATTERN } from '../../../common/entity_analytics/risk_engine'; +import type { RiskEngineMissingPrivilegesResponse } from '../hooks/use_missing_risk_engine_privileges'; + +export const userHasRiskEngineReadPermissions = ( + privileges: RiskEngineMissingPrivilegesResponse +): boolean => { + if (privileges.isLoading) { + return false; + } + + if (privileges.hasAllRequiredPrivileges) { + return true; + } + + const { indexPrivileges: missingIndexPrivileges } = privileges.missingPrivileges; + + const isMissingReadPrivilege = missingIndexPrivileges.find( + ([indexName, indexPrivileges]) => + indexName === RISK_SCORE_INDEX_PATTERN && indexPrivileges.includes('read') + ); + + return !isMissingReadPrivilege; +}; diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/risk_engine_privileges_callout/risk_engine_privileges_callout.tsx b/x-pack/plugins/security_solution/public/entity_analytics/components/risk_engine_privileges_callout/risk_engine_privileges_callout.tsx index edb6bc11f7217..b2b4e0def3f54 100644 --- a/x-pack/plugins/security_solution/public/entity_analytics/components/risk_engine_privileges_callout/risk_engine_privileges_callout.tsx +++ b/x-pack/plugins/security_solution/public/entity_analytics/components/risk_engine_privileges_callout/risk_engine_privileges_callout.tsx @@ -9,15 +9,14 @@ import React from 'react'; import type { CallOutMessage } from '../../../common/components/callouts'; import { CallOutSwitcher } from '../../../common/components/callouts'; import { MissingPrivilegesCallOutBody, MISSING_PRIVILEGES_CALLOUT_TITLE } from './translations'; -import { useMissingPrivileges } from './use_missing_risk_engine_privileges'; - -export const RiskEnginePrivilegesCallOut = () => { - const privileges = useMissingPrivileges(); +import type { RiskEngineMissingPrivilegesResponse } from '../../hooks/use_missing_risk_engine_privileges'; +export const RiskEnginePrivilegesCallOut: React.FC<{ + privileges: RiskEngineMissingPrivilegesResponse; +}> = ({ privileges }) => { if (privileges.isLoading || privileges.hasAllRequiredPrivileges) { return null; } - const message: CallOutMessage = { type: 'primary', id: `missing-risk-engine-privileges`, diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/risk_score_enable_section.tsx b/x-pack/plugins/security_solution/public/entity_analytics/components/risk_score_enable_section.tsx index c93196a6336e5..fa61a6c15b9e8 100644 --- a/x-pack/plugins/security_solution/public/entity_analytics/components/risk_score_enable_section.tsx +++ b/x-pack/plugins/security_solution/public/entity_analytics/components/risk_score_enable_section.tsx @@ -28,7 +28,6 @@ import { EuiCallOut, EuiAccordion, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n-react'; import { LinkAnchor } from '@kbn/security-solution-navigation/links'; import { SecurityPageName } from '@kbn/security-solution-navigation'; import * as i18n from '../translations'; @@ -40,6 +39,7 @@ import { RiskEngineStatus, MAX_SPACES_COUNT } from '../../../common/entity_analy import { RiskInformationFlyout } from '../../explore/components/risk_score/risk_information'; import { useOnOpenCloseHandler } from '../../helper_hooks'; +import type { RiskEngineMissingPrivilegesResponse } from '../hooks/use_missing_risk_engine_privileges'; const MIN_WIDTH_TO_PREVENT_LABEL_FROM_MOVING = '50px'; @@ -64,47 +64,6 @@ const RiskScoreErrorPanel = ({ errors }: { errors: string[] }) => ( ))} - - -

- {i18n.NEED_TO_HAVE} -

    -
  • - {'all'}, - index: {'risk-score.risk-score-*'}, - }} - /> -
  • -
  • - - {'manage_index_templates'} - {','} {'manage_transform'} - - ), - }} - /> -
  • -
  • - {'Saved Objects Management'}, - }} - /> -
  • -
-

-
); @@ -177,7 +136,59 @@ const RiskScoreUpdateModal = ({ ); }; -export const RiskScoreEnableSection = () => { +const RiskEngineHealth: React.FC<{ currentRiskEngineStatus?: RiskEngineStatus | null }> = ({ + currentRiskEngineStatus, +}) => { + if (!currentRiskEngineStatus) { + return {'-'}; + } + if (currentRiskEngineStatus === RiskEngineStatus.ENABLED) { + return {i18n.RISK_SCORE_MODULE_STATUS_ON}; + } + return {i18n.RISK_SCORE_MODULE_STATUS_OFF}; +}; + +const RiskEngineStatusRow: React.FC<{ + currentRiskEngineStatus?: RiskEngineStatus | null; + onSwitchClick: () => void; + isLoading: boolean; + privileges: RiskEngineMissingPrivilegesResponse; +}> = ({ currentRiskEngineStatus, onSwitchClick, isLoading, privileges }) => { + const userHasRequiredPrivileges = + 'hasAllRequiredPrivileges' in privileges && privileges.hasAllRequiredPrivileges; + const btnIsDisabled = !currentRiskEngineStatus || isLoading || !userHasRequiredPrivileges; + + return ( + + {isLoading && ( + + + + )} + + + + + + + + ); +}; + +export const RiskScoreEnableSection: React.FC<{ + privileges: RiskEngineMissingPrivilegesResponse; +}> = ({ privileges }) => { const [isModalVisible, setIsModalVisible] = useState(false); const { data: riskEngineStatus, isFetching: isStatusLoading } = useRiskEngineStatus(); const initRiskEngineMutation = useInitRiskEngineMutation({ @@ -200,13 +211,13 @@ export const RiskScoreEnableSection = () => { initRiskEngineMutation.isLoading || enableRiskEngineMutation.isLoading || disableRiskEngineMutation.isLoading || + privileges.isLoading || isStatusLoading; const isUpdateAvailable = riskEngineStatus?.isUpdateAvailable; - const btnIsDisabled = !currentRiskEngineStatus || isLoading; const onSwitchClick = () => { - if (btnIsDisabled) { + if (!currentRiskEngineStatus || isLoading) { return; } @@ -295,34 +306,12 @@ export const RiskScoreEnableSection = () => { )} {!isUpdateAvailable && ( - - - {isLoading && ( - - )} - - - {currentRiskEngineStatus === RiskEngineStatus.ENABLED ? ( - {i18n.RISK_SCORE_MODULE_STATUS_ON} - ) : ( - {i18n.RISK_SCORE_MODULE_STATUS_OFF} - )} - - - - - + )} diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/risk_score_preview_section.tsx b/x-pack/plugins/security_solution/public/entity_analytics/components/risk_score_preview_section.tsx index ea499717e8341..c927a12f48a64 100644 --- a/x-pack/plugins/security_solution/public/entity_analytics/components/risk_score_preview_section.tsx +++ b/x-pack/plugins/security_solution/public/entity_analytics/components/risk_score_preview_section.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import React, { useState, useCallback } from 'react'; +import React, { useState, useCallback, useMemo } from 'react'; import type { DataView } from '@kbn/data-views-plugin/public'; import { EuiAccordion, @@ -17,10 +17,19 @@ import { EuiButton, EuiIcon, EuiText, + EuiLoadingSpinner, + EuiFlexGroup, + EuiFlexItem, + EuiCode, } from '@elastic/eui'; import type { BoolQuery, TimeRange, Query } from '@kbn/es-query'; import { buildEsQuery } from '@kbn/es-query'; -import { RiskScoreEntity, type RiskScore } from '../../../common/entity_analytics/risk_engine'; +import { FormattedMessage } from '@kbn/i18n-react'; +import { + RiskScoreEntity, + RISK_SCORE_INDEX_PATTERN, + type RiskScore, +} from '../../../common/entity_analytics/risk_engine'; import { RiskScorePreviewTable } from './risk_score_preview_table'; import * as i18n from '../translations'; import { useRiskScorePreview } from '../api/hooks/use_preview_risk_scores'; @@ -28,7 +37,8 @@ import { useKibana } from '../../common/lib/kibana'; import { SourcererScopeName } from '../../common/store/sourcerer/model'; import { useSourcererDataView } from '../../common/containers/sourcerer'; import { useAppToasts } from '../../common/hooks/use_app_toasts'; - +import type { RiskEngineMissingPrivilegesResponse } from '../hooks/use_missing_risk_engine_privileges'; +import { userHasRiskEngineReadPermissions } from '../common'; interface IRiskScorePreviewPanel { showMessage: string; hideMessage: string; @@ -43,6 +53,58 @@ const getRiskiestScores = (scores: RiskScore[] = [], field: string) => ?.sort((a, b) => b?.calculated_score_norm - a?.calculated_score_norm) ?.slice(0, 5) || []; +export const RiskScorePreviewSection: React.FC<{ + privileges: RiskEngineMissingPrivilegesResponse; +}> = ({ privileges }) => { + const sectionBody = useMemo(() => { + if (privileges.isLoading) { + return ( + + + + + + ); + } + if (userHasRiskEngineReadPermissions(privileges)) { + return ; + } + + return ; + }, [privileges]); + + return ( + <> + +

{i18n.PREVIEW}

+
+ + {sectionBody} + + ); +}; + +const MissingPermissionsCallout = () => { + return ( + + + {RISK_SCORE_INDEX_PATTERN}, + }} + /> + + + ); +}; + const RiskScorePreviewPanel = ({ items, showMessage, @@ -76,7 +138,7 @@ const RiskScorePreviewPanel = ({ ); }; -export const RiskScorePreviewSection = () => { +const RiskEnginePreview = () => { const [dateRange, setDateRange] = useState<{ from: string; to: string }>({ from: 'now-24h', to: 'now', @@ -150,10 +212,6 @@ export const RiskScorePreviewSection = () => { return ( <> - -

{i18n.PREVIEW}

-
- {i18n.PREVIEW_DESCRIPTION} diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/risk_engine_privileges_callout/use_missing_risk_engine_privileges.ts b/x-pack/plugins/security_solution/public/entity_analytics/hooks/use_missing_risk_engine_privileges.ts similarity index 71% rename from x-pack/plugins/security_solution/public/entity_analytics/components/risk_engine_privileges_callout/use_missing_risk_engine_privileges.ts rename to x-pack/plugins/security_solution/public/entity_analytics/hooks/use_missing_risk_engine_privileges.ts index aeda116c7a188..d51c2b2dfb49d 100644 --- a/x-pack/plugins/security_solution/public/entity_analytics/components/risk_engine_privileges_callout/use_missing_risk_engine_privileges.ts +++ b/x-pack/plugins/security_solution/public/entity_analytics/hooks/use_missing_risk_engine_privileges.ts @@ -6,10 +6,10 @@ */ import { useMemo } from 'react'; -import { useRiskEnginePrivileges } from '../../api/hooks/use_risk_engine_privileges'; -import type { MissingPrivileges } from '../../../../common/entity_analytics/risk_engine'; -import { getMissingRiskEnginePrivileges } from '../../../../common/entity_analytics/risk_engine'; -export type MissingPrivilegesResponse = +import { useRiskEnginePrivileges } from '../api/hooks/use_risk_engine_privileges'; +import { getMissingRiskEnginePrivileges } from '../../../common/entity_analytics/risk_engine'; +import type { MissingPrivileges } from '../../../common/entity_analytics/risk_engine'; +export type RiskEngineMissingPrivilegesResponse = | { isLoading: true } | { isLoading: false; hasAllRequiredPrivileges: true } | { @@ -18,10 +18,10 @@ export type MissingPrivilegesResponse = hasAllRequiredPrivileges: false; }; -export const useMissingPrivileges = (): MissingPrivilegesResponse => { +export const useMissingRiskEnginePrivileges = (): RiskEngineMissingPrivilegesResponse => { const { data: privilegesResponse, isLoading } = useRiskEnginePrivileges(); - return useMemo(() => { + return useMemo(() => { if (isLoading || !privilegesResponse) { return { isLoading: true, diff --git a/x-pack/plugins/security_solution/public/entity_analytics/pages/entity_analytics_management_page.tsx b/x-pack/plugins/security_solution/public/entity_analytics/pages/entity_analytics_management_page.tsx index 7bc395d279751..71b7e676eaae6 100644 --- a/x-pack/plugins/security_solution/public/entity_analytics/pages/entity_analytics_management_page.tsx +++ b/x-pack/plugins/security_solution/public/entity_analytics/pages/entity_analytics_management_page.tsx @@ -13,15 +13,13 @@ import { RiskScoreEnableSection } from '../components/risk_score_enable_section' import { ENTITY_ANALYTICS_RISK_SCORE } from '../../app/translations'; import { BETA } from '../../common/translations'; import { RiskEnginePrivilegesCallOut } from '../components/risk_engine_privileges_callout'; -import { useIsExperimentalFeatureEnabled } from '../../common/hooks/use_experimental_features'; +import { useMissingRiskEnginePrivileges } from '../hooks/use_missing_risk_engine_privileges'; export const EntityAnalyticsManagementPage = () => { - const privilegesCalloutEnabled = useIsExperimentalFeatureEnabled( - 'riskEnginePrivilegesRouteEnabled' - ); + const privileges = useMissingRiskEnginePrivileges(); return ( <> - {privilegesCalloutEnabled && } + { - + - + diff --git a/x-pack/plugins/security_solution/public/entity_analytics/translations.ts b/x-pack/plugins/security_solution/public/entity_analytics/translations.ts index 06880dbdd4ae1..533f28f207de6 100644 --- a/x-pack/plugins/security_solution/public/entity_analytics/translations.ts +++ b/x-pack/plugins/security_solution/public/entity_analytics/translations.ts @@ -98,6 +98,13 @@ export const EA_DOCS_ENTITY_RISK_SCORE = i18n.translate( } ); +export const PREVIEW_MISSING_PERMISSIONS_TITLE = i18n.translate( + 'xpack.securitySolution.riskScore.riskScorePreview.missingPermissionsCallout.title', + { + defaultMessage: 'Insifficient index privileges to preview data', + } +); + export const PREVIEW = i18n.translate('xpack.securitySolution.riskScore.riskScorePreview.preview', { defaultMessage: 'Preview', }); diff --git a/x-pack/plugins/security_solution/public/explore/components/authentication/__snapshots__/authentications_host_table.test.tsx.snap b/x-pack/plugins/security_solution/public/explore/components/authentication/__snapshots__/authentications_host_table.test.tsx.snap index cebd8a483aafb..b0b2754c24d3b 100644 --- a/x-pack/plugins/security_solution/public/explore/components/authentication/__snapshots__/authentications_host_table.test.tsx.snap +++ b/x-pack/plugins/security_solution/public/explore/components/authentication/__snapshots__/authentications_host_table.test.tsx.snap @@ -374,32 +374,28 @@ exports[`Authentication Host Table Component rendering it renders the host authe class="euiFlexItem emotion-euiFlexItem-grow-1" >
-
- -
+ + +
-
- -
+ + +
diff --git a/x-pack/plugins/security_solution/public/management/components/effected_policy_select/effected_policy_select.test.tsx b/x-pack/plugins/security_solution/public/management/components/effected_policy_select/effected_policy_select.test.tsx index 174496f1f3d21..f3fdb0b8009be 100644 --- a/x-pack/plugins/security_solution/public/management/components/effected_policy_select/effected_policy_select.test.tsx +++ b/x-pack/plugins/security_solution/public/management/components/effected_policy_select/effected_policy_select.test.tsx @@ -74,13 +74,13 @@ describe('when using EffectedPolicySelect component', () => { const selectGlobalPolicy = () => { act(() => { - fireEvent.click(renderResult.getByTestId('globalPolicy')); + fireEvent.click(renderResult.getByTestId('test-global')); }); }; const selectPerPolicy = () => { act(() => { - fireEvent.click(renderResult.getByTestId('perPolicy')); + fireEvent.click(renderResult.getByTestId('test-perPolicy')); }); }; @@ -142,7 +142,8 @@ describe('when using EffectedPolicySelect component', () => { }); it('should maintain policies selection even if global was checked, and user switched back to per policy', () => { - render(); + const { debug } = render(); + debug(undefined, 999999); selectPerPolicy(); clickOnPolicy(); diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/alerts_response_console.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/alerts_response_console.cy.ts index a736e05c33145..91557f3958f27 100644 --- a/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/alerts_response_console.cy.ts +++ b/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/alerts_response_console.cy.ts @@ -26,7 +26,7 @@ import { enableAllPolicyProtections } from '../../tasks/endpoint_policy'; import { createEndpointHost } from '../../tasks/create_endpoint_host'; import { deleteAllLoadedEndpointData } from '../../tasks/delete_all_endpoint_data'; -describe('Response console', { tags: ['@ess', '@serverless', '@brokenInServerless'] }, () => { +describe.skip('Response console', { tags: ['@ess', '@serverless', '@brokenInServerless'] }, () => { let indexedPolicy: IndexedFleetEndpointPolicyResponse; let policy: PolicyData; let createdHost: CreateAndEnrollEndpointHostResponse; @@ -65,7 +65,9 @@ describe('Response console', { tags: ['@ess', '@serverless', '@brokenInServerles } }); - describe('From Alerts', () => { + // FLAKY: https://github.com/elastic/kibana/issues/169689 + // FLAKY: https://github.com/elastic/kibana/issues/173472 + describe.skip('From Alerts', () => { let ruleId: string; let ruleName: string; diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/switching_policies/unenroll_agent_from_fleet_changing_policy_from_disabled_to_enabled.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/switching_policies/unenroll_agent_from_fleet_changing_policy_from_disabled_to_enabled.cy.ts index 3d92528c2eee7..0bd503db67e99 100644 --- a/x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/switching_policies/unenroll_agent_from_fleet_changing_policy_from_disabled_to_enabled.cy.ts +++ b/x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/switching_policies/unenroll_agent_from_fleet_changing_policy_from_disabled_to_enabled.cy.ts @@ -22,7 +22,9 @@ import { enableAllPolicyProtections } from '../../../tasks/endpoint_policy'; import { createEndpointHost } from '../../../tasks/create_endpoint_host'; import { deleteAllLoadedEndpointData } from '../../../tasks/delete_all_endpoint_data'; -describe( +// FLAKY: https://github.com/elastic/kibana/issues/173470 +// FLAKY: https://github.com/elastic/kibana/issues/170811 +describe.skip( 'Unenroll agent from fleet when agent tamper protection is disabled but then is switched to a policy with it enabled', { tags: ['@ess'] }, () => { diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/switching_policies/unenroll_agent_from_fleet_changing_policy_from_enabled_to_disabled.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/switching_policies/unenroll_agent_from_fleet_changing_policy_from_enabled_to_disabled.cy.ts index a9508a13f719b..d744abcb5b431 100644 --- a/x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/switching_policies/unenroll_agent_from_fleet_changing_policy_from_enabled_to_disabled.cy.ts +++ b/x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/switching_policies/unenroll_agent_from_fleet_changing_policy_from_enabled_to_disabled.cy.ts @@ -22,7 +22,7 @@ import { enableAllPolicyProtections } from '../../../tasks/endpoint_policy'; import { createEndpointHost } from '../../../tasks/create_endpoint_host'; import { deleteAllLoadedEndpointData } from '../../../tasks/delete_all_endpoint_data'; -describe( +describe.skip( 'Unenroll agent from fleet changing when agent tamper protection is enabled but then is switched to a policy with it disabled', { tags: ['@ess'] }, () => { diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/switching_policies/uninstall_agent_from_host_changing_policy_from_disabled_to_enabled.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/switching_policies/uninstall_agent_from_host_changing_policy_from_disabled_to_enabled.cy.ts index bbb675cf56d5e..ebd08694cd985 100644 --- a/x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/switching_policies/uninstall_agent_from_host_changing_policy_from_disabled_to_enabled.cy.ts +++ b/x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/switching_policies/uninstall_agent_from_host_changing_policy_from_disabled_to_enabled.cy.ts @@ -24,7 +24,9 @@ import { enableAllPolicyProtections } from '../../../tasks/endpoint_policy'; import { createEndpointHost } from '../../../tasks/create_endpoint_host'; import { deleteAllLoadedEndpointData } from '../../../tasks/delete_all_endpoint_data'; -describe( +// FLAKY: https://github.com/elastic/kibana/issues/173475 +// FLAKY: https://github.com/elastic/kibana/issues/170794 +describe.skip( 'Uninstall agent from host changing agent policy when agent tamper protection is disabled but then is switched to a policy with it enabled', { tags: ['@ess'] }, () => { diff --git a/x-pack/plugins/security_solution/public/management/pages/blocklist/view/components/blocklist_form.test.tsx b/x-pack/plugins/security_solution/public/management/pages/blocklist/view/components/blocklist_form.test.tsx index e07dc6f2d081b..c7d1c3a46d442 100644 --- a/x-pack/plugins/security_solution/public/management/pages/blocklist/view/components/blocklist_form.test.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/blocklist/view/components/blocklist_form.test.tsx @@ -368,7 +368,7 @@ describe('blocklist form', () => { it('should default to global policy', () => { render(); - expect(screen.getByTestId('globalPolicy')).toBeEnabled(); + expect(screen.getByTestId('blocklist-form-effectedPolicies-global')).toBeEnabled(); }); it('should correctly edit policies', () => { @@ -383,7 +383,7 @@ describe('blocklist form', () => { }, ] as PolicyData[]; render(createProps({ policies })); - const byPolicyButton = screen.getByTestId('perPolicy'); + const byPolicyButton = screen.getByTestId('blocklist-form-effectedPolicies-perPolicy'); userEvent.click(byPolicyButton); expect(byPolicyButton).toBeEnabled(); @@ -408,9 +408,9 @@ describe('blocklist form', () => { }, ] as PolicyData[]; render(createProps({ policies, item: createItem({ tags: [`policy:${policies[1].id}`] }) })); - expect(screen.getByTestId('globalPolicy')).toBeEnabled(); + expect(screen.getByTestId('blocklist-form-effectedPolicies-global')).toBeEnabled(); - const byPolicyButton = screen.getByTestId('perPolicy'); + const byPolicyButton = screen.getByTestId('blocklist-form-effectedPolicies-perPolicy'); userEvent.click(byPolicyButton); expect(byPolicyButton).toBeEnabled(); userEvent.click(screen.getByText(policies[0].name)); diff --git a/x-pack/plugins/security_solution/public/management/pages/event_filters/view/components/form.test.tsx b/x-pack/plugins/security_solution/public/management/pages/event_filters/view/components/form.test.tsx index 2870a67e7042c..168ecc6b84a72 100644 --- a/x-pack/plugins/security_solution/public/management/pages/event_filters/view/components/form.test.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/event_filters/view/components/form.test.tsx @@ -281,7 +281,7 @@ describe('Event filter form', () => { it('should display the policy list when "per policy" is selected', async () => { render(); - userEvent.click(renderResult.getByTestId('perPolicy')); + userEvent.click(renderResult.getByTestId('eventFilters-form-effectedPolicies-perPolicy')); rerenderWithLatestProps(); // policy selector should show up expect( @@ -308,17 +308,21 @@ describe('Event filter form', () => { it('should have global policy by default', async () => { render(); - expect(renderResult.getByTestId('globalPolicy')).toBeChecked(); - expect(renderResult.getByTestId('perPolicy')).not.toBeChecked(); + expect(renderResult.getByTestId('eventFilters-form-effectedPolicies-global')).toHaveAttribute( + 'aria-pressed', + 'true' + ); + expect( + renderResult.getByTestId('eventFilters-form-effectedPolicies-perPolicy') + ).toHaveAttribute('aria-pressed', 'false'); }); it('should retain the previous policy selection when switching from per-policy to global', async () => { formProps.item.tags = [formProps.policies.map((p) => `policy:${p.id}`)[0]]; render(); const policyId = formProps.policies[0].id; - // move to per-policy and select the first - userEvent.click(renderResult.getByTestId('perPolicy')); + userEvent.click(renderResult.getByTestId('eventFilters-form-effectedPolicies-perPolicy')); userEvent.click(renderResult.getByTestId(`policy-${policyId}`)); formProps.item.tags = formProps.onChange.mock.calls[0][0].item.tags; rerender(); @@ -328,7 +332,7 @@ describe('Event filter form', () => { expect(formProps.item.tags).toEqual([`policy:${policyId}`]); // move back to global - userEvent.click(renderResult.getByTestId('globalPolicy')); + userEvent.click(renderResult.getByTestId('eventFilters-form-effectedPolicies-global')); formProps.item.tags = ['policy:all']; rerenderWithLatestProps(); expect(formProps.item.tags).toEqual(['policy:all']); @@ -337,7 +341,7 @@ describe('Event filter form', () => { ).toBeFalsy(); // move back to per-policy - userEvent.click(renderResult.getByTestId('perPolicy')); + userEvent.click(renderResult.getByTestId('eventFilters-form-effectedPolicies-perPolicy')); formProps.item.tags = [`policy:${policyId}`]; rerender(); // on change called with the previous policy @@ -379,13 +383,17 @@ describe('Event filter form', () => { formProps.item.tags = ['policy:id-0']; rerender(); - expect(renderResult.queryByTestId('perPolicy')).not.toBeNull(); + expect( + renderResult.queryByTestId('eventFilters-form-effectedPolicies-perPolicy') + ).not.toBeNull(); expect(renderResult.getByTestId('policy-id-0').getAttribute('aria-disabled')).toBe('true'); }); it("allows the user to set the event filter entry to 'Global' in the edit option", () => { render(); - const globalButtonInput = renderResult.getByTestId('globalPolicy') as HTMLButtonElement; + const globalButtonInput = renderResult.getByTestId( + 'eventFilters-form-effectedPolicies-global' + ) as HTMLButtonElement; userEvent.click(globalButtonInput); formProps.item.tags = ['policy:all']; rerender(); diff --git a/x-pack/plugins/security_solution/public/management/pages/host_isolation_exceptions/view/components/integration_tests/form.test.tsx b/x-pack/plugins/security_solution/public/management/pages/host_isolation_exceptions/view/components/integration_tests/form.test.tsx index 268fa8ac3c47a..04b94c0262fea 100644 --- a/x-pack/plugins/security_solution/public/management/pages/host_isolation_exceptions/view/components/integration_tests/form.test.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/host_isolation_exceptions/view/components/integration_tests/form.test.tsx @@ -146,7 +146,9 @@ describe('When on the host isolation exceptions entry form', () => { }); it('should show policy as selected when user clicks on it', async () => { - userEvent.click(renderResult.getByTestId('perPolicy')); + userEvent.click( + renderResult.getByTestId('hostIsolationExceptions-form-effectedPolicies-perPolicy') + ); await clickOnEffectedPolicy(renderResult, testIdPrefix); await expect(isEffectedPolicySelected(renderResult, testIdPrefix)).resolves.toBe(true); @@ -154,20 +156,26 @@ describe('When on the host isolation exceptions entry form', () => { it('should retain the previous policy selection when switching from per-policy to global', async () => { // move to per-policy and select the first - userEvent.click(renderResult.getByTestId('perPolicy')); + userEvent.click( + renderResult.getByTestId('hostIsolationExceptions-form-effectedPolicies-perPolicy') + ); await clickOnEffectedPolicy(renderResult, testIdPrefix); await expect(isEffectedPolicySelected(renderResult, testIdPrefix)).resolves.toBe(true); // move back to global - userEvent.click(renderResult.getByTestId('globalPolicy')); + userEvent.click( + renderResult.getByTestId('hostIsolationExceptions-form-effectedPolicies-global') + ); expect( renderResult.queryByTestId(`${testIdPrefix}-effectedPolicies-policiesSelectable`) ).toBeFalsy(); // move back to per-policy - userEvent.click(renderResult.getByTestId('perPolicy')); + userEvent.click( + renderResult.getByTestId('hostIsolationExceptions-form-effectedPolicies-perPolicy') + ); await expect(isEffectedPolicySelected(renderResult, testIdPrefix)).resolves.toBe(true); }); }); diff --git a/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/components/form.test.tsx b/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/components/form.test.tsx index cc0111f23c416..df4b06ecc2b9c 100644 --- a/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/components/form.test.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/components/form.test.tsx @@ -430,7 +430,9 @@ describe('Trusted apps form', () => { expect(renderResult.getByTestId('policy-id-0-checkbox')).toBeChecked(); }); it("allows the user to set the trusted app entry to 'Global' in the edit option", () => { - const globalButtonInput = renderResult.getByTestId('globalPolicy') as HTMLButtonElement; + const globalButtonInput = renderResult.getByTestId( + 'trustedApps-form-effectedPolicies-global' + ) as HTMLButtonElement; act(() => { fireEvent.click(globalButtonInput); }); diff --git a/x-pack/plugins/security_solution/public/timelines/components/edit_data_provider/index.test.tsx b/x-pack/plugins/security_solution/public/timelines/components/edit_data_provider/index.test.tsx index 8fd5dce2da0d2..edcadfb2d391a 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/edit_data_provider/index.test.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/edit_data_provider/index.test.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { render, screen } from '@testing-library/react'; +import { render, screen, within } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import React from 'react'; @@ -42,7 +42,8 @@ describe('StatefulEditDataProvider', () => { ); - expect(screen.getByText(field)).toBeInTheDocument(); + const fieldWrapper = screen.getByTestId('field'); + expect(within(fieldWrapper).getByTestId('comboBoxSearchInput')).toHaveValue(field); }); test('it renders the expected placeholder for the current field when field is empty', () => { @@ -82,7 +83,8 @@ describe('StatefulEditDataProvider', () => { ); - expect(screen.getByText('is')).toBeInTheDocument(); + const fieldWrapper = screen.getByTestId('operator'); + expect(within(fieldWrapper).getByTestId('comboBoxSearchInput')).toHaveValue('is'); }); test('it renders the negated "is" operator in a humanized format when isExcluded is true', () => { @@ -102,7 +104,8 @@ describe('StatefulEditDataProvider', () => { ); - expect(screen.getByText('is not')).toBeInTheDocument(); + const fieldWrapper = screen.getByTestId('operator'); + expect(within(fieldWrapper).getByTestId('comboBoxSearchInput')).toHaveValue('is not'); }); test('it renders the "exists" operator in human-readable format', () => { @@ -122,7 +125,8 @@ describe('StatefulEditDataProvider', () => { ); - expect(screen.getByText('exists')).toBeInTheDocument(); + const fieldWrapper = screen.getByTestId('operator'); + expect(within(fieldWrapper).getByTestId('comboBoxSearchInput')).toHaveValue('exists'); }); test('it renders the negated "exists" operator in a humanized format when isExcluded is true', () => { @@ -142,7 +146,8 @@ describe('StatefulEditDataProvider', () => { ); - expect(screen.getByText('does not exist')).toBeInTheDocument(); + const fieldWrapper = screen.getByTestId('operator'); + expect(within(fieldWrapper).getByTestId('comboBoxSearchInput')).toHaveValue('does not exist'); }); test('it renders the "is one of" operator in human-readable format', () => { @@ -162,7 +167,8 @@ describe('StatefulEditDataProvider', () => { ); - expect(screen.getByText('is one of')).toBeInTheDocument(); + const fieldWrapper = screen.getByTestId('operator'); + expect(within(fieldWrapper).getByTestId('comboBoxSearchInput')).toHaveValue('is one of'); }); test('it renders the negated "is one of" operator in a humanized format when isExcluded is true', () => { @@ -182,7 +188,8 @@ describe('StatefulEditDataProvider', () => { ); - expect(screen.getByText('is not one of')).toBeInTheDocument(); + const fieldWrapper = screen.getByTestId('operator'); + expect(within(fieldWrapper).getByTestId('comboBoxSearchInput')).toHaveValue('is not one of'); }); test('it renders the current value when the operator is "is"', () => { @@ -244,7 +251,9 @@ describe('StatefulEditDataProvider', () => { /> ); - expect(screen.getByText('enter one or more values')).toBeInTheDocument(); + + const wrapper = screen.getByTestId('is-one-of-combobox-input'); + expect(within(wrapper).getByPlaceholderText('enter one or more values')).toBeInTheDocument(); }); test('it renders selected values when the type of value is an array and the operator is "is one of"', () => { @@ -326,8 +335,8 @@ describe('StatefulEditDataProvider', () => { ); - // EuiCombobox does not render placeholder text with placeholder tag - expect(screen.getByText('enter one or more values')).toBeInTheDocument(); + const wrapper = screen.getByTestId('is-one-of-combobox-input'); + expect(within(wrapper).getByPlaceholderText('enter one or more values')).toBeInTheDocument(); }); test('it does NOT render value when the operator is "exists"', () => { diff --git a/x-pack/plugins/security_solution/public/timelines/components/field_renderers/__snapshots__/field_renderers.test.tsx.snap b/x-pack/plugins/security_solution/public/timelines/components/field_renderers/__snapshots__/field_renderers.test.tsx.snap index bf7c1251f5202..2f11cdf57c3a6 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/field_renderers/__snapshots__/field_renderers.test.tsx.snap +++ b/x-pack/plugins/security_solution/public/timelines/components/field_renderers/__snapshots__/field_renderers.test.tsx.snap @@ -2,15 +2,11 @@ exports[`Field Renderers #autonomousSystemRenderer it renders correctly against snapshot 1`] = ` - .c0 .euiPopover__anchor { - width: 100%; -} - -.c1 > span.euiToolTipAnchor { + .c0 > span.euiToolTipAnchor { display: block; } -.c1 > span.euiToolTipAnchor.eui-textTruncate { +.c0 > span.euiToolTipAnchor.eui-textTruncate { display: inline-block; } @@ -24,29 +20,25 @@ exports[`Field Renderers #autonomousSystemRenderer it renders correctly against class="" >
-
- - Test Org - + Test Org -
+
@@ -64,29 +56,25 @@ exports[`Field Renderers #autonomousSystemRenderer it renders correctly against class="" >
-
- - 12345 - + 12345 -
+
@@ -108,15 +96,11 @@ exports[`Field Renderers #dateRenderer it renders correctly against snapshot 1`] exports[`Field Renderers #hostIdRenderer it renders correctly against snapshot 1`] = ` - .c0 .euiPopover__anchor { - width: 100%; -} - -.c1 > span.euiToolTipAnchor { + .c0 > span.euiToolTipAnchor { display: block; } -.c1 > span.euiToolTipAnchor.eui-textTruncate { +.c0 > span.euiToolTipAnchor.eui-textTruncate { display: inline-block; } @@ -124,36 +108,32 @@ exports[`Field Renderers #hostIdRenderer it renders correctly against snapshot 1 class="" >
-
- - - raspberrypi - - + raspberrypi + -
+
@@ -163,15 +143,11 @@ exports[`Field Renderers #hostIdRenderer it renders correctly against snapshot 1 exports[`Field Renderers #hostNameRenderer it renders correctly against snapshot 1`] = ` - .c0 .euiPopover__anchor { - width: 100%; -} - -.c1 > span.euiToolTipAnchor { + .c0 > span.euiToolTipAnchor { display: block; } -.c1 > span.euiToolTipAnchor.eui-textTruncate { +.c0 > span.euiToolTipAnchor.eui-textTruncate { display: inline-block; } @@ -179,36 +155,32 @@ exports[`Field Renderers #hostNameRenderer it renders correctly against snapshot class="" >
-
- - - raspberrypi - - + raspberrypi + -
+
@@ -218,15 +190,11 @@ exports[`Field Renderers #hostNameRenderer it renders correctly against snapshot exports[`Field Renderers #locationRenderer it renders correctly against snapshot 1`] = ` - .c0 .euiPopover__anchor { - width: 100%; -} - -.c1 > span.euiToolTipAnchor { + .c0 > span.euiToolTipAnchor { display: block; } -.c1 > span.euiToolTipAnchor.eui-textTruncate { +.c0 > span.euiToolTipAnchor.eui-textTruncate { display: inline-block; } @@ -240,29 +208,25 @@ exports[`Field Renderers #locationRenderer it renders correctly against snapshot class="" >
-
- - New York - + New York -
+
@@ -276,29 +240,25 @@ exports[`Field Renderers #locationRenderer it renders correctly against snapshot class="" >
-
- - New York - + New York -
+
diff --git a/x-pack/plugins/security_solution/public/timelines/components/flyout/__snapshots__/index.test.tsx.snap b/x-pack/plugins/security_solution/public/timelines/components/flyout/__snapshots__/index.test.tsx.snap index 5ef25f98932c0..76ff4c26321be 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/flyout/__snapshots__/index.test.tsx.snap +++ b/x-pack/plugins/security_solution/public/timelines/components/flyout/__snapshots__/index.test.tsx.snap @@ -69,26 +69,22 @@ exports[`Flyout rendering it renders correctly against snapshot 1`] = ` class="euiFlexItem emotion-euiFlexItem-growZero" >
-
- -
+
diff --git a/x-pack/plugins/security_solution/public/timelines/components/netflow/__snapshots__/index.test.tsx.snap b/x-pack/plugins/security_solution/public/timelines/components/netflow/__snapshots__/index.test.tsx.snap index 8ad225711b773..919d237027815 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/netflow/__snapshots__/index.test.tsx.snap +++ b/x-pack/plugins/security_solution/public/timelines/components/netflow/__snapshots__/index.test.tsx.snap @@ -2,13 +2,13 @@ exports[`Netflow renders correctly against snapshot 1`] = ` - .c13 svg { + .c12 svg { position: relative; top: -1px; } -.c11, -.c11 * { +.c10, +.c10 * { display: inline-block; max-width: 100%; overflow: hidden; @@ -17,18 +17,14 @@ exports[`Netflow renders correctly against snapshot 1`] = ` white-space: nowrap; } -.c1 .euiPopover__anchor { - width: 100%; -} - -.c3 { +.c2 { border-radius: 2px; padding: 0 4px 0 8px; position: relative; z-index: 0 !important; } -.c3::before { +.c2::before { background-image: linear-gradient( 135deg, #535966 25%, transparent 25% ), linear-gradient( -135deg, #535966 25%, transparent 25% ), linear-gradient( 135deg, transparent 75%, #535966 75% ), linear-gradient( -135deg, transparent 75%, #535966 75% ); background-position: 0 0,1px 0,1px -1px,0px 1px; background-size: 2px 2px; @@ -41,147 +37,147 @@ exports[`Netflow renders correctly against snapshot 1`] = ` width: 4px; } -.c3:hover, -.c3:hover .euiBadge, -.c3:hover .euiBadge__text { +.c2:hover, +.c2:hover .euiBadge, +.c2:hover .euiBadge__text { cursor: move; cursor: -webkit-grab; cursor: -moz-grab; cursor: grab; } -.event-column-view:hover .c3::before, -tr:hover .c3::before { +.event-column-view:hover .c2::before, +tr:hover .c2::before { background-image: linear-gradient( 135deg, #98a2b3 25%, transparent 25% ), linear-gradient( -135deg, #98a2b3 25%, transparent 25% ), linear-gradient( 135deg, transparent 75%, #98a2b3 75% ), linear-gradient( -135deg, transparent 75%, #98a2b3 75% ); } -.c3:hover, -.c3:focus, -.event-column-view:hover .c3:hover, -.event-column-view:focus .c3:focus, -tr:hover .c3:hover, -tr:hover .c3:focus { +.c2:hover, +.c2:focus, +.event-column-view:hover .c2:hover, +.event-column-view:focus .c2:focus, +tr:hover .c2:hover, +tr:hover .c2:focus { background-color: #36a2ef; } -.c3:hover, -.c3:focus, -.event-column-view:hover .c3:hover, -.event-column-view:focus .c3:focus, -tr:hover .c3:hover, -tr:hover .c3:focus, -.c3:hover a, -.c3:focus a, -.event-column-view:hover .c3:hover a, -.event-column-view:focus .c3:focus a, -tr:hover .c3:hover a, -tr:hover .c3:focus a, -.c3:hover a:hover, -.c3:focus a:hover, -.event-column-view:hover .c3:hover a:hover, -.event-column-view:focus .c3:focus a:hover, -tr:hover .c3:hover a:hover, -tr:hover .c3:focus a:hover { +.c2:hover, +.c2:focus, +.event-column-view:hover .c2:hover, +.event-column-view:focus .c2:focus, +tr:hover .c2:hover, +tr:hover .c2:focus, +.c2:hover a, +.c2:focus a, +.event-column-view:hover .c2:hover a, +.event-column-view:focus .c2:focus a, +tr:hover .c2:hover a, +tr:hover .c2:focus a, +.c2:hover a:hover, +.c2:focus a:hover, +.event-column-view:hover .c2:hover a:hover, +.event-column-view:focus .c2:focus a:hover, +tr:hover .c2:hover a:hover, +tr:hover .c2:focus a:hover { color: #1d1e24; } -.c3:hover::before, -.c3:focus::before, -.event-column-view:hover .c3:hover::before, -.event-column-view:focus .c3:focus::before, -tr:hover .c3:hover::before, -tr:hover .c3:focus::before { +.c2:hover::before, +.c2:focus::before, +.event-column-view:hover .c2:hover::before, +.event-column-view:focus .c2:focus::before, +tr:hover .c2:hover::before, +tr:hover .c2:focus::before { background-image: linear-gradient( 135deg, #1d1e24 25%, transparent 25% ), linear-gradient( -135deg, #1d1e24 25%, transparent 25% ), linear-gradient( 135deg, transparent 75%, #1d1e24 75% ), linear-gradient( -135deg, transparent 75%, #1d1e24 75% ); } -.c2 { +.c1 { display: inline-block; max-width: 100%; } -.c2 [data-rbd-placeholder-context-id] { +.c1 [data-rbd-placeholder-context-id] { display: none !important; } -.c4 > span.euiToolTipAnchor { +.c3 > span.euiToolTipAnchor { display: block; } -.c4 > span.euiToolTipAnchor.eui-textTruncate { +.c3 > span.euiToolTipAnchor.eui-textTruncate { display: inline-block; } -.c5 { +.c4 { vertical-align: top; } -.c22 { +.c21 { margin-right: 5px; } -.c21 { +.c20 { margin-right: 5px; } -.c15 { +.c14 { position: relative; top: 1px; } -.c14 { +.c13 { margin-right: 5px; } -.c17 { +.c16 { background-color: #343741; height: 2.8px; width: 25px; } -.c20 { +.c19 { background-color: #343741; height: 2.2px; width: 25px; } -.c19 { +.c18 { margin-right: 5px; } -.c16 { +.c15 { margin: 0 2px; } -.c16 .euiToolTipAnchor { +.c15 .euiToolTipAnchor { white-space: nowrap; } -.c18 { +.c17 { margin: 0 5px; } -.c7 { +.c6 { margin-right: 3px; } -.c8 { +.c7 { margin: 0 5px; } -.c12 { +.c11 { margin: 0 3px; } -.c10 { +.c9 { font-weight: bold; margin-top: 2px; } -.c9 { +.c8 { margin-top: 3px; } -.c6 { +.c5 { margin-right: 3px; position: relative; top: -1px; @@ -216,69 +212,65 @@ tr:hover .c3:focus::before { class="" >
-
+ - - - first.last - + first.last -
+
@@ -294,69 +286,65 @@ tr:hover .c3:focus::before { class="" >
-
+ - - - rat - + rat -
+
@@ -381,63 +369,59 @@ tr:hover .c3:focus::before { class="" >
-
- -
+ - - -
- 1ms -
-
-
-
-
+ 1ms +
+ +
+
@@ -453,59 +437,55 @@ tr:hover .c3:focus::before { class="" >
-
- -
+ - - - Nov 12, 2018 @ 19:03:25.836 - -
-
-
+ Nov 12, 2018 @ 19:03:25.836 + +
+
@@ -521,59 +501,55 @@ tr:hover .c3:focus::before { class="" >
-
- -
+ - - - Nov 12, 2018 @ 19:03:25.936 - -
-
-
+ Nov 12, 2018 @ 19:03:25.936 + +
+
@@ -597,75 +573,71 @@ tr:hover .c3:focus::before { class="euiFlexGroup emotion-euiFlexGroup-responsive-none-center-center-row" >
-
+ - - - outgoing - + outgoing -
+
@@ -675,70 +647,66 @@ tr:hover .c3:focus::before {
-
- - http - + http -
+
@@ -748,63 +716,59 @@ tr:hover .c3:focus::before {
-
- -
- - 100B - -
-
+ + 100B + +
-
+
@@ -814,63 +778,59 @@ tr:hover .c3:focus::before {
-
- -
- - 3 pkts - -
-
+ + 3 pkts + +
-
+
@@ -880,70 +840,66 @@ tr:hover .c3:focus::before {
-
- - tcp - + tcp -
+
@@ -959,64 +915,60 @@ tr:hover .c3:focus::before { class="" >
-
- - we.live.in.a - + we.live.in.a -
+
@@ -1028,7 +980,7 @@ tr:hover .c3:focus::before {
Source
@@ -1079,58 +1031,54 @@ tr:hover .c3:focus::before { class="" >
-
- - - 192.168.1.2 - - + 192.168.1.2 + -
+
@@ -1149,7 +1097,7 @@ tr:hover .c3:focus::before { class="euiFlexItem emotion-euiFlexItem-growZero" > : @@ -1159,7 +1107,7 @@ tr:hover .c3:focus::before { class="euiFlexItem emotion-euiFlexItem-growZero" >
-
- - North America - + North America -
+
@@ -1264,7 +1208,7 @@ tr:hover .c3:focus::before {
-
- - United States - + United States -
+
@@ -1332,7 +1272,7 @@ tr:hover .c3:focus::before {
🇺🇸 @@ -1354,51 +1294,47 @@ tr:hover .c3:focus::before { class="" >
-
- - US - + US -
+
@@ -1410,7 +1346,7 @@ tr:hover .c3:focus::before {
-
- - Georgia - + Georgia -
+
@@ -1478,7 +1410,7 @@ tr:hover .c3:focus::before {
-
- - Atlanta - + Atlanta -
+
@@ -1553,7 +1481,7 @@ tr:hover .c3:focus::before {
@@ -1576,62 +1504,58 @@ tr:hover .c3:focus::before { class="" >
-
- -
- - (60.00%) - - - 60B - -
-
+ (60.00%) +
+ + 60B + +
-
+
@@ -1644,7 +1568,7 @@ tr:hover .c3:focus::before { class="euiFlexItem emotion-euiFlexItem-growZero" >
@@ -1655,57 +1579,53 @@ tr:hover .c3:focus::before { class="" >
-
- -
- - 2 pkts - -
-
+ + 2 pkts + +
-
+
@@ -1718,7 +1638,7 @@ tr:hover .c3:focus::before { class="euiFlexItem emotion-euiFlexItem-growZero" >
@@ -1752,7 +1672,7 @@ tr:hover .c3:focus::before { class="euiFlexItem emotion-euiFlexItem-growZero" >
@@ -1763,62 +1683,58 @@ tr:hover .c3:focus::before { class="" >
-
- -
- - (40.00%) - - - 40B - -
-
+ (40.00%) +
+ + 40B + +
-
+
@@ -1831,7 +1747,7 @@ tr:hover .c3:focus::before { class="euiFlexItem emotion-euiFlexItem-growZero" >
@@ -1842,57 +1758,53 @@ tr:hover .c3:focus::before { class="" >
-
- -
- - 1 pkts - -
-
+ + 1 pkts + +
-
+
@@ -1905,7 +1817,7 @@ tr:hover .c3:focus::before { class="euiFlexItem emotion-euiFlexItem-growZero" >
@@ -1934,7 +1846,7 @@ tr:hover .c3:focus::before { class="euiFlexItem emotion-euiFlexItem-growZero" >
Destination
@@ -1958,58 +1870,54 @@ tr:hover .c3:focus::before { class="" >
-
- - - 10.1.2.3 - - + 10.1.2.3 + -
+
@@ -2028,7 +1936,7 @@ tr:hover .c3:focus::before { class="euiFlexItem emotion-euiFlexItem-growZero" > : @@ -2038,7 +1946,7 @@ tr:hover .c3:focus::before { class="euiFlexItem emotion-euiFlexItem-growZero" >
-
- - North America - + North America -
+
@@ -2143,7 +2047,7 @@ tr:hover .c3:focus::before {
-
- - United States - + United States -
+
@@ -2211,7 +2111,7 @@ tr:hover .c3:focus::before {
🇺🇸 @@ -2233,51 +2133,47 @@ tr:hover .c3:focus::before { class="" >
-
- - US - + US -
+
@@ -2289,7 +2185,7 @@ tr:hover .c3:focus::before {
-
- - New York - + New York -
+
@@ -2357,7 +2249,7 @@ tr:hover .c3:focus::before {
-
- - New York - + New York -
+
@@ -2451,93 +2339,89 @@ tr:hover .c3:focus::before { class="" >
@@ -2553,93 +2437,89 @@ tr:hover .c3:focus::before { class="" >
@@ -2655,93 +2535,89 @@ tr:hover .c3:focus::before { class="" >
diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/column_headers/column_header.tsx b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/column_headers/column_header.tsx index c10a7fd829f9f..945c999dbe639 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/column_headers/column_header.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/column_headers/column_header.tsx @@ -42,7 +42,7 @@ const ContextMenu = styled(EuiContextMenu)` `; const PopoverContainer = styled.div<{ $width: number }>` - & .euiPopover__anchor { + & .euiPopover { padding-right: 8px; width: ${({ $width }) => $width}px; } diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/netflow/__snapshots__/netflow_row_renderer.test.tsx.snap b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/netflow/__snapshots__/netflow_row_renderer.test.tsx.snap index e9f09d689f0cd..803a4f84552f2 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/netflow/__snapshots__/netflow_row_renderer.test.tsx.snap +++ b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/netflow/__snapshots__/netflow_row_renderer.test.tsx.snap @@ -16,13 +16,13 @@ exports[`netflowRowRenderer renders correctly against snapshot 1`] = ` border-radius: 4px; } -.c15 svg { +.c14 svg { position: relative; top: -1px; } -.c13, -.c13 * { +.c12, +.c12 * { display: inline-block; max-width: 100%; overflow: hidden; @@ -31,18 +31,14 @@ exports[`netflowRowRenderer renders correctly against snapshot 1`] = ` white-space: nowrap; } -.c3 .euiPopover__anchor { - width: 100%; -} - -.c5 { +.c4 { border-radius: 2px; padding: 0 4px 0 8px; position: relative; z-index: 0 !important; } -.c5::before { +.c4::before { background-image: linear-gradient( 135deg, #535966 25%, transparent 25% ), linear-gradient( -135deg, #535966 25%, transparent 25% ), linear-gradient( 135deg, transparent 75%, #535966 75% ), linear-gradient( -135deg, transparent 75%, #535966 75% ); background-position: 0 0,1px 0,1px -1px,0px 1px; background-size: 2px 2px; @@ -55,147 +51,147 @@ exports[`netflowRowRenderer renders correctly against snapshot 1`] = ` width: 4px; } -.c5:hover, -.c5:hover .euiBadge, -.c5:hover .euiBadge__text { +.c4:hover, +.c4:hover .euiBadge, +.c4:hover .euiBadge__text { cursor: move; cursor: -webkit-grab; cursor: -moz-grab; cursor: grab; } -.event-column-view:hover .c5::before, -tr:hover .c5::before { +.event-column-view:hover .c4::before, +tr:hover .c4::before { background-image: linear-gradient( 135deg, #98a2b3 25%, transparent 25% ), linear-gradient( -135deg, #98a2b3 25%, transparent 25% ), linear-gradient( 135deg, transparent 75%, #98a2b3 75% ), linear-gradient( -135deg, transparent 75%, #98a2b3 75% ); } -.c5:hover, -.c5:focus, -.event-column-view:hover .c5:hover, -.event-column-view:focus .c5:focus, -tr:hover .c5:hover, -tr:hover .c5:focus { +.c4:hover, +.c4:focus, +.event-column-view:hover .c4:hover, +.event-column-view:focus .c4:focus, +tr:hover .c4:hover, +tr:hover .c4:focus { background-color: #36a2ef; } -.c5:hover, -.c5:focus, -.event-column-view:hover .c5:hover, -.event-column-view:focus .c5:focus, -tr:hover .c5:hover, -tr:hover .c5:focus, -.c5:hover a, -.c5:focus a, -.event-column-view:hover .c5:hover a, -.event-column-view:focus .c5:focus a, -tr:hover .c5:hover a, -tr:hover .c5:focus a, -.c5:hover a:hover, -.c5:focus a:hover, -.event-column-view:hover .c5:hover a:hover, -.event-column-view:focus .c5:focus a:hover, -tr:hover .c5:hover a:hover, -tr:hover .c5:focus a:hover { +.c4:hover, +.c4:focus, +.event-column-view:hover .c4:hover, +.event-column-view:focus .c4:focus, +tr:hover .c4:hover, +tr:hover .c4:focus, +.c4:hover a, +.c4:focus a, +.event-column-view:hover .c4:hover a, +.event-column-view:focus .c4:focus a, +tr:hover .c4:hover a, +tr:hover .c4:focus a, +.c4:hover a:hover, +.c4:focus a:hover, +.event-column-view:hover .c4:hover a:hover, +.event-column-view:focus .c4:focus a:hover, +tr:hover .c4:hover a:hover, +tr:hover .c4:focus a:hover { color: #1d1e24; } -.c5:hover::before, -.c5:focus::before, -.event-column-view:hover .c5:hover::before, -.event-column-view:focus .c5:focus::before, -tr:hover .c5:hover::before, -tr:hover .c5:focus::before { +.c4:hover::before, +.c4:focus::before, +.event-column-view:hover .c4:hover::before, +.event-column-view:focus .c4:focus::before, +tr:hover .c4:hover::before, +tr:hover .c4:focus::before { background-image: linear-gradient( 135deg, #1d1e24 25%, transparent 25% ), linear-gradient( -135deg, #1d1e24 25%, transparent 25% ), linear-gradient( 135deg, transparent 75%, #1d1e24 75% ), linear-gradient( -135deg, transparent 75%, #1d1e24 75% ); } -.c4 { +.c3 { display: inline-block; max-width: 100%; } -.c4 [data-rbd-placeholder-context-id] { +.c3 [data-rbd-placeholder-context-id] { display: none !important; } -.c6 > span.euiToolTipAnchor { +.c5 > span.euiToolTipAnchor { display: block; } -.c6 > span.euiToolTipAnchor.eui-textTruncate { +.c5 > span.euiToolTipAnchor.eui-textTruncate { display: inline-block; } -.c7 { +.c6 { vertical-align: top; } -.c24 { +.c23 { margin-right: 5px; } -.c23 { +.c22 { margin-right: 5px; } -.c9 { +.c8 { margin-right: 3px; } -.c10 { +.c9 { margin: 0 5px; } -.c19 { +.c18 { background-color: #343741; height: 2.8px; width: 25px; } -.c22 { +.c21 { background-color: #343741; height: 2.2px; width: 25px; } -.c21 { +.c20 { margin-right: 5px; } -.c18 { +.c17 { margin: 0 2px; } -.c18 .euiToolTipAnchor { +.c17 .euiToolTipAnchor { white-space: nowrap; } -.c20 { +.c19 { margin: 0 5px; } -.c17 { +.c16 { position: relative; top: 1px; } -.c16 { +.c15 { margin-right: 5px; } -.c14 { +.c13 { margin: 0 3px; } -.c12 { +.c11 { font-weight: bold; margin-top: 2px; } -.c11 { +.c10 { margin-top: 3px; } -.c8 { +.c7 { margin-right: 3px; position: relative; top: -1px; @@ -240,79 +236,75 @@ tr:hover .c5:focus::before { class="" >
-
+ user.name +

+ -

- user.name -

+ - - - first.last - + first.last -

- Press enter for options, or press space to begin dragging. -

-
+ +

+ Press enter for options, or press space to begin dragging. +

@@ -328,79 +320,75 @@ tr:hover .c5:focus::before { class="" >
-
+ process.name +

+ -

- process.name -

+ - - - rat - + rat -

- Press enter for options, or press space to begin dragging. -

-
+ +

+ Press enter for options, or press space to begin dragging. +

@@ -425,73 +413,69 @@ tr:hover .c5:focus::before { class="" >
-
+ event.duration +

+ -

- event.duration -

- -
+ - - -
- 1ms -
-
-
-
-

- Press enter for options, or press space to begin dragging. -

-
+ 1ms +
+ +
+ +

+ Press enter for options, or press space to begin dragging. +

@@ -507,69 +491,65 @@ tr:hover .c5:focus::before { class="" >
-
+ event.start +

+ -

- event.start -

- -
+ - - - Nov 12, 2018 @ 19:03:25.836 - -
-
-

- Press enter for options, or press space to begin dragging. -

-
+ Nov 12, 2018 @ 19:03:25.836 + +
+ +

+ Press enter for options, or press space to begin dragging. +

@@ -585,69 +565,65 @@ tr:hover .c5:focus::before { class="" >
-
+ event.end +

+ -

- event.end -

- -
+ - - - Nov 12, 2018 @ 19:03:25.936 - -
-
-

- Press enter for options, or press space to begin dragging. -

-
+ Nov 12, 2018 @ 19:03:25.936 + +
+ +

+ Press enter for options, or press space to begin dragging. +

@@ -671,85 +647,81 @@ tr:hover .c5:focus::before { class="euiFlexGroup emotion-euiFlexGroup-responsive-none-center-center-row" >
-
+ network.direction +

+ -

- network.direction -

+ - - - outgoing - + outgoing -

- Press enter for options, or press space to begin dragging. -

-
+ +

+ Press enter for options, or press space to begin dragging. +

@@ -759,80 +731,76 @@ tr:hover .c5:focus::before {
-
+ network.protocol +

+ -

- network.protocol -

- - http - + http -

- Press enter for options, or press space to begin dragging. -

-
+ +

+ Press enter for options, or press space to begin dragging. +

@@ -842,73 +810,69 @@ tr:hover .c5:focus::before {
-
+ network.bytes +

+ -

- network.bytes -

- -
- - 100B - -
-
+ + 100B + +
-

- Press enter for options, or press space to begin dragging. -

-
+ +

+ Press enter for options, or press space to begin dragging. +

@@ -918,73 +882,69 @@ tr:hover .c5:focus::before {
-
+ network.packets +

+ -

- network.packets -

- -
- - 3 pkts - -
-
+ + 3 pkts + +
-

- Press enter for options, or press space to begin dragging. -

-
+ +

+ Press enter for options, or press space to begin dragging. +

@@ -994,80 +954,76 @@ tr:hover .c5:focus::before {
-
+ network.transport +

+ -

- network.transport -

- - tcp - + tcp -

- Press enter for options, or press space to begin dragging. -

-
+ +

+ Press enter for options, or press space to begin dragging. +

@@ -1083,74 +1039,70 @@ tr:hover .c5:focus::before { class="" >
-
+ network.community_id +

+ -

- network.community_id -

- - we.live.in.a - + we.live.in.a -

- Press enter for options, or press space to begin dragging. -

-
+ +

+ Press enter for options, or press space to begin dragging. +

@@ -1162,7 +1114,7 @@ tr:hover .c5:focus::before {
Source
@@ -1213,68 +1165,64 @@ tr:hover .c5:focus::before { class="" >
-
+ source.ip +

+ -

- source.ip -

- - - 192.168.1.2 - - + 192.168.1.2 + -

- Press enter for options, or press space to begin dragging. -

-
+ +

+ Press enter for options, or press space to begin dragging. +

@@ -1293,7 +1241,7 @@ tr:hover .c5:focus::before { class="euiFlexItem emotion-euiFlexItem-growZero" > : @@ -1306,84 +1254,80 @@ tr:hover .c5:focus::before { class="" >
-
+ source.port +

+ -

- source.port -

- - - + External link + + + (opens in a new tab or window) + + +
-

- Press enter for options, or press space to begin dragging. -

-
+ +

+ Press enter for options, or press space to begin dragging. +

@@ -1405,7 +1349,7 @@ tr:hover .c5:focus::before { class="euiFlexGroup emotion-euiFlexGroup-responsive-none-flexStart-center-row" >
-
+ source.geo.continent_name +

+ -

- source.geo.continent_name -

- - North America - + North America -

- Press enter for options, or press space to begin dragging. -

-
+ +

+ Press enter for options, or press space to begin dragging. +

@@ -1483,7 +1423,7 @@ tr:hover .c5:focus::before {
-
+ source.geo.country_name +

+ -

- source.geo.country_name -

- - United States - + United States -

- Press enter for options, or press space to begin dragging. -

-
+ +

+ Press enter for options, or press space to begin dragging. +

@@ -1561,7 +1497,7 @@ tr:hover .c5:focus::before {
🇺🇸 @@ -1583,61 +1519,57 @@ tr:hover .c5:focus::before { class="" >
-
+ source.geo.country_iso_code +

+ -

- source.geo.country_iso_code -

- - US - + US -

- Press enter for options, or press space to begin dragging. -

-
+ +

+ Press enter for options, or press space to begin dragging. +

@@ -1649,7 +1581,7 @@ tr:hover .c5:focus::before {
-
+ source.geo.region_name +

+ -

- source.geo.region_name -

- - Georgia - + Georgia -

- Press enter for options, or press space to begin dragging. -

-
+ +

+ Press enter for options, or press space to begin dragging. +

@@ -1727,7 +1655,7 @@ tr:hover .c5:focus::before {
-
+ source.geo.city_name +

+ -

- source.geo.city_name -

- - Atlanta - + Atlanta -

- Press enter for options, or press space to begin dragging. -

-
+ +

+ Press enter for options, or press space to begin dragging. +

@@ -1812,7 +1736,7 @@ tr:hover .c5:focus::before {
@@ -1835,72 +1759,68 @@ tr:hover .c5:focus::before { class="" >
-
+ source.bytes +

+ -

- source.bytes -

- -
- - (60.00%) - - - 60B - -
-
+ (60.00%) +
+ + 60B + +
-

- Press enter for options, or press space to begin dragging. -

-
+ +

+ Press enter for options, or press space to begin dragging. +

@@ -1913,7 +1833,7 @@ tr:hover .c5:focus::before { class="euiFlexItem emotion-euiFlexItem-growZero" >
@@ -1924,67 +1844,63 @@ tr:hover .c5:focus::before { class="" >
-
+ source.packets +

+ -

- source.packets -

- -
- - 2 pkts - -
-
+ + 2 pkts + +
-

- Press enter for options, or press space to begin dragging. -

-
+ +

+ Press enter for options, or press space to begin dragging. +

@@ -1997,7 +1913,7 @@ tr:hover .c5:focus::before { class="euiFlexItem emotion-euiFlexItem-growZero" >
@@ -2031,7 +1947,7 @@ tr:hover .c5:focus::before { class="euiFlexItem emotion-euiFlexItem-growZero" >
@@ -2042,72 +1958,68 @@ tr:hover .c5:focus::before { class="" >
-
+ destination.bytes +

+ -

- destination.bytes -

- -
- - (40.00%) - - - 40B - -
-
+ (40.00%) +
+ + 40B + +
-

- Press enter for options, or press space to begin dragging. -

-
+ +

+ Press enter for options, or press space to begin dragging. +

@@ -2120,7 +2032,7 @@ tr:hover .c5:focus::before { class="euiFlexItem emotion-euiFlexItem-growZero" >
@@ -2131,67 +2043,63 @@ tr:hover .c5:focus::before { class="" >
-
+ destination.packets +

+ -

- destination.packets -

- -
- - 1 pkts - -
-
+ + 1 pkts + +
-

- Press enter for options, or press space to begin dragging. -

-
+ +

+ Press enter for options, or press space to begin dragging. +

@@ -2204,7 +2112,7 @@ tr:hover .c5:focus::before { class="euiFlexItem emotion-euiFlexItem-growZero" >
@@ -2233,7 +2141,7 @@ tr:hover .c5:focus::before { class="euiFlexItem emotion-euiFlexItem-growZero" >
Destination
@@ -2257,68 +2165,64 @@ tr:hover .c5:focus::before { class="" >
-
+ destination.ip +

+ -

- destination.ip -

- - - 10.1.2.3 - - + 10.1.2.3 + -

- Press enter for options, or press space to begin dragging. -

-
+ +

+ Press enter for options, or press space to begin dragging. +

@@ -2337,7 +2241,7 @@ tr:hover .c5:focus::before { class="euiFlexItem emotion-euiFlexItem-growZero" > : @@ -2350,84 +2254,80 @@ tr:hover .c5:focus::before { class="" >
-
+ destination.port +

+ -

- destination.port -

- - - + External link + + + (opens in a new tab or window) + + +
-

- Press enter for options, or press space to begin dragging. -

-
+ +

+ Press enter for options, or press space to begin dragging. +

@@ -2449,7 +2349,7 @@ tr:hover .c5:focus::before { class="euiFlexGroup emotion-euiFlexGroup-responsive-none-flexStart-center-row" >
-
+ destination.geo.continent_name +

+ -

- destination.geo.continent_name -

- - North America - + North America -

- Press enter for options, or press space to begin dragging. -

-
+ +

+ Press enter for options, or press space to begin dragging. +

@@ -2527,7 +2423,7 @@ tr:hover .c5:focus::before {
-
+ destination.geo.country_name +

+ -

- destination.geo.country_name -

- - United States - + United States -

- Press enter for options, or press space to begin dragging. -

-
+ +

+ Press enter for options, or press space to begin dragging. +

@@ -2605,7 +2497,7 @@ tr:hover .c5:focus::before {
🇺🇸 @@ -2627,61 +2519,57 @@ tr:hover .c5:focus::before { class="" >
-
+ destination.geo.country_iso_code +

+ -

- destination.geo.country_iso_code -

- - US - + US -

- Press enter for options, or press space to begin dragging. -

-
+ +

+ Press enter for options, or press space to begin dragging. +

@@ -2693,7 +2581,7 @@ tr:hover .c5:focus::before {
-
+ destination.geo.region_name +

+ -

- destination.geo.region_name -

- - New York - + New York -

- Press enter for options, or press space to begin dragging. -

-
+ +

+ Press enter for options, or press space to begin dragging. +

@@ -2771,7 +2655,7 @@ tr:hover .c5:focus::before {
-
+ destination.geo.city_name +

+ -

- destination.geo.city_name -

- - New York - + New York -

- Press enter for options, or press space to begin dragging. -

-
+ +

+ Press enter for options, or press space to begin dragging. +

@@ -2875,103 +2755,99 @@ tr:hover .c5:focus::before { class="" >
-
+ tls.fingerprints.ja3.hash +

+ -

- tls.fingerprints.ja3.hash -

+ - + ja3 + + + tls.fingerprints.ja3.hash-value - ja3 + External link - - tls.fingerprints.ja3.hash-value - - External link - - - (opens in a new tab or window) - - - + (opens in a new tab or window) + + -

- Press enter for options, or press space to begin dragging. -

-
+ +

+ Press enter for options, or press space to begin dragging. +

@@ -2987,103 +2863,99 @@ tr:hover .c5:focus::before { class="" >
@@ -3099,103 +2971,99 @@ tr:hover .c5:focus::before { class="" >
diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/index.tsx b/x-pack/plugins/security_solution/public/timelines/components/timeline/index.tsx index bffc5c45f84ef..0ebc326a35226 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/timeline/index.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/timeline/index.tsx @@ -245,7 +245,11 @@ const StatefulTimelineComponent: React.FC = ({
{showTimelineTour ? ( - + ) : null} ); diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/search_super_select/index.tsx b/x-pack/plugins/security_solution/public/timelines/components/timeline/search_super_select/index.tsx index a18176e523f1b..d7e8ae909c75f 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/timeline/search_super_select/index.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/timeline/search_super_select/index.tsx @@ -133,7 +133,7 @@ const SearchTimelineSuperSelectComponent: React.FC { +const TestComponent = (props: Partial = {}) => { return ( - - + + {Object.values(TIMELINE_TOUR_CONFIG_ANCHORS).map((anchor) => { return
; })} @@ -35,6 +56,18 @@ describe('Timeline Tour', () => { (useIsElementMounted as jest.Mock).mockReturnValue(true); }); + beforeEach(() => { + (useKibana as jest.Mock).mockReturnValue({ + ...mockedUseKibana, + services: { + ...mockedUseKibana.services, + storage: storageMock, + }, + }); + + storageMock.clear(); + }); + it('should not render tour steps when element are not mounted', () => { (useIsElementMounted as jest.Mock).mockReturnValueOnce(false); render(); @@ -71,4 +104,29 @@ describe('Timeline Tour', () => { expect(screen.queryByText('Finish tour')).toBeVisible(); }); }); + + it('should render different tour steps when timeline type is template', async () => { + render(); + + await waitFor(() => { + expect(screen.getByTestId('timeline-tour-step-1')).toBeVisible(); + }); + + fireEvent.click(screen.getByText('Next')); + await waitFor(() => { + expect(screen.getByTestId('timeline-tour-step-2')).toBeVisible(); + }); + + fireEvent.click(screen.getByText('Next')); + + await waitFor(() => { + expect(screen.getByTestId('timeline-tour-step-3')).toBeVisible(); + }); + + fireEvent.click(screen.getByText('Next')); + + await waitFor(() => { + expect(screen.queryByText('Finish tour')).toBeVisible(); + }); + }); }); diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/tour/index.tsx b/x-pack/plugins/security_solution/public/timelines/components/timeline/tour/index.tsx index 7285798688461..f959e6fe3a47a 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/timeline/tour/index.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/timeline/tour/index.tsx @@ -10,8 +10,9 @@ * * */ -import React, { useEffect, useCallback, useState } from 'react'; +import React, { useEffect, useCallback, useState, useMemo } from 'react'; import { EuiButton, EuiButtonEmpty, EuiTourStep } from '@elastic/eui'; +import type { TimelineType } from '../../../../../common/api/timeline'; import type { TimelineTabs } from '../../../../../common/types'; import { useIsElementMounted } from '../../../../detection_engine/rule_management_ui/components/rules_table/rules_table/guided_onboarding/use_is_element_mounted'; import { NEW_FEATURES_TOUR_STORAGE_KEYS } from '../../../../../common/constants'; @@ -26,20 +27,26 @@ interface TourState { tourSubtitle: string; } -interface TimelineTourProps { +export interface TimelineTourProps { activeTab: TimelineTabs; + timelineType: TimelineType; switchToTab: (tab: TimelineTabs) => void; } const TimelineTourComp = (props: TimelineTourProps) => { - const { activeTab, switchToTab } = props; + const { activeTab, switchToTab, timelineType } = props; const { services: { storage }, } = useKibana(); + const updatedTourSteps = useMemo( + () => + timelineTourSteps.filter((step) => !step.timelineType || step.timelineType === timelineType), + [timelineType] + ); + const [tourState, setTourState] = useState(() => { const restoredTourState = storage.get(NEW_FEATURES_TOUR_STORAGE_KEYS.TIMELINE); - if (restoredTourState != null) { return restoredTourState; } @@ -71,7 +78,7 @@ const TimelineTourComp = (props: TimelineTourProps) => { const getFooterAction = useCallback( (step: number) => { // if it's the last step, we don't want to show the next button - return step === timelineTourSteps.length ? ( + return step === updatedTourSteps.length ? ( {i18n.TIMELINE_TOUR_FINISH} @@ -86,14 +93,14 @@ const TimelineTourComp = (props: TimelineTourProps) => { ] ); }, - [finishTour, nextStep] + [finishTour, nextStep, updatedTourSteps.length] ); - const nextEl = timelineTourSteps[tourState.currentTourStep - 1]?.anchor; + const nextEl = updatedTourSteps[tourState.currentTourStep - 1]?.anchor; const isElementAtCurrentStepMounted = useIsElementMounted(nextEl); - const currentStepConfig = timelineTourSteps[tourState.currentTourStep - 1]; + const currentStepConfig = updatedTourSteps[tourState.currentTourStep - 1]; if (currentStepConfig?.timelineTab && currentStepConfig.timelineTab !== activeTab) { switchToTab(currentStepConfig.timelineTab); @@ -105,7 +112,7 @@ const TimelineTourComp = (props: TimelineTourProps) => { return ( <> - {timelineTourSteps.map((steps, idx) => { + {updatedTourSteps.map((steps, idx) => { const stepCount = idx + 1; if (tourState.currentTourStep !== stepCount) return null; const panelProps = { @@ -118,7 +125,7 @@ const TimelineTourComp = (props: TimelineTourProps) => { step={stepCount} isStepOpen={tourState.isTourActive && tourState.currentTourStep === idx + 1} minWidth={tourState.tourPopoverWidth} - stepsTotal={timelineTourSteps.length} + stepsTotal={updatedTourSteps.length} onFinish={finishTour} title={steps.title} content={steps.content} diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/tour/step_config.tsx b/x-pack/plugins/security_solution/public/timelines/components/timeline/tour/step_config.tsx index 8b1e416324b1b..265f87a61d0bc 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/timeline/tour/step_config.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/timeline/tour/step_config.tsx @@ -8,6 +8,7 @@ import { EuiText, EuiCode } from '@elastic/eui'; import React from 'react'; import { FormattedMessage } from '@kbn/i18n-react'; +import { TimelineType } from '../../../../../common/api/timeline'; import { TimelineTabs } from '../../../../../common/types'; import * as i18n from './translations'; @@ -65,6 +66,7 @@ export const timelineTourSteps = [ anchor: TIMELINE_TOUR_CONFIG_ANCHORS.DATA_VIEW, }, { + timelineType: TimelineType.default, timelineTab: TimelineTabs.query, title: i18n.TIMELINE_TOUR_DATA_PROVIDER_VISIBILITY_TITLE, content: {i18n.TIMELINE_TOUR_DATA_PROVIDER_VISIBILITY_DESCRIPTION}, diff --git a/x-pack/plugins/security_solution/scripts/endpoint/common/screen/column_layout_formatter.ts b/x-pack/plugins/security_solution/scripts/endpoint/common/screen/column_layout_formatter.ts index 6bdb5f006f296..35a351c4cee27 100644 --- a/x-pack/plugins/security_solution/scripts/endpoint/common/screen/column_layout_formatter.ts +++ b/x-pack/plugins/security_solution/scripts/endpoint/common/screen/column_layout_formatter.ts @@ -6,7 +6,6 @@ */ import stripAnsi from 'strip-ansi'; -import ansiRegex from 'ansi-regex'; import { blue } from 'chalk'; import { DataFormatter } from './data_formatter'; import { SCREEN_ROW_MAX_WIDTH } from './constants'; @@ -84,3 +83,15 @@ export class ColumnLayoutFormatter extends DataFormatter { return colData + (fillCount > 0 ? ' '.repeat(fillCount) : ''); } } + +// this is a copy of the `ansiRegex` module, which is no longer allowed to be `import`ed at the module +// because it is not defined as an ESM module (only dynamic import is supported). Due to its usage, +// which does not allow `async` calls to be `await`ed, it is now being copied here for use locally. +function ansiRegex({ onlyFirst = false } = {}) { + const pattern = [ + '[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)', + '(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))', + ].join('|'); + + return new RegExp(pattern, onlyFirst ? undefined : 'g'); +} diff --git a/x-pack/plugins/serverless/kibana.jsonc b/x-pack/plugins/serverless/kibana.jsonc index d8993d5ac7c72..a0adba7f60dfc 100644 --- a/x-pack/plugins/serverless/kibana.jsonc +++ b/x-pack/plugins/serverless/kibana.jsonc @@ -13,10 +13,11 @@ "plugin", ], "requiredPlugins": [ - "kibanaReact", "cloud" ], "optionalPlugins": [], - "requiredBundles": [] + "requiredBundles": [ + "kibanaReact", + ] } } diff --git a/x-pack/plugins/serverless/server/index.ts b/x-pack/plugins/serverless/server/index.ts index 350b7a6c27641..b873dda868231 100644 --- a/x-pack/plugins/serverless/server/index.ts +++ b/x-pack/plugins/serverless/server/index.ts @@ -13,4 +13,7 @@ export const plugin = async (initializerContext: PluginInitializerContext) => { return new ServerlessPlugin(initializerContext); }; -export type { ServerlessPluginSetup, ServerlessPluginStart } from './types'; +export type { + ServerlessServerSetup as ServerlessPluginSetup, + ServerlessServerStart as ServerlessPluginStart, +} from './types'; diff --git a/x-pack/plugins/serverless/server/plugin.ts b/x-pack/plugins/serverless/server/plugin.ts index eefe74e6de903..03a4ace34253a 100644 --- a/x-pack/plugins/serverless/server/plugin.ts +++ b/x-pack/plugins/serverless/server/plugin.ts @@ -14,7 +14,12 @@ import { getConfigDirectory } from '@kbn/utils'; import { ProjectType } from '@kbn/serverless-types'; import { ALL_COMMON_SETTINGS } from '@kbn/serverless-common-settings'; -import { ServerlessPluginSetup, ServerlessPluginStart } from './types'; +import type { + ServerlessServerSetup, + ServerlessServerStart, + ServerlessServerSetupDependencies, + ServerlessServerStartDependencies, +} from './types'; import { ServerlessConfig } from './config'; import { API_SWITCH_PROJECT } from '../common'; @@ -34,7 +39,15 @@ const typeToIdMap: Record = { search: 'es', }; -export class ServerlessPlugin implements Plugin { +export class ServerlessPlugin + implements + Plugin< + ServerlessServerSetup, + ServerlessServerStart, + ServerlessServerSetupDependencies, + ServerlessServerStartDependencies + > +{ private readonly config: ServerlessConfig; private projectSettingsAdded: boolean = false; diff --git a/x-pack/plugins/serverless/server/types.ts b/x-pack/plugins/serverless/server/types.ts index 71c06ce1b96b4..d47a045bccdc0 100644 --- a/x-pack/plugins/serverless/server/types.ts +++ b/x-pack/plugins/serverless/server/types.ts @@ -5,9 +5,15 @@ * 2.0. */ -export interface ServerlessPluginSetup { +export interface ServerlessServerSetup { setupProjectSettings(keys: string[]): void; } // eslint-disable-next-line @typescript-eslint/no-empty-interface -export interface ServerlessPluginStart {} +export interface ServerlessServerStart {} + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface ServerlessServerSetupDependencies {} + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface ServerlessServerStartDependencies {} diff --git a/x-pack/plugins/serverless_observability/kibana.jsonc b/x-pack/plugins/serverless_observability/kibana.jsonc index 692d721c20a30..4d9a15fc8804d 100644 --- a/x-pack/plugins/serverless_observability/kibana.jsonc +++ b/x-pack/plugins/serverless_observability/kibana.jsonc @@ -20,11 +20,10 @@ "serverless", "observability", "observabilityShared", - "kibanaReact", "management", "cloud" ], "optionalPlugins": [], "requiredBundles": [] } -} +} \ No newline at end of file diff --git a/x-pack/plugins/serverless_observability/public/index.ts b/x-pack/plugins/serverless_observability/public/index.ts index a785b68735375..76a90fe4016b7 100644 --- a/x-pack/plugins/serverless_observability/public/index.ts +++ b/x-pack/plugins/serverless_observability/public/index.ts @@ -14,6 +14,6 @@ export function plugin() { } export type { - ServerlessObservabilityPluginSetup, - ServerlessObservabilityPluginStart, + ServerlessObservabilityPublicSetup as ServerlessObservabilityPluginSetup, + ServerlessObservabilityPublicStart as ServerlessObservabilityPluginStart, } from './types'; diff --git a/x-pack/plugins/serverless_observability/public/plugin.ts b/x-pack/plugins/serverless_observability/public/plugin.ts index a24ebf3855429..8c786330c7e84 100644 --- a/x-pack/plugins/serverless_observability/public/plugin.ts +++ b/x-pack/plugins/serverless_observability/public/plugin.ts @@ -12,22 +12,28 @@ import { appCategories } from '@kbn/management-cards-navigation/src/types'; import { getObservabilitySideNavComponent } from './components/side_navigation'; import { createObservabilityDashboardRegistration } from './logs_signal/overview_registration'; import { - ServerlessObservabilityPluginSetup, - ServerlessObservabilityPluginStart, - ServerlessObservabilityPluginSetupDependencies, - ServerlessObservabilityPluginStartDependencies, + ServerlessObservabilityPublicSetup, + ServerlessObservabilityPublicStart, + ServerlessObservabilityPublicSetupDependencies, + ServerlessObservabilityPublicStartDependencies, } from './types'; export class ServerlessObservabilityPlugin - implements Plugin + implements + Plugin< + ServerlessObservabilityPublicSetup, + ServerlessObservabilityPublicStart, + ServerlessObservabilityPublicSetupDependencies, + ServerlessObservabilityPublicStartDependencies + > { public setup( _core: CoreSetup< - ServerlessObservabilityPluginStartDependencies, - ServerlessObservabilityPluginStart + ServerlessObservabilityPublicStartDependencies, + ServerlessObservabilityPublicStart >, - setupDeps: ServerlessObservabilityPluginSetupDependencies - ): ServerlessObservabilityPluginSetup { + setupDeps: ServerlessObservabilityPublicSetupDependencies + ): ServerlessObservabilityPublicSetup { setupDeps.observability.dashboard.register( createObservabilityDashboardRegistration({ search: _core @@ -41,8 +47,8 @@ export class ServerlessObservabilityPlugin public start( core: CoreStart, - setupDeps: ServerlessObservabilityPluginStartDependencies - ): ServerlessObservabilityPluginStart { + setupDeps: ServerlessObservabilityPublicStartDependencies + ): ServerlessObservabilityPublicStart { const { observabilityShared, serverless, management, cloud } = setupDeps; observabilityShared.setIsSidebarEnabled(false); serverless.setProjectHome('/app/observability/landing'); diff --git a/x-pack/plugins/serverless_observability/public/services.tsx b/x-pack/plugins/serverless_observability/public/services.tsx deleted file mode 100644 index 67b71268de0f1..0000000000000 --- a/x-pack/plugins/serverless_observability/public/services.tsx +++ /dev/null @@ -1,23 +0,0 @@ -/* - * 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; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { CoreStart } from '@kbn/core/public'; -import type { CloudStart } from '@kbn/cloud-plugin/public'; -import React from 'react'; -import { KibanaContextProvider } from '@kbn/kibana-react-plugin/public'; -import type { ServerlessObservabilityPluginStartDependencies } from './types'; - -type Services = CoreStart & ServerlessObservabilityPluginStartDependencies; - -export const KibanaServicesProvider: React.FC<{ - core: CoreStart; - pluginsStart: ServerlessObservabilityPluginStartDependencies; - cloud: CloudStart; -}> = ({ core, pluginsStart, cloud, children }) => { - const services: Services = { ...core, ...pluginsStart, cloud }; - return {children}; -}; diff --git a/x-pack/plugins/serverless_observability/public/types.ts b/x-pack/plugins/serverless_observability/public/types.ts index a1674fffde9d8..92837c9cfa767 100644 --- a/x-pack/plugins/serverless_observability/public/types.ts +++ b/x-pack/plugins/serverless_observability/public/types.ts @@ -16,19 +16,19 @@ import { import { ServerlessPluginSetup, ServerlessPluginStart } from '@kbn/serverless/public'; // eslint-disable-next-line @typescript-eslint/no-empty-interface -export interface ServerlessObservabilityPluginSetup {} +export interface ServerlessObservabilityPublicSetup {} // eslint-disable-next-line @typescript-eslint/no-empty-interface -export interface ServerlessObservabilityPluginStart {} +export interface ServerlessObservabilityPublicStart {} -export interface ServerlessObservabilityPluginSetupDependencies { +export interface ServerlessObservabilityPublicSetupDependencies { observability: ObservabilityPublicSetup; observabilityShared: ObservabilitySharedPluginSetup; serverless: ServerlessPluginSetup; management: ManagementSetup; } -export interface ServerlessObservabilityPluginStartDependencies { +export interface ServerlessObservabilityPublicStartDependencies { observabilityShared: ObservabilitySharedPluginStart; serverless: ServerlessPluginStart; management: ManagementStart; diff --git a/x-pack/plugins/serverless_observability/tsconfig.json b/x-pack/plugins/serverless_observability/tsconfig.json index c0894de19697e..964f25de2d445 100644 --- a/x-pack/plugins/serverless_observability/tsconfig.json +++ b/x-pack/plugins/serverless_observability/tsconfig.json @@ -20,7 +20,6 @@ "@kbn/management-plugin", "@kbn/serverless", "@kbn/observability-shared-plugin", - "@kbn/kibana-react-plugin", "@kbn/shared-ux-chrome-navigation", "@kbn/i18n", "@kbn/management-cards-navigation", diff --git a/x-pack/plugins/serverless_search/public/application/components/overview.tsx b/x-pack/plugins/serverless_search/public/application/components/overview.tsx index d5e1c84f2aec6..e0b858b99022d 100644 --- a/x-pack/plugins/serverless_search/public/application/components/overview.tsx +++ b/x-pack/plugins/serverless_search/public/application/components/overview.tsx @@ -426,6 +426,7 @@ const OverviewFooter = () => { } href={docLinks.gettingStartedSearch} + target="_blank" /> diff --git a/x-pack/plugins/spaces/public/nav_control/__snapshots__/nav_control_popover.test.tsx.snap b/x-pack/plugins/spaces/public/nav_control/__snapshots__/nav_control_popover.test.tsx.snap index 77801c3f8dadd..af2221e460a32 100644 --- a/x-pack/plugins/spaces/public/nav_control/__snapshots__/nav_control_popover.test.tsx.snap +++ b/x-pack/plugins/spaces/public/nav_control/__snapshots__/nav_control_popover.test.tsx.snap @@ -4,48 +4,44 @@ exports[`NavControlPopover renders without crashing 1`] = `
- + +
diff --git a/x-pack/plugins/stack_connectors/public/connector_types/tines/tines_params.test.tsx b/x-pack/plugins/stack_connectors/public/connector_types/tines/tines_params.test.tsx index 12fa612ac9794..22a33248aea55 100644 --- a/x-pack/plugins/stack_connectors/public/connector_types/tines/tines_params.test.tsx +++ b/x-pack/plugins/stack_connectors/public/connector_types/tines/tines_params.test.tsx @@ -91,13 +91,15 @@ describe('TinesParamsFields renders', () => { expect(wrapper.find('[data-test-subj="tines-bodyJsonEditor"]').exists()).toBe(false); expect(wrapper.find('[data-test-subj="tines-storySelector"]').exists()).toBe(true); - expect(wrapper.find('[data-test-subj="tines-storySelector"]').first().text()).toBe( - 'Select a Tines story' - ); + expect( + wrapper.find('[data-test-subj="tines-storySelector"]').first().find('input').props() + .placeholder + ).toBe('Select a Tines story'); expect(wrapper.find('[data-test-subj="tines-webhookSelector"]').exists()).toBe(true); - expect(wrapper.find('[data-test-subj="tines-webhookSelector"]').first().text()).toBe( - 'Select a story first' - ); + expect( + wrapper.find('[data-test-subj="tines-webhookSelector"]').first().find('input').props() + .placeholder + ).toBe('Select a story first'); expect(wrapper.find('[data-test-subj="tines-fallbackCallout"]').exists()).toBe(false); expect(wrapper.find('[data-test-subj="tines-webhookUrlInput"]').exists()).toBe(false); @@ -119,13 +121,13 @@ describe('TinesParamsFields renders', () => { expect(wrapper.find('[data-test-subj="bodyAddVariableButton"]').exists()).toBe(false); expect(wrapper.find('[data-test-subj="tines-storySelector"]').exists()).toBe(true); - expect(wrapper.find('[data-test-subj="tines-storySelector"]').first().text()).toBe( - 'Select a Tines story' - ); + expect( + wrapper.find('[data-test-subj="tines-storySelector"] input').first().props().placeholder + ).toBe('Select a Tines story'); expect(wrapper.find('[data-test-subj="tines-webhookSelector"]').exists()).toBe(true); - expect(wrapper.find('[data-test-subj="tines-webhookSelector"]').first().text()).toBe( - 'Select a story first' - ); + expect( + wrapper.find('[data-test-subj="tines-webhookSelector"] input').first().props().placeholder + ).toBe('Select a story first'); expect(mockEditAction).toHaveBeenCalledWith('subAction', 'test', index); }); @@ -223,9 +225,9 @@ describe('TinesParamsFields renders', () => { expect( wrapper.find('[data-test-subj="tines-webhookSelector"]').first().prop('disabled') ).toBe(false); - expect(wrapper.find('[data-test-subj="tines-webhookSelector"]').first().text()).toBe( - 'Select a webhook action' - ); + expect( + wrapper.find('[data-test-subj="tines-webhookSelector"] input').first().props().placeholder + ).toBe('Select a webhook action'); wrapper .find( '[data-test-subj="tines-webhookSelector"] [data-test-subj="comboBoxToggleListButton"]' @@ -312,13 +314,13 @@ describe('TinesParamsFields renders', () => { expect(wrapper.find('[data-test-subj="tines-bodyJsonEditor"]').exists()).toBe(false); expect(wrapper.find('[data-test-subj="tines-storySelector"]').exists()).toBe(true); - expect(wrapper.find('[data-test-subj="tines-storySelector"]').first().text()).toBe( - story.name - ); + expect( + wrapper.find('[data-test-subj="tines-storySelector"] input').first().props().value + ).toBe(story.name); expect(wrapper.find('[data-test-subj="tines-webhookSelector"]').exists()).toBe(true); - expect(wrapper.find('[data-test-subj="tines-webhookSelector"]').first().text()).toBe( - webhook.name - ); + expect( + wrapper.find('[data-test-subj="tines-webhookSelector"] input').first().props().value + ).toBe(webhook.name); expect(wrapper.find('[data-test-subj="tines-fallbackCallout"]').exists()).toBe(false); expect(wrapper.find('[data-test-subj="tines-webhookUrlInput"]').exists()).toBe(false); diff --git a/x-pack/plugins/synthetics/common/config.ts b/x-pack/plugins/synthetics/common/config.ts index 63cea263d1648..9da43f8bf9a08 100644 --- a/x-pack/plugins/synthetics/common/config.ts +++ b/x-pack/plugins/synthetics/common/config.ts @@ -17,6 +17,7 @@ const serviceConfig = schema.object({ syncInterval: schema.maybe(schema.string()), tls: schema.maybe(sslSchema), devUrl: schema.maybe(schema.string()), + showExperimentalLocations: schema.maybe(schema.boolean()), }); const uptimeConfig = schema.object({ diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/common/header/action_menu_content.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/common/header/action_menu_content.tsx index a123f4be95382..c9a0118815eca 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/components/common/header/action_menu_content.tsx +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/common/header/action_menu_content.tsx @@ -11,10 +11,9 @@ import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n-react'; import { useHistory, useRouteMatch } from 'react-router-dom'; import { createExploratoryViewUrl } from '@kbn/exploratory-view-plugin/public'; -import { ObservabilityAIAssistantActionMenuItem } from '@kbn/observability-ai-assistant-plugin/public'; import { LastRefreshed } from '../components/last_refreshed'; import { AutoRefreshButton } from '../components/auto_refresh_button'; -import { useSyntheticsSettingsContext } from '../../../contexts'; +import { useSyntheticsSettingsContext, useSyntheticsStartPlugins } from '../../../contexts'; import { useGetUrlParams } from '../../../hooks'; import { MONITOR_ROUTE, SETTINGS_ROUTE } from '../../../../../../common/constants'; import { stringifyUrlParams } from '../../../utils/url_params'; @@ -32,6 +31,9 @@ const ANALYZE_MESSAGE = i18n.translate('xpack.synthetics.analyzeDataButtonLabel. export function ActionMenuContent(): React.ReactElement { const { basePath } = useSyntheticsSettingsContext(); + + const { observabilityAIAssistant: { ObservabilityAIAssistantActionMenuItem } = {} } = + useSyntheticsStartPlugins(); const params = useGetUrlParams(); const { dateRangeStart, dateRangeEnd } = params; const history = useHistory(); @@ -104,7 +106,9 @@ export function ActionMenuContent(): React.ReactElement { - + {ObservabilityAIAssistantActionMenuItem && ObservabilityAIAssistantActionMenuItem ? ( + + ) : null} ); } diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/synthetics_app.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/synthetics_app.tsx index 89bffbe6dfd73..3bd3407dcb3c1 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/synthetics_app.tsx +++ b/x-pack/plugins/synthetics/public/apps/synthetics/synthetics_app.tsx @@ -14,7 +14,6 @@ import { KibanaContextProvider, KibanaThemeProvider } from '@kbn/kibana-react-pl import { RedirectAppLinks } from '@kbn/shared-ux-link-redirect-app'; import { EuiThemeProvider } from '@kbn/kibana-react-plugin/common'; import { InspectorContextProvider } from '@kbn/observability-shared-plugin/public'; -import { ObservabilityAIAssistantProvider } from '@kbn/observability-ai-assistant-plugin/public'; import { SyntheticsDataViewContextProvider } from './contexts/synthetics_data_view_context'; import { SyntheticsAppProps } from './contexts'; @@ -91,6 +90,7 @@ const Application = (props: SyntheticsAppProps) => { triggersActionsUi: startPlugins.triggersActionsUi, observability: startPlugins.observability, observabilityShared: startPlugins.observabilityShared, + observabilityAIAssistant: startPlugins.observabilityAIAssistant, exploratoryView: startPlugins.exploratoryView, cases: startPlugins.cases, spaces: startPlugins.spaces, @@ -98,35 +98,31 @@ const Application = (props: SyntheticsAppProps) => { }} > - - - - - - - -
- - - - - - - -
-
-
-
-
-
-
-
+ + + + + + +
+ + + + + + + +
+
+
+
+
+
+
diff --git a/x-pack/plugins/translations/translations/fr-FR.json b/x-pack/plugins/translations/translations/fr-FR.json index 549c459b4944f..83014ab40d7b4 100644 --- a/x-pack/plugins/translations/translations/fr-FR.json +++ b/x-pack/plugins/translations/translations/fr-FR.json @@ -452,7 +452,6 @@ "controls.controlGroup.manageControl.dataSource.fieldTitle": "Champ", "controls.controlGroup.manageControl.dataSource.formGroupDescription": "Sélectionnez la vue de données et le champ pour lesquels vous voulez créer un contrôle.", "controls.controlGroup.manageControl.dataSource.formGroupTitle": "Source de données", - "controls.controlGroup.manageControl.dataSource.noControlTypeMessage": "Aucun champ sélectionné pour l’instant", "controls.controlGroup.manageControl.dataSource.selectDataViewMessage": "Veuillez sélectionner une vue de données", "controls.controlGroup.manageControl.displaySettings.formGroupDescription": "Changez la manière dont le contrôle apparaît sur votre tableau de bord.", "controls.controlGroup.manageControl.displaySettings.formGroupTitle": "Paramètres d'affichage", @@ -28790,8 +28789,6 @@ "xpack.observability.slo.alerting.burnRate.reasonForInstanceId": "{actionGroupName} : Le taux d'avancement pour le (les) dernier(s) {longWindowDuration} est de {longWindowBurnRate} et pour le (les) dernier(s) {shortWindowDuration} est de {shortWindowBurnRate} pour {instanceId}. Alerter si supérieur à {burnRateThreshold} pour les deux fenêtres", "xpack.observability.slo.burnRate.breachedStatustSubtitle": "Au rythme actuel, le budget d'erreur sera épuisé en {hour} heures.", "xpack.observability.slo.burnRate.threshold": "Le seuil est {threshold}x", - "xpack.observability.slo.clone.errorNotification": "Échec du clonage de {name}", - "xpack.observability.slo.clone.successNotification": "{name} créé avec succès", "xpack.observability.slo.create.errorNotification": "Un problème est survenu lors de la création de {name}", "xpack.observability.slo.create.successNotification": "{name} créé avec succès", "xpack.observability.slo.deleteConfirmationModal.title": "Supprimer {name} ?", diff --git a/x-pack/plugins/translations/translations/ja-JP.json b/x-pack/plugins/translations/translations/ja-JP.json index 8ab33bb6186bb..9dba513261801 100644 --- a/x-pack/plugins/translations/translations/ja-JP.json +++ b/x-pack/plugins/translations/translations/ja-JP.json @@ -452,7 +452,6 @@ "controls.controlGroup.manageControl.dataSource.fieldTitle": "フィールド", "controls.controlGroup.manageControl.dataSource.formGroupDescription": "コントロールを作成するデータビューとフィールドを選択します。", "controls.controlGroup.manageControl.dataSource.formGroupTitle": "データソース", - "controls.controlGroup.manageControl.dataSource.noControlTypeMessage": "まだフィールドが選択されていません", "controls.controlGroup.manageControl.dataSource.selectDataViewMessage": "データビューを選択してください", "controls.controlGroup.manageControl.displaySettings.formGroupDescription": "ダッシュボードにコントロールを表示する方法を変更します。", "controls.controlGroup.manageControl.displaySettings.formGroupTitle": "表示設定", @@ -28790,8 +28789,6 @@ "xpack.observability.slo.alerting.burnRate.reasonForInstanceId": "{actionGroupName}:過去{longWindowDuration}のバーンレートは{longWindowBurnRate}、{instanceId}の過去{shortWindowDuration}のバーンレートは{shortWindowBurnRate}です。両期間とも{burnRateThreshold}を超えたらアラート", "xpack.observability.slo.burnRate.breachedStatustSubtitle": "現在のレートでは、エラー予算は{hour}時間後に使い果たされます。", "xpack.observability.slo.burnRate.threshold": "しきい値は{threshold}xです", - "xpack.observability.slo.clone.errorNotification": "{name}を複製できませんでした", - "xpack.observability.slo.clone.successNotification": "{name}の作成が正常に完了しました", "xpack.observability.slo.create.errorNotification": "{name}の作成中に問題が発生しました", "xpack.observability.slo.create.successNotification": "{name}の作成が正常に完了しました", "xpack.observability.slo.deleteConfirmationModal.title": "{name}を削除しますか?", diff --git a/x-pack/plugins/translations/translations/zh-CN.json b/x-pack/plugins/translations/translations/zh-CN.json index d12e878252732..8401f714b8350 100644 --- a/x-pack/plugins/translations/translations/zh-CN.json +++ b/x-pack/plugins/translations/translations/zh-CN.json @@ -452,7 +452,6 @@ "controls.controlGroup.manageControl.dataSource.fieldTitle": "字段", "controls.controlGroup.manageControl.dataSource.formGroupDescription": "选择要为其创建控件的数据视图和字段。", "controls.controlGroup.manageControl.dataSource.formGroupTitle": "数据源", - "controls.controlGroup.manageControl.dataSource.noControlTypeMessage": "尚未选择字段", "controls.controlGroup.manageControl.dataSource.selectDataViewMessage": "请选择数据视图", "controls.controlGroup.manageControl.displaySettings.formGroupDescription": "更改控件在仪表板上的显示方式。", "controls.controlGroup.manageControl.displaySettings.formGroupTitle": "显示设置", @@ -28787,8 +28786,6 @@ "xpack.observability.slo.alerting.burnRate.reasonForInstanceId": "{actionGroupName}:过去 {longWindowDuration} 的消耗速度为 {longWindowBurnRate},且对于 {instanceId},过去 {shortWindowDuration} 为 {shortWindowBurnRate}。两个窗口超出 {burnRateThreshold} 时告警", "xpack.observability.slo.burnRate.breachedStatustSubtitle": "按照当前的速率,错误预算将在 {hour} 小时后耗尽。", "xpack.observability.slo.burnRate.threshold": "阈值为 {threshold}x", - "xpack.observability.slo.clone.errorNotification": "无法克隆 {name}", - "xpack.observability.slo.clone.successNotification": "已成功创建 {name}", "xpack.observability.slo.create.errorNotification": "创建 {name} 时出现问题", "xpack.observability.slo.create.successNotification": "已成功创建 {name}", "xpack.observability.slo.deleteConfirmationModal.title": "删除 {name}?", diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/connectors_selection.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/connectors_selection.test.tsx index 4f961f8a7bf6c..e3bf983d7bd09 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/connectors_selection.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/connectors_selection.test.tsx @@ -123,6 +123,6 @@ describe('connectors_selection', () => { ); - expect(screen.queryAllByText('test pagerduty')).toHaveLength(1); + expect(screen.getByRole('combobox')).toHaveValue('test pagerduty'); }); }); diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_form/rule_form_consumer_selection.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_form/rule_form_consumer_selection.test.tsx index 52a2ac0914088..324e9a290e831 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_form/rule_form_consumer_selection.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_form/rule_form_consumer_selection.test.tsx @@ -30,7 +30,11 @@ describe('RuleFormConsumerSelectionModal', () => { ); expect(screen.getByTestId('ruleFormConsumerSelect')).toBeInTheDocument(); - expect(screen.getByText('Select a scope')).toBeInTheDocument(); + expect(screen.getByTestId('comboBoxSearchInput')).toHaveAttribute( + 'placeholder', + 'Select a scope' + ); + expect(screen.getByTestId('comboBoxSearchInput')).toHaveValue(''); fireEvent.click(screen.getByTestId('comboBoxToggleListButton')); expect(screen.getByText('Logs')).toBeInTheDocument(); expect(screen.getByText('Metrics')).toBeInTheDocument(); @@ -116,8 +120,7 @@ describe('RuleFormConsumerSelectionModal', () => { /> ); - expect(screen.getByText('Logs')).toBeInTheDocument(); - expect(() => screen.getByText('Select a scope')).toThrow(); + expect(screen.getByTestId('comboBoxSearchInput')).toHaveValue('Logs'); }); it('should not display the initial selected consumer if it is not a selectable option', () => { @@ -129,7 +132,6 @@ describe('RuleFormConsumerSelectionModal', () => { errors={{}} /> ); - expect(() => screen.getByText('Logs')).toThrow(); - expect(screen.getByText('Select a scope')).toBeInTheDocument(); + expect(screen.getByTestId('comboBoxSearchInput')).toHaveValue(''); }); }); diff --git a/x-pack/plugins/uptime/public/legacy_uptime/app/uptime_app.tsx b/x-pack/plugins/uptime/public/legacy_uptime/app/uptime_app.tsx index a87180eb0a932..0dd752ab2ff64 100644 --- a/x-pack/plugins/uptime/public/legacy_uptime/app/uptime_app.tsx +++ b/x-pack/plugins/uptime/public/legacy_uptime/app/uptime_app.tsx @@ -15,7 +15,6 @@ import { KibanaContextProvider, KibanaThemeProvider } from '@kbn/kibana-react-pl import { RedirectAppLinks } from '@kbn/shared-ux-link-redirect-app'; import { EuiThemeProvider } from '@kbn/kibana-react-plugin/common'; import { InspectorContextProvider } from '@kbn/observability-shared-plugin/public'; -import { ObservabilityAIAssistantProvider } from '@kbn/observability-ai-assistant-plugin/public'; import { ClientPluginsSetup, ClientPluginsStart } from '../../plugin'; import { UMUpdateBadge } from '../lib/lib'; import { @@ -127,37 +126,33 @@ const Application = (props: UptimeAppProps) => { cases: startPlugins.cases, }} > - - - - - - - - -
- - - - - - - -
-
-
-
-
-
-
-
-
+ + + + + + + +
+ + + + + + + +
+
+
+
+
+
+
+
diff --git a/x-pack/plugins/uptime/public/legacy_uptime/components/common/header/action_menu_content.tsx b/x-pack/plugins/uptime/public/legacy_uptime/components/common/header/action_menu_content.tsx index d6a37ea9bd4ee..58756b4a5669a 100644 --- a/x-pack/plugins/uptime/public/legacy_uptime/components/common/header/action_menu_content.tsx +++ b/x-pack/plugins/uptime/public/legacy_uptime/components/common/header/action_menu_content.tsx @@ -13,7 +13,7 @@ import { useHistory, useRouteMatch } from 'react-router-dom'; import { useSelector } from 'react-redux'; import { createExploratoryViewUrl } from '@kbn/exploratory-view-plugin/public'; import { useKibana } from '@kbn/kibana-react-plugin/public'; -import { ObservabilityAIAssistantActionMenuItem } from '@kbn/observability-ai-assistant-plugin/public'; + import { stringifyUrlParams } from '../../../lib/helper/url_params/stringify_url_params'; import { useUptimeSettingsContext } from '../../../contexts/uptime_settings_context'; import { useGetUrlParams } from '../../../hooks'; @@ -22,6 +22,7 @@ import { MONITOR_ROUTE, SETTINGS_ROUTE } from '../../../../../common/constants'; import { InspectorHeaderLink } from './inspector_header_link'; import { monitorStatusSelector } from '../../../state/selectors'; import { ManageMonitorsBtn } from './manage_monitors_btn'; +import { useUptimeStartPlugins } from '../../../contexts/uptime_startup_plugins_context'; const ADD_DATA_LABEL = i18n.translate('xpack.uptime.addDataButtonLabel', { defaultMessage: 'Add data', @@ -38,7 +39,10 @@ const ANALYZE_MESSAGE = i18n.translate('xpack.uptime.analyzeDataButtonLabel.mess export function ActionMenuContent(): React.ReactElement { const kibana = useKibana(); + const { basePath } = useUptimeSettingsContext(); + const { observabilityAIAssistant: { ObservabilityAIAssistantActionMenuItem } = {} } = + useUptimeStartPlugins(); const params = useGetUrlParams(); const { dateRangeStart, dateRangeEnd } = params; const history = useHistory(); @@ -117,7 +121,7 @@ export function ActionMenuContent(): React.ReactElement { {ADD_DATA_LABEL} - + {ObservabilityAIAssistantActionMenuItem ? : null} ); } diff --git a/x-pack/plugins/uptime/public/legacy_uptime/components/monitor/ml/__snapshots__/ml_integerations.test.tsx.snap b/x-pack/plugins/uptime/public/legacy_uptime/components/monitor/ml/__snapshots__/ml_integerations.test.tsx.snap index b85193cb80f05..5b8d20ae63ba0 100644 --- a/x-pack/plugins/uptime/public/legacy_uptime/components/monitor/ml/__snapshots__/ml_integerations.test.tsx.snap +++ b/x-pack/plugins/uptime/public/legacy_uptime/components/monitor/ml/__snapshots__/ml_integerations.test.tsx.snap @@ -2,33 +2,29 @@ exports[`ML Integrations renders without errors 1`] = `
-
- -
+ aria-label="Loading" + class="euiLoadingSpinner emotion-euiLoadingSpinner-m" + role="progressbar" + style="border-color:#07C currentcolor currentcolor currentcolor" + /> + + +
`; diff --git a/x-pack/plugins/uptime/public/legacy_uptime/components/monitor/status_details/__snapshots__/monitor_status.bar.test.tsx.snap b/x-pack/plugins/uptime/public/legacy_uptime/components/monitor/status_details/__snapshots__/monitor_status.bar.test.tsx.snap index 77345c95164a6..8a4e0915d4fa3 100644 --- a/x-pack/plugins/uptime/public/legacy_uptime/components/monitor/status_details/__snapshots__/monitor_status.bar.test.tsx.snap +++ b/x-pack/plugins/uptime/public/legacy_uptime/components/monitor/status_details/__snapshots__/monitor_status.bar.test.tsx.snap @@ -83,42 +83,38 @@ Array [ Enable status alerts
-
- -
+ class="euiSwitch__thumb" + /> + + +
diff --git a/x-pack/plugins/uptime/public/legacy_uptime/components/overview/alerts/monitor_expressions/__snapshots__/down_number_select.test.tsx.snap b/x-pack/plugins/uptime/public/legacy_uptime/components/overview/alerts/monitor_expressions/__snapshots__/down_number_select.test.tsx.snap index 527247ec9f072..8e559f70cd5fb 100644 --- a/x-pack/plugins/uptime/public/legacy_uptime/components/overview/alerts/monitor_expressions/__snapshots__/down_number_select.test.tsx.snap +++ b/x-pack/plugins/uptime/public/legacy_uptime/components/overview/alerts/monitor_expressions/__snapshots__/down_number_select.test.tsx.snap @@ -2,30 +2,26 @@ exports[`DownNoExpressionSelect component should renders against props 1`] = `
-
- - matching monitors are down >= - - - - 5 times - + matching monitors are down >= -
+ + + 5 times + +
`; diff --git a/x-pack/plugins/uptime/public/legacy_uptime/components/overview/alerts/monitor_expressions/__snapshots__/time_expression_select.test.tsx.snap b/x-pack/plugins/uptime/public/legacy_uptime/components/overview/alerts/monitor_expressions/__snapshots__/time_expression_select.test.tsx.snap index 8bdfe9e9b28eb..49aabf62728c1 100644 --- a/x-pack/plugins/uptime/public/legacy_uptime/components/overview/alerts/monitor_expressions/__snapshots__/time_expression_select.test.tsx.snap +++ b/x-pack/plugins/uptime/public/legacy_uptime/components/overview/alerts/monitor_expressions/__snapshots__/time_expression_select.test.tsx.snap @@ -8,58 +8,50 @@ exports[`TimeExpressionSelect component should renders against props 1`] = ` class="euiFlexItem emotion-euiFlexItem-growZero" >
-
- - within - - - - last 15 - + within -
+ + + last 15 + +
-
+ + - - - - minutes - + minutes -
+
diff --git a/x-pack/plugins/ux/public/application/application.test.tsx b/x-pack/plugins/ux/public/application/application.test.tsx index 33a2ef66b9c70..bcac3494f5376 100644 --- a/x-pack/plugins/ux/public/application/application.test.tsx +++ b/x-pack/plugins/ux/public/application/application.test.tsx @@ -8,11 +8,12 @@ import React from 'react'; import { EuiErrorBoundary } from '@elastic/eui'; import { mount } from 'enzyme'; +import { createObservabilityRuleTypeRegistryMock } from '@kbn/observability-plugin/public'; +import { observabilityAIAssistantPluginMock } from '@kbn/observability-ai-assistant-plugin/public/mock'; import { UXAppRoot } from './ux_app'; import { RumHome } from '../components/app/rum_dashboard/rum_home'; import { coreMock } from '@kbn/core/public/mocks'; -import { createObservabilityRuleTypeRegistryMock } from '@kbn/observability-plugin/public'; import { merge } from 'lodash'; import { UI_SETTINGS } from '@kbn/data-plugin/common'; import { embeddablePluginMock } from '@kbn/embeddable-plugin/public/mocks'; @@ -36,6 +37,9 @@ jest.mock('@kbn/kibana-react-plugin/public', () => { }; }); +const mockAIAssistantPlugin = + observabilityAIAssistantPluginMock.createStartContract(); + const mockPlugin = { data: { query: { @@ -43,6 +47,7 @@ const mockPlugin = { }, }, observability: {}, + observabilityAIAssistant: mockAIAssistantPlugin, }; const mockEmbeddable = embeddablePluginMock.createStartContract(); @@ -67,9 +72,7 @@ const mockCorePlugins = { ), }, }, - observabilityAIAssistant: { - service: {}, - }, + observabilityAIAssistant: mockAIAssistantPlugin, data: { query: { timefilter: { @@ -127,6 +130,7 @@ export const mockApmPluginContextValue = { core: mockCore, plugins: mockPlugin, observabilityRuleTypeRegistry: createObservabilityRuleTypeRegistryMock(), + observabilityAIAssistant: mockAIAssistantPlugin, corePlugins: mockCorePlugins, deps: {}, }; diff --git a/x-pack/plugins/ux/public/application/ux_app.tsx b/x-pack/plugins/ux/public/application/ux_app.tsx index 9eb0b7f2f967b..aae803dec162a 100644 --- a/x-pack/plugins/ux/public/application/ux_app.tsx +++ b/x-pack/plugins/ux/public/application/ux_app.tsx @@ -33,7 +33,6 @@ import { InspectorContextProvider, useBreadcrumbs, } from '@kbn/observability-shared-plugin/public'; -import { ObservabilityAIAssistantProvider } from '@kbn/observability-ai-assistant-plugin/public'; import { CsmSharedContextProvider } from '../components/app/rum_dashboard/csm_shared_context'; import { DASHBOARD_LABEL, @@ -147,6 +146,7 @@ export function UXAppRoot({ inspector, observability, observabilityShared, + observabilityAIAssistant, embeddable, exploratoryView, data, @@ -154,47 +154,43 @@ export function UXAppRoot({ lens, }} > - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + +
diff --git a/x-pack/plugins/ux/public/components/app/rum_dashboard/action_menu/index.tsx b/x-pack/plugins/ux/public/components/app/rum_dashboard/action_menu/index.tsx index fc6a636abba50..da0cc4f8cfc7e 100644 --- a/x-pack/plugins/ux/public/components/app/rum_dashboard/action_menu/index.tsx +++ b/x-pack/plugins/ux/public/components/app/rum_dashboard/action_menu/index.tsx @@ -14,7 +14,6 @@ import { createExploratoryViewUrl, } from '@kbn/exploratory-view-plugin/public'; import { AppMountParameters } from '@kbn/core/public'; -import { ObservabilityAIAssistantActionMenuItem } from '@kbn/observability-ai-assistant-plugin/public'; import { useLegacyUrlParams } from '../../../../context/url_params_context/use_url_params'; import { SERVICE_NAME } from '../../../../../common/elasticsearch_fieldnames'; import { UxInspectorHeaderLink } from './inpector_link'; @@ -39,7 +38,12 @@ export function UXActionMenu({ appMountParameters: AppMountParameters; isDev: boolean; }) { - const { http, application } = useKibanaServices(); + const { + http, + application, + observabilityAIAssistant: { ObservabilityAIAssistantActionMenuItem }, + } = useKibanaServices(); + const { urlParams } = useLegacyUrlParams(); const { rangeTo, rangeFrom, serviceName } = urlParams; @@ -88,7 +92,9 @@ export function UXActionMenu({ })} - + {ObservabilityAIAssistantActionMenuItem ? ( + + ) : null} ); diff --git a/x-pack/test/alerting_api_integration/common/plugins/aad/server/plugin.ts b/x-pack/test/alerting_api_integration/common/plugins/aad/server/plugin.ts index 75b66396c269c..a55417d668595 100644 --- a/x-pack/test/alerting_api_integration/common/plugins/aad/server/plugin.ts +++ b/x-pack/test/alerting_api_integration/common/plugins/aad/server/plugin.ts @@ -16,6 +16,7 @@ import { import { schema } from '@kbn/config-schema'; import { EncryptedSavedObjectsPluginStart } from '@kbn/encrypted-saved-objects-plugin/server'; import { SpacesPluginSetup } from '@kbn/spaces-plugin/server'; +import { RULE_SAVED_OBJECT_TYPE } from '@kbn/alerting-plugin/server'; interface FixtureSetupDeps { spaces?: SpacesPluginSetup; @@ -49,7 +50,7 @@ export class FixturePlugin implements Plugin { return await savedObjectsWithAlerts.update( - 'alert', + RULE_SAVED_OBJECT_TYPE, id, { ...( await encryptedSavedObjectsWithAlerts.getDecryptedAsInternalUser( - 'alert', + RULE_SAVED_OBJECT_TYPE, id, { namespace, @@ -182,7 +183,7 @@ export function defineRoutes( const [{ savedObjects }] = await core.getStartServices(); const savedObjectsWithAlerts = await savedObjects.getScopedClient(req, { - includedHiddenTypes: ['alert'], + includedHiddenTypes: [RULE_SAVED_OBJECT_TYPE], }); const savedAlert = await savedObjectsWithAlerts.get(type, id); const result = await retryIfConflicts( @@ -223,7 +224,7 @@ export function defineRoutes( const [{ savedObjects }] = await core.getStartServices(); const savedObjectsWithTasksAndAlerts = await savedObjects.getScopedClient(req, { - includedHiddenTypes: ['task', 'alert'], + includedHiddenTypes: ['task', RULE_SAVED_OBJECT_TYPE], }); const result = await retryIfConflicts( logger, @@ -260,9 +261,9 @@ export function defineRoutes( const [{ savedObjects }] = await core.getStartServices(); const savedObjectsWithTasksAndAlerts = await savedObjects.getScopedClient(req, { - includedHiddenTypes: ['task', 'alert'], + includedHiddenTypes: ['task', RULE_SAVED_OBJECT_TYPE], }); - const alert = await savedObjectsWithTasksAndAlerts.get('alert', id); + const alert = await savedObjectsWithTasksAndAlerts.get(RULE_SAVED_OBJECT_TYPE, id); const result = await retryIfConflicts( logger, `/api/alerts_fixture/{id}/reset_task_status`, @@ -422,9 +423,9 @@ export function defineRoutes( attributes: { apiKey, apiKeyOwner }, }: SavedObject = await encryptedSavedObjects .getClient({ - includedHiddenTypes: ['alert'], + includedHiddenTypes: [RULE_SAVED_OBJECT_TYPE], }) - .getDecryptedAsInternalUser('alert', id, { + .getDecryptedAsInternalUser(RULE_SAVED_OBJECT_TYPE, id, { namespace, }); diff --git a/x-pack/test/alerting_api_integration/common/plugins/alerts_restricted/server/plugin.ts b/x-pack/test/alerting_api_integration/common/plugins/alerts_restricted/server/plugin.ts index 66a85b32e6be6..9e78728d1f7a8 100644 --- a/x-pack/test/alerting_api_integration/common/plugins/alerts_restricted/server/plugin.ts +++ b/x-pack/test/alerting_api_integration/common/plugins/alerts_restricted/server/plugin.ts @@ -10,6 +10,7 @@ import { PluginSetupContract as ActionsPluginSetup } from '@kbn/actions-plugin/s import { PluginSetupContract as AlertingPluginSetup } from '@kbn/alerting-plugin/server/plugin'; import { EncryptedSavedObjectsPluginStart } from '@kbn/encrypted-saved-objects-plugin/server'; import { PluginSetupContract as FeaturesPluginSetup } from '@kbn/features-plugin/server'; +import { RULE_SAVED_OBJECT_TYPE } from '@kbn/alerting-plugin/server'; import { defineAlertTypes } from './alert_types'; export interface FixtureSetupDeps { @@ -34,7 +35,7 @@ export class FixturePlugin implements Plugin = { space_1_all_alerts_none_actions: SavedObjectsUtils.getConvertedObjectId( 'space1', - 'alert', + RULE_SAVED_OBJECT_TYPE, '6ee9630a-a20e-44af-9465-217a3717d2ab' ), space_1_all_with_restricted_fixture: SavedObjectsUtils.getConvertedObjectId( 'space1', - 'alert', + RULE_SAVED_OBJECT_TYPE, '5cc59319-74ee-4edc-8646-a79ea91067cd' ), space_1_all: SavedObjectsUtils.getConvertedObjectId( 'space1', - 'alert', + RULE_SAVED_OBJECT_TYPE, 'd41a6abb-b93b-46df-a80a-926221ea847c' ), global_read: SavedObjectsUtils.getConvertedObjectId( 'space1', - 'alert', + RULE_SAVED_OBJECT_TYPE, '362e362b-a137-4aa2-9434-43e3d0d84a34' ), superuser: SavedObjectsUtils.getConvertedObjectId( 'space1', - 'alert', + RULE_SAVED_OBJECT_TYPE, 'b384be60-ec53-4b26-857e-0253ee55b277' ), }; diff --git a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/alerting/unmute_all.ts b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/alerting/unmute_all.ts index 9623462b8ae45..d038108d29f67 100644 --- a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/alerting/unmute_all.ts +++ b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/alerting/unmute_all.ts @@ -6,6 +6,7 @@ */ import expect from '@kbn/expect'; +import { RULE_SAVED_OBJECT_TYPE } from '@kbn/alerting-plugin/server'; import { UserAtSpaceScenarios } from '../../../scenarios'; import { FtrProviderContext } from '../../../../common/ftr_provider_context'; import { @@ -103,7 +104,7 @@ export default function createUnmuteAlertTests({ getService }: FtrProviderContex await checkAAD({ supertest, spaceId: space.id, - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, id: createdAlert.id, }); break; @@ -164,7 +165,7 @@ export default function createUnmuteAlertTests({ getService }: FtrProviderContex await checkAAD({ supertest, spaceId: space.id, - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, id: createdAlert.id, }); break; @@ -225,7 +226,7 @@ export default function createUnmuteAlertTests({ getService }: FtrProviderContex await checkAAD({ supertest, spaceId: space.id, - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, id: createdAlert.id, }); break; @@ -293,7 +294,7 @@ export default function createUnmuteAlertTests({ getService }: FtrProviderContex await checkAAD({ supertest, spaceId: space.id, - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, id: createdAlert.id, }); break; diff --git a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/alerting/unmute_instance.ts b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/alerting/unmute_instance.ts index 3d9f49eb3cffb..97add81c6d5b8 100644 --- a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/alerting/unmute_instance.ts +++ b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/alerting/unmute_instance.ts @@ -6,6 +6,7 @@ */ import expect from '@kbn/expect'; +import { RULE_SAVED_OBJECT_TYPE } from '@kbn/alerting-plugin/server'; import { UserAtSpaceScenarios } from '../../../scenarios'; import { FtrProviderContext } from '../../../../common/ftr_provider_context'; import { @@ -103,7 +104,7 @@ export default function createMuteAlertInstanceTests({ getService }: FtrProvider await checkAAD({ supertest, spaceId: space.id, - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, id: createdAlert.id, }); break; @@ -164,7 +165,7 @@ export default function createMuteAlertInstanceTests({ getService }: FtrProvider await checkAAD({ supertest, spaceId: space.id, - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, id: createdAlert.id, }); break; @@ -225,7 +226,7 @@ export default function createMuteAlertInstanceTests({ getService }: FtrProvider await checkAAD({ supertest, spaceId: space.id, - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, id: createdAlert.id, }); break; @@ -297,7 +298,7 @@ export default function createMuteAlertInstanceTests({ getService }: FtrProvider await checkAAD({ supertest, spaceId: space.id, - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, id: createdAlert.id, }); break; diff --git a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/alerting/update.ts b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/alerting/update.ts index 31250862265ea..b4a775b7a6635 100644 --- a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/alerting/update.ts +++ b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/alerting/update.ts @@ -7,6 +7,7 @@ import expect from '@kbn/expect'; import { Response as SupertestResponse } from 'supertest'; +import { RULE_SAVED_OBJECT_TYPE } from '@kbn/alerting-plugin/server'; import { UserAtSpaceScenarios } from '../../../scenarios'; import { checkAAD, @@ -146,7 +147,7 @@ export default function createUpdateTests({ getService }: FtrProviderContext) { await checkAAD({ supertest, spaceId: space.id, - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, id: createdAlert.id, }); break; @@ -238,7 +239,7 @@ export default function createUpdateTests({ getService }: FtrProviderContext) { await checkAAD({ supertest, spaceId: space.id, - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, id: createdAlert.id, }); break; @@ -330,7 +331,7 @@ export default function createUpdateTests({ getService }: FtrProviderContext) { await checkAAD({ supertest, spaceId: space.id, - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, id: createdAlert.id, }); break; @@ -429,7 +430,7 @@ export default function createUpdateTests({ getService }: FtrProviderContext) { await checkAAD({ supertest, spaceId: space.id, - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, id: createdAlert.id, }); break; @@ -526,7 +527,7 @@ export default function createUpdateTests({ getService }: FtrProviderContext) { await checkAAD({ supertest, spaceId: space.id, - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, id: createdAlert.id, }); break; diff --git a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/alerting/update_api_key.ts b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/alerting/update_api_key.ts index 7e2f4e74aa023..3df0570650146 100644 --- a/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/alerting/update_api_key.ts +++ b/x-pack/test/alerting_api_integration/security_and_spaces/group2/tests/alerting/update_api_key.ts @@ -6,6 +6,7 @@ */ import expect from '@kbn/expect'; +import { RULE_SAVED_OBJECT_TYPE } from '@kbn/alerting-plugin/server'; import { UserAtSpaceScenarios } from '../../../scenarios'; import { FtrProviderContext } from '../../../../common/ftr_provider_context'; import { @@ -99,7 +100,7 @@ export default function createUpdateApiKeyTests({ getService }: FtrProviderConte await checkAAD({ supertest, spaceId: space.id, - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, id: createdAlert.id, }); break; @@ -155,7 +156,7 @@ export default function createUpdateApiKeyTests({ getService }: FtrProviderConte await checkAAD({ supertest, spaceId: space.id, - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, id: createdAlert.id, }); break; @@ -211,7 +212,7 @@ export default function createUpdateApiKeyTests({ getService }: FtrProviderConte await checkAAD({ supertest, spaceId: space.id, - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, id: createdAlert.id, }); break; @@ -278,7 +279,7 @@ export default function createUpdateApiKeyTests({ getService }: FtrProviderConte await checkAAD({ supertest, spaceId: space.id, - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, id: createdAlert.id, }); break; @@ -340,7 +341,7 @@ export default function createUpdateApiKeyTests({ getService }: FtrProviderConte await checkAAD({ supertest, spaceId: space.id, - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, id: createdAlert.id, }); break; diff --git a/x-pack/test/alerting_api_integration/security_and_spaces/group3/tests/alerting/bulk_edit.ts b/x-pack/test/alerting_api_integration/security_and_spaces/group3/tests/alerting/bulk_edit.ts index c948791e5ea49..8dec0a90e8d31 100644 --- a/x-pack/test/alerting_api_integration/security_and_spaces/group3/tests/alerting/bulk_edit.ts +++ b/x-pack/test/alerting_api_integration/security_and_spaces/group3/tests/alerting/bulk_edit.ts @@ -7,6 +7,7 @@ import expect from '@kbn/expect'; import type { SanitizedRule } from '@kbn/alerting-plugin/common'; +import { RULE_SAVED_OBJECT_TYPE } from '@kbn/alerting-plugin/server'; import { UserAtSpaceScenarios } from '../../../scenarios'; import { checkAAD, @@ -123,7 +124,7 @@ export default function createUpdateTests({ getService }: FtrProviderContext) { await checkAAD({ supertest, spaceId: space.id, - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, id: createdRule.id, }); break; diff --git a/x-pack/test/alerting_api_integration/security_and_spaces/group3/tests/alerting/clone.ts b/x-pack/test/alerting_api_integration/security_and_spaces/group3/tests/alerting/clone.ts index 2cbec3853f02e..90748d1b2d4cd 100644 --- a/x-pack/test/alerting_api_integration/security_and_spaces/group3/tests/alerting/clone.ts +++ b/x-pack/test/alerting_api_integration/security_and_spaces/group3/tests/alerting/clone.ts @@ -6,6 +6,7 @@ */ import expect from '@kbn/expect'; +import { RULE_SAVED_OBJECT_TYPE } from '@kbn/alerting-plugin/server'; import { Spaces, UserAtSpaceScenarios } from '../../../scenarios'; import { checkAAD, @@ -194,7 +195,7 @@ export default function createAlertTests({ getService }: FtrProviderContext) { await checkAAD({ supertest, spaceId: space.id, - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, id: response.body.id, }); break; diff --git a/x-pack/test/alerting_api_integration/security_and_spaces/group3/tests/alerting/user_managed_api_key.ts b/x-pack/test/alerting_api_integration/security_and_spaces/group3/tests/alerting/user_managed_api_key.ts index 905fe05e110e1..77c6efc4e92d8 100644 --- a/x-pack/test/alerting_api_integration/security_and_spaces/group3/tests/alerting/user_managed_api_key.ts +++ b/x-pack/test/alerting_api_integration/security_and_spaces/group3/tests/alerting/user_managed_api_key.ts @@ -8,6 +8,7 @@ import expect from '@kbn/expect'; import { generateAPIKeyName } from '@kbn/alerting-plugin/server/rules_client/common'; import { IValidatedEvent } from '@kbn/event-log-plugin/server'; +import { RULE_SAVED_OBJECT_TYPE } from '@kbn/alerting-plugin/server'; import { checkAAD, getEventLog, @@ -128,7 +129,7 @@ export default function userManagedApiKeyTest({ getService }: FtrProviderContext await checkAAD({ supertest, spaceId: SuperuserAtSpace1.space.id, - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, id: ruleId, }); @@ -184,7 +185,7 @@ export default function userManagedApiKeyTest({ getService }: FtrProviderContext await checkAAD({ supertest, spaceId: SuperuserAtSpace1.space.id, - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, id: ruleId, }); @@ -248,7 +249,7 @@ export default function userManagedApiKeyTest({ getService }: FtrProviderContext await checkAAD({ supertest, spaceId: SuperuserAtSpace1.space.id, - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, id: response.body.id, }); @@ -311,7 +312,7 @@ export default function userManagedApiKeyTest({ getService }: FtrProviderContext await checkAAD({ supertest, spaceId: SuperuserAtSpace1.space.id, - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, id: response.body.id, }); @@ -347,7 +348,7 @@ export default function userManagedApiKeyTest({ getService }: FtrProviderContext await checkAAD({ supertest, spaceId: SuperuserAtSpace1.space.id, - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, id: ruleId, }); @@ -382,7 +383,7 @@ export default function userManagedApiKeyTest({ getService }: FtrProviderContext await checkAAD({ supertest, spaceId: SuperuserAtSpace1.space.id, - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, id: ruleId, }); @@ -407,7 +408,7 @@ export default function userManagedApiKeyTest({ getService }: FtrProviderContext await checkAAD({ supertest, spaceId: SuperuserAtSpace1.space.id, - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, id: ruleId, }); @@ -431,7 +432,7 @@ export default function userManagedApiKeyTest({ getService }: FtrProviderContext await checkAAD({ supertest, spaceId: SuperuserAtSpace1.space.id, - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, id: ruleId, }); @@ -452,7 +453,7 @@ export default function userManagedApiKeyTest({ getService }: FtrProviderContext await checkAAD({ supertest, spaceId: SuperuserAtSpace1.space.id, - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, id: ruleId, }); @@ -472,7 +473,7 @@ export default function userManagedApiKeyTest({ getService }: FtrProviderContext await checkAAD({ supertest, spaceId: SuperuserAtSpace1.space.id, - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, id: ruleId, }); @@ -496,7 +497,7 @@ export default function userManagedApiKeyTest({ getService }: FtrProviderContext await checkAAD({ supertest, spaceId: SuperuserAtSpace1.space.id, - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, id: ruleId, }); @@ -519,7 +520,7 @@ export default function userManagedApiKeyTest({ getService }: FtrProviderContext await checkAAD({ supertest, spaceId: SuperuserAtSpace1.space.id, - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, id: ruleId, }); diff --git a/x-pack/test/alerting_api_integration/security_and_spaces/group4/tests/alerting/alerts.ts b/x-pack/test/alerting_api_integration/security_and_spaces/group4/tests/alerting/alerts.ts index 90ddf77f888c3..bf6811b4ad175 100644 --- a/x-pack/test/alerting_api_integration/security_and_spaces/group4/tests/alerting/alerts.ts +++ b/x-pack/test/alerting_api_integration/security_and_spaces/group4/tests/alerting/alerts.ts @@ -13,6 +13,7 @@ import { IValidatedEvent, nanosToMillis } from '@kbn/event-log-plugin/server'; import { TaskRunning, TaskRunningStage } from '@kbn/task-manager-plugin/server/task_running'; import { ConcreteTaskInstance } from '@kbn/task-manager-plugin/server'; import { ESTestIndexTool, ES_TEST_INDEX_NAME } from '@kbn/alerting-api-integration-helpers'; +import { RULE_SAVED_OBJECT_TYPE } from '@kbn/alerting-plugin/server'; import { UserAtSpaceScenarios, Superuser } from '../../../scenarios'; import { FtrProviderContext } from '../../../../common/ftr_provider_context'; import { @@ -1916,7 +1917,7 @@ instanceStateValue: true expect(event?.kibana?.saved_objects).to.eql([ { rel: 'primary', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, id: alertId, namespace: spaceId, type_id: ruleObject.alertInfo.ruleTypeId, diff --git a/x-pack/test/alerting_api_integration/security_and_spaces/group4/tests/alerting/event_log.ts b/x-pack/test/alerting_api_integration/security_and_spaces/group4/tests/alerting/event_log.ts index 9ad165706bc3d..41963a2e488ba 100644 --- a/x-pack/test/alerting_api_integration/security_and_spaces/group4/tests/alerting/event_log.ts +++ b/x-pack/test/alerting_api_integration/security_and_spaces/group4/tests/alerting/event_log.ts @@ -6,6 +6,7 @@ */ import expect from '@kbn/expect'; +import { RULE_SAVED_OBJECT_TYPE } from '@kbn/alerting-plugin/server'; import { descriptorToArray, SavedObjectDescriptor, @@ -85,7 +86,9 @@ export default function eventLogTests({ getService }: FtrProviderContext) { validateEvent(event, { spaceId, - savedObjects: [{ type: 'alert', id: alertId, rel: 'primary', type_id: 'test.noop' }], + savedObjects: [ + { type: RULE_SAVED_OBJECT_TYPE, id: alertId, rel: 'primary', type_id: 'test.noop' }, + ], outcome: 'failure', message: `test.noop:${alertId}: execution failed`, errorMessage: `Unable to decrypt attribute "apiKey" of saved object "${descriptorToArray( diff --git a/x-pack/test/alerting_api_integration/security_and_spaces/group4/tests/alerting/snooze.ts b/x-pack/test/alerting_api_integration/security_and_spaces/group4/tests/alerting/snooze.ts index 8073ef48fbefe..8c1fed7978b55 100644 --- a/x-pack/test/alerting_api_integration/security_and_spaces/group4/tests/alerting/snooze.ts +++ b/x-pack/test/alerting_api_integration/security_and_spaces/group4/tests/alerting/snooze.ts @@ -6,6 +6,7 @@ */ import expect from '@kbn/expect'; +import { RULE_SAVED_OBJECT_TYPE } from '@kbn/alerting-plugin/server'; import { UserAtSpaceScenarios } from '../../../scenarios'; import { FtrProviderContext } from '../../../../common/ftr_provider_context'; import { @@ -114,7 +115,7 @@ export default function createSnoozeRuleTests({ getService }: FtrProviderContext await checkAAD({ supertest, spaceId: space.id, - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, id: createdAlert.id, }); break; @@ -176,7 +177,7 @@ export default function createSnoozeRuleTests({ getService }: FtrProviderContext await checkAAD({ supertest, spaceId: space.id, - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, id: createdAlert.id, }); break; @@ -238,7 +239,7 @@ export default function createSnoozeRuleTests({ getService }: FtrProviderContext await checkAAD({ supertest, spaceId: space.id, - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, id: createdAlert.id, }); break; @@ -307,7 +308,7 @@ export default function createSnoozeRuleTests({ getService }: FtrProviderContext await checkAAD({ supertest, spaceId: space.id, - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, id: createdAlert.id, }); break; @@ -388,7 +389,7 @@ export default function createSnoozeRuleTests({ getService }: FtrProviderContext await checkAAD({ supertest, spaceId: space.id, - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, id: createdAlert.id, }); break; diff --git a/x-pack/test/alerting_api_integration/security_and_spaces/group4/tests/alerting/unsnooze.ts b/x-pack/test/alerting_api_integration/security_and_spaces/group4/tests/alerting/unsnooze.ts index 2f697b0ee3aff..eae8814a514fb 100644 --- a/x-pack/test/alerting_api_integration/security_and_spaces/group4/tests/alerting/unsnooze.ts +++ b/x-pack/test/alerting_api_integration/security_and_spaces/group4/tests/alerting/unsnooze.ts @@ -6,6 +6,7 @@ */ import expect from '@kbn/expect'; +import { RULE_SAVED_OBJECT_TYPE } from '@kbn/alerting-plugin/server'; import { UserAtSpaceScenarios } from '../../../scenarios'; import { FtrProviderContext } from '../../../../common/ftr_provider_context'; import { @@ -98,7 +99,7 @@ export default function createUnsnoozeRuleTests({ getService }: FtrProviderConte await checkAAD({ supertest, spaceId: space.id, - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, id: createdAlert.id, }); break; @@ -155,7 +156,7 @@ export default function createUnsnoozeRuleTests({ getService }: FtrProviderConte await checkAAD({ supertest, spaceId: space.id, - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, id: createdAlert.id, }); break; @@ -212,7 +213,7 @@ export default function createUnsnoozeRuleTests({ getService }: FtrProviderConte await checkAAD({ supertest, spaceId: space.id, - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, id: createdAlert.id, }); break; @@ -276,7 +277,7 @@ export default function createUnsnoozeRuleTests({ getService }: FtrProviderConte await checkAAD({ supertest, spaceId: space.id, - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, id: createdAlert.id, }); break; diff --git a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group1/create.ts b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group1/create.ts index eb9f90cb41f2a..3d97d39097348 100644 --- a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group1/create.ts +++ b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group1/create.ts @@ -9,6 +9,7 @@ import expect from '@kbn/expect'; import { SavedObject } from '@kbn/core/server'; import { RawRule } from '@kbn/alerting-plugin/server/types'; import { ALERTING_CASES_SAVED_OBJECT_INDEX } from '@kbn/core-saved-objects-server'; +import { RULE_SAVED_OBJECT_TYPE } from '@kbn/alerting-plugin/server'; import { Spaces } from '../../../scenarios'; import { checkAAD, @@ -122,7 +123,7 @@ export default function createAlertTests({ getService }: FtrProviderContext) { await checkAAD({ supertest, spaceId: Spaces.space1.id, - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, id: response.body.id, }); }); @@ -313,7 +314,7 @@ export default function createAlertTests({ getService }: FtrProviderContext) { await checkAAD({ supertest, spaceId: Spaces.space1.id, - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, id: response.body.id, }); }); @@ -380,7 +381,7 @@ export default function createAlertTests({ getService }: FtrProviderContext) { await checkAAD({ supertest, spaceId: Spaces.space1.id, - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, id: customId, }); }); @@ -399,7 +400,7 @@ export default function createAlertTests({ getService }: FtrProviderContext) { await checkAAD({ supertest, spaceId: Spaces.space1.id, - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, id: customId, }); }); @@ -556,7 +557,7 @@ export default function createAlertTests({ getService }: FtrProviderContext) { await checkAAD({ supertest, spaceId: Spaces.space1.id, - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, id: response.body.id, }); }); diff --git a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group1/disable.ts b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group1/disable.ts index 39eaa216e7e04..0dccb0ea5a545 100644 --- a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group1/disable.ts +++ b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group1/disable.ts @@ -6,6 +6,7 @@ */ import expect from '@kbn/expect'; +import { RULE_SAVED_OBJECT_TYPE } from '@kbn/alerting-plugin/server'; import { Spaces } from '../../../scenarios'; import { FtrProviderContext } from '../../../../common/ftr_provider_context'; import { @@ -75,7 +76,7 @@ export default function createDisableRuleTests({ getService }: FtrProviderContex await checkAAD({ supertest: supertestWithoutAuth, spaceId: Spaces.space1.id, - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, id: createdRule.id, }); }); @@ -149,7 +150,12 @@ export default function createDisableRuleTests({ getService }: FtrProviderContex validateEvent(event, { spaceId: Spaces.space1.id, savedObjects: [ - { type: 'alert', id: ruleId, rel: 'primary', type_id: 'test.cumulative-firing' }, + { + type: RULE_SAVED_OBJECT_TYPE, + id: ruleId, + rel: 'primary', + type_id: 'test.cumulative-firing', + }, ], message: "instance 'instance-0' has been untracked because the rule was disabled", shouldHaveEventEnd: false, @@ -193,7 +199,7 @@ export default function createDisableRuleTests({ getService }: FtrProviderContex await checkAAD({ supertest: supertestWithoutAuth, spaceId: Spaces.space1.id, - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, id: createdRule.id, }); }); @@ -237,7 +243,7 @@ export default function createDisableRuleTests({ getService }: FtrProviderContex await checkAAD({ supertest: supertestWithoutAuth, spaceId: Spaces.space1.id, - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, id: createdRule.id, }); }); diff --git a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group1/enable.ts b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group1/enable.ts index b9538c786a496..cf49801cb6145 100644 --- a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group1/enable.ts +++ b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group1/enable.ts @@ -6,6 +6,7 @@ */ import expect from '@kbn/expect'; +import { RULE_SAVED_OBJECT_TYPE } from '@kbn/alerting-plugin/server'; import { Spaces } from '../../../scenarios'; import { FtrProviderContext } from '../../../../common/ftr_provider_context'; import { @@ -68,7 +69,7 @@ export default function createEnableAlertTests({ getService }: FtrProviderContex await checkAAD({ supertest: supertestWithoutAuth, spaceId: Spaces.space1.id, - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, id: createdAlert.id, }); }); @@ -124,7 +125,7 @@ export default function createEnableAlertTests({ getService }: FtrProviderContex await checkAAD({ supertest: supertestWithoutAuth, spaceId: Spaces.space1.id, - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, id: createdAlert.id, }); }); diff --git a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group1/event_log.ts b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group1/event_log.ts index 2662ba69f3025..4b0bcba103e10 100644 --- a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group1/event_log.ts +++ b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group1/event_log.ts @@ -10,6 +10,7 @@ import expect from '@kbn/expect'; import { IValidatedEvent, nanosToMillis } from '@kbn/event-log-plugin/server'; import { RuleNotifyWhen } from '@kbn/alerting-plugin/common'; import { ES_TEST_INDEX_NAME, ESTestIndexTool } from '@kbn/alerting-api-integration-helpers'; +import { RULE_SAVED_OBJECT_TYPE } from '@kbn/alerting-plugin/server'; import { Spaces } from '../../../scenarios'; import { getUrlPrefix, @@ -167,7 +168,12 @@ export default function eventLogTests({ getService }: FtrProviderContext) { validateEvent(event, { spaceId: space.id, savedObjects: [ - { type: 'alert', id: alertId, rel: 'primary', type_id: 'test.patternFiring' }, + { + type: RULE_SAVED_OBJECT_TYPE, + id: alertId, + rel: 'primary', + type_id: 'test.patternFiring', + }, ], message: `rule execution start: "${alertId}"`, shouldHaveTask: true, @@ -186,7 +192,12 @@ export default function eventLogTests({ getService }: FtrProviderContext) { validateEvent(event, { spaceId: space.id, savedObjects: [ - { type: 'alert', id: alertId, rel: 'primary', type_id: 'test.patternFiring' }, + { + type: RULE_SAVED_OBJECT_TYPE, + id: alertId, + rel: 'primary', + type_id: 'test.patternFiring', + }, { type: 'action', id: createdAction.id, type_id: 'test.noop' }, ], message: `alert: test.patternFiring:${alertId}: 'abc' instanceId: 'instance' scheduled actionGroup: 'default' action: test.noop:${createdAction.id}`, @@ -238,7 +249,12 @@ export default function eventLogTests({ getService }: FtrProviderContext) { validateEvent(event, { spaceId: space.id, savedObjects: [ - { type: 'alert', id: alertId, rel: 'primary', type_id: 'test.patternFiring' }, + { + type: RULE_SAVED_OBJECT_TYPE, + id: alertId, + rel: 'primary', + type_id: 'test.patternFiring', + }, ], outcome: 'success', message: `rule executed: test.patternFiring:${alertId}: 'abc'`, @@ -289,7 +305,12 @@ export default function eventLogTests({ getService }: FtrProviderContext) { validateEvent(event, { spaceId: space.id, savedObjects: [ - { type: 'alert', id: alertId, rel: 'primary', type_id: 'test.patternFiring' }, + { + type: RULE_SAVED_OBJECT_TYPE, + id: alertId, + rel: 'primary', + type_id: 'test.patternFiring', + }, ], message: `test.patternFiring:${alertId}: 'abc' ${subMessage}`, instanceId: 'instance', diff --git a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group2/execution_status.ts b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group2/execution_status.ts index a21027ea448b9..9f2dc2ff77eb6 100644 --- a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group2/execution_status.ts +++ b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group2/execution_status.ts @@ -6,6 +6,7 @@ */ import expect from '@kbn/expect'; +import { RULE_SAVED_OBJECT_TYPE } from '@kbn/alerting-plugin/server'; import { Spaces } from '../../../scenarios'; import { checkAAD, @@ -49,7 +50,7 @@ export default function executionStatusAlertTests({ getService }: FtrProviderCon await checkAAD({ supertest, spaceId: Spaces.space1.id, - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, id: response.body.id, }); }); @@ -82,7 +83,7 @@ export default function executionStatusAlertTests({ getService }: FtrProviderCon await checkAAD({ supertest, spaceId: Spaces.space1.id, - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, id: response.body.id, }); }); @@ -118,7 +119,7 @@ export default function executionStatusAlertTests({ getService }: FtrProviderCon await checkAAD({ supertest, spaceId: Spaces.space1.id, - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, id: response.body.id, }); }); @@ -151,7 +152,7 @@ export default function executionStatusAlertTests({ getService }: FtrProviderCon await checkAAD({ supertest, spaceId: Spaces.space1.id, - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, id: response.body.id, }); }); diff --git a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group2/mute_all.ts b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group2/mute_all.ts index 9cfbb1e477526..f6d6f56306753 100644 --- a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group2/mute_all.ts +++ b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group2/mute_all.ts @@ -6,6 +6,7 @@ */ import expect from '@kbn/expect'; +import { RULE_SAVED_OBJECT_TYPE } from '@kbn/alerting-plugin/server'; import { Spaces } from '../../../scenarios'; import { FtrProviderContext } from '../../../../common/ftr_provider_context'; import { @@ -45,7 +46,7 @@ export default function createMuteTests({ getService }: FtrProviderContext) { await checkAAD({ supertest: supertestWithoutAuth, spaceId: Spaces.space1.id, - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, id: createdAlert.id, }); }); @@ -74,7 +75,7 @@ export default function createMuteTests({ getService }: FtrProviderContext) { await checkAAD({ supertest: supertestWithoutAuth, spaceId: Spaces.space1.id, - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, id: createdAlert.id, }); }); diff --git a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group2/mute_instance.ts b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group2/mute_instance.ts index 85dda60babfd0..85f55ce3ba51c 100644 --- a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group2/mute_instance.ts +++ b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group2/mute_instance.ts @@ -6,6 +6,7 @@ */ import expect from '@kbn/expect'; +import { RULE_SAVED_OBJECT_TYPE } from '@kbn/alerting-plugin/server'; import { Spaces } from '../../../scenarios'; import { FtrProviderContext } from '../../../../common/ftr_provider_context'; import { @@ -46,7 +47,7 @@ export default function createMuteInstanceTests({ getService }: FtrProviderConte await checkAAD({ supertest: supertestWithoutAuth, spaceId: Spaces.space1.id, - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, id: createdAlert.id, }); }); @@ -79,7 +80,7 @@ export default function createMuteInstanceTests({ getService }: FtrProviderConte await checkAAD({ supertest: supertestWithoutAuth, spaceId: Spaces.space1.id, - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, id: createdAlert.id, }); }); diff --git a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group2/unmute_all.ts b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group2/unmute_all.ts index a39f576364d04..24c717a97dcdc 100644 --- a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group2/unmute_all.ts +++ b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group2/unmute_all.ts @@ -6,6 +6,7 @@ */ import expect from '@kbn/expect'; +import { RULE_SAVED_OBJECT_TYPE } from '@kbn/alerting-plugin/server'; import { Spaces } from '../../../scenarios'; import { FtrProviderContext } from '../../../../common/ftr_provider_context'; import { @@ -47,7 +48,7 @@ export default function createUnmuteTests({ getService }: FtrProviderContext) { await checkAAD({ supertest: supertestWithoutAuth, spaceId: Spaces.space1.id, - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, id: createdAlert.id, }); }); @@ -80,7 +81,7 @@ export default function createUnmuteTests({ getService }: FtrProviderContext) { await checkAAD({ supertest: supertestWithoutAuth, spaceId: Spaces.space1.id, - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, id: createdAlert.id, }); }); diff --git a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group2/unmute_instance.ts b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group2/unmute_instance.ts index 3dda4b0db49b8..6e6c7c0d368b9 100644 --- a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group2/unmute_instance.ts +++ b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group2/unmute_instance.ts @@ -6,6 +6,7 @@ */ import expect from '@kbn/expect'; +import { RULE_SAVED_OBJECT_TYPE } from '@kbn/alerting-plugin/server'; import { Spaces } from '../../../scenarios'; import { FtrProviderContext } from '../../../../common/ftr_provider_context'; import { @@ -47,7 +48,7 @@ export default function createUnmuteInstanceTests({ getService }: FtrProviderCon await checkAAD({ supertest: supertestWithoutAuth, spaceId: Spaces.space1.id, - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, id: createdAlert.id, }); }); @@ -88,7 +89,7 @@ export default function createUnmuteInstanceTests({ getService }: FtrProviderCon await checkAAD({ supertest: supertestWithoutAuth, spaceId: Spaces.space1.id, - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, id: createdAlert.id, }); }); diff --git a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group2/update.ts b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group2/update.ts index c7dc4e1484580..623a2efc3f005 100644 --- a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group2/update.ts +++ b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group2/update.ts @@ -6,6 +6,7 @@ */ import expect from '@kbn/expect'; +import { RULE_SAVED_OBJECT_TYPE } from '@kbn/alerting-plugin/server'; import { Spaces } from '../../../scenarios'; import { checkAAD, getUrlPrefix, getTestRuleData, ObjectRemover } from '../../../../common/lib'; import { FtrProviderContext } from '../../../../common/ftr_provider_context'; @@ -93,7 +94,7 @@ export default function createUpdateTests({ getService }: FtrProviderContext) { await checkAAD({ supertest, spaceId: Spaces.space1.id, - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, id: createdAlert.id, }); }); @@ -190,7 +191,7 @@ export default function createUpdateTests({ getService }: FtrProviderContext) { await checkAAD({ supertest, spaceId: Spaces.space1.id, - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, id: createdAlert.id, }); }); diff --git a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group2/update_api_key.ts b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group2/update_api_key.ts index bd3a12d9afdb6..546c4df51c62e 100644 --- a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group2/update_api_key.ts +++ b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group2/update_api_key.ts @@ -6,6 +6,7 @@ */ import expect from '@kbn/expect'; +import { RULE_SAVED_OBJECT_TYPE } from '@kbn/alerting-plugin/server'; import { Spaces } from '../../../scenarios'; import { FtrProviderContext } from '../../../../common/ftr_provider_context'; import { @@ -53,7 +54,7 @@ export default function createUpdateApiKeyTests({ getService }: FtrProviderConte await checkAAD({ supertest: supertestWithoutAuth, spaceId: Spaces.space1.id, - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, id: createdAlert.id, }); }); @@ -102,7 +103,7 @@ export default function createUpdateApiKeyTests({ getService }: FtrProviderConte await checkAAD({ supertest: supertestWithoutAuth, spaceId: Spaces.space1.id, - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, id: createdAlert.id, }); }); diff --git a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group4/bulk_edit.ts b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group4/bulk_edit.ts index 23e05ed530d4a..7bbf87f9901c2 100644 --- a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group4/bulk_edit.ts +++ b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group4/bulk_edit.ts @@ -8,6 +8,7 @@ import expect from '@kbn/expect'; import { v4 as uuidv4 } from 'uuid'; import type { SanitizedRule } from '@kbn/alerting-plugin/common'; +import { RULE_SAVED_OBJECT_TYPE } from '@kbn/alerting-plugin/server'; import { Spaces } from '../../../scenarios'; import { checkAAD, @@ -81,7 +82,7 @@ export default function createUpdateTests({ getService }: FtrProviderContext) { await checkAAD({ supertest, spaceId: Spaces.space1.id, - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, id: createdRule.id, }); }); @@ -183,7 +184,7 @@ export default function createUpdateTests({ getService }: FtrProviderContext) { await checkAAD({ supertest, spaceId: Spaces.space1.id, - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, id: createdRule.id, }); }); @@ -229,7 +230,7 @@ export default function createUpdateTests({ getService }: FtrProviderContext) { await checkAAD({ supertest, spaceId: Spaces.space1.id, - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, id: createdRule.id, }); }); @@ -275,7 +276,7 @@ export default function createUpdateTests({ getService }: FtrProviderContext) { await checkAAD({ supertest, spaceId: Spaces.space1.id, - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, id: createdRule.id, }); }); @@ -340,7 +341,7 @@ export default function createUpdateTests({ getService }: FtrProviderContext) { await checkAAD({ supertest, spaceId: Spaces.space1.id, - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, id: createdRule.id, }); }); @@ -417,7 +418,7 @@ export default function createUpdateTests({ getService }: FtrProviderContext) { await checkAAD({ supertest, spaceId: Spaces.space1.id, - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, id: createdRule.id, }); }); diff --git a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group4/migrations.ts b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group4/migrations.ts index 5611341bd3223..b339f9492b054 100644 --- a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group4/migrations.ts +++ b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group4/migrations.ts @@ -11,6 +11,7 @@ import type { RawRule, RawRuleAction } from '@kbn/alerting-plugin/server/types'; import { FILEBEAT_7X_INDICATOR_PATH } from '@kbn/alerting-plugin/server/saved_objects/migrations'; import type { SavedObjectReference } from '@kbn/core/server'; import { ALERTING_CASES_SAVED_OBJECT_INDEX } from '@kbn/core-saved-objects-server'; +import { RULE_SAVED_OBJECT_TYPE } from '@kbn/alerting-plugin/server'; import { getUrlPrefix } from '../../../../common/lib'; import { FtrProviderContext } from '../../../../common/ftr_provider_context'; @@ -284,7 +285,7 @@ export default function createGetTests({ getService }: FtrProviderContext) { { name: 'param:alert_0', id: '1a4ed6ae-3c89-44b2-999d-db554144504c', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, }, ]); }); diff --git a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group4/snooze.ts b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group4/snooze.ts index a658e461917f4..a027a427c9d01 100644 --- a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group4/snooze.ts +++ b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group4/snooze.ts @@ -7,6 +7,7 @@ import expect from '@kbn/expect'; import { v4 as uuidv4 } from 'uuid'; +import { RULE_SAVED_OBJECT_TYPE } from '@kbn/alerting-plugin/server'; import { Spaces } from '../../../scenarios'; import { FtrProviderContext } from '../../../../common/ftr_provider_context'; import { @@ -92,7 +93,7 @@ export default function createSnoozeRuleTests({ getService }: FtrProviderContext await checkAAD({ supertest, spaceId: Spaces.space1.id, - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, id: createdRule.id, }); }); @@ -147,7 +148,7 @@ export default function createSnoozeRuleTests({ getService }: FtrProviderContext await checkAAD({ supertest, spaceId: Spaces.space1.id, - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, id: createdRule.id, }); }); @@ -390,7 +391,7 @@ export default function createSnoozeRuleTests({ getService }: FtrProviderContext await checkAAD({ supertest, spaceId: Spaces.space1.id, - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, id: createdRule.id, }); }); diff --git a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group4/unsnooze.ts b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group4/unsnooze.ts index 81e246de3214a..31b7c8bf9befc 100644 --- a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group4/unsnooze.ts +++ b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group4/unsnooze.ts @@ -6,6 +6,7 @@ */ import expect from '@kbn/expect'; +import { RULE_SAVED_OBJECT_TYPE } from '@kbn/alerting-plugin/server'; import { Spaces } from '../../../scenarios'; import { FtrProviderContext } from '../../../../common/ftr_provider_context'; import { @@ -73,7 +74,7 @@ export default function createSnoozeRuleTests({ getService }: FtrProviderContext await checkAAD({ supertest, spaceId: Spaces.space1.id, - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, id: createdAlert.id, }); }); diff --git a/x-pack/test/apm_api_integration/tests/historical_data/has_data.spec.ts b/x-pack/test/apm_api_integration/tests/historical_data/has_data.spec.ts index 7fac147db62e0..a7017263e9db7 100644 --- a/x-pack/test/apm_api_integration/tests/historical_data/has_data.spec.ts +++ b/x-pack/test/apm_api_integration/tests/historical_data/has_data.spec.ts @@ -6,34 +6,54 @@ */ import expect from '@kbn/expect'; +import { apm, timerange } from '@kbn/apm-synthtrace-client'; +import moment from 'moment'; import { FtrProviderContext } from '../../common/ftr_provider_context'; export default function ApiTest({ getService }: FtrProviderContext) { const registry = getService('registry'); const apmApiClient = getService('apmApiClient'); - const archiveName = 'apm_8.0.0'; + const synthtraceEsClient = getService('synthtraceEsClient'); - registry.when( - 'Historical data when data is not loaded', - { config: 'basic', archives: [] }, - () => { - it('handles the empty state', async () => { + registry.when('Historical data ', { config: 'basic', archives: [] }, () => { + describe('when there is not data', () => { + it('returns hasData=false', async () => { const response = await apmApiClient.readUser({ endpoint: `GET /internal/apm/has_data` }); expect(response.status).to.be(200); expect(response.body.hasData).to.be(false); }); - } - ); - - registry.when( - 'Historical data when data is loaded', - { config: 'basic', archives: [archiveName] }, - () => { - it('returns hasData: true', async () => { + }); + + describe('when there is data', () => { + before(async () => { + const start = moment().subtract(30, 'minutes').valueOf(); + const end = moment().valueOf(); + + const serviceInstance = apm + .service({ name: 'my-go-service', environment: 'production', agentName: 'go' }) + .instance('instance-a'); + + const documents = [ + timerange(start, end) + .interval('1m') + .generator((timestamp) => + serviceInstance + .transaction({ transactionName: 'GET /users' }) + .timestamp(timestamp) + .duration(10) + ), + ]; + + await synthtraceEsClient.index(documents); + }); + + after(() => synthtraceEsClient.clean()); + + it('returns hasData=true', async () => { const response = await apmApiClient.readUser({ endpoint: `GET /internal/apm/has_data` }); expect(response.status).to.be(200); expect(response.body.hasData).to.be(true); }); - } - ); + }); + }); } diff --git a/x-pack/test/cloud_security_posture_api/config.ts b/x-pack/test/cloud_security_posture_api/config.ts index e7a34bafe9fb5..625236022cd14 100644 --- a/x-pack/test/cloud_security_posture_api/config.ts +++ b/x-pack/test/cloud_security_posture_api/config.ts @@ -18,6 +18,7 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) { require.resolve('./telemetry/telemetry.ts'), require.resolve('./routes/vulnerabilities_dashboard.ts'), require.resolve('./routes/stats.ts'), + require.resolve('./routes/csp_benchmark_rules_bulk_update.ts'), ], junit: { reportName: 'X-Pack Cloud Security Posture API Tests', diff --git a/x-pack/test/cloud_security_posture_api/routes/csp_benchmark_rules_bulk_update.ts b/x-pack/test/cloud_security_posture_api/routes/csp_benchmark_rules_bulk_update.ts new file mode 100644 index 0000000000000..dad7845e60e31 --- /dev/null +++ b/x-pack/test/cloud_security_posture_api/routes/csp_benchmark_rules_bulk_update.ts @@ -0,0 +1,247 @@ +/* + * 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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import expect from '@kbn/expect'; +import { expect as expectExpect } from 'expect'; + +import { + ELASTIC_HTTP_VERSION_HEADER, + X_ELASTIC_INTERNAL_ORIGIN_REQUEST, +} from '@kbn/core-http-common'; +import type { FtrProviderContext } from '../ftr_provider_context'; + +interface RuleIdentifier { + benchmarkId: string; + benchmarkVersion: string; + ruleNumber: string; +} + +// eslint-disable-next-line import/no-default-export +export default function ({ getService }: FtrProviderContext) { + const retry = getService('retry'); + const supertest = getService('supertest'); + const log = getService('log'); + const kibanaServer = getService('kibanaServer'); + + const generateRuleKey = (ruleParams: RuleIdentifier): string => { + return `${ruleParams.benchmarkId};${ruleParams.benchmarkVersion};${ruleParams.ruleNumber}`; + }; + + const generateRandomRule = (): RuleIdentifier => { + const majorVersionNumber = Math.floor(Math.random() * 10); // Random major number between 0 and 9 + const minorVersionNumber = Math.floor(Math.random() * 10); + const benchmarksIds = ['cis_aws', 'cis_k8s', 'cis_k8s']; + const benchmarksVersions = ['v2.0.0', 'v2.0.1', 'v2.0.3', 'v3.0.0']; + const randomBenchmarkId = benchmarksIds[Math.floor(Math.random() * benchmarksIds.length)]; + const randomBenchmarkVersion = + benchmarksVersions[Math.floor(Math.random() * benchmarksVersions.length)]; + + return { + benchmarkId: randomBenchmarkId, + benchmarkVersion: randomBenchmarkVersion, + ruleNumber: `${majorVersionNumber}.${minorVersionNumber}`, + }; + }; + + /** + * required before indexing findings + */ + const waitForPluginInitialized = (): Promise => + retry.try(async () => { + log.debug('Check CSP plugin is initialized'); + const response = await supertest + .get('/internal/cloud_security_posture/status?check=init') + .set(ELASTIC_HTTP_VERSION_HEADER, '1') + .expect(200); + expect(response.body).to.eql({ isPluginInitialized: true }); + log.debug('CSP plugin is initialized'); + }); + + describe('Verify update csp rules states API', async () => { + before(async () => { + await waitForPluginInitialized(); + }); + + afterEach(async () => { + await kibanaServer.savedObjects.clean({ + types: ['cloud-security-posture-settings'], + }); + }); + + it('mute rules successfully', async () => { + const rule1 = generateRandomRule(); + const rule2 = generateRandomRule(); + + const { body } = await supertest + .post(`/internal/cloud_security_posture/rules/_bulk_action`) + .set(ELASTIC_HTTP_VERSION_HEADER, '1') + .set(X_ELASTIC_INTERNAL_ORIGIN_REQUEST, 'kibana') + .set('kbn-xsrf', 'xxxx') + .send({ + action: 'mute', + rules: [ + { + benchmark_id: rule1.benchmarkId, + benchmark_version: rule1.benchmarkVersion, + rule_number: rule1.ruleNumber, + }, + { + benchmark_id: rule2.benchmarkId, + benchmark_version: rule2.benchmarkVersion, + rule_number: rule2.ruleNumber, + }, + ], + }) + .expect(200); + + expectExpect(body.updated_benchmark_rules).toEqual( + expectExpect.objectContaining({ + [generateRuleKey(rule1)]: { muted: true }, + [generateRuleKey(rule2)]: { muted: true }, + }) + ); + }); + + it('unmute rules successfully', async () => { + const rule1 = generateRandomRule(); + const rule2 = generateRandomRule(); + + const { body } = await supertest + .post(`/internal/cloud_security_posture/rules/_bulk_action`) + .set(ELASTIC_HTTP_VERSION_HEADER, '1') + .set(X_ELASTIC_INTERNAL_ORIGIN_REQUEST, 'kibana') + .set('kbn-xsrf', 'xxxx') + .send({ + action: 'unmute', + rules: [ + { + benchmark_id: rule1.benchmarkId, + benchmark_version: rule1.benchmarkVersion, + rule_number: rule1.ruleNumber, + }, + { + benchmark_id: rule2.benchmarkId, + benchmark_version: rule2.benchmarkVersion, + rule_number: rule2.ruleNumber, + }, + ], + }) + .expect(200); + + expectExpect(body.updated_benchmark_rules).toEqual( + expectExpect.objectContaining({ + [generateRuleKey(rule1)]: { muted: false }, + [generateRuleKey(rule2)]: { muted: false }, + }) + ); + }); + + it('verify new rules are added and existing rules are set.', async () => { + const rule1 = generateRandomRule(); + const rule2 = generateRandomRule(); + const rule3 = generateRandomRule(); + + // unmute rule1 and rule2 + const cspSettingsResponse = await supertest + .post(`/internal/cloud_security_posture/rules/_bulk_action`) + .set(ELASTIC_HTTP_VERSION_HEADER, '1') + .set(X_ELASTIC_INTERNAL_ORIGIN_REQUEST, 'kibana') + .set('kbn-xsrf', 'xxxx') + .send({ + action: 'unmute', + rules: [ + { + benchmark_id: rule1.benchmarkId, + benchmark_version: rule1.benchmarkVersion, + rule_number: rule1.ruleNumber, + }, + { + benchmark_id: rule2.benchmarkId, + benchmark_version: rule2.benchmarkVersion, + rule_number: rule2.ruleNumber, + }, + ], + }) + .expect(200); + + expectExpect(cspSettingsResponse.body.updated_benchmark_rules).toEqual( + expectExpect.objectContaining({ + [generateRuleKey(rule1)]: { muted: false }, + [generateRuleKey(rule2)]: { muted: false }, + }) + ); + + // mute rule1 and rule3 + const updatedCspSettingsResponse = await supertest + .post(`/internal/cloud_security_posture/rules/_bulk_action`) + .set(ELASTIC_HTTP_VERSION_HEADER, '1') + .set(X_ELASTIC_INTERNAL_ORIGIN_REQUEST, 'kibana') + .set('kbn-xsrf', 'xxxx') + .send({ + action: 'mute', + rules: [ + { + benchmark_id: rule1.benchmarkId, + benchmark_version: rule1.benchmarkVersion, + rule_number: rule1.ruleNumber, + }, + { + benchmark_id: rule3.benchmarkId, + benchmark_version: rule3.benchmarkVersion, + rule_number: rule3.ruleNumber, + }, + ], + }) + .expect(200); + + expectExpect(updatedCspSettingsResponse.body.updated_benchmark_rules).toEqual( + expectExpect.objectContaining({ + [generateRuleKey(rule1)]: { muted: true }, + [generateRuleKey(rule3)]: { muted: true }, + }) + ); + }); + + it('set wrong action input', async () => { + const rule1 = generateRandomRule(); + + const { body } = await supertest + .post(`/internal/cloud_security_posture/rules/_bulk_action`) + .set(ELASTIC_HTTP_VERSION_HEADER, '1') + .set(X_ELASTIC_INTERNAL_ORIGIN_REQUEST, 'kibana') + .set('kbn-xsrf', 'xxxx') + .send({ + action: 'foo', + rules: [ + { + benchmark_id: rule1.benchmarkId, + benchmark_version: rule1.benchmarkVersion, + rule_number: rule1.ruleNumber, + }, + ], + }); + + expect(body.error).to.eql('Bad Request'); + expect(body.statusCode).to.eql(400); + }); + + it('set wrong rule ids input', async () => { + const { body } = await supertest + .post(`/internal/cloud_security_posture/rules/_bulk_action`) + .set(ELASTIC_HTTP_VERSION_HEADER, '1') + .set(X_ELASTIC_INTERNAL_ORIGIN_REQUEST, 'kibana') + .set('kbn-xsrf', 'xxxx') + .send({ + action: 'mute', + rule_ids: ['invalid_rule_structure'], + }); + + expect(body.error).to.eql('Bad Request'); + expect(body.statusCode).to.eql(400); + }); + }); +} diff --git a/x-pack/test/dataset_quality_api_integration/tests/data_streams/degraded_docs.spec.ts b/x-pack/test/dataset_quality_api_integration/tests/data_streams/degraded_docs.spec.ts new file mode 100644 index 0000000000000..ba38cc432ff8c --- /dev/null +++ b/x-pack/test/dataset_quality_api_integration/tests/data_streams/degraded_docs.spec.ts @@ -0,0 +1,98 @@ +/* + * 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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { log, timerange } from '@kbn/apm-synthtrace-client'; +import expect from '@kbn/expect'; +import { DatasetQualityApiClientKey } from '../../common/config'; +import { FtrProviderContext } from '../../common/ftr_provider_context'; + +export default function ApiTest({ getService }: FtrProviderContext) { + const registry = getService('registry'); + const synthtrace = getService('logSynthtraceEsClient'); + const datasetQualityApiClient = getService('datasetQualityApiClient'); + const start = '2023-12-11T18:00:00.000Z'; + const end = '2023-12-11T18:01:00.000Z'; + + async function callApiAs(user: DatasetQualityApiClientKey) { + return await datasetQualityApiClient[user]({ + endpoint: 'GET /internal/dataset_quality/data_streams/degraded_docs', + params: { + query: { + type: 'logs', + start, + end, + }, + }, + }); + } + + registry.when('Degraded docs', { config: 'basic' }, () => { + describe('and there are log documents', () => { + before(async () => { + await synthtrace.index([ + timerange(start, end) + .interval('1m') + .rate(1) + .generator((timestamp) => + log + .create() + .message('This is a log message') + .timestamp(timestamp) + .dataset('synth.1') + .defaults({ + 'log.file.path': '/my-service.log', + }) + ), + timerange(start, end) + .interval('1m') + .rate(1) + .generator((timestamp) => + log + .create() + .message('This is a log message') + .timestamp(timestamp) + .dataset('synth.2') + .logLevel( + 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?' + ) + .defaults({ + 'log.file.path': '/my-service.log', + }) + ), + ]); + }); + + it('returns stats correctly', async () => { + const stats = await callApiAs('datasetQualityLogsUser'); + expect(stats.body.degradedDocs.length).to.be(2); + + const percentages = stats.body.degradedDocs.reduce( + (acc, curr) => ({ + ...acc, + [curr.dataset]: curr.percentage, + }), + {} as Record + ); + + expect(percentages['logs-synth.1-default']).to.be(0); + expect(percentages['logs-synth.2-default']).to.be(100); + }); + + after(async () => { + await synthtrace.clean(); + }); + }); + + describe('and there are not log documents', () => { + it('returns stats correctly', async () => { + const stats = await callApiAs('datasetQualityLogsUser'); + + expect(stats.body.degradedDocs.length).to.be(0); + }); + }); + }); +} diff --git a/x-pack/test/dataset_quality_api_integration/tests/es_utils.ts b/x-pack/test/dataset_quality_api_integration/tests/data_streams/es_utils.ts similarity index 100% rename from x-pack/test/dataset_quality_api_integration/tests/es_utils.ts rename to x-pack/test/dataset_quality_api_integration/tests/data_streams/es_utils.ts diff --git a/x-pack/test/dataset_quality_api_integration/tests/data_streams.spec.ts b/x-pack/test/dataset_quality_api_integration/tests/data_streams/stats.spec.ts similarity index 86% rename from x-pack/test/dataset_quality_api_integration/tests/data_streams.spec.ts rename to x-pack/test/dataset_quality_api_integration/tests/data_streams/stats.spec.ts index 6d11326bf213e..7fa60dcb4b118 100644 --- a/x-pack/test/dataset_quality_api_integration/tests/data_streams.spec.ts +++ b/x-pack/test/dataset_quality_api_integration/tests/data_streams/stats.spec.ts @@ -7,10 +7,10 @@ import { log, timerange } from '@kbn/apm-synthtrace-client'; import expect from '@kbn/expect'; -import { DatasetQualityApiClientKey } from '../common/config'; -import { DatasetQualityApiError } from '../common/dataset_quality_api_supertest'; -import { FtrProviderContext } from '../common/ftr_provider_context'; -import { expectToReject } from '../utils'; +import { DatasetQualityApiClientKey } from '../../common/config'; +import { DatasetQualityApiError } from '../../common/dataset_quality_api_supertest'; +import { FtrProviderContext } from '../../common/ftr_provider_context'; +import { expectToReject } from '../../utils'; import { cleanLogIndexTemplate, addIntegrationToLogIndexTemplate } from './es_utils'; export default function ApiTest({ getService }: FtrProviderContext) { @@ -43,7 +43,7 @@ export default function ApiTest({ getService }: FtrProviderContext) { }); describe('when required privileges are set', () => { - describe('and uncategorized datastreams', () => { + describe('and categorized datastreams', () => { const integration = 'my-custom-integration'; before(async () => { @@ -67,8 +67,8 @@ export default function ApiTest({ getService }: FtrProviderContext) { expect(stats.body.dataStreamsStats.length).to.be(1); expect(stats.body.dataStreamsStats[0].integration).to.be(integration); expect(stats.body.dataStreamsStats[0].size).not.empty(); - expect(stats.body.dataStreamsStats[0].size_bytes).greaterThan(0); - expect(stats.body.dataStreamsStats[0].last_activity).greaterThan(0); + expect(stats.body.dataStreamsStats[0].sizeBytes).greaterThan(0); + expect(stats.body.dataStreamsStats[0].lastActivity).greaterThan(0); }); after(async () => { @@ -77,7 +77,7 @@ export default function ApiTest({ getService }: FtrProviderContext) { }); }); - describe('and categorized datastreams', () => { + describe('and uncategorized datastreams', () => { before(async () => { await synthtrace.index([ timerange('2023-11-20T15:00:00.000Z', '2023-11-20T15:01:00.000Z') @@ -97,8 +97,8 @@ export default function ApiTest({ getService }: FtrProviderContext) { expect(stats.body.dataStreamsStats.length).to.be(1); expect(stats.body.dataStreamsStats[0].integration).not.ok(); expect(stats.body.dataStreamsStats[0].size).not.empty(); - expect(stats.body.dataStreamsStats[0].size_bytes).greaterThan(0); - expect(stats.body.dataStreamsStats[0].last_activity).greaterThan(0); + expect(stats.body.dataStreamsStats[0].sizeBytes).greaterThan(0); + expect(stats.body.dataStreamsStats[0].lastActivity).greaterThan(0); }); after(async () => { diff --git a/x-pack/test/functional/apps/dev_tools/searchprofiler_editor.ts b/x-pack/test/functional/apps/dev_tools/searchprofiler_editor.ts index 5884e30f153a3..b6b514fe2c75d 100644 --- a/x-pack/test/functional/apps/dev_tools/searchprofiler_editor.ts +++ b/x-pack/test/functional/apps/dev_tools/searchprofiler_editor.ts @@ -6,26 +6,27 @@ */ import expect from '@kbn/expect'; -import { compressToEncodedURIComponent } from 'lz-string'; import { asyncForEach } from '@kbn/std'; import { FtrProviderContext } from '../../ftr_provider_context'; +const testIndex = 'test-index'; +const testQuery = { + query: { + match_all: {}, + }, +}; export default function ({ getPageObjects, getService }: FtrProviderContext) { - const PageObjects = getPageObjects(['common']); - const testSubjects = getService('testSubjects'); - const aceEditor = getService('aceEditor'); + const PageObjects = getPageObjects(['common', 'searchProfiler']); const retry = getService('retry'); const security = getService('security'); const es = getService('es'); const log = getService('log'); - const editorTestSubjectSelector = 'searchProfilerEditor'; - describe('Search Profiler Editor', () => { before(async () => { await security.testUser.setRoles(['global_devtools_read']); await PageObjects.common.navigateToApp('searchProfiler'); - expect(await testSubjects.exists('searchProfilerEditor')).to.be(true); + expect(await PageObjects.searchProfiler.editorExists()).to.be(true); }); after(async () => { @@ -36,7 +37,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { // The below inputs are written to work _with_ ace's autocomplete unlike console's unit test // counterparts in src/legacy/core_plugins/console/public/tests/src/editor.test.js - const okInput = [ + const okInputs = [ `{ "query": { "match_all": {}`, @@ -46,7 +47,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { "test": """{ "more": "json" }"""`, ]; - const notOkInput = [ + const notOkInputs = [ `{ "query": { "match_all": { @@ -59,24 +60,24 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { const expectHasParseErrorsToBe = (expectation: boolean) => async (inputs: string[]) => { for (const input of inputs) { - await aceEditor.setValue(editorTestSubjectSelector, input); + await PageObjects.searchProfiler.setQuery(input); await retry.waitFor( `parser errors to match expectation: HAS ${expectation ? 'ERRORS' : 'NO ERRORS'}`, async () => { - const actual = await aceEditor.hasParseErrors(editorTestSubjectSelector); + const actual = await PageObjects.searchProfiler.editorHasParseErrors(); return expectation === actual; } ); } }; - await expectHasParseErrorsToBe(false)(okInput); - await expectHasParseErrorsToBe(true)(notOkInput); + await expectHasParseErrorsToBe(false)(okInputs); + await expectHasParseErrorsToBe(true)(notOkInputs); }); it('supports pre-configured search query', async () => { - const searchQuery = { + const query = { query: { bool: { should: [ @@ -106,24 +107,21 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { // this index name is just an input placeholder and does not exist const indexName = 'my_index'; - const searchQueryURI = compressToEncodedURIComponent(JSON.stringify(searchQuery, null, 2)); - await PageObjects.common.navigateToUrl( 'searchProfiler', - `/searchprofiler?index=${indexName}&load_from=${searchQueryURI}`, + PageObjects.searchProfiler.getUrlWithIndexAndQuery({ indexName, query }), { useActualUrl: true, } ); - const indexInput = await testSubjects.find('indexName'); - const indexInputValue = await indexInput.getAttribute('value'); + const indexInputValue = await PageObjects.searchProfiler.getIndexName(); expect(indexInputValue).to.eql(indexName); await retry.try(async () => { - const searchProfilerInput = JSON.parse(await aceEditor.getValue('searchProfilerEditor')); - expect(searchProfilerInput).to.eql(searchQuery); + const searchProfilerInput = await PageObjects.searchProfiler.getQuery(); + expect(searchProfilerInput).to.eql(query); }); }); @@ -148,23 +146,35 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { }); it('returns error if profile is executed with no valid indices', async () => { - const input = { - query: { - match_all: {}, - }, - }; - - await testSubjects.setValue('indexName', '_all'); - await aceEditor.setValue(editorTestSubjectSelector, JSON.stringify(input)); + await PageObjects.searchProfiler.setIndexName('_all'); + await PageObjects.searchProfiler.setQuery(testQuery); - await testSubjects.click('profileButton'); + await PageObjects.searchProfiler.clickProfileButton(); await retry.waitFor('notification renders', async () => { - const notification = await testSubjects.find('noShardsNotification'); - const notificationText = await notification.getVisibleText(); - return notificationText.includes('Unable to profile'); + return await PageObjects.searchProfiler.editorHasErrorNotification(); }); }); }); + + describe('With a test index', () => { + before(async () => { + await es.indices.create({ index: testIndex }); + }); + + after(async () => { + await es.indices.delete({ index: testIndex }); + }); + + it('profiles a simple query', async () => { + await PageObjects.searchProfiler.setIndexName(testIndex); + await PageObjects.searchProfiler.setQuery(testQuery); + + await PageObjects.searchProfiler.clickProfileButton(); + + const content = await PageObjects.searchProfiler.getProfileContent(); + expect(content).to.contain(testIndex); + }); + }); }); } diff --git a/x-pack/test/functional/apps/lens/open_in_lens/agg_based/table.ts b/x-pack/test/functional/apps/lens/open_in_lens/agg_based/table.ts index 99985787c53a0..56a4ad07285f5 100644 --- a/x-pack/test/functional/apps/lens/open_in_lens/agg_based/table.ts +++ b/x-pack/test/functional/apps/lens/open_in_lens/agg_based/table.ts @@ -18,6 +18,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { ]); const testSubjects = getService('testSubjects'); + const comboBox = getService('comboBox'); describe('Table', function describeIndexTests() { const isNewChartsLibraryEnabled = true; @@ -85,8 +86,9 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { expect(await dimensions[0].getVisibleText()).to.be('Average machine.ram'); await lens.openDimensionEditor('lnsDatatable_metrics > lns-dimensionTrigger'); - const summaryRowFunction = await testSubjects.find('lnsDatatable_summaryrow_function'); - expect(await summaryRowFunction.getVisibleText()).to.be('Sum'); + expect(await comboBox.getComboBoxSelectedOptions('lnsDatatable_summaryrow_function')).to.eql([ + 'Sum', + ]); }); it('should convert sibling pipeline aggregation', async () => { @@ -171,8 +173,9 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { const percentageColumnText = await lens.getDimensionTriggerText('lnsDatatable_metrics', 1); await lens.openDimensionEditor('lnsDatatable_metrics > lns-dimensionTrigger', 0, 1); - const format = await testSubjects.find('indexPattern-dimension-format'); - expect(await format.getVisibleText()).to.be('Percent'); + expect(await comboBox.getComboBoxSelectedOptions('indexPattern-dimension-format')).to.eql([ + 'Percent', + ]); const dimensions = await testSubjects.findAll('lns-dimensionTrigger'); expect(dimensions).to.have.length(2); diff --git a/x-pack/test/functional/apps/lens/open_in_lens/tsvb/table.ts b/x-pack/test/functional/apps/lens/open_in_lens/tsvb/table.ts index d2f8b49c1ae92..9e9f301859db5 100644 --- a/x-pack/test/functional/apps/lens/open_in_lens/tsvb/table.ts +++ b/x-pack/test/functional/apps/lens/open_in_lens/tsvb/table.ts @@ -114,8 +114,10 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { await lens.waitForVisualization('lnsDataTable'); await lens.openDimensionEditor('lnsDatatable_metrics > lns-dimensionTrigger'); await testSubjects.click('indexPattern-advanced-accordion'); - const reducedTimeRange = await testSubjects.find('indexPattern-dimension-reducedTimeRange'); - expect(await reducedTimeRange.getVisibleText()).to.be('1 minute (1m)'); + const reducedTimeRange = await testSubjects.find( + 'indexPattern-dimension-reducedTimeRange > comboBoxSearchInput' + ); + expect(await reducedTimeRange.getAttribute('value')).to.be('1 minute (1m)'); await retry.try(async () => { const layerCount = await lens.getLayerCount(); expect(layerCount).to.be(1); diff --git a/x-pack/test/functional/apps/lens/open_in_lens/tsvb/top_n.ts b/x-pack/test/functional/apps/lens/open_in_lens/tsvb/top_n.ts index 10b8e2136deb1..5207b18035837 100644 --- a/x-pack/test/functional/apps/lens/open_in_lens/tsvb/top_n.ts +++ b/x-pack/test/functional/apps/lens/open_in_lens/tsvb/top_n.ts @@ -115,8 +115,10 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { await lens.waitForVisualization('xyVisChart'); await lens.openDimensionEditor('lnsXY_yDimensionPanel > lns-dimensionTrigger'); await testSubjects.click('indexPattern-advanced-accordion'); - const reducedTimeRange = await testSubjects.find('indexPattern-dimension-reducedTimeRange'); - expect(await reducedTimeRange.getVisibleText()).to.be('1 minute (1m)'); + const reducedTimeRange = await testSubjects.find( + 'indexPattern-dimension-reducedTimeRange > comboBoxSearchInput' + ); + expect(await reducedTimeRange.getAttribute('value')).to.be('1 minute (1m)'); await retry.try(async () => { const layerCount = await lens.getLayerCount(); expect(layerCount).to.be(1); diff --git a/x-pack/test/functional/apps/maps/group4/layer_errors.js b/x-pack/test/functional/apps/maps/group4/layer_errors.js index e597f1bb0fe52..e47c0e582c8f4 100644 --- a/x-pack/test/functional/apps/maps/group4/layer_errors.js +++ b/x-pack/test/functional/apps/maps/group4/layer_errors.js @@ -11,6 +11,7 @@ export default function ({ getPageObjects, getService }) { const PageObjects = getPageObjects(['maps', 'header']); const inspector = getService('inspector'); const testSubjects = getService('testSubjects'); + const comboBox = getService('comboBox'); describe('layer errors', () => { before(async () => { @@ -33,8 +34,9 @@ export default function ({ getPageObjects, getService }) { it('should open request in inspector', async () => { await testSubjects.click('viewEsErrorButton'); - const selectedRequest = await testSubjects.getVisibleText('euiComboBoxPill'); - expect(selectedRequest).to.equal('load layer features (connections)'); + expect(await comboBox.getComboBoxSelectedOptions('inspectorRequestChooser')).to.eql([ + 'load layer features (connections)', + ]); }); }); diff --git a/x-pack/test/functional/page_objects/index.ts b/x-pack/test/functional/page_objects/index.ts index 75f86f7645954..b4ea0f741e117 100644 --- a/x-pack/test/functional/page_objects/index.ts +++ b/x-pack/test/functional/page_objects/index.ts @@ -50,6 +50,7 @@ import { UpgradeAssistantPageObject } from './upgrade_assistant_page'; import { UptimePageObject } from './uptime_page'; import { UserProfilePageProvider } from './user_profile_page'; import { WatcherPageObject } from './watcher_page'; +import { SearchProfilerPageProvider } from './search_profiler_page'; // just like services, PageObjects are defined as a map of // names to Providers. Merge in Kibana's or pick specific ones @@ -87,6 +88,7 @@ export const pageObjects = { reporting: ReportingPageObject, roleMappings: RoleMappingsPageProvider, rollup: RollupPageObject, + searchProfiler: SearchProfilerPageProvider, searchSessionsManagement: SearchSessionsPageProvider, security: SecurityPageObject, shareSavedObjectsToSpace: ShareSavedObjectsToSpacePageProvider, diff --git a/x-pack/test/functional/page_objects/infra_home_page.ts b/x-pack/test/functional/page_objects/infra_home_page.ts index a867535ea06ee..0247ecde88ac9 100644 --- a/x-pack/test/functional/page_objects/infra_home_page.ts +++ b/x-pack/test/functional/page_objects/infra_home_page.ts @@ -337,7 +337,7 @@ export function InfraHomePageProvider({ getService, getPageObjects }: FtrProvide await testSubjects.click('superDatePickerAbsoluteTab'); const datePickerInput = await testSubjects.find('superDatePickerAbsoluteDateInput'); await datePickerInput.clearValueWithKeyboard(); - await datePickerInput.type([date]); + await datePickerInput.type([date, browser.keys.RETURN]); }, async setAnomaliesThreshold(threshold: string) { const thresholdInput = await find.byCssSelector( diff --git a/x-pack/test/functional/page_objects/lens_page.ts b/x-pack/test/functional/page_objects/lens_page.ts index d0c962d8c574a..429b30b686485 100644 --- a/x-pack/test/functional/page_objects/lens_page.ts +++ b/x-pack/test/functional/page_objects/lens_page.ts @@ -912,8 +912,8 @@ export function LensPageProvider({ getService, getPageObjects }: FtrProviderCont `[data-test-subj^="lnsXY_axisSide_groups_"]` ); for (const axisSideGroup of axisSideGroups) { - const input = await axisSideGroup.findByTagName('input'); - const isSelected = await input.isSelected(); + const ariaPressed = await axisSideGroup.getAttribute('aria-pressed'); + const isSelected = ariaPressed === 'true'; if (isSelected) { return axisSideGroup?.getVisibleText(); } @@ -1439,7 +1439,7 @@ export function LensPageProvider({ getService, getPageObjects }: FtrProviderCont */ async assertFocusedField(name: string) { const input = await find.activeElement(); - const fieldAncestor = await input.findByXpath('./../../..'); + const fieldAncestor = await input.findByXpath('./../..'); const focusedElementText = await fieldAncestor.getVisibleText(); const dataTestSubj = await fieldAncestor.getAttribute('data-test-subj'); expect(focusedElementText).to.eql(name); diff --git a/x-pack/test/functional/page_objects/search_profiler_page.ts b/x-pack/test/functional/page_objects/search_profiler_page.ts new file mode 100644 index 0000000000000..a110bd16eeafe --- /dev/null +++ b/x-pack/test/functional/page_objects/search_profiler_page.ts @@ -0,0 +1,54 @@ +/* + * 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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { compressToEncodedURIComponent } from 'lz-string'; +import { FtrProviderContext } from '../ftr_provider_context'; + +export function SearchProfilerPageProvider({ getService }: FtrProviderContext) { + const find = getService('find'); + const testSubjects = getService('testSubjects'); + const aceEditor = getService('aceEditor'); + const editorTestSubjectSelector = 'searchProfilerEditor'; + + return { + async editorExists() { + return await testSubjects.exists(editorTestSubjectSelector); + }, + async setQuery(query: any) { + await aceEditor.setValue(editorTestSubjectSelector, JSON.stringify(query)); + }, + async getQuery() { + return JSON.parse(await aceEditor.getValue(editorTestSubjectSelector)); + }, + async setIndexName(indexName: string) { + await testSubjects.setValue('indexName', indexName); + }, + async getIndexName() { + const indexInput = await testSubjects.find('indexName'); + return await indexInput.getAttribute('value'); + }, + async clickProfileButton() { + await testSubjects.click('profileButton'); + }, + async getProfileContent() { + const profileTree = await find.byClassName('prfDevTool__main__profiletree'); + return profileTree.getVisibleText(); + }, + getUrlWithIndexAndQuery({ indexName, query }: { indexName: string; query: any }) { + const searchQueryURI = compressToEncodedURIComponent(JSON.stringify(query, null, 2)); + return `/searchprofiler?index=${indexName}&load_from=${searchQueryURI}`; + }, + async editorHasParseErrors() { + return await aceEditor.hasParseErrors(editorTestSubjectSelector); + }, + async editorHasErrorNotification() { + const notification = await testSubjects.find('noShardsNotification'); + const text = await notification.getVisibleText(); + return text.includes('Unable to profile'); + }, + }; +} diff --git a/x-pack/test/functional/services/ml/stack_management_jobs.ts b/x-pack/test/functional/services/ml/stack_management_jobs.ts index e99172b374f9d..f8db28deb5092 100644 --- a/x-pack/test/functional/services/ml/stack_management_jobs.ts +++ b/x-pack/test/functional/services/ml/stack_management_jobs.ts @@ -142,27 +142,22 @@ export function MachineLearningStackManagementJobsProvider({ await testSubjects.missingOrFail('share-to-space-flyout', { timeout: 2000 }); }, - async selectShareToSpacesMode(inputTestSubj: 'shareToExplicitSpacesId' | 'shareToAllSpacesId') { - // The input element can not be clicked directly. - // Instead, we need to click the parent label - const getInputLabel = async () => { - const input = await testSubjects.find(inputTestSubj, 1000); - return await input.findByXpath('./../../..'); // Clicks the parent label 3 levels up - }; + async selectShareToSpacesMode( + buttonTestSubj: 'shareToExplicitSpacesId' | 'shareToAllSpacesId' + ) { await retry.tryForTime(5000, async () => { - const labelElement = await getInputLabel(); - await labelElement.click(); + const button = await testSubjects.find(buttonTestSubj, 1000); + await button.click(); - const checked = await testSubjects.getAttribute(inputTestSubj, 'checked', 1000); - expect(checked).to.eql('true', `Input '${inputTestSubj}' should be checked`); + const isPressed = await button.getAttribute('aria-pressed'); + expect(isPressed).to.eql('true', `Button '${buttonTestSubj}' should be checked`); - // sometimes the checked attribute of the input is set but it's not actually + // sometimes the aria-pressed attribute of the button is set but it's not actually // selected, so we're also checking the class of the corresponding label - const updatedLabelElement = await getInputLabel(); - const labelClasses = await updatedLabelElement.getAttribute('class'); + const labelClasses = await button.getAttribute('class'); expect(labelClasses).to.contain( 'euiButtonGroupButton-isSelected', - `Label for '${inputTestSubj}' should be selected` + `Label for '${buttonTestSubj}' should be selected` ); }); }, diff --git a/x-pack/test/observability_ai_assistant_api_integration/common/config.ts b/x-pack/test/observability_ai_assistant_api_integration/common/config.ts index f0669eebe8e1a..3551c6cb290ce 100644 --- a/x-pack/test/observability_ai_assistant_api_integration/common/config.ts +++ b/x-pack/test/observability_ai_assistant_api_integration/common/config.ts @@ -5,11 +5,11 @@ * 2.0. */ -import { FtrConfigProviderContext } from '@kbn/test'; +import { Config, FtrConfigProviderContext } from '@kbn/test'; import supertest from 'supertest'; import { format, UrlObject } from 'url'; import { ObservabilityAIAssistantFtrConfigName } from '../configs'; -import { InheritedFtrProviderContext, InheritedServices } from './ftr_provider_context'; +import { InheritedServices } from './ftr_provider_context'; import { createObservabilityAIAssistantApiClient, ObservabilityAIAssistantAPIClient, @@ -34,21 +34,71 @@ export type CreateTestConfig = ReturnType; export interface CreateTest { testFiles: string[]; servers: any; - servicesRequiredForTestAnalysis: string[]; services: InheritedServices & { - observabilityAIAssistantAPIClient: (context: InheritedFtrProviderContext) => Promise<{ + observabilityAIAssistantAPIClient: () => Promise<{ readUser: ObservabilityAIAssistantAPIClient; writeUser: ObservabilityAIAssistantAPIClient; }>; - observabilityAIAssistantFtrConfig: ( - context: InheritedFtrProviderContext - ) => ObservabilityAIAssistantFtrConfig; }; junit: { reportName: string }; esTestCluster: any; kbnTestServer: any; } +export function createObservabilityAIAssistantAPIConfig({ + config, + license, + name, + kibanaConfig, +}: { + config: Config; + license: 'basic' | 'trial'; + name: string; + kibanaConfig?: Record; +}): Omit { + const services = config.get('services') as InheritedServices; + const servers = config.get('servers'); + const kibanaServer = servers.kibana as UrlObject; + + const createTest: Omit = { + ...config.getAll(), + servers, + services: { + ...services, + observabilityAIAssistantAPIClient: async () => { + return { + readUser: await getObservabilityAIAssistantAPIClient({ + kibanaServer, + }), + writeUser: await getObservabilityAIAssistantAPIClient({ + kibanaServer, + }), + }; + }, + }, + junit: { + reportName: `Observability AI Assistant API Integration tests (${name})`, + }, + esTestCluster: { + ...config.get('esTestCluster'), + license, + }, + kbnTestServer: { + ...config.get('kbnTestServer'), + serverArgs: [ + ...config.get('kbnTestServer.serverArgs'), + ...(kibanaConfig + ? Object.entries(kibanaConfig).map(([key, value]) => + Array.isArray(value) ? `--${key}=${JSON.stringify(value)}` : `--${key}=${value}` + ) + : []), + ], + }, + }; + + return createTest; +} + export function createTestConfig( config: ObservabilityAIAssistantFtrConfig ): ({ readConfigFile }: FtrConfigProviderContext) => Promise { @@ -59,49 +109,15 @@ export function createTestConfig( require.resolve('../../api_integration/config.ts') ); - const services = xPackAPITestsConfig.get('services') as InheritedServices; - const servers = xPackAPITestsConfig.get('servers'); - const kibanaServer = servers.kibana as UrlObject; - - const createTest: CreateTest = { - testFiles: [require.resolve('../tests')], - servers, - servicesRequiredForTestAnalysis: ['observabilityAIAssistantFtrConfig', 'registry'], - services: { - ...services, - observabilityAIAssistantFtrConfig: () => config, - observabilityAIAssistantAPIClient: async (_: InheritedFtrProviderContext) => { - return { - readUser: await getObservabilityAIAssistantAPIClient({ - kibanaServer, - }), - writeUser: await getObservabilityAIAssistantAPIClient({ - kibanaServer, - }), - }; - }, - }, - junit: { - reportName: `Observability AI Assistant API Integration tests (${name})`, - }, - esTestCluster: { - ...xPackAPITestsConfig.get('esTestCluster'), + return { + ...createObservabilityAIAssistantAPIConfig({ + config: xPackAPITestsConfig, + name, license, - }, - kbnTestServer: { - ...xPackAPITestsConfig.get('kbnTestServer'), - serverArgs: [ - ...xPackAPITestsConfig.get('kbnTestServer.serverArgs'), - ...(kibanaConfig - ? Object.entries(kibanaConfig).map(([key, value]) => - Array.isArray(value) ? `--${key}=${JSON.stringify(value)}` : `--${key}=${value}` - ) - : []), - ], - }, + kibanaConfig, + }), + testFiles: [require.resolve('../tests')], }; - - return createTest; }; } diff --git a/x-pack/test/observability_ai_assistant_api_integration/configs/index.ts b/x-pack/test/observability_ai_assistant_api_integration/configs/index.ts index 8370bb35f7ea6..56dd87f3915d9 100644 --- a/x-pack/test/observability_ai_assistant_api_integration/configs/index.ts +++ b/x-pack/test/observability_ai_assistant_api_integration/configs/index.ts @@ -14,7 +14,7 @@ export const observabilityAIAssistantDebugLogger = { appenders: ['console'], }; -const observabilityAIAssistantFtrConfigs = { +export const observabilityAIAssistantFtrConfigs = { basic: { license: 'basic' as const, kibanaConfig: { diff --git a/x-pack/test/observability_ai_assistant_functional/common/config.ts b/x-pack/test/observability_ai_assistant_functional/common/config.ts new file mode 100644 index 0000000000000..1ff0f4fee291a --- /dev/null +++ b/x-pack/test/observability_ai_assistant_functional/common/config.ts @@ -0,0 +1,83 @@ +/* + * 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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { FtrConfigProviderContext } from '@kbn/test'; +import { merge } from 'lodash'; +import supertest from 'supertest'; +import { format, UrlObject } from 'url'; +import { + ObservabilityAIAssistantFtrConfig, + CreateTest as CreateTestAPI, + createObservabilityAIAssistantAPIConfig, +} from '../../observability_ai_assistant_api_integration/common/config'; +import { + createObservabilityAIAssistantApiClient, + ObservabilityAIAssistantAPIClient, +} from '../../observability_ai_assistant_api_integration/common/observability_ai_assistant_api_client'; +import { InheritedFtrProviderContext, InheritedServices } from '../ftr_provider_context'; +import { ObservabilityAIAssistantUIProvider, ObservabilityAIAssistantUIService } from './ui'; + +export interface TestConfig extends CreateTestAPI { + services: Omit & + InheritedServices & { + observabilityAIAssistantUI: ( + context: InheritedFtrProviderContext + ) => Promise; + observabilityAIAssistantAPIClient: () => Promise< + Awaited> & { + testUser: ObservabilityAIAssistantAPIClient; + } + >; + }; +} + +export type CreateTestConfig = ReturnType; + +export function createTestConfig( + config: ObservabilityAIAssistantFtrConfig +): ({ readConfigFile }: FtrConfigProviderContext) => Promise { + const { license, name, kibanaConfig } = config; + + return async ({ readConfigFile, log, esVersion }: FtrConfigProviderContext) => { + const testConfig = await readConfigFile(require.resolve('../../functional/config.base.js')); + + const baseConfig = createObservabilityAIAssistantAPIConfig({ + config: testConfig, + license, + name, + kibanaConfig, + }); + + return merge( + { + services: testConfig.get('services'), + }, + baseConfig, + { + testFiles: [require.resolve('../tests')], + services: { + observabilityAIAssistantUI: (context: InheritedFtrProviderContext) => + ObservabilityAIAssistantUIProvider(context), + observabilityAIAssistantAPIClient: async (context: InheritedFtrProviderContext) => { + const otherUsers = await baseConfig.services.observabilityAIAssistantAPIClient(); + return { + ...otherUsers, + testUser: createObservabilityAIAssistantApiClient( + supertest( + format({ + ...(baseConfig.servers.kibana as UrlObject), + auth: `test_user:changeme`, + }) + ) + ), + }; + }, + }, + } + ); + }; +} diff --git a/x-pack/test/observability_ai_assistant_functional/common/intercept_request.ts b/x-pack/test/observability_ai_assistant_functional/common/intercept_request.ts new file mode 100644 index 0000000000000..edc3496809209 --- /dev/null +++ b/x-pack/test/observability_ai_assistant_functional/common/intercept_request.ts @@ -0,0 +1,60 @@ +/* + * 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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { WebDriver } from 'selenium-webdriver'; + +interface ResponseFactory { + fail: (reason?: string) => ['Fetch.failRequest', { requestId: string }]; +} + +export async function interceptRequest( + driver: WebDriver, + pattern: string, + onIntercept: (responseFactory: ResponseFactory) => [string, Record], + cb: () => Promise +) { + const connection = await driver.createCDPConnection('page'); + + return new Promise((resolve, reject) => { + connection._wsConnection.on('message', async (data: Buffer) => { + const parsed = JSON.parse(data.toString()); + + if (parsed.method === 'Fetch.requestPaused') { + await new Promise((innerResolve) => + connection.execute( + ...onIntercept({ + fail: () => [ + 'Fetch.failRequest', + { requestId: parsed.params.requestId, errorReason: 'Failed' }, + ], + }), + innerResolve + ) + ); + + await new Promise((innerResolve) => connection.execute('Fetch.disable', {}, innerResolve)); + resolve(); + } + }); + + new Promise((innerResolve) => + connection.execute( + 'Fetch.enable', + { + patterns: [{ urlPattern: pattern }], + }, + innerResolve + ) + ) + .then(() => { + return cb(); + }) + .catch((err: Error) => { + reject(err); + }); + }); +} diff --git a/x-pack/test/observability_ai_assistant_functional/common/ui/index.ts b/x-pack/test/observability_ai_assistant_functional/common/ui/index.ts new file mode 100644 index 0000000000000..92c1c72626a4d --- /dev/null +++ b/x-pack/test/observability_ai_assistant_functional/common/ui/index.ts @@ -0,0 +1,121 @@ +/* + * 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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import type { PathsOf, TypeAsArgs, TypeOf } from '@kbn/typed-react-router-config'; +import type { ObservabilityAIAssistantRoutes } from '@kbn/observability-ai-assistant-plugin/public/routes/config'; +import qs from 'query-string'; +import type { Role } from '@kbn/security-plugin-types-common'; +import { OBSERVABILITY_AI_ASSISTANT_FEATURE_ID } from '@kbn/observability-ai-assistant-plugin/common/feature'; +import { APM_SERVER_FEATURE_ID } from '@kbn/apm-plugin/server'; +import type { InheritedFtrProviderContext } from '../../ftr_provider_context'; + +export interface ObservabilityAIAssistantUIService { + pages: typeof pages; + auth: { + login: () => Promise; + logout: () => Promise; + }; + router: { + goto>( + path: T, + ...params: TypeAsArgs> + ): Promise; + }; +} + +const pages = { + conversations: { + setupGenAiConnectorsButtonSelector: `observabilityAiAssistantInitialSetupPanelSetUpGenerativeAiConnectorButton`, + chatInput: 'observabilityAiAssistantChatPromptEditorTextArea', + retryButton: 'observabilityAiAssistantWelcomeMessageSetUpKnowledgeBaseButton', + }, + createConnectorFlyout: { + flyout: 'create-connector-flyout', + genAiCard: '.gen-ai-card', + bedrockCard: '.bedrock-card', + nameInput: 'nameInput', + urlInput: 'config.apiUrl-input', + apiKeyInput: 'secrets.apiKey-input', + saveButton: 'create-connector-flyout-save-btn', + }, +}; + +export async function ObservabilityAIAssistantUIProvider({ + getPageObjects, + getService, +}: InheritedFtrProviderContext): Promise { + const browser = getService('browser'); + const deployment = getService('deployment'); + const security = getService('security'); + const pageObjects = getPageObjects(['common']); + + const roleName = 'observability-ai-assistant-functional-test-role'; + + return { + pages, + auth: { + login: async () => { + await browser.navigateTo(deployment.getHostPort()); + + const roleDefinition: Role = { + name: roleName, + elasticsearch: { + cluster: [], + indices: [], + run_as: [], + }, + kibana: [ + { + spaces: ['*'], + base: [], + feature: { + actions: ['all'], + [APM_SERVER_FEATURE_ID]: ['all'], + [OBSERVABILITY_AI_ASSISTANT_FEATURE_ID]: ['all'], + }, + }, + ], + }; + + await security.role.create(roleName, roleDefinition); + + await security.testUser.setRoles([roleName, 'apm_user']); // performs a page reload + }, + logout: async () => { + await security.role.delete(roleName); + await security.testUser.restoreDefaults(); + }, + }, + router: { + goto: (...args) => { + const [path, params] = args; + + const formattedPath = path + .split('/') + .map((part) => { + const match = part.match(/(?:{([a-zA-Z]+)})/); + return match ? (params.path as Record)[match[1]] : part; + }) + .join('/'); + + const urlWithQueryParams = qs.stringifyUrl( + { + url: formattedPath, + query: params.query, + }, + { encode: true } + ); + + return pageObjects.common.navigateToApp('observabilityAIAssistant', { + path: urlWithQueryParams.substring(1), + shouldLoginIfPrompted: true, + insertTimestamp: false, + }); + }, + }, + }; +} diff --git a/x-pack/test/observability_ai_assistant_functional/configs/index.ts b/x-pack/test/observability_ai_assistant_functional/configs/index.ts new file mode 100644 index 0000000000000..22096dff2a47e --- /dev/null +++ b/x-pack/test/observability_ai_assistant_functional/configs/index.ts @@ -0,0 +1,23 @@ +/* + * 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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { mapValues } from 'lodash'; +import { + ObservabilityAIAssistantFtrConfigName, + observabilityAIAssistantFtrConfigs, +} from '../../observability_ai_assistant_api_integration/configs'; +import { createTestConfig, CreateTestConfig } from '../common/config'; + +export const configs: Record = mapValues( + observabilityAIAssistantFtrConfigs, + (value, key) => { + return createTestConfig({ + name: key as ObservabilityAIAssistantFtrConfigName, + ...value, + }); + } +); diff --git a/x-pack/plugins/dataset_quality/server/types/integration.ts b/x-pack/test/observability_ai_assistant_functional/enterprise/config.ts similarity index 51% rename from x-pack/plugins/dataset_quality/server/types/integration.ts rename to x-pack/test/observability_ai_assistant_functional/enterprise/config.ts index 2595a120c8b70..598ecae70efbb 100644 --- a/x-pack/plugins/dataset_quality/server/types/integration.ts +++ b/x-pack/test/observability_ai_assistant_functional/enterprise/config.ts @@ -5,17 +5,7 @@ * 2.0. */ -export interface Integration { - name: string; - title?: string; - version?: string; - icons?: IntegrationIcon[]; -} +import { configs } from '../configs'; -export interface IntegrationIcon { - path: string; - src: string; - title?: string; - size?: string; - type?: string; -} +// eslint-disable-next-line import/no-default-export +export default configs.enterprise; diff --git a/x-pack/test/observability_ai_assistant_functional/ftr_provider_context.d.ts b/x-pack/test/observability_ai_assistant_functional/ftr_provider_context.d.ts new file mode 100644 index 0000000000000..fdb6ed227a781 --- /dev/null +++ b/x-pack/test/observability_ai_assistant_functional/ftr_provider_context.d.ts @@ -0,0 +1,24 @@ +/* + * 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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { GenericFtrProviderContext } from '@kbn/test'; + +import { pageObjects } from '../functional/page_objects'; +import { services } from '../functional/services'; +import { TestConfig } from './common/config'; + +export type InheritedServices = typeof services; + +export type InheritedFtrProviderContext = GenericFtrProviderContext< + InheritedServices, + typeof pageObjects +>; + +export type FtrProviderContext = GenericFtrProviderContext< + TestConfig['services'], + typeof pageObjects +>; diff --git a/x-pack/test/observability_ai_assistant_functional/tests/conversations/index.spec.ts b/x-pack/test/observability_ai_assistant_functional/tests/conversations/index.spec.ts new file mode 100644 index 0000000000000..2d2f4c3fc8c33 --- /dev/null +++ b/x-pack/test/observability_ai_assistant_functional/tests/conversations/index.spec.ts @@ -0,0 +1,245 @@ +/* + * 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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import expect from '@kbn/expect'; +import { CreateChatCompletionRequest } from 'openai'; +import { + createLlmProxy, + LlmProxy, +} from '../../../observability_ai_assistant_api_integration/common/create_llm_proxy'; +import { interceptRequest } from '../../common/intercept_request'; +import { FtrProviderContext } from '../../ftr_provider_context'; + +export default function ApiTest({ getService, getPageObjects }: FtrProviderContext) { + const observabilityAIAssistantAPIClient = getService('observabilityAIAssistantAPIClient'); + const ui = getService('observabilityAIAssistantUI'); + const testSubjects = getService('testSubjects'); + const browser = getService('browser'); + const supertest = getService('supertest'); + const retry = getService('retry'); + + const driver = getService('__webdriver__'); + + const toasts = getService('toasts'); + + const { header, common } = getPageObjects(['header', 'common']); + + const flyoutService = getService('flyout'); + + async function deleteConversations() { + const response = await observabilityAIAssistantAPIClient.testUser({ + endpoint: 'POST /internal/observability_ai_assistant/conversations', + }); + + for (const conversation of response.body.conversations) { + await observabilityAIAssistantAPIClient.testUser({ + endpoint: `DELETE /internal/observability_ai_assistant/conversation/{conversationId}`, + params: { + path: { + conversationId: conversation.conversation.id, + }, + }, + }); + } + } + + async function deleteConnectors() { + const response = await observabilityAIAssistantAPIClient.testUser({ + endpoint: 'GET /internal/observability_ai_assistant/connectors', + }); + + for (const connector of response.body) { + await supertest + .delete(`/api/actions/connector/${connector.id}`) + .set('kbn-xsrf', 'foo') + .expect(204); + } + } + + describe('Conversations', () => { + let proxy: LlmProxy; + before(async () => { + await deleteConnectors(); + await deleteConversations(); + + proxy = await createLlmProxy(); + + await ui.auth.login(); + + await ui.router.goto('/conversations/new', { path: {}, query: {} }); + }); + + describe('without a connector', () => { + it('should display the set up connectors button', async () => { + await testSubjects.existOrFail(ui.pages.conversations.setupGenAiConnectorsButtonSelector); + }); + + describe('after clicking on the setup connectors button', async () => { + before(async () => { + await testSubjects.click(ui.pages.conversations.setupGenAiConnectorsButtonSelector); + }); + + it('opens a flyout', async () => { + await testSubjects.existOrFail(ui.pages.createConnectorFlyout.flyout); + await testSubjects.existOrFail(ui.pages.createConnectorFlyout.genAiCard); + // TODO: https://github.com/elastic/obs-ai-assistant-team/issues/126 + // await testSubjects.missingOrFail(ui.pages.createConnectorFlyout.bedrockCard); + }); + + describe('after clicking on the Gen AI card and submitting the form', () => { + before(async () => { + await testSubjects.click(ui.pages.createConnectorFlyout.genAiCard); + await testSubjects.setValue(ui.pages.createConnectorFlyout.nameInput, 'myConnector'); + await testSubjects.setValue( + ui.pages.createConnectorFlyout.urlInput, + `http://localhost:${proxy.getPort()}` + ); + await testSubjects.setValue(ui.pages.createConnectorFlyout.apiKeyInput, 'myApiKey'); + + // intercept the request to set up the knowledge base, + // so we don't have to wait until it's fully downloaded + await interceptRequest( + driver.driver, + '*kb\\/setup*', + (responseFactory) => { + return responseFactory.fail(); + }, + async () => { + await testSubjects.clickWhenNotDisabled(ui.pages.createConnectorFlyout.saveButton); + } + ); + + await retry.waitFor('Connector created toast', async () => { + const count = await toasts.getToastCount(); + return count > 0; + }); + + await toasts.dismissAllToasts(); + }); + + it('creates a connector', async () => { + const response = await observabilityAIAssistantAPIClient.testUser({ + endpoint: 'GET /internal/observability_ai_assistant/connectors', + }); + + expect(response.body.length).to.eql(1); + }); + + describe('after refreshing the page', () => { + before(async () => { + await browser.refresh(); + }); + + it('shows a setup kb button', async () => { + await testSubjects.existOrFail(ui.pages.conversations.retryButton); + }); + + it('has an input field enabled', async () => { + await testSubjects.existOrFail(ui.pages.conversations.chatInput); + await testSubjects.isEnabled(ui.pages.conversations.chatInput); + }); + + describe('and sending over some text', () => { + before(async () => { + const titleInterceptor = proxy.intercept( + 'title', + (body) => (JSON.parse(body) as CreateChatCompletionRequest).messages.length === 1 + ); + + const conversationInterceptor = proxy.intercept( + 'conversation', + (body) => (JSON.parse(body) as CreateChatCompletionRequest).messages.length !== 1 + ); + + await testSubjects.setValue(ui.pages.conversations.chatInput, 'hello'); + + await testSubjects.pressEnter(ui.pages.conversations.chatInput); + + const [titleSimulator, conversationSimulator] = await Promise.all([ + titleInterceptor.waitForIntercept(), + conversationInterceptor.waitForIntercept(), + ]); + + await titleSimulator.next('My title'); + + await titleSimulator.complete(); + + await conversationSimulator.next('My response'); + + await conversationSimulator.complete(); + + await header.waitUntilLoadingHasFinished(); + }); + + it('creates a conversation and updates the URL', async () => { + const response = await observabilityAIAssistantAPIClient.testUser({ + endpoint: 'POST /internal/observability_ai_assistant/conversations', + }); + + expect(response.body.conversations.length).to.eql(1); + + expect(response.body.conversations[0].messages.length).to.eql(3); + + expect(response.body.conversations[0].conversation.title).to.be('My title'); + + await common.waitUntilUrlIncludes( + `/conversations/${response.body.conversations[0].conversation.id}` + ); + }); + + describe('and adding another prompt', () => { + before(async () => { + const conversationInterceptor = proxy.intercept('conversation', () => true); + + await testSubjects.setValue(ui.pages.conversations.chatInput, 'hello'); + + await testSubjects.pressEnter(ui.pages.conversations.chatInput); + + const conversationSimulator = await conversationInterceptor.waitForIntercept(); + + await conversationSimulator.next('My second response'); + + await conversationSimulator.complete(); + + await header.waitUntilLoadingHasFinished(); + }); + + it('does not create another conversation', async () => { + const response = await observabilityAIAssistantAPIClient.testUser({ + endpoint: 'POST /internal/observability_ai_assistant/conversations', + }); + + expect(response.body.conversations.length).to.eql(1); + }); + + it('appends to the existing one', async () => { + const response = await observabilityAIAssistantAPIClient.testUser({ + endpoint: 'POST /internal/observability_ai_assistant/conversations', + }); + + expect(response.body.conversations[0].messages.length).to.eql(5); + }); + }); + }); + }); + }); + + after(async () => { + await flyoutService.ensureAllClosed(); + }); + }); + }); + + after(async () => { + await deleteConnectors(); + await deleteConversations(); + + await ui.auth.logout(); + await proxy.close(); + }); + }); +} diff --git a/x-pack/test/observability_ai_assistant_functional/tests/index.ts b/x-pack/test/observability_ai_assistant_functional/tests/index.ts new file mode 100644 index 0000000000000..9a2e4902d7366 --- /dev/null +++ b/x-pack/test/observability_ai_assistant_functional/tests/index.ts @@ -0,0 +1,28 @@ +/* + * 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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import globby from 'globby'; +import path from 'path'; +import { FtrProviderContext } from '../../observability_ai_assistant_api_integration/common/ftr_provider_context'; + +const cwd = path.join(__dirname); + +export default function observabilityAIAssistantFunctionalTests({ + getService, + loadTestFile, +}: FtrProviderContext) { + describe('Observability AI Assistant Functional tests', function () { + const filePattern = '**/*.spec.ts'; + const tests = globby.sync(filePattern, { cwd }); + + tests.forEach((testName) => { + describe(testName, () => { + loadTestFile(require.resolve(`./${testName}`)); + }); + }); + }); +} diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/detection_engine/exceptions/rule_details_flow/add_edit_endpoint_exception.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/detection_engine/exceptions/rule_details_flow/add_edit_endpoint_exception.cy.ts index 8d5b537dd3bce..eef28b77e7ac5 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/detection_engine/exceptions/rule_details_flow/add_edit_endpoint_exception.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/detection_engine/exceptions/rule_details_flow/add_edit_endpoint_exception.cy.ts @@ -195,8 +195,8 @@ describe('Add endpoint exception from rule details', { tags: ['@ess', '@serverle .eq(0) .find(FIELD_INPUT_PARENT) .eq(0) - .should('have.text', ITEM_FIELD); - cy.get(VALUES_INPUT).should('have.text', 'foo'); + .should('have.value', ITEM_FIELD); + cy.get(VALUES_INPUT).should('have.value', 'foo'); // edit conditions editException(FIELD_DIFFERENT_FROM_EXISTING_ITEM_FIELD, 0, 0); diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/detection_engine/exceptions/rule_details_flow/add_edit_exception.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/detection_engine/exceptions/rule_details_flow/add_edit_exception.cy.ts index 70c35610476b8..b1115b5833bd0 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/detection_engine/exceptions/rule_details_flow/add_edit_exception.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/detection_engine/exceptions/rule_details_flow/add_edit_exception.cy.ts @@ -149,7 +149,7 @@ describe( .eq(0) .find(FIELD_INPUT_PARENT) .eq(0) - .should('have.text', ITEM_FIELD); + .should('have.value', ITEM_FIELD); cy.get(VALUES_MATCH_ANY_INPUT).should('have.text', 'foo'); // edit conditions diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/detection_engine/exceptions/rule_details_flow/add_edit_exception_data_view.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/detection_engine/exceptions/rule_details_flow/add_edit_exception_data_view.cy.ts index 3f585dbad90cf..18c75ce25cbfa 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/detection_engine/exceptions/rule_details_flow/add_edit_exception_data_view.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/detection_engine/exceptions/rule_details_flow/add_edit_exception_data_view.cy.ts @@ -165,8 +165,8 @@ describe( .eq(0) .find(FIELD_INPUT_PARENT) .eq(0) - .should('have.text', ITEM_FIELD); - cy.get(VALUES_INPUT).should('have.text', 'foo'); + .should('have.value', ITEM_FIELD); + cy.get(VALUES_INPUT).should('have.value', 'foo'); // edit conditions editException(FIELD_DIFFERENT_FROM_EXISTING_ITEM_FIELD, 0, 0); diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/detection_engine/rule_creation/indicator_match_rule.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/detection_engine/rule_creation/indicator_match_rule.cy.ts index 5b0fc1f122928..b2b000803e6c4 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/detection_engine/rule_creation/indicator_match_rule.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/detection_engine/rule_creation/indicator_match_rule.cy.ts @@ -287,10 +287,9 @@ describe('indicator match', { tags: ['@ess', '@serverless', '@brokenInServerless }); getIndicatorDeleteButton().click(); getIndicatorIndexComboField().find('input').should('have.value', 'agent.name'); - getIndicatorMappingComboField().should( - 'have.text', - getNewThreatIndicatorRule().threat_mapping[0].entries[0].value - ); + getIndicatorMappingComboField() + .find('input') + .should('have.value', getNewThreatIndicatorRule().threat_mapping[0].entries[0].value); getIndicatorIndexComboField(2).should('not.exist'); getIndicatorMappingComboField(2).should('not.exist'); }); @@ -343,8 +342,14 @@ describe('indicator match', { tags: ['@ess', '@serverless', '@brokenInServerless indicatorIndexField: getNewThreatIndicatorRule().threat_mapping[0].entries[0].value, }); getIndicatorDeleteButton().click(); - getIndicatorIndexComboField().should('text', 'Search'); - getIndicatorMappingComboField().should('text', 'Search'); + getIndicatorIndexComboField() + .find('input') + .should('value', '') + .should('have.attr', 'placeholder', 'Search'); + getIndicatorMappingComboField() + .find('input') + .should('value', '') + .should('have.attr', 'placeholder', 'Search'); getIndicatorIndexComboField(2).should('not.exist'); getIndicatorMappingComboField(2).should('not.exist'); }); @@ -368,22 +373,18 @@ describe('indicator match', { tags: ['@ess', '@serverless', '@brokenInServerless indicatorIndexField: getNewThreatIndicatorRule().threat_mapping[0].entries[0].value, }); getIndicatorDeleteButton(2).click(); - getIndicatorIndexComboField(1).should( - 'text', - getNewThreatIndicatorRule().threat_mapping[0].entries[0].field - ); - getIndicatorMappingComboField(1).should( - 'text', - getNewThreatIndicatorRule().threat_mapping[0].entries[0].value - ); - getIndicatorIndexComboField(2).should( - 'text', - getNewThreatIndicatorRule().threat_mapping[0].entries[0].field - ); - getIndicatorMappingComboField(2).should( - 'text', - getNewThreatIndicatorRule().threat_mapping[0].entries[0].value - ); + getIndicatorIndexComboField(1) + .find('input') + .should('value', getNewThreatIndicatorRule().threat_mapping[0].entries[0].field); + getIndicatorMappingComboField(1) + .find('input') + .should('value', getNewThreatIndicatorRule().threat_mapping[0].entries[0].value); + getIndicatorIndexComboField(2) + .find('input') + .should('value', getNewThreatIndicatorRule().threat_mapping[0].entries[0].field); + getIndicatorMappingComboField(2) + .find('input') + .should('value', getNewThreatIndicatorRule().threat_mapping[0].entries[0].value); getIndicatorIndexComboField(3).should('not.exist'); getIndicatorMappingComboField(3).should('not.exist'); }); @@ -401,14 +402,12 @@ describe('indicator match', { tags: ['@ess', '@serverless', '@brokenInServerless indicatorIndexField: getNewThreatIndicatorRule().threat_mapping[0].entries[0].value, }); getIndicatorDeleteButton().click(); - getIndicatorIndexComboField().should( - 'text', - getNewThreatIndicatorRule().threat_mapping[0].entries[0].field - ); - getIndicatorMappingComboField().should( - 'text', - getNewThreatIndicatorRule().threat_mapping[0].entries[0].value - ); + getIndicatorIndexComboField() + .find('input') + .should('value', getNewThreatIndicatorRule().threat_mapping[0].entries[0].field); + getIndicatorMappingComboField() + .find('input') + .should('value', getNewThreatIndicatorRule().threat_mapping[0].entries[0].value); getIndicatorIndexComboField(2).should('not.exist'); getIndicatorMappingComboField(2).should('not.exist'); }); diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/entity_analytics/entity_analytics_management_page_privileges_callout.ts b/x-pack/test/security_solution_cypress/cypress/e2e/entity_analytics/entity_analytics_management_page_privileges.cy.ts similarity index 83% rename from x-pack/test/security_solution_cypress/cypress/e2e/entity_analytics/entity_analytics_management_page_privileges_callout.ts rename to x-pack/test/security_solution_cypress/cypress/e2e/entity_analytics/entity_analytics_management_page_privileges.cy.ts index 0072b653a3e7b..4ade4a1091273 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/entity_analytics/entity_analytics_management_page_privileges_callout.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/entity_analytics/entity_analytics_management_page_privileges.cy.ts @@ -8,8 +8,10 @@ import { ROLES } from '@kbn/security-solution-plugin/common/test'; import { RISK_ENGINE_PRIVILEGES_URL } from '@kbn/security-solution-plugin/common/constants'; import { + RISK_SCORE_PREVIEW_PRIVILEGES_CALLOUT, RISK_SCORE_PRIVILEGES_CALLOUT, RISK_SCORE_STATUS_LOADING, + RISK_SCORE_SWITCH, } from '../../screens/entity_analytics_management'; import { login } from '../../tasks/login'; @@ -23,7 +25,7 @@ const loadPageAsUserWithNoPrivileges = () => { // this test suite doesn't run on serverless because it requires a custom role describe( - 'Entity analytics management page - Risk Engine Privileges Callout', + 'Entity analytics management page - Risk Engine Privileges Behaviour', { tags: ['@ess'], }, @@ -37,7 +39,7 @@ describe( cy.get(RISK_SCORE_PRIVILEGES_CALLOUT).should('not.exist'); }); - it('should show the callout for user without risk engine privileges', () => { + it('should show the callout, diable the risk score switch, and hide preview for user without risk engine privileges', () => { cy.intercept(RISK_ENGINE_PRIVILEGES_URL).as('getPrivileges'); loadPageAsUserWithNoPrivileges(); cy.get(RISK_SCORE_STATUS_LOADING).should('not.exist'); @@ -49,6 +51,8 @@ describe( ); cy.get(RISK_SCORE_PRIVILEGES_CALLOUT).should('contain', 'manage_index_templates'); cy.get(RISK_SCORE_PRIVILEGES_CALLOUT).should('contain', 'manage_transform'); + cy.get(RISK_SCORE_PREVIEW_PRIVILEGES_CALLOUT); + cy.get(RISK_SCORE_SWITCH).should('be.disabled'); }); } ); diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/explore/guided_onboarding/tour.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/explore/guided_onboarding/tour.cy.ts index fbe1ebf91cbff..93ce4f5861889 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/explore/guided_onboarding/tour.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/explore/guided_onboarding/tour.cy.ts @@ -68,45 +68,37 @@ describe('Guided onboarding tour', { tags: ['@ess'] }, () => { assertTourStepExist(AlertsCasesTourSteps.pointToAlertName); }); - describe.skip( - 'persists tour steps in flyout on flyout toggle', - { tags: ['@ess', '@brokenInServerless'] }, - () => { - const stepsInAlertsFlyout = [ - AlertsCasesTourSteps.reviewAlertDetailsFlyout, - AlertsCasesTourSteps.addAlertToCase, - AlertsCasesTourSteps.viewCase, - ]; + describe('persists tour steps in flyout on flyout toggle', () => { + const stepsInAlertsFlyout = [ + AlertsCasesTourSteps.reviewAlertDetailsFlyout, + AlertsCasesTourSteps.addAlertToCase, + AlertsCasesTourSteps.viewCase, + ]; - const stepsInCasesFlyout = [AlertsCasesTourSteps.createCase, AlertsCasesTourSteps.submitCase]; + const stepsInCasesFlyout = [AlertsCasesTourSteps.createCase, AlertsCasesTourSteps.submitCase]; - stepsInAlertsFlyout.forEach((step) => { - it(`step: ${step}, resets to ${step}`, { tags: ['@ess', '@brokenInServerless'] }, () => { - startTour(); - goToStep(step); - assertTourStepExist(step); - closeAlertFlyout(); - assertTourStepNotExist(step); - expandFirstAlert(); - assertTourStepExist(step); - }); + stepsInAlertsFlyout.forEach((step) => { + it(`step: ${step}, resets to ${step}`, () => { + startTour(); + goToStep(step); + assertTourStepExist(step); + closeAlertFlyout(); + assertTourStepNotExist(step); + expandFirstAlert(); + assertTourStepExist(step); }); + }); - stepsInCasesFlyout.forEach((step) => { - it( - `step: ${step}, resets to ${AlertsCasesTourSteps.createCase}`, - { tags: ['@ess', '@brokenInServerless'] }, - () => { - startTour(); - goToStep(step); - assertTourStepExist(step); - closeCreateCaseFlyout(); - assertTourStepNotExist(step); - addToCase(); - assertTourStepExist(AlertsCasesTourSteps.createCase); - } - ); + stepsInCasesFlyout.forEach((step) => { + it(`step: ${step}, resets to ${AlertsCasesTourSteps.createCase}`, () => { + startTour(); + goToStep(step); + assertTourStepExist(step); + closeCreateCaseFlyout(); + assertTourStepNotExist(step); + addToCase(); + assertTourStepExist(AlertsCasesTourSteps.createCase); }); - } - ); + }); + }); }); diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/explore/urls/not_found.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/explore/urls/not_found.cy.ts index 9c27440a97864..80e682d74de96 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/explore/urls/not_found.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/explore/urls/not_found.cy.ts @@ -31,6 +31,7 @@ describe('Display not found page', { tags: ['@ess', '@serverless'] }, () => { visitWithTimeRange(TIMELINES_URL); }); + // Tracked by https://github.com/elastic/kibana/issues/143705 // TODO: We need to determine what we want the behavior to be here it.skip('navigates to the alerts page with incorrect link', () => { visitWithTimeRange(`${ALERTS_URL}/randomUrl`); diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/investigations/timeline_templates/export.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/investigations/timeline_templates/export.cy.ts index ad3fdcc6fb973..603613892fcd3 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/investigations/timeline_templates/export.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/investigations/timeline_templates/export.cy.ts @@ -17,8 +17,6 @@ import { TIMELINE_TEMPLATES_URL } from '../../../urls/navigation'; import { createTimelineTemplate } from '../../../tasks/api_calls/timelines'; import { searchByTitle } from '../../../tasks/table_pagination'; -// FLAKY: https://github.com/elastic/kibana/issues/165760 -// FLAKY: https://github.com/elastic/kibana/issues/165645 describe('Export timelines', { tags: ['@ess', '@serverless'] }, () => { before(() => { createTimelineTemplate(getTimelineTemplate()).then((response) => { diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/investigations/timelines/esql/search_filter.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/investigations/timelines/esql/search_filter.cy.ts index e54a78c5c6fd2..b0e5bcb397c0e 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/investigations/timelines/esql/search_filter.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/investigations/timelines/esql/search_filter.cy.ts @@ -5,9 +5,11 @@ * 2.0. */ +import { deleteTimelines } from '../../../../tasks/api_calls/common'; import { GET_LOCAL_DATE_PICKER_START_DATE_POPOVER_BUTTON } from '../../../../screens/date_picker'; import { setStartDate, + showStartEndDate, updateDateRangeInLocalDatePickers, updateDates, } from '../../../../tasks/date_picker'; @@ -21,20 +23,20 @@ import { addDiscoverEsqlQuery, submitDiscoverSearchBar, addFieldToTable, - convertNBSPToSP, + convertEditorNonBreakingSpaceToSpace, } from '../../../../tasks/discover'; -import { createNewTimeline, goToEsqlTab } from '../../../../tasks/timeline'; +import { createNewTimeline, goToEsqlTab, openActiveTimeline } from '../../../../tasks/timeline'; import { login } from '../../../../tasks/login'; import { visitWithTimeRange } from '../../../../tasks/navigation'; import { ALERTS_URL } from '../../../../urls/navigation'; +const DEFAULT_DATE = '~ 15 minutes ago'; const INITIAL_START_DATE = 'Jan 18, 2021 @ 20:33:29.186'; const INITIAL_END_DATE = 'Jan 19, 2024 @ 20:33:29.186'; const NEW_START_DATE = 'Jan 18, 2023 @ 20:33:29.186'; const esqlQuery = 'from auditbeat-* | where ecs.version == "8.0.0"'; -// FLAKY: https://github.com/elastic/kibana/issues/168758 -describe.skip( +describe( 'Basic esql search and filter operations', { tags: ['@ess'], @@ -42,17 +44,20 @@ describe.skip( () => { beforeEach(() => { login(); + deleteTimelines(); visitWithTimeRange(ALERTS_URL); + openActiveTimeline(); createNewTimeline(); goToEsqlTab(); updateDateRangeInLocalDatePickers(DISCOVER_CONTAINER, INITIAL_START_DATE, INITIAL_END_DATE); }); - it('should show data according to esql query', () => { + it('should show data according to the esql query', () => { addDiscoverEsqlQuery(`${esqlQuery} | limit 1`); submitDiscoverSearchBar(); cy.get(DISCOVER_RESULT_HITS).should('have.text', 1); }); + it('should be able to add fields to the table', () => { addFieldToTable('host.name'); addFieldToTable('user.name'); @@ -60,34 +65,32 @@ describe.skip( cy.get(GET_DISCOVER_DATA_GRID_CELL_HEADER('user.name')).should('be.visible'); }); - context('navigation', () => { - it('should remove the query when back is pressed after adding a query', () => { - addDiscoverEsqlQuery(esqlQuery); - submitDiscoverSearchBar(); - cy.get(DISCOVER_ESQL_INPUT_TEXT_CONTAINER).then((subj) => { - const currentQuery = subj.text(); - const sanitizedQuery = convertNBSPToSP(currentQuery); - expect(sanitizedQuery).to.eq(esqlQuery); - }); - cy.go('back'); - cy.get(DISCOVER_ESQL_INPUT_TEXT_CONTAINER).then((subj) => { - const currentQuery = subj.text(); - const sanitizedQuery = convertNBSPToSP(currentQuery); - expect(sanitizedQuery).to.not.eq(esqlQuery); - }); + it('should remove the query when the back button is pressed after adding a query', () => { + addDiscoverEsqlQuery(esqlQuery); + submitDiscoverSearchBar(); + cy.get(DISCOVER_ESQL_INPUT_TEXT_CONTAINER).then((subj) => { + const currentQuery = subj.text(); + const sanitizedQuery = convertEditorNonBreakingSpaceToSpace(currentQuery); + expect(sanitizedQuery).to.eq(esqlQuery); }); + cy.go('back'); + cy.get(DISCOVER_ESQL_INPUT_TEXT_CONTAINER).then((subj) => { + const currentQuery = subj.text(); + const sanitizedQuery = convertEditorNonBreakingSpaceToSpace(currentQuery); + expect(sanitizedQuery).to.not.eq(esqlQuery); + }); + }); - it(`should changed the timerange to ${INITIAL_START_DATE} when back is pressed after modifying timerange from ${INITIAL_START_DATE} to ${NEW_START_DATE} `, () => { - setStartDate(NEW_START_DATE, DISCOVER_CONTAINER); - updateDates(DISCOVER_CONTAINER); - - cy.go('back'); + it(`should change the timerange to ${DEFAULT_DATE} when back is pressed after modifying timerange to ${NEW_START_DATE} without saving`, () => { + setStartDate(NEW_START_DATE, DISCOVER_CONTAINER); + updateDates(DISCOVER_CONTAINER); - cy.get(GET_LOCAL_DATE_PICKER_START_DATE_POPOVER_BUTTON(DISCOVER_CONTAINER)).should( - 'have.text', - INITIAL_START_DATE - ); - }); + cy.go('back'); + showStartEndDate(DISCOVER_CONTAINER); + cy.get(GET_LOCAL_DATE_PICKER_START_DATE_POPOVER_BUTTON(DISCOVER_CONTAINER)).should( + 'have.text', + DEFAULT_DATE + ); }); } ); diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/investigations/timelines/export.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/investigations/timelines/export.cy.ts index 408fa14cd0acf..cbcc6fc758963 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/investigations/timelines/export.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/investigations/timelines/export.cy.ts @@ -13,17 +13,19 @@ import { } from '../../../tasks/timelines'; import { login } from '../../../tasks/login'; import { visit } from '../../../tasks/navigation'; +import { deleteTimelines } from '../../../tasks/api_calls/common'; import { TIMELINES_URL } from '../../../urls/navigation'; import { TOASTER } from '../../../screens/alerts_detection_rules'; import { TIMELINE_CHECKBOX } from '../../../screens/timelines'; import { createTimeline } from '../../../tasks/api_calls/timelines'; import { expectedExportedTimeline, getTimeline } from '../../../objects/timeline'; +import { closeToast } from '../../../tasks/common/toast'; -// FLAKY: https://github.com/elastic/kibana/issues/165744 describe('Export timelines', { tags: ['@ess', '@serverless'] }, () => { - before(() => { + beforeEach(() => { login(); + deleteTimelines(); cy.intercept({ method: 'POST', path: '/api/timeline/_export?file_name=timelines_export.ndjson', @@ -39,7 +41,7 @@ describe('Export timelines', { tags: ['@ess', '@serverless'] }, () => { visit(TIMELINES_URL); }); - it('Exports custom timeline(s)', function () { + it('should export custom timeline(s)', function () { cy.log('Export a custom timeline via timeline actions'); exportTimeline(this.timelineId1); @@ -47,7 +49,7 @@ describe('Export timelines', { tags: ['@ess', '@serverless'] }, () => { cy.wrap(response?.statusCode).should('eql', 200); cy.wrap(response?.body).should('eql', expectedExportedTimeline(this.timelineResponse1)); }); - cy.get('[data-test-subj="toastCloseButton"]').click(); + closeToast(); cy.log('Export a custom timeline via bulk actions'); @@ -57,7 +59,7 @@ describe('Export timelines', { tags: ['@ess', '@serverless'] }, () => { cy.wrap(response?.statusCode).should('eql', 200); cy.wrap(response?.body).should('eql', expectedExportedTimeline(this.timelineResponse1)); }); - cy.get('[data-test-subj="toastCloseButton"]').click(); + closeToast(); cy.log('Export all custom timelines via bulk actions'); diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/investigations/timelines/full_screen.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/investigations/timelines/full_screen.cy.ts index 0c2132a168560..bf69b711a7aef 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/investigations/timelines/full_screen.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/investigations/timelines/full_screen.cy.ts @@ -18,7 +18,6 @@ import { populateTimeline } from '../../../tasks/timeline'; import { hostsUrl } from '../../../urls/navigation'; -// FLAKY: https://github.com/elastic/kibana/issues/165638 describe('Toggle full screen', { tags: ['@ess', '@serverless'] }, () => { beforeEach(() => { login(); diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/investigations/timelines/inspect.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/investigations/timelines/inspect.cy.ts index 235c8c248b33d..0f4a22d7e338d 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/investigations/timelines/inspect.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/investigations/timelines/inspect.cy.ts @@ -14,7 +14,6 @@ import { executeTimelineKQL, openTimelineInspectButton } from '../../../tasks/ti import { hostsUrl } from '../../../urls/navigation'; -// FLAKY: https://github.com/elastic/kibana/issues/165688 describe('Inspect', { tags: ['@ess', '@serverless'] }, () => { context('Timeline', () => { it('inspects the timeline', () => { diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/investigations/timelines/row_renderers.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/investigations/timelines/row_renderers.cy.ts index 80d4a9780c6e7..4867ba79183f3 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/investigations/timelines/row_renderers.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/investigations/timelines/row_renderers.cy.ts @@ -116,7 +116,7 @@ describe('Row renderers', { tags: ['@ess', '@serverless'] }, () => { // A follw-up ticket to tackle this issue has been created. it.skip('Signature tooltips do not overlap', () => { // Hover the signature to show the tooltips - cy.get(TIMELINE_ROW_RENDERERS_SURICATA_SIGNATURE).parents('.euiPopover__anchor').realHover(); + cy.get(TIMELINE_ROW_RENDERERS_SURICATA_SIGNATURE).parents('.euiPopover').realHover(); cy.get(TIMELINE_ROW_RENDERERS_SURICATA_LINK_TOOLTIP).then(($googleLinkTooltip) => { cy.get(TIMELINE_ROW_RENDERERS_SURICATA_SIGNATURE_TOOLTIP).then(($signatureTooltip) => { diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/investigations/timelines/unsaved_timeline.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/investigations/timelines/unsaved_timeline.cy.ts index fd52a80ed9ff6..fb7e0652293e8 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/investigations/timelines/unsaved_timeline.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/investigations/timelines/unsaved_timeline.cy.ts @@ -7,7 +7,6 @@ import { MODAL_CONFIRMATION_BTN } from '../../../screens/alerts_detection_rules'; import { - ALERTS_PAGE, APP_LEAVE_CONFIRM_MODAL, CASES_PAGE, MANAGE_PAGE, @@ -38,10 +37,12 @@ import { } from '../../../tasks/timeline'; import { EXPLORE_URL, hostsUrl, MANAGE_URL } from '../../../urls/navigation'; -// FLAKY: https://github.com/elastic/kibana/issues/169588 -describe.skip('Save Timeline Prompts', { tags: ['@ess'] }, () => { - before(() => { +describe('[ESS] Save Timeline Prompts', { tags: ['@ess'] }, () => { + beforeEach(() => { login(); + visitWithTimeRange(hostsUrl('allHosts')); + openTimelineUsingToggle(); + createNewTimeline(); /* * When timeline changes are pending, chrome would popup with * a confirm dialog stating that `you can lose unsaved changed. @@ -53,46 +54,37 @@ describe.skip('Save Timeline Prompts', { tags: ['@ess'] }, () => { }); }); - beforeEach(() => { - login(); - visitWithTimeRange(hostsUrl('allHosts')); - openTimelineUsingToggle(); - createNewTimeline(); - }); - - it('unchanged & unsaved timeline should NOT prompt when user navigates away', () => { + it('should NOT prompt when navigating with an unchanged & unsaved timeline', () => { openKibanaNavigation(); navigateFromKibanaCollapsibleTo(OBSERVABILITY_ALERTS_PAGE); cy.url().should('not.contain', hostsUrl('allHosts')); }); - it('Changed & unsaved timeline should prompt when user navigates away from security solution', () => { + it('should prompt when navigating away from security solution with a changed & unsaved timeline', () => { populateTimeline(); closeTimelineUsingCloseButton(); openKibanaNavigation(); navigateFromKibanaCollapsibleTo(OBSERVABILITY_ALERTS_PAGE); cy.get(APP_LEAVE_CONFIRM_MODAL).should('be.visible'); - cy.get(MODAL_CONFIRMATION_BTN).click(); }); - it('Changed & unsaved timeline should NOT prompt when user navigates away within security solution where timelines are enabled', () => { + it('should NOT prompt when navigating with a changed & unsaved timeline within security solution where timelines are enabled', () => { populateTimeline(); closeTimelineUsingCloseButton(); // navigate to any other page in security solution openKibanaNavigation(); - cy.get(CASES_PAGE).click(); + navigateFromKibanaCollapsibleTo(CASES_PAGE); cy.get(APP_LEAVE_CONFIRM_MODAL).should('not.exist'); }); - it('Changed & unsaved timeline should prompt when user navigates away within security solution where timelines are disabled eg. admin screen', () => { + it('should prompt when navigating with a changed & unsaved timeline within security solution where timelines are disabled eg. admin screen', () => { populateTimeline(); openKibanaNavigation(); - cy.get(MANAGE_PAGE).click(); + navigateFromKibanaCollapsibleTo(MANAGE_PAGE); cy.get(APP_LEAVE_CONFIRM_MODAL).should('be.visible'); - cy.get(MODAL_CONFIRMATION_BTN).click(); }); - it('Changed & saved timeline should NOT prompt when user navigates away out of security solution', () => { + it('should NOT prompt when navigating with a changed & saved timeline out of security solution', () => { populateTimeline(); addNameToTimelineAndSave('Test'); closeTimelineUsingCloseButton(); @@ -101,36 +93,20 @@ describe.skip('Save Timeline Prompts', { tags: ['@ess'] }, () => { cy.get(APP_LEAVE_CONFIRM_MODAL).should('not.exist'); }); - it('Changed & saved timeline should NOT prompt when user navigates within security solution where timelines are disabled', () => { + it('should NOT prompt when navigating with a changed & saved timeline within security solution where timelines are disabled', () => { populateTimeline(); addNameToTimelineAndSave('Test'); closeTimelineUsingCloseButton(); openKibanaNavigation(); - cy.get(MANAGE_PAGE).click(); + navigateFromKibanaCollapsibleTo(MANAGE_PAGE); cy.get(APP_LEAVE_CONFIRM_MODAL).should('not.exist'); }); - it('When user navigates to the page where timeline is present, Timeline save modal should not exists.', () => { + it('should NOT prompt when navigating with a changed and unsaved timeline from the page where timeline is disabled', () => { populateTimeline(); closeTimelineUsingCloseButton(); openKibanaNavigation(); - cy.get(MANAGE_PAGE).click(); - cy.get(APP_LEAVE_CONFIRM_MODAL).should('be.visible'); - cy.get(MODAL_CONFIRMATION_BTN).click(); - - // Navigate back to HOSTS_URL and ensure that - // timeline save modal is NOT present - - openKibanaNavigation(); - cy.get(ALERTS_PAGE).click(); - cy.get(TIMELINE_SAVE_MODAL).should('not.exist'); - }); - - it('Changed and unsaved timeline should NOT prompt when user navigates from the page where timeline is disabled', () => { - populateTimeline(); - closeTimelineUsingCloseButton(); - openKibanaNavigation(); - cy.get(MANAGE_PAGE).click(); + navigateFromKibanaCollapsibleTo(MANAGE_PAGE); cy.get(APP_LEAVE_CONFIRM_MODAL).should('be.visible'); cy.get(MODAL_CONFIRMATION_BTN).click(); // now we have come from MANAGE_PAGE where timeline is disabled @@ -145,9 +121,12 @@ describe.skip('Save Timeline Prompts', { tags: ['@ess'] }, () => { }); // In serverless it is not possible to use the navigation menu without closing the timeline -describe('Save Timeline Prompts', { tags: ['@serverless'] }, () => { - before(() => { +describe('[serverless] Save Timeline Prompts', { tags: ['@serverless'] }, () => { + beforeEach(() => { login(); + visitWithTimeRange(hostsUrl('allHosts')); + openTimelineUsingToggle(); + createNewTimeline(); /* * When timeline changes are pending, chrome would popup with * a confirm dialog stating that `you can lose unsaved changed. @@ -159,14 +138,7 @@ describe('Save Timeline Prompts', { tags: ['@serverless'] }, () => { }); }); - beforeEach(() => { - login(); - visitWithTimeRange(hostsUrl('allHosts')); - openTimelineUsingToggle(); - createNewTimeline(); - }); - - it('unchanged & unsaved timeline should NOT prompt when it is closed and navigate to any page', () => { + it('should NOT prompt when navigating with an unchanged & unsaved timeline to any page', () => { closeTimelineUsingCloseButton(); navigateToAlertsPageInServerless(); // security page with timelines enabled @@ -177,7 +149,7 @@ describe('Save Timeline Prompts', { tags: ['@serverless'] }, () => { cy.get(APP_LEAVE_CONFIRM_MODAL).should('not.exist'); }); - it('Changed & unsaved timeline should prompt when it is closed and navigate to Security page without timeline', () => { + it('should prompt when navigating with a changed & unsaved timeline to a security page without timeline', () => { populateTimeline(); closeTimelineUsingCloseButton(); @@ -185,19 +157,17 @@ describe('Save Timeline Prompts', { tags: ['@serverless'] }, () => { cy.get(APP_LEAVE_CONFIRM_MODAL).should('not.exist'); navigateToExplorePageInServerless(); // security page with timelines disabled cy.get(APP_LEAVE_CONFIRM_MODAL).should('be.visible'); - cy.get(MODAL_CONFIRMATION_BTN).click(); }); - it('Changed & unsaved timeline should prompt when it is closed and navigate to external page', () => { + it('should prompt when navigating with a changed & unsaved timeline to an external page', () => { populateTimeline(); closeTimelineUsingCloseButton(); navigateToDiscoverPageInServerless(); cy.get(APP_LEAVE_CONFIRM_MODAL).should('be.visible'); - cy.get(MODAL_CONFIRMATION_BTN).click(); }); - it('Changed & saved timeline should NOT prompt when it is closed', () => { + it('should NOT prompt when navigating with a changed & saved timeline to pages where timelines are disabled', () => { populateTimeline(); addNameToTimelineAndSave('Test'); closeTimelineUsingCloseButton(); @@ -210,13 +180,13 @@ describe('Save Timeline Prompts', { tags: ['@serverless'] }, () => { cy.get(APP_LEAVE_CONFIRM_MODAL).should('not.exist'); }); - it('Changed & unsaved timeline should NOT prompt when navigate to page with timeline using breadcrumbs', () => { + it('should NOT prompt when navigating with a changed & unsaved timeline to a page with timeline using breadcrumbs', () => { populateTimeline(); navigateToHostsUsingBreadcrumb(); // hosts has timelines enabled cy.get(APP_LEAVE_CONFIRM_MODAL).should('not.exist'); }); - it('Changed & unsaved timeline should NOT prompt when navigate to page without timeline using breadcrumbs', () => { + it('should prompt when navigating with a changed & unsaved timeline to page without timeline using breadcrumbs', () => { populateTimeline(); navigateToExploreUsingBreadcrumb(); // explore has timelines disabled cy.get(APP_LEAVE_CONFIRM_MODAL).should('be.visible'); @@ -224,7 +194,7 @@ describe('Save Timeline Prompts', { tags: ['@serverless'] }, () => { cy.url().should('contain', EXPLORE_URL); }); - it('Changed & saved timeline should NOT prompt when user navigates within security solution where timelines are disabled', () => { + it('should NOT prompt when navigating with a changed & saved timeline within security solution where timelines are disabled', () => { populateTimeline(); addNameToTimelineAndSave('Test'); navigateToExploreUsingBreadcrumb(); // explore has timelines disabled diff --git a/x-pack/test/security_solution_cypress/cypress/screens/common/toast.ts b/x-pack/test/security_solution_cypress/cypress/screens/common/toast.ts new file mode 100644 index 0000000000000..3f52d30a05a1a --- /dev/null +++ b/x-pack/test/security_solution_cypress/cypress/screens/common/toast.ts @@ -0,0 +1,8 @@ +/* + * 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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +export const TOAST_CLOSE_BUTTON = '[data-test-subj="toastCloseButton"]'; diff --git a/x-pack/test/security_solution_cypress/cypress/screens/entity_analytics_management.ts b/x-pack/test/security_solution_cypress/cypress/screens/entity_analytics_management.ts index 2c025efcbe79a..481c12fd9232e 100644 --- a/x-pack/test/security_solution_cypress/cypress/screens/entity_analytics_management.ts +++ b/x-pack/test/security_solution_cypress/cypress/screens/entity_analytics_management.ts @@ -39,3 +39,6 @@ export const RISK_SCORE_PRIVILEGES_CALLOUT = '[data-test-subj="callout-missing-risk-engine-privileges"]'; export const RISK_SCORE_SWITCH = '[data-test-subj="risk-score-switch"]'; + +export const RISK_SCORE_PREVIEW_PRIVILEGES_CALLOUT = + '[data-test-subj="missing-risk-engine-preview-permissions"]'; diff --git a/x-pack/test/security_solution_cypress/cypress/screens/exceptions.ts b/x-pack/test/security_solution_cypress/cypress/screens/exceptions.ts index f93e01271fda9..b4032167ebe43 100644 --- a/x-pack/test/security_solution_cypress/cypress/screens/exceptions.ts +++ b/x-pack/test/security_solution_cypress/cypress/screens/exceptions.ts @@ -12,19 +12,20 @@ export const CLOSE_SINGLE_ALERT_CHECKBOX = '[data-test-subj="closeAlertOnAddExce export const CONFIRM_BTN = '[data-test-subj="addExceptionConfirmButton"]'; export const FIELD_INPUT = - '[data-test-subj="fieldAutocompleteComboBox"] [data-test-subj="comboBoxInput"] input'; + '[data-test-subj="fieldAutocompleteComboBox"] [data-test-subj="comboBoxSearchInput"]'; export const FIELD_INPUT_PARENT = - '[data-test-subj="fieldAutocompleteComboBox"] [data-test-subj="comboBoxInput"]'; + '[data-test-subj="fieldAutocompleteComboBox"] [data-test-subj="comboBoxSearchInput"]'; export const LOADING_SPINNER = '[data-test-subj="loading-spinner"]'; export const EXCEPTION_FLYOUT_LOADING_SPINNER = '[data-test-subj="loadingAddExceptionFlyout"]'; -export const OPERATOR_INPUT = '[data-test-subj="operatorAutocompleteComboBox"]'; +export const OPERATOR_INPUT = + '[data-test-subj="operatorAutocompleteComboBox"] [data-test-subj="comboBoxInput"]'; export const VALUES_INPUT = - '[data-test-subj="valuesAutocompleteMatch"] [data-test-subj="comboBoxInput"]'; + '[data-test-subj="valuesAutocompleteMatch"] [data-test-subj="comboBoxSearchInput"]'; export const VALUES_MATCH_ANY_INPUT = '[data-test-subj="valuesAutocompleteMatchAny"] [data-test-subj="comboBoxInput"]'; diff --git a/x-pack/test/security_solution_cypress/cypress/tasks/common/toast.ts b/x-pack/test/security_solution_cypress/cypress/tasks/common/toast.ts new file mode 100644 index 0000000000000..50c32e68ca9e2 --- /dev/null +++ b/x-pack/test/security_solution_cypress/cypress/tasks/common/toast.ts @@ -0,0 +1,10 @@ +/* + * 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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { TOAST_CLOSE_BUTTON } from '../../screens/common/toast'; + +export const closeToast = () => cy.get(TOAST_CLOSE_BUTTON).click(); diff --git a/x-pack/test/security_solution_cypress/cypress/tasks/date_picker.ts b/x-pack/test/security_solution_cypress/cypress/tasks/date_picker.ts index 00d5a892593b6..99823f357dc90 100644 --- a/x-pack/test/security_solution_cypress/cypress/tasks/date_picker.ts +++ b/x-pack/test/security_solution_cypress/cypress/tasks/date_picker.ts @@ -76,7 +76,7 @@ export const updateDateRangeInLocalDatePickers = ( cy.get(DATE_PICKER_ABSOLUTE_INPUT).click(); cy.get(DATE_PICKER_ABSOLUTE_INPUT).clear(); - cy.get(DATE_PICKER_ABSOLUTE_INPUT).type(startDate); + cy.get(DATE_PICKER_ABSOLUTE_INPUT).type(`${startDate}{enter}`); cy.get(GET_LOCAL_DATE_PICKER_APPLY_BUTTON(localQueryBarSelector)).click(); cy.get(GET_LOCAL_DATE_PICKER_APPLY_BUTTON(localQueryBarSelector)).should( 'not.have.text', @@ -89,7 +89,7 @@ export const updateDateRangeInLocalDatePickers = ( cy.get(DATE_PICKER_ABSOLUTE_INPUT).click(); cy.get(DATE_PICKER_ABSOLUTE_INPUT).clear(); - cy.get(DATE_PICKER_ABSOLUTE_INPUT).type(endDate); + cy.get(DATE_PICKER_ABSOLUTE_INPUT).type(`${endDate}{enter}`); cy.get(GET_LOCAL_DATE_PICKER_APPLY_BUTTON(localQueryBarSelector)).click(); }; diff --git a/x-pack/test/security_solution_cypress/cypress/tasks/discover.ts b/x-pack/test/security_solution_cypress/cypress/tasks/discover.ts index 4402e1c65f477..364f292124913 100644 --- a/x-pack/test/security_solution_cypress/cypress/tasks/discover.ts +++ b/x-pack/test/security_solution_cypress/cypress/tasks/discover.ts @@ -64,7 +64,7 @@ export const addDiscoverEsqlQuery = (esqlQuery: string) => { cy.get(GET_LOCAL_SEARCH_BAR_SUBMIT_BUTTON(DISCOVER_CONTAINER)).realClick(); }; -export const convertNBSPToSP = (str: string) => { +export const convertEditorNonBreakingSpaceToSpace = (str: string) => { return str.replaceAll(String.fromCharCode(160), ' '); }; diff --git a/x-pack/test/security_solution_cypress/cypress/tasks/exceptions.ts b/x-pack/test/security_solution_cypress/cypress/tasks/exceptions.ts index 4ed5ff5ef2f8d..db260fab5ad6b 100644 --- a/x-pack/test/security_solution_cypress/cypress/tasks/exceptions.ts +++ b/x-pack/test/security_solution_cypress/cypress/tasks/exceptions.ts @@ -74,7 +74,7 @@ export const addExceptionEntryFieldValueOfItemX = ( .eq(itemIndex) .find(FIELD_INPUT) .eq(fieldIndex) - .type(`${field}{enter}`); + .type(`{selectall}${field}{enter}`); cy.get(EXCEPTION_FLYOUT_TITLE).click(); }; @@ -99,7 +99,7 @@ export const selectCurrentEntryField = (index = 0) => { }; export const addExceptionEntryFieldValue = (field: string, index = 0) => { - cy.get(FIELD_INPUT).eq(index).type(`${field}{enter}`); + cy.get(FIELD_INPUT).eq(index).type(`{selectall}${field}{enter}`); cy.get(EXCEPTION_FLYOUT_TITLE).click(); }; @@ -109,23 +109,23 @@ export const addExceptionEntryFieldValueAndSelectSuggestion = (field: string, in }; export const addExceptionEntryOperatorValue = (operator: string, index = 0) => { - cy.get(OPERATOR_INPUT).eq(index).type(`${operator}{enter}`); + cy.get(OPERATOR_INPUT).eq(index).type(`{selectall}${operator}{enter}`); cy.get(EXCEPTION_FLYOUT_TITLE).click(); }; export const addExceptionEntryFieldValueValue = (value: string, index = 0) => { - cy.get(VALUES_INPUT).eq(index).type(`${value}{enter}`); + cy.get(VALUES_INPUT).eq(index).type(`{selectall}${value}{enter}`); cy.get(EXCEPTION_FLYOUT_TITLE).click(); }; export const addExceptionEntryFieldMatchAnyValue = (values: string[], index = 0) => { values.forEach((value) => { - cy.get(VALUES_MATCH_ANY_INPUT).eq(index).type(`${value}{enter}`); + cy.get(VALUES_MATCH_ANY_INPUT).eq(index).type(`{selectall}${value}{enter}`); }); cy.get(EXCEPTION_FLYOUT_TITLE).click(); }; export const addExceptionEntryFieldMatchIncludedValue = (value: string, index = 0) => { - cy.get(VALUES_MATCH_INCLUDED_INPUT).eq(index).type(`${value}{enter}`); + cy.get(VALUES_MATCH_INCLUDED_INPUT).eq(index).type(`{selectall}${value}{enter}`); cy.get(EXCEPTION_FLYOUT_TITLE).click(); }; @@ -148,13 +148,13 @@ export const addExceptionFlyoutItemName = (name: string) => { cy.get(EXCEPTION_ITEM_NAME_INPUT).scrollIntoView(); cy.get(EXCEPTION_ITEM_NAME_INPUT).should('be.visible'); cy.get(EXCEPTION_ITEM_NAME_INPUT).first().focus(); - cy.get(EXCEPTION_ITEM_NAME_INPUT).type(`${name}{enter}`, { force: true }); + cy.get(EXCEPTION_ITEM_NAME_INPUT).type(`{selectall}${name}{enter}`, { force: true }); cy.get(EXCEPTION_ITEM_NAME_INPUT).should('have.value', name); }; export const editExceptionFlyoutItemName = (name: string) => { cy.get(EXCEPTION_ITEM_NAME_INPUT).clear(); - cy.get(EXCEPTION_ITEM_NAME_INPUT).type(`${name}{enter}`); + cy.get(EXCEPTION_ITEM_NAME_INPUT).type(`{selectall}${name}{enter}`); cy.get(EXCEPTION_ITEM_NAME_INPUT).should('have.value', name); }; @@ -169,12 +169,12 @@ export const selectCloseSingleAlerts = () => { export const addExceptionConditions = (exception: Exception) => { cy.get(FIELD_INPUT).type(`${exception.field}{downArrow}{enter}`); - cy.get(OPERATOR_INPUT).type(`${exception.operator}{enter}`); + cy.get(OPERATOR_INPUT).type(`{selectall}${exception.operator}{enter}`); if (exception.operator === 'is one of') { addExceptionEntryFieldMatchAnyValue(exception.values, 0); } else { exception.values.forEach((value) => { - cy.get(VALUES_INPUT).type(`${value}{enter}`); + cy.get(VALUES_INPUT).type(`{selectall}${value}{enter}`); }); } }; @@ -189,7 +189,7 @@ export const submitNewExceptionItem = () => { cy.get(CONFIRM_BTN).should('exist'); /* Sometimes a toaster error message unrelated with the test performed is displayed. The toaster is blocking the confirm button we have to click. Using force true would solve the issue, but should not be used. - There are some tests that use the closeErrorToast() method to close error toasters before continuing with the interactions with the page. + There are some tests that use the closeErrorToast() method to close error toasters before continuing with the interactions with the page. In this case we check if a toaster is displayed and if so, close it to continue with the test. */ cy.root().then(($page) => { diff --git a/x-pack/test/security_solution_cypress/cypress/tasks/timeline.ts b/x-pack/test/security_solution_cypress/cypress/tasks/timeline.ts index c71eb590f1fea..670cbe92bdffa 100644 --- a/x-pack/test/security_solution_cypress/cypress/tasks/timeline.ts +++ b/x-pack/test/security_solution_cypress/cypress/tasks/timeline.ts @@ -302,8 +302,8 @@ export const closeTimeline = () => { }; export const createNewTimeline = () => { - cy.get(NEW_TIMELINE_ACTION).should('be.visible').trigger('click'); - cy.get(CREATE_NEW_TIMELINE).eq(0).should('be.visible').click({ force: true }); + cy.get(NEW_TIMELINE_ACTION).click(); + cy.get(CREATE_NEW_TIMELINE).first().click(); }; export const openCreateTimelineOptionsPopover = () => { diff --git a/x-pack/test/security_solution_cypress/cypress/tasks/timelines.ts b/x-pack/test/security_solution_cypress/cypress/tasks/timelines.ts index 1e59727a26527..607b1d3e67978 100644 --- a/x-pack/test/security_solution_cypress/cypress/tasks/timelines.ts +++ b/x-pack/test/security_solution_cypress/cypress/tasks/timelines.ts @@ -59,7 +59,6 @@ export const selectTimeline = (timelineId: string) => { }; export const selectAllTimelines = () => { - cy.get(SELECT_ALL_CHECKBOX).should('exist'); cy.get(SELECT_ALL_CHECKBOX).click(); }; diff --git a/x-pack/test/security_solution_endpoint/apps/integrations/endpoint_exceptions.ts b/x-pack/test/security_solution_endpoint/apps/integrations/endpoint_exceptions.ts index aab49b3c5c299..539101c795047 100644 --- a/x-pack/test/security_solution_endpoint/apps/integrations/endpoint_exceptions.ts +++ b/x-pack/test/security_solution_endpoint/apps/integrations/endpoint_exceptions.ts @@ -26,6 +26,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { const supertest = getService('supertest'); const find = getService('find'); const unzipPromisify = promisify(unzip); + const comboBox = getService('comboBox'); // FLAKY: https://github.com/elastic/kibana/issues/173184 describe.skip('Endpoint Exceptions', function () { @@ -60,7 +61,6 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { const setLastFieldsValue = async ({ testSubj, value, - optionSelector = `button[title="${value}"]`, }: { testSubj: string; value: string; @@ -71,11 +71,16 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { const lastField = fields[fields.length - 1]; await lastField.click(); - const inputField = await lastField.findByTagName('input'); - await inputField.type(value); - - const dropdownOptionSelector = `[data-test-subj="comboBoxOptionsList ${testSubj}-optionsList"] ${optionSelector}`; - await find.clickByCssSelector(dropdownOptionSelector); + await retry.try( + async () => { + await comboBox.setElement(lastField, value); + }, + async () => { + // If the above fails due to an option not existing, create the value custom instead + await comboBox.setFilterValue(lastField, value); + await pageObjects.common.pressEnterKey(); + } + ); }; const setLastEntry = async ({ @@ -92,7 +97,6 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { await setLastFieldsValue({ testSubj: operator === 'matches' ? 'valuesAutocompleteWildcard' : 'valuesAutocompleteMatch', value, - optionSelector: 'p', }); }; diff --git a/x-pack/test/tsconfig.json b/x-pack/test/tsconfig.json index e99384efa14cb..894d4c8039946 100644 --- a/x-pack/test/tsconfig.json +++ b/x-pack/test/tsconfig.json @@ -164,5 +164,6 @@ "@kbn/io-ts-utils", "@kbn/log-explorer-plugin", "@kbn/security-plugin-types-common", + "@kbn/typed-react-router-config", ] } diff --git a/x-pack/test_serverless/api_integration/test_suites/common/alerting/rules.ts b/x-pack/test_serverless/api_integration/test_suites/common/alerting/rules.ts index b0813a55325f1..be10f9b83ac6b 100644 --- a/x-pack/test_serverless/api_integration/test_suites/common/alerting/rules.ts +++ b/x-pack/test_serverless/api_integration/test_suites/common/alerting/rules.ts @@ -5,6 +5,7 @@ * 2.0. */ +import { RULE_SAVED_OBJECT_TYPE } from '@kbn/alerting-plugin/server'; import expect from '@kbn/expect'; import { omit } from 'lodash'; import { FtrProviderContext } from '../../../ftr_provider_context'; @@ -926,7 +927,7 @@ function validateEventLog(event: any, params: ValidateEventLogParams) { expect(event?.kibana?.saved_objects).to.eql([ { rel: 'primary', - type: 'alert', + type: RULE_SAVED_OBJECT_TYPE, id: params.ruleId, type_id: params.ruleTypeId, }, diff --git a/x-pack/test_serverless/functional/config.base.ts b/x-pack/test_serverless/functional/config.base.ts index 643c537940484..501a23c258046 100644 --- a/x-pack/test_serverless/functional/config.base.ts +++ b/x-pack/test_serverless/functional/config.base.ts @@ -103,6 +103,10 @@ export function createTestConfig(options: CreateTestConfigOptions) { pathname: '/app/discover', hash: '/context', }, + searchProfiler: { + pathname: '/app/dev_tools', + hash: '/searchprofiler', + }, }, // choose where screenshots should be saved screenshots: { diff --git a/x-pack/test_serverless/functional/test_suites/common/dev_tools/index.ts b/x-pack/test_serverless/functional/test_suites/common/dev_tools/index.ts new file mode 100644 index 0000000000000..067a17062c3a9 --- /dev/null +++ b/x-pack/test_serverless/functional/test_suites/common/dev_tools/index.ts @@ -0,0 +1,14 @@ +/* + * 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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { FtrProviderContext } from '../../../ftr_provider_context'; + +export default ({ loadTestFile }: FtrProviderContext) => { + describe('Serverless Common UI - Dev Tools', function () { + loadTestFile(require.resolve('./search_profiler')); + }); +}; diff --git a/x-pack/test_serverless/functional/test_suites/common/dev_tools/search_profiler.ts b/x-pack/test_serverless/functional/test_suites/common/dev_tools/search_profiler.ts new file mode 100644 index 0000000000000..1747d6a517c5f --- /dev/null +++ b/x-pack/test_serverless/functional/test_suites/common/dev_tools/search_profiler.ts @@ -0,0 +1,102 @@ +/* + * 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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import expect from '@kbn/expect'; +import { FtrProviderContext } from '../../../ftr_provider_context'; + +const testIndex = 'test-index'; +const testQuery = { + query: { + match_all: {}, + }, +}; +export default function ({ getPageObjects, getService }: FtrProviderContext) { + const PageObjects = getPageObjects(['svlCommonPage', 'common', 'searchProfiler']); + const retry = getService('retry'); + const es = getService('es'); + + describe('Search Profiler Editor', () => { + before(async () => { + await PageObjects.svlCommonPage.login(); + await PageObjects.common.navigateToApp('searchProfiler'); + expect(await PageObjects.searchProfiler.editorExists()).to.be(true); + }); + + after(async () => { + await PageObjects.svlCommonPage.forceLogout(); + }); + + it('supports pre-configured search query', async () => { + const query = { + query: { + bool: { + should: [ + { + match: { + name: 'fred', + }, + }, + { + terms: { + name: ['sue', 'sally'], + }, + }, + ], + }, + }, + aggs: { + stats: { + stats: { + field: 'price', + }, + }, + }, + }; + + // Since we're not actually running the query in the test, + // this index name is just an input placeholder and does not exist + const indexName = 'my_index'; + + await PageObjects.common.navigateToUrl( + 'searchProfiler', + PageObjects.searchProfiler.getUrlWithIndexAndQuery({ indexName, query }), + { + useActualUrl: true, + } + ); + + const indexInputValue = await PageObjects.searchProfiler.getIndexName(); + + expect(indexInputValue).to.eql(indexName); + + await retry.try(async () => { + const searchProfilerInput = await PageObjects.searchProfiler.getQuery(); + expect(searchProfilerInput).to.eql(query); + }); + }); + + describe('With a test index', () => { + before(async () => { + await es.indices.create({ index: testIndex }); + }); + + after(async () => { + await es.indices.delete({ index: testIndex }); + }); + + it('profiles a simple query', async () => { + await PageObjects.searchProfiler.setIndexName(testIndex); + await PageObjects.searchProfiler.setQuery(testQuery); + + await PageObjects.searchProfiler.clickProfileButton(); + + const content = await PageObjects.searchProfiler.getProfileContent(); + expect(content).to.contain(testIndex); + }); + }); + }); +} diff --git a/x-pack/test_serverless/functional/test_suites/common/examples/unified_field_list_examples/existing_fields.ts b/x-pack/test_serverless/functional/test_suites/common/examples/unified_field_list_examples/existing_fields.ts index 6dd1542bbea39..d9721c09ecd3b 100644 --- a/x-pack/test_serverless/functional/test_suites/common/examples/unified_field_list_examples/existing_fields.ts +++ b/x-pack/test_serverless/functional/test_suites/common/examples/unified_field_list_examples/existing_fields.ts @@ -57,7 +57,8 @@ export default ({ getService, getPageObjects }: FtrProviderContext) => { await PageObjects.header.waitUntilLoadingHasFinished(); } - describe('Fields existence info', () => { + // FLAKY: https://github.com/elastic/kibana/issues/172781 + describe.skip('Fields existence info', () => { before(async () => { await esArchiver.load( 'test/api_integration/fixtures/es_archiver/index_patterns/constant_keyword' diff --git a/x-pack/test_serverless/functional/test_suites/common/management/data_views/_data_view_create_delete.ts b/x-pack/test_serverless/functional/test_suites/common/management/data_views/_data_view_create_delete.ts index ca7bc4bc55569..f8309602d87ac 100644 --- a/x-pack/test_serverless/functional/test_suites/common/management/data_views/_data_view_create_delete.ts +++ b/x-pack/test_serverless/functional/test_suites/common/management/data_views/_data_view_create_delete.ts @@ -198,7 +198,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); }); - describe('index pattern edit', function () { + // FLAKY: https://github.com/elastic/kibana/issues/173564 + describe.skip('index pattern edit', function () { it('should update field list', async function () { await PageObjects.settings.editIndexPattern( 'kibana_sample_data_flights', diff --git a/x-pack/test_serverless/functional/test_suites/common/management/data_views/_runtime_fields.ts b/x-pack/test_serverless/functional/test_suites/common/management/data_views/_runtime_fields.ts index 810676e07df47..47af432c0dad0 100644 --- a/x-pack/test_serverless/functional/test_suites/common/management/data_views/_runtime_fields.ts +++ b/x-pack/test_serverless/functional/test_suites/common/management/data_views/_runtime_fields.ts @@ -16,7 +16,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const PageObjects = getPageObjects(['settings', 'common']); const testSubjects = getService('testSubjects'); - describe('runtime fields', function () { + // Failing: See https://github.com/elastic/kibana/issues/173580 + // FLAKY: https://github.com/elastic/kibana/issues/173558 + // FLAKY: https://github.com/elastic/kibana/issues/173572 + describe.skip('runtime fields', function () { this.tags(['skipFirefox']); before(async function () { diff --git a/x-pack/test_serverless/functional/test_suites/common/visualizations/group3/open_in_lens/tsvb/table.ts b/x-pack/test_serverless/functional/test_suites/common/visualizations/group3/open_in_lens/tsvb/table.ts index be48300683d7c..864e205e3ff5f 100644 --- a/x-pack/test_serverless/functional/test_suites/common/visualizations/group3/open_in_lens/tsvb/table.ts +++ b/x-pack/test_serverless/functional/test_suites/common/visualizations/group3/open_in_lens/tsvb/table.ts @@ -22,6 +22,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { const retry = getService('retry'); const panelActions = getService('dashboardPanelActions'); const kibanaServer = getService('kibanaServer'); + const comboBox = getService('comboBox'); describe('Table', function describeIndexTests() { const fixture = @@ -83,8 +84,10 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { await lens.openDimensionEditor('lnsDatatable_metrics > lns-dimensionTrigger'); await testSubjects.click('indexPattern-advanced-accordion'); - const reducedTimeRange = await testSubjects.find('indexPattern-dimension-reducedTimeRange'); - expect(await reducedTimeRange.getVisibleText()).to.be('1 minute (1m)'); + expect( + await comboBox.getComboBoxSelectedOptions('indexPattern-dimension-reducedTimeRange') + ).to.eql(['1 minute (1m)']); + await retry.try(async () => { const layerCount = await lens.getLayerCount(); expect(layerCount).to.be(1); diff --git a/x-pack/test_serverless/functional/test_suites/common/visualizations/group3/open_in_lens/tsvb/top_n.ts b/x-pack/test_serverless/functional/test_suites/common/visualizations/group3/open_in_lens/tsvb/top_n.ts index dd7fdb01827dd..4085e7faad08c 100644 --- a/x-pack/test_serverless/functional/test_suites/common/visualizations/group3/open_in_lens/tsvb/top_n.ts +++ b/x-pack/test_serverless/functional/test_suites/common/visualizations/group3/open_in_lens/tsvb/top_n.ts @@ -17,6 +17,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { const queryBar = getService('queryBar'); const panelActions = getService('dashboardPanelActions'); const kibanaServer = getService('kibanaServer'); + const comboBox = getService('comboBox'); describe('Top N', function describeIndexTests() { const fixture = @@ -102,7 +103,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { await lens.openDimensionEditor('lnsXY_yDimensionPanel > lns-dimensionTrigger'); await testSubjects.click('indexPattern-advanced-accordion'); const reducedTimeRange = await testSubjects.find('indexPattern-dimension-reducedTimeRange'); - expect(await reducedTimeRange.getVisibleText()).to.be('1 minute (1m)'); + await comboBox.isOptionSelected(reducedTimeRange, '1 minute (1m)'); await retry.try(async () => { const layerCount = await lens.getLayerCount(); expect(layerCount).to.be(1); diff --git a/x-pack/test_serverless/functional/test_suites/observability/common_configs/config.group1.ts b/x-pack/test_serverless/functional/test_suites/observability/common_configs/config.group1.ts index 79ace54bdc6ac..62f34915d6f15 100644 --- a/x-pack/test_serverless/functional/test_suites/observability/common_configs/config.group1.ts +++ b/x-pack/test_serverless/functional/test_suites/observability/common_configs/config.group1.ts @@ -15,6 +15,7 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) { testFiles: [ require.resolve('../../common/home_page'), require.resolve('../../common/management'), + require.resolve('../../common/dev_tools'), require.resolve('../../common/platform_security'), require.resolve('../../common/reporting'), require.resolve('../../common/grok_debugger'), diff --git a/x-pack/test_serverless/functional/test_suites/search/common_configs/config.group1.ts b/x-pack/test_serverless/functional/test_suites/search/common_configs/config.group1.ts index 5cf92c7199d76..848aec3f340f5 100644 --- a/x-pack/test_serverless/functional/test_suites/search/common_configs/config.group1.ts +++ b/x-pack/test_serverless/functional/test_suites/search/common_configs/config.group1.ts @@ -15,6 +15,7 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) { testFiles: [ require.resolve('../../common/home_page'), require.resolve('../../common/management'), + require.resolve('../../common/dev_tools'), require.resolve('../../common/platform_security'), require.resolve('../../common/reporting'), require.resolve('../../common/console'), diff --git a/x-pack/test_serverless/functional/test_suites/security/common_configs/config.group1.ts b/x-pack/test_serverless/functional/test_suites/security/common_configs/config.group1.ts index c7771a0bf9c2d..120359a8903b3 100644 --- a/x-pack/test_serverless/functional/test_suites/security/common_configs/config.group1.ts +++ b/x-pack/test_serverless/functional/test_suites/security/common_configs/config.group1.ts @@ -15,6 +15,7 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) { testFiles: [ require.resolve('../../common/home_page'), require.resolve('../../common/management'), + require.resolve('../../common/dev_tools'), require.resolve('../../common/platform_security'), require.resolve('../../common/reporting'), require.resolve('../../common/grok_debugger'), diff --git a/x-pack/test_serverless/tsconfig.json b/x-pack/test_serverless/tsconfig.json index 72039a6ad1368..54c1e26f069d1 100644 --- a/x-pack/test_serverless/tsconfig.json +++ b/x-pack/test_serverless/tsconfig.json @@ -83,5 +83,6 @@ "@kbn/io-ts-utils", "@kbn/log-explorer-plugin", "@kbn/index-management-plugin", + "@kbn/alerting-plugin", ] } diff --git a/yarn.lock b/yarn.lock index 69b2efda65bde..dd6069f3c26ef 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1625,10 +1625,10 @@ resolved "https://registry.yarnpkg.com/@elastic/eslint-plugin-eui/-/eslint-plugin-eui-0.0.2.tgz#56b9ef03984a05cc213772ae3713ea8ef47b0314" integrity sha512-IoxURM5zraoQ7C8f+mJb9HYSENiZGgRVcG4tLQxE61yHNNRDXtGDWTZh8N1KIHcsqN1CEPETjuzBXkJYF/fDiQ== -"@elastic/eui@90.0.1-backport.0": - version "90.0.1-backport.0" - resolved "https://registry.yarnpkg.com/@elastic/eui/-/eui-90.0.1-backport.0.tgz#c57910220dab4f85c813c4b7b44a80500b5abf82" - integrity sha512-mv8ucgZdBAJ7i7sDb6K1wHS9eboVe4rb3Vg0NSIMsat2skCfQAods+aPuXuKo323W57uZGnJnQlO07wF4iA3Tg== +"@elastic/eui@91.0.0-backport.0": + version "91.0.0-backport.0" + resolved "https://registry.yarnpkg.com/@elastic/eui/-/eui-91.0.0-backport.0.tgz#821306a580cc8fcf1a142106e425f3fcd1bebfbf" + integrity sha512-2T+8JiPs1Ejh2T8l7cwqv/IIlNV6I9RbXtJ60L9U4lJGtS/R8zIoikrR/2SEs8bXwyXXg4i/trhfbYbylAvZpw== dependencies: "@hello-pangea/dnd" "^16.3.0" "@types/lodash" "^4.14.198" @@ -2897,10 +2897,10 @@ resolved "https://registry.yarnpkg.com/@jridgewell/set-array/-/set-array-1.1.2.tgz#7c6cf998d6d20b914c0a55a91ae928ff25965e72" integrity sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw== -"@jridgewell/source-map@^0.3.2": - version "0.3.2" - resolved "https://registry.yarnpkg.com/@jridgewell/source-map/-/source-map-0.3.2.tgz#f45351aaed4527a298512ec72f81040c998580fb" - integrity sha512-m7O9o2uR8k2ObDysZYzdfhb08VuEml5oWGiosa1VdaPZ/A6QyPkAJuwN0Q1lhULOf6B7MtQmHENS743hWtCrgw== +"@jridgewell/source-map@^0.3.3": + version "0.3.5" + resolved "https://registry.yarnpkg.com/@jridgewell/source-map/-/source-map-0.3.5.tgz#a3bb4d5c6825aab0d281268f47f6ad5853431e91" + integrity sha512-UTYAUj/wviwdsMfzoSJspJxbkH5o1snzwX0//0ENX1u/55kkZZkcTZP6u9bwKGkv+dkk9at4m1Cpt0uY80kcpQ== dependencies: "@jridgewell/gen-mapping" "^0.3.0" "@jridgewell/trace-mapping" "^0.3.9" @@ -3271,6 +3271,10 @@ version "0.0.0" uid "" +"@kbn/code-owners@link:packages/kbn-code-owners": + version "0.0.0" + uid "" + "@kbn/coloring@link:packages/kbn-coloring": version "0.0.0" uid "" @@ -4623,6 +4627,10 @@ version "0.0.0" uid "" +"@kbn/ftr-common-functional-ui-services@link:packages/kbn-ftr-common-functional-ui-services": + version "0.0.0" + uid "" + "@kbn/ftr-screenshot-filename@link:packages/kbn-ftr-screenshot-filename": version "0.0.0" uid "" @@ -5427,6 +5435,10 @@ version "0.0.0" uid "" +"@kbn/router-utils@link:packages/kbn-router-utils": + version "0.0.0" + uid "" + "@kbn/routing-example-plugin@link:examples/routing_example": version "0.0.0" uid "" @@ -10000,10 +10012,10 @@ resolved "https://registry.yarnpkg.com/@types/seedrandom/-/seedrandom-2.4.28.tgz#9ce8fa048c1e8c85cb71d7fe4d704e000226036f" integrity sha512-SMA+fUwULwK7sd/ZJicUztiPs8F1yCPwF3O23Z9uQ32ME5Ha0NmDK9+QTsYE4O2tHXChzXomSWWeIhCnoN1LqA== -"@types/selenium-webdriver@^4.1.20": - version "4.1.20" - resolved "https://registry.yarnpkg.com/@types/selenium-webdriver/-/selenium-webdriver-4.1.20.tgz#00d10f0593c18fe72fabc55b8f62fa387a31a193" - integrity sha512-WxzARWDZVTbXlJgwYGhNoiV4OuHDabctSQmK5V88LqjW9TJiLETcknxRZ2xB1toecQnu0T2jt1pPXnSYkaWYiw== +"@types/selenium-webdriver@^4.1.21": + version "4.1.21" + resolved "https://registry.yarnpkg.com/@types/selenium-webdriver/-/selenium-webdriver-4.1.21.tgz#79fe31faf9953a4143c3e32944d98d5146bbe185" + integrity sha512-QGURnImvxYlIQz5DVhvHdqpYNLBjhJ2Vm+cnQI2G9QZzkWlZm0LkLcvDcHp+qE6N2KBz4CeuvXgPO7W3XQ0Tyw== dependencies: "@types/ws" "*" @@ -10417,10 +10429,10 @@ "@typescript-eslint/types" "5.62.0" eslint-visitor-keys "^3.3.0" -"@wdio/logger@^8.11.0": - version "8.16.17" - resolved "https://registry.yarnpkg.com/@wdio/logger/-/logger-8.16.17.tgz#c2055857ed3e3cf12cfad843140fa79264c6a632" - integrity sha512-zeQ41z3T+b4IsrriZZipayXxLNDuGsm7TdExaviNGojPVrIsQUCSd/FvlLHM32b7ZrMyInHenu/zx1cjAZO71g== +"@wdio/logger@^8.24.12": + version "8.24.12" + resolved "https://registry.yarnpkg.com/@wdio/logger/-/logger-8.24.12.tgz#03cb8bb7ce7ee443e1dcd200a3b44270ae16a1f9" + integrity sha512-QisOiVIWKTUCf1H7S+DOtC+gruhlpimQrUXfWMTeeh672PvAJYnTpOJDWA+BtXfsikkUYFAzAaq8SeMJk8rqKg== dependencies: chalk "^5.1.2" loglevel "^1.6.0" @@ -10860,7 +10872,7 @@ acorn@^7.0.0, acorn@^7.4.1: resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.1.tgz#feaed255973d2e77555b83dbc08851a6c63520fa" integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A== -acorn@^8.0.4, acorn@^8.1.0, acorn@^8.4.1, acorn@^8.5.0, acorn@^8.7.1, acorn@^8.8.0, acorn@^8.8.2, acorn@^8.9.0: +acorn@^8.0.4, acorn@^8.1.0, acorn@^8.4.1, acorn@^8.7.1, acorn@^8.8.0, acorn@^8.8.2, acorn@^8.9.0: version "8.10.0" resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.10.0.tgz#8be5b3907a67221a81ab23c7889c4c5526b62ec5" integrity sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw== @@ -12960,10 +12972,10 @@ chrome-trace-event@^1.0.2: dependencies: tslib "^1.9.0" -chromedriver@^119.0.1: - version "119.0.1" - resolved "https://registry.yarnpkg.com/chromedriver/-/chromedriver-119.0.1.tgz#064f3650790ccea055e9bfd95c600f5ea60295e9" - integrity sha512-lpCFFLaXPpvElTaUOWKdP74pFb/sJhWtWqMjn7Ju1YriWn8dT5JBk84BGXMPvZQs70WfCYWecxdMmwfIu1Mupg== +chromedriver@^120.0.0: + version "120.0.0" + resolved "https://registry.yarnpkg.com/chromedriver/-/chromedriver-120.0.0.tgz#34d60a6726a104a348d8dbf82106ca45a430684b" + integrity sha512-LGy2LhWRBiqDarFIU8gQ43EEyj+07Tc3JuUhthkESAwZ99lrifSnKZwKU0aVwansU84+k6bt71z7K3dkk65gZg== dependencies: "@testim/chrome-version" "^1.1.4" axios "^1.6.0" @@ -13635,10 +13647,10 @@ core-js@^2.4.0, core-js@^2.5.0, core-js@^2.6.9: resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.9.tgz#6b4b214620c834152e179323727fc19741b084f2" integrity sha512-HOpZf6eXmnl7la+cUdMnLvUxKNqLUzJvgIziQ0DiF3JwSImNphIqdGqzj6hIKyX04MmV0poclQ7+wjWvxQyR2A== -core-js@^3.0.4, core-js@^3.31.0, core-js@^3.6.5, core-js@^3.8.2, core-js@^3.8.3: - version "3.31.0" - resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.31.0.tgz#4471dd33e366c79d8c0977ed2d940821719db344" - integrity sha512-NIp2TQSGfR6ba5aalZD+ZQ1fSxGhDo/s1w0nx3RYzf2pnJxt7YynxFlFScP6eV7+GZsKO95NSjGxyJsU3DZgeQ== +core-js@^3.0.4, core-js@^3.34.0, core-js@^3.6.5, core-js@^3.8.2, core-js@^3.8.3: + version "3.34.0" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.34.0.tgz#5705e6ad5982678612e96987d05b27c6c7c274a5" + integrity sha512-aDdvlDder8QmY91H88GzNi9EtQi2TjvQhpCX6B1v/dAZHU1AuLgHvRh54RiOerpEhEW46Tkf+vgAViB/CWC0ag== core-util-is@1.0.2, core-util-is@^1.0.2, core-util-is@~1.0.0: version "1.0.2" @@ -17425,16 +17437,16 @@ gaze@^1.0.0: dependencies: globule "^1.0.0" -geckodriver@^4.2.1: - version "4.2.1" - resolved "https://registry.yarnpkg.com/geckodriver/-/geckodriver-4.2.1.tgz#03ad628241417737b962966aa8f8b13fa0f8bf75" - integrity sha512-4m/CRk0OI8MaANRuFIahvOxYTSjlNAO2p9JmE14zxueknq6cdtB5M9UGRQ8R9aMV0bLGNVHHDnDXmoXdOwJfWg== +geckodriver@^4.3.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/geckodriver/-/geckodriver-4.3.0.tgz#8586e80ddd23e5d5cd47382d9f6897051ca12ea3" + integrity sha512-QfpvxFsMORwKpvnLslkHCr3NTCczHAvkte6+pQGsiUZXKBe6mO4TTb727b+9KMVSK6XZqhR6ZwImKdP+F5vS6A== dependencies: - "@wdio/logger" "^8.11.0" + "@wdio/logger" "^8.24.12" decamelize "^6.0.0" http-proxy-agent "^7.0.0" - https-proxy-agent "^7.0.1" - node-fetch "^3.3.1" + https-proxy-agent "^7.0.2" + node-fetch "^3.3.2" tar-fs "^3.0.4" unzipper "^0.10.14" which "^4.0.0" @@ -18734,10 +18746,10 @@ ignore@^4.0.3: resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc" integrity sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg== -ignore@^5.0.5, ignore@^5.1.1, ignore@^5.1.4, ignore@^5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.2.0.tgz#6d3bac8fa7fe0d45d9f9be7bac2fc279577e345a" - integrity sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ== +ignore@^5.0.5, ignore@^5.1.1, ignore@^5.1.4, ignore@^5.2.0, ignore@^5.3.0: + version "5.3.0" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.3.0.tgz#67418ae40d34d6999c95ff56016759c718c82f78" + integrity sha512-g7dmpshy+gD7mh88OC9NwSGTKoc3kyLAZQRU1mt53Aw/vnvfXnbC+F/7F7QoYVKbV+KNvJx8wArewKy1vXMtlg== immediate@~3.0.5: version "3.0.6" @@ -22941,10 +22953,10 @@ node-fetch@^1.0.1, node-fetch@^2.6.1, node-fetch@^2.6.12, node-fetch@^2.6.7: dependencies: whatwg-url "^5.0.0" -node-fetch@^3.3.1: - version "3.3.1" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-3.3.1.tgz#b3eea7b54b3a48020e46f4f88b9c5a7430d20b2e" - integrity sha512-cRVc/kyto/7E5shrWca1Wsea4y6tL9iYJE5FBCius3JQfb/4P4I295PfhgbJQBLTx6lATE4z+wK0rPM4VS2uow== +node-fetch@^3.3.2: + version "3.3.2" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-3.3.2.tgz#d1e889bacdf733b4ff3b2b243eb7a12866a0b78b" + integrity sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA== dependencies: data-uri-to-buffer "^4.0.0" fetch-blob "^3.1.4" @@ -27108,10 +27120,10 @@ select-hose@^2.0.0: resolved "https://registry.yarnpkg.com/select-hose/-/select-hose-2.0.0.tgz#625d8658f865af43ec962bfc376a37359a4994ca" integrity sha1-Yl2GWPhlr0Psliv8N2o3NZpJlMo= -selenium-webdriver@^4.15.0: - version "4.15.0" - resolved "https://registry.yarnpkg.com/selenium-webdriver/-/selenium-webdriver-4.15.0.tgz#ee827f8993864dc0821df0d3b46d4f312d6f1aa3" - integrity sha512-BNG1bq+KWiBGHcJ/wULi0eKY0yaDqFIbEmtbsYJmfaEghdCkXBsx1akgOorhNwjBipOr0uwpvNXqT6/nzl+zjg== +selenium-webdriver@^4.16.0: + version "4.16.0" + resolved "https://registry.yarnpkg.com/selenium-webdriver/-/selenium-webdriver-4.16.0.tgz#2f1a2426d876aa389d1c937b00f034c2c7808360" + integrity sha512-IbqpRpfGE7JDGgXHJeWuCqT/tUqnLvZ14csSwt+S8o4nJo3RtQoE9VR4jB47tP/A8ArkYsh/THuMY6kyRP6kuA== dependencies: jszip "^3.10.1" tmp "^0.2.1" @@ -28850,13 +28862,13 @@ terser@^4.1.2, terser@^4.6.3: source-map "~0.6.1" source-map-support "~0.5.12" -terser@^5.14.1, terser@^5.16.5, terser@^5.3.4, terser@^5.9.0: - version "5.16.5" - resolved "https://registry.yarnpkg.com/terser/-/terser-5.16.5.tgz#1c285ca0655f467f92af1bbab46ab72d1cb08e5a" - integrity sha512-qcwfg4+RZa3YvlFh0qjifnzBHjKGNbtDo9yivMqMFDy9Q6FSaQWSB/j1xKhsoUFJIqDOM3TsN6D5xbrMrFcHbg== +terser@^5.14.1, terser@^5.26.0, terser@^5.3.4, terser@^5.9.0: + version "5.26.0" + resolved "https://registry.yarnpkg.com/terser/-/terser-5.26.0.tgz#ee9f05d929f4189a9c28a0feb889d96d50126fe1" + integrity sha512-dytTGoE2oHgbNV9nTzgBEPaqAWvcJNl66VZ0BkJqlvp71IjO8CxdBx/ykCNb47cLnCmCvRZ6ZR0tLkqvZCdVBQ== dependencies: - "@jridgewell/source-map" "^0.3.2" - acorn "^8.5.0" + "@jridgewell/source-map" "^0.3.3" + acorn "^8.8.2" commander "^2.20.0" source-map-support "~0.5.20"