diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index b071e06f1bc54e..0cf5fc4e0dfd0f 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -24,6 +24,7 @@ /src/plugins/vis_type_vega/ @elastic/kibana-app /src/plugins/vis_type_vislib/ @elastic/kibana-app /src/plugins/vis_type_xy/ @elastic/kibana-app +/src/plugins/vis_type_pie/ @elastic/kibana-app /src/plugins/visualize/ @elastic/kibana-app /src/plugins/visualizations/ @elastic/kibana-app /packages/kbn-tinymath/ @elastic/kibana-app @@ -54,6 +55,7 @@ /src/plugins/share/ @elastic/kibana-app-services /src/plugins/ui_actions/ @elastic/kibana-app-services /src/plugins/index_pattern_field_editor @elastic/kibana-app-services +/src/plugins/screenshot_mode @elastic/kibana-app-services /x-pack/examples/ui_actions_enhanced_examples/ @elastic/kibana-app-services /x-pack/plugins/data_enhanced/ @elastic/kibana-app-services /x-pack/plugins/embeddable_enhanced/ @elastic/kibana-app-services @@ -87,7 +89,7 @@ # Client Side Monitoring / Uptime (lives in APM directories but owned by Uptime) /x-pack/plugins/apm/e2e/cypress/support/step_definitions/csm @elastic/uptime /x-pack/plugins/apm/e2e/cypress/integration/csm_dashboard.feature @elastic/uptime -/x-pack/plugins/apm/public/application/csmApp.tsx @elastic/uptime +/x-pack/plugins/apm/public/application/uxApp.tsx @elastic/uptime /x-pack/plugins/apm/public/components/app/RumDashboard @elastic/uptime /x-pack/plugins/apm/server/lib/rum_client @elastic/uptime /x-pack/plugins/apm/server/routes/rum_client.ts @elastic/uptime @@ -126,7 +128,7 @@ /x-pack/test/functional_basic/apps/ml/ @elastic/ml-ui /x-pack/test/functional_with_es_ssl/apps/ml/ @elastic/ml-ui -# ML team owns and maintains the transform plugin despite it living in the Elasticsearch management section. +# ML team owns and maintains the transform plugin despite it living in the Data management section. /x-pack/plugins/transform/ @elastic/ml-ui /x-pack/test/accessibility/apps/transform.ts @elastic/ml-ui /x-pack/test/api_integration/apis/transform/ @elastic/ml-ui @@ -303,29 +305,29 @@ /x-pack/plugins/enterprise_search/server/collectors/workplace_search/ @elastic/workplace-search-frontend /x-pack/plugins/enterprise_search/server/saved_objects/workplace_search/ @elastic/workplace-search-frontend -# Elasticsearch UI -/src/plugins/dev_tools/ @elastic/es-ui -/src/plugins/console/ @elastic/es-ui -/src/plugins/es_ui_shared/ @elastic/es-ui -/x-pack/plugins/cross_cluster_replication/ @elastic/es-ui -/x-pack/plugins/index_lifecycle_management/ @elastic/es-ui -/x-pack/plugins/console_extensions/ @elastic/es-ui -/x-pack/plugins/grokdebugger/ @elastic/es-ui -/x-pack/plugins/index_management/ @elastic/es-ui -/x-pack/plugins/license_api_guard/ @elastic/es-ui -/x-pack/plugins/license_management/ @elastic/es-ui -/x-pack/plugins/painless_lab/ @elastic/es-ui -/x-pack/plugins/remote_clusters/ @elastic/es-ui -/x-pack/plugins/rollup/ @elastic/es-ui -/x-pack/plugins/searchprofiler/ @elastic/es-ui -/x-pack/plugins/snapshot_restore/ @elastic/es-ui -/x-pack/plugins/upgrade_assistant/ @elastic/es-ui -/x-pack/plugins/watcher/ @elastic/es-ui -/x-pack/plugins/ingest_pipelines/ @elastic/es-ui -/packages/kbn-ace/ @elastic/es-ui -/packages/kbn-monaco/ @elastic/es-ui -#CC# /x-pack/plugins/console_extensions/ @elastic/es-ui -#CC# /x-pack/plugins/cross_cluster_replication/ @elastic/es-ui +# Stack Management +/src/plugins/dev_tools/ @elastic/kibana-stack-management +/src/plugins/console/ @elastic/kibana-stack-management +/src/plugins/es_ui_shared/ @elastic/kibana-stack-management +/x-pack/plugins/cross_cluster_replication/ @elastic/kibana-stack-management +/x-pack/plugins/index_lifecycle_management/ @elastic/kibana-stack-management +/x-pack/plugins/console_extensions/ @elastic/kibana-stack-management +/x-pack/plugins/grokdebugger/ @elastic/kibana-stack-management +/x-pack/plugins/index_management/ @elastic/kibana-stack-management +/x-pack/plugins/license_api_guard/ @elastic/kibana-stack-management +/x-pack/plugins/license_management/ @elastic/kibana-stack-management +/x-pack/plugins/painless_lab/ @elastic/kibana-stack-management +/x-pack/plugins/remote_clusters/ @elastic/kibana-stack-management +/x-pack/plugins/rollup/ @elastic/kibana-stack-management +/x-pack/plugins/searchprofiler/ @elastic/kibana-stack-management +/x-pack/plugins/snapshot_restore/ @elastic/kibana-stack-management +/x-pack/plugins/upgrade_assistant/ @elastic/kibana-stack-management +/x-pack/plugins/watcher/ @elastic/kibana-stack-management +/x-pack/plugins/ingest_pipelines/ @elastic/kibana-stack-management +/packages/kbn-ace/ @elastic/kibana-stack-management +/packages/kbn-monaco/ @elastic/kibana-stack-management +#CC# /x-pack/plugins/console_extensions/ @elastic/kibana-stack-management +#CC# /x-pack/plugins/cross_cluster_replication/ @elastic/kibana-stack-management # Security Solution /x-pack/test/endpoint_api_integration_no_ingest/ @elastic/security-solution diff --git a/.gitignore b/.gitignore index f9855520cb1103..d5a51049540787 100644 --- a/.gitignore +++ b/.gitignore @@ -63,7 +63,7 @@ npm-debug.log* .vagrant ## @cypress/snapshot from apm plugin -snapshots.js +/snapshots.js # release notes script output report.csv diff --git a/.i18nrc.json b/.i18nrc.json index 57dffa4147e525..ad91042a2172de 100644 --- a/.i18nrc.json +++ b/.i18nrc.json @@ -56,6 +56,7 @@ "visTypeVega": "src/plugins/vis_type_vega", "visTypeVislib": "src/plugins/vis_type_vislib", "visTypeXy": "src/plugins/vis_type_xy", + "visTypePie": "src/plugins/vis_type_pie", "visualizations": "src/plugins/visualizations", "visualize": "src/plugins/visualize", "apmOss": "src/plugins/apm_oss", diff --git a/WORKSPACE.bazel b/WORKSPACE.bazel index d80ad948cbb553..acb62043a15ca7 100644 --- a/WORKSPACE.bazel +++ b/WORKSPACE.bazel @@ -10,15 +10,15 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # Fetch Node.js rules http_archive( name = "build_bazel_rules_nodejs", - sha256 = "10f534e1c80f795cffe1f2822becd4897754d18564612510c59b3c73544ae7c6", - urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/3.5.0/rules_nodejs-3.5.0.tar.gz"], + sha256 = "4a5d654a4ccd4a4c24eca5d319d85a88a650edf119601550c95bf400c8cc897e", + urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/3.5.1/rules_nodejs-3.5.1.tar.gz"], ) # Now that we have the rules let's import from them to complete the work load("@build_bazel_rules_nodejs//:index.bzl", "check_rules_nodejs_version", "node_repositories", "yarn_install") # Assure we have at least a given rules_nodejs version -check_rules_nodejs_version(minimum_version_string = "3.5.0") +check_rules_nodejs_version(minimum_version_string = "3.5.1") # Setup the Node.js toolchain for the architectures we want to support # diff --git a/api_docs/actions.json b/api_docs/actions.json index 8bd644be376d76..d7c5e63434c078 100644 --- a/api_docs/actions.json +++ b/api_docs/actions.json @@ -1054,7 +1054,7 @@ ], "source": { "path": "x-pack/plugins/actions/server/builtin_action_types/pagerduty.ts", - "lineNumber": 121 + "lineNumber": 129 }, "deprecated": false, "initialIsOpen": false diff --git a/api_docs/apm.json b/api_docs/apm.json index 7eee0349fa349e..84f5a87f404ae9 100644 --- a/api_docs/apm.json +++ b/api_docs/apm.json @@ -78,7 +78,7 @@ ], "source": { "path": "x-pack/plugins/apm/public/plugin.ts", - "lineNumber": 45 + "lineNumber": 47 }, "deprecated": false, "lifecycle": "setup", @@ -96,7 +96,7 @@ ], "source": { "path": "x-pack/plugins/apm/public/plugin.ts", - "lineNumber": 47 + "lineNumber": 49 }, "deprecated": false, "lifecycle": "start", @@ -144,7 +144,7 @@ ], "source": { "path": "x-pack/plugins/apm/server/plugin.ts", - "lineNumber": 55 + "lineNumber": 54 }, "deprecated": false, "children": [ @@ -160,7 +160,7 @@ ], "source": { "path": "x-pack/plugins/apm/server/plugin.ts", - "lineNumber": 65 + "lineNumber": 64 }, "deprecated": false, "children": [ @@ -183,7 +183,7 @@ ], "source": { "path": "x-pack/plugins/apm/server/plugin.ts", - "lineNumber": 65 + "lineNumber": 64 }, "deprecated": false, "isRequired": true @@ -237,7 +237,7 @@ ], "source": { "path": "x-pack/plugins/apm/server/plugin.ts", - "lineNumber": 69 + "lineNumber": 68 }, "deprecated": false, "children": [ @@ -262,7 +262,7 @@ ], "source": { "path": "x-pack/plugins/apm/server/plugin.ts", - "lineNumber": 70 + "lineNumber": 69 }, "deprecated": false, "isRequired": true @@ -281,7 +281,7 @@ ], "source": { "path": "x-pack/plugins/apm/server/plugin.ts", - "lineNumber": 71 + "lineNumber": 70 }, "deprecated": false, "isRequired": true @@ -309,7 +309,7 @@ ], "source": { "path": "x-pack/plugins/apm/server/plugin.ts", - "lineNumber": 269 + "lineNumber": 260 }, "deprecated": false, "children": [ @@ -331,7 +331,7 @@ ], "source": { "path": "x-pack/plugins/apm/server/plugin.ts", - "lineNumber": 269 + "lineNumber": 260 }, "deprecated": false, "isRequired": true @@ -351,7 +351,7 @@ ], "source": { "path": "x-pack/plugins/apm/server/plugin.ts", - "lineNumber": 288 + "lineNumber": 279 }, "deprecated": false, "children": [], diff --git a/api_docs/apm_oss.json b/api_docs/apm_oss.json index 75cb60610335b5..c09f772ea0a553 100644 --- a/api_docs/apm_oss.json +++ b/api_docs/apm_oss.json @@ -5,606 +5,15 @@ "functions": [], "interfaces": [], "enums": [], - "misc": [ - { - "parentPluginId": "apmOss", - "id": "def-public.APM_STATIC_INDEX_PATTERN_ID", - "type": "string", - "tags": [], - "label": "APM_STATIC_INDEX_PATTERN_ID", - "description": [], - "signature": [ - "\"apm_static_index_pattern_id\"" - ], - "source": { - "path": "src/plugins/apm_oss/common/index_pattern_constants.ts", - "lineNumber": 9 - }, - "deprecated": false, - "initialIsOpen": false - } - ], - "objects": [], - "setup": { - "parentPluginId": "apmOss", - "id": "def-public.ApmOssPluginSetup", - "type": "Interface", - "tags": [], - "label": "ApmOssPluginSetup", - "description": [], - "source": { - "path": "src/plugins/apm_oss/public/types.ts", - "lineNumber": 10 - }, - "deprecated": false, - "children": [], - "lifecycle": "setup", - "initialIsOpen": true - }, - "start": { - "parentPluginId": "apmOss", - "id": "def-public.ApmOssPluginStart", - "type": "Interface", - "tags": [], - "label": "ApmOssPluginStart", - "description": [], - "source": { - "path": "src/plugins/apm_oss/public/types.ts", - "lineNumber": 13 - }, - "deprecated": false, - "children": [], - "lifecycle": "start", - "initialIsOpen": true - } + "misc": [], + "objects": [] }, "server": { "classes": [], - "functions": [ - { - "parentPluginId": "apmOss", - "id": "def-server.createDjangoAgentInstructions", - "type": "Function", - "tags": [], - "label": "createDjangoAgentInstructions", - "description": [], - "signature": [ - "(apmServerUrl?: string, secretToken?: string) => ({ title: string; textPre: string; commands: string[]; textPost?: undefined; } | { title: string; textPre: string; commands: string[]; textPost: string; })[]" - ], - "source": { - "path": "src/plugins/apm_oss/server/tutorial/instructions/apm_agent_instructions.ts", - "lineNumber": 88 - }, - "deprecated": false, - "children": [ - { - "parentPluginId": "apmOss", - "id": "def-server.createDjangoAgentInstructions.$1", - "type": "string", - "tags": [], - "label": "apmServerUrl", - "description": [], - "signature": [ - "string" - ], - "source": { - "path": "src/plugins/apm_oss/server/tutorial/instructions/apm_agent_instructions.ts", - "lineNumber": 88 - }, - "deprecated": false, - "isRequired": true - }, - { - "parentPluginId": "apmOss", - "id": "def-server.createDjangoAgentInstructions.$2", - "type": "string", - "tags": [], - "label": "secretToken", - "description": [], - "signature": [ - "string" - ], - "source": { - "path": "src/plugins/apm_oss/server/tutorial/instructions/apm_agent_instructions.ts", - "lineNumber": 88 - }, - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [], - "initialIsOpen": false - }, - { - "parentPluginId": "apmOss", - "id": "def-server.createDotNetAgentInstructions", - "type": "Function", - "tags": [], - "label": "createDotNetAgentInstructions", - "description": [], - "signature": [ - "(apmServerUrl?: string, secretToken?: string) => ({ title: string; textPre: string; commands?: undefined; textPost?: undefined; } | { title: string; textPre: string; commands: string[]; textPost: string; } | { title: string; commands: string[]; textPost: string; textPre?: undefined; })[]" - ], - "source": { - "path": "src/plugins/apm_oss/server/tutorial/instructions/apm_agent_instructions.ts", - "lineNumber": 631 - }, - "deprecated": false, - "children": [ - { - "parentPluginId": "apmOss", - "id": "def-server.createDotNetAgentInstructions.$1", - "type": "string", - "tags": [], - "label": "apmServerUrl", - "description": [], - "signature": [ - "string" - ], - "source": { - "path": "src/plugins/apm_oss/server/tutorial/instructions/apm_agent_instructions.ts", - "lineNumber": 631 - }, - "deprecated": false, - "isRequired": true - }, - { - "parentPluginId": "apmOss", - "id": "def-server.createDotNetAgentInstructions.$2", - "type": "string", - "tags": [], - "label": "secretToken", - "description": [], - "signature": [ - "string" - ], - "source": { - "path": "src/plugins/apm_oss/server/tutorial/instructions/apm_agent_instructions.ts", - "lineNumber": 631 - }, - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [], - "initialIsOpen": false - }, - { - "parentPluginId": "apmOss", - "id": "def-server.createFlaskAgentInstructions", - "type": "Function", - "tags": [], - "label": "createFlaskAgentInstructions", - "description": [], - "signature": [ - "(apmServerUrl?: string, secretToken?: string) => ({ title: string; textPre: string; commands: string[]; textPost?: undefined; } | { title: string; textPre: string; commands: string[]; textPost: string; })[]" - ], - "source": { - "path": "src/plugins/apm_oss/server/tutorial/instructions/apm_agent_instructions.ts", - "lineNumber": 173 - }, - "deprecated": false, - "children": [ - { - "parentPluginId": "apmOss", - "id": "def-server.createFlaskAgentInstructions.$1", - "type": "string", - "tags": [], - "label": "apmServerUrl", - "description": [], - "signature": [ - "string" - ], - "source": { - "path": "src/plugins/apm_oss/server/tutorial/instructions/apm_agent_instructions.ts", - "lineNumber": 173 - }, - "deprecated": false, - "isRequired": true - }, - { - "parentPluginId": "apmOss", - "id": "def-server.createFlaskAgentInstructions.$2", - "type": "string", - "tags": [], - "label": "secretToken", - "description": [], - "signature": [ - "string" - ], - "source": { - "path": "src/plugins/apm_oss/server/tutorial/instructions/apm_agent_instructions.ts", - "lineNumber": 173 - }, - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [], - "initialIsOpen": false - }, - { - "parentPluginId": "apmOss", - "id": "def-server.createGoAgentInstructions", - "type": "Function", - "tags": [], - "label": "createGoAgentInstructions", - "description": [], - "signature": [ - "(apmServerUrl?: string, secretToken?: string) => ({ title: string; textPre: string; commands: string[]; textPost?: undefined; } | { title: string; textPre: string; commands: string[]; textPost: string; })[]" - ], - "source": { - "path": "src/plugins/apm_oss/server/tutorial/instructions/apm_agent_instructions.ts", - "lineNumber": 492 - }, - "deprecated": false, - "children": [ - { - "parentPluginId": "apmOss", - "id": "def-server.createGoAgentInstructions.$1", - "type": "string", - "tags": [], - "label": "apmServerUrl", - "description": [], - "signature": [ - "string" - ], - "source": { - "path": "src/plugins/apm_oss/server/tutorial/instructions/apm_agent_instructions.ts", - "lineNumber": 492 - }, - "deprecated": false, - "isRequired": true - }, - { - "parentPluginId": "apmOss", - "id": "def-server.createGoAgentInstructions.$2", - "type": "string", - "tags": [], - "label": "secretToken", - "description": [], - "signature": [ - "string" - ], - "source": { - "path": "src/plugins/apm_oss/server/tutorial/instructions/apm_agent_instructions.ts", - "lineNumber": 492 - }, - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [], - "initialIsOpen": false - }, - { - "parentPluginId": "apmOss", - "id": "def-server.createJavaAgentInstructions", - "type": "Function", - "tags": [], - "label": "createJavaAgentInstructions", - "description": [], - "signature": [ - "(apmServerUrl?: string, secretToken?: string) => ({ title: string; textPre: string; commands?: undefined; textPost?: undefined; } | { title: string; textPre: string; commands: string[]; textPost: string; })[]" - ], - "source": { - "path": "src/plugins/apm_oss/server/tutorial/instructions/apm_agent_instructions.ts", - "lineNumber": 585 - }, - "deprecated": false, - "children": [ - { - "parentPluginId": "apmOss", - "id": "def-server.createJavaAgentInstructions.$1", - "type": "string", - "tags": [], - "label": "apmServerUrl", - "description": [], - "signature": [ - "string" - ], - "source": { - "path": "src/plugins/apm_oss/server/tutorial/instructions/apm_agent_instructions.ts", - "lineNumber": 585 - }, - "deprecated": false, - "isRequired": true - }, - { - "parentPluginId": "apmOss", - "id": "def-server.createJavaAgentInstructions.$2", - "type": "string", - "tags": [], - "label": "secretToken", - "description": [], - "signature": [ - "string" - ], - "source": { - "path": "src/plugins/apm_oss/server/tutorial/instructions/apm_agent_instructions.ts", - "lineNumber": 585 - }, - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [], - "initialIsOpen": false - }, - { - "parentPluginId": "apmOss", - "id": "def-server.createJsAgentInstructions", - "type": "Function", - "tags": [], - "label": "createJsAgentInstructions", - "description": [], - "signature": [ - "(apmServerUrl?: string) => ({ title: string; textPre: string; commands?: undefined; textPost?: undefined; } | { title: string; textPre: string; commands: string[]; textPost: string; } | { title: string; textPre: string; commands: string[]; textPost?: undefined; })[]" - ], - "source": { - "path": "src/plugins/apm_oss/server/tutorial/instructions/apm_agent_instructions.ts", - "lineNumber": 393 - }, - "deprecated": false, - "children": [ - { - "parentPluginId": "apmOss", - "id": "def-server.createJsAgentInstructions.$1", - "type": "string", - "tags": [], - "label": "apmServerUrl", - "description": [], - "signature": [ - "string" - ], - "source": { - "path": "src/plugins/apm_oss/server/tutorial/instructions/apm_agent_instructions.ts", - "lineNumber": 393 - }, - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [], - "initialIsOpen": false - }, - { - "parentPluginId": "apmOss", - "id": "def-server.createNodeAgentInstructions", - "type": "Function", - "tags": [], - "label": "createNodeAgentInstructions", - "description": [], - "signature": [ - "(apmServerUrl?: string, secretToken?: string) => ({ title: string; textPre: string; commands: string[]; textPost?: undefined; } | { title: string; textPre: string; commands: string[]; textPost: string; })[]" - ], - "source": { - "path": "src/plugins/apm_oss/server/tutorial/instructions/apm_agent_instructions.ts", - "lineNumber": 11 - }, - "deprecated": false, - "children": [ - { - "parentPluginId": "apmOss", - "id": "def-server.createNodeAgentInstructions.$1", - "type": "string", - "tags": [], - "label": "apmServerUrl", - "description": [], - "signature": [ - "string" - ], - "source": { - "path": "src/plugins/apm_oss/server/tutorial/instructions/apm_agent_instructions.ts", - "lineNumber": 11 - }, - "deprecated": false, - "isRequired": true - }, - { - "parentPluginId": "apmOss", - "id": "def-server.createNodeAgentInstructions.$2", - "type": "string", - "tags": [], - "label": "secretToken", - "description": [], - "signature": [ - "string" - ], - "source": { - "path": "src/plugins/apm_oss/server/tutorial/instructions/apm_agent_instructions.ts", - "lineNumber": 11 - }, - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [], - "initialIsOpen": false - }, - { - "parentPluginId": "apmOss", - "id": "def-server.createPhpAgentInstructions", - "type": "Function", - "tags": [], - "label": "createPhpAgentInstructions", - "description": [], - "signature": [ - "(apmServerUrl?: string, secretToken?: string) => ({ title: string; textPre: string; commands?: undefined; textPost?: undefined; } | { title: string; textPre: string; commands: string[]; textPost: string; })[]" - ], - "source": { - "path": "src/plugins/apm_oss/server/tutorial/instructions/apm_agent_instructions.ts", - "lineNumber": 705 - }, - "deprecated": false, - "children": [ - { - "parentPluginId": "apmOss", - "id": "def-server.createPhpAgentInstructions.$1", - "type": "string", - "tags": [], - "label": "apmServerUrl", - "description": [], - "signature": [ - "string" - ], - "source": { - "path": "src/plugins/apm_oss/server/tutorial/instructions/apm_agent_instructions.ts", - "lineNumber": 705 - }, - "deprecated": false, - "isRequired": true - }, - { - "parentPluginId": "apmOss", - "id": "def-server.createPhpAgentInstructions.$2", - "type": "string", - "tags": [], - "label": "secretToken", - "description": [], - "signature": [ - "string" - ], - "source": { - "path": "src/plugins/apm_oss/server/tutorial/instructions/apm_agent_instructions.ts", - "lineNumber": 705 - }, - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [], - "initialIsOpen": false - }, - { - "parentPluginId": "apmOss", - "id": "def-server.createRackAgentInstructions", - "type": "Function", - "tags": [], - "label": "createRackAgentInstructions", - "description": [], - "signature": [ - "(apmServerUrl?: string, secretToken?: string) => ({ title: string; textPre: string; commands: string[]; textPost?: undefined; } | { title: string; textPre: string; commands: string[]; textPost: string; })[]" - ], - "source": { - "path": "src/plugins/apm_oss/server/tutorial/instructions/apm_agent_instructions.ts", - "lineNumber": 298 - }, - "deprecated": false, - "children": [ - { - "parentPluginId": "apmOss", - "id": "def-server.createRackAgentInstructions.$1", - "type": "string", - "tags": [], - "label": "apmServerUrl", - "description": [], - "signature": [ - "string" - ], - "source": { - "path": "src/plugins/apm_oss/server/tutorial/instructions/apm_agent_instructions.ts", - "lineNumber": 298 - }, - "deprecated": false, - "isRequired": true - }, - { - "parentPluginId": "apmOss", - "id": "def-server.createRackAgentInstructions.$2", - "type": "string", - "tags": [], - "label": "secretToken", - "description": [], - "signature": [ - "string" - ], - "source": { - "path": "src/plugins/apm_oss/server/tutorial/instructions/apm_agent_instructions.ts", - "lineNumber": 298 - }, - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [], - "initialIsOpen": false - }, - { - "parentPluginId": "apmOss", - "id": "def-server.createRailsAgentInstructions", - "type": "Function", - "tags": [], - "label": "createRailsAgentInstructions", - "description": [], - "signature": [ - "(apmServerUrl?: string, secretToken?: string) => ({ title: string; textPre: string; commands: string[]; textPost?: undefined; } | { title: string; textPre: string; commands: string[]; textPost: string; })[]" - ], - "source": { - "path": "src/plugins/apm_oss/server/tutorial/instructions/apm_agent_instructions.ts", - "lineNumber": 255 - }, - "deprecated": false, - "children": [ - { - "parentPluginId": "apmOss", - "id": "def-server.createRailsAgentInstructions.$1", - "type": "string", - "tags": [], - "label": "apmServerUrl", - "description": [], - "signature": [ - "string" - ], - "source": { - "path": "src/plugins/apm_oss/server/tutorial/instructions/apm_agent_instructions.ts", - "lineNumber": 255 - }, - "deprecated": false, - "isRequired": true - }, - { - "parentPluginId": "apmOss", - "id": "def-server.createRailsAgentInstructions.$2", - "type": "string", - "tags": [], - "label": "secretToken", - "description": [], - "signature": [ - "string" - ], - "source": { - "path": "src/plugins/apm_oss/server/tutorial/instructions/apm_agent_instructions.ts", - "lineNumber": 255 - }, - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [], - "initialIsOpen": false - } - ], + "functions": [], "interfaces": [], "enums": [], "misc": [ - { - "parentPluginId": "apmOss", - "id": "def-server.APM_STATIC_INDEX_PATTERN_ID", - "type": "string", - "tags": [], - "label": "APM_STATIC_INDEX_PATTERN_ID", - "description": [], - "signature": [ - "\"apm_static_index_pattern_id\"" - ], - "source": { - "path": "src/plugins/apm_oss/common/index_pattern_constants.ts", - "lineNumber": 9 - }, - "deprecated": false, - "initialIsOpen": false - }, { "parentPluginId": "apmOss", "id": "def-server.APMOSSConfig", @@ -617,7 +26,7 @@ ], "source": { "path": "src/plugins/apm_oss/server/index.ts", - "lineNumber": 32 + "lineNumber": 31 }, "deprecated": false, "initialIsOpen": false @@ -633,7 +42,7 @@ "description": [], "source": { "path": "src/plugins/apm_oss/server/plugin.ts", - "lineNumber": 47 + "lineNumber": 27 }, "deprecated": false, "children": [ @@ -649,7 +58,7 @@ ], "source": { "path": "src/plugins/apm_oss/server/plugin.ts", - "lineNumber": 48 + "lineNumber": 28 }, "deprecated": false }, @@ -666,34 +75,9 @@ ], "source": { "path": "src/plugins/apm_oss/server/plugin.ts", - "lineNumber": 49 + "lineNumber": 29 }, "deprecated": false - }, - { - "parentPluginId": "apmOss", - "id": "def-server.APMOSSPluginSetup.getRegisteredTutorialProvider", - "type": "Function", - "tags": [], - "label": "getRegisteredTutorialProvider", - "description": [], - "signature": [ - "() => ", - { - "pluginId": "home", - "scope": "server", - "docId": "kibHomePluginApi", - "section": "def-server.TutorialProvider", - "text": "TutorialProvider" - } - ], - "source": { - "path": "src/plugins/apm_oss/server/plugin.ts", - "lineNumber": 50 - }, - "deprecated": false, - "children": [], - "returnComment": [] } ], "lifecycle": "setup", diff --git a/api_docs/apm_oss.mdx b/api_docs/apm_oss.mdx index c4facc4e390b65..73707040013788 100644 --- a/api_docs/apm_oss.mdx +++ b/api_docs/apm_oss.mdx @@ -11,25 +11,11 @@ warning: This document is auto-generated and is meant to be viewed inside our ex import apmOssObj from './apm_oss.json'; -## Client - -### Setup - - -### Start - - -### Consts, variables and types - - ## Server ### Setup -### Functions - - ### Consts, variables and types diff --git a/api_docs/bfetch.json b/api_docs/bfetch.json index 76b2118282b2e5..ce294077f9499c 100644 --- a/api_docs/bfetch.json +++ b/api_docs/bfetch.json @@ -78,7 +78,7 @@ "description": [], "source": { "path": "src/plugins/bfetch/public/plugin.ts", - "lineNumber": 24 + "lineNumber": 23 }, "deprecated": false, "children": [ @@ -98,7 +98,7 @@ ], "source": { "path": "src/plugins/bfetch/public/plugin.ts", - "lineNumber": 25 + "lineNumber": 24 }, "deprecated": false, "returnComment": [], @@ -115,7 +115,7 @@ ], "source": { "path": "src/plugins/bfetch/public/plugin.ts", - "lineNumber": 25 + "lineNumber": 24 }, "deprecated": false } @@ -143,7 +143,7 @@ ], "source": { "path": "src/plugins/bfetch/public/plugin.ts", - "lineNumber": 26 + "lineNumber": 25 }, "deprecated": false, "returnComment": [], @@ -161,7 +161,7 @@ ], "source": { "path": "src/plugins/bfetch/public/plugin.ts", - "lineNumber": 27 + "lineNumber": 26 }, "deprecated": false } @@ -195,7 +195,7 @@ ], "source": { "path": "src/plugins/bfetch/server/plugin.ts", - "lineNumber": 39 + "lineNumber": 41 }, "deprecated": false, "children": [ @@ -211,7 +211,7 @@ ], "source": { "path": "src/plugins/bfetch/server/plugin.ts", - "lineNumber": 40 + "lineNumber": 42 }, "deprecated": false, "returnComment": [], @@ -228,7 +228,7 @@ ], "source": { "path": "src/plugins/bfetch/server/plugin.ts", - "lineNumber": 40 + "lineNumber": 42 }, "deprecated": false } @@ -290,7 +290,7 @@ "description": [], "source": { "path": "src/plugins/bfetch/server/plugin.ts", - "lineNumber": 44 + "lineNumber": 46 }, "deprecated": false, "children": [ @@ -322,7 +322,7 @@ ], "source": { "path": "src/plugins/bfetch/server/plugin.ts", - "lineNumber": 45 + "lineNumber": 47 }, "deprecated": false, "returnComment": [], @@ -336,7 +336,7 @@ "description": [], "source": { "path": "src/plugins/bfetch/server/plugin.ts", - "lineNumber": 46 + "lineNumber": 48 }, "deprecated": false }, @@ -368,7 +368,7 @@ ], "source": { "path": "src/plugins/bfetch/server/plugin.ts", - "lineNumber": 47 + "lineNumber": 49 }, "deprecated": false } @@ -402,7 +402,7 @@ ], "source": { "path": "src/plugins/bfetch/server/plugin.ts", - "lineNumber": 49 + "lineNumber": 51 }, "deprecated": false, "returnComment": [], @@ -416,7 +416,7 @@ "description": [], "source": { "path": "src/plugins/bfetch/server/plugin.ts", - "lineNumber": 50 + "lineNumber": 52 }, "deprecated": false }, @@ -448,7 +448,7 @@ ], "source": { "path": "src/plugins/bfetch/server/plugin.ts", - "lineNumber": 51 + "lineNumber": 53 }, "deprecated": false } @@ -682,7 +682,7 @@ ], "source": { "path": "src/plugins/bfetch/server/plugin.ts", - "lineNumber": 81 + "lineNumber": 83 }, "deprecated": false, "returnComment": [], @@ -719,7 +719,7 @@ ], "source": { "path": "src/plugins/bfetch/server/plugin.ts", - "lineNumber": 89 + "lineNumber": 91 }, "deprecated": false } @@ -738,7 +738,7 @@ "description": [], "source": { "path": "src/plugins/bfetch/server/plugin.ts", - "lineNumber": 94 + "lineNumber": 96 }, "deprecated": false, "children": [], @@ -1343,6 +1343,48 @@ ], "initialIsOpen": false }, + { + "parentPluginId": "bfetch", + "id": "def-common.BatchItemWrapper", + "type": "Interface", + "tags": [], + "label": "BatchItemWrapper", + "description": [], + "source": { + "path": "src/plugins/bfetch/common/batch.ts", + "lineNumber": 23 + }, + "deprecated": false, + "children": [ + { + "parentPluginId": "bfetch", + "id": "def-common.BatchItemWrapper.compressed", + "type": "boolean", + "tags": [], + "label": "compressed", + "description": [], + "source": { + "path": "src/plugins/bfetch/common/batch.ts", + "lineNumber": 24 + }, + "deprecated": false + }, + { + "parentPluginId": "bfetch", + "id": "def-common.BatchItemWrapper.payload", + "type": "string", + "tags": [], + "label": "payload", + "description": [], + "source": { + "path": "src/plugins/bfetch/common/batch.ts", + "lineNumber": 25 + }, + "deprecated": false + } + ], + "initialIsOpen": false + }, { "parentPluginId": "bfetch", "id": "def-common.BatchRequestData", @@ -1684,7 +1726,25 @@ } ], "enums": [], - "misc": [], + "misc": [ + { + "parentPluginId": "bfetch", + "id": "def-common.DISABLE_BFETCH_COMPRESSION", + "type": "string", + "tags": [], + "label": "DISABLE_BFETCH_COMPRESSION", + "description": [], + "signature": [ + "\"bfetch:disableCompression\"" + ], + "source": { + "path": "src/plugins/bfetch/common/constants.ts", + "lineNumber": 9 + }, + "deprecated": false, + "initialIsOpen": false + } + ], "objects": [] } } \ No newline at end of file diff --git a/api_docs/bfetch.mdx b/api_docs/bfetch.mdx index 0e9a9e79dbea60..faf3d7eefc7f9f 100644 --- a/api_docs/bfetch.mdx +++ b/api_docs/bfetch.mdx @@ -47,3 +47,6 @@ import bfetchObj from './bfetch.json'; ### Interfaces +### Consts, variables and types + + diff --git a/api_docs/cases.json b/api_docs/cases.json index 3d77ada0c336b4..2df1b04871273c 100644 --- a/api_docs/cases.json +++ b/api_docs/cases.json @@ -294,6 +294,38 @@ ], "functions": [], "interfaces": [ + { + "parentPluginId": "cases", + "id": "def-public.Owner", + "type": "Interface", + "tags": [], + "label": "Owner", + "description": [], + "source": { + "path": "x-pack/plugins/cases/public/types.ts", + "lineNumber": 42 + }, + "deprecated": false, + "children": [ + { + "parentPluginId": "cases", + "id": "def-public.Owner.owner", + "type": "Array", + "tags": [], + "label": "owner", + "description": [], + "signature": [ + "string[]" + ], + "source": { + "path": "x-pack/plugins/cases/public/types.ts", + "lineNumber": 43 + }, + "deprecated": false + } + ], + "initialIsOpen": false + }, { "parentPluginId": "cases", "id": "def-public.SetupPlugins", @@ -454,7 +486,7 @@ "description": [], "source": { "path": "x-pack/plugins/cases/public/types.ts", - "lineNumber": 42 + "lineNumber": 46 }, "deprecated": false, "children": [ @@ -474,7 +506,7 @@ ], "source": { "path": "x-pack/plugins/cases/public/types.ts", - "lineNumber": 43 + "lineNumber": 47 }, "deprecated": false, "returnComment": [], @@ -491,7 +523,7 @@ ], "source": { "path": "x-pack/plugins/cases/public/types.ts", - "lineNumber": 43 + "lineNumber": 47 }, "deprecated": false } @@ -513,7 +545,7 @@ ], "source": { "path": "x-pack/plugins/cases/public/types.ts", - "lineNumber": 44 + "lineNumber": 48 }, "deprecated": false, "returnComment": [], @@ -530,7 +562,7 @@ ], "source": { "path": "x-pack/plugins/cases/public/types.ts", - "lineNumber": 45 + "lineNumber": 49 }, "deprecated": false } @@ -552,7 +584,7 @@ ], "source": { "path": "x-pack/plugins/cases/public/types.ts", - "lineNumber": 47 + "lineNumber": 51 }, "deprecated": false, "returnComment": [], @@ -569,7 +601,7 @@ ], "source": { "path": "x-pack/plugins/cases/public/types.ts", - "lineNumber": 47 + "lineNumber": 51 }, "deprecated": false } @@ -591,7 +623,7 @@ ], "source": { "path": "x-pack/plugins/cases/public/types.ts", - "lineNumber": 48 + "lineNumber": 52 }, "deprecated": false, "returnComment": [], @@ -608,7 +640,7 @@ ], "source": { "path": "x-pack/plugins/cases/public/types.ts", - "lineNumber": 48 + "lineNumber": 52 }, "deprecated": false } @@ -630,7 +662,7 @@ ], "source": { "path": "x-pack/plugins/cases/public/types.ts", - "lineNumber": 49 + "lineNumber": 53 }, "deprecated": false, "returnComment": [], @@ -647,7 +679,7 @@ ], "source": { "path": "x-pack/plugins/cases/public/types.ts", - "lineNumber": 49 + "lineNumber": 53 }, "deprecated": false } @@ -669,7 +701,7 @@ ], "source": { "path": "x-pack/plugins/cases/public/types.ts", - "lineNumber": 50 + "lineNumber": 54 }, "deprecated": false, "returnComment": [], @@ -686,7 +718,7 @@ ], "source": { "path": "x-pack/plugins/cases/public/types.ts", - "lineNumber": 50 + "lineNumber": 54 }, "deprecated": false } @@ -698,7 +730,170 @@ } }, "server": { - "classes": [], + "classes": [ + { + "parentPluginId": "cases", + "id": "def-server.CasesClient", + "type": "Class", + "tags": [], + "label": "CasesClient", + "description": [ + "\nClient wrapper that contains accessor methods for individual entities within the cases system." + ], + "source": { + "path": "x-pack/plugins/cases/server/client/client.ts", + "lineNumber": 21 + }, + "deprecated": false, + "children": [ + { + "parentPluginId": "cases", + "id": "def-server.CasesClient.Unnamed", + "type": "Function", + "tags": [], + "label": "Constructor", + "description": [], + "signature": [ + "any" + ], + "source": { + "path": "x-pack/plugins/cases/server/client/client.ts", + "lineNumber": 30 + }, + "deprecated": false, + "children": [ + { + "parentPluginId": "cases", + "id": "def-server.CasesClient.Unnamed.$1", + "type": "Object", + "tags": [], + "label": "args", + "description": [], + "signature": [ + "CasesClientArgs" + ], + "source": { + "path": "x-pack/plugins/cases/server/client/client.ts", + "lineNumber": 30 + }, + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "cases", + "id": "def-server.CasesClient.cases", + "type": "Object", + "tags": [], + "label": "cases", + "description": [ + "\nRetrieves an interface for interacting with cases entities." + ], + "signature": [ + "CasesSubClient" + ], + "source": { + "path": "x-pack/plugins/cases/server/client/client.ts", + "lineNumber": 43 + }, + "deprecated": false + }, + { + "parentPluginId": "cases", + "id": "def-server.CasesClient.attachments", + "type": "Object", + "tags": [], + "label": "attachments", + "description": [ + "\nRetrieves an interface for interacting with attachments (comments) entities." + ], + "signature": [ + "AttachmentsSubClient" + ], + "source": { + "path": "x-pack/plugins/cases/server/client/client.ts", + "lineNumber": 50 + }, + "deprecated": false + }, + { + "parentPluginId": "cases", + "id": "def-server.CasesClient.userActions", + "type": "Object", + "tags": [], + "label": "userActions", + "description": [ + "\nRetrieves an interface for interacting with the user actions associated with the plugin entities." + ], + "signature": [ + "UserActionsSubClient" + ], + "source": { + "path": "x-pack/plugins/cases/server/client/client.ts", + "lineNumber": 57 + }, + "deprecated": false + }, + { + "parentPluginId": "cases", + "id": "def-server.CasesClient.subCases", + "type": "Object", + "tags": [], + "label": "subCases", + "description": [ + "\nRetrieves an interface for interacting with the case as a connector entities.\n\nCurrently this functionality is disabled and will throw an error if this function is called." + ], + "signature": [ + "SubCasesClient" + ], + "source": { + "path": "x-pack/plugins/cases/server/client/client.ts", + "lineNumber": 66 + }, + "deprecated": false + }, + { + "parentPluginId": "cases", + "id": "def-server.CasesClient.configure", + "type": "Object", + "tags": [], + "label": "configure", + "description": [ + "\nRetrieves an interface for interacting with the configuration of external connectors for the plugin entities." + ], + "signature": [ + "ConfigureSubClient" + ], + "source": { + "path": "x-pack/plugins/cases/server/client/client.ts", + "lineNumber": 76 + }, + "deprecated": false + }, + { + "parentPluginId": "cases", + "id": "def-server.CasesClient.stats", + "type": "Object", + "tags": [], + "label": "stats", + "description": [ + "\nRetrieves an interface for retrieving statistics related to the cases entities." + ], + "signature": [ + "StatsSubClient" + ], + "source": { + "path": "x-pack/plugins/cases/server/client/client.ts", + "lineNumber": 83 + }, + "deprecated": false + } + ], + "initialIsOpen": false + } + ], "functions": [], "interfaces": [ { @@ -710,7 +905,7 @@ "description": [], "source": { "path": "x-pack/plugins/cases/server/types.ts", - "lineNumber": 12 + "lineNumber": 18 }, "deprecated": false, "children": [ @@ -722,18 +917,19 @@ "label": "getCasesClient", "description": [], "signature": [ - "() => ", + "() => Promise<", { "pluginId": "cases", "scope": "server", "docId": "kibCasesPluginApi", "section": "def-server.CasesClient", "text": "CasesClient" - } + }, + ">" ], "source": { "path": "x-pack/plugins/cases/server/types.ts", - "lineNumber": 13 + "lineNumber": 19 }, "deprecated": false, "returnComment": [], @@ -744,1448 +940,62 @@ }, { "parentPluginId": "cases", - "id": "def-server.CasesClient", + "id": "def-server.PluginStartContract", "type": "Interface", "tags": [], - "label": "CasesClient", + "label": "PluginStartContract", "description": [ - "\nThis represents the interface that other plugins can access." + "\nCases server exposed contract for interacting with cases entities." ], "source": { - "path": "x-pack/plugins/cases/server/client/types.ts", - "lineNumber": 102 + "path": "x-pack/plugins/cases/server/plugin.ts", + "lineNumber": 55 }, "deprecated": false, "children": [ { "parentPluginId": "cases", - "id": "def-server.CasesClient.addComment", + "id": "def-server.PluginStartContract.getCasesClientWithRequest", "type": "Function", "tags": [], - "label": "addComment", - "description": [], + "label": "getCasesClientWithRequest", + "description": [ + "\nReturns a client which can be used to interact with the cases backend entities.\n" + ], "signature": [ - "(args: ", - "CasesClientAddComment", - ") => Promise<{ description: string; status: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CaseStatuses", - "text": "CaseStatuses" - }, - "; tags: string[]; title: string; type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CaseType", - "text": "CaseType" - }, - "; connector: ({ id: string; name: string; } & { type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.ConnectorTypes", - "text": "ConnectorTypes" - }, - ".jira; fields: { issueType: string | null; priority: string | null; parent: string | null; } | null; }) | ({ id: string; name: string; } & { type: ", + "(request: ", { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.ConnectorTypes", - "text": "ConnectorTypes" - }, - ".resilient; fields: { incidentTypes: string[] | null; severityCode: string | null; } | null; }) | ({ id: string; name: string; } & { type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.ConnectorTypes", - "text": "ConnectorTypes" - }, - ".serviceNowITSM; fields: { impact: string | null; severity: string | null; urgency: string | null; category: string | null; subcategory: string | null; } | null; }) | ({ id: string; name: string; } & { type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.ConnectorTypes", - "text": "ConnectorTypes" - }, - ".serviceNowSIR; fields: { category: string | null; destIp: boolean | null; malwareHash: boolean | null; malwareUrl: boolean | null; priority: string | null; sourceIp: boolean | null; subcategory: string | null; } | null; }) | ({ id: string; name: string; } & { type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.ConnectorTypes", - "text": "ConnectorTypes" - }, - ".none; fields: null; }); settings: { syncAlerts: boolean; }; } & { closed_at: string | null; closed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; external_service: ({ connector_id: string; connector_name: string; external_id: string; external_title: string; external_url: string; } & { pushed_at: string; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; }) | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; totalComment: number; totalAlerts: number; version: string; } & { subCaseIds?: string[] | undefined; subCases?: ({ status: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CaseStatuses", - "text": "CaseStatuses" - }, - "; } & { closed_at: string | null; closed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; totalComment: number; totalAlerts: number; version: string; } & { comments?: (({ comment: string; type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CommentType", - "text": "CommentType" - }, - ".user; } & { associationType: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.AssociationType", - "text": "AssociationType" + "pluginId": "core", + "scope": "server", + "docId": "kibCoreHttpPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" }, - "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }) | ({ type: ", + ") => Promise<", { "pluginId": "cases", - "scope": "common", + "scope": "server", "docId": "kibCasesPluginApi", - "section": "def-common.CommentType", - "text": "CommentType" - }, - ".alert | ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CommentType", - "text": "CommentType" - }, - ".generatedAlert; alertId: string | string[]; index: string | string[]; rule: { id: string | null; name: string | null; }; } & { associationType: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.AssociationType", - "text": "AssociationType" - }, - "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }))[] | undefined; })[] | undefined; comments?: (({ comment: string; type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CommentType", - "text": "CommentType" - }, - ".user; } & { associationType: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.AssociationType", - "text": "AssociationType" - }, - "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }) | ({ type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CommentType", - "text": "CommentType" - }, - ".alert | ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CommentType", - "text": "CommentType" - }, - ".generatedAlert; alertId: string | string[]; index: string | string[]; rule: { id: string | null; name: string | null; }; } & { associationType: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.AssociationType", - "text": "AssociationType" - }, - "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }))[] | undefined; }>" - ], - "source": { - "path": "x-pack/plugins/cases/server/client/types.ts", - "lineNumber": 103 - }, - "deprecated": false, - "children": [ - { - "parentPluginId": "cases", - "id": "def-server.CasesClient.addComment.$1", - "type": "Object", - "tags": [], - "label": "args", - "description": [], - "signature": [ - "CasesClientAddComment" - ], - "source": { - "path": "x-pack/plugins/cases/server/client/types.ts", - "lineNumber": 103 - }, - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] - }, - { - "parentPluginId": "cases", - "id": "def-server.CasesClient.create", - "type": "Function", - "tags": [], - "label": "create", - "description": [], - "signature": [ - "(theCase: { type?: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CaseType", - "text": "CaseType" - }, - " | undefined; } & { description: string; tags: string[]; title: string; connector: ({ id: string; name: string; } & { type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.ConnectorTypes", - "text": "ConnectorTypes" - }, - ".jira; fields: { issueType: string | null; priority: string | null; parent: string | null; } | null; }) | ({ id: string; name: string; } & { type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.ConnectorTypes", - "text": "ConnectorTypes" - }, - ".resilient; fields: { incidentTypes: string[] | null; severityCode: string | null; } | null; }) | ({ id: string; name: string; } & { type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.ConnectorTypes", - "text": "ConnectorTypes" - }, - ".serviceNowITSM; fields: { impact: string | null; severity: string | null; urgency: string | null; category: string | null; subcategory: string | null; } | null; }) | ({ id: string; name: string; } & { type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.ConnectorTypes", - "text": "ConnectorTypes" - }, - ".serviceNowSIR; fields: { category: string | null; destIp: boolean | null; malwareHash: boolean | null; malwareUrl: boolean | null; priority: string | null; sourceIp: boolean | null; subcategory: string | null; } | null; }) | ({ id: string; name: string; } & { type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.ConnectorTypes", - "text": "ConnectorTypes" - }, - ".none; fields: null; }); settings: { syncAlerts: boolean; }; }) => Promise<{ description: string; status: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CaseStatuses", - "text": "CaseStatuses" - }, - "; tags: string[]; title: string; type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CaseType", - "text": "CaseType" - }, - "; connector: ({ id: string; name: string; } & { type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.ConnectorTypes", - "text": "ConnectorTypes" - }, - ".jira; fields: { issueType: string | null; priority: string | null; parent: string | null; } | null; }) | ({ id: string; name: string; } & { type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.ConnectorTypes", - "text": "ConnectorTypes" - }, - ".resilient; fields: { incidentTypes: string[] | null; severityCode: string | null; } | null; }) | ({ id: string; name: string; } & { type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.ConnectorTypes", - "text": "ConnectorTypes" - }, - ".serviceNowITSM; fields: { impact: string | null; severity: string | null; urgency: string | null; category: string | null; subcategory: string | null; } | null; }) | ({ id: string; name: string; } & { type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.ConnectorTypes", - "text": "ConnectorTypes" - }, - ".serviceNowSIR; fields: { category: string | null; destIp: boolean | null; malwareHash: boolean | null; malwareUrl: boolean | null; priority: string | null; sourceIp: boolean | null; subcategory: string | null; } | null; }) | ({ id: string; name: string; } & { type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.ConnectorTypes", - "text": "ConnectorTypes" - }, - ".none; fields: null; }); settings: { syncAlerts: boolean; }; } & { closed_at: string | null; closed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; external_service: ({ connector_id: string; connector_name: string; external_id: string; external_title: string; external_url: string; } & { pushed_at: string; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; }) | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; totalComment: number; totalAlerts: number; version: string; } & { subCaseIds?: string[] | undefined; subCases?: ({ status: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CaseStatuses", - "text": "CaseStatuses" - }, - "; } & { closed_at: string | null; closed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; totalComment: number; totalAlerts: number; version: string; } & { comments?: (({ comment: string; type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CommentType", - "text": "CommentType" - }, - ".user; } & { associationType: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.AssociationType", - "text": "AssociationType" - }, - "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }) | ({ type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CommentType", - "text": "CommentType" - }, - ".alert | ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CommentType", - "text": "CommentType" - }, - ".generatedAlert; alertId: string | string[]; index: string | string[]; rule: { id: string | null; name: string | null; }; } & { associationType: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.AssociationType", - "text": "AssociationType" - }, - "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }))[] | undefined; })[] | undefined; comments?: (({ comment: string; type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CommentType", - "text": "CommentType" - }, - ".user; } & { associationType: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.AssociationType", - "text": "AssociationType" - }, - "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }) | ({ type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CommentType", - "text": "CommentType" - }, - ".alert | ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CommentType", - "text": "CommentType" - }, - ".generatedAlert; alertId: string | string[]; index: string | string[]; rule: { id: string | null; name: string | null; }; } & { associationType: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.AssociationType", - "text": "AssociationType" - }, - "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }))[] | undefined; }>" - ], - "source": { - "path": "x-pack/plugins/cases/server/client/types.ts", - "lineNumber": 104 - }, - "deprecated": false, - "children": [ - { - "parentPluginId": "cases", - "id": "def-server.CasesClient.create.$1", - "type": "CompoundType", - "tags": [], - "label": "theCase", - "description": [], - "signature": [ - "{ type?: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CaseType", - "text": "CaseType" - }, - " | undefined; } & { description: string; tags: string[]; title: string; connector: ({ id: string; name: string; } & { type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.ConnectorTypes", - "text": "ConnectorTypes" - }, - ".jira; fields: { issueType: string | null; priority: string | null; parent: string | null; } | null; }) | ({ id: string; name: string; } & { type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.ConnectorTypes", - "text": "ConnectorTypes" - }, - ".resilient; fields: { incidentTypes: string[] | null; severityCode: string | null; } | null; }) | ({ id: string; name: string; } & { type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.ConnectorTypes", - "text": "ConnectorTypes" - }, - ".serviceNowITSM; fields: { impact: string | null; severity: string | null; urgency: string | null; category: string | null; subcategory: string | null; } | null; }) | ({ id: string; name: string; } & { type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.ConnectorTypes", - "text": "ConnectorTypes" - }, - ".serviceNowSIR; fields: { category: string | null; destIp: boolean | null; malwareHash: boolean | null; malwareUrl: boolean | null; priority: string | null; sourceIp: boolean | null; subcategory: string | null; } | null; }) | ({ id: string; name: string; } & { type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.ConnectorTypes", - "text": "ConnectorTypes" - }, - ".none; fields: null; }); settings: { syncAlerts: boolean; }; }" - ], - "source": { - "path": "x-pack/plugins/cases/server/client/types.ts", - "lineNumber": 104 - }, - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] - }, - { - "parentPluginId": "cases", - "id": "def-server.CasesClient.get", - "type": "Function", - "tags": [], - "label": "get", - "description": [], - "signature": [ - "(args: ", - "CasesClientGet", - ") => Promise<{ description: string; status: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CaseStatuses", - "text": "CaseStatuses" - }, - "; tags: string[]; title: string; type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CaseType", - "text": "CaseType" - }, - "; connector: ({ id: string; name: string; } & { type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.ConnectorTypes", - "text": "ConnectorTypes" - }, - ".jira; fields: { issueType: string | null; priority: string | null; parent: string | null; } | null; }) | ({ id: string; name: string; } & { type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.ConnectorTypes", - "text": "ConnectorTypes" - }, - ".resilient; fields: { incidentTypes: string[] | null; severityCode: string | null; } | null; }) | ({ id: string; name: string; } & { type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.ConnectorTypes", - "text": "ConnectorTypes" - }, - ".serviceNowITSM; fields: { impact: string | null; severity: string | null; urgency: string | null; category: string | null; subcategory: string | null; } | null; }) | ({ id: string; name: string; } & { type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.ConnectorTypes", - "text": "ConnectorTypes" - }, - ".serviceNowSIR; fields: { category: string | null; destIp: boolean | null; malwareHash: boolean | null; malwareUrl: boolean | null; priority: string | null; sourceIp: boolean | null; subcategory: string | null; } | null; }) | ({ id: string; name: string; } & { type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.ConnectorTypes", - "text": "ConnectorTypes" - }, - ".none; fields: null; }); settings: { syncAlerts: boolean; }; } & { closed_at: string | null; closed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; external_service: ({ connector_id: string; connector_name: string; external_id: string; external_title: string; external_url: string; } & { pushed_at: string; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; }) | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; totalComment: number; totalAlerts: number; version: string; } & { subCaseIds?: string[] | undefined; subCases?: ({ status: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CaseStatuses", - "text": "CaseStatuses" - }, - "; } & { closed_at: string | null; closed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; totalComment: number; totalAlerts: number; version: string; } & { comments?: (({ comment: string; type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CommentType", - "text": "CommentType" - }, - ".user; } & { associationType: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.AssociationType", - "text": "AssociationType" - }, - "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }) | ({ type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CommentType", - "text": "CommentType" - }, - ".alert | ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CommentType", - "text": "CommentType" - }, - ".generatedAlert; alertId: string | string[]; index: string | string[]; rule: { id: string | null; name: string | null; }; } & { associationType: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.AssociationType", - "text": "AssociationType" - }, - "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }))[] | undefined; })[] | undefined; comments?: (({ comment: string; type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CommentType", - "text": "CommentType" - }, - ".user; } & { associationType: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.AssociationType", - "text": "AssociationType" - }, - "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }) | ({ type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CommentType", - "text": "CommentType" - }, - ".alert | ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CommentType", - "text": "CommentType" - }, - ".generatedAlert; alertId: string | string[]; index: string | string[]; rule: { id: string | null; name: string | null; }; } & { associationType: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.AssociationType", - "text": "AssociationType" - }, - "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }))[] | undefined; }>" - ], - "source": { - "path": "x-pack/plugins/cases/server/client/types.ts", - "lineNumber": 105 - }, - "deprecated": false, - "children": [ - { - "parentPluginId": "cases", - "id": "def-server.CasesClient.get.$1", - "type": "Object", - "tags": [], - "label": "args", - "description": [], - "signature": [ - "CasesClientGet" - ], - "source": { - "path": "x-pack/plugins/cases/server/client/types.ts", - "lineNumber": 105 - }, - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] - }, - { - "parentPluginId": "cases", - "id": "def-server.CasesClient.getAlerts", - "type": "Function", - "tags": [], - "label": "getAlerts", - "description": [], - "signature": [ - "(args: ", - "CasesClientGetAlerts", - ") => Promise<", - "CasesClientGetAlertsResponse", - ">" - ], - "source": { - "path": "x-pack/plugins/cases/server/client/types.ts", - "lineNumber": 106 - }, - "deprecated": false, - "children": [ - { - "parentPluginId": "cases", - "id": "def-server.CasesClient.getAlerts.$1", - "type": "Object", - "tags": [], - "label": "args", - "description": [], - "signature": [ - "CasesClientGetAlerts" - ], - "source": { - "path": "x-pack/plugins/cases/server/client/types.ts", - "lineNumber": 106 - }, - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] - }, - { - "parentPluginId": "cases", - "id": "def-server.CasesClient.getFields", - "type": "Function", - "tags": [], - "label": "getFields", - "description": [], - "signature": [ - "(args: ", - "ConfigureFields", - ") => Promise<{ defaultMappings: { action_type: \"append\" | \"overwrite\" | \"nothing\"; source: \"description\" | \"title\" | \"comments\"; target: string; }[]; fields: { id: string; name: string; required: boolean; type: \"text\" | \"textarea\"; }[]; }>" - ], - "source": { - "path": "x-pack/plugins/cases/server/client/types.ts", - "lineNumber": 107 - }, - "deprecated": false, - "children": [ - { - "parentPluginId": "cases", - "id": "def-server.CasesClient.getFields.$1", - "type": "Object", - "tags": [], - "label": "args", - "description": [], - "signature": [ - "ConfigureFields" - ], - "source": { - "path": "x-pack/plugins/cases/server/client/types.ts", - "lineNumber": 107 - }, - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] - }, - { - "parentPluginId": "cases", - "id": "def-server.CasesClient.getMappings", - "type": "Function", - "tags": [], - "label": "getMappings", - "description": [], - "signature": [ - "(args: ", - "MappingsClient", - ") => Promise<{ action_type: \"append\" | \"overwrite\" | \"nothing\"; source: \"description\" | \"title\" | \"comments\"; target: string; }[]>" - ], - "source": { - "path": "x-pack/plugins/cases/server/client/types.ts", - "lineNumber": 108 - }, - "deprecated": false, - "children": [ - { - "parentPluginId": "cases", - "id": "def-server.CasesClient.getMappings.$1", - "type": "Object", - "tags": [], - "label": "args", - "description": [], - "signature": [ - "MappingsClient" - ], - "source": { - "path": "x-pack/plugins/cases/server/client/types.ts", - "lineNumber": 108 - }, - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] - }, - { - "parentPluginId": "cases", - "id": "def-server.CasesClient.getUserActions", - "type": "Function", - "tags": [], - "label": "getUserActions", - "description": [], - "signature": [ - "(args: ", - "CasesClientGetUserActions", - ") => Promise<({ action_field: (\"status\" | \"description\" | \"title\" | \"comment\" | \"tags\" | \"settings\" | \"connector\" | \"pushed\" | \"sub_case\")[]; action: \"add\" | \"delete\" | \"create\" | \"update\" | \"push-to-service\"; action_at: string; action_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; new_value: string | null; old_value: string | null; } & { action_id: string; case_id: string; comment_id: string | null; } & { sub_case_id?: string | undefined; })[]>" - ], - "source": { - "path": "x-pack/plugins/cases/server/client/types.ts", - "lineNumber": 109 - }, - "deprecated": false, - "children": [ - { - "parentPluginId": "cases", - "id": "def-server.CasesClient.getUserActions.$1", - "type": "Object", - "tags": [], - "label": "args", - "description": [], - "signature": [ - "CasesClientGetUserActions" - ], - "source": { - "path": "x-pack/plugins/cases/server/client/types.ts", - "lineNumber": 109 - }, - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] - }, - { - "parentPluginId": "cases", - "id": "def-server.CasesClient.push", - "type": "Function", - "tags": [], - "label": "push", - "description": [], - "signature": [ - "(args: ", - "CasesClientPush", - ") => Promise<{ description: string; status: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CaseStatuses", - "text": "CaseStatuses" - }, - "; tags: string[]; title: string; type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CaseType", - "text": "CaseType" - }, - "; connector: ({ id: string; name: string; } & { type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.ConnectorTypes", - "text": "ConnectorTypes" - }, - ".jira; fields: { issueType: string | null; priority: string | null; parent: string | null; } | null; }) | ({ id: string; name: string; } & { type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.ConnectorTypes", - "text": "ConnectorTypes" - }, - ".resilient; fields: { incidentTypes: string[] | null; severityCode: string | null; } | null; }) | ({ id: string; name: string; } & { type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.ConnectorTypes", - "text": "ConnectorTypes" - }, - ".serviceNowITSM; fields: { impact: string | null; severity: string | null; urgency: string | null; category: string | null; subcategory: string | null; } | null; }) | ({ id: string; name: string; } & { type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.ConnectorTypes", - "text": "ConnectorTypes" - }, - ".serviceNowSIR; fields: { category: string | null; destIp: boolean | null; malwareHash: boolean | null; malwareUrl: boolean | null; priority: string | null; sourceIp: boolean | null; subcategory: string | null; } | null; }) | ({ id: string; name: string; } & { type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.ConnectorTypes", - "text": "ConnectorTypes" - }, - ".none; fields: null; }); settings: { syncAlerts: boolean; }; } & { closed_at: string | null; closed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; external_service: ({ connector_id: string; connector_name: string; external_id: string; external_title: string; external_url: string; } & { pushed_at: string; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; }) | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; totalComment: number; totalAlerts: number; version: string; } & { subCaseIds?: string[] | undefined; subCases?: ({ status: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CaseStatuses", - "text": "CaseStatuses" - }, - "; } & { closed_at: string | null; closed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; totalComment: number; totalAlerts: number; version: string; } & { comments?: (({ comment: string; type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CommentType", - "text": "CommentType" - }, - ".user; } & { associationType: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.AssociationType", - "text": "AssociationType" - }, - "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }) | ({ type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CommentType", - "text": "CommentType" - }, - ".alert | ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CommentType", - "text": "CommentType" - }, - ".generatedAlert; alertId: string | string[]; index: string | string[]; rule: { id: string | null; name: string | null; }; } & { associationType: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.AssociationType", - "text": "AssociationType" - }, - "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }))[] | undefined; })[] | undefined; comments?: (({ comment: string; type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CommentType", - "text": "CommentType" - }, - ".user; } & { associationType: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.AssociationType", - "text": "AssociationType" - }, - "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }) | ({ type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CommentType", - "text": "CommentType" - }, - ".alert | ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CommentType", - "text": "CommentType" - }, - ".generatedAlert; alertId: string | string[]; index: string | string[]; rule: { id: string | null; name: string | null; }; } & { associationType: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.AssociationType", - "text": "AssociationType" - }, - "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }))[] | undefined; }>" - ], - "source": { - "path": "x-pack/plugins/cases/server/client/types.ts", - "lineNumber": 110 - }, - "deprecated": false, - "children": [ - { - "parentPluginId": "cases", - "id": "def-server.CasesClient.push.$1", - "type": "Object", - "tags": [], - "label": "args", - "description": [], - "signature": [ - "CasesClientPush" - ], - "source": { - "path": "x-pack/plugins/cases/server/client/types.ts", - "lineNumber": 110 - }, - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] - }, - { - "parentPluginId": "cases", - "id": "def-server.CasesClient.update", - "type": "Function", - "tags": [], - "label": "update", - "description": [], - "signature": [ - "(args: { cases: ({ description?: string | undefined; status?: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CaseStatuses", - "text": "CaseStatuses" - }, - " | undefined; tags?: string[] | undefined; title?: string | undefined; type?: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CaseType", - "text": "CaseType" - }, - " | undefined; connector?: ({ id: string; name: string; } & { type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.ConnectorTypes", - "text": "ConnectorTypes" - }, - ".jira; fields: { issueType: string | null; priority: string | null; parent: string | null; } | null; }) | ({ id: string; name: string; } & { type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.ConnectorTypes", - "text": "ConnectorTypes" - }, - ".resilient; fields: { incidentTypes: string[] | null; severityCode: string | null; } | null; }) | ({ id: string; name: string; } & { type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.ConnectorTypes", - "text": "ConnectorTypes" - }, - ".serviceNowITSM; fields: { impact: string | null; severity: string | null; urgency: string | null; category: string | null; subcategory: string | null; } | null; }) | ({ id: string; name: string; } & { type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.ConnectorTypes", - "text": "ConnectorTypes" - }, - ".serviceNowSIR; fields: { category: string | null; destIp: boolean | null; malwareHash: boolean | null; malwareUrl: boolean | null; priority: string | null; sourceIp: boolean | null; subcategory: string | null; } | null; }) | ({ id: string; name: string; } & { type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.ConnectorTypes", - "text": "ConnectorTypes" - }, - ".none; fields: null; }) | undefined; settings?: { syncAlerts: boolean; } | undefined; } & { id: string; version: string; })[]; }) => Promise<({ description: string; status: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CaseStatuses", - "text": "CaseStatuses" - }, - "; tags: string[]; title: string; type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CaseType", - "text": "CaseType" - }, - "; connector: ({ id: string; name: string; } & { type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.ConnectorTypes", - "text": "ConnectorTypes" - }, - ".jira; fields: { issueType: string | null; priority: string | null; parent: string | null; } | null; }) | ({ id: string; name: string; } & { type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.ConnectorTypes", - "text": "ConnectorTypes" - }, - ".resilient; fields: { incidentTypes: string[] | null; severityCode: string | null; } | null; }) | ({ id: string; name: string; } & { type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.ConnectorTypes", - "text": "ConnectorTypes" - }, - ".serviceNowITSM; fields: { impact: string | null; severity: string | null; urgency: string | null; category: string | null; subcategory: string | null; } | null; }) | ({ id: string; name: string; } & { type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.ConnectorTypes", - "text": "ConnectorTypes" - }, - ".serviceNowSIR; fields: { category: string | null; destIp: boolean | null; malwareHash: boolean | null; malwareUrl: boolean | null; priority: string | null; sourceIp: boolean | null; subcategory: string | null; } | null; }) | ({ id: string; name: string; } & { type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.ConnectorTypes", - "text": "ConnectorTypes" - }, - ".none; fields: null; }); settings: { syncAlerts: boolean; }; } & { closed_at: string | null; closed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; external_service: ({ connector_id: string; connector_name: string; external_id: string; external_title: string; external_url: string; } & { pushed_at: string; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; }) | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; totalComment: number; totalAlerts: number; version: string; } & { subCaseIds?: string[] | undefined; subCases?: ({ status: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CaseStatuses", - "text": "CaseStatuses" - }, - "; } & { closed_at: string | null; closed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; totalComment: number; totalAlerts: number; version: string; } & { comments?: (({ comment: string; type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CommentType", - "text": "CommentType" - }, - ".user; } & { associationType: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.AssociationType", - "text": "AssociationType" - }, - "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }) | ({ type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CommentType", - "text": "CommentType" - }, - ".alert | ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CommentType", - "text": "CommentType" - }, - ".generatedAlert; alertId: string | string[]; index: string | string[]; rule: { id: string | null; name: string | null; }; } & { associationType: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.AssociationType", - "text": "AssociationType" - }, - "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }))[] | undefined; })[] | undefined; comments?: (({ comment: string; type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CommentType", - "text": "CommentType" - }, - ".user; } & { associationType: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.AssociationType", - "text": "AssociationType" - }, - "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }) | ({ type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CommentType", - "text": "CommentType" - }, - ".alert | ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CommentType", - "text": "CommentType" - }, - ".generatedAlert; alertId: string | string[]; index: string | string[]; rule: { id: string | null; name: string | null; }; } & { associationType: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.AssociationType", - "text": "AssociationType" - }, - "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }))[] | undefined; })[]>" - ], - "source": { - "path": "x-pack/plugins/cases/server/client/types.ts", - "lineNumber": 111 - }, - "deprecated": false, - "children": [ - { - "parentPluginId": "cases", - "id": "def-server.CasesClient.update.$1", - "type": "Object", - "tags": [], - "label": "args", - "description": [], - "signature": [ - "{ cases: ({ description?: string | undefined; status?: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CaseStatuses", - "text": "CaseStatuses" - }, - " | undefined; tags?: string[] | undefined; title?: string | undefined; type?: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CaseType", - "text": "CaseType" - }, - " | undefined; connector?: ({ id: string; name: string; } & { type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.ConnectorTypes", - "text": "ConnectorTypes" - }, - ".jira; fields: { issueType: string | null; priority: string | null; parent: string | null; } | null; }) | ({ id: string; name: string; } & { type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.ConnectorTypes", - "text": "ConnectorTypes" - }, - ".resilient; fields: { incidentTypes: string[] | null; severityCode: string | null; } | null; }) | ({ id: string; name: string; } & { type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.ConnectorTypes", - "text": "ConnectorTypes" - }, - ".serviceNowITSM; fields: { impact: string | null; severity: string | null; urgency: string | null; category: string | null; subcategory: string | null; } | null; }) | ({ id: string; name: string; } & { type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.ConnectorTypes", - "text": "ConnectorTypes" - }, - ".serviceNowSIR; fields: { category: string | null; destIp: boolean | null; malwareHash: boolean | null; malwareUrl: boolean | null; priority: string | null; sourceIp: boolean | null; subcategory: string | null; } | null; }) | ({ id: string; name: string; } & { type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.ConnectorTypes", - "text": "ConnectorTypes" - }, - ".none; fields: null; }) | undefined; settings?: { syncAlerts: boolean; } | undefined; } & { id: string; version: string; })[]; }" - ], - "source": { - "path": "x-pack/plugins/cases/server/client/types.ts", - "lineNumber": 111 - }, - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] - }, - { - "parentPluginId": "cases", - "id": "def-server.CasesClient.updateAlertsStatus", - "type": "Function", - "tags": [], - "label": "updateAlertsStatus", - "description": [], - "signature": [ - "(args: ", - "CasesClientUpdateAlertsStatus", - ") => Promise" - ], - "source": { - "path": "x-pack/plugins/cases/server/client/types.ts", - "lineNumber": 112 - }, - "deprecated": false, - "children": [ - { - "parentPluginId": "cases", - "id": "def-server.CasesClient.updateAlertsStatus.$1", - "type": "Object", - "tags": [], - "label": "args", - "description": [], - "signature": [ - "CasesClientUpdateAlertsStatus" - ], - "source": { - "path": "x-pack/plugins/cases/server/client/types.ts", - "lineNumber": 112 - }, - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] - }, - { - "parentPluginId": "cases", - "id": "def-server.CasesClient.getCaseIdsByAlertId", - "type": "Function", - "tags": [], - "label": "getCaseIdsByAlertId", - "description": [], - "signature": [ - "(args: ", - "CasesClientGetCasesByAlert", - ") => Promise" - ], - "source": { - "path": "x-pack/plugins/cases/server/client/types.ts", - "lineNumber": 113 - }, - "deprecated": false, - "children": [ - { - "parentPluginId": "cases", - "id": "def-server.CasesClient.getCaseIdsByAlertId.$1", - "type": "Object", - "tags": [], - "label": "args", - "description": [], - "signature": [ - "CasesClientGetCasesByAlert" - ], - "source": { - "path": "x-pack/plugins/cases/server/client/types.ts", - "lineNumber": 113 - }, - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "cases", - "id": "def-server.PluginStartContract", - "type": "Interface", - "tags": [], - "label": "PluginStartContract", - "description": [], - "source": { - "path": "x-pack/plugins/cases/server/index.ts", - "lineNumber": 29 - }, - "deprecated": false, - "children": [ - { - "parentPluginId": "cases", - "id": "def-server.PluginStartContract.getCasesClientWithRequestAndContext", - "type": "Function", - "tags": [], - "label": "getCasesClientWithRequestAndContext", - "description": [], - "signature": [ - "(context: ", - { - "pluginId": "core", - "scope": "server", - "docId": "kibCorePluginApi", - "section": "def-server.RequestHandlerContext", - "text": "RequestHandlerContext" - }, - ", request: ", - { - "pluginId": "core", - "scope": "server", - "docId": "kibCoreHttpPluginApi", - "section": "def-server.KibanaRequest", - "text": "KibanaRequest" - }, - ") => ", - { - "pluginId": "cases", - "scope": "server", - "docId": "kibCasesPluginApi", - "section": "def-server.CasesClient", - "text": "CasesClient" - } - ], - "source": { - "path": "x-pack/plugins/cases/server/index.ts", - "lineNumber": 30 - }, - "deprecated": false, - "children": [ - { - "parentPluginId": "cases", - "id": "def-server.PluginStartContract.getCasesClientWithRequestAndContext.$1", - "type": "Object", - "tags": [], - "label": "context", - "description": [], - "signature": [ - { - "pluginId": "core", - "scope": "server", - "docId": "kibCorePluginApi", - "section": "def-server.RequestHandlerContext", - "text": "RequestHandlerContext" - } - ], - "source": { - "path": "x-pack/plugins/cases/server/index.ts", - "lineNumber": 31 - }, - "deprecated": false, - "isRequired": true + "section": "def-server.CasesClient", + "text": "CasesClient" }, + ">" + ], + "source": { + "path": "x-pack/plugins/cases/server/plugin.ts", + "lineNumber": 62 + }, + "deprecated": false, + "children": [ { "parentPluginId": "cases", - "id": "def-server.PluginStartContract.getCasesClientWithRequestAndContext.$2", + "id": "def-server.PluginStartContract.getCasesClientWithRequest.$1", "type": "Object", "tags": [], "label": "request", - "description": [], + "description": [ + "a KibanaRequest" + ], "signature": [ { "pluginId": "core", @@ -2197,14 +1007,16 @@ "" ], "source": { - "path": "x-pack/plugins/cases/server/index.ts", - "lineNumber": 32 + "path": "x-pack/plugins/cases/server/plugin.ts", + "lineNumber": 62 }, "deprecated": false, "isRequired": true } ], - "returnComment": [] + "returnComment": [ + "a {@link CasesClient}" + ] } ], "initialIsOpen": false @@ -2229,7 +1041,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/runtime_types.ts", - "lineNumber": 49 + "lineNumber": 53 }, "deprecated": false, "children": [ @@ -2245,7 +1057,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/runtime_types.ts", - "lineNumber": 49 + "lineNumber": 53 }, "deprecated": false, "isRequired": true @@ -2268,7 +1080,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/runtime_types.ts", - "lineNumber": 55 + "lineNumber": 59 }, "deprecated": false, "children": [ @@ -2285,7 +1097,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/runtime_types.ts", - "lineNumber": 56 + "lineNumber": 60 }, "deprecated": false, "isRequired": true @@ -2302,7 +1114,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/runtime_types.ts", - "lineNumber": 57 + "lineNumber": 61 }, "deprecated": false, "isRequired": true @@ -2323,7 +1135,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/runtime_types.ts", - "lineNumber": 71 + "lineNumber": 75 }, "deprecated": false, "children": [ @@ -2339,7 +1151,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/runtime_types.ts", - "lineNumber": 71 + "lineNumber": 76 }, "deprecated": false, "isRequired": true @@ -2364,7 +1176,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/runtime_types.ts", - "lineNumber": 20 + "lineNumber": 24 }, "deprecated": true, "references": [], @@ -2381,7 +1193,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/runtime_types.ts", - "lineNumber": 20 + "lineNumber": 24 }, "deprecated": false, "isRequired": true @@ -2402,7 +1214,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/helpers.ts", - "lineNumber": 36 + "lineNumber": 37 }, "deprecated": false, "children": [ @@ -2418,7 +1230,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/helpers.ts", - "lineNumber": 36 + "lineNumber": 37 }, "deprecated": false, "isRequired": true @@ -2435,7 +1247,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/helpers.ts", - "lineNumber": 36 + "lineNumber": 37 }, "deprecated": false, "isRequired": true @@ -2456,7 +1268,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/helpers.ts", - "lineNumber": 32 + "lineNumber": 33 }, "deprecated": false, "children": [ @@ -2472,7 +1284,44 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/helpers.ts", - "lineNumber": 32 + "lineNumber": 33 + }, + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "cases", + "id": "def-common.getCaseConfigurationDetailsUrl", + "type": "Function", + "tags": [], + "label": "getCaseConfigurationDetailsUrl", + "description": [], + "signature": [ + "(configureID: string) => string" + ], + "source": { + "path": "x-pack/plugins/cases/common/api/helpers.ts", + "lineNumber": 53 + }, + "deprecated": false, + "children": [ + { + "parentPluginId": "cases", + "id": "def-common.getCaseConfigurationDetailsUrl.$1", + "type": "string", + "tags": [], + "label": "configureID", + "description": [], + "signature": [ + "string" + ], + "source": { + "path": "x-pack/plugins/cases/common/api/helpers.ts", + "lineNumber": 53 }, "deprecated": false, "isRequired": true @@ -2493,7 +1342,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/helpers.ts", - "lineNumber": 20 + "lineNumber": 21 }, "deprecated": false, "children": [ @@ -2509,7 +1358,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/helpers.ts", - "lineNumber": 20 + "lineNumber": 21 }, "deprecated": false, "isRequired": true @@ -2530,7 +1379,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/helpers.ts", - "lineNumber": 48 + "lineNumber": 49 }, "deprecated": false, "children": [ @@ -2546,7 +1395,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/helpers.ts", - "lineNumber": 48 + "lineNumber": 49 }, "deprecated": false, "isRequired": true @@ -2563,7 +1412,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/helpers.ts", - "lineNumber": 48 + "lineNumber": 49 }, "deprecated": false, "isRequired": true @@ -2584,7 +1433,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/helpers.ts", - "lineNumber": 52 + "lineNumber": 57 }, "deprecated": false, "children": [ @@ -2600,7 +1449,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/helpers.ts", - "lineNumber": 52 + "lineNumber": 57 }, "deprecated": false, "isRequired": true @@ -2621,7 +1470,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/helpers.ts", - "lineNumber": 40 + "lineNumber": 41 }, "deprecated": false, "children": [ @@ -2637,7 +1486,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/helpers.ts", - "lineNumber": 40 + "lineNumber": 41 }, "deprecated": false, "isRequired": true @@ -2658,7 +1507,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/helpers.ts", - "lineNumber": 28 + "lineNumber": 29 }, "deprecated": false, "children": [ @@ -2674,7 +1523,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/helpers.ts", - "lineNumber": 28 + "lineNumber": 29 }, "deprecated": false, "isRequired": true @@ -2691,7 +1540,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/helpers.ts", - "lineNumber": 28 + "lineNumber": 29 }, "deprecated": false, "isRequired": true @@ -2712,7 +1561,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/helpers.ts", - "lineNumber": 24 + "lineNumber": 25 }, "deprecated": false, "children": [ @@ -2728,7 +1577,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/helpers.ts", - "lineNumber": 24 + "lineNumber": 25 }, "deprecated": false, "isRequired": true @@ -2749,7 +1598,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/helpers.ts", - "lineNumber": 44 + "lineNumber": 45 }, "deprecated": false, "children": [ @@ -2765,7 +1614,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/helpers.ts", - "lineNumber": 44 + "lineNumber": 45 }, "deprecated": false, "isRequired": true @@ -2782,7 +1631,63 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/helpers.ts", - "lineNumber": 44 + "lineNumber": 45 + }, + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "cases", + "id": "def-common.OmitProp", + "type": "Function", + "tags": [], + "label": "OmitProp", + "description": [], + "signature": [ + "(o: O, k: K) => Pick>" + ], + "source": { + "path": "x-pack/plugins/cases/common/api/runtime_types.ts", + "lineNumber": 17 + }, + "deprecated": false, + "children": [ + { + "parentPluginId": "cases", + "id": "def-common.OmitProp.$1", + "type": "Uncategorized", + "tags": [], + "label": "o", + "description": [], + "signature": [ + "O" + ], + "source": { + "path": "x-pack/plugins/cases/common/api/runtime_types.ts", + "lineNumber": 17 + }, + "deprecated": false, + "isRequired": true + }, + { + "parentPluginId": "cases", + "id": "def-common.OmitProp.$2", + "type": "Uncategorized", + "tags": [], + "label": "k", + "description": [], + "signature": [ + "K" + ], + "source": { + "path": "x-pack/plugins/cases/common/api/runtime_types.ts", + "lineNumber": 17 }, "deprecated": false, "isRequired": true @@ -2805,7 +1710,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/runtime_types.ts", - "lineNumber": 51 + "lineNumber": 55 }, "deprecated": false, "children": [ @@ -2821,7 +1726,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/runtime_types.ts", - "lineNumber": 51 + "lineNumber": 55 }, "deprecated": false, "isRequired": true @@ -2841,7 +1746,7 @@ "description": [], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 144 + "lineNumber": 145 }, "deprecated": false, "children": [ @@ -2854,7 +1759,7 @@ "description": [], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 145 + "lineNumber": 146 }, "deprecated": false }, @@ -2867,7 +1772,7 @@ "description": [], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 146 + "lineNumber": 147 }, "deprecated": false }, @@ -2880,7 +1785,7 @@ "description": [], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 147 + "lineNumber": 148 }, "deprecated": false }, @@ -2893,7 +1798,7 @@ "description": [], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 148 + "lineNumber": 149 }, "deprecated": false }, @@ -2906,7 +1811,7 @@ "description": [], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 149 + "lineNumber": 150 }, "deprecated": false } @@ -2939,7 +1844,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 112 + "lineNumber": 113 }, "deprecated": false, "children": [ @@ -2962,7 +1867,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 113 + "lineNumber": 114 }, "deprecated": false }, @@ -2975,7 +1880,7 @@ "description": [], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 114 + "lineNumber": 115 }, "deprecated": false }, @@ -2988,7 +1893,7 @@ "description": [], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 115 + "lineNumber": 116 }, "deprecated": false }, @@ -3001,7 +1906,7 @@ "description": [], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 116 + "lineNumber": 117 }, "deprecated": false } @@ -3017,7 +1922,7 @@ "description": [], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 135 + "lineNumber": 136 }, "deprecated": false, "children": [ @@ -3033,7 +1938,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 136 + "lineNumber": 137 }, "deprecated": false } @@ -3049,7 +1954,7 @@ "description": [], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 139 + "lineNumber": 140 }, "deprecated": false, "children": [ @@ -3062,7 +1967,7 @@ "description": [], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 140 + "lineNumber": 141 }, "deprecated": false }, @@ -3075,7 +1980,7 @@ "description": [], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 141 + "lineNumber": 142 }, "deprecated": false }, @@ -3088,7 +1993,7 @@ "description": [], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 142 + "lineNumber": 143 }, "deprecated": false } @@ -3114,7 +2019,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 80 + "lineNumber": 81 }, "deprecated": false, "children": [ @@ -3170,7 +2075,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 81 + "lineNumber": 82 }, "deprecated": false }, @@ -3183,7 +2088,7 @@ "description": [], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 82 + "lineNumber": 83 }, "deprecated": false }, @@ -3206,7 +2111,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 83 + "lineNumber": 84 }, "deprecated": false }, @@ -3229,7 +2134,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 84 + "lineNumber": 85 }, "deprecated": false }, @@ -3245,7 +2150,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 85 + "lineNumber": 86 }, "deprecated": false }, @@ -3261,7 +2166,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 86 + "lineNumber": 87 }, "deprecated": false }, @@ -3277,7 +2182,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 87 + "lineNumber": 88 }, "deprecated": false }, @@ -3299,7 +2204,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 88 + "lineNumber": 89 }, "deprecated": false } @@ -3431,7 +2336,7 @@ "description": [], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 106 + "lineNumber": 107 }, "deprecated": false, "children": [ @@ -3447,7 +2352,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 107 + "lineNumber": 108 }, "deprecated": false }, @@ -3463,7 +2368,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 108 + "lineNumber": 109 }, "deprecated": false }, @@ -3479,7 +2384,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 109 + "lineNumber": 110 }, "deprecated": false } @@ -3520,7 +2425,7 @@ "label": "actionField", "description": [], "signature": [ - "(\"status\" | \"description\" | \"title\" | \"comment\" | \"tags\" | \"settings\" | \"connector\" | \"pushed\" | \"sub_case\")[]" + "(\"status\" | \"description\" | \"title\" | \"comment\" | \"tags\" | \"settings\" | \"owner\" | \"connector\" | \"pushed\" | \"sub_case\")[]" ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", @@ -3652,7 +2557,7 @@ "description": [], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 152 + "lineNumber": 153 }, "deprecated": false, "children": [ @@ -3665,7 +2570,7 @@ "description": [], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 153 + "lineNumber": 154 }, "deprecated": false }, @@ -3688,7 +2593,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 154 + "lineNumber": 155 }, "deprecated": false }, @@ -3704,7 +2609,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 155 + "lineNumber": 156 }, "deprecated": false } @@ -3720,7 +2625,7 @@ "description": [], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 225 + "lineNumber": 226 }, "deprecated": false, "children": [ @@ -3733,7 +2638,7 @@ "description": [], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 226 + "lineNumber": 227 }, "deprecated": false }, @@ -3749,7 +2654,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 227 + "lineNumber": 228 }, "deprecated": false }, @@ -3772,7 +2677,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 228 + "lineNumber": 229 }, "deprecated": false } @@ -3788,7 +2693,7 @@ "description": [], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 124 + "lineNumber": 125 }, "deprecated": false, "children": [ @@ -3804,7 +2709,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 125 + "lineNumber": 126 }, "deprecated": false }, @@ -3820,7 +2725,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 126 + "lineNumber": 127 }, "deprecated": false }, @@ -3836,7 +2741,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 127 + "lineNumber": 128 }, "deprecated": false } @@ -3956,7 +2861,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 130 + "lineNumber": 131 }, "deprecated": false, "children": [ @@ -3979,18 +2884,19 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 131 + "lineNumber": 132 }, "deprecated": false }, { "parentPluginId": "cases", "id": "def-common.FetchCasesProps.filterOptions", - "type": "Object", + "type": "CompoundType", "tags": [], "label": "filterOptions", "description": [], "signature": [ + "(", { "pluginId": "cases", "scope": "common", @@ -3998,11 +2904,11 @@ "section": "def-common.FilterOptions", "text": "FilterOptions" }, - " | undefined" + " & { owner: string[]; }) | undefined" ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 132 + "lineNumber": 133 }, "deprecated": false } @@ -4018,7 +2924,7 @@ "description": [], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 158 + "lineNumber": 159 }, "deprecated": false, "children": [ @@ -4031,7 +2937,7 @@ "description": [], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 159 + "lineNumber": 160 }, "deprecated": false }, @@ -4047,7 +2953,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 160 + "lineNumber": 161 }, "deprecated": false } @@ -4063,7 +2969,7 @@ "description": [], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 98 + "lineNumber": 99 }, "deprecated": false, "children": [ @@ -4076,7 +2982,7 @@ "description": [], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 99 + "lineNumber": 100 }, "deprecated": false }, @@ -4099,7 +3005,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 100 + "lineNumber": 101 }, "deprecated": false }, @@ -4115,7 +3021,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 101 + "lineNumber": 102 }, "deprecated": false }, @@ -4131,7 +3037,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 102 + "lineNumber": 103 }, "deprecated": false }, @@ -4147,7 +3053,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 103 + "lineNumber": 104 }, "deprecated": false } @@ -4163,7 +3069,7 @@ "description": [], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 91 + "lineNumber": 92 }, "deprecated": false, "children": [ @@ -4176,7 +3082,7 @@ "description": [], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 92 + "lineNumber": 93 }, "deprecated": false }, @@ -4189,7 +3095,7 @@ "description": [], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 93 + "lineNumber": 94 }, "deprecated": false }, @@ -4211,7 +3117,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 94 + "lineNumber": 95 }, "deprecated": false }, @@ -4227,7 +3133,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 95 + "lineNumber": 96 }, "deprecated": false } @@ -4243,7 +3149,7 @@ "description": [], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 178 + "lineNumber": 179 }, "deprecated": false, "children": [ @@ -4259,7 +3165,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 179 + "lineNumber": 180 }, "deprecated": false }, @@ -4275,7 +3181,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 180 + "lineNumber": 181 }, "deprecated": false }, @@ -4291,7 +3197,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 181 + "lineNumber": 182 }, "deprecated": false }, @@ -4307,7 +3213,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 182 + "lineNumber": 183 }, "deprecated": false }, @@ -4323,7 +3229,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 183 + "lineNumber": 184 }, "deprecated": false }, @@ -4339,7 +3245,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 184 + "lineNumber": 185 }, "deprecated": false }, @@ -4355,7 +3261,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 185 + "lineNumber": 186 }, "deprecated": false }, @@ -4371,7 +3277,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 186 + "lineNumber": 187 }, "deprecated": false }, @@ -4387,7 +3293,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 187 + "lineNumber": 188 }, "deprecated": false }, @@ -4403,7 +3309,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 188 + "lineNumber": 189 }, "deprecated": false }, @@ -4419,7 +3325,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 189 + "lineNumber": 190 }, "deprecated": false }, @@ -4435,7 +3341,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 190 + "lineNumber": 191 }, "deprecated": false }, @@ -4451,7 +3357,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 191 + "lineNumber": 192 }, "deprecated": false }, @@ -4467,7 +3373,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 192 + "lineNumber": 193 }, "deprecated": false }, @@ -4483,7 +3389,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 193 + "lineNumber": 194 }, "deprecated": false }, @@ -4499,7 +3405,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 194 + "lineNumber": 195 }, "deprecated": false }, @@ -4515,7 +3421,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 195 + "lineNumber": 196 }, "deprecated": false }, @@ -4531,7 +3437,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 196 + "lineNumber": 197 }, "deprecated": false }, @@ -4547,7 +3453,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 197 + "lineNumber": 198 }, "deprecated": false }, @@ -4563,7 +3469,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 198 + "lineNumber": 199 }, "deprecated": false }, @@ -4579,7 +3485,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 199 + "lineNumber": 200 }, "deprecated": false }, @@ -4595,7 +3501,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 200 + "lineNumber": 201 }, "deprecated": false }, @@ -4611,7 +3517,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 201 + "lineNumber": 202 }, "deprecated": false }, @@ -4627,7 +3533,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 202 + "lineNumber": 203 }, "deprecated": false }, @@ -4643,7 +3549,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 203 + "lineNumber": 204 }, "deprecated": false }, @@ -4659,7 +3565,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 204 + "lineNumber": 205 }, "deprecated": false }, @@ -4675,7 +3581,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 205 + "lineNumber": 206 }, "deprecated": false }, @@ -4691,7 +3597,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 206 + "lineNumber": 207 }, "deprecated": false }, @@ -4707,7 +3613,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 207 + "lineNumber": 208 }, "deprecated": false }, @@ -4723,7 +3629,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 208 + "lineNumber": 209 }, "deprecated": false }, @@ -4739,7 +3645,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 209 + "lineNumber": 210 }, "deprecated": false }, @@ -4755,7 +3661,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 210 + "lineNumber": 211 }, "deprecated": false }, @@ -4771,7 +3677,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 211 + "lineNumber": 212 }, "deprecated": false }, @@ -4787,7 +3693,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 212 + "lineNumber": 213 }, "deprecated": false } @@ -4803,7 +3709,7 @@ "description": [], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 215 + "lineNumber": 216 }, "deprecated": false, "children": [ @@ -4826,7 +3732,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 216 + "lineNumber": 217 }, "deprecated": false }, @@ -4842,7 +3748,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 217 + "lineNumber": 218 }, "deprecated": false }, @@ -4858,7 +3764,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 218 + "lineNumber": 219 }, "deprecated": false }, @@ -4874,7 +3780,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 219 + "lineNumber": 220 }, "deprecated": false }, @@ -4890,7 +3796,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 222 + "lineNumber": 223 }, "deprecated": false } @@ -4916,7 +3822,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 75 + "lineNumber": 76 }, "deprecated": false, "children": [ @@ -4938,7 +3844,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 76 + "lineNumber": 77 }, "deprecated": false }, @@ -4951,7 +3857,7 @@ "description": [], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 77 + "lineNumber": 78 }, "deprecated": false } @@ -4967,7 +3873,7 @@ "description": [], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 168 + "lineNumber": 169 }, "deprecated": false, "children": [ @@ -4983,7 +3889,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 169 + "lineNumber": 170 }, "deprecated": false }, @@ -5039,7 +3945,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 170 + "lineNumber": 171 }, "deprecated": false }, @@ -5055,7 +3961,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 171 + "lineNumber": 172 }, "deprecated": false }, @@ -5079,7 +3985,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 172 + "lineNumber": 173 }, "deprecated": false }, @@ -5101,7 +4007,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 173 + "lineNumber": 174 }, "deprecated": false }, @@ -5117,7 +4023,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 174 + "lineNumber": 175 }, "deprecated": false }, @@ -5133,7 +4039,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 175 + "lineNumber": 176 }, "deprecated": false } @@ -5153,7 +4059,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/cases/comment.ts", - "lineNumber": 33 + "lineNumber": 34 }, "deprecated": false, "initialIsOpen": false @@ -5195,7 +4101,7 @@ "description": [], "source": { "path": "x-pack/plugins/cases/common/api/cases/comment.ts", - "lineNumber": 51 + "lineNumber": 53 }, "deprecated": false, "initialIsOpen": false @@ -5223,7 +4129,7 @@ "description": [], "source": { "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 119 + "lineNumber": 120 }, "deprecated": false, "initialIsOpen": false @@ -5242,7 +4148,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/constants.ts", - "lineNumber": 41 + "lineNumber": 60 }, "deprecated": false, "initialIsOpen": false @@ -5261,7 +4167,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/constants.ts", - "lineNumber": 40 + "lineNumber": 59 }, "deprecated": false, "initialIsOpen": false @@ -5345,7 +4251,7 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".user; } & { associationType: ", + ".user; owner: string; } & { associationType: ", { "pluginId": "cases", "scope": "common", @@ -5353,7 +4259,7 @@ "section": "def-common.AssociationType", "text": "AssociationType" }, - "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }) | ({ type: ", + "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; owner: string; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }) | ({ type: ", { "pluginId": "cases", "scope": "common", @@ -5369,7 +4275,7 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".generatedAlert; alertId: string | string[]; index: string | string[]; rule: { id: string | null; name: string | null; }; } & { associationType: ", + ".generatedAlert; alertId: string | string[]; index: string | string[]; rule: { id: string | null; name: string | null; }; owner: string; } & { associationType: ", { "pluginId": "cases", "scope": "common", @@ -5377,11 +4283,45 @@ "section": "def-common.AssociationType", "text": "AssociationType" }, - "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }))[]" + "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; owner: string; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }))[]" ], "source": { "path": "x-pack/plugins/cases/common/api/cases/comment.ts", - "lineNumber": 135 + "lineNumber": 149 + }, + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "cases", + "id": "def-common.AllReportersFindRequest", + "type": "Type", + "tags": [], + "label": "AllReportersFindRequest", + "description": [], + "signature": [ + "{ owner?: string | string[] | undefined; }" + ], + "source": { + "path": "x-pack/plugins/cases/common/api/cases/case.ts", + "lineNumber": 313 + }, + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "cases", + "id": "def-common.AllTagsFindRequest", + "type": "Type", + "tags": [], + "label": "AllTagsFindRequest", + "description": [], + "signature": [ + "{ owner?: string | string[] | undefined; }" + ], + "source": { + "path": "x-pack/plugins/cases/common/api/cases/case.ts", + "lineNumber": 312 }, "deprecated": false, "initialIsOpen": false @@ -5427,7 +4367,40 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".generatedAlert; alertId: string | string[]; index: string | string[]; rule: { id: string | null; name: string | null; }; } & { associationType: ", + ".generatedAlert; alertId: string | string[]; index: string | string[]; rule: { id: string | null; name: string | null; }; owner: string; } & { associationType: ", + { + "pluginId": "cases", + "scope": "common", + "docId": "kibCasesPluginApi", + "section": "def-common.AssociationType", + "text": "AssociationType" + }, + "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; owner: string; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; }" + ], + "source": { + "path": "x-pack/plugins/cases/common/api/cases/comment.ts", + "lineNumber": 143 + }, + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "cases", + "id": "def-common.AttributesTypeUser", + "type": "Type", + "tags": [], + "label": "AttributesTypeUser", + "description": [], + "signature": [ + "{ comment: string; type: ", + { + "pluginId": "cases", + "scope": "common", + "docId": "kibCasesPluginApi", + "section": "def-common.CommentType", + "text": "CommentType" + }, + ".user; owner: string; } & { associationType: ", { "pluginId": "cases", "scope": "common", @@ -5435,11 +4408,11 @@ "section": "def-common.AssociationType", "text": "AssociationType" }, - "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; }" + "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; owner: string; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; }" ], "source": { "path": "x-pack/plugins/cases/common/api/cases/comment.ts", - "lineNumber": 130 + "lineNumber": 144 }, "deprecated": false, "initialIsOpen": false @@ -5453,7 +4426,7 @@ "description": [], "source": { "path": "x-pack/plugins/cases/common/constants.ts", - "lineNumber": 34 + "lineNumber": 53 }, "deprecated": false, "initialIsOpen": false @@ -5467,7 +4440,24 @@ "description": [], "source": { "path": "x-pack/plugins/cases/common/constants.ts", - "lineNumber": 27 + "lineNumber": 46 + }, + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "cases", + "id": "def-common.CASE_COMMENT_SAVED_OBJECT", + "type": "string", + "tags": [], + "label": "CASE_COMMENT_SAVED_OBJECT", + "description": [], + "signature": [ + "\"cases-comments\"" + ], + "source": { + "path": "x-pack/plugins/cases/common/constants.ts", + "lineNumber": 16 }, "deprecated": false, "initialIsOpen": false @@ -5481,7 +4471,7 @@ "description": [], "source": { "path": "x-pack/plugins/cases/common/constants.ts", - "lineNumber": 26 + "lineNumber": 45 }, "deprecated": false, "initialIsOpen": false @@ -5495,7 +4485,38 @@ "description": [], "source": { "path": "x-pack/plugins/cases/common/constants.ts", - "lineNumber": 19 + "lineNumber": 38 + }, + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "cases", + "id": "def-common.CASE_CONFIGURE_DETAILS_URL", + "type": "string", + "tags": [], + "label": "CASE_CONFIGURE_DETAILS_URL", + "description": [], + "source": { + "path": "x-pack/plugins/cases/common/constants.ts", + "lineNumber": 37 + }, + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "cases", + "id": "def-common.CASE_CONFIGURE_SAVED_OBJECT", + "type": "string", + "tags": [], + "label": "CASE_CONFIGURE_SAVED_OBJECT", + "description": [], + "signature": [ + "\"cases-configure\"" + ], + "source": { + "path": "x-pack/plugins/cases/common/constants.ts", + "lineNumber": 17 }, "deprecated": false, "initialIsOpen": false @@ -5509,7 +4530,24 @@ "description": [], "source": { "path": "x-pack/plugins/cases/common/constants.ts", - "lineNumber": 18 + "lineNumber": 36 + }, + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "cases", + "id": "def-common.CASE_CONNECTOR_MAPPINGS_SAVED_OBJECT", + "type": "string", + "tags": [], + "label": "CASE_CONNECTOR_MAPPINGS_SAVED_OBJECT", + "description": [], + "signature": [ + "\"cases-connector-mappings\"" + ], + "source": { + "path": "x-pack/plugins/cases/common/constants.ts", + "lineNumber": 13 }, "deprecated": false, "initialIsOpen": false @@ -5523,7 +4561,7 @@ "description": [], "source": { "path": "x-pack/plugins/cases/common/constants.ts", - "lineNumber": 17 + "lineNumber": 35 }, "deprecated": false, "initialIsOpen": false @@ -5537,7 +4575,7 @@ "description": [], "source": { "path": "x-pack/plugins/cases/common/constants.ts", - "lineNumber": 28 + "lineNumber": 47 }, "deprecated": false, "initialIsOpen": false @@ -5551,7 +4589,24 @@ "description": [], "source": { "path": "x-pack/plugins/cases/common/constants.ts", - "lineNumber": 29 + "lineNumber": 48 + }, + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "cases", + "id": "def-common.CASE_SAVED_OBJECT", + "type": "string", + "tags": [], + "label": "CASE_SAVED_OBJECT", + "description": [], + "signature": [ + "\"cases\"" + ], + "source": { + "path": "x-pack/plugins/cases/common/constants.ts", + "lineNumber": 12 }, "deprecated": false, "initialIsOpen": false @@ -5565,7 +4620,7 @@ "description": [], "source": { "path": "x-pack/plugins/cases/common/constants.ts", - "lineNumber": 30 + "lineNumber": 49 }, "deprecated": false, "initialIsOpen": false @@ -5579,7 +4634,24 @@ "description": [], "source": { "path": "x-pack/plugins/cases/common/constants.ts", - "lineNumber": 31 + "lineNumber": 50 + }, + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "cases", + "id": "def-common.CASE_USER_ACTION_SAVED_OBJECT", + "type": "string", + "tags": [], + "label": "CASE_USER_ACTION_SAVED_OBJECT", + "description": [], + "signature": [ + "\"cases-user-actions\"" + ], + "source": { + "path": "x-pack/plugins/cases/common/constants.ts", + "lineNumber": 15 }, "deprecated": false, "initialIsOpen": false @@ -5593,7 +4665,7 @@ "description": [], "source": { "path": "x-pack/plugins/cases/common/constants.ts", - "lineNumber": 32 + "lineNumber": 51 }, "deprecated": false, "initialIsOpen": false @@ -5662,11 +4734,11 @@ "section": "def-common.ConnectorTypes", "text": "ConnectorTypes" }, - ".none; fields: null; }); settings: { syncAlerts: boolean; }; } & { closed_at: string | null; closed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; external_service: ({ connector_id: string; connector_name: string; external_id: string; external_title: string; external_url: string; } & { pushed_at: string; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; }) | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; }" + ".none; fields: null; }); settings: { syncAlerts: boolean; }; owner: string; } & { closed_at: string | null; closed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; external_service: ({ connector_id: string; connector_name: string; external_id: string; external_title: string; external_url: string; } & { pushed_at: string; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; }) | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; }" ], "source": { "path": "x-pack/plugins/cases/common/api/cases/case.ts", - "lineNumber": 175 + "lineNumber": 288 }, "deprecated": false, "initialIsOpen": false @@ -5757,7 +4829,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/cases/case.ts", - "lineNumber": 189 + "lineNumber": 303 }, "deprecated": false, "initialIsOpen": false @@ -5826,11 +4898,11 @@ "section": "def-common.ConnectorTypes", "text": "ConnectorTypes" }, - ".none; fields: null; }) | undefined; settings?: { syncAlerts: boolean; } | undefined; } & { id: string; version: string; }" + ".none; fields: null; }) | undefined; settings?: { syncAlerts: boolean; } | undefined; owner?: string | undefined; } & { id: string; version: string; }" ], "source": { "path": "x-pack/plugins/cases/common/api/cases/case.ts", - "lineNumber": 187 + "lineNumber": 301 }, "deprecated": false, "initialIsOpen": false @@ -5891,11 +4963,11 @@ "section": "def-common.ConnectorTypes", "text": "ConnectorTypes" }, - ".none; fields: null; }); settings: { syncAlerts: boolean; }; }" + ".none; fields: null; }); settings: { syncAlerts: boolean; }; owner: string; }" ], "source": { "path": "x-pack/plugins/cases/common/api/cases/case.ts", - "lineNumber": 182 + "lineNumber": 295 }, "deprecated": false, "initialIsOpen": false @@ -5964,7 +5036,7 @@ "section": "def-common.ConnectorTypes", "text": "ConnectorTypes" }, - ".none; fields: null; }); settings: { syncAlerts: boolean; }; } & { closed_at: string | null; closed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; external_service: ({ connector_id: string; connector_name: string; external_id: string; external_title: string; external_url: string; } & { pushed_at: string; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; }) | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; totalComment: number; totalAlerts: number; version: string; } & { subCaseIds?: string[] | undefined; subCases?: ({ status: ", + ".none; fields: null; }); settings: { syncAlerts: boolean; }; owner: string; } & { closed_at: string | null; closed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; external_service: ({ connector_id: string; connector_name: string; external_id: string; external_title: string; external_url: string; } & { pushed_at: string; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; }) | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; totalComment: number; totalAlerts: number; version: string; } & { subCaseIds?: string[] | undefined; subCases?: ({ status: ", { "pluginId": "cases", "scope": "common", @@ -5972,7 +5044,7 @@ "section": "def-common.CaseStatuses", "text": "CaseStatuses" }, - "; } & { closed_at: string | null; closed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; totalComment: number; totalAlerts: number; version: string; } & { comments?: (({ comment: string; type: ", + "; } & { closed_at: string | null; closed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; owner: string; } & { id: string; totalComment: number; totalAlerts: number; version: string; } & { comments?: (({ comment: string; type: ", { "pluginId": "cases", "scope": "common", @@ -5980,7 +5052,7 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".user; } & { associationType: ", + ".user; owner: string; } & { associationType: ", { "pluginId": "cases", "scope": "common", @@ -5988,7 +5060,7 @@ "section": "def-common.AssociationType", "text": "AssociationType" }, - "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }) | ({ type: ", + "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; owner: string; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }) | ({ type: ", { "pluginId": "cases", "scope": "common", @@ -6004,7 +5076,7 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".generatedAlert; alertId: string | string[]; index: string | string[]; rule: { id: string | null; name: string | null; }; } & { associationType: ", + ".generatedAlert; alertId: string | string[]; index: string | string[]; rule: { id: string | null; name: string | null; }; owner: string; } & { associationType: ", { "pluginId": "cases", "scope": "common", @@ -6012,7 +5084,7 @@ "section": "def-common.AssociationType", "text": "AssociationType" }, - "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }))[] | undefined; })[] | undefined; comments?: (({ comment: string; type: ", + "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; owner: string; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }))[] | undefined; })[] | undefined; comments?: (({ comment: string; type: ", { "pluginId": "cases", "scope": "common", @@ -6020,7 +5092,7 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".user; } & { associationType: ", + ".user; owner: string; } & { associationType: ", { "pluginId": "cases", "scope": "common", @@ -6028,7 +5100,7 @@ "section": "def-common.AssociationType", "text": "AssociationType" }, - "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }) | ({ type: ", + "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; owner: string; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }) | ({ type: ", { "pluginId": "cases", "scope": "common", @@ -6044,7 +5116,7 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".generatedAlert; alertId: string | string[]; index: string | string[]; rule: { id: string | null; name: string | null; }; } & { associationType: ", + ".generatedAlert; alertId: string | string[]; index: string | string[]; rule: { id: string | null; name: string | null; }; owner: string; } & { associationType: ", { "pluginId": "cases", "scope": "common", @@ -6052,11 +5124,11 @@ "section": "def-common.AssociationType", "text": "AssociationType" }, - "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }))[] | undefined; }" + "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; owner: string; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }))[] | undefined; }" ], "source": { "path": "x-pack/plugins/cases/common/api/cases/case.ts", - "lineNumber": 183 + "lineNumber": 296 }, "deprecated": false, "initialIsOpen": false @@ -6074,31 +5146,105 @@ "\"/api/cases\"" ], "source": { - "path": "x-pack/plugins/cases/common/constants.ts", - "lineNumber": 16 + "path": "x-pack/plugins/cases/common/constants.ts", + "lineNumber": 34 + }, + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "cases", + "id": "def-common.CasesByAlertIDRequest", + "type": "Type", + "tags": [], + "label": "CasesByAlertIDRequest", + "description": [], + "signature": [ + "{ owner?: string | string[] | undefined; }" + ], + "source": { + "path": "x-pack/plugins/cases/common/api/cases/case.ts", + "lineNumber": 299 + }, + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "cases", + "id": "def-common.CasesClientPostRequest", + "type": "Type", + "tags": [], + "label": "CasesClientPostRequest", + "description": [ + "\nThis field differs from the CasePostRequest in that the post request's type field can be optional. This type requires\nthat the type field be defined. The CasePostRequest should be used in most places (the UI etc). This type is really\nonly necessary for validation." + ], + "signature": [ + "{ type: ", + { + "pluginId": "cases", + "scope": "common", + "docId": "kibCasesPluginApi", + "section": "def-common.CaseType", + "text": "CaseType" + }, + "; description: string; tags: string[]; title: string; connector: ({ id: string; name: string; } & { type: ", + { + "pluginId": "cases", + "scope": "common", + "docId": "kibCasesPluginApi", + "section": "def-common.ConnectorTypes", + "text": "ConnectorTypes" + }, + ".jira; fields: { issueType: string | null; priority: string | null; parent: string | null; } | null; }) | ({ id: string; name: string; } & { type: ", + { + "pluginId": "cases", + "scope": "common", + "docId": "kibCasesPluginApi", + "section": "def-common.ConnectorTypes", + "text": "ConnectorTypes" + }, + ".resilient; fields: { incidentTypes: string[] | null; severityCode: string | null; } | null; }) | ({ id: string; name: string; } & { type: ", + { + "pluginId": "cases", + "scope": "common", + "docId": "kibCasesPluginApi", + "section": "def-common.ConnectorTypes", + "text": "ConnectorTypes" + }, + ".serviceNowITSM; fields: { impact: string | null; severity: string | null; urgency: string | null; category: string | null; subcategory: string | null; } | null; }) | ({ id: string; name: string; } & { type: ", + { + "pluginId": "cases", + "scope": "common", + "docId": "kibCasesPluginApi", + "section": "def-common.ConnectorTypes", + "text": "ConnectorTypes" + }, + ".serviceNowSIR; fields: { category: string | null; destIp: boolean | null; malwareHash: boolean | null; malwareUrl: boolean | null; priority: string | null; sourceIp: boolean | null; subcategory: string | null; } | null; }) | ({ id: string; name: string; } & { type: ", + { + "pluginId": "cases", + "scope": "common", + "docId": "kibCasesPluginApi", + "section": "def-common.ConnectorTypes", + "text": "ConnectorTypes" + }, + ".none; fields: null; }); settings: { syncAlerts: boolean; }; owner: string; }" + ], + "source": { + "path": "x-pack/plugins/cases/common/api/cases/case.ts", + "lineNumber": 294 }, "deprecated": false, "initialIsOpen": false }, { "parentPluginId": "cases", - "id": "def-common.CasesClientPostRequest", + "id": "def-common.CasesConfigurationsResponse", "type": "Type", "tags": [], - "label": "CasesClientPostRequest", - "description": [ - "\nThis field differs from the CasePostRequest in that the post request's type field can be optional. This type requires\nthat the type field be defined. The CasePostRequest should be used in most places (the UI etc). This type is really\nonly necessary for validation." - ], + "label": "CasesConfigurationsResponse", + "description": [], "signature": [ - "{ type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CaseType", - "text": "CaseType" - }, - "; description: string; tags: string[]; title: string; connector: ({ id: string; name: string; } & { type: ", + "({ connector: ({ id: string; name: string; } & { type: ", { "pluginId": "cases", "scope": "common", @@ -6138,11 +5284,11 @@ "section": "def-common.ConnectorTypes", "text": "ConnectorTypes" }, - ".none; fields: null; }); settings: { syncAlerts: boolean; }; }" + ".none; fields: null; }); closure_type: \"close-by-user\" | \"close-by-pushing\"; owner: string; } & { created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { mappings: { action_type: \"append\" | \"overwrite\" | \"nothing\"; source: \"description\" | \"title\" | \"comments\"; target: string; }[]; owner: string; } & { id: string; version: string; error: string | null; owner: string; })[]" ], "source": { - "path": "x-pack/plugins/cases/common/api/cases/case.ts", - "lineNumber": 181 + "path": "x-pack/plugins/cases/common/api/cases/configure.ts", + "lineNumber": 84 }, "deprecated": false, "initialIsOpen": false @@ -6195,11 +5341,11 @@ "section": "def-common.ConnectorTypes", "text": "ConnectorTypes" }, - ".none; fields: null; }); closure_type: \"close-by-user\" | \"close-by-pushing\"; }" + ".none; fields: null; }); closure_type: \"close-by-user\" | \"close-by-pushing\"; owner: string; }" ], "source": { "path": "x-pack/plugins/cases/common/api/cases/configure.ts", - "lineNumber": 47 + "lineNumber": 79 }, "deprecated": false, "initialIsOpen": false @@ -6252,11 +5398,11 @@ "section": "def-common.ConnectorTypes", "text": "ConnectorTypes" }, - ".none; fields: null; }); closure_type: \"close-by-user\" | \"close-by-pushing\"; } & { created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; }" + ".none; fields: null; }); closure_type: \"close-by-user\" | \"close-by-pushing\"; owner: string; } & { created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; }" ], "source": { "path": "x-pack/plugins/cases/common/api/cases/configure.ts", - "lineNumber": 50 + "lineNumber": 82 }, "deprecated": false, "initialIsOpen": false @@ -6313,7 +5459,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/cases/configure.ts", - "lineNumber": 49 + "lineNumber": 81 }, "deprecated": false, "initialIsOpen": false @@ -6366,11 +5512,11 @@ "section": "def-common.ConnectorTypes", "text": "ConnectorTypes" }, - ".none; fields: null; }); closure_type: \"close-by-user\" | \"close-by-pushing\"; }" + ".none; fields: null; }); closure_type: \"close-by-user\" | \"close-by-pushing\"; owner: string; }" ], "source": { "path": "x-pack/plugins/cases/common/api/cases/configure.ts", - "lineNumber": 48 + "lineNumber": 80 }, "deprecated": false, "initialIsOpen": false @@ -6423,11 +5569,11 @@ "section": "def-common.ConnectorTypes", "text": "ConnectorTypes" }, - ".none; fields: null; }); closure_type: \"close-by-user\" | \"close-by-pushing\"; } & { created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { mappings: { action_type: \"append\" | \"overwrite\" | \"nothing\"; source: \"description\" | \"title\" | \"comments\"; target: string; }[]; } & { version: string; error: string | null; }" + ".none; fields: null; }); closure_type: \"close-by-user\" | \"close-by-pushing\"; owner: string; } & { created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { mappings: { action_type: \"append\" | \"overwrite\" | \"nothing\"; source: \"description\" | \"title\" | \"comments\"; target: string; }[]; owner: string; } & { id: string; version: string; error: string | null; owner: string; }" ], "source": { "path": "x-pack/plugins/cases/common/api/cases/configure.ts", - "lineNumber": 51 + "lineNumber": 83 }, "deprecated": false, "initialIsOpen": false @@ -6444,7 +5590,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/cases/case.ts", - "lineNumber": 190 + "lineNumber": 304 }, "deprecated": false, "initialIsOpen": false @@ -6473,11 +5619,11 @@ "section": "def-common.CaseStatuses", "text": "CaseStatuses" }, - " | undefined; reporters?: string | string[] | undefined; defaultSearchOperator?: \"AND\" | \"OR\" | undefined; fields?: string[] | undefined; page?: number | undefined; perPage?: number | undefined; search?: string | undefined; searchFields?: string[] | undefined; sortField?: string | undefined; sortOrder?: \"asc\" | \"desc\" | undefined; }" + " | undefined; reporters?: string | string[] | undefined; defaultSearchOperator?: \"AND\" | \"OR\" | undefined; fields?: string[] | undefined; page?: number | undefined; perPage?: number | undefined; search?: string | undefined; searchFields?: string | string[] | undefined; sortField?: string | undefined; sortOrder?: \"asc\" | \"desc\" | undefined; owner?: string | string[] | undefined; }" ], "source": { "path": "x-pack/plugins/cases/common/api/cases/case.ts", - "lineNumber": 185 + "lineNumber": 298 }, "deprecated": false, "initialIsOpen": false @@ -6546,7 +5692,7 @@ "section": "def-common.ConnectorTypes", "text": "ConnectorTypes" }, - ".none; fields: null; }); settings: { syncAlerts: boolean; }; } & { closed_at: string | null; closed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; external_service: ({ connector_id: string; connector_name: string; external_id: string; external_title: string; external_url: string; } & { pushed_at: string; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; }) | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; totalComment: number; totalAlerts: number; version: string; } & { subCaseIds?: string[] | undefined; subCases?: ({ status: ", + ".none; fields: null; }); settings: { syncAlerts: boolean; }; owner: string; } & { closed_at: string | null; closed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; external_service: ({ connector_id: string; connector_name: string; external_id: string; external_title: string; external_url: string; } & { pushed_at: string; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; }) | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; totalComment: number; totalAlerts: number; version: string; } & { subCaseIds?: string[] | undefined; subCases?: ({ status: ", { "pluginId": "cases", "scope": "common", @@ -6554,7 +5700,7 @@ "section": "def-common.CaseStatuses", "text": "CaseStatuses" }, - "; } & { closed_at: string | null; closed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; totalComment: number; totalAlerts: number; version: string; } & { comments?: (({ comment: string; type: ", + "; } & { closed_at: string | null; closed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; owner: string; } & { id: string; totalComment: number; totalAlerts: number; version: string; } & { comments?: (({ comment: string; type: ", { "pluginId": "cases", "scope": "common", @@ -6562,7 +5708,7 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".user; } & { associationType: ", + ".user; owner: string; } & { associationType: ", { "pluginId": "cases", "scope": "common", @@ -6570,7 +5716,7 @@ "section": "def-common.AssociationType", "text": "AssociationType" }, - "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }) | ({ type: ", + "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; owner: string; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }) | ({ type: ", { "pluginId": "cases", "scope": "common", @@ -6586,7 +5732,7 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".generatedAlert; alertId: string | string[]; index: string | string[]; rule: { id: string | null; name: string | null; }; } & { associationType: ", + ".generatedAlert; alertId: string | string[]; index: string | string[]; rule: { id: string | null; name: string | null; }; owner: string; } & { associationType: ", { "pluginId": "cases", "scope": "common", @@ -6594,7 +5740,7 @@ "section": "def-common.AssociationType", "text": "AssociationType" }, - "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }))[] | undefined; })[] | undefined; comments?: (({ comment: string; type: ", + "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; owner: string; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }))[] | undefined; })[] | undefined; comments?: (({ comment: string; type: ", { "pluginId": "cases", "scope": "common", @@ -6602,7 +5748,7 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".user; } & { associationType: ", + ".user; owner: string; } & { associationType: ", { "pluginId": "cases", "scope": "common", @@ -6610,7 +5756,7 @@ "section": "def-common.AssociationType", "text": "AssociationType" }, - "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }) | ({ type: ", + "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; owner: string; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }) | ({ type: ", { "pluginId": "cases", "scope": "common", @@ -6626,7 +5772,7 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".generatedAlert; alertId: string | string[]; index: string | string[]; rule: { id: string | null; name: string | null; }; } & { associationType: ", + ".generatedAlert; alertId: string | string[]; index: string | string[]; rule: { id: string | null; name: string | null; }; owner: string; } & { associationType: ", { "pluginId": "cases", "scope": "common", @@ -6634,11 +5780,11 @@ "section": "def-common.AssociationType", "text": "AssociationType" }, - "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }))[] | undefined; })[]; page: number; per_page: number; total: number; } & { count_open_cases: number; count_in_progress_cases: number; count_closed_cases: number; }" + "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; owner: string; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }))[] | undefined; })[]; page: number; per_page: number; total: number; } & { count_open_cases: number; count_in_progress_cases: number; count_closed_cases: number; }" ], "source": { "path": "x-pack/plugins/cases/common/api/cases/case.ts", - "lineNumber": 186 + "lineNumber": 300 }, "deprecated": false, "initialIsOpen": false @@ -6707,11 +5853,11 @@ "section": "def-common.ConnectorTypes", "text": "ConnectorTypes" }, - ".none; fields: null; }) | undefined; settings?: { syncAlerts: boolean; } | undefined; } & { id: string; version: string; })[]; }" + ".none; fields: null; }) | undefined; settings?: { syncAlerts: boolean; } | undefined; owner?: string | undefined; } & { id: string; version: string; })[]; }" ], "source": { "path": "x-pack/plugins/cases/common/api/cases/case.ts", - "lineNumber": 188 + "lineNumber": 302 }, "deprecated": false, "initialIsOpen": false @@ -6780,7 +5926,7 @@ "section": "def-common.ConnectorTypes", "text": "ConnectorTypes" }, - ".none; fields: null; }); settings: { syncAlerts: boolean; }; } & { closed_at: string | null; closed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; external_service: ({ connector_id: string; connector_name: string; external_id: string; external_title: string; external_url: string; } & { pushed_at: string; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; }) | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; totalComment: number; totalAlerts: number; version: string; } & { subCaseIds?: string[] | undefined; subCases?: ({ status: ", + ".none; fields: null; }); settings: { syncAlerts: boolean; }; owner: string; } & { closed_at: string | null; closed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; external_service: ({ connector_id: string; connector_name: string; external_id: string; external_title: string; external_url: string; } & { pushed_at: string; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; }) | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; totalComment: number; totalAlerts: number; version: string; } & { subCaseIds?: string[] | undefined; subCases?: ({ status: ", { "pluginId": "cases", "scope": "common", @@ -6788,7 +5934,7 @@ "section": "def-common.CaseStatuses", "text": "CaseStatuses" }, - "; } & { closed_at: string | null; closed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; totalComment: number; totalAlerts: number; version: string; } & { comments?: (({ comment: string; type: ", + "; } & { closed_at: string | null; closed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; owner: string; } & { id: string; totalComment: number; totalAlerts: number; version: string; } & { comments?: (({ comment: string; type: ", { "pluginId": "cases", "scope": "common", @@ -6796,7 +5942,7 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".user; } & { associationType: ", + ".user; owner: string; } & { associationType: ", { "pluginId": "cases", "scope": "common", @@ -6804,7 +5950,7 @@ "section": "def-common.AssociationType", "text": "AssociationType" }, - "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }) | ({ type: ", + "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; owner: string; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }) | ({ type: ", { "pluginId": "cases", "scope": "common", @@ -6820,7 +5966,7 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".generatedAlert; alertId: string | string[]; index: string | string[]; rule: { id: string | null; name: string | null; }; } & { associationType: ", + ".generatedAlert; alertId: string | string[]; index: string | string[]; rule: { id: string | null; name: string | null; }; owner: string; } & { associationType: ", { "pluginId": "cases", "scope": "common", @@ -6828,7 +5974,7 @@ "section": "def-common.AssociationType", "text": "AssociationType" }, - "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }))[] | undefined; })[] | undefined; comments?: (({ comment: string; type: ", + "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; owner: string; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }))[] | undefined; })[] | undefined; comments?: (({ comment: string; type: ", { "pluginId": "cases", "scope": "common", @@ -6836,7 +5982,7 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".user; } & { associationType: ", + ".user; owner: string; } & { associationType: ", { "pluginId": "cases", "scope": "common", @@ -6844,7 +5990,7 @@ "section": "def-common.AssociationType", "text": "AssociationType" }, - "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }) | ({ type: ", + "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; owner: string; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }) | ({ type: ", { "pluginId": "cases", "scope": "common", @@ -6860,7 +6006,7 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".generatedAlert; alertId: string | string[]; index: string | string[]; rule: { id: string | null; name: string | null; }; } & { associationType: ", + ".generatedAlert; alertId: string | string[]; index: string | string[]; rule: { id: string | null; name: string | null; }; owner: string; } & { associationType: ", { "pluginId": "cases", "scope": "common", @@ -6868,11 +6014,28 @@ "section": "def-common.AssociationType", "text": "AssociationType" }, - "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }))[] | undefined; })[]" + "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; owner: string; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }))[] | undefined; })[]" ], "source": { "path": "x-pack/plugins/cases/common/api/cases/case.ts", - "lineNumber": 184 + "lineNumber": 297 + }, + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "cases", + "id": "def-common.CasesStatusRequest", + "type": "Type", + "tags": [], + "label": "CasesStatusRequest", + "description": [], + "signature": [ + "{ owner?: string | string[] | undefined; }" + ], + "source": { + "path": "x-pack/plugins/cases/common/api/cases/status.ts", + "lineNumber": 39 }, "deprecated": false, "initialIsOpen": false @@ -6889,7 +6052,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/cases/status.ts", - "lineNumber": 30 + "lineNumber": 38 }, "deprecated": false, "initialIsOpen": false @@ -6969,11 +6132,28 @@ "label": "CaseUserActionAttributes", "description": [], "signature": [ - "{ action_field: (\"status\" | \"description\" | \"title\" | \"comment\" | \"tags\" | \"settings\" | \"connector\" | \"pushed\" | \"sub_case\")[]; action: \"add\" | \"delete\" | \"create\" | \"update\" | \"push-to-service\"; action_at: string; action_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; new_value: string | null; old_value: string | null; }" + "{ action_field: (\"status\" | \"description\" | \"title\" | \"comment\" | \"tags\" | \"settings\" | \"owner\" | \"connector\" | \"pushed\" | \"sub_case\")[]; action: \"add\" | \"delete\" | \"create\" | \"update\" | \"push-to-service\"; action_at: string; action_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; new_value: string | null; old_value: string | null; owner: string; }" ], "source": { "path": "x-pack/plugins/cases/common/api/cases/user_actions.ts", - "lineNumber": 59 + "lineNumber": 62 + }, + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "cases", + "id": "def-common.CaseUserActionResponse", + "type": "Type", + "tags": [], + "label": "CaseUserActionResponse", + "description": [], + "signature": [ + "{ action_field: (\"status\" | \"description\" | \"title\" | \"comment\" | \"tags\" | \"settings\" | \"owner\" | \"connector\" | \"pushed\" | \"sub_case\")[]; action: \"add\" | \"delete\" | \"create\" | \"update\" | \"push-to-service\"; action_at: string; action_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; new_value: string | null; old_value: string | null; owner: string; } & { action_id: string; case_id: string; comment_id: string | null; } & { sub_case_id?: string | undefined; }" + ], + "source": { + "path": "x-pack/plugins/cases/common/api/cases/user_actions.ts", + "lineNumber": 64 }, "deprecated": false, "initialIsOpen": false @@ -6986,11 +6166,11 @@ "label": "CaseUserActionsResponse", "description": [], "signature": [ - "({ action_field: (\"status\" | \"description\" | \"title\" | \"comment\" | \"tags\" | \"settings\" | \"connector\" | \"pushed\" | \"sub_case\")[]; action: \"add\" | \"delete\" | \"create\" | \"update\" | \"push-to-service\"; action_at: string; action_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; new_value: string | null; old_value: string | null; } & { action_id: string; case_id: string; comment_id: string | null; } & { sub_case_id?: string | undefined; })[]" + "({ action_field: (\"status\" | \"description\" | \"title\" | \"comment\" | \"tags\" | \"settings\" | \"owner\" | \"connector\" | \"pushed\" | \"sub_case\")[]; action: \"add\" | \"delete\" | \"create\" | \"update\" | \"push-to-service\"; action_at: string; action_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; new_value: string | null; old_value: string | null; owner: string; } & { action_id: string; case_id: string; comment_id: string | null; } & { sub_case_id?: string | undefined; })[]" ], "source": { "path": "x-pack/plugins/cases/common/api/cases/user_actions.ts", - "lineNumber": 60 + "lineNumber": 63 }, "deprecated": false, "initialIsOpen": false @@ -7007,7 +6187,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/cases/configure.ts", - "lineNumber": 46 + "lineNumber": 78 }, "deprecated": false, "initialIsOpen": false @@ -7028,7 +6208,7 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".user; } & { associationType: ", + ".user; owner: string; } & { associationType: ", { "pluginId": "cases", "scope": "common", @@ -7068,7 +6248,7 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".generatedAlert; alertId: string | string[]; index: string | string[]; rule: { id: string | null; name: string | null; }; } & { associationType: ", + ".generatedAlert; alertId: string | string[]; index: string | string[]; rule: { id: string | null; name: string | null; }; owner: string; } & { associationType: ", { "pluginId": "cases", "scope": "common", @@ -7117,7 +6297,7 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".user; } & { associationType: ", + ".user; owner: string; } & { associationType: ", { "pluginId": "cases", "scope": "common", @@ -7125,7 +6305,7 @@ "section": "def-common.AssociationType", "text": "AssociationType" }, - "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; }) | ({ type: ", + "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; owner: string; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; }) | ({ type: ", { "pluginId": "cases", "scope": "common", @@ -7141,7 +6321,7 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".generatedAlert; alertId: string | string[]; index: string | string[]; rule: { id: string | null; name: string | null; }; } & { associationType: ", + ".generatedAlert; alertId: string | string[]; index: string | string[]; rule: { id: string | null; name: string | null; }; owner: string; } & { associationType: ", { "pluginId": "cases", "scope": "common", @@ -7149,11 +6329,11 @@ "section": "def-common.AssociationType", "text": "AssociationType" }, - "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; })" + "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; owner: string; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; })" ], "source": { "path": "x-pack/plugins/cases/common/api/cases/comment.ts", - "lineNumber": 131 + "lineNumber": 145 }, "deprecated": false, "initialIsOpen": false @@ -7174,7 +6354,7 @@ "section": "def-common.AssociationType", "text": "AssociationType" }, - " | undefined; created_at?: string | undefined; created_by?: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | undefined; pushed_at?: string | null | undefined; pushed_by?: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null | undefined; updated_at?: string | null | undefined; updated_by?: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null | undefined; } | ({ type?: ", + " | undefined; created_at?: string | undefined; created_by?: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | undefined; owner?: string | undefined; pushed_at?: string | null | undefined; pushed_by?: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null | undefined; updated_at?: string | null | undefined; updated_by?: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null | undefined; } | ({ type?: ", { "pluginId": "cases", "scope": "common", @@ -7190,7 +6370,7 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".generatedAlert | undefined; alertId?: string | string[] | undefined; index?: string | string[] | undefined; rule?: { id: string | null; name: string | null; } | undefined; } & { associationType?: ", + ".generatedAlert | undefined; alertId?: string | string[] | undefined; index?: string | string[] | undefined; rule?: { id: string | null; name: string | null; } | undefined; owner?: string | undefined; } & { associationType?: ", { "pluginId": "cases", "scope": "common", @@ -7198,11 +6378,11 @@ "section": "def-common.AssociationType", "text": "AssociationType" }, - " | undefined; created_at?: string | undefined; created_by?: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | undefined; pushed_at?: string | null | undefined; pushed_by?: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null | undefined; updated_at?: string | null | undefined; updated_by?: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null | undefined; })" + " | undefined; created_at?: string | undefined; created_by?: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | undefined; owner?: string | undefined; pushed_at?: string | null | undefined; pushed_by?: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null | undefined; updated_at?: string | null | undefined; updated_by?: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null | undefined; })" ], "source": { "path": "x-pack/plugins/cases/common/api/cases/comment.ts", - "lineNumber": 138 + "lineNumber": 152 }, "deprecated": false, "initialIsOpen": false @@ -7223,7 +6403,7 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".user; } & { id: string; version: string; }) | ({ type: ", + ".user; owner: string; } & { id: string; version: string; }) | ({ type: ", { "pluginId": "cases", "scope": "common", @@ -7239,11 +6419,11 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".generatedAlert; alertId: string | string[]; index: string | string[]; rule: { id: string | null; name: string | null; }; } & { id: string; version: string; })" + ".generatedAlert; alertId: string | string[]; index: string | string[]; rule: { id: string | null; name: string | null; }; owner: string; } & { id: string; version: string; })" ], "source": { "path": "x-pack/plugins/cases/common/api/cases/comment.ts", - "lineNumber": 137 + "lineNumber": 151 }, "deprecated": false, "initialIsOpen": false @@ -7264,7 +6444,7 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".user; } | { type: ", + ".user; owner: string; } | { type: ", { "pluginId": "cases", "scope": "common", @@ -7280,11 +6460,11 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".generatedAlert; alertId: string | string[]; index: string | string[]; rule: { id: string | null; name: string | null; }; }" + ".generatedAlert; alertId: string | string[]; index: string | string[]; rule: { id: string | null; name: string | null; }; owner: string; }" ], "source": { "path": "x-pack/plugins/cases/common/api/cases/comment.ts", - "lineNumber": 132 + "lineNumber": 146 }, "deprecated": false, "initialIsOpen": false @@ -7313,11 +6493,11 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".generatedAlert; alertId: string | string[]; index: string | string[]; rule: { id: string | null; name: string | null; }; }" + ".generatedAlert; alertId: string | string[]; index: string | string[]; rule: { id: string | null; name: string | null; }; owner: string; }" ], "source": { "path": "x-pack/plugins/cases/common/api/cases/comment.ts", - "lineNumber": 140 + "lineNumber": 154 }, "deprecated": false, "initialIsOpen": false @@ -7338,11 +6518,11 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".user; }" + ".user; owner: string; }" ], "source": { "path": "x-pack/plugins/cases/common/api/cases/comment.ts", - "lineNumber": 139 + "lineNumber": 153 }, "deprecated": false, "initialIsOpen": false @@ -7363,7 +6543,7 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".user; } & { associationType: ", + ".user; owner: string; } & { associationType: ", { "pluginId": "cases", "scope": "common", @@ -7371,7 +6551,7 @@ "section": "def-common.AssociationType", "text": "AssociationType" }, - "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }) | ({ type: ", + "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; owner: string; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }) | ({ type: ", { "pluginId": "cases", "scope": "common", @@ -7387,7 +6567,7 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".generatedAlert; alertId: string | string[]; index: string | string[]; rule: { id: string | null; name: string | null; }; } & { associationType: ", + ".generatedAlert; alertId: string | string[]; index: string | string[]; rule: { id: string | null; name: string | null; }; owner: string; } & { associationType: ", { "pluginId": "cases", "scope": "common", @@ -7395,11 +6575,11 @@ "section": "def-common.AssociationType", "text": "AssociationType" }, - "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; })" + "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; owner: string; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; })" ], "source": { "path": "x-pack/plugins/cases/common/api/cases/comment.ts", - "lineNumber": 133 + "lineNumber": 147 }, "deprecated": false, "initialIsOpen": false @@ -7428,7 +6608,7 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".generatedAlert; alertId: string | string[]; index: string | string[]; rule: { id: string | null; name: string | null; }; } & { associationType: ", + ".generatedAlert; alertId: string | string[]; index: string | string[]; rule: { id: string | null; name: string | null; }; owner: string; } & { associationType: ", { "pluginId": "cases", "scope": "common", @@ -7436,11 +6616,11 @@ "section": "def-common.AssociationType", "text": "AssociationType" }, - "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }" + "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; owner: string; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }" ], "source": { "path": "x-pack/plugins/cases/common/api/cases/comment.ts", - "lineNumber": 134 + "lineNumber": 148 }, "deprecated": false, "initialIsOpen": false @@ -7461,7 +6641,7 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".user; } & { associationType: ", + ".user; owner: string; } & { associationType: ", { "pluginId": "cases", "scope": "common", @@ -7469,7 +6649,7 @@ "section": "def-common.AssociationType", "text": "AssociationType" }, - "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }) | ({ type: ", + "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; owner: string; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }) | ({ type: ", { "pluginId": "cases", "scope": "common", @@ -7485,7 +6665,7 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".generatedAlert; alertId: string | string[]; index: string | string[]; rule: { id: string | null; name: string | null; }; } & { associationType: ", + ".generatedAlert; alertId: string | string[]; index: string | string[]; rule: { id: string | null; name: string | null; }; owner: string; } & { associationType: ", { "pluginId": "cases", "scope": "common", @@ -7493,11 +6673,11 @@ "section": "def-common.AssociationType", "text": "AssociationType" }, - "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }))[]; page: number; per_page: number; total: number; }" + "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; owner: string; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }))[]; page: number; per_page: number; total: number; }" ], "source": { "path": "x-pack/plugins/cases/common/api/cases/comment.ts", - "lineNumber": 136 + "lineNumber": 150 }, "deprecated": false, "initialIsOpen": false @@ -7514,7 +6694,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/connectors/mappings.ts", - "lineNumber": 48 + "lineNumber": 49 }, "deprecated": false, "initialIsOpen": false @@ -7569,11 +6749,11 @@ "label": "ConnectorMappings", "description": [], "signature": [ - "{ mappings: { action_type: \"append\" | \"overwrite\" | \"nothing\"; source: \"description\" | \"title\" | \"comments\"; target: string; }[]; }" + "{ mappings: { action_type: \"append\" | \"overwrite\" | \"nothing\"; source: \"description\" | \"title\" | \"comments\"; target: string; }[]; owner: string; }" ], "source": { "path": "x-pack/plugins/cases/common/api/connectors/mappings.ts", - "lineNumber": 37 + "lineNumber": 38 }, "deprecated": false, "initialIsOpen": false @@ -7590,7 +6770,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/connectors/mappings.ts", - "lineNumber": 36 + "lineNumber": 37 }, "deprecated": false, "initialIsOpen": false @@ -7775,7 +6955,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/constants.ts", - "lineNumber": 63 + "lineNumber": 90 }, "deprecated": false, "initialIsOpen": false @@ -7844,7 +7024,7 @@ "section": "def-common.ConnectorTypes", "text": "ConnectorTypes" }, - ".none; fields: null; }); settings: { syncAlerts: boolean; }; } & { closed_at: string | null; closed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; external_service: ({ connector_id: string; connector_name: string; external_id: string; external_title: string; external_url: string; } & { pushed_at: string; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; }) | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; }, \"type\" | \"status\" | \"description\" | \"title\" | \"updated_at\" | \"tags\" | \"settings\" | \"created_at\" | \"created_by\" | \"updated_by\" | \"closed_at\" | \"closed_by\" | \"external_service\"> & { connector: ", + ".none; fields: null; }); settings: { syncAlerts: boolean; }; owner: string; } & { closed_at: string | null; closed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; external_service: ({ connector_id: string; connector_name: string; external_id: string; external_title: string; external_url: string; } & { pushed_at: string; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; }) | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; }, \"type\" | \"status\" | \"description\" | \"title\" | \"updated_at\" | \"tags\" | \"settings\" | \"owner\" | \"created_at\" | \"created_by\" | \"updated_by\" | \"closed_at\" | \"closed_by\" | \"external_service\"> & { connector: ", { "pluginId": "cases", "scope": "common", @@ -7856,7 +7036,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/cases/case.ts", - "lineNumber": 193 + "lineNumber": 307 }, "deprecated": false, "initialIsOpen": false @@ -7948,7 +7128,7 @@ "section": "def-common.ConnectorTypes", "text": "ConnectorTypes" }, - ".none; fields: null; }) | undefined; settings?: { syncAlerts: boolean; } | undefined; } & { id: string; version: string; }, \"type\" | \"status\" | \"description\" | \"title\" | \"id\" | \"version\" | \"tags\" | \"settings\"> & { connector?: ", + ".none; fields: null; }) | undefined; settings?: { syncAlerts: boolean; } | undefined; owner?: string | undefined; } & { id: string; version: string; }, \"type\" | \"status\" | \"description\" | \"title\" | \"id\" | \"version\" | \"tags\" | \"settings\" | \"owner\"> & { connector?: ", { "pluginId": "cases", "scope": "common", @@ -7960,7 +7140,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/cases/case.ts", - "lineNumber": 194 + "lineNumber": 308 }, "deprecated": false, "initialIsOpen": false @@ -8013,7 +7193,7 @@ "section": "def-common.ConnectorTypes", "text": "ConnectorTypes" }, - ".none; fields: null; }); closure_type: \"close-by-user\" | \"close-by-pushing\"; } & { created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; }, \"updated_at\" | \"created_at\" | \"created_by\" | \"updated_by\" | \"closure_type\"> & { connector: ", + ".none; fields: null; }); closure_type: \"close-by-user\" | \"close-by-pushing\"; owner: string; } & { created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; }, \"updated_at\" | \"owner\" | \"created_at\" | \"created_by\" | \"updated_by\" | \"closure_type\"> & { connector: ", { "pluginId": "cases", "scope": "common", @@ -8025,7 +7205,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/cases/configure.ts", - "lineNumber": 53 + "lineNumber": 86 }, "deprecated": false, "initialIsOpen": false @@ -8059,7 +7239,24 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/cases/case.ts", - "lineNumber": 191 + "lineNumber": 305 + }, + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "cases", + "id": "def-common.FindQueryParams", + "type": "Type", + "tags": [], + "label": "FindQueryParams", + "description": [], + "signature": [ + "{ subCaseId?: string | undefined; defaultSearchOperator?: \"AND\" | \"OR\" | undefined; hasReferenceOperator?: \"AND\" | \"OR\" | undefined; hasReference?: { id: string; type: string; } | { id: string; type: string; }[] | undefined; fields?: string[] | undefined; filter?: string | undefined; page?: number | undefined; perPage?: number | undefined; search?: string | undefined; searchFields?: string[] | undefined; sortField?: string | undefined; sortOrder?: \"asc\" | \"desc\" | undefined; }" + ], + "source": { + "path": "x-pack/plugins/cases/common/api/cases/comment.ts", + "lineNumber": 142 }, "deprecated": false, "initialIsOpen": false @@ -8076,7 +7273,24 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/cases/comment.ts", - "lineNumber": 141 + "lineNumber": 155 + }, + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "cases", + "id": "def-common.GetConfigureFindRequest", + "type": "Type", + "tags": [], + "label": "GetConfigureFindRequest", + "description": [], + "signature": [ + "{ owner?: string | string[] | undefined; }" + ], + "source": { + "path": "x-pack/plugins/cases/common/api/cases/configure.ts", + "lineNumber": 90 }, "deprecated": false, "initialIsOpen": false @@ -8093,7 +7307,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/connectors/mappings.ts", - "lineNumber": 55 + "lineNumber": 56 }, "deprecated": false, "initialIsOpen": false @@ -8110,7 +7324,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/constants.ts", - "lineNumber": 44 + "lineNumber": 63 }, "deprecated": false, "initialIsOpen": false @@ -8146,7 +7360,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/constants.ts", - "lineNumber": 57 + "lineNumber": 76 }, "deprecated": false, "initialIsOpen": false @@ -8163,7 +7377,26 @@ ], "source": { "path": "x-pack/plugins/cases/common/constants.ts", - "lineNumber": 58 + "lineNumber": 77 + }, + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "cases", + "id": "def-common.OWNER_FIELD", + "type": "string", + "tags": [], + "label": "OWNER_FIELD", + "description": [ + "\nThis field is used for authorization of the entities within the cases plugin. Each entity within Cases will have the owner field\nset to a string that represents the plugin that \"owns\" (i.e. the plugin that originally issued the POST request to\ncreate the entity) the entity.\n\nThe Authorization class constructs a string composed of the operation being performed (createCase, getComment, etc),\nand the owner of the entity being acted upon or created. This string is then given to the Security plugin which\nchecks to see if the user making the request has that particular string stored within it's privileges. If it does,\nthen the operation succeeds, otherwise the operation fails.\n\nAPIs that create/update an entity require that the owner field be passed in the body of the request.\nAPIs that search for entities typically require that the owner be passed as a query parameter.\nAPIs that specify an ID of an entity directly generally don't need to specify the owner field.\n\nFor APIs that create/update an entity, the RBAC implementation checks to see if the user making the request has the\ncorrect privileges for performing that action (a create/update) for the specified owner.\nThis check is done through the Security plugin's API.\n\nFor APIs that search for entities, the RBAC implementation creates a filter for the saved objects query that limits\nthe search to only owners that the user has access to. We also check that the objects returned by the saved objects\nAPI have the limited owner scope. If we find one that the user does not have permissions for, we throw a 403 error.\nThe owner field that is passed in as a query parameter can be used to further limit the results. If a user attempts\nto pass an owner that they do not have access to, the owner is ignored.\n\nFor APIs that retrieve/delete entities directly using their ID, the RBAC implementation requests the object first,\nand then checks to see if the user making the request has access to that operation and owner. If the user does, the\noperation continues, otherwise we throw a 403." + ], + "signature": [ + "\"owner\"" + ], + "source": { + "path": "x-pack/plugins/cases/common/api/cases/constants.ts", + "lineNumber": 36 }, "deprecated": false, "initialIsOpen": false @@ -8180,7 +7413,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/constants.ts", - "lineNumber": 45 + "lineNumber": 64 }, "deprecated": false, "initialIsOpen": false @@ -8202,6 +7435,25 @@ "deprecated": false, "initialIsOpen": false }, + { + "parentPluginId": "cases", + "id": "def-common.SAVED_OBJECT_TYPES", + "type": "Array", + "tags": [], + "label": "SAVED_OBJECT_TYPES", + "description": [ + "\nIf more values are added here please also add them here: x-pack/test/case_api_integration/common/fixtures/plugins" + ], + "signature": [ + "string[]" + ], + "source": { + "path": "x-pack/plugins/cases/common/constants.ts", + "lineNumber": 22 + }, + "deprecated": false, + "initialIsOpen": false + }, { "parentPluginId": "cases", "id": "def-common.SavedObjectFindOptions", @@ -8214,7 +7466,26 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/saved_object.ts", - "lineNumber": 39 + "lineNumber": 72 + }, + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "cases", + "id": "def-common.SECURITY_SOLUTION_OWNER", + "type": "string", + "tags": [], + "label": "SECURITY_SOLUTION_OWNER", + "description": [ + "\nThis must be the same value that the security solution plugin uses to define the case kind when it registers the\nfeature for the 7.13 migration only.\n\nThis variable is being also used by test files and mocks." + ], + "signature": [ + "\"securitySolution\"" + ], + "source": { + "path": "x-pack/plugins/cases/common/constants.ts", + "lineNumber": 85 }, "deprecated": false, "initialIsOpen": false @@ -8231,7 +7502,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/constants.ts", - "lineNumber": 42 + "lineNumber": 61 }, "deprecated": false, "initialIsOpen": false @@ -8248,7 +7519,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/constants.ts", - "lineNumber": 43 + "lineNumber": 62 }, "deprecated": false, "initialIsOpen": false @@ -8329,63 +7600,220 @@ "label": "SUB_CASE_DETAILS_URL", "description": [], "source": { - "path": "x-pack/plugins/cases/common/constants.ts", - "lineNumber": 23 + "path": "x-pack/plugins/cases/common/constants.ts", + "lineNumber": 42 + }, + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "cases", + "id": "def-common.SUB_CASE_SAVED_OBJECT", + "type": "string", + "tags": [], + "label": "SUB_CASE_SAVED_OBJECT", + "description": [], + "signature": [ + "\"cases-sub-case\"" + ], + "source": { + "path": "x-pack/plugins/cases/common/constants.ts", + "lineNumber": 14 + }, + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "cases", + "id": "def-common.SUB_CASE_USER_ACTIONS_URL", + "type": "string", + "tags": [], + "label": "SUB_CASE_USER_ACTIONS_URL", + "description": [], + "source": { + "path": "x-pack/plugins/cases/common/constants.ts", + "lineNumber": 43 + }, + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "cases", + "id": "def-common.SUB_CASES_PATCH_DEL_URL", + "type": "string", + "tags": [], + "label": "SUB_CASES_PATCH_DEL_URL", + "description": [], + "source": { + "path": "x-pack/plugins/cases/common/constants.ts", + "lineNumber": 40 + }, + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "cases", + "id": "def-common.SUB_CASES_URL", + "type": "string", + "tags": [], + "label": "SUB_CASES_URL", + "description": [], + "source": { + "path": "x-pack/plugins/cases/common/constants.ts", + "lineNumber": 41 + }, + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "cases", + "id": "def-common.SubCaseAttributes", + "type": "Type", + "tags": [], + "label": "SubCaseAttributes", + "description": [], + "signature": [ + "{ status: ", + { + "pluginId": "cases", + "scope": "common", + "docId": "kibCasesPluginApi", + "section": "def-common.CaseStatuses", + "text": "CaseStatuses" + }, + "; } & { closed_at: string | null; closed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; owner: string; }" + ], + "source": { + "path": "x-pack/plugins/cases/common/api/cases/sub_case.ts", + "lineNumber": 107 }, "deprecated": false, "initialIsOpen": false }, { "parentPluginId": "cases", - "id": "def-common.SUB_CASE_USER_ACTIONS_URL", - "type": "string", + "id": "def-common.SubCasePatchRequest", + "type": "Type", "tags": [], - "label": "SUB_CASE_USER_ACTIONS_URL", + "label": "SubCasePatchRequest", "description": [], + "signature": [ + "{ status?: ", + { + "pluginId": "cases", + "scope": "common", + "docId": "kibCasesPluginApi", + "section": "def-common.CaseStatuses", + "text": "CaseStatuses" + }, + " | undefined; } & { id: string; version: string; }" + ], "source": { - "path": "x-pack/plugins/cases/common/constants.ts", - "lineNumber": 24 + "path": "x-pack/plugins/cases/common/api/cases/sub_case.ts", + "lineNumber": 111 }, "deprecated": false, "initialIsOpen": false }, { "parentPluginId": "cases", - "id": "def-common.SUB_CASES_PATCH_DEL_URL", - "type": "string", + "id": "def-common.SubCaseResponse", + "type": "Type", "tags": [], - "label": "SUB_CASES_PATCH_DEL_URL", + "label": "SubCaseResponse", "description": [], + "signature": [ + "{ status: ", + { + "pluginId": "cases", + "scope": "common", + "docId": "kibCasesPluginApi", + "section": "def-common.CaseStatuses", + "text": "CaseStatuses" + }, + "; } & { closed_at: string | null; closed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; owner: string; } & { id: string; totalComment: number; totalAlerts: number; version: string; } & { comments?: (({ comment: string; type: ", + { + "pluginId": "cases", + "scope": "common", + "docId": "kibCasesPluginApi", + "section": "def-common.CommentType", + "text": "CommentType" + }, + ".user; owner: string; } & { associationType: ", + { + "pluginId": "cases", + "scope": "common", + "docId": "kibCasesPluginApi", + "section": "def-common.AssociationType", + "text": "AssociationType" + }, + "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; owner: string; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }) | ({ type: ", + { + "pluginId": "cases", + "scope": "common", + "docId": "kibCasesPluginApi", + "section": "def-common.CommentType", + "text": "CommentType" + }, + ".alert | ", + { + "pluginId": "cases", + "scope": "common", + "docId": "kibCasesPluginApi", + "section": "def-common.CommentType", + "text": "CommentType" + }, + ".generatedAlert; alertId: string | string[]; index: string | string[]; rule: { id: string | null; name: string | null; }; owner: string; } & { associationType: ", + { + "pluginId": "cases", + "scope": "common", + "docId": "kibCasesPluginApi", + "section": "def-common.AssociationType", + "text": "AssociationType" + }, + "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; owner: string; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }))[] | undefined; }" + ], "source": { - "path": "x-pack/plugins/cases/common/constants.ts", - "lineNumber": 21 + "path": "x-pack/plugins/cases/common/api/cases/sub_case.ts", + "lineNumber": 108 }, "deprecated": false, "initialIsOpen": false }, { "parentPluginId": "cases", - "id": "def-common.SUB_CASES_URL", - "type": "string", + "id": "def-common.SubCasesFindRequest", + "type": "Type", "tags": [], - "label": "SUB_CASES_URL", + "label": "SubCasesFindRequest", "description": [], + "signature": [ + "{ status?: ", + { + "pluginId": "cases", + "scope": "common", + "docId": "kibCasesPluginApi", + "section": "def-common.CaseStatuses", + "text": "CaseStatuses" + }, + " | undefined; defaultSearchOperator?: \"AND\" | \"OR\" | undefined; fields?: string[] | undefined; page?: number | undefined; perPage?: number | undefined; search?: string | undefined; searchFields?: string[] | undefined; sortField?: string | undefined; sortOrder?: \"asc\" | \"desc\" | undefined; owner?: string | undefined; }" + ], "source": { - "path": "x-pack/plugins/cases/common/constants.ts", - "lineNumber": 22 + "path": "x-pack/plugins/cases/common/api/cases/sub_case.ts", + "lineNumber": 113 }, "deprecated": false, "initialIsOpen": false }, { "parentPluginId": "cases", - "id": "def-common.SubCaseAttributes", + "id": "def-common.SubCasesFindResponse", "type": "Type", "tags": [], - "label": "SubCaseAttributes", + "label": "SubCasesFindResponse", "description": [], "signature": [ - "{ status: ", + "{ subCases: ({ status: ", { "pluginId": "cases", "scope": "common", @@ -8393,24 +7821,64 @@ "section": "def-common.CaseStatuses", "text": "CaseStatuses" }, - "; } & { closed_at: string | null; closed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; }" + "; } & { closed_at: string | null; closed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; owner: string; } & { id: string; totalComment: number; totalAlerts: number; version: string; } & { comments?: (({ comment: string; type: ", + { + "pluginId": "cases", + "scope": "common", + "docId": "kibCasesPluginApi", + "section": "def-common.CommentType", + "text": "CommentType" + }, + ".user; owner: string; } & { associationType: ", + { + "pluginId": "cases", + "scope": "common", + "docId": "kibCasesPluginApi", + "section": "def-common.AssociationType", + "text": "AssociationType" + }, + "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; owner: string; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }) | ({ type: ", + { + "pluginId": "cases", + "scope": "common", + "docId": "kibCasesPluginApi", + "section": "def-common.CommentType", + "text": "CommentType" + }, + ".alert | ", + { + "pluginId": "cases", + "scope": "common", + "docId": "kibCasesPluginApi", + "section": "def-common.CommentType", + "text": "CommentType" + }, + ".generatedAlert; alertId: string | string[]; index: string | string[]; rule: { id: string | null; name: string | null; }; owner: string; } & { associationType: ", + { + "pluginId": "cases", + "scope": "common", + "docId": "kibCasesPluginApi", + "section": "def-common.AssociationType", + "text": "AssociationType" + }, + "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; owner: string; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }))[] | undefined; })[]; page: number; per_page: number; total: number; } & { count_open_cases: number; count_in_progress_cases: number; count_closed_cases: number; }" ], "source": { "path": "x-pack/plugins/cases/common/api/cases/sub_case.ts", - "lineNumber": 75 + "lineNumber": 110 }, "deprecated": false, "initialIsOpen": false }, { "parentPluginId": "cases", - "id": "def-common.SubCasePatchRequest", + "id": "def-common.SubCasesPatchRequest", "type": "Type", "tags": [], - "label": "SubCasePatchRequest", + "label": "SubCasesPatchRequest", "description": [], "signature": [ - "{ status?: ", + "{ subCases: ({ status?: ", { "pluginId": "cases", "scope": "common", @@ -8418,24 +7886,24 @@ "section": "def-common.CaseStatuses", "text": "CaseStatuses" }, - " | undefined; } & { id: string; version: string; }" + " | undefined; } & { id: string; version: string; })[]; }" ], "source": { "path": "x-pack/plugins/cases/common/api/cases/sub_case.ts", - "lineNumber": 79 + "lineNumber": 112 }, "deprecated": false, "initialIsOpen": false }, { "parentPluginId": "cases", - "id": "def-common.SubCaseResponse", + "id": "def-common.SubCasesResponse", "type": "Type", "tags": [], - "label": "SubCaseResponse", + "label": "SubCasesResponse", "description": [], "signature": [ - "{ status: ", + "({ status: ", { "pluginId": "cases", "scope": "common", @@ -8443,7 +7911,7 @@ "section": "def-common.CaseStatuses", "text": "CaseStatuses" }, - "; } & { closed_at: string | null; closed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; totalComment: number; totalAlerts: number; version: string; } & { comments?: (({ comment: string; type: ", + "; } & { closed_at: string | null; closed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; owner: string; } & { id: string; totalComment: number; totalAlerts: number; version: string; } & { comments?: (({ comment: string; type: ", { "pluginId": "cases", "scope": "common", @@ -8451,7 +7919,7 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".user; } & { associationType: ", + ".user; owner: string; } & { associationType: ", { "pluginId": "cases", "scope": "common", @@ -8459,7 +7927,7 @@ "section": "def-common.AssociationType", "text": "AssociationType" }, - "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }) | ({ type: ", + "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; owner: string; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }) | ({ type: ", { "pluginId": "cases", "scope": "common", @@ -8475,7 +7943,7 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".generatedAlert; alertId: string | string[]; index: string | string[]; rule: { id: string | null; name: string | null; }; } & { associationType: ", + ".generatedAlert; alertId: string | string[]; index: string | string[]; rule: { id: string | null; name: string | null; }; owner: string; } & { associationType: ", { "pluginId": "cases", "scope": "common", @@ -8483,130 +7951,258 @@ "section": "def-common.AssociationType", "text": "AssociationType" }, - "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }))[] | undefined; }" + "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; owner: string; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }))[] | undefined; })[]" + ], + "source": { + "path": "x-pack/plugins/cases/common/api/cases/sub_case.ts", + "lineNumber": 109 + }, + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "cases", + "id": "def-common.SUPPORTED_CONNECTORS", + "type": "Array", + "tags": [], + "label": "SUPPORTED_CONNECTORS", + "description": [], + "signature": [ + "string[]" + ], + "source": { + "path": "x-pack/plugins/cases/common/constants.ts", + "lineNumber": 66 + }, + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "cases", + "id": "def-common.ThirdPartyField", + "type": "Type", + "tags": [], + "label": "ThirdPartyField", + "description": [], + "signature": [ + "string" + ], + "source": { + "path": "x-pack/plugins/cases/common/api/connectors/mappings.ts", + "lineNumber": 24 + }, + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "cases", + "id": "def-common.UpdateKey", + "type": "Type", + "tags": [], + "label": "UpdateKey", + "description": [], + "signature": [ + "\"status\" | \"description\" | \"title\" | \"tags\" | \"settings\" | \"connector\"" + ], + "source": { + "path": "x-pack/plugins/cases/common/ui/types.ts", + "lineNumber": 164 + }, + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "cases", + "id": "def-common.User", + "type": "Type", + "tags": [], + "label": "User", + "description": [], + "signature": [ + "{ email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }" + ], + "source": { + "path": "x-pack/plugins/cases/common/api/user.ts", + "lineNumber": 18 + }, + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "cases", + "id": "def-common.UserAction", + "type": "Type", + "tags": [], + "label": "UserAction", + "description": [], + "signature": [ + "\"add\" | \"delete\" | \"create\" | \"update\" | \"push-to-service\"" + ], + "source": { + "path": "x-pack/plugins/cases/common/api/cases/user_actions.ts", + "lineNumber": 66 + }, + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "cases", + "id": "def-common.UserActionField", + "type": "Type", + "tags": [], + "label": "UserActionField", + "description": [], + "signature": [ + "(\"status\" | \"description\" | \"title\" | \"comment\" | \"tags\" | \"settings\" | \"owner\" | \"connector\" | \"pushed\" | \"sub_case\")[]" ], "source": { - "path": "x-pack/plugins/cases/common/api/cases/sub_case.ts", - "lineNumber": 76 + "path": "x-pack/plugins/cases/common/api/cases/user_actions.ts", + "lineNumber": 67 }, "deprecated": false, "initialIsOpen": false }, { "parentPluginId": "cases", - "id": "def-common.SubCasesFindResponse", + "id": "def-common.UserActionFieldType", "type": "Type", "tags": [], - "label": "SubCasesFindResponse", + "label": "UserActionFieldType", "description": [], "signature": [ - "{ subCases: ({ status: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CaseStatuses", - "text": "CaseStatuses" - }, - "; } & { closed_at: string | null; closed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; totalComment: number; totalAlerts: number; version: string; } & { comments?: (({ comment: string; type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CommentType", - "text": "CommentType" - }, - ".user; } & { associationType: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.AssociationType", - "text": "AssociationType" - }, - "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }) | ({ type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CommentType", - "text": "CommentType" - }, - ".alert | ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CommentType", - "text": "CommentType" - }, - ".generatedAlert; alertId: string | string[]; index: string | string[]; rule: { id: string | null; name: string | null; }; } & { associationType: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.AssociationType", - "text": "AssociationType" - }, - "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }))[] | undefined; })[]; page: number; per_page: number; total: number; } & { count_open_cases: number; count_in_progress_cases: number; count_closed_cases: number; }" + "\"status\" | \"description\" | \"title\" | \"comment\" | \"tags\" | \"settings\" | \"owner\" | \"connector\" | \"pushed\" | \"sub_case\"" ], "source": { - "path": "x-pack/plugins/cases/common/api/cases/sub_case.ts", - "lineNumber": 78 + "path": "x-pack/plugins/cases/common/api/cases/user_actions.ts", + "lineNumber": 68 }, "deprecated": false, "initialIsOpen": false - }, + } + ], + "objects": [ { "parentPluginId": "cases", - "id": "def-common.SubCasesPatchRequest", - "type": "Type", + "id": "def-common.AlertCommentRequestRt", + "type": "Object", "tags": [], - "label": "SubCasesPatchRequest", - "description": [], + "label": "AlertCommentRequestRt", + "description": [ + "\nThis defines the structure of how alerts (generated or user attached) are stored in saved objects documents. It also\nrepresents of an alert after it has been transformed. A generated alert will be transformed by the connector so that\nit matches this structure. User attached alerts do not need to be transformed." + ], "signature": [ - "{ subCases: ({ status?: ", + "TypeC", + "<{ type: ", + "UnionC", + "<[", + "LiteralC", + "<", { "pluginId": "cases", "scope": "common", "docId": "kibCasesPluginApi", - "section": "def-common.CaseStatuses", - "text": "CaseStatuses" + "section": "def-common.CommentType", + "text": "CommentType" }, - " | undefined; } & { id: string; version: string; })[]; }" + ".generatedAlert>, ", + "LiteralC", + "<", + { + "pluginId": "cases", + "scope": "common", + "docId": "kibCasesPluginApi", + "section": "def-common.CommentType", + "text": "CommentType" + }, + ".alert>]>; alertId: ", + "UnionC", + "<[", + "ArrayC", + "<", + "StringC", + ">, ", + "StringC", + "]>; index: ", + "UnionC", + "<[", + "ArrayC", + "<", + "StringC", + ">, ", + "StringC", + "]>; rule: ", + "TypeC", + "<{ id: ", + "UnionC", + "<[", + "StringC", + ", ", + "NullC", + "]>; name: ", + "UnionC", + "<[", + "StringC", + ", ", + "NullC", + "]>; }>; owner: ", + "StringC", + "; }>" ], "source": { - "path": "x-pack/plugins/cases/common/api/cases/sub_case.ts", - "lineNumber": 80 + "path": "x-pack/plugins/cases/common/api/cases/comment.ts", + "lineNumber": 70 }, "deprecated": false, "initialIsOpen": false }, { "parentPluginId": "cases", - "id": "def-common.SubCasesResponse", - "type": "Type", + "id": "def-common.AllCommentsResponseRt", + "type": "Object", "tags": [], - "label": "SubCasesResponse", + "label": "AllCommentsResponseRt", "description": [], "signature": [ - "({ status: ", + "ArrayC", + "<", + "IntersectionC", + "<[", + "UnionC", + "<[", + "IntersectionC", + "<[", + "TypeC", + "<{ comment: ", + "StringC", + "; type: ", + "LiteralC", + "<", { "pluginId": "cases", "scope": "common", "docId": "kibCasesPluginApi", - "section": "def-common.CaseStatuses", - "text": "CaseStatuses" + "section": "def-common.CommentType", + "text": "CommentType" }, - "; } & { closed_at: string | null; closed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; totalComment: number; totalAlerts: number; version: string; } & { comments?: (({ comment: string; type: ", + ".user>; owner: ", + "StringC", + "; }>, ", + "TypeC", + "<{ associationType: ", + "UnionC", + "<[", + "LiteralC", + "<", { "pluginId": "cases", "scope": "common", "docId": "kibCasesPluginApi", - "section": "def-common.CommentType", - "text": "CommentType" + "section": "def-common.AssociationType", + "text": "AssociationType" }, - ".user; } & { associationType: ", + ".case>, ", + "LiteralC", + "<", { "pluginId": "cases", "scope": "common", @@ -8614,7 +8210,117 @@ "section": "def-common.AssociationType", "text": "AssociationType" }, - "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }) | ({ type: ", + ".subCase>]>; created_at: ", + "StringC", + "; created_by: ", + "TypeC", + "<{ email: ", + "UnionC", + "<[", + "UndefinedC", + ", ", + "NullC", + ", ", + "StringC", + "]>; full_name: ", + "UnionC", + "<[", + "UndefinedC", + ", ", + "NullC", + ", ", + "StringC", + "]>; username: ", + "UnionC", + "<[", + "UndefinedC", + ", ", + "NullC", + ", ", + "StringC", + "]>; }>; owner: ", + "StringC", + "; pushed_at: ", + "UnionC", + "<[", + "StringC", + ", ", + "NullC", + "]>; pushed_by: ", + "UnionC", + "<[", + "TypeC", + "<{ email: ", + "UnionC", + "<[", + "UndefinedC", + ", ", + "NullC", + ", ", + "StringC", + "]>; full_name: ", + "UnionC", + "<[", + "UndefinedC", + ", ", + "NullC", + ", ", + "StringC", + "]>; username: ", + "UnionC", + "<[", + "UndefinedC", + ", ", + "NullC", + ", ", + "StringC", + "]>; }>, ", + "NullC", + "]>; updated_at: ", + "UnionC", + "<[", + "StringC", + ", ", + "NullC", + "]>; updated_by: ", + "UnionC", + "<[", + "TypeC", + "<{ email: ", + "UnionC", + "<[", + "UndefinedC", + ", ", + "NullC", + ", ", + "StringC", + "]>; full_name: ", + "UnionC", + "<[", + "UndefinedC", + ", ", + "NullC", + ", ", + "StringC", + "]>; username: ", + "UnionC", + "<[", + "UndefinedC", + ", ", + "NullC", + ", ", + "StringC", + "]>; }>, ", + "NullC", + "]>; }>]>, ", + "IntersectionC", + "<[", + "TypeC", + "<{ type: ", + "UnionC", + "<[", + "LiteralC", + "<", { "pluginId": "cases", "scope": "common", @@ -8622,7 +8328,9 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".alert | ", + ".generatedAlert>, ", + "LiteralC", + "<", { "pluginId": "cases", "scope": "common", @@ -8630,156 +8338,41 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".generatedAlert; alertId: string | string[]; index: string | string[]; rule: { id: string | null; name: string | null; }; } & { associationType: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.AssociationType", - "text": "AssociationType" - }, - "; created_at: string; created_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; pushed_at: string | null; pushed_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; updated_at: string | null; updated_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; } | null; } & { id: string; version: string; }))[] | undefined; })[]" - ], - "source": { - "path": "x-pack/plugins/cases/common/api/cases/sub_case.ts", - "lineNumber": 77 - }, - "deprecated": false, - "initialIsOpen": false - }, - { - "parentPluginId": "cases", - "id": "def-common.SUPPORTED_CONNECTORS", - "type": "Array", - "tags": [], - "label": "SUPPORTED_CONNECTORS", - "description": [], - "signature": [ - "string[]" - ], - "source": { - "path": "x-pack/plugins/cases/common/constants.ts", - "lineNumber": 47 - }, - "deprecated": false, - "initialIsOpen": false - }, - { - "parentPluginId": "cases", - "id": "def-common.ThirdPartyField", - "type": "Type", - "tags": [], - "label": "ThirdPartyField", - "description": [], - "signature": [ - "string" - ], - "source": { - "path": "x-pack/plugins/cases/common/api/connectors/mappings.ts", - "lineNumber": 24 - }, - "deprecated": false, - "initialIsOpen": false - }, - { - "parentPluginId": "cases", - "id": "def-common.UpdateKey", - "type": "Type", - "tags": [], - "label": "UpdateKey", - "description": [], - "signature": [ - "\"status\" | \"description\" | \"title\" | \"tags\" | \"settings\" | \"connector\"" - ], - "source": { - "path": "x-pack/plugins/cases/common/ui/types.ts", - "lineNumber": 163 - }, - "deprecated": false, - "initialIsOpen": false - }, - { - "parentPluginId": "cases", - "id": "def-common.User", - "type": "Type", - "tags": [], - "label": "User", - "description": [], - "signature": [ - "{ email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }" - ], - "source": { - "path": "x-pack/plugins/cases/common/api/user.ts", - "lineNumber": 18 - }, - "deprecated": false, - "initialIsOpen": false - }, - { - "parentPluginId": "cases", - "id": "def-common.UserAction", - "type": "Type", - "tags": [], - "label": "UserAction", - "description": [], - "signature": [ - "\"add\" | \"delete\" | \"create\" | \"update\" | \"push-to-service\"" - ], - "source": { - "path": "x-pack/plugins/cases/common/api/cases/user_actions.ts", - "lineNumber": 62 - }, - "deprecated": false, - "initialIsOpen": false - }, - { - "parentPluginId": "cases", - "id": "def-common.UserActionField", - "type": "Type", - "tags": [], - "label": "UserActionField", - "description": [], - "signature": [ - "(\"status\" | \"description\" | \"title\" | \"comment\" | \"tags\" | \"settings\" | \"connector\" | \"pushed\" | \"sub_case\")[]" - ], - "source": { - "path": "x-pack/plugins/cases/common/api/cases/user_actions.ts", - "lineNumber": 63 - }, - "deprecated": false, - "initialIsOpen": false - }, - { - "parentPluginId": "cases", - "id": "def-common.UserActionFieldType", - "type": "Type", - "tags": [], - "label": "UserActionFieldType", - "description": [], - "signature": [ - "\"status\" | \"description\" | \"title\" | \"comment\" | \"tags\" | \"settings\" | \"connector\" | \"pushed\" | \"sub_case\"" - ], - "source": { - "path": "x-pack/plugins/cases/common/api/cases/user_actions.ts", - "lineNumber": 64 - }, - "deprecated": false, - "initialIsOpen": false - } - ], - "objects": [ - { - "parentPluginId": "cases", - "id": "def-common.AlertCommentRequestRt", - "type": "Object", - "tags": [], - "label": "AlertCommentRequestRt", - "description": [ - "\nThis defines the structure of how alerts (generated or user attached) are stored in saved objects documents. It also\nrepresents of an alert after it has been transformed. A generated alert will be transformed by the connector so that\nit matches this structure. User attached alerts do not need to be transformed." - ], - "signature": [ + ".alert>]>; alertId: ", + "UnionC", + "<[", + "ArrayC", + "<", + "StringC", + ">, ", + "StringC", + "]>; index: ", + "UnionC", + "<[", + "ArrayC", + "<", + "StringC", + ">, ", + "StringC", + "]>; rule: ", "TypeC", - "<{ type: ", + "<{ id: ", + "UnionC", + "<[", + "StringC", + ", ", + "NullC", + "]>; name: ", + "UnionC", + "<[", + "StringC", + ", ", + "NullC", + "]>; }>; owner: ", + "StringC", + "; }>, ", + "TypeC", + "<{ associationType: ", "UnionC", "<[", "LiteralC", @@ -8788,64 +8381,142 @@ "pluginId": "cases", "scope": "common", "docId": "kibCasesPluginApi", - "section": "def-common.CommentType", - "text": "CommentType" + "section": "def-common.AssociationType", + "text": "AssociationType" }, - ".generatedAlert>, ", + ".case>, ", "LiteralC", "<", { "pluginId": "cases", "scope": "common", "docId": "kibCasesPluginApi", - "section": "def-common.CommentType", - "text": "CommentType" + "section": "def-common.AssociationType", + "text": "AssociationType" }, - ".alert>]>; alertId: ", + ".subCase>]>; created_at: ", + "StringC", + "; created_by: ", + "TypeC", + "<{ email: ", + "UnionC", + "<[", + "UndefinedC", + ", ", + "NullC", + ", ", + "StringC", + "]>; full_name: ", + "UnionC", + "<[", + "UndefinedC", + ", ", + "NullC", + ", ", + "StringC", + "]>; username: ", + "UnionC", + "<[", + "UndefinedC", + ", ", + "NullC", + ", ", + "StringC", + "]>; }>; owner: ", + "StringC", + "; pushed_at: ", + "UnionC", + "<[", + "StringC", + ", ", + "NullC", + "]>; pushed_by: ", + "UnionC", + "<[", + "TypeC", + "<{ email: ", + "UnionC", + "<[", + "UndefinedC", + ", ", + "NullC", + ", ", + "StringC", + "]>; full_name: ", "UnionC", "<[", - "ArrayC", - "<", - "StringC", - ">, ", + "UndefinedC", + ", ", + "NullC", + ", ", "StringC", - "]>; index: ", + "]>; username: ", "UnionC", "<[", - "ArrayC", - "<", + "UndefinedC", + ", ", + "NullC", + ", ", "StringC", - ">, ", + "]>; }>, ", + "NullC", + "]>; updated_at: ", + "UnionC", + "<[", "StringC", - "]>; rule: ", + ", ", + "NullC", + "]>; updated_by: ", + "UnionC", + "<[", "TypeC", - "<{ id: ", + "<{ email: ", "UnionC", "<[", - "StringC", + "UndefinedC", ", ", "NullC", - "]>; name: ", + ", ", + "StringC", + "]>; full_name: ", "UnionC", "<[", + "UndefinedC", + ", ", + "NullC", + ", ", "StringC", + "]>; username: ", + "UnionC", + "<[", + "UndefinedC", + ", ", + "NullC", ", ", + "StringC", + "]>; }>, ", "NullC", - "]>; }>; }>" + "]>; }>]>]>, ", + "TypeC", + "<{ id: ", + "StringC", + "; version: ", + "StringC", + "; }>]>>" ], "source": { "path": "x-pack/plugins/cases/common/api/cases/comment.ts", - "lineNumber": 67 + "lineNumber": 132 }, "deprecated": false, "initialIsOpen": false }, { "parentPluginId": "cases", - "id": "def-common.AllCommentsResponseRt", + "id": "def-common.AllCommentsResponseRT", "type": "Object", "tags": [], - "label": "AllCommentsResponseRt", + "label": "AllCommentsResponseRT", "description": [], "signature": [ "ArrayC", @@ -8869,7 +8540,9 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".user>; }>, ", + ".user>; owner: ", + "StringC", + "; }>, ", "TypeC", "<{ associationType: ", "UnionC", @@ -8921,7 +8594,9 @@ "NullC", ", ", "StringC", - "]>; }>; pushed_at: ", + "]>; }>; owner: ", + "StringC", + "; pushed_at: ", "UnionC", "<[", "StringC", @@ -9049,7 +8724,9 @@ "StringC", ", ", "NullC", - "]>; }>; }>, ", + "]>; }>; owner: ", + "StringC", + "; }>, ", "TypeC", "<{ associationType: ", "UnionC", @@ -9101,7 +8778,9 @@ "NullC", ", ", "StringC", - "]>; }>; pushed_at: ", + "]>; }>; owner: ", + "StringC", + "; pushed_at: ", "UnionC", "<[", "StringC", @@ -9183,245 +8862,381 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/cases/comment.ts", - "lineNumber": 128 + "lineNumber": 103 }, "deprecated": false, "initialIsOpen": false }, { "parentPluginId": "cases", - "id": "def-common.AllCommentsResponseRT", + "id": "def-common.AllReportersFindRequestRt", "type": "Object", "tags": [], - "label": "AllCommentsResponseRT", + "label": "AllReportersFindRequestRt", "description": [], "signature": [ + "PartialC", + "<{ owner: ", + "UnionC", + "<[", "ArrayC", "<", - "IntersectionC", - "<[", + "StringC", + ">, ", + "StringC", + "]>; }>" + ], + "source": { + "path": "x-pack/plugins/cases/common/api/cases/case.ts", + "lineNumber": 286 + }, + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "cases", + "id": "def-common.AllTagsFindRequestRt", + "type": "Object", + "tags": [], + "label": "AllTagsFindRequestRt", + "description": [], + "signature": [ + "PartialC", + "<{ owner: ", "UnionC", "<[", + "ArrayC", + "<", + "StringC", + ">, ", + "StringC", + "]>; }>" + ], + "source": { + "path": "x-pack/plugins/cases/common/api/cases/case.ts", + "lineNumber": 278 + }, + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "cases", + "id": "def-common.CaseAttributesRt", + "type": "Object", + "tags": [], + "label": "CaseAttributesRt", + "description": [], + "signature": [ "IntersectionC", "<[", "TypeC", - "<{ comment: ", + "<{ description: ", + "StringC", + "; status: ", + "UnionC", + "<[", + "LiteralC", + "<", + { + "pluginId": "cases", + "scope": "common", + "docId": "kibCasesPluginApi", + "section": "def-common.CaseStatuses", + "text": "CaseStatuses" + }, + ".open>, ", + "LiteralC", + ", ", + "LiteralC", + "<", + { + "pluginId": "cases", + "scope": "common", + "docId": "kibCasesPluginApi", + "section": "def-common.CaseStatuses", + "text": "CaseStatuses" + }, + ".closed>]>; tags: ", + "ArrayC", + "<", + "StringC", + ">; title: ", "StringC", "; type: ", + "UnionC", + "<[", "LiteralC", "<", { "pluginId": "cases", "scope": "common", "docId": "kibCasesPluginApi", - "section": "def-common.CommentType", - "text": "CommentType" + "section": "def-common.CaseType", + "text": "CaseType" + }, + ".collection>, ", + "LiteralC", + "<", + { + "pluginId": "cases", + "scope": "common", + "docId": "kibCasesPluginApi", + "section": "def-common.CaseType", + "text": "CaseType" }, - ".user>; }>, ", + ".individual>]>; connector: ", + "IntersectionC", + "<[", "TypeC", - "<{ associationType: ", + "<{ id: ", + "StringC", + "; name: ", + "StringC", + "; }>, ", "UnionC", "<[", + "TypeC", + "<{ type: ", "LiteralC", "<", { "pluginId": "cases", "scope": "common", "docId": "kibCasesPluginApi", - "section": "def-common.AssociationType", - "text": "AssociationType" + "section": "def-common.ConnectorTypes", + "text": "ConnectorTypes" }, - ".case>, ", + ".jira>; fields: ", + "UnionC", + "<[", + "TypeC", + "<{ issueType: ", + "UnionC", + "<[", + "StringC", + ", ", + "NullC", + "]>; priority: ", + "UnionC", + "<[", + "StringC", + ", ", + "NullC", + "]>; parent: ", + "UnionC", + "<[", + "StringC", + ", ", + "NullC", + "]>; }>, ", + "NullC", + "]>; }>, ", + "TypeC", + "<{ type: ", "LiteralC", "<", { "pluginId": "cases", "scope": "common", "docId": "kibCasesPluginApi", - "section": "def-common.AssociationType", - "text": "AssociationType" + "section": "def-common.ConnectorTypes", + "text": "ConnectorTypes" }, - ".subCase>]>; created_at: ", + ".resilient>; fields: ", + "UnionC", + "<[", + "TypeC", + "<{ incidentTypes: ", + "UnionC", + "<[", + "ArrayC", + "<", "StringC", - "; created_by: ", + ">, ", + "NullC", + "]>; severityCode: ", + "UnionC", + "<[", + "StringC", + ", ", + "NullC", + "]>; }>, ", + "NullC", + "]>; }>, ", "TypeC", - "<{ email: ", + "<{ type: ", + "LiteralC", + "<", + { + "pluginId": "cases", + "scope": "common", + "docId": "kibCasesPluginApi", + "section": "def-common.ConnectorTypes", + "text": "ConnectorTypes" + }, + ".serviceNowITSM>; fields: ", + "UnionC", + "<[", + "TypeC", + "<{ impact: ", "UnionC", "<[", - "UndefinedC", + "StringC", ", ", "NullC", - ", ", - "StringC", - "]>; full_name: ", + "]>; severity: ", "UnionC", "<[", - "UndefinedC", + "StringC", ", ", "NullC", - ", ", - "StringC", - "]>; username: ", + "]>; urgency: ", "UnionC", "<[", - "UndefinedC", + "StringC", ", ", "NullC", - ", ", + "]>; category: ", + "UnionC", + "<[", "StringC", - "]>; }>; pushed_at: ", + ", ", + "NullC", + "]>; subcategory: ", "UnionC", "<[", "StringC", ", ", "NullC", - "]>; pushed_by: ", + "]>; }>, ", + "NullC", + "]>; }>, ", + "TypeC", + "<{ type: ", + "LiteralC", + "<", + { + "pluginId": "cases", + "scope": "common", + "docId": "kibCasesPluginApi", + "section": "def-common.ConnectorTypes", + "text": "ConnectorTypes" + }, + ".serviceNowSIR>; fields: ", "UnionC", "<[", "TypeC", - "<{ email: ", + "<{ category: ", "UnionC", "<[", - "UndefinedC", + "StringC", ", ", "NullC", - ", ", - "StringC", - "]>; full_name: ", + "]>; destIp: ", "UnionC", "<[", - "UndefinedC", + "BooleanC", ", ", "NullC", - ", ", - "StringC", - "]>; username: ", + "]>; malwareHash: ", "UnionC", "<[", - "UndefinedC", - ", ", - "NullC", + "BooleanC", ", ", - "StringC", - "]>; }>, ", "NullC", - "]>; updated_at: ", + "]>; malwareUrl: ", "UnionC", "<[", - "StringC", + "BooleanC", ", ", "NullC", - "]>; updated_by: ", - "UnionC", - "<[", - "TypeC", - "<{ email: ", + "]>; priority: ", "UnionC", "<[", - "UndefinedC", + "StringC", ", ", "NullC", - ", ", - "StringC", - "]>; full_name: ", + "]>; sourceIp: ", "UnionC", "<[", - "UndefinedC", + "BooleanC", ", ", "NullC", - ", ", - "StringC", - "]>; username: ", + "]>; subcategory: ", "UnionC", "<[", - "UndefinedC", + "StringC", ", ", "NullC", - ", ", - "StringC", "]>; }>, ", "NullC", - "]>; }>]>, ", - "IntersectionC", - "<[", + "]>; }>, ", "TypeC", "<{ type: ", - "UnionC", - "<[", - "LiteralC", - "<", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CommentType", - "text": "CommentType" - }, - ".generatedAlert>, ", "LiteralC", "<", { "pluginId": "cases", "scope": "common", "docId": "kibCasesPluginApi", - "section": "def-common.CommentType", - "text": "CommentType" + "section": "def-common.ConnectorTypes", + "text": "ConnectorTypes" }, - ".alert>]>; alertId: ", + ".none>; fields: ", + "NullC", + "; }>]>]>; settings: ", + "TypeC", + "<{ syncAlerts: ", + "BooleanC", + "; }>; owner: ", + "StringC", + "; }>, ", + "TypeC", + "<{ closed_at: ", "UnionC", "<[", - "ArrayC", - "<", - "StringC", - ">, ", "StringC", - "]>; index: ", + ", ", + "NullC", + "]>; closed_by: ", "UnionC", "<[", - "ArrayC", - "<", - "StringC", - ">, ", - "StringC", - "]>; rule: ", "TypeC", - "<{ id: ", + "<{ email: ", "UnionC", "<[", - "StringC", + "UndefinedC", ", ", "NullC", - "]>; name: ", + ", ", + "StringC", + "]>; full_name: ", "UnionC", "<[", - "StringC", + "UndefinedC", ", ", "NullC", - "]>; }>; }>, ", - "TypeC", - "<{ associationType: ", + ", ", + "StringC", + "]>; username: ", "UnionC", "<[", - "LiteralC", - "<", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.AssociationType", - "text": "AssociationType" - }, - ".case>, ", - "LiteralC", - "<", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.AssociationType", - "text": "AssociationType" - }, - ".subCase>]>; created_at: ", + "UndefinedC", + ", ", + "NullC", + ", ", + "StringC", + "]>; }>, ", + "NullC", + "]>; created_at: ", "StringC", "; created_by: ", "TypeC", @@ -9449,16 +9264,28 @@ "NullC", ", ", "StringC", - "]>; }>; pushed_at: ", + "]>; }>; external_service: ", "UnionC", "<[", - "StringC", - ", ", - "NullC", - "]>; pushed_by: ", - "UnionC", + "IntersectionC", "<[", "TypeC", + "<{ connector_id: ", + "StringC", + "; connector_name: ", + "StringC", + "; external_id: ", + "StringC", + "; external_title: ", + "StringC", + "; external_url: ", + "StringC", + "; }>, ", + "TypeC", + "<{ pushed_at: ", + "StringC", + "; pushed_by: ", + "TypeC", "<{ email: ", "UnionC", "<[", @@ -9483,7 +9310,7 @@ "NullC", ", ", "StringC", - "]>; }>, ", + "]>; }>; }>]>, ", "NullC", "]>; updated_at: ", "UnionC", @@ -9521,95 +9348,31 @@ "StringC", "]>; }>, ", "NullC", - "]>; }>]>]>, ", - "TypeC", - "<{ id: ", - "StringC", - "; version: ", - "StringC", - "; }>]>>" + "]>; }>]>" ], "source": { - "path": "x-pack/plugins/cases/common/api/cases/comment.ts", - "lineNumber": 99 + "path": "x-pack/plugins/cases/common/api/cases/case.ts", + "lineNumber": 87 }, "deprecated": false, - "initialIsOpen": false - }, - { - "parentPluginId": "cases", - "id": "def-common.CaseAttributesRt", - "type": "Object", - "tags": [], - "label": "CaseAttributesRt", - "description": [], - "signature": [ - "IntersectionC", - "<[", - "TypeC", - "<{ description: ", - "StringC", - "; status: ", - "UnionC", - "<[", - "LiteralC", - "<", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CaseStatuses", - "text": "CaseStatuses" - }, - ".open>, ", - "LiteralC", - ", ", - "LiteralC", - "<", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CaseStatuses", - "text": "CaseStatuses" - }, - ".closed>]>; tags: ", + "initialIsOpen": false + }, + { + "parentPluginId": "cases", + "id": "def-common.CaseConfigurationsResponseRt", + "type": "Object", + "tags": [], + "label": "CaseConfigurationsResponseRt", + "description": [], + "signature": [ "ArrayC", "<", - "StringC", - ">; title: ", - "StringC", - "; type: ", - "UnionC", + "IntersectionC", "<[", - "LiteralC", - "<", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CaseType", - "text": "CaseType" - }, - ".collection>, ", - "LiteralC", - "<", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CaseType", - "text": "CaseType" - }, - ".individual>]>; connector: ", + "IntersectionC", + "<[", + "TypeC", + "<{ connector: ", "IntersectionC", "<[", "TypeC", @@ -9809,21 +9572,19 @@ }, ".none>; fields: ", "NullC", - "; }>]>]>; settings: ", - "TypeC", - "<{ syncAlerts: ", - "BooleanC", - "; }>; }>, ", - "TypeC", - "<{ closed_at: ", + "; }>]>]>; closure_type: ", "UnionC", "<[", + "LiteralC", + "<\"close-by-user\">, ", + "LiteralC", + "<\"close-by-pushing\">]>; owner: ", "StringC", - ", ", - "NullC", - "]>; closed_by: ", - "UnionC", - "<[", + "; }>, ", + "TypeC", + "<{ created_at: ", + "StringC", + "; created_by: ", "TypeC", "<{ email: ", "UnionC", @@ -9849,57 +9610,15 @@ "NullC", ", ", "StringC", - "]>; }>, ", - "NullC", - "]>; created_at: ", - "StringC", - "; created_by: ", - "TypeC", - "<{ email: ", - "UnionC", - "<[", - "UndefinedC", - ", ", - "NullC", - ", ", - "StringC", - "]>; full_name: ", + "]>; }>; updated_at: ", "UnionC", "<[", - "UndefinedC", - ", ", - "NullC", - ", ", "StringC", - "]>; username: ", - "UnionC", - "<[", - "UndefinedC", ", ", "NullC", - ", ", - "StringC", - "]>; }>; external_service: ", + "]>; updated_by: ", "UnionC", "<[", - "IntersectionC", - "<[", - "TypeC", - "<{ connector_id: ", - "StringC", - "; connector_name: ", - "StringC", - "; external_id: ", - "StringC", - "; external_title: ", - "StringC", - "; external_url: ", - "StringC", - "; }>, ", - "TypeC", - "<{ pushed_at: ", - "StringC", - "; pushed_by: ", "TypeC", "<{ email: ", "UnionC", @@ -9925,49 +9644,57 @@ "NullC", ", ", "StringC", - "]>; }>; }>]>, ", + "]>; }>, ", "NullC", - "]>; updated_at: ", + "]>; }>]>, ", + "TypeC", + "<{ mappings: ", + "ArrayC", + "<", + "TypeC", + "<{ action_type: ", "UnionC", "<[", - "StringC", - ", ", - "NullC", - "]>; updated_by: ", + "LiteralC", + "<\"append\">, ", + "LiteralC", + "<\"nothing\">, ", + "LiteralC", + "<\"overwrite\">]>; source: ", "UnionC", "<[", - "TypeC", - "<{ email: ", + "LiteralC", + "<\"title\">, ", + "LiteralC", + "<\"description\">, ", + "LiteralC", + "<\"comments\">]>; target: ", "UnionC", "<[", - "UndefinedC", - ", ", - "NullC", - ", ", "StringC", - "]>; full_name: ", - "UnionC", - "<[", - "UndefinedC", - ", ", - "NullC", ", ", + "LiteralC", + "<\"not_mapped\">]>; }>>; owner: ", "StringC", - "]>; username: ", + "; }>, ", + "TypeC", + "<{ id: ", + "StringC", + "; version: ", + "StringC", + "; error: ", "UnionC", "<[", - "UndefinedC", + "StringC", ", ", "NullC", - ", ", + "]>; owner: ", "StringC", - "]>; }>, ", - "NullC", - "]>; }>]>" + "; }>]>>" ], "source": { - "path": "x-pack/plugins/cases/common/api/cases/case.ts", - "lineNumber": 62 + "path": "x-pack/plugins/cases/common/api/cases/configure.ts", + "lineNumber": 76 }, "deprecated": false, "initialIsOpen": false @@ -10189,7 +9916,9 @@ "LiteralC", "<\"close-by-user\">, ", "LiteralC", - "<\"close-by-pushing\">]>; }>, ", + "<\"close-by-pushing\">]>; owner: ", + "StringC", + "; }>, ", "TypeC", "<{ created_at: ", "StringC", @@ -10259,7 +9988,27 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/cases/configure.ts", - "lineNumber": 27 + "lineNumber": 43 + }, + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "cases", + "id": "def-common.CaseConfigureRequestParamsRt", + "type": "Object", + "tags": [], + "label": "CaseConfigureRequestParamsRt", + "description": [], + "signature": [ + "TypeC", + "<{ configuration_id: ", + "StringC", + "; }>" + ], + "source": { + "path": "x-pack/plugins/cases/common/api/cases/configure.ts", + "lineNumber": 72 }, "deprecated": false, "initialIsOpen": false @@ -10483,7 +10232,9 @@ "LiteralC", "<\"close-by-user\">, ", "LiteralC", - "<\"close-by-pushing\">]>; }>, ", + "<\"close-by-pushing\">]>; owner: ", + "StringC", + "; }>, ", "TypeC", "<{ created_at: ", "StringC", @@ -10577,9 +10328,13 @@ "StringC", ", ", "LiteralC", - "<\"not_mapped\">]>; }>>; }>, ", + "<\"not_mapped\">]>; }>>; owner: ", + "StringC", + "; }>, ", "TypeC", - "<{ version: ", + "<{ id: ", + "StringC", + "; version: ", "StringC", "; error: ", "UnionC", @@ -10587,11 +10342,13 @@ "StringC", ", ", "NullC", - "]>; }>]>" + "]>; owner: ", + "StringC", + "; }>]>" ], "source": { "path": "x-pack/plugins/cases/common/api/cases/configure.ts", - "lineNumber": 37 + "lineNumber": 53 }, "deprecated": false, "initialIsOpen": false @@ -11089,7 +10846,9 @@ "TypeC", "<{ syncAlerts: ", "BooleanC", - "; }>; }>, ", + "; }>; owner: ", + "StringC", + "; }>, ", "TypeC", "<{ id: ", "StringC", @@ -11099,7 +10858,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/cases/case.ts", - "lineNumber": 142 + "lineNumber": 242 }, "deprecated": false, "initialIsOpen": false @@ -11353,11 +11112,13 @@ "TypeC", "<{ syncAlerts: ", "BooleanC", - "; }>; }>]>" + "; }>; owner: ", + "StringC", + "; }>]>" ], "source": { "path": "x-pack/plugins/cases/common/api/cases/case.ts", - "lineNumber": 97 + "lineNumber": 142 }, "deprecated": false, "initialIsOpen": false @@ -11379,7 +11140,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/cases/case.ts", - "lineNumber": 150 + "lineNumber": 253 }, "deprecated": false, "initialIsOpen": false @@ -11663,7 +11424,9 @@ "TypeC", "<{ syncAlerts: ", "BooleanC", - "; }>; }>, ", + "; }>; owner: ", + "StringC", + "; }>, ", "TypeC", "<{ closed_at: ", "UnionC", @@ -11975,7 +11738,9 @@ "StringC", "]>; }>, ", "NullC", - "]>; }>]>, ", + "]>; owner: ", + "StringC", + "; }>]>, ", "TypeC", "<{ id: ", "StringC", @@ -12009,7 +11774,9 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".user>; }>, ", + ".user>; owner: ", + "StringC", + "; }>, ", "TypeC", "<{ associationType: ", "UnionC", @@ -12061,7 +11828,9 @@ "NullC", ", ", "StringC", - "]>; }>; pushed_at: ", + "]>; }>; owner: ", + "StringC", + "; pushed_at: ", "UnionC", "<[", "StringC", @@ -12189,7 +11958,9 @@ "StringC", ", ", "NullC", - "]>; }>; }>, ", + "]>; }>; owner: ", + "StringC", + "; }>, ", "TypeC", "<{ associationType: ", "UnionC", @@ -12241,7 +12012,9 @@ "NullC", ", ", "StringC", - "]>; }>; pushed_at: ", + "]>; }>; owner: ", + "StringC", + "; pushed_at: ", "UnionC", "<[", "StringC", @@ -12341,7 +12114,9 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".user>; }>, ", + ".user>; owner: ", + "StringC", + "; }>, ", "TypeC", "<{ associationType: ", "UnionC", @@ -12393,7 +12168,9 @@ "NullC", ", ", "StringC", - "]>; }>; pushed_at: ", + "]>; }>; owner: ", + "StringC", + "; pushed_at: ", "UnionC", "<[", "StringC", @@ -12521,7 +12298,9 @@ "StringC", ", ", "NullC", - "]>; }>; }>, ", + "]>; }>; owner: ", + "StringC", + "; }>, ", "TypeC", "<{ associationType: ", "UnionC", @@ -12573,7 +12352,9 @@ "NullC", ", ", "StringC", - "]>; }>; pushed_at: ", + "]>; }>; owner: ", + "StringC", + "; pushed_at: ", "UnionC", "<[", "StringC", @@ -12655,7 +12436,33 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/cases/case.ts", - "lineNumber": 117 + "lineNumber": 217 + }, + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "cases", + "id": "def-common.CasesByAlertIDRequestRt", + "type": "Object", + "tags": [], + "label": "CasesByAlertIDRequestRt", + "description": [], + "signature": [ + "PartialC", + "<{ owner: ", + "UnionC", + "<[", + "ArrayC", + "<", + "StringC", + ">, ", + "StringC", + "]>; }>" + ], + "source": { + "path": "x-pack/plugins/cases/common/api/cases/case.ts", + "lineNumber": 209 }, "deprecated": false, "initialIsOpen": false @@ -12905,11 +12712,13 @@ "TypeC", "<{ syncAlerts: ", "BooleanC", - "; }>; }>" + "; }>; owner: ", + "StringC", + "; }>" ], "source": { "path": "x-pack/plugins/cases/common/api/cases/case.ts", - "lineNumber": 86 + "lineNumber": 131 }, "deprecated": false, "initialIsOpen": false @@ -12925,7 +12734,7 @@ "IntersectionC", "<[", "PartialC", - "<{ connector: ", + ", ", "LiteralC", - "<\"close-by-pushing\">]>; }>, ", + "<\"close-by-pushing\">]>; owner: ", + "StringC", + "; }, \"connector\" | \"closure_type\">>, ", "TypeC", "<{ version: ", "StringC", @@ -13139,7 +12950,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/cases/configure.ts", - "lineNumber": 22 + "lineNumber": 38 }, "deprecated": false, "initialIsOpen": false @@ -13359,11 +13170,13 @@ "LiteralC", "<\"close-by-user\">, ", "LiteralC", - "<\"close-by-pushing\">]>; }>" + "<\"close-by-pushing\">]>; owner: ", + "StringC", + "; }>" ], "source": { "path": "x-pack/plugins/cases/common/api/cases/configure.ts", - "lineNumber": 21 + "lineNumber": 37 }, "deprecated": false, "initialIsOpen": false @@ -13464,10 +13277,14 @@ "; search: ", "StringC", "; searchFields: ", + "UnionC", + "<[", "ArrayC", "<", "StringC", - ">; sortField: ", + ">, ", + "StringC", + "]>; sortField: ", "StringC", "; sortOrder: ", "UnionC", @@ -13475,11 +13292,19 @@ "LiteralC", "<\"desc\">, ", "LiteralC", - "<\"asc\">]>; }>" + "<\"asc\">]>; owner: ", + "UnionC", + "<[", + "ArrayC", + "<", + "StringC", + ">, ", + "StringC", + "]>; }>" ], "source": { "path": "x-pack/plugins/cases/common/api/cases/case.ts", - "lineNumber": 102 + "lineNumber": 150 }, "deprecated": false, "initialIsOpen": false @@ -13769,7 +13594,9 @@ "TypeC", "<{ syncAlerts: ", "BooleanC", - "; }>; }>, ", + "; }>; owner: ", + "StringC", + "; }>, ", "TypeC", "<{ closed_at: ", "UnionC", @@ -14081,7 +13908,9 @@ "StringC", "]>; }>, ", "NullC", - "]>; }>]>, ", + "]>; owner: ", + "StringC", + "; }>]>, ", "TypeC", "<{ id: ", "StringC", @@ -14115,7 +13944,9 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".user>; }>, ", + ".user>; owner: ", + "StringC", + "; }>, ", "TypeC", "<{ associationType: ", "UnionC", @@ -14167,7 +13998,9 @@ "NullC", ", ", "StringC", - "]>; }>; pushed_at: ", + "]>; }>; owner: ", + "StringC", + "; pushed_at: ", "UnionC", "<[", "StringC", @@ -14295,7 +14128,9 @@ "StringC", ", ", "NullC", - "]>; }>; }>, ", + "]>; }>; owner: ", + "StringC", + "; }>, ", "TypeC", "<{ associationType: ", "UnionC", @@ -14347,7 +14182,9 @@ "NullC", ", ", "StringC", - "]>; }>; pushed_at: ", + "]>; }>; owner: ", + "StringC", + "; pushed_at: ", "UnionC", "<[", "StringC", @@ -14447,7 +14284,9 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".user>; }>, ", + ".user>; owner: ", + "StringC", + "; }>, ", "TypeC", "<{ associationType: ", "UnionC", @@ -14499,7 +14338,9 @@ "NullC", ", ", "StringC", - "]>; }>; pushed_at: ", + "]>; }>; owner: ", + "StringC", + "; pushed_at: ", "UnionC", "<[", "StringC", @@ -14627,7 +14468,9 @@ "StringC", ", ", "NullC", - "]>; }>; }>, ", + "]>; }>; owner: ", + "StringC", + "; }>, ", "TypeC", "<{ associationType: ", "UnionC", @@ -14679,7 +14522,9 @@ "NullC", ", ", "StringC", - "]>; }>; pushed_at: ", + "]>; }>; owner: ", + "StringC", + "; pushed_at: ", "UnionC", "<[", "StringC", @@ -14775,7 +14620,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/cases/case.ts", - "lineNumber": 132 + "lineNumber": 232 }, "deprecated": false, "initialIsOpen": false @@ -15061,7 +14906,9 @@ "TypeC", "<{ syncAlerts: ", "BooleanC", - "; }>; }>, ", + "; }>; owner: ", + "StringC", + "; }>, ", "TypeC", "<{ id: ", "StringC", @@ -15071,7 +14918,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/cases/case.ts", - "lineNumber": 147 + "lineNumber": 250 }, "deprecated": false, "initialIsOpen": false @@ -15357,7 +15204,9 @@ "TypeC", "<{ syncAlerts: ", "BooleanC", - "; }>; }>, ", + "; }>; owner: ", + "StringC", + "; }>, ", "TypeC", "<{ closed_at: ", "UnionC", @@ -15669,7 +15518,9 @@ "StringC", "]>; }>, ", "NullC", - "]>; }>]>, ", + "]>; owner: ", + "StringC", + "; }>]>, ", "TypeC", "<{ id: ", "StringC", @@ -15703,7 +15554,9 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".user>; }>, ", + ".user>; owner: ", + "StringC", + "; }>, ", "TypeC", "<{ associationType: ", "UnionC", @@ -15755,7 +15608,9 @@ "NullC", ", ", "StringC", - "]>; }>; pushed_at: ", + "]>; }>; owner: ", + "StringC", + "; pushed_at: ", "UnionC", "<[", "StringC", @@ -15883,7 +15738,9 @@ "StringC", ", ", "NullC", - "]>; }>; }>, ", + "]>; }>; owner: ", + "StringC", + "; }>, ", "TypeC", "<{ associationType: ", "UnionC", @@ -15935,7 +15792,9 @@ "NullC", ", ", "StringC", - "]>; }>; pushed_at: ", + "]>; }>; owner: ", + "StringC", + "; pushed_at: ", "UnionC", "<[", "StringC", @@ -16035,7 +15894,9 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".user>; }>, ", + ".user>; owner: ", + "StringC", + "; }>, ", "TypeC", "<{ associationType: ", "UnionC", @@ -16087,7 +15948,9 @@ "NullC", ", ", "StringC", - "]>; }>; pushed_at: ", + "]>; }>; owner: ", + "StringC", + "; pushed_at: ", "UnionC", "<[", "StringC", @@ -16215,7 +16078,9 @@ "StringC", ", ", "NullC", - "]>; }>; }>, ", + "]>; }>; owner: ", + "StringC", + "; }>, ", "TypeC", "<{ associationType: ", "UnionC", @@ -16267,7 +16132,9 @@ "NullC", ", ", "StringC", - "]>; }>; pushed_at: ", + "]>; }>; owner: ", + "StringC", + "; pushed_at: ", "UnionC", "<[", "StringC", @@ -16349,7 +16216,33 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/cases/case.ts", - "lineNumber": 148 + "lineNumber": 251 + }, + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "cases", + "id": "def-common.CasesStatusRequestRt", + "type": "Object", + "tags": [], + "label": "CasesStatusRequestRt", + "description": [], + "signature": [ + "PartialC", + "<{ owner: ", + "UnionC", + "<[", + "ArrayC", + "<", + "StringC", + ">, ", + "StringC", + "]>; }>" + ], + "source": { + "path": "x-pack/plugins/cases/common/api/cases/status.ts", + "lineNumber": 30 }, "deprecated": false, "initialIsOpen": false @@ -16457,7 +16350,9 @@ "LiteralC", "<\"settings\">, ", "LiteralC", - "<\"sub_case\">]>>; action: ", + "<\"sub_case\">, ", + "LiteralC", + "<\"owner\">]>>; action: ", "UnionC", "<[", "LiteralC", @@ -16509,11 +16404,13 @@ "StringC", ", ", "NullC", - "]>; }>" + "]>; owner: ", + "StringC", + "; }>" ], "source": { "path": "x-pack/plugins/cases/common/api/cases/user_actions.ts", - "lineNumber": 55 + "lineNumber": 58 }, "deprecated": false, "initialIsOpen": false @@ -16553,7 +16450,9 @@ "LiteralC", "<\"settings\">, ", "LiteralC", - "<\"sub_case\">]>>; action: ", + "<\"sub_case\">, ", + "LiteralC", + "<\"owner\">]>>; action: ", "UnionC", "<[", "LiteralC", @@ -16605,7 +16504,9 @@ "StringC", ", ", "NullC", - "]>; }>, ", + "]>; owner: ", + "StringC", + "; }>, ", "TypeC", "<{ action_id: ", "StringC", @@ -16625,7 +16526,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/cases/user_actions.ts", - "lineNumber": 57 + "lineNumber": 60 }, "deprecated": false, "initialIsOpen": false @@ -16689,7 +16590,9 @@ "NullC", ", ", "StringC", - "]>; }>; pushed_at: ", + "]>; }>; owner: ", + "StringC", + "; pushed_at: ", "UnionC", "<[", "StringC", @@ -16765,7 +16668,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/cases/comment.ts", - "lineNumber": 38 + "lineNumber": 39 }, "deprecated": false, "initialIsOpen": false @@ -16835,7 +16738,9 @@ "NullC", ", ", "StringC", - "]>; }>; pushed_at: ", + "]>; }>; owner: ", + "StringC", + "; pushed_at: ", "UnionC", "<[", "StringC", @@ -16961,7 +16866,9 @@ "StringC", ", ", "NullC", - "]>; }>; }>]>, ", + "]>; }>; owner: ", + "StringC", + "; }>]>, ", "PartialC", "<{ associationType: ", "UnionC", @@ -17013,7 +16920,9 @@ "NullC", ", ", "StringC", - "]>; }>; pushed_at: ", + "]>; }>; owner: ", + "StringC", + "; pushed_at: ", "UnionC", "<[", "StringC", @@ -17089,7 +16998,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/cases/comment.ts", - "lineNumber": 116 + "lineNumber": 120 }, "deprecated": false, "initialIsOpen": false @@ -17119,7 +17028,9 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".user>; }>, ", + ".user>; owner: ", + "StringC", + "; }>, ", "TypeC", "<{ type: ", "UnionC", @@ -17173,7 +17084,9 @@ "StringC", ", ", "NullC", - "]>; }>; }>]>, ", + "]>; }>; owner: ", + "StringC", + "; }>]>, ", "TypeC", "<{ id: ", "StringC", @@ -17183,7 +17096,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/cases/comment.ts", - "lineNumber": 101 + "lineNumber": 105 }, "deprecated": false, "initialIsOpen": false @@ -17211,7 +17124,9 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".user>; }>, ", + ".user>; owner: ", + "StringC", + "; }>, ", "TypeC", "<{ type: ", "UnionC", @@ -17265,11 +17180,13 @@ "StringC", ", ", "NullC", - "]>; }>; }>]>" + "]>; }>; owner: ", + "StringC", + "; }>]>" ], "source": { "path": "x-pack/plugins/cases/common/api/cases/comment.ts", - "lineNumber": 81 + "lineNumber": 85 }, "deprecated": false, "initialIsOpen": false @@ -17301,7 +17218,9 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".user>; }>, ", + ".user>; owner: ", + "StringC", + "; }>, ", "TypeC", "<{ associationType: ", "UnionC", @@ -17353,7 +17272,9 @@ "NullC", ", ", "StringC", - "]>; }>; pushed_at: ", + "]>; }>; owner: ", + "StringC", + "; pushed_at: ", "UnionC", "<[", "StringC", @@ -17481,7 +17402,9 @@ "StringC", ", ", "NullC", - "]>; }>; }>, ", + "]>; }>; owner: ", + "StringC", + "; }>, ", "TypeC", "<{ associationType: ", "UnionC", @@ -17533,7 +17456,9 @@ "NullC", ", ", "StringC", - "]>; }>; pushed_at: ", + "]>; }>; owner: ", + "StringC", + "; pushed_at: ", "UnionC", "<[", "StringC", @@ -17615,7 +17540,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/cases/comment.ts", - "lineNumber": 83 + "lineNumber": 87 }, "deprecated": false, "initialIsOpen": false @@ -17685,7 +17610,9 @@ "StringC", ", ", "NullC", - "]>; }>; }>, ", + "]>; }>; owner: ", + "StringC", + "; }>, ", "TypeC", "<{ associationType: ", "UnionC", @@ -17737,7 +17664,9 @@ "NullC", ", ", "StringC", - "]>; }>; pushed_at: ", + "]>; }>; owner: ", + "StringC", + "; pushed_at: ", "UnionC", "<[", "StringC", @@ -17819,7 +17748,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/cases/comment.ts", - "lineNumber": 91 + "lineNumber": 95 }, "deprecated": false, "initialIsOpen": false @@ -17855,7 +17784,9 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".user>; }>, ", + ".user>; owner: ", + "StringC", + "; }>, ", "TypeC", "<{ associationType: ", "UnionC", @@ -17907,7 +17838,9 @@ "NullC", ", ", "StringC", - "]>; }>; pushed_at: ", + "]>; }>; owner: ", + "StringC", + "; pushed_at: ", "UnionC", "<[", "StringC", @@ -18035,7 +17968,9 @@ "StringC", ", ", "NullC", - "]>; }>; }>, ", + "]>; }>; owner: ", + "StringC", + "; }>, ", "TypeC", "<{ associationType: ", "UnionC", @@ -18087,7 +18022,9 @@ "NullC", ", ", "StringC", - "]>; }>; pushed_at: ", + "]>; }>; owner: ", + "StringC", + "; pushed_at: ", "UnionC", "<[", "StringC", @@ -18175,7 +18112,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/cases/comment.ts", - "lineNumber": 121 + "lineNumber": 125 }, "deprecated": false, "initialIsOpen": false @@ -18387,7 +18324,9 @@ "StringC", ", ", "LiteralC", - "<\"not_mapped\">]>; }>>; }>" + "<\"not_mapped\">]>; }>>; owner: ", + "StringC", + "; }>" ], "source": { "path": "x-pack/plugins/cases/common/api/connectors/mappings.ts", @@ -18625,11 +18564,13 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".user>; }>" + ".user>; owner: ", + "StringC", + "; }>" ], "source": { "path": "x-pack/plugins/cases/common/api/cases/comment.ts", - "lineNumber": 57 + "lineNumber": 59 }, "deprecated": false, "initialIsOpen": false @@ -18673,7 +18614,79 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/cases/case.ts", - "lineNumber": 155 + "lineNumber": 258 + }, + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "cases", + "id": "def-common.FindQueryParamsRt", + "type": "Object", + "tags": [], + "label": "FindQueryParamsRt", + "description": [], + "signature": [ + "PartialC", + "<{ subCaseId: ", + "StringC", + "; defaultSearchOperator: ", + "UnionC", + "<[", + "LiteralC", + "<\"AND\">, ", + "LiteralC", + "<\"OR\">]>; hasReferenceOperator: ", + "UnionC", + "<[", + "LiteralC", + "<\"AND\">, ", + "LiteralC", + "<\"OR\">]>; hasReference: ", + "UnionC", + "<[", + "ArrayC", + "<", + "TypeC", + "<{ id: ", + "StringC", + "; type: ", + "StringC", + "; }>>, ", + "TypeC", + "<{ id: ", + "StringC", + "; type: ", + "StringC", + "; }>]>; fields: ", + "ArrayC", + "<", + "StringC", + ">; filter: ", + "StringC", + "; page: ", + "Type", + "; perPage: ", + "Type", + "; search: ", + "StringC", + "; searchFields: ", + "ArrayC", + "<", + "StringC", + ">; sortField: ", + "StringC", + "; sortOrder: ", + "UnionC", + "<[", + "LiteralC", + "<\"desc\">, ", + "LiteralC", + "<\"asc\">]>; }>" + ], + "source": { + "path": "x-pack/plugins/cases/common/api/cases/comment.ts", + "lineNumber": 134 }, "deprecated": false, "initialIsOpen": false @@ -18703,7 +18716,33 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/cases/comment.ts", - "lineNumber": 18 + "lineNumber": 19 + }, + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "cases", + "id": "def-common.GetConfigureFindRequestRt", + "type": "Object", + "tags": [], + "label": "GetConfigureFindRequestRt", + "description": [], + "signature": [ + "PartialC", + "<{ owner: ", + "UnionC", + "<[", + "ArrayC", + "<", + "StringC", + ">, ", + "StringC", + "]>; }>" + ], + "source": { + "path": "x-pack/plugins/cases/common/api/cases/configure.ts", + "lineNumber": 64 }, "deprecated": false, "initialIsOpen": false @@ -19121,11 +19160,13 @@ "StringC", "]>; }>, ", "NullC", - "]>; }>]>" + "]>; owner: ", + "StringC", + "; }>]>" ], "source": { "path": "x-pack/plugins/cases/common/api/cases/sub_case.ts", - "lineNumber": 20 + "lineNumber": 23 }, "deprecated": false, "initialIsOpen": false @@ -19183,7 +19224,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/cases/sub_case.ts", - "lineNumber": 67 + "lineNumber": 99 }, "deprecated": false, "initialIsOpen": false @@ -19339,7 +19380,9 @@ "StringC", "]>; }>, ", "NullC", - "]>; }>]>, ", + "]>; owner: ", + "StringC", + "; }>]>, ", "TypeC", "<{ id: ", "StringC", @@ -19373,7 +19416,9 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".user>; }>, ", + ".user>; owner: ", + "StringC", + "; }>, ", "TypeC", "<{ associationType: ", "UnionC", @@ -19425,7 +19470,9 @@ "NullC", ", ", "StringC", - "]>; }>; pushed_at: ", + "]>; }>; owner: ", + "StringC", + "; pushed_at: ", "UnionC", "<[", "StringC", @@ -19553,7 +19600,9 @@ "StringC", ", ", "NullC", - "]>; }>; }>, ", + "]>; }>; owner: ", + "StringC", + "; }>, ", "TypeC", "<{ associationType: ", "UnionC", @@ -19605,7 +19654,9 @@ "NullC", ", ", "StringC", - "]>; }>; pushed_at: ", + "]>; }>; owner: ", + "StringC", + "; pushed_at: ", "UnionC", "<[", "StringC", @@ -19687,7 +19738,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/cases/sub_case.ts", - "lineNumber": 44 + "lineNumber": 76 }, "deprecated": false, "initialIsOpen": false @@ -19761,11 +19812,13 @@ "LiteralC", "<\"desc\">, ", "LiteralC", - "<\"asc\">]>; }>" + "<\"asc\">]>; owner: ", + "StringC", + "; }>" ], "source": { "path": "x-pack/plugins/cases/common/api/cases/sub_case.ts", - "lineNumber": 32 + "lineNumber": 36 }, "deprecated": false, "initialIsOpen": false @@ -19927,7 +19980,9 @@ "StringC", "]>; }>, ", "NullC", - "]>; }>]>, ", + "]>; owner: ", + "StringC", + "; }>]>, ", "TypeC", "<{ id: ", "StringC", @@ -19961,7 +20016,9 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".user>; }>, ", + ".user>; owner: ", + "StringC", + "; }>, ", "TypeC", "<{ associationType: ", "UnionC", @@ -20013,7 +20070,9 @@ "NullC", ", ", "StringC", - "]>; }>; pushed_at: ", + "]>; }>; owner: ", + "StringC", + "; pushed_at: ", "UnionC", "<[", "StringC", @@ -20141,7 +20200,9 @@ "StringC", ", ", "NullC", - "]>; }>; }>, ", + "]>; }>; owner: ", + "StringC", + "; }>, ", "TypeC", "<{ associationType: ", "UnionC", @@ -20193,7 +20254,9 @@ "NullC", ", ", "StringC", - "]>; }>; pushed_at: ", + "]>; }>; owner: ", + "StringC", + "; pushed_at: ", "UnionC", "<[", "StringC", @@ -20289,7 +20352,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/cases/sub_case.ts", - "lineNumber": 57 + "lineNumber": 89 }, "deprecated": false, "initialIsOpen": false @@ -20351,7 +20414,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/cases/sub_case.ts", - "lineNumber": 72 + "lineNumber": 104 }, "deprecated": false, "initialIsOpen": false @@ -20509,7 +20572,9 @@ "StringC", "]>; }>, ", "NullC", - "]>; }>]>, ", + "]>; owner: ", + "StringC", + "; }>]>, ", "TypeC", "<{ id: ", "StringC", @@ -20543,7 +20608,9 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".user>; }>, ", + ".user>; owner: ", + "StringC", + "; }>, ", "TypeC", "<{ associationType: ", "UnionC", @@ -20595,7 +20662,9 @@ "NullC", ", ", "StringC", - "]>; }>; pushed_at: ", + "]>; }>; owner: ", + "StringC", + "; pushed_at: ", "UnionC", "<[", "StringC", @@ -20723,7 +20792,9 @@ "StringC", ", ", "NullC", - "]>; }>; }>, ", + "]>; }>; owner: ", + "StringC", + "; }>, ", "TypeC", "<{ associationType: ", "UnionC", @@ -20775,7 +20846,9 @@ "NullC", ", ", "StringC", - "]>; }>; pushed_at: ", + "]>; }>; owner: ", + "StringC", + "; pushed_at: ", "UnionC", "<[", "StringC", @@ -20857,7 +20930,7 @@ ], "source": { "path": "x-pack/plugins/cases/common/api/cases/sub_case.ts", - "lineNumber": 73 + "lineNumber": 105 }, "deprecated": false, "initialIsOpen": false diff --git a/api_docs/cases.mdx b/api_docs/cases.mdx index 892e3e02e75222..20d371cbcdc6e0 100644 --- a/api_docs/cases.mdx +++ b/api_docs/cases.mdx @@ -27,6 +27,9 @@ import casesObj from './cases.json'; ## Server +### Classes + + ### Interfaces diff --git a/api_docs/charts.json b/api_docs/charts.json index 29c1c163d19a03..f42832e5d1e95f 100644 --- a/api_docs/charts.json +++ b/api_docs/charts.json @@ -11,11 +11,11 @@ "label": "ColorPicker", "description": [], "signature": [ - "({ onChange, color: selectedColor, label, useLegacyColors, colorIsOverwritten, onKeyDown, }: ColorPickerProps) => JSX.Element" + "({ onChange, color: selectedColor, label, useLegacyColors, colorIsOverwritten, onKeyDown, maxDepth, layerIndex, }: ColorPickerProps) => JSX.Element" ], "source": { "path": "src/plugins/charts/public/static/components/color_picker.tsx", - "lineNumber": 111 + "lineNumber": 119 }, "deprecated": false, "children": [ @@ -24,14 +24,14 @@ "id": "def-public.ColorPicker.$1", "type": "Object", "tags": [], - "label": "{\n onChange,\n color: selectedColor,\n label,\n useLegacyColors = true,\n colorIsOverwritten = true,\n onKeyDown,\n}", + "label": "{\n onChange,\n color: selectedColor,\n label,\n useLegacyColors = true,\n colorIsOverwritten = true,\n onKeyDown,\n maxDepth,\n layerIndex,\n}", "description": [], "signature": [ "ColorPickerProps" ], "source": { "path": "src/plugins/charts/public/static/components/color_picker.tsx", - "lineNumber": 111 + "lineNumber": 119 }, "deprecated": false, "isRequired": true @@ -630,6 +630,77 @@ ], "initialIsOpen": false }, + { + "parentPluginId": "charts", + "id": "def-public.lightenColor", + "type": "Function", + "tags": [], + "label": "lightenColor", + "description": [], + "signature": [ + "(baseColor: string, step: number, totalSteps: number) => string" + ], + "source": { + "path": "src/plugins/charts/public/services/palettes/lighten_color.ts", + "lineNumber": 14 + }, + "deprecated": false, + "children": [ + { + "parentPluginId": "charts", + "id": "def-public.lightenColor.$1", + "type": "string", + "tags": [], + "label": "baseColor", + "description": [], + "signature": [ + "string" + ], + "source": { + "path": "src/plugins/charts/public/services/palettes/lighten_color.ts", + "lineNumber": 14 + }, + "deprecated": false, + "isRequired": true + }, + { + "parentPluginId": "charts", + "id": "def-public.lightenColor.$2", + "type": "number", + "tags": [], + "label": "step", + "description": [], + "signature": [ + "number" + ], + "source": { + "path": "src/plugins/charts/public/services/palettes/lighten_color.ts", + "lineNumber": 14 + }, + "deprecated": false, + "isRequired": true + }, + { + "parentPluginId": "charts", + "id": "def-public.lightenColor.$3", + "type": "number", + "tags": [], + "label": "totalSteps", + "description": [], + "signature": [ + "number" + ], + "source": { + "path": "src/plugins/charts/public/services/palettes/lighten_color.ts", + "lineNumber": 14 + }, + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, { "parentPluginId": "charts", "id": "def-public.renderEndzoneTooltip", @@ -1132,6 +1203,86 @@ "lineNumber": 16 }, "deprecated": false + }, + { + "parentPluginId": "charts", + "id": "def-public.CustomPaletteArguments.stop", + "type": "Array", + "tags": [], + "label": "stop", + "description": [], + "signature": [ + "number[] | undefined" + ], + "source": { + "path": "src/plugins/charts/common/palette.ts", + "lineNumber": 17 + }, + "deprecated": false + }, + { + "parentPluginId": "charts", + "id": "def-public.CustomPaletteArguments.range", + "type": "CompoundType", + "tags": [], + "label": "range", + "description": [], + "signature": [ + "\"number\" | \"percent\" | undefined" + ], + "source": { + "path": "src/plugins/charts/common/palette.ts", + "lineNumber": 18 + }, + "deprecated": false + }, + { + "parentPluginId": "charts", + "id": "def-public.CustomPaletteArguments.rangeMin", + "type": "number", + "tags": [], + "label": "rangeMin", + "description": [], + "signature": [ + "number | undefined" + ], + "source": { + "path": "src/plugins/charts/common/palette.ts", + "lineNumber": 19 + }, + "deprecated": false + }, + { + "parentPluginId": "charts", + "id": "def-public.CustomPaletteArguments.rangeMax", + "type": "number", + "tags": [], + "label": "rangeMax", + "description": [], + "signature": [ + "number | undefined" + ], + "source": { + "path": "src/plugins/charts/common/palette.ts", + "lineNumber": 20 + }, + "deprecated": false + }, + { + "parentPluginId": "charts", + "id": "def-public.CustomPaletteArguments.continuity", + "type": "CompoundType", + "tags": [], + "label": "continuity", + "description": [], + "signature": [ + "\"above\" | \"below\" | \"all\" | \"none\" | undefined" + ], + "source": { + "path": "src/plugins/charts/common/palette.ts", + "lineNumber": 21 + }, + "deprecated": false } ], "initialIsOpen": false @@ -1145,7 +1296,7 @@ "description": [], "source": { "path": "src/plugins/charts/common/palette.ts", - "lineNumber": 19 + "lineNumber": 24 }, "deprecated": false, "children": [ @@ -1161,7 +1312,7 @@ ], "source": { "path": "src/plugins/charts/common/palette.ts", - "lineNumber": 20 + "lineNumber": 25 }, "deprecated": false }, @@ -1174,7 +1325,81 @@ "description": [], "source": { "path": "src/plugins/charts/common/palette.ts", - "lineNumber": 21 + "lineNumber": 26 + }, + "deprecated": false + }, + { + "parentPluginId": "charts", + "id": "def-public.CustomPaletteState.stops", + "type": "Array", + "tags": [], + "label": "stops", + "description": [], + "signature": [ + "number[]" + ], + "source": { + "path": "src/plugins/charts/common/palette.ts", + "lineNumber": 27 + }, + "deprecated": false + }, + { + "parentPluginId": "charts", + "id": "def-public.CustomPaletteState.range", + "type": "CompoundType", + "tags": [], + "label": "range", + "description": [], + "signature": [ + "\"number\" | \"percent\"" + ], + "source": { + "path": "src/plugins/charts/common/palette.ts", + "lineNumber": 28 + }, + "deprecated": false + }, + { + "parentPluginId": "charts", + "id": "def-public.CustomPaletteState.rangeMin", + "type": "number", + "tags": [], + "label": "rangeMin", + "description": [], + "source": { + "path": "src/plugins/charts/common/palette.ts", + "lineNumber": 29 + }, + "deprecated": false + }, + { + "parentPluginId": "charts", + "id": "def-public.CustomPaletteState.rangeMax", + "type": "number", + "tags": [], + "label": "rangeMax", + "description": [], + "source": { + "path": "src/plugins/charts/common/palette.ts", + "lineNumber": 30 + }, + "deprecated": false + }, + { + "parentPluginId": "charts", + "id": "def-public.CustomPaletteState.continuity", + "type": "CompoundType", + "tags": [], + "label": "continuity", + "description": [], + "signature": [ + "\"above\" | \"below\" | \"all\" | \"none\" | undefined" + ], + "source": { + "path": "src/plugins/charts/common/palette.ts", + "lineNumber": 31 }, "deprecated": false } @@ -1408,28 +1633,10 @@ }, { "parentPluginId": "charts", - "id": "def-public.PaletteDefinition.renderEditor", + "id": "def-public.PaletteDefinition.getCategoricalColor", "type": "Function", "tags": [], - "label": "renderEditor", - "description": [ - "\nRenders the UI for editing the internal state of the palette.\nNot each palette has to feature an internal state, so this is an optional property." - ], - "signature": [ - "((domElement: Element, props: { state?: T | undefined; setState: (updater: (oldState: T) => T) => void; }) => void) | undefined" - ], - "source": { - "path": "src/plugins/charts/public/services/palettes/types.ts", - "lineNumber": 88 - }, - "deprecated": false - }, - { - "parentPluginId": "charts", - "id": "def-public.PaletteDefinition.getColor", - "type": "Function", - "tags": [], - "label": "getColor", + "label": "getCategoricalColor", "description": [ "\nColor a series according to the internal rules of the palette." ], @@ -1454,7 +1661,7 @@ ], "source": { "path": "src/plugins/charts/public/services/palettes/types.ts", - "lineNumber": 97 + "lineNumber": 87 }, "deprecated": false, "returnComment": [], @@ -1480,7 +1687,7 @@ ], "source": { "path": "src/plugins/charts/public/services/palettes/types.ts", - "lineNumber": 98 + "lineNumber": 88 }, "deprecated": false }, @@ -1503,7 +1710,7 @@ ], "source": { "path": "src/plugins/charts/public/services/palettes/types.ts", - "lineNumber": 99 + "lineNumber": 89 }, "deprecated": false }, @@ -1521,7 +1728,7 @@ ], "source": { "path": "src/plugins/charts/public/services/palettes/types.ts", - "lineNumber": 100 + "lineNumber": 90 }, "deprecated": false } @@ -1529,10 +1736,10 @@ }, { "parentPluginId": "charts", - "id": "def-public.PaletteDefinition.getColors", + "id": "def-public.PaletteDefinition.getCategoricalColors", "type": "Function", "tags": [], - "label": "getColors", + "label": "getCategoricalColors", "description": [ "\nGet a spectrum of colors of the current palette.\nThis can be used if the chart wants to control color assignment locally." ], @@ -1541,7 +1748,7 @@ ], "source": { "path": "src/plugins/charts/public/services/palettes/types.ts", - "lineNumber": 106 + "lineNumber": 96 }, "deprecated": false, "returnComment": [], @@ -1555,7 +1762,7 @@ "description": [], "source": { "path": "src/plugins/charts/public/services/palettes/types.ts", - "lineNumber": 106 + "lineNumber": 96 }, "deprecated": false }, @@ -1571,11 +1778,47 @@ ], "source": { "path": "src/plugins/charts/public/services/palettes/types.ts", - "lineNumber": 106 + "lineNumber": 96 }, "deprecated": false } ] + }, + { + "parentPluginId": "charts", + "id": "def-public.PaletteDefinition.canDynamicColoring", + "type": "CompoundType", + "tags": [], + "label": "canDynamicColoring", + "description": [ + "\nDefine whether a palette supports dynamic coloring (i.e. gradient colors mapped to number values)" + ], + "signature": [ + "boolean | undefined" + ], + "source": { + "path": "src/plugins/charts/public/services/palettes/types.ts", + "lineNumber": 100 + }, + "deprecated": false + }, + { + "parentPluginId": "charts", + "id": "def-public.PaletteDefinition.getColorForValue", + "type": "Function", + "tags": [], + "label": "getColorForValue", + "description": [ + "\nGet the assigned color for the given value based on its data domain and state settings.\nThis can be used for dynamic coloring based on uniform color distribution or custom stops." + ], + "signature": [ + "((value: number | undefined, state: T, { min, max }: { min: number; max: number; }) => string | undefined) | undefined" + ], + "source": { + "path": "src/plugins/charts/public/services/palettes/types.ts", + "lineNumber": 105 + }, + "deprecated": false } ], "initialIsOpen": false @@ -1599,7 +1842,7 @@ ], "source": { "path": "src/plugins/charts/common/palette.ts", - "lineNumber": 28 + "lineNumber": 38 }, "deprecated": false, "children": [ @@ -1615,7 +1858,7 @@ ], "source": { "path": "src/plugins/charts/common/palette.ts", - "lineNumber": 29 + "lineNumber": 39 }, "deprecated": false }, @@ -1628,7 +1871,7 @@ "description": [], "source": { "path": "src/plugins/charts/common/palette.ts", - "lineNumber": 30 + "lineNumber": 40 }, "deprecated": false }, @@ -1644,7 +1887,7 @@ ], "source": { "path": "src/plugins/charts/common/palette.ts", - "lineNumber": 31 + "lineNumber": 41 }, "deprecated": false } @@ -1660,7 +1903,7 @@ "description": [], "source": { "path": "src/plugins/charts/public/services/palettes/types.ts", - "lineNumber": 109 + "lineNumber": 112 }, "deprecated": false, "children": [ @@ -1684,7 +1927,7 @@ ], "source": { "path": "src/plugins/charts/public/services/palettes/types.ts", - "lineNumber": 110 + "lineNumber": 113 }, "deprecated": false, "returnComment": [], @@ -1698,7 +1941,7 @@ "description": [], "source": { "path": "src/plugins/charts/public/services/palettes/types.ts", - "lineNumber": 110 + "lineNumber": 113 }, "deprecated": false } @@ -1724,7 +1967,7 @@ ], "source": { "path": "src/plugins/charts/public/services/palettes/types.ts", - "lineNumber": 111 + "lineNumber": 114 }, "deprecated": false, "returnComment": [], @@ -1953,7 +2196,7 @@ "description": [], "source": { "path": "src/plugins/charts/common/palette.ts", - "lineNumber": 24 + "lineNumber": 34 }, "deprecated": false, "children": [ @@ -1966,7 +2209,7 @@ "description": [], "source": { "path": "src/plugins/charts/common/palette.ts", - "lineNumber": 25 + "lineNumber": 35 }, "deprecated": false } @@ -2693,7 +2936,7 @@ ], "source": { "path": "src/plugins/charts/common/palette.ts", - "lineNumber": 53 + "lineNumber": 63 }, "deprecated": false, "children": [], @@ -2754,7 +2997,7 @@ ], "source": { "path": "src/plugins/charts/common/palette.ts", - "lineNumber": 119 + "lineNumber": 175 }, "deprecated": false, "children": [], @@ -2820,6 +3063,86 @@ "lineNumber": 16 }, "deprecated": false + }, + { + "parentPluginId": "charts", + "id": "def-common.CustomPaletteArguments.stop", + "type": "Array", + "tags": [], + "label": "stop", + "description": [], + "signature": [ + "number[] | undefined" + ], + "source": { + "path": "src/plugins/charts/common/palette.ts", + "lineNumber": 17 + }, + "deprecated": false + }, + { + "parentPluginId": "charts", + "id": "def-common.CustomPaletteArguments.range", + "type": "CompoundType", + "tags": [], + "label": "range", + "description": [], + "signature": [ + "\"number\" | \"percent\" | undefined" + ], + "source": { + "path": "src/plugins/charts/common/palette.ts", + "lineNumber": 18 + }, + "deprecated": false + }, + { + "parentPluginId": "charts", + "id": "def-common.CustomPaletteArguments.rangeMin", + "type": "number", + "tags": [], + "label": "rangeMin", + "description": [], + "signature": [ + "number | undefined" + ], + "source": { + "path": "src/plugins/charts/common/palette.ts", + "lineNumber": 19 + }, + "deprecated": false + }, + { + "parentPluginId": "charts", + "id": "def-common.CustomPaletteArguments.rangeMax", + "type": "number", + "tags": [], + "label": "rangeMax", + "description": [], + "signature": [ + "number | undefined" + ], + "source": { + "path": "src/plugins/charts/common/palette.ts", + "lineNumber": 20 + }, + "deprecated": false + }, + { + "parentPluginId": "charts", + "id": "def-common.CustomPaletteArguments.continuity", + "type": "CompoundType", + "tags": [], + "label": "continuity", + "description": [], + "signature": [ + "\"above\" | \"below\" | \"all\" | \"none\" | undefined" + ], + "source": { + "path": "src/plugins/charts/common/palette.ts", + "lineNumber": 21 + }, + "deprecated": false } ], "initialIsOpen": false @@ -2833,7 +3156,7 @@ "description": [], "source": { "path": "src/plugins/charts/common/palette.ts", - "lineNumber": 19 + "lineNumber": 24 }, "deprecated": false, "children": [ @@ -2849,7 +3172,7 @@ ], "source": { "path": "src/plugins/charts/common/palette.ts", - "lineNumber": 20 + "lineNumber": 25 }, "deprecated": false }, @@ -2862,7 +3185,81 @@ "description": [], "source": { "path": "src/plugins/charts/common/palette.ts", - "lineNumber": 21 + "lineNumber": 26 + }, + "deprecated": false + }, + { + "parentPluginId": "charts", + "id": "def-common.CustomPaletteState.stops", + "type": "Array", + "tags": [], + "label": "stops", + "description": [], + "signature": [ + "number[]" + ], + "source": { + "path": "src/plugins/charts/common/palette.ts", + "lineNumber": 27 + }, + "deprecated": false + }, + { + "parentPluginId": "charts", + "id": "def-common.CustomPaletteState.range", + "type": "CompoundType", + "tags": [], + "label": "range", + "description": [], + "signature": [ + "\"number\" | \"percent\"" + ], + "source": { + "path": "src/plugins/charts/common/palette.ts", + "lineNumber": 28 + }, + "deprecated": false + }, + { + "parentPluginId": "charts", + "id": "def-common.CustomPaletteState.rangeMin", + "type": "number", + "tags": [], + "label": "rangeMin", + "description": [], + "source": { + "path": "src/plugins/charts/common/palette.ts", + "lineNumber": 29 + }, + "deprecated": false + }, + { + "parentPluginId": "charts", + "id": "def-common.CustomPaletteState.rangeMax", + "type": "number", + "tags": [], + "label": "rangeMax", + "description": [], + "source": { + "path": "src/plugins/charts/common/palette.ts", + "lineNumber": 30 + }, + "deprecated": false + }, + { + "parentPluginId": "charts", + "id": "def-common.CustomPaletteState.continuity", + "type": "CompoundType", + "tags": [], + "label": "continuity", + "description": [], + "signature": [ + "\"above\" | \"below\" | \"all\" | \"none\" | undefined" + ], + "source": { + "path": "src/plugins/charts/common/palette.ts", + "lineNumber": 31 }, "deprecated": false } @@ -2888,7 +3285,7 @@ ], "source": { "path": "src/plugins/charts/common/palette.ts", - "lineNumber": 28 + "lineNumber": 38 }, "deprecated": false, "children": [ @@ -2904,7 +3301,7 @@ ], "source": { "path": "src/plugins/charts/common/palette.ts", - "lineNumber": 29 + "lineNumber": 39 }, "deprecated": false }, @@ -2917,7 +3314,7 @@ "description": [], "source": { "path": "src/plugins/charts/common/palette.ts", - "lineNumber": 30 + "lineNumber": 40 }, "deprecated": false }, @@ -2933,7 +3330,7 @@ ], "source": { "path": "src/plugins/charts/common/palette.ts", - "lineNumber": 31 + "lineNumber": 41 }, "deprecated": false } @@ -2949,7 +3346,7 @@ "description": [], "source": { "path": "src/plugins/charts/common/palette.ts", - "lineNumber": 24 + "lineNumber": 34 }, "deprecated": false, "children": [ @@ -2962,7 +3359,7 @@ "description": [], "source": { "path": "src/plugins/charts/common/palette.ts", - "lineNumber": 25 + "lineNumber": 35 }, "deprecated": false } @@ -3001,7 +3398,7 @@ ], "source": { "path": "src/plugins/charts/common/palette.ts", - "lineNumber": 33 + "lineNumber": 43 }, "deprecated": false, "initialIsOpen": false diff --git a/api_docs/core.json b/api_docs/core.json index 4fedef842a1c4c..0f856afee51c5b 100644 --- a/api_docs/core.json +++ b/api_docs/core.json @@ -8058,7 +8058,7 @@ ], "source": { "path": "src/core/server/elasticsearch/elasticsearch_config.ts", - "lineNumber": 188 + "lineNumber": 210 }, "deprecated": false, "children": [ @@ -8076,7 +8076,7 @@ ], "source": { "path": "src/core/server/elasticsearch/elasticsearch_config.ts", - "lineNumber": 192 + "lineNumber": 214 }, "deprecated": false }, @@ -8091,7 +8091,7 @@ ], "source": { "path": "src/core/server/elasticsearch/elasticsearch_config.ts", - "lineNumber": 197 + "lineNumber": 219 }, "deprecated": false }, @@ -8106,7 +8106,7 @@ ], "source": { "path": "src/core/server/elasticsearch/elasticsearch_config.ts", - "lineNumber": 202 + "lineNumber": 224 }, "deprecated": false }, @@ -8124,7 +8124,7 @@ ], "source": { "path": "src/core/server/elasticsearch/elasticsearch_config.ts", - "lineNumber": 208 + "lineNumber": 230 }, "deprecated": false }, @@ -8142,7 +8142,7 @@ ], "source": { "path": "src/core/server/elasticsearch/elasticsearch_config.ts", - "lineNumber": 215 + "lineNumber": 237 }, "deprecated": false }, @@ -8160,7 +8160,7 @@ ], "source": { "path": "src/core/server/elasticsearch/elasticsearch_config.ts", - "lineNumber": 220 + "lineNumber": 242 }, "deprecated": false }, @@ -8178,7 +8178,7 @@ ], "source": { "path": "src/core/server/elasticsearch/elasticsearch_config.ts", - "lineNumber": 225 + "lineNumber": 247 }, "deprecated": false }, @@ -8196,7 +8196,7 @@ ], "source": { "path": "src/core/server/elasticsearch/elasticsearch_config.ts", - "lineNumber": 230 + "lineNumber": 252 }, "deprecated": false }, @@ -8211,7 +8211,7 @@ ], "source": { "path": "src/core/server/elasticsearch/elasticsearch_config.ts", - "lineNumber": 236 + "lineNumber": 258 }, "deprecated": false }, @@ -8229,7 +8229,7 @@ ], "source": { "path": "src/core/server/elasticsearch/elasticsearch_config.ts", - "lineNumber": 242 + "lineNumber": 264 }, "deprecated": false }, @@ -8244,7 +8244,7 @@ ], "source": { "path": "src/core/server/elasticsearch/elasticsearch_config.ts", - "lineNumber": 248 + "lineNumber": 270 }, "deprecated": false }, @@ -8262,7 +8262,7 @@ ], "source": { "path": "src/core/server/elasticsearch/elasticsearch_config.ts", - "lineNumber": 254 + "lineNumber": 276 }, "deprecated": false }, @@ -8280,7 +8280,7 @@ ], "source": { "path": "src/core/server/elasticsearch/elasticsearch_config.ts", - "lineNumber": 260 + "lineNumber": 282 }, "deprecated": false }, @@ -8298,7 +8298,7 @@ ], "source": { "path": "src/core/server/elasticsearch/elasticsearch_config.ts", - "lineNumber": 267 + "lineNumber": 289 }, "deprecated": false }, @@ -8316,7 +8316,7 @@ ], "source": { "path": "src/core/server/elasticsearch/elasticsearch_config.ts", - "lineNumber": 277 + "lineNumber": 299 }, "deprecated": false }, @@ -8332,7 +8332,7 @@ ], "source": { "path": "src/core/server/elasticsearch/elasticsearch_config.ts", - "lineNumber": 279 + "lineNumber": 301 }, "deprecated": false, "children": [ @@ -8348,7 +8348,7 @@ ], "source": { "path": "src/core/server/elasticsearch/elasticsearch_config.ts", - "lineNumber": 279 + "lineNumber": 301 }, "deprecated": false, "isRequired": true @@ -9095,7 +9095,7 @@ "plugin": "indexManagement", "link": { "path": "x-pack/plugins/index_management/server/types.ts", - "lineNumber": 40 + "lineNumber": 39 } }, { @@ -9109,7 +9109,7 @@ "plugin": "indexManagement", "link": { "path": "x-pack/plugins/index_management/target/types/server/types.d.ts", - "lineNumber": 25 + "lineNumber": 24 } } ], @@ -9383,7 +9383,7 @@ "plugin": "data", "link": { "path": "src/plugins/data/server/autocomplete/value_suggestions_route.ts", - "lineNumber": 67 + "lineNumber": 65 } }, { @@ -9439,7 +9439,7 @@ "plugin": "indexManagement", "link": { "path": "x-pack/plugins/index_management/server/routes/api/indices/register_list_route.ts", - "lineNumber": 18 + "lineNumber": 16 } }, { @@ -9460,7 +9460,7 @@ "plugin": "indexManagement", "link": { "path": "x-pack/plugins/index_management/server/routes/api/indices/register_reload_route.ts", - "lineNumber": 33 + "lineNumber": 28 } }, { @@ -9488,14 +9488,14 @@ "plugin": "indexManagement", "link": { "path": "x-pack/plugins/index_management/server/routes/api/templates/register_get_routes.ts", - "lineNumber": 24 + "lineNumber": 22 } }, { "plugin": "indexManagement", "link": { "path": "x-pack/plugins/index_management/server/routes/api/templates/register_get_routes.ts", - "lineNumber": 65 + "lineNumber": 62 } }, { @@ -9572,14 +9572,14 @@ "plugin": "indexManagement", "link": { "path": "x-pack/plugins/index_management/server/routes/api/component_templates/create.ts", - "lineNumber": 28 + "lineNumber": 24 } }, { "plugin": "indexManagement", "link": { "path": "x-pack/plugins/index_management/server/routes/api/component_templates/update.ts", - "lineNumber": 32 + "lineNumber": 28 } }, { @@ -9596,181 +9596,6 @@ "lineNumber": 48 } }, - { - "plugin": "crossClusterReplication", - "link": { - "path": "x-pack/plugins/cross_cluster_replication/server/routes/api/auto_follow_pattern/register_create_route.ts", - "lineNumber": 45 - } - }, - { - "plugin": "crossClusterReplication", - "link": { - "path": "x-pack/plugins/cross_cluster_replication/server/routes/api/auto_follow_pattern/register_create_route.ts", - "lineNumber": 64 - } - }, - { - "plugin": "crossClusterReplication", - "link": { - "path": "x-pack/plugins/cross_cluster_replication/server/routes/api/auto_follow_pattern/register_delete_route.ts", - "lineNumber": 50 - } - }, - { - "plugin": "crossClusterReplication", - "link": { - "path": "x-pack/plugins/cross_cluster_replication/server/routes/api/auto_follow_pattern/register_fetch_route.ts", - "lineNumber": 27 - } - }, - { - "plugin": "crossClusterReplication", - "link": { - "path": "x-pack/plugins/cross_cluster_replication/server/routes/api/auto_follow_pattern/register_get_route.ts", - "lineNumber": 37 - } - }, - { - "plugin": "crossClusterReplication", - "link": { - "path": "x-pack/plugins/cross_cluster_replication/server/routes/api/auto_follow_pattern/register_pause_route.ts", - "lineNumber": 49 - } - }, - { - "plugin": "crossClusterReplication", - "link": { - "path": "x-pack/plugins/cross_cluster_replication/server/routes/api/auto_follow_pattern/register_resume_route.ts", - "lineNumber": 49 - } - }, - { - "plugin": "crossClusterReplication", - "link": { - "path": "x-pack/plugins/cross_cluster_replication/server/routes/api/auto_follow_pattern/register_update_route.ts", - "lineNumber": 47 - } - }, - { - "plugin": "crossClusterReplication", - "link": { - "path": "x-pack/plugins/cross_cluster_replication/server/routes/api/follower_index/register_create_route.ts", - "lineNumber": 52 - } - }, - { - "plugin": "crossClusterReplication", - "link": { - "path": "x-pack/plugins/cross_cluster_replication/server/routes/api/follower_index/register_fetch_route.ts", - "lineNumber": 29 - } - }, - { - "plugin": "crossClusterReplication", - "link": { - "path": "x-pack/plugins/cross_cluster_replication/server/routes/api/follower_index/register_fetch_route.ts", - "lineNumber": 35 - } - }, - { - "plugin": "crossClusterReplication", - "link": { - "path": "x-pack/plugins/cross_cluster_replication/server/routes/api/follower_index/register_get_route.ts", - "lineNumber": 38 - } - }, - { - "plugin": "crossClusterReplication", - "link": { - "path": "x-pack/plugins/cross_cluster_replication/server/routes/api/follower_index/register_get_route.ts", - "lineNumber": 58 - } - }, - { - "plugin": "crossClusterReplication", - "link": { - "path": "x-pack/plugins/cross_cluster_replication/server/routes/api/follower_index/register_pause_route.ts", - "lineNumber": 47 - } - }, - { - "plugin": "crossClusterReplication", - "link": { - "path": "x-pack/plugins/cross_cluster_replication/server/routes/api/follower_index/register_resume_route.ts", - "lineNumber": 47 - } - }, - { - "plugin": "crossClusterReplication", - "link": { - "path": "x-pack/plugins/cross_cluster_replication/server/routes/api/follower_index/register_unfollow_route.ts", - "lineNumber": 50 - } - }, - { - "plugin": "crossClusterReplication", - "link": { - "path": "x-pack/plugins/cross_cluster_replication/server/routes/api/follower_index/register_unfollow_route.ts", - "lineNumber": 59 - } - }, - { - "plugin": "crossClusterReplication", - "link": { - "path": "x-pack/plugins/cross_cluster_replication/server/routes/api/follower_index/register_unfollow_route.ts", - "lineNumber": 64 - } - }, - { - "plugin": "crossClusterReplication", - "link": { - "path": "x-pack/plugins/cross_cluster_replication/server/routes/api/follower_index/register_unfollow_route.ts", - "lineNumber": 72 - } - }, - { - "plugin": "crossClusterReplication", - "link": { - "path": "x-pack/plugins/cross_cluster_replication/server/routes/api/follower_index/register_update_route.ts", - "lineNumber": 53 - } - }, - { - "plugin": "crossClusterReplication", - "link": { - "path": "x-pack/plugins/cross_cluster_replication/server/routes/api/follower_index/register_update_route.ts", - "lineNumber": 66 - } - }, - { - "plugin": "crossClusterReplication", - "link": { - "path": "x-pack/plugins/cross_cluster_replication/server/routes/api/follower_index/register_update_route.ts", - "lineNumber": 80 - } - }, - { - "plugin": "crossClusterReplication", - "link": { - "path": "x-pack/plugins/cross_cluster_replication/server/routes/api/cross_cluster_replication/register_permissions_route.ts", - "lineNumber": 40 - } - }, - { - "plugin": "crossClusterReplication", - "link": { - "path": "x-pack/plugins/cross_cluster_replication/server/routes/api/cross_cluster_replication/register_stats_route.ts", - "lineNumber": 29 - } - }, - { - "plugin": "infra", - "link": { - "path": "x-pack/plugins/infra/server/lib/log_analysis/log_entry_categories_analysis.ts", - "lineNumber": 420 - } - }, { "plugin": "lists", "link": { @@ -9803,7 +9628,7 @@ "plugin": "monitoring", "link": { "path": "x-pack/plugins/monitoring/server/plugin.ts", - "lineNumber": 356 + "lineNumber": 361 } }, { @@ -9817,7 +9642,7 @@ "plugin": "securitySolution", "link": { "path": "x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals/query_signals_route.ts", - "lineNumber": 52 + "lineNumber": 60 } }, { @@ -10303,7 +10128,7 @@ "plugin": "fleet", "link": { "path": "x-pack/plugins/fleet/server/plugin.ts", - "lineNumber": 189 + "lineNumber": 190 } }, { @@ -12169,6 +11994,24 @@ }, "deprecated": false }, + { + "parentPluginId": "core", + "id": "def-server.DeprecationsDetails.deprecationType", + "type": "CompoundType", + "tags": [], + "label": "deprecationType", + "description": [ + "\n(optional) Used to identify between different deprecation types.\nExample use case: in Upgrade Assistant, we may want to allow the user to sort by\ndeprecation type or show each type in a separate tab.\n\nFeel free to add new types if necessary.\nPredefined types are necessary to reduce having similar definitions with different keywords\nacross kibana deprecations." + ], + "signature": [ + "\"config\" | \"feature\" | undefined" + ], + "source": { + "path": "src/core/server/deprecations/types.ts", + "lineNumber": 37 + }, + "deprecated": false + }, { "parentPluginId": "core", "id": "def-server.DeprecationsDetails.documentationUrl", @@ -12181,7 +12024,7 @@ ], "source": { "path": "src/core/server/deprecations/types.ts", - "lineNumber": 29 + "lineNumber": 39 }, "deprecated": false }, @@ -12193,11 +12036,11 @@ "label": "correctiveActions", "description": [], "signature": [ - "{ api?: { path: string; method: \"PUT\" | \"POST\"; body?: { [key: string]: any; } | undefined; } | undefined; manualSteps?: string[] | undefined; }" + "{ api?: { path: string; method: \"PUT\" | \"POST\"; body?: { [key: string]: any; } | undefined; } | undefined; manualSteps: string[]; }" ], "source": { "path": "src/core/server/deprecations/types.ts", - "lineNumber": 31 + "lineNumber": 41 }, "deprecated": false } @@ -12265,7 +12108,7 @@ ], "source": { "path": "src/core/server/deprecations/deprecations_service.ts", - "lineNumber": 103 + "lineNumber": 101 }, "deprecated": false, "children": [ @@ -12289,7 +12132,7 @@ ], "source": { "path": "src/core/server/deprecations/deprecations_service.ts", - "lineNumber": 104 + "lineNumber": 102 }, "deprecated": false, "returnComment": [], @@ -12312,7 +12155,7 @@ ], "source": { "path": "src/core/server/deprecations/deprecations_service.ts", - "lineNumber": 104 + "lineNumber": 102 }, "deprecated": false } @@ -12708,14 +12551,7 @@ "plugin": "indexManagement", "link": { "path": "x-pack/plugins/index_management/server/plugin.ts", - "lineNumber": 34 - } - }, - { - "plugin": "crossClusterReplication", - "link": { - "path": "x-pack/plugins/cross_cluster_replication/server/plugin.ts", - "lineNumber": 33 + "lineNumber": 32 } }, { @@ -12949,7 +12785,7 @@ "description": [], "source": { "path": "src/core/server/deprecations/types.ts", - "lineNumber": 60 + "lineNumber": 70 }, "deprecated": false, "children": [ @@ -12971,7 +12807,7 @@ ], "source": { "path": "src/core/server/deprecations/types.ts", - "lineNumber": 61 + "lineNumber": 71 }, "deprecated": false }, @@ -13287,7 +13123,7 @@ ], "source": { "path": "src/core/server/deprecations/types.ts", - "lineNumber": 62 + "lineNumber": 72 }, "deprecated": false } @@ -15957,14 +15793,14 @@ "plugin": "crossClusterReplication", "link": { "path": "x-pack/plugins/cross_cluster_replication/server/plugin.ts", - "lineNumber": 17 + "lineNumber": 16 } }, { "plugin": "crossClusterReplication", "link": { "path": "x-pack/plugins/cross_cluster_replication/server/plugin.ts", - "lineNumber": 36 + "lineNumber": 27 } }, { @@ -20314,13 +20150,13 @@ "signature": [ "{ legacy: { globalConfig$: ", "Observable", - " moment.Duration; humanize: { (argWithSuffix?: boolean | undefined, argThresholds?: moment.argThresholdOpts | undefined): string; (argThresholds?: moment.argThresholdOpts | undefined): string; }; abs: () => moment.Duration; as: (units: moment.unitOfTime.Base) => number; get: (units: moment.unitOfTime.Base) => number; milliseconds: () => number; asMilliseconds: () => number; seconds: () => number; asSeconds: () => number; minutes: () => number; asMinutes: () => number; hours: () => number; asHours: () => number; days: () => number; asDays: () => number; weeks: () => number; asWeeks: () => number; months: () => number; asMonths: () => number; years: () => number; asYears: () => number; add: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; subtract: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; locale: { (): string; (locale: moment.LocaleSpecifier): moment.Duration; }; localeData: () => moment.Locale; toISOString: () => string; toJSON: () => string; isValid: () => boolean; lang: { (locale: moment.LocaleSpecifier): moment.Moment; (): moment.Locale; }; toIsoString: () => string; }>; readonly autocompleteTimeout: Readonly<{ clone: () => moment.Duration; humanize: { (argWithSuffix?: boolean | undefined, argThresholds?: moment.argThresholdOpts | undefined): string; (argThresholds?: moment.argThresholdOpts | undefined): string; }; abs: () => moment.Duration; as: (units: moment.unitOfTime.Base) => number; get: (units: moment.unitOfTime.Base) => number; milliseconds: () => number; asMilliseconds: () => number; seconds: () => number; asSeconds: () => number; minutes: () => number; asMinutes: () => number; hours: () => number; asHours: () => number; days: () => number; asDays: () => number; weeks: () => number; asWeeks: () => number; months: () => number; asMonths: () => number; years: () => number; asYears: () => number; add: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; subtract: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; locale: { (): string; (locale: moment.LocaleSpecifier): moment.Duration; }; localeData: () => moment.Locale; toISOString: () => string; toJSON: () => string; isValid: () => boolean; lang: { (locale: moment.LocaleSpecifier): moment.Moment; (): moment.Locale; }; toIsoString: () => string; }>; }>; elasticsearch: Readonly<{ readonly shardTimeout: Readonly<{ clone: () => moment.Duration; humanize: { (argWithSuffix?: boolean | undefined, argThresholds?: moment.argThresholdOpts | undefined): string; (argThresholds?: moment.argThresholdOpts | undefined): string; }; abs: () => moment.Duration; as: (units: moment.unitOfTime.Base) => number; get: (units: moment.unitOfTime.Base) => number; milliseconds: () => number; asMilliseconds: () => number; seconds: () => number; asSeconds: () => number; minutes: () => number; asMinutes: () => number; hours: () => number; asHours: () => number; days: () => number; asDays: () => number; weeks: () => number; asWeeks: () => number; months: () => number; asMonths: () => number; years: () => number; asYears: () => number; add: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; subtract: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; locale: { (): string; (locale: moment.LocaleSpecifier): moment.Duration; }; localeData: () => moment.Locale; toISOString: () => string; toJSON: () => string; isValid: () => boolean; lang: { (locale: moment.LocaleSpecifier): moment.Moment; (): moment.Locale; }; toIsoString: () => string; }>; readonly requestTimeout: Readonly<{ clone: () => moment.Duration; humanize: { (argWithSuffix?: boolean | undefined, argThresholds?: moment.argThresholdOpts | undefined): string; (argThresholds?: moment.argThresholdOpts | undefined): string; }; abs: () => moment.Duration; as: (units: moment.unitOfTime.Base) => number; get: (units: moment.unitOfTime.Base) => number; milliseconds: () => number; asMilliseconds: () => number; seconds: () => number; asSeconds: () => number; minutes: () => number; asMinutes: () => number; hours: () => number; asHours: () => number; days: () => number; asDays: () => number; weeks: () => number; asWeeks: () => number; months: () => number; asMonths: () => number; years: () => number; asYears: () => number; add: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; subtract: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; locale: { (): string; (locale: moment.LocaleSpecifier): moment.Duration; }; localeData: () => moment.Locale; toISOString: () => string; toJSON: () => string; isValid: () => boolean; lang: { (locale: moment.LocaleSpecifier): moment.Moment; (): moment.Locale; }; toIsoString: () => string; }>; readonly pingTimeout: Readonly<{ clone: () => moment.Duration; humanize: { (argWithSuffix?: boolean | undefined, argThresholds?: moment.argThresholdOpts | undefined): string; (argThresholds?: moment.argThresholdOpts | undefined): string; }; abs: () => moment.Duration; as: (units: moment.unitOfTime.Base) => number; get: (units: moment.unitOfTime.Base) => number; milliseconds: () => number; asMilliseconds: () => number; seconds: () => number; asSeconds: () => number; minutes: () => number; asMinutes: () => number; hours: () => number; asHours: () => number; days: () => number; asDays: () => number; weeks: () => number; asWeeks: () => number; months: () => number; asMonths: () => number; years: () => number; asYears: () => number; add: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; subtract: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; locale: { (): string; (locale: moment.LocaleSpecifier): moment.Duration; }; localeData: () => moment.Locale; toISOString: () => string; toJSON: () => string; isValid: () => boolean; lang: { (locale: moment.LocaleSpecifier): moment.Moment; (): moment.Locale; }; toIsoString: () => string; }>; }>; path: Readonly<{ readonly data: string; }>; savedObjects: Readonly<{ readonly maxImportPayloadBytes: Readonly<{ isGreaterThan: (other: ", + "; elasticsearch: Readonly<{ readonly shardTimeout: Readonly<{ clone: () => moment.Duration; humanize: { (argWithSuffix?: boolean | undefined, argThresholds?: moment.argThresholdOpts | undefined): string; (argThresholds?: moment.argThresholdOpts | undefined): string; }; abs: () => moment.Duration; as: (units: moment.unitOfTime.Base) => number; get: (units: moment.unitOfTime.Base) => number; milliseconds: () => number; asMilliseconds: () => number; seconds: () => number; asSeconds: () => number; minutes: () => number; asMinutes: () => number; hours: () => number; asHours: () => number; days: () => number; asDays: () => number; weeks: () => number; asWeeks: () => number; months: () => number; asMonths: () => number; years: () => number; asYears: () => number; add: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; subtract: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; locale: { (): string; (locale: moment.LocaleSpecifier): moment.Duration; }; localeData: () => moment.Locale; toISOString: () => string; toJSON: () => string; isValid: () => boolean; lang: { (locale: moment.LocaleSpecifier): moment.Moment; (): moment.Locale; }; toIsoString: () => string; }>; readonly requestTimeout: Readonly<{ clone: () => moment.Duration; humanize: { (argWithSuffix?: boolean | undefined, argThresholds?: moment.argThresholdOpts | undefined): string; (argThresholds?: moment.argThresholdOpts | undefined): string; }; abs: () => moment.Duration; as: (units: moment.unitOfTime.Base) => number; get: (units: moment.unitOfTime.Base) => number; milliseconds: () => number; asMilliseconds: () => number; seconds: () => number; asSeconds: () => number; minutes: () => number; asMinutes: () => number; hours: () => number; asHours: () => number; days: () => number; asDays: () => number; weeks: () => number; asWeeks: () => number; months: () => number; asMonths: () => number; years: () => number; asYears: () => number; add: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; subtract: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; locale: { (): string; (locale: moment.LocaleSpecifier): moment.Duration; }; localeData: () => moment.Locale; toISOString: () => string; toJSON: () => string; isValid: () => boolean; lang: { (locale: moment.LocaleSpecifier): moment.Moment; (): moment.Locale; }; toIsoString: () => string; }>; readonly pingTimeout: Readonly<{ clone: () => moment.Duration; humanize: { (argWithSuffix?: boolean | undefined, argThresholds?: moment.argThresholdOpts | undefined): string; (argThresholds?: moment.argThresholdOpts | undefined): string; }; abs: () => moment.Duration; as: (units: moment.unitOfTime.Base) => number; get: (units: moment.unitOfTime.Base) => number; milliseconds: () => number; asMilliseconds: () => number; seconds: () => number; asSeconds: () => number; minutes: () => number; asMinutes: () => number; hours: () => number; asHours: () => number; days: () => number; asDays: () => number; weeks: () => number; asWeeks: () => number; months: () => number; asMonths: () => number; years: () => number; asYears: () => number; add: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; subtract: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; locale: { (): string; (locale: moment.LocaleSpecifier): moment.Duration; }; localeData: () => moment.Locale; toISOString: () => string; toJSON: () => string; isValid: () => boolean; lang: { (locale: moment.LocaleSpecifier): moment.Moment; (): moment.Locale; }; toIsoString: () => string; }>; }>; path: Readonly<{ readonly data: string; }>; savedObjects: Readonly<{ readonly maxImportPayloadBytes: Readonly<{ isGreaterThan: (other: ", "ByteSizeValue", ") => boolean; isLessThan: (other: ", "ByteSizeValue", ") => boolean; isEqualTo: (other: ", "ByteSizeValue", - ") => boolean; getValueInBytes: () => number; toString: (returnUnit?: \"b\" | \"kb\" | \"mb\" | \"gb\" | undefined) => string; }>; }>; }>>; get: () => Readonly<{ kibana: Readonly<{ readonly index: string; readonly autocompleteTerminateAfter: Readonly<{ clone: () => moment.Duration; humanize: { (argWithSuffix?: boolean | undefined, argThresholds?: moment.argThresholdOpts | undefined): string; (argThresholds?: moment.argThresholdOpts | undefined): string; }; abs: () => moment.Duration; as: (units: moment.unitOfTime.Base) => number; get: (units: moment.unitOfTime.Base) => number; milliseconds: () => number; asMilliseconds: () => number; seconds: () => number; asSeconds: () => number; minutes: () => number; asMinutes: () => number; hours: () => number; asHours: () => number; days: () => number; asDays: () => number; weeks: () => number; asWeeks: () => number; months: () => number; asMonths: () => number; years: () => number; asYears: () => number; add: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; subtract: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; locale: { (): string; (locale: moment.LocaleSpecifier): moment.Duration; }; localeData: () => moment.Locale; toISOString: () => string; toJSON: () => string; isValid: () => boolean; lang: { (locale: moment.LocaleSpecifier): moment.Moment; (): moment.Locale; }; toIsoString: () => string; }>; readonly autocompleteTimeout: Readonly<{ clone: () => moment.Duration; humanize: { (argWithSuffix?: boolean | undefined, argThresholds?: moment.argThresholdOpts | undefined): string; (argThresholds?: moment.argThresholdOpts | undefined): string; }; abs: () => moment.Duration; as: (units: moment.unitOfTime.Base) => number; get: (units: moment.unitOfTime.Base) => number; milliseconds: () => number; asMilliseconds: () => number; seconds: () => number; asSeconds: () => number; minutes: () => number; asMinutes: () => number; hours: () => number; asHours: () => number; days: () => number; asDays: () => number; weeks: () => number; asWeeks: () => number; months: () => number; asMonths: () => number; years: () => number; asYears: () => number; add: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; subtract: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; locale: { (): string; (locale: moment.LocaleSpecifier): moment.Duration; }; localeData: () => moment.Locale; toISOString: () => string; toJSON: () => string; isValid: () => boolean; lang: { (locale: moment.LocaleSpecifier): moment.Moment; (): moment.Locale; }; toIsoString: () => string; }>; }>; elasticsearch: Readonly<{ readonly shardTimeout: Readonly<{ clone: () => moment.Duration; humanize: { (argWithSuffix?: boolean | undefined, argThresholds?: moment.argThresholdOpts | undefined): string; (argThresholds?: moment.argThresholdOpts | undefined): string; }; abs: () => moment.Duration; as: (units: moment.unitOfTime.Base) => number; get: (units: moment.unitOfTime.Base) => number; milliseconds: () => number; asMilliseconds: () => number; seconds: () => number; asSeconds: () => number; minutes: () => number; asMinutes: () => number; hours: () => number; asHours: () => number; days: () => number; asDays: () => number; weeks: () => number; asWeeks: () => number; months: () => number; asMonths: () => number; years: () => number; asYears: () => number; add: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; subtract: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; locale: { (): string; (locale: moment.LocaleSpecifier): moment.Duration; }; localeData: () => moment.Locale; toISOString: () => string; toJSON: () => string; isValid: () => boolean; lang: { (locale: moment.LocaleSpecifier): moment.Moment; (): moment.Locale; }; toIsoString: () => string; }>; readonly requestTimeout: Readonly<{ clone: () => moment.Duration; humanize: { (argWithSuffix?: boolean | undefined, argThresholds?: moment.argThresholdOpts | undefined): string; (argThresholds?: moment.argThresholdOpts | undefined): string; }; abs: () => moment.Duration; as: (units: moment.unitOfTime.Base) => number; get: (units: moment.unitOfTime.Base) => number; milliseconds: () => number; asMilliseconds: () => number; seconds: () => number; asSeconds: () => number; minutes: () => number; asMinutes: () => number; hours: () => number; asHours: () => number; days: () => number; asDays: () => number; weeks: () => number; asWeeks: () => number; months: () => number; asMonths: () => number; years: () => number; asYears: () => number; add: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; subtract: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; locale: { (): string; (locale: moment.LocaleSpecifier): moment.Duration; }; localeData: () => moment.Locale; toISOString: () => string; toJSON: () => string; isValid: () => boolean; lang: { (locale: moment.LocaleSpecifier): moment.Moment; (): moment.Locale; }; toIsoString: () => string; }>; readonly pingTimeout: Readonly<{ clone: () => moment.Duration; humanize: { (argWithSuffix?: boolean | undefined, argThresholds?: moment.argThresholdOpts | undefined): string; (argThresholds?: moment.argThresholdOpts | undefined): string; }; abs: () => moment.Duration; as: (units: moment.unitOfTime.Base) => number; get: (units: moment.unitOfTime.Base) => number; milliseconds: () => number; asMilliseconds: () => number; seconds: () => number; asSeconds: () => number; minutes: () => number; asMinutes: () => number; hours: () => number; asHours: () => number; days: () => number; asDays: () => number; weeks: () => number; asWeeks: () => number; months: () => number; asMonths: () => number; years: () => number; asYears: () => number; add: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; subtract: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; locale: { (): string; (locale: moment.LocaleSpecifier): moment.Duration; }; localeData: () => moment.Locale; toISOString: () => string; toJSON: () => string; isValid: () => boolean; lang: { (locale: moment.LocaleSpecifier): moment.Moment; (): moment.Locale; }; toIsoString: () => string; }>; }>; path: Readonly<{ readonly data: string; }>; savedObjects: Readonly<{ readonly maxImportPayloadBytes: Readonly<{ isGreaterThan: (other: ", + ") => boolean; getValueInBytes: () => number; toString: (returnUnit?: \"b\" | \"kb\" | \"mb\" | \"gb\" | undefined) => string; }>; }>; }>>; get: () => Readonly<{ kibana: Readonly<{ readonly index: string; }>; elasticsearch: Readonly<{ readonly shardTimeout: Readonly<{ clone: () => moment.Duration; humanize: { (argWithSuffix?: boolean | undefined, argThresholds?: moment.argThresholdOpts | undefined): string; (argThresholds?: moment.argThresholdOpts | undefined): string; }; abs: () => moment.Duration; as: (units: moment.unitOfTime.Base) => number; get: (units: moment.unitOfTime.Base) => number; milliseconds: () => number; asMilliseconds: () => number; seconds: () => number; asSeconds: () => number; minutes: () => number; asMinutes: () => number; hours: () => number; asHours: () => number; days: () => number; asDays: () => number; weeks: () => number; asWeeks: () => number; months: () => number; asMonths: () => number; years: () => number; asYears: () => number; add: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; subtract: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; locale: { (): string; (locale: moment.LocaleSpecifier): moment.Duration; }; localeData: () => moment.Locale; toISOString: () => string; toJSON: () => string; isValid: () => boolean; lang: { (locale: moment.LocaleSpecifier): moment.Moment; (): moment.Locale; }; toIsoString: () => string; }>; readonly requestTimeout: Readonly<{ clone: () => moment.Duration; humanize: { (argWithSuffix?: boolean | undefined, argThresholds?: moment.argThresholdOpts | undefined): string; (argThresholds?: moment.argThresholdOpts | undefined): string; }; abs: () => moment.Duration; as: (units: moment.unitOfTime.Base) => number; get: (units: moment.unitOfTime.Base) => number; milliseconds: () => number; asMilliseconds: () => number; seconds: () => number; asSeconds: () => number; minutes: () => number; asMinutes: () => number; hours: () => number; asHours: () => number; days: () => number; asDays: () => number; weeks: () => number; asWeeks: () => number; months: () => number; asMonths: () => number; years: () => number; asYears: () => number; add: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; subtract: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; locale: { (): string; (locale: moment.LocaleSpecifier): moment.Duration; }; localeData: () => moment.Locale; toISOString: () => string; toJSON: () => string; isValid: () => boolean; lang: { (locale: moment.LocaleSpecifier): moment.Moment; (): moment.Locale; }; toIsoString: () => string; }>; readonly pingTimeout: Readonly<{ clone: () => moment.Duration; humanize: { (argWithSuffix?: boolean | undefined, argThresholds?: moment.argThresholdOpts | undefined): string; (argThresholds?: moment.argThresholdOpts | undefined): string; }; abs: () => moment.Duration; as: (units: moment.unitOfTime.Base) => number; get: (units: moment.unitOfTime.Base) => number; milliseconds: () => number; asMilliseconds: () => number; seconds: () => number; asSeconds: () => number; minutes: () => number; asMinutes: () => number; hours: () => number; asHours: () => number; days: () => number; asDays: () => number; weeks: () => number; asWeeks: () => number; months: () => number; asMonths: () => number; years: () => number; asYears: () => number; add: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; subtract: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; locale: { (): string; (locale: moment.LocaleSpecifier): moment.Duration; }; localeData: () => moment.Locale; toISOString: () => string; toJSON: () => string; isValid: () => boolean; lang: { (locale: moment.LocaleSpecifier): moment.Moment; (): moment.Locale; }; toIsoString: () => string; }>; }>; path: Readonly<{ readonly data: string; }>; savedObjects: Readonly<{ readonly maxImportPayloadBytes: Readonly<{ isGreaterThan: (other: ", "ByteSizeValue", ") => boolean; isLessThan: (other: ", "ByteSizeValue", @@ -20552,7 +20388,7 @@ "description": [], "source": { "path": "src/core/server/deprecations/types.ts", - "lineNumber": 56 + "lineNumber": 66 }, "deprecated": false, "children": [ @@ -20584,7 +20420,7 @@ ], "source": { "path": "src/core/server/deprecations/types.ts", - "lineNumber": 57 + "lineNumber": 67 }, "deprecated": false, "returnComment": [], @@ -20607,7 +20443,7 @@ ], "source": { "path": "src/core/server/deprecations/types.ts", - "lineNumber": 57 + "lineNumber": 67 }, "deprecated": false } @@ -23394,28 +23230,14 @@ "plugin": "indexManagement", "link": { "path": "x-pack/plugins/index_management/server/plugin.ts", - "lineNumber": 14 + "lineNumber": 12 } }, { "plugin": "indexManagement", "link": { "path": "x-pack/plugins/index_management/server/plugin.ts", - "lineNumber": 42 - } - }, - { - "plugin": "crossClusterReplication", - "link": { - "path": "x-pack/plugins/cross_cluster_replication/server/plugin.ts", - "lineNumber": 13 - } - }, - { - "plugin": "crossClusterReplication", - "link": { - "path": "x-pack/plugins/cross_cluster_replication/server/plugin.ts", - "lineNumber": 69 + "lineNumber": 38 } }, { @@ -23499,7 +23321,7 @@ "plugin": "monitoring", "link": { "path": "x-pack/plugins/monitoring/server/plugin.ts", - "lineNumber": 279 + "lineNumber": 284 } }, { @@ -23672,28 +23494,14 @@ "plugin": "indexManagement", "link": { "path": "x-pack/plugins/index_management/server/types.ts", - "lineNumber": 43 + "lineNumber": 42 } }, { "plugin": "indexManagement", "link": { "path": "x-pack/plugins/index_management/server/types.ts", - "lineNumber": 50 - } - }, - { - "plugin": "crossClusterReplication", - "link": { - "path": "x-pack/plugins/cross_cluster_replication/server/types.ts", - "lineNumber": 8 - } - }, - { - "plugin": "crossClusterReplication", - "link": { - "path": "x-pack/plugins/cross_cluster_replication/server/types.ts", - "lineNumber": 41 + "lineNumber": 49 } }, { @@ -23710,41 +23518,6 @@ "lineNumber": 73 } }, - { - "plugin": "infra", - "link": { - "path": "x-pack/plugins/infra/server/lib/log_analysis/log_entry_categories_analysis.ts", - "lineNumber": 9 - } - }, - { - "plugin": "infra", - "link": { - "path": "x-pack/plugins/infra/server/lib/log_analysis/log_entry_categories_analysis.ts", - "lineNumber": 139 - } - }, - { - "plugin": "infra", - "link": { - "path": "x-pack/plugins/infra/server/lib/log_analysis/log_entry_categories_analysis.ts", - "lineNumber": 405 - } - }, - { - "plugin": "crossClusterReplication", - "link": { - "path": "x-pack/plugins/cross_cluster_replication/target/types/server/types.d.ts", - "lineNumber": 1 - } - }, - { - "plugin": "crossClusterReplication", - "link": { - "path": "x-pack/plugins/cross_cluster_replication/target/types/server/types.d.ts", - "lineNumber": 30 - } - }, { "plugin": "globalSearch", "link": { @@ -23770,28 +23543,14 @@ "plugin": "indexManagement", "link": { "path": "x-pack/plugins/index_management/target/types/server/types.d.ts", - "lineNumber": 27 + "lineNumber": 26 } }, { "plugin": "indexManagement", "link": { "path": "x-pack/plugins/index_management/target/types/server/types.d.ts", - "lineNumber": 33 - } - }, - { - "plugin": "infra", - "link": { - "path": "x-pack/plugins/infra/target/types/server/lib/log_analysis/log_entry_categories_analysis.d.ts", - "lineNumber": 1 - } - }, - { - "plugin": "infra", - "link": { - "path": "x-pack/plugins/infra/target/types/server/lib/log_analysis/log_entry_categories_analysis.d.ts", - "lineNumber": 58 + "lineNumber": 32 } } ], @@ -24260,7 +24019,7 @@ "label": "SharedGlobalConfig", "description": [], "signature": [ - "{ readonly kibana: Readonly<{ readonly index: string; readonly autocompleteTerminateAfter: Readonly<{ clone: () => moment.Duration; humanize: { (argWithSuffix?: boolean | undefined, argThresholds?: moment.argThresholdOpts | undefined): string; (argThresholds?: moment.argThresholdOpts | undefined): string; }; abs: () => moment.Duration; as: (units: moment.unitOfTime.Base) => number; get: (units: moment.unitOfTime.Base) => number; milliseconds: () => number; asMilliseconds: () => number; seconds: () => number; asSeconds: () => number; minutes: () => number; asMinutes: () => number; hours: () => number; asHours: () => number; days: () => number; asDays: () => number; weeks: () => number; asWeeks: () => number; months: () => number; asMonths: () => number; years: () => number; asYears: () => number; add: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; subtract: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; locale: { (): string; (locale: moment.LocaleSpecifier): moment.Duration; }; localeData: () => moment.Locale; toISOString: () => string; toJSON: () => string; isValid: () => boolean; lang: { (locale: moment.LocaleSpecifier): moment.Moment; (): moment.Locale; }; toIsoString: () => string; }>; readonly autocompleteTimeout: Readonly<{ clone: () => moment.Duration; humanize: { (argWithSuffix?: boolean | undefined, argThresholds?: moment.argThresholdOpts | undefined): string; (argThresholds?: moment.argThresholdOpts | undefined): string; }; abs: () => moment.Duration; as: (units: moment.unitOfTime.Base) => number; get: (units: moment.unitOfTime.Base) => number; milliseconds: () => number; asMilliseconds: () => number; seconds: () => number; asSeconds: () => number; minutes: () => number; asMinutes: () => number; hours: () => number; asHours: () => number; days: () => number; asDays: () => number; weeks: () => number; asWeeks: () => number; months: () => number; asMonths: () => number; years: () => number; asYears: () => number; add: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; subtract: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; locale: { (): string; (locale: moment.LocaleSpecifier): moment.Duration; }; localeData: () => moment.Locale; toISOString: () => string; toJSON: () => string; isValid: () => boolean; lang: { (locale: moment.LocaleSpecifier): moment.Moment; (): moment.Locale; }; toIsoString: () => string; }>; }>; readonly elasticsearch: Readonly<{ readonly shardTimeout: Readonly<{ clone: () => moment.Duration; humanize: { (argWithSuffix?: boolean | undefined, argThresholds?: moment.argThresholdOpts | undefined): string; (argThresholds?: moment.argThresholdOpts | undefined): string; }; abs: () => moment.Duration; as: (units: moment.unitOfTime.Base) => number; get: (units: moment.unitOfTime.Base) => number; milliseconds: () => number; asMilliseconds: () => number; seconds: () => number; asSeconds: () => number; minutes: () => number; asMinutes: () => number; hours: () => number; asHours: () => number; days: () => number; asDays: () => number; weeks: () => number; asWeeks: () => number; months: () => number; asMonths: () => number; years: () => number; asYears: () => number; add: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; subtract: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; locale: { (): string; (locale: moment.LocaleSpecifier): moment.Duration; }; localeData: () => moment.Locale; toISOString: () => string; toJSON: () => string; isValid: () => boolean; lang: { (locale: moment.LocaleSpecifier): moment.Moment; (): moment.Locale; }; toIsoString: () => string; }>; readonly requestTimeout: Readonly<{ clone: () => moment.Duration; humanize: { (argWithSuffix?: boolean | undefined, argThresholds?: moment.argThresholdOpts | undefined): string; (argThresholds?: moment.argThresholdOpts | undefined): string; }; abs: () => moment.Duration; as: (units: moment.unitOfTime.Base) => number; get: (units: moment.unitOfTime.Base) => number; milliseconds: () => number; asMilliseconds: () => number; seconds: () => number; asSeconds: () => number; minutes: () => number; asMinutes: () => number; hours: () => number; asHours: () => number; days: () => number; asDays: () => number; weeks: () => number; asWeeks: () => number; months: () => number; asMonths: () => number; years: () => number; asYears: () => number; add: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; subtract: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; locale: { (): string; (locale: moment.LocaleSpecifier): moment.Duration; }; localeData: () => moment.Locale; toISOString: () => string; toJSON: () => string; isValid: () => boolean; lang: { (locale: moment.LocaleSpecifier): moment.Moment; (): moment.Locale; }; toIsoString: () => string; }>; readonly pingTimeout: Readonly<{ clone: () => moment.Duration; humanize: { (argWithSuffix?: boolean | undefined, argThresholds?: moment.argThresholdOpts | undefined): string; (argThresholds?: moment.argThresholdOpts | undefined): string; }; abs: () => moment.Duration; as: (units: moment.unitOfTime.Base) => number; get: (units: moment.unitOfTime.Base) => number; milliseconds: () => number; asMilliseconds: () => number; seconds: () => number; asSeconds: () => number; minutes: () => number; asMinutes: () => number; hours: () => number; asHours: () => number; days: () => number; asDays: () => number; weeks: () => number; asWeeks: () => number; months: () => number; asMonths: () => number; years: () => number; asYears: () => number; add: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; subtract: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; locale: { (): string; (locale: moment.LocaleSpecifier): moment.Duration; }; localeData: () => moment.Locale; toISOString: () => string; toJSON: () => string; isValid: () => boolean; lang: { (locale: moment.LocaleSpecifier): moment.Moment; (): moment.Locale; }; toIsoString: () => string; }>; }>; readonly path: Readonly<{ readonly data: string; }>; readonly savedObjects: Readonly<{ readonly maxImportPayloadBytes: Readonly<{ isGreaterThan: (other: ", + "{ readonly kibana: Readonly<{ readonly index: string; }>; readonly elasticsearch: Readonly<{ readonly shardTimeout: Readonly<{ clone: () => moment.Duration; humanize: { (argWithSuffix?: boolean | undefined, argThresholds?: moment.argThresholdOpts | undefined): string; (argThresholds?: moment.argThresholdOpts | undefined): string; }; abs: () => moment.Duration; as: (units: moment.unitOfTime.Base) => number; get: (units: moment.unitOfTime.Base) => number; milliseconds: () => number; asMilliseconds: () => number; seconds: () => number; asSeconds: () => number; minutes: () => number; asMinutes: () => number; hours: () => number; asHours: () => number; days: () => number; asDays: () => number; weeks: () => number; asWeeks: () => number; months: () => number; asMonths: () => number; years: () => number; asYears: () => number; add: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; subtract: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; locale: { (): string; (locale: moment.LocaleSpecifier): moment.Duration; }; localeData: () => moment.Locale; toISOString: () => string; toJSON: () => string; isValid: () => boolean; lang: { (locale: moment.LocaleSpecifier): moment.Moment; (): moment.Locale; }; toIsoString: () => string; }>; readonly requestTimeout: Readonly<{ clone: () => moment.Duration; humanize: { (argWithSuffix?: boolean | undefined, argThresholds?: moment.argThresholdOpts | undefined): string; (argThresholds?: moment.argThresholdOpts | undefined): string; }; abs: () => moment.Duration; as: (units: moment.unitOfTime.Base) => number; get: (units: moment.unitOfTime.Base) => number; milliseconds: () => number; asMilliseconds: () => number; seconds: () => number; asSeconds: () => number; minutes: () => number; asMinutes: () => number; hours: () => number; asHours: () => number; days: () => number; asDays: () => number; weeks: () => number; asWeeks: () => number; months: () => number; asMonths: () => number; years: () => number; asYears: () => number; add: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; subtract: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; locale: { (): string; (locale: moment.LocaleSpecifier): moment.Duration; }; localeData: () => moment.Locale; toISOString: () => string; toJSON: () => string; isValid: () => boolean; lang: { (locale: moment.LocaleSpecifier): moment.Moment; (): moment.Locale; }; toIsoString: () => string; }>; readonly pingTimeout: Readonly<{ clone: () => moment.Duration; humanize: { (argWithSuffix?: boolean | undefined, argThresholds?: moment.argThresholdOpts | undefined): string; (argThresholds?: moment.argThresholdOpts | undefined): string; }; abs: () => moment.Duration; as: (units: moment.unitOfTime.Base) => number; get: (units: moment.unitOfTime.Base) => number; milliseconds: () => number; asMilliseconds: () => number; seconds: () => number; asSeconds: () => number; minutes: () => number; asMinutes: () => number; hours: () => number; asHours: () => number; days: () => number; asDays: () => number; weeks: () => number; asWeeks: () => number; months: () => number; asMonths: () => number; years: () => number; asYears: () => number; add: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; subtract: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; locale: { (): string; (locale: moment.LocaleSpecifier): moment.Duration; }; localeData: () => moment.Locale; toISOString: () => string; toJSON: () => string; isValid: () => boolean; lang: { (locale: moment.LocaleSpecifier): moment.Moment; (): moment.Locale; }; toIsoString: () => string; }>; }>; readonly path: Readonly<{ readonly data: string; }>; readonly savedObjects: Readonly<{ readonly maxImportPayloadBytes: Readonly<{ isGreaterThan: (other: ", "ByteSizeValue", ") => boolean; isLessThan: (other: ", "ByteSizeValue", diff --git a/api_docs/core_application.json b/api_docs/core_application.json index e890b6f92a2ad6..c8a036fda242df 100644 --- a/api_docs/core_application.json +++ b/api_docs/core_application.json @@ -1606,6 +1606,13 @@ "lineNumber": 16 } }, + { + "plugin": "fleet", + "link": { + "path": "x-pack/plugins/fleet/public/applications/integrations/index.tsx", + "lineNumber": 67 + } + }, { "plugin": "fleet", "link": { @@ -1661,6 +1668,13 @@ "path": "x-pack/plugins/fleet/target/types/public/applications/fleet/index.d.ts", "lineNumber": 11 } + }, + { + "plugin": "fleet", + "link": { + "path": "x-pack/plugins/fleet/target/types/public/applications/integrations/index.d.ts", + "lineNumber": 11 + } } ] }, @@ -1695,22 +1709,22 @@ { "plugin": "dashboard", "link": { - "path": "src/plugins/dashboard/public/application/types.ts", - "lineNumber": 82 + "path": "src/plugins/dashboard/public/types.ts", + "lineNumber": 194 } }, { "plugin": "dashboard", "link": { "path": "src/plugins/dashboard/public/application/dashboard_router.tsx", - "lineNumber": 56 + "lineNumber": 57 } }, { "plugin": "dashboard", "link": { "path": "src/plugins/dashboard/public/plugin.tsx", - "lineNumber": 298 + "lineNumber": 299 } }, { @@ -1724,7 +1738,7 @@ "plugin": "maps", "link": { "path": "x-pack/plugins/maps/public/routes/map_page/map_app/map_app.tsx", - "lineNumber": 59 + "lineNumber": 67 } }, { @@ -1738,14 +1752,21 @@ "plugin": "lens", "link": { "path": "x-pack/plugins/lens/public/app_plugin/types.ts", - "lineNumber": 71 + "lineNumber": 44 + } + }, + { + "plugin": "lens", + "link": { + "path": "x-pack/plugins/lens/public/app_plugin/types.ts", + "lineNumber": 72 } }, { "plugin": "lens", "link": { "path": "x-pack/plugins/lens/public/app_plugin/mounter.tsx", - "lineNumber": 171 + "lineNumber": 219 } }, { @@ -1822,7 +1843,7 @@ "plugin": "maps", "link": { "path": "x-pack/plugins/maps/target/types/public/routes/map_page/map_app/map_app.d.ts", - "lineNumber": 13 + "lineNumber": 17 } } ], diff --git a/api_docs/core_saved_objects.json b/api_docs/core_saved_objects.json index adf0612a28faf8..3590d38b0f8265 100644 --- a/api_docs/core_saved_objects.json +++ b/api_docs/core_saved_objects.json @@ -4759,7 +4759,7 @@ "description": [], "source": { "path": "src/core/server/saved_objects/export/saved_objects_exporter.ts", - "lineNumber": 36 + "lineNumber": 35 }, "deprecated": false, "children": [ @@ -5075,7 +5075,7 @@ ], "source": { "path": "src/core/server/saved_objects/export/saved_objects_exporter.ts", - "lineNumber": 37 + "lineNumber": 36 }, "deprecated": false }, @@ -5099,7 +5099,7 @@ ], "source": { "path": "src/core/server/saved_objects/export/saved_objects_exporter.ts", - "lineNumber": 38 + "lineNumber": 37 }, "deprecated": false }, @@ -5112,7 +5112,7 @@ "description": [], "source": { "path": "src/core/server/saved_objects/export/saved_objects_exporter.ts", - "lineNumber": 39 + "lineNumber": 38 }, "deprecated": false }, @@ -5128,7 +5128,7 @@ ], "source": { "path": "src/core/server/saved_objects/export/saved_objects_exporter.ts", - "lineNumber": 40 + "lineNumber": 39 }, "deprecated": false }, @@ -5144,7 +5144,7 @@ ], "source": { "path": "src/core/server/saved_objects/export/saved_objects_exporter.ts", - "lineNumber": 42 + "lineNumber": 41 }, "deprecated": false, "children": [ @@ -5157,7 +5157,7 @@ "description": [], "source": { "path": "src/core/server/saved_objects/export/saved_objects_exporter.ts", - "lineNumber": 47 + "lineNumber": 46 }, "deprecated": false, "children": [ @@ -5473,7 +5473,7 @@ ], "source": { "path": "src/core/server/saved_objects/export/saved_objects_exporter.ts", - "lineNumber": 48 + "lineNumber": 47 }, "deprecated": false }, @@ -5521,7 +5521,7 @@ ], "source": { "path": "src/core/server/saved_objects/export/saved_objects_exporter.ts", - "lineNumber": 49 + "lineNumber": 48 }, "deprecated": false }, @@ -5534,7 +5534,7 @@ "description": [], "source": { "path": "src/core/server/saved_objects/export/saved_objects_exporter.ts", - "lineNumber": 50 + "lineNumber": 49 }, "deprecated": false }, @@ -5550,7 +5550,7 @@ ], "source": { "path": "src/core/server/saved_objects/export/saved_objects_exporter.ts", - "lineNumber": 51 + "lineNumber": 50 }, "deprecated": false } @@ -5585,7 +5585,7 @@ ], "source": { "path": "src/core/server/saved_objects/export/saved_objects_exporter.ts", - "lineNumber": 74 + "lineNumber": 73 }, "deprecated": false, "children": [ @@ -5607,7 +5607,7 @@ ], "source": { "path": "src/core/server/saved_objects/export/saved_objects_exporter.ts", - "lineNumber": 74 + "lineNumber": 73 }, "deprecated": false, "isRequired": true @@ -5641,7 +5641,7 @@ ], "source": { "path": "src/core/server/saved_objects/export/saved_objects_exporter.ts", - "lineNumber": 93 + "lineNumber": 92 }, "deprecated": false, "children": [ @@ -5663,7 +5663,7 @@ ], "source": { "path": "src/core/server/saved_objects/export/saved_objects_exporter.ts", - "lineNumber": 93 + "lineNumber": 92 }, "deprecated": false, "isRequired": true @@ -14507,15 +14507,15 @@ { "plugin": "lens", "link": { - "path": "x-pack/plugins/lens/server/migrations.ts", - "lineNumber": 245 + "path": "x-pack/plugins/lens/server/migrations/saved_object_migrations.ts", + "lineNumber": 167 } }, { "plugin": "lens", "link": { - "path": "x-pack/plugins/lens/server/migrations.ts", - "lineNumber": 312 + "path": "x-pack/plugins/lens/server/migrations/saved_object_migrations.ts", + "lineNumber": 234 } } ], @@ -17426,7 +17426,7 @@ ], "source": { "path": "src/core/server/saved_objects/export/saved_objects_exporter.ts", - "lineNumber": 31 + "lineNumber": 30 }, "deprecated": false, "initialIsOpen": false diff --git a/api_docs/dashboard.json b/api_docs/dashboard.json index 9c3dccb95bc07c..821d298ea1309e 100644 --- a/api_docs/dashboard.json +++ b/api_docs/dashboard.json @@ -47,7 +47,7 @@ ], "source": { "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx", - "lineNumber": 105 + "lineNumber": 87 }, "deprecated": false, "children": [ @@ -63,31 +63,7 @@ ], "source": { "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx", - "lineNumber": 106 - }, - "deprecated": false - }, - { - "parentPluginId": "dashboard", - "id": "def-public.DashboardContainer.switchViewMode", - "type": "Function", - "tags": [], - "label": "switchViewMode", - "description": [], - "signature": [ - "((newViewMode: ", - { - "pluginId": "embeddable", - "scope": "common", - "docId": "kibEmbeddablePluginApi", - "section": "def-common.ViewMode", - "text": "ViewMode" - }, - ") => void) | undefined" - ], - "source": { - "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx", - "lineNumber": 107 + "lineNumber": 88 }, "deprecated": false }, @@ -103,7 +79,7 @@ ], "source": { "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx", - "lineNumber": 109 + "lineNumber": 90 }, "deprecated": false, "children": [], @@ -121,7 +97,7 @@ ], "source": { "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx", - "lineNumber": 113 + "lineNumber": 94 }, "deprecated": false, "children": [ @@ -143,7 +119,7 @@ ], "source": { "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx", - "lineNumber": 114 + "lineNumber": 95 }, "deprecated": false, "isRequired": true @@ -160,7 +136,7 @@ ], "source": { "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx", - "lineNumber": 115 + "lineNumber": 96 }, "deprecated": false, "isRequired": true @@ -200,7 +176,7 @@ ], "source": { "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx", - "lineNumber": 116 + "lineNumber": 97 }, "deprecated": false, "isRequired": false @@ -248,7 +224,7 @@ ], "source": { "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx", - "lineNumber": 129 + "lineNumber": 110 }, "deprecated": false, "children": [ @@ -273,7 +249,7 @@ ], "source": { "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx", - "lineNumber": 133 + "lineNumber": 114 }, "deprecated": false, "isRequired": true @@ -290,7 +266,7 @@ ], "source": { "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx", - "lineNumber": 134 + "lineNumber": 115 }, "deprecated": false, "isRequired": true @@ -322,7 +298,7 @@ ], "source": { "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx", - "lineNumber": 140 + "lineNumber": 122 }, "deprecated": false, "children": [ @@ -346,7 +322,7 @@ ], "source": { "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx", - "lineNumber": 141 + "lineNumber": 123 }, "deprecated": false, "isRequired": true @@ -364,7 +340,7 @@ ], "source": { "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx", - "lineNumber": 142 + "lineNumber": 124 }, "deprecated": false, "isRequired": false @@ -381,7 +357,7 @@ ], "source": { "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx", - "lineNumber": 143 + "lineNumber": 125 }, "deprecated": false, "isRequired": false @@ -419,7 +395,7 @@ ], "source": { "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx", - "lineNumber": 181 + "lineNumber": 164 }, "deprecated": false, "children": [ @@ -444,7 +420,7 @@ ], "source": { "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx", - "lineNumber": 182 + "lineNumber": 165 }, "deprecated": false, "isRequired": true @@ -469,7 +445,7 @@ ], "source": { "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx", - "lineNumber": 183 + "lineNumber": 166 }, "deprecated": false, "isRequired": true @@ -486,7 +462,7 @@ ], "source": { "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx", - "lineNumber": 184 + "lineNumber": 167 }, "deprecated": false, "isRequired": false @@ -562,7 +538,7 @@ ], "source": { "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx", - "lineNumber": 228 + "lineNumber": 211 }, "deprecated": false, "children": [ @@ -578,7 +554,7 @@ ], "source": { "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx", - "lineNumber": 232 + "lineNumber": 215 }, "deprecated": false, "isRequired": true @@ -595,7 +571,7 @@ ], "source": { "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx", - "lineNumber": 232 + "lineNumber": 215 }, "deprecated": false, "isRequired": true @@ -612,7 +588,7 @@ ], "source": { "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx", - "lineNumber": 232 + "lineNumber": 215 }, "deprecated": false, "isRequired": false @@ -632,7 +608,7 @@ ], "source": { "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx", - "lineNumber": 246 + "lineNumber": 229 }, "deprecated": false, "children": [ @@ -648,7 +624,7 @@ ], "source": { "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx", - "lineNumber": 246 + "lineNumber": 229 }, "deprecated": false, "isRequired": true @@ -669,7 +645,7 @@ ], "source": { "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx", - "lineNumber": 259 + "lineNumber": 242 }, "deprecated": false, "children": [ @@ -685,7 +661,7 @@ ], "source": { "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx", - "lineNumber": 259 + "lineNumber": 242 }, "deprecated": false, "isRequired": true @@ -749,7 +725,7 @@ ], "source": { "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container_factory.tsx", - "lineNumber": 34 + "lineNumber": 32 }, "deprecated": false, "children": [ @@ -765,7 +741,7 @@ ], "source": { "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container_factory.tsx", - "lineNumber": 37 + "lineNumber": 35 }, "deprecated": false }, @@ -781,7 +757,7 @@ ], "source": { "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container_factory.tsx", - "lineNumber": 38 + "lineNumber": 36 }, "deprecated": false }, @@ -797,7 +773,7 @@ ], "source": { "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container_factory.tsx", - "lineNumber": 40 + "lineNumber": 38 }, "deprecated": false, "children": [ @@ -815,7 +791,7 @@ ], "source": { "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container_factory.tsx", - "lineNumber": 41 + "lineNumber": 39 }, "deprecated": false, "isRequired": true @@ -838,7 +814,7 @@ ], "source": { "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container_factory.tsx", - "lineNumber": 42 + "lineNumber": 40 }, "deprecated": false, "isRequired": true @@ -858,7 +834,7 @@ ], "source": { "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container_factory.tsx", - "lineNumber": 45 + "lineNumber": 43 }, "deprecated": false, "children": [], @@ -876,7 +852,7 @@ ], "source": { "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container_factory.tsx", - "lineNumber": 50 + "lineNumber": 48 }, "deprecated": false, "children": [], @@ -902,7 +878,7 @@ ], "source": { "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container_factory.tsx", - "lineNumber": 56 + "lineNumber": 54 }, "deprecated": false, "children": [], @@ -968,7 +944,7 @@ ], "source": { "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container_factory.tsx", - "lineNumber": 66 + "lineNumber": 64 }, "deprecated": false, "children": [ @@ -990,7 +966,7 @@ ], "source": { "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container_factory.tsx", - "lineNumber": 67 + "lineNumber": 65 }, "deprecated": false, "isRequired": true @@ -1030,7 +1006,7 @@ ], "source": { "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container_factory.tsx", - "lineNumber": 68 + "lineNumber": 66 }, "deprecated": false, "isRequired": false @@ -1067,7 +1043,7 @@ ], "source": { "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container_factory.tsx", - "lineNumber": 74 + "lineNumber": 72 }, "deprecated": false, "returnComment": [], @@ -1137,7 +1113,7 @@ ], "source": { "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container_factory.tsx", - "lineNumber": 76 + "lineNumber": 74 }, "deprecated": false, "returnComment": [], @@ -1177,7 +1153,7 @@ ], "source": { "path": "src/plugins/dashboard/public/dashboard_constants.ts", - "lineNumber": 22 + "lineNumber": 24 }, "deprecated": false, "children": [ @@ -1193,7 +1169,7 @@ ], "source": { "path": "src/plugins/dashboard/public/dashboard_constants.ts", - "lineNumber": 22 + "lineNumber": 24 }, "deprecated": false, "isRequired": false @@ -1210,7 +1186,7 @@ ], "source": { "path": "src/plugins/dashboard/public/dashboard_constants.ts", - "lineNumber": 22 + "lineNumber": 24 }, "deprecated": false, "isRequired": false @@ -1308,8 +1284,8 @@ "<{}>" ], "source": { - "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx", - "lineNumber": 43 + "path": "src/plugins/dashboard/public/types.ts", + "lineNumber": 72 }, "deprecated": false, "children": [ @@ -1321,12 +1297,12 @@ "label": "dashboardCapabilities", "description": [], "signature": [ - "DashboardCapabilities", + "DashboardAppCapabilities", " | undefined" ], "source": { - "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx", - "lineNumber": 44 + "path": "src/plugins/dashboard/public/types.ts", + "lineNumber": 73 }, "deprecated": false }, @@ -1348,8 +1324,8 @@ " | undefined" ], "source": { - "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx", - "lineNumber": 45 + "path": "src/plugins/dashboard/public/types.ts", + "lineNumber": 74 }, "deprecated": false }, @@ -1364,8 +1340,8 @@ "boolean | undefined" ], "source": { - "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx", - "lineNumber": 46 + "path": "src/plugins/dashboard/public/types.ts", + "lineNumber": 75 }, "deprecated": false }, @@ -1377,8 +1353,8 @@ "label": "isFullScreenMode", "description": [], "source": { - "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx", - "lineNumber": 47 + "path": "src/plugins/dashboard/public/types.ts", + "lineNumber": 76 }, "deprecated": false }, @@ -1393,8 +1369,8 @@ "string | undefined" ], "source": { - "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx", - "lineNumber": 48 + "path": "src/plugins/dashboard/public/types.ts", + "lineNumber": 77 }, "deprecated": false }, @@ -1409,8 +1385,8 @@ "{ from: string; to: string; mode?: \"absolute\" | \"relative\" | undefined; }" ], "source": { - "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx", - "lineNumber": 49 + "path": "src/plugins/dashboard/public/types.ts", + "lineNumber": 78 }, "deprecated": false }, @@ -1425,8 +1401,8 @@ "string | undefined" ], "source": { - "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx", - "lineNumber": 50 + "path": "src/plugins/dashboard/public/types.ts", + "lineNumber": 79 }, "deprecated": false }, @@ -1438,8 +1414,8 @@ "label": "useMargins", "description": [], "source": { - "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx", - "lineNumber": 51 + "path": "src/plugins/dashboard/public/types.ts", + "lineNumber": 80 }, "deprecated": false }, @@ -1454,8 +1430,8 @@ "boolean | undefined" ], "source": { - "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx", - "lineNumber": 52 + "path": "src/plugins/dashboard/public/types.ts", + "lineNumber": 81 }, "deprecated": false }, @@ -1476,8 +1452,8 @@ } ], "source": { - "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx", - "lineNumber": 53 + "path": "src/plugins/dashboard/public/types.ts", + "lineNumber": 82 }, "deprecated": false }, @@ -1499,8 +1475,8 @@ "[]" ], "source": { - "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx", - "lineNumber": 54 + "path": "src/plugins/dashboard/public/types.ts", + "lineNumber": 83 }, "deprecated": false }, @@ -1512,8 +1488,8 @@ "label": "title", "description": [], "source": { - "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx", - "lineNumber": 55 + "path": "src/plugins/dashboard/public/types.ts", + "lineNumber": 84 }, "deprecated": false }, @@ -1528,8 +1504,8 @@ "{ query: string | { [key: string]: any; }; language: string; }" ], "source": { - "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx", - "lineNumber": 56 + "path": "src/plugins/dashboard/public/types.ts", + "lineNumber": 85 }, "deprecated": false }, @@ -1554,8 +1530,8 @@ " & { [k: string]: unknown; }>; }" ], "source": { - "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx", - "lineNumber": 57 + "path": "src/plugins/dashboard/public/types.ts", + "lineNumber": 86 }, "deprecated": false } @@ -1571,7 +1547,7 @@ "description": [], "source": { "path": "src/plugins/dashboard/public/plugin.tsx", - "lineNumber": 91 + "lineNumber": 92 }, "deprecated": false, "children": [ @@ -1584,7 +1560,7 @@ "description": [], "source": { "path": "src/plugins/dashboard/public/plugin.tsx", - "lineNumber": 92 + "lineNumber": 93 }, "deprecated": false } @@ -1617,7 +1593,7 @@ ], "source": { "path": "src/plugins/dashboard/public/saved_dashboards/saved_dashboard.ts", - "lineNumber": 18 + "lineNumber": 19 }, "deprecated": false, "children": [ @@ -1633,7 +1609,7 @@ ], "source": { "path": "src/plugins/dashboard/public/saved_dashboards/saved_dashboard.ts", - "lineNumber": 19 + "lineNumber": 20 }, "deprecated": false }, @@ -1646,7 +1622,7 @@ "description": [], "source": { "path": "src/plugins/dashboard/public/saved_dashboards/saved_dashboard.ts", - "lineNumber": 20 + "lineNumber": 21 }, "deprecated": false }, @@ -1662,7 +1638,7 @@ ], "source": { "path": "src/plugins/dashboard/public/saved_dashboards/saved_dashboard.ts", - "lineNumber": 21 + "lineNumber": 22 }, "deprecated": false }, @@ -1678,7 +1654,7 @@ ], "source": { "path": "src/plugins/dashboard/public/saved_dashboards/saved_dashboard.ts", - "lineNumber": 22 + "lineNumber": 23 }, "deprecated": false }, @@ -1694,7 +1670,7 @@ ], "source": { "path": "src/plugins/dashboard/public/saved_dashboards/saved_dashboard.ts", - "lineNumber": 23 + "lineNumber": 24 }, "deprecated": false }, @@ -1707,7 +1683,7 @@ "description": [], "source": { "path": "src/plugins/dashboard/public/saved_dashboards/saved_dashboard.ts", - "lineNumber": 24 + "lineNumber": 25 }, "deprecated": false }, @@ -1723,7 +1699,7 @@ ], "source": { "path": "src/plugins/dashboard/public/saved_dashboards/saved_dashboard.ts", - "lineNumber": 25 + "lineNumber": 26 }, "deprecated": false }, @@ -1739,7 +1715,7 @@ ], "source": { "path": "src/plugins/dashboard/public/saved_dashboards/saved_dashboard.ts", - "lineNumber": 27 + "lineNumber": 28 }, "deprecated": false }, @@ -1752,7 +1728,7 @@ "description": [], "source": { "path": "src/plugins/dashboard/public/saved_dashboards/saved_dashboard.ts", - "lineNumber": 28 + "lineNumber": 29 }, "deprecated": false }, @@ -1775,7 +1751,7 @@ ], "source": { "path": "src/plugins/dashboard/public/saved_dashboards/saved_dashboard.ts", - "lineNumber": 29 + "lineNumber": 30 }, "deprecated": false }, @@ -1967,7 +1943,7 @@ ], "source": { "path": "src/plugins/dashboard/public/saved_dashboards/saved_dashboard.ts", - "lineNumber": 30 + "lineNumber": 31 }, "deprecated": false }, @@ -1990,7 +1966,7 @@ ], "source": { "path": "src/plugins/dashboard/public/saved_dashboards/saved_dashboard.ts", - "lineNumber": 31 + "lineNumber": 32 }, "deprecated": false, "children": [], @@ -2016,7 +1992,7 @@ ], "source": { "path": "src/plugins/dashboard/public/saved_dashboards/saved_dashboard.ts", - "lineNumber": 32 + "lineNumber": 33 }, "deprecated": false, "children": [], @@ -2034,7 +2010,7 @@ ], "source": { "path": "src/plugins/dashboard/public/saved_dashboards/saved_dashboard.ts", - "lineNumber": 33 + "lineNumber": 34 }, "deprecated": false, "returnComment": [], @@ -2051,7 +2027,7 @@ ], "source": { "path": "src/plugins/dashboard/public/saved_dashboards/saved_dashboard.ts", - "lineNumber": 33 + "lineNumber": 34 }, "deprecated": false } @@ -2372,7 +2348,7 @@ ], "source": { "path": "src/plugins/dashboard/public/plugin.tsx", - "lineNumber": 89 + "lineNumber": 90 }, "deprecated": false, "initialIsOpen": false @@ -2399,7 +2375,7 @@ ], "source": { "path": "src/plugins/dashboard/common/types.ts", - "lineNumber": 38 + "lineNumber": 46 }, "deprecated": false, "initialIsOpen": false @@ -2522,6 +2498,32 @@ "lineNumber": 19 }, "deprecated": false + }, + { + "parentPluginId": "dashboard", + "id": "def-public.DashboardConstants.CHANGE_CHECK_DEBOUNCE", + "type": "number", + "tags": [], + "label": "CHANGE_CHECK_DEBOUNCE", + "description": [], + "source": { + "path": "src/plugins/dashboard/public/dashboard_constants.ts", + "lineNumber": 20 + }, + "deprecated": false + }, + { + "parentPluginId": "dashboard", + "id": "def-public.DashboardConstants.CHANGE_APPLY_DEBOUNCE", + "type": "number", + "tags": [], + "label": "CHANGE_APPLY_DEBOUNCE", + "description": [], + "source": { + "path": "src/plugins/dashboard/public/dashboard_constants.ts", + "lineNumber": 21 + }, + "deprecated": false } ], "initialIsOpen": false @@ -2539,7 +2541,7 @@ ], "source": { "path": "src/plugins/dashboard/public/plugin.tsx", - "lineNumber": 123 + "lineNumber": 124 }, "deprecated": false, "lifecycle": "setup", @@ -2554,7 +2556,7 @@ "description": [], "source": { "path": "src/plugins/dashboard/public/plugin.tsx", - "lineNumber": 125 + "lineNumber": 126 }, "deprecated": false, "children": [ @@ -2577,7 +2579,7 @@ ], "source": { "path": "src/plugins/dashboard/public/plugin.tsx", - "lineNumber": 126 + "lineNumber": 127 }, "deprecated": false, "returnComment": [], @@ -2595,7 +2597,7 @@ ], "source": { "path": "src/plugins/dashboard/public/plugin.tsx", - "lineNumber": 127 + "lineNumber": 128 }, "deprecated": false, "returnComment": [], @@ -2620,7 +2622,7 @@ ], "source": { "path": "src/plugins/dashboard/public/plugin.tsx", - "lineNumber": 130 + "lineNumber": 131 }, "deprecated": false }, @@ -2642,7 +2644,7 @@ ], "source": { "path": "src/plugins/dashboard/public/plugin.tsx", - "lineNumber": 131 + "lineNumber": 132 }, "deprecated": false } @@ -2983,7 +2985,7 @@ ], "source": { "path": "src/plugins/dashboard/common/types.ts", - "lineNumber": 91 + "lineNumber": 99 }, "deprecated": false, "children": [ @@ -3009,7 +3011,7 @@ ], "source": { "path": "src/plugins/dashboard/common/types.ts", - "lineNumber": 92 + "lineNumber": 100 }, "deprecated": false } @@ -3184,7 +3186,7 @@ ], "source": { "path": "src/plugins/dashboard/common/types.ts", - "lineNumber": 64 + "lineNumber": 72 }, "deprecated": false, "initialIsOpen": false @@ -3203,7 +3205,7 @@ ], "source": { "path": "src/plugins/dashboard/common/types.ts", - "lineNumber": 56 + "lineNumber": 64 }, "deprecated": false, "initialIsOpen": false @@ -3222,7 +3224,7 @@ ], "source": { "path": "src/plugins/dashboard/common/types.ts", - "lineNumber": 48 + "lineNumber": 56 }, "deprecated": false, "initialIsOpen": false @@ -3241,7 +3243,7 @@ ], "source": { "path": "src/plugins/dashboard/common/types.ts", - "lineNumber": 40 + "lineNumber": 48 }, "deprecated": false, "initialIsOpen": false @@ -3266,7 +3268,7 @@ ], "source": { "path": "src/plugins/dashboard/common/types.ts", - "lineNumber": 81 + "lineNumber": 89 }, "deprecated": false, "initialIsOpen": false @@ -3285,7 +3287,7 @@ ], "source": { "path": "src/plugins/dashboard/common/types.ts", - "lineNumber": 72 + "lineNumber": 80 }, "deprecated": false, "initialIsOpen": false diff --git a/api_docs/dashboard_enhanced.json b/api_docs/dashboard_enhanced.json index 30daac1b263957..b1ce19250a597d 100644 --- a/api_docs/dashboard_enhanced.json +++ b/api_docs/dashboard_enhanced.json @@ -684,6 +684,8 @@ }, ") => void; } & { urlGenerators: ", "UrlGeneratorsSetup", + "; url: ", + "UrlService", "; }" ], "source": { @@ -792,6 +794,8 @@ }, ") => void; } & { urlGenerators: ", "UrlGeneratorsStart", + "; url: ", + "UrlService", "; }" ], "source": { diff --git a/api_docs/data.json b/api_docs/data.json index 1ba62ea9946549..75b5a3c98b778d 100644 --- a/api_docs/data.json +++ b/api_docs/data.json @@ -11,7 +11,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 55 + "lineNumber": 57 }, "deprecated": false, "children": [ @@ -31,7 +31,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 63 + "lineNumber": 65 }, "deprecated": false, "children": [ @@ -49,7 +49,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 63 + "lineNumber": 65 }, "deprecated": false, "isRequired": true @@ -83,7 +83,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 83 + "lineNumber": 85 }, "deprecated": false, "children": [ @@ -106,7 +106,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 83 + "lineNumber": 85 }, "deprecated": false, "isRequired": true @@ -134,7 +134,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 92 + "lineNumber": 94 }, "deprecated": false }, @@ -147,7 +147,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 93 + "lineNumber": 95 }, "deprecated": false }, @@ -160,7 +160,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 94 + "lineNumber": 96 }, "deprecated": false }, @@ -176,7 +176,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 95 + "lineNumber": 97 }, "deprecated": false }, @@ -199,7 +199,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 96 + "lineNumber": 98 }, "deprecated": false }, @@ -215,7 +215,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 97 + "lineNumber": 99 }, "deprecated": false }, @@ -231,7 +231,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 98 + "lineNumber": 100 }, "deprecated": false }, @@ -247,7 +247,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 104 + "lineNumber": 106 }, "deprecated": false, "children": [ @@ -269,7 +269,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 104 + "lineNumber": 106 }, "deprecated": false, "isRequired": true @@ -304,7 +304,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 104 + "lineNumber": 106 }, "deprecated": false, "isRequired": true @@ -328,7 +328,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 134 + "lineNumber": 136 }, "deprecated": false, "children": [ @@ -346,7 +346,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 134 + "lineNumber": 136 }, "deprecated": false, "isRequired": true @@ -366,7 +366,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 171 + "lineNumber": 173 }, "deprecated": false, "children": [ @@ -382,7 +382,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 171 + "lineNumber": 173 }, "deprecated": false, "isRequired": true @@ -390,6 +390,42 @@ ], "returnComment": [] }, + { + "parentPluginId": "data", + "id": "def-public.AggConfig.hasTimeShift", + "type": "Function", + "tags": [], + "label": "hasTimeShift", + "description": [], + "signature": [ + "() => boolean" + ], + "source": { + "path": "src/plugins/data/common/search/aggs/agg_config.ts", + "lineNumber": 177 + }, + "deprecated": false, + "children": [], + "returnComment": [] + }, + { + "parentPluginId": "data", + "id": "def-public.AggConfig.getTimeShift", + "type": "Function", + "tags": [], + "label": "getTimeShift", + "description": [], + "signature": [ + "() => moment.Duration | undefined" + ], + "source": { + "path": "src/plugins/data/common/search/aggs/agg_config.ts", + "lineNumber": 181 + }, + "deprecated": false, + "children": [], + "returnComment": [] + }, { "parentPluginId": "data", "id": "def-public.AggConfig.write", @@ -410,7 +446,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 175 + "lineNumber": 202 }, "deprecated": false, "children": [ @@ -433,7 +469,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 175 + "lineNumber": 202 }, "deprecated": false, "isRequired": false @@ -453,7 +489,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 179 + "lineNumber": 206 }, "deprecated": false, "children": [], @@ -471,7 +507,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 183 + "lineNumber": 210 }, "deprecated": false, "children": [ @@ -487,7 +523,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 183 + "lineNumber": 210 }, "deprecated": false, "isRequired": true @@ -504,7 +540,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 183 + "lineNumber": 210 }, "deprecated": false, "isRequired": true @@ -544,7 +580,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 209 + "lineNumber": 236 }, "deprecated": false, "children": [ @@ -568,7 +604,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 209 + "lineNumber": 236 }, "deprecated": false, "isRequired": true @@ -592,7 +628,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 209 + "lineNumber": 236 }, "deprecated": false, "isRequired": false @@ -624,7 +660,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 230 + "lineNumber": 257 }, "deprecated": false, "children": [ @@ -649,7 +685,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 230 + "lineNumber": 257 }, "deprecated": false, "isRequired": false @@ -673,7 +709,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 265 + "lineNumber": 292 }, "deprecated": false, "children": [], @@ -697,7 +733,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 296 + "lineNumber": 323 }, "deprecated": true, "references": [ @@ -726,7 +762,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 307 + "lineNumber": 334 }, "deprecated": false, "children": [], @@ -752,7 +788,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 316 + "lineNumber": 343 }, "deprecated": false, "children": [], @@ -788,7 +824,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 371 + "lineNumber": 398 }, "deprecated": false, "children": [], @@ -814,7 +850,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 375 + "lineNumber": 402 }, "deprecated": false, "children": [], @@ -840,7 +876,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 379 + "lineNumber": 406 }, "deprecated": false, "children": [], @@ -858,7 +894,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 383 + "lineNumber": 410 }, "deprecated": false, "children": [ @@ -874,7 +910,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 383 + "lineNumber": 410 }, "deprecated": false, "isRequired": true @@ -894,7 +930,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 387 + "lineNumber": 414 }, "deprecated": false, "children": [ @@ -910,7 +946,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 387 + "lineNumber": 414 }, "deprecated": false, "isRequired": true @@ -927,7 +963,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 387 + "lineNumber": 414 }, "deprecated": false, "isRequired": false @@ -947,7 +983,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 395 + "lineNumber": 422 }, "deprecated": false, "children": [], @@ -965,7 +1001,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 401 + "lineNumber": 428 }, "deprecated": false, "children": [], @@ -985,7 +1021,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 410 + "lineNumber": 437 }, "deprecated": false, "children": [], @@ -1003,7 +1039,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 414 + "lineNumber": 441 }, "deprecated": false, "children": [ @@ -1019,7 +1055,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 414 + "lineNumber": 441 }, "deprecated": false, "isRequired": true @@ -1046,7 +1082,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 428 + "lineNumber": 455 }, "deprecated": false, "children": [], @@ -1072,7 +1108,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 432 + "lineNumber": 459 }, "deprecated": false, "children": [], @@ -1090,7 +1126,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 436 + "lineNumber": 463 }, "deprecated": false, "children": [], @@ -1108,7 +1144,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 441 + "lineNumber": 468 }, "deprecated": false, "children": [], @@ -1157,7 +1193,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 452 + "lineNumber": 479 }, "deprecated": false }, @@ -1204,7 +1240,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 456 + "lineNumber": 483 }, "deprecated": false }, @@ -1228,7 +1264,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 486 + "lineNumber": 513 }, "deprecated": false, "children": [ @@ -1250,7 +1286,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 486 + "lineNumber": 513 }, "deprecated": false, "isRequired": true @@ -1270,7 +1306,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 65 + "lineNumber": 76 }, "deprecated": false, "children": [ @@ -1292,7 +1328,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 66 + "lineNumber": 77 }, "deprecated": false }, @@ -1315,7 +1351,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 67 + "lineNumber": 78 }, "deprecated": false }, @@ -1331,7 +1367,23 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 68 + "lineNumber": 79 + }, + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-public.AggConfigs.forceNow", + "type": "Object", + "tags": [], + "label": "forceNow", + "description": [], + "signature": [ + "Date | undefined" + ], + "source": { + "path": "src/plugins/data/common/search/aggs/agg_configs.ts", + "lineNumber": 80 }, "deprecated": false }, @@ -1347,7 +1399,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 69 + "lineNumber": 81 }, "deprecated": false }, @@ -1370,7 +1422,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 73 + "lineNumber": 85 }, "deprecated": false }, @@ -1386,7 +1438,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 75 + "lineNumber": 87 }, "deprecated": false, "children": [ @@ -1408,7 +1460,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 76 + "lineNumber": 88 }, "deprecated": false, "isRequired": true @@ -1443,7 +1495,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 77 + "lineNumber": 89 }, "deprecated": false, "isRequired": true @@ -1466,7 +1518,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 78 + "lineNumber": 90 }, "deprecated": false, "isRequired": true @@ -1486,7 +1538,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 91 + "lineNumber": 103 }, "deprecated": false, "children": [ @@ -1502,7 +1554,43 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 91 + "lineNumber": 103 + }, + "deprecated": false, + "isRequired": false + } + ], + "returnComment": [] + }, + { + "parentPluginId": "data", + "id": "def-public.AggConfigs.setForceNow", + "type": "Function", + "tags": [], + "label": "setForceNow", + "description": [], + "signature": [ + "(now: Date | undefined) => void" + ], + "source": { + "path": "src/plugins/data/common/search/aggs/agg_configs.ts", + "lineNumber": 107 + }, + "deprecated": false, + "children": [ + { + "parentPluginId": "data", + "id": "def-public.AggConfigs.setForceNow.$1", + "type": "Object", + "tags": [], + "label": "now", + "description": [], + "signature": [ + "Date | undefined" + ], + "source": { + "path": "src/plugins/data/common/search/aggs/agg_configs.ts", + "lineNumber": 107 }, "deprecated": false, "isRequired": false @@ -1530,7 +1618,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 95 + "lineNumber": 111 }, "deprecated": false, "children": [ @@ -1552,7 +1640,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 95 + "lineNumber": 111 }, "deprecated": false, "isRequired": true @@ -1579,7 +1667,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 113 + "lineNumber": 129 }, "deprecated": false, "children": [ @@ -1595,7 +1683,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 113 + "lineNumber": 129 }, "deprecated": false, "isRequired": true @@ -1649,7 +1737,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 126 + "lineNumber": 142 }, "deprecated": false, "children": [ @@ -1683,7 +1771,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 127 + "lineNumber": 143 }, "deprecated": false, "isRequired": true @@ -1700,7 +1788,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 128 + "lineNumber": 144 }, "deprecated": false, "isRequired": true @@ -1730,7 +1818,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 169 + "lineNumber": 185 }, "deprecated": false, "children": [ @@ -1755,7 +1843,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 169 + "lineNumber": 185 }, "deprecated": false, "isRequired": true @@ -1775,7 +1863,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 181 + "lineNumber": 197 }, "deprecated": false, "children": [], @@ -1801,7 +1889,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 250 + "lineNumber": 287 }, "deprecated": false, "children": [], @@ -1826,7 +1914,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 254 + "lineNumber": 291 }, "deprecated": false, "children": [ @@ -1842,7 +1930,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 254 + "lineNumber": 291 }, "deprecated": false, "isRequired": true @@ -1870,7 +1958,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 258 + "lineNumber": 295 }, "deprecated": false, "children": [ @@ -1886,7 +1974,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 258 + "lineNumber": 295 }, "deprecated": false, "isRequired": true @@ -1914,7 +2002,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 262 + "lineNumber": 299 }, "deprecated": false, "children": [ @@ -1930,7 +2018,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 262 + "lineNumber": 299 }, "deprecated": false, "isRequired": true @@ -1958,7 +2046,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 266 + "lineNumber": 303 }, "deprecated": false, "children": [ @@ -1974,7 +2062,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 266 + "lineNumber": 303 }, "deprecated": false, "isRequired": true @@ -2002,7 +2090,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 270 + "lineNumber": 307 }, "deprecated": false, "children": [ @@ -2018,7 +2106,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 270 + "lineNumber": 307 }, "deprecated": false, "isRequired": true @@ -2046,7 +2134,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 274 + "lineNumber": 311 }, "deprecated": false, "children": [ @@ -2062,7 +2150,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 274 + "lineNumber": 311 }, "deprecated": false, "isRequired": true @@ -2090,12 +2178,169 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 278 + "lineNumber": 315 + }, + "deprecated": false, + "children": [], + "returnComment": [] + }, + { + "parentPluginId": "data", + "id": "def-public.AggConfigs.getTimeShifts", + "type": "Function", + "tags": [], + "label": "getTimeShifts", + "description": [], + "signature": [ + "() => Record" + ], + "source": { + "path": "src/plugins/data/common/search/aggs/agg_configs.ts", + "lineNumber": 329 + }, + "deprecated": false, + "children": [], + "returnComment": [] + }, + { + "parentPluginId": "data", + "id": "def-public.AggConfigs.getTimeShiftInterval", + "type": "Function", + "tags": [], + "label": "getTimeShiftInterval", + "description": [], + "signature": [ + "() => moment.Duration | undefined" + ], + "source": { + "path": "src/plugins/data/common/search/aggs/agg_configs.ts", + "lineNumber": 344 + }, + "deprecated": false, + "children": [], + "returnComment": [] + }, + { + "parentPluginId": "data", + "id": "def-public.AggConfigs.hasTimeShifts", + "type": "Function", + "tags": [], + "label": "hasTimeShifts", + "description": [], + "signature": [ + "() => boolean" + ], + "source": { + "path": "src/plugins/data/common/search/aggs/agg_configs.ts", + "lineNumber": 351 }, "deprecated": false, "children": [], "returnComment": [] }, + { + "parentPluginId": "data", + "id": "def-public.AggConfigs.getSearchSourceTimeFilter", + "type": "Function", + "tags": [], + "label": "getSearchSourceTimeFilter", + "description": [], + "signature": [ + "(forceNow?: Date | undefined) => ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataPluginApi", + "section": "def-common.RangeFilter", + "text": "RangeFilter" + }, + "[] | { meta: { index: string | undefined; params: {}; alias: string; disabled: boolean; negate: boolean; }; query: { bool: { should: { bool: { filter: { range: { [x: string]: { gte: string; lte: string; }; }; }[]; }; }[]; minimum_should_match: number; }; }; }[]" + ], + "source": { + "path": "src/plugins/data/common/search/aggs/agg_configs.ts", + "lineNumber": 355 + }, + "deprecated": false, + "children": [ + { + "parentPluginId": "data", + "id": "def-public.AggConfigs.getSearchSourceTimeFilter.$1", + "type": "Object", + "tags": [], + "label": "forceNow", + "description": [], + "signature": [ + "Date | undefined" + ], + "source": { + "path": "src/plugins/data/common/search/aggs/agg_configs.ts", + "lineNumber": 355 + }, + "deprecated": false, + "isRequired": false + } + ], + "returnComment": [] + }, + { + "parentPluginId": "data", + "id": "def-public.AggConfigs.postFlightTransform", + "type": "Function", + "tags": [], + "label": "postFlightTransform", + "description": [], + "signature": [ + "(response: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.IEsSearchResponse", + "text": "IEsSearchResponse" + }, + ") => ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.IEsSearchResponse", + "text": "IEsSearchResponse" + }, + "" + ], + "source": { + "path": "src/plugins/data/common/search/aggs/agg_configs.ts", + "lineNumber": 408 + }, + "deprecated": false, + "children": [ + { + "parentPluginId": "data", + "id": "def-public.AggConfigs.postFlightTransform.$1", + "type": "Object", + "tags": [], + "label": "response", + "description": [], + "signature": [ + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.IEsSearchResponse", + "text": "IEsSearchResponse" + }, + "" + ], + "source": { + "path": "src/plugins/data/common/search/aggs/agg_configs.ts", + "lineNumber": 408 + }, + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [] + }, { "parentPluginId": "data", "id": "def-public.AggConfigs.getRequestAggById", @@ -2116,7 +2361,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 292 + "lineNumber": 427 }, "deprecated": false, "children": [ @@ -2132,7 +2377,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 292 + "lineNumber": 427 }, "deprecated": false, "isRequired": true @@ -2164,7 +2409,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 307 + "lineNumber": 442 }, "deprecated": false, "children": [], @@ -2194,7 +2439,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 321 + "lineNumber": 456 }, "deprecated": false, "children": [ @@ -2212,7 +2457,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 321 + "lineNumber": 456 }, "deprecated": false, "isRequired": true @@ -2248,7 +2493,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 330 + "lineNumber": 465 }, "deprecated": false, "children": [ @@ -2272,7 +2517,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 330 + "lineNumber": 465 }, "deprecated": false, "isRequired": true @@ -2296,7 +2541,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 330 + "lineNumber": 465 }, "deprecated": false, "isRequired": false @@ -2530,7 +2775,7 @@ "section": "def-public.PluginInitializerContext", "text": "PluginInitializerContext" }, - "; }>; }>; autocomplete: Readonly<{} & { querySuggestions: Readonly<{} & { enabled: boolean; }>; valueSuggestions: Readonly<{} & { enabled: boolean; }>; }>; }>>" + "; }>; }>; autocomplete: Readonly<{} & { querySuggestions: Readonly<{} & { enabled: boolean; }>; valueSuggestions: Readonly<{} & { enabled: boolean; timeout: moment.Duration; terminateAfter: moment.Duration; }>; }>; }>>" ], "source": { "path": "src/plugins/data/public/plugin.ts", @@ -4008,7 +4253,9 @@ "parentPluginId": "data", "id": "def-public.IndexPattern.addScriptedField", "type": "Function", - "tags": [], + "tags": [ + "deprecated" + ], "label": "addScriptedField", "description": [ "\nAdd scripted field to field list\n" @@ -4018,9 +4265,10 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 244 + "lineNumber": 245 }, - "deprecated": false, + "deprecated": true, + "references": [], "children": [ { "parentPluginId": "data", @@ -4036,7 +4284,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 244 + "lineNumber": 245 }, "deprecated": false, "isRequired": true @@ -4055,7 +4303,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 244 + "lineNumber": 245 }, "deprecated": false, "isRequired": true @@ -4072,7 +4320,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 244 + "lineNumber": 245 }, "deprecated": false, "isRequired": true @@ -4084,7 +4332,9 @@ "parentPluginId": "data", "id": "def-public.IndexPattern.removeScriptedField", "type": "Function", - "tags": [], + "tags": [ + "deprecated" + ], "label": "removeScriptedField", "description": [ "\nRemove scripted field from field list" @@ -4094,9 +4344,25 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 270 + "lineNumber": 272 }, - "deprecated": false, + "deprecated": true, + "references": [ + { + "plugin": "indexPatternManagement", + "link": { + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/scripted_fields_table.tsx", + "lineNumber": 117 + } + }, + { + "plugin": "indexPatternManagement", + "link": { + "path": "src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx", + "lineNumber": 777 + } + } + ], "children": [ { "parentPluginId": "data", @@ -4110,7 +4376,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 270 + "lineNumber": 272 }, "deprecated": false, "isRequired": true @@ -4122,9 +4388,13 @@ "parentPluginId": "data", "id": "def-public.IndexPattern.getNonScriptedFields", "type": "Function", - "tags": [], + "tags": [ + "deprecated" + ], "label": "getNonScriptedFields", - "description": [], + "description": [ + "\n" + ], "signature": [ "() => ", { @@ -4138,9 +4408,74 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 277 + "lineNumber": 283 }, - "deprecated": false, + "deprecated": true, + "references": [ + { + "plugin": "indexPatternManagement", + "link": { + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/table/table.tsx", + "lineNumber": 152 + } + }, + { + "plugin": "indexPatternManagement", + "link": { + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx", + "lineNumber": 66 + } + }, + { + "plugin": "indexPatternManagement", + "link": { + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx", + "lineNumber": 74 + } + }, + { + "plugin": "indexPatternManagement", + "link": { + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx", + "lineNumber": 204 + } + }, + { + "plugin": "visTypeTimeseries", + "link": { + "path": "src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/abstract_search_strategy.ts", + "lineNumber": 65 + } + }, + { + "plugin": "graph", + "link": { + "path": "x-pack/plugins/graph/public/services/persistence/deserialize.ts", + "lineNumber": 106 + } + }, + { + "plugin": "graph", + "link": { + "path": "x-pack/plugins/graph/public/state_management/datasource.test.ts", + "lineNumber": 29 + } + }, + { + "plugin": "graph", + "link": { + "path": "x-pack/plugins/graph/public/services/persistence/deserialize.test.ts", + "lineNumber": 122 + } + }, + { + "plugin": "graph", + "link": { + "path": "x-pack/plugins/graph/public/services/persistence/deserialize.test.ts", + "lineNumber": 244 + } + } + ], "children": [], "returnComment": [] }, @@ -4148,9 +4483,13 @@ "parentPluginId": "data", "id": "def-public.IndexPattern.getScriptedFields", "type": "Function", - "tags": [], + "tags": [ + "deprecated" + ], "label": "getScriptedFields", - "description": [], + "description": [ + "\n" + ], "signature": [ "() => ", { @@ -4164,9 +4503,18 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 281 + "lineNumber": 291 }, - "deprecated": false, + "deprecated": true, + "references": [ + { + "plugin": "indexPatternManagement", + "link": { + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/scripted_fields_table.tsx", + "lineNumber": 61 + } + } + ], "children": [], "returnComment": [] }, @@ -4182,7 +4530,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 285 + "lineNumber": 295 }, "deprecated": false, "children": [], @@ -4200,7 +4548,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 289 + "lineNumber": 299 }, "deprecated": false, "children": [], @@ -4226,7 +4574,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 294 + "lineNumber": 304 }, "deprecated": false, "children": [], @@ -4252,7 +4600,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 299 + "lineNumber": 309 }, "deprecated": false, "children": [ @@ -4268,7 +4616,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 299 + "lineNumber": 309 }, "deprecated": false, "isRequired": true @@ -4288,7 +4636,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 304 + "lineNumber": 314 }, "deprecated": false, "children": [], @@ -4304,11 +4652,18 @@ "\nReturns index pattern as saved object body for saving" ], "signature": [ - "() => { fieldAttrs: string | undefined; title: string; timeFieldName: string | undefined; intervalName: string | undefined; sourceFilters: string | undefined; fields: string | undefined; fieldFormatMap: string | undefined; type: string | undefined; typeMeta: string | undefined; allowNoIndex: true | undefined; runtimeFieldMap: string | undefined; }" + "() => ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.IndexPatternAttributes", + "text": "IndexPatternAttributes" + } ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 311 + "lineNumber": 321 }, "deprecated": false, "children": [], @@ -4359,7 +4714,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 339 + "lineNumber": 347 }, "deprecated": false, "children": [ @@ -4397,7 +4752,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 340 + "lineNumber": 348 }, "deprecated": false, "isRequired": true @@ -4427,7 +4782,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 360 + "lineNumber": 368 }, "deprecated": false, "children": [ @@ -4445,7 +4800,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 360 + "lineNumber": 368 }, "deprecated": false, "isRequired": true @@ -4470,7 +4825,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 360 + "lineNumber": 368 }, "deprecated": false, "isRequired": true @@ -4492,7 +4847,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 384 + "lineNumber": 392 }, "deprecated": false, "children": [ @@ -4510,7 +4865,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 384 + "lineNumber": 392 }, "deprecated": false, "isRequired": true @@ -4540,7 +4895,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 404 + "lineNumber": 412 }, "deprecated": false, "children": [ @@ -4556,7 +4911,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 404 + "lineNumber": 412 }, "deprecated": false, "isRequired": true @@ -4584,7 +4939,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 411 + "lineNumber": 419 }, "deprecated": false, "children": [ @@ -4600,7 +4955,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 412 + "lineNumber": 420 }, "deprecated": false, "isRequired": true @@ -4617,7 +4972,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 413 + "lineNumber": 421 }, "deprecated": false, "isRequired": true @@ -4641,7 +4996,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 414 + "lineNumber": 422 }, "deprecated": false, "isRequired": true @@ -4661,7 +5016,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 422 + "lineNumber": 430 }, "deprecated": false, "children": [ @@ -4677,7 +5032,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 422 + "lineNumber": 430 }, "deprecated": false, "isRequired": true @@ -4694,7 +5049,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 422 + "lineNumber": 430 }, "deprecated": false, "isRequired": false @@ -4714,7 +5069,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 433 + "lineNumber": 441 }, "deprecated": false, "children": [ @@ -4730,7 +5085,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 433 + "lineNumber": 441 }, "deprecated": false, "isRequired": true @@ -4747,7 +5102,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 433 + "lineNumber": 441 }, "deprecated": false, "isRequired": false @@ -4775,7 +5130,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 446 + "lineNumber": 454 }, "deprecated": false, "children": [ @@ -4791,7 +5146,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 446 + "lineNumber": 454 }, "deprecated": false, "isRequired": true @@ -4815,7 +5170,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 446 + "lineNumber": 454 }, "deprecated": false, "isRequired": true @@ -4835,7 +5190,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 450 + "lineNumber": 458 }, "deprecated": false, "children": [ @@ -4851,7 +5206,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 450 + "lineNumber": 458 }, "deprecated": false, "isRequired": true @@ -6331,7 +6686,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 473 + "lineNumber": 480 }, "deprecated": false, "children": [ @@ -6347,7 +6702,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 473 + "lineNumber": 480 }, "deprecated": false, "isRequired": true @@ -6385,7 +6740,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 492 + "lineNumber": 499 }, "deprecated": false, "children": [ @@ -6407,7 +6762,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 492 + "lineNumber": 499 }, "deprecated": false, "isRequired": true @@ -6424,7 +6779,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 492 + "lineNumber": 499 }, "deprecated": false, "isRequired": true @@ -6464,7 +6819,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 517 + "lineNumber": 524 }, "deprecated": false, "children": [ @@ -6486,7 +6841,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 517 + "lineNumber": 524 }, "deprecated": false, "isRequired": true @@ -6505,7 +6860,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 517 + "lineNumber": 524 }, "deprecated": false, "isRequired": true @@ -6524,7 +6879,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 517 + "lineNumber": 524 }, "deprecated": false, "isRequired": true @@ -6562,7 +6917,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 530 + "lineNumber": 537 }, "deprecated": false, "children": [ @@ -6584,7 +6939,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 530 + "lineNumber": 537 }, "deprecated": false, "isRequired": true @@ -6603,7 +6958,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 530 + "lineNumber": 537 }, "deprecated": false, "isRequired": true @@ -6633,7 +6988,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 558 + "lineNumber": 570 }, "deprecated": false, "children": [ @@ -6655,7 +7010,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 559 + "lineNumber": 571 }, "deprecated": false, "isRequired": true @@ -6672,7 +7027,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 560 + "lineNumber": 572 }, "deprecated": false, "isRequired": true @@ -6689,7 +7044,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 561 + "lineNumber": 573 }, "deprecated": false, "isRequired": true @@ -6711,7 +7066,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 644 + "lineNumber": 656 }, "deprecated": false, "children": [ @@ -6729,7 +7084,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 644 + "lineNumber": 656 }, "deprecated": false, "isRequired": true @@ -6850,7 +7205,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 121 + "lineNumber": 127 }, "deprecated": false, "children": [ @@ -6866,7 +7221,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 129 + "lineNumber": 135 }, "deprecated": false }, @@ -6882,7 +7237,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 133 + "lineNumber": 139 }, "deprecated": false, "children": [ @@ -6904,7 +7259,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 133 + "lineNumber": 139 }, "deprecated": false, "isRequired": true @@ -6927,7 +7282,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 133 + "lineNumber": 139 }, "deprecated": false, "isRequired": true @@ -6949,7 +7304,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 151 + "lineNumber": 157 }, "deprecated": false, "children": [ @@ -6965,7 +7320,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 151 + "lineNumber": 157 }, "deprecated": false, "isRequired": true @@ -6995,7 +7350,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 160 + "lineNumber": 166 }, "deprecated": false, "children": [ @@ -7013,7 +7368,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 160 + "lineNumber": 166 }, "deprecated": false, "isRequired": true @@ -7039,7 +7394,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 160 + "lineNumber": 166 }, "deprecated": false, "isRequired": true @@ -7061,7 +7416,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 172 + "lineNumber": 178 }, "deprecated": false, "children": [ @@ -7079,7 +7434,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 172 + "lineNumber": 178 }, "deprecated": false, "isRequired": true @@ -7111,7 +7466,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 183 + "lineNumber": 189 }, "deprecated": false, "children": [ @@ -7135,7 +7490,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 183 + "lineNumber": 189 }, "deprecated": false, "isRequired": true @@ -7157,7 +7512,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 191 + "lineNumber": 197 }, "deprecated": false, "children": [], @@ -7184,7 +7539,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 198 + "lineNumber": 204 }, "deprecated": false, "children": [], @@ -7212,7 +7567,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 205 + "lineNumber": 211 }, "deprecated": false, "children": [ @@ -7228,7 +7583,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 205 + "lineNumber": 211 }, "deprecated": false, "isRequired": true @@ -7245,7 +7600,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 205 + "lineNumber": 211 }, "deprecated": false, "isRequired": true @@ -7275,7 +7630,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 216 + "lineNumber": 222 }, "deprecated": false, "children": [ @@ -7291,7 +7646,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 216 + "lineNumber": 222 }, "deprecated": false, "isRequired": true @@ -7320,7 +7675,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 223 + "lineNumber": 229 }, "deprecated": true, "references": [ @@ -7328,14 +7683,14 @@ "plugin": "discover", "link": { "path": "src/plugins/discover/public/application/embeddable/search_embeddable.ts", - "lineNumber": 206 + "lineNumber": 207 } }, { "plugin": "discover", "link": { "path": "src/plugins/discover/public/application/embeddable/search_embeddable.ts", - "lineNumber": 212 + "lineNumber": 213 } } ], @@ -7363,7 +7718,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 230 + "lineNumber": 236 }, "deprecated": false, "children": [], @@ -7390,7 +7745,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 244 + "lineNumber": 250 }, "deprecated": false, "children": [ @@ -7406,7 +7761,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 244 + "lineNumber": 250 }, "deprecated": false, "isRequired": true @@ -7446,7 +7801,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 256 + "lineNumber": 262 }, "deprecated": false, "children": [ @@ -7472,7 +7827,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 256 + "lineNumber": 262 }, "deprecated": false, "isRequired": false @@ -7497,7 +7852,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 256 + "lineNumber": 262 }, "deprecated": false, "isRequired": true @@ -7531,7 +7886,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 266 + "lineNumber": 272 }, "deprecated": false, "children": [], @@ -7571,7 +7926,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 274 + "lineNumber": 280 }, "deprecated": false, "children": [ @@ -7593,7 +7948,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 275 + "lineNumber": 281 }, "deprecated": false, "isRequired": true @@ -7627,7 +7982,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 312 + "lineNumber": 318 }, "deprecated": true, "references": [ @@ -7638,13 +7993,6 @@ "lineNumber": 77 } }, - { - "plugin": "discover", - "link": { - "path": "src/plugins/discover/public/application/angular/context/api/anchor.ts", - "lineNumber": 57 - } - }, { "plugin": "maps", "link": { @@ -7686,7 +8034,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 312 + "lineNumber": 318 }, "deprecated": false, "isRequired": true @@ -7726,7 +8074,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 325 + "lineNumber": 331 }, "deprecated": false, "children": [ @@ -7758,7 +8106,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 326 + "lineNumber": 332 }, "deprecated": false, "isRequired": true @@ -7780,7 +8128,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 334 + "lineNumber": 340 }, "deprecated": false, "children": [], @@ -7802,7 +8150,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 342 + "lineNumber": 348 }, "deprecated": false, "children": [], @@ -7829,7 +8177,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 831 + "lineNumber": 848 }, "deprecated": false, "children": [ @@ -7845,7 +8193,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 831 + "lineNumber": 848 }, "deprecated": false, "isRequired": true @@ -7869,7 +8217,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 860 + "lineNumber": 877 }, "deprecated": false, "children": [], @@ -8816,7 +9164,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 195 + "lineNumber": 196 }, "deprecated": false, "children": [ @@ -8845,7 +9193,7 @@ "section": "def-common.BUCKET_TYPES", "text": "BUCKET_TYPES" }, - ".FILTER>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\"> & Pick<{ geo_bounding_box?: string | undefined; filter?: string | undefined; }, \"geo_bounding_box\"> & Pick<{ geo_bounding_box?: string | undefined; filter?: string | undefined; }, \"filter\">, \"enabled\" | \"id\" | \"filter\" | \"customLabel\" | \"schema\" | \"geo_bounding_box\" | \"json\">, ", + ".FILTER>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\"> & Pick<{ geo_bounding_box?: string | undefined; filter?: string | undefined; }, \"geo_bounding_box\"> & Pick<{ geo_bounding_box?: string | undefined; filter?: string | undefined; }, \"filter\">, \"enabled\" | \"id\" | \"filter\" | \"customLabel\" | \"schema\" | \"geo_bounding_box\" | \"json\" | \"timeShift\">, ", "AggExpressionType", ", ", { @@ -8869,7 +9217,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 196 + "lineNumber": 197 }, "deprecated": false }, @@ -8898,7 +9246,7 @@ "section": "def-common.BUCKET_TYPES", "text": "BUCKET_TYPES" }, - ".FILTERS>, \"enabled\" | \"id\" | \"schema\" | \"json\"> & Pick<{ filters?: string | undefined; }, \"filters\"> & Pick<{ filters?: string | undefined; }, never>, \"enabled\" | \"filters\" | \"id\" | \"schema\" | \"json\">, ", + ".FILTERS>, \"enabled\" | \"id\" | \"schema\" | \"json\" | \"timeShift\"> & Pick<{ filters?: string | undefined; }, \"filters\"> & Pick<{ filters?: string | undefined; }, never>, \"enabled\" | \"filters\" | \"id\" | \"schema\" | \"json\" | \"timeShift\">, ", "AggExpressionType", ", ", { @@ -8922,7 +9270,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 197 + "lineNumber": 198 }, "deprecated": false }, @@ -8975,7 +9323,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 198 + "lineNumber": 199 }, "deprecated": false }, @@ -9004,7 +9352,7 @@ "section": "def-common.BUCKET_TYPES", "text": "BUCKET_TYPES" }, - ".IP_RANGE>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"field\"> & Pick<{ ranges?: string | undefined; ipRangeType?: string | undefined; }, \"ipRangeType\" | \"ranges\"> & Pick<{ ranges?: string | undefined; ipRangeType?: string | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"field\" | \"ipRangeType\" | \"ranges\">, ", + ".IP_RANGE>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\"> & Pick<{ ranges?: string | undefined; ipRangeType?: string | undefined; }, \"ipRangeType\" | \"ranges\"> & Pick<{ ranges?: string | undefined; ipRangeType?: string | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\" | \"ipRangeType\" | \"ranges\">, ", "AggExpressionType", ", ", { @@ -9028,7 +9376,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 199 + "lineNumber": 200 }, "deprecated": false }, @@ -9057,7 +9405,7 @@ "section": "def-common.BUCKET_TYPES", "text": "BUCKET_TYPES" }, - ".DATE_RANGE>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"field\" | \"time_zone\"> & Pick<{ ranges?: string | undefined; }, \"ranges\"> & Pick<{ ranges?: string | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"field\" | \"ranges\" | \"time_zone\">, ", + ".DATE_RANGE>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\" | \"time_zone\"> & Pick<{ ranges?: string | undefined; }, \"ranges\"> & Pick<{ ranges?: string | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\" | \"ranges\" | \"time_zone\">, ", "AggExpressionType", ", ", { @@ -9081,7 +9429,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 200 + "lineNumber": 201 }, "deprecated": false }, @@ -9110,7 +9458,7 @@ "section": "def-common.BUCKET_TYPES", "text": "BUCKET_TYPES" }, - ".RANGE>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"field\"> & Pick<{ ranges?: string | undefined; }, \"ranges\"> & Pick<{ ranges?: string | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"field\" | \"ranges\">, ", + ".RANGE>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\"> & Pick<{ ranges?: string | undefined; }, \"ranges\"> & Pick<{ ranges?: string | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\" | \"ranges\">, ", "AggExpressionType", ", ", { @@ -9134,7 +9482,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 201 + "lineNumber": 202 }, "deprecated": false }, @@ -9187,7 +9535,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 202 + "lineNumber": 203 }, "deprecated": false }, @@ -9216,7 +9564,7 @@ "section": "def-common.BUCKET_TYPES", "text": "BUCKET_TYPES" }, - ".GEOHASH_GRID>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"field\" | \"autoPrecision\" | \"precision\" | \"useGeocentroid\" | \"isFilteredByCollar\"> & Pick<{ boundingBox?: string | undefined; }, \"boundingBox\"> & Pick<{ boundingBox?: string | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"field\" | \"autoPrecision\" | \"precision\" | \"useGeocentroid\" | \"isFilteredByCollar\" | \"boundingBox\">, ", + ".GEOHASH_GRID>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\" | \"autoPrecision\" | \"precision\" | \"useGeocentroid\" | \"isFilteredByCollar\"> & Pick<{ boundingBox?: string | undefined; }, \"boundingBox\"> & Pick<{ boundingBox?: string | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\" | \"autoPrecision\" | \"precision\" | \"useGeocentroid\" | \"isFilteredByCollar\" | \"boundingBox\">, ", "AggExpressionType", ", ", { @@ -9240,7 +9588,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 203 + "lineNumber": 204 }, "deprecated": false }, @@ -9269,7 +9617,7 @@ "section": "def-common.BUCKET_TYPES", "text": "BUCKET_TYPES" }, - ".HISTOGRAM>, \"enabled\" | \"interval\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"field\" | \"used_interval\" | \"maxBars\" | \"intervalBase\" | \"min_doc_count\" | \"has_extended_bounds\"> & Pick<{ extended_bounds?: string | undefined; }, \"extended_bounds\"> & Pick<{ extended_bounds?: string | undefined; }, never>, \"enabled\" | \"interval\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"field\" | \"used_interval\" | \"maxBars\" | \"intervalBase\" | \"min_doc_count\" | \"has_extended_bounds\" | \"extended_bounds\">, ", + ".HISTOGRAM>, \"enabled\" | \"interval\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\" | \"used_interval\" | \"maxBars\" | \"intervalBase\" | \"min_doc_count\" | \"has_extended_bounds\"> & Pick<{ extended_bounds?: string | undefined; }, \"extended_bounds\"> & Pick<{ extended_bounds?: string | undefined; }, never>, \"enabled\" | \"interval\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\" | \"used_interval\" | \"maxBars\" | \"intervalBase\" | \"min_doc_count\" | \"has_extended_bounds\" | \"extended_bounds\">, ", "AggExpressionType", ", ", { @@ -9293,7 +9641,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 204 + "lineNumber": 205 }, "deprecated": false }, @@ -9322,7 +9670,7 @@ "section": "def-common.BUCKET_TYPES", "text": "BUCKET_TYPES" }, - ".DATE_HISTOGRAM>, \"enabled\" | \"interval\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"field\" | \"time_zone\" | \"used_interval\" | \"min_doc_count\" | \"useNormalizedEsInterval\" | \"scaleMetricValues\" | \"used_time_zone\" | \"drop_partials\" | \"format\"> & Pick<{ timeRange?: string | undefined; extended_bounds?: string | undefined; }, \"timeRange\" | \"extended_bounds\"> & Pick<{ timeRange?: string | undefined; extended_bounds?: string | undefined; }, never>, \"enabled\" | \"interval\" | \"timeRange\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"field\" | \"time_zone\" | \"used_interval\" | \"min_doc_count\" | \"extended_bounds\" | \"useNormalizedEsInterval\" | \"scaleMetricValues\" | \"used_time_zone\" | \"drop_partials\" | \"format\">, ", + ".DATE_HISTOGRAM>, \"enabled\" | \"interval\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\" | \"time_zone\" | \"used_interval\" | \"min_doc_count\" | \"useNormalizedEsInterval\" | \"scaleMetricValues\" | \"used_time_zone\" | \"drop_partials\" | \"format\"> & Pick<{ timeRange?: string | undefined; extended_bounds?: string | undefined; }, \"timeRange\" | \"extended_bounds\"> & Pick<{ timeRange?: string | undefined; extended_bounds?: string | undefined; }, never>, \"enabled\" | \"interval\" | \"timeRange\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\" | \"time_zone\" | \"used_interval\" | \"min_doc_count\" | \"extended_bounds\" | \"useNormalizedEsInterval\" | \"scaleMetricValues\" | \"used_time_zone\" | \"drop_partials\" | \"format\">, ", "AggExpressionType", ", ", { @@ -9346,7 +9694,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 205 + "lineNumber": 206 }, "deprecated": false }, @@ -9375,11 +9723,11 @@ "section": "def-common.BUCKET_TYPES", "text": "BUCKET_TYPES" }, - ".TERMS>, \"enabled\" | \"id\" | \"size\" | \"customLabel\" | \"schema\" | \"json\" | \"field\" | \"orderBy\" | \"order\" | \"missingBucket\" | \"missingBucketLabel\" | \"otherBucket\" | \"otherBucketLabel\" | \"exclude\" | \"include\"> & Pick<{ orderAgg?: ", + ".TERMS>, \"enabled\" | \"id\" | \"size\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\" | \"orderBy\" | \"order\" | \"missingBucket\" | \"missingBucketLabel\" | \"otherBucket\" | \"otherBucketLabel\" | \"exclude\" | \"include\"> & Pick<{ orderAgg?: ", "AggExpressionType", " | undefined; }, \"orderAgg\"> & Pick<{ orderAgg?: ", "AggExpressionType", - " | undefined; }, never>, \"enabled\" | \"id\" | \"size\" | \"customLabel\" | \"schema\" | \"json\" | \"field\" | \"orderBy\" | \"orderAgg\" | \"order\" | \"missingBucket\" | \"missingBucketLabel\" | \"otherBucket\" | \"otherBucketLabel\" | \"exclude\" | \"include\">, ", + " | undefined; }, never>, \"enabled\" | \"id\" | \"size\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\" | \"orderBy\" | \"orderAgg\" | \"order\" | \"missingBucket\" | \"missingBucketLabel\" | \"otherBucket\" | \"otherBucketLabel\" | \"exclude\" | \"include\">, ", "AggExpressionType", ", ", { @@ -9403,7 +9751,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 206 + "lineNumber": 207 }, "deprecated": false }, @@ -9456,7 +9804,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 207 + "lineNumber": 208 }, "deprecated": false }, @@ -9485,7 +9833,7 @@ "section": "def-common.METRIC_TYPES", "text": "METRIC_TYPES" }, - ".AVG_BUCKET>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\"> & Pick<{ customBucket?: ", + ".AVG_BUCKET>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\"> & Pick<{ customBucket?: ", "AggExpressionType", " | undefined; customMetric?: ", "AggExpressionType", @@ -9493,7 +9841,7 @@ "AggExpressionType", " | undefined; customMetric?: ", "AggExpressionType", - " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"customMetric\" | \"customBucket\">, ", + " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"customMetric\" | \"customBucket\">, ", "AggExpressionType", ", ", { @@ -9517,7 +9865,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 208 + "lineNumber": 209 }, "deprecated": false }, @@ -9546,7 +9894,7 @@ "section": "def-common.METRIC_TYPES", "text": "METRIC_TYPES" }, - ".MAX_BUCKET>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\"> & Pick<{ customBucket?: ", + ".MAX_BUCKET>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\"> & Pick<{ customBucket?: ", "AggExpressionType", " | undefined; customMetric?: ", "AggExpressionType", @@ -9554,7 +9902,7 @@ "AggExpressionType", " | undefined; customMetric?: ", "AggExpressionType", - " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"customMetric\" | \"customBucket\">, ", + " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"customMetric\" | \"customBucket\">, ", "AggExpressionType", ", ", { @@ -9578,7 +9926,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 209 + "lineNumber": 210 }, "deprecated": false }, @@ -9607,7 +9955,7 @@ "section": "def-common.METRIC_TYPES", "text": "METRIC_TYPES" }, - ".MIN_BUCKET>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\"> & Pick<{ customBucket?: ", + ".MIN_BUCKET>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\"> & Pick<{ customBucket?: ", "AggExpressionType", " | undefined; customMetric?: ", "AggExpressionType", @@ -9615,7 +9963,7 @@ "AggExpressionType", " | undefined; customMetric?: ", "AggExpressionType", - " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"customMetric\" | \"customBucket\">, ", + " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"customMetric\" | \"customBucket\">, ", "AggExpressionType", ", ", { @@ -9639,7 +9987,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 210 + "lineNumber": 211 }, "deprecated": false }, @@ -9668,7 +10016,7 @@ "section": "def-common.METRIC_TYPES", "text": "METRIC_TYPES" }, - ".SUM_BUCKET>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\"> & Pick<{ customBucket?: ", + ".SUM_BUCKET>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\"> & Pick<{ customBucket?: ", "AggExpressionType", " | undefined; customMetric?: ", "AggExpressionType", @@ -9676,7 +10024,7 @@ "AggExpressionType", " | undefined; customMetric?: ", "AggExpressionType", - " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"customMetric\" | \"customBucket\">, ", + " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"customMetric\" | \"customBucket\">, ", "AggExpressionType", ", ", { @@ -9700,7 +10048,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 211 + "lineNumber": 212 }, "deprecated": false }, @@ -9729,7 +10077,7 @@ "section": "def-common.METRIC_TYPES", "text": "METRIC_TYPES" }, - ".FILTERED_METRIC>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\"> & Pick<{ customBucket?: ", + ".FILTERED_METRIC>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\"> & Pick<{ customBucket?: ", "AggExpressionType", " | undefined; customMetric?: ", "AggExpressionType", @@ -9737,7 +10085,7 @@ "AggExpressionType", " | undefined; customMetric?: ", "AggExpressionType", - " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"customMetric\" | \"customBucket\">, ", + " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"customMetric\" | \"customBucket\">, ", "AggExpressionType", ", ", { @@ -9761,7 +10109,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 212 + "lineNumber": 213 }, "deprecated": false }, @@ -9814,7 +10162,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 213 + "lineNumber": 214 }, "deprecated": false }, @@ -9867,7 +10215,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 214 + "lineNumber": 215 }, "deprecated": false }, @@ -9896,11 +10244,11 @@ "section": "def-common.METRIC_TYPES", "text": "METRIC_TYPES" }, - ".CUMULATIVE_SUM>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"buckets_path\" | \"metricAgg\"> & Pick<{ customMetric?: ", + ".CUMULATIVE_SUM>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"buckets_path\" | \"metricAgg\"> & Pick<{ customMetric?: ", "AggExpressionType", " | undefined; }, \"customMetric\"> & Pick<{ customMetric?: ", "AggExpressionType", - " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"customMetric\" | \"buckets_path\" | \"metricAgg\">, ", + " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"customMetric\" | \"buckets_path\" | \"metricAgg\">, ", "AggExpressionType", ", ", { @@ -9924,7 +10272,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 215 + "lineNumber": 216 }, "deprecated": false }, @@ -9953,11 +10301,11 @@ "section": "def-common.METRIC_TYPES", "text": "METRIC_TYPES" }, - ".DERIVATIVE>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"buckets_path\" | \"metricAgg\"> & Pick<{ customMetric?: ", + ".DERIVATIVE>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"buckets_path\" | \"metricAgg\"> & Pick<{ customMetric?: ", "AggExpressionType", " | undefined; }, \"customMetric\"> & Pick<{ customMetric?: ", "AggExpressionType", - " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"customMetric\" | \"buckets_path\" | \"metricAgg\">, ", + " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"customMetric\" | \"buckets_path\" | \"metricAgg\">, ", "AggExpressionType", ", ", { @@ -9981,7 +10329,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 216 + "lineNumber": 217 }, "deprecated": false }, @@ -10034,7 +10382,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 217 + "lineNumber": 218 }, "deprecated": false }, @@ -10087,7 +10435,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 218 + "lineNumber": 219 }, "deprecated": false }, @@ -10140,7 +10488,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 219 + "lineNumber": 220 }, "deprecated": false }, @@ -10193,7 +10541,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 220 + "lineNumber": 221 }, "deprecated": false }, @@ -10246,7 +10594,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 221 + "lineNumber": 222 }, "deprecated": false }, @@ -10299,7 +10647,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 222 + "lineNumber": 223 }, "deprecated": false }, @@ -10328,11 +10676,11 @@ "section": "def-common.METRIC_TYPES", "text": "METRIC_TYPES" }, - ".MOVING_FN>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"buckets_path\" | \"metricAgg\" | \"window\" | \"script\"> & Pick<{ customMetric?: ", + ".MOVING_FN>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"buckets_path\" | \"metricAgg\" | \"window\" | \"script\"> & Pick<{ customMetric?: ", "AggExpressionType", " | undefined; }, \"customMetric\"> & Pick<{ customMetric?: ", "AggExpressionType", - " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"customMetric\" | \"buckets_path\" | \"metricAgg\" | \"window\" | \"script\">, ", + " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"customMetric\" | \"buckets_path\" | \"metricAgg\" | \"window\" | \"script\">, ", "AggExpressionType", ", ", { @@ -10356,7 +10704,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 223 + "lineNumber": 224 }, "deprecated": false }, @@ -10409,7 +10757,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 224 + "lineNumber": 225 }, "deprecated": false }, @@ -10462,7 +10810,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 225 + "lineNumber": 226 }, "deprecated": false }, @@ -10491,11 +10839,11 @@ "section": "def-common.METRIC_TYPES", "text": "METRIC_TYPES" }, - ".SERIAL_DIFF>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"buckets_path\" | \"metricAgg\"> & Pick<{ customMetric?: ", + ".SERIAL_DIFF>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"buckets_path\" | \"metricAgg\"> & Pick<{ customMetric?: ", "AggExpressionType", " | undefined; }, \"customMetric\"> & Pick<{ customMetric?: ", "AggExpressionType", - " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"customMetric\" | \"buckets_path\" | \"metricAgg\">, ", + " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"customMetric\" | \"buckets_path\" | \"metricAgg\">, ", "AggExpressionType", ", ", { @@ -10519,7 +10867,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 226 + "lineNumber": 227 }, "deprecated": false }, @@ -10572,7 +10920,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 227 + "lineNumber": 228 }, "deprecated": false }, @@ -10625,7 +10973,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 228 + "lineNumber": 229 }, "deprecated": false }, @@ -10678,7 +11026,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 229 + "lineNumber": 230 }, "deprecated": false } @@ -11531,7 +11879,7 @@ "plugin": "discover", "link": { "path": "src/plugins/discover/public/application/embeddable/search_embeddable.ts", - "lineNumber": 58 + "lineNumber": 59 } }, { @@ -12882,28 +13230,28 @@ "plugin": "lens", "link": { "path": "x-pack/plugins/lens/server/routes/field_stats.ts", - "lineNumber": 139 + "lineNumber": 140 } }, { "plugin": "lens", "link": { "path": "x-pack/plugins/lens/server/routes/field_stats.ts", - "lineNumber": 248 + "lineNumber": 249 } }, { "plugin": "lens", "link": { "path": "x-pack/plugins/lens/server/routes/field_stats.ts", - "lineNumber": 287 + "lineNumber": 289 } }, { "plugin": "lens", "link": { "path": "x-pack/plugins/lens/server/routes/field_stats.ts", - "lineNumber": 329 + "lineNumber": 331 } }, { @@ -14340,6 +14688,20 @@ "lineNumber": 85 } }, + { + "plugin": "lens", + "link": { + "path": "x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/terms/index.tsx", + "lineNumber": 25 + } + }, + { + "plugin": "lens", + "link": { + "path": "x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/terms/index.tsx", + "lineNumber": 102 + } + }, { "plugin": "lens", "link": { @@ -14445,20 +14807,6 @@ "lineNumber": 30 } }, - { - "plugin": "apm", - "link": { - "path": "x-pack/plugins/apm/public/components/shared/KueryBar/index.tsx", - "lineNumber": 14 - } - }, - { - "plugin": "apm", - "link": { - "path": "x-pack/plugins/apm/public/components/shared/KueryBar/index.tsx", - "lineNumber": 31 - } - }, { "plugin": "infra", "link": { @@ -14627,6 +14975,20 @@ "lineNumber": 23 } }, + { + "plugin": "apm", + "link": { + "path": "x-pack/plugins/apm/public/components/shared/KueryBar/index.tsx", + "lineNumber": 14 + } + }, + { + "plugin": "apm", + "link": { + "path": "x-pack/plugins/apm/public/components/shared/KueryBar/index.tsx", + "lineNumber": 31 + } + }, { "plugin": "lists", "link": { @@ -14659,21 +15021,21 @@ "plugin": "securitySolution", "link": { "path": "x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/types.ts", - "lineNumber": 21 + "lineNumber": 22 } }, { "plugin": "securitySolution", "link": { "path": "x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/types.ts", - "lineNumber": 66 + "lineNumber": 72 } }, { "plugin": "securitySolution", "link": { "path": "x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/action.ts", - "lineNumber": 19 + "lineNumber": 20 } }, { @@ -14932,21 +15294,21 @@ "plugin": "securitySolution", "link": { "path": "x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts", - "lineNumber": 44 + "lineNumber": 48 } }, { "plugin": "securitySolution", "link": { "path": "x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts", - "lineNumber": 60 + "lineNumber": 64 } }, { "plugin": "securitySolution", "link": { "path": "x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts", - "lineNumber": 65 + "lineNumber": 69 } }, { @@ -15733,6 +16095,20 @@ "lineNumber": 30 } }, + { + "plugin": "securitySolution", + "link": { + "path": "x-pack/plugins/security_solution/server/lib/detection_engine/reference_rules/query.ts", + "lineNumber": 13 + } + }, + { + "plugin": "securitySolution", + "link": { + "path": "x-pack/plugins/security_solution/server/lib/detection_engine/reference_rules/query.ts", + "lineNumber": 52 + } + }, { "plugin": "stackAlerts", "link": { @@ -15936,20 +16312,6 @@ "lineNumber": 1352 } }, - { - "plugin": "discover", - "link": { - "path": "src/plugins/discover/public/application/components/context_app/context_app_legacy.tsx", - "lineNumber": 17 - } - }, - { - "plugin": "discover", - "link": { - "path": "src/plugins/discover/public/application/components/context_app/context_app_legacy.tsx", - "lineNumber": 26 - } - }, { "plugin": "maps", "link": { @@ -15961,7 +16323,7 @@ "plugin": "maps", "link": { "path": "x-pack/plugins/maps/public/embeddable/types.ts", - "lineNumber": 45 + "lineNumber": 44 } }, { @@ -16066,14 +16428,14 @@ "plugin": "observability", "link": { "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/types.ts", - "lineNumber": 18 + "lineNumber": 19 } }, { "plugin": "observability", "link": { "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/types.ts", - "lineNumber": 95 + "lineNumber": 104 } }, { @@ -16115,7 +16477,7 @@ "plugin": "observability", "link": { "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/default_configs.ts", - "lineNumber": 24 + "lineNumber": 25 } }, { @@ -19028,7 +19390,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 43 + "lineNumber": 45 }, "deprecated": false, "initialIsOpen": false @@ -19041,7 +19403,7 @@ "label": "AggGroupName", "description": [], "signature": [ - "\"buckets\" | \"metrics\" | \"none\"" + "\"none\" | \"buckets\" | \"metrics\"" ], "source": { "path": "src/plugins/data/common/search/aggs/agg_groups.ts", @@ -19773,7 +20135,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 53 + "lineNumber": 55 }, "deprecated": false, "initialIsOpen": false @@ -20132,7 +20494,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/metrics/metric_agg_type.ts", - "lineNumber": 35 + "lineNumber": 36 }, "deprecated": false, "initialIsOpen": false @@ -20359,7 +20721,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 650 + "lineNumber": 662 }, "deprecated": false, "initialIsOpen": false @@ -23530,7 +23892,7 @@ ], "source": { "path": "src/plugins/data/common/es_query/es_query/build_es_query.ts", - "lineNumber": 33 + "lineNumber": 39 }, "deprecated": false }, @@ -23561,7 +23923,7 @@ ], "source": { "path": "src/plugins/data/common/es_query/es_query/build_es_query.ts", - "lineNumber": 34 + "lineNumber": 40 }, "deprecated": false }, @@ -23592,7 +23954,7 @@ ], "source": { "path": "src/plugins/data/common/es_query/es_query/build_es_query.ts", - "lineNumber": 35 + "lineNumber": 41 }, "deprecated": false }, @@ -23614,7 +23976,7 @@ ], "source": { "path": "src/plugins/data/common/es_query/es_query/build_es_query.ts", - "lineNumber": 36 + "lineNumber": 42 }, "deprecated": false } @@ -25922,7 +26284,7 @@ "section": "def-public.QuerySuggestionGetFn", "text": "QuerySuggestionGetFn" }, - "; }" + "; getAutocompleteSettings: () => { terminateAfter: number; timeout: number; }; }" ], "source": { "path": "src/plugins/data/public/types.ts", @@ -26699,7 +27061,7 @@ "section": "def-server.PluginInitializerContext", "text": "PluginInitializerContext" }, - "; }>; }>; autocomplete: Readonly<{} & { querySuggestions: Readonly<{} & { enabled: boolean; }>; valueSuggestions: Readonly<{} & { enabled: boolean; }>; }>; }>>" + "; }>; }>; autocomplete: Readonly<{} & { querySuggestions: Readonly<{} & { enabled: boolean; }>; valueSuggestions: Readonly<{} & { enabled: boolean; timeout: moment.Duration; terminateAfter: moment.Duration; }>; }>; }>>" ], "source": { "path": "src/plugins/data/server/plugin.ts", @@ -27533,7 +27895,9 @@ "parentPluginId": "data", "id": "def-server.IndexPattern.addScriptedField", "type": "Function", - "tags": [], + "tags": [ + "deprecated" + ], "label": "addScriptedField", "description": [ "\nAdd scripted field to field list\n" @@ -27543,9 +27907,10 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 244 + "lineNumber": 245 }, - "deprecated": false, + "deprecated": true, + "references": [], "children": [ { "parentPluginId": "data", @@ -27561,7 +27926,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 244 + "lineNumber": 245 }, "deprecated": false, "isRequired": true @@ -27580,7 +27945,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 244 + "lineNumber": 245 }, "deprecated": false, "isRequired": true @@ -27597,7 +27962,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 244 + "lineNumber": 245 }, "deprecated": false, "isRequired": true @@ -27609,7 +27974,9 @@ "parentPluginId": "data", "id": "def-server.IndexPattern.removeScriptedField", "type": "Function", - "tags": [], + "tags": [ + "deprecated" + ], "label": "removeScriptedField", "description": [ "\nRemove scripted field from field list" @@ -27619,9 +27986,25 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 270 + "lineNumber": 272 }, - "deprecated": false, + "deprecated": true, + "references": [ + { + "plugin": "indexPatternManagement", + "link": { + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/scripted_fields_table.tsx", + "lineNumber": 117 + } + }, + { + "plugin": "indexPatternManagement", + "link": { + "path": "src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx", + "lineNumber": 777 + } + } + ], "children": [ { "parentPluginId": "data", @@ -27635,7 +28018,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 270 + "lineNumber": 272 }, "deprecated": false, "isRequired": true @@ -27647,9 +28030,13 @@ "parentPluginId": "data", "id": "def-server.IndexPattern.getNonScriptedFields", "type": "Function", - "tags": [], + "tags": [ + "deprecated" + ], "label": "getNonScriptedFields", - "description": [], + "description": [ + "\n" + ], "signature": [ "() => ", { @@ -27663,9 +28050,74 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 277 + "lineNumber": 283 }, - "deprecated": false, + "deprecated": true, + "references": [ + { + "plugin": "indexPatternManagement", + "link": { + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/table/table.tsx", + "lineNumber": 152 + } + }, + { + "plugin": "indexPatternManagement", + "link": { + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx", + "lineNumber": 66 + } + }, + { + "plugin": "indexPatternManagement", + "link": { + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx", + "lineNumber": 74 + } + }, + { + "plugin": "indexPatternManagement", + "link": { + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx", + "lineNumber": 204 + } + }, + { + "plugin": "visTypeTimeseries", + "link": { + "path": "src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/abstract_search_strategy.ts", + "lineNumber": 65 + } + }, + { + "plugin": "graph", + "link": { + "path": "x-pack/plugins/graph/public/services/persistence/deserialize.ts", + "lineNumber": 106 + } + }, + { + "plugin": "graph", + "link": { + "path": "x-pack/plugins/graph/public/state_management/datasource.test.ts", + "lineNumber": 29 + } + }, + { + "plugin": "graph", + "link": { + "path": "x-pack/plugins/graph/public/services/persistence/deserialize.test.ts", + "lineNumber": 122 + } + }, + { + "plugin": "graph", + "link": { + "path": "x-pack/plugins/graph/public/services/persistence/deserialize.test.ts", + "lineNumber": 244 + } + } + ], "children": [], "returnComment": [] }, @@ -27673,9 +28125,13 @@ "parentPluginId": "data", "id": "def-server.IndexPattern.getScriptedFields", "type": "Function", - "tags": [], + "tags": [ + "deprecated" + ], "label": "getScriptedFields", - "description": [], + "description": [ + "\n" + ], "signature": [ "() => ", { @@ -27689,9 +28145,18 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 281 + "lineNumber": 291 }, - "deprecated": false, + "deprecated": true, + "references": [ + { + "plugin": "indexPatternManagement", + "link": { + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/scripted_fields_table.tsx", + "lineNumber": 61 + } + } + ], "children": [], "returnComment": [] }, @@ -27707,7 +28172,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 285 + "lineNumber": 295 }, "deprecated": false, "children": [], @@ -27725,7 +28190,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 289 + "lineNumber": 299 }, "deprecated": false, "children": [], @@ -27751,7 +28216,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 294 + "lineNumber": 304 }, "deprecated": false, "children": [], @@ -27777,7 +28242,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 299 + "lineNumber": 309 }, "deprecated": false, "children": [ @@ -27793,7 +28258,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 299 + "lineNumber": 309 }, "deprecated": false, "isRequired": true @@ -27813,7 +28278,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 304 + "lineNumber": 314 }, "deprecated": false, "children": [], @@ -27829,11 +28294,18 @@ "\nReturns index pattern as saved object body for saving" ], "signature": [ - "() => { fieldAttrs: string | undefined; title: string; timeFieldName: string | undefined; intervalName: string | undefined; sourceFilters: string | undefined; fields: string | undefined; fieldFormatMap: string | undefined; type: string | undefined; typeMeta: string | undefined; allowNoIndex: true | undefined; runtimeFieldMap: string | undefined; }" + "() => ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.IndexPatternAttributes", + "text": "IndexPatternAttributes" + } ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 311 + "lineNumber": 321 }, "deprecated": false, "children": [], @@ -27884,7 +28356,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 339 + "lineNumber": 347 }, "deprecated": false, "children": [ @@ -27922,7 +28394,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 340 + "lineNumber": 348 }, "deprecated": false, "isRequired": true @@ -27952,7 +28424,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 360 + "lineNumber": 368 }, "deprecated": false, "children": [ @@ -27970,7 +28442,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 360 + "lineNumber": 368 }, "deprecated": false, "isRequired": true @@ -27995,7 +28467,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 360 + "lineNumber": 368 }, "deprecated": false, "isRequired": true @@ -28017,7 +28489,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 384 + "lineNumber": 392 }, "deprecated": false, "children": [ @@ -28035,7 +28507,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 384 + "lineNumber": 392 }, "deprecated": false, "isRequired": true @@ -28065,7 +28537,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 404 + "lineNumber": 412 }, "deprecated": false, "children": [ @@ -28081,7 +28553,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 404 + "lineNumber": 412 }, "deprecated": false, "isRequired": true @@ -28109,7 +28581,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 411 + "lineNumber": 419 }, "deprecated": false, "children": [ @@ -28125,7 +28597,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 412 + "lineNumber": 420 }, "deprecated": false, "isRequired": true @@ -28142,7 +28614,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 413 + "lineNumber": 421 }, "deprecated": false, "isRequired": true @@ -28166,7 +28638,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 414 + "lineNumber": 422 }, "deprecated": false, "isRequired": true @@ -28186,7 +28658,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 422 + "lineNumber": 430 }, "deprecated": false, "children": [ @@ -28202,7 +28674,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 422 + "lineNumber": 430 }, "deprecated": false, "isRequired": true @@ -28219,7 +28691,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 422 + "lineNumber": 430 }, "deprecated": false, "isRequired": false @@ -28239,7 +28711,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 433 + "lineNumber": 441 }, "deprecated": false, "children": [ @@ -28255,7 +28727,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 433 + "lineNumber": 441 }, "deprecated": false, "isRequired": true @@ -28272,7 +28744,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 433 + "lineNumber": 441 }, "deprecated": false, "isRequired": false @@ -28300,7 +28772,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 446 + "lineNumber": 454 }, "deprecated": false, "children": [ @@ -28316,7 +28788,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 446 + "lineNumber": 454 }, "deprecated": false, "isRequired": true @@ -28340,7 +28812,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 446 + "lineNumber": 454 }, "deprecated": false, "isRequired": true @@ -28360,7 +28832,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 450 + "lineNumber": 458 }, "deprecated": false, "children": [ @@ -28376,7 +28848,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 450 + "lineNumber": 458 }, "deprecated": false, "isRequired": true @@ -29199,7 +29671,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 473 + "lineNumber": 480 }, "deprecated": false, "children": [ @@ -29215,7 +29687,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 473 + "lineNumber": 480 }, "deprecated": false, "isRequired": true @@ -29253,7 +29725,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 492 + "lineNumber": 499 }, "deprecated": false, "children": [ @@ -29275,7 +29747,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 492 + "lineNumber": 499 }, "deprecated": false, "isRequired": true @@ -29292,7 +29764,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 492 + "lineNumber": 499 }, "deprecated": false, "isRequired": true @@ -29332,7 +29804,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 517 + "lineNumber": 524 }, "deprecated": false, "children": [ @@ -29354,7 +29826,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 517 + "lineNumber": 524 }, "deprecated": false, "isRequired": true @@ -29373,7 +29845,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 517 + "lineNumber": 524 }, "deprecated": false, "isRequired": true @@ -29392,7 +29864,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 517 + "lineNumber": 524 }, "deprecated": false, "isRequired": true @@ -29430,7 +29902,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 530 + "lineNumber": 537 }, "deprecated": false, "children": [ @@ -29452,7 +29924,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 530 + "lineNumber": 537 }, "deprecated": false, "isRequired": true @@ -29471,7 +29943,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 530 + "lineNumber": 537 }, "deprecated": false, "isRequired": true @@ -29501,7 +29973,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 558 + "lineNumber": 570 }, "deprecated": false, "children": [ @@ -29523,7 +29995,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 559 + "lineNumber": 571 }, "deprecated": false, "isRequired": true @@ -29540,7 +30012,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 560 + "lineNumber": 572 }, "deprecated": false, "isRequired": true @@ -29557,7 +30029,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 561 + "lineNumber": 573 }, "deprecated": false, "isRequired": true @@ -29579,7 +30051,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 644 + "lineNumber": 656 }, "deprecated": false, "children": [ @@ -29597,7 +30069,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 644 + "lineNumber": 656 }, "deprecated": false, "isRequired": true @@ -30420,7 +30892,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 473 + "lineNumber": 480 }, "deprecated": false, "children": [ @@ -30436,7 +30908,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 473 + "lineNumber": 480 }, "deprecated": false, "isRequired": true @@ -30474,7 +30946,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 492 + "lineNumber": 499 }, "deprecated": false, "children": [ @@ -30496,7 +30968,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 492 + "lineNumber": 499 }, "deprecated": false, "isRequired": true @@ -30513,7 +30985,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 492 + "lineNumber": 499 }, "deprecated": false, "isRequired": true @@ -30553,7 +31025,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 517 + "lineNumber": 524 }, "deprecated": false, "children": [ @@ -30575,7 +31047,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 517 + "lineNumber": 524 }, "deprecated": false, "isRequired": true @@ -30594,7 +31066,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 517 + "lineNumber": 524 }, "deprecated": false, "isRequired": true @@ -30613,7 +31085,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 517 + "lineNumber": 524 }, "deprecated": false, "isRequired": true @@ -30651,7 +31123,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 530 + "lineNumber": 537 }, "deprecated": false, "children": [ @@ -30673,7 +31145,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 530 + "lineNumber": 537 }, "deprecated": false, "isRequired": true @@ -30692,7 +31164,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 530 + "lineNumber": 537 }, "deprecated": false, "isRequired": true @@ -30722,7 +31194,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 558 + "lineNumber": 570 }, "deprecated": false, "children": [ @@ -30744,7 +31216,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 559 + "lineNumber": 571 }, "deprecated": false, "isRequired": true @@ -30761,7 +31233,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 560 + "lineNumber": 572 }, "deprecated": false, "isRequired": true @@ -30778,7 +31250,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 561 + "lineNumber": 573 }, "deprecated": false, "isRequired": true @@ -30800,7 +31272,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 644 + "lineNumber": 656 }, "deprecated": false, "children": [ @@ -30818,7 +31290,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 644 + "lineNumber": 656 }, "deprecated": false, "isRequired": true @@ -31168,7 +31640,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 195 + "lineNumber": 196 }, "deprecated": false, "children": [ @@ -31197,7 +31669,7 @@ "section": "def-common.BUCKET_TYPES", "text": "BUCKET_TYPES" }, - ".FILTER>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\"> & Pick<{ geo_bounding_box?: string | undefined; filter?: string | undefined; }, \"geo_bounding_box\"> & Pick<{ geo_bounding_box?: string | undefined; filter?: string | undefined; }, \"filter\">, \"enabled\" | \"id\" | \"filter\" | \"customLabel\" | \"schema\" | \"geo_bounding_box\" | \"json\">, ", + ".FILTER>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\"> & Pick<{ geo_bounding_box?: string | undefined; filter?: string | undefined; }, \"geo_bounding_box\"> & Pick<{ geo_bounding_box?: string | undefined; filter?: string | undefined; }, \"filter\">, \"enabled\" | \"id\" | \"filter\" | \"customLabel\" | \"schema\" | \"geo_bounding_box\" | \"json\" | \"timeShift\">, ", "AggExpressionType", ", ", { @@ -31221,7 +31693,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 196 + "lineNumber": 197 }, "deprecated": false }, @@ -31250,7 +31722,7 @@ "section": "def-common.BUCKET_TYPES", "text": "BUCKET_TYPES" }, - ".FILTERS>, \"enabled\" | \"id\" | \"schema\" | \"json\"> & Pick<{ filters?: string | undefined; }, \"filters\"> & Pick<{ filters?: string | undefined; }, never>, \"enabled\" | \"filters\" | \"id\" | \"schema\" | \"json\">, ", + ".FILTERS>, \"enabled\" | \"id\" | \"schema\" | \"json\" | \"timeShift\"> & Pick<{ filters?: string | undefined; }, \"filters\"> & Pick<{ filters?: string | undefined; }, never>, \"enabled\" | \"filters\" | \"id\" | \"schema\" | \"json\" | \"timeShift\">, ", "AggExpressionType", ", ", { @@ -31274,7 +31746,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 197 + "lineNumber": 198 }, "deprecated": false }, @@ -31327,7 +31799,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 198 + "lineNumber": 199 }, "deprecated": false }, @@ -31356,7 +31828,7 @@ "section": "def-common.BUCKET_TYPES", "text": "BUCKET_TYPES" }, - ".IP_RANGE>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"field\"> & Pick<{ ranges?: string | undefined; ipRangeType?: string | undefined; }, \"ipRangeType\" | \"ranges\"> & Pick<{ ranges?: string | undefined; ipRangeType?: string | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"field\" | \"ipRangeType\" | \"ranges\">, ", + ".IP_RANGE>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\"> & Pick<{ ranges?: string | undefined; ipRangeType?: string | undefined; }, \"ipRangeType\" | \"ranges\"> & Pick<{ ranges?: string | undefined; ipRangeType?: string | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\" | \"ipRangeType\" | \"ranges\">, ", "AggExpressionType", ", ", { @@ -31380,7 +31852,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 199 + "lineNumber": 200 }, "deprecated": false }, @@ -31409,7 +31881,7 @@ "section": "def-common.BUCKET_TYPES", "text": "BUCKET_TYPES" }, - ".DATE_RANGE>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"field\" | \"time_zone\"> & Pick<{ ranges?: string | undefined; }, \"ranges\"> & Pick<{ ranges?: string | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"field\" | \"ranges\" | \"time_zone\">, ", + ".DATE_RANGE>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\" | \"time_zone\"> & Pick<{ ranges?: string | undefined; }, \"ranges\"> & Pick<{ ranges?: string | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\" | \"ranges\" | \"time_zone\">, ", "AggExpressionType", ", ", { @@ -31433,7 +31905,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 200 + "lineNumber": 201 }, "deprecated": false }, @@ -31462,7 +31934,7 @@ "section": "def-common.BUCKET_TYPES", "text": "BUCKET_TYPES" }, - ".RANGE>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"field\"> & Pick<{ ranges?: string | undefined; }, \"ranges\"> & Pick<{ ranges?: string | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"field\" | \"ranges\">, ", + ".RANGE>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\"> & Pick<{ ranges?: string | undefined; }, \"ranges\"> & Pick<{ ranges?: string | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\" | \"ranges\">, ", "AggExpressionType", ", ", { @@ -31486,7 +31958,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 201 + "lineNumber": 202 }, "deprecated": false }, @@ -31539,7 +32011,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 202 + "lineNumber": 203 }, "deprecated": false }, @@ -31568,7 +32040,7 @@ "section": "def-common.BUCKET_TYPES", "text": "BUCKET_TYPES" }, - ".GEOHASH_GRID>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"field\" | \"autoPrecision\" | \"precision\" | \"useGeocentroid\" | \"isFilteredByCollar\"> & Pick<{ boundingBox?: string | undefined; }, \"boundingBox\"> & Pick<{ boundingBox?: string | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"field\" | \"autoPrecision\" | \"precision\" | \"useGeocentroid\" | \"isFilteredByCollar\" | \"boundingBox\">, ", + ".GEOHASH_GRID>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\" | \"autoPrecision\" | \"precision\" | \"useGeocentroid\" | \"isFilteredByCollar\"> & Pick<{ boundingBox?: string | undefined; }, \"boundingBox\"> & Pick<{ boundingBox?: string | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\" | \"autoPrecision\" | \"precision\" | \"useGeocentroid\" | \"isFilteredByCollar\" | \"boundingBox\">, ", "AggExpressionType", ", ", { @@ -31592,7 +32064,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 203 + "lineNumber": 204 }, "deprecated": false }, @@ -31621,7 +32093,7 @@ "section": "def-common.BUCKET_TYPES", "text": "BUCKET_TYPES" }, - ".HISTOGRAM>, \"enabled\" | \"interval\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"field\" | \"used_interval\" | \"maxBars\" | \"intervalBase\" | \"min_doc_count\" | \"has_extended_bounds\"> & Pick<{ extended_bounds?: string | undefined; }, \"extended_bounds\"> & Pick<{ extended_bounds?: string | undefined; }, never>, \"enabled\" | \"interval\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"field\" | \"used_interval\" | \"maxBars\" | \"intervalBase\" | \"min_doc_count\" | \"has_extended_bounds\" | \"extended_bounds\">, ", + ".HISTOGRAM>, \"enabled\" | \"interval\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\" | \"used_interval\" | \"maxBars\" | \"intervalBase\" | \"min_doc_count\" | \"has_extended_bounds\"> & Pick<{ extended_bounds?: string | undefined; }, \"extended_bounds\"> & Pick<{ extended_bounds?: string | undefined; }, never>, \"enabled\" | \"interval\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\" | \"used_interval\" | \"maxBars\" | \"intervalBase\" | \"min_doc_count\" | \"has_extended_bounds\" | \"extended_bounds\">, ", "AggExpressionType", ", ", { @@ -31645,7 +32117,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 204 + "lineNumber": 205 }, "deprecated": false }, @@ -31674,7 +32146,7 @@ "section": "def-common.BUCKET_TYPES", "text": "BUCKET_TYPES" }, - ".DATE_HISTOGRAM>, \"enabled\" | \"interval\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"field\" | \"time_zone\" | \"used_interval\" | \"min_doc_count\" | \"useNormalizedEsInterval\" | \"scaleMetricValues\" | \"used_time_zone\" | \"drop_partials\" | \"format\"> & Pick<{ timeRange?: string | undefined; extended_bounds?: string | undefined; }, \"timeRange\" | \"extended_bounds\"> & Pick<{ timeRange?: string | undefined; extended_bounds?: string | undefined; }, never>, \"enabled\" | \"interval\" | \"timeRange\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"field\" | \"time_zone\" | \"used_interval\" | \"min_doc_count\" | \"extended_bounds\" | \"useNormalizedEsInterval\" | \"scaleMetricValues\" | \"used_time_zone\" | \"drop_partials\" | \"format\">, ", + ".DATE_HISTOGRAM>, \"enabled\" | \"interval\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\" | \"time_zone\" | \"used_interval\" | \"min_doc_count\" | \"useNormalizedEsInterval\" | \"scaleMetricValues\" | \"used_time_zone\" | \"drop_partials\" | \"format\"> & Pick<{ timeRange?: string | undefined; extended_bounds?: string | undefined; }, \"timeRange\" | \"extended_bounds\"> & Pick<{ timeRange?: string | undefined; extended_bounds?: string | undefined; }, never>, \"enabled\" | \"interval\" | \"timeRange\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\" | \"time_zone\" | \"used_interval\" | \"min_doc_count\" | \"extended_bounds\" | \"useNormalizedEsInterval\" | \"scaleMetricValues\" | \"used_time_zone\" | \"drop_partials\" | \"format\">, ", "AggExpressionType", ", ", { @@ -31698,7 +32170,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 205 + "lineNumber": 206 }, "deprecated": false }, @@ -31727,11 +32199,11 @@ "section": "def-common.BUCKET_TYPES", "text": "BUCKET_TYPES" }, - ".TERMS>, \"enabled\" | \"id\" | \"size\" | \"customLabel\" | \"schema\" | \"json\" | \"field\" | \"orderBy\" | \"order\" | \"missingBucket\" | \"missingBucketLabel\" | \"otherBucket\" | \"otherBucketLabel\" | \"exclude\" | \"include\"> & Pick<{ orderAgg?: ", + ".TERMS>, \"enabled\" | \"id\" | \"size\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\" | \"orderBy\" | \"order\" | \"missingBucket\" | \"missingBucketLabel\" | \"otherBucket\" | \"otherBucketLabel\" | \"exclude\" | \"include\"> & Pick<{ orderAgg?: ", "AggExpressionType", " | undefined; }, \"orderAgg\"> & Pick<{ orderAgg?: ", "AggExpressionType", - " | undefined; }, never>, \"enabled\" | \"id\" | \"size\" | \"customLabel\" | \"schema\" | \"json\" | \"field\" | \"orderBy\" | \"orderAgg\" | \"order\" | \"missingBucket\" | \"missingBucketLabel\" | \"otherBucket\" | \"otherBucketLabel\" | \"exclude\" | \"include\">, ", + " | undefined; }, never>, \"enabled\" | \"id\" | \"size\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\" | \"orderBy\" | \"orderAgg\" | \"order\" | \"missingBucket\" | \"missingBucketLabel\" | \"otherBucket\" | \"otherBucketLabel\" | \"exclude\" | \"include\">, ", "AggExpressionType", ", ", { @@ -31755,7 +32227,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 206 + "lineNumber": 207 }, "deprecated": false }, @@ -31808,7 +32280,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 207 + "lineNumber": 208 }, "deprecated": false }, @@ -31837,7 +32309,7 @@ "section": "def-common.METRIC_TYPES", "text": "METRIC_TYPES" }, - ".AVG_BUCKET>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\"> & Pick<{ customBucket?: ", + ".AVG_BUCKET>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\"> & Pick<{ customBucket?: ", "AggExpressionType", " | undefined; customMetric?: ", "AggExpressionType", @@ -31845,7 +32317,7 @@ "AggExpressionType", " | undefined; customMetric?: ", "AggExpressionType", - " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"customMetric\" | \"customBucket\">, ", + " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"customMetric\" | \"customBucket\">, ", "AggExpressionType", ", ", { @@ -31869,7 +32341,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 208 + "lineNumber": 209 }, "deprecated": false }, @@ -31898,7 +32370,7 @@ "section": "def-common.METRIC_TYPES", "text": "METRIC_TYPES" }, - ".MAX_BUCKET>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\"> & Pick<{ customBucket?: ", + ".MAX_BUCKET>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\"> & Pick<{ customBucket?: ", "AggExpressionType", " | undefined; customMetric?: ", "AggExpressionType", @@ -31906,7 +32378,7 @@ "AggExpressionType", " | undefined; customMetric?: ", "AggExpressionType", - " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"customMetric\" | \"customBucket\">, ", + " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"customMetric\" | \"customBucket\">, ", "AggExpressionType", ", ", { @@ -31930,7 +32402,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 209 + "lineNumber": 210 }, "deprecated": false }, @@ -31959,7 +32431,7 @@ "section": "def-common.METRIC_TYPES", "text": "METRIC_TYPES" }, - ".MIN_BUCKET>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\"> & Pick<{ customBucket?: ", + ".MIN_BUCKET>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\"> & Pick<{ customBucket?: ", "AggExpressionType", " | undefined; customMetric?: ", "AggExpressionType", @@ -31967,7 +32439,7 @@ "AggExpressionType", " | undefined; customMetric?: ", "AggExpressionType", - " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"customMetric\" | \"customBucket\">, ", + " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"customMetric\" | \"customBucket\">, ", "AggExpressionType", ", ", { @@ -31991,7 +32463,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 210 + "lineNumber": 211 }, "deprecated": false }, @@ -32020,7 +32492,7 @@ "section": "def-common.METRIC_TYPES", "text": "METRIC_TYPES" }, - ".SUM_BUCKET>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\"> & Pick<{ customBucket?: ", + ".SUM_BUCKET>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\"> & Pick<{ customBucket?: ", "AggExpressionType", " | undefined; customMetric?: ", "AggExpressionType", @@ -32028,7 +32500,7 @@ "AggExpressionType", " | undefined; customMetric?: ", "AggExpressionType", - " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"customMetric\" | \"customBucket\">, ", + " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"customMetric\" | \"customBucket\">, ", "AggExpressionType", ", ", { @@ -32052,7 +32524,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 211 + "lineNumber": 212 }, "deprecated": false }, @@ -32081,7 +32553,7 @@ "section": "def-common.METRIC_TYPES", "text": "METRIC_TYPES" }, - ".FILTERED_METRIC>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\"> & Pick<{ customBucket?: ", + ".FILTERED_METRIC>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\"> & Pick<{ customBucket?: ", "AggExpressionType", " | undefined; customMetric?: ", "AggExpressionType", @@ -32089,7 +32561,7 @@ "AggExpressionType", " | undefined; customMetric?: ", "AggExpressionType", - " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"customMetric\" | \"customBucket\">, ", + " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"customMetric\" | \"customBucket\">, ", "AggExpressionType", ", ", { @@ -32113,7 +32585,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 212 + "lineNumber": 213 }, "deprecated": false }, @@ -32166,7 +32638,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 213 + "lineNumber": 214 }, "deprecated": false }, @@ -32219,7 +32691,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 214 + "lineNumber": 215 }, "deprecated": false }, @@ -32248,11 +32720,11 @@ "section": "def-common.METRIC_TYPES", "text": "METRIC_TYPES" }, - ".CUMULATIVE_SUM>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"buckets_path\" | \"metricAgg\"> & Pick<{ customMetric?: ", + ".CUMULATIVE_SUM>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"buckets_path\" | \"metricAgg\"> & Pick<{ customMetric?: ", "AggExpressionType", " | undefined; }, \"customMetric\"> & Pick<{ customMetric?: ", "AggExpressionType", - " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"customMetric\" | \"buckets_path\" | \"metricAgg\">, ", + " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"customMetric\" | \"buckets_path\" | \"metricAgg\">, ", "AggExpressionType", ", ", { @@ -32276,7 +32748,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 215 + "lineNumber": 216 }, "deprecated": false }, @@ -32305,11 +32777,11 @@ "section": "def-common.METRIC_TYPES", "text": "METRIC_TYPES" }, - ".DERIVATIVE>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"buckets_path\" | \"metricAgg\"> & Pick<{ customMetric?: ", + ".DERIVATIVE>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"buckets_path\" | \"metricAgg\"> & Pick<{ customMetric?: ", "AggExpressionType", " | undefined; }, \"customMetric\"> & Pick<{ customMetric?: ", "AggExpressionType", - " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"customMetric\" | \"buckets_path\" | \"metricAgg\">, ", + " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"customMetric\" | \"buckets_path\" | \"metricAgg\">, ", "AggExpressionType", ", ", { @@ -32333,7 +32805,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 216 + "lineNumber": 217 }, "deprecated": false }, @@ -32386,7 +32858,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 217 + "lineNumber": 218 }, "deprecated": false }, @@ -32439,7 +32911,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 218 + "lineNumber": 219 }, "deprecated": false }, @@ -32492,7 +32964,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 219 + "lineNumber": 220 }, "deprecated": false }, @@ -32545,7 +33017,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 220 + "lineNumber": 221 }, "deprecated": false }, @@ -32598,7 +33070,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 221 + "lineNumber": 222 }, "deprecated": false }, @@ -32651,7 +33123,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 222 + "lineNumber": 223 }, "deprecated": false }, @@ -32680,11 +33152,11 @@ "section": "def-common.METRIC_TYPES", "text": "METRIC_TYPES" }, - ".MOVING_FN>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"buckets_path\" | \"metricAgg\" | \"window\" | \"script\"> & Pick<{ customMetric?: ", + ".MOVING_FN>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"buckets_path\" | \"metricAgg\" | \"window\" | \"script\"> & Pick<{ customMetric?: ", "AggExpressionType", " | undefined; }, \"customMetric\"> & Pick<{ customMetric?: ", "AggExpressionType", - " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"customMetric\" | \"buckets_path\" | \"metricAgg\" | \"window\" | \"script\">, ", + " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"customMetric\" | \"buckets_path\" | \"metricAgg\" | \"window\" | \"script\">, ", "AggExpressionType", ", ", { @@ -32708,7 +33180,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 223 + "lineNumber": 224 }, "deprecated": false }, @@ -32761,7 +33233,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 224 + "lineNumber": 225 }, "deprecated": false }, @@ -32814,7 +33286,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 225 + "lineNumber": 226 }, "deprecated": false }, @@ -32843,11 +33315,11 @@ "section": "def-common.METRIC_TYPES", "text": "METRIC_TYPES" }, - ".SERIAL_DIFF>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"buckets_path\" | \"metricAgg\"> & Pick<{ customMetric?: ", + ".SERIAL_DIFF>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"buckets_path\" | \"metricAgg\"> & Pick<{ customMetric?: ", "AggExpressionType", " | undefined; }, \"customMetric\"> & Pick<{ customMetric?: ", "AggExpressionType", - " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"customMetric\" | \"buckets_path\" | \"metricAgg\">, ", + " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"customMetric\" | \"buckets_path\" | \"metricAgg\">, ", "AggExpressionType", ", ", { @@ -32871,7 +33343,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 226 + "lineNumber": 227 }, "deprecated": false }, @@ -32924,7 +33396,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 227 + "lineNumber": 228 }, "deprecated": false }, @@ -32977,7 +33449,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 228 + "lineNumber": 229 }, "deprecated": false }, @@ -33030,7 +33502,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 229 + "lineNumber": 230 }, "deprecated": false } @@ -33403,7 +33875,7 @@ "plugin": "discover", "link": { "path": "src/plugins/discover/public/application/embeddable/search_embeddable.ts", - "lineNumber": 58 + "lineNumber": 59 } }, { @@ -34754,28 +35226,28 @@ "plugin": "lens", "link": { "path": "x-pack/plugins/lens/server/routes/field_stats.ts", - "lineNumber": 139 + "lineNumber": 140 } }, { "plugin": "lens", "link": { "path": "x-pack/plugins/lens/server/routes/field_stats.ts", - "lineNumber": 248 + "lineNumber": 249 } }, { "plugin": "lens", "link": { "path": "x-pack/plugins/lens/server/routes/field_stats.ts", - "lineNumber": 287 + "lineNumber": 289 } }, { "plugin": "lens", "link": { "path": "x-pack/plugins/lens/server/routes/field_stats.ts", - "lineNumber": 329 + "lineNumber": 331 } }, { @@ -36603,7 +37075,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 43 + "lineNumber": 45 }, "deprecated": false, "initialIsOpen": false @@ -36616,7 +37088,7 @@ "label": "AggGroupName", "description": [], "signature": [ - "\"buckets\" | \"metrics\" | \"none\"" + "\"none\" | \"buckets\" | \"metrics\"" ], "source": { "path": "src/plugins/data/common/search/aggs/agg_groups.ts", @@ -36988,7 +37460,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 53 + "lineNumber": 55 }, "deprecated": false, "initialIsOpen": false @@ -37324,7 +37796,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/metrics/metric_agg_type.ts", - "lineNumber": 35 + "lineNumber": 36 }, "deprecated": false, "initialIsOpen": false @@ -38964,7 +39436,7 @@ ], "source": { "path": "src/plugins/data/common/es_query/es_query/build_es_query.ts", - "lineNumber": 33 + "lineNumber": 39 }, "deprecated": false }, @@ -38995,7 +39467,7 @@ ], "source": { "path": "src/plugins/data/common/es_query/es_query/build_es_query.ts", - "lineNumber": 34 + "lineNumber": 40 }, "deprecated": false }, @@ -39026,7 +39498,7 @@ ], "source": { "path": "src/plugins/data/common/es_query/es_query/build_es_query.ts", - "lineNumber": 35 + "lineNumber": 41 }, "deprecated": false }, @@ -39048,7 +39520,7 @@ ], "source": { "path": "src/plugins/data/common/es_query/es_query/build_es_query.ts", - "lineNumber": 36 + "lineNumber": 42 }, "deprecated": false } @@ -39658,7 +40130,7 @@ "description": [], "source": { "path": "src/plugins/data/server/index.ts", - "lineNumber": 243 + "lineNumber": 244 }, "deprecated": false, "children": [ @@ -39671,7 +40143,7 @@ "description": [], "source": { "path": "src/plugins/data/server/index.ts", - "lineNumber": 244 + "lineNumber": 245 }, "deprecated": false, "children": [ @@ -39694,7 +40166,7 @@ ], "source": { "path": "src/plugins/data/server/index.ts", - "lineNumber": 245 + "lineNumber": 246 }, "deprecated": false }, @@ -39710,7 +40182,7 @@ ], "source": { "path": "src/plugins/data/server/index.ts", - "lineNumber": 246 + "lineNumber": 247 }, "deprecated": false, "returnComment": [], @@ -39750,7 +40222,7 @@ ], "source": { "path": "src/plugins/data/server/index.ts", - "lineNumber": 247 + "lineNumber": 248 }, "deprecated": false }, @@ -39773,7 +40245,7 @@ ], "source": { "path": "src/plugins/data/server/index.ts", - "lineNumber": 248 + "lineNumber": 249 }, "deprecated": false }, @@ -39796,7 +40268,7 @@ ], "source": { "path": "src/plugins/data/server/index.ts", - "lineNumber": 249 + "lineNumber": 250 }, "deprecated": false }, @@ -39819,7 +40291,7 @@ ], "source": { "path": "src/plugins/data/server/index.ts", - "lineNumber": 250 + "lineNumber": 251 }, "deprecated": false }, @@ -39843,7 +40315,7 @@ ], "source": { "path": "src/plugins/data/server/index.ts", - "lineNumber": 251 + "lineNumber": 252 }, "deprecated": false, "returnComment": [], @@ -39892,7 +40364,7 @@ ], "source": { "path": "src/plugins/data/server/index.ts", - "lineNumber": 252 + "lineNumber": 253 }, "deprecated": false, "returnComment": [], @@ -39941,7 +40413,7 @@ ], "source": { "path": "src/plugins/data/server/index.ts", - "lineNumber": 253 + "lineNumber": 254 }, "deprecated": false, "returnComment": [], @@ -39976,7 +40448,7 @@ ], "source": { "path": "src/plugins/data/server/index.ts", - "lineNumber": 254 + "lineNumber": 255 }, "deprecated": false, "returnComment": [], @@ -40008,7 +40480,7 @@ ], "source": { "path": "src/plugins/data/server/index.ts", - "lineNumber": 255 + "lineNumber": 256 }, "deprecated": false, "returnComment": [], @@ -40053,7 +40525,7 @@ "description": [], "source": { "path": "src/plugins/data/server/index.ts", - "lineNumber": 256 + "lineNumber": 257 }, "deprecated": false }, @@ -40071,7 +40543,7 @@ ], "source": { "path": "src/plugins/data/server/index.ts", - "lineNumber": 257 + "lineNumber": 258 }, "deprecated": false, "returnComment": [], @@ -40103,7 +40575,7 @@ ], "source": { "path": "src/plugins/data/server/index.ts", - "lineNumber": 258 + "lineNumber": 259 }, "deprecated": false, "returnComment": [], @@ -40135,7 +40607,7 @@ ], "source": { "path": "src/plugins/data/server/index.ts", - "lineNumber": 259 + "lineNumber": 260 }, "deprecated": false, "returnComment": [], @@ -40167,7 +40639,7 @@ "description": [], "source": { "path": "src/plugins/data/server/index.ts", - "lineNumber": 260 + "lineNumber": 261 }, "deprecated": false }, @@ -40183,7 +40655,7 @@ ], "source": { "path": "src/plugins/data/server/index.ts", - "lineNumber": 261 + "lineNumber": 262 }, "deprecated": false }, @@ -40207,7 +40679,7 @@ ], "source": { "path": "src/plugins/data/server/index.ts", - "lineNumber": 262 + "lineNumber": 263 }, "deprecated": false, "returnComment": [], @@ -40242,7 +40714,7 @@ ], "source": { "path": "src/plugins/data/server/index.ts", - "lineNumber": 263 + "lineNumber": 264 }, "deprecated": false, "returnComment": [], @@ -40306,7 +40778,7 @@ ], "source": { "path": "src/plugins/data/server/index.ts", - "lineNumber": 265 + "lineNumber": 266 }, "deprecated": false, "returnComment": [], @@ -40391,7 +40863,7 @@ ], "source": { "path": "src/plugins/data/server/index.ts", - "lineNumber": 266 + "lineNumber": 267 }, "deprecated": false, "returnComment": [], @@ -41124,7 +41596,7 @@ ], "source": { "path": "src/plugins/data/common/es_query/es_query/build_es_query.ts", - "lineNumber": 32 + "lineNumber": 38 }, "deprecated": false, "children": [ @@ -41147,7 +41619,7 @@ ], "source": { "path": "src/plugins/data/common/es_query/es_query/build_es_query.ts", - "lineNumber": 33 + "lineNumber": 39 }, "deprecated": false, "isRequired": false @@ -41181,7 +41653,7 @@ ], "source": { "path": "src/plugins/data/common/es_query/es_query/build_es_query.ts", - "lineNumber": 34 + "lineNumber": 40 }, "deprecated": false, "isRequired": true @@ -41215,7 +41687,7 @@ ], "source": { "path": "src/plugins/data/common/es_query/es_query/build_es_query.ts", - "lineNumber": 35 + "lineNumber": 41 }, "deprecated": false, "isRequired": true @@ -41240,7 +41712,7 @@ ], "source": { "path": "src/plugins/data/common/es_query/es_query/build_es_query.ts", - "lineNumber": 36 + "lineNumber": 42 }, "deprecated": false, "isRequired": true diff --git a/api_docs/data_autocomplete.json b/api_docs/data_autocomplete.json index 38e27d4df6e2d8..25bda08157358d 100644 --- a/api_docs/data_autocomplete.json +++ b/api_docs/data_autocomplete.json @@ -370,7 +370,7 @@ ], "source": { "path": "src/plugins/data/public/autocomplete/autocomplete_service.ts", - "lineNumber": 96 + "lineNumber": 103 }, "deprecated": false, "initialIsOpen": false diff --git a/api_docs/data_field_formats.json b/api_docs/data_field_formats.json index 1807c32a18389d..a5fba87c20169b 100644 --- a/api_docs/data_field_formats.json +++ b/api_docs/data_field_formats.json @@ -513,7 +513,7 @@ ], "source": { "path": "src/plugins/data/common/field_formats/converters/duration.ts", - "lineNumber": 157 + "lineNumber": 211 }, "deprecated": false, "children": [ @@ -535,7 +535,7 @@ ], "source": { "path": "src/plugins/data/common/field_formats/converters/duration.ts", - "lineNumber": 158 + "lineNumber": 212 }, "deprecated": false }, @@ -548,7 +548,7 @@ "description": [], "source": { "path": "src/plugins/data/common/field_formats/converters/duration.ts", - "lineNumber": 159 + "lineNumber": 213 }, "deprecated": false }, @@ -570,7 +570,7 @@ ], "source": { "path": "src/plugins/data/common/field_formats/converters/duration.ts", - "lineNumber": 162 + "lineNumber": 216 }, "deprecated": false }, @@ -586,7 +586,7 @@ ], "source": { "path": "src/plugins/data/common/field_formats/converters/duration.ts", - "lineNumber": 163 + "lineNumber": 217 }, "deprecated": false }, @@ -598,11 +598,11 @@ "label": "outputFormats", "description": [], "signature": [ - "{ text: string; method: string; }[]" + "({ text: string; method: string; shortText?: undefined; } | { text: string; shortText: string; method: string; })[]" ], "source": { "path": "src/plugins/data/common/field_formats/converters/duration.ts", - "lineNumber": 164 + "lineNumber": 218 }, "deprecated": false }, @@ -615,7 +615,7 @@ "description": [], "source": { "path": "src/plugins/data/common/field_formats/converters/duration.ts", - "lineNumber": 165 + "lineNumber": 219 }, "deprecated": false }, @@ -631,7 +631,25 @@ ], "source": { "path": "src/plugins/data/common/field_formats/converters/duration.ts", - "lineNumber": 167 + "lineNumber": 221 + }, + "deprecated": false, + "children": [], + "returnComment": [] + }, + { + "parentPluginId": "data", + "id": "def-common.DurationFormat.isHumanPrecise", + "type": "Function", + "tags": [], + "label": "isHumanPrecise", + "description": [], + "signature": [ + "() => boolean" + ], + "source": { + "path": "src/plugins/data/common/field_formats/converters/duration.ts", + "lineNumber": 225 }, "deprecated": false, "children": [], @@ -645,11 +663,11 @@ "label": "getParamDefaults", "description": [], "signature": [ - "() => { inputFormat: string; outputFormat: string; outputPrecision: number; }" + "() => { inputFormat: string; outputFormat: string; outputPrecision: number; includeSpaceWithSuffix: boolean; }" ], "source": { "path": "src/plugins/data/common/field_formats/converters/duration.ts", - "lineNumber": 170 + "lineNumber": 229 }, "deprecated": false, "children": [], @@ -663,11 +681,11 @@ "label": "textConvert", "description": [], "signature": [ - "(val: any) => string" + "(val: any) => any" ], "source": { "path": "src/plugins/data/common/field_formats/converters/duration.ts", - "lineNumber": 178 + "lineNumber": 238 }, "deprecated": false, "children": [ @@ -683,7 +701,7 @@ ], "source": { "path": "src/plugins/data/common/field_formats/converters/duration.ts", - "lineNumber": 178 + "lineNumber": 238 }, "deprecated": false, "isRequired": true diff --git a/api_docs/data_index_patterns.json b/api_docs/data_index_patterns.json index 676ded76cb331b..0a74a65fb4d34a 100644 --- a/api_docs/data_index_patterns.json +++ b/api_docs/data_index_patterns.json @@ -1689,7 +1689,9 @@ "parentPluginId": "data", "id": "def-common.IndexPattern.addScriptedField", "type": "Function", - "tags": [], + "tags": [ + "deprecated" + ], "label": "addScriptedField", "description": [ "\nAdd scripted field to field list\n" @@ -1699,9 +1701,10 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 244 + "lineNumber": 245 }, - "deprecated": false, + "deprecated": true, + "references": [], "children": [ { "parentPluginId": "data", @@ -1717,7 +1720,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 244 + "lineNumber": 245 }, "deprecated": false, "isRequired": true @@ -1736,7 +1739,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 244 + "lineNumber": 245 }, "deprecated": false, "isRequired": true @@ -1753,7 +1756,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 244 + "lineNumber": 245 }, "deprecated": false, "isRequired": true @@ -1765,7 +1768,9 @@ "parentPluginId": "data", "id": "def-common.IndexPattern.removeScriptedField", "type": "Function", - "tags": [], + "tags": [ + "deprecated" + ], "label": "removeScriptedField", "description": [ "\nRemove scripted field from field list" @@ -1775,9 +1780,25 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 270 + "lineNumber": 272 }, - "deprecated": false, + "deprecated": true, + "references": [ + { + "plugin": "indexPatternManagement", + "link": { + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/scripted_fields_table.tsx", + "lineNumber": 117 + } + }, + { + "plugin": "indexPatternManagement", + "link": { + "path": "src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx", + "lineNumber": 777 + } + } + ], "children": [ { "parentPluginId": "data", @@ -1791,7 +1812,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 270 + "lineNumber": 272 }, "deprecated": false, "isRequired": true @@ -1803,9 +1824,13 @@ "parentPluginId": "data", "id": "def-common.IndexPattern.getNonScriptedFields", "type": "Function", - "tags": [], + "tags": [ + "deprecated" + ], "label": "getNonScriptedFields", - "description": [], + "description": [ + "\n" + ], "signature": [ "() => ", { @@ -1819,9 +1844,74 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 277 + "lineNumber": 283 }, - "deprecated": false, + "deprecated": true, + "references": [ + { + "plugin": "indexPatternManagement", + "link": { + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/table/table.tsx", + "lineNumber": 152 + } + }, + { + "plugin": "indexPatternManagement", + "link": { + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx", + "lineNumber": 66 + } + }, + { + "plugin": "indexPatternManagement", + "link": { + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx", + "lineNumber": 74 + } + }, + { + "plugin": "indexPatternManagement", + "link": { + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx", + "lineNumber": 204 + } + }, + { + "plugin": "visTypeTimeseries", + "link": { + "path": "src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/abstract_search_strategy.ts", + "lineNumber": 65 + } + }, + { + "plugin": "graph", + "link": { + "path": "x-pack/plugins/graph/public/services/persistence/deserialize.ts", + "lineNumber": 106 + } + }, + { + "plugin": "graph", + "link": { + "path": "x-pack/plugins/graph/public/state_management/datasource.test.ts", + "lineNumber": 29 + } + }, + { + "plugin": "graph", + "link": { + "path": "x-pack/plugins/graph/public/services/persistence/deserialize.test.ts", + "lineNumber": 122 + } + }, + { + "plugin": "graph", + "link": { + "path": "x-pack/plugins/graph/public/services/persistence/deserialize.test.ts", + "lineNumber": 244 + } + } + ], "children": [], "returnComment": [] }, @@ -1829,9 +1919,13 @@ "parentPluginId": "data", "id": "def-common.IndexPattern.getScriptedFields", "type": "Function", - "tags": [], + "tags": [ + "deprecated" + ], "label": "getScriptedFields", - "description": [], + "description": [ + "\n" + ], "signature": [ "() => ", { @@ -1845,9 +1939,18 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 281 + "lineNumber": 291 }, - "deprecated": false, + "deprecated": true, + "references": [ + { + "plugin": "indexPatternManagement", + "link": { + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/scripted_fields_table.tsx", + "lineNumber": 61 + } + } + ], "children": [], "returnComment": [] }, @@ -1863,7 +1966,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 285 + "lineNumber": 295 }, "deprecated": false, "children": [], @@ -1881,7 +1984,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 289 + "lineNumber": 299 }, "deprecated": false, "children": [], @@ -1907,7 +2010,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 294 + "lineNumber": 304 }, "deprecated": false, "children": [], @@ -1933,7 +2036,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 299 + "lineNumber": 309 }, "deprecated": false, "children": [ @@ -1949,7 +2052,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 299 + "lineNumber": 309 }, "deprecated": false, "isRequired": true @@ -1969,7 +2072,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 304 + "lineNumber": 314 }, "deprecated": false, "children": [], @@ -1985,11 +2088,18 @@ "\nReturns index pattern as saved object body for saving" ], "signature": [ - "() => { fieldAttrs: string | undefined; title: string; timeFieldName: string | undefined; intervalName: string | undefined; sourceFilters: string | undefined; fields: string | undefined; fieldFormatMap: string | undefined; type: string | undefined; typeMeta: string | undefined; allowNoIndex: true | undefined; runtimeFieldMap: string | undefined; }" + "() => ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.IndexPatternAttributes", + "text": "IndexPatternAttributes" + } ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 311 + "lineNumber": 321 }, "deprecated": false, "children": [], @@ -2040,7 +2150,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 339 + "lineNumber": 347 }, "deprecated": false, "children": [ @@ -2078,7 +2188,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 340 + "lineNumber": 348 }, "deprecated": false, "isRequired": true @@ -2108,7 +2218,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 360 + "lineNumber": 368 }, "deprecated": false, "children": [ @@ -2126,7 +2236,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 360 + "lineNumber": 368 }, "deprecated": false, "isRequired": true @@ -2151,7 +2261,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 360 + "lineNumber": 368 }, "deprecated": false, "isRequired": true @@ -2173,7 +2283,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 384 + "lineNumber": 392 }, "deprecated": false, "children": [ @@ -2191,7 +2301,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 384 + "lineNumber": 392 }, "deprecated": false, "isRequired": true @@ -2221,7 +2331,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 404 + "lineNumber": 412 }, "deprecated": false, "children": [ @@ -2237,7 +2347,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 404 + "lineNumber": 412 }, "deprecated": false, "isRequired": true @@ -2265,7 +2375,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 411 + "lineNumber": 419 }, "deprecated": false, "children": [ @@ -2281,7 +2391,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 412 + "lineNumber": 420 }, "deprecated": false, "isRequired": true @@ -2298,7 +2408,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 413 + "lineNumber": 421 }, "deprecated": false, "isRequired": true @@ -2322,7 +2432,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 414 + "lineNumber": 422 }, "deprecated": false, "isRequired": true @@ -2342,7 +2452,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 422 + "lineNumber": 430 }, "deprecated": false, "children": [ @@ -2358,7 +2468,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 422 + "lineNumber": 430 }, "deprecated": false, "isRequired": true @@ -2375,7 +2485,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 422 + "lineNumber": 430 }, "deprecated": false, "isRequired": false @@ -2395,7 +2505,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 433 + "lineNumber": 441 }, "deprecated": false, "children": [ @@ -2411,7 +2521,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 433 + "lineNumber": 441 }, "deprecated": false, "isRequired": true @@ -2428,7 +2538,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 433 + "lineNumber": 441 }, "deprecated": false, "isRequired": false @@ -2456,7 +2566,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 446 + "lineNumber": 454 }, "deprecated": false, "children": [ @@ -2472,7 +2582,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 446 + "lineNumber": 454 }, "deprecated": false, "isRequired": true @@ -2496,7 +2606,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 446 + "lineNumber": 454 }, "deprecated": false, "isRequired": true @@ -2516,7 +2626,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 450 + "lineNumber": 458 }, "deprecated": false, "children": [ @@ -2532,7 +2642,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "lineNumber": 450 + "lineNumber": 458 }, "deprecated": false, "isRequired": true @@ -4012,7 +4122,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 473 + "lineNumber": 480 }, "deprecated": false, "children": [ @@ -4028,7 +4138,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 473 + "lineNumber": 480 }, "deprecated": false, "isRequired": true @@ -4066,7 +4176,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 492 + "lineNumber": 499 }, "deprecated": false, "children": [ @@ -4088,7 +4198,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 492 + "lineNumber": 499 }, "deprecated": false, "isRequired": true @@ -4105,7 +4215,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 492 + "lineNumber": 499 }, "deprecated": false, "isRequired": true @@ -4145,7 +4255,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 517 + "lineNumber": 524 }, "deprecated": false, "children": [ @@ -4167,7 +4277,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 517 + "lineNumber": 524 }, "deprecated": false, "isRequired": true @@ -4186,7 +4296,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 517 + "lineNumber": 524 }, "deprecated": false, "isRequired": true @@ -4205,7 +4315,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 517 + "lineNumber": 524 }, "deprecated": false, "isRequired": true @@ -4243,7 +4353,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 530 + "lineNumber": 537 }, "deprecated": false, "children": [ @@ -4265,7 +4375,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 530 + "lineNumber": 537 }, "deprecated": false, "isRequired": true @@ -4284,7 +4394,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 530 + "lineNumber": 537 }, "deprecated": false, "isRequired": true @@ -4314,7 +4424,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 558 + "lineNumber": 570 }, "deprecated": false, "children": [ @@ -4336,7 +4446,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 559 + "lineNumber": 571 }, "deprecated": false, "isRequired": true @@ -4353,7 +4463,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 560 + "lineNumber": 572 }, "deprecated": false, "isRequired": true @@ -4370,7 +4480,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 561 + "lineNumber": 573 }, "deprecated": false, "isRequired": true @@ -4392,7 +4502,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 644 + "lineNumber": 656 }, "deprecated": false, "children": [ @@ -4410,7 +4520,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 644 + "lineNumber": 656 }, "deprecated": false, "isRequired": true @@ -5542,7 +5652,7 @@ "plugin": "discover", "link": { "path": "src/plugins/discover/public/application/embeddable/search_embeddable.ts", - "lineNumber": 58 + "lineNumber": 59 } }, { @@ -6893,28 +7003,28 @@ "plugin": "lens", "link": { "path": "x-pack/plugins/lens/server/routes/field_stats.ts", - "lineNumber": 139 + "lineNumber": 140 } }, { "plugin": "lens", "link": { "path": "x-pack/plugins/lens/server/routes/field_stats.ts", - "lineNumber": 248 + "lineNumber": 249 } }, { "plugin": "lens", "link": { "path": "x-pack/plugins/lens/server/routes/field_stats.ts", - "lineNumber": 287 + "lineNumber": 289 } }, { "plugin": "lens", "link": { "path": "x-pack/plugins/lens/server/routes/field_stats.ts", - "lineNumber": 329 + "lineNumber": 331 } }, { @@ -8351,6 +8461,20 @@ "lineNumber": 85 } }, + { + "plugin": "lens", + "link": { + "path": "x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/terms/index.tsx", + "lineNumber": 25 + } + }, + { + "plugin": "lens", + "link": { + "path": "x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/terms/index.tsx", + "lineNumber": 102 + } + }, { "plugin": "lens", "link": { @@ -8456,20 +8580,6 @@ "lineNumber": 30 } }, - { - "plugin": "apm", - "link": { - "path": "x-pack/plugins/apm/public/components/shared/KueryBar/index.tsx", - "lineNumber": 14 - } - }, - { - "plugin": "apm", - "link": { - "path": "x-pack/plugins/apm/public/components/shared/KueryBar/index.tsx", - "lineNumber": 31 - } - }, { "plugin": "infra", "link": { @@ -8638,6 +8748,20 @@ "lineNumber": 23 } }, + { + "plugin": "apm", + "link": { + "path": "x-pack/plugins/apm/public/components/shared/KueryBar/index.tsx", + "lineNumber": 14 + } + }, + { + "plugin": "apm", + "link": { + "path": "x-pack/plugins/apm/public/components/shared/KueryBar/index.tsx", + "lineNumber": 31 + } + }, { "plugin": "lists", "link": { @@ -8670,21 +8794,21 @@ "plugin": "securitySolution", "link": { "path": "x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/types.ts", - "lineNumber": 21 + "lineNumber": 22 } }, { "plugin": "securitySolution", "link": { "path": "x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/types.ts", - "lineNumber": 66 + "lineNumber": 72 } }, { "plugin": "securitySolution", "link": { "path": "x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/action.ts", - "lineNumber": 19 + "lineNumber": 20 } }, { @@ -8943,21 +9067,21 @@ "plugin": "securitySolution", "link": { "path": "x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts", - "lineNumber": 44 + "lineNumber": 48 } }, { "plugin": "securitySolution", "link": { "path": "x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts", - "lineNumber": 60 + "lineNumber": 64 } }, { "plugin": "securitySolution", "link": { "path": "x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts", - "lineNumber": 65 + "lineNumber": 69 } }, { @@ -9744,6 +9868,20 @@ "lineNumber": 30 } }, + { + "plugin": "securitySolution", + "link": { + "path": "x-pack/plugins/security_solution/server/lib/detection_engine/reference_rules/query.ts", + "lineNumber": 13 + } + }, + { + "plugin": "securitySolution", + "link": { + "path": "x-pack/plugins/security_solution/server/lib/detection_engine/reference_rules/query.ts", + "lineNumber": 52 + } + }, { "plugin": "stackAlerts", "link": { @@ -9947,20 +10085,6 @@ "lineNumber": 1352 } }, - { - "plugin": "discover", - "link": { - "path": "src/plugins/discover/public/application/components/context_app/context_app_legacy.tsx", - "lineNumber": 17 - } - }, - { - "plugin": "discover", - "link": { - "path": "src/plugins/discover/public/application/components/context_app/context_app_legacy.tsx", - "lineNumber": 26 - } - }, { "plugin": "maps", "link": { @@ -9972,7 +10096,7 @@ "plugin": "maps", "link": { "path": "x-pack/plugins/maps/public/embeddable/types.ts", - "lineNumber": 45 + "lineNumber": 44 } }, { @@ -10077,14 +10201,14 @@ "plugin": "observability", "link": { "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/types.ts", - "lineNumber": 18 + "lineNumber": 19 } }, { "plugin": "observability", "link": { "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/types.ts", - "lineNumber": 95 + "lineNumber": 104 } }, { @@ -10126,7 +10250,7 @@ "plugin": "observability", "link": { "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/default_configs.ts", - "lineNumber": 24 + "lineNumber": 25 } }, { @@ -12657,7 +12781,7 @@ ], "source": { "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "lineNumber": 650 + "lineNumber": 662 }, "deprecated": false, "initialIsOpen": false diff --git a/api_docs/data_search.json b/api_docs/data_search.json index d72ae79e79bd87..81fa9660d32fe7 100644 --- a/api_docs/data_search.json +++ b/api_docs/data_search.json @@ -2272,7 +2272,7 @@ "label": "getShardTimeout", "description": [], "signature": [ - "(config: Readonly<{ kibana: Readonly<{ readonly index: string; readonly autocompleteTerminateAfter: Readonly<{ clone: () => moment.Duration; humanize: { (argWithSuffix?: boolean | undefined, argThresholds?: moment.argThresholdOpts | undefined): string; (argThresholds?: moment.argThresholdOpts | undefined): string; }; abs: () => moment.Duration; as: (units: moment.unitOfTime.Base) => number; get: (units: moment.unitOfTime.Base) => number; milliseconds: () => number; asMilliseconds: () => number; seconds: () => number; asSeconds: () => number; minutes: () => number; asMinutes: () => number; hours: () => number; asHours: () => number; days: () => number; asDays: () => number; weeks: () => number; asWeeks: () => number; months: () => number; asMonths: () => number; years: () => number; asYears: () => number; add: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; subtract: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; locale: { (): string; (locale: moment.LocaleSpecifier): moment.Duration; }; localeData: () => moment.Locale; toISOString: () => string; toJSON: () => string; isValid: () => boolean; lang: { (locale: moment.LocaleSpecifier): moment.Moment; (): moment.Locale; }; toIsoString: () => string; }>; readonly autocompleteTimeout: Readonly<{ clone: () => moment.Duration; humanize: { (argWithSuffix?: boolean | undefined, argThresholds?: moment.argThresholdOpts | undefined): string; (argThresholds?: moment.argThresholdOpts | undefined): string; }; abs: () => moment.Duration; as: (units: moment.unitOfTime.Base) => number; get: (units: moment.unitOfTime.Base) => number; milliseconds: () => number; asMilliseconds: () => number; seconds: () => number; asSeconds: () => number; minutes: () => number; asMinutes: () => number; hours: () => number; asHours: () => number; days: () => number; asDays: () => number; weeks: () => number; asWeeks: () => number; months: () => number; asMonths: () => number; years: () => number; asYears: () => number; add: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; subtract: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; locale: { (): string; (locale: moment.LocaleSpecifier): moment.Duration; }; localeData: () => moment.Locale; toISOString: () => string; toJSON: () => string; isValid: () => boolean; lang: { (locale: moment.LocaleSpecifier): moment.Moment; (): moment.Locale; }; toIsoString: () => string; }>; }>; elasticsearch: Readonly<{ readonly shardTimeout: Readonly<{ clone: () => moment.Duration; humanize: { (argWithSuffix?: boolean | undefined, argThresholds?: moment.argThresholdOpts | undefined): string; (argThresholds?: moment.argThresholdOpts | undefined): string; }; abs: () => moment.Duration; as: (units: moment.unitOfTime.Base) => number; get: (units: moment.unitOfTime.Base) => number; milliseconds: () => number; asMilliseconds: () => number; seconds: () => number; asSeconds: () => number; minutes: () => number; asMinutes: () => number; hours: () => number; asHours: () => number; days: () => number; asDays: () => number; weeks: () => number; asWeeks: () => number; months: () => number; asMonths: () => number; years: () => number; asYears: () => number; add: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; subtract: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; locale: { (): string; (locale: moment.LocaleSpecifier): moment.Duration; }; localeData: () => moment.Locale; toISOString: () => string; toJSON: () => string; isValid: () => boolean; lang: { (locale: moment.LocaleSpecifier): moment.Moment; (): moment.Locale; }; toIsoString: () => string; }>; readonly requestTimeout: Readonly<{ clone: () => moment.Duration; humanize: { (argWithSuffix?: boolean | undefined, argThresholds?: moment.argThresholdOpts | undefined): string; (argThresholds?: moment.argThresholdOpts | undefined): string; }; abs: () => moment.Duration; as: (units: moment.unitOfTime.Base) => number; get: (units: moment.unitOfTime.Base) => number; milliseconds: () => number; asMilliseconds: () => number; seconds: () => number; asSeconds: () => number; minutes: () => number; asMinutes: () => number; hours: () => number; asHours: () => number; days: () => number; asDays: () => number; weeks: () => number; asWeeks: () => number; months: () => number; asMonths: () => number; years: () => number; asYears: () => number; add: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; subtract: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; locale: { (): string; (locale: moment.LocaleSpecifier): moment.Duration; }; localeData: () => moment.Locale; toISOString: () => string; toJSON: () => string; isValid: () => boolean; lang: { (locale: moment.LocaleSpecifier): moment.Moment; (): moment.Locale; }; toIsoString: () => string; }>; readonly pingTimeout: Readonly<{ clone: () => moment.Duration; humanize: { (argWithSuffix?: boolean | undefined, argThresholds?: moment.argThresholdOpts | undefined): string; (argThresholds?: moment.argThresholdOpts | undefined): string; }; abs: () => moment.Duration; as: (units: moment.unitOfTime.Base) => number; get: (units: moment.unitOfTime.Base) => number; milliseconds: () => number; asMilliseconds: () => number; seconds: () => number; asSeconds: () => number; minutes: () => number; asMinutes: () => number; hours: () => number; asHours: () => number; days: () => number; asDays: () => number; weeks: () => number; asWeeks: () => number; months: () => number; asMonths: () => number; years: () => number; asYears: () => number; add: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; subtract: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; locale: { (): string; (locale: moment.LocaleSpecifier): moment.Duration; }; localeData: () => moment.Locale; toISOString: () => string; toJSON: () => string; isValid: () => boolean; lang: { (locale: moment.LocaleSpecifier): moment.Moment; (): moment.Locale; }; toIsoString: () => string; }>; }>; path: Readonly<{ readonly data: string; }>; savedObjects: Readonly<{ readonly maxImportPayloadBytes: Readonly<{ isGreaterThan: (other: ", + "(config: Readonly<{ kibana: Readonly<{ readonly index: string; }>; elasticsearch: Readonly<{ readonly shardTimeout: Readonly<{ clone: () => moment.Duration; humanize: { (argWithSuffix?: boolean | undefined, argThresholds?: moment.argThresholdOpts | undefined): string; (argThresholds?: moment.argThresholdOpts | undefined): string; }; abs: () => moment.Duration; as: (units: moment.unitOfTime.Base) => number; get: (units: moment.unitOfTime.Base) => number; milliseconds: () => number; asMilliseconds: () => number; seconds: () => number; asSeconds: () => number; minutes: () => number; asMinutes: () => number; hours: () => number; asHours: () => number; days: () => number; asDays: () => number; weeks: () => number; asWeeks: () => number; months: () => number; asMonths: () => number; years: () => number; asYears: () => number; add: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; subtract: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; locale: { (): string; (locale: moment.LocaleSpecifier): moment.Duration; }; localeData: () => moment.Locale; toISOString: () => string; toJSON: () => string; isValid: () => boolean; lang: { (locale: moment.LocaleSpecifier): moment.Moment; (): moment.Locale; }; toIsoString: () => string; }>; readonly requestTimeout: Readonly<{ clone: () => moment.Duration; humanize: { (argWithSuffix?: boolean | undefined, argThresholds?: moment.argThresholdOpts | undefined): string; (argThresholds?: moment.argThresholdOpts | undefined): string; }; abs: () => moment.Duration; as: (units: moment.unitOfTime.Base) => number; get: (units: moment.unitOfTime.Base) => number; milliseconds: () => number; asMilliseconds: () => number; seconds: () => number; asSeconds: () => number; minutes: () => number; asMinutes: () => number; hours: () => number; asHours: () => number; days: () => number; asDays: () => number; weeks: () => number; asWeeks: () => number; months: () => number; asMonths: () => number; years: () => number; asYears: () => number; add: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; subtract: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; locale: { (): string; (locale: moment.LocaleSpecifier): moment.Duration; }; localeData: () => moment.Locale; toISOString: () => string; toJSON: () => string; isValid: () => boolean; lang: { (locale: moment.LocaleSpecifier): moment.Moment; (): moment.Locale; }; toIsoString: () => string; }>; readonly pingTimeout: Readonly<{ clone: () => moment.Duration; humanize: { (argWithSuffix?: boolean | undefined, argThresholds?: moment.argThresholdOpts | undefined): string; (argThresholds?: moment.argThresholdOpts | undefined): string; }; abs: () => moment.Duration; as: (units: moment.unitOfTime.Base) => number; get: (units: moment.unitOfTime.Base) => number; milliseconds: () => number; asMilliseconds: () => number; seconds: () => number; asSeconds: () => number; minutes: () => number; asMinutes: () => number; hours: () => number; asHours: () => number; days: () => number; asDays: () => number; weeks: () => number; asWeeks: () => number; months: () => number; asMonths: () => number; years: () => number; asYears: () => number; add: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; subtract: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; locale: { (): string; (locale: moment.LocaleSpecifier): moment.Duration; }; localeData: () => moment.Locale; toISOString: () => string; toJSON: () => string; isValid: () => boolean; lang: { (locale: moment.LocaleSpecifier): moment.Moment; (): moment.Locale; }; toIsoString: () => string; }>; }>; path: Readonly<{ readonly data: string; }>; savedObjects: Readonly<{ readonly maxImportPayloadBytes: Readonly<{ isGreaterThan: (other: ", "ByteSizeValue", ") => boolean; isLessThan: (other: ", "ByteSizeValue", @@ -2298,7 +2298,7 @@ "label": "config", "description": [], "signature": [ - "Readonly<{ kibana: Readonly<{ readonly index: string; readonly autocompleteTerminateAfter: Readonly<{ clone: () => moment.Duration; humanize: { (argWithSuffix?: boolean | undefined, argThresholds?: moment.argThresholdOpts | undefined): string; (argThresholds?: moment.argThresholdOpts | undefined): string; }; abs: () => moment.Duration; as: (units: moment.unitOfTime.Base) => number; get: (units: moment.unitOfTime.Base) => number; milliseconds: () => number; asMilliseconds: () => number; seconds: () => number; asSeconds: () => number; minutes: () => number; asMinutes: () => number; hours: () => number; asHours: () => number; days: () => number; asDays: () => number; weeks: () => number; asWeeks: () => number; months: () => number; asMonths: () => number; years: () => number; asYears: () => number; add: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; subtract: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; locale: { (): string; (locale: moment.LocaleSpecifier): moment.Duration; }; localeData: () => moment.Locale; toISOString: () => string; toJSON: () => string; isValid: () => boolean; lang: { (locale: moment.LocaleSpecifier): moment.Moment; (): moment.Locale; }; toIsoString: () => string; }>; readonly autocompleteTimeout: Readonly<{ clone: () => moment.Duration; humanize: { (argWithSuffix?: boolean | undefined, argThresholds?: moment.argThresholdOpts | undefined): string; (argThresholds?: moment.argThresholdOpts | undefined): string; }; abs: () => moment.Duration; as: (units: moment.unitOfTime.Base) => number; get: (units: moment.unitOfTime.Base) => number; milliseconds: () => number; asMilliseconds: () => number; seconds: () => number; asSeconds: () => number; minutes: () => number; asMinutes: () => number; hours: () => number; asHours: () => number; days: () => number; asDays: () => number; weeks: () => number; asWeeks: () => number; months: () => number; asMonths: () => number; years: () => number; asYears: () => number; add: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; subtract: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; locale: { (): string; (locale: moment.LocaleSpecifier): moment.Duration; }; localeData: () => moment.Locale; toISOString: () => string; toJSON: () => string; isValid: () => boolean; lang: { (locale: moment.LocaleSpecifier): moment.Moment; (): moment.Locale; }; toIsoString: () => string; }>; }>; elasticsearch: Readonly<{ readonly shardTimeout: Readonly<{ clone: () => moment.Duration; humanize: { (argWithSuffix?: boolean | undefined, argThresholds?: moment.argThresholdOpts | undefined): string; (argThresholds?: moment.argThresholdOpts | undefined): string; }; abs: () => moment.Duration; as: (units: moment.unitOfTime.Base) => number; get: (units: moment.unitOfTime.Base) => number; milliseconds: () => number; asMilliseconds: () => number; seconds: () => number; asSeconds: () => number; minutes: () => number; asMinutes: () => number; hours: () => number; asHours: () => number; days: () => number; asDays: () => number; weeks: () => number; asWeeks: () => number; months: () => number; asMonths: () => number; years: () => number; asYears: () => number; add: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; subtract: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; locale: { (): string; (locale: moment.LocaleSpecifier): moment.Duration; }; localeData: () => moment.Locale; toISOString: () => string; toJSON: () => string; isValid: () => boolean; lang: { (locale: moment.LocaleSpecifier): moment.Moment; (): moment.Locale; }; toIsoString: () => string; }>; readonly requestTimeout: Readonly<{ clone: () => moment.Duration; humanize: { (argWithSuffix?: boolean | undefined, argThresholds?: moment.argThresholdOpts | undefined): string; (argThresholds?: moment.argThresholdOpts | undefined): string; }; abs: () => moment.Duration; as: (units: moment.unitOfTime.Base) => number; get: (units: moment.unitOfTime.Base) => number; milliseconds: () => number; asMilliseconds: () => number; seconds: () => number; asSeconds: () => number; minutes: () => number; asMinutes: () => number; hours: () => number; asHours: () => number; days: () => number; asDays: () => number; weeks: () => number; asWeeks: () => number; months: () => number; asMonths: () => number; years: () => number; asYears: () => number; add: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; subtract: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; locale: { (): string; (locale: moment.LocaleSpecifier): moment.Duration; }; localeData: () => moment.Locale; toISOString: () => string; toJSON: () => string; isValid: () => boolean; lang: { (locale: moment.LocaleSpecifier): moment.Moment; (): moment.Locale; }; toIsoString: () => string; }>; readonly pingTimeout: Readonly<{ clone: () => moment.Duration; humanize: { (argWithSuffix?: boolean | undefined, argThresholds?: moment.argThresholdOpts | undefined): string; (argThresholds?: moment.argThresholdOpts | undefined): string; }; abs: () => moment.Duration; as: (units: moment.unitOfTime.Base) => number; get: (units: moment.unitOfTime.Base) => number; milliseconds: () => number; asMilliseconds: () => number; seconds: () => number; asSeconds: () => number; minutes: () => number; asMinutes: () => number; hours: () => number; asHours: () => number; days: () => number; asDays: () => number; weeks: () => number; asWeeks: () => number; months: () => number; asMonths: () => number; years: () => number; asYears: () => number; add: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; subtract: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; locale: { (): string; (locale: moment.LocaleSpecifier): moment.Duration; }; localeData: () => moment.Locale; toISOString: () => string; toJSON: () => string; isValid: () => boolean; lang: { (locale: moment.LocaleSpecifier): moment.Moment; (): moment.Locale; }; toIsoString: () => string; }>; }>; path: Readonly<{ readonly data: string; }>; savedObjects: Readonly<{ readonly maxImportPayloadBytes: Readonly<{ isGreaterThan: (other: ", + "Readonly<{ kibana: Readonly<{ readonly index: string; }>; elasticsearch: Readonly<{ readonly shardTimeout: Readonly<{ clone: () => moment.Duration; humanize: { (argWithSuffix?: boolean | undefined, argThresholds?: moment.argThresholdOpts | undefined): string; (argThresholds?: moment.argThresholdOpts | undefined): string; }; abs: () => moment.Duration; as: (units: moment.unitOfTime.Base) => number; get: (units: moment.unitOfTime.Base) => number; milliseconds: () => number; asMilliseconds: () => number; seconds: () => number; asSeconds: () => number; minutes: () => number; asMinutes: () => number; hours: () => number; asHours: () => number; days: () => number; asDays: () => number; weeks: () => number; asWeeks: () => number; months: () => number; asMonths: () => number; years: () => number; asYears: () => number; add: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; subtract: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; locale: { (): string; (locale: moment.LocaleSpecifier): moment.Duration; }; localeData: () => moment.Locale; toISOString: () => string; toJSON: () => string; isValid: () => boolean; lang: { (locale: moment.LocaleSpecifier): moment.Moment; (): moment.Locale; }; toIsoString: () => string; }>; readonly requestTimeout: Readonly<{ clone: () => moment.Duration; humanize: { (argWithSuffix?: boolean | undefined, argThresholds?: moment.argThresholdOpts | undefined): string; (argThresholds?: moment.argThresholdOpts | undefined): string; }; abs: () => moment.Duration; as: (units: moment.unitOfTime.Base) => number; get: (units: moment.unitOfTime.Base) => number; milliseconds: () => number; asMilliseconds: () => number; seconds: () => number; asSeconds: () => number; minutes: () => number; asMinutes: () => number; hours: () => number; asHours: () => number; days: () => number; asDays: () => number; weeks: () => number; asWeeks: () => number; months: () => number; asMonths: () => number; years: () => number; asYears: () => number; add: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; subtract: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; locale: { (): string; (locale: moment.LocaleSpecifier): moment.Duration; }; localeData: () => moment.Locale; toISOString: () => string; toJSON: () => string; isValid: () => boolean; lang: { (locale: moment.LocaleSpecifier): moment.Moment; (): moment.Locale; }; toIsoString: () => string; }>; readonly pingTimeout: Readonly<{ clone: () => moment.Duration; humanize: { (argWithSuffix?: boolean | undefined, argThresholds?: moment.argThresholdOpts | undefined): string; (argThresholds?: moment.argThresholdOpts | undefined): string; }; abs: () => moment.Duration; as: (units: moment.unitOfTime.Base) => number; get: (units: moment.unitOfTime.Base) => number; milliseconds: () => number; asMilliseconds: () => number; seconds: () => number; asSeconds: () => number; minutes: () => number; asMinutes: () => number; hours: () => number; asHours: () => number; days: () => number; asDays: () => number; weeks: () => number; asWeeks: () => number; months: () => number; asMonths: () => number; years: () => number; asYears: () => number; add: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; subtract: (inp?: moment.DurationInputArg1, unit?: \"year\" | \"years\" | \"y\" | \"month\" | \"months\" | \"M\" | \"week\" | \"weeks\" | \"w\" | \"day\" | \"days\" | \"d\" | \"hour\" | \"hours\" | \"h\" | \"minute\" | \"minutes\" | \"m\" | \"second\" | \"seconds\" | \"s\" | \"millisecond\" | \"milliseconds\" | \"ms\" | \"quarter\" | \"quarters\" | \"Q\" | undefined) => moment.Duration; locale: { (): string; (locale: moment.LocaleSpecifier): moment.Duration; }; localeData: () => moment.Locale; toISOString: () => string; toJSON: () => string; isValid: () => boolean; lang: { (locale: moment.LocaleSpecifier): moment.Moment; (): moment.Locale; }; toIsoString: () => string; }>; }>; path: Readonly<{ readonly data: string; }>; savedObjects: Readonly<{ readonly maxImportPayloadBytes: Readonly<{ isGreaterThan: (other: ", "ByteSizeValue", ") => boolean; isLessThan: (other: ", "ByteSizeValue", @@ -4164,7 +4164,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 55 + "lineNumber": 57 }, "deprecated": false, "children": [ @@ -4184,7 +4184,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 63 + "lineNumber": 65 }, "deprecated": false, "children": [ @@ -4202,7 +4202,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 63 + "lineNumber": 65 }, "deprecated": false, "isRequired": true @@ -4236,7 +4236,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 83 + "lineNumber": 85 }, "deprecated": false, "children": [ @@ -4259,7 +4259,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 83 + "lineNumber": 85 }, "deprecated": false, "isRequired": true @@ -4287,7 +4287,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 92 + "lineNumber": 94 }, "deprecated": false }, @@ -4300,7 +4300,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 93 + "lineNumber": 95 }, "deprecated": false }, @@ -4313,7 +4313,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 94 + "lineNumber": 96 }, "deprecated": false }, @@ -4329,7 +4329,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 95 + "lineNumber": 97 }, "deprecated": false }, @@ -4352,7 +4352,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 96 + "lineNumber": 98 }, "deprecated": false }, @@ -4368,7 +4368,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 97 + "lineNumber": 99 }, "deprecated": false }, @@ -4384,7 +4384,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 98 + "lineNumber": 100 }, "deprecated": false }, @@ -4400,7 +4400,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 104 + "lineNumber": 106 }, "deprecated": false, "children": [ @@ -4422,7 +4422,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 104 + "lineNumber": 106 }, "deprecated": false, "isRequired": true @@ -4457,7 +4457,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 104 + "lineNumber": 106 }, "deprecated": false, "isRequired": true @@ -4481,7 +4481,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 134 + "lineNumber": 136 }, "deprecated": false, "children": [ @@ -4499,7 +4499,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 134 + "lineNumber": 136 }, "deprecated": false, "isRequired": true @@ -4519,7 +4519,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 171 + "lineNumber": 173 }, "deprecated": false, "children": [ @@ -4535,7 +4535,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 171 + "lineNumber": 173 }, "deprecated": false, "isRequired": true @@ -4543,6 +4543,42 @@ ], "returnComment": [] }, + { + "parentPluginId": "data", + "id": "def-common.AggConfig.hasTimeShift", + "type": "Function", + "tags": [], + "label": "hasTimeShift", + "description": [], + "signature": [ + "() => boolean" + ], + "source": { + "path": "src/plugins/data/common/search/aggs/agg_config.ts", + "lineNumber": 177 + }, + "deprecated": false, + "children": [], + "returnComment": [] + }, + { + "parentPluginId": "data", + "id": "def-common.AggConfig.getTimeShift", + "type": "Function", + "tags": [], + "label": "getTimeShift", + "description": [], + "signature": [ + "() => moment.Duration | undefined" + ], + "source": { + "path": "src/plugins/data/common/search/aggs/agg_config.ts", + "lineNumber": 181 + }, + "deprecated": false, + "children": [], + "returnComment": [] + }, { "parentPluginId": "data", "id": "def-common.AggConfig.write", @@ -4563,7 +4599,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 175 + "lineNumber": 202 }, "deprecated": false, "children": [ @@ -4586,7 +4622,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 175 + "lineNumber": 202 }, "deprecated": false, "isRequired": false @@ -4606,7 +4642,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 179 + "lineNumber": 206 }, "deprecated": false, "children": [], @@ -4624,7 +4660,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 183 + "lineNumber": 210 }, "deprecated": false, "children": [ @@ -4640,7 +4676,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 183 + "lineNumber": 210 }, "deprecated": false, "isRequired": true @@ -4657,7 +4693,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 183 + "lineNumber": 210 }, "deprecated": false, "isRequired": true @@ -4697,7 +4733,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 209 + "lineNumber": 236 }, "deprecated": false, "children": [ @@ -4721,7 +4757,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 209 + "lineNumber": 236 }, "deprecated": false, "isRequired": true @@ -4745,7 +4781,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 209 + "lineNumber": 236 }, "deprecated": false, "isRequired": false @@ -4777,7 +4813,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 230 + "lineNumber": 257 }, "deprecated": false, "children": [ @@ -4802,7 +4838,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 230 + "lineNumber": 257 }, "deprecated": false, "isRequired": false @@ -4826,7 +4862,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 265 + "lineNumber": 292 }, "deprecated": false, "children": [], @@ -4850,7 +4886,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 296 + "lineNumber": 323 }, "deprecated": true, "references": [ @@ -4879,7 +4915,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 307 + "lineNumber": 334 }, "deprecated": false, "children": [], @@ -4905,7 +4941,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 316 + "lineNumber": 343 }, "deprecated": false, "children": [], @@ -4941,7 +4977,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 371 + "lineNumber": 398 }, "deprecated": false, "children": [], @@ -4967,7 +5003,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 375 + "lineNumber": 402 }, "deprecated": false, "children": [], @@ -4993,7 +5029,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 379 + "lineNumber": 406 }, "deprecated": false, "children": [], @@ -5011,7 +5047,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 383 + "lineNumber": 410 }, "deprecated": false, "children": [ @@ -5027,7 +5063,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 383 + "lineNumber": 410 }, "deprecated": false, "isRequired": true @@ -5047,7 +5083,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 387 + "lineNumber": 414 }, "deprecated": false, "children": [ @@ -5063,7 +5099,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 387 + "lineNumber": 414 }, "deprecated": false, "isRequired": true @@ -5080,7 +5116,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 387 + "lineNumber": 414 }, "deprecated": false, "isRequired": false @@ -5100,7 +5136,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 395 + "lineNumber": 422 }, "deprecated": false, "children": [], @@ -5118,7 +5154,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 401 + "lineNumber": 428 }, "deprecated": false, "children": [], @@ -5138,7 +5174,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 410 + "lineNumber": 437 }, "deprecated": false, "children": [], @@ -5156,7 +5192,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 414 + "lineNumber": 441 }, "deprecated": false, "children": [ @@ -5172,7 +5208,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 414 + "lineNumber": 441 }, "deprecated": false, "isRequired": true @@ -5199,7 +5235,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 428 + "lineNumber": 455 }, "deprecated": false, "children": [], @@ -5225,7 +5261,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 432 + "lineNumber": 459 }, "deprecated": false, "children": [], @@ -5243,7 +5279,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 436 + "lineNumber": 463 }, "deprecated": false, "children": [], @@ -5261,7 +5297,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 441 + "lineNumber": 468 }, "deprecated": false, "children": [], @@ -5310,7 +5346,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 452 + "lineNumber": 479 }, "deprecated": false }, @@ -5357,7 +5393,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 456 + "lineNumber": 483 }, "deprecated": false }, @@ -5381,7 +5417,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 486 + "lineNumber": 513 }, "deprecated": false, "children": [ @@ -5403,7 +5439,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 486 + "lineNumber": 513 }, "deprecated": false, "isRequired": true @@ -5423,7 +5459,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 65 + "lineNumber": 76 }, "deprecated": false, "children": [ @@ -5445,7 +5481,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 66 + "lineNumber": 77 }, "deprecated": false }, @@ -5468,7 +5504,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 67 + "lineNumber": 78 }, "deprecated": false }, @@ -5484,7 +5520,23 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 68 + "lineNumber": 79 + }, + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-common.AggConfigs.forceNow", + "type": "Object", + "tags": [], + "label": "forceNow", + "description": [], + "signature": [ + "Date | undefined" + ], + "source": { + "path": "src/plugins/data/common/search/aggs/agg_configs.ts", + "lineNumber": 80 }, "deprecated": false }, @@ -5500,7 +5552,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 69 + "lineNumber": 81 }, "deprecated": false }, @@ -5523,7 +5575,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 73 + "lineNumber": 85 }, "deprecated": false }, @@ -5539,7 +5591,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 75 + "lineNumber": 87 }, "deprecated": false, "children": [ @@ -5561,7 +5613,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 76 + "lineNumber": 88 }, "deprecated": false, "isRequired": true @@ -5596,7 +5648,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 77 + "lineNumber": 89 }, "deprecated": false, "isRequired": true @@ -5619,7 +5671,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 78 + "lineNumber": 90 }, "deprecated": false, "isRequired": true @@ -5639,7 +5691,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 91 + "lineNumber": 103 }, "deprecated": false, "children": [ @@ -5655,7 +5707,43 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 91 + "lineNumber": 103 + }, + "deprecated": false, + "isRequired": false + } + ], + "returnComment": [] + }, + { + "parentPluginId": "data", + "id": "def-common.AggConfigs.setForceNow", + "type": "Function", + "tags": [], + "label": "setForceNow", + "description": [], + "signature": [ + "(now: Date | undefined) => void" + ], + "source": { + "path": "src/plugins/data/common/search/aggs/agg_configs.ts", + "lineNumber": 107 + }, + "deprecated": false, + "children": [ + { + "parentPluginId": "data", + "id": "def-common.AggConfigs.setForceNow.$1", + "type": "Object", + "tags": [], + "label": "now", + "description": [], + "signature": [ + "Date | undefined" + ], + "source": { + "path": "src/plugins/data/common/search/aggs/agg_configs.ts", + "lineNumber": 107 }, "deprecated": false, "isRequired": false @@ -5683,7 +5771,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 95 + "lineNumber": 111 }, "deprecated": false, "children": [ @@ -5705,7 +5793,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 95 + "lineNumber": 111 }, "deprecated": false, "isRequired": true @@ -5732,7 +5820,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 113 + "lineNumber": 129 }, "deprecated": false, "children": [ @@ -5748,7 +5836,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 113 + "lineNumber": 129 }, "deprecated": false, "isRequired": true @@ -5802,7 +5890,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 126 + "lineNumber": 142 }, "deprecated": false, "children": [ @@ -5836,7 +5924,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 127 + "lineNumber": 143 }, "deprecated": false, "isRequired": true @@ -5853,7 +5941,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 128 + "lineNumber": 144 }, "deprecated": false, "isRequired": true @@ -5883,7 +5971,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 169 + "lineNumber": 185 }, "deprecated": false, "children": [ @@ -5908,7 +5996,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 169 + "lineNumber": 185 }, "deprecated": false, "isRequired": true @@ -5928,7 +6016,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 181 + "lineNumber": 197 }, "deprecated": false, "children": [], @@ -5954,7 +6042,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 250 + "lineNumber": 287 }, "deprecated": false, "children": [], @@ -5979,7 +6067,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 254 + "lineNumber": 291 }, "deprecated": false, "children": [ @@ -5995,7 +6083,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 254 + "lineNumber": 291 }, "deprecated": false, "isRequired": true @@ -6023,7 +6111,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 258 + "lineNumber": 295 }, "deprecated": false, "children": [ @@ -6039,7 +6127,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 258 + "lineNumber": 295 }, "deprecated": false, "isRequired": true @@ -6067,7 +6155,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 262 + "lineNumber": 299 }, "deprecated": false, "children": [ @@ -6083,7 +6171,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 262 + "lineNumber": 299 }, "deprecated": false, "isRequired": true @@ -6111,7 +6199,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 266 + "lineNumber": 303 }, "deprecated": false, "children": [ @@ -6127,7 +6215,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 266 + "lineNumber": 303 }, "deprecated": false, "isRequired": true @@ -6155,7 +6243,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 270 + "lineNumber": 307 }, "deprecated": false, "children": [ @@ -6171,7 +6259,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 270 + "lineNumber": 307 }, "deprecated": false, "isRequired": true @@ -6199,7 +6287,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 274 + "lineNumber": 311 }, "deprecated": false, "children": [ @@ -6215,7 +6303,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 274 + "lineNumber": 311 }, "deprecated": false, "isRequired": true @@ -6243,12 +6331,169 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 278 + "lineNumber": 315 + }, + "deprecated": false, + "children": [], + "returnComment": [] + }, + { + "parentPluginId": "data", + "id": "def-common.AggConfigs.getTimeShifts", + "type": "Function", + "tags": [], + "label": "getTimeShifts", + "description": [], + "signature": [ + "() => Record" + ], + "source": { + "path": "src/plugins/data/common/search/aggs/agg_configs.ts", + "lineNumber": 329 + }, + "deprecated": false, + "children": [], + "returnComment": [] + }, + { + "parentPluginId": "data", + "id": "def-common.AggConfigs.getTimeShiftInterval", + "type": "Function", + "tags": [], + "label": "getTimeShiftInterval", + "description": [], + "signature": [ + "() => moment.Duration | undefined" + ], + "source": { + "path": "src/plugins/data/common/search/aggs/agg_configs.ts", + "lineNumber": 344 + }, + "deprecated": false, + "children": [], + "returnComment": [] + }, + { + "parentPluginId": "data", + "id": "def-common.AggConfigs.hasTimeShifts", + "type": "Function", + "tags": [], + "label": "hasTimeShifts", + "description": [], + "signature": [ + "() => boolean" + ], + "source": { + "path": "src/plugins/data/common/search/aggs/agg_configs.ts", + "lineNumber": 351 }, "deprecated": false, "children": [], "returnComment": [] }, + { + "parentPluginId": "data", + "id": "def-common.AggConfigs.getSearchSourceTimeFilter", + "type": "Function", + "tags": [], + "label": "getSearchSourceTimeFilter", + "description": [], + "signature": [ + "(forceNow?: Date | undefined) => ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataPluginApi", + "section": "def-common.RangeFilter", + "text": "RangeFilter" + }, + "[] | { meta: { index: string | undefined; params: {}; alias: string; disabled: boolean; negate: boolean; }; query: { bool: { should: { bool: { filter: { range: { [x: string]: { gte: string; lte: string; }; }; }[]; }; }[]; minimum_should_match: number; }; }; }[]" + ], + "source": { + "path": "src/plugins/data/common/search/aggs/agg_configs.ts", + "lineNumber": 355 + }, + "deprecated": false, + "children": [ + { + "parentPluginId": "data", + "id": "def-common.AggConfigs.getSearchSourceTimeFilter.$1", + "type": "Object", + "tags": [], + "label": "forceNow", + "description": [], + "signature": [ + "Date | undefined" + ], + "source": { + "path": "src/plugins/data/common/search/aggs/agg_configs.ts", + "lineNumber": 355 + }, + "deprecated": false, + "isRequired": false + } + ], + "returnComment": [] + }, + { + "parentPluginId": "data", + "id": "def-common.AggConfigs.postFlightTransform", + "type": "Function", + "tags": [], + "label": "postFlightTransform", + "description": [], + "signature": [ + "(response: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.IEsSearchResponse", + "text": "IEsSearchResponse" + }, + ") => ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.IEsSearchResponse", + "text": "IEsSearchResponse" + }, + "" + ], + "source": { + "path": "src/plugins/data/common/search/aggs/agg_configs.ts", + "lineNumber": 408 + }, + "deprecated": false, + "children": [ + { + "parentPluginId": "data", + "id": "def-common.AggConfigs.postFlightTransform.$1", + "type": "Object", + "tags": [], + "label": "response", + "description": [], + "signature": [ + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.IEsSearchResponse", + "text": "IEsSearchResponse" + }, + "" + ], + "source": { + "path": "src/plugins/data/common/search/aggs/agg_configs.ts", + "lineNumber": 408 + }, + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [] + }, { "parentPluginId": "data", "id": "def-common.AggConfigs.getRequestAggById", @@ -6269,7 +6514,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 292 + "lineNumber": 427 }, "deprecated": false, "children": [ @@ -6285,7 +6530,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 292 + "lineNumber": 427 }, "deprecated": false, "isRequired": true @@ -6317,7 +6562,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 307 + "lineNumber": 442 }, "deprecated": false, "children": [], @@ -6347,7 +6592,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 321 + "lineNumber": 456 }, "deprecated": false, "children": [ @@ -6365,7 +6610,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 321 + "lineNumber": 456 }, "deprecated": false, "isRequired": true @@ -6401,7 +6646,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 330 + "lineNumber": 465 }, "deprecated": false, "children": [ @@ -6425,7 +6670,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 330 + "lineNumber": 465 }, "deprecated": false, "isRequired": true @@ -6449,7 +6694,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 330 + "lineNumber": 465 }, "deprecated": false, "isRequired": false @@ -7629,6 +7874,73 @@ ], "returnComment": [] }, + { + "parentPluginId": "data", + "id": "def-common.AggType.splitForTimeShift", + "type": "Function", + "tags": [], + "label": "splitForTimeShift", + "description": [], + "signature": [ + "(agg: TAggConfig, aggs: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.AggConfigs", + "text": "AggConfigs" + }, + ") => boolean" + ], + "source": { + "path": "src/plugins/data/common/search/aggs/agg_type.ts", + "lineNumber": 218 + }, + "deprecated": false, + "children": [ + { + "parentPluginId": "data", + "id": "def-common.AggType.splitForTimeShift.$1", + "type": "Uncategorized", + "tags": [], + "label": "agg", + "description": [], + "signature": [ + "TAggConfig" + ], + "source": { + "path": "src/plugins/data/common/search/aggs/agg_type.ts", + "lineNumber": 218 + }, + "deprecated": false, + "isRequired": true + }, + { + "parentPluginId": "data", + "id": "def-common.AggType.splitForTimeShift.$2", + "type": "Object", + "tags": [], + "label": "aggs", + "description": [], + "signature": [ + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.AggConfigs", + "text": "AggConfigs" + } + ], + "source": { + "path": "src/plugins/data/common/search/aggs/agg_type.ts", + "lineNumber": 218 + }, + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [] + }, { "parentPluginId": "data", "id": "def-common.AggType.Unnamed", @@ -7646,7 +7958,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_type.ts", - "lineNumber": 227 + "lineNumber": 231 }, "deprecated": false, "children": [ @@ -7679,7 +7991,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_type.ts", - "lineNumber": 227 + "lineNumber": 231 }, "deprecated": false, "isRequired": true @@ -8296,7 +8608,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/buckets/bucket_agg_type.ts", - "lineNumber": 31 + "lineNumber": 40 }, "deprecated": false, "children": [ @@ -8312,7 +8624,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/buckets/bucket_agg_type.ts", - "lineNumber": 35 + "lineNumber": 44 }, "deprecated": false, "returnComment": [], @@ -8329,7 +8641,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/buckets/bucket_agg_type.ts", - "lineNumber": 35 + "lineNumber": 44 }, "deprecated": false }, @@ -8345,40 +8657,244 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/buckets/bucket_agg_type.ts", - "lineNumber": 35 + "lineNumber": 44 + }, + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-common.agg", + "type": "Uncategorized", + "tags": [], + "label": "agg", + "description": [], + "signature": [ + "TBucketAggConfig" + ], + "source": { + "path": "src/plugins/data/common/search/aggs/buckets/bucket_agg_type.ts", + "lineNumber": 44 }, "deprecated": false + } + ] + }, + { + "parentPluginId": "data", + "id": "def-common.BucketAggType.type", + "type": "string", + "tags": [], + "label": "type", + "description": [], + "source": { + "path": "src/plugins/data/common/search/aggs/buckets/bucket_agg_type.ts", + "lineNumber": 45 + }, + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-common.BucketAggType.getShiftedKey", + "type": "Function", + "tags": [], + "label": "getShiftedKey", + "description": [], + "signature": [ + "(agg: TBucketAggConfig, key: React.ReactText, timeShift: moment.Duration) => React.ReactText" + ], + "source": { + "path": "src/plugins/data/common/search/aggs/buckets/bucket_agg_type.ts", + "lineNumber": 47 + }, + "deprecated": false, + "children": [ + { + "parentPluginId": "data", + "id": "def-common.BucketAggType.getShiftedKey.$1", + "type": "Uncategorized", + "tags": [], + "label": "agg", + "description": [], + "signature": [ + "TBucketAggConfig" + ], + "source": { + "path": "src/plugins/data/common/search/aggs/buckets/bucket_agg_type.ts", + "lineNumber": 48 + }, + "deprecated": false, + "isRequired": true + }, + { + "parentPluginId": "data", + "id": "def-common.BucketAggType.getShiftedKey.$2", + "type": "CompoundType", + "tags": [], + "label": "key", + "description": [], + "signature": [ + "React.ReactText" + ], + "source": { + "path": "src/plugins/data/common/search/aggs/buckets/bucket_agg_type.ts", + "lineNumber": 49 + }, + "deprecated": false, + "isRequired": true + }, + { + "parentPluginId": "data", + "id": "def-common.BucketAggType.getShiftedKey.$3", + "type": "Object", + "tags": [], + "label": "timeShift", + "description": [], + "signature": [ + "moment.Duration" + ], + "source": { + "path": "src/plugins/data/common/search/aggs/buckets/bucket_agg_type.ts", + "lineNumber": 50 + }, + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "data", + "id": "def-common.BucketAggType.getTimeShiftInterval", + "type": "Function", + "tags": [], + "label": "getTimeShiftInterval", + "description": [], + "signature": [ + "(agg: TBucketAggConfig) => moment.Duration | undefined" + ], + "source": { + "path": "src/plugins/data/common/search/aggs/buckets/bucket_agg_type.ts", + "lineNumber": 55 + }, + "deprecated": false, + "children": [ + { + "parentPluginId": "data", + "id": "def-common.BucketAggType.getTimeShiftInterval.$1", + "type": "Uncategorized", + "tags": [], + "label": "agg", + "description": [], + "signature": [ + "TBucketAggConfig" + ], + "source": { + "path": "src/plugins/data/common/search/aggs/buckets/bucket_agg_type.ts", + "lineNumber": 55 + }, + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "data", + "id": "def-common.BucketAggType.orderBuckets", + "type": "Function", + "tags": [], + "label": "orderBuckets", + "description": [], + "signature": [ + "(agg: TBucketAggConfig, a: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.GenericBucket", + "text": "GenericBucket" + }, + ", b: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.GenericBucket", + "text": "GenericBucket" + }, + ") => number" + ], + "source": { + "path": "src/plugins/data/common/search/aggs/buckets/bucket_agg_type.ts", + "lineNumber": 59 + }, + "deprecated": false, + "children": [ + { + "parentPluginId": "data", + "id": "def-common.BucketAggType.orderBuckets.$1", + "type": "Uncategorized", + "tags": [], + "label": "agg", + "description": [], + "signature": [ + "TBucketAggConfig" + ], + "source": { + "path": "src/plugins/data/common/search/aggs/buckets/bucket_agg_type.ts", + "lineNumber": 59 + }, + "deprecated": false, + "isRequired": true + }, + { + "parentPluginId": "data", + "id": "def-common.BucketAggType.orderBuckets.$2", + "type": "CompoundType", + "tags": [], + "label": "a", + "description": [], + "signature": [ + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.GenericBucket", + "text": "GenericBucket" + } + ], + "source": { + "path": "src/plugins/data/common/search/aggs/buckets/bucket_agg_type.ts", + "lineNumber": 59 + }, + "deprecated": false, + "isRequired": true }, { "parentPluginId": "data", - "id": "def-common.agg", - "type": "Uncategorized", + "id": "def-common.BucketAggType.orderBuckets.$3", + "type": "CompoundType", "tags": [], - "label": "agg", + "label": "b", "description": [], "signature": [ - "TBucketAggConfig" + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.GenericBucket", + "text": "GenericBucket" + } ], "source": { "path": "src/plugins/data/common/search/aggs/buckets/bucket_agg_type.ts", - "lineNumber": 35 + "lineNumber": 59 }, - "deprecated": false + "deprecated": false, + "isRequired": true } - ] - }, - { - "parentPluginId": "data", - "id": "def-common.BucketAggType.type", - "type": "string", - "tags": [], - "label": "type", - "description": [], - "source": { - "path": "src/plugins/data/common/search/aggs/buckets/bucket_agg_type.ts", - "lineNumber": 36 - }, - "deprecated": false + ], + "returnComment": [] }, { "parentPluginId": "data", @@ -8392,7 +8908,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/buckets/bucket_agg_type.ts", - "lineNumber": 38 + "lineNumber": 63 }, "deprecated": false, "children": [ @@ -8408,7 +8924,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/buckets/bucket_agg_type.ts", - "lineNumber": 38 + "lineNumber": 63 }, "deprecated": false, "isRequired": true @@ -9091,7 +9607,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/metrics/metric_agg_type.ts", - "lineNumber": 37 + "lineNumber": 38 }, "deprecated": false, "children": [ @@ -9104,7 +9620,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/metrics/metric_agg_type.ts", - "lineNumber": 41 + "lineNumber": 42 }, "deprecated": false }, @@ -9120,7 +9636,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/metrics/metric_agg_type.ts", - "lineNumber": 42 + "lineNumber": 43 }, "deprecated": false, "returnComment": [], @@ -9135,7 +9651,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/metrics/metric_agg_type.ts", - "lineNumber": 43 + "lineNumber": 44 }, "deprecated": false }, @@ -9151,7 +9667,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/metrics/metric_agg_type.ts", - "lineNumber": 45 + "lineNumber": 46 }, "deprecated": false, "children": [], @@ -9169,7 +9685,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/metrics/metric_agg_type.ts", - "lineNumber": 47 + "lineNumber": 48 }, "deprecated": false, "children": [ @@ -9185,7 +9701,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/metrics/metric_agg_type.ts", - "lineNumber": 47 + "lineNumber": 48 }, "deprecated": false, "isRequired": true @@ -9431,7 +9947,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 121 + "lineNumber": 127 }, "deprecated": false, "children": [ @@ -9447,7 +9963,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 129 + "lineNumber": 135 }, "deprecated": false }, @@ -9463,7 +9979,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 133 + "lineNumber": 139 }, "deprecated": false, "children": [ @@ -9485,7 +10001,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 133 + "lineNumber": 139 }, "deprecated": false, "isRequired": true @@ -9508,7 +10024,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 133 + "lineNumber": 139 }, "deprecated": false, "isRequired": true @@ -9530,7 +10046,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 151 + "lineNumber": 157 }, "deprecated": false, "children": [ @@ -9546,7 +10062,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 151 + "lineNumber": 157 }, "deprecated": false, "isRequired": true @@ -9576,7 +10092,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 160 + "lineNumber": 166 }, "deprecated": false, "children": [ @@ -9594,7 +10110,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 160 + "lineNumber": 166 }, "deprecated": false, "isRequired": true @@ -9620,7 +10136,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 160 + "lineNumber": 166 }, "deprecated": false, "isRequired": true @@ -9642,7 +10158,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 172 + "lineNumber": 178 }, "deprecated": false, "children": [ @@ -9660,7 +10176,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 172 + "lineNumber": 178 }, "deprecated": false, "isRequired": true @@ -9692,7 +10208,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 183 + "lineNumber": 189 }, "deprecated": false, "children": [ @@ -9716,7 +10232,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 183 + "lineNumber": 189 }, "deprecated": false, "isRequired": true @@ -9738,7 +10254,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 191 + "lineNumber": 197 }, "deprecated": false, "children": [], @@ -9765,7 +10281,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 198 + "lineNumber": 204 }, "deprecated": false, "children": [], @@ -9793,7 +10309,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 205 + "lineNumber": 211 }, "deprecated": false, "children": [ @@ -9809,7 +10325,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 205 + "lineNumber": 211 }, "deprecated": false, "isRequired": true @@ -9826,7 +10342,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 205 + "lineNumber": 211 }, "deprecated": false, "isRequired": true @@ -9856,7 +10372,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 216 + "lineNumber": 222 }, "deprecated": false, "children": [ @@ -9872,7 +10388,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 216 + "lineNumber": 222 }, "deprecated": false, "isRequired": true @@ -9901,7 +10417,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 223 + "lineNumber": 229 }, "deprecated": true, "references": [ @@ -9909,14 +10425,14 @@ "plugin": "discover", "link": { "path": "src/plugins/discover/public/application/embeddable/search_embeddable.ts", - "lineNumber": 206 + "lineNumber": 207 } }, { "plugin": "discover", "link": { "path": "src/plugins/discover/public/application/embeddable/search_embeddable.ts", - "lineNumber": 212 + "lineNumber": 213 } } ], @@ -9944,7 +10460,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 230 + "lineNumber": 236 }, "deprecated": false, "children": [], @@ -9971,7 +10487,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 244 + "lineNumber": 250 }, "deprecated": false, "children": [ @@ -9987,7 +10503,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 244 + "lineNumber": 250 }, "deprecated": false, "isRequired": true @@ -10027,7 +10543,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 256 + "lineNumber": 262 }, "deprecated": false, "children": [ @@ -10053,7 +10569,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 256 + "lineNumber": 262 }, "deprecated": false, "isRequired": false @@ -10078,7 +10594,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 256 + "lineNumber": 262 }, "deprecated": false, "isRequired": true @@ -10112,7 +10628,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 266 + "lineNumber": 272 }, "deprecated": false, "children": [], @@ -10152,7 +10668,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 274 + "lineNumber": 280 }, "deprecated": false, "children": [ @@ -10174,7 +10690,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 275 + "lineNumber": 281 }, "deprecated": false, "isRequired": true @@ -10208,7 +10724,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 312 + "lineNumber": 318 }, "deprecated": true, "references": [ @@ -10219,13 +10735,6 @@ "lineNumber": 77 } }, - { - "plugin": "discover", - "link": { - "path": "src/plugins/discover/public/application/angular/context/api/anchor.ts", - "lineNumber": 57 - } - }, { "plugin": "maps", "link": { @@ -10267,7 +10776,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 312 + "lineNumber": 318 }, "deprecated": false, "isRequired": true @@ -10307,7 +10816,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 325 + "lineNumber": 331 }, "deprecated": false, "children": [ @@ -10339,7 +10848,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 326 + "lineNumber": 332 }, "deprecated": false, "isRequired": true @@ -10361,7 +10870,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 334 + "lineNumber": 340 }, "deprecated": false, "children": [], @@ -10383,7 +10892,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 342 + "lineNumber": 348 }, "deprecated": false, "children": [], @@ -10410,7 +10919,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 831 + "lineNumber": 848 }, "deprecated": false, "children": [ @@ -10426,7 +10935,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 831 + "lineNumber": 848 }, "deprecated": false, "isRequired": true @@ -10450,7 +10959,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 860 + "lineNumber": 877 }, "deprecated": false, "children": [], @@ -13926,7 +14435,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/buckets/terms.ts", - "lineNumber": 63 + "lineNumber": 64 }, "deprecated": false, "children": [], @@ -13982,7 +14491,7 @@ ], "source": { "path": "src/plugins/data/common/search/expressions/esaggs/request_handler.ts", - "lineNumber": 43 + "lineNumber": 35 }, "deprecated": false, "children": [ @@ -13998,7 +14507,7 @@ ], "source": { "path": "src/plugins/data/common/search/expressions/esaggs/request_handler.ts", - "lineNumber": 43 + "lineNumber": 35 }, "deprecated": false, "isRequired": true @@ -14251,7 +14760,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/buckets/bucket_agg_type.ts", - "lineNumber": 49 + "lineNumber": 90 }, "deprecated": false, "children": [ @@ -14267,7 +14776,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/buckets/bucket_agg_type.ts", - "lineNumber": 49 + "lineNumber": 90 }, "deprecated": false, "isRequired": true @@ -14433,7 +14942,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/metrics/metric_agg_type.ts", - "lineNumber": 75 + "lineNumber": 92 }, "deprecated": false, "children": [ @@ -14449,7 +14958,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/metrics/metric_agg_type.ts", - "lineNumber": 75 + "lineNumber": 92 }, "deprecated": false, "isRequired": true @@ -14926,6 +15435,45 @@ "returnComment": [], "initialIsOpen": false }, + { + "parentPluginId": "data", + "id": "def-common.parseTimeShift", + "type": "Function", + "tags": [], + "label": "parseTimeShift", + "description": [ + "\nThis method parses a string into a time shift duration.\nIf parsing fails, 'invalid' is returned.\nAllowed values are the string 'previous' and an integer followed by the units s,m,h,d,w,M,y" + ], + "signature": [ + "(val: string) => moment.Duration | \"previous\" | \"invalid\"" + ], + "source": { + "path": "src/plugins/data/common/search/aggs/utils/parse_time_shift.ts", + "lineNumber": 18 + }, + "deprecated": false, + "children": [ + { + "parentPluginId": "data", + "id": "def-common.parseTimeShift.$1", + "type": "string", + "tags": [], + "label": "val", + "description": [], + "signature": [ + "string" + ], + "source": { + "path": "src/plugins/data/common/search/aggs/utils/parse_time_shift.ts", + "lineNumber": 18 + }, + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, { "parentPluginId": "data", "id": "def-common.pollSearch", @@ -15561,7 +16109,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 44 + "lineNumber": 53 }, "deprecated": false, "children": [ @@ -15577,7 +16125,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 45 + "lineNumber": 54 }, "deprecated": false }, @@ -15593,7 +16141,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 46 + "lineNumber": 55 }, "deprecated": false } @@ -15611,7 +16159,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 195 + "lineNumber": 196 }, "deprecated": false, "children": [ @@ -15640,7 +16188,7 @@ "section": "def-common.BUCKET_TYPES", "text": "BUCKET_TYPES" }, - ".FILTER>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\"> & Pick<{ geo_bounding_box?: string | undefined; filter?: string | undefined; }, \"geo_bounding_box\"> & Pick<{ geo_bounding_box?: string | undefined; filter?: string | undefined; }, \"filter\">, \"enabled\" | \"id\" | \"filter\" | \"customLabel\" | \"schema\" | \"geo_bounding_box\" | \"json\">, ", + ".FILTER>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\"> & Pick<{ geo_bounding_box?: string | undefined; filter?: string | undefined; }, \"geo_bounding_box\"> & Pick<{ geo_bounding_box?: string | undefined; filter?: string | undefined; }, \"filter\">, \"enabled\" | \"id\" | \"filter\" | \"customLabel\" | \"schema\" | \"geo_bounding_box\" | \"json\" | \"timeShift\">, ", "AggExpressionType", ", ", { @@ -15664,7 +16212,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 196 + "lineNumber": 197 }, "deprecated": false }, @@ -15693,7 +16241,7 @@ "section": "def-common.BUCKET_TYPES", "text": "BUCKET_TYPES" }, - ".FILTERS>, \"enabled\" | \"id\" | \"schema\" | \"json\"> & Pick<{ filters?: string | undefined; }, \"filters\"> & Pick<{ filters?: string | undefined; }, never>, \"enabled\" | \"filters\" | \"id\" | \"schema\" | \"json\">, ", + ".FILTERS>, \"enabled\" | \"id\" | \"schema\" | \"json\" | \"timeShift\"> & Pick<{ filters?: string | undefined; }, \"filters\"> & Pick<{ filters?: string | undefined; }, never>, \"enabled\" | \"filters\" | \"id\" | \"schema\" | \"json\" | \"timeShift\">, ", "AggExpressionType", ", ", { @@ -15717,7 +16265,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 197 + "lineNumber": 198 }, "deprecated": false }, @@ -15770,7 +16318,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 198 + "lineNumber": 199 }, "deprecated": false }, @@ -15799,7 +16347,7 @@ "section": "def-common.BUCKET_TYPES", "text": "BUCKET_TYPES" }, - ".IP_RANGE>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"field\"> & Pick<{ ranges?: string | undefined; ipRangeType?: string | undefined; }, \"ipRangeType\" | \"ranges\"> & Pick<{ ranges?: string | undefined; ipRangeType?: string | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"field\" | \"ipRangeType\" | \"ranges\">, ", + ".IP_RANGE>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\"> & Pick<{ ranges?: string | undefined; ipRangeType?: string | undefined; }, \"ipRangeType\" | \"ranges\"> & Pick<{ ranges?: string | undefined; ipRangeType?: string | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\" | \"ipRangeType\" | \"ranges\">, ", "AggExpressionType", ", ", { @@ -15823,7 +16371,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 199 + "lineNumber": 200 }, "deprecated": false }, @@ -15852,7 +16400,7 @@ "section": "def-common.BUCKET_TYPES", "text": "BUCKET_TYPES" }, - ".DATE_RANGE>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"field\" | \"time_zone\"> & Pick<{ ranges?: string | undefined; }, \"ranges\"> & Pick<{ ranges?: string | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"field\" | \"ranges\" | \"time_zone\">, ", + ".DATE_RANGE>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\" | \"time_zone\"> & Pick<{ ranges?: string | undefined; }, \"ranges\"> & Pick<{ ranges?: string | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\" | \"ranges\" | \"time_zone\">, ", "AggExpressionType", ", ", { @@ -15876,7 +16424,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 200 + "lineNumber": 201 }, "deprecated": false }, @@ -15905,7 +16453,7 @@ "section": "def-common.BUCKET_TYPES", "text": "BUCKET_TYPES" }, - ".RANGE>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"field\"> & Pick<{ ranges?: string | undefined; }, \"ranges\"> & Pick<{ ranges?: string | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"field\" | \"ranges\">, ", + ".RANGE>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\"> & Pick<{ ranges?: string | undefined; }, \"ranges\"> & Pick<{ ranges?: string | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\" | \"ranges\">, ", "AggExpressionType", ", ", { @@ -15929,7 +16477,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 201 + "lineNumber": 202 }, "deprecated": false }, @@ -15982,7 +16530,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 202 + "lineNumber": 203 }, "deprecated": false }, @@ -16011,7 +16559,7 @@ "section": "def-common.BUCKET_TYPES", "text": "BUCKET_TYPES" }, - ".GEOHASH_GRID>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"field\" | \"autoPrecision\" | \"precision\" | \"useGeocentroid\" | \"isFilteredByCollar\"> & Pick<{ boundingBox?: string | undefined; }, \"boundingBox\"> & Pick<{ boundingBox?: string | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"field\" | \"autoPrecision\" | \"precision\" | \"useGeocentroid\" | \"isFilteredByCollar\" | \"boundingBox\">, ", + ".GEOHASH_GRID>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\" | \"autoPrecision\" | \"precision\" | \"useGeocentroid\" | \"isFilteredByCollar\"> & Pick<{ boundingBox?: string | undefined; }, \"boundingBox\"> & Pick<{ boundingBox?: string | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\" | \"autoPrecision\" | \"precision\" | \"useGeocentroid\" | \"isFilteredByCollar\" | \"boundingBox\">, ", "AggExpressionType", ", ", { @@ -16035,7 +16583,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 203 + "lineNumber": 204 }, "deprecated": false }, @@ -16064,7 +16612,7 @@ "section": "def-common.BUCKET_TYPES", "text": "BUCKET_TYPES" }, - ".HISTOGRAM>, \"enabled\" | \"interval\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"field\" | \"used_interval\" | \"maxBars\" | \"intervalBase\" | \"min_doc_count\" | \"has_extended_bounds\"> & Pick<{ extended_bounds?: string | undefined; }, \"extended_bounds\"> & Pick<{ extended_bounds?: string | undefined; }, never>, \"enabled\" | \"interval\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"field\" | \"used_interval\" | \"maxBars\" | \"intervalBase\" | \"min_doc_count\" | \"has_extended_bounds\" | \"extended_bounds\">, ", + ".HISTOGRAM>, \"enabled\" | \"interval\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\" | \"used_interval\" | \"maxBars\" | \"intervalBase\" | \"min_doc_count\" | \"has_extended_bounds\"> & Pick<{ extended_bounds?: string | undefined; }, \"extended_bounds\"> & Pick<{ extended_bounds?: string | undefined; }, never>, \"enabled\" | \"interval\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\" | \"used_interval\" | \"maxBars\" | \"intervalBase\" | \"min_doc_count\" | \"has_extended_bounds\" | \"extended_bounds\">, ", "AggExpressionType", ", ", { @@ -16088,7 +16636,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 204 + "lineNumber": 205 }, "deprecated": false }, @@ -16117,7 +16665,7 @@ "section": "def-common.BUCKET_TYPES", "text": "BUCKET_TYPES" }, - ".DATE_HISTOGRAM>, \"enabled\" | \"interval\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"field\" | \"time_zone\" | \"used_interval\" | \"min_doc_count\" | \"useNormalizedEsInterval\" | \"scaleMetricValues\" | \"used_time_zone\" | \"drop_partials\" | \"format\"> & Pick<{ timeRange?: string | undefined; extended_bounds?: string | undefined; }, \"timeRange\" | \"extended_bounds\"> & Pick<{ timeRange?: string | undefined; extended_bounds?: string | undefined; }, never>, \"enabled\" | \"interval\" | \"timeRange\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"field\" | \"time_zone\" | \"used_interval\" | \"min_doc_count\" | \"extended_bounds\" | \"useNormalizedEsInterval\" | \"scaleMetricValues\" | \"used_time_zone\" | \"drop_partials\" | \"format\">, ", + ".DATE_HISTOGRAM>, \"enabled\" | \"interval\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\" | \"time_zone\" | \"used_interval\" | \"min_doc_count\" | \"useNormalizedEsInterval\" | \"scaleMetricValues\" | \"used_time_zone\" | \"drop_partials\" | \"format\"> & Pick<{ timeRange?: string | undefined; extended_bounds?: string | undefined; }, \"timeRange\" | \"extended_bounds\"> & Pick<{ timeRange?: string | undefined; extended_bounds?: string | undefined; }, never>, \"enabled\" | \"interval\" | \"timeRange\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\" | \"time_zone\" | \"used_interval\" | \"min_doc_count\" | \"extended_bounds\" | \"useNormalizedEsInterval\" | \"scaleMetricValues\" | \"used_time_zone\" | \"drop_partials\" | \"format\">, ", "AggExpressionType", ", ", { @@ -16141,7 +16689,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 205 + "lineNumber": 206 }, "deprecated": false }, @@ -16170,11 +16718,11 @@ "section": "def-common.BUCKET_TYPES", "text": "BUCKET_TYPES" }, - ".TERMS>, \"enabled\" | \"id\" | \"size\" | \"customLabel\" | \"schema\" | \"json\" | \"field\" | \"orderBy\" | \"order\" | \"missingBucket\" | \"missingBucketLabel\" | \"otherBucket\" | \"otherBucketLabel\" | \"exclude\" | \"include\"> & Pick<{ orderAgg?: ", + ".TERMS>, \"enabled\" | \"id\" | \"size\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\" | \"orderBy\" | \"order\" | \"missingBucket\" | \"missingBucketLabel\" | \"otherBucket\" | \"otherBucketLabel\" | \"exclude\" | \"include\"> & Pick<{ orderAgg?: ", "AggExpressionType", " | undefined; }, \"orderAgg\"> & Pick<{ orderAgg?: ", "AggExpressionType", - " | undefined; }, never>, \"enabled\" | \"id\" | \"size\" | \"customLabel\" | \"schema\" | \"json\" | \"field\" | \"orderBy\" | \"orderAgg\" | \"order\" | \"missingBucket\" | \"missingBucketLabel\" | \"otherBucket\" | \"otherBucketLabel\" | \"exclude\" | \"include\">, ", + " | undefined; }, never>, \"enabled\" | \"id\" | \"size\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\" | \"orderBy\" | \"orderAgg\" | \"order\" | \"missingBucket\" | \"missingBucketLabel\" | \"otherBucket\" | \"otherBucketLabel\" | \"exclude\" | \"include\">, ", "AggExpressionType", ", ", { @@ -16198,7 +16746,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 206 + "lineNumber": 207 }, "deprecated": false }, @@ -16251,7 +16799,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 207 + "lineNumber": 208 }, "deprecated": false }, @@ -16280,7 +16828,7 @@ "section": "def-common.METRIC_TYPES", "text": "METRIC_TYPES" }, - ".AVG_BUCKET>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\"> & Pick<{ customBucket?: ", + ".AVG_BUCKET>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\"> & Pick<{ customBucket?: ", "AggExpressionType", " | undefined; customMetric?: ", "AggExpressionType", @@ -16288,7 +16836,7 @@ "AggExpressionType", " | undefined; customMetric?: ", "AggExpressionType", - " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"customMetric\" | \"customBucket\">, ", + " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"customMetric\" | \"customBucket\">, ", "AggExpressionType", ", ", { @@ -16312,7 +16860,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 208 + "lineNumber": 209 }, "deprecated": false }, @@ -16341,7 +16889,7 @@ "section": "def-common.METRIC_TYPES", "text": "METRIC_TYPES" }, - ".MAX_BUCKET>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\"> & Pick<{ customBucket?: ", + ".MAX_BUCKET>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\"> & Pick<{ customBucket?: ", "AggExpressionType", " | undefined; customMetric?: ", "AggExpressionType", @@ -16349,7 +16897,7 @@ "AggExpressionType", " | undefined; customMetric?: ", "AggExpressionType", - " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"customMetric\" | \"customBucket\">, ", + " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"customMetric\" | \"customBucket\">, ", "AggExpressionType", ", ", { @@ -16373,7 +16921,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 209 + "lineNumber": 210 }, "deprecated": false }, @@ -16402,7 +16950,7 @@ "section": "def-common.METRIC_TYPES", "text": "METRIC_TYPES" }, - ".MIN_BUCKET>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\"> & Pick<{ customBucket?: ", + ".MIN_BUCKET>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\"> & Pick<{ customBucket?: ", "AggExpressionType", " | undefined; customMetric?: ", "AggExpressionType", @@ -16410,7 +16958,7 @@ "AggExpressionType", " | undefined; customMetric?: ", "AggExpressionType", - " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"customMetric\" | \"customBucket\">, ", + " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"customMetric\" | \"customBucket\">, ", "AggExpressionType", ", ", { @@ -16434,7 +16982,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 210 + "lineNumber": 211 }, "deprecated": false }, @@ -16463,7 +17011,7 @@ "section": "def-common.METRIC_TYPES", "text": "METRIC_TYPES" }, - ".SUM_BUCKET>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\"> & Pick<{ customBucket?: ", + ".SUM_BUCKET>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\"> & Pick<{ customBucket?: ", "AggExpressionType", " | undefined; customMetric?: ", "AggExpressionType", @@ -16471,7 +17019,7 @@ "AggExpressionType", " | undefined; customMetric?: ", "AggExpressionType", - " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"customMetric\" | \"customBucket\">, ", + " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"customMetric\" | \"customBucket\">, ", "AggExpressionType", ", ", { @@ -16495,7 +17043,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 211 + "lineNumber": 212 }, "deprecated": false }, @@ -16524,7 +17072,7 @@ "section": "def-common.METRIC_TYPES", "text": "METRIC_TYPES" }, - ".FILTERED_METRIC>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\"> & Pick<{ customBucket?: ", + ".FILTERED_METRIC>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\"> & Pick<{ customBucket?: ", "AggExpressionType", " | undefined; customMetric?: ", "AggExpressionType", @@ -16532,7 +17080,7 @@ "AggExpressionType", " | undefined; customMetric?: ", "AggExpressionType", - " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"customMetric\" | \"customBucket\">, ", + " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"customMetric\" | \"customBucket\">, ", "AggExpressionType", ", ", { @@ -16556,7 +17104,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 212 + "lineNumber": 213 }, "deprecated": false }, @@ -16609,7 +17157,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 213 + "lineNumber": 214 }, "deprecated": false }, @@ -16662,7 +17210,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 214 + "lineNumber": 215 }, "deprecated": false }, @@ -16691,11 +17239,11 @@ "section": "def-common.METRIC_TYPES", "text": "METRIC_TYPES" }, - ".CUMULATIVE_SUM>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"buckets_path\" | \"metricAgg\"> & Pick<{ customMetric?: ", + ".CUMULATIVE_SUM>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"buckets_path\" | \"metricAgg\"> & Pick<{ customMetric?: ", "AggExpressionType", " | undefined; }, \"customMetric\"> & Pick<{ customMetric?: ", "AggExpressionType", - " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"customMetric\" | \"buckets_path\" | \"metricAgg\">, ", + " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"customMetric\" | \"buckets_path\" | \"metricAgg\">, ", "AggExpressionType", ", ", { @@ -16719,7 +17267,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 215 + "lineNumber": 216 }, "deprecated": false }, @@ -16748,11 +17296,11 @@ "section": "def-common.METRIC_TYPES", "text": "METRIC_TYPES" }, - ".DERIVATIVE>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"buckets_path\" | \"metricAgg\"> & Pick<{ customMetric?: ", + ".DERIVATIVE>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"buckets_path\" | \"metricAgg\"> & Pick<{ customMetric?: ", "AggExpressionType", " | undefined; }, \"customMetric\"> & Pick<{ customMetric?: ", "AggExpressionType", - " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"customMetric\" | \"buckets_path\" | \"metricAgg\">, ", + " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"customMetric\" | \"buckets_path\" | \"metricAgg\">, ", "AggExpressionType", ", ", { @@ -16776,7 +17324,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 216 + "lineNumber": 217 }, "deprecated": false }, @@ -16829,7 +17377,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 217 + "lineNumber": 218 }, "deprecated": false }, @@ -16882,7 +17430,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 218 + "lineNumber": 219 }, "deprecated": false }, @@ -16935,7 +17483,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 219 + "lineNumber": 220 }, "deprecated": false }, @@ -16988,7 +17536,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 220 + "lineNumber": 221 }, "deprecated": false }, @@ -17041,7 +17589,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 221 + "lineNumber": 222 }, "deprecated": false }, @@ -17094,7 +17642,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 222 + "lineNumber": 223 }, "deprecated": false }, @@ -17123,11 +17671,11 @@ "section": "def-common.METRIC_TYPES", "text": "METRIC_TYPES" }, - ".MOVING_FN>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"buckets_path\" | \"metricAgg\" | \"window\" | \"script\"> & Pick<{ customMetric?: ", + ".MOVING_FN>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"buckets_path\" | \"metricAgg\" | \"window\" | \"script\"> & Pick<{ customMetric?: ", "AggExpressionType", " | undefined; }, \"customMetric\"> & Pick<{ customMetric?: ", "AggExpressionType", - " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"customMetric\" | \"buckets_path\" | \"metricAgg\" | \"window\" | \"script\">, ", + " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"customMetric\" | \"buckets_path\" | \"metricAgg\" | \"window\" | \"script\">, ", "AggExpressionType", ", ", { @@ -17151,7 +17699,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 223 + "lineNumber": 224 }, "deprecated": false }, @@ -17204,7 +17752,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 224 + "lineNumber": 225 }, "deprecated": false }, @@ -17257,7 +17805,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 225 + "lineNumber": 226 }, "deprecated": false }, @@ -17286,11 +17834,11 @@ "section": "def-common.METRIC_TYPES", "text": "METRIC_TYPES" }, - ".SERIAL_DIFF>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"buckets_path\" | \"metricAgg\"> & Pick<{ customMetric?: ", + ".SERIAL_DIFF>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"buckets_path\" | \"metricAgg\"> & Pick<{ customMetric?: ", "AggExpressionType", " | undefined; }, \"customMetric\"> & Pick<{ customMetric?: ", "AggExpressionType", - " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"customMetric\" | \"buckets_path\" | \"metricAgg\">, ", + " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"customMetric\" | \"buckets_path\" | \"metricAgg\">, ", "AggExpressionType", ", ", { @@ -17314,7 +17862,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 226 + "lineNumber": 227 }, "deprecated": false }, @@ -17367,7 +17915,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 227 + "lineNumber": 228 }, "deprecated": false }, @@ -17420,7 +17968,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 228 + "lineNumber": 229 }, "deprecated": false }, @@ -17473,7 +18021,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/types.ts", - "lineNumber": 229 + "lineNumber": 230 }, "deprecated": false } @@ -18498,7 +19046,7 @@ }, " extends Pick<", "BaseAggParams", - ", \"json\">" + ", \"json\" | \"timeShift\">" ], "source": { "path": "src/plugins/data/common/search/aggs/buckets/filters.ts", @@ -19768,7 +20316,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/buckets/terms.ts", - "lineNumber": 48 + "lineNumber": 49 }, "deprecated": false, "children": [ @@ -19781,7 +20329,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/buckets/terms.ts", - "lineNumber": 49 + "lineNumber": 50 }, "deprecated": false }, @@ -19794,7 +20342,7 @@ "description": [], "source": { "path": "src/plugins/data/common/search/aggs/buckets/terms.ts", - "lineNumber": 50 + "lineNumber": 51 }, "deprecated": false }, @@ -19812,7 +20360,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/buckets/terms.ts", - "lineNumber": 51 + "lineNumber": 52 }, "deprecated": false }, @@ -19828,7 +20376,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/buckets/terms.ts", - "lineNumber": 52 + "lineNumber": 53 }, "deprecated": false }, @@ -19844,7 +20392,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/buckets/terms.ts", - "lineNumber": 53 + "lineNumber": 54 }, "deprecated": false }, @@ -19860,7 +20408,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/buckets/terms.ts", - "lineNumber": 54 + "lineNumber": 55 }, "deprecated": false }, @@ -19876,7 +20424,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/buckets/terms.ts", - "lineNumber": 55 + "lineNumber": 56 }, "deprecated": false }, @@ -19892,7 +20440,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/buckets/terms.ts", - "lineNumber": 56 + "lineNumber": 57 }, "deprecated": false }, @@ -19908,7 +20456,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/buckets/terms.ts", - "lineNumber": 57 + "lineNumber": 58 }, "deprecated": false }, @@ -19924,7 +20472,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/buckets/terms.ts", - "lineNumber": 59 + "lineNumber": 60 }, "deprecated": false }, @@ -19940,7 +20488,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/buckets/terms.ts", - "lineNumber": 60 + "lineNumber": 61 }, "deprecated": false } @@ -20497,7 +21045,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/buckets/bucket_agg_type.ts", - "lineNumber": 18 + "lineNumber": 19 }, "deprecated": false, "children": [ @@ -20513,7 +21061,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/buckets/bucket_agg_type.ts", - "lineNumber": 20 + "lineNumber": 21 }, "deprecated": false }, @@ -20544,7 +21092,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/buckets/bucket_agg_type.ts", - "lineNumber": 21 + "lineNumber": 22 }, "deprecated": false } @@ -21283,7 +21831,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/buckets/bucket_agg_type.ts", - "lineNumber": 14 + "lineNumber": 15 }, "deprecated": false, "children": [ @@ -21314,7 +21862,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/buckets/bucket_agg_type.ts", - "lineNumber": 15 + "lineNumber": 16 }, "deprecated": false } @@ -21839,7 +22387,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/metrics/metric_agg_type.ts", - "lineNumber": 16 + "lineNumber": 17 }, "deprecated": false, "children": [ @@ -21870,7 +22418,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/metrics/metric_agg_type.ts", - "lineNumber": 17 + "lineNumber": 18 }, "deprecated": false } @@ -22536,7 +23084,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/metrics/metric_agg_type.ts", - "lineNumber": 20 + "lineNumber": 21 }, "deprecated": false, "children": [ @@ -22567,7 +23115,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/metrics/metric_agg_type.ts", - "lineNumber": 22 + "lineNumber": 23 }, "deprecated": false }, @@ -22583,7 +23131,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/metrics/metric_agg_type.ts", - "lineNumber": 23 + "lineNumber": 24 }, "deprecated": false } @@ -23650,7 +24198,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 116 + "lineNumber": 122 }, "deprecated": false, "children": [ @@ -23708,7 +24256,7 @@ ], "source": { "path": "src/plugins/data/common/search/search_source/search_source.ts", - "lineNumber": 117 + "lineNumber": 123 }, "deprecated": false, "returnComment": [], @@ -24786,7 +25334,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 43 + "lineNumber": 45 }, "deprecated": false, "initialIsOpen": false @@ -25003,7 +25551,7 @@ "label": "AggGroupName", "description": [], "signature": [ - "\"buckets\" | \"metrics\" | \"none\"" + "\"none\" | \"buckets\" | \"metrics\"" ], "source": { "path": "src/plugins/data/common/search/aggs/agg_groups.ts", @@ -25512,7 +26060,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_configs.ts", - "lineNumber": 49 + "lineNumber": 58 }, "deprecated": false, "initialIsOpen": false @@ -26549,6 +27097,87 @@ "deprecated": false, "initialIsOpen": false }, + { + "parentPluginId": "data", + "id": "def-common.GenericBucket", + "type": "Type", + "tags": [], + "label": "GenericBucket", + "description": [], + "signature": [ + "(", + "CompositeBucketKeys", + " & { [property: string]: ", + "Aggregate", + "; }) | ({ [property: string]: ", + "Aggregate", + "; } & { [property: string]: ", + "Aggregate", + "; }) | (", + "DateHistogramBucketKeys", + " & { [property: string]: ", + "Aggregate", + "; }) | ({ [property: string]: ", + "Aggregate", + "; } & { [property: string]: ", + "Aggregate", + "; }) | (", + "FiltersBucketItemKeys", + " & { [property: string]: ", + "Aggregate", + "; }) | ({ [property: string]: ", + "Aggregate", + "; } & { [property: string]: ", + "Aggregate", + "; }) | (", + "IpRangeBucketKeys", + " & { [property: string]: ", + "Aggregate", + "; }) | ({ [property: string]: ", + "Aggregate", + "; } & { [property: string]: ", + "Aggregate", + "; }) | (", + "RangeBucketKeys", + " & { [property: string]: ", + "Aggregate", + "; }) | ({ [property: string]: ", + "Aggregate", + "; } & { [property: string]: ", + "Aggregate", + "; }) | ({ [property: string]: ", + "Aggregate", + "; } & { [property: string]: ", + "Aggregate", + "; }) | (", + "RareTermsBucketKeys", + " & { [property: string]: ", + "Aggregate", + "; }) | ({ [property: string]: ", + "Aggregate", + "; } & { [property: string]: ", + "Aggregate", + "; }) | (", + "SignificantTermsBucketKeys", + " & { [property: string]: ", + "Aggregate", + "; }) | ({ [property: string]: ", + "Aggregate", + "; } & { [property: string]: ", + "Aggregate", + "; }) | (", + "KeyedBucketKeys", + " & { [property: string]: ", + "Aggregate", + "; })" + ], + "source": { + "path": "src/plugins/data/common/search/aggs/agg_configs.ts", + "lineNumber": 60 + }, + "deprecated": false, + "initialIsOpen": false + }, { "parentPluginId": "data", "id": "def-common.IAggConfig", @@ -26570,7 +27199,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "lineNumber": 53 + "lineNumber": 55 }, "deprecated": false, "initialIsOpen": false @@ -26699,7 +27328,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/metrics/metric_agg_type.ts", - "lineNumber": 35 + "lineNumber": 36 }, "deprecated": false, "initialIsOpen": false @@ -27399,7 +28028,7 @@ ], "source": { "path": "src/plugins/data/common/search/aggs/buckets/terms.ts", - "lineNumber": 30 + "lineNumber": 31 }, "deprecated": false, "initialIsOpen": false @@ -30613,7 +31242,7 @@ "label": "types", "description": [], "signature": [ - "(\"string\" | \"number\")[]" + "(\"number\" | \"string\")[]" ], "source": { "path": "src/plugins/data/common/search/expressions/range.ts", @@ -30657,7 +31286,7 @@ "label": "types", "description": [], "signature": [ - "(\"string\" | \"number\")[]" + "(\"number\" | \"string\")[]" ], "source": { "path": "src/plugins/data/common/search/expressions/range.ts", @@ -30701,7 +31330,7 @@ "label": "types", "description": [], "signature": [ - "(\"string\" | \"number\")[]" + "(\"number\" | \"string\")[]" ], "source": { "path": "src/plugins/data/common/search/expressions/range.ts", @@ -30745,7 +31374,7 @@ "label": "types", "description": [], "signature": [ - "(\"string\" | \"number\")[]" + "(\"number\" | \"string\")[]" ], "source": { "path": "src/plugins/data/common/search/expressions/range.ts", diff --git a/api_docs/data_ui.json b/api_docs/data_ui.json index 5b4f11ee0cd9fa..4a532af99a115f 100644 --- a/api_docs/data_ui.json +++ b/api_docs/data_ui.json @@ -510,9 +510,9 @@ "signature": [ "Pick, \"children\" | \"onClick\" | \"color\" | \"onKeyDown\" | \"title\" | \"id\" | \"defaultChecked\" | \"defaultValue\" | \"suppressContentEditableWarning\" | \"suppressHydrationWarning\" | \"accessKey\" | \"className\" | \"contentEditable\" | \"contextMenu\" | \"dir\" | \"draggable\" | \"hidden\" | \"lang\" | \"placeholder\" | \"slot\" | \"spellCheck\" | \"style\" | \"tabIndex\" | \"translate\" | \"radioGroup\" | \"role\" | \"about\" | \"datatype\" | \"inlist\" | \"prefix\" | \"property\" | \"resource\" | \"typeof\" | \"vocab\" | \"autoCapitalize\" | \"autoCorrect\" | \"autoSave\" | \"itemProp\" | \"itemScope\" | \"itemType\" | \"itemID\" | \"itemRef\" | \"results\" | \"security\" | \"unselectable\" | \"inputMode\" | \"is\" | \"aria-activedescendant\" | \"aria-atomic\" | \"aria-autocomplete\" | \"aria-busy\" | \"aria-checked\" | \"aria-colcount\" | \"aria-colindex\" | \"aria-colspan\" | \"aria-controls\" | \"aria-current\" | \"aria-describedby\" | \"aria-details\" | \"aria-disabled\" | \"aria-dropeffect\" | \"aria-errormessage\" | \"aria-expanded\" | \"aria-flowto\" | \"aria-grabbed\" | \"aria-haspopup\" | \"aria-hidden\" | \"aria-invalid\" | \"aria-keyshortcuts\" | \"aria-label\" | \"aria-labelledby\" | \"aria-level\" | \"aria-live\" | \"aria-modal\" | \"aria-multiline\" | \"aria-multiselectable\" | \"aria-orientation\" | \"aria-owns\" | \"aria-placeholder\" | \"aria-posinset\" | \"aria-pressed\" | \"aria-readonly\" | \"aria-relevant\" | \"aria-required\" | \"aria-roledescription\" | \"aria-rowcount\" | \"aria-rowindex\" | \"aria-rowspan\" | \"aria-selected\" | \"aria-setsize\" | \"aria-sort\" | \"aria-valuemax\" | \"aria-valuemin\" | \"aria-valuenow\" | \"aria-valuetext\" | \"dangerouslySetInnerHTML\" | \"onCopy\" | \"onCopyCapture\" | \"onCut\" | \"onCutCapture\" | \"onPaste\" | \"onPasteCapture\" | \"onCompositionEnd\" | \"onCompositionEndCapture\" | \"onCompositionStart\" | \"onCompositionStartCapture\" | \"onCompositionUpdate\" | \"onCompositionUpdateCapture\" | \"onFocus\" | \"onFocusCapture\" | \"onBlur\" | \"onBlurCapture\" | \"onChangeCapture\" | \"onBeforeInput\" | \"onBeforeInputCapture\" | \"onInput\" | \"onInputCapture\" | \"onReset\" | \"onResetCapture\" | \"onSubmit\" | \"onSubmitCapture\" | \"onInvalid\" | \"onInvalidCapture\" | \"onLoad\" | \"onLoadCapture\" | \"onError\" | \"onErrorCapture\" | \"onKeyDownCapture\" | \"onKeyPress\" | \"onKeyPressCapture\" | \"onKeyUp\" | \"onKeyUpCapture\" | \"onAbort\" | \"onAbortCapture\" | \"onCanPlay\" | \"onCanPlayCapture\" | \"onCanPlayThrough\" | \"onCanPlayThroughCapture\" | \"onDurationChange\" | \"onDurationChangeCapture\" | \"onEmptied\" | \"onEmptiedCapture\" | \"onEncrypted\" | \"onEncryptedCapture\" | \"onEnded\" | \"onEndedCapture\" | \"onLoadedData\" | \"onLoadedDataCapture\" | \"onLoadedMetadata\" | \"onLoadedMetadataCapture\" | \"onLoadStart\" | \"onLoadStartCapture\" | \"onPause\" | \"onPauseCapture\" | \"onPlay\" | \"onPlayCapture\" | \"onPlaying\" | \"onPlayingCapture\" | \"onProgress\" | \"onProgressCapture\" | \"onRateChange\" | \"onRateChangeCapture\" | \"onSeeked\" | \"onSeekedCapture\" | \"onSeeking\" | \"onSeekingCapture\" | \"onStalled\" | \"onStalledCapture\" | \"onSuspend\" | \"onSuspendCapture\" | \"onTimeUpdate\" | \"onTimeUpdateCapture\" | \"onVolumeChange\" | \"onVolumeChangeCapture\" | \"onWaiting\" | \"onWaitingCapture\" | \"onAuxClick\" | \"onAuxClickCapture\" | \"onClickCapture\" | \"onContextMenu\" | \"onContextMenuCapture\" | \"onDoubleClick\" | \"onDoubleClickCapture\" | \"onDrag\" | \"onDragCapture\" | \"onDragEnd\" | \"onDragEndCapture\" | \"onDragEnter\" | \"onDragEnterCapture\" | \"onDragExit\" | \"onDragExitCapture\" | \"onDragLeave\" | \"onDragLeaveCapture\" | \"onDragOver\" | \"onDragOverCapture\" | \"onDragStart\" | \"onDragStartCapture\" | \"onDrop\" | \"onDropCapture\" | \"onMouseDown\" | \"onMouseDownCapture\" | \"onMouseEnter\" | \"onMouseLeave\" | \"onMouseMove\" | \"onMouseMoveCapture\" | \"onMouseOut\" | \"onMouseOutCapture\" | \"onMouseOver\" | \"onMouseOverCapture\" | \"onMouseUp\" | \"onMouseUpCapture\" | \"onSelect\" | \"onSelectCapture\" | \"onTouchCancel\" | \"onTouchCancelCapture\" | \"onTouchEnd\" | \"onTouchEndCapture\" | \"onTouchMove\" | \"onTouchMoveCapture\" | \"onTouchStart\" | \"onTouchStartCapture\" | \"onPointerDown\" | \"onPointerDownCapture\" | \"onPointerMove\" | \"onPointerMoveCapture\" | \"onPointerUp\" | \"onPointerUpCapture\" | \"onPointerCancel\" | \"onPointerCancelCapture\" | \"onPointerEnter\" | \"onPointerEnterCapture\" | \"onPointerLeave\" | \"onPointerLeaveCapture\" | \"onPointerOver\" | \"onPointerOverCapture\" | \"onPointerOut\" | \"onPointerOutCapture\" | \"onGotPointerCapture\" | \"onGotPointerCaptureCapture\" | \"onLostPointerCapture\" | \"onLostPointerCaptureCapture\" | \"onScroll\" | \"onScrollCapture\" | \"onWheel\" | \"onWheelCapture\" | \"onAnimationStart\" | \"onAnimationStartCapture\" | \"onAnimationEnd\" | \"onAnimationEndCapture\" | \"onAnimationIteration\" | \"onAnimationIterationCapture\" | \"onTransitionEnd\" | \"onTransitionEndCapture\" | \"css\" | \"data-test-subj\" | \"isClearable\" | \"async\" | \"compressed\" | \"fullWidth\" | \"singleSelection\" | \"prepend\" | \"append\" | \"sortMatchesBy\" | \"customOptionText\" | \"onCreateOption\" | \"renderOption\" | \"inputRef\" | \"isDisabled\" | \"isInvalid\" | \"noSuggestions\" | \"rowHeight\" | \"delimiter\">, \"children\" | \"onClick\" | \"color\" | \"onKeyDown\" | \"title\" | \"id\" | \"defaultChecked\" | \"defaultValue\" | \"suppressContentEditableWarning\" | \"suppressHydrationWarning\" | \"accessKey\" | \"className\" | \"contentEditable\" | \"contextMenu\" | \"dir\" | \"draggable\" | \"hidden\" | \"lang\" | \"slot\" | \"spellCheck\" | \"style\" | \"tabIndex\" | \"translate\" | \"radioGroup\" | \"role\" | \"about\" | \"datatype\" | \"inlist\" | \"prefix\" | \"property\" | \"resource\" | \"typeof\" | \"vocab\" | \"autoCapitalize\" | \"autoCorrect\" | \"autoSave\" | \"itemProp\" | \"itemScope\" | \"itemType\" | \"itemID\" | \"itemRef\" | \"results\" | \"security\" | \"unselectable\" | \"inputMode\" | \"is\" | \"aria-activedescendant\" | \"aria-atomic\" | \"aria-autocomplete\" | \"aria-busy\" | \"aria-checked\" | \"aria-colcount\" | \"aria-colindex\" | \"aria-colspan\" | \"aria-controls\" | \"aria-current\" | \"aria-describedby\" | \"aria-details\" | \"aria-disabled\" | \"aria-dropeffect\" | \"aria-errormessage\" | \"aria-expanded\" | \"aria-flowto\" | \"aria-grabbed\" | \"aria-haspopup\" | \"aria-hidden\" | \"aria-invalid\" | \"aria-keyshortcuts\" | \"aria-label\" | \"aria-labelledby\" | \"aria-level\" | \"aria-live\" | \"aria-modal\" | \"aria-multiline\" | \"aria-multiselectable\" | \"aria-orientation\" | \"aria-owns\" | \"aria-placeholder\" | \"aria-posinset\" | \"aria-pressed\" | \"aria-readonly\" | \"aria-relevant\" | \"aria-required\" | \"aria-roledescription\" | \"aria-rowcount\" | \"aria-rowindex\" | \"aria-rowspan\" | \"aria-selected\" | \"aria-setsize\" | \"aria-sort\" | \"aria-valuemax\" | \"aria-valuemin\" | \"aria-valuenow\" | \"aria-valuetext\" | \"dangerouslySetInnerHTML\" | \"onCopy\" | \"onCopyCapture\" | \"onCut\" | \"onCutCapture\" | \"onPaste\" | \"onPasteCapture\" | \"onCompositionEnd\" | \"onCompositionEndCapture\" | \"onCompositionStart\" | \"onCompositionStartCapture\" | \"onCompositionUpdate\" | \"onCompositionUpdateCapture\" | \"onFocus\" | \"onFocusCapture\" | \"onBlur\" | \"onBlurCapture\" | \"onChangeCapture\" | \"onBeforeInput\" | \"onBeforeInputCapture\" | \"onInput\" | \"onInputCapture\" | \"onReset\" | \"onResetCapture\" | \"onSubmit\" | \"onSubmitCapture\" | \"onInvalid\" | \"onInvalidCapture\" | \"onLoad\" | \"onLoadCapture\" | \"onError\" | \"onErrorCapture\" | \"onKeyDownCapture\" | \"onKeyPress\" | \"onKeyPressCapture\" | \"onKeyUp\" | \"onKeyUpCapture\" | \"onAbort\" | \"onAbortCapture\" | \"onCanPlay\" | \"onCanPlayCapture\" | \"onCanPlayThrough\" | \"onCanPlayThroughCapture\" | \"onDurationChange\" | \"onDurationChangeCapture\" | \"onEmptied\" | \"onEmptiedCapture\" | \"onEncrypted\" | \"onEncryptedCapture\" | \"onEnded\" | \"onEndedCapture\" | \"onLoadedData\" | \"onLoadedDataCapture\" | \"onLoadedMetadata\" | \"onLoadedMetadataCapture\" | \"onLoadStart\" | \"onLoadStartCapture\" | \"onPause\" | \"onPauseCapture\" | \"onPlay\" | \"onPlayCapture\" | \"onPlaying\" | \"onPlayingCapture\" | \"onProgress\" | \"onProgressCapture\" | \"onRateChange\" | \"onRateChangeCapture\" | \"onSeeked\" | \"onSeekedCapture\" | \"onSeeking\" | \"onSeekingCapture\" | \"onStalled\" | \"onStalledCapture\" | \"onSuspend\" | \"onSuspendCapture\" | \"onTimeUpdate\" | \"onTimeUpdateCapture\" | \"onVolumeChange\" | \"onVolumeChangeCapture\" | \"onWaiting\" | \"onWaitingCapture\" | \"onAuxClick\" | \"onAuxClickCapture\" | \"onClickCapture\" | \"onContextMenu\" | \"onContextMenuCapture\" | \"onDoubleClick\" | \"onDoubleClickCapture\" | \"onDrag\" | \"onDragCapture\" | \"onDragEnd\" | \"onDragEndCapture\" | \"onDragEnter\" | \"onDragEnterCapture\" | \"onDragExit\" | \"onDragExitCapture\" | \"onDragLeave\" | \"onDragLeaveCapture\" | \"onDragOver\" | \"onDragOverCapture\" | \"onDragStart\" | \"onDragStartCapture\" | \"onDrop\" | \"onDropCapture\" | \"onMouseDown\" | \"onMouseDownCapture\" | \"onMouseEnter\" | \"onMouseLeave\" | \"onMouseMove\" | \"onMouseMoveCapture\" | \"onMouseOut\" | \"onMouseOutCapture\" | \"onMouseOver\" | \"onMouseOverCapture\" | \"onMouseUp\" | \"onMouseUpCapture\" | \"onSelect\" | \"onSelectCapture\" | \"onTouchCancel\" | \"onTouchCancelCapture\" | \"onTouchEnd\" | \"onTouchEndCapture\" | \"onTouchMove\" | \"onTouchMoveCapture\" | \"onTouchStart\" | \"onTouchStartCapture\" | \"onPointerDown\" | \"onPointerDownCapture\" | \"onPointerMove\" | \"onPointerMoveCapture\" | \"onPointerUp\" | \"onPointerUpCapture\" | \"onPointerCancel\" | \"onPointerCancelCapture\" | \"onPointerEnter\" | \"onPointerEnterCapture\" | \"onPointerLeave\" | \"onPointerLeaveCapture\" | \"onPointerOver\" | \"onPointerOverCapture\" | \"onPointerOut\" | \"onPointerOutCapture\" | \"onGotPointerCapture\" | \"onGotPointerCaptureCapture\" | \"onLostPointerCapture\" | \"onLostPointerCaptureCapture\" | \"onScroll\" | \"onScrollCapture\" | \"onWheel\" | \"onWheelCapture\" | \"onAnimationStart\" | \"onAnimationStartCapture\" | \"onAnimationEnd\" | \"onAnimationEndCapture\" | \"onAnimationIteration\" | \"onAnimationIterationCapture\" | \"onTransitionEnd\" | \"onTransitionEndCapture\" | \"css\" | \"data-test-subj\" | \"isClearable\" | \"async\" | \"compressed\" | \"fullWidth\" | \"singleSelection\" | \"prepend\" | \"append\" | \"sortMatchesBy\" | \"customOptionText\" | \"onCreateOption\" | \"renderOption\" | \"inputRef\" | \"isDisabled\" | \"isInvalid\" | \"noSuggestions\" | \"rowHeight\" | \"delimiter\"> & Required, \"children\" | \"onClick\" | \"color\" | \"onKeyDown\" | \"title\" | \"id\" | \"defaultChecked\" | \"defaultValue\" | \"suppressContentEditableWarning\" | \"suppressHydrationWarning\" | \"accessKey\" | \"className\" | \"contentEditable\" | \"contextMenu\" | \"dir\" | \"draggable\" | \"hidden\" | \"lang\" | \"placeholder\" | \"slot\" | \"spellCheck\" | \"style\" | \"tabIndex\" | \"translate\" | \"radioGroup\" | \"role\" | \"about\" | \"datatype\" | \"inlist\" | \"prefix\" | \"property\" | \"resource\" | \"typeof\" | \"vocab\" | \"autoCapitalize\" | \"autoCorrect\" | \"autoSave\" | \"itemProp\" | \"itemScope\" | \"itemType\" | \"itemID\" | \"itemRef\" | \"results\" | \"security\" | \"unselectable\" | \"inputMode\" | \"is\" | \"aria-activedescendant\" | \"aria-atomic\" | \"aria-autocomplete\" | \"aria-busy\" | \"aria-checked\" | \"aria-colcount\" | \"aria-colindex\" | \"aria-colspan\" | \"aria-controls\" | \"aria-current\" | \"aria-describedby\" | \"aria-details\" | \"aria-disabled\" | \"aria-dropeffect\" | \"aria-errormessage\" | \"aria-expanded\" | \"aria-flowto\" | \"aria-grabbed\" | \"aria-haspopup\" | \"aria-hidden\" | \"aria-invalid\" | \"aria-keyshortcuts\" | \"aria-label\" | \"aria-labelledby\" | \"aria-level\" | \"aria-live\" | \"aria-modal\" | \"aria-multiline\" | \"aria-multiselectable\" | \"aria-orientation\" | \"aria-owns\" | \"aria-placeholder\" | \"aria-posinset\" | \"aria-pressed\" | \"aria-readonly\" | \"aria-relevant\" | \"aria-required\" | \"aria-roledescription\" | \"aria-rowcount\" | \"aria-rowindex\" | \"aria-rowspan\" | \"aria-selected\" | \"aria-setsize\" | \"aria-sort\" | \"aria-valuemax\" | \"aria-valuemin\" | \"aria-valuenow\" | \"aria-valuetext\" | \"dangerouslySetInnerHTML\" | \"onCopy\" | \"onCopyCapture\" | \"onCut\" | \"onCutCapture\" | \"onPaste\" | \"onPasteCapture\" | \"onCompositionEnd\" | \"onCompositionEndCapture\" | \"onCompositionStart\" | \"onCompositionStartCapture\" | \"onCompositionUpdate\" | \"onCompositionUpdateCapture\" | \"onFocus\" | \"onFocusCapture\" | \"onBlur\" | \"onBlurCapture\" | \"onChangeCapture\" | \"onBeforeInput\" | \"onBeforeInputCapture\" | \"onInput\" | \"onInputCapture\" | \"onReset\" | \"onResetCapture\" | \"onSubmit\" | \"onSubmitCapture\" | \"onInvalid\" | \"onInvalidCapture\" | \"onLoad\" | \"onLoadCapture\" | \"onError\" | \"onErrorCapture\" | \"onKeyDownCapture\" | \"onKeyPress\" | \"onKeyPressCapture\" | \"onKeyUp\" | \"onKeyUpCapture\" | \"onAbort\" | \"onAbortCapture\" | \"onCanPlay\" | \"onCanPlayCapture\" | \"onCanPlayThrough\" | \"onCanPlayThroughCapture\" | \"onDurationChange\" | \"onDurationChangeCapture\" | \"onEmptied\" | \"onEmptiedCapture\" | \"onEncrypted\" | \"onEncryptedCapture\" | \"onEnded\" | \"onEndedCapture\" | \"onLoadedData\" | \"onLoadedDataCapture\" | \"onLoadedMetadata\" | \"onLoadedMetadataCapture\" | \"onLoadStart\" | \"onLoadStartCapture\" | \"onPause\" | \"onPauseCapture\" | \"onPlay\" | \"onPlayCapture\" | \"onPlaying\" | \"onPlayingCapture\" | \"onProgress\" | \"onProgressCapture\" | \"onRateChange\" | \"onRateChangeCapture\" | \"onSeeked\" | \"onSeekedCapture\" | \"onSeeking\" | \"onSeekingCapture\" | \"onStalled\" | \"onStalledCapture\" | \"onSuspend\" | \"onSuspendCapture\" | \"onTimeUpdate\" | \"onTimeUpdateCapture\" | \"onVolumeChange\" | \"onVolumeChangeCapture\" | \"onWaiting\" | \"onWaitingCapture\" | \"onAuxClick\" | \"onAuxClickCapture\" | \"onClickCapture\" | \"onContextMenu\" | \"onContextMenuCapture\" | \"onDoubleClick\" | \"onDoubleClickCapture\" | \"onDrag\" | \"onDragCapture\" | \"onDragEnd\" | \"onDragEndCapture\" | \"onDragEnter\" | \"onDragEnterCapture\" | \"onDragExit\" | \"onDragExitCapture\" | \"onDragLeave\" | \"onDragLeaveCapture\" | \"onDragOver\" | \"onDragOverCapture\" | \"onDragStart\" | \"onDragStartCapture\" | \"onDrop\" | \"onDropCapture\" | \"onMouseDown\" | \"onMouseDownCapture\" | \"onMouseEnter\" | \"onMouseLeave\" | \"onMouseMove\" | \"onMouseMoveCapture\" | \"onMouseOut\" | \"onMouseOutCapture\" | \"onMouseOver\" | \"onMouseOverCapture\" | \"onMouseUp\" | \"onMouseUpCapture\" | \"onSelect\" | \"onSelectCapture\" | \"onTouchCancel\" | \"onTouchCancelCapture\" | \"onTouchEnd\" | \"onTouchEndCapture\" | \"onTouchMove\" | \"onTouchMoveCapture\" | \"onTouchStart\" | \"onTouchStartCapture\" | \"onPointerDown\" | \"onPointerDownCapture\" | \"onPointerMove\" | \"onPointerMoveCapture\" | \"onPointerUp\" | \"onPointerUpCapture\" | \"onPointerCancel\" | \"onPointerCancelCapture\" | \"onPointerEnter\" | \"onPointerEnterCapture\" | \"onPointerLeave\" | \"onPointerLeaveCapture\" | \"onPointerOver\" | \"onPointerOverCapture\" | \"onPointerOut\" | \"onPointerOutCapture\" | \"onGotPointerCapture\" | \"onGotPointerCaptureCapture\" | \"onLostPointerCapture\" | \"onLostPointerCaptureCapture\" | \"onScroll\" | \"onScrollCapture\" | \"onWheel\" | \"onWheelCapture\" | \"onAnimationStart\" | \"onAnimationStartCapture\" | \"onAnimationEnd\" | \"onAnimationEndCapture\" | \"onAnimationIteration\" | \"onAnimationIterationCapture\" | \"onTransitionEnd\" | \"onTransitionEndCapture\" | \"css\" | \"data-test-subj\" | \"isClearable\" | \"async\" | \"compressed\" | \"fullWidth\" | \"singleSelection\" | \"prepend\" | \"append\" | \"sortMatchesBy\" | \"autoFocus\" | \"customOptionText\" | \"onCreateOption\" | \"renderOption\" | \"inputRef\" | \"isDisabled\" | \"isInvalid\" | \"noSuggestions\" | \"rowHeight\" | \"delimiter\">, \"children\" | \"onClick\" | \"color\" | \"onKeyDown\" | \"title\" | \"id\" | \"defaultChecked\" | \"defaultValue\" | \"suppressContentEditableWarning\" | \"suppressHydrationWarning\" | \"accessKey\" | \"className\" | \"contentEditable\" | \"contextMenu\" | \"dir\" | \"draggable\" | \"hidden\" | \"lang\" | \"slot\" | \"spellCheck\" | \"style\" | \"tabIndex\" | \"translate\" | \"radioGroup\" | \"role\" | \"about\" | \"datatype\" | \"inlist\" | \"prefix\" | \"property\" | \"resource\" | \"typeof\" | \"vocab\" | \"autoCapitalize\" | \"autoCorrect\" | \"autoSave\" | \"itemProp\" | \"itemScope\" | \"itemType\" | \"itemID\" | \"itemRef\" | \"results\" | \"security\" | \"unselectable\" | \"inputMode\" | \"is\" | \"aria-activedescendant\" | \"aria-atomic\" | \"aria-autocomplete\" | \"aria-busy\" | \"aria-checked\" | \"aria-colcount\" | \"aria-colindex\" | \"aria-colspan\" | \"aria-controls\" | \"aria-current\" | \"aria-describedby\" | \"aria-details\" | \"aria-disabled\" | \"aria-dropeffect\" | \"aria-errormessage\" | \"aria-expanded\" | \"aria-flowto\" | \"aria-grabbed\" | \"aria-haspopup\" | \"aria-hidden\" | \"aria-invalid\" | \"aria-keyshortcuts\" | \"aria-label\" | \"aria-labelledby\" | \"aria-level\" | \"aria-live\" | \"aria-modal\" | \"aria-multiline\" | \"aria-multiselectable\" | \"aria-orientation\" | \"aria-owns\" | \"aria-placeholder\" | \"aria-posinset\" | \"aria-pressed\" | \"aria-readonly\" | \"aria-relevant\" | \"aria-required\" | \"aria-roledescription\" | \"aria-rowcount\" | \"aria-rowindex\" | \"aria-rowspan\" | \"aria-selected\" | \"aria-setsize\" | \"aria-sort\" | \"aria-valuemax\" | \"aria-valuemin\" | \"aria-valuenow\" | \"aria-valuetext\" | \"dangerouslySetInnerHTML\" | \"onCopy\" | \"onCopyCapture\" | \"onCut\" | \"onCutCapture\" | \"onPaste\" | \"onPasteCapture\" | \"onCompositionEnd\" | \"onCompositionEndCapture\" | \"onCompositionStart\" | \"onCompositionStartCapture\" | \"onCompositionUpdate\" | \"onCompositionUpdateCapture\" | \"onFocus\" | \"onFocusCapture\" | \"onBlur\" | \"onBlurCapture\" | \"onChangeCapture\" | \"onBeforeInput\" | \"onBeforeInputCapture\" | \"onInput\" | \"onInputCapture\" | \"onReset\" | \"onResetCapture\" | \"onSubmit\" | \"onSubmitCapture\" | \"onInvalid\" | \"onInvalidCapture\" | \"onLoad\" | \"onLoadCapture\" | \"onError\" | \"onErrorCapture\" | \"onKeyDownCapture\" | \"onKeyPress\" | \"onKeyPressCapture\" | \"onKeyUp\" | \"onKeyUpCapture\" | \"onAbort\" | \"onAbortCapture\" | \"onCanPlay\" | \"onCanPlayCapture\" | \"onCanPlayThrough\" | \"onCanPlayThroughCapture\" | \"onDurationChange\" | \"onDurationChangeCapture\" | \"onEmptied\" | \"onEmptiedCapture\" | \"onEncrypted\" | \"onEncryptedCapture\" | \"onEnded\" | \"onEndedCapture\" | \"onLoadedData\" | \"onLoadedDataCapture\" | \"onLoadedMetadata\" | \"onLoadedMetadataCapture\" | \"onLoadStart\" | \"onLoadStartCapture\" | \"onPause\" | \"onPauseCapture\" | \"onPlay\" | \"onPlayCapture\" | \"onPlaying\" | \"onPlayingCapture\" | \"onProgress\" | \"onProgressCapture\" | \"onRateChange\" | \"onRateChangeCapture\" | \"onSeeked\" | \"onSeekedCapture\" | \"onSeeking\" | \"onSeekingCapture\" | \"onStalled\" | \"onStalledCapture\" | \"onSuspend\" | \"onSuspendCapture\" | \"onTimeUpdate\" | \"onTimeUpdateCapture\" | \"onVolumeChange\" | \"onVolumeChangeCapture\" | \"onWaiting\" | \"onWaitingCapture\" | \"onAuxClick\" | \"onAuxClickCapture\" | \"onClickCapture\" | \"onContextMenu\" | \"onContextMenuCapture\" | \"onDoubleClick\" | \"onDoubleClickCapture\" | \"onDrag\" | \"onDragCapture\" | \"onDragEnd\" | \"onDragEndCapture\" | \"onDragEnter\" | \"onDragEnterCapture\" | \"onDragExit\" | \"onDragExitCapture\" | \"onDragLeave\" | \"onDragLeaveCapture\" | \"onDragOver\" | \"onDragOverCapture\" | \"onDragStart\" | \"onDragStartCapture\" | \"onDrop\" | \"onDropCapture\" | \"onMouseDown\" | \"onMouseDownCapture\" | \"onMouseEnter\" | \"onMouseLeave\" | \"onMouseMove\" | \"onMouseMoveCapture\" | \"onMouseOut\" | \"onMouseOutCapture\" | \"onMouseOver\" | \"onMouseOverCapture\" | \"onMouseUp\" | \"onMouseUpCapture\" | \"onSelect\" | \"onSelectCapture\" | \"onTouchCancel\" | \"onTouchCancelCapture\" | \"onTouchEnd\" | \"onTouchEndCapture\" | \"onTouchMove\" | \"onTouchMoveCapture\" | \"onTouchStart\" | \"onTouchStartCapture\" | \"onPointerDown\" | \"onPointerDownCapture\" | \"onPointerMove\" | \"onPointerMoveCapture\" | \"onPointerUp\" | \"onPointerUpCapture\" | \"onPointerCancel\" | \"onPointerCancelCapture\" | \"onPointerEnter\" | \"onPointerEnterCapture\" | \"onPointerLeave\" | \"onPointerLeaveCapture\" | \"onPointerOver\" | \"onPointerOverCapture\" | \"onPointerOut\" | \"onPointerOutCapture\" | \"onGotPointerCapture\" | \"onGotPointerCaptureCapture\" | \"onLostPointerCapture\" | \"onLostPointerCaptureCapture\" | \"onScroll\" | \"onScrollCapture\" | \"onWheel\" | \"onWheelCapture\" | \"onAnimationStart\" | \"onAnimationStartCapture\" | \"onAnimationEnd\" | \"onAnimationEndCapture\" | \"onAnimationIteration\" | \"onAnimationIterationCapture\" | \"onTransitionEnd\" | \"onTransitionEndCapture\" | \"css\" | \"data-test-subj\" | \"isClearable\" | \"async\" | \"compressed\" | \"fullWidth\" | \"singleSelection\" | \"prepend\" | \"append\" | \"sortMatchesBy\" | \"autoFocus\" | \"customOptionText\" | \"onCreateOption\" | \"renderOption\" | \"inputRef\" | \"isDisabled\" | \"isInvalid\" | \"noSuggestions\" | \"rowHeight\" | \"delimiter\"> & Required, \"children\" | \"onClick\" | \"color\" | \"onKeyDown\" | \"title\" | \"id\" | \"defaultChecked\" | \"defaultValue\" | \"suppressContentEditableWarning\" | \"suppressHydrationWarning\" | \"accessKey\" | \"className\" | \"contentEditable\" | \"contextMenu\" | \"dir\" | \"draggable\" | \"hidden\" | \"lang\" | \"placeholder\" | \"slot\" | \"spellCheck\" | \"style\" | \"tabIndex\" | \"translate\" | \"radioGroup\" | \"role\" | \"about\" | \"datatype\" | \"inlist\" | \"prefix\" | \"property\" | \"resource\" | \"typeof\" | \"vocab\" | \"autoCapitalize\" | \"autoCorrect\" | \"autoSave\" | \"itemProp\" | \"itemScope\" | \"itemType\" | \"itemID\" | \"itemRef\" | \"results\" | \"security\" | \"unselectable\" | \"inputMode\" | \"is\" | \"aria-activedescendant\" | \"aria-atomic\" | \"aria-autocomplete\" | \"aria-busy\" | \"aria-checked\" | \"aria-colcount\" | \"aria-colindex\" | \"aria-colspan\" | \"aria-controls\" | \"aria-current\" | \"aria-describedby\" | \"aria-details\" | \"aria-disabled\" | \"aria-dropeffect\" | \"aria-errormessage\" | \"aria-expanded\" | \"aria-flowto\" | \"aria-grabbed\" | \"aria-haspopup\" | \"aria-hidden\" | \"aria-invalid\" | \"aria-keyshortcuts\" | \"aria-label\" | \"aria-labelledby\" | \"aria-level\" | \"aria-live\" | \"aria-modal\" | \"aria-multiline\" | \"aria-multiselectable\" | \"aria-orientation\" | \"aria-owns\" | \"aria-placeholder\" | \"aria-posinset\" | \"aria-pressed\" | \"aria-readonly\" | \"aria-relevant\" | \"aria-required\" | \"aria-roledescription\" | \"aria-rowcount\" | \"aria-rowindex\" | \"aria-rowspan\" | \"aria-selected\" | \"aria-setsize\" | \"aria-sort\" | \"aria-valuemax\" | \"aria-valuemin\" | \"aria-valuenow\" | \"aria-valuetext\" | \"dangerouslySetInnerHTML\" | \"onCopy\" | \"onCopyCapture\" | \"onCut\" | \"onCutCapture\" | \"onPaste\" | \"onPasteCapture\" | \"onCompositionEnd\" | \"onCompositionEndCapture\" | \"onCompositionStart\" | \"onCompositionStartCapture\" | \"onCompositionUpdate\" | \"onCompositionUpdateCapture\" | \"onFocus\" | \"onFocusCapture\" | \"onBlur\" | \"onBlurCapture\" | \"onChangeCapture\" | \"onBeforeInput\" | \"onBeforeInputCapture\" | \"onInput\" | \"onInputCapture\" | \"onReset\" | \"onResetCapture\" | \"onSubmit\" | \"onSubmitCapture\" | \"onInvalid\" | \"onInvalidCapture\" | \"onLoad\" | \"onLoadCapture\" | \"onError\" | \"onErrorCapture\" | \"onKeyDownCapture\" | \"onKeyPress\" | \"onKeyPressCapture\" | \"onKeyUp\" | \"onKeyUpCapture\" | \"onAbort\" | \"onAbortCapture\" | \"onCanPlay\" | \"onCanPlayCapture\" | \"onCanPlayThrough\" | \"onCanPlayThroughCapture\" | \"onDurationChange\" | \"onDurationChangeCapture\" | \"onEmptied\" | \"onEmptiedCapture\" | \"onEncrypted\" | \"onEncryptedCapture\" | \"onEnded\" | \"onEndedCapture\" | \"onLoadedData\" | \"onLoadedDataCapture\" | \"onLoadedMetadata\" | \"onLoadedMetadataCapture\" | \"onLoadStart\" | \"onLoadStartCapture\" | \"onPause\" | \"onPauseCapture\" | \"onPlay\" | \"onPlayCapture\" | \"onPlaying\" | \"onPlayingCapture\" | \"onProgress\" | \"onProgressCapture\" | \"onRateChange\" | \"onRateChangeCapture\" | \"onSeeked\" | \"onSeekedCapture\" | \"onSeeking\" | \"onSeekingCapture\" | \"onStalled\" | \"onStalledCapture\" | \"onSuspend\" | \"onSuspendCapture\" | \"onTimeUpdate\" | \"onTimeUpdateCapture\" | \"onVolumeChange\" | \"onVolumeChangeCapture\" | \"onWaiting\" | \"onWaitingCapture\" | \"onAuxClick\" | \"onAuxClickCapture\" | \"onClickCapture\" | \"onContextMenu\" | \"onContextMenuCapture\" | \"onDoubleClick\" | \"onDoubleClickCapture\" | \"onDrag\" | \"onDragCapture\" | \"onDragEnd\" | \"onDragEndCapture\" | \"onDragEnter\" | \"onDragEnterCapture\" | \"onDragExit\" | \"onDragExitCapture\" | \"onDragLeave\" | \"onDragLeaveCapture\" | \"onDragOver\" | \"onDragOverCapture\" | \"onDragStart\" | \"onDragStartCapture\" | \"onDrop\" | \"onDropCapture\" | \"onMouseDown\" | \"onMouseDownCapture\" | \"onMouseEnter\" | \"onMouseLeave\" | \"onMouseMove\" | \"onMouseMoveCapture\" | \"onMouseOut\" | \"onMouseOutCapture\" | \"onMouseOver\" | \"onMouseOverCapture\" | \"onMouseUp\" | \"onMouseUpCapture\" | \"onSelect\" | \"onSelectCapture\" | \"onTouchCancel\" | \"onTouchCancelCapture\" | \"onTouchEnd\" | \"onTouchEndCapture\" | \"onTouchMove\" | \"onTouchMoveCapture\" | \"onTouchStart\" | \"onTouchStartCapture\" | \"onPointerDown\" | \"onPointerDownCapture\" | \"onPointerMove\" | \"onPointerMoveCapture\" | \"onPointerUp\" | \"onPointerUpCapture\" | \"onPointerCancel\" | \"onPointerCancelCapture\" | \"onPointerEnter\" | \"onPointerEnterCapture\" | \"onPointerLeave\" | \"onPointerLeaveCapture\" | \"onPointerOver\" | \"onPointerOverCapture\" | \"onPointerOut\" | \"onPointerOutCapture\" | \"onGotPointerCapture\" | \"onGotPointerCaptureCapture\" | \"onLostPointerCapture\" | \"onLostPointerCaptureCapture\" | \"onScroll\" | \"onScrollCapture\" | \"onWheel\" | \"onWheelCapture\" | \"onAnimationStart\" | \"onAnimationStartCapture\" | \"onAnimationEnd\" | \"onAnimationEndCapture\" | \"onAnimationIteration\" | \"onAnimationIterationCapture\" | \"onTransitionEnd\" | \"onTransitionEndCapture\" | \"css\" | \"data-test-subj\" | \"isClearable\" | \"async\" | \"compressed\" | \"fullWidth\" | \"singleSelection\" | \"prepend\" | \"append\" | \"sortMatchesBy\" | \"customOptionText\" | \"onCreateOption\" | \"renderOption\" | \"inputRef\" | \"isDisabled\" | \"isInvalid\" | \"noSuggestions\" | \"rowHeight\" | \"delimiter\">, \"placeholder\">> & { onChange: (indexPatternId?: string | undefined) => void; indexPatternId: string; onNoIndexPatterns?: (() => void) | undefined; }" + ", \"children\" | \"onClick\" | \"color\" | \"onKeyDown\" | \"title\" | \"id\" | \"defaultChecked\" | \"defaultValue\" | \"suppressContentEditableWarning\" | \"suppressHydrationWarning\" | \"accessKey\" | \"className\" | \"contentEditable\" | \"contextMenu\" | \"dir\" | \"draggable\" | \"hidden\" | \"lang\" | \"placeholder\" | \"slot\" | \"spellCheck\" | \"style\" | \"tabIndex\" | \"translate\" | \"radioGroup\" | \"role\" | \"about\" | \"datatype\" | \"inlist\" | \"prefix\" | \"property\" | \"resource\" | \"typeof\" | \"vocab\" | \"autoCapitalize\" | \"autoCorrect\" | \"autoSave\" | \"itemProp\" | \"itemScope\" | \"itemType\" | \"itemID\" | \"itemRef\" | \"results\" | \"security\" | \"unselectable\" | \"inputMode\" | \"is\" | \"aria-activedescendant\" | \"aria-atomic\" | \"aria-autocomplete\" | \"aria-busy\" | \"aria-checked\" | \"aria-colcount\" | \"aria-colindex\" | \"aria-colspan\" | \"aria-controls\" | \"aria-current\" | \"aria-describedby\" | \"aria-details\" | \"aria-disabled\" | \"aria-dropeffect\" | \"aria-errormessage\" | \"aria-expanded\" | \"aria-flowto\" | \"aria-grabbed\" | \"aria-haspopup\" | \"aria-hidden\" | \"aria-invalid\" | \"aria-keyshortcuts\" | \"aria-label\" | \"aria-labelledby\" | \"aria-level\" | \"aria-live\" | \"aria-modal\" | \"aria-multiline\" | \"aria-multiselectable\" | \"aria-orientation\" | \"aria-owns\" | \"aria-placeholder\" | \"aria-posinset\" | \"aria-pressed\" | \"aria-readonly\" | \"aria-relevant\" | \"aria-required\" | \"aria-roledescription\" | \"aria-rowcount\" | \"aria-rowindex\" | \"aria-rowspan\" | \"aria-selected\" | \"aria-setsize\" | \"aria-sort\" | \"aria-valuemax\" | \"aria-valuemin\" | \"aria-valuenow\" | \"aria-valuetext\" | \"dangerouslySetInnerHTML\" | \"onCopy\" | \"onCopyCapture\" | \"onCut\" | \"onCutCapture\" | \"onPaste\" | \"onPasteCapture\" | \"onCompositionEnd\" | \"onCompositionEndCapture\" | \"onCompositionStart\" | \"onCompositionStartCapture\" | \"onCompositionUpdate\" | \"onCompositionUpdateCapture\" | \"onFocus\" | \"onFocusCapture\" | \"onBlur\" | \"onBlurCapture\" | \"onChangeCapture\" | \"onBeforeInput\" | \"onBeforeInputCapture\" | \"onInput\" | \"onInputCapture\" | \"onReset\" | \"onResetCapture\" | \"onSubmit\" | \"onSubmitCapture\" | \"onInvalid\" | \"onInvalidCapture\" | \"onLoad\" | \"onLoadCapture\" | \"onError\" | \"onErrorCapture\" | \"onKeyDownCapture\" | \"onKeyPress\" | \"onKeyPressCapture\" | \"onKeyUp\" | \"onKeyUpCapture\" | \"onAbort\" | \"onAbortCapture\" | \"onCanPlay\" | \"onCanPlayCapture\" | \"onCanPlayThrough\" | \"onCanPlayThroughCapture\" | \"onDurationChange\" | \"onDurationChangeCapture\" | \"onEmptied\" | \"onEmptiedCapture\" | \"onEncrypted\" | \"onEncryptedCapture\" | \"onEnded\" | \"onEndedCapture\" | \"onLoadedData\" | \"onLoadedDataCapture\" | \"onLoadedMetadata\" | \"onLoadedMetadataCapture\" | \"onLoadStart\" | \"onLoadStartCapture\" | \"onPause\" | \"onPauseCapture\" | \"onPlay\" | \"onPlayCapture\" | \"onPlaying\" | \"onPlayingCapture\" | \"onProgress\" | \"onProgressCapture\" | \"onRateChange\" | \"onRateChangeCapture\" | \"onSeeked\" | \"onSeekedCapture\" | \"onSeeking\" | \"onSeekingCapture\" | \"onStalled\" | \"onStalledCapture\" | \"onSuspend\" | \"onSuspendCapture\" | \"onTimeUpdate\" | \"onTimeUpdateCapture\" | \"onVolumeChange\" | \"onVolumeChangeCapture\" | \"onWaiting\" | \"onWaitingCapture\" | \"onAuxClick\" | \"onAuxClickCapture\" | \"onClickCapture\" | \"onContextMenu\" | \"onContextMenuCapture\" | \"onDoubleClick\" | \"onDoubleClickCapture\" | \"onDrag\" | \"onDragCapture\" | \"onDragEnd\" | \"onDragEndCapture\" | \"onDragEnter\" | \"onDragEnterCapture\" | \"onDragExit\" | \"onDragExitCapture\" | \"onDragLeave\" | \"onDragLeaveCapture\" | \"onDragOver\" | \"onDragOverCapture\" | \"onDragStart\" | \"onDragStartCapture\" | \"onDrop\" | \"onDropCapture\" | \"onMouseDown\" | \"onMouseDownCapture\" | \"onMouseEnter\" | \"onMouseLeave\" | \"onMouseMove\" | \"onMouseMoveCapture\" | \"onMouseOut\" | \"onMouseOutCapture\" | \"onMouseOver\" | \"onMouseOverCapture\" | \"onMouseUp\" | \"onMouseUpCapture\" | \"onSelect\" | \"onSelectCapture\" | \"onTouchCancel\" | \"onTouchCancelCapture\" | \"onTouchEnd\" | \"onTouchEndCapture\" | \"onTouchMove\" | \"onTouchMoveCapture\" | \"onTouchStart\" | \"onTouchStartCapture\" | \"onPointerDown\" | \"onPointerDownCapture\" | \"onPointerMove\" | \"onPointerMoveCapture\" | \"onPointerUp\" | \"onPointerUpCapture\" | \"onPointerCancel\" | \"onPointerCancelCapture\" | \"onPointerEnter\" | \"onPointerEnterCapture\" | \"onPointerLeave\" | \"onPointerLeaveCapture\" | \"onPointerOver\" | \"onPointerOverCapture\" | \"onPointerOut\" | \"onPointerOutCapture\" | \"onGotPointerCapture\" | \"onGotPointerCaptureCapture\" | \"onLostPointerCapture\" | \"onLostPointerCaptureCapture\" | \"onScroll\" | \"onScrollCapture\" | \"onWheel\" | \"onWheelCapture\" | \"onAnimationStart\" | \"onAnimationStartCapture\" | \"onAnimationEnd\" | \"onAnimationEndCapture\" | \"onAnimationIteration\" | \"onAnimationIterationCapture\" | \"onTransitionEnd\" | \"onTransitionEndCapture\" | \"css\" | \"data-test-subj\" | \"isClearable\" | \"async\" | \"compressed\" | \"fullWidth\" | \"singleSelection\" | \"prepend\" | \"append\" | \"sortMatchesBy\" | \"autoFocus\" | \"customOptionText\" | \"onCreateOption\" | \"renderOption\" | \"inputRef\" | \"isDisabled\" | \"isInvalid\" | \"noSuggestions\" | \"rowHeight\" | \"delimiter\">, \"placeholder\">> & { onChange: (indexPatternId?: string | undefined) => void; indexPatternId: string; onNoIndexPatterns?: (() => void) | undefined; }" ], "source": { "path": "src/plugins/data/public/ui/index_pattern_select/index_pattern_select.tsx", diff --git a/api_docs/deprecations.mdx b/api_docs/deprecations.mdx index 99edad62075bce..36acb26d4b9917 100644 --- a/api_docs/deprecations.mdx +++ b/api_docs/deprecations.mdx @@ -82,14 +82,8 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | Deprecated API | Reference location | Remove By | | ---------------|-----------|-----------| -| | [plugin.ts#L13](https://github.com/elastic/kibana/tree/master/x-pack/plugins/cross_cluster_replication/server/plugin.ts#L13) | 7.16 | -| | [plugin.ts#L69](https://github.com/elastic/kibana/tree/master/x-pack/plugins/cross_cluster_replication/server/plugin.ts#L69) | 7.16 | -| | [types.ts#L8](https://github.com/elastic/kibana/tree/master/x-pack/plugins/cross_cluster_replication/server/types.ts#L8) | 7.16 | -| | [types.ts#L41](https://github.com/elastic/kibana/tree/master/x-pack/plugins/cross_cluster_replication/server/types.ts#L41) | 7.16 | -| | [types.d.ts#L1](https://github.com/elastic/kibana/tree/master/x-pack/plugins/cross_cluster_replication/target/types/server/types.d.ts#L1) | 7.16 | -| | [types.d.ts#L30](https://github.com/elastic/kibana/tree/master/x-pack/plugins/cross_cluster_replication/target/types/server/types.d.ts#L30) | 7.16 | -| | [plugin.ts#L17](https://github.com/elastic/kibana/tree/master/x-pack/plugins/cross_cluster_replication/server/plugin.ts#L17) | 7.16 | -| | [plugin.ts#L36](https://github.com/elastic/kibana/tree/master/x-pack/plugins/cross_cluster_replication/server/plugin.ts#L36) | 7.16 | +| | [plugin.ts#L16](https://github.com/elastic/kibana/tree/master/x-pack/plugins/cross_cluster_replication/server/plugin.ts#L16) | 7.16 | +| | [plugin.ts#L27](https://github.com/elastic/kibana/tree/master/x-pack/plugins/cross_cluster_replication/server/plugin.ts#L27) | 7.16 | @@ -103,20 +97,20 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [saved_objects.ts#L13](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/services/saved_objects.ts#L13) | - | | | [saved_dashboards.ts#L12](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/saved_dashboards/saved_dashboards.ts#L12) | - | | | [saved_dashboards.ts#L31](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/saved_dashboards/saved_dashboards.ts#L31) | - | -| | [types.ts#L25](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/types.ts#L25) | - | -| | [types.ts#L74](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/types.ts#L74) | - | +| | [types.ts#L33](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/types.ts#L33) | - | +| | [types.ts#L186](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/types.ts#L186) | - | | | [plugin.tsx#L42](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/plugin.tsx#L42) | - | -| | [plugin.tsx#L126](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/plugin.tsx#L126) | - | +| | [plugin.tsx#L127](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/plugin.tsx#L127) | - | | | [url_generator.ts#L19](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/url_generator.ts#L19) | - | | | [url_generator.ts#L95](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/url_generator.ts#L95) | - | | | [saved_objects.ts#L11](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/services/saved_objects.ts#L11) | - | | | [saved_dashboard.ts#L10](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/saved_dashboards/saved_dashboard.ts#L10) | - | -| | [saved_dashboard.ts#L18](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/saved_dashboards/saved_dashboard.ts#L18) | - | +| | [saved_dashboard.ts#L19](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/saved_dashboards/saved_dashboard.ts#L19) | - | +| | [dashboard_tagging.ts#L10](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/lib/dashboard_tagging.ts#L10) | - | +| | [dashboard_tagging.ts#L15](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/lib/dashboard_tagging.ts#L15) | - | | | [clone_panel_action.tsx#L14](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/actions/clone_panel_action.tsx#L14) | - | | | [clone_panel_action.tsx#L98](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/actions/clone_panel_action.tsx#L98) | - | | | [clone_panel_action.tsx#L126](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/actions/clone_panel_action.tsx#L126) | - | -| | [use_dashboard_state_manager.ts#L23](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/hooks/use_dashboard_state_manager.ts#L23) | - | -| | [use_dashboard_state_manager.ts#L35](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/hooks/use_dashboard_state_manager.ts#L35) | - | @@ -129,24 +123,20 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [create_doc_table_react.tsx#L25](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/angular/doc_table/create_doc_table_react.tsx#L25) | - | | | [types.ts#L16](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/embeddable/types.ts#L16) | - | | | [types.ts#L30](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/embeddable/types.ts#L30) | - | -| | [context_app_legacy.tsx#L17](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/context_app/context_app_legacy.tsx#L17) | - | -| | [context_app_legacy.tsx#L26](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/context_app/context_app_legacy.tsx#L26) | - | | | [kibana_services.ts#L104](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/kibana_services.ts#L104) | - | | | [search_embeddable.ts#L23](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/embeddable/search_embeddable.ts#L23) | - | -| | [search_embeddable.ts#L58](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/embeddable/search_embeddable.ts#L58) | - | +| | [search_embeddable.ts#L59](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/embeddable/search_embeddable.ts#L59) | - | | | [kibana_services.ts#L104](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/kibana_services.ts#L104) | - | | | [search_embeddable.ts#L23](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/embeddable/search_embeddable.ts#L23) | - | -| | [search_embeddable.ts#L58](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/embeddable/search_embeddable.ts#L58) | - | +| | [search_embeddable.ts#L59](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/embeddable/search_embeddable.ts#L59) | - | | | [kibana_services.ts#L101](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/kibana_services.ts#L101) | - | | | [create_doc_table_react.tsx#L15](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/angular/doc_table/create_doc_table_react.tsx#L15) | - | | | [create_doc_table_react.tsx#L25](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/angular/doc_table/create_doc_table_react.tsx#L25) | - | | | [types.ts#L16](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/embeddable/types.ts#L16) | - | | | [types.ts#L30](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/embeddable/types.ts#L30) | - | -| | [context_app_legacy.tsx#L17](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/context_app/context_app_legacy.tsx#L17) | - | -| | [context_app_legacy.tsx#L26](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/context_app/context_app_legacy.tsx#L26) | - | | | [kibana_services.ts#L104](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/kibana_services.ts#L104) | - | | | [search_embeddable.ts#L23](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/embeddable/search_embeddable.ts#L23) | - | -| | [search_embeddable.ts#L58](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/embeddable/search_embeddable.ts#L58) | - | +| | [search_embeddable.ts#L59](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/embeddable/search_embeddable.ts#L59) | - | | | [on_save_search.tsx#L11](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/top_nav/on_save_search.tsx#L11) | - | | | [on_save_search.tsx#L133](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/top_nav/on_save_search.tsx#L133) | - | | | [saved_searches.ts#L10](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/saved_searches/saved_searches.ts#L10) | - | @@ -163,7 +153,7 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | Deprecated API | Reference location | Remove By | | ---------------|-----------|-----------| | | [attribute_service.tsx#L13](https://github.com/elastic/kibana/tree/master/src/plugins/embeddable/public/lib/attribute_service/attribute_service.tsx#L13) | - | -| | [attribute_service.tsx#L167](https://github.com/elastic/kibana/tree/master/src/plugins/embeddable/public/lib/attribute_service/attribute_service.tsx#L167) | - | +| | [attribute_service.tsx#L165](https://github.com/elastic/kibana/tree/master/src/plugins/embeddable/public/lib/attribute_service/attribute_service.tsx#L165) | - | @@ -199,7 +189,7 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [query_bar.tsx#L30](https://github.com/elastic/kibana/tree/master/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/query_bar.tsx#L30) | - | | | [query_bar.tsx#L38](https://github.com/elastic/kibana/tree/master/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/query_bar.tsx#L38) | - | | | [plugin.ts#L14](https://github.com/elastic/kibana/tree/master/x-pack/plugins/fleet/server/plugin.ts#L14) | - | -| | [plugin.ts#L189](https://github.com/elastic/kibana/tree/master/x-pack/plugins/fleet/server/plugin.ts#L189) | - | +| | [plugin.ts#L190](https://github.com/elastic/kibana/tree/master/x-pack/plugins/fleet/server/plugin.ts#L190) | - | | | [plugin.d.ts#L2](https://github.com/elastic/kibana/tree/master/x-pack/plugins/fleet/target/types/server/plugin.d.ts#L2) | - | | | [plugin.d.ts#L84](https://github.com/elastic/kibana/tree/master/x-pack/plugins/fleet/target/types/server/plugin.d.ts#L84) | - | @@ -238,18 +228,18 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | Deprecated API | Reference location | Remove By | | ---------------|-----------|-----------| -| | [plugin.ts#L14](https://github.com/elastic/kibana/tree/master/x-pack/plugins/index_management/server/plugin.ts#L14) | 7.16 | -| | [plugin.ts#L42](https://github.com/elastic/kibana/tree/master/x-pack/plugins/index_management/server/plugin.ts#L42) | 7.16 | +| | [plugin.ts#L12](https://github.com/elastic/kibana/tree/master/x-pack/plugins/index_management/server/plugin.ts#L12) | 7.16 | +| | [plugin.ts#L38](https://github.com/elastic/kibana/tree/master/x-pack/plugins/index_management/server/plugin.ts#L38) | 7.16 | | | [types.ts#L9](https://github.com/elastic/kibana/tree/master/x-pack/plugins/index_management/server/types.ts#L9) | 7.16 | -| | [types.ts#L40](https://github.com/elastic/kibana/tree/master/x-pack/plugins/index_management/server/types.ts#L40) | 7.16 | +| | [types.ts#L39](https://github.com/elastic/kibana/tree/master/x-pack/plugins/index_management/server/types.ts#L39) | 7.16 | | | [types.d.ts#L1](https://github.com/elastic/kibana/tree/master/x-pack/plugins/index_management/target/types/server/types.d.ts#L1) | 7.16 | -| | [types.d.ts#L25](https://github.com/elastic/kibana/tree/master/x-pack/plugins/index_management/target/types/server/types.d.ts#L25) | 7.16 | +| | [types.d.ts#L24](https://github.com/elastic/kibana/tree/master/x-pack/plugins/index_management/target/types/server/types.d.ts#L24) | 7.16 | | | [types.ts#L10](https://github.com/elastic/kibana/tree/master/x-pack/plugins/index_management/server/types.ts#L10) | 7.16 | -| | [types.ts#L43](https://github.com/elastic/kibana/tree/master/x-pack/plugins/index_management/server/types.ts#L43) | 7.16 | -| | [types.ts#L50](https://github.com/elastic/kibana/tree/master/x-pack/plugins/index_management/server/types.ts#L50) | 7.16 | +| | [types.ts#L42](https://github.com/elastic/kibana/tree/master/x-pack/plugins/index_management/server/types.ts#L42) | 7.16 | +| | [types.ts#L49](https://github.com/elastic/kibana/tree/master/x-pack/plugins/index_management/server/types.ts#L49) | 7.16 | | | [types.d.ts#L1](https://github.com/elastic/kibana/tree/master/x-pack/plugins/index_management/target/types/server/types.d.ts#L1) | 7.16 | -| | [types.d.ts#L27](https://github.com/elastic/kibana/tree/master/x-pack/plugins/index_management/target/types/server/types.d.ts#L27) | 7.16 | -| | [types.d.ts#L33](https://github.com/elastic/kibana/tree/master/x-pack/plugins/index_management/target/types/server/types.d.ts#L33) | 7.16 | +| | [types.d.ts#L26](https://github.com/elastic/kibana/tree/master/x-pack/plugins/index_management/target/types/server/types.d.ts#L26) | 7.16 | +| | [types.d.ts#L32](https://github.com/elastic/kibana/tree/master/x-pack/plugins/index_management/target/types/server/types.d.ts#L32) | 7.16 | @@ -588,11 +578,6 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [custom_metric_form.d.ts#L8](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/target/types/public/pages/metrics/inventory_view/components/waffle/metric_control/custom_metric_form.d.ts#L8) | - | | | [index.d.ts#L1](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/target/types/public/pages/metrics/inventory_view/components/waffle/metric_control/index.d.ts#L1) | - | | | [index.d.ts#L9](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/target/types/public/pages/metrics/inventory_view/components/waffle/metric_control/index.d.ts#L9) | - | -| | [log_entry_categories_analysis.ts#L9](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/server/lib/log_analysis/log_entry_categories_analysis.ts#L9) | 7.16 | -| | [log_entry_categories_analysis.ts#L139](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/server/lib/log_analysis/log_entry_categories_analysis.ts#L139) | 7.16 | -| | [log_entry_categories_analysis.ts#L405](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/server/lib/log_analysis/log_entry_categories_analysis.ts#L405) | 7.16 | -| | [log_entry_categories_analysis.d.ts#L1](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/target/types/server/lib/log_analysis/log_entry_categories_analysis.d.ts#L1) | 7.16 | -| | [log_entry_categories_analysis.d.ts#L58](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/target/types/server/lib/log_analysis/log_entry_categories_analysis.d.ts#L58) | 7.16 | @@ -602,6 +587,8 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | ---------------|-----------|-----------| | | [embeddable.tsx#L14](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/editor_frame_service/embeddable/embeddable.tsx#L14) | - | | | [embeddable.tsx#L85](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/editor_frame_service/embeddable/embeddable.tsx#L85) | - | +| | [index.tsx#L25](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/terms/index.tsx#L25) | - | +| | [index.tsx#L102](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/terms/index.tsx#L102) | - | | | [field_item.tsx#L47](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/field_item.tsx#L47) | - | | | [field_item.tsx#L172](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/field_item.tsx#L172) | - | | | [datapanel.tsx#L42](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/datapanel.tsx#L42) | - | @@ -616,10 +603,10 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [types.ts#L8](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/types.ts#L8) | - | | | [types.ts#L57](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/types.ts#L57) | - | | | [field_stats.ts#L11](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/field_stats.ts#L11) | - | -| | [field_stats.ts#L139](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/field_stats.ts#L139) | - | -| | [field_stats.ts#L248](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/field_stats.ts#L248) | - | -| | [field_stats.ts#L287](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/field_stats.ts#L287) | - | -| | [field_stats.ts#L329](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/field_stats.ts#L329) | - | +| | [field_stats.ts#L140](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/field_stats.ts#L140) | - | +| | [field_stats.ts#L249](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/field_stats.ts#L249) | - | +| | [field_stats.ts#L289](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/field_stats.ts#L289) | - | +| | [field_stats.ts#L331](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/field_stats.ts#L331) | - | | | [types.d.ts#L1](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/target/types/public/indexpattern_datasource/types.d.ts#L1) | - | | | [types.d.ts#L22](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/target/types/public/indexpattern_datasource/types.d.ts#L22) | - | | | [field_stats.d.ts#L3](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/target/types/server/routes/field_stats.d.ts#L3) | - | @@ -631,10 +618,10 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [types.ts#L8](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/types.ts#L8) | - | | | [types.ts#L57](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/types.ts#L57) | - | | | [field_stats.ts#L11](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/field_stats.ts#L11) | - | -| | [field_stats.ts#L139](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/field_stats.ts#L139) | - | -| | [field_stats.ts#L248](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/field_stats.ts#L248) | - | -| | [field_stats.ts#L287](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/field_stats.ts#L287) | - | -| | [field_stats.ts#L329](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/field_stats.ts#L329) | - | +| | [field_stats.ts#L140](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/field_stats.ts#L140) | - | +| | [field_stats.ts#L249](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/field_stats.ts#L249) | - | +| | [field_stats.ts#L289](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/field_stats.ts#L289) | - | +| | [field_stats.ts#L331](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/field_stats.ts#L331) | - | | | [types.d.ts#L1](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/target/types/public/indexpattern_datasource/types.d.ts#L1) | - | | | [types.d.ts#L22](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/target/types/public/indexpattern_datasource/types.d.ts#L22) | - | | | [field_stats.d.ts#L3](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/target/types/server/routes/field_stats.d.ts#L3) | - | @@ -643,6 +630,8 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [field_stats.d.ts#L9](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/target/types/server/routes/field_stats.d.ts#L9) | - | | | [embeddable.tsx#L14](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/editor_frame_service/embeddable/embeddable.tsx#L14) | - | | | [embeddable.tsx#L85](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/editor_frame_service/embeddable/embeddable.tsx#L85) | - | +| | [index.tsx#L25](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/terms/index.tsx#L25) | - | +| | [index.tsx#L102](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/terms/index.tsx#L102) | - | | | [field_item.tsx#L47](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/field_item.tsx#L47) | - | | | [field_item.tsx#L172](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/field_item.tsx#L172) | - | | | [datapanel.tsx#L42](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/datapanel.tsx#L42) | - | @@ -657,10 +646,10 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [types.ts#L8](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/types.ts#L8) | - | | | [types.ts#L57](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/types.ts#L57) | - | | | [field_stats.ts#L11](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/field_stats.ts#L11) | - | -| | [field_stats.ts#L139](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/field_stats.ts#L139) | - | -| | [field_stats.ts#L248](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/field_stats.ts#L248) | - | -| | [field_stats.ts#L287](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/field_stats.ts#L287) | - | -| | [field_stats.ts#L329](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/field_stats.ts#L329) | - | +| | [field_stats.ts#L140](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/field_stats.ts#L140) | - | +| | [field_stats.ts#L249](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/field_stats.ts#L249) | - | +| | [field_stats.ts#L289](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/field_stats.ts#L289) | - | +| | [field_stats.ts#L331](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/field_stats.ts#L331) | - | | | [types.d.ts#L1](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/target/types/public/indexpattern_datasource/types.d.ts#L1) | - | | | [types.d.ts#L22](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/target/types/public/indexpattern_datasource/types.d.ts#L22) | - | | | [field_stats.d.ts#L3](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/target/types/server/routes/field_stats.d.ts#L3) | - | @@ -946,7 +935,7 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | Deprecated API | Reference location | Remove By | | ---------------|-----------|-----------| | | [types.ts#L8](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/embeddable/types.ts#L8) | - | -| | [types.ts#L45](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/embeddable/types.ts#L45) | - | +| | [types.ts#L44](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/embeddable/types.ts#L44) | - | | | [es_doc_field.ts#L12](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/fields/es_doc_field.ts#L12) | - | | | [es_doc_field.ts#L45](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/fields/es_doc_field.ts#L45) | - | | | [es_source.ts#L10](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/es_source/es_source.ts#L10) | - | @@ -1136,7 +1125,7 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [get_docvalue_source_fields.test.ts#L10](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/es_search_source/get_docvalue_source_fields.test.ts#L10) | - | | | [get_docvalue_source_fields.test.ts#L12](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/es_search_source/get_docvalue_source_fields.test.ts#L12) | - | | | [types.ts#L8](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/embeddable/types.ts#L8) | - | -| | [types.ts#L45](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/embeddable/types.ts#L45) | - | +| | [types.ts#L44](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/embeddable/types.ts#L44) | - | | | [es_doc_field.ts#L12](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/fields/es_doc_field.ts#L12) | - | | | [es_doc_field.ts#L45](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/fields/es_doc_field.ts#L45) | - | | | [es_source.ts#L10](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/es_source/es_source.ts#L10) | - | @@ -1393,7 +1382,7 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [static_globals.ts#L43](https://github.com/elastic/kibana/tree/master/x-pack/plugins/monitoring/server/static_globals.ts#L43) | 7.16 | | | [plugin.ts#L18](https://github.com/elastic/kibana/tree/master/x-pack/plugins/monitoring/server/plugin.ts#L18) | 7.16 | | | [plugin.ts#L74](https://github.com/elastic/kibana/tree/master/x-pack/plugins/monitoring/server/plugin.ts#L74) | 7.16 | -| | [plugin.ts#L279](https://github.com/elastic/kibana/tree/master/x-pack/plugins/monitoring/server/plugin.ts#L279) | 7.16 | +| | [plugin.ts#L284](https://github.com/elastic/kibana/tree/master/x-pack/plugins/monitoring/server/plugin.ts#L284) | 7.16 | | | [types.d.ts#L2](https://github.com/elastic/kibana/tree/master/x-pack/plugins/monitoring/target/types/server/types.d.ts#L2) | 7.16 | | | [types.d.ts#L47](https://github.com/elastic/kibana/tree/master/x-pack/plugins/monitoring/target/types/server/types.d.ts#L47) | 7.16 | | | [plugin.d.ts#L1](https://github.com/elastic/kibana/tree/master/x-pack/plugins/monitoring/target/types/server/plugin.d.ts#L1) | 7.16 | @@ -1482,22 +1471,22 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | Deprecated API | Reference location | Remove By | | ---------------|-----------|-----------| -| | [types.ts#L18](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/types.ts#L18) | - | -| | [types.ts#L95](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/types.ts#L95) | - | +| | [types.ts#L19](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/types.ts#L19) | - | +| | [types.ts#L104](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/types.ts#L104) | - | | | [utils.ts#L10](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/utils.ts#L10) | - | | | [utils.ts#L53](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/utils.ts#L53) | - | | | [utils.ts#L61](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/utils.ts#L61) | - | | | [utils.ts#L69](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/utils.ts#L69) | - | | | [default_configs.ts#L19](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/default_configs.ts#L19) | - | -| | [default_configs.ts#L24](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/default_configs.ts#L24) | - | -| | [types.ts#L18](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/types.ts#L18) | - | -| | [types.ts#L95](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/types.ts#L95) | - | +| | [default_configs.ts#L25](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/default_configs.ts#L25) | - | +| | [types.ts#L19](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/types.ts#L19) | - | +| | [types.ts#L104](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/types.ts#L104) | - | | | [utils.ts#L10](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/utils.ts#L10) | - | | | [utils.ts#L53](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/utils.ts#L53) | - | | | [utils.ts#L61](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/utils.ts#L61) | - | | | [utils.ts#L69](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/utils.ts#L69) | - | | | [default_configs.ts#L19](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/default_configs.ts#L19) | - | -| | [default_configs.ts#L24](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/default_configs.ts#L24) | - | +| | [default_configs.ts#L25](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/default_configs.ts#L25) | - | @@ -1573,9 +1562,9 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | Deprecated API | Reference location | Remove By | | ---------------|-----------|-----------| -| | [types.ts#L21](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/types.ts#L21) | - | -| | [types.ts#L66](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/types.ts#L66) | - | -| | [action.ts#L19](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/action.ts#L19) | - | +| | [types.ts#L22](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/types.ts#L22) | - | +| | [types.ts#L72](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/types.ts#L72) | - | +| | [action.ts#L20](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/action.ts#L20) | - | | | [action.ts#L100](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/action.ts#L100) | - | | | [index.ts#L8](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/common/search_strategy/index_fields/index.ts#L8) | - | | | [index.ts#L86](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/common/search_strategy/index_fields/index.ts#L86) | - | @@ -1612,9 +1601,9 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [types.ts#L41](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/network/pages/details/types.ts#L41) | - | | | [index.tsx#L12](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/network/components/network_top_countries_table/index.tsx#L12) | - | | | [index.tsx#L34](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/network/components/network_top_countries_table/index.tsx#L34) | - | -| | [middleware.ts#L44](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts#L44) | - | -| | [middleware.ts#L60](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts#L60) | - | -| | [middleware.ts#L65](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts#L65) | - | +| | [middleware.ts#L48](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts#L48) | - | +| | [middleware.ts#L64](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts#L64) | - | +| | [middleware.ts#L69](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts#L69) | - | | | [types.ts#L12](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/detections/components/rules/description_step/types.ts#L12) | - | | | [types.ts#L28](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/detections/components/rules/description_step/types.ts#L28) | - | | | [index.tsx#L15](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/detections/components/rules/description_step/index.tsx#L15) | - | @@ -1669,6 +1658,8 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [use_field_value_autocomplete.ts#L31](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/autocomplete/hooks/use_field_value_autocomplete.ts#L31) | - | | | [field_value_match.tsx#L19](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/autocomplete/field_value_match.tsx#L19) | - | | | [field_value_match.tsx#L30](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/autocomplete/field_value_match.tsx#L30) | - | +| | [query.ts#L13](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/lib/detection_engine/reference_rules/query.ts#L13) | - | +| | [query.ts#L52](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/lib/detection_engine/reference_rules/query.ts#L52) | - | | | [model.ts#L8](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/store/sourcerer/model.ts#L8) | - | | | [model.ts#L30](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/store/sourcerer/model.ts#L30) | - | | | [index.tsx#L33](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/detections/components/rules/severity_mapping/index.tsx#L33) | - | @@ -1785,9 +1776,9 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [index.tsx#L242](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/detections/components/rules/risk_score_mapping/index.tsx#L242) | - | | | [index.tsx#L12](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/detections/components/rules/autocomplete_field/index.tsx#L12) | - | | | [index.tsx#L35](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/detections/components/rules/autocomplete_field/index.tsx#L35) | - | -| | [types.ts#L21](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/types.ts#L21) | - | -| | [types.ts#L66](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/types.ts#L66) | - | -| | [action.ts#L19](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/action.ts#L19) | - | +| | [types.ts#L22](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/types.ts#L22) | - | +| | [types.ts#L72](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/types.ts#L72) | - | +| | [action.ts#L20](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/action.ts#L20) | - | | | [action.ts#L100](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/action.ts#L100) | - | | | [index.ts#L8](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/common/search_strategy/index_fields/index.ts#L8) | - | | | [index.ts#L86](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/common/search_strategy/index_fields/index.ts#L86) | - | @@ -1824,9 +1815,9 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [types.ts#L41](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/network/pages/details/types.ts#L41) | - | | | [index.tsx#L12](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/network/components/network_top_countries_table/index.tsx#L12) | - | | | [index.tsx#L34](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/network/components/network_top_countries_table/index.tsx#L34) | - | -| | [middleware.ts#L44](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts#L44) | - | -| | [middleware.ts#L60](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts#L60) | - | -| | [middleware.ts#L65](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts#L65) | - | +| | [middleware.ts#L48](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts#L48) | - | +| | [middleware.ts#L64](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts#L64) | - | +| | [middleware.ts#L69](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts#L69) | - | | | [types.ts#L12](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/detections/components/rules/description_step/types.ts#L12) | - | | | [types.ts#L28](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/detections/components/rules/description_step/types.ts#L28) | - | | | [index.tsx#L15](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/detections/components/rules/description_step/index.tsx#L15) | - | @@ -1881,6 +1872,8 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [use_field_value_autocomplete.ts#L31](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/autocomplete/hooks/use_field_value_autocomplete.ts#L31) | - | | | [field_value_match.tsx#L19](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/autocomplete/field_value_match.tsx#L19) | - | | | [field_value_match.tsx#L30](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/autocomplete/field_value_match.tsx#L30) | - | +| | [query.ts#L13](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/lib/detection_engine/reference_rules/query.ts#L13) | - | +| | [query.ts#L52](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/lib/detection_engine/reference_rules/query.ts#L52) | - | | | [model.ts#L8](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/store/sourcerer/model.ts#L8) | - | | | [model.ts#L30](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/store/sourcerer/model.ts#L30) | - | | | [index.tsx#L33](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/detections/components/rules/severity_mapping/index.tsx#L33) | - | diff --git a/api_docs/discover.json b/api_docs/discover.json index 1824b5a3e3d5d0..3ded38e306768e 100644 --- a/api_docs/discover.json +++ b/api_docs/discover.json @@ -79,7 +79,7 @@ "description": [], "source": { "path": "src/plugins/discover/public/url_generator.ts", - "lineNumber": 22 + "lineNumber": 16 }, "deprecated": false, "children": [ @@ -97,7 +97,7 @@ ], "source": { "path": "src/plugins/discover/public/url_generator.ts", - "lineNumber": 26 + "lineNumber": 20 }, "deprecated": false }, @@ -115,7 +115,7 @@ ], "source": { "path": "src/plugins/discover/public/url_generator.ts", - "lineNumber": 31 + "lineNumber": 25 }, "deprecated": false }, @@ -140,7 +140,7 @@ ], "source": { "path": "src/plugins/discover/public/url_generator.ts", - "lineNumber": 36 + "lineNumber": 30 }, "deprecated": false }, @@ -165,7 +165,7 @@ ], "source": { "path": "src/plugins/discover/public/url_generator.ts", - "lineNumber": 41 + "lineNumber": 35 }, "deprecated": false }, @@ -190,7 +190,7 @@ ], "source": { "path": "src/plugins/discover/public/url_generator.ts", - "lineNumber": 46 + "lineNumber": 40 }, "deprecated": false }, @@ -215,7 +215,7 @@ ], "source": { "path": "src/plugins/discover/public/url_generator.ts", - "lineNumber": 52 + "lineNumber": 46 }, "deprecated": false }, @@ -233,7 +233,7 @@ ], "source": { "path": "src/plugins/discover/public/url_generator.ts", - "lineNumber": 58 + "lineNumber": 52 }, "deprecated": false }, @@ -251,7 +251,7 @@ ], "source": { "path": "src/plugins/discover/public/url_generator.ts", - "lineNumber": 63 + "lineNumber": 57 }, "deprecated": false }, @@ -269,7 +269,7 @@ ], "source": { "path": "src/plugins/discover/public/url_generator.ts", - "lineNumber": 68 + "lineNumber": 62 }, "deprecated": false }, @@ -287,7 +287,7 @@ ], "source": { "path": "src/plugins/discover/public/url_generator.ts", - "lineNumber": 73 + "lineNumber": 67 }, "deprecated": false }, @@ -305,7 +305,7 @@ ], "source": { "path": "src/plugins/discover/public/url_generator.ts", - "lineNumber": 77 + "lineNumber": 72 }, "deprecated": false }, @@ -323,7 +323,7 @@ ], "source": { "path": "src/plugins/discover/public/url_generator.ts", - "lineNumber": 81 + "lineNumber": 77 }, "deprecated": false } @@ -890,7 +890,7 @@ ], "source": { "path": "src/plugins/discover/public/url_generator.ts", - "lineNumber": 20 + "lineNumber": 14 }, "deprecated": false, "initialIsOpen": false diff --git a/api_docs/enterprise_search.json b/api_docs/enterprise_search.json index 6ea7bfe1c50f1f..e2b6184c9d36f9 100644 --- a/api_docs/enterprise_search.json +++ b/api_docs/enterprise_search.json @@ -22,11 +22,11 @@ "label": "ConfigType", "description": [], "signature": [ - "{ readonly host?: string | undefined; readonly enabled: boolean; readonly accessCheckTimeout: number; readonly accessCheckTimeoutWarning: number; }" + "{ readonly host?: string | undefined; readonly enabled: boolean; readonly ssl: Readonly<{ certificateAuthorities?: string | string[] | undefined; } & { verificationMode: \"none\" | \"certificate\" | \"full\"; }>; readonly accessCheckTimeout: number; readonly accessCheckTimeoutWarning: number; }" ], "source": { "path": "x-pack/plugins/enterprise_search/server/index.ts", - "lineNumber": 24 + "lineNumber": 33 }, "deprecated": false, "initialIsOpen": false @@ -50,7 +50,13 @@ "Type", "; accessCheckTimeoutWarning: ", "Type", - "; }>" + "; ssl: ", + "ObjectType", + "<{ certificateAuthorities: ", + "Type", + "; verificationMode: ", + "Type", + "<\"none\" | \"certificate\" | \"full\">; }>; }>" ], "source": { "path": "x-pack/plugins/enterprise_search/server/index.ts", diff --git a/api_docs/event_log.json b/api_docs/event_log.json index 1eb19bf6310de4..1d5605105c7c1a 100644 --- a/api_docs/event_log.json +++ b/api_docs/event_log.json @@ -687,7 +687,7 @@ "label": "logEvent", "description": [], "signature": [ - "(properties: DeepPartial[] | undefined; alerting?: Readonly<{ status?: string | undefined; instance_id?: string | undefined; action_group_id?: string | undefined; action_subgroup?: string | undefined; } & {}> | undefined; server_uuid?: string | undefined; } & {}> | undefined; user?: Readonly<{ name?: string | undefined; } & {}> | undefined; error?: Readonly<{ type?: string | undefined; id?: string | undefined; message?: string | undefined; code?: string | undefined; stack_trace?: string | undefined; } & {}> | undefined; message?: string | undefined; tags?: string[] | undefined; event?: Readonly<{ start?: string | undefined; type?: string[] | undefined; id?: string | undefined; url?: string | undefined; end?: string | undefined; category?: string[] | undefined; code?: string | undefined; action?: string | undefined; kind?: string | undefined; original?: string | undefined; severity?: number | undefined; created?: string | undefined; dataset?: string | undefined; duration?: number | undefined; hash?: string | undefined; ingested?: string | undefined; module?: string | undefined; outcome?: string | undefined; provider?: string | undefined; reason?: string | undefined; reference?: string | undefined; risk_score?: number | undefined; risk_score_norm?: number | undefined; sequence?: number | undefined; timezone?: string | undefined; } & {}> | undefined; rule?: Readonly<{ description?: string | undefined; id?: string | undefined; name?: string | undefined; version?: string | undefined; license?: string | undefined; category?: string | undefined; reference?: string | undefined; author?: string[] | undefined; ruleset?: string | undefined; uuid?: string | undefined; } & {}> | undefined; log?: Readonly<{ logger?: string | undefined; level?: string | undefined; } & {}> | undefined; ecs?: Readonly<{ version?: string | undefined; } & {}> | undefined; } & {}>>> | undefined) => void" + "(properties: DeepPartial[] | undefined; alerting?: Readonly<{ status?: string | undefined; instance_id?: string | undefined; action_group_id?: string | undefined; action_subgroup?: string | undefined; } & {}> | undefined; server_uuid?: string | undefined; } & {}> | undefined; user?: Readonly<{ name?: string | undefined; } & {}> | undefined; error?: Readonly<{ type?: string | undefined; id?: string | undefined; message?: string | undefined; code?: string | undefined; stack_trace?: string | undefined; } & {}> | undefined; message?: string | undefined; tags?: string[] | undefined; event?: Readonly<{ start?: string | undefined; type?: string[] | undefined; id?: string | undefined; url?: string | undefined; end?: string | undefined; category?: string[] | undefined; code?: string | undefined; action?: string | undefined; kind?: string | undefined; original?: string | undefined; severity?: number | undefined; created?: string | undefined; dataset?: string | undefined; duration?: number | undefined; hash?: string | undefined; ingested?: string | undefined; module?: string | undefined; outcome?: string | undefined; provider?: string | undefined; reason?: string | undefined; reference?: string | undefined; risk_score?: number | undefined; risk_score_norm?: number | undefined; sequence?: number | undefined; timezone?: string | undefined; } & {}> | undefined; rule?: Readonly<{ description?: string | undefined; id?: string | undefined; name?: string | undefined; version?: string | undefined; license?: string | undefined; category?: string | undefined; reference?: string | undefined; author?: string[] | undefined; ruleset?: string | undefined; uuid?: string | undefined; } & {}> | undefined; '@timestamp'?: string | undefined; log?: Readonly<{ logger?: string | undefined; level?: string | undefined; } & {}> | undefined; ecs?: Readonly<{ version?: string | undefined; } & {}> | undefined; } & {}>>> | undefined) => void" ], "source": { "path": "x-pack/plugins/event_log/server/types.ts", @@ -703,7 +703,7 @@ "label": "properties", "description": [], "signature": [ - "DeepPartial[] | undefined; alerting?: Readonly<{ status?: string | undefined; instance_id?: string | undefined; action_group_id?: string | undefined; action_subgroup?: string | undefined; } & {}> | undefined; server_uuid?: string | undefined; } & {}> | undefined; user?: Readonly<{ name?: string | undefined; } & {}> | undefined; error?: Readonly<{ type?: string | undefined; id?: string | undefined; message?: string | undefined; code?: string | undefined; stack_trace?: string | undefined; } & {}> | undefined; message?: string | undefined; tags?: string[] | undefined; event?: Readonly<{ start?: string | undefined; type?: string[] | undefined; id?: string | undefined; url?: string | undefined; end?: string | undefined; category?: string[] | undefined; code?: string | undefined; action?: string | undefined; kind?: string | undefined; original?: string | undefined; severity?: number | undefined; created?: string | undefined; dataset?: string | undefined; duration?: number | undefined; hash?: string | undefined; ingested?: string | undefined; module?: string | undefined; outcome?: string | undefined; provider?: string | undefined; reason?: string | undefined; reference?: string | undefined; risk_score?: number | undefined; risk_score_norm?: number | undefined; sequence?: number | undefined; timezone?: string | undefined; } & {}> | undefined; rule?: Readonly<{ description?: string | undefined; id?: string | undefined; name?: string | undefined; version?: string | undefined; license?: string | undefined; category?: string | undefined; reference?: string | undefined; author?: string[] | undefined; ruleset?: string | undefined; uuid?: string | undefined; } & {}> | undefined; log?: Readonly<{ logger?: string | undefined; level?: string | undefined; } & {}> | undefined; ecs?: Readonly<{ version?: string | undefined; } & {}> | undefined; } & {}>>> | undefined" + "DeepPartial[] | undefined; alerting?: Readonly<{ status?: string | undefined; instance_id?: string | undefined; action_group_id?: string | undefined; action_subgroup?: string | undefined; } & {}> | undefined; server_uuid?: string | undefined; } & {}> | undefined; user?: Readonly<{ name?: string | undefined; } & {}> | undefined; error?: Readonly<{ type?: string | undefined; id?: string | undefined; message?: string | undefined; code?: string | undefined; stack_trace?: string | undefined; } & {}> | undefined; message?: string | undefined; tags?: string[] | undefined; event?: Readonly<{ start?: string | undefined; type?: string[] | undefined; id?: string | undefined; url?: string | undefined; end?: string | undefined; category?: string[] | undefined; code?: string | undefined; action?: string | undefined; kind?: string | undefined; original?: string | undefined; severity?: number | undefined; created?: string | undefined; dataset?: string | undefined; duration?: number | undefined; hash?: string | undefined; ingested?: string | undefined; module?: string | undefined; outcome?: string | undefined; provider?: string | undefined; reason?: string | undefined; reference?: string | undefined; risk_score?: number | undefined; risk_score_norm?: number | undefined; sequence?: number | undefined; timezone?: string | undefined; } & {}> | undefined; rule?: Readonly<{ description?: string | undefined; id?: string | undefined; name?: string | undefined; version?: string | undefined; license?: string | undefined; category?: string | undefined; reference?: string | undefined; author?: string[] | undefined; ruleset?: string | undefined; uuid?: string | undefined; } & {}> | undefined; '@timestamp'?: string | undefined; log?: Readonly<{ logger?: string | undefined; level?: string | undefined; } & {}> | undefined; ecs?: Readonly<{ version?: string | undefined; } & {}> | undefined; } & {}>>> | undefined" ], "source": { "path": "x-pack/plugins/event_log/server/types.ts", @@ -723,7 +723,7 @@ "label": "startTiming", "description": [], "signature": [ - "(event: DeepPartial[] | undefined; alerting?: Readonly<{ status?: string | undefined; instance_id?: string | undefined; action_group_id?: string | undefined; action_subgroup?: string | undefined; } & {}> | undefined; server_uuid?: string | undefined; } & {}> | undefined; user?: Readonly<{ name?: string | undefined; } & {}> | undefined; error?: Readonly<{ type?: string | undefined; id?: string | undefined; message?: string | undefined; code?: string | undefined; stack_trace?: string | undefined; } & {}> | undefined; message?: string | undefined; tags?: string[] | undefined; event?: Readonly<{ start?: string | undefined; type?: string[] | undefined; id?: string | undefined; url?: string | undefined; end?: string | undefined; category?: string[] | undefined; code?: string | undefined; action?: string | undefined; kind?: string | undefined; original?: string | undefined; severity?: number | undefined; created?: string | undefined; dataset?: string | undefined; duration?: number | undefined; hash?: string | undefined; ingested?: string | undefined; module?: string | undefined; outcome?: string | undefined; provider?: string | undefined; reason?: string | undefined; reference?: string | undefined; risk_score?: number | undefined; risk_score_norm?: number | undefined; sequence?: number | undefined; timezone?: string | undefined; } & {}> | undefined; rule?: Readonly<{ description?: string | undefined; id?: string | undefined; name?: string | undefined; version?: string | undefined; license?: string | undefined; category?: string | undefined; reference?: string | undefined; author?: string[] | undefined; ruleset?: string | undefined; uuid?: string | undefined; } & {}> | undefined; log?: Readonly<{ logger?: string | undefined; level?: string | undefined; } & {}> | undefined; ecs?: Readonly<{ version?: string | undefined; } & {}> | undefined; } & {}>>> | undefined) => void" + "(event: DeepPartial[] | undefined; alerting?: Readonly<{ status?: string | undefined; instance_id?: string | undefined; action_group_id?: string | undefined; action_subgroup?: string | undefined; } & {}> | undefined; server_uuid?: string | undefined; } & {}> | undefined; user?: Readonly<{ name?: string | undefined; } & {}> | undefined; error?: Readonly<{ type?: string | undefined; id?: string | undefined; message?: string | undefined; code?: string | undefined; stack_trace?: string | undefined; } & {}> | undefined; message?: string | undefined; tags?: string[] | undefined; event?: Readonly<{ start?: string | undefined; type?: string[] | undefined; id?: string | undefined; url?: string | undefined; end?: string | undefined; category?: string[] | undefined; code?: string | undefined; action?: string | undefined; kind?: string | undefined; original?: string | undefined; severity?: number | undefined; created?: string | undefined; dataset?: string | undefined; duration?: number | undefined; hash?: string | undefined; ingested?: string | undefined; module?: string | undefined; outcome?: string | undefined; provider?: string | undefined; reason?: string | undefined; reference?: string | undefined; risk_score?: number | undefined; risk_score_norm?: number | undefined; sequence?: number | undefined; timezone?: string | undefined; } & {}> | undefined; rule?: Readonly<{ description?: string | undefined; id?: string | undefined; name?: string | undefined; version?: string | undefined; license?: string | undefined; category?: string | undefined; reference?: string | undefined; author?: string[] | undefined; ruleset?: string | undefined; uuid?: string | undefined; } & {}> | undefined; '@timestamp'?: string | undefined; log?: Readonly<{ logger?: string | undefined; level?: string | undefined; } & {}> | undefined; ecs?: Readonly<{ version?: string | undefined; } & {}> | undefined; } & {}>>> | undefined) => void" ], "source": { "path": "x-pack/plugins/event_log/server/types.ts", @@ -739,7 +739,7 @@ "label": "event", "description": [], "signature": [ - "DeepPartial[] | undefined; alerting?: Readonly<{ status?: string | undefined; instance_id?: string | undefined; action_group_id?: string | undefined; action_subgroup?: string | undefined; } & {}> | undefined; server_uuid?: string | undefined; } & {}> | undefined; user?: Readonly<{ name?: string | undefined; } & {}> | undefined; error?: Readonly<{ type?: string | undefined; id?: string | undefined; message?: string | undefined; code?: string | undefined; stack_trace?: string | undefined; } & {}> | undefined; message?: string | undefined; tags?: string[] | undefined; event?: Readonly<{ start?: string | undefined; type?: string[] | undefined; id?: string | undefined; url?: string | undefined; end?: string | undefined; category?: string[] | undefined; code?: string | undefined; action?: string | undefined; kind?: string | undefined; original?: string | undefined; severity?: number | undefined; created?: string | undefined; dataset?: string | undefined; duration?: number | undefined; hash?: string | undefined; ingested?: string | undefined; module?: string | undefined; outcome?: string | undefined; provider?: string | undefined; reason?: string | undefined; reference?: string | undefined; risk_score?: number | undefined; risk_score_norm?: number | undefined; sequence?: number | undefined; timezone?: string | undefined; } & {}> | undefined; rule?: Readonly<{ description?: string | undefined; id?: string | undefined; name?: string | undefined; version?: string | undefined; license?: string | undefined; category?: string | undefined; reference?: string | undefined; author?: string[] | undefined; ruleset?: string | undefined; uuid?: string | undefined; } & {}> | undefined; log?: Readonly<{ logger?: string | undefined; level?: string | undefined; } & {}> | undefined; ecs?: Readonly<{ version?: string | undefined; } & {}> | undefined; } & {}>>> | undefined" + "DeepPartial[] | undefined; alerting?: Readonly<{ status?: string | undefined; instance_id?: string | undefined; action_group_id?: string | undefined; action_subgroup?: string | undefined; } & {}> | undefined; server_uuid?: string | undefined; } & {}> | undefined; user?: Readonly<{ name?: string | undefined; } & {}> | undefined; error?: Readonly<{ type?: string | undefined; id?: string | undefined; message?: string | undefined; code?: string | undefined; stack_trace?: string | undefined; } & {}> | undefined; message?: string | undefined; tags?: string[] | undefined; event?: Readonly<{ start?: string | undefined; type?: string[] | undefined; id?: string | undefined; url?: string | undefined; end?: string | undefined; category?: string[] | undefined; code?: string | undefined; action?: string | undefined; kind?: string | undefined; original?: string | undefined; severity?: number | undefined; created?: string | undefined; dataset?: string | undefined; duration?: number | undefined; hash?: string | undefined; ingested?: string | undefined; module?: string | undefined; outcome?: string | undefined; provider?: string | undefined; reason?: string | undefined; reference?: string | undefined; risk_score?: number | undefined; risk_score_norm?: number | undefined; sequence?: number | undefined; timezone?: string | undefined; } & {}> | undefined; rule?: Readonly<{ description?: string | undefined; id?: string | undefined; name?: string | undefined; version?: string | undefined; license?: string | undefined; category?: string | undefined; reference?: string | undefined; author?: string[] | undefined; ruleset?: string | undefined; uuid?: string | undefined; } & {}> | undefined; '@timestamp'?: string | undefined; log?: Readonly<{ logger?: string | undefined; level?: string | undefined; } & {}> | undefined; ecs?: Readonly<{ version?: string | undefined; } & {}> | undefined; } & {}>>> | undefined" ], "source": { "path": "x-pack/plugins/event_log/server/types.ts", @@ -759,7 +759,7 @@ "label": "stopTiming", "description": [], "signature": [ - "(event: DeepPartial[] | undefined; alerting?: Readonly<{ status?: string | undefined; instance_id?: string | undefined; action_group_id?: string | undefined; action_subgroup?: string | undefined; } & {}> | undefined; server_uuid?: string | undefined; } & {}> | undefined; user?: Readonly<{ name?: string | undefined; } & {}> | undefined; error?: Readonly<{ type?: string | undefined; id?: string | undefined; message?: string | undefined; code?: string | undefined; stack_trace?: string | undefined; } & {}> | undefined; message?: string | undefined; tags?: string[] | undefined; event?: Readonly<{ start?: string | undefined; type?: string[] | undefined; id?: string | undefined; url?: string | undefined; end?: string | undefined; category?: string[] | undefined; code?: string | undefined; action?: string | undefined; kind?: string | undefined; original?: string | undefined; severity?: number | undefined; created?: string | undefined; dataset?: string | undefined; duration?: number | undefined; hash?: string | undefined; ingested?: string | undefined; module?: string | undefined; outcome?: string | undefined; provider?: string | undefined; reason?: string | undefined; reference?: string | undefined; risk_score?: number | undefined; risk_score_norm?: number | undefined; sequence?: number | undefined; timezone?: string | undefined; } & {}> | undefined; rule?: Readonly<{ description?: string | undefined; id?: string | undefined; name?: string | undefined; version?: string | undefined; license?: string | undefined; category?: string | undefined; reference?: string | undefined; author?: string[] | undefined; ruleset?: string | undefined; uuid?: string | undefined; } & {}> | undefined; log?: Readonly<{ logger?: string | undefined; level?: string | undefined; } & {}> | undefined; ecs?: Readonly<{ version?: string | undefined; } & {}> | undefined; } & {}>>> | undefined) => void" + "(event: DeepPartial[] | undefined; alerting?: Readonly<{ status?: string | undefined; instance_id?: string | undefined; action_group_id?: string | undefined; action_subgroup?: string | undefined; } & {}> | undefined; server_uuid?: string | undefined; } & {}> | undefined; user?: Readonly<{ name?: string | undefined; } & {}> | undefined; error?: Readonly<{ type?: string | undefined; id?: string | undefined; message?: string | undefined; code?: string | undefined; stack_trace?: string | undefined; } & {}> | undefined; message?: string | undefined; tags?: string[] | undefined; event?: Readonly<{ start?: string | undefined; type?: string[] | undefined; id?: string | undefined; url?: string | undefined; end?: string | undefined; category?: string[] | undefined; code?: string | undefined; action?: string | undefined; kind?: string | undefined; original?: string | undefined; severity?: number | undefined; created?: string | undefined; dataset?: string | undefined; duration?: number | undefined; hash?: string | undefined; ingested?: string | undefined; module?: string | undefined; outcome?: string | undefined; provider?: string | undefined; reason?: string | undefined; reference?: string | undefined; risk_score?: number | undefined; risk_score_norm?: number | undefined; sequence?: number | undefined; timezone?: string | undefined; } & {}> | undefined; rule?: Readonly<{ description?: string | undefined; id?: string | undefined; name?: string | undefined; version?: string | undefined; license?: string | undefined; category?: string | undefined; reference?: string | undefined; author?: string[] | undefined; ruleset?: string | undefined; uuid?: string | undefined; } & {}> | undefined; '@timestamp'?: string | undefined; log?: Readonly<{ logger?: string | undefined; level?: string | undefined; } & {}> | undefined; ecs?: Readonly<{ version?: string | undefined; } & {}> | undefined; } & {}>>> | undefined) => void" ], "source": { "path": "x-pack/plugins/event_log/server/types.ts", @@ -775,7 +775,7 @@ "label": "event", "description": [], "signature": [ - "DeepPartial[] | undefined; alerting?: Readonly<{ status?: string | undefined; instance_id?: string | undefined; action_group_id?: string | undefined; action_subgroup?: string | undefined; } & {}> | undefined; server_uuid?: string | undefined; } & {}> | undefined; user?: Readonly<{ name?: string | undefined; } & {}> | undefined; error?: Readonly<{ type?: string | undefined; id?: string | undefined; message?: string | undefined; code?: string | undefined; stack_trace?: string | undefined; } & {}> | undefined; message?: string | undefined; tags?: string[] | undefined; event?: Readonly<{ start?: string | undefined; type?: string[] | undefined; id?: string | undefined; url?: string | undefined; end?: string | undefined; category?: string[] | undefined; code?: string | undefined; action?: string | undefined; kind?: string | undefined; original?: string | undefined; severity?: number | undefined; created?: string | undefined; dataset?: string | undefined; duration?: number | undefined; hash?: string | undefined; ingested?: string | undefined; module?: string | undefined; outcome?: string | undefined; provider?: string | undefined; reason?: string | undefined; reference?: string | undefined; risk_score?: number | undefined; risk_score_norm?: number | undefined; sequence?: number | undefined; timezone?: string | undefined; } & {}> | undefined; rule?: Readonly<{ description?: string | undefined; id?: string | undefined; name?: string | undefined; version?: string | undefined; license?: string | undefined; category?: string | undefined; reference?: string | undefined; author?: string[] | undefined; ruleset?: string | undefined; uuid?: string | undefined; } & {}> | undefined; log?: Readonly<{ logger?: string | undefined; level?: string | undefined; } & {}> | undefined; ecs?: Readonly<{ version?: string | undefined; } & {}> | undefined; } & {}>>> | undefined" + "DeepPartial[] | undefined; alerting?: Readonly<{ status?: string | undefined; instance_id?: string | undefined; action_group_id?: string | undefined; action_subgroup?: string | undefined; } & {}> | undefined; server_uuid?: string | undefined; } & {}> | undefined; user?: Readonly<{ name?: string | undefined; } & {}> | undefined; error?: Readonly<{ type?: string | undefined; id?: string | undefined; message?: string | undefined; code?: string | undefined; stack_trace?: string | undefined; } & {}> | undefined; message?: string | undefined; tags?: string[] | undefined; event?: Readonly<{ start?: string | undefined; type?: string[] | undefined; id?: string | undefined; url?: string | undefined; end?: string | undefined; category?: string[] | undefined; code?: string | undefined; action?: string | undefined; kind?: string | undefined; original?: string | undefined; severity?: number | undefined; created?: string | undefined; dataset?: string | undefined; duration?: number | undefined; hash?: string | undefined; ingested?: string | undefined; module?: string | undefined; outcome?: string | undefined; provider?: string | undefined; reason?: string | undefined; reference?: string | undefined; risk_score?: number | undefined; risk_score_norm?: number | undefined; sequence?: number | undefined; timezone?: string | undefined; } & {}> | undefined; rule?: Readonly<{ description?: string | undefined; id?: string | undefined; name?: string | undefined; version?: string | undefined; license?: string | undefined; category?: string | undefined; reference?: string | undefined; author?: string[] | undefined; ruleset?: string | undefined; uuid?: string | undefined; } & {}> | undefined; '@timestamp'?: string | undefined; log?: Readonly<{ logger?: string | undefined; level?: string | undefined; } & {}> | undefined; ecs?: Readonly<{ version?: string | undefined; } & {}> | undefined; } & {}>>> | undefined" ], "source": { "path": "x-pack/plugins/event_log/server/types.ts", @@ -850,7 +850,7 @@ "label": "data", "description": [], "signature": [ - "(Readonly<{ '@timestamp'?: string | undefined; kibana?: Readonly<{ saved_objects?: Readonly<{ type?: string | undefined; id?: string | undefined; rel?: string | undefined; namespace?: string | undefined; } & {}>[] | undefined; alerting?: Readonly<{ status?: string | undefined; instance_id?: string | undefined; action_group_id?: string | undefined; action_subgroup?: string | undefined; } & {}> | undefined; server_uuid?: string | undefined; } & {}> | undefined; user?: Readonly<{ name?: string | undefined; } & {}> | undefined; error?: Readonly<{ type?: string | undefined; id?: string | undefined; message?: string | undefined; code?: string | undefined; stack_trace?: string | undefined; } & {}> | undefined; message?: string | undefined; tags?: string[] | undefined; event?: Readonly<{ start?: string | undefined; type?: string[] | undefined; id?: string | undefined; url?: string | undefined; end?: string | undefined; category?: string[] | undefined; code?: string | undefined; action?: string | undefined; kind?: string | undefined; original?: string | undefined; severity?: number | undefined; created?: string | undefined; dataset?: string | undefined; duration?: number | undefined; hash?: string | undefined; ingested?: string | undefined; module?: string | undefined; outcome?: string | undefined; provider?: string | undefined; reason?: string | undefined; reference?: string | undefined; risk_score?: number | undefined; risk_score_norm?: number | undefined; sequence?: number | undefined; timezone?: string | undefined; } & {}> | undefined; rule?: Readonly<{ description?: string | undefined; id?: string | undefined; name?: string | undefined; version?: string | undefined; license?: string | undefined; category?: string | undefined; reference?: string | undefined; author?: string[] | undefined; ruleset?: string | undefined; uuid?: string | undefined; } & {}> | undefined; log?: Readonly<{ logger?: string | undefined; level?: string | undefined; } & {}> | undefined; ecs?: Readonly<{ version?: string | undefined; } & {}> | undefined; } & {}> | undefined)[]" + "(Readonly<{ kibana?: Readonly<{ saved_objects?: Readonly<{ type?: string | undefined; id?: string | undefined; rel?: string | undefined; namespace?: string | undefined; type_id?: string | undefined; } & {}>[] | undefined; alerting?: Readonly<{ status?: string | undefined; instance_id?: string | undefined; action_group_id?: string | undefined; action_subgroup?: string | undefined; } & {}> | undefined; server_uuid?: string | undefined; } & {}> | undefined; user?: Readonly<{ name?: string | undefined; } & {}> | undefined; error?: Readonly<{ type?: string | undefined; id?: string | undefined; message?: string | undefined; code?: string | undefined; stack_trace?: string | undefined; } & {}> | undefined; message?: string | undefined; tags?: string[] | undefined; event?: Readonly<{ start?: string | undefined; type?: string[] | undefined; id?: string | undefined; url?: string | undefined; end?: string | undefined; category?: string[] | undefined; code?: string | undefined; action?: string | undefined; kind?: string | undefined; original?: string | undefined; severity?: number | undefined; created?: string | undefined; dataset?: string | undefined; duration?: number | undefined; hash?: string | undefined; ingested?: string | undefined; module?: string | undefined; outcome?: string | undefined; provider?: string | undefined; reason?: string | undefined; reference?: string | undefined; risk_score?: number | undefined; risk_score_norm?: number | undefined; sequence?: number | undefined; timezone?: string | undefined; } & {}> | undefined; rule?: Readonly<{ description?: string | undefined; id?: string | undefined; name?: string | undefined; version?: string | undefined; license?: string | undefined; category?: string | undefined; reference?: string | undefined; author?: string[] | undefined; ruleset?: string | undefined; uuid?: string | undefined; } & {}> | undefined; '@timestamp'?: string | undefined; log?: Readonly<{ logger?: string | undefined; level?: string | undefined; } & {}> | undefined; ecs?: Readonly<{ version?: string | undefined; } & {}> | undefined; } & {}> | undefined)[]" ], "source": { "path": "x-pack/plugins/event_log/server/es/cluster_client_adapter.ts", @@ -872,7 +872,7 @@ "label": "IEvent", "description": [], "signature": [ - "DeepPartial[] | undefined; alerting?: Readonly<{ status?: string | undefined; instance_id?: string | undefined; action_group_id?: string | undefined; action_subgroup?: string | undefined; } & {}> | undefined; server_uuid?: string | undefined; } & {}> | undefined; user?: Readonly<{ name?: string | undefined; } & {}> | undefined; error?: Readonly<{ type?: string | undefined; id?: string | undefined; message?: string | undefined; code?: string | undefined; stack_trace?: string | undefined; } & {}> | undefined; message?: string | undefined; tags?: string[] | undefined; event?: Readonly<{ start?: string | undefined; type?: string[] | undefined; id?: string | undefined; url?: string | undefined; end?: string | undefined; category?: string[] | undefined; code?: string | undefined; action?: string | undefined; kind?: string | undefined; original?: string | undefined; severity?: number | undefined; created?: string | undefined; dataset?: string | undefined; duration?: number | undefined; hash?: string | undefined; ingested?: string | undefined; module?: string | undefined; outcome?: string | undefined; provider?: string | undefined; reason?: string | undefined; reference?: string | undefined; risk_score?: number | undefined; risk_score_norm?: number | undefined; sequence?: number | undefined; timezone?: string | undefined; } & {}> | undefined; rule?: Readonly<{ description?: string | undefined; id?: string | undefined; name?: string | undefined; version?: string | undefined; license?: string | undefined; category?: string | undefined; reference?: string | undefined; author?: string[] | undefined; ruleset?: string | undefined; uuid?: string | undefined; } & {}> | undefined; log?: Readonly<{ logger?: string | undefined; level?: string | undefined; } & {}> | undefined; ecs?: Readonly<{ version?: string | undefined; } & {}> | undefined; } & {}>>> | undefined" + "DeepPartial[] | undefined; alerting?: Readonly<{ status?: string | undefined; instance_id?: string | undefined; action_group_id?: string | undefined; action_subgroup?: string | undefined; } & {}> | undefined; server_uuid?: string | undefined; } & {}> | undefined; user?: Readonly<{ name?: string | undefined; } & {}> | undefined; error?: Readonly<{ type?: string | undefined; id?: string | undefined; message?: string | undefined; code?: string | undefined; stack_trace?: string | undefined; } & {}> | undefined; message?: string | undefined; tags?: string[] | undefined; event?: Readonly<{ start?: string | undefined; type?: string[] | undefined; id?: string | undefined; url?: string | undefined; end?: string | undefined; category?: string[] | undefined; code?: string | undefined; action?: string | undefined; kind?: string | undefined; original?: string | undefined; severity?: number | undefined; created?: string | undefined; dataset?: string | undefined; duration?: number | undefined; hash?: string | undefined; ingested?: string | undefined; module?: string | undefined; outcome?: string | undefined; provider?: string | undefined; reason?: string | undefined; reference?: string | undefined; risk_score?: number | undefined; risk_score_norm?: number | undefined; sequence?: number | undefined; timezone?: string | undefined; } & {}> | undefined; rule?: Readonly<{ description?: string | undefined; id?: string | undefined; name?: string | undefined; version?: string | undefined; license?: string | undefined; category?: string | undefined; reference?: string | undefined; author?: string[] | undefined; ruleset?: string | undefined; uuid?: string | undefined; } & {}> | undefined; '@timestamp'?: string | undefined; log?: Readonly<{ logger?: string | undefined; level?: string | undefined; } & {}> | undefined; ecs?: Readonly<{ version?: string | undefined; } & {}> | undefined; } & {}>>> | undefined" ], "source": { "path": "x-pack/plugins/event_log/generated/schemas.ts", @@ -889,7 +889,7 @@ "label": "IValidatedEvent", "description": [], "signature": [ - "Readonly<{ '@timestamp'?: string | undefined; kibana?: Readonly<{ saved_objects?: Readonly<{ type?: string | undefined; id?: string | undefined; rel?: string | undefined; namespace?: string | undefined; } & {}>[] | undefined; alerting?: Readonly<{ status?: string | undefined; instance_id?: string | undefined; action_group_id?: string | undefined; action_subgroup?: string | undefined; } & {}> | undefined; server_uuid?: string | undefined; } & {}> | undefined; user?: Readonly<{ name?: string | undefined; } & {}> | undefined; error?: Readonly<{ type?: string | undefined; id?: string | undefined; message?: string | undefined; code?: string | undefined; stack_trace?: string | undefined; } & {}> | undefined; message?: string | undefined; tags?: string[] | undefined; event?: Readonly<{ start?: string | undefined; type?: string[] | undefined; id?: string | undefined; url?: string | undefined; end?: string | undefined; category?: string[] | undefined; code?: string | undefined; action?: string | undefined; kind?: string | undefined; original?: string | undefined; severity?: number | undefined; created?: string | undefined; dataset?: string | undefined; duration?: number | undefined; hash?: string | undefined; ingested?: string | undefined; module?: string | undefined; outcome?: string | undefined; provider?: string | undefined; reason?: string | undefined; reference?: string | undefined; risk_score?: number | undefined; risk_score_norm?: number | undefined; sequence?: number | undefined; timezone?: string | undefined; } & {}> | undefined; rule?: Readonly<{ description?: string | undefined; id?: string | undefined; name?: string | undefined; version?: string | undefined; license?: string | undefined; category?: string | undefined; reference?: string | undefined; author?: string[] | undefined; ruleset?: string | undefined; uuid?: string | undefined; } & {}> | undefined; log?: Readonly<{ logger?: string | undefined; level?: string | undefined; } & {}> | undefined; ecs?: Readonly<{ version?: string | undefined; } & {}> | undefined; } & {}> | undefined" + "Readonly<{ kibana?: Readonly<{ saved_objects?: Readonly<{ type?: string | undefined; id?: string | undefined; rel?: string | undefined; namespace?: string | undefined; type_id?: string | undefined; } & {}>[] | undefined; alerting?: Readonly<{ status?: string | undefined; instance_id?: string | undefined; action_group_id?: string | undefined; action_subgroup?: string | undefined; } & {}> | undefined; server_uuid?: string | undefined; } & {}> | undefined; user?: Readonly<{ name?: string | undefined; } & {}> | undefined; error?: Readonly<{ type?: string | undefined; id?: string | undefined; message?: string | undefined; code?: string | undefined; stack_trace?: string | undefined; } & {}> | undefined; message?: string | undefined; tags?: string[] | undefined; event?: Readonly<{ start?: string | undefined; type?: string[] | undefined; id?: string | undefined; url?: string | undefined; end?: string | undefined; category?: string[] | undefined; code?: string | undefined; action?: string | undefined; kind?: string | undefined; original?: string | undefined; severity?: number | undefined; created?: string | undefined; dataset?: string | undefined; duration?: number | undefined; hash?: string | undefined; ingested?: string | undefined; module?: string | undefined; outcome?: string | undefined; provider?: string | undefined; reason?: string | undefined; reference?: string | undefined; risk_score?: number | undefined; risk_score_norm?: number | undefined; sequence?: number | undefined; timezone?: string | undefined; } & {}> | undefined; rule?: Readonly<{ description?: string | undefined; id?: string | undefined; name?: string | undefined; version?: string | undefined; license?: string | undefined; category?: string | undefined; reference?: string | undefined; author?: string[] | undefined; ruleset?: string | undefined; uuid?: string | undefined; } & {}> | undefined; '@timestamp'?: string | undefined; log?: Readonly<{ logger?: string | undefined; level?: string | undefined; } & {}> | undefined; ecs?: Readonly<{ version?: string | undefined; } & {}> | undefined; } & {}> | undefined" ], "source": { "path": "x-pack/plugins/event_log/generated/schemas.ts", @@ -1171,7 +1171,7 @@ "label": "getLogger", "description": [], "signature": [ - "(properties: DeepPartial[] | undefined; alerting?: Readonly<{ status?: string | undefined; instance_id?: string | undefined; action_group_id?: string | undefined; action_subgroup?: string | undefined; } & {}> | undefined; server_uuid?: string | undefined; } & {}> | undefined; user?: Readonly<{ name?: string | undefined; } & {}> | undefined; error?: Readonly<{ type?: string | undefined; id?: string | undefined; message?: string | undefined; code?: string | undefined; stack_trace?: string | undefined; } & {}> | undefined; message?: string | undefined; tags?: string[] | undefined; event?: Readonly<{ start?: string | undefined; type?: string[] | undefined; id?: string | undefined; url?: string | undefined; end?: string | undefined; category?: string[] | undefined; code?: string | undefined; action?: string | undefined; kind?: string | undefined; original?: string | undefined; severity?: number | undefined; created?: string | undefined; dataset?: string | undefined; duration?: number | undefined; hash?: string | undefined; ingested?: string | undefined; module?: string | undefined; outcome?: string | undefined; provider?: string | undefined; reason?: string | undefined; reference?: string | undefined; risk_score?: number | undefined; risk_score_norm?: number | undefined; sequence?: number | undefined; timezone?: string | undefined; } & {}> | undefined; rule?: Readonly<{ description?: string | undefined; id?: string | undefined; name?: string | undefined; version?: string | undefined; license?: string | undefined; category?: string | undefined; reference?: string | undefined; author?: string[] | undefined; ruleset?: string | undefined; uuid?: string | undefined; } & {}> | undefined; log?: Readonly<{ logger?: string | undefined; level?: string | undefined; } & {}> | undefined; ecs?: Readonly<{ version?: string | undefined; } & {}> | undefined; } & {}>>> | undefined) => ", + "(properties: DeepPartial[] | undefined; alerting?: Readonly<{ status?: string | undefined; instance_id?: string | undefined; action_group_id?: string | undefined; action_subgroup?: string | undefined; } & {}> | undefined; server_uuid?: string | undefined; } & {}> | undefined; user?: Readonly<{ name?: string | undefined; } & {}> | undefined; error?: Readonly<{ type?: string | undefined; id?: string | undefined; message?: string | undefined; code?: string | undefined; stack_trace?: string | undefined; } & {}> | undefined; message?: string | undefined; tags?: string[] | undefined; event?: Readonly<{ start?: string | undefined; type?: string[] | undefined; id?: string | undefined; url?: string | undefined; end?: string | undefined; category?: string[] | undefined; code?: string | undefined; action?: string | undefined; kind?: string | undefined; original?: string | undefined; severity?: number | undefined; created?: string | undefined; dataset?: string | undefined; duration?: number | undefined; hash?: string | undefined; ingested?: string | undefined; module?: string | undefined; outcome?: string | undefined; provider?: string | undefined; reason?: string | undefined; reference?: string | undefined; risk_score?: number | undefined; risk_score_norm?: number | undefined; sequence?: number | undefined; timezone?: string | undefined; } & {}> | undefined; rule?: Readonly<{ description?: string | undefined; id?: string | undefined; name?: string | undefined; version?: string | undefined; license?: string | undefined; category?: string | undefined; reference?: string | undefined; author?: string[] | undefined; ruleset?: string | undefined; uuid?: string | undefined; } & {}> | undefined; '@timestamp'?: string | undefined; log?: Readonly<{ logger?: string | undefined; level?: string | undefined; } & {}> | undefined; ecs?: Readonly<{ version?: string | undefined; } & {}> | undefined; } & {}>>> | undefined) => ", { "pluginId": "eventLog", "scope": "server", @@ -1194,7 +1194,7 @@ "label": "properties", "description": [], "signature": [ - "DeepPartial[] | undefined; alerting?: Readonly<{ status?: string | undefined; instance_id?: string | undefined; action_group_id?: string | undefined; action_subgroup?: string | undefined; } & {}> | undefined; server_uuid?: string | undefined; } & {}> | undefined; user?: Readonly<{ name?: string | undefined; } & {}> | undefined; error?: Readonly<{ type?: string | undefined; id?: string | undefined; message?: string | undefined; code?: string | undefined; stack_trace?: string | undefined; } & {}> | undefined; message?: string | undefined; tags?: string[] | undefined; event?: Readonly<{ start?: string | undefined; type?: string[] | undefined; id?: string | undefined; url?: string | undefined; end?: string | undefined; category?: string[] | undefined; code?: string | undefined; action?: string | undefined; kind?: string | undefined; original?: string | undefined; severity?: number | undefined; created?: string | undefined; dataset?: string | undefined; duration?: number | undefined; hash?: string | undefined; ingested?: string | undefined; module?: string | undefined; outcome?: string | undefined; provider?: string | undefined; reason?: string | undefined; reference?: string | undefined; risk_score?: number | undefined; risk_score_norm?: number | undefined; sequence?: number | undefined; timezone?: string | undefined; } & {}> | undefined; rule?: Readonly<{ description?: string | undefined; id?: string | undefined; name?: string | undefined; version?: string | undefined; license?: string | undefined; category?: string | undefined; reference?: string | undefined; author?: string[] | undefined; ruleset?: string | undefined; uuid?: string | undefined; } & {}> | undefined; log?: Readonly<{ logger?: string | undefined; level?: string | undefined; } & {}> | undefined; ecs?: Readonly<{ version?: string | undefined; } & {}> | undefined; } & {}>>> | undefined" + "DeepPartial[] | undefined; alerting?: Readonly<{ status?: string | undefined; instance_id?: string | undefined; action_group_id?: string | undefined; action_subgroup?: string | undefined; } & {}> | undefined; server_uuid?: string | undefined; } & {}> | undefined; user?: Readonly<{ name?: string | undefined; } & {}> | undefined; error?: Readonly<{ type?: string | undefined; id?: string | undefined; message?: string | undefined; code?: string | undefined; stack_trace?: string | undefined; } & {}> | undefined; message?: string | undefined; tags?: string[] | undefined; event?: Readonly<{ start?: string | undefined; type?: string[] | undefined; id?: string | undefined; url?: string | undefined; end?: string | undefined; category?: string[] | undefined; code?: string | undefined; action?: string | undefined; kind?: string | undefined; original?: string | undefined; severity?: number | undefined; created?: string | undefined; dataset?: string | undefined; duration?: number | undefined; hash?: string | undefined; ingested?: string | undefined; module?: string | undefined; outcome?: string | undefined; provider?: string | undefined; reason?: string | undefined; reference?: string | undefined; risk_score?: number | undefined; risk_score_norm?: number | undefined; sequence?: number | undefined; timezone?: string | undefined; } & {}> | undefined; rule?: Readonly<{ description?: string | undefined; id?: string | undefined; name?: string | undefined; version?: string | undefined; license?: string | undefined; category?: string | undefined; reference?: string | undefined; author?: string[] | undefined; ruleset?: string | undefined; uuid?: string | undefined; } & {}> | undefined; '@timestamp'?: string | undefined; log?: Readonly<{ logger?: string | undefined; level?: string | undefined; } & {}> | undefined; ecs?: Readonly<{ version?: string | undefined; } & {}> | undefined; } & {}>>> | undefined" ], "source": { "path": "x-pack/plugins/event_log/server/types.ts", diff --git a/api_docs/expressions.json b/api_docs/expressions.json index e981414fe7bda9..79a9d016df0710 100644 --- a/api_docs/expressions.json +++ b/api_docs/expressions.json @@ -39151,7 +39151,7 @@ "label": "types", "description": [], "signature": [ - "(\"boolean\" | \"string\" | \"number\" | \"null\")[]" + "(\"number\" | \"boolean\" | \"string\" | \"null\")[]" ], "source": { "path": "src/plugins/expressions/common/expression_functions/specs/map_column.ts", diff --git a/api_docs/features.json b/api_docs/features.json index 63c3ebe3a92dec..7392fcf6a17f76 100644 --- a/api_docs/features.json +++ b/api_docs/features.json @@ -11,7 +11,7 @@ "description": [], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 137 + "lineNumber": 142 }, "deprecated": false, "children": [ @@ -34,7 +34,7 @@ ], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 138 + "lineNumber": 143 }, "deprecated": false }, @@ -50,7 +50,7 @@ ], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 140 + "lineNumber": 145 }, "deprecated": false, "children": [ @@ -62,7 +62,7 @@ "label": "config", "description": [], "signature": [ - "Readonly<{ id: string; name: string; category: Readonly<{ id: string; label: string; ariaLabel?: string | undefined; order?: number | undefined; euiIconType?: string | undefined; }>; order?: number | undefined; excludeFromBasePrivileges?: boolean | undefined; minimumLicense?: \"basic\" | \"standard\" | \"gold\" | \"platinum\" | \"enterprise\" | \"trial\" | undefined; app: readonly string[]; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; alerting?: readonly string[] | undefined; privileges: Readonly<{ all: Readonly<{ excludeFromBasePrivileges?: boolean | undefined; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; api?: readonly string[] | undefined; app?: readonly string[] | undefined; alerting?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; savedObject: Readonly<{ all: readonly string[]; read: readonly string[]; }>; ui: readonly string[]; }>; read: Readonly<{ excludeFromBasePrivileges?: boolean | undefined; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; api?: readonly string[] | undefined; app?: readonly string[] | undefined; alerting?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; savedObject: Readonly<{ all: readonly string[]; read: readonly string[]; }>; ui: readonly string[]; }>; }> | null; subFeatures?: readonly Readonly<{ name: string; privilegeGroups: readonly Readonly<{ groupType: ", + "Readonly<{ id: string; name: string; category: Readonly<{ id: string; label: string; ariaLabel?: string | undefined; order?: number | undefined; euiIconType?: string | undefined; }>; order?: number | undefined; excludeFromBasePrivileges?: boolean | undefined; minimumLicense?: \"basic\" | \"standard\" | \"gold\" | \"platinum\" | \"enterprise\" | \"trial\" | undefined; app: readonly string[]; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; alerting?: readonly string[] | undefined; cases?: readonly string[] | undefined; privileges: Readonly<{ all: Readonly<{ excludeFromBasePrivileges?: boolean | undefined; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; api?: readonly string[] | undefined; app?: readonly string[] | undefined; alerting?: Readonly<{ rule?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; alert?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; }> | undefined; cases?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; savedObject: Readonly<{ all: readonly string[]; read: readonly string[]; }>; ui: readonly string[]; }>; read: Readonly<{ excludeFromBasePrivileges?: boolean | undefined; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; api?: readonly string[] | undefined; app?: readonly string[] | undefined; alerting?: Readonly<{ rule?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; alert?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; }> | undefined; cases?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; savedObject: Readonly<{ all: readonly string[]; read: readonly string[]; }>; ui: readonly string[]; }>; }> | null; subFeatures?: readonly Readonly<{ name: string; privilegeGroups: readonly Readonly<{ groupType: ", { "pluginId": "features", "scope": "common", @@ -70,11 +70,11 @@ "section": "def-common.SubFeaturePrivilegeGroupType", "text": "SubFeaturePrivilegeGroupType" }, - "; privileges: readonly Readonly<{ id: string; name: string; includeIn: \"none\" | \"all\" | \"read\"; minimumLicense?: \"basic\" | \"standard\" | \"gold\" | \"platinum\" | \"enterprise\" | \"trial\" | undefined; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; alerting?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; ui: readonly string[]; app?: readonly string[] | undefined; api?: readonly string[] | undefined; savedObject: Readonly<{ all: readonly string[]; read: readonly string[]; }>; }>[]; }>[]; }>[] | undefined; privilegesTooltip?: string | undefined; reserved?: Readonly<{ description: string; privileges: readonly Readonly<{ id: string; privilege: Readonly<{ excludeFromBasePrivileges?: boolean | undefined; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; api?: readonly string[] | undefined; app?: readonly string[] | undefined; alerting?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; savedObject: Readonly<{ all: readonly string[]; read: readonly string[]; }>; ui: readonly string[]; }>; }>[]; }> | undefined; }>" + "; privileges: readonly Readonly<{ id: string; name: string; includeIn: \"all\" | \"none\" | \"read\"; minimumLicense?: \"basic\" | \"standard\" | \"gold\" | \"platinum\" | \"enterprise\" | \"trial\" | undefined; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; alerting?: Readonly<{ rule?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; alert?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; }> | undefined; ui: readonly string[]; cases?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; app?: readonly string[] | undefined; api?: readonly string[] | undefined; savedObject: Readonly<{ all: readonly string[]; read: readonly string[]; }>; }>[]; }>[]; }>[] | undefined; privilegesTooltip?: string | undefined; reserved?: Readonly<{ description: string; privileges: readonly Readonly<{ id: string; privilege: Readonly<{ excludeFromBasePrivileges?: boolean | undefined; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; api?: readonly string[] | undefined; app?: readonly string[] | undefined; alerting?: Readonly<{ rule?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; alert?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; }> | undefined; cases?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; savedObject: Readonly<{ all: readonly string[]; read: readonly string[]; }>; ui: readonly string[]; }>; }>[]; }> | undefined; }>" ], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 140 + "lineNumber": 145 }, "deprecated": false, "isRequired": true @@ -91,7 +91,7 @@ "description": [], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 146 + "lineNumber": 151 }, "deprecated": false }, @@ -104,7 +104,7 @@ "description": [], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 150 + "lineNumber": 155 }, "deprecated": false }, @@ -120,7 +120,7 @@ ], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 154 + "lineNumber": 159 }, "deprecated": false }, @@ -136,7 +136,7 @@ ], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 158 + "lineNumber": 163 }, "deprecated": false }, @@ -152,7 +152,7 @@ ], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 162 + "lineNumber": 167 }, "deprecated": false }, @@ -168,7 +168,7 @@ ], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 166 + "lineNumber": 171 }, "deprecated": false }, @@ -184,7 +184,7 @@ ], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 170 + "lineNumber": 175 }, "deprecated": false }, @@ -200,7 +200,7 @@ ], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 174 + "lineNumber": 179 }, "deprecated": false }, @@ -212,11 +212,11 @@ "label": "privileges", "description": [], "signature": [ - "Readonly<{ all: Readonly<{ excludeFromBasePrivileges?: boolean | undefined; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; api?: readonly string[] | undefined; app?: readonly string[] | undefined; alerting?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; savedObject: Readonly<{ all: readonly string[]; read: readonly string[]; }>; ui: readonly string[]; }>; read: Readonly<{ excludeFromBasePrivileges?: boolean | undefined; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; api?: readonly string[] | undefined; app?: readonly string[] | undefined; alerting?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; savedObject: Readonly<{ all: readonly string[]; read: readonly string[]; }>; ui: readonly string[]; }>; }> | null" + "Readonly<{ all: Readonly<{ excludeFromBasePrivileges?: boolean | undefined; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; api?: readonly string[] | undefined; app?: readonly string[] | undefined; alerting?: Readonly<{ rule?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; alert?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; }> | undefined; cases?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; savedObject: Readonly<{ all: readonly string[]; read: readonly string[]; }>; ui: readonly string[]; }>; read: Readonly<{ excludeFromBasePrivileges?: boolean | undefined; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; api?: readonly string[] | undefined; app?: readonly string[] | undefined; alerting?: Readonly<{ rule?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; alert?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; }> | undefined; cases?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; savedObject: Readonly<{ all: readonly string[]; read: readonly string[]; }>; ui: readonly string[]; }>; }> | null" ], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 178 + "lineNumber": 183 }, "deprecated": false }, @@ -232,7 +232,23 @@ ], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 182 + "lineNumber": 187 + }, + "deprecated": false + }, + { + "parentPluginId": "features", + "id": "def-public.KibanaFeature.cases", + "type": "Object", + "tags": [], + "label": "cases", + "description": [], + "signature": [ + "readonly string[] | undefined" + ], + "source": { + "path": "x-pack/plugins/features/common/kibana_feature.ts", + "lineNumber": 191 }, "deprecated": false }, @@ -245,7 +261,7 @@ "description": [], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 186 + "lineNumber": 195 }, "deprecated": false }, @@ -257,11 +273,11 @@ "label": "reserved", "description": [], "signature": [ - "Readonly<{ description: string; privileges: readonly Readonly<{ id: string; privilege: Readonly<{ excludeFromBasePrivileges?: boolean | undefined; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; api?: readonly string[] | undefined; app?: readonly string[] | undefined; alerting?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; savedObject: Readonly<{ all: readonly string[]; read: readonly string[]; }>; ui: readonly string[]; }>; }>[]; }> | undefined" + "Readonly<{ description: string; privileges: readonly Readonly<{ id: string; privilege: Readonly<{ excludeFromBasePrivileges?: boolean | undefined; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; api?: readonly string[] | undefined; app?: readonly string[] | undefined; alerting?: Readonly<{ rule?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; alert?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; }> | undefined; cases?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; savedObject: Readonly<{ all: readonly string[]; read: readonly string[]; }>; ui: readonly string[]; }>; }>[]; }> | undefined" ], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 190 + "lineNumber": 199 }, "deprecated": false }, @@ -284,7 +300,7 @@ ], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 194 + "lineNumber": 203 }, "deprecated": false, "children": [], @@ -411,7 +427,7 @@ "\nIf your feature requires access to specific Alert Types, then specify your access needs here.\nInclude both Alert Types registered by the feature and external Alert Types such as built-in\nAlert Types and Alert Types provided by other features to which you wish to grant access." ], "signature": [ - "{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; } | undefined" + "{ rule?: { all?: readonly string[] | undefined; read?: readonly string[] | undefined; } | undefined; alert?: { all?: readonly string[] | undefined; read?: readonly string[] | undefined; } | undefined; } | undefined" ], "source": { "path": "x-pack/plugins/features/common/feature_kibana_privileges.ts", @@ -419,6 +435,24 @@ }, "deprecated": false }, + { + "parentPluginId": "features", + "id": "def-public.FeatureKibanaPrivileges.cases", + "type": "Object", + "tags": [], + "label": "cases", + "description": [ + "\nIf your feature requires access to specific owners of cases (aka plugins that have created cases), then specify your access needs here. The values here should\nbe unique identifiers for the owners of cases you want access to." + ], + "signature": [ + "{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; } | undefined" + ], + "source": { + "path": "x-pack/plugins/features/common/feature_kibana_privileges.ts", + "lineNumber": 135 + }, + "deprecated": false + }, { "parentPluginId": "features", "id": "def-public.FeatureKibanaPrivileges.savedObject", @@ -433,7 +467,7 @@ ], "source": { "path": "x-pack/plugins/features/common/feature_kibana_privileges.ts", - "lineNumber": 110 + "lineNumber": 161 }, "deprecated": false }, @@ -453,7 +487,7 @@ ], "source": { "path": "x-pack/plugins/features/common/feature_kibana_privileges.ts", - "lineNumber": 153 + "lineNumber": 204 }, "deprecated": false } @@ -651,6 +685,24 @@ }, "deprecated": false }, + { + "parentPluginId": "features", + "id": "def-public.KibanaFeatureConfig.cases", + "type": "Object", + "tags": [], + "label": "cases", + "description": [ + "\nIf your feature grants access to specific case types, you can specify them here to control visibility based on the current space." + ], + "signature": [ + "readonly string[] | undefined" + ], + "source": { + "path": "x-pack/plugins/features/common/kibana_feature.ts", + "lineNumber": 104 + }, + "deprecated": false + }, { "parentPluginId": "features", "id": "def-public.KibanaFeatureConfig.privileges", @@ -683,7 +735,7 @@ ], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 113 + "lineNumber": 118 }, "deprecated": false }, @@ -709,7 +761,7 @@ ], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 121 + "lineNumber": 126 }, "deprecated": false }, @@ -727,7 +779,7 @@ ], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 126 + "lineNumber": 131 }, "deprecated": false }, @@ -747,7 +799,7 @@ ], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 131 + "lineNumber": 136 }, "deprecated": false } @@ -838,7 +890,7 @@ "section": "def-common.FeatureKibanaPrivileges", "text": "FeatureKibanaPrivileges" }, - ", \"management\" | \"catalogue\" | \"alerting\" | \"ui\" | \"app\" | \"api\" | \"savedObject\">" + ", \"management\" | \"catalogue\" | \"alerting\" | \"ui\" | \"cases\" | \"app\" | \"api\" | \"savedObject\">" ], "source": { "path": "x-pack/plugins/features/common/sub_feature.ts", @@ -886,7 +938,7 @@ "\nDenotes which Primary Feature Privilege this sub-feature privilege should be included in.\n`read` is also included in `all` automatically." ], "signature": [ - "\"none\" | \"all\" | \"read\"" + "\"all\" | \"none\" | \"read\"" ], "source": { "path": "x-pack/plugins/features/common/sub_feature.ts", @@ -1139,7 +1191,7 @@ "description": [], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 137 + "lineNumber": 142 }, "deprecated": false, "children": [ @@ -1162,7 +1214,7 @@ ], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 138 + "lineNumber": 143 }, "deprecated": false }, @@ -1178,7 +1230,7 @@ ], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 140 + "lineNumber": 145 }, "deprecated": false, "children": [ @@ -1190,7 +1242,7 @@ "label": "config", "description": [], "signature": [ - "Readonly<{ id: string; name: string; category: Readonly<{ id: string; label: string; ariaLabel?: string | undefined; order?: number | undefined; euiIconType?: string | undefined; }>; order?: number | undefined; excludeFromBasePrivileges?: boolean | undefined; minimumLicense?: \"basic\" | \"standard\" | \"gold\" | \"platinum\" | \"enterprise\" | \"trial\" | undefined; app: readonly string[]; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; alerting?: readonly string[] | undefined; privileges: Readonly<{ all: Readonly<{ excludeFromBasePrivileges?: boolean | undefined; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; api?: readonly string[] | undefined; app?: readonly string[] | undefined; alerting?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; savedObject: Readonly<{ all: readonly string[]; read: readonly string[]; }>; ui: readonly string[]; }>; read: Readonly<{ excludeFromBasePrivileges?: boolean | undefined; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; api?: readonly string[] | undefined; app?: readonly string[] | undefined; alerting?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; savedObject: Readonly<{ all: readonly string[]; read: readonly string[]; }>; ui: readonly string[]; }>; }> | null; subFeatures?: readonly Readonly<{ name: string; privilegeGroups: readonly Readonly<{ groupType: ", + "Readonly<{ id: string; name: string; category: Readonly<{ id: string; label: string; ariaLabel?: string | undefined; order?: number | undefined; euiIconType?: string | undefined; }>; order?: number | undefined; excludeFromBasePrivileges?: boolean | undefined; minimumLicense?: \"basic\" | \"standard\" | \"gold\" | \"platinum\" | \"enterprise\" | \"trial\" | undefined; app: readonly string[]; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; alerting?: readonly string[] | undefined; cases?: readonly string[] | undefined; privileges: Readonly<{ all: Readonly<{ excludeFromBasePrivileges?: boolean | undefined; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; api?: readonly string[] | undefined; app?: readonly string[] | undefined; alerting?: Readonly<{ rule?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; alert?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; }> | undefined; cases?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; savedObject: Readonly<{ all: readonly string[]; read: readonly string[]; }>; ui: readonly string[]; }>; read: Readonly<{ excludeFromBasePrivileges?: boolean | undefined; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; api?: readonly string[] | undefined; app?: readonly string[] | undefined; alerting?: Readonly<{ rule?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; alert?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; }> | undefined; cases?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; savedObject: Readonly<{ all: readonly string[]; read: readonly string[]; }>; ui: readonly string[]; }>; }> | null; subFeatures?: readonly Readonly<{ name: string; privilegeGroups: readonly Readonly<{ groupType: ", { "pluginId": "features", "scope": "common", @@ -1198,11 +1250,11 @@ "section": "def-common.SubFeaturePrivilegeGroupType", "text": "SubFeaturePrivilegeGroupType" }, - "; privileges: readonly Readonly<{ id: string; name: string; includeIn: \"none\" | \"all\" | \"read\"; minimumLicense?: \"basic\" | \"standard\" | \"gold\" | \"platinum\" | \"enterprise\" | \"trial\" | undefined; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; alerting?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; ui: readonly string[]; app?: readonly string[] | undefined; api?: readonly string[] | undefined; savedObject: Readonly<{ all: readonly string[]; read: readonly string[]; }>; }>[]; }>[]; }>[] | undefined; privilegesTooltip?: string | undefined; reserved?: Readonly<{ description: string; privileges: readonly Readonly<{ id: string; privilege: Readonly<{ excludeFromBasePrivileges?: boolean | undefined; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; api?: readonly string[] | undefined; app?: readonly string[] | undefined; alerting?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; savedObject: Readonly<{ all: readonly string[]; read: readonly string[]; }>; ui: readonly string[]; }>; }>[]; }> | undefined; }>" + "; privileges: readonly Readonly<{ id: string; name: string; includeIn: \"all\" | \"none\" | \"read\"; minimumLicense?: \"basic\" | \"standard\" | \"gold\" | \"platinum\" | \"enterprise\" | \"trial\" | undefined; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; alerting?: Readonly<{ rule?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; alert?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; }> | undefined; ui: readonly string[]; cases?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; app?: readonly string[] | undefined; api?: readonly string[] | undefined; savedObject: Readonly<{ all: readonly string[]; read: readonly string[]; }>; }>[]; }>[]; }>[] | undefined; privilegesTooltip?: string | undefined; reserved?: Readonly<{ description: string; privileges: readonly Readonly<{ id: string; privilege: Readonly<{ excludeFromBasePrivileges?: boolean | undefined; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; api?: readonly string[] | undefined; app?: readonly string[] | undefined; alerting?: Readonly<{ rule?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; alert?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; }> | undefined; cases?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; savedObject: Readonly<{ all: readonly string[]; read: readonly string[]; }>; ui: readonly string[]; }>; }>[]; }> | undefined; }>" ], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 140 + "lineNumber": 145 }, "deprecated": false, "isRequired": true @@ -1219,7 +1271,7 @@ "description": [], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 146 + "lineNumber": 151 }, "deprecated": false }, @@ -1232,7 +1284,7 @@ "description": [], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 150 + "lineNumber": 155 }, "deprecated": false }, @@ -1248,7 +1300,7 @@ ], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 154 + "lineNumber": 159 }, "deprecated": false }, @@ -1264,7 +1316,7 @@ ], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 158 + "lineNumber": 163 }, "deprecated": false }, @@ -1280,7 +1332,7 @@ ], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 162 + "lineNumber": 167 }, "deprecated": false }, @@ -1296,7 +1348,7 @@ ], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 166 + "lineNumber": 171 }, "deprecated": false }, @@ -1312,7 +1364,7 @@ ], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 170 + "lineNumber": 175 }, "deprecated": false }, @@ -1328,7 +1380,7 @@ ], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 174 + "lineNumber": 179 }, "deprecated": false }, @@ -1340,11 +1392,11 @@ "label": "privileges", "description": [], "signature": [ - "Readonly<{ all: Readonly<{ excludeFromBasePrivileges?: boolean | undefined; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; api?: readonly string[] | undefined; app?: readonly string[] | undefined; alerting?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; savedObject: Readonly<{ all: readonly string[]; read: readonly string[]; }>; ui: readonly string[]; }>; read: Readonly<{ excludeFromBasePrivileges?: boolean | undefined; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; api?: readonly string[] | undefined; app?: readonly string[] | undefined; alerting?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; savedObject: Readonly<{ all: readonly string[]; read: readonly string[]; }>; ui: readonly string[]; }>; }> | null" + "Readonly<{ all: Readonly<{ excludeFromBasePrivileges?: boolean | undefined; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; api?: readonly string[] | undefined; app?: readonly string[] | undefined; alerting?: Readonly<{ rule?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; alert?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; }> | undefined; cases?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; savedObject: Readonly<{ all: readonly string[]; read: readonly string[]; }>; ui: readonly string[]; }>; read: Readonly<{ excludeFromBasePrivileges?: boolean | undefined; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; api?: readonly string[] | undefined; app?: readonly string[] | undefined; alerting?: Readonly<{ rule?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; alert?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; }> | undefined; cases?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; savedObject: Readonly<{ all: readonly string[]; read: readonly string[]; }>; ui: readonly string[]; }>; }> | null" ], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 178 + "lineNumber": 183 }, "deprecated": false }, @@ -1360,7 +1412,23 @@ ], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 182 + "lineNumber": 187 + }, + "deprecated": false + }, + { + "parentPluginId": "features", + "id": "def-server.KibanaFeature.cases", + "type": "Object", + "tags": [], + "label": "cases", + "description": [], + "signature": [ + "readonly string[] | undefined" + ], + "source": { + "path": "x-pack/plugins/features/common/kibana_feature.ts", + "lineNumber": 191 }, "deprecated": false }, @@ -1373,7 +1441,7 @@ "description": [], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 186 + "lineNumber": 195 }, "deprecated": false }, @@ -1385,11 +1453,11 @@ "label": "reserved", "description": [], "signature": [ - "Readonly<{ description: string; privileges: readonly Readonly<{ id: string; privilege: Readonly<{ excludeFromBasePrivileges?: boolean | undefined; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; api?: readonly string[] | undefined; app?: readonly string[] | undefined; alerting?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; savedObject: Readonly<{ all: readonly string[]; read: readonly string[]; }>; ui: readonly string[]; }>; }>[]; }> | undefined" + "Readonly<{ description: string; privileges: readonly Readonly<{ id: string; privilege: Readonly<{ excludeFromBasePrivileges?: boolean | undefined; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; api?: readonly string[] | undefined; app?: readonly string[] | undefined; alerting?: Readonly<{ rule?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; alert?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; }> | undefined; cases?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; savedObject: Readonly<{ all: readonly string[]; read: readonly string[]; }>; ui: readonly string[]; }>; }>[]; }> | undefined" ], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 190 + "lineNumber": 199 }, "deprecated": false }, @@ -1412,7 +1480,7 @@ ], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 194 + "lineNumber": 203 }, "deprecated": false, "children": [], @@ -1740,7 +1808,7 @@ "\nIf your feature requires access to specific Alert Types, then specify your access needs here.\nInclude both Alert Types registered by the feature and external Alert Types such as built-in\nAlert Types and Alert Types provided by other features to which you wish to grant access." ], "signature": [ - "{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; } | undefined" + "{ rule?: { all?: readonly string[] | undefined; read?: readonly string[] | undefined; } | undefined; alert?: { all?: readonly string[] | undefined; read?: readonly string[] | undefined; } | undefined; } | undefined" ], "source": { "path": "x-pack/plugins/features/common/feature_kibana_privileges.ts", @@ -1748,6 +1816,24 @@ }, "deprecated": false }, + { + "parentPluginId": "features", + "id": "def-server.FeatureKibanaPrivileges.cases", + "type": "Object", + "tags": [], + "label": "cases", + "description": [ + "\nIf your feature requires access to specific owners of cases (aka plugins that have created cases), then specify your access needs here. The values here should\nbe unique identifiers for the owners of cases you want access to." + ], + "signature": [ + "{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; } | undefined" + ], + "source": { + "path": "x-pack/plugins/features/common/feature_kibana_privileges.ts", + "lineNumber": 135 + }, + "deprecated": false + }, { "parentPluginId": "features", "id": "def-server.FeatureKibanaPrivileges.savedObject", @@ -1762,7 +1848,7 @@ ], "source": { "path": "x-pack/plugins/features/common/feature_kibana_privileges.ts", - "lineNumber": 110 + "lineNumber": 161 }, "deprecated": false }, @@ -1782,7 +1868,7 @@ ], "source": { "path": "x-pack/plugins/features/common/feature_kibana_privileges.ts", - "lineNumber": 153 + "lineNumber": 204 }, "deprecated": false } @@ -1980,6 +2066,24 @@ }, "deprecated": false }, + { + "parentPluginId": "features", + "id": "def-server.KibanaFeatureConfig.cases", + "type": "Object", + "tags": [], + "label": "cases", + "description": [ + "\nIf your feature grants access to specific case types, you can specify them here to control visibility based on the current space." + ], + "signature": [ + "readonly string[] | undefined" + ], + "source": { + "path": "x-pack/plugins/features/common/kibana_feature.ts", + "lineNumber": 104 + }, + "deprecated": false + }, { "parentPluginId": "features", "id": "def-server.KibanaFeatureConfig.privileges", @@ -2012,7 +2116,7 @@ ], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 113 + "lineNumber": 118 }, "deprecated": false }, @@ -2038,7 +2142,7 @@ ], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 121 + "lineNumber": 126 }, "deprecated": false }, @@ -2056,7 +2160,7 @@ ], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 126 + "lineNumber": 131 }, "deprecated": false }, @@ -2076,7 +2180,7 @@ ], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 131 + "lineNumber": 136 }, "deprecated": false } @@ -2708,7 +2812,7 @@ "description": [], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 137 + "lineNumber": 142 }, "deprecated": false, "children": [ @@ -2731,7 +2835,7 @@ ], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 138 + "lineNumber": 143 }, "deprecated": false }, @@ -2747,7 +2851,7 @@ ], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 140 + "lineNumber": 145 }, "deprecated": false, "children": [ @@ -2759,7 +2863,7 @@ "label": "config", "description": [], "signature": [ - "Readonly<{ id: string; name: string; category: Readonly<{ id: string; label: string; ariaLabel?: string | undefined; order?: number | undefined; euiIconType?: string | undefined; }>; order?: number | undefined; excludeFromBasePrivileges?: boolean | undefined; minimumLicense?: \"basic\" | \"standard\" | \"gold\" | \"platinum\" | \"enterprise\" | \"trial\" | undefined; app: readonly string[]; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; alerting?: readonly string[] | undefined; privileges: Readonly<{ all: Readonly<{ excludeFromBasePrivileges?: boolean | undefined; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; api?: readonly string[] | undefined; app?: readonly string[] | undefined; alerting?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; savedObject: Readonly<{ all: readonly string[]; read: readonly string[]; }>; ui: readonly string[]; }>; read: Readonly<{ excludeFromBasePrivileges?: boolean | undefined; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; api?: readonly string[] | undefined; app?: readonly string[] | undefined; alerting?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; savedObject: Readonly<{ all: readonly string[]; read: readonly string[]; }>; ui: readonly string[]; }>; }> | null; subFeatures?: readonly Readonly<{ name: string; privilegeGroups: readonly Readonly<{ groupType: ", + "Readonly<{ id: string; name: string; category: Readonly<{ id: string; label: string; ariaLabel?: string | undefined; order?: number | undefined; euiIconType?: string | undefined; }>; order?: number | undefined; excludeFromBasePrivileges?: boolean | undefined; minimumLicense?: \"basic\" | \"standard\" | \"gold\" | \"platinum\" | \"enterprise\" | \"trial\" | undefined; app: readonly string[]; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; alerting?: readonly string[] | undefined; cases?: readonly string[] | undefined; privileges: Readonly<{ all: Readonly<{ excludeFromBasePrivileges?: boolean | undefined; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; api?: readonly string[] | undefined; app?: readonly string[] | undefined; alerting?: Readonly<{ rule?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; alert?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; }> | undefined; cases?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; savedObject: Readonly<{ all: readonly string[]; read: readonly string[]; }>; ui: readonly string[]; }>; read: Readonly<{ excludeFromBasePrivileges?: boolean | undefined; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; api?: readonly string[] | undefined; app?: readonly string[] | undefined; alerting?: Readonly<{ rule?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; alert?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; }> | undefined; cases?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; savedObject: Readonly<{ all: readonly string[]; read: readonly string[]; }>; ui: readonly string[]; }>; }> | null; subFeatures?: readonly Readonly<{ name: string; privilegeGroups: readonly Readonly<{ groupType: ", { "pluginId": "features", "scope": "common", @@ -2767,11 +2871,11 @@ "section": "def-common.SubFeaturePrivilegeGroupType", "text": "SubFeaturePrivilegeGroupType" }, - "; privileges: readonly Readonly<{ id: string; name: string; includeIn: \"none\" | \"all\" | \"read\"; minimumLicense?: \"basic\" | \"standard\" | \"gold\" | \"platinum\" | \"enterprise\" | \"trial\" | undefined; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; alerting?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; ui: readonly string[]; app?: readonly string[] | undefined; api?: readonly string[] | undefined; savedObject: Readonly<{ all: readonly string[]; read: readonly string[]; }>; }>[]; }>[]; }>[] | undefined; privilegesTooltip?: string | undefined; reserved?: Readonly<{ description: string; privileges: readonly Readonly<{ id: string; privilege: Readonly<{ excludeFromBasePrivileges?: boolean | undefined; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; api?: readonly string[] | undefined; app?: readonly string[] | undefined; alerting?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; savedObject: Readonly<{ all: readonly string[]; read: readonly string[]; }>; ui: readonly string[]; }>; }>[]; }> | undefined; }>" + "; privileges: readonly Readonly<{ id: string; name: string; includeIn: \"all\" | \"none\" | \"read\"; minimumLicense?: \"basic\" | \"standard\" | \"gold\" | \"platinum\" | \"enterprise\" | \"trial\" | undefined; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; alerting?: Readonly<{ rule?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; alert?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; }> | undefined; ui: readonly string[]; cases?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; app?: readonly string[] | undefined; api?: readonly string[] | undefined; savedObject: Readonly<{ all: readonly string[]; read: readonly string[]; }>; }>[]; }>[]; }>[] | undefined; privilegesTooltip?: string | undefined; reserved?: Readonly<{ description: string; privileges: readonly Readonly<{ id: string; privilege: Readonly<{ excludeFromBasePrivileges?: boolean | undefined; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; api?: readonly string[] | undefined; app?: readonly string[] | undefined; alerting?: Readonly<{ rule?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; alert?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; }> | undefined; cases?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; savedObject: Readonly<{ all: readonly string[]; read: readonly string[]; }>; ui: readonly string[]; }>; }>[]; }> | undefined; }>" ], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 140 + "lineNumber": 145 }, "deprecated": false, "isRequired": true @@ -2788,7 +2892,7 @@ "description": [], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 146 + "lineNumber": 151 }, "deprecated": false }, @@ -2801,7 +2905,7 @@ "description": [], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 150 + "lineNumber": 155 }, "deprecated": false }, @@ -2817,7 +2921,7 @@ ], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 154 + "lineNumber": 159 }, "deprecated": false }, @@ -2833,7 +2937,7 @@ ], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 158 + "lineNumber": 163 }, "deprecated": false }, @@ -2849,7 +2953,7 @@ ], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 162 + "lineNumber": 167 }, "deprecated": false }, @@ -2865,7 +2969,7 @@ ], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 166 + "lineNumber": 171 }, "deprecated": false }, @@ -2881,7 +2985,7 @@ ], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 170 + "lineNumber": 175 }, "deprecated": false }, @@ -2897,7 +3001,7 @@ ], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 174 + "lineNumber": 179 }, "deprecated": false }, @@ -2909,11 +3013,11 @@ "label": "privileges", "description": [], "signature": [ - "Readonly<{ all: Readonly<{ excludeFromBasePrivileges?: boolean | undefined; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; api?: readonly string[] | undefined; app?: readonly string[] | undefined; alerting?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; savedObject: Readonly<{ all: readonly string[]; read: readonly string[]; }>; ui: readonly string[]; }>; read: Readonly<{ excludeFromBasePrivileges?: boolean | undefined; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; api?: readonly string[] | undefined; app?: readonly string[] | undefined; alerting?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; savedObject: Readonly<{ all: readonly string[]; read: readonly string[]; }>; ui: readonly string[]; }>; }> | null" + "Readonly<{ all: Readonly<{ excludeFromBasePrivileges?: boolean | undefined; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; api?: readonly string[] | undefined; app?: readonly string[] | undefined; alerting?: Readonly<{ rule?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; alert?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; }> | undefined; cases?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; savedObject: Readonly<{ all: readonly string[]; read: readonly string[]; }>; ui: readonly string[]; }>; read: Readonly<{ excludeFromBasePrivileges?: boolean | undefined; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; api?: readonly string[] | undefined; app?: readonly string[] | undefined; alerting?: Readonly<{ rule?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; alert?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; }> | undefined; cases?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; savedObject: Readonly<{ all: readonly string[]; read: readonly string[]; }>; ui: readonly string[]; }>; }> | null" ], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 178 + "lineNumber": 183 }, "deprecated": false }, @@ -2929,7 +3033,23 @@ ], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 182 + "lineNumber": 187 + }, + "deprecated": false + }, + { + "parentPluginId": "features", + "id": "def-common.KibanaFeature.cases", + "type": "Object", + "tags": [], + "label": "cases", + "description": [], + "signature": [ + "readonly string[] | undefined" + ], + "source": { + "path": "x-pack/plugins/features/common/kibana_feature.ts", + "lineNumber": 191 }, "deprecated": false }, @@ -2942,7 +3062,7 @@ "description": [], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 186 + "lineNumber": 195 }, "deprecated": false }, @@ -2954,11 +3074,11 @@ "label": "reserved", "description": [], "signature": [ - "Readonly<{ description: string; privileges: readonly Readonly<{ id: string; privilege: Readonly<{ excludeFromBasePrivileges?: boolean | undefined; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; api?: readonly string[] | undefined; app?: readonly string[] | undefined; alerting?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; savedObject: Readonly<{ all: readonly string[]; read: readonly string[]; }>; ui: readonly string[]; }>; }>[]; }> | undefined" + "Readonly<{ description: string; privileges: readonly Readonly<{ id: string; privilege: Readonly<{ excludeFromBasePrivileges?: boolean | undefined; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; api?: readonly string[] | undefined; app?: readonly string[] | undefined; alerting?: Readonly<{ rule?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; alert?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; }> | undefined; cases?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; savedObject: Readonly<{ all: readonly string[]; read: readonly string[]; }>; ui: readonly string[]; }>; }>[]; }> | undefined" ], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 190 + "lineNumber": 199 }, "deprecated": false }, @@ -2981,7 +3101,7 @@ ], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 194 + "lineNumber": 203 }, "deprecated": false, "children": [], @@ -3035,7 +3155,7 @@ "section": "def-common.SubFeaturePrivilegeGroupType", "text": "SubFeaturePrivilegeGroupType" }, - "; privileges: readonly Readonly<{ id: string; name: string; includeIn: \"none\" | \"all\" | \"read\"; minimumLicense?: \"basic\" | \"standard\" | \"gold\" | \"platinum\" | \"enterprise\" | \"trial\" | undefined; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; alerting?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; ui: readonly string[]; app?: readonly string[] | undefined; api?: readonly string[] | undefined; savedObject: Readonly<{ all: readonly string[]; read: readonly string[]; }>; }>[]; }>[]; }>" + "; privileges: readonly Readonly<{ id: string; name: string; includeIn: \"all\" | \"none\" | \"read\"; minimumLicense?: \"basic\" | \"standard\" | \"gold\" | \"platinum\" | \"enterprise\" | \"trial\" | undefined; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; alerting?: Readonly<{ rule?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; alert?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; }> | undefined; ui: readonly string[]; cases?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; app?: readonly string[] | undefined; api?: readonly string[] | undefined; savedObject: Readonly<{ all: readonly string[]; read: readonly string[]; }>; }>[]; }>[]; }>" ], "source": { "path": "x-pack/plugins/features/common/sub_feature.ts", @@ -3076,7 +3196,7 @@ "section": "def-common.SubFeaturePrivilegeGroupType", "text": "SubFeaturePrivilegeGroupType" }, - "; privileges: readonly Readonly<{ id: string; name: string; includeIn: \"none\" | \"all\" | \"read\"; minimumLicense?: \"basic\" | \"standard\" | \"gold\" | \"platinum\" | \"enterprise\" | \"trial\" | undefined; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; alerting?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; ui: readonly string[]; app?: readonly string[] | undefined; api?: readonly string[] | undefined; savedObject: Readonly<{ all: readonly string[]; read: readonly string[]; }>; }>[]; }>[]" + "; privileges: readonly Readonly<{ id: string; name: string; includeIn: \"all\" | \"none\" | \"read\"; minimumLicense?: \"basic\" | \"standard\" | \"gold\" | \"platinum\" | \"enterprise\" | \"trial\" | undefined; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; alerting?: Readonly<{ rule?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; alert?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; }> | undefined; ui: readonly string[]; cases?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; app?: readonly string[] | undefined; api?: readonly string[] | undefined; savedObject: Readonly<{ all: readonly string[]; read: readonly string[]; }>; }>[]; }>[]" ], "source": { "path": "x-pack/plugins/features/common/sub_feature.ts", @@ -3100,7 +3220,7 @@ "section": "def-common.SubFeaturePrivilegeGroupType", "text": "SubFeaturePrivilegeGroupType" }, - "; privileges: readonly Readonly<{ id: string; name: string; includeIn: \"none\" | \"all\" | \"read\"; minimumLicense?: \"basic\" | \"standard\" | \"gold\" | \"platinum\" | \"enterprise\" | \"trial\" | undefined; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; alerting?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; ui: readonly string[]; app?: readonly string[] | undefined; api?: readonly string[] | undefined; savedObject: Readonly<{ all: readonly string[]; read: readonly string[]; }>; }>[]; }>[]; }" + "; privileges: readonly Readonly<{ id: string; name: string; includeIn: \"all\" | \"none\" | \"read\"; minimumLicense?: \"basic\" | \"standard\" | \"gold\" | \"platinum\" | \"enterprise\" | \"trial\" | undefined; management?: Readonly<{ [x: string]: readonly string[]; }> | undefined; catalogue?: readonly string[] | undefined; alerting?: Readonly<{ rule?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; alert?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; }> | undefined; ui: readonly string[]; cases?: Readonly<{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; }> | undefined; app?: readonly string[] | undefined; api?: readonly string[] | undefined; savedObject: Readonly<{ all: readonly string[]; read: readonly string[]; }>; }>[]; }>[]; }" ], "source": { "path": "x-pack/plugins/features/common/sub_feature.ts", @@ -3432,7 +3552,7 @@ "\nIf your feature requires access to specific Alert Types, then specify your access needs here.\nInclude both Alert Types registered by the feature and external Alert Types such as built-in\nAlert Types and Alert Types provided by other features to which you wish to grant access." ], "signature": [ - "{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; } | undefined" + "{ rule?: { all?: readonly string[] | undefined; read?: readonly string[] | undefined; } | undefined; alert?: { all?: readonly string[] | undefined; read?: readonly string[] | undefined; } | undefined; } | undefined" ], "source": { "path": "x-pack/plugins/features/common/feature_kibana_privileges.ts", @@ -3440,6 +3560,24 @@ }, "deprecated": false }, + { + "parentPluginId": "features", + "id": "def-common.FeatureKibanaPrivileges.cases", + "type": "Object", + "tags": [], + "label": "cases", + "description": [ + "\nIf your feature requires access to specific owners of cases (aka plugins that have created cases), then specify your access needs here. The values here should\nbe unique identifiers for the owners of cases you want access to." + ], + "signature": [ + "{ all?: readonly string[] | undefined; read?: readonly string[] | undefined; } | undefined" + ], + "source": { + "path": "x-pack/plugins/features/common/feature_kibana_privileges.ts", + "lineNumber": 135 + }, + "deprecated": false + }, { "parentPluginId": "features", "id": "def-common.FeatureKibanaPrivileges.savedObject", @@ -3454,7 +3592,7 @@ ], "source": { "path": "x-pack/plugins/features/common/feature_kibana_privileges.ts", - "lineNumber": 110 + "lineNumber": 161 }, "deprecated": false }, @@ -3474,7 +3612,7 @@ ], "source": { "path": "x-pack/plugins/features/common/feature_kibana_privileges.ts", - "lineNumber": 153 + "lineNumber": 204 }, "deprecated": false } @@ -3672,6 +3810,24 @@ }, "deprecated": false }, + { + "parentPluginId": "features", + "id": "def-common.KibanaFeatureConfig.cases", + "type": "Object", + "tags": [], + "label": "cases", + "description": [ + "\nIf your feature grants access to specific case types, you can specify them here to control visibility based on the current space." + ], + "signature": [ + "readonly string[] | undefined" + ], + "source": { + "path": "x-pack/plugins/features/common/kibana_feature.ts", + "lineNumber": 104 + }, + "deprecated": false + }, { "parentPluginId": "features", "id": "def-common.KibanaFeatureConfig.privileges", @@ -3704,7 +3860,7 @@ ], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 113 + "lineNumber": 118 }, "deprecated": false }, @@ -3730,7 +3886,7 @@ ], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 121 + "lineNumber": 126 }, "deprecated": false }, @@ -3748,7 +3904,7 @@ ], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 126 + "lineNumber": 131 }, "deprecated": false }, @@ -3768,7 +3924,7 @@ ], "source": { "path": "x-pack/plugins/features/common/kibana_feature.ts", - "lineNumber": 131 + "lineNumber": 136 }, "deprecated": false } @@ -3859,7 +4015,7 @@ "section": "def-common.FeatureKibanaPrivileges", "text": "FeatureKibanaPrivileges" }, - ", \"management\" | \"catalogue\" | \"alerting\" | \"ui\" | \"app\" | \"api\" | \"savedObject\">" + ", \"management\" | \"catalogue\" | \"alerting\" | \"ui\" | \"cases\" | \"app\" | \"api\" | \"savedObject\">" ], "source": { "path": "x-pack/plugins/features/common/sub_feature.ts", @@ -3907,7 +4063,7 @@ "\nDenotes which Primary Feature Privilege this sub-feature privilege should be included in.\n`read` is also included in `all` automatically." ], "signature": [ - "\"none\" | \"all\" | \"read\"" + "\"all\" | \"none\" | \"read\"" ], "source": { "path": "x-pack/plugins/features/common/sub_feature.ts", diff --git a/api_docs/file_data_visualizer.json b/api_docs/file_data_visualizer.json index c536acd5f4997a..31b2c6bf5b673e 100644 --- a/api_docs/file_data_visualizer.json +++ b/api_docs/file_data_visualizer.json @@ -19,7 +19,7 @@ ], "source": { "path": "x-pack/plugins/file_data_visualizer/public/plugin.ts", - "lineNumber": 33 + "lineNumber": 36 }, "deprecated": false, "lifecycle": "start", @@ -230,7 +230,7 @@ "label": "JobFieldType", "description": [], "signature": [ - "\"number\" | \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"unknown\"" + "\"number\" | \"boolean\" | \"date\" | \"keyword\" | \"text\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"unknown\"" ], "source": { "path": "x-pack/plugins/file_data_visualizer/common/types.ts", diff --git a/api_docs/fleet.json b/api_docs/fleet.json index 043dfcd16c2a79..ea4d3db538f397 100644 --- a/api_docs/fleet.json +++ b/api_docs/fleet.json @@ -14,7 +14,7 @@ "(packageInfo: T) => string" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/services/pkg_key_from_package_info.ts", + "path": "x-pack/plugins/fleet/public/services/pkg_key_from_package_info.ts", "lineNumber": 8 }, "deprecated": false, @@ -30,7 +30,7 @@ "T" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/services/pkg_key_from_package_info.ts", + "path": "x-pack/plugins/fleet/public/services/pkg_key_from_package_info.ts", "lineNumber": 9 }, "deprecated": false, @@ -52,7 +52,7 @@ "\nSupported routing state for the agent policy details page routes with deploy agents action" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/types/intra_app_route_state.ts", + "path": "x-pack/plugins/fleet/public/types/intra_app_route_state.ts", "lineNumber": 37 }, "deprecated": false, @@ -78,7 +78,7 @@ " | undefined] | undefined" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/types/intra_app_route_state.ts", + "path": "x-pack/plugins/fleet/public/types/intra_app_route_state.ts", "lineNumber": 39 }, "deprecated": false @@ -96,7 +96,7 @@ "\nSupported routing state for the agent policy details page routes with deploy agents action" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/types/intra_app_route_state.ts", + "path": "x-pack/plugins/fleet/public/types/intra_app_route_state.ts", "lineNumber": 29 }, "deprecated": false, @@ -122,7 +122,7 @@ " | undefined] | undefined" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/types/intra_app_route_state.ts", + "path": "x-pack/plugins/fleet/public/types/intra_app_route_state.ts", "lineNumber": 31 }, "deprecated": false @@ -140,7 +140,7 @@ "\nSupported routing state for the create package policy page routes" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/types/intra_app_route_state.ts", + "path": "x-pack/plugins/fleet/public/types/intra_app_route_state.ts", "lineNumber": 15 }, "deprecated": false, @@ -182,7 +182,7 @@ " | undefined]) | undefined" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/types/intra_app_route_state.ts", + "path": "x-pack/plugins/fleet/public/types/intra_app_route_state.ts", "lineNumber": 17 }, "deprecated": false @@ -208,7 +208,7 @@ " | undefined] | undefined" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/types/intra_app_route_state.ts", + "path": "x-pack/plugins/fleet/public/types/intra_app_route_state.ts", "lineNumber": 21 }, "deprecated": false @@ -226,7 +226,7 @@ "string | undefined" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/types/intra_app_route_state.ts", + "path": "x-pack/plugins/fleet/public/types/intra_app_route_state.ts", "lineNumber": 23 }, "deprecated": false @@ -411,7 +411,7 @@ "Extension point registration contract for Integration details Custom view" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/types/ui_extensions.ts", + "path": "x-pack/plugins/fleet/public/types/ui_extensions.ts", "lineNumber": 94 }, "deprecated": false, @@ -424,7 +424,7 @@ "label": "package", "description": [], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/types/ui_extensions.ts", + "path": "x-pack/plugins/fleet/public/types/ui_extensions.ts", "lineNumber": 95 }, "deprecated": false @@ -440,7 +440,7 @@ "\"package-detail-custom\"" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/types/ui_extensions.ts", + "path": "x-pack/plugins/fleet/public/types/ui_extensions.ts", "lineNumber": 96 }, "deprecated": false @@ -488,7 +488,7 @@ ">; }" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/types/ui_extensions.ts", + "path": "x-pack/plugins/fleet/public/types/ui_extensions.ts", "lineNumber": 97 }, "deprecated": false, @@ -523,7 +523,7 @@ "label": "PackageCustomExtensionComponentProps", "description": [], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/types/ui_extensions.ts", + "path": "x-pack/plugins/fleet/public/types/ui_extensions.ts", "lineNumber": 87 }, "deprecated": false, @@ -538,7 +538,7 @@ "The package key value that should be used used for URLs" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/types/ui_extensions.ts", + "path": "x-pack/plugins/fleet/public/types/ui_extensions.ts", "lineNumber": 89 }, "deprecated": false @@ -649,7 +649,7 @@ ">>" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/types/ui_extensions.ts", + "path": "x-pack/plugins/fleet/public/types/ui_extensions.ts", "lineNumber": 90 }, "deprecated": false @@ -667,7 +667,7 @@ "Extension point registration contract for Integration Policy Create views" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/types/ui_extensions.ts", + "path": "x-pack/plugins/fleet/public/types/ui_extensions.ts", "lineNumber": 76 }, "deprecated": false, @@ -680,7 +680,7 @@ "label": "package", "description": [], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/types/ui_extensions.ts", + "path": "x-pack/plugins/fleet/public/types/ui_extensions.ts", "lineNumber": 77 }, "deprecated": false @@ -696,7 +696,7 @@ "\"package-policy-create\"" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/types/ui_extensions.ts", + "path": "x-pack/plugins/fleet/public/types/ui_extensions.ts", "lineNumber": 78 }, "deprecated": false @@ -744,7 +744,7 @@ ">; }" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/types/ui_extensions.ts", + "path": "x-pack/plugins/fleet/public/types/ui_extensions.ts", "lineNumber": 79 }, "deprecated": false, @@ -779,7 +779,7 @@ "label": "PackagePolicyCreateExtensionComponentProps", "description": [], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/types/ui_extensions.ts", + "path": "x-pack/plugins/fleet/public/types/ui_extensions.ts", "lineNumber": 60 }, "deprecated": false, @@ -803,7 +803,7 @@ } ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/types/ui_extensions.ts", + "path": "x-pack/plugins/fleet/public/types/ui_extensions.ts", "lineNumber": 62 }, "deprecated": false @@ -829,7 +829,7 @@ "; }) => void" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/types/ui_extensions.ts", + "path": "x-pack/plugins/fleet/public/types/ui_extensions.ts", "lineNumber": 67 }, "deprecated": false, @@ -854,7 +854,7 @@ "; }" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/types/ui_extensions.ts", + "path": "x-pack/plugins/fleet/public/types/ui_extensions.ts", "lineNumber": 67 }, "deprecated": false @@ -874,7 +874,7 @@ "Extension point registration contract for Integration Policy Edit views" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/types/ui_extensions.ts", + "path": "x-pack/plugins/fleet/public/types/ui_extensions.ts", "lineNumber": 48 }, "deprecated": false, @@ -887,7 +887,7 @@ "label": "package", "description": [], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/types/ui_extensions.ts", + "path": "x-pack/plugins/fleet/public/types/ui_extensions.ts", "lineNumber": 49 }, "deprecated": false @@ -903,7 +903,7 @@ "\"package-policy-edit\"" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/types/ui_extensions.ts", + "path": "x-pack/plugins/fleet/public/types/ui_extensions.ts", "lineNumber": 50 }, "deprecated": false @@ -951,7 +951,7 @@ ">; }" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/types/ui_extensions.ts", + "path": "x-pack/plugins/fleet/public/types/ui_extensions.ts", "lineNumber": 51 }, "deprecated": false, @@ -986,7 +986,7 @@ "label": "PackagePolicyEditExtensionComponentProps", "description": [], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/types/ui_extensions.ts", + "path": "x-pack/plugins/fleet/public/types/ui_extensions.ts", "lineNumber": 26 }, "deprecated": false, @@ -1010,7 +1010,7 @@ } ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/types/ui_extensions.ts", + "path": "x-pack/plugins/fleet/public/types/ui_extensions.ts", "lineNumber": 28 }, "deprecated": false @@ -1034,7 +1034,7 @@ } ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/types/ui_extensions.ts", + "path": "x-pack/plugins/fleet/public/types/ui_extensions.ts", "lineNumber": 30 }, "deprecated": false @@ -1060,7 +1060,7 @@ ">; }) => void" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/types/ui_extensions.ts", + "path": "x-pack/plugins/fleet/public/types/ui_extensions.ts", "lineNumber": 39 }, "deprecated": false, @@ -1085,7 +1085,7 @@ ">; }" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/types/ui_extensions.ts", + "path": "x-pack/plugins/fleet/public/types/ui_extensions.ts", "lineNumber": 39 }, "deprecated": false @@ -1105,7 +1105,7 @@ "Internal storage for registered UI Extension Points" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/types/ui_extensions.ts", + "path": "x-pack/plugins/fleet/public/types/ui_extensions.ts", "lineNumber": 16 }, "deprecated": false, @@ -1121,7 +1121,7 @@ "any" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/types/ui_extensions.ts", + "path": "x-pack/plugins/fleet/public/types/ui_extensions.ts", "lineNumber": 17 }, "deprecated": false @@ -1167,7 +1167,7 @@ } ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/types/intra_app_route_state.ts", + "path": "x-pack/plugins/fleet/public/types/intra_app_route_state.ts", "lineNumber": 45 }, "deprecated": false, @@ -1202,7 +1202,7 @@ ">" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/types/ui_extensions.ts", + "path": "x-pack/plugins/fleet/public/types/ui_extensions.ts", "lineNumber": 85 }, "deprecated": false, @@ -1237,7 +1237,7 @@ ">" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/types/ui_extensions.ts", + "path": "x-pack/plugins/fleet/public/types/ui_extensions.ts", "lineNumber": 58 }, "deprecated": false, @@ -1272,7 +1272,7 @@ ">" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/types/ui_extensions.ts", + "path": "x-pack/plugins/fleet/public/types/ui_extensions.ts", "lineNumber": 24 }, "deprecated": false, @@ -1313,7 +1313,7 @@ } ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/types/ui_extensions.ts", + "path": "x-pack/plugins/fleet/public/types/ui_extensions.ts", "lineNumber": 101 }, "deprecated": false, @@ -1340,7 +1340,7 @@ ") => void" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/types/ui_extensions.ts", + "path": "x-pack/plugins/fleet/public/types/ui_extensions.ts", "lineNumber": 13 }, "deprecated": false, @@ -1356,8 +1356,8 @@ "label": "pagePathGetters", "description": [], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/constants/page_paths.ts", - "lineNumber": 69 + "path": "x-pack/plugins/fleet/public/constants/page_paths.ts", + "lineNumber": 73 }, "deprecated": false, "children": [ @@ -1369,11 +1369,11 @@ "label": "base", "description": [], "signature": [ - "() => string" + "() => [string, string]" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/constants/page_paths.ts", - "lineNumber": 75 + "path": "x-pack/plugins/fleet/public/constants/page_paths.ts", + "lineNumber": 79 }, "deprecated": false, "children": [], @@ -1387,11 +1387,11 @@ "label": "overview", "description": [], "signature": [ - "() => string" + "() => [string, string]" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/constants/page_paths.ts", - "lineNumber": 76 + "path": "x-pack/plugins/fleet/public/constants/page_paths.ts", + "lineNumber": 80 }, "deprecated": false, "children": [], @@ -1405,11 +1405,11 @@ "label": "integrations", "description": [], "signature": [ - "() => string" + "() => [string, string]" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/constants/page_paths.ts", - "lineNumber": 77 + "path": "x-pack/plugins/fleet/public/constants/page_paths.ts", + "lineNumber": 81 }, "deprecated": false, "children": [], @@ -1423,11 +1423,11 @@ "label": "integrations_all", "description": [], "signature": [ - "() => string" + "() => [string, string]" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/constants/page_paths.ts", - "lineNumber": 78 + "path": "x-pack/plugins/fleet/public/constants/page_paths.ts", + "lineNumber": 82 }, "deprecated": false, "children": [], @@ -1441,11 +1441,11 @@ "label": "integrations_installed", "description": [], "signature": [ - "() => string" + "() => [string, string]" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/constants/page_paths.ts", - "lineNumber": 79 + "path": "x-pack/plugins/fleet/public/constants/page_paths.ts", + "lineNumber": 83 }, "deprecated": false, "children": [], @@ -1461,11 +1461,11 @@ "signature": [ "({ pkgkey, integration }: ", "DynamicPagePathValues", - ") => string" + ") => [string, string]" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/constants/page_paths.ts", - "lineNumber": 80 + "path": "x-pack/plugins/fleet/public/constants/page_paths.ts", + "lineNumber": 84 }, "deprecated": false, "children": [ @@ -1480,8 +1480,8 @@ "DynamicPagePathValues" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/constants/page_paths.ts", - "lineNumber": 80 + "path": "x-pack/plugins/fleet/public/constants/page_paths.ts", + "lineNumber": 84 }, "deprecated": false, "isRequired": true @@ -1499,11 +1499,11 @@ "signature": [ "({ pkgkey, integration }: ", "DynamicPagePathValues", - ") => string" + ") => [string, string]" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/constants/page_paths.ts", - "lineNumber": 82 + "path": "x-pack/plugins/fleet/public/constants/page_paths.ts", + "lineNumber": 88 }, "deprecated": false, "children": [ @@ -1518,8 +1518,8 @@ "DynamicPagePathValues" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/constants/page_paths.ts", - "lineNumber": 82 + "path": "x-pack/plugins/fleet/public/constants/page_paths.ts", + "lineNumber": 88 }, "deprecated": false, "isRequired": true @@ -1537,11 +1537,11 @@ "signature": [ "({ pkgkey, integration }: ", "DynamicPagePathValues", - ") => string" + ") => [string, string]" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/constants/page_paths.ts", - "lineNumber": 84 + "path": "x-pack/plugins/fleet/public/constants/page_paths.ts", + "lineNumber": 92 }, "deprecated": false, "children": [ @@ -1556,8 +1556,8 @@ "DynamicPagePathValues" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/constants/page_paths.ts", - "lineNumber": 84 + "path": "x-pack/plugins/fleet/public/constants/page_paths.ts", + "lineNumber": 92 }, "deprecated": false, "isRequired": true @@ -1575,11 +1575,11 @@ "signature": [ "({ pkgkey, integration }: ", "DynamicPagePathValues", - ") => string" + ") => [string, string]" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/constants/page_paths.ts", - "lineNumber": 86 + "path": "x-pack/plugins/fleet/public/constants/page_paths.ts", + "lineNumber": 96 }, "deprecated": false, "children": [ @@ -1594,8 +1594,8 @@ "DynamicPagePathValues" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/constants/page_paths.ts", - "lineNumber": 86 + "path": "x-pack/plugins/fleet/public/constants/page_paths.ts", + "lineNumber": 96 }, "deprecated": false, "isRequired": true @@ -1613,11 +1613,11 @@ "signature": [ "({ packagePolicyId }: ", "DynamicPagePathValues", - ") => string" + ") => [string, string]" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/constants/page_paths.ts", - "lineNumber": 88 + "path": "x-pack/plugins/fleet/public/constants/page_paths.ts", + "lineNumber": 100 }, "deprecated": false, "children": [ @@ -1632,8 +1632,8 @@ "DynamicPagePathValues" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/constants/page_paths.ts", - "lineNumber": 88 + "path": "x-pack/plugins/fleet/public/constants/page_paths.ts", + "lineNumber": 100 }, "deprecated": false, "isRequired": true @@ -1649,11 +1649,11 @@ "label": "policies", "description": [], "signature": [ - "() => string" + "() => [string, string]" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/constants/page_paths.ts", - "lineNumber": 90 + "path": "x-pack/plugins/fleet/public/constants/page_paths.ts", + "lineNumber": 104 }, "deprecated": false, "children": [], @@ -1667,11 +1667,11 @@ "label": "policies_list", "description": [], "signature": [ - "() => string" + "() => [string, string]" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/constants/page_paths.ts", - "lineNumber": 91 + "path": "x-pack/plugins/fleet/public/constants/page_paths.ts", + "lineNumber": 105 }, "deprecated": false, "children": [], @@ -1687,11 +1687,11 @@ "signature": [ "({ policyId, tabId }: ", "DynamicPagePathValues", - ") => string" + ") => [string, string]" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/constants/page_paths.ts", - "lineNumber": 92 + "path": "x-pack/plugins/fleet/public/constants/page_paths.ts", + "lineNumber": 106 }, "deprecated": false, "children": [ @@ -1706,8 +1706,8 @@ "DynamicPagePathValues" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/constants/page_paths.ts", - "lineNumber": 92 + "path": "x-pack/plugins/fleet/public/constants/page_paths.ts", + "lineNumber": 106 }, "deprecated": false, "isRequired": true @@ -1725,11 +1725,11 @@ "signature": [ "({ policyId }: ", "DynamicPagePathValues", - ") => string" + ") => [string, string]" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/constants/page_paths.ts", - "lineNumber": 93 + "path": "x-pack/plugins/fleet/public/constants/page_paths.ts", + "lineNumber": 110 }, "deprecated": false, "children": [ @@ -1744,8 +1744,8 @@ "DynamicPagePathValues" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/constants/page_paths.ts", - "lineNumber": 93 + "path": "x-pack/plugins/fleet/public/constants/page_paths.ts", + "lineNumber": 110 }, "deprecated": false, "isRequired": true @@ -1763,11 +1763,11 @@ "signature": [ "({ pkgkey, integration }: ", "DynamicPagePathValues", - ") => string" + ") => [string, string]" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/constants/page_paths.ts", - "lineNumber": 94 + "path": "x-pack/plugins/fleet/public/constants/page_paths.ts", + "lineNumber": 114 }, "deprecated": false, "children": [ @@ -1782,8 +1782,8 @@ "DynamicPagePathValues" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/constants/page_paths.ts", - "lineNumber": 94 + "path": "x-pack/plugins/fleet/public/constants/page_paths.ts", + "lineNumber": 114 }, "deprecated": false, "isRequired": true @@ -1801,11 +1801,11 @@ "signature": [ "({ policyId, packagePolicyId }: ", "DynamicPagePathValues", - ") => string" + ") => [string, string]" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/constants/page_paths.ts", - "lineNumber": 96 + "path": "x-pack/plugins/fleet/public/constants/page_paths.ts", + "lineNumber": 118 }, "deprecated": false, "children": [ @@ -1820,8 +1820,8 @@ "DynamicPagePathValues" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/constants/page_paths.ts", - "lineNumber": 96 + "path": "x-pack/plugins/fleet/public/constants/page_paths.ts", + "lineNumber": 118 }, "deprecated": false, "isRequired": true @@ -1837,11 +1837,11 @@ "label": "fleet", "description": [], "signature": [ - "() => string" + "() => [string, string]" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/constants/page_paths.ts", - "lineNumber": 98 + "path": "x-pack/plugins/fleet/public/constants/page_paths.ts", + "lineNumber": 122 }, "deprecated": false, "children": [], @@ -1857,11 +1857,11 @@ "signature": [ "({ kuery }: ", "DynamicPagePathValues", - ") => string" + ") => [string, string]" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/constants/page_paths.ts", - "lineNumber": 99 + "path": "x-pack/plugins/fleet/public/constants/page_paths.ts", + "lineNumber": 123 }, "deprecated": false, "children": [ @@ -1876,8 +1876,8 @@ "DynamicPagePathValues" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/constants/page_paths.ts", - "lineNumber": 99 + "path": "x-pack/plugins/fleet/public/constants/page_paths.ts", + "lineNumber": 123 }, "deprecated": false, "isRequired": true @@ -1895,11 +1895,11 @@ "signature": [ "({ agentId, tabId, logQuery }: ", "DynamicPagePathValues", - ") => string" + ") => [string, string]" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/constants/page_paths.ts", - "lineNumber": 100 + "path": "x-pack/plugins/fleet/public/constants/page_paths.ts", + "lineNumber": 127 }, "deprecated": false, "children": [ @@ -1914,8 +1914,8 @@ "DynamicPagePathValues" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/constants/page_paths.ts", - "lineNumber": 100 + "path": "x-pack/plugins/fleet/public/constants/page_paths.ts", + "lineNumber": 127 }, "deprecated": false, "isRequired": true @@ -1931,11 +1931,11 @@ "label": "fleet_enrollment_tokens", "description": [], "signature": [ - "() => string" + "() => [string, string]" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/constants/page_paths.ts", - "lineNumber": 102 + "path": "x-pack/plugins/fleet/public/constants/page_paths.ts", + "lineNumber": 131 }, "deprecated": false, "children": [], @@ -1949,11 +1949,11 @@ "label": "data_streams", "description": [], "signature": [ - "() => string" + "() => [string, string]" ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/constants/page_paths.ts", - "lineNumber": 103 + "path": "x-pack/plugins/fleet/public/constants/page_paths.ts", + "lineNumber": 132 }, "deprecated": false, "children": [], @@ -1972,7 +1972,7 @@ "description": [], "source": { "path": "x-pack/plugins/fleet/public/plugin.ts", - "lineNumber": 51 + "lineNumber": 48 }, "deprecated": false, "children": [], @@ -1990,7 +1990,7 @@ ], "source": { "path": "x-pack/plugins/fleet/public/plugin.ts", - "lineNumber": 56 + "lineNumber": 53 }, "deprecated": false, "children": [ @@ -2014,7 +2014,7 @@ ], "source": { "path": "x-pack/plugins/fleet/public/plugin.ts", - "lineNumber": 57 + "lineNumber": 54 }, "deprecated": false, "returnComment": [], @@ -2052,7 +2052,7 @@ } ], "source": { - "path": "x-pack/plugins/fleet/public/applications/fleet/types/ui_extensions.ts", + "path": "x-pack/plugins/fleet/public/types/ui_extensions.ts", "lineNumber": 13 }, "deprecated": false @@ -2071,7 +2071,7 @@ ], "source": { "path": "x-pack/plugins/fleet/public/plugin.ts", - "lineNumber": 58 + "lineNumber": 55 }, "deprecated": false, "returnComment": [], @@ -4448,7 +4448,7 @@ "description": [], "source": { "path": "x-pack/plugins/fleet/server/plugin.ts", - "lineNumber": 90 + "lineNumber": 91 }, "deprecated": false, "children": [ @@ -4470,7 +4470,7 @@ ], "source": { "path": "x-pack/plugins/fleet/server/plugin.ts", - "lineNumber": 91 + "lineNumber": 92 }, "deprecated": false }, @@ -4493,7 +4493,7 @@ ], "source": { "path": "x-pack/plugins/fleet/server/plugin.ts", - "lineNumber": 92 + "lineNumber": 93 }, "deprecated": false }, @@ -4516,7 +4516,7 @@ ], "source": { "path": "x-pack/plugins/fleet/server/plugin.ts", - "lineNumber": 93 + "lineNumber": 94 }, "deprecated": false }, @@ -4538,7 +4538,7 @@ ], "source": { "path": "x-pack/plugins/fleet/server/plugin.ts", - "lineNumber": 94 + "lineNumber": 95 }, "deprecated": false }, @@ -4561,7 +4561,7 @@ ], "source": { "path": "x-pack/plugins/fleet/server/plugin.ts", - "lineNumber": 95 + "lineNumber": 96 }, "deprecated": false }, @@ -4584,7 +4584,7 @@ ], "source": { "path": "x-pack/plugins/fleet/server/plugin.ts", - "lineNumber": 96 + "lineNumber": 97 }, "deprecated": false } @@ -4767,7 +4767,7 @@ ], "source": { "path": "x-pack/plugins/fleet/server/plugin.ts", - "lineNumber": 137 + "lineNumber": 138 }, "deprecated": false, "initialIsOpen": false @@ -4784,7 +4784,7 @@ ], "source": { "path": "x-pack/plugins/fleet/server/index.ts", - "lineNumber": 66 + "lineNumber": 83 }, "deprecated": false, "initialIsOpen": false @@ -4838,7 +4838,7 @@ ], "source": { "path": "x-pack/plugins/fleet/server/plugin.ts", - "lineNumber": 122 + "lineNumber": 123 }, "deprecated": false, "lifecycle": "setup", @@ -4855,7 +4855,7 @@ ], "source": { "path": "x-pack/plugins/fleet/server/plugin.ts", - "lineNumber": 160 + "lineNumber": 161 }, "deprecated": false, "children": [ @@ -4873,7 +4873,7 @@ ], "source": { "path": "x-pack/plugins/fleet/server/plugin.ts", - "lineNumber": 166 + "lineNumber": 167 }, "deprecated": false, "returnComment": [], @@ -4897,7 +4897,7 @@ ], "source": { "path": "x-pack/plugins/fleet/server/plugin.ts", - "lineNumber": 167 + "lineNumber": 168 }, "deprecated": false }, @@ -4919,7 +4919,7 @@ ], "source": { "path": "x-pack/plugins/fleet/server/plugin.ts", - "lineNumber": 168 + "lineNumber": 169 }, "deprecated": false }, @@ -4941,7 +4941,7 @@ ], "source": { "path": "x-pack/plugins/fleet/server/plugin.ts", - "lineNumber": 169 + "lineNumber": 170 }, "deprecated": false }, @@ -4959,7 +4959,7 @@ ], "source": { "path": "x-pack/plugins/fleet/server/plugin.ts", - "lineNumber": 173 + "lineNumber": 174 }, "deprecated": false }, @@ -4981,7 +4981,7 @@ ], "source": { "path": "x-pack/plugins/fleet/server/plugin.ts", - "lineNumber": 174 + "lineNumber": 175 }, "deprecated": false }, @@ -5007,7 +5007,7 @@ ], "source": { "path": "x-pack/plugins/fleet/server/plugin.ts", - "lineNumber": 179 + "lineNumber": 180 }, "deprecated": false, "returnComment": [], @@ -5088,7 +5088,7 @@ ], "source": { "path": "x-pack/plugins/fleet/server/plugin.ts", - "lineNumber": 179 + "lineNumber": 180 }, "deprecated": false } @@ -5109,7 +5109,7 @@ ], "source": { "path": "x-pack/plugins/fleet/server/plugin.ts", - "lineNumber": 185 + "lineNumber": 186 }, "deprecated": false, "returnComment": [], @@ -5123,7 +5123,7 @@ "description": [], "source": { "path": "x-pack/plugins/fleet/server/plugin.ts", - "lineNumber": 185 + "lineNumber": 186 }, "deprecated": false } @@ -8203,7 +8203,7 @@ "label": "agents", "description": [], "signature": [ - "{ enabled: boolean; elasticsearch: { host?: string | undefined; ca_sha256?: string | undefined; }; fleet_server?: { hosts?: string[] | undefined; } | undefined; }" + "{ enabled: boolean; elasticsearch: { hosts?: string[] | undefined; ca_sha256?: string | undefined; }; fleet_server?: { hosts?: string[] | undefined; } | undefined; }" ], "source": { "path": "x-pack/plugins/fleet/common/types/index.ts", @@ -17304,6 +17304,23 @@ "deprecated": false, "initialIsOpen": false }, + { + "parentPluginId": "fleet", + "id": "def-common.INTEGRATIONS_PLUGIN_ID", + "type": "string", + "tags": [], + "label": "INTEGRATIONS_PLUGIN_ID", + "description": [], + "signature": [ + "\"integrations\"" + ], + "source": { + "path": "x-pack/plugins/fleet/common/constants/plugin.ts", + "lineNumber": 9 + }, + "deprecated": false, + "initialIsOpen": false + }, { "parentPluginId": "fleet", "id": "def-common.KibanaAssetParts", diff --git a/api_docs/home.json b/api_docs/home.json index a1039beb8d3a24..c11d02dfed9de1 100644 --- a/api_docs/home.json +++ b/api_docs/home.json @@ -501,7 +501,7 @@ ], "source": { "path": "src/plugins/home/public/plugin.ts", - "lineNumber": 161 + "lineNumber": 166 }, "deprecated": false, "initialIsOpen": false @@ -534,7 +534,7 @@ ], "source": { "path": "src/plugins/home/public/plugin.ts", - "lineNumber": 158 + "lineNumber": 163 }, "deprecated": false, "initialIsOpen": false @@ -602,7 +602,7 @@ ], "source": { "path": "src/plugins/home/public/plugin.ts", - "lineNumber": 164 + "lineNumber": 169 }, "deprecated": false, "initialIsOpen": false @@ -873,7 +873,7 @@ "description": [], "source": { "path": "src/plugins/home/public/plugin.ts", - "lineNumber": 167 + "lineNumber": 175 }, "deprecated": false, "children": [ @@ -889,7 +889,25 @@ ], "source": { "path": "src/plugins/home/public/plugin.ts", - "lineNumber": 168 + "lineNumber": 176 + }, + "deprecated": false + }, + { + "parentPluginId": "home", + "id": "def-public.HomePublicPluginSetup.addData", + "type": "Object", + "tags": [], + "label": "addData", + "description": [], + "signature": [ + "{ registerAddDataTab: (tab: ", + "AddDataTab", + ") => void; }" + ], + "source": { + "path": "src/plugins/home/public/plugin.ts", + "lineNumber": 177 }, "deprecated": false }, @@ -921,7 +939,7 @@ ], "source": { "path": "src/plugins/home/public/plugin.ts", - "lineNumber": 169 + "lineNumber": 178 }, "deprecated": false }, @@ -949,7 +967,7 @@ ], "source": { "path": "src/plugins/home/public/plugin.ts", - "lineNumber": 176 + "lineNumber": 185 }, "deprecated": true, "references": [ @@ -964,7 +982,7 @@ "plugin": "apm", "link": { "path": "x-pack/plugins/apm/public/plugin.ts", - "lineNumber": 82 + "lineNumber": 85 } }, { @@ -989,7 +1007,7 @@ "description": [], "source": { "path": "src/plugins/home/public/plugin.ts", - "lineNumber": 178 + "lineNumber": 187 }, "deprecated": false, "children": [ @@ -1005,7 +1023,7 @@ ], "source": { "path": "src/plugins/home/public/plugin.ts", - "lineNumber": 179 + "lineNumber": 188 }, "deprecated": false } diff --git a/api_docs/index_management.json b/api_docs/index_management.json index 9d4edf199ca274..9dc02a51148bca 100644 --- a/api_docs/index_management.json +++ b/api_docs/index_management.json @@ -722,7 +722,7 @@ "description": [], "source": { "path": "x-pack/plugins/index_management/server/plugin.ts", - "lineNumber": 25 + "lineNumber": 23 }, "deprecated": false, "children": [ @@ -740,7 +740,7 @@ ], "source": { "path": "x-pack/plugins/index_management/server/plugin.ts", - "lineNumber": 26 + "lineNumber": 24 }, "deprecated": false } diff --git a/api_docs/kibana_react.json b/api_docs/kibana_react.json index 98537d71d7b019..a477de7c6512c1 100644 --- a/api_docs/kibana_react.json +++ b/api_docs/kibana_react.json @@ -3952,11 +3952,11 @@ "CommonProps", " & React.HTMLAttributes & ", "DisambiguateSet", - "<{ position?: \"fixed\" | undefined; usePortal?: boolean | undefined; affordForDisplacement?: boolean | undefined; }, { position: \"static\" | \"sticky\"; }> & { position: \"static\" | \"sticky\"; } & { paddingSize?: \"m\" | \"s\" | \"none\" | \"l\" | undefined; bodyClassName?: string | undefined; landmarkHeading?: string | undefined; top?: string | number | undefined; right?: string | number | undefined; bottom?: string | number | undefined; left?: string | number | undefined; }) | (", + "<{ position?: \"fixed\" | undefined; usePortal?: boolean | undefined; affordForDisplacement?: boolean | undefined; }, { position: \"static\" | \"sticky\"; }> & { position: \"static\" | \"sticky\"; } & { paddingSize?: \"none\" | \"m\" | \"s\" | \"l\" | undefined; bodyClassName?: string | undefined; landmarkHeading?: string | undefined; top?: string | number | undefined; right?: string | number | undefined; bottom?: string | number | undefined; left?: string | number | undefined; }) | (", "CommonProps", " & React.HTMLAttributes & ", "DisambiguateSet", - "<{ position: \"static\" | \"sticky\"; }, { position?: \"fixed\" | undefined; usePortal?: boolean | undefined; affordForDisplacement?: boolean | undefined; }> & { position?: \"fixed\" | undefined; usePortal?: boolean | undefined; affordForDisplacement?: boolean | undefined; } & { paddingSize?: \"m\" | \"s\" | \"none\" | \"l\" | undefined; bodyClassName?: string | undefined; landmarkHeading?: string | undefined; top?: string | number | undefined; right?: string | number | undefined; bottom?: string | number | undefined; left?: string | number | undefined; }) | undefined; }, { template: \"default\" | \"empty\" | \"centeredBody\" | \"centeredContent\"; }> & { template: \"default\" | \"empty\" | \"centeredBody\" | \"centeredContent\"; } & { paddingSize?: \"m\" | \"s\" | \"none\" | \"l\" | undefined; pageSideBar?: React.ReactNode; pageSideBarProps?: ", + "<{ position: \"static\" | \"sticky\"; }, { position?: \"fixed\" | undefined; usePortal?: boolean | undefined; affordForDisplacement?: boolean | undefined; }> & { position?: \"fixed\" | undefined; usePortal?: boolean | undefined; affordForDisplacement?: boolean | undefined; } & { paddingSize?: \"none\" | \"m\" | \"s\" | \"l\" | undefined; bodyClassName?: string | undefined; landmarkHeading?: string | undefined; top?: string | number | undefined; right?: string | number | undefined; bottom?: string | number | undefined; left?: string | number | undefined; }) | undefined; }, { template: \"default\" | \"empty\" | \"centeredBody\" | \"centeredContent\"; }> & { template: \"default\" | \"empty\" | \"centeredBody\" | \"centeredContent\"; } & { paddingSize?: \"none\" | \"m\" | \"s\" | \"l\" | undefined; pageSideBar?: React.ReactNode; pageSideBarProps?: ", "EuiPageSideBarProps", " | undefined; pageHeader?: ", "EuiPageHeaderProps", @@ -3976,19 +3976,19 @@ "CommonProps", " & React.HTMLAttributes & ", "DisambiguateSet", - "<{ position?: \"fixed\" | undefined; usePortal?: boolean | undefined; affordForDisplacement?: boolean | undefined; }, { position: \"static\" | \"sticky\"; }> & { position: \"static\" | \"sticky\"; } & { paddingSize?: \"m\" | \"s\" | \"none\" | \"l\" | undefined; bodyClassName?: string | undefined; landmarkHeading?: string | undefined; top?: string | number | undefined; right?: string | number | undefined; bottom?: string | number | undefined; left?: string | number | undefined; }) | (", + "<{ position?: \"fixed\" | undefined; usePortal?: boolean | undefined; affordForDisplacement?: boolean | undefined; }, { position: \"static\" | \"sticky\"; }> & { position: \"static\" | \"sticky\"; } & { paddingSize?: \"none\" | \"m\" | \"s\" | \"l\" | undefined; bodyClassName?: string | undefined; landmarkHeading?: string | undefined; top?: string | number | undefined; right?: string | number | undefined; bottom?: string | number | undefined; left?: string | number | undefined; }) | (", "CommonProps", " & React.HTMLAttributes & ", "DisambiguateSet", - "<{ position: \"static\" | \"sticky\"; }, { position?: \"fixed\" | undefined; usePortal?: boolean | undefined; affordForDisplacement?: boolean | undefined; }> & { position?: \"fixed\" | undefined; usePortal?: boolean | undefined; affordForDisplacement?: boolean | undefined; } & { paddingSize?: \"m\" | \"s\" | \"none\" | \"l\" | undefined; bodyClassName?: string | undefined; landmarkHeading?: string | undefined; top?: string | number | undefined; right?: string | number | undefined; bottom?: string | number | undefined; left?: string | number | undefined; }) | undefined; }> & { template?: \"default\" | undefined; bottomBar?: React.ReactNode; bottomBarProps?: (", + "<{ position: \"static\" | \"sticky\"; }, { position?: \"fixed\" | undefined; usePortal?: boolean | undefined; affordForDisplacement?: boolean | undefined; }> & { position?: \"fixed\" | undefined; usePortal?: boolean | undefined; affordForDisplacement?: boolean | undefined; } & { paddingSize?: \"none\" | \"m\" | \"s\" | \"l\" | undefined; bodyClassName?: string | undefined; landmarkHeading?: string | undefined; top?: string | number | undefined; right?: string | number | undefined; bottom?: string | number | undefined; left?: string | number | undefined; }) | undefined; }> & { template?: \"default\" | undefined; bottomBar?: React.ReactNode; bottomBarProps?: (", "CommonProps", " & React.HTMLAttributes & ", "DisambiguateSet", - "<{ position?: \"fixed\" | undefined; usePortal?: boolean | undefined; affordForDisplacement?: boolean | undefined; }, { position: \"static\" | \"sticky\"; }> & { position: \"static\" | \"sticky\"; } & { paddingSize?: \"m\" | \"s\" | \"none\" | \"l\" | undefined; bodyClassName?: string | undefined; landmarkHeading?: string | undefined; top?: string | number | undefined; right?: string | number | undefined; bottom?: string | number | undefined; left?: string | number | undefined; }) | (", + "<{ position?: \"fixed\" | undefined; usePortal?: boolean | undefined; affordForDisplacement?: boolean | undefined; }, { position: \"static\" | \"sticky\"; }> & { position: \"static\" | \"sticky\"; } & { paddingSize?: \"none\" | \"m\" | \"s\" | \"l\" | undefined; bodyClassName?: string | undefined; landmarkHeading?: string | undefined; top?: string | number | undefined; right?: string | number | undefined; bottom?: string | number | undefined; left?: string | number | undefined; }) | (", "CommonProps", " & React.HTMLAttributes & ", "DisambiguateSet", - "<{ position: \"static\" | \"sticky\"; }, { position?: \"fixed\" | undefined; usePortal?: boolean | undefined; affordForDisplacement?: boolean | undefined; }> & { position?: \"fixed\" | undefined; usePortal?: boolean | undefined; affordForDisplacement?: boolean | undefined; } & { paddingSize?: \"m\" | \"s\" | \"none\" | \"l\" | undefined; bodyClassName?: string | undefined; landmarkHeading?: string | undefined; top?: string | number | undefined; right?: string | number | undefined; bottom?: string | number | undefined; left?: string | number | undefined; }) | undefined; } & { paddingSize?: \"m\" | \"s\" | \"none\" | \"l\" | undefined; pageSideBar?: React.ReactNode; pageSideBarProps?: ", + "<{ position: \"static\" | \"sticky\"; }, { position?: \"fixed\" | undefined; usePortal?: boolean | undefined; affordForDisplacement?: boolean | undefined; }> & { position?: \"fixed\" | undefined; usePortal?: boolean | undefined; affordForDisplacement?: boolean | undefined; } & { paddingSize?: \"none\" | \"m\" | \"s\" | \"l\" | undefined; bodyClassName?: string | undefined; landmarkHeading?: string | undefined; top?: string | number | undefined; right?: string | number | undefined; bottom?: string | number | undefined; left?: string | number | undefined; }) | undefined; } & { paddingSize?: \"none\" | \"m\" | \"s\" | \"l\" | undefined; pageSideBar?: React.ReactNode; pageSideBarProps?: ", "EuiPageSideBarProps", " | undefined; pageHeader?: ", "EuiPageHeaderProps", @@ -4122,7 +4122,7 @@ "label": "POSITIONS", "description": [], "signature": [ - "(\"left\" | \"right\" | \"none\" | \"center\")[]" + "(\"none\" | \"left\" | \"right\" | \"center\")[]" ], "source": { "path": "src/plugins/kibana_react/public/toolbar_button/toolbar_button.tsx", @@ -4185,7 +4185,7 @@ "EuiButtonProps", ", { buttonRef?: ((instance: HTMLButtonElement | null) => void) | React.RefObject | null | undefined; }>> & ", "EuiButtonProps", - " & { onClick?: ((event: React.MouseEvent) => void) | undefined; } & React.ButtonHTMLAttributes & { buttonRef?: ((instance: HTMLButtonElement | null) => void) | React.RefObject | null | undefined; } & { fontWeight?: \"bold\" | \"normal\" | undefined; size?: \"m\" | \"s\" | undefined; hasArrow?: boolean | undefined; groupPosition?: \"left\" | \"right\" | \"none\" | \"center\" | undefined; dataTestSubj?: string | undefined; }) | (", + " & { onClick?: ((event: React.MouseEvent) => void) | undefined; } & React.ButtonHTMLAttributes & { buttonRef?: ((instance: HTMLButtonElement | null) => void) | React.RefObject | null | undefined; } & { fontWeight?: \"bold\" | \"normal\" | undefined; size?: \"m\" | \"s\" | undefined; hasArrow?: boolean | undefined; groupPosition?: \"none\" | \"left\" | \"right\" | \"center\" | undefined; dataTestSubj?: string | undefined; }) | (", "DisambiguateSet", "<", "PropsForButton", @@ -4197,7 +4197,7 @@ "EuiButtonProps", ", { buttonRef?: ((instance: HTMLAnchorElement | null) => void) | React.RefObject | null | undefined; }>> & ", "EuiButtonProps", - " & { href?: string | undefined; onClick?: ((event: React.MouseEvent) => void) | undefined; } & React.AnchorHTMLAttributes & { buttonRef?: ((instance: HTMLAnchorElement | null) => void) | React.RefObject | null | undefined; } & { fontWeight?: \"bold\" | \"normal\" | undefined; size?: \"m\" | \"s\" | undefined; hasArrow?: boolean | undefined; groupPosition?: \"left\" | \"right\" | \"none\" | \"center\" | undefined; dataTestSubj?: string | undefined; })" + " & { href?: string | undefined; onClick?: ((event: React.MouseEvent) => void) | undefined; } & React.AnchorHTMLAttributes & { buttonRef?: ((instance: HTMLAnchorElement | null) => void) | React.RefObject | null | undefined; } & { fontWeight?: \"bold\" | \"normal\" | undefined; size?: \"m\" | \"s\" | undefined; hasArrow?: boolean | undefined; groupPosition?: \"none\" | \"left\" | \"right\" | \"center\" | undefined; dataTestSubj?: string | undefined; })" ], "source": { "path": "src/plugins/kibana_react/public/toolbar_button/toolbar_button.tsx", @@ -5003,7 +5003,7 @@ "label": "eui", "description": [], "signature": [ - "{ paddingSizes: { xs: string; s: string; m: string; l: string; xl: string; }; avatarSizing: { s: { size: string; 'font-size': string; }; m: { size: string; 'font-size': string; }; l: { size: string; 'font-size': string; }; xl: { size: string; 'font-size': string; }; }; euiBadgeGroupGutterTypes: { gutterExtraSmall: string; gutterSmall: string; }; euiBreadcrumbSpacing: string; euiBreadcrumbTruncateWidth: string; euiButtonEmptyTypes: { primary: string; danger: string; disabled: string; ghost: string; text: string; success: string; warning: string; }; euiButtonIconTypes: { accent: string; danger: string; ghost: string; primary: string; subdued: string; success: string; text: string; warning: string; }; euiCallOutTypes: { primary: string; success: string; warning: string; danger: string; }; euiCardSpacing: string; euiCardBottomNodeHeight: string; euiCardSelectButtonBorders: { text: string; primary: string; success: string; danger: string; ghost: string; }; euiCardSelectButtonBackgrounds: { text: string; primary: string; success: string; danger: string; ghost: string; }; euiCardPaddingModifiers: { paddingNone: number; paddingSmall: string; paddingMedium: string; paddingLarge: string; }; euiCheckableCardPadding: string; euiCollapsibleNavWidth: string; euiCollapsibleNavGroupLightBackgroundColor: string; euiCollapsibleNavGroupDarkBackgroundColor: string; euiCollapsibleNavGroupDarkHighContrastColor: string; euiColorPickerValueRange0: string; euiColorPickerValueRange1: string; euiColorPickerSaturationRange0: string; euiColorPickerSaturationRange1: string; euiColorPickerIndicatorSize: string; euiColorPickerWidth: string; euiColorPaletteDisplaySizes: { sizeExtraSmall: string; sizeSmall: string; sizeMedium: string; }; euiContextMenuWidth: string; euiControlBarBackground: string; euiControlBarText: string; euiControlBarBorderColor: string; euiControlBarInitialHeight: string; euiControlBarMaxHeight: string; euiControlBarHeights: { s: string; m: string; l: string; }; euiDataGridPrefix: string; euiDataGridStyles: string; euiDataGridColumnResizerWidth: string; euiDataGridPopoverMaxHeight: string; euiDataGridCellPaddingS: string; euiDataGridCellPaddingM: string; euiDataGridCellPaddingL: string; euiDataGridVerticalBorder: string; euiDatePickerCalendarWidth: string; euiSuperDatePickerWidth: string; euiSuperDatePickerButtonWidth: string; euiDragAndDropSpacing: { s: string; m: string; l: string; }; euiExpressionColors: { subdued: string; primary: string; secondary: string; warning: string; danger: string; accent: string; }; euiFacetGutterSizes: { gutterNone: number; gutterSmall: string; gutterMedium: string; gutterLarge: string; }; gutterTypes: { gutterExtraSmall: string; gutterSmall: string; gutterMedium: string; gutterLarge: string; gutterExtraLarge: string; }; fractions: { fourths: { percentage: string; count: number; }; thirds: { percentage: string; count: number; }; halves: { percentage: string; count: number; }; single: { percentage: string; count: number; }; }; flyoutSizes: { small: { min: string; width: string; max: string; }; medium: { min: string; width: string; max: string; }; large: { min: string; width: string; max: string; }; }; euiFlyoutBorder: string; euiFlyoutPaddingModifiers: { paddingNone: number; paddingSmall: string; paddingMedium: string; paddingLarge: string; }; euiFilePickerTallHeight: string; euiRangeLevelColors: { primary: string; success: string; warning: string; danger: string; }; textareaResizing: { vertical: string; horizontal: string; both: string; none: string; }; euiHeaderLinksGutterSizes: { gutterXS: string; gutterS: string; gutterM: string; gutterL: string; }; ruleMargins: { marginXSmall: string; marginSmall: string; marginMedium: string; marginLarge: string; marginXLarge: string; marginXXLarge: string; }; euiIconLoadingOpacity: number; euiIconColors: { accent: string; danger: string; ghost: string; primary: string; secondary: string; success: string; subdued: string; text: string; warning: string; }; euiIconSizes: { small: string; medium: string; large: string; xLarge: string; xxLarge: string; }; euiKeyPadMenuSize: string; euiKeyPadMenuItemBetaBadgeSize: string; euiLinkColors: { subdued: string; primary: string; secondary: string; accent: string; warning: string; danger: string; text: string; ghost: string; }; euiListGroupItemHoverBackground: string; euiListGroupItemHoverBackgroundGhost: string; euiListGroupGutterTypes: { gutterSmall: string; gutterMedium: string; }; euiListGroupItemColorTypes: { primary: string; text: string; subdued: string; ghost: string; }; euiListGroupItemSizeTypes: { xSmall: string; small: string; medium: string; large: string; }; euiGradientStartStop: string; euiGradientMiddle: string; browserDefaultFontSize: string; euiMarkdownEditorMinHeight: string; euiPopoverArrowSize: string; euiPopoverTranslateDistance: string; euiProgressSizes: { xs: string; s: string; m: string; l: string; }; euiProgressColors: { primary: string; secondary: string; success: string; warning: string; danger: string; accent: string; subdued: string; vis0: string; vis1: string; vis2: string; vis3: string; vis4: string; vis5: string; vis6: string; vis7: string; vis8: string; vis9: string; customColor: string; }; euiResizableButtonTransitionSpeed: string; euiResizableButtonSize: string; euiSelectableListItemBorder: string; euiSelectableListItemPadding: string; euiSelectableTemplateSitewideTypes: { application: { color: string; 'font-weight': number; }; deployment: { color: string; 'font-weight': number; }; article: { color: string; 'font-weight': number; }; case: { color: string; 'font-weight': number; }; platform: { color: string; 'font-weight': number; }; }; euiSideNavEmphasizedBackgroundColor: string; euiSideNavRootTextcolor: string; euiSideNavBranchTextcolor: string; euiSideNavSelectedTextcolor: string; spacerSizes: { xs: string; s: string; m: string; l: string; xl: string; xxl: string; }; euiStepNumberSize: string; euiStepNumberSmallSize: string; euiStepNumberMargin: string; euiStepStatusColorsToFade: { warning: string; danger: string; disabled: string; incomplete: string; }; euiSuggestItemColors: { tint0: string; tint1: string; tint2: string; tint3: string; tint4: string; tint5: string; tint6: string; tint7: string; tint8: string; tint9: string; tint10: string; }; euiTableCellContentPadding: string; euiTableCellContentPaddingCompressed: string; euiTableCellCheckboxWidth: string; euiTableActionsAreaWidth: string; euiTableHoverColor: string; euiTableSelectedColor: string; euiTableHoverSelectedColor: string; euiTableActionsBorderColor: string; euiTableHoverClickableColor: string; euiTableFocusClickableColor: string; euiTabFontSize: string; euiTabFontSizeS: string; euiTabFontSizeL: string; euiTextColors: { default: string; subdued: string; secondary: string; accent: string; warning: string; danger: string; ghost: string; }; euiTextConstrainedMaxWidth: string; euiToastWidth: string; euiToastTypes: { primary: string; success: string; warning: string; danger: string; }; euiTokenGrayColor: string; euiTokenTypes: { euiColorVis0: { graphic: string; behindText: string; }; euiColorVis1: { graphic: string; behindText: string; }; euiColorVis2: { graphic: string; behindText: string; }; euiColorVis3: { graphic: string; behindText: string; }; euiColorVis4: { graphic: string; behindText: string; }; euiColorVis5: { graphic: string; behindText: string; }; euiColorVis6: { graphic: string; behindText: string; }; euiColorVis7: { graphic: string; behindText: string; }; euiColorVis8: { graphic: string; behindText: string; }; euiColorVis9: { graphic: string; behindText: string; }; gray: { graphic: string; behindText: string; }; }; euiTokenTypeKeys: string; euiAnimSlightBounce: string; euiAnimSlightResistance: string; euiAnimSpeedExtraFast: string; euiAnimSpeedFast: string; euiAnimSpeedNormal: string; euiAnimSpeedSlow: string; euiAnimSpeedExtraSlow: string; euiBorderWidthThin: string; euiBorderWidthThick: string; euiBorderColor: string; euiBorderRadius: string; euiBorderRadiusSmall: string; euiBorderThick: string; euiBorderThin: string; euiBorderEditable: string; euiButtonHeight: string; euiButtonHeightSmall: string; euiButtonHeightXSmall: string; euiButtonColorDisabled: string; euiButtonColorDisabledText: string; euiButtonColorGhostDisabled: string; euiButtonTypes: { primary: string; secondary: string; warning: string; danger: string; ghost: string; text: string; }; euiColorGhost: string; euiColorInk: string; euiColorPrimary: string; euiColorSecondary: string; euiColorAccent: string; euiColorSuccess: string; euiColorWarning: string; euiColorDanger: string; euiColorEmptyShade: string; euiColorLightestShade: string; euiColorLightShade: string; euiColorMediumShade: string; euiColorDarkShade: string; euiColorDarkestShade: string; euiColorFullShade: string; euiPageBackgroundColor: string; euiColorHighlight: string; euiTextColor: string; euiTitleColor: string; euiTextSubduedColor: string; euiColorDisabled: string; euiColorPrimaryText: string; euiColorSecondaryText: string; euiColorAccentText: string; euiColorWarningText: string; euiColorDangerText: string; euiColorDisabledText: string; euiColorSuccessText: string; euiLinkColor: string; euiPaletteColorBlind: { euiColorVis0: { graphic: string; behindText: string; }; euiColorVis1: { graphic: string; behindText: string; }; euiColorVis2: { graphic: string; behindText: string; }; euiColorVis3: { graphic: string; behindText: string; }; euiColorVis4: { graphic: string; behindText: string; }; euiColorVis5: { graphic: string; behindText: string; }; euiColorVis6: { graphic: string; behindText: string; }; euiColorVis7: { graphic: string; behindText: string; }; euiColorVis8: { graphic: string; behindText: string; }; euiColorVis9: { graphic: string; behindText: string; }; }; euiPaletteColorBlindKeys: string; euiColorVis0: string; euiColorVis1: string; euiColorVis2: string; euiColorVis3: string; euiColorVis4: string; euiColorVis5: string; euiColorVis6: string; euiColorVis7: string; euiColorVis8: string; euiColorVis9: string; euiColorVis0_behindText: string; euiColorVis1_behindText: string; euiColorVis2_behindText: string; euiColorVis3_behindText: string; euiColorVis4_behindText: string; euiColorVis5_behindText: string; euiColorVis6_behindText: string; euiColorVis7_behindText: string; euiColorVis8_behindText: string; euiColorVis9_behindText: string; euiColorChartLines: string; euiColorChartBand: string; euiCodeBlockBackgroundColor: string; euiCodeBlockColor: string; euiCodeBlockSelectedBackgroundColor: string; euiCodeBlockCommentColor: string; euiCodeBlockSelectorTagColor: string; euiCodeBlockStringColor: string; euiCodeBlockTagColor: string; euiCodeBlockNameColor: string; euiCodeBlockNumberColor: string; euiCodeBlockKeywordColor: string; euiCodeBlockFunctionTitleColor: string; euiCodeBlockTypeColor: string; euiCodeBlockAttributeColor: string; euiCodeBlockSymbolColor: string; euiCodeBlockParamsColor: string; euiCodeBlockMetaColor: string; euiCodeBlockTitleColor: string; euiCodeBlockSectionColor: string; euiCodeBlockAdditionColor: string; euiCodeBlockDeletionColor: string; euiCodeBlockSelectorClassColor: string; euiCodeBlockSelectorIdColor: string; euiFormMaxWidth: string; euiFormControlHeight: string; euiFormControlCompressedHeight: string; euiFormControlPadding: string; euiFormControlCompressedPadding: string; euiFormControlBorderRadius: number; euiFormControlCompressedBorderRadius: string; euiRadioSize: string; euiCheckBoxSize: string; euiCheckboxBorderRadius: string; euiSwitchHeight: string; euiSwitchWidth: string; euiSwitchThumbSize: string; euiSwitchIconHeight: string; euiSwitchHeightCompressed: string; euiSwitchWidthCompressed: string; euiSwitchThumbSizeCompressed: string; euiSwitchHeightMini: string; euiSwitchWidthMini: string; euiSwitchThumbSizeMini: string; euiFormBackgroundColor: string; euiFormBackgroundDisabledColor: string; euiFormBackgroundReadOnlyColor: string; euiFormBorderOpaqueColor: string; euiFormBorderColor: string; euiFormBorderDisabledColor: string; euiFormCustomControlDisabledIconColor: string; euiFormCustomControlBorderColor: string; euiFormControlDisabledColor: string; euiFormControlBoxShadow: string; euiFormInputGroupLabelBackground: string; euiFormInputGroupBorder: string; euiSwitchOffColor: string; euiFormControlLayoutGroupInputHeight: string; euiFormControlLayoutGroupInputCompressedHeight: string; euiFormControlLayoutGroupInputCompressedBorderRadius: string; euiRangeTrackColor: string; euiRangeThumbRadius: string; euiRangeThumbHeight: string; euiRangeThumbWidth: string; euiRangeThumbBorderColor: string; euiRangeTrackWidth: string; euiRangeTrackHeight: string; euiRangeTrackBorderWidth: number; euiRangeTrackBorderColor: string; euiRangeTrackRadius: string; euiRangeDisabledOpacity: number; euiRangeHighlightHeight: string; euiHeaderBackgroundColor: string; euiHeaderDarkBackgroundColor: string; euiHeaderBorderColor: string; euiHeaderBreadcrumbColor: string; euiHeaderHeight: string; euiHeaderChildSize: string; euiHeaderHeightCompensation: string; euiPageDefaultMaxWidth: string; euiPageSidebarMinWidth: string; euiPanelPaddingModifiers: { paddingSmall: string; paddingMedium: string; paddingLarge: string; }; euiPanelBorderRadiusModifiers: { borderRadiusNone: number; borderRadiusMedium: string; }; euiPanelBackgroundColorModifiers: { transparent: string; plain: string; subdued: string; accent: string; primary: string; success: string; warning: string; danger: string; }; euiBreakpoints: { xs: number; s: string; m: string; l: string; xl: string; }; euiBreakpointKeys: string; euiShadowColor: string; euiShadowColorLarge: string; euiSize: string; euiSizeXS: string; euiSizeS: string; euiSizeM: string; euiSizeL: string; euiSizeXL: string; euiSizeXXL: string; euiButtonMinWidth: string; euiScrollBar: string; euiScrollBarCorner: string; euiFocusRingColor: string; euiFocusRingAnimStartColor: string; euiFocusRingAnimStartSize: string; euiFocusRingAnimStartSizeLarge: string; euiFocusRingSizeLarge: string; euiFocusRingSize: string; euiFocusTransparency: number; euiFocusBackgroundColor: string; euiTooltipBackgroundColor: string; euiTooltipAnimations: { top: string; left: string; bottom: string; right: string; }; euiFontFamily: string; euiCodeFontFamily: string; euiFontFeatureSettings: string; euiTextScale: string; euiFontSize: string; euiFontSizeXS: string; euiFontSizeS: string; euiFontSizeM: string; euiFontSizeL: string; euiFontSizeXL: string; euiFontSizeXXL: string; euiLineHeight: number; euiBodyLineHeight: number; euiFontWeightLight: number; euiFontWeightRegular: number; euiFontWeightMedium: number; euiFontWeightSemiBold: number; euiFontWeightBold: number; euiCodeFontWeightRegular: number; euiCodeFontWeightBold: number; euiTitles: { xxxs: { 'font-size': string; 'line-height': string; 'font-weight': number; }; xxs: { 'font-size': string; 'line-height': string; 'font-weight': number; }; xs: { 'font-size': string; 'line-height': string; 'font-weight': number; 'letter-spacing': string; }; s: { 'font-size': string; 'line-height': string; 'font-weight': number; 'letter-spacing': string; }; m: { 'font-size': string; 'line-height': string; 'font-weight': number; 'letter-spacing': string; }; l: { 'font-size': string; 'line-height': string; 'font-weight': number; 'letter-spacing': string; }; }; euiZLevel0: number; euiZLevel1: number; euiZLevel2: number; euiZLevel3: number; euiZLevel4: number; euiZLevel5: number; euiZLevel6: number; euiZLevel7: number; euiZLevel8: number; euiZLevel9: number; euiZContent: number; euiZHeader: number; euiZContentMenu: number; euiZFlyout: number; euiZNavigation: number; euiZMask: number; euiZModal: number; euiZToastList: number; } | { paddingSizes: { xs: string; s: string; m: string; l: string; xl: string; }; avatarSizing: { s: { size: string; 'font-size': string; }; m: { size: string; 'font-size': string; }; l: { size: string; 'font-size': string; }; xl: { size: string; 'font-size': string; }; }; euiBadgeGroupGutterTypes: { gutterExtraSmall: string; gutterSmall: string; }; euiBreadcrumbSpacing: string; euiBreadcrumbTruncateWidth: string; euiButtonEmptyTypes: { primary: string; danger: string; disabled: string; ghost: string; text: string; success: string; warning: string; }; euiButtonIconTypes: { accent: string; danger: string; ghost: string; primary: string; subdued: string; success: string; text: string; warning: string; }; euiCallOutTypes: { primary: string; success: string; warning: string; danger: string; }; euiCardSpacing: string; euiCardBottomNodeHeight: string; euiCardSelectButtonBorders: { text: string; primary: string; success: string; danger: string; ghost: string; }; euiCardSelectButtonBackgrounds: { text: string; primary: string; success: string; danger: string; ghost: string; }; euiCardPaddingModifiers: { paddingNone: number; paddingSmall: string; paddingMedium: string; paddingLarge: string; }; euiCheckableCardPadding: string; euiCollapsibleNavWidth: string; euiCollapsibleNavGroupLightBackgroundColor: string; euiCollapsibleNavGroupDarkBackgroundColor: string; euiCollapsibleNavGroupDarkHighContrastColor: string; euiColorPickerValueRange0: string; euiColorPickerValueRange1: string; euiColorPickerSaturationRange0: string; euiColorPickerSaturationRange1: string; euiColorPickerIndicatorSize: string; euiColorPickerWidth: string; euiColorPaletteDisplaySizes: { sizeExtraSmall: string; sizeSmall: string; sizeMedium: string; }; euiContextMenuWidth: string; euiControlBarBackground: string; euiControlBarText: string; euiControlBarBorderColor: string; euiControlBarInitialHeight: string; euiControlBarMaxHeight: string; euiControlBarHeights: { s: string; m: string; l: string; }; euiDataGridPrefix: string; euiDataGridStyles: string; euiDataGridColumnResizerWidth: string; euiDataGridPopoverMaxHeight: string; euiDataGridCellPaddingS: string; euiDataGridCellPaddingM: string; euiDataGridCellPaddingL: string; euiDataGridVerticalBorder: string; euiDatePickerCalendarWidth: string; euiSuperDatePickerWidth: string; euiSuperDatePickerButtonWidth: string; euiDragAndDropSpacing: { s: string; m: string; l: string; }; euiExpressionColors: { subdued: string; primary: string; secondary: string; warning: string; danger: string; accent: string; }; euiFacetGutterSizes: { gutterNone: number; gutterSmall: string; gutterMedium: string; gutterLarge: string; }; gutterTypes: { gutterExtraSmall: string; gutterSmall: string; gutterMedium: string; gutterLarge: string; gutterExtraLarge: string; }; fractions: { fourths: { percentage: string; count: number; }; thirds: { percentage: string; count: number; }; halves: { percentage: string; count: number; }; single: { percentage: string; count: number; }; }; flyoutSizes: { small: { min: string; width: string; max: string; }; medium: { min: string; width: string; max: string; }; large: { min: string; width: string; max: string; }; }; euiFlyoutBorder: string; euiFlyoutPaddingModifiers: { paddingNone: number; paddingSmall: string; paddingMedium: string; paddingLarge: string; }; euiFilePickerTallHeight: string; euiRangeLevelColors: { primary: string; success: string; warning: string; danger: string; }; textareaResizing: { vertical: string; horizontal: string; both: string; none: string; }; euiHeaderLinksGutterSizes: { gutterXS: string; gutterS: string; gutterM: string; gutterL: string; }; ruleMargins: { marginXSmall: string; marginSmall: string; marginMedium: string; marginLarge: string; marginXLarge: string; marginXXLarge: string; }; euiIconLoadingOpacity: number; euiIconColors: { accent: string; danger: string; ghost: string; primary: string; secondary: string; success: string; subdued: string; text: string; warning: string; }; euiIconSizes: { small: string; medium: string; large: string; xLarge: string; xxLarge: string; }; euiKeyPadMenuSize: string; euiKeyPadMenuItemBetaBadgeSize: string; euiLinkColors: { subdued: string; primary: string; secondary: string; accent: string; warning: string; danger: string; text: string; ghost: string; }; euiListGroupItemHoverBackground: string; euiListGroupItemHoverBackgroundGhost: string; euiListGroupGutterTypes: { gutterSmall: string; gutterMedium: string; }; euiListGroupItemColorTypes: { primary: string; text: string; subdued: string; ghost: string; }; euiListGroupItemSizeTypes: { xSmall: string; small: string; medium: string; large: string; }; euiGradientStartStop: string; euiGradientMiddle: string; browserDefaultFontSize: string; euiMarkdownEditorMinHeight: string; euiPopoverArrowSize: string; euiPopoverTranslateDistance: string; euiProgressSizes: { xs: string; s: string; m: string; l: string; }; euiProgressColors: { primary: string; secondary: string; success: string; warning: string; danger: string; accent: string; subdued: string; vis0: string; vis1: string; vis2: string; vis3: string; vis4: string; vis5: string; vis6: string; vis7: string; vis8: string; vis9: string; customColor: string; }; euiResizableButtonTransitionSpeed: string; euiResizableButtonSize: string; euiSelectableListItemBorder: string; euiSelectableListItemPadding: string; euiSelectableTemplateSitewideTypes: { application: { color: string; 'font-weight': number; }; deployment: { color: string; 'font-weight': number; }; article: { color: string; 'font-weight': number; }; case: { color: string; 'font-weight': number; }; platform: { color: string; 'font-weight': number; }; }; euiSideNavEmphasizedBackgroundColor: string; euiSideNavRootTextcolor: string; euiSideNavBranchTextcolor: string; euiSideNavSelectedTextcolor: string; spacerSizes: { xs: string; s: string; m: string; l: string; xl: string; xxl: string; }; euiStepNumberSize: string; euiStepNumberSmallSize: string; euiStepNumberMargin: string; euiStepStatusColorsToFade: { warning: string; danger: string; disabled: string; incomplete: string; }; euiSuggestItemColors: { tint0: string; tint1: string; tint2: string; tint3: string; tint4: string; tint5: string; tint6: string; tint7: string; tint8: string; tint9: string; tint10: string; }; euiTableCellContentPadding: string; euiTableCellContentPaddingCompressed: string; euiTableCellCheckboxWidth: string; euiTableActionsAreaWidth: string; euiTableHoverColor: string; euiTableSelectedColor: string; euiTableHoverSelectedColor: string; euiTableActionsBorderColor: string; euiTableHoverClickableColor: string; euiTableFocusClickableColor: string; euiTabFontSize: string; euiTabFontSizeS: string; euiTabFontSizeL: string; euiTextColors: { default: string; subdued: string; secondary: string; accent: string; warning: string; danger: string; ghost: string; }; euiTextConstrainedMaxWidth: string; euiToastWidth: string; euiToastTypes: { primary: string; success: string; warning: string; danger: string; }; euiTokenGrayColor: string; euiTokenTypes: { euiColorVis0: { graphic: string; behindText: string; }; euiColorVis1: { graphic: string; behindText: string; }; euiColorVis2: { graphic: string; behindText: string; }; euiColorVis3: { graphic: string; behindText: string; }; euiColorVis4: { graphic: string; behindText: string; }; euiColorVis5: { graphic: string; behindText: string; }; euiColorVis6: { graphic: string; behindText: string; }; euiColorVis7: { graphic: string; behindText: string; }; euiColorVis8: { graphic: string; behindText: string; }; euiColorVis9: { graphic: string; behindText: string; }; gray: { graphic: string; behindText: string; }; }; euiTokenTypeKeys: string; euiAnimSlightBounce: string; euiAnimSlightResistance: string; euiAnimSpeedExtraFast: string; euiAnimSpeedFast: string; euiAnimSpeedNormal: string; euiAnimSpeedSlow: string; euiAnimSpeedExtraSlow: string; euiBorderWidthThin: string; euiBorderWidthThick: string; euiBorderColor: string; euiBorderRadius: string; euiBorderRadiusSmall: string; euiBorderThick: string; euiBorderThin: string; euiBorderEditable: string; euiButtonHeight: string; euiButtonHeightSmall: string; euiButtonHeightXSmall: string; euiButtonColorDisabled: string; euiButtonColorDisabledText: string; euiButtonColorGhostDisabled: string; euiButtonTypes: { primary: string; secondary: string; warning: string; danger: string; ghost: string; text: string; }; euiColorGhost: string; euiColorInk: string; euiColorPrimary: string; euiColorSecondary: string; euiColorAccent: string; euiColorSuccess: string; euiColorWarning: string; euiColorDanger: string; euiColorEmptyShade: string; euiColorLightestShade: string; euiColorLightShade: string; euiColorMediumShade: string; euiColorDarkShade: string; euiColorDarkestShade: string; euiColorFullShade: string; euiPageBackgroundColor: string; euiColorHighlight: string; euiTextColor: string; euiTitleColor: string; euiTextSubduedColor: string; euiColorDisabled: string; euiColorPrimaryText: string; euiColorSecondaryText: string; euiColorAccentText: string; euiColorWarningText: string; euiColorDangerText: string; euiColorDisabledText: string; euiColorSuccessText: string; euiLinkColor: string; euiPaletteColorBlind: { euiColorVis0: { graphic: string; behindText: string; }; euiColorVis1: { graphic: string; behindText: string; }; euiColorVis2: { graphic: string; behindText: string; }; euiColorVis3: { graphic: string; behindText: string; }; euiColorVis4: { graphic: string; behindText: string; }; euiColorVis5: { graphic: string; behindText: string; }; euiColorVis6: { graphic: string; behindText: string; }; euiColorVis7: { graphic: string; behindText: string; }; euiColorVis8: { graphic: string; behindText: string; }; euiColorVis9: { graphic: string; behindText: string; }; }; euiPaletteColorBlindKeys: string; euiColorVis0: string; euiColorVis1: string; euiColorVis2: string; euiColorVis3: string; euiColorVis4: string; euiColorVis5: string; euiColorVis6: string; euiColorVis7: string; euiColorVis8: string; euiColorVis9: string; euiColorVis0_behindText: string; euiColorVis1_behindText: string; euiColorVis2_behindText: string; euiColorVis3_behindText: string; euiColorVis4_behindText: string; euiColorVis5_behindText: string; euiColorVis6_behindText: string; euiColorVis7_behindText: string; euiColorVis8_behindText: string; euiColorVis9_behindText: string; euiColorChartLines: string; euiColorChartBand: string; euiCodeBlockBackgroundColor: string; euiCodeBlockColor: string; euiCodeBlockSelectedBackgroundColor: string; euiCodeBlockCommentColor: string; euiCodeBlockSelectorTagColor: string; euiCodeBlockStringColor: string; euiCodeBlockTagColor: string; euiCodeBlockNameColor: string; euiCodeBlockNumberColor: string; euiCodeBlockKeywordColor: string; euiCodeBlockFunctionTitleColor: string; euiCodeBlockTypeColor: string; euiCodeBlockAttributeColor: string; euiCodeBlockSymbolColor: string; euiCodeBlockParamsColor: string; euiCodeBlockMetaColor: string; euiCodeBlockTitleColor: string; euiCodeBlockSectionColor: string; euiCodeBlockAdditionColor: string; euiCodeBlockDeletionColor: string; euiCodeBlockSelectorClassColor: string; euiCodeBlockSelectorIdColor: string; euiFormMaxWidth: string; euiFormControlHeight: string; euiFormControlCompressedHeight: string; euiFormControlPadding: string; euiFormControlCompressedPadding: string; euiFormControlBorderRadius: number; euiFormControlCompressedBorderRadius: string; euiRadioSize: string; euiCheckBoxSize: string; euiCheckboxBorderRadius: string; euiSwitchHeight: string; euiSwitchWidth: string; euiSwitchThumbSize: string; euiSwitchIconHeight: string; euiSwitchHeightCompressed: string; euiSwitchWidthCompressed: string; euiSwitchThumbSizeCompressed: string; euiSwitchHeightMini: string; euiSwitchWidthMini: string; euiSwitchThumbSizeMini: string; euiFormBackgroundColor: string; euiFormBackgroundDisabledColor: string; euiFormBackgroundReadOnlyColor: string; euiFormBorderOpaqueColor: string; euiFormBorderColor: string; euiFormBorderDisabledColor: string; euiFormCustomControlDisabledIconColor: string; euiFormCustomControlBorderColor: string; euiFormControlDisabledColor: string; euiFormControlBoxShadow: string; euiFormInputGroupLabelBackground: string; euiFormInputGroupBorder: string; euiSwitchOffColor: string; euiFormControlLayoutGroupInputHeight: string; euiFormControlLayoutGroupInputCompressedHeight: string; euiFormControlLayoutGroupInputCompressedBorderRadius: string; euiRangeTrackColor: string; euiRangeThumbRadius: string; euiRangeThumbHeight: string; euiRangeThumbWidth: string; euiRangeThumbBorderColor: string; euiRangeTrackWidth: string; euiRangeTrackHeight: string; euiRangeTrackBorderWidth: number; euiRangeTrackBorderColor: string; euiRangeTrackRadius: string; euiRangeDisabledOpacity: number; euiRangeHighlightHeight: string; euiHeaderBackgroundColor: string; euiHeaderDarkBackgroundColor: string; euiHeaderBorderColor: string; euiHeaderBreadcrumbColor: string; euiHeaderHeight: string; euiHeaderChildSize: string; euiHeaderHeightCompensation: string; euiPageDefaultMaxWidth: string; euiPageSidebarMinWidth: string; euiPanelPaddingModifiers: { paddingSmall: string; paddingMedium: string; paddingLarge: string; }; euiPanelBorderRadiusModifiers: { borderRadiusNone: number; borderRadiusMedium: string; }; euiPanelBackgroundColorModifiers: { transparent: string; plain: string; subdued: string; accent: string; primary: string; success: string; warning: string; danger: string; }; euiBreakpoints: { xs: number; s: string; m: string; l: string; xl: string; }; euiBreakpointKeys: string; euiShadowColor: string; euiShadowColorLarge: string; euiSize: string; euiSizeXS: string; euiSizeS: string; euiSizeM: string; euiSizeL: string; euiSizeXL: string; euiSizeXXL: string; euiButtonMinWidth: string; euiScrollBar: string; euiScrollBarCorner: string; euiFocusRingColor: string; euiFocusRingAnimStartColor: string; euiFocusRingAnimStartSize: string; euiFocusRingAnimStartSizeLarge: string; euiFocusRingSizeLarge: string; euiFocusRingSize: string; euiFocusTransparency: number; euiFocusBackgroundColor: string; euiTooltipBackgroundColor: string; euiTooltipAnimations: { top: string; left: string; bottom: string; right: string; }; euiFontFamily: string; euiCodeFontFamily: string; euiFontFeatureSettings: string; euiTextScale: string; euiFontSize: string; euiFontSizeXS: string; euiFontSizeS: string; euiFontSizeM: string; euiFontSizeL: string; euiFontSizeXL: string; euiFontSizeXXL: string; euiLineHeight: number; euiBodyLineHeight: number; euiFontWeightLight: number; euiFontWeightRegular: number; euiFontWeightMedium: number; euiFontWeightSemiBold: number; euiFontWeightBold: number; euiCodeFontWeightRegular: number; euiCodeFontWeightBold: number; euiTitles: { xxxs: { 'font-size': string; 'line-height': string; 'font-weight': number; }; xxs: { 'font-size': string; 'line-height': string; 'font-weight': number; }; xs: { 'font-size': string; 'line-height': string; 'font-weight': number; 'letter-spacing': string; }; s: { 'font-size': string; 'line-height': string; 'font-weight': number; 'letter-spacing': string; }; m: { 'font-size': string; 'line-height': string; 'font-weight': number; 'letter-spacing': string; }; l: { 'font-size': string; 'line-height': string; 'font-weight': number; 'letter-spacing': string; }; }; euiZLevel0: number; euiZLevel1: number; euiZLevel2: number; euiZLevel3: number; euiZLevel4: number; euiZLevel5: number; euiZLevel6: number; euiZLevel7: number; euiZLevel8: number; euiZLevel9: number; euiZContent: number; euiZHeader: number; euiZContentMenu: number; euiZFlyout: number; euiZNavigation: number; euiZMask: number; euiZModal: number; euiZToastList: number; }" + "{ paddingSizes: { xs: string; s: string; m: string; l: string; xl: string; }; avatarSizing: { s: { size: string; 'font-size': string; }; m: { size: string; 'font-size': string; }; l: { size: string; 'font-size': string; }; xl: { size: string; 'font-size': string; }; }; euiBadgeGroupGutterTypes: { gutterExtraSmall: string; gutterSmall: string; }; euiBreadcrumbSpacing: string; euiBreadcrumbTruncateWidth: string; euiButtonEmptyTypes: { primary: string; danger: string; disabled: string; ghost: string; text: string; success: string; warning: string; }; euiButtonIconTypes: { accent: string; danger: string; ghost: string; primary: string; subdued: string; success: string; text: string; warning: string; }; euiCallOutTypes: { primary: string; success: string; warning: string; danger: string; }; euiCardSpacing: string; euiCardBottomNodeHeight: string; euiCardSelectButtonBorders: { text: string; primary: string; success: string; danger: string; ghost: string; }; euiCardSelectButtonBackgrounds: { text: string; primary: string; success: string; danger: string; ghost: string; }; euiCardPaddingModifiers: { paddingNone: number; paddingSmall: string; paddingMedium: string; paddingLarge: string; }; euiCheckableCardPadding: string; euiCollapsibleNavWidth: string; euiCollapsibleNavGroupLightBackgroundColor: string; euiCollapsibleNavGroupDarkBackgroundColor: string; euiCollapsibleNavGroupDarkHighContrastColor: string; euiColorPickerValueRange0: string; euiColorPickerValueRange1: string; euiColorPickerSaturationRange0: string; euiColorPickerSaturationRange1: string; euiColorPickerIndicatorSize: string; euiColorPickerWidth: string; euiColorPaletteDisplaySizes: { sizeExtraSmall: string; sizeSmall: string; sizeMedium: string; }; euiContextMenuWidth: string; euiControlBarBackground: string; euiControlBarText: string; euiControlBarBorderColor: string; euiControlBarInitialHeight: string; euiControlBarMaxHeight: string; euiControlBarHeights: { s: string; m: string; l: string; }; euiDataGridPrefix: string; euiDataGridStyles: string; euiDataGridColumnResizerWidth: string; euiDataGridPopoverMaxHeight: string; euiDataGridCellPaddingS: string; euiDataGridCellPaddingM: string; euiDataGridCellPaddingL: string; euiDataGridVerticalBorder: string; euiDatePickerCalendarWidth: string; euiSuperDatePickerWidth: string; euiSuperDatePickerButtonWidth: string; euiDragAndDropSpacing: { s: string; m: string; l: string; }; euiExpressionColors: { subdued: string; primary: string; secondary: string; warning: string; danger: string; accent: string; }; euiFacetGutterSizes: { gutterNone: number; gutterSmall: string; gutterMedium: string; gutterLarge: string; }; gutterTypes: { gutterExtraSmall: string; gutterSmall: string; gutterMedium: string; gutterLarge: string; gutterExtraLarge: string; }; fractions: { fourths: { percentage: string; count: number; }; thirds: { percentage: string; count: number; }; halves: { percentage: string; count: number; }; single: { percentage: string; count: number; }; }; flyoutSizes: { small: { min: string; width: string; max: string; }; medium: { min: string; width: string; max: string; }; large: { min: string; width: string; max: string; }; }; euiFlyoutBorder: string; euiFlyoutPaddingModifiers: { paddingNone: number; paddingSmall: string; paddingMedium: string; paddingLarge: string; }; euiFilePickerTallHeight: string; euiRangeLevelColors: { primary: string; success: string; warning: string; danger: string; }; textareaResizing: { vertical: string; horizontal: string; both: string; none: string; }; euiHeaderLinksGutterSizes: { gutterXS: string; gutterS: string; gutterM: string; gutterL: string; }; ruleMargins: { marginXSmall: string; marginSmall: string; marginMedium: string; marginLarge: string; marginXLarge: string; marginXXLarge: string; }; euiIconLoadingOpacity: number; euiIconColors: { accent: string; danger: string; ghost: string; primary: string; secondary: string; success: string; subdued: string; text: string; warning: string; inherit: string; }; euiIconSizes: { small: string; medium: string; large: string; xLarge: string; xxLarge: string; }; euiKeyPadMenuSize: string; euiKeyPadMenuItemBetaBadgeSize: string; euiLinkColors: { subdued: string; primary: string; secondary: string; accent: string; warning: string; danger: string; text: string; ghost: string; }; euiListGroupItemHoverBackground: string; euiListGroupItemHoverBackgroundGhost: string; euiListGroupGutterTypes: { gutterSmall: string; gutterMedium: string; }; euiListGroupItemColorTypes: { primary: string; text: string; subdued: string; ghost: string; }; euiListGroupItemSizeTypes: { xSmall: string; small: string; medium: string; large: string; }; euiGradientStartStop: string; euiGradientMiddle: string; browserDefaultFontSize: string; euiMarkdownEditorMinHeight: string; euiPopoverArrowSize: string; euiPopoverTranslateDistance: string; euiProgressSizes: { xs: string; s: string; m: string; l: string; }; euiProgressColors: { primary: string; secondary: string; success: string; warning: string; danger: string; accent: string; subdued: string; vis0: string; vis1: string; vis2: string; vis3: string; vis4: string; vis5: string; vis6: string; vis7: string; vis8: string; vis9: string; customColor: string; }; euiResizableButtonTransitionSpeed: string; euiResizableButtonSize: string; euiSelectableListItemBorder: string; euiSelectableListItemPadding: string; euiSelectableTemplateSitewideTypes: { application: { color: string; 'font-weight': number; }; deployment: { color: string; 'font-weight': number; }; article: { color: string; 'font-weight': number; }; case: { color: string; 'font-weight': number; }; platform: { color: string; 'font-weight': number; }; }; euiSideNavEmphasizedBackgroundColor: string; euiSideNavRootTextcolor: string; euiSideNavBranchTextcolor: string; euiSideNavSelectedTextcolor: string; spacerSizes: { xs: string; s: string; m: string; l: string; xl: string; xxl: string; }; euiStepNumberSize: string; euiStepNumberSmallSize: string; euiStepNumberMargin: string; euiStepStatusColorsToFade: { warning: string; danger: string; disabled: string; incomplete: string; }; euiSuggestItemColors: { tint0: string; tint1: string; tint2: string; tint3: string; tint4: string; tint5: string; tint6: string; tint7: string; tint8: string; tint9: string; tint10: string; }; euiTableCellContentPadding: string; euiTableCellContentPaddingCompressed: string; euiTableCellCheckboxWidth: string; euiTableActionsAreaWidth: string; euiTableHoverColor: string; euiTableSelectedColor: string; euiTableHoverSelectedColor: string; euiTableActionsBorderColor: string; euiTableHoverClickableColor: string; euiTableFocusClickableColor: string; euiTabFontSize: string; euiTabFontSizeS: string; euiTabFontSizeL: string; euiTextColors: { default: string; subdued: string; secondary: string; accent: string; warning: string; danger: string; ghost: string; }; euiTextConstrainedMaxWidth: string; euiToastWidth: string; euiToastTypes: { primary: string; success: string; warning: string; danger: string; }; euiTokenGrayColor: string; euiTokenTypes: { euiColorVis0: { graphic: string; behindText: string; }; euiColorVis1: { graphic: string; behindText: string; }; euiColorVis2: { graphic: string; behindText: string; }; euiColorVis3: { graphic: string; behindText: string; }; euiColorVis4: { graphic: string; behindText: string; }; euiColorVis5: { graphic: string; behindText: string; }; euiColorVis6: { graphic: string; behindText: string; }; euiColorVis7: { graphic: string; behindText: string; }; euiColorVis8: { graphic: string; behindText: string; }; euiColorVis9: { graphic: string; behindText: string; }; gray: { graphic: string; behindText: string; }; }; euiTokenTypeKeys: string; euiAnimSlightBounce: string; euiAnimSlightResistance: string; euiAnimSpeedExtraFast: string; euiAnimSpeedFast: string; euiAnimSpeedNormal: string; euiAnimSpeedSlow: string; euiAnimSpeedExtraSlow: string; euiBorderWidthThin: string; euiBorderWidthThick: string; euiBorderColor: string; euiBorderRadius: string; euiBorderRadiusSmall: string; euiBorderThick: string; euiBorderThin: string; euiBorderEditable: string; euiButtonHeight: string; euiButtonHeightSmall: string; euiButtonHeightXSmall: string; euiButtonColorDisabled: string; euiButtonColorDisabledText: string; euiButtonColorGhostDisabled: string; euiButtonTypes: { primary: string; secondary: string; warning: string; danger: string; ghost: string; text: string; }; euiColorGhost: string; euiColorInk: string; euiColorPrimary: string; euiColorSecondary: string; euiColorAccent: string; euiColorSuccess: string; euiColorWarning: string; euiColorDanger: string; euiColorEmptyShade: string; euiColorLightestShade: string; euiColorLightShade: string; euiColorMediumShade: string; euiColorDarkShade: string; euiColorDarkestShade: string; euiColorFullShade: string; euiPageBackgroundColor: string; euiColorHighlight: string; euiTextColor: string; euiTitleColor: string; euiTextSubduedColor: string; euiColorDisabled: string; euiColorPrimaryText: string; euiColorSecondaryText: string; euiColorAccentText: string; euiColorWarningText: string; euiColorDangerText: string; euiColorDisabledText: string; euiColorSuccessText: string; euiLinkColor: string; euiPaletteColorBlind: { euiColorVis0: { graphic: string; behindText: string; }; euiColorVis1: { graphic: string; behindText: string; }; euiColorVis2: { graphic: string; behindText: string; }; euiColorVis3: { graphic: string; behindText: string; }; euiColorVis4: { graphic: string; behindText: string; }; euiColorVis5: { graphic: string; behindText: string; }; euiColorVis6: { graphic: string; behindText: string; }; euiColorVis7: { graphic: string; behindText: string; }; euiColorVis8: { graphic: string; behindText: string; }; euiColorVis9: { graphic: string; behindText: string; }; }; euiPaletteColorBlindKeys: string; euiColorVis0: string; euiColorVis1: string; euiColorVis2: string; euiColorVis3: string; euiColorVis4: string; euiColorVis5: string; euiColorVis6: string; euiColorVis7: string; euiColorVis8: string; euiColorVis9: string; euiColorVis0_behindText: string; euiColorVis1_behindText: string; euiColorVis2_behindText: string; euiColorVis3_behindText: string; euiColorVis4_behindText: string; euiColorVis5_behindText: string; euiColorVis6_behindText: string; euiColorVis7_behindText: string; euiColorVis8_behindText: string; euiColorVis9_behindText: string; euiColorChartLines: string; euiColorChartBand: string; euiCodeBlockBackgroundColor: string; euiCodeBlockColor: string; euiCodeBlockSelectedBackgroundColor: string; euiCodeBlockCommentColor: string; euiCodeBlockSelectorTagColor: string; euiCodeBlockStringColor: string; euiCodeBlockTagColor: string; euiCodeBlockNameColor: string; euiCodeBlockNumberColor: string; euiCodeBlockKeywordColor: string; euiCodeBlockFunctionTitleColor: string; euiCodeBlockTypeColor: string; euiCodeBlockAttributeColor: string; euiCodeBlockSymbolColor: string; euiCodeBlockParamsColor: string; euiCodeBlockMetaColor: string; euiCodeBlockTitleColor: string; euiCodeBlockSectionColor: string; euiCodeBlockAdditionColor: string; euiCodeBlockDeletionColor: string; euiCodeBlockSelectorClassColor: string; euiCodeBlockSelectorIdColor: string; euiFormMaxWidth: string; euiFormControlHeight: string; euiFormControlCompressedHeight: string; euiFormControlPadding: string; euiFormControlCompressedPadding: string; euiFormControlBorderRadius: number; euiFormControlCompressedBorderRadius: string; euiRadioSize: string; euiCheckBoxSize: string; euiCheckboxBorderRadius: string; euiSwitchHeight: string; euiSwitchWidth: string; euiSwitchThumbSize: string; euiSwitchIconHeight: string; euiSwitchHeightCompressed: string; euiSwitchWidthCompressed: string; euiSwitchThumbSizeCompressed: string; euiSwitchHeightMini: string; euiSwitchWidthMini: string; euiSwitchThumbSizeMini: string; euiFormBackgroundColor: string; euiFormBackgroundDisabledColor: string; euiFormBackgroundReadOnlyColor: string; euiFormBorderOpaqueColor: string; euiFormBorderColor: string; euiFormBorderDisabledColor: string; euiFormCustomControlDisabledIconColor: string; euiFormCustomControlBorderColor: string; euiFormControlDisabledColor: string; euiFormControlBoxShadow: string; euiFormControlPlaceholderText: string; euiFormInputGroupLabelBackground: string; euiFormInputGroupBorder: string; euiSwitchOffColor: string; euiFormControlLayoutGroupInputHeight: string; euiFormControlLayoutGroupInputCompressedHeight: string; euiFormControlLayoutGroupInputCompressedBorderRadius: string; euiRangeTrackColor: string; euiRangeThumbRadius: string; euiRangeThumbHeight: string; euiRangeThumbWidth: string; euiRangeThumbBorderColor: string; euiRangeTrackWidth: string; euiRangeTrackHeight: string; euiRangeTrackBorderWidth: number; euiRangeTrackBorderColor: string; euiRangeTrackRadius: string; euiRangeDisabledOpacity: number; euiRangeHighlightHeight: string; euiHeaderBackgroundColor: string; euiHeaderDarkBackgroundColor: string; euiHeaderBorderColor: string; euiHeaderBreadcrumbColor: string; euiHeaderHeight: string; euiHeaderChildSize: string; euiHeaderHeightCompensation: string; euiPageDefaultMaxWidth: string; euiPageSidebarMinWidth: string; euiPanelPaddingModifiers: { paddingSmall: string; paddingMedium: string; paddingLarge: string; }; euiPanelBorderRadiusModifiers: { borderRadiusNone: number; borderRadiusMedium: string; }; euiPanelBackgroundColorModifiers: { transparent: string; plain: string; subdued: string; accent: string; primary: string; success: string; warning: string; danger: string; }; euiBreakpoints: { xs: number; s: string; m: string; l: string; xl: string; }; euiBreakpointKeys: string; euiShadowColor: string; euiShadowColorLarge: string; euiSize: string; euiSizeXS: string; euiSizeS: string; euiSizeM: string; euiSizeL: string; euiSizeXL: string; euiSizeXXL: string; euiButtonMinWidth: string; euiScrollBar: string; euiScrollBarCorner: string; euiFocusRingColor: string; euiFocusRingAnimStartColor: string; euiFocusRingAnimStartSize: string; euiFocusRingAnimStartSizeLarge: string; euiFocusRingSizeLarge: string; euiFocusRingSize: string; euiFocusTransparency: number; euiFocusBackgroundColor: string; euiTooltipBackgroundColor: string; euiTooltipAnimations: { top: string; left: string; bottom: string; right: string; }; euiFontFamily: string; euiCodeFontFamily: string; euiFontFeatureSettings: string; euiTextScale: string; euiFontSize: string; euiFontSizeXS: string; euiFontSizeS: string; euiFontSizeM: string; euiFontSizeL: string; euiFontSizeXL: string; euiFontSizeXXL: string; euiLineHeight: number; euiBodyLineHeight: number; euiFontWeightLight: number; euiFontWeightRegular: number; euiFontWeightMedium: number; euiFontWeightSemiBold: number; euiFontWeightBold: number; euiCodeFontWeightRegular: number; euiCodeFontWeightBold: number; euiTitles: { xxxs: { 'font-size': string; 'line-height': string; 'font-weight': number; }; xxs: { 'font-size': string; 'line-height': string; 'font-weight': number; }; xs: { 'font-size': string; 'line-height': string; 'font-weight': number; 'letter-spacing': string; }; s: { 'font-size': string; 'line-height': string; 'font-weight': number; 'letter-spacing': string; }; m: { 'font-size': string; 'line-height': string; 'font-weight': number; 'letter-spacing': string; }; l: { 'font-size': string; 'line-height': string; 'font-weight': number; 'letter-spacing': string; }; }; euiZLevel0: number; euiZLevel1: number; euiZLevel2: number; euiZLevel3: number; euiZLevel4: number; euiZLevel5: number; euiZLevel6: number; euiZLevel7: number; euiZLevel8: number; euiZLevel9: number; euiZContent: number; euiZHeader: number; euiZContentMenu: number; euiZFlyout: number; euiZNavigation: number; euiZMask: number; euiZModal: number; euiZToastList: number; } | { paddingSizes: { xs: string; s: string; m: string; l: string; xl: string; }; avatarSizing: { s: { size: string; 'font-size': string; }; m: { size: string; 'font-size': string; }; l: { size: string; 'font-size': string; }; xl: { size: string; 'font-size': string; }; }; euiBadgeGroupGutterTypes: { gutterExtraSmall: string; gutterSmall: string; }; euiBreadcrumbSpacing: string; euiBreadcrumbTruncateWidth: string; euiButtonEmptyTypes: { primary: string; danger: string; disabled: string; ghost: string; text: string; success: string; warning: string; }; euiButtonIconTypes: { accent: string; danger: string; ghost: string; primary: string; subdued: string; success: string; text: string; warning: string; }; euiCallOutTypes: { primary: string; success: string; warning: string; danger: string; }; euiCardSpacing: string; euiCardBottomNodeHeight: string; euiCardSelectButtonBorders: { text: string; primary: string; success: string; danger: string; ghost: string; }; euiCardSelectButtonBackgrounds: { text: string; primary: string; success: string; danger: string; ghost: string; }; euiCardPaddingModifiers: { paddingNone: number; paddingSmall: string; paddingMedium: string; paddingLarge: string; }; euiCheckableCardPadding: string; euiCollapsibleNavWidth: string; euiCollapsibleNavGroupLightBackgroundColor: string; euiCollapsibleNavGroupDarkBackgroundColor: string; euiCollapsibleNavGroupDarkHighContrastColor: string; euiColorPickerValueRange0: string; euiColorPickerValueRange1: string; euiColorPickerSaturationRange0: string; euiColorPickerSaturationRange1: string; euiColorPickerIndicatorSize: string; euiColorPickerWidth: string; euiColorPaletteDisplaySizes: { sizeExtraSmall: string; sizeSmall: string; sizeMedium: string; }; euiContextMenuWidth: string; euiControlBarBackground: string; euiControlBarText: string; euiControlBarBorderColor: string; euiControlBarInitialHeight: string; euiControlBarMaxHeight: string; euiControlBarHeights: { s: string; m: string; l: string; }; euiDataGridPrefix: string; euiDataGridStyles: string; euiDataGridColumnResizerWidth: string; euiDataGridPopoverMaxHeight: string; euiDataGridCellPaddingS: string; euiDataGridCellPaddingM: string; euiDataGridCellPaddingL: string; euiDataGridVerticalBorder: string; euiDatePickerCalendarWidth: string; euiSuperDatePickerWidth: string; euiSuperDatePickerButtonWidth: string; euiDragAndDropSpacing: { s: string; m: string; l: string; }; euiExpressionColors: { subdued: string; primary: string; secondary: string; warning: string; danger: string; accent: string; }; euiFacetGutterSizes: { gutterNone: number; gutterSmall: string; gutterMedium: string; gutterLarge: string; }; gutterTypes: { gutterExtraSmall: string; gutterSmall: string; gutterMedium: string; gutterLarge: string; gutterExtraLarge: string; }; fractions: { fourths: { percentage: string; count: number; }; thirds: { percentage: string; count: number; }; halves: { percentage: string; count: number; }; single: { percentage: string; count: number; }; }; flyoutSizes: { small: { min: string; width: string; max: string; }; medium: { min: string; width: string; max: string; }; large: { min: string; width: string; max: string; }; }; euiFlyoutBorder: string; euiFlyoutPaddingModifiers: { paddingNone: number; paddingSmall: string; paddingMedium: string; paddingLarge: string; }; euiFilePickerTallHeight: string; euiRangeLevelColors: { primary: string; success: string; warning: string; danger: string; }; textareaResizing: { vertical: string; horizontal: string; both: string; none: string; }; euiHeaderLinksGutterSizes: { gutterXS: string; gutterS: string; gutterM: string; gutterL: string; }; ruleMargins: { marginXSmall: string; marginSmall: string; marginMedium: string; marginLarge: string; marginXLarge: string; marginXXLarge: string; }; euiIconLoadingOpacity: number; euiIconColors: { accent: string; danger: string; ghost: string; primary: string; secondary: string; success: string; subdued: string; text: string; warning: string; inherit: string; }; euiIconSizes: { small: string; medium: string; large: string; xLarge: string; xxLarge: string; }; euiKeyPadMenuSize: string; euiKeyPadMenuItemBetaBadgeSize: string; euiLinkColors: { subdued: string; primary: string; secondary: string; accent: string; warning: string; danger: string; text: string; ghost: string; }; euiListGroupItemHoverBackground: string; euiListGroupItemHoverBackgroundGhost: string; euiListGroupGutterTypes: { gutterSmall: string; gutterMedium: string; }; euiListGroupItemColorTypes: { primary: string; text: string; subdued: string; ghost: string; }; euiListGroupItemSizeTypes: { xSmall: string; small: string; medium: string; large: string; }; euiGradientStartStop: string; euiGradientMiddle: string; browserDefaultFontSize: string; euiMarkdownEditorMinHeight: string; euiPopoverArrowSize: string; euiPopoverTranslateDistance: string; euiProgressSizes: { xs: string; s: string; m: string; l: string; }; euiProgressColors: { primary: string; secondary: string; success: string; warning: string; danger: string; accent: string; subdued: string; vis0: string; vis1: string; vis2: string; vis3: string; vis4: string; vis5: string; vis6: string; vis7: string; vis8: string; vis9: string; customColor: string; }; euiResizableButtonTransitionSpeed: string; euiResizableButtonSize: string; euiSelectableListItemBorder: string; euiSelectableListItemPadding: string; euiSelectableTemplateSitewideTypes: { application: { color: string; 'font-weight': number; }; deployment: { color: string; 'font-weight': number; }; article: { color: string; 'font-weight': number; }; case: { color: string; 'font-weight': number; }; platform: { color: string; 'font-weight': number; }; }; euiSideNavEmphasizedBackgroundColor: string; euiSideNavRootTextcolor: string; euiSideNavBranchTextcolor: string; euiSideNavSelectedTextcolor: string; spacerSizes: { xs: string; s: string; m: string; l: string; xl: string; xxl: string; }; euiStepNumberSize: string; euiStepNumberSmallSize: string; euiStepNumberMargin: string; euiStepStatusColorsToFade: { warning: string; danger: string; disabled: string; incomplete: string; }; euiSuggestItemColors: { tint0: string; tint1: string; tint2: string; tint3: string; tint4: string; tint5: string; tint6: string; tint7: string; tint8: string; tint9: string; tint10: string; }; euiTableCellContentPadding: string; euiTableCellContentPaddingCompressed: string; euiTableCellCheckboxWidth: string; euiTableActionsAreaWidth: string; euiTableHoverColor: string; euiTableSelectedColor: string; euiTableHoverSelectedColor: string; euiTableActionsBorderColor: string; euiTableHoverClickableColor: string; euiTableFocusClickableColor: string; euiTabFontSize: string; euiTabFontSizeS: string; euiTabFontSizeL: string; euiTextColors: { default: string; subdued: string; secondary: string; accent: string; warning: string; danger: string; ghost: string; }; euiTextConstrainedMaxWidth: string; euiToastWidth: string; euiToastTypes: { primary: string; success: string; warning: string; danger: string; }; euiTokenGrayColor: string; euiTokenTypes: { euiColorVis0: { graphic: string; behindText: string; }; euiColorVis1: { graphic: string; behindText: string; }; euiColorVis2: { graphic: string; behindText: string; }; euiColorVis3: { graphic: string; behindText: string; }; euiColorVis4: { graphic: string; behindText: string; }; euiColorVis5: { graphic: string; behindText: string; }; euiColorVis6: { graphic: string; behindText: string; }; euiColorVis7: { graphic: string; behindText: string; }; euiColorVis8: { graphic: string; behindText: string; }; euiColorVis9: { graphic: string; behindText: string; }; gray: { graphic: string; behindText: string; }; }; euiTokenTypeKeys: string; euiAnimSlightBounce: string; euiAnimSlightResistance: string; euiAnimSpeedExtraFast: string; euiAnimSpeedFast: string; euiAnimSpeedNormal: string; euiAnimSpeedSlow: string; euiAnimSpeedExtraSlow: string; euiBorderWidthThin: string; euiBorderWidthThick: string; euiBorderColor: string; euiBorderRadius: string; euiBorderRadiusSmall: string; euiBorderThick: string; euiBorderThin: string; euiBorderEditable: string; euiButtonHeight: string; euiButtonHeightSmall: string; euiButtonHeightXSmall: string; euiButtonColorDisabled: string; euiButtonColorDisabledText: string; euiButtonColorGhostDisabled: string; euiButtonTypes: { primary: string; secondary: string; warning: string; danger: string; ghost: string; text: string; }; euiColorGhost: string; euiColorInk: string; euiColorPrimary: string; euiColorSecondary: string; euiColorAccent: string; euiColorSuccess: string; euiColorWarning: string; euiColorDanger: string; euiColorEmptyShade: string; euiColorLightestShade: string; euiColorLightShade: string; euiColorMediumShade: string; euiColorDarkShade: string; euiColorDarkestShade: string; euiColorFullShade: string; euiPageBackgroundColor: string; euiColorHighlight: string; euiTextColor: string; euiTitleColor: string; euiTextSubduedColor: string; euiColorDisabled: string; euiColorPrimaryText: string; euiColorSecondaryText: string; euiColorAccentText: string; euiColorWarningText: string; euiColorDangerText: string; euiColorDisabledText: string; euiColorSuccessText: string; euiLinkColor: string; euiPaletteColorBlind: { euiColorVis0: { graphic: string; behindText: string; }; euiColorVis1: { graphic: string; behindText: string; }; euiColorVis2: { graphic: string; behindText: string; }; euiColorVis3: { graphic: string; behindText: string; }; euiColorVis4: { graphic: string; behindText: string; }; euiColorVis5: { graphic: string; behindText: string; }; euiColorVis6: { graphic: string; behindText: string; }; euiColorVis7: { graphic: string; behindText: string; }; euiColorVis8: { graphic: string; behindText: string; }; euiColorVis9: { graphic: string; behindText: string; }; }; euiPaletteColorBlindKeys: string; euiColorVis0: string; euiColorVis1: string; euiColorVis2: string; euiColorVis3: string; euiColorVis4: string; euiColorVis5: string; euiColorVis6: string; euiColorVis7: string; euiColorVis8: string; euiColorVis9: string; euiColorVis0_behindText: string; euiColorVis1_behindText: string; euiColorVis2_behindText: string; euiColorVis3_behindText: string; euiColorVis4_behindText: string; euiColorVis5_behindText: string; euiColorVis6_behindText: string; euiColorVis7_behindText: string; euiColorVis8_behindText: string; euiColorVis9_behindText: string; euiColorChartLines: string; euiColorChartBand: string; euiCodeBlockBackgroundColor: string; euiCodeBlockColor: string; euiCodeBlockSelectedBackgroundColor: string; euiCodeBlockCommentColor: string; euiCodeBlockSelectorTagColor: string; euiCodeBlockStringColor: string; euiCodeBlockTagColor: string; euiCodeBlockNameColor: string; euiCodeBlockNumberColor: string; euiCodeBlockKeywordColor: string; euiCodeBlockFunctionTitleColor: string; euiCodeBlockTypeColor: string; euiCodeBlockAttributeColor: string; euiCodeBlockSymbolColor: string; euiCodeBlockParamsColor: string; euiCodeBlockMetaColor: string; euiCodeBlockTitleColor: string; euiCodeBlockSectionColor: string; euiCodeBlockAdditionColor: string; euiCodeBlockDeletionColor: string; euiCodeBlockSelectorClassColor: string; euiCodeBlockSelectorIdColor: string; euiFormMaxWidth: string; euiFormControlHeight: string; euiFormControlCompressedHeight: string; euiFormControlPadding: string; euiFormControlCompressedPadding: string; euiFormControlBorderRadius: number; euiFormControlCompressedBorderRadius: string; euiRadioSize: string; euiCheckBoxSize: string; euiCheckboxBorderRadius: string; euiSwitchHeight: string; euiSwitchWidth: string; euiSwitchThumbSize: string; euiSwitchIconHeight: string; euiSwitchHeightCompressed: string; euiSwitchWidthCompressed: string; euiSwitchThumbSizeCompressed: string; euiSwitchHeightMini: string; euiSwitchWidthMini: string; euiSwitchThumbSizeMini: string; euiFormBackgroundColor: string; euiFormBackgroundDisabledColor: string; euiFormBackgroundReadOnlyColor: string; euiFormBorderOpaqueColor: string; euiFormBorderColor: string; euiFormBorderDisabledColor: string; euiFormCustomControlDisabledIconColor: string; euiFormCustomControlBorderColor: string; euiFormControlDisabledColor: string; euiFormControlBoxShadow: string; euiFormControlPlaceholderText: string; euiFormInputGroupLabelBackground: string; euiFormInputGroupBorder: string; euiSwitchOffColor: string; euiFormControlLayoutGroupInputHeight: string; euiFormControlLayoutGroupInputCompressedHeight: string; euiFormControlLayoutGroupInputCompressedBorderRadius: string; euiRangeTrackColor: string; euiRangeThumbRadius: string; euiRangeThumbHeight: string; euiRangeThumbWidth: string; euiRangeThumbBorderColor: string; euiRangeTrackWidth: string; euiRangeTrackHeight: string; euiRangeTrackBorderWidth: number; euiRangeTrackBorderColor: string; euiRangeTrackRadius: string; euiRangeDisabledOpacity: number; euiRangeHighlightHeight: string; euiHeaderBackgroundColor: string; euiHeaderDarkBackgroundColor: string; euiHeaderBorderColor: string; euiHeaderBreadcrumbColor: string; euiHeaderHeight: string; euiHeaderChildSize: string; euiHeaderHeightCompensation: string; euiPageDefaultMaxWidth: string; euiPageSidebarMinWidth: string; euiPanelPaddingModifiers: { paddingSmall: string; paddingMedium: string; paddingLarge: string; }; euiPanelBorderRadiusModifiers: { borderRadiusNone: number; borderRadiusMedium: string; }; euiPanelBackgroundColorModifiers: { transparent: string; plain: string; subdued: string; accent: string; primary: string; success: string; warning: string; danger: string; }; euiBreakpoints: { xs: number; s: string; m: string; l: string; xl: string; }; euiBreakpointKeys: string; euiShadowColor: string; euiShadowColorLarge: string; euiSize: string; euiSizeXS: string; euiSizeS: string; euiSizeM: string; euiSizeL: string; euiSizeXL: string; euiSizeXXL: string; euiButtonMinWidth: string; euiScrollBar: string; euiScrollBarCorner: string; euiFocusRingColor: string; euiFocusRingAnimStartColor: string; euiFocusRingAnimStartSize: string; euiFocusRingAnimStartSizeLarge: string; euiFocusRingSizeLarge: string; euiFocusRingSize: string; euiFocusTransparency: number; euiFocusBackgroundColor: string; euiTooltipBackgroundColor: string; euiTooltipAnimations: { top: string; left: string; bottom: string; right: string; }; euiFontFamily: string; euiCodeFontFamily: string; euiFontFeatureSettings: string; euiTextScale: string; euiFontSize: string; euiFontSizeXS: string; euiFontSizeS: string; euiFontSizeM: string; euiFontSizeL: string; euiFontSizeXL: string; euiFontSizeXXL: string; euiLineHeight: number; euiBodyLineHeight: number; euiFontWeightLight: number; euiFontWeightRegular: number; euiFontWeightMedium: number; euiFontWeightSemiBold: number; euiFontWeightBold: number; euiCodeFontWeightRegular: number; euiCodeFontWeightBold: number; euiTitles: { xxxs: { 'font-size': string; 'line-height': string; 'font-weight': number; }; xxs: { 'font-size': string; 'line-height': string; 'font-weight': number; }; xs: { 'font-size': string; 'line-height': string; 'font-weight': number; 'letter-spacing': string; }; s: { 'font-size': string; 'line-height': string; 'font-weight': number; 'letter-spacing': string; }; m: { 'font-size': string; 'line-height': string; 'font-weight': number; 'letter-spacing': string; }; l: { 'font-size': string; 'line-height': string; 'font-weight': number; 'letter-spacing': string; }; }; euiZLevel0: number; euiZLevel1: number; euiZLevel2: number; euiZLevel3: number; euiZLevel4: number; euiZLevel5: number; euiZLevel6: number; euiZLevel7: number; euiZLevel8: number; euiZLevel9: number; euiZContent: number; euiZHeader: number; euiZContentMenu: number; euiZFlyout: number; euiZNavigation: number; euiZMask: number; euiZModal: number; euiZToastList: number; }" ], "source": { "path": "src/plugins/kibana_react/common/eui_styled_components.tsx", diff --git a/api_docs/lens.json b/api_docs/lens.json index 196361f65682b9..782d060f398cb3 100644 --- a/api_docs/lens.json +++ b/api_docs/lens.json @@ -87,7 +87,7 @@ ], "source": { "path": "x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/cardinality.tsx", - "lineNumber": 45 + "lineNumber": 52 }, "deprecated": false, "children": [ @@ -103,7 +103,7 @@ ], "source": { "path": "x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/cardinality.tsx", - "lineNumber": 48 + "lineNumber": 55 }, "deprecated": false } @@ -119,7 +119,7 @@ "description": [], "source": { "path": "x-pack/plugins/lens/public/datatable_visualization/visualization.tsx", - "lineNumber": 42 + "lineNumber": 48 }, "deprecated": false, "children": [ @@ -136,7 +136,7 @@ ], "source": { "path": "x-pack/plugins/lens/public/datatable_visualization/visualization.tsx", - "lineNumber": 43 + "lineNumber": 49 }, "deprecated": false }, @@ -149,7 +149,7 @@ "description": [], "source": { "path": "x-pack/plugins/lens/public/datatable_visualization/visualization.tsx", - "lineNumber": 44 + "lineNumber": 50 }, "deprecated": false }, @@ -166,7 +166,7 @@ ], "source": { "path": "x-pack/plugins/lens/public/datatable_visualization/visualization.tsx", - "lineNumber": 45 + "lineNumber": 51 }, "deprecated": false } @@ -199,7 +199,7 @@ ], "source": { "path": "x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/date_histogram.tsx", - "lineNumber": 43 + "lineNumber": 44 }, "deprecated": false, "children": [ @@ -215,7 +215,7 @@ ], "source": { "path": "x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/date_histogram.tsx", - "lineNumber": 44 + "lineNumber": 45 }, "deprecated": false }, @@ -231,7 +231,7 @@ ], "source": { "path": "x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/date_histogram.tsx", - "lineNumber": 45 + "lineNumber": 46 }, "deprecated": false } @@ -308,7 +308,7 @@ "description": [], "source": { "path": "x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/column_types.ts", - "lineNumber": 45 + "lineNumber": 46 }, "deprecated": false, "children": [ @@ -324,7 +324,7 @@ ], "source": { "path": "x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/column_types.ts", - "lineNumber": 46 + "lineNumber": 47 }, "deprecated": false }, @@ -340,7 +340,7 @@ ], "source": { "path": "x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/column_types.ts", - "lineNumber": 47 + "lineNumber": 48 }, "deprecated": false } @@ -407,7 +407,7 @@ ], "source": { "path": "x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/last_value.tsx", - "lineNumber": 80 + "lineNumber": 87 }, "deprecated": false, "children": [ @@ -423,7 +423,7 @@ ], "source": { "path": "x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/last_value.tsx", - "lineNumber": 81 + "lineNumber": 88 }, "deprecated": false }, @@ -439,7 +439,7 @@ ], "source": { "path": "x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/last_value.tsx", - "lineNumber": 82 + "lineNumber": 89 }, "deprecated": false } @@ -522,7 +522,7 @@ "description": [], "source": { "path": "x-pack/plugins/lens/public/plugin.ts", - "lineNumber": 83 + "lineNumber": 84 }, "deprecated": false, "children": [ @@ -558,7 +558,7 @@ ], "source": { "path": "x-pack/plugins/lens/public/plugin.ts", - "lineNumber": 92 + "lineNumber": 93 }, "deprecated": false }, @@ -580,7 +580,7 @@ ], "source": { "path": "x-pack/plugins/lens/public/plugin.ts", - "lineNumber": 101 + "lineNumber": 102 }, "deprecated": false, "returnComment": [], @@ -599,7 +599,7 @@ ], "source": { "path": "x-pack/plugins/lens/public/plugin.ts", - "lineNumber": 101 + "lineNumber": 102 }, "deprecated": false }, @@ -615,7 +615,7 @@ ], "source": { "path": "x-pack/plugins/lens/public/plugin.ts", - "lineNumber": 101 + "lineNumber": 102 }, "deprecated": false } @@ -635,7 +635,7 @@ ], "source": { "path": "x-pack/plugins/lens/public/plugin.ts", - "lineNumber": 105 + "lineNumber": 106 }, "deprecated": false, "returnComment": [], @@ -657,7 +657,7 @@ ], "source": { "path": "x-pack/plugins/lens/public/plugin.ts", - "lineNumber": 110 + "lineNumber": 111 }, "deprecated": false, "returnComment": [], @@ -720,7 +720,7 @@ "description": [], "source": { "path": "x-pack/plugins/lens/public/types.ts", - "lineNumber": 363 + "lineNumber": 362 }, "deprecated": false, "children": [ @@ -736,7 +736,7 @@ ], "source": { "path": "x-pack/plugins/lens/public/types.ts", - "lineNumber": 365 + "lineNumber": 364 }, "deprecated": false }, @@ -749,7 +749,7 @@ "description": [], "source": { "path": "x-pack/plugins/lens/public/types.ts", - "lineNumber": 368 + "lineNumber": 367 }, "deprecated": false }, @@ -767,7 +767,7 @@ ], "source": { "path": "x-pack/plugins/lens/public/types.ts", - "lineNumber": 374 + "lineNumber": 373 }, "deprecated": false } @@ -800,7 +800,7 @@ ], "source": { "path": "x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/percentile.tsx", - "lineNumber": 24 + "lineNumber": 25 }, "deprecated": false, "children": [ @@ -816,7 +816,7 @@ ], "source": { "path": "x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/percentile.tsx", - "lineNumber": 25 + "lineNumber": 26 }, "deprecated": false }, @@ -832,7 +832,7 @@ ], "source": { "path": "x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/percentile.tsx", - "lineNumber": 26 + "lineNumber": 27 }, "deprecated": false } @@ -1039,7 +1039,7 @@ "label": "numberDisplay", "description": [], "signature": [ - "\"hidden\" | \"value\" | \"percent\"" + "\"percent\" | \"hidden\" | \"value\"" ], "source": { "path": "x-pack/plugins/lens/public/pie_visualization/types.ts", @@ -1156,7 +1156,7 @@ ], "source": { "path": "x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/terms/index.tsx", - "lineNumber": 56 + "lineNumber": 161 }, "deprecated": false, "children": [ @@ -1172,7 +1172,7 @@ ], "source": { "path": "x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/terms/index.tsx", - "lineNumber": 57 + "lineNumber": 162 }, "deprecated": false }, @@ -1188,7 +1188,7 @@ ], "source": { "path": "x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/terms/index.tsx", - "lineNumber": 58 + "lineNumber": 163 }, "deprecated": false } @@ -1277,7 +1277,13 @@ "label": "yConfig", "description": [], "signature": [ - "YConfig", + { + "pluginId": "lens", + "scope": "public", + "docId": "kibLensPluginApi", + "section": "def-public.YConfig", + "text": "YConfig" + }, "[] | undefined" ], "source": { @@ -1353,7 +1359,7 @@ "description": [], "source": { "path": "x-pack/plugins/lens/public/xy_visualization/types.ts", - "lineNumber": 474 + "lineNumber": 475 }, "deprecated": false, "children": [ @@ -1369,7 +1375,7 @@ ], "source": { "path": "x-pack/plugins/lens/public/xy_visualization/types.ts", - "lineNumber": 475 + "lineNumber": 476 }, "deprecated": false }, @@ -1391,7 +1397,7 @@ ], "source": { "path": "x-pack/plugins/lens/public/xy_visualization/types.ts", - "lineNumber": 476 + "lineNumber": 477 }, "deprecated": false }, @@ -1407,7 +1413,7 @@ ], "source": { "path": "x-pack/plugins/lens/public/xy_visualization/types.ts", - "lineNumber": 477 + "lineNumber": 478 }, "deprecated": false }, @@ -1423,7 +1429,7 @@ ], "source": { "path": "x-pack/plugins/lens/public/xy_visualization/types.ts", - "lineNumber": 478 + "lineNumber": 479 }, "deprecated": false }, @@ -1440,7 +1446,7 @@ ], "source": { "path": "x-pack/plugins/lens/public/xy_visualization/types.ts", - "lineNumber": 479 + "lineNumber": 480 }, "deprecated": false }, @@ -1457,7 +1463,7 @@ ], "source": { "path": "x-pack/plugins/lens/public/xy_visualization/types.ts", - "lineNumber": 480 + "lineNumber": 481 }, "deprecated": false }, @@ -1480,7 +1486,7 @@ ], "source": { "path": "x-pack/plugins/lens/public/xy_visualization/types.ts", - "lineNumber": 481 + "lineNumber": 482 }, "deprecated": false }, @@ -1496,7 +1502,7 @@ ], "source": { "path": "x-pack/plugins/lens/public/xy_visualization/types.ts", - "lineNumber": 482 + "lineNumber": 483 }, "deprecated": false }, @@ -1512,7 +1518,7 @@ ], "source": { "path": "x-pack/plugins/lens/public/xy_visualization/types.ts", - "lineNumber": 483 + "lineNumber": 484 }, "deprecated": false }, @@ -1528,7 +1534,7 @@ ], "source": { "path": "x-pack/plugins/lens/public/xy_visualization/types.ts", - "lineNumber": 484 + "lineNumber": 485 }, "deprecated": false }, @@ -1551,7 +1557,7 @@ ], "source": { "path": "x-pack/plugins/lens/public/xy_visualization/types.ts", - "lineNumber": 485 + "lineNumber": 486 }, "deprecated": false }, @@ -1574,7 +1580,7 @@ ], "source": { "path": "x-pack/plugins/lens/public/xy_visualization/types.ts", - "lineNumber": 486 + "lineNumber": 487 }, "deprecated": false }, @@ -1597,7 +1603,7 @@ ], "source": { "path": "x-pack/plugins/lens/public/xy_visualization/types.ts", - "lineNumber": 487 + "lineNumber": 488 }, "deprecated": false }, @@ -1613,7 +1619,7 @@ ], "source": { "path": "x-pack/plugins/lens/public/xy_visualization/types.ts", - "lineNumber": 488 + "lineNumber": 489 }, "deprecated": false }, @@ -1629,7 +1635,7 @@ ], "source": { "path": "x-pack/plugins/lens/public/xy_visualization/types.ts", - "lineNumber": 489 + "lineNumber": 490 }, "deprecated": false }, @@ -1645,7 +1651,84 @@ ], "source": { "path": "x-pack/plugins/lens/public/xy_visualization/types.ts", - "lineNumber": 490 + "lineNumber": 491 + }, + "deprecated": false + }, + { + "parentPluginId": "lens", + "id": "def-public.XYState.valuesInLegend", + "type": "CompoundType", + "tags": [], + "label": "valuesInLegend", + "description": [], + "signature": [ + "boolean | undefined" + ], + "source": { + "path": "x-pack/plugins/lens/public/xy_visualization/types.ts", + "lineNumber": 492 + }, + "deprecated": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "lens", + "id": "def-public.YConfig", + "type": "Interface", + "tags": [], + "label": "YConfig", + "description": [], + "source": { + "path": "x-pack/plugins/lens/public/xy_visualization/types.ts", + "lineNumber": 418 + }, + "deprecated": false, + "children": [ + { + "parentPluginId": "lens", + "id": "def-public.YConfig.forAccessor", + "type": "string", + "tags": [], + "label": "forAccessor", + "description": [], + "source": { + "path": "x-pack/plugins/lens/public/xy_visualization/types.ts", + "lineNumber": 419 + }, + "deprecated": false + }, + { + "parentPluginId": "lens", + "id": "def-public.YConfig.axisMode", + "type": "CompoundType", + "tags": [], + "label": "axisMode", + "description": [], + "signature": [ + "\"left\" | \"right\" | \"auto\" | undefined" + ], + "source": { + "path": "x-pack/plugins/lens/public/xy_visualization/types.ts", + "lineNumber": 420 + }, + "deprecated": false + }, + { + "parentPluginId": "lens", + "id": "def-public.YConfig.color", + "type": "string", + "tags": [], + "label": "color", + "description": [], + "signature": [ + "string | undefined" + ], + "source": { + "path": "x-pack/plugins/lens/public/xy_visualization/types.ts", + "lineNumber": 421 }, "deprecated": false } @@ -1676,7 +1759,7 @@ ], "source": { "path": "x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/metrics.tsx", - "lineNumber": 132 + "lineNumber": 139 }, "deprecated": false, "initialIsOpen": false @@ -1742,7 +1825,7 @@ ], "source": { "path": "x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/calculations/cumulative_sum.tsx", - "lineNumber": 33 + "lineNumber": 34 }, "deprecated": false, "initialIsOpen": false @@ -1759,7 +1842,7 @@ ], "source": { "path": "x-pack/plugins/lens/public/types.ts", - "lineNumber": 352 + "lineNumber": 351 }, "deprecated": false, "initialIsOpen": false @@ -1875,7 +1958,7 @@ ], "source": { "path": "x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/index.ts", - "lineNumber": 79 + "lineNumber": 80 }, "deprecated": false, "initialIsOpen": false @@ -1992,7 +2075,7 @@ ], "source": { "path": "x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/index.ts", - "lineNumber": 58 + "lineNumber": 59 }, "deprecated": false, "initialIsOpen": false @@ -2018,7 +2101,7 @@ ], "source": { "path": "x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/metrics.tsx", - "lineNumber": 134 + "lineNumber": 141 }, "deprecated": false, "initialIsOpen": false @@ -2044,7 +2127,7 @@ ], "source": { "path": "x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/metrics.tsx", - "lineNumber": 135 + "lineNumber": 142 }, "deprecated": false, "initialIsOpen": false @@ -2070,7 +2153,7 @@ ], "source": { "path": "x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/metrics.tsx", - "lineNumber": 133 + "lineNumber": 140 }, "deprecated": false, "initialIsOpen": false @@ -2090,7 +2173,7 @@ ], "source": { "path": "x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/calculations/moving_average.tsx", - "lineNumber": 47 + "lineNumber": 43 }, "deprecated": false, "initialIsOpen": false @@ -2109,7 +2192,7 @@ ], "source": { "path": "x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/index.ts", - "lineNumber": 498 + "lineNumber": 533 }, "deprecated": false, "initialIsOpen": false @@ -2209,7 +2292,7 @@ ], "source": { "path": "x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/metrics.tsx", - "lineNumber": 131 + "lineNumber": 138 }, "deprecated": false, "initialIsOpen": false @@ -2296,7 +2379,7 @@ ], "source": { "path": "x-pack/plugins/lens/public/xy_visualization/types.ts", - "lineNumber": 471 + "lineNumber": 472 }, "deprecated": false, "initialIsOpen": false @@ -2350,7 +2433,7 @@ ], "source": { "path": "x-pack/plugins/lens/server/plugin.tsx", - "lineNumber": 31 + "lineNumber": 34 }, "deprecated": false, "children": [ @@ -2366,7 +2449,7 @@ ], "source": { "path": "x-pack/plugins/lens/server/plugin.tsx", - "lineNumber": 35 + "lineNumber": 38 }, "deprecated": false, "children": [ @@ -2389,7 +2472,7 @@ ], "source": { "path": "x-pack/plugins/lens/server/plugin.tsx", - "lineNumber": 35 + "lineNumber": 38 }, "deprecated": false, "isRequired": true @@ -2433,7 +2516,7 @@ ], "source": { "path": "x-pack/plugins/lens/server/plugin.tsx", - "lineNumber": 39 + "lineNumber": 42 }, "deprecated": false, "children": [ @@ -2464,7 +2547,7 @@ ], "source": { "path": "x-pack/plugins/lens/server/plugin.tsx", - "lineNumber": 39 + "lineNumber": 42 }, "deprecated": false, "isRequired": true @@ -2487,7 +2570,7 @@ ], "source": { "path": "x-pack/plugins/lens/server/plugin.tsx", - "lineNumber": 39 + "lineNumber": 42 }, "deprecated": false, "isRequired": true @@ -2523,7 +2606,7 @@ ], "source": { "path": "x-pack/plugins/lens/server/plugin.tsx", - "lineNumber": 59 + "lineNumber": 63 }, "deprecated": false, "children": [ @@ -2545,7 +2628,7 @@ ], "source": { "path": "x-pack/plugins/lens/server/plugin.tsx", - "lineNumber": 59 + "lineNumber": 63 }, "deprecated": false, "isRequired": true @@ -2568,7 +2651,7 @@ ], "source": { "path": "x-pack/plugins/lens/server/plugin.tsx", - "lineNumber": 59 + "lineNumber": 63 }, "deprecated": false, "isRequired": true @@ -2588,7 +2671,7 @@ ], "source": { "path": "x-pack/plugins/lens/server/plugin.tsx", - "lineNumber": 66 + "lineNumber": 70 }, "deprecated": false, "children": [], @@ -2609,7 +2692,7 @@ "description": [], "source": { "path": "x-pack/plugins/lens/server/plugin.tsx", - "lineNumber": 21 + "lineNumber": 23 }, "deprecated": false, "children": [ @@ -2632,7 +2715,7 @@ ], "source": { "path": "x-pack/plugins/lens/server/plugin.tsx", - "lineNumber": 22 + "lineNumber": 24 }, "deprecated": false }, @@ -2655,7 +2738,29 @@ ], "source": { "path": "x-pack/plugins/lens/server/plugin.tsx", - "lineNumber": 23 + "lineNumber": 25 + }, + "deprecated": false + }, + { + "parentPluginId": "lens", + "id": "def-server.PluginSetupContract.embeddable", + "type": "Object", + "tags": [], + "label": "embeddable", + "description": [], + "signature": [ + { + "pluginId": "embeddable", + "scope": "server", + "docId": "kibEmbeddablePluginApi", + "section": "def-server.EmbeddableSetup", + "text": "EmbeddableSetup" + } + ], + "source": { + "path": "x-pack/plugins/lens/server/plugin.tsx", + "lineNumber": 26 }, "deprecated": false } @@ -2671,7 +2776,7 @@ "description": [], "source": { "path": "x-pack/plugins/lens/server/plugin.tsx", - "lineNumber": 26 + "lineNumber": 29 }, "deprecated": false, "children": [ @@ -2694,7 +2799,7 @@ ], "source": { "path": "x-pack/plugins/lens/server/plugin.tsx", - "lineNumber": 27 + "lineNumber": 30 }, "deprecated": false }, @@ -2716,7 +2821,7 @@ ], "source": { "path": "x-pack/plugins/lens/server/plugin.tsx", - "lineNumber": 28 + "lineNumber": 31 }, "deprecated": false } diff --git a/api_docs/licensing.json b/api_docs/licensing.json index 1451cff869f47a..11832f60ee4124 100644 --- a/api_docs/licensing.json +++ b/api_docs/licensing.json @@ -45,7 +45,7 @@ "\nThe validity status of the license." ], "signature": [ - "\"active\" | \"invalid\" | \"expired\" | undefined" + "\"invalid\" | \"active\" | \"expired\" | undefined" ], "source": { "path": "x-pack/plugins/licensing/common/types.ts", @@ -492,7 +492,7 @@ "\nThe validity status of the license." ], "signature": [ - "\"active\" | \"invalid\" | \"expired\"" + "\"invalid\" | \"active\" | \"expired\"" ], "source": { "path": "x-pack/plugins/licensing/common/types.ts", @@ -856,7 +856,7 @@ "label": "LicenseStatus", "description": [], "signature": [ - "\"active\" | \"invalid\" | \"expired\"" + "\"invalid\" | \"active\" | \"expired\"" ], "source": { "path": "x-pack/plugins/licensing/common/types.ts", @@ -1001,7 +1001,7 @@ "plugin": "ml", "link": { "path": "x-pack/plugins/ml/public/plugin.ts", - "lineNumber": 136 + "lineNumber": 141 } }, { @@ -1022,7 +1022,7 @@ "plugin": "fleet", "link": { "path": "x-pack/plugins/fleet/public/plugin.ts", - "lineNumber": 97 + "lineNumber": 94 } }, { @@ -2078,7 +2078,7 @@ "\nThe validity status of the license." ], "signature": [ - "\"active\" | \"invalid\" | \"expired\" | undefined" + "\"invalid\" | \"active\" | \"expired\" | undefined" ], "source": { "path": "x-pack/plugins/licensing/common/types.ts", @@ -2581,7 +2581,7 @@ "\nThe validity status of the license." ], "signature": [ - "\"active\" | \"invalid\" | \"expired\"" + "\"invalid\" | \"active\" | \"expired\"" ], "source": { "path": "x-pack/plugins/licensing/common/types.ts", @@ -2964,7 +2964,7 @@ "label": "LicenseStatus", "description": [], "signature": [ - "\"active\" | \"invalid\" | \"expired\"" + "\"invalid\" | \"active\" | \"expired\"" ], "source": { "path": "x-pack/plugins/licensing/common/types.ts", @@ -3119,13 +3119,6 @@ "lineNumber": 139 } }, - { - "plugin": "indexManagement", - "link": { - "path": "x-pack/plugins/index_management/server/services/license.ts", - "lineNumber": 36 - } - }, { "plugin": "remoteClusters", "link": { @@ -3137,7 +3130,7 @@ "plugin": "fleet", "link": { "path": "x-pack/plugins/fleet/server/plugin.ts", - "lineNumber": 213 + "lineNumber": 214 } }, { @@ -3154,18 +3147,11 @@ "lineNumber": 41 } }, - { - "plugin": "ingestPipelines", - "link": { - "path": "x-pack/plugins/ingest_pipelines/server/services/license.ts", - "lineNumber": 40 - } - }, { "plugin": "maps", "link": { "path": "x-pack/plugins/maps/server/plugin.ts", - "lineNumber": 164 + "lineNumber": 167 } }, { diff --git a/api_docs/lists.json b/api_docs/lists.json index 90f5cd726287b9..71974dd9fe2051 100644 --- a/api_docs/lists.json +++ b/api_docs/lists.json @@ -341,7 +341,7 @@ "description": [], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 56 + "lineNumber": 59 }, "deprecated": false, "children": [ @@ -357,7 +357,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 61 + "lineNumber": 64 }, "deprecated": false, "children": [ @@ -373,7 +373,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 61 + "lineNumber": 64 }, "deprecated": false, "isRequired": true @@ -395,7 +395,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 66 + "lineNumber": 69 }, "deprecated": false, "children": [ @@ -411,7 +411,45 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 66 + "lineNumber": 69 + }, + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "lists", + "id": "def-server.ExceptionListClient.getExceptionListSummary", + "type": "Function", + "tags": [], + "label": "getExceptionListSummary", + "description": [], + "signature": [ + "({ listId, id, namespaceType, }: ", + "GetExceptionListSummaryOptions", + ") => Promise<{ windows: number; linux: number; macos: number; total: number; } | null>" + ], + "source": { + "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", + "lineNumber": 78 + }, + "deprecated": false, + "children": [ + { + "parentPluginId": "lists", + "id": "def-server.ExceptionListClient.getExceptionListSummary.$1", + "type": "Object", + "tags": [], + "label": "{\n listId,\n id,\n namespaceType,\n }", + "description": [], + "signature": [ + "GetExceptionListSummaryOptions" + ], + "source": { + "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", + "lineNumber": 78 }, "deprecated": false, "isRequired": true @@ -429,11 +467,11 @@ "signature": [ "({ itemId, id, namespaceType, }: ", "GetExceptionListItemOptions", - ") => Promise<{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; } | null>" + ") => Promise<{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"text\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; } | null>" ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 75 + "lineNumber": 87 }, "deprecated": false, "children": [ @@ -449,7 +487,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 75 + "lineNumber": 87 }, "deprecated": false, "isRequired": true @@ -471,7 +509,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 90 + "lineNumber": 102 }, "deprecated": false, "children": [], @@ -493,7 +531,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 102 + "lineNumber": 114 }, "deprecated": false, "children": [], @@ -513,7 +551,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 114 + "lineNumber": 126 }, "deprecated": false, "children": [], @@ -531,11 +569,11 @@ "signature": [ "({ comments, description, entries, itemId, meta, name, osTypes, tags, type, }: ", "CreateEndpointListItemOptions", - ") => Promise<{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }>" + ") => Promise<{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"text\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }>" ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 128 + "lineNumber": 140 }, "deprecated": false, "children": [ @@ -551,7 +589,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 128 + "lineNumber": 140 }, "deprecated": false, "isRequired": true @@ -571,11 +609,11 @@ "signature": [ "({ _version, comments, description, entries, id, itemId, meta, name, osTypes, tags, type, }: ", "UpdateEndpointListItemOptions", - ") => Promise<{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; } | null>" + ") => Promise<{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"text\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; } | null>" ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 164 + "lineNumber": 176 }, "deprecated": false, "children": [ @@ -591,7 +629,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 164 + "lineNumber": 176 }, "deprecated": false, "isRequired": true @@ -611,11 +649,11 @@ "signature": [ "({ itemId, id, }: ", "GetEndpointListItemOptions", - ") => Promise<{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; } | null>" + ") => Promise<{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"text\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; } | null>" ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 200 + "lineNumber": 212 }, "deprecated": false, "children": [ @@ -631,7 +669,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 200 + "lineNumber": 212 }, "deprecated": false, "isRequired": true @@ -653,7 +691,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 208 + "lineNumber": 220 }, "deprecated": false, "children": [ @@ -669,7 +707,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 208 + "lineNumber": 220 }, "deprecated": false, "isRequired": true @@ -691,7 +729,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 235 + "lineNumber": 247 }, "deprecated": false, "children": [ @@ -707,7 +745,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 235 + "lineNumber": 247 }, "deprecated": false, "isRequired": true @@ -729,7 +767,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 266 + "lineNumber": 278 }, "deprecated": false, "children": [ @@ -745,7 +783,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 266 + "lineNumber": 278 }, "deprecated": false, "isRequired": true @@ -769,11 +807,11 @@ "section": "def-server.CreateExceptionListItemOptions", "text": "CreateExceptionListItemOptions" }, - ") => Promise<{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }>" + ") => Promise<{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"text\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }>" ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 280 + "lineNumber": 292 }, "deprecated": false, "children": [ @@ -795,7 +833,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 280 + "lineNumber": 292 }, "deprecated": false, "isRequired": true @@ -819,11 +857,11 @@ "section": "def-server.UpdateExceptionListItemOptions", "text": "UpdateExceptionListItemOptions" }, - ") => Promise<{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; } | null>" + ") => Promise<{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"text\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; } | null>" ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 311 + "lineNumber": 323 }, "deprecated": false, "children": [ @@ -845,7 +883,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 311 + "lineNumber": 323 }, "deprecated": false, "isRequired": true @@ -863,11 +901,11 @@ "signature": [ "({ id, itemId, namespaceType, }: ", "DeleteExceptionListItemOptions", - ") => Promise<{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; } | null>" + ") => Promise<{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"text\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; } | null>" ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 344 + "lineNumber": 356 }, "deprecated": false, "children": [ @@ -883,7 +921,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 344 + "lineNumber": 356 }, "deprecated": false, "isRequired": true @@ -905,7 +943,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 358 + "lineNumber": 370 }, "deprecated": false, "children": [ @@ -921,7 +959,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 358 + "lineNumber": 370 }, "deprecated": false, "isRequired": true @@ -941,11 +979,11 @@ "signature": [ "({ id, itemId, }: ", "DeleteEndpointListItemOptions", - ") => Promise<{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; } | null>" + ") => Promise<{ _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"text\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; } | null>" ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 373 + "lineNumber": 385 }, "deprecated": false, "children": [ @@ -961,7 +999,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 373 + "lineNumber": 385 }, "deprecated": false, "isRequired": true @@ -979,11 +1017,11 @@ "signature": [ "({ listId, filter, perPage, page, sortField, sortOrder, namespaceType, }: ", "FindExceptionListItemOptions", - ") => Promise<{ data: { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }[]; page: number; per_page: number; total: number; } | null>" + ") => Promise<{ data: { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"text\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }[]; page: number; per_page: number; total: number; } | null>" ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 386 + "lineNumber": 398 }, "deprecated": false, "children": [ @@ -999,7 +1037,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 386 + "lineNumber": 398 }, "deprecated": false, "isRequired": true @@ -1017,11 +1055,11 @@ "signature": [ "({ listId, filter, perPage, page, sortField, sortOrder, namespaceType, }: ", "FindExceptionListsItemOptions", - ") => Promise<{ data: { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }[]; page: number; per_page: number; total: number; } | null>" + ") => Promise<{ data: { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"text\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }[]; page: number; per_page: number; total: number; } | null>" ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 408 + "lineNumber": 420 }, "deprecated": false, "children": [ @@ -1037,7 +1075,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 408 + "lineNumber": 420 }, "deprecated": false, "isRequired": true @@ -1055,11 +1093,11 @@ "signature": [ "({ perPage, page, sortField, sortOrder, valueListId, }: ", "FindValueListExceptionListsItems", - ") => Promise<{ data: { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }[]; page: number; per_page: number; total: number; } | null>" + ") => Promise<{ data: { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"text\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }[]; page: number; per_page: number; total: number; } | null>" ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 430 + "lineNumber": 442 }, "deprecated": false, "children": [ @@ -1075,7 +1113,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 430 + "lineNumber": 442 }, "deprecated": false, "isRequired": true @@ -1097,7 +1135,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 448 + "lineNumber": 460 }, "deprecated": false, "children": [ @@ -1113,7 +1151,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 448 + "lineNumber": 460 }, "deprecated": false, "isRequired": true @@ -1133,11 +1171,11 @@ "signature": [ "({ filter, perPage, page, sortField, sortOrder, }: ", "FindEndpointListItemOptions", - ") => Promise<{ data: { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }[]; page: number; per_page: number; total: number; } | null>" + ") => Promise<{ data: { _version: string | undefined; comments: ({ comment: string; created_at: string; created_by: string; id: string; } & { updated_at?: string | undefined; updated_by?: string | undefined; })[]; created_at: string; created_by: string; description: string; entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"text\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]; id: string; item_id: string; list_id: string; meta: object | undefined; name: string; namespace_type: \"single\" | \"agnostic\"; os_types: (\"windows\" | \"linux\" | \"macos\")[]; tags: string[]; tie_breaker_id: string; type: \"simple\"; updated_at: string; updated_by: string; }[]; page: number; per_page: number; total: number; } | null>" ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 476 + "lineNumber": 488 }, "deprecated": false, "children": [ @@ -1153,7 +1191,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", - "lineNumber": 476 + "lineNumber": 488 }, "deprecated": false, "isRequired": true @@ -1259,7 +1297,7 @@ "signature": [ "({ id }: ", "GetListOptions", - ") => Promise<{ _version: string | undefined; created_at: string; created_by: string; description: string; deserializer: string | undefined; id: string; immutable: boolean; meta: object | undefined; name: string; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\"; updated_at: string; updated_by: string; version: number; } | null>" + ") => Promise<{ _version: string | undefined; created_at: string; created_by: string; description: string; deserializer: string | undefined; id: string; immutable: boolean; meta: object | undefined; name: string; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"text\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\"; updated_at: string; updated_by: string; version: number; } | null>" ], "source": { "path": "x-pack/plugins/lists/server/services/lists/list_client.ts", @@ -1297,7 +1335,7 @@ "signature": [ "({ id, deserializer, immutable, serializer, name, description, type, meta, version, }: ", "CreateListOptions", - ") => Promise<{ _version: string | undefined; created_at: string; created_by: string; description: string; deserializer: string | undefined; id: string; immutable: boolean; meta: object | undefined; name: string; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\"; updated_at: string; updated_by: string; version: number; }>" + ") => Promise<{ _version: string | undefined; created_at: string; created_by: string; description: string; deserializer: string | undefined; id: string; immutable: boolean; meta: object | undefined; name: string; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"text\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\"; updated_at: string; updated_by: string; version: number; }>" ], "source": { "path": "x-pack/plugins/lists/server/services/lists/list_client.ts", @@ -1335,7 +1373,7 @@ "signature": [ "({ id, deserializer, serializer, name, description, immutable, type, meta, version, }: ", "CreateListIfItDoesNotExistOptions", - ") => Promise<{ _version: string | undefined; created_at: string; created_by: string; description: string; deserializer: string | undefined; id: string; immutable: boolean; meta: object | undefined; name: string; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\"; updated_at: string; updated_by: string; version: number; }>" + ") => Promise<{ _version: string | undefined; created_at: string; created_by: string; description: string; deserializer: string | undefined; id: string; immutable: boolean; meta: object | undefined; name: string; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"text\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\"; updated_at: string; updated_by: string; version: number; }>" ], "source": { "path": "x-pack/plugins/lists/server/services/lists/list_client.ts", @@ -1733,7 +1771,7 @@ "signature": [ "({ id }: ", "DeleteListItemOptions", - ") => Promise<{ _version: string | undefined; created_at: string; created_by: string; deserializer: string | undefined; id: string; list_id: string; meta: object | undefined; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\"; updated_at: string; updated_by: string; value: string; } | null>" + ") => Promise<{ _version: string | undefined; created_at: string; created_by: string; deserializer: string | undefined; id: string; list_id: string; meta: object | undefined; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"text\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\"; updated_at: string; updated_by: string; value: string; } | null>" ], "source": { "path": "x-pack/plugins/lists/server/services/lists/list_client.ts", @@ -1771,7 +1809,7 @@ "signature": [ "({ listId, value, type, }: ", "DeleteListItemByValueOptions", - ") => Promise<{ _version: string | undefined; created_at: string; created_by: string; deserializer: string | undefined; id: string; list_id: string; meta: object | undefined; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\"; updated_at: string; updated_by: string; value: string; }[]>" + ") => Promise<{ _version: string | undefined; created_at: string; created_by: string; deserializer: string | undefined; id: string; list_id: string; meta: object | undefined; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"text\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\"; updated_at: string; updated_by: string; value: string; }[]>" ], "source": { "path": "x-pack/plugins/lists/server/services/lists/list_client.ts", @@ -1809,7 +1847,7 @@ "signature": [ "({ id }: ", "DeleteListOptions", - ") => Promise<{ _version: string | undefined; created_at: string; created_by: string; description: string; deserializer: string | undefined; id: string; immutable: boolean; meta: object | undefined; name: string; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\"; updated_at: string; updated_by: string; version: number; } | null>" + ") => Promise<{ _version: string | undefined; created_at: string; created_by: string; description: string; deserializer: string | undefined; id: string; immutable: boolean; meta: object | undefined; name: string; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"text\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\"; updated_at: string; updated_by: string; version: number; } | null>" ], "source": { "path": "x-pack/plugins/lists/server/services/lists/list_client.ts", @@ -1885,7 +1923,7 @@ "signature": [ "({ deserializer, serializer, type, listId, stream, meta, version, }: ", "ImportListItemsToStreamOptions", - ") => Promise<{ _version: string | undefined; created_at: string; created_by: string; description: string; deserializer: string | undefined; id: string; immutable: boolean; meta: object | undefined; name: string; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\"; updated_at: string; updated_by: string; version: number; } | null>" + ") => Promise<{ _version: string | undefined; created_at: string; created_by: string; description: string; deserializer: string | undefined; id: string; immutable: boolean; meta: object | undefined; name: string; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"text\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\"; updated_at: string; updated_by: string; version: number; } | null>" ], "source": { "path": "x-pack/plugins/lists/server/services/lists/list_client.ts", @@ -1923,7 +1961,7 @@ "signature": [ "({ listId, value, type, }: ", "GetListItemByValueOptions", - ") => Promise<{ _version: string | undefined; created_at: string; created_by: string; deserializer: string | undefined; id: string; list_id: string; meta: object | undefined; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\"; updated_at: string; updated_by: string; value: string; }[]>" + ") => Promise<{ _version: string | undefined; created_at: string; created_by: string; deserializer: string | undefined; id: string; list_id: string; meta: object | undefined; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"text\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\"; updated_at: string; updated_by: string; value: string; }[]>" ], "source": { "path": "x-pack/plugins/lists/server/services/lists/list_client.ts", @@ -1961,7 +1999,7 @@ "signature": [ "({ id, deserializer, serializer, listId, value, type, meta, }: ", "CreateListItemOptions", - ") => Promise<{ _version: string | undefined; created_at: string; created_by: string; deserializer: string | undefined; id: string; list_id: string; meta: object | undefined; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\"; updated_at: string; updated_by: string; value: string; } | null>" + ") => Promise<{ _version: string | undefined; created_at: string; created_by: string; deserializer: string | undefined; id: string; list_id: string; meta: object | undefined; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"text\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\"; updated_at: string; updated_by: string; value: string; } | null>" ], "source": { "path": "x-pack/plugins/lists/server/services/lists/list_client.ts", @@ -1999,7 +2037,7 @@ "signature": [ "({ _version, id, value, meta, }: ", "UpdateListItemOptions", - ") => Promise<{ _version: string | undefined; created_at: string; created_by: string; deserializer: string | undefined; id: string; list_id: string; meta: object | undefined; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\"; updated_at: string; updated_by: string; value: string; } | null>" + ") => Promise<{ _version: string | undefined; created_at: string; created_by: string; deserializer: string | undefined; id: string; list_id: string; meta: object | undefined; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"text\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\"; updated_at: string; updated_by: string; value: string; } | null>" ], "source": { "path": "x-pack/plugins/lists/server/services/lists/list_client.ts", @@ -2037,7 +2075,7 @@ "signature": [ "({ _version, id, name, description, meta, version, }: ", "UpdateListOptions", - ") => Promise<{ _version: string | undefined; created_at: string; created_by: string; description: string; deserializer: string | undefined; id: string; immutable: boolean; meta: object | undefined; name: string; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\"; updated_at: string; updated_by: string; version: number; } | null>" + ") => Promise<{ _version: string | undefined; created_at: string; created_by: string; description: string; deserializer: string | undefined; id: string; immutable: boolean; meta: object | undefined; name: string; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"text\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\"; updated_at: string; updated_by: string; version: number; } | null>" ], "source": { "path": "x-pack/plugins/lists/server/services/lists/list_client.ts", @@ -2075,7 +2113,7 @@ "signature": [ "({ id }: ", "GetListItemOptions", - ") => Promise<{ _version: string | undefined; created_at: string; created_by: string; deserializer: string | undefined; id: string; list_id: string; meta: object | undefined; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\"; updated_at: string; updated_by: string; value: string; } | null>" + ") => Promise<{ _version: string | undefined; created_at: string; created_by: string; deserializer: string | undefined; id: string; list_id: string; meta: object | undefined; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"text\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\"; updated_at: string; updated_by: string; value: string; } | null>" ], "source": { "path": "x-pack/plugins/lists/server/services/lists/list_client.ts", @@ -2113,7 +2151,7 @@ "signature": [ "({ type, listId, value, }: ", "GetListItemsByValueOptions", - ") => Promise<{ _version: string | undefined; created_at: string; created_by: string; deserializer: string | undefined; id: string; list_id: string; meta: object | undefined; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\"; updated_at: string; updated_by: string; value: string; }[]>" + ") => Promise<{ _version: string | undefined; created_at: string; created_by: string; deserializer: string | undefined; id: string; list_id: string; meta: object | undefined; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"text\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\"; updated_at: string; updated_by: string; value: string; }[]>" ], "source": { "path": "x-pack/plugins/lists/server/services/lists/list_client.ts", @@ -2151,7 +2189,7 @@ "signature": [ "({ type, listId, value, }: ", "SearchListItemByValuesOptions", - ") => Promise<{ items: { _version: string | undefined; created_at: string; created_by: string; deserializer: string | undefined; id: string; list_id: string; meta: object | undefined; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\"; updated_at: string; updated_by: string; value: string; }[]; value: unknown; }[]>" + ") => Promise<{ items: { _version: string | undefined; created_at: string; created_by: string; deserializer: string | undefined; id: string; list_id: string; meta: object | undefined; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"text\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\"; updated_at: string; updated_by: string; value: string; }[]; value: unknown; }[]>" ], "source": { "path": "x-pack/plugins/lists/server/services/lists/list_client.ts", @@ -2189,7 +2227,7 @@ "signature": [ "({ filter, currentIndexPosition, perPage, page, sortField, sortOrder, searchAfter, }: ", "FindListOptions", - ") => Promise<{ cursor: string; data: { _version: string | undefined; created_at: string; created_by: string; description: string; deserializer: string | undefined; id: string; immutable: boolean; meta: object | undefined; name: string; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\"; updated_at: string; updated_by: string; version: number; }[]; page: number; per_page: number; total: number; }>" + ") => Promise<{ cursor: string; data: { _version: string | undefined; created_at: string; created_by: string; description: string; deserializer: string | undefined; id: string; immutable: boolean; meta: object | undefined; name: string; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"text\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\"; updated_at: string; updated_by: string; version: number; }[]; page: number; per_page: number; total: number; }>" ], "source": { "path": "x-pack/plugins/lists/server/services/lists/list_client.ts", @@ -2227,7 +2265,7 @@ "signature": [ "({ listId, filter, currentIndexPosition, perPage, page, sortField, sortOrder, searchAfter, }: ", "FindListItemOptions", - ") => Promise<{ cursor: string; data: { _version: string | undefined; created_at: string; created_by: string; deserializer: string | undefined; id: string; list_id: string; meta: object | undefined; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\"; updated_at: string; updated_by: string; value: string; }[]; page: number; per_page: number; total: number; } | null>" + ") => Promise<{ cursor: string; data: { _version: string | undefined; created_at: string; created_by: string; deserializer: string | undefined; id: string; list_id: string; meta: object | undefined; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"text\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\"; updated_at: string; updated_by: string; value: string; }[]; page: number; per_page: number; total: number; } | null>" ], "source": { "path": "x-pack/plugins/lists/server/services/lists/list_client.ts", @@ -2270,7 +2308,7 @@ "description": [], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client_types.ts", - "lineNumber": 118 + "lineNumber": 124 }, "deprecated": false, "children": [ @@ -2286,7 +2324,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client_types.ts", - "lineNumber": 119 + "lineNumber": 125 }, "deprecated": false }, @@ -2298,11 +2336,11 @@ "label": "entries", "description": [], "signature": [ - "({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]" + "({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"text\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]" ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client_types.ts", - "lineNumber": 120 + "lineNumber": 126 }, "deprecated": false }, @@ -2315,7 +2353,7 @@ "description": [], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client_types.ts", - "lineNumber": 121 + "lineNumber": 127 }, "deprecated": false }, @@ -2328,7 +2366,7 @@ "description": [], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client_types.ts", - "lineNumber": 122 + "lineNumber": 128 }, "deprecated": false }, @@ -2344,7 +2382,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client_types.ts", - "lineNumber": 123 + "lineNumber": 129 }, "deprecated": false }, @@ -2357,7 +2395,7 @@ "description": [], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client_types.ts", - "lineNumber": 124 + "lineNumber": 130 }, "deprecated": false }, @@ -2373,7 +2411,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client_types.ts", - "lineNumber": 125 + "lineNumber": 131 }, "deprecated": false }, @@ -2386,7 +2424,7 @@ "description": [], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client_types.ts", - "lineNumber": 126 + "lineNumber": 132 }, "deprecated": false }, @@ -2402,7 +2440,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client_types.ts", - "lineNumber": 127 + "lineNumber": 133 }, "deprecated": false }, @@ -2418,7 +2456,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client_types.ts", - "lineNumber": 128 + "lineNumber": 134 }, "deprecated": false }, @@ -2434,7 +2472,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client_types.ts", - "lineNumber": 129 + "lineNumber": 135 }, "deprecated": false } @@ -2981,7 +3019,7 @@ "description": [], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client_types.ts", - "lineNumber": 144 + "lineNumber": 150 }, "deprecated": false, "children": [ @@ -2997,7 +3035,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client_types.ts", - "lineNumber": 145 + "lineNumber": 151 }, "deprecated": false }, @@ -3013,7 +3051,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client_types.ts", - "lineNumber": 146 + "lineNumber": 152 }, "deprecated": false }, @@ -3025,11 +3063,11 @@ "label": "entries", "description": [], "signature": [ - "({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"text\" | \"keyword\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]" + "({ field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; } | { field: string; list: { id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"text\" | \"long\" | \"double\" | \"ip\" | \"date_nanos\" | \"geo_point\" | \"geo_shape\" | \"binary\" | \"short\" | \"date_range\" | \"ip_range\" | \"shape\" | \"integer\" | \"byte\" | \"float\" | \"half_float\" | \"integer_range\" | \"float_range\" | \"long_range\" | \"double_range\"; }; operator: \"excluded\" | \"included\"; type: \"list\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { entries: ({ field: string; operator: \"excluded\" | \"included\"; type: \"exists\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match\"; value: string; } | { field: string; operator: \"excluded\" | \"included\"; type: \"match_any\"; value: string[]; })[]; field: string; type: \"nested\"; } | { field: string; operator: \"excluded\" | \"included\"; type: \"wildcard\"; value: string; })[]" ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client_types.ts", - "lineNumber": 147 + "lineNumber": 153 }, "deprecated": false }, @@ -3045,7 +3083,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client_types.ts", - "lineNumber": 148 + "lineNumber": 154 }, "deprecated": false }, @@ -3061,7 +3099,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client_types.ts", - "lineNumber": 149 + "lineNumber": 155 }, "deprecated": false }, @@ -3077,7 +3115,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client_types.ts", - "lineNumber": 150 + "lineNumber": 156 }, "deprecated": false }, @@ -3093,7 +3131,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client_types.ts", - "lineNumber": 151 + "lineNumber": 157 }, "deprecated": false }, @@ -3109,7 +3147,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client_types.ts", - "lineNumber": 152 + "lineNumber": 158 }, "deprecated": false }, @@ -3125,7 +3163,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client_types.ts", - "lineNumber": 153 + "lineNumber": 159 }, "deprecated": false }, @@ -3141,7 +3179,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client_types.ts", - "lineNumber": 154 + "lineNumber": 160 }, "deprecated": false }, @@ -3157,7 +3195,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client_types.ts", - "lineNumber": 155 + "lineNumber": 161 }, "deprecated": false }, @@ -3173,7 +3211,7 @@ ], "source": { "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client_types.ts", - "lineNumber": 156 + "lineNumber": 162 }, "deprecated": false } diff --git a/api_docs/maps.json b/api_docs/maps.json index d418518dcb0d2c..9c1c7243a41bc5 100644 --- a/api_docs/maps.json +++ b/api_docs/maps.json @@ -57,7 +57,7 @@ ], "source": { "path": "x-pack/plugins/maps/public/embeddable/map_embeddable.tsx", - "lineNumber": 95 + "lineNumber": 93 }, "deprecated": false, "children": [ @@ -70,7 +70,7 @@ "description": [], "source": { "path": "x-pack/plugins/maps/public/embeddable/map_embeddable.tsx", - "lineNumber": 98 + "lineNumber": 96 }, "deprecated": false }, @@ -86,7 +86,7 @@ ], "source": { "path": "x-pack/plugins/maps/public/embeddable/map_embeddable.tsx", - "lineNumber": 118 + "lineNumber": 115 }, "deprecated": false, "children": [ @@ -102,7 +102,7 @@ ], "source": { "path": "x-pack/plugins/maps/public/embeddable/map_embeddable.tsx", - "lineNumber": 118 + "lineNumber": 115 }, "deprecated": false, "isRequired": true @@ -125,7 +125,7 @@ ], "source": { "path": "x-pack/plugins/maps/public/embeddable/map_embeddable.tsx", - "lineNumber": 118 + "lineNumber": 115 }, "deprecated": false, "isRequired": true @@ -165,7 +165,7 @@ ], "source": { "path": "x-pack/plugins/maps/public/embeddable/map_embeddable.tsx", - "lineNumber": 118 + "lineNumber": 115 }, "deprecated": false, "isRequired": false @@ -194,7 +194,7 @@ ], "source": { "path": "x-pack/plugins/maps/public/embeddable/map_embeddable.tsx", - "lineNumber": 200 + "lineNumber": 194 }, "deprecated": false, "children": [ @@ -216,7 +216,7 @@ ], "source": { "path": "x-pack/plugins/maps/public/embeddable/map_embeddable.tsx", - "lineNumber": 201 + "lineNumber": 195 }, "deprecated": false, "isRequired": true @@ -238,7 +238,7 @@ ], "source": { "path": "x-pack/plugins/maps/public/embeddable/map_embeddable.tsx", - "lineNumber": 206 + "lineNumber": 200 }, "deprecated": false, "children": [], @@ -258,7 +258,7 @@ ], "source": { "path": "x-pack/plugins/maps/public/embeddable/map_embeddable.tsx", - "lineNumber": 214 + "lineNumber": 208 }, "deprecated": false, "children": [], @@ -276,7 +276,7 @@ ], "source": { "path": "x-pack/plugins/maps/public/embeddable/map_embeddable.tsx", - "lineNumber": 219 + "lineNumber": 213 }, "deprecated": false, "children": [], @@ -294,7 +294,7 @@ ], "source": { "path": "x-pack/plugins/maps/public/embeddable/map_embeddable.tsx", - "lineNumber": 223 + "lineNumber": 217 }, "deprecated": false, "children": [], @@ -314,7 +314,7 @@ ], "source": { "path": "x-pack/plugins/maps/public/embeddable/map_embeddable.tsx", - "lineNumber": 227 + "lineNumber": 221 }, "deprecated": false, "children": [ @@ -330,7 +330,7 @@ ], "source": { "path": "x-pack/plugins/maps/public/embeddable/map_embeddable.tsx", - "lineNumber": 227 + "lineNumber": 221 }, "deprecated": false, "isRequired": true @@ -352,7 +352,7 @@ ], "source": { "path": "x-pack/plugins/maps/public/embeddable/map_embeddable.tsx", - "lineNumber": 231 + "lineNumber": 225 }, "deprecated": false, "children": [ @@ -368,7 +368,7 @@ ], "source": { "path": "x-pack/plugins/maps/public/embeddable/map_embeddable.tsx", - "lineNumber": 231 + "lineNumber": 225 }, "deprecated": false, "isRequired": true @@ -395,7 +395,7 @@ ], "source": { "path": "x-pack/plugins/maps/public/embeddable/map_embeddable.tsx", - "lineNumber": 235 + "lineNumber": 229 }, "deprecated": false, "children": [], @@ -413,7 +413,7 @@ ], "source": { "path": "x-pack/plugins/maps/public/embeddable/map_embeddable.tsx", - "lineNumber": 239 + "lineNumber": 233 }, "deprecated": false, "children": [], @@ -439,7 +439,7 @@ ], "source": { "path": "x-pack/plugins/maps/public/embeddable/map_embeddable.tsx", - "lineNumber": 283 + "lineNumber": 273 }, "deprecated": false, "children": [], @@ -457,7 +457,7 @@ ], "source": { "path": "x-pack/plugins/maps/public/embeddable/map_embeddable.tsx", - "lineNumber": 291 + "lineNumber": 281 }, "deprecated": false, "children": [], @@ -475,7 +475,7 @@ ], "source": { "path": "x-pack/plugins/maps/public/embeddable/map_embeddable.tsx", - "lineNumber": 301 + "lineNumber": 291 }, "deprecated": false, "children": [ @@ -488,7 +488,7 @@ "description": [], "source": { "path": "x-pack/plugins/maps/public/embeddable/map_embeddable.tsx", - "lineNumber": 301 + "lineNumber": 291 }, "deprecated": false, "children": [ @@ -501,7 +501,7 @@ "description": [], "source": { "path": "x-pack/plugins/maps/public/embeddable/map_embeddable.tsx", - "lineNumber": 301 + "lineNumber": 291 }, "deprecated": false } @@ -510,56 +510,6 @@ ], "returnComment": [] }, - { - "parentPluginId": "maps", - "id": "def-public.MapEmbeddable._dispatchSetRefreshConfig", - "type": "Function", - "tags": [], - "label": "_dispatchSetRefreshConfig", - "description": [], - "signature": [ - "(refreshConfig: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataQueryPluginApi", - "section": "def-common.RefreshInterval", - "text": "RefreshInterval" - }, - ") => void" - ], - "source": { - "path": "x-pack/plugins/maps/public/embeddable/map_embeddable.tsx", - "lineNumber": 321 - }, - "deprecated": false, - "children": [ - { - "parentPluginId": "maps", - "id": "def-public.MapEmbeddable._dispatchSetRefreshConfig.$1", - "type": "Object", - "tags": [], - "label": "refreshConfig", - "description": [], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataQueryPluginApi", - "section": "def-common.RefreshInterval", - "text": "RefreshInterval" - } - ], - "source": { - "path": "x-pack/plugins/maps/public/embeddable/map_embeddable.tsx", - "lineNumber": 321 - }, - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] - }, { "parentPluginId": "maps", "id": "def-public.MapEmbeddable._dispatchSetChartsPaletteServiceGetColor", @@ -572,7 +522,7 @@ ], "source": { "path": "x-pack/plugins/maps/public/embeddable/map_embeddable.tsx", - "lineNumber": 331 + "lineNumber": 311 }, "deprecated": false, "children": [ @@ -588,7 +538,7 @@ ], "source": { "path": "x-pack/plugins/maps/public/embeddable/map_embeddable.tsx", - "lineNumber": 331 + "lineNumber": 311 }, "deprecated": false, "isRequired": false @@ -610,7 +560,7 @@ ], "source": { "path": "x-pack/plugins/maps/public/embeddable/map_embeddable.tsx", - "lineNumber": 349 + "lineNumber": 329 }, "deprecated": false, "children": [ @@ -626,7 +576,7 @@ ], "source": { "path": "x-pack/plugins/maps/public/embeddable/map_embeddable.tsx", - "lineNumber": 349 + "lineNumber": 329 }, "deprecated": false, "isRequired": true @@ -648,7 +598,7 @@ ], "source": { "path": "x-pack/plugins/maps/public/embeddable/map_embeddable.tsx", - "lineNumber": 375 + "lineNumber": 355 }, "deprecated": false, "children": [ @@ -665,7 +615,7 @@ ], "source": { "path": "x-pack/plugins/maps/public/embeddable/map_embeddable.tsx", - "lineNumber": 375 + "lineNumber": 355 }, "deprecated": false, "isRequired": true @@ -693,7 +643,7 @@ ], "source": { "path": "x-pack/plugins/maps/public/embeddable/map_embeddable.tsx", - "lineNumber": 392 + "lineNumber": 372 }, "deprecated": false, "children": [ @@ -709,7 +659,7 @@ ], "source": { "path": "x-pack/plugins/maps/public/embeddable/map_embeddable.tsx", - "lineNumber": 392 + "lineNumber": 372 }, "deprecated": false, "isRequired": true @@ -726,7 +676,7 @@ ], "source": { "path": "x-pack/plugins/maps/public/embeddable/map_embeddable.tsx", - "lineNumber": 392 + "lineNumber": 372 }, "deprecated": false, "isRequired": true @@ -749,7 +699,7 @@ ], "source": { "path": "x-pack/plugins/maps/public/embeddable/map_embeddable.tsx", - "lineNumber": 392 + "lineNumber": 372 }, "deprecated": false, "isRequired": false @@ -777,7 +727,7 @@ ], "source": { "path": "x-pack/plugins/maps/public/embeddable/map_embeddable.tsx", - "lineNumber": 406 + "lineNumber": 386 }, "deprecated": false, "children": [ @@ -800,7 +750,7 @@ ], "source": { "path": "x-pack/plugins/maps/public/embeddable/map_embeddable.tsx", - "lineNumber": 406 + "lineNumber": 386 }, "deprecated": false, "isRequired": true @@ -817,7 +767,7 @@ ], "source": { "path": "x-pack/plugins/maps/public/embeddable/map_embeddable.tsx", - "lineNumber": 406 + "lineNumber": 386 }, "deprecated": false, "isRequired": true @@ -845,7 +795,7 @@ ], "source": { "path": "x-pack/plugins/maps/public/embeddable/map_embeddable.tsx", - "lineNumber": 418 + "lineNumber": 398 }, "deprecated": false, "children": [], @@ -871,7 +821,7 @@ ], "source": { "path": "x-pack/plugins/maps/public/embeddable/map_embeddable.tsx", - "lineNumber": 439 + "lineNumber": 419 }, "deprecated": false, "children": [], @@ -889,7 +839,7 @@ ], "source": { "path": "x-pack/plugins/maps/public/embeddable/map_embeddable.tsx", - "lineNumber": 450 + "lineNumber": 430 }, "deprecated": false, "children": [], @@ -907,7 +857,7 @@ ], "source": { "path": "x-pack/plugins/maps/public/embeddable/map_embeddable.tsx", - "lineNumber": 487 + "lineNumber": 466 }, "deprecated": false, "children": [], @@ -925,7 +875,7 @@ ], "source": { "path": "x-pack/plugins/maps/public/embeddable/map_embeddable.tsx", - "lineNumber": 501 + "lineNumber": 480 }, "deprecated": false, "children": [], @@ -943,7 +893,7 @@ ], "source": { "path": "x-pack/plugins/maps/public/embeddable/map_embeddable.tsx", - "lineNumber": 517 + "lineNumber": 496 }, "deprecated": false, "children": [], @@ -961,7 +911,7 @@ ], "source": { "path": "x-pack/plugins/maps/public/embeddable/map_embeddable.tsx", - "lineNumber": 523 + "lineNumber": 502 }, "deprecated": false, "children": [], @@ -1377,7 +1327,7 @@ ], "source": { "path": "x-pack/plugins/maps/public/embeddable/types.ts", - "lineNumber": 42 + "lineNumber": 41 }, "deprecated": false, "initialIsOpen": false @@ -1409,7 +1359,7 @@ ], "source": { "path": "x-pack/plugins/maps/public/embeddable/types.ts", - "lineNumber": 44 + "lineNumber": 43 }, "deprecated": false, "initialIsOpen": false diff --git a/api_docs/ml.json b/api_docs/ml.json index dee66858b9be94..7308e182d7e5c3 100644 --- a/api_docs/ml.json +++ b/api_docs/ml.json @@ -868,7 +868,7 @@ "description": [], "source": { "path": "x-pack/plugins/ml/common/types/capabilities.ts", - "lineNumber": 153 + "lineNumber": 161 }, "deprecated": false, "children": [ @@ -884,7 +884,7 @@ ], "source": { "path": "x-pack/plugins/ml/common/types/capabilities.ts", - "lineNumber": 154 + "lineNumber": 162 }, "deprecated": false }, @@ -897,7 +897,7 @@ "description": [], "source": { "path": "x-pack/plugins/ml/common/types/capabilities.ts", - "lineNumber": 155 + "lineNumber": 163 }, "deprecated": false }, @@ -910,7 +910,7 @@ "description": [], "source": { "path": "x-pack/plugins/ml/common/types/capabilities.ts", - "lineNumber": 156 + "lineNumber": 164 }, "deprecated": false }, @@ -923,7 +923,7 @@ "description": [], "source": { "path": "x-pack/plugins/ml/common/types/capabilities.ts", - "lineNumber": 157 + "lineNumber": 165 }, "deprecated": false } @@ -1563,7 +1563,7 @@ ], "source": { "path": "x-pack/plugins/ml/public/plugin.ts", - "lineNumber": 213 + "lineNumber": 212 }, "deprecated": false, "lifecycle": "start", diff --git a/api_docs/newsfeed.json b/api_docs/newsfeed.json index 45ec0de037851f..eec5a9c5642e50 100644 --- a/api_docs/newsfeed.json +++ b/api_docs/newsfeed.json @@ -228,7 +228,7 @@ "description": [], "source": { "path": "src/plugins/newsfeed/public/lib/api.ts", - "lineNumber": 25 + "lineNumber": 16 }, "deprecated": false, "initialIsOpen": false diff --git a/api_docs/observability.json b/api_docs/observability.json index fc645dd7e2e6b8..f6104d1c1b8029 100644 --- a/api_docs/observability.json +++ b/api_docs/observability.json @@ -417,7 +417,7 @@ "signature": [ "({ children, ...props }: { children?: React.ReactNode; } & ", "CommonProps", - " & Pick, \"children\" | \"onClick\" | \"onChange\" | \"onKeyDown\" | \"title\" | \"id\" | \"defaultChecked\" | \"defaultValue\" | \"suppressContentEditableWarning\" | \"suppressHydrationWarning\" | \"accessKey\" | \"className\" | \"contentEditable\" | \"contextMenu\" | \"dir\" | \"draggable\" | \"hidden\" | \"lang\" | \"placeholder\" | \"slot\" | \"spellCheck\" | \"style\" | \"tabIndex\" | \"translate\" | \"radioGroup\" | \"role\" | \"about\" | \"datatype\" | \"inlist\" | \"prefix\" | \"property\" | \"resource\" | \"typeof\" | \"vocab\" | \"autoCapitalize\" | \"autoCorrect\" | \"autoSave\" | \"itemProp\" | \"itemScope\" | \"itemType\" | \"itemID\" | \"itemRef\" | \"results\" | \"security\" | \"unselectable\" | \"inputMode\" | \"is\" | \"aria-activedescendant\" | \"aria-atomic\" | \"aria-autocomplete\" | \"aria-busy\" | \"aria-checked\" | \"aria-colcount\" | \"aria-colindex\" | \"aria-colspan\" | \"aria-controls\" | \"aria-current\" | \"aria-describedby\" | \"aria-details\" | \"aria-disabled\" | \"aria-dropeffect\" | \"aria-errormessage\" | \"aria-expanded\" | \"aria-flowto\" | \"aria-grabbed\" | \"aria-haspopup\" | \"aria-hidden\" | \"aria-invalid\" | \"aria-keyshortcuts\" | \"aria-label\" | \"aria-labelledby\" | \"aria-level\" | \"aria-live\" | \"aria-modal\" | \"aria-multiline\" | \"aria-multiselectable\" | \"aria-orientation\" | \"aria-owns\" | \"aria-placeholder\" | \"aria-posinset\" | \"aria-pressed\" | \"aria-readonly\" | \"aria-relevant\" | \"aria-required\" | \"aria-roledescription\" | \"aria-rowcount\" | \"aria-rowindex\" | \"aria-rowspan\" | \"aria-selected\" | \"aria-setsize\" | \"aria-sort\" | \"aria-valuemax\" | \"aria-valuemin\" | \"aria-valuenow\" | \"aria-valuetext\" | \"dangerouslySetInnerHTML\" | \"onCopy\" | \"onCopyCapture\" | \"onCut\" | \"onCutCapture\" | \"onPaste\" | \"onPasteCapture\" | \"onCompositionEnd\" | \"onCompositionEndCapture\" | \"onCompositionStart\" | \"onCompositionStartCapture\" | \"onCompositionUpdate\" | \"onCompositionUpdateCapture\" | \"onFocus\" | \"onFocusCapture\" | \"onBlur\" | \"onBlurCapture\" | \"onChangeCapture\" | \"onBeforeInput\" | \"onBeforeInputCapture\" | \"onInput\" | \"onInputCapture\" | \"onReset\" | \"onResetCapture\" | \"onSubmit\" | \"onSubmitCapture\" | \"onInvalid\" | \"onInvalidCapture\" | \"onLoad\" | \"onLoadCapture\" | \"onError\" | \"onErrorCapture\" | \"onKeyDownCapture\" | \"onKeyPress\" | \"onKeyPressCapture\" | \"onKeyUp\" | \"onKeyUpCapture\" | \"onAbort\" | \"onAbortCapture\" | \"onCanPlay\" | \"onCanPlayCapture\" | \"onCanPlayThrough\" | \"onCanPlayThroughCapture\" | \"onDurationChange\" | \"onDurationChangeCapture\" | \"onEmptied\" | \"onEmptiedCapture\" | \"onEncrypted\" | \"onEncryptedCapture\" | \"onEnded\" | \"onEndedCapture\" | \"onLoadedData\" | \"onLoadedDataCapture\" | \"onLoadedMetadata\" | \"onLoadedMetadataCapture\" | \"onLoadStart\" | \"onLoadStartCapture\" | \"onPause\" | \"onPauseCapture\" | \"onPlay\" | \"onPlayCapture\" | \"onPlaying\" | \"onPlayingCapture\" | \"onProgress\" | \"onProgressCapture\" | \"onRateChange\" | \"onRateChangeCapture\" | \"onSeeked\" | \"onSeekedCapture\" | \"onSeeking\" | \"onSeekingCapture\" | \"onStalled\" | \"onStalledCapture\" | \"onSuspend\" | \"onSuspendCapture\" | \"onTimeUpdate\" | \"onTimeUpdateCapture\" | \"onVolumeChange\" | \"onVolumeChangeCapture\" | \"onWaiting\" | \"onWaitingCapture\" | \"onAuxClick\" | \"onAuxClickCapture\" | \"onClickCapture\" | \"onContextMenu\" | \"onContextMenuCapture\" | \"onDoubleClick\" | \"onDoubleClickCapture\" | \"onDrag\" | \"onDragCapture\" | \"onDragEnd\" | \"onDragEndCapture\" | \"onDragEnter\" | \"onDragEnterCapture\" | \"onDragExit\" | \"onDragExitCapture\" | \"onDragLeave\" | \"onDragLeaveCapture\" | \"onDragOver\" | \"onDragOverCapture\" | \"onDragStart\" | \"onDragStartCapture\" | \"onDrop\" | \"onDropCapture\" | \"onMouseDown\" | \"onMouseDownCapture\" | \"onMouseEnter\" | \"onMouseLeave\" | \"onMouseMove\" | \"onMouseMoveCapture\" | \"onMouseOut\" | \"onMouseOutCapture\" | \"onMouseOver\" | \"onMouseOverCapture\" | \"onMouseUp\" | \"onMouseUpCapture\" | \"onSelect\" | \"onSelectCapture\" | \"onTouchCancel\" | \"onTouchCancelCapture\" | \"onTouchEnd\" | \"onTouchEndCapture\" | \"onTouchMove\" | \"onTouchMoveCapture\" | \"onTouchStart\" | \"onTouchStartCapture\" | \"onPointerDown\" | \"onPointerDownCapture\" | \"onPointerMove\" | \"onPointerMoveCapture\" | \"onPointerUp\" | \"onPointerUpCapture\" | \"onPointerCancel\" | \"onPointerCancelCapture\" | \"onPointerEnter\" | \"onPointerEnterCapture\" | \"onPointerLeave\" | \"onPointerLeaveCapture\" | \"onPointerOver\" | \"onPointerOverCapture\" | \"onPointerOut\" | \"onPointerOutCapture\" | \"onGotPointerCapture\" | \"onGotPointerCaptureCapture\" | \"onLostPointerCapture\" | \"onLostPointerCaptureCapture\" | \"onScroll\" | \"onScrollCapture\" | \"onWheel\" | \"onWheelCapture\" | \"onAnimationStart\" | \"onAnimationStartCapture\" | \"onAnimationEnd\" | \"onAnimationEndCapture\" | \"onAnimationIteration\" | \"onAnimationIterationCapture\" | \"onTransitionEnd\" | \"onTransitionEndCapture\" | \"css\"> & { bordered?: boolean | undefined; flush?: boolean | undefined; gutterSize?: \"m\" | \"s\" | \"none\" | undefined; listItems?: ", + " & Pick, \"children\" | \"onClick\" | \"onChange\" | \"onKeyDown\" | \"title\" | \"id\" | \"defaultChecked\" | \"defaultValue\" | \"suppressContentEditableWarning\" | \"suppressHydrationWarning\" | \"accessKey\" | \"className\" | \"contentEditable\" | \"contextMenu\" | \"dir\" | \"draggable\" | \"hidden\" | \"lang\" | \"placeholder\" | \"slot\" | \"spellCheck\" | \"style\" | \"tabIndex\" | \"translate\" | \"radioGroup\" | \"role\" | \"about\" | \"datatype\" | \"inlist\" | \"prefix\" | \"property\" | \"resource\" | \"typeof\" | \"vocab\" | \"autoCapitalize\" | \"autoCorrect\" | \"autoSave\" | \"itemProp\" | \"itemScope\" | \"itemType\" | \"itemID\" | \"itemRef\" | \"results\" | \"security\" | \"unselectable\" | \"inputMode\" | \"is\" | \"aria-activedescendant\" | \"aria-atomic\" | \"aria-autocomplete\" | \"aria-busy\" | \"aria-checked\" | \"aria-colcount\" | \"aria-colindex\" | \"aria-colspan\" | \"aria-controls\" | \"aria-current\" | \"aria-describedby\" | \"aria-details\" | \"aria-disabled\" | \"aria-dropeffect\" | \"aria-errormessage\" | \"aria-expanded\" | \"aria-flowto\" | \"aria-grabbed\" | \"aria-haspopup\" | \"aria-hidden\" | \"aria-invalid\" | \"aria-keyshortcuts\" | \"aria-label\" | \"aria-labelledby\" | \"aria-level\" | \"aria-live\" | \"aria-modal\" | \"aria-multiline\" | \"aria-multiselectable\" | \"aria-orientation\" | \"aria-owns\" | \"aria-placeholder\" | \"aria-posinset\" | \"aria-pressed\" | \"aria-readonly\" | \"aria-relevant\" | \"aria-required\" | \"aria-roledescription\" | \"aria-rowcount\" | \"aria-rowindex\" | \"aria-rowspan\" | \"aria-selected\" | \"aria-setsize\" | \"aria-sort\" | \"aria-valuemax\" | \"aria-valuemin\" | \"aria-valuenow\" | \"aria-valuetext\" | \"dangerouslySetInnerHTML\" | \"onCopy\" | \"onCopyCapture\" | \"onCut\" | \"onCutCapture\" | \"onPaste\" | \"onPasteCapture\" | \"onCompositionEnd\" | \"onCompositionEndCapture\" | \"onCompositionStart\" | \"onCompositionStartCapture\" | \"onCompositionUpdate\" | \"onCompositionUpdateCapture\" | \"onFocus\" | \"onFocusCapture\" | \"onBlur\" | \"onBlurCapture\" | \"onChangeCapture\" | \"onBeforeInput\" | \"onBeforeInputCapture\" | \"onInput\" | \"onInputCapture\" | \"onReset\" | \"onResetCapture\" | \"onSubmit\" | \"onSubmitCapture\" | \"onInvalid\" | \"onInvalidCapture\" | \"onLoad\" | \"onLoadCapture\" | \"onError\" | \"onErrorCapture\" | \"onKeyDownCapture\" | \"onKeyPress\" | \"onKeyPressCapture\" | \"onKeyUp\" | \"onKeyUpCapture\" | \"onAbort\" | \"onAbortCapture\" | \"onCanPlay\" | \"onCanPlayCapture\" | \"onCanPlayThrough\" | \"onCanPlayThroughCapture\" | \"onDurationChange\" | \"onDurationChangeCapture\" | \"onEmptied\" | \"onEmptiedCapture\" | \"onEncrypted\" | \"onEncryptedCapture\" | \"onEnded\" | \"onEndedCapture\" | \"onLoadedData\" | \"onLoadedDataCapture\" | \"onLoadedMetadata\" | \"onLoadedMetadataCapture\" | \"onLoadStart\" | \"onLoadStartCapture\" | \"onPause\" | \"onPauseCapture\" | \"onPlay\" | \"onPlayCapture\" | \"onPlaying\" | \"onPlayingCapture\" | \"onProgress\" | \"onProgressCapture\" | \"onRateChange\" | \"onRateChangeCapture\" | \"onSeeked\" | \"onSeekedCapture\" | \"onSeeking\" | \"onSeekingCapture\" | \"onStalled\" | \"onStalledCapture\" | \"onSuspend\" | \"onSuspendCapture\" | \"onTimeUpdate\" | \"onTimeUpdateCapture\" | \"onVolumeChange\" | \"onVolumeChangeCapture\" | \"onWaiting\" | \"onWaitingCapture\" | \"onAuxClick\" | \"onAuxClickCapture\" | \"onClickCapture\" | \"onContextMenu\" | \"onContextMenuCapture\" | \"onDoubleClick\" | \"onDoubleClickCapture\" | \"onDrag\" | \"onDragCapture\" | \"onDragEnd\" | \"onDragEndCapture\" | \"onDragEnter\" | \"onDragEnterCapture\" | \"onDragExit\" | \"onDragExitCapture\" | \"onDragLeave\" | \"onDragLeaveCapture\" | \"onDragOver\" | \"onDragOverCapture\" | \"onDragStart\" | \"onDragStartCapture\" | \"onDrop\" | \"onDropCapture\" | \"onMouseDown\" | \"onMouseDownCapture\" | \"onMouseEnter\" | \"onMouseLeave\" | \"onMouseMove\" | \"onMouseMoveCapture\" | \"onMouseOut\" | \"onMouseOutCapture\" | \"onMouseOver\" | \"onMouseOverCapture\" | \"onMouseUp\" | \"onMouseUpCapture\" | \"onSelect\" | \"onSelectCapture\" | \"onTouchCancel\" | \"onTouchCancelCapture\" | \"onTouchEnd\" | \"onTouchEndCapture\" | \"onTouchMove\" | \"onTouchMoveCapture\" | \"onTouchStart\" | \"onTouchStartCapture\" | \"onPointerDown\" | \"onPointerDownCapture\" | \"onPointerMove\" | \"onPointerMoveCapture\" | \"onPointerUp\" | \"onPointerUpCapture\" | \"onPointerCancel\" | \"onPointerCancelCapture\" | \"onPointerEnter\" | \"onPointerEnterCapture\" | \"onPointerLeave\" | \"onPointerLeaveCapture\" | \"onPointerOver\" | \"onPointerOverCapture\" | \"onPointerOut\" | \"onPointerOutCapture\" | \"onGotPointerCapture\" | \"onGotPointerCaptureCapture\" | \"onLostPointerCapture\" | \"onLostPointerCaptureCapture\" | \"onScroll\" | \"onScrollCapture\" | \"onWheel\" | \"onWheelCapture\" | \"onAnimationStart\" | \"onAnimationStartCapture\" | \"onAnimationEnd\" | \"onAnimationEndCapture\" | \"onAnimationIteration\" | \"onAnimationIterationCapture\" | \"onTransitionEnd\" | \"onTransitionEndCapture\" | \"css\"> & { bordered?: boolean | undefined; flush?: boolean | undefined; gutterSize?: \"none\" | \"m\" | \"s\" | undefined; listItems?: ", "EuiListGroupItemProps", "[] | undefined; color?: \"text\" | \"primary\" | \"inherit\" | \"ghost\" | \"subdued\" | undefined; size?: \"m\" | \"s\" | \"l\" | \"xs\" | undefined; maxWidth?: string | number | boolean | undefined; showToolTips?: boolean | undefined; wrapText?: boolean | undefined; ariaLabelledby?: string | undefined; }) => JSX.Element" ], @@ -437,7 +437,7 @@ "signature": [ "{ children?: React.ReactNode; } & ", "CommonProps", - " & Pick, \"children\" | \"onClick\" | \"onChange\" | \"onKeyDown\" | \"title\" | \"id\" | \"defaultChecked\" | \"defaultValue\" | \"suppressContentEditableWarning\" | \"suppressHydrationWarning\" | \"accessKey\" | \"className\" | \"contentEditable\" | \"contextMenu\" | \"dir\" | \"draggable\" | \"hidden\" | \"lang\" | \"placeholder\" | \"slot\" | \"spellCheck\" | \"style\" | \"tabIndex\" | \"translate\" | \"radioGroup\" | \"role\" | \"about\" | \"datatype\" | \"inlist\" | \"prefix\" | \"property\" | \"resource\" | \"typeof\" | \"vocab\" | \"autoCapitalize\" | \"autoCorrect\" | \"autoSave\" | \"itemProp\" | \"itemScope\" | \"itemType\" | \"itemID\" | \"itemRef\" | \"results\" | \"security\" | \"unselectable\" | \"inputMode\" | \"is\" | \"aria-activedescendant\" | \"aria-atomic\" | \"aria-autocomplete\" | \"aria-busy\" | \"aria-checked\" | \"aria-colcount\" | \"aria-colindex\" | \"aria-colspan\" | \"aria-controls\" | \"aria-current\" | \"aria-describedby\" | \"aria-details\" | \"aria-disabled\" | \"aria-dropeffect\" | \"aria-errormessage\" | \"aria-expanded\" | \"aria-flowto\" | \"aria-grabbed\" | \"aria-haspopup\" | \"aria-hidden\" | \"aria-invalid\" | \"aria-keyshortcuts\" | \"aria-label\" | \"aria-labelledby\" | \"aria-level\" | \"aria-live\" | \"aria-modal\" | \"aria-multiline\" | \"aria-multiselectable\" | \"aria-orientation\" | \"aria-owns\" | \"aria-placeholder\" | \"aria-posinset\" | \"aria-pressed\" | \"aria-readonly\" | \"aria-relevant\" | \"aria-required\" | \"aria-roledescription\" | \"aria-rowcount\" | \"aria-rowindex\" | \"aria-rowspan\" | \"aria-selected\" | \"aria-setsize\" | \"aria-sort\" | \"aria-valuemax\" | \"aria-valuemin\" | \"aria-valuenow\" | \"aria-valuetext\" | \"dangerouslySetInnerHTML\" | \"onCopy\" | \"onCopyCapture\" | \"onCut\" | \"onCutCapture\" | \"onPaste\" | \"onPasteCapture\" | \"onCompositionEnd\" | \"onCompositionEndCapture\" | \"onCompositionStart\" | \"onCompositionStartCapture\" | \"onCompositionUpdate\" | \"onCompositionUpdateCapture\" | \"onFocus\" | \"onFocusCapture\" | \"onBlur\" | \"onBlurCapture\" | \"onChangeCapture\" | \"onBeforeInput\" | \"onBeforeInputCapture\" | \"onInput\" | \"onInputCapture\" | \"onReset\" | \"onResetCapture\" | \"onSubmit\" | \"onSubmitCapture\" | \"onInvalid\" | \"onInvalidCapture\" | \"onLoad\" | \"onLoadCapture\" | \"onError\" | \"onErrorCapture\" | \"onKeyDownCapture\" | \"onKeyPress\" | \"onKeyPressCapture\" | \"onKeyUp\" | \"onKeyUpCapture\" | \"onAbort\" | \"onAbortCapture\" | \"onCanPlay\" | \"onCanPlayCapture\" | \"onCanPlayThrough\" | \"onCanPlayThroughCapture\" | \"onDurationChange\" | \"onDurationChangeCapture\" | \"onEmptied\" | \"onEmptiedCapture\" | \"onEncrypted\" | \"onEncryptedCapture\" | \"onEnded\" | \"onEndedCapture\" | \"onLoadedData\" | \"onLoadedDataCapture\" | \"onLoadedMetadata\" | \"onLoadedMetadataCapture\" | \"onLoadStart\" | \"onLoadStartCapture\" | \"onPause\" | \"onPauseCapture\" | \"onPlay\" | \"onPlayCapture\" | \"onPlaying\" | \"onPlayingCapture\" | \"onProgress\" | \"onProgressCapture\" | \"onRateChange\" | \"onRateChangeCapture\" | \"onSeeked\" | \"onSeekedCapture\" | \"onSeeking\" | \"onSeekingCapture\" | \"onStalled\" | \"onStalledCapture\" | \"onSuspend\" | \"onSuspendCapture\" | \"onTimeUpdate\" | \"onTimeUpdateCapture\" | \"onVolumeChange\" | \"onVolumeChangeCapture\" | \"onWaiting\" | \"onWaitingCapture\" | \"onAuxClick\" | \"onAuxClickCapture\" | \"onClickCapture\" | \"onContextMenu\" | \"onContextMenuCapture\" | \"onDoubleClick\" | \"onDoubleClickCapture\" | \"onDrag\" | \"onDragCapture\" | \"onDragEnd\" | \"onDragEndCapture\" | \"onDragEnter\" | \"onDragEnterCapture\" | \"onDragExit\" | \"onDragExitCapture\" | \"onDragLeave\" | \"onDragLeaveCapture\" | \"onDragOver\" | \"onDragOverCapture\" | \"onDragStart\" | \"onDragStartCapture\" | \"onDrop\" | \"onDropCapture\" | \"onMouseDown\" | \"onMouseDownCapture\" | \"onMouseEnter\" | \"onMouseLeave\" | \"onMouseMove\" | \"onMouseMoveCapture\" | \"onMouseOut\" | \"onMouseOutCapture\" | \"onMouseOver\" | \"onMouseOverCapture\" | \"onMouseUp\" | \"onMouseUpCapture\" | \"onSelect\" | \"onSelectCapture\" | \"onTouchCancel\" | \"onTouchCancelCapture\" | \"onTouchEnd\" | \"onTouchEndCapture\" | \"onTouchMove\" | \"onTouchMoveCapture\" | \"onTouchStart\" | \"onTouchStartCapture\" | \"onPointerDown\" | \"onPointerDownCapture\" | \"onPointerMove\" | \"onPointerMoveCapture\" | \"onPointerUp\" | \"onPointerUpCapture\" | \"onPointerCancel\" | \"onPointerCancelCapture\" | \"onPointerEnter\" | \"onPointerEnterCapture\" | \"onPointerLeave\" | \"onPointerLeaveCapture\" | \"onPointerOver\" | \"onPointerOverCapture\" | \"onPointerOut\" | \"onPointerOutCapture\" | \"onGotPointerCapture\" | \"onGotPointerCaptureCapture\" | \"onLostPointerCapture\" | \"onLostPointerCaptureCapture\" | \"onScroll\" | \"onScrollCapture\" | \"onWheel\" | \"onWheelCapture\" | \"onAnimationStart\" | \"onAnimationStartCapture\" | \"onAnimationEnd\" | \"onAnimationEndCapture\" | \"onAnimationIteration\" | \"onAnimationIterationCapture\" | \"onTransitionEnd\" | \"onTransitionEndCapture\" | \"css\"> & { bordered?: boolean | undefined; flush?: boolean | undefined; gutterSize?: \"m\" | \"s\" | \"none\" | undefined; listItems?: ", + " & Pick, \"children\" | \"onClick\" | \"onChange\" | \"onKeyDown\" | \"title\" | \"id\" | \"defaultChecked\" | \"defaultValue\" | \"suppressContentEditableWarning\" | \"suppressHydrationWarning\" | \"accessKey\" | \"className\" | \"contentEditable\" | \"contextMenu\" | \"dir\" | \"draggable\" | \"hidden\" | \"lang\" | \"placeholder\" | \"slot\" | \"spellCheck\" | \"style\" | \"tabIndex\" | \"translate\" | \"radioGroup\" | \"role\" | \"about\" | \"datatype\" | \"inlist\" | \"prefix\" | \"property\" | \"resource\" | \"typeof\" | \"vocab\" | \"autoCapitalize\" | \"autoCorrect\" | \"autoSave\" | \"itemProp\" | \"itemScope\" | \"itemType\" | \"itemID\" | \"itemRef\" | \"results\" | \"security\" | \"unselectable\" | \"inputMode\" | \"is\" | \"aria-activedescendant\" | \"aria-atomic\" | \"aria-autocomplete\" | \"aria-busy\" | \"aria-checked\" | \"aria-colcount\" | \"aria-colindex\" | \"aria-colspan\" | \"aria-controls\" | \"aria-current\" | \"aria-describedby\" | \"aria-details\" | \"aria-disabled\" | \"aria-dropeffect\" | \"aria-errormessage\" | \"aria-expanded\" | \"aria-flowto\" | \"aria-grabbed\" | \"aria-haspopup\" | \"aria-hidden\" | \"aria-invalid\" | \"aria-keyshortcuts\" | \"aria-label\" | \"aria-labelledby\" | \"aria-level\" | \"aria-live\" | \"aria-modal\" | \"aria-multiline\" | \"aria-multiselectable\" | \"aria-orientation\" | \"aria-owns\" | \"aria-placeholder\" | \"aria-posinset\" | \"aria-pressed\" | \"aria-readonly\" | \"aria-relevant\" | \"aria-required\" | \"aria-roledescription\" | \"aria-rowcount\" | \"aria-rowindex\" | \"aria-rowspan\" | \"aria-selected\" | \"aria-setsize\" | \"aria-sort\" | \"aria-valuemax\" | \"aria-valuemin\" | \"aria-valuenow\" | \"aria-valuetext\" | \"dangerouslySetInnerHTML\" | \"onCopy\" | \"onCopyCapture\" | \"onCut\" | \"onCutCapture\" | \"onPaste\" | \"onPasteCapture\" | \"onCompositionEnd\" | \"onCompositionEndCapture\" | \"onCompositionStart\" | \"onCompositionStartCapture\" | \"onCompositionUpdate\" | \"onCompositionUpdateCapture\" | \"onFocus\" | \"onFocusCapture\" | \"onBlur\" | \"onBlurCapture\" | \"onChangeCapture\" | \"onBeforeInput\" | \"onBeforeInputCapture\" | \"onInput\" | \"onInputCapture\" | \"onReset\" | \"onResetCapture\" | \"onSubmit\" | \"onSubmitCapture\" | \"onInvalid\" | \"onInvalidCapture\" | \"onLoad\" | \"onLoadCapture\" | \"onError\" | \"onErrorCapture\" | \"onKeyDownCapture\" | \"onKeyPress\" | \"onKeyPressCapture\" | \"onKeyUp\" | \"onKeyUpCapture\" | \"onAbort\" | \"onAbortCapture\" | \"onCanPlay\" | \"onCanPlayCapture\" | \"onCanPlayThrough\" | \"onCanPlayThroughCapture\" | \"onDurationChange\" | \"onDurationChangeCapture\" | \"onEmptied\" | \"onEmptiedCapture\" | \"onEncrypted\" | \"onEncryptedCapture\" | \"onEnded\" | \"onEndedCapture\" | \"onLoadedData\" | \"onLoadedDataCapture\" | \"onLoadedMetadata\" | \"onLoadedMetadataCapture\" | \"onLoadStart\" | \"onLoadStartCapture\" | \"onPause\" | \"onPauseCapture\" | \"onPlay\" | \"onPlayCapture\" | \"onPlaying\" | \"onPlayingCapture\" | \"onProgress\" | \"onProgressCapture\" | \"onRateChange\" | \"onRateChangeCapture\" | \"onSeeked\" | \"onSeekedCapture\" | \"onSeeking\" | \"onSeekingCapture\" | \"onStalled\" | \"onStalledCapture\" | \"onSuspend\" | \"onSuspendCapture\" | \"onTimeUpdate\" | \"onTimeUpdateCapture\" | \"onVolumeChange\" | \"onVolumeChangeCapture\" | \"onWaiting\" | \"onWaitingCapture\" | \"onAuxClick\" | \"onAuxClickCapture\" | \"onClickCapture\" | \"onContextMenu\" | \"onContextMenuCapture\" | \"onDoubleClick\" | \"onDoubleClickCapture\" | \"onDrag\" | \"onDragCapture\" | \"onDragEnd\" | \"onDragEndCapture\" | \"onDragEnter\" | \"onDragEnterCapture\" | \"onDragExit\" | \"onDragExitCapture\" | \"onDragLeave\" | \"onDragLeaveCapture\" | \"onDragOver\" | \"onDragOverCapture\" | \"onDragStart\" | \"onDragStartCapture\" | \"onDrop\" | \"onDropCapture\" | \"onMouseDown\" | \"onMouseDownCapture\" | \"onMouseEnter\" | \"onMouseLeave\" | \"onMouseMove\" | \"onMouseMoveCapture\" | \"onMouseOut\" | \"onMouseOutCapture\" | \"onMouseOver\" | \"onMouseOverCapture\" | \"onMouseUp\" | \"onMouseUpCapture\" | \"onSelect\" | \"onSelectCapture\" | \"onTouchCancel\" | \"onTouchCancelCapture\" | \"onTouchEnd\" | \"onTouchEndCapture\" | \"onTouchMove\" | \"onTouchMoveCapture\" | \"onTouchStart\" | \"onTouchStartCapture\" | \"onPointerDown\" | \"onPointerDownCapture\" | \"onPointerMove\" | \"onPointerMoveCapture\" | \"onPointerUp\" | \"onPointerUpCapture\" | \"onPointerCancel\" | \"onPointerCancelCapture\" | \"onPointerEnter\" | \"onPointerEnterCapture\" | \"onPointerLeave\" | \"onPointerLeaveCapture\" | \"onPointerOver\" | \"onPointerOverCapture\" | \"onPointerOut\" | \"onPointerOutCapture\" | \"onGotPointerCapture\" | \"onGotPointerCaptureCapture\" | \"onLostPointerCapture\" | \"onLostPointerCaptureCapture\" | \"onScroll\" | \"onScrollCapture\" | \"onWheel\" | \"onWheelCapture\" | \"onAnimationStart\" | \"onAnimationStartCapture\" | \"onAnimationEnd\" | \"onAnimationEndCapture\" | \"onAnimationIteration\" | \"onAnimationIterationCapture\" | \"onTransitionEnd\" | \"onTransitionEndCapture\" | \"css\"> & { bordered?: boolean | undefined; flush?: boolean | undefined; gutterSize?: \"none\" | \"m\" | \"s\" | undefined; listItems?: ", "EuiListGroupItemProps", "[] | undefined; color?: \"text\" | \"primary\" | \"inherit\" | \"ghost\" | \"subdued\" | undefined; size?: \"m\" | \"s\" | \"l\" | \"xs\" | undefined; maxWidth?: string | number | boolean | undefined; showToolTips?: boolean | undefined; wrapText?: boolean | undefined; ariaLabelledby?: string | undefined; }" ], @@ -573,6 +573,46 @@ "returnComment": [], "initialIsOpen": false }, + { + "parentPluginId": "observability", + "id": "def-public.useBreadcrumbs", + "type": "Function", + "tags": [], + "label": "useBreadcrumbs", + "description": [], + "signature": [ + "(extraCrumbs: ", + "EuiBreadcrumb", + "[]) => void" + ], + "source": { + "path": "x-pack/plugins/observability/public/hooks/use_breadcrumbs.ts", + "lineNumber": 43 + }, + "deprecated": false, + "children": [ + { + "parentPluginId": "observability", + "id": "def-public.useBreadcrumbs.$1", + "type": "Array", + "tags": [], + "label": "extraCrumbs", + "description": [], + "signature": [ + "EuiBreadcrumb", + "[]" + ], + "source": { + "path": "x-pack/plugins/observability/public/hooks/use_breadcrumbs.ts", + "lineNumber": 43 + }, + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, { "parentPluginId": "observability", "id": "def-public.useChartTheme", @@ -2267,7 +2307,7 @@ "description": [], "source": { "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/types.ts", - "lineNumber": 73 + "lineNumber": 82 }, "deprecated": false, "children": [ @@ -2283,7 +2323,7 @@ ], "source": { "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/types.ts", - "lineNumber": 74 + "lineNumber": 83 }, "deprecated": false }, @@ -2299,7 +2339,7 @@ ], "source": { "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/types.ts", - "lineNumber": 78 + "lineNumber": 87 }, "deprecated": false }, @@ -2316,7 +2356,7 @@ ], "source": { "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/types.ts", - "lineNumber": 79 + "lineNumber": 88 }, "deprecated": false }, @@ -2332,7 +2372,7 @@ ], "source": { "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/types.ts", - "lineNumber": 80 + "lineNumber": 89 }, "deprecated": false }, @@ -2344,11 +2384,11 @@ "label": "reportType", "description": [], "signature": [ - "\"logs\" | \"cpu\" | \"pld\" | \"kpi\" | \"upd\" | \"upp\" | \"svl\" | \"tpt\" | \"mem\" | \"nwk\"" + "\"logs\" | \"cpu\" | \"pld\" | \"kpi\" | \"cwv\" | \"upd\" | \"upp\" | \"svl\" | \"tpt\" | \"mem\" | \"nwk\"" ], "source": { "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/types.ts", - "lineNumber": 81 + "lineNumber": 90 }, "deprecated": false }, @@ -2364,7 +2404,7 @@ ], "source": { "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/types.ts", - "lineNumber": 82 + "lineNumber": 91 }, "deprecated": false }, @@ -2380,7 +2420,7 @@ ], "source": { "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/types.ts", - "lineNumber": 83 + "lineNumber": 92 }, "deprecated": false }, @@ -2396,7 +2436,7 @@ ], "source": { "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/types.ts", - "lineNumber": 84 + "lineNumber": 93 }, "deprecated": false } @@ -3046,7 +3086,9 @@ "DisambiguateSet", ", \"children\" | \"type\" | \"onClick\" | \"onChange\" | \"color\" | \"onKeyDown\" | \"title\" | \"id\" | \"defaultChecked\" | \"defaultValue\" | \"suppressContentEditableWarning\" | \"suppressHydrationWarning\" | \"accessKey\" | \"className\" | \"contentEditable\" | \"contextMenu\" | \"dir\" | \"draggable\" | \"hidden\" | \"lang\" | \"placeholder\" | \"slot\" | \"spellCheck\" | \"style\" | \"tabIndex\" | \"translate\" | \"radioGroup\" | \"role\" | \"about\" | \"datatype\" | \"inlist\" | \"prefix\" | \"property\" | \"resource\" | \"typeof\" | \"vocab\" | \"autoCapitalize\" | \"autoCorrect\" | \"autoSave\" | \"itemProp\" | \"itemScope\" | \"itemType\" | \"itemID\" | \"itemRef\" | \"results\" | \"security\" | \"unselectable\" | \"inputMode\" | \"is\" | \"aria-activedescendant\" | \"aria-atomic\" | \"aria-autocomplete\" | \"aria-busy\" | \"aria-checked\" | \"aria-colcount\" | \"aria-colindex\" | \"aria-colspan\" | \"aria-controls\" | \"aria-current\" | \"aria-describedby\" | \"aria-details\" | \"aria-disabled\" | \"aria-dropeffect\" | \"aria-errormessage\" | \"aria-expanded\" | \"aria-flowto\" | \"aria-grabbed\" | \"aria-haspopup\" | \"aria-hidden\" | \"aria-invalid\" | \"aria-keyshortcuts\" | \"aria-label\" | \"aria-labelledby\" | \"aria-level\" | \"aria-live\" | \"aria-modal\" | \"aria-multiline\" | \"aria-multiselectable\" | \"aria-orientation\" | \"aria-owns\" | \"aria-placeholder\" | \"aria-posinset\" | \"aria-pressed\" | \"aria-readonly\" | \"aria-relevant\" | \"aria-required\" | \"aria-roledescription\" | \"aria-rowcount\" | \"aria-rowindex\" | \"aria-rowspan\" | \"aria-selected\" | \"aria-setsize\" | \"aria-sort\" | \"aria-valuemax\" | \"aria-valuemin\" | \"aria-valuenow\" | \"aria-valuetext\" | \"dangerouslySetInnerHTML\" | \"onCopy\" | \"onCopyCapture\" | \"onCut\" | \"onCutCapture\" | \"onPaste\" | \"onPasteCapture\" | \"onCompositionEnd\" | \"onCompositionEndCapture\" | \"onCompositionStart\" | \"onCompositionStartCapture\" | \"onCompositionUpdate\" | \"onCompositionUpdateCapture\" | \"onFocus\" | \"onFocusCapture\" | \"onBlur\" | \"onBlurCapture\" | \"onChangeCapture\" | \"onBeforeInput\" | \"onBeforeInputCapture\" | \"onInput\" | \"onInputCapture\" | \"onReset\" | \"onResetCapture\" | \"onSubmit\" | \"onSubmitCapture\" | \"onInvalid\" | \"onInvalidCapture\" | \"onLoad\" | \"onLoadCapture\" | \"onError\" | \"onErrorCapture\" | \"onKeyDownCapture\" | \"onKeyPress\" | \"onKeyPressCapture\" | \"onKeyUp\" | \"onKeyUpCapture\" | \"onAbort\" | \"onAbortCapture\" | \"onCanPlay\" | \"onCanPlayCapture\" | \"onCanPlayThrough\" | \"onCanPlayThroughCapture\" | \"onDurationChange\" | \"onDurationChangeCapture\" | \"onEmptied\" | \"onEmptiedCapture\" | \"onEncrypted\" | \"onEncryptedCapture\" | \"onEnded\" | \"onEndedCapture\" | \"onLoadedData\" | \"onLoadedDataCapture\" | \"onLoadedMetadata\" | \"onLoadedMetadataCapture\" | \"onLoadStart\" | \"onLoadStartCapture\" | \"onPause\" | \"onPauseCapture\" | \"onPlay\" | \"onPlayCapture\" | \"onPlaying\" | \"onPlayingCapture\" | \"onProgress\" | \"onProgressCapture\" | \"onRateChange\" | \"onRateChangeCapture\" | \"onSeeked\" | \"onSeekedCapture\" | \"onSeeking\" | \"onSeekingCapture\" | \"onStalled\" | \"onStalledCapture\" | \"onSuspend\" | \"onSuspendCapture\" | \"onTimeUpdate\" | \"onTimeUpdateCapture\" | \"onVolumeChange\" | \"onVolumeChangeCapture\" | \"onWaiting\" | \"onWaitingCapture\" | \"onAuxClick\" | \"onAuxClickCapture\" | \"onClickCapture\" | \"onContextMenu\" | \"onContextMenuCapture\" | \"onDoubleClick\" | \"onDoubleClickCapture\" | \"onDrag\" | \"onDragCapture\" | \"onDragEnd\" | \"onDragEndCapture\" | \"onDragEnter\" | \"onDragEnterCapture\" | \"onDragExit\" | \"onDragExitCapture\" | \"onDragLeave\" | \"onDragLeaveCapture\" | \"onDragOver\" | \"onDragOverCapture\" | \"onDragStart\" | \"onDragStartCapture\" | \"onDrop\" | \"onDropCapture\" | \"onMouseDown\" | \"onMouseDownCapture\" | \"onMouseEnter\" | \"onMouseLeave\" | \"onMouseMove\" | \"onMouseMoveCapture\" | \"onMouseOut\" | \"onMouseOutCapture\" | \"onMouseOver\" | \"onMouseOverCapture\" | \"onMouseUp\" | \"onMouseUpCapture\" | \"onSelect\" | \"onSelectCapture\" | \"onTouchCancel\" | \"onTouchCancelCapture\" | \"onTouchEnd\" | \"onTouchEndCapture\" | \"onTouchMove\" | \"onTouchMoveCapture\" | \"onTouchStart\" | \"onTouchStartCapture\" | \"onPointerDown\" | \"onPointerDownCapture\" | \"onPointerMove\" | \"onPointerMoveCapture\" | \"onPointerUp\" | \"onPointerUpCapture\" | \"onPointerCancel\" | \"onPointerCancelCapture\" | \"onPointerEnter\" | \"onPointerEnterCapture\" | \"onPointerLeave\" | \"onPointerLeaveCapture\" | \"onPointerOver\" | \"onPointerOverCapture\" | \"onPointerOut\" | \"onPointerOutCapture\" | \"onGotPointerCapture\" | \"onGotPointerCaptureCapture\" | \"onLostPointerCapture\" | \"onLostPointerCaptureCapture\" | \"onScroll\" | \"onScrollCapture\" | \"onWheel\" | \"onWheelCapture\" | \"onAnimationStart\" | \"onAnimationStartCapture\" | \"onAnimationEnd\" | \"onAnimationEndCapture\" | \"onAnimationIteration\" | \"onAnimationIterationCapture\" | \"onTransitionEnd\" | \"onTransitionEndCapture\" | \"css\" | \"download\" | \"media\" | \"target\" | \"ping\" | \"hrefLang\" | \"rel\" | \"referrerPolicy\">, React.ButtonHTMLAttributes> & React.ButtonHTMLAttributes)> & ", "DisambiguateSet", - ", \"children\" | \"type\" | \"onClick\" | \"onChange\" | \"color\" | \"onKeyDown\" | \"title\" | \"id\" | \"defaultChecked\" | \"defaultValue\" | \"suppressContentEditableWarning\" | \"suppressHydrationWarning\" | \"accessKey\" | \"className\" | \"contentEditable\" | \"contextMenu\" | \"dir\" | \"draggable\" | \"hidden\" | \"lang\" | \"placeholder\" | \"slot\" | \"spellCheck\" | \"style\" | \"tabIndex\" | \"translate\" | \"radioGroup\" | \"role\" | \"about\" | \"datatype\" | \"inlist\" | \"prefix\" | \"property\" | \"resource\" | \"typeof\" | \"vocab\" | \"autoCapitalize\" | \"autoCorrect\" | \"autoSave\" | \"itemProp\" | \"itemScope\" | \"itemType\" | \"itemID\" | \"itemRef\" | \"results\" | \"security\" | \"unselectable\" | \"inputMode\" | \"is\" | \"aria-activedescendant\" | \"aria-atomic\" | \"aria-autocomplete\" | \"aria-busy\" | \"aria-checked\" | \"aria-colcount\" | \"aria-colindex\" | \"aria-colspan\" | \"aria-controls\" | \"aria-current\" | \"aria-describedby\" | \"aria-details\" | \"aria-disabled\" | \"aria-dropeffect\" | \"aria-errormessage\" | \"aria-expanded\" | \"aria-flowto\" | \"aria-grabbed\" | \"aria-haspopup\" | \"aria-hidden\" | \"aria-invalid\" | \"aria-keyshortcuts\" | \"aria-label\" | \"aria-labelledby\" | \"aria-level\" | \"aria-live\" | \"aria-modal\" | \"aria-multiline\" | \"aria-multiselectable\" | \"aria-orientation\" | \"aria-owns\" | \"aria-placeholder\" | \"aria-posinset\" | \"aria-pressed\" | \"aria-readonly\" | \"aria-relevant\" | \"aria-required\" | \"aria-roledescription\" | \"aria-rowcount\" | \"aria-rowindex\" | \"aria-rowspan\" | \"aria-selected\" | \"aria-setsize\" | \"aria-sort\" | \"aria-valuemax\" | \"aria-valuemin\" | \"aria-valuenow\" | \"aria-valuetext\" | \"dangerouslySetInnerHTML\" | \"onCopy\" | \"onCopyCapture\" | \"onCut\" | \"onCutCapture\" | \"onPaste\" | \"onPasteCapture\" | \"onCompositionEnd\" | \"onCompositionEndCapture\" | \"onCompositionStart\" | \"onCompositionStartCapture\" | \"onCompositionUpdate\" | \"onCompositionUpdateCapture\" | \"onFocus\" | \"onFocusCapture\" | \"onBlur\" | \"onBlurCapture\" | \"onChangeCapture\" | \"onBeforeInput\" | \"onBeforeInputCapture\" | \"onInput\" | \"onInputCapture\" | \"onReset\" | \"onResetCapture\" | \"onSubmit\" | \"onSubmitCapture\" | \"onInvalid\" | \"onInvalidCapture\" | \"onLoad\" | \"onLoadCapture\" | \"onError\" | \"onErrorCapture\" | \"onKeyDownCapture\" | \"onKeyPress\" | \"onKeyPressCapture\" | \"onKeyUp\" | \"onKeyUpCapture\" | \"onAbort\" | \"onAbortCapture\" | \"onCanPlay\" | \"onCanPlayCapture\" | \"onCanPlayThrough\" | \"onCanPlayThroughCapture\" | \"onDurationChange\" | \"onDurationChangeCapture\" | \"onEmptied\" | \"onEmptiedCapture\" | \"onEncrypted\" | \"onEncryptedCapture\" | \"onEnded\" | \"onEndedCapture\" | \"onLoadedData\" | \"onLoadedDataCapture\" | \"onLoadedMetadata\" | \"onLoadedMetadataCapture\" | \"onLoadStart\" | \"onLoadStartCapture\" | \"onPause\" | \"onPauseCapture\" | \"onPlay\" | \"onPlayCapture\" | \"onPlaying\" | \"onPlayingCapture\" | \"onProgress\" | \"onProgressCapture\" | \"onRateChange\" | \"onRateChangeCapture\" | \"onSeeked\" | \"onSeekedCapture\" | \"onSeeking\" | \"onSeekingCapture\" | \"onStalled\" | \"onStalledCapture\" | \"onSuspend\" | \"onSuspendCapture\" | \"onTimeUpdate\" | \"onTimeUpdateCapture\" | \"onVolumeChange\" | \"onVolumeChangeCapture\" | \"onWaiting\" | \"onWaitingCapture\" | \"onAuxClick\" | \"onAuxClickCapture\" | \"onClickCapture\" | \"onContextMenu\" | \"onContextMenuCapture\" | \"onDoubleClick\" | \"onDoubleClickCapture\" | \"onDrag\" | \"onDragCapture\" | \"onDragEnd\" | \"onDragEndCapture\" | \"onDragEnter\" | \"onDragEnterCapture\" | \"onDragExit\" | \"onDragExitCapture\" | \"onDragLeave\" | \"onDragLeaveCapture\" | \"onDragOver\" | \"onDragOverCapture\" | \"onDragStart\" | \"onDragStartCapture\" | \"onDrop\" | \"onDropCapture\" | \"onMouseDown\" | \"onMouseDownCapture\" | \"onMouseEnter\" | \"onMouseLeave\" | \"onMouseMove\" | \"onMouseMoveCapture\" | \"onMouseOut\" | \"onMouseOutCapture\" | \"onMouseOver\" | \"onMouseOverCapture\" | \"onMouseUp\" | \"onMouseUpCapture\" | \"onSelect\" | \"onSelectCapture\" | \"onTouchCancel\" | \"onTouchCancelCapture\" | \"onTouchEnd\" | \"onTouchEndCapture\" | \"onTouchMove\" | \"onTouchMoveCapture\" | \"onTouchStart\" | \"onTouchStartCapture\" | \"onPointerDown\" | \"onPointerDownCapture\" | \"onPointerMove\" | \"onPointerMoveCapture\" | \"onPointerUp\" | \"onPointerUpCapture\" | \"onPointerCancel\" | \"onPointerCancelCapture\" | \"onPointerEnter\" | \"onPointerEnterCapture\" | \"onPointerLeave\" | \"onPointerLeaveCapture\" | \"onPointerOver\" | \"onPointerOverCapture\" | \"onPointerOut\" | \"onPointerOutCapture\" | \"onGotPointerCapture\" | \"onGotPointerCaptureCapture\" | \"onLostPointerCapture\" | \"onLostPointerCaptureCapture\" | \"onScroll\" | \"onScrollCapture\" | \"onWheel\" | \"onWheelCapture\" | \"onAnimationStart\" | \"onAnimationStartCapture\" | \"onAnimationEnd\" | \"onAnimationEndCapture\" | \"onAnimationIteration\" | \"onAnimationIterationCapture\" | \"onTransitionEnd\" | \"onTransitionEndCapture\" | \"css\" | \"download\" | \"media\" | \"target\" | \"ping\" | \"hrefLang\" | \"rel\" | \"referrerPolicy\">, React.ButtonHTMLAttributes> & React.ButtonHTMLAttributes), \"children\" | \"type\" | \"onChange\" | \"onKeyDown\" | \"title\" | \"id\" | \"name\" | \"defaultChecked\" | \"defaultValue\" | \"suppressContentEditableWarning\" | \"suppressHydrationWarning\" | \"accessKey\" | \"className\" | \"contentEditable\" | \"contextMenu\" | \"dir\" | \"draggable\" | \"hidden\" | \"lang\" | \"placeholder\" | \"slot\" | \"spellCheck\" | \"style\" | \"tabIndex\" | \"translate\" | \"radioGroup\" | \"role\" | \"about\" | \"datatype\" | \"inlist\" | \"prefix\" | \"property\" | \"resource\" | \"typeof\" | \"vocab\" | \"autoCapitalize\" | \"autoCorrect\" | \"autoSave\" | \"itemProp\" | \"itemScope\" | \"itemType\" | \"itemID\" | \"itemRef\" | \"results\" | \"security\" | \"unselectable\" | \"inputMode\" | \"is\" | \"aria-activedescendant\" | \"aria-atomic\" | \"aria-autocomplete\" | \"aria-busy\" | \"aria-checked\" | \"aria-colcount\" | \"aria-colindex\" | \"aria-colspan\" | \"aria-controls\" | \"aria-current\" | \"aria-describedby\" | \"aria-details\" | \"aria-disabled\" | \"aria-dropeffect\" | \"aria-errormessage\" | \"aria-expanded\" | \"aria-flowto\" | \"aria-grabbed\" | \"aria-haspopup\" | \"aria-hidden\" | \"aria-invalid\" | \"aria-keyshortcuts\" | \"aria-label\" | \"aria-labelledby\" | \"aria-level\" | \"aria-live\" | \"aria-modal\" | \"aria-multiline\" | \"aria-multiselectable\" | \"aria-orientation\" | \"aria-owns\" | \"aria-placeholder\" | \"aria-posinset\" | \"aria-pressed\" | \"aria-readonly\" | \"aria-relevant\" | \"aria-required\" | \"aria-roledescription\" | \"aria-rowcount\" | \"aria-rowindex\" | \"aria-rowspan\" | \"aria-selected\" | \"aria-setsize\" | \"aria-sort\" | \"aria-valuemax\" | \"aria-valuemin\" | \"aria-valuenow\" | \"aria-valuetext\" | \"dangerouslySetInnerHTML\" | \"onCopy\" | \"onCopyCapture\" | \"onCut\" | \"onCutCapture\" | \"onPaste\" | \"onPasteCapture\" | \"onCompositionEnd\" | \"onCompositionEndCapture\" | \"onCompositionStart\" | \"onCompositionStartCapture\" | \"onCompositionUpdate\" | \"onCompositionUpdateCapture\" | \"onFocus\" | \"onFocusCapture\" | \"onBlur\" | \"onBlurCapture\" | \"onChangeCapture\" | \"onBeforeInput\" | \"onBeforeInputCapture\" | \"onInput\" | \"onInputCapture\" | \"onReset\" | \"onResetCapture\" | \"onSubmit\" | \"onSubmitCapture\" | \"onInvalid\" | \"onInvalidCapture\" | \"onLoad\" | \"onLoadCapture\" | \"onError\" | \"onErrorCapture\" | \"onKeyDownCapture\" | \"onKeyPress\" | \"onKeyPressCapture\" | \"onKeyUp\" | \"onKeyUpCapture\" | \"onAbort\" | \"onAbortCapture\" | \"onCanPlay\" | \"onCanPlayCapture\" | \"onCanPlayThrough\" | \"onCanPlayThroughCapture\" | \"onDurationChange\" | \"onDurationChangeCapture\" | \"onEmptied\" | \"onEmptiedCapture\" | \"onEncrypted\" | \"onEncryptedCapture\" | \"onEnded\" | \"onEndedCapture\" | \"onLoadedData\" | \"onLoadedDataCapture\" | \"onLoadedMetadata\" | \"onLoadedMetadataCapture\" | \"onLoadStart\" | \"onLoadStartCapture\" | \"onPause\" | \"onPauseCapture\" | \"onPlay\" | \"onPlayCapture\" | \"onPlaying\" | \"onPlayingCapture\" | \"onProgress\" | \"onProgressCapture\" | \"onRateChange\" | \"onRateChangeCapture\" | \"onSeeked\" | \"onSeekedCapture\" | \"onSeeking\" | \"onSeekingCapture\" | \"onStalled\" | \"onStalledCapture\" | \"onSuspend\" | \"onSuspendCapture\" | \"onTimeUpdate\" | \"onTimeUpdateCapture\" | \"onVolumeChange\" | \"onVolumeChangeCapture\" | \"onWaiting\" | \"onWaitingCapture\" | \"onAuxClick\" | \"onAuxClickCapture\" | \"onClickCapture\" | \"onContextMenu\" | \"onContextMenuCapture\" | \"onDoubleClick\" | \"onDoubleClickCapture\" | \"onDrag\" | \"onDragCapture\" | \"onDragEnd\" | \"onDragEndCapture\" | \"onDragEnter\" | \"onDragEnterCapture\" | \"onDragExit\" | \"onDragExitCapture\" | \"onDragLeave\" | \"onDragLeaveCapture\" | \"onDragOver\" | \"onDragOverCapture\" | \"onDragStart\" | \"onDragStartCapture\" | \"onDrop\" | \"onDropCapture\" | \"onMouseDown\" | \"onMouseDownCapture\" | \"onMouseEnter\" | \"onMouseLeave\" | \"onMouseMove\" | \"onMouseMoveCapture\" | \"onMouseOut\" | \"onMouseOutCapture\" | \"onMouseOver\" | \"onMouseOverCapture\" | \"onMouseUp\" | \"onMouseUpCapture\" | \"onSelect\" | \"onSelectCapture\" | \"onTouchCancel\" | \"onTouchCancelCapture\" | \"onTouchEnd\" | \"onTouchEndCapture\" | \"onTouchMove\" | \"onTouchMoveCapture\" | \"onTouchStart\" | \"onTouchStartCapture\" | \"onPointerDown\" | \"onPointerDownCapture\" | \"onPointerMove\" | \"onPointerMoveCapture\" | \"onPointerUp\" | \"onPointerUpCapture\" | \"onPointerCancel\" | \"onPointerCancelCapture\" | \"onPointerEnter\" | \"onPointerEnterCapture\" | \"onPointerLeave\" | \"onPointerLeaveCapture\" | \"onPointerOver\" | \"onPointerOverCapture\" | \"onPointerOut\" | \"onPointerOutCapture\" | \"onGotPointerCapture\" | \"onGotPointerCaptureCapture\" | \"onLostPointerCapture\" | \"onLostPointerCaptureCapture\" | \"onScroll\" | \"onScrollCapture\" | \"onWheel\" | \"onWheelCapture\" | \"onAnimationStart\" | \"onAnimationStartCapture\" | \"onAnimationEnd\" | \"onAnimationEndCapture\" | \"onAnimationIteration\" | \"onAnimationIterationCapture\" | \"onTransitionEnd\" | \"onTransitionEndCapture\" | \"css\" | \"download\" | \"autoFocus\" | \"disabled\" | \"form\" | \"formAction\" | \"formEncType\" | \"formMethod\" | \"formNoValidate\" | \"formTarget\" | \"value\" | \"media\" | \"ping\" | \"hrefLang\" | \"referrerPolicy\"> & { size?: \"m\" | \"s\" | \"l\" | \"xs\" | undefined; color?: \"text\" | \"primary\" | \"inherit\" | \"ghost\" | \"subdued\" | undefined; label: React.ReactNode; isActive?: boolean | undefined; isDisabled?: boolean | undefined; href?: string | undefined; target?: string | undefined; rel?: string | undefined; iconType?: string | React.ComponentClass<{}, any> | React.FunctionComponent<{}> | undefined; icon?: React.ReactElement React.ReactElement React.Component)> | null) | (new (props: any) => React.Component)> | undefined; showToolTip?: boolean | undefined; extraAction?: ({ type?: \"reset\" | \"button\" | \"submit\" | undefined; } & ", + ", \"children\" | \"type\" | \"onClick\" | \"onChange\" | \"color\" | \"onKeyDown\" | \"title\" | \"id\" | \"defaultChecked\" | \"defaultValue\" | \"suppressContentEditableWarning\" | \"suppressHydrationWarning\" | \"accessKey\" | \"className\" | \"contentEditable\" | \"contextMenu\" | \"dir\" | \"draggable\" | \"hidden\" | \"lang\" | \"placeholder\" | \"slot\" | \"spellCheck\" | \"style\" | \"tabIndex\" | \"translate\" | \"radioGroup\" | \"role\" | \"about\" | \"datatype\" | \"inlist\" | \"prefix\" | \"property\" | \"resource\" | \"typeof\" | \"vocab\" | \"autoCapitalize\" | \"autoCorrect\" | \"autoSave\" | \"itemProp\" | \"itemScope\" | \"itemType\" | \"itemID\" | \"itemRef\" | \"results\" | \"security\" | \"unselectable\" | \"inputMode\" | \"is\" | \"aria-activedescendant\" | \"aria-atomic\" | \"aria-autocomplete\" | \"aria-busy\" | \"aria-checked\" | \"aria-colcount\" | \"aria-colindex\" | \"aria-colspan\" | \"aria-controls\" | \"aria-current\" | \"aria-describedby\" | \"aria-details\" | \"aria-disabled\" | \"aria-dropeffect\" | \"aria-errormessage\" | \"aria-expanded\" | \"aria-flowto\" | \"aria-grabbed\" | \"aria-haspopup\" | \"aria-hidden\" | \"aria-invalid\" | \"aria-keyshortcuts\" | \"aria-label\" | \"aria-labelledby\" | \"aria-level\" | \"aria-live\" | \"aria-modal\" | \"aria-multiline\" | \"aria-multiselectable\" | \"aria-orientation\" | \"aria-owns\" | \"aria-placeholder\" | \"aria-posinset\" | \"aria-pressed\" | \"aria-readonly\" | \"aria-relevant\" | \"aria-required\" | \"aria-roledescription\" | \"aria-rowcount\" | \"aria-rowindex\" | \"aria-rowspan\" | \"aria-selected\" | \"aria-setsize\" | \"aria-sort\" | \"aria-valuemax\" | \"aria-valuemin\" | \"aria-valuenow\" | \"aria-valuetext\" | \"dangerouslySetInnerHTML\" | \"onCopy\" | \"onCopyCapture\" | \"onCut\" | \"onCutCapture\" | \"onPaste\" | \"onPasteCapture\" | \"onCompositionEnd\" | \"onCompositionEndCapture\" | \"onCompositionStart\" | \"onCompositionStartCapture\" | \"onCompositionUpdate\" | \"onCompositionUpdateCapture\" | \"onFocus\" | \"onFocusCapture\" | \"onBlur\" | \"onBlurCapture\" | \"onChangeCapture\" | \"onBeforeInput\" | \"onBeforeInputCapture\" | \"onInput\" | \"onInputCapture\" | \"onReset\" | \"onResetCapture\" | \"onSubmit\" | \"onSubmitCapture\" | \"onInvalid\" | \"onInvalidCapture\" | \"onLoad\" | \"onLoadCapture\" | \"onError\" | \"onErrorCapture\" | \"onKeyDownCapture\" | \"onKeyPress\" | \"onKeyPressCapture\" | \"onKeyUp\" | \"onKeyUpCapture\" | \"onAbort\" | \"onAbortCapture\" | \"onCanPlay\" | \"onCanPlayCapture\" | \"onCanPlayThrough\" | \"onCanPlayThroughCapture\" | \"onDurationChange\" | \"onDurationChangeCapture\" | \"onEmptied\" | \"onEmptiedCapture\" | \"onEncrypted\" | \"onEncryptedCapture\" | \"onEnded\" | \"onEndedCapture\" | \"onLoadedData\" | \"onLoadedDataCapture\" | \"onLoadedMetadata\" | \"onLoadedMetadataCapture\" | \"onLoadStart\" | \"onLoadStartCapture\" | \"onPause\" | \"onPauseCapture\" | \"onPlay\" | \"onPlayCapture\" | \"onPlaying\" | \"onPlayingCapture\" | \"onProgress\" | \"onProgressCapture\" | \"onRateChange\" | \"onRateChangeCapture\" | \"onSeeked\" | \"onSeekedCapture\" | \"onSeeking\" | \"onSeekingCapture\" | \"onStalled\" | \"onStalledCapture\" | \"onSuspend\" | \"onSuspendCapture\" | \"onTimeUpdate\" | \"onTimeUpdateCapture\" | \"onVolumeChange\" | \"onVolumeChangeCapture\" | \"onWaiting\" | \"onWaitingCapture\" | \"onAuxClick\" | \"onAuxClickCapture\" | \"onClickCapture\" | \"onContextMenu\" | \"onContextMenuCapture\" | \"onDoubleClick\" | \"onDoubleClickCapture\" | \"onDrag\" | \"onDragCapture\" | \"onDragEnd\" | \"onDragEndCapture\" | \"onDragEnter\" | \"onDragEnterCapture\" | \"onDragExit\" | \"onDragExitCapture\" | \"onDragLeave\" | \"onDragLeaveCapture\" | \"onDragOver\" | \"onDragOverCapture\" | \"onDragStart\" | \"onDragStartCapture\" | \"onDrop\" | \"onDropCapture\" | \"onMouseDown\" | \"onMouseDownCapture\" | \"onMouseEnter\" | \"onMouseLeave\" | \"onMouseMove\" | \"onMouseMoveCapture\" | \"onMouseOut\" | \"onMouseOutCapture\" | \"onMouseOver\" | \"onMouseOverCapture\" | \"onMouseUp\" | \"onMouseUpCapture\" | \"onSelect\" | \"onSelectCapture\" | \"onTouchCancel\" | \"onTouchCancelCapture\" | \"onTouchEnd\" | \"onTouchEndCapture\" | \"onTouchMove\" | \"onTouchMoveCapture\" | \"onTouchStart\" | \"onTouchStartCapture\" | \"onPointerDown\" | \"onPointerDownCapture\" | \"onPointerMove\" | \"onPointerMoveCapture\" | \"onPointerUp\" | \"onPointerUpCapture\" | \"onPointerCancel\" | \"onPointerCancelCapture\" | \"onPointerEnter\" | \"onPointerEnterCapture\" | \"onPointerLeave\" | \"onPointerLeaveCapture\" | \"onPointerOver\" | \"onPointerOverCapture\" | \"onPointerOut\" | \"onPointerOutCapture\" | \"onGotPointerCapture\" | \"onGotPointerCaptureCapture\" | \"onLostPointerCapture\" | \"onLostPointerCaptureCapture\" | \"onScroll\" | \"onScrollCapture\" | \"onWheel\" | \"onWheelCapture\" | \"onAnimationStart\" | \"onAnimationStartCapture\" | \"onAnimationEnd\" | \"onAnimationEndCapture\" | \"onAnimationIteration\" | \"onAnimationIterationCapture\" | \"onTransitionEnd\" | \"onTransitionEndCapture\" | \"css\" | \"download\" | \"media\" | \"target\" | \"ping\" | \"hrefLang\" | \"rel\" | \"referrerPolicy\">, React.ButtonHTMLAttributes> & React.ButtonHTMLAttributes), \"children\" | \"type\" | \"onChange\" | \"onKeyDown\" | \"title\" | \"id\" | \"name\" | \"defaultChecked\" | \"defaultValue\" | \"suppressContentEditableWarning\" | \"suppressHydrationWarning\" | \"accessKey\" | \"className\" | \"contentEditable\" | \"contextMenu\" | \"dir\" | \"draggable\" | \"hidden\" | \"lang\" | \"placeholder\" | \"slot\" | \"spellCheck\" | \"style\" | \"tabIndex\" | \"translate\" | \"radioGroup\" | \"role\" | \"about\" | \"datatype\" | \"inlist\" | \"prefix\" | \"property\" | \"resource\" | \"typeof\" | \"vocab\" | \"autoCapitalize\" | \"autoCorrect\" | \"autoSave\" | \"itemProp\" | \"itemScope\" | \"itemType\" | \"itemID\" | \"itemRef\" | \"results\" | \"security\" | \"unselectable\" | \"inputMode\" | \"is\" | \"aria-activedescendant\" | \"aria-atomic\" | \"aria-autocomplete\" | \"aria-busy\" | \"aria-checked\" | \"aria-colcount\" | \"aria-colindex\" | \"aria-colspan\" | \"aria-controls\" | \"aria-current\" | \"aria-describedby\" | \"aria-details\" | \"aria-disabled\" | \"aria-dropeffect\" | \"aria-errormessage\" | \"aria-expanded\" | \"aria-flowto\" | \"aria-grabbed\" | \"aria-haspopup\" | \"aria-hidden\" | \"aria-invalid\" | \"aria-keyshortcuts\" | \"aria-label\" | \"aria-labelledby\" | \"aria-level\" | \"aria-live\" | \"aria-modal\" | \"aria-multiline\" | \"aria-multiselectable\" | \"aria-orientation\" | \"aria-owns\" | \"aria-placeholder\" | \"aria-posinset\" | \"aria-pressed\" | \"aria-readonly\" | \"aria-relevant\" | \"aria-required\" | \"aria-roledescription\" | \"aria-rowcount\" | \"aria-rowindex\" | \"aria-rowspan\" | \"aria-selected\" | \"aria-setsize\" | \"aria-sort\" | \"aria-valuemax\" | \"aria-valuemin\" | \"aria-valuenow\" | \"aria-valuetext\" | \"dangerouslySetInnerHTML\" | \"onCopy\" | \"onCopyCapture\" | \"onCut\" | \"onCutCapture\" | \"onPaste\" | \"onPasteCapture\" | \"onCompositionEnd\" | \"onCompositionEndCapture\" | \"onCompositionStart\" | \"onCompositionStartCapture\" | \"onCompositionUpdate\" | \"onCompositionUpdateCapture\" | \"onFocus\" | \"onFocusCapture\" | \"onBlur\" | \"onBlurCapture\" | \"onChangeCapture\" | \"onBeforeInput\" | \"onBeforeInputCapture\" | \"onInput\" | \"onInputCapture\" | \"onReset\" | \"onResetCapture\" | \"onSubmit\" | \"onSubmitCapture\" | \"onInvalid\" | \"onInvalidCapture\" | \"onLoad\" | \"onLoadCapture\" | \"onError\" | \"onErrorCapture\" | \"onKeyDownCapture\" | \"onKeyPress\" | \"onKeyPressCapture\" | \"onKeyUp\" | \"onKeyUpCapture\" | \"onAbort\" | \"onAbortCapture\" | \"onCanPlay\" | \"onCanPlayCapture\" | \"onCanPlayThrough\" | \"onCanPlayThroughCapture\" | \"onDurationChange\" | \"onDurationChangeCapture\" | \"onEmptied\" | \"onEmptiedCapture\" | \"onEncrypted\" | \"onEncryptedCapture\" | \"onEnded\" | \"onEndedCapture\" | \"onLoadedData\" | \"onLoadedDataCapture\" | \"onLoadedMetadata\" | \"onLoadedMetadataCapture\" | \"onLoadStart\" | \"onLoadStartCapture\" | \"onPause\" | \"onPauseCapture\" | \"onPlay\" | \"onPlayCapture\" | \"onPlaying\" | \"onPlayingCapture\" | \"onProgress\" | \"onProgressCapture\" | \"onRateChange\" | \"onRateChangeCapture\" | \"onSeeked\" | \"onSeekedCapture\" | \"onSeeking\" | \"onSeekingCapture\" | \"onStalled\" | \"onStalledCapture\" | \"onSuspend\" | \"onSuspendCapture\" | \"onTimeUpdate\" | \"onTimeUpdateCapture\" | \"onVolumeChange\" | \"onVolumeChangeCapture\" | \"onWaiting\" | \"onWaitingCapture\" | \"onAuxClick\" | \"onAuxClickCapture\" | \"onClickCapture\" | \"onContextMenu\" | \"onContextMenuCapture\" | \"onDoubleClick\" | \"onDoubleClickCapture\" | \"onDrag\" | \"onDragCapture\" | \"onDragEnd\" | \"onDragEndCapture\" | \"onDragEnter\" | \"onDragEnterCapture\" | \"onDragExit\" | \"onDragExitCapture\" | \"onDragLeave\" | \"onDragLeaveCapture\" | \"onDragOver\" | \"onDragOverCapture\" | \"onDragStart\" | \"onDragStartCapture\" | \"onDrop\" | \"onDropCapture\" | \"onMouseDown\" | \"onMouseDownCapture\" | \"onMouseEnter\" | \"onMouseLeave\" | \"onMouseMove\" | \"onMouseMoveCapture\" | \"onMouseOut\" | \"onMouseOutCapture\" | \"onMouseOver\" | \"onMouseOverCapture\" | \"onMouseUp\" | \"onMouseUpCapture\" | \"onSelect\" | \"onSelectCapture\" | \"onTouchCancel\" | \"onTouchCancelCapture\" | \"onTouchEnd\" | \"onTouchEndCapture\" | \"onTouchMove\" | \"onTouchMoveCapture\" | \"onTouchStart\" | \"onTouchStartCapture\" | \"onPointerDown\" | \"onPointerDownCapture\" | \"onPointerMove\" | \"onPointerMoveCapture\" | \"onPointerUp\" | \"onPointerUpCapture\" | \"onPointerCancel\" | \"onPointerCancelCapture\" | \"onPointerEnter\" | \"onPointerEnterCapture\" | \"onPointerLeave\" | \"onPointerLeaveCapture\" | \"onPointerOver\" | \"onPointerOverCapture\" | \"onPointerOut\" | \"onPointerOutCapture\" | \"onGotPointerCapture\" | \"onGotPointerCaptureCapture\" | \"onLostPointerCapture\" | \"onLostPointerCaptureCapture\" | \"onScroll\" | \"onScrollCapture\" | \"onWheel\" | \"onWheelCapture\" | \"onAnimationStart\" | \"onAnimationStartCapture\" | \"onAnimationEnd\" | \"onAnimationEndCapture\" | \"onAnimationIteration\" | \"onAnimationIterationCapture\" | \"onTransitionEnd\" | \"onTransitionEndCapture\" | \"css\" | \"download\" | \"autoFocus\" | \"disabled\" | \"form\" | \"formAction\" | \"formEncType\" | \"formMethod\" | \"formNoValidate\" | \"formTarget\" | \"value\" | \"media\" | \"ping\" | \"hrefLang\" | \"referrerPolicy\"> & { size?: \"m\" | \"s\" | \"l\" | \"xs\" | undefined; color?: \"text\" | \"primary\" | \"inherit\" | \"ghost\" | \"subdued\" | undefined; label: React.ReactNode; isActive?: boolean | undefined; isDisabled?: boolean | undefined; href?: string | undefined; target?: string | undefined; rel?: string | undefined; iconType?: string | React.ComponentClass<{}, any> | React.FunctionComponent<{}> | undefined; iconProps?: Pick<", + "EuiIconProps", + ", \"string\" | \"children\" | \"from\" | \"origin\" | \"onClick\" | \"onChange\" | \"color\" | \"onKeyDown\" | \"y\" | \"d\" | \"x\" | \"title\" | \"id\" | \"operator\" | \"name\" | \"version\" | \"filter\" | \"size\" | \"format\" | \"order\" | \"className\" | \"lang\" | \"style\" | \"tabIndex\" | \"role\" | \"aria-activedescendant\" | \"aria-atomic\" | \"aria-autocomplete\" | \"aria-busy\" | \"aria-checked\" | \"aria-colcount\" | \"aria-colindex\" | \"aria-colspan\" | \"aria-controls\" | \"aria-current\" | \"aria-describedby\" | \"aria-details\" | \"aria-disabled\" | \"aria-dropeffect\" | \"aria-errormessage\" | \"aria-expanded\" | \"aria-flowto\" | \"aria-grabbed\" | \"aria-haspopup\" | \"aria-hidden\" | \"aria-invalid\" | \"aria-keyshortcuts\" | \"aria-label\" | \"aria-labelledby\" | \"aria-level\" | \"aria-live\" | \"aria-modal\" | \"aria-multiline\" | \"aria-multiselectable\" | \"aria-orientation\" | \"aria-owns\" | \"aria-placeholder\" | \"aria-posinset\" | \"aria-pressed\" | \"aria-readonly\" | \"aria-relevant\" | \"aria-required\" | \"aria-roledescription\" | \"aria-rowcount\" | \"aria-rowindex\" | \"aria-rowspan\" | \"aria-selected\" | \"aria-setsize\" | \"aria-sort\" | \"aria-valuemax\" | \"aria-valuemin\" | \"aria-valuenow\" | \"aria-valuetext\" | \"dangerouslySetInnerHTML\" | \"onCopy\" | \"onCopyCapture\" | \"onCut\" | \"onCutCapture\" | \"onPaste\" | \"onPasteCapture\" | \"onCompositionEnd\" | \"onCompositionEndCapture\" | \"onCompositionStart\" | \"onCompositionStartCapture\" | \"onCompositionUpdate\" | \"onCompositionUpdateCapture\" | \"onFocus\" | \"onFocusCapture\" | \"onBlur\" | \"onBlurCapture\" | \"onChangeCapture\" | \"onBeforeInput\" | \"onBeforeInputCapture\" | \"onInput\" | \"onInputCapture\" | \"onReset\" | \"onResetCapture\" | \"onSubmit\" | \"onSubmitCapture\" | \"onInvalid\" | \"onInvalidCapture\" | \"onLoad\" | \"onLoadCapture\" | \"onError\" | \"onErrorCapture\" | \"onKeyDownCapture\" | \"onKeyPress\" | \"onKeyPressCapture\" | \"onKeyUp\" | \"onKeyUpCapture\" | \"onAbort\" | \"onAbortCapture\" | \"onCanPlay\" | \"onCanPlayCapture\" | \"onCanPlayThrough\" | \"onCanPlayThroughCapture\" | \"onDurationChange\" | \"onDurationChangeCapture\" | \"onEmptied\" | \"onEmptiedCapture\" | \"onEncrypted\" | \"onEncryptedCapture\" | \"onEnded\" | \"onEndedCapture\" | \"onLoadedData\" | \"onLoadedDataCapture\" | \"onLoadedMetadata\" | \"onLoadedMetadataCapture\" | \"onLoadStart\" | \"onLoadStartCapture\" | \"onPause\" | \"onPauseCapture\" | \"onPlay\" | \"onPlayCapture\" | \"onPlaying\" | \"onPlayingCapture\" | \"onProgress\" | \"onProgressCapture\" | \"onRateChange\" | \"onRateChangeCapture\" | \"onSeeked\" | \"onSeekedCapture\" | \"onSeeking\" | \"onSeekingCapture\" | \"onStalled\" | \"onStalledCapture\" | \"onSuspend\" | \"onSuspendCapture\" | \"onTimeUpdate\" | \"onTimeUpdateCapture\" | \"onVolumeChange\" | \"onVolumeChangeCapture\" | \"onWaiting\" | \"onWaitingCapture\" | \"onAuxClick\" | \"onAuxClickCapture\" | \"onClickCapture\" | \"onContextMenu\" | \"onContextMenuCapture\" | \"onDoubleClick\" | \"onDoubleClickCapture\" | \"onDrag\" | \"onDragCapture\" | \"onDragEnd\" | \"onDragEndCapture\" | \"onDragEnter\" | \"onDragEnterCapture\" | \"onDragExit\" | \"onDragExitCapture\" | \"onDragLeave\" | \"onDragLeaveCapture\" | \"onDragOver\" | \"onDragOverCapture\" | \"onDragStart\" | \"onDragStartCapture\" | \"onDrop\" | \"onDropCapture\" | \"onMouseDown\" | \"onMouseDownCapture\" | \"onMouseEnter\" | \"onMouseLeave\" | \"onMouseMove\" | \"onMouseMoveCapture\" | \"onMouseOut\" | \"onMouseOutCapture\" | \"onMouseOver\" | \"onMouseOverCapture\" | \"onMouseUp\" | \"onMouseUpCapture\" | \"onSelect\" | \"onSelectCapture\" | \"onTouchCancel\" | \"onTouchCancelCapture\" | \"onTouchEnd\" | \"onTouchEndCapture\" | \"onTouchMove\" | \"onTouchMoveCapture\" | \"onTouchStart\" | \"onTouchStartCapture\" | \"onPointerDown\" | \"onPointerDownCapture\" | \"onPointerMove\" | \"onPointerMoveCapture\" | \"onPointerUp\" | \"onPointerUpCapture\" | \"onPointerCancel\" | \"onPointerCancelCapture\" | \"onPointerEnter\" | \"onPointerEnterCapture\" | \"onPointerLeave\" | \"onPointerLeaveCapture\" | \"onPointerOver\" | \"onPointerOverCapture\" | \"onPointerOut\" | \"onPointerOutCapture\" | \"onGotPointerCapture\" | \"onGotPointerCaptureCapture\" | \"onLostPointerCapture\" | \"onLostPointerCaptureCapture\" | \"onScroll\" | \"onScrollCapture\" | \"onWheel\" | \"onWheelCapture\" | \"onAnimationStart\" | \"onAnimationStartCapture\" | \"onAnimationEnd\" | \"onAnimationEndCapture\" | \"onAnimationIteration\" | \"onAnimationIterationCapture\" | \"onTransitionEnd\" | \"onTransitionEndCapture\" | \"css\" | \"data-test-subj\" | \"scale\" | \"height\" | \"max\" | \"media\" | \"method\" | \"min\" | \"target\" | \"width\" | \"crossOrigin\" | \"accentHeight\" | \"accumulate\" | \"additive\" | \"alignmentBaseline\" | \"allowReorder\" | \"alphabetic\" | \"amplitude\" | \"arabicForm\" | \"ascent\" | \"attributeName\" | \"attributeType\" | \"autoReverse\" | \"azimuth\" | \"baseFrequency\" | \"baselineShift\" | \"baseProfile\" | \"bbox\" | \"begin\" | \"bias\" | \"by\" | \"calcMode\" | \"capHeight\" | \"clip\" | \"clipPath\" | \"clipPathUnits\" | \"clipRule\" | \"colorInterpolation\" | \"colorInterpolationFilters\" | \"colorProfile\" | \"colorRendering\" | \"contentScriptType\" | \"contentStyleType\" | \"cursor\" | \"cx\" | \"cy\" | \"decelerate\" | \"descent\" | \"diffuseConstant\" | \"direction\" | \"display\" | \"divisor\" | \"dominantBaseline\" | \"dur\" | \"dx\" | \"dy\" | \"edgeMode\" | \"elevation\" | \"enableBackground\" | \"end\" | \"exponent\" | \"externalResourcesRequired\" | \"fill\" | \"fillOpacity\" | \"fillRule\" | \"filterRes\" | \"filterUnits\" | \"floodColor\" | \"floodOpacity\" | \"focusable\" | \"fontFamily\" | \"fontSize\" | \"fontSizeAdjust\" | \"fontStretch\" | \"fontStyle\" | \"fontVariant\" | \"fontWeight\" | \"fx\" | \"fy\" | \"g1\" | \"g2\" | \"glyphName\" | \"glyphOrientationHorizontal\" | \"glyphOrientationVertical\" | \"glyphRef\" | \"gradientTransform\" | \"gradientUnits\" | \"hanging\" | \"horizAdvX\" | \"horizOriginX\" | \"href\" | \"ideographic\" | \"imageRendering\" | \"in2\" | \"in\" | \"intercept\" | \"k1\" | \"k2\" | \"k3\" | \"k4\" | \"k\" | \"kernelMatrix\" | \"kernelUnitLength\" | \"kerning\" | \"keyPoints\" | \"keySplines\" | \"keyTimes\" | \"lengthAdjust\" | \"letterSpacing\" | \"lightingColor\" | \"limitingConeAngle\" | \"local\" | \"markerEnd\" | \"markerHeight\" | \"markerMid\" | \"markerStart\" | \"markerUnits\" | \"markerWidth\" | \"mask\" | \"maskContentUnits\" | \"maskUnits\" | \"mathematical\" | \"mode\" | \"numOctaves\" | \"offset\" | \"opacity\" | \"orient\" | \"orientation\" | \"overflow\" | \"overlinePosition\" | \"overlineThickness\" | \"paintOrder\" | \"panose1\" | \"path\" | \"pathLength\" | \"patternContentUnits\" | \"patternTransform\" | \"patternUnits\" | \"pointerEvents\" | \"points\" | \"pointsAtX\" | \"pointsAtY\" | \"pointsAtZ\" | \"preserveAlpha\" | \"preserveAspectRatio\" | \"primitiveUnits\" | \"r\" | \"radius\" | \"refX\" | \"refY\" | \"renderingIntent\" | \"repeatCount\" | \"repeatDur\" | \"requiredExtensions\" | \"requiredFeatures\" | \"restart\" | \"result\" | \"rotate\" | \"rx\" | \"ry\" | \"seed\" | \"shapeRendering\" | \"slope\" | \"spacing\" | \"specularConstant\" | \"specularExponent\" | \"speed\" | \"spreadMethod\" | \"startOffset\" | \"stdDeviation\" | \"stemh\" | \"stemv\" | \"stitchTiles\" | \"stopColor\" | \"stopOpacity\" | \"strikethroughPosition\" | \"strikethroughThickness\" | \"stroke\" | \"strokeDasharray\" | \"strokeDashoffset\" | \"strokeLinecap\" | \"strokeLinejoin\" | \"strokeMiterlimit\" | \"strokeOpacity\" | \"strokeWidth\" | \"surfaceScale\" | \"systemLanguage\" | \"tableValues\" | \"targetX\" | \"targetY\" | \"textAnchor\" | \"textDecoration\" | \"textLength\" | \"textRendering\" | \"to\" | \"transform\" | \"u1\" | \"u2\" | \"underlinePosition\" | \"underlineThickness\" | \"unicode\" | \"unicodeBidi\" | \"unicodeRange\" | \"unitsPerEm\" | \"vAlphabetic\" | \"values\" | \"vectorEffect\" | \"vertAdvY\" | \"vertOriginX\" | \"vertOriginY\" | \"vHanging\" | \"vIdeographic\" | \"viewBox\" | \"viewTarget\" | \"visibility\" | \"vMathematical\" | \"widths\" | \"wordSpacing\" | \"writingMode\" | \"x1\" | \"x2\" | \"xChannelSelector\" | \"xHeight\" | \"xlinkActuate\" | \"xlinkArcrole\" | \"xlinkHref\" | \"xlinkRole\" | \"xlinkShow\" | \"xlinkTitle\" | \"xlinkType\" | \"xmlBase\" | \"xmlLang\" | \"xmlns\" | \"xmlnsXlink\" | \"xmlSpace\" | \"y1\" | \"y2\" | \"yChannelSelector\" | \"z\" | \"zoomAndPan\" | \"titleId\" | \"onIconLoad\"> | undefined; icon?: React.ReactElement React.ReactElement React.Component)> | null) | (new (props: any) => React.Component)> | undefined; showToolTip?: boolean | undefined; extraAction?: ({ type?: \"reset\" | \"button\" | \"submit\" | undefined; } & ", "EuiButtonIconProps", " & { onClick?: ((event: React.MouseEvent) => void) | undefined; } & React.ButtonHTMLAttributes & { buttonRef?: ((instance: HTMLButtonElement | null) => void) | React.RefObject | null | undefined; } & { alwaysShow?: boolean | undefined; }) | undefined; onClick?: ((event: React.MouseEvent) => void) | undefined; wrapText?: boolean | undefined; buttonRef?: ((instance: HTMLButtonElement | null) => void) | React.RefObject | null | undefined; }" ], diff --git a/api_docs/rule_registry.json b/api_docs/rule_registry.json index cd1f4994c1da61..f114f1bf227516 100644 --- a/api_docs/rule_registry.json +++ b/api_docs/rule_registry.json @@ -342,6 +342,115 @@ "returnComment": [], "initialIsOpen": false }, + { + "parentPluginId": "ruleRegistry", + "id": "def-server.createPersistenceRuleTypeFactory", + "type": "Function", + "tags": [], + "label": "createPersistenceRuleTypeFactory", + "description": [], + "signature": [ + "({ logger, ruleDataClient, }: { ruleDataClient: ", + { + "pluginId": "ruleRegistry", + "scope": "server", + "docId": "kibRuleRegistryPluginApi", + "section": "def-server.RuleDataClient", + "text": "RuleDataClient" + }, + "; logger: ", + "Logger", + "; }) => , TAlertInstanceContext extends { [x: string]: unknown; }, TServices extends { alertWithPersistence: PersistenceAlertService; findAlerts: PersistenceAlertQueryService; }>(type: ", + "AlertTypeWithExecutor", + ") => { executor: (options: ", + { + "pluginId": "alerting", + "scope": "server", + "docId": "kibAlertingPluginApi", + "section": "def-server.AlertExecutorOptions", + "text": "AlertExecutorOptions" + }, + ", { [x: string]: unknown; }, TAlertInstanceContext, never> & { services: any; }) => Promise; id: string; name: string; validate?: { params?: ", + "AlertTypeParamsValidator", + " | undefined; } | undefined; actionGroups: ", + { + "pluginId": "alerting", + "scope": "common", + "docId": "kibAlertingPluginApi", + "section": "def-common.ActionGroup", + "text": "ActionGroup" + }, + "[]; defaultActionGroupId: string; recoveryActionGroup?: ", + { + "pluginId": "alerting", + "scope": "common", + "docId": "kibAlertingPluginApi", + "section": "def-common.ActionGroup", + "text": "ActionGroup" + }, + " | undefined; producer: string; actionVariables?: { context?: ", + { + "pluginId": "alerting", + "scope": "common", + "docId": "kibAlertingPluginApi", + "section": "def-common.ActionVariable", + "text": "ActionVariable" + }, + "[] | undefined; state?: ", + { + "pluginId": "alerting", + "scope": "common", + "docId": "kibAlertingPluginApi", + "section": "def-common.ActionVariable", + "text": "ActionVariable" + }, + "[] | undefined; params?: ", + { + "pluginId": "alerting", + "scope": "common", + "docId": "kibAlertingPluginApi", + "section": "def-common.ActionVariable", + "text": "ActionVariable" + }, + "[] | undefined; } | undefined; minimumLicenseRequired: \"basic\" | \"standard\" | \"gold\" | \"platinum\" | \"enterprise\" | \"trial\"; }" + ], + "source": { + "path": "x-pack/plugins/rule_registry/server/utils/create_persistence_rule_type_factory.ts", + "lineNumber": 42 + }, + "deprecated": false, + "children": [ + { + "parentPluginId": "ruleRegistry", + "id": "def-server.createPersistenceRuleTypeFactory.$1", + "type": "Object", + "tags": [], + "label": "{\n logger,\n ruleDataClient,\n}", + "description": [], + "signature": [ + "{ ruleDataClient: ", + { + "pluginId": "ruleRegistry", + "scope": "server", + "docId": "kibRuleRegistryPluginApi", + "section": "def-server.RuleDataClient", + "text": "RuleDataClient" + }, + "; logger: ", + "Logger", + "; }" + ], + "source": { + "path": "x-pack/plugins/rule_registry/server/utils/create_persistence_rule_type_factory.ts", + "lineNumber": 42 + }, + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, { "parentPluginId": "ruleRegistry", "id": "def-server.getRuleExecutorData", @@ -784,7 +893,7 @@ "signature": [ "(input: unknown) => OutputOf<", "Optional", - "<{ readonly \"kibana.rac.alert.producer\": { readonly type: \"keyword\"; }; readonly \"kibana.rac.alert.uuid\": { readonly type: \"keyword\"; }; readonly \"kibana.rac.alert.id\": { readonly type: \"keyword\"; }; readonly \"kibana.rac.alert.start\": { readonly type: \"date\"; }; readonly \"kibana.rac.alert.end\": { readonly type: \"date\"; }; readonly \"kibana.rac.alert.duration.us\": { readonly type: \"long\"; }; readonly \"kibana.rac.alert.severity.level\": { readonly type: \"keyword\"; }; readonly \"kibana.rac.alert.severity.value\": { readonly type: \"long\"; }; readonly \"kibana.rac.alert.status\": { readonly type: \"keyword\"; }; readonly \"kibana.rac.alert.evaluation.threshold\": { readonly type: \"scaled_float\"; readonly scaling_factor: 100; }; readonly \"kibana.rac.alert.evaluation.value\": { readonly type: \"scaled_float\"; readonly scaling_factor: 100; }; readonly '@timestamp': { readonly type: \"date\"; readonly array: false; readonly required: true; }; readonly tags: { readonly type: \"keyword\"; readonly array: true; readonly required: false; }; readonly 'event.kind': { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly 'event.action': { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly 'rule.uuid': { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly 'rule.id': { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly 'rule.name': { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly 'rule.category': { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; }, \"tags\" | \"kibana.rac.alert.uuid\" | \"event.kind\" | \"event.action\" | \"rule.uuid\" | \"rule.id\" | \"rule.name\" | \"rule.category\" | \"kibana.rac.alert.producer\" | \"kibana.rac.alert.id\" | \"kibana.rac.alert.start\" | \"kibana.rac.alert.end\" | \"kibana.rac.alert.duration.us\" | \"kibana.rac.alert.severity.level\" | \"kibana.rac.alert.severity.value\" | \"kibana.rac.alert.status\" | \"kibana.rac.alert.evaluation.threshold\" | \"kibana.rac.alert.evaluation.value\">>" + "<{ readonly \"kibana.rac.alert.producer\": { readonly type: \"keyword\"; }; readonly \"kibana.rac.alert.uuid\": { readonly type: \"keyword\"; }; readonly \"kibana.rac.alert.id\": { readonly type: \"keyword\"; }; readonly \"kibana.rac.alert.start\": { readonly type: \"date\"; }; readonly \"kibana.rac.alert.end\": { readonly type: \"date\"; }; readonly \"kibana.rac.alert.duration.us\": { readonly type: \"long\"; }; readonly \"kibana.rac.alert.severity.level\": { readonly type: \"keyword\"; }; readonly \"kibana.rac.alert.severity.value\": { readonly type: \"long\"; }; readonly \"kibana.rac.alert.status\": { readonly type: \"keyword\"; }; readonly \"kibana.rac.alert.evaluation.threshold\": { readonly type: \"scaled_float\"; readonly scaling_factor: 100; }; readonly \"kibana.rac.alert.evaluation.value\": { readonly type: \"scaled_float\"; readonly scaling_factor: 100; }; readonly tags: { readonly type: \"keyword\"; readonly array: true; readonly required: false; }; readonly '@timestamp': { readonly type: \"date\"; readonly array: false; readonly required: true; }; readonly 'event.kind': { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly 'event.action': { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly 'rule.uuid': { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly 'rule.id': { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly 'rule.name': { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly 'rule.category': { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; }, \"tags\" | \"kibana.rac.alert.uuid\" | \"event.kind\" | \"event.action\" | \"rule.uuid\" | \"rule.id\" | \"rule.name\" | \"rule.category\" | \"kibana.rac.alert.producer\" | \"kibana.rac.alert.id\" | \"kibana.rac.alert.start\" | \"kibana.rac.alert.end\" | \"kibana.rac.alert.duration.us\" | \"kibana.rac.alert.severity.level\" | \"kibana.rac.alert.severity.value\" | \"kibana.rac.alert.status\" | \"kibana.rac.alert.evaluation.threshold\" | \"kibana.rac.alert.evaluation.value\">>" ], "source": { "path": "x-pack/plugins/rule_registry/common/parse_technical_fields.ts", diff --git a/api_docs/saved_objects.json b/api_docs/saved_objects.json index 48579ca8e589e0..6c2e7cc262cf36 100644 --- a/api_docs/saved_objects.json +++ b/api_docs/saved_objects.json @@ -781,15 +781,15 @@ { "plugin": "dashboard", "link": { - "path": "src/plugins/dashboard/public/application/types.ts", - "lineNumber": 25 + "path": "src/plugins/dashboard/public/types.ts", + "lineNumber": 33 } }, { "plugin": "dashboard", "link": { - "path": "src/plugins/dashboard/public/application/types.ts", - "lineNumber": 74 + "path": "src/plugins/dashboard/public/types.ts", + "lineNumber": 186 } }, { @@ -803,7 +803,7 @@ "plugin": "dashboard", "link": { "path": "src/plugins/dashboard/public/plugin.tsx", - "lineNumber": 126 + "lineNumber": 127 } }, { @@ -1383,7 +1383,7 @@ "plugin": "embeddable", "link": { "path": "src/plugins/embeddable/public/lib/attribute_service/attribute_service.tsx", - "lineNumber": 167 + "lineNumber": 165 } }, { @@ -2670,42 +2670,42 @@ "plugin": "dashboard", "link": { "path": "src/plugins/dashboard/public/saved_dashboards/saved_dashboard.ts", - "lineNumber": 18 + "lineNumber": 19 } }, { "plugin": "dashboard", "link": { - "path": "src/plugins/dashboard/public/application/actions/clone_panel_action.tsx", - "lineNumber": 14 + "path": "src/plugins/dashboard/public/application/lib/dashboard_tagging.ts", + "lineNumber": 10 } }, { "plugin": "dashboard", "link": { - "path": "src/plugins/dashboard/public/application/actions/clone_panel_action.tsx", - "lineNumber": 98 + "path": "src/plugins/dashboard/public/application/lib/dashboard_tagging.ts", + "lineNumber": 15 } }, { "plugin": "dashboard", "link": { "path": "src/plugins/dashboard/public/application/actions/clone_panel_action.tsx", - "lineNumber": 126 + "lineNumber": 14 } }, { "plugin": "dashboard", "link": { - "path": "src/plugins/dashboard/public/application/hooks/use_dashboard_state_manager.ts", - "lineNumber": 23 + "path": "src/plugins/dashboard/public/application/actions/clone_panel_action.tsx", + "lineNumber": 98 } }, { "plugin": "dashboard", "link": { - "path": "src/plugins/dashboard/public/application/hooks/use_dashboard_state_manager.ts", - "lineNumber": 35 + "path": "src/plugins/dashboard/public/application/actions/clone_panel_action.tsx", + "lineNumber": 126 } }, { @@ -4337,7 +4337,7 @@ "plugin": "dashboard", "link": { "path": "src/plugins/dashboard/public/saved_dashboards/saved_dashboard.ts", - "lineNumber": 41 + "lineNumber": 42 } } ] @@ -4364,14 +4364,14 @@ "plugin": "dashboard", "link": { "path": "src/plugins/dashboard/public/application/listing/dashboard_listing.tsx", - "lineNumber": 87 + "lineNumber": 92 } }, { "plugin": "dashboard", "link": { "path": "src/plugins/dashboard/public/application/listing/dashboard_listing.tsx", - "lineNumber": 172 + "lineNumber": 177 } }, { diff --git a/api_docs/saved_objects_management.json b/api_docs/saved_objects_management.json index 5d95b713715fa6..8e8e7850261a34 100644 --- a/api_docs/saved_objects_management.json +++ b/api_docs/saved_objects_management.json @@ -987,7 +987,7 @@ "label": "euiColumn", "description": [], "signature": [ - "{ children?: React.ReactNode; headers?: string | undefined; onClick?: ((event: React.MouseEvent) => void) | undefined; onChange?: ((event: React.FormEvent) => void) | undefined; color?: string | undefined; onKeyDown?: ((event: React.KeyboardEvent) => void) | undefined; description?: string | undefined; title?: string | undefined; id?: string | undefined; name: React.ReactNode; field: string; defaultChecked?: boolean | undefined; defaultValue?: string | number | string[] | undefined; suppressContentEditableWarning?: boolean | undefined; suppressHydrationWarning?: boolean | undefined; accessKey?: string | undefined; className?: string | undefined; contentEditable?: boolean | \"true\" | \"false\" | \"inherit\" | undefined; contextMenu?: string | undefined; dir?: string | undefined; draggable?: boolean | \"true\" | \"false\" | undefined; hidden?: boolean | undefined; lang?: string | undefined; placeholder?: string | undefined; slot?: string | undefined; spellCheck?: boolean | \"true\" | \"false\" | undefined; style?: React.CSSProperties | undefined; tabIndex?: number | undefined; translate?: \"yes\" | \"no\" | undefined; radioGroup?: string | undefined; role?: string | undefined; about?: string | undefined; datatype?: string | undefined; inlist?: any; prefix?: string | undefined; property?: string | undefined; resource?: string | undefined; typeof?: string | undefined; vocab?: string | undefined; autoCapitalize?: string | undefined; autoCorrect?: string | undefined; autoSave?: string | undefined; itemProp?: string | undefined; itemScope?: boolean | undefined; itemType?: string | undefined; itemID?: string | undefined; itemRef?: string | undefined; results?: number | undefined; security?: string | undefined; unselectable?: \"on\" | \"off\" | undefined; inputMode?: \"text\" | \"none\" | \"search\" | \"email\" | \"tel\" | \"url\" | \"numeric\" | \"decimal\" | undefined; is?: string | undefined; 'aria-activedescendant'?: string | undefined; 'aria-atomic'?: boolean | \"true\" | \"false\" | undefined; 'aria-autocomplete'?: \"none\" | \"list\" | \"inline\" | \"both\" | undefined; 'aria-busy'?: boolean | \"true\" | \"false\" | undefined; 'aria-checked'?: boolean | \"mixed\" | \"true\" | \"false\" | undefined; 'aria-colcount'?: number | undefined; 'aria-colindex'?: number | undefined; 'aria-colspan'?: number | undefined; 'aria-controls'?: string | undefined; 'aria-current'?: boolean | \"date\" | \"location\" | \"page\" | \"true\" | \"false\" | \"step\" | \"time\" | undefined; 'aria-describedby'?: string | undefined; 'aria-details'?: string | undefined; 'aria-disabled'?: boolean | \"true\" | \"false\" | undefined; 'aria-dropeffect'?: \"none\" | \"copy\" | \"link\" | \"execute\" | \"move\" | \"popup\" | undefined; 'aria-errormessage'?: string | undefined; 'aria-expanded'?: boolean | \"true\" | \"false\" | undefined; 'aria-flowto'?: string | undefined; 'aria-grabbed'?: boolean | \"true\" | \"false\" | undefined; 'aria-haspopup'?: boolean | \"grid\" | \"menu\" | \"true\" | \"false\" | \"listbox\" | \"tree\" | \"dialog\" | undefined; 'aria-hidden'?: boolean | \"true\" | \"false\" | undefined; 'aria-invalid'?: boolean | \"true\" | \"false\" | \"grammar\" | \"spelling\" | undefined; 'aria-keyshortcuts'?: string | undefined; 'aria-label'?: string | undefined; 'aria-labelledby'?: string | undefined; 'aria-level'?: number | undefined; 'aria-live'?: \"off\" | \"assertive\" | \"polite\" | undefined; 'aria-modal'?: boolean | \"true\" | \"false\" | undefined; 'aria-multiline'?: boolean | \"true\" | \"false\" | undefined; 'aria-multiselectable'?: boolean | \"true\" | \"false\" | undefined; 'aria-orientation'?: \"horizontal\" | \"vertical\" | undefined; 'aria-owns'?: string | undefined; 'aria-placeholder'?: string | undefined; 'aria-posinset'?: number | undefined; 'aria-pressed'?: boolean | \"mixed\" | \"true\" | \"false\" | undefined; 'aria-readonly'?: boolean | \"true\" | \"false\" | undefined; 'aria-relevant'?: \"text\" | \"additions\" | \"additions text\" | \"all\" | \"removals\" | undefined; 'aria-required'?: boolean | \"true\" | \"false\" | undefined; 'aria-roledescription'?: string | undefined; 'aria-rowcount'?: number | undefined; 'aria-rowindex'?: number | undefined; 'aria-rowspan'?: number | undefined; 'aria-selected'?: boolean | \"true\" | \"false\" | undefined; 'aria-setsize'?: number | undefined; 'aria-sort'?: \"none\" | \"ascending\" | \"descending\" | \"other\" | undefined; 'aria-valuemax'?: number | undefined; 'aria-valuemin'?: number | undefined; 'aria-valuenow'?: number | undefined; 'aria-valuetext'?: string | undefined; dangerouslySetInnerHTML?: { __html: string; } | undefined; onCopy?: ((event: React.ClipboardEvent) => void) | undefined; onCopyCapture?: ((event: React.ClipboardEvent) => void) | undefined; onCut?: ((event: React.ClipboardEvent) => void) | undefined; onCutCapture?: ((event: React.ClipboardEvent) => void) | undefined; onPaste?: ((event: React.ClipboardEvent) => void) | undefined; onPasteCapture?: ((event: React.ClipboardEvent) => void) | undefined; onCompositionEnd?: ((event: React.CompositionEvent) => void) | undefined; onCompositionEndCapture?: ((event: React.CompositionEvent) => void) | undefined; onCompositionStart?: ((event: React.CompositionEvent) => void) | undefined; onCompositionStartCapture?: ((event: React.CompositionEvent) => void) | undefined; onCompositionUpdate?: ((event: React.CompositionEvent) => void) | undefined; onCompositionUpdateCapture?: ((event: React.CompositionEvent) => void) | undefined; onFocus?: ((event: React.FocusEvent) => void) | undefined; onFocusCapture?: ((event: React.FocusEvent) => void) | undefined; onBlur?: ((event: React.FocusEvent) => void) | undefined; onBlurCapture?: ((event: React.FocusEvent) => void) | undefined; onChangeCapture?: ((event: React.FormEvent) => void) | undefined; onBeforeInput?: ((event: React.FormEvent) => void) | undefined; onBeforeInputCapture?: ((event: React.FormEvent) => void) | undefined; onInput?: ((event: React.FormEvent) => void) | undefined; onInputCapture?: ((event: React.FormEvent) => void) | undefined; onReset?: ((event: React.FormEvent) => void) | undefined; onResetCapture?: ((event: React.FormEvent) => void) | undefined; onSubmit?: ((event: React.FormEvent) => void) | undefined; onSubmitCapture?: ((event: React.FormEvent) => void) | undefined; onInvalid?: ((event: React.FormEvent) => void) | undefined; onInvalidCapture?: ((event: React.FormEvent) => void) | undefined; onLoad?: ((event: React.SyntheticEvent) => void) | undefined; onLoadCapture?: ((event: React.SyntheticEvent) => void) | undefined; onError?: ((event: React.SyntheticEvent) => void) | undefined; onErrorCapture?: ((event: React.SyntheticEvent) => void) | undefined; onKeyDownCapture?: ((event: React.KeyboardEvent) => void) | undefined; onKeyPress?: ((event: React.KeyboardEvent) => void) | undefined; onKeyPressCapture?: ((event: React.KeyboardEvent) => void) | undefined; onKeyUp?: ((event: React.KeyboardEvent) => void) | undefined; onKeyUpCapture?: ((event: React.KeyboardEvent) => void) | undefined; onAbort?: ((event: React.SyntheticEvent) => void) | undefined; onAbortCapture?: ((event: React.SyntheticEvent) => void) | undefined; onCanPlay?: ((event: React.SyntheticEvent) => void) | undefined; onCanPlayCapture?: ((event: React.SyntheticEvent) => void) | undefined; onCanPlayThrough?: ((event: React.SyntheticEvent) => void) | undefined; onCanPlayThroughCapture?: ((event: React.SyntheticEvent) => void) | undefined; onDurationChange?: ((event: React.SyntheticEvent) => void) | undefined; onDurationChangeCapture?: ((event: React.SyntheticEvent) => void) | undefined; onEmptied?: ((event: React.SyntheticEvent) => void) | undefined; onEmptiedCapture?: ((event: React.SyntheticEvent) => void) | undefined; onEncrypted?: ((event: React.SyntheticEvent) => void) | undefined; onEncryptedCapture?: ((event: React.SyntheticEvent) => void) | undefined; onEnded?: ((event: React.SyntheticEvent) => void) | undefined; onEndedCapture?: ((event: React.SyntheticEvent) => void) | undefined; onLoadedData?: ((event: React.SyntheticEvent) => void) | undefined; onLoadedDataCapture?: ((event: React.SyntheticEvent) => void) | undefined; onLoadedMetadata?: ((event: React.SyntheticEvent) => void) | undefined; onLoadedMetadataCapture?: ((event: React.SyntheticEvent) => void) | undefined; onLoadStart?: ((event: React.SyntheticEvent) => void) | undefined; onLoadStartCapture?: ((event: React.SyntheticEvent) => void) | undefined; onPause?: ((event: React.SyntheticEvent) => void) | undefined; onPauseCapture?: ((event: React.SyntheticEvent) => void) | undefined; onPlay?: ((event: React.SyntheticEvent) => void) | undefined; onPlayCapture?: ((event: React.SyntheticEvent) => void) | undefined; onPlaying?: ((event: React.SyntheticEvent) => void) | undefined; onPlayingCapture?: ((event: React.SyntheticEvent) => void) | undefined; onProgress?: ((event: React.SyntheticEvent) => void) | undefined; onProgressCapture?: ((event: React.SyntheticEvent) => void) | undefined; onRateChange?: ((event: React.SyntheticEvent) => void) | undefined; onRateChangeCapture?: ((event: React.SyntheticEvent) => void) | undefined; onSeeked?: ((event: React.SyntheticEvent) => void) | undefined; onSeekedCapture?: ((event: React.SyntheticEvent) => void) | undefined; onSeeking?: ((event: React.SyntheticEvent) => void) | undefined; onSeekingCapture?: ((event: React.SyntheticEvent) => void) | undefined; onStalled?: ((event: React.SyntheticEvent) => void) | undefined; onStalledCapture?: ((event: React.SyntheticEvent) => void) | undefined; onSuspend?: ((event: React.SyntheticEvent) => void) | undefined; onSuspendCapture?: ((event: React.SyntheticEvent) => void) | undefined; onTimeUpdate?: ((event: React.SyntheticEvent) => void) | undefined; onTimeUpdateCapture?: ((event: React.SyntheticEvent) => void) | undefined; onVolumeChange?: ((event: React.SyntheticEvent) => void) | undefined; onVolumeChangeCapture?: ((event: React.SyntheticEvent) => void) | undefined; onWaiting?: ((event: React.SyntheticEvent) => void) | undefined; onWaitingCapture?: ((event: React.SyntheticEvent) => void) | undefined; onAuxClick?: ((event: React.MouseEvent) => void) | undefined; onAuxClickCapture?: ((event: React.MouseEvent) => void) | undefined; onClickCapture?: ((event: React.MouseEvent) => void) | undefined; onContextMenu?: ((event: React.MouseEvent) => void) | undefined; onContextMenuCapture?: ((event: React.MouseEvent) => void) | undefined; onDoubleClick?: ((event: React.MouseEvent) => void) | undefined; onDoubleClickCapture?: ((event: React.MouseEvent) => void) | undefined; onDrag?: ((event: React.DragEvent) => void) | undefined; onDragCapture?: ((event: React.DragEvent) => void) | undefined; onDragEnd?: ((event: React.DragEvent) => void) | undefined; onDragEndCapture?: ((event: React.DragEvent) => void) | undefined; onDragEnter?: ((event: React.DragEvent) => void) | undefined; onDragEnterCapture?: ((event: React.DragEvent) => void) | undefined; onDragExit?: ((event: React.DragEvent) => void) | undefined; onDragExitCapture?: ((event: React.DragEvent) => void) | undefined; onDragLeave?: ((event: React.DragEvent) => void) | undefined; onDragLeaveCapture?: ((event: React.DragEvent) => void) | undefined; onDragOver?: ((event: React.DragEvent) => void) | undefined; onDragOverCapture?: ((event: React.DragEvent) => void) | undefined; onDragStart?: ((event: React.DragEvent) => void) | undefined; onDragStartCapture?: ((event: React.DragEvent) => void) | undefined; onDrop?: ((event: React.DragEvent) => void) | undefined; onDropCapture?: ((event: React.DragEvent) => void) | undefined; onMouseDown?: ((event: React.MouseEvent) => void) | undefined; onMouseDownCapture?: ((event: React.MouseEvent) => void) | undefined; onMouseEnter?: ((event: React.MouseEvent) => void) | undefined; onMouseLeave?: ((event: React.MouseEvent) => void) | undefined; onMouseMove?: ((event: React.MouseEvent) => void) | undefined; onMouseMoveCapture?: ((event: React.MouseEvent) => void) | undefined; onMouseOut?: ((event: React.MouseEvent) => void) | undefined; onMouseOutCapture?: ((event: React.MouseEvent) => void) | undefined; onMouseOver?: ((event: React.MouseEvent) => void) | undefined; onMouseOverCapture?: ((event: React.MouseEvent) => void) | undefined; onMouseUp?: ((event: React.MouseEvent) => void) | undefined; onMouseUpCapture?: ((event: React.MouseEvent) => void) | undefined; onSelect?: ((event: React.SyntheticEvent) => void) | undefined; onSelectCapture?: ((event: React.SyntheticEvent) => void) | undefined; onTouchCancel?: ((event: React.TouchEvent) => void) | undefined; onTouchCancelCapture?: ((event: React.TouchEvent) => void) | undefined; onTouchEnd?: ((event: React.TouchEvent) => void) | undefined; onTouchEndCapture?: ((event: React.TouchEvent) => void) | undefined; onTouchMove?: ((event: React.TouchEvent) => void) | undefined; onTouchMoveCapture?: ((event: React.TouchEvent) => void) | undefined; onTouchStart?: ((event: React.TouchEvent) => void) | undefined; onTouchStartCapture?: ((event: React.TouchEvent) => void) | undefined; onPointerDown?: ((event: React.PointerEvent) => void) | undefined; onPointerDownCapture?: ((event: React.PointerEvent) => void) | undefined; onPointerMove?: ((event: React.PointerEvent) => void) | undefined; onPointerMoveCapture?: ((event: React.PointerEvent) => void) | undefined; onPointerUp?: ((event: React.PointerEvent) => void) | undefined; onPointerUpCapture?: ((event: React.PointerEvent) => void) | undefined; onPointerCancel?: ((event: React.PointerEvent) => void) | undefined; onPointerCancelCapture?: ((event: React.PointerEvent) => void) | undefined; onPointerEnter?: ((event: React.PointerEvent) => void) | undefined; onPointerEnterCapture?: ((event: React.PointerEvent) => void) | undefined; onPointerLeave?: ((event: React.PointerEvent) => void) | undefined; onPointerLeaveCapture?: ((event: React.PointerEvent) => void) | undefined; onPointerOver?: ((event: React.PointerEvent) => void) | undefined; onPointerOverCapture?: ((event: React.PointerEvent) => void) | undefined; onPointerOut?: ((event: React.PointerEvent) => void) | undefined; onPointerOutCapture?: ((event: React.PointerEvent) => void) | undefined; onGotPointerCapture?: ((event: React.PointerEvent) => void) | undefined; onGotPointerCaptureCapture?: ((event: React.PointerEvent) => void) | undefined; onLostPointerCapture?: ((event: React.PointerEvent) => void) | undefined; onLostPointerCaptureCapture?: ((event: React.PointerEvent) => void) | undefined; onScroll?: ((event: React.UIEvent) => void) | undefined; onScrollCapture?: ((event: React.UIEvent) => void) | undefined; onWheel?: ((event: React.WheelEvent) => void) | undefined; onWheelCapture?: ((event: React.WheelEvent) => void) | undefined; onAnimationStart?: ((event: React.AnimationEvent) => void) | undefined; onAnimationStartCapture?: ((event: React.AnimationEvent) => void) | undefined; onAnimationEnd?: ((event: React.AnimationEvent) => void) | undefined; onAnimationEndCapture?: ((event: React.AnimationEvent) => void) | undefined; onAnimationIteration?: ((event: React.AnimationEvent) => void) | undefined; onAnimationIterationCapture?: ((event: React.AnimationEvent) => void) | undefined; onTransitionEnd?: ((event: React.TransitionEvent) => void) | undefined; onTransitionEndCapture?: ((event: React.TransitionEvent) => void) | undefined; css?: ", + "{ children?: React.ReactNode; headers?: string | undefined; onClick?: ((event: React.MouseEvent) => void) | undefined; onChange?: ((event: React.FormEvent) => void) | undefined; color?: string | undefined; onKeyDown?: ((event: React.KeyboardEvent) => void) | undefined; description?: string | undefined; title?: string | undefined; id?: string | undefined; name: React.ReactNode; field: string; defaultChecked?: boolean | undefined; defaultValue?: string | number | string[] | undefined; suppressContentEditableWarning?: boolean | undefined; suppressHydrationWarning?: boolean | undefined; accessKey?: string | undefined; className?: string | undefined; contentEditable?: boolean | \"true\" | \"false\" | \"inherit\" | undefined; contextMenu?: string | undefined; dir?: string | undefined; draggable?: boolean | \"true\" | \"false\" | undefined; hidden?: boolean | undefined; lang?: string | undefined; placeholder?: string | undefined; slot?: string | undefined; spellCheck?: boolean | \"true\" | \"false\" | undefined; style?: React.CSSProperties | undefined; tabIndex?: number | undefined; translate?: \"yes\" | \"no\" | undefined; radioGroup?: string | undefined; role?: string | undefined; about?: string | undefined; datatype?: string | undefined; inlist?: any; prefix?: string | undefined; property?: string | undefined; resource?: string | undefined; typeof?: string | undefined; vocab?: string | undefined; autoCapitalize?: string | undefined; autoCorrect?: string | undefined; autoSave?: string | undefined; itemProp?: string | undefined; itemScope?: boolean | undefined; itemType?: string | undefined; itemID?: string | undefined; itemRef?: string | undefined; results?: number | undefined; security?: string | undefined; unselectable?: \"on\" | \"off\" | undefined; inputMode?: \"none\" | \"text\" | \"search\" | \"email\" | \"tel\" | \"url\" | \"numeric\" | \"decimal\" | undefined; is?: string | undefined; 'aria-activedescendant'?: string | undefined; 'aria-atomic'?: boolean | \"true\" | \"false\" | undefined; 'aria-autocomplete'?: \"none\" | \"list\" | \"inline\" | \"both\" | undefined; 'aria-busy'?: boolean | \"true\" | \"false\" | undefined; 'aria-checked'?: boolean | \"mixed\" | \"true\" | \"false\" | undefined; 'aria-colcount'?: number | undefined; 'aria-colindex'?: number | undefined; 'aria-colspan'?: number | undefined; 'aria-controls'?: string | undefined; 'aria-current'?: boolean | \"date\" | \"location\" | \"page\" | \"true\" | \"false\" | \"step\" | \"time\" | undefined; 'aria-describedby'?: string | undefined; 'aria-details'?: string | undefined; 'aria-disabled'?: boolean | \"true\" | \"false\" | undefined; 'aria-dropeffect'?: \"none\" | \"copy\" | \"link\" | \"execute\" | \"move\" | \"popup\" | undefined; 'aria-errormessage'?: string | undefined; 'aria-expanded'?: boolean | \"true\" | \"false\" | undefined; 'aria-flowto'?: string | undefined; 'aria-grabbed'?: boolean | \"true\" | \"false\" | undefined; 'aria-haspopup'?: boolean | \"grid\" | \"menu\" | \"true\" | \"false\" | \"listbox\" | \"tree\" | \"dialog\" | undefined; 'aria-hidden'?: boolean | \"true\" | \"false\" | undefined; 'aria-invalid'?: boolean | \"true\" | \"false\" | \"grammar\" | \"spelling\" | undefined; 'aria-keyshortcuts'?: string | undefined; 'aria-label'?: string | undefined; 'aria-labelledby'?: string | undefined; 'aria-level'?: number | undefined; 'aria-live'?: \"off\" | \"assertive\" | \"polite\" | undefined; 'aria-modal'?: boolean | \"true\" | \"false\" | undefined; 'aria-multiline'?: boolean | \"true\" | \"false\" | undefined; 'aria-multiselectable'?: boolean | \"true\" | \"false\" | undefined; 'aria-orientation'?: \"horizontal\" | \"vertical\" | undefined; 'aria-owns'?: string | undefined; 'aria-placeholder'?: string | undefined; 'aria-posinset'?: number | undefined; 'aria-pressed'?: boolean | \"mixed\" | \"true\" | \"false\" | undefined; 'aria-readonly'?: boolean | \"true\" | \"false\" | undefined; 'aria-relevant'?: \"all\" | \"text\" | \"additions\" | \"additions text\" | \"removals\" | undefined; 'aria-required'?: boolean | \"true\" | \"false\" | undefined; 'aria-roledescription'?: string | undefined; 'aria-rowcount'?: number | undefined; 'aria-rowindex'?: number | undefined; 'aria-rowspan'?: number | undefined; 'aria-selected'?: boolean | \"true\" | \"false\" | undefined; 'aria-setsize'?: number | undefined; 'aria-sort'?: \"none\" | \"ascending\" | \"descending\" | \"other\" | undefined; 'aria-valuemax'?: number | undefined; 'aria-valuemin'?: number | undefined; 'aria-valuenow'?: number | undefined; 'aria-valuetext'?: string | undefined; dangerouslySetInnerHTML?: { __html: string; } | undefined; onCopy?: ((event: React.ClipboardEvent) => void) | undefined; onCopyCapture?: ((event: React.ClipboardEvent) => void) | undefined; onCut?: ((event: React.ClipboardEvent) => void) | undefined; onCutCapture?: ((event: React.ClipboardEvent) => void) | undefined; onPaste?: ((event: React.ClipboardEvent) => void) | undefined; onPasteCapture?: ((event: React.ClipboardEvent) => void) | undefined; onCompositionEnd?: ((event: React.CompositionEvent) => void) | undefined; onCompositionEndCapture?: ((event: React.CompositionEvent) => void) | undefined; onCompositionStart?: ((event: React.CompositionEvent) => void) | undefined; onCompositionStartCapture?: ((event: React.CompositionEvent) => void) | undefined; onCompositionUpdate?: ((event: React.CompositionEvent) => void) | undefined; onCompositionUpdateCapture?: ((event: React.CompositionEvent) => void) | undefined; onFocus?: ((event: React.FocusEvent) => void) | undefined; onFocusCapture?: ((event: React.FocusEvent) => void) | undefined; onBlur?: ((event: React.FocusEvent) => void) | undefined; onBlurCapture?: ((event: React.FocusEvent) => void) | undefined; onChangeCapture?: ((event: React.FormEvent) => void) | undefined; onBeforeInput?: ((event: React.FormEvent) => void) | undefined; onBeforeInputCapture?: ((event: React.FormEvent) => void) | undefined; onInput?: ((event: React.FormEvent) => void) | undefined; onInputCapture?: ((event: React.FormEvent) => void) | undefined; onReset?: ((event: React.FormEvent) => void) | undefined; onResetCapture?: ((event: React.FormEvent) => void) | undefined; onSubmit?: ((event: React.FormEvent) => void) | undefined; onSubmitCapture?: ((event: React.FormEvent) => void) | undefined; onInvalid?: ((event: React.FormEvent) => void) | undefined; onInvalidCapture?: ((event: React.FormEvent) => void) | undefined; onLoad?: ((event: React.SyntheticEvent) => void) | undefined; onLoadCapture?: ((event: React.SyntheticEvent) => void) | undefined; onError?: ((event: React.SyntheticEvent) => void) | undefined; onErrorCapture?: ((event: React.SyntheticEvent) => void) | undefined; onKeyDownCapture?: ((event: React.KeyboardEvent) => void) | undefined; onKeyPress?: ((event: React.KeyboardEvent) => void) | undefined; onKeyPressCapture?: ((event: React.KeyboardEvent) => void) | undefined; onKeyUp?: ((event: React.KeyboardEvent) => void) | undefined; onKeyUpCapture?: ((event: React.KeyboardEvent) => void) | undefined; onAbort?: ((event: React.SyntheticEvent) => void) | undefined; onAbortCapture?: ((event: React.SyntheticEvent) => void) | undefined; onCanPlay?: ((event: React.SyntheticEvent) => void) | undefined; onCanPlayCapture?: ((event: React.SyntheticEvent) => void) | undefined; onCanPlayThrough?: ((event: React.SyntheticEvent) => void) | undefined; onCanPlayThroughCapture?: ((event: React.SyntheticEvent) => void) | undefined; onDurationChange?: ((event: React.SyntheticEvent) => void) | undefined; onDurationChangeCapture?: ((event: React.SyntheticEvent) => void) | undefined; onEmptied?: ((event: React.SyntheticEvent) => void) | undefined; onEmptiedCapture?: ((event: React.SyntheticEvent) => void) | undefined; onEncrypted?: ((event: React.SyntheticEvent) => void) | undefined; onEncryptedCapture?: ((event: React.SyntheticEvent) => void) | undefined; onEnded?: ((event: React.SyntheticEvent) => void) | undefined; onEndedCapture?: ((event: React.SyntheticEvent) => void) | undefined; onLoadedData?: ((event: React.SyntheticEvent) => void) | undefined; onLoadedDataCapture?: ((event: React.SyntheticEvent) => void) | undefined; onLoadedMetadata?: ((event: React.SyntheticEvent) => void) | undefined; onLoadedMetadataCapture?: ((event: React.SyntheticEvent) => void) | undefined; onLoadStart?: ((event: React.SyntheticEvent) => void) | undefined; onLoadStartCapture?: ((event: React.SyntheticEvent) => void) | undefined; onPause?: ((event: React.SyntheticEvent) => void) | undefined; onPauseCapture?: ((event: React.SyntheticEvent) => void) | undefined; onPlay?: ((event: React.SyntheticEvent) => void) | undefined; onPlayCapture?: ((event: React.SyntheticEvent) => void) | undefined; onPlaying?: ((event: React.SyntheticEvent) => void) | undefined; onPlayingCapture?: ((event: React.SyntheticEvent) => void) | undefined; onProgress?: ((event: React.SyntheticEvent) => void) | undefined; onProgressCapture?: ((event: React.SyntheticEvent) => void) | undefined; onRateChange?: ((event: React.SyntheticEvent) => void) | undefined; onRateChangeCapture?: ((event: React.SyntheticEvent) => void) | undefined; onSeeked?: ((event: React.SyntheticEvent) => void) | undefined; onSeekedCapture?: ((event: React.SyntheticEvent) => void) | undefined; onSeeking?: ((event: React.SyntheticEvent) => void) | undefined; onSeekingCapture?: ((event: React.SyntheticEvent) => void) | undefined; onStalled?: ((event: React.SyntheticEvent) => void) | undefined; onStalledCapture?: ((event: React.SyntheticEvent) => void) | undefined; onSuspend?: ((event: React.SyntheticEvent) => void) | undefined; onSuspendCapture?: ((event: React.SyntheticEvent) => void) | undefined; onTimeUpdate?: ((event: React.SyntheticEvent) => void) | undefined; onTimeUpdateCapture?: ((event: React.SyntheticEvent) => void) | undefined; onVolumeChange?: ((event: React.SyntheticEvent) => void) | undefined; onVolumeChangeCapture?: ((event: React.SyntheticEvent) => void) | undefined; onWaiting?: ((event: React.SyntheticEvent) => void) | undefined; onWaitingCapture?: ((event: React.SyntheticEvent) => void) | undefined; onAuxClick?: ((event: React.MouseEvent) => void) | undefined; onAuxClickCapture?: ((event: React.MouseEvent) => void) | undefined; onClickCapture?: ((event: React.MouseEvent) => void) | undefined; onContextMenu?: ((event: React.MouseEvent) => void) | undefined; onContextMenuCapture?: ((event: React.MouseEvent) => void) | undefined; onDoubleClick?: ((event: React.MouseEvent) => void) | undefined; onDoubleClickCapture?: ((event: React.MouseEvent) => void) | undefined; onDrag?: ((event: React.DragEvent) => void) | undefined; onDragCapture?: ((event: React.DragEvent) => void) | undefined; onDragEnd?: ((event: React.DragEvent) => void) | undefined; onDragEndCapture?: ((event: React.DragEvent) => void) | undefined; onDragEnter?: ((event: React.DragEvent) => void) | undefined; onDragEnterCapture?: ((event: React.DragEvent) => void) | undefined; onDragExit?: ((event: React.DragEvent) => void) | undefined; onDragExitCapture?: ((event: React.DragEvent) => void) | undefined; onDragLeave?: ((event: React.DragEvent) => void) | undefined; onDragLeaveCapture?: ((event: React.DragEvent) => void) | undefined; onDragOver?: ((event: React.DragEvent) => void) | undefined; onDragOverCapture?: ((event: React.DragEvent) => void) | undefined; onDragStart?: ((event: React.DragEvent) => void) | undefined; onDragStartCapture?: ((event: React.DragEvent) => void) | undefined; onDrop?: ((event: React.DragEvent) => void) | undefined; onDropCapture?: ((event: React.DragEvent) => void) | undefined; onMouseDown?: ((event: React.MouseEvent) => void) | undefined; onMouseDownCapture?: ((event: React.MouseEvent) => void) | undefined; onMouseEnter?: ((event: React.MouseEvent) => void) | undefined; onMouseLeave?: ((event: React.MouseEvent) => void) | undefined; onMouseMove?: ((event: React.MouseEvent) => void) | undefined; onMouseMoveCapture?: ((event: React.MouseEvent) => void) | undefined; onMouseOut?: ((event: React.MouseEvent) => void) | undefined; onMouseOutCapture?: ((event: React.MouseEvent) => void) | undefined; onMouseOver?: ((event: React.MouseEvent) => void) | undefined; onMouseOverCapture?: ((event: React.MouseEvent) => void) | undefined; onMouseUp?: ((event: React.MouseEvent) => void) | undefined; onMouseUpCapture?: ((event: React.MouseEvent) => void) | undefined; onSelect?: ((event: React.SyntheticEvent) => void) | undefined; onSelectCapture?: ((event: React.SyntheticEvent) => void) | undefined; onTouchCancel?: ((event: React.TouchEvent) => void) | undefined; onTouchCancelCapture?: ((event: React.TouchEvent) => void) | undefined; onTouchEnd?: ((event: React.TouchEvent) => void) | undefined; onTouchEndCapture?: ((event: React.TouchEvent) => void) | undefined; onTouchMove?: ((event: React.TouchEvent) => void) | undefined; onTouchMoveCapture?: ((event: React.TouchEvent) => void) | undefined; onTouchStart?: ((event: React.TouchEvent) => void) | undefined; onTouchStartCapture?: ((event: React.TouchEvent) => void) | undefined; onPointerDown?: ((event: React.PointerEvent) => void) | undefined; onPointerDownCapture?: ((event: React.PointerEvent) => void) | undefined; onPointerMove?: ((event: React.PointerEvent) => void) | undefined; onPointerMoveCapture?: ((event: React.PointerEvent) => void) | undefined; onPointerUp?: ((event: React.PointerEvent) => void) | undefined; onPointerUpCapture?: ((event: React.PointerEvent) => void) | undefined; onPointerCancel?: ((event: React.PointerEvent) => void) | undefined; onPointerCancelCapture?: ((event: React.PointerEvent) => void) | undefined; onPointerEnter?: ((event: React.PointerEvent) => void) | undefined; onPointerEnterCapture?: ((event: React.PointerEvent) => void) | undefined; onPointerLeave?: ((event: React.PointerEvent) => void) | undefined; onPointerLeaveCapture?: ((event: React.PointerEvent) => void) | undefined; onPointerOver?: ((event: React.PointerEvent) => void) | undefined; onPointerOverCapture?: ((event: React.PointerEvent) => void) | undefined; onPointerOut?: ((event: React.PointerEvent) => void) | undefined; onPointerOutCapture?: ((event: React.PointerEvent) => void) | undefined; onGotPointerCapture?: ((event: React.PointerEvent) => void) | undefined; onGotPointerCaptureCapture?: ((event: React.PointerEvent) => void) | undefined; onLostPointerCapture?: ((event: React.PointerEvent) => void) | undefined; onLostPointerCaptureCapture?: ((event: React.PointerEvent) => void) | undefined; onScroll?: ((event: React.UIEvent) => void) | undefined; onScrollCapture?: ((event: React.UIEvent) => void) | undefined; onWheel?: ((event: React.WheelEvent) => void) | undefined; onWheelCapture?: ((event: React.WheelEvent) => void) | undefined; onAnimationStart?: ((event: React.AnimationEvent) => void) | undefined; onAnimationStartCapture?: ((event: React.AnimationEvent) => void) | undefined; onAnimationEnd?: ((event: React.AnimationEvent) => void) | undefined; onAnimationEndCapture?: ((event: React.AnimationEvent) => void) | undefined; onAnimationIteration?: ((event: React.AnimationEvent) => void) | undefined; onAnimationIterationCapture?: ((event: React.AnimationEvent) => void) | undefined; onTransitionEnd?: ((event: React.TransitionEvent) => void) | undefined; onTransitionEndCapture?: ((event: React.TransitionEvent) => void) | undefined; css?: ", "InterpolationWithTheme", "; 'data-test-subj'?: string | undefined; width?: string | undefined; render?: ((value: any, record: ", { @@ -1320,7 +1320,7 @@ "section": "def-public.SavedObjectsManagementServiceRegistryEntry", "text": "SavedObjectsManagementServiceRegistryEntry" }, - " | undefined; register: (entry: ", + " | undefined; all: () => ", { "pluginId": "savedObjectsManagement", "scope": "public", @@ -1328,7 +1328,7 @@ "section": "def-public.SavedObjectsManagementServiceRegistryEntry", "text": "SavedObjectsManagementServiceRegistryEntry" }, - ") => void; all: () => ", + "[]; register: (entry: ", { "pluginId": "savedObjectsManagement", "scope": "public", @@ -1336,7 +1336,7 @@ "section": "def-public.SavedObjectsManagementServiceRegistryEntry", "text": "SavedObjectsManagementServiceRegistryEntry" }, - "[]; }" + ") => void; }" ], "source": { "path": "src/plugins/saved_objects_management/public/services/service_registry.ts", @@ -1448,7 +1448,7 @@ "section": "def-public.SavedObjectsManagementServiceRegistryEntry", "text": "SavedObjectsManagementServiceRegistryEntry" }, - " | undefined; register: (entry: ", + " | undefined; all: () => ", { "pluginId": "savedObjectsManagement", "scope": "public", @@ -1456,7 +1456,7 @@ "section": "def-public.SavedObjectsManagementServiceRegistryEntry", "text": "SavedObjectsManagementServiceRegistryEntry" }, - ") => void; all: () => ", + "[]; register: (entry: ", { "pluginId": "savedObjectsManagement", "scope": "public", @@ -1464,7 +1464,7 @@ "section": "def-public.SavedObjectsManagementServiceRegistryEntry", "text": "SavedObjectsManagementServiceRegistryEntry" }, - "[]; }" + ") => void; }" ], "source": { "path": "src/plugins/saved_objects_management/public/plugin.ts", diff --git a/api_docs/screenshot_mode.json b/api_docs/screenshot_mode.json index b7d680b6e93b1e..22b613bf0b04bc 100644 --- a/api_docs/screenshot_mode.json +++ b/api_docs/screenshot_mode.json @@ -2,11 +2,83 @@ "id": "screenshotMode", "client": { "classes": [], - "functions": [], + "functions": [ + { + "parentPluginId": "screenshotMode", + "id": "def-public.setScreenshotModeEnabled", + "type": "Function", + "tags": [], + "label": "setScreenshotModeEnabled", + "description": [ + "\nUse this function to set the current browser to screenshot mode.\n\nThis function should be called as early as possible to ensure that screenshot mode is\ncorrectly detected for the first page load. It is not suitable for use inside any plugin\ncode unless the plugin code is guaranteed to, somehow, load before any other code.\n\nAdditionally, we don't know what environment this code will run in so we remove as many external\nreferences as possible to make it portable. For instance, running inside puppeteer." + ], + "signature": [ + "() => void" + ], + "source": { + "path": "src/plugins/screenshot_mode/common/get_set_browser_screenshot_mode.ts", + "lineNumber": 39 + }, + "deprecated": false, + "children": [], + "returnComment": [], + "initialIsOpen": false + } + ], "interfaces": [], "enums": [], - "misc": [], - "objects": [] + "misc": [ + { + "parentPluginId": "screenshotMode", + "id": "def-public.KBN_SCREENSHOT_MODE_ENABLED_KEY", + "type": "string", + "tags": [], + "label": "KBN_SCREENSHOT_MODE_ENABLED_KEY", + "description": [], + "signature": [ + "\"__KBN_SCREENSHOT_MODE_ENABLED_KEY__\"" + ], + "source": { + "path": "src/plugins/screenshot_mode/common/get_set_browser_screenshot_mode.ts", + "lineNumber": 13 + }, + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "screenshotMode", + "id": "def-public.KBN_SCREENSHOT_MODE_HEADER", + "type": "string", + "tags": [], + "label": "KBN_SCREENSHOT_MODE_HEADER", + "description": [], + "source": { + "path": "src/plugins/screenshot_mode/common/constants.ts", + "lineNumber": 9 + }, + "deprecated": false, + "initialIsOpen": false + } + ], + "objects": [], + "setup": { + "parentPluginId": "screenshotMode", + "id": "def-public.ScreenshotModePluginSetup", + "type": "Type", + "tags": [], + "label": "ScreenshotModePluginSetup", + "description": [], + "signature": [ + "IScreenshotModeService" + ], + "source": { + "path": "src/plugins/screenshot_mode/public/types.ts", + "lineNumber": 17 + }, + "deprecated": false, + "lifecycle": "setup", + "initialIsOpen": true + } }, "server": { "classes": [], @@ -86,6 +158,23 @@ ], "enums": [], "misc": [ + { + "parentPluginId": "screenshotMode", + "id": "def-server.KBN_SCREENSHOT_MODE_ENABLED_KEY", + "type": "string", + "tags": [], + "label": "KBN_SCREENSHOT_MODE_ENABLED_KEY", + "description": [], + "signature": [ + "\"__KBN_SCREENSHOT_MODE_ENABLED_KEY__\"" + ], + "source": { + "path": "src/plugins/screenshot_mode/common/get_set_browser_screenshot_mode.ts", + "lineNumber": 13 + }, + "deprecated": false, + "initialIsOpen": false + }, { "parentPluginId": "screenshotMode", "id": "def-server.KBN_SCREENSHOT_MODE_HEADER", @@ -325,6 +414,23 @@ "interfaces": [], "enums": [], "misc": [ + { + "parentPluginId": "screenshotMode", + "id": "def-common.KBN_SCREENSHOT_MODE_ENABLED_KEY", + "type": "string", + "tags": [], + "label": "KBN_SCREENSHOT_MODE_ENABLED_KEY", + "description": [], + "signature": [ + "\"__KBN_SCREENSHOT_MODE_ENABLED_KEY__\"" + ], + "source": { + "path": "src/plugins/screenshot_mode/common/get_set_browser_screenshot_mode.ts", + "lineNumber": 13 + }, + "deprecated": false, + "initialIsOpen": false + }, { "parentPluginId": "screenshotMode", "id": "def-common.KBN_SCREENSHOT_MODE_HEADER", diff --git a/api_docs/screenshot_mode.mdx b/api_docs/screenshot_mode.mdx index 115a348cbe2e6e..cdb70b22b0837c 100644 --- a/api_docs/screenshot_mode.mdx +++ b/api_docs/screenshot_mode.mdx @@ -11,6 +11,17 @@ warning: This document is auto-generated and is meant to be viewed inside our ex import screenshotModeObj from './screenshot_mode.json'; +## Client + +### Setup + + +### Functions + + +### Consts, variables and types + + ## Server ### Setup diff --git a/api_docs/security.json b/api_docs/security.json index 7e28ad2a222bb3..fe1381030f97fc 100644 --- a/api_docs/security.json +++ b/api_docs/security.json @@ -832,7 +832,7 @@ ], "source": { "path": "x-pack/plugins/security/server/authentication/api_keys/api_keys.ts", - "lineNumber": 56 + "lineNumber": 62 }, "deprecated": false, "children": [ @@ -847,7 +847,7 @@ ], "source": { "path": "x-pack/plugins/security/server/authentication/api_keys/api_keys.ts", - "lineNumber": 60 + "lineNumber": 66 }, "deprecated": false }, @@ -862,7 +862,7 @@ ], "source": { "path": "x-pack/plugins/security/server/authentication/api_keys/api_keys.ts", - "lineNumber": 64 + "lineNumber": 70 }, "deprecated": false }, @@ -880,7 +880,7 @@ ], "source": { "path": "x-pack/plugins/security/server/authentication/api_keys/api_keys.ts", - "lineNumber": 68 + "lineNumber": 74 }, "deprecated": false }, @@ -895,7 +895,7 @@ ], "source": { "path": "x-pack/plugins/security/server/authentication/api_keys/api_keys.ts", - "lineNumber": 72 + "lineNumber": 78 }, "deprecated": false } @@ -911,7 +911,7 @@ "description": [], "source": { "path": "x-pack/plugins/security/server/authentication/api_keys/api_keys.ts", - "lineNumber": 75 + "lineNumber": 81 }, "deprecated": false, "children": [ @@ -926,7 +926,7 @@ ], "source": { "path": "x-pack/plugins/security/server/authentication/api_keys/api_keys.ts", - "lineNumber": 79 + "lineNumber": 85 }, "deprecated": false }, @@ -941,7 +941,7 @@ ], "source": { "path": "x-pack/plugins/security/server/authentication/api_keys/api_keys.ts", - "lineNumber": 83 + "lineNumber": 89 }, "deprecated": false }, @@ -956,7 +956,7 @@ ], "source": { "path": "x-pack/plugins/security/server/authentication/api_keys/api_keys.ts", - "lineNumber": 87 + "lineNumber": 93 }, "deprecated": false } @@ -974,7 +974,7 @@ ], "source": { "path": "x-pack/plugins/security/server/authentication/api_keys/api_keys.ts", - "lineNumber": 93 + "lineNumber": 99 }, "deprecated": false, "children": [ @@ -992,7 +992,7 @@ ], "source": { "path": "x-pack/plugins/security/server/authentication/api_keys/api_keys.ts", - "lineNumber": 97 + "lineNumber": 103 }, "deprecated": false }, @@ -1010,7 +1010,7 @@ ], "source": { "path": "x-pack/plugins/security/server/authentication/api_keys/api_keys.ts", - "lineNumber": 101 + "lineNumber": 107 }, "deprecated": false }, @@ -1025,7 +1025,7 @@ ], "source": { "path": "x-pack/plugins/security/server/authentication/api_keys/api_keys.ts", - "lineNumber": 105 + "lineNumber": 111 }, "deprecated": false }, @@ -1043,7 +1043,7 @@ ], "source": { "path": "x-pack/plugins/security/server/authentication/api_keys/api_keys.ts", - "lineNumber": 109 + "lineNumber": 115 }, "deprecated": false } @@ -1061,7 +1061,7 @@ ], "source": { "path": "x-pack/plugins/security/server/authentication/api_keys/api_keys.ts", - "lineNumber": 46 + "lineNumber": 52 }, "deprecated": false, "children": [ @@ -1077,7 +1077,7 @@ ], "source": { "path": "x-pack/plugins/security/server/authentication/api_keys/api_keys.ts", - "lineNumber": 47 + "lineNumber": 53 }, "deprecated": false } @@ -1313,13 +1313,6 @@ "lineNumber": 105 } }, - { - "plugin": "cases", - "link": { - "path": "x-pack/plugins/cases/server/plugin.ts", - "lineNumber": 89 - } - }, { "plugin": "dashboardMode", "link": { diff --git a/api_docs/security_solution.json b/api_docs/security_solution.json index a265ea7fdc7ac2..747ef4b4b715b0 100644 --- a/api_docs/security_solution.json +++ b/api_docs/security_solution.json @@ -43,7 +43,7 @@ ], "source": { "path": "x-pack/plugins/security_solution/public/plugin.tsx", - "lineNumber": 74 + "lineNumber": 75 }, "deprecated": false, "children": [ @@ -59,7 +59,7 @@ ], "source": { "path": "x-pack/plugins/security_solution/public/plugin.tsx", - "lineNumber": 78 + "lineNumber": 79 }, "deprecated": false, "children": [ @@ -82,7 +82,7 @@ ], "source": { "path": "x-pack/plugins/security_solution/public/plugin.tsx", - "lineNumber": 78 + "lineNumber": 79 }, "deprecated": false, "isRequired": true @@ -123,7 +123,7 @@ ], "source": { "path": "x-pack/plugins/security_solution/public/plugin.tsx", - "lineNumber": 102 + "lineNumber": 103 }, "deprecated": false, "children": [ @@ -150,7 +150,7 @@ ], "source": { "path": "x-pack/plugins/security_solution/public/plugin.tsx", - "lineNumber": 102 + "lineNumber": 103 }, "deprecated": false, "isRequired": true @@ -167,7 +167,7 @@ ], "source": { "path": "x-pack/plugins/security_solution/public/plugin.tsx", - "lineNumber": 102 + "lineNumber": 103 }, "deprecated": false, "isRequired": true @@ -197,7 +197,7 @@ ], "source": { "path": "x-pack/plugins/security_solution/public/plugin.tsx", - "lineNumber": 343 + "lineNumber": 344 }, "deprecated": false, "children": [ @@ -219,7 +219,7 @@ ], "source": { "path": "x-pack/plugins/security_solution/public/plugin.tsx", - "lineNumber": 343 + "lineNumber": 344 }, "deprecated": false, "isRequired": true @@ -236,7 +236,7 @@ ], "source": { "path": "x-pack/plugins/security_solution/public/plugin.tsx", - "lineNumber": 343 + "lineNumber": 344 }, "deprecated": false, "isRequired": true @@ -256,7 +256,7 @@ ], "source": { "path": "x-pack/plugins/security_solution/public/plugin.tsx", - "lineNumber": 388 + "lineNumber": 389 }, "deprecated": false, "children": [], @@ -445,7 +445,7 @@ ], "source": { "path": "x-pack/plugins/security_solution/server/plugin.ts", - "lineNumber": 133 + "lineNumber": 143 }, "deprecated": false, "children": [ @@ -461,7 +461,7 @@ ], "source": { "path": "x-pack/plugins/security_solution/server/plugin.ts", - "lineNumber": 148 + "lineNumber": 159 }, "deprecated": false, "children": [ @@ -484,7 +484,7 @@ ], "source": { "path": "x-pack/plugins/security_solution/server/plugin.ts", - "lineNumber": 148 + "lineNumber": 159 }, "deprecated": false, "isRequired": true @@ -524,7 +524,7 @@ ], "source": { "path": "x-pack/plugins/security_solution/server/plugin.ts", - "lineNumber": 160 + "lineNumber": 171 }, "deprecated": false, "children": [ @@ -557,7 +557,7 @@ ], "source": { "path": "x-pack/plugins/security_solution/server/plugin.ts", - "lineNumber": 160 + "lineNumber": 171 }, "deprecated": false, "isRequired": true @@ -574,7 +574,7 @@ ], "source": { "path": "x-pack/plugins/security_solution/server/plugin.ts", - "lineNumber": 160 + "lineNumber": 171 }, "deprecated": false, "isRequired": true @@ -604,7 +604,7 @@ ], "source": { "path": "x-pack/plugins/security_solution/server/plugin.ts", - "lineNumber": 345 + "lineNumber": 471 }, "deprecated": false, "children": [ @@ -626,7 +626,7 @@ ], "source": { "path": "x-pack/plugins/security_solution/server/plugin.ts", - "lineNumber": 345 + "lineNumber": 471 }, "deprecated": false, "isRequired": true @@ -643,7 +643,7 @@ ], "source": { "path": "x-pack/plugins/security_solution/server/plugin.ts", - "lineNumber": 345 + "lineNumber": 471 }, "deprecated": false, "isRequired": true @@ -663,7 +663,7 @@ ], "source": { "path": "x-pack/plugins/security_solution/server/plugin.ts", - "lineNumber": 420 + "lineNumber": 546 }, "deprecated": false, "children": [], @@ -747,7 +747,7 @@ "description": [], "source": { "path": "x-pack/plugins/security_solution/server/plugin.ts", - "lineNumber": 109 + "lineNumber": 127 }, "deprecated": false, "children": [], @@ -763,7 +763,7 @@ "description": [], "source": { "path": "x-pack/plugins/security_solution/server/plugin.ts", - "lineNumber": 112 + "lineNumber": 130 }, "deprecated": false, "children": [], diff --git a/api_docs/share.json b/api_docs/share.json index 82f5b8697b72df..41b7ecc38e1f05 100644 --- a/api_docs/share.json +++ b/api_docs/share.json @@ -124,7 +124,7 @@ ], "source": { "path": "src/plugins/share/public/url_generators/url_generator_service.ts", - "lineNumber": 25 + "lineNumber": 35 }, "deprecated": false, "children": [ @@ -140,7 +140,7 @@ ], "source": { "path": "src/plugins/share/public/url_generators/url_generator_service.ts", - "lineNumber": 30 + "lineNumber": 40 }, "deprecated": false, "children": [], @@ -167,7 +167,7 @@ ], "source": { "path": "src/plugins/share/public/url_generators/url_generator_service.ts", - "lineNumber": 32 + "lineNumber": 42 }, "deprecated": false, "children": [ @@ -190,7 +190,7 @@ ], "source": { "path": "src/plugins/share/public/url_generators/url_generator_service.ts", - "lineNumber": 32 + "lineNumber": 42 }, "deprecated": false, "isRequired": true @@ -219,7 +219,7 @@ ], "source": { "path": "src/plugins/share/public/url_generators/url_generator_service.ts", - "lineNumber": 45 + "lineNumber": 55 }, "deprecated": false, "children": [ @@ -241,7 +241,7 @@ ], "source": { "path": "src/plugins/share/public/url_generators/url_generator_service.ts", - "lineNumber": 45 + "lineNumber": 55 }, "deprecated": false, "isRequired": true @@ -261,7 +261,7 @@ ], "source": { "path": "src/plugins/share/public/url_generators/url_generator_service.ts", - "lineNumber": 52 + "lineNumber": 62 }, "deprecated": false, "children": [], @@ -1316,11 +1316,13 @@ }, ") => void; } & { urlGenerators: ", "UrlGeneratorsSetup", + "; url: ", + "UrlService", "; }" ], "source": { "path": "src/plugins/share/public/plugin.ts", - "lineNumber": 56 + "lineNumber": 32 }, "deprecated": false, "lifecycle": "setup", @@ -1344,11 +1346,13 @@ }, ") => void; } & { urlGenerators: ", "UrlGeneratorsStart", + "; url: ", + "UrlService", "; }" ], "source": { "path": "src/plugins/share/public/plugin.ts", - "lineNumber": 61 + "lineNumber": 47 }, "deprecated": false, "lifecycle": "start", diff --git a/api_docs/spaces.json b/api_docs/spaces.json index 2f2d79c2379d58..d24b3884ffac6f 100644 --- a/api_docs/spaces.json +++ b/api_docs/spaces.json @@ -1245,7 +1245,7 @@ "plugin": "securitySolution", "link": { "path": "x-pack/plugins/security_solution/server/plugin.ts", - "lineNumber": 194 + "lineNumber": 206 } }, { @@ -2086,7 +2086,7 @@ "plugin": "securitySolution", "link": { "path": "x-pack/plugins/security_solution/server/plugin.ts", - "lineNumber": 194 + "lineNumber": 206 } } ] diff --git a/api_docs/task_manager.json b/api_docs/task_manager.json index 61e37fa5acc0ce..34f16e8ad309b6 100644 --- a/api_docs/task_manager.json +++ b/api_docs/task_manager.json @@ -364,7 +364,7 @@ ], "source": { "path": "x-pack/plugins/task_manager/server/task.ts", - "lineNumber": 297 + "lineNumber": 302 }, "deprecated": false, "children": [ @@ -379,7 +379,7 @@ ], "source": { "path": "x-pack/plugins/task_manager/server/task.ts", - "lineNumber": 302 + "lineNumber": 307 }, "deprecated": false }, @@ -397,7 +397,7 @@ ], "source": { "path": "x-pack/plugins/task_manager/server/task.ts", - "lineNumber": 307 + "lineNumber": 312 }, "deprecated": false }, @@ -415,7 +415,7 @@ ], "source": { "path": "x-pack/plugins/task_manager/server/task.ts", - "lineNumber": 313 + "lineNumber": 318 }, "deprecated": false }, @@ -430,7 +430,7 @@ ], "source": { "path": "x-pack/plugins/task_manager/server/task.ts", - "lineNumber": 319 + "lineNumber": 324 }, "deprecated": false }, @@ -454,7 +454,7 @@ ], "source": { "path": "x-pack/plugins/task_manager/server/task.ts", - "lineNumber": 324 + "lineNumber": 329 }, "deprecated": false }, @@ -472,7 +472,7 @@ ], "source": { "path": "x-pack/plugins/task_manager/server/task.ts", - "lineNumber": 330 + "lineNumber": 335 }, "deprecated": false }, @@ -490,7 +490,7 @@ ], "source": { "path": "x-pack/plugins/task_manager/server/task.ts", - "lineNumber": 337 + "lineNumber": 342 }, "deprecated": false }, @@ -508,7 +508,7 @@ ], "source": { "path": "x-pack/plugins/task_manager/server/task.ts", - "lineNumber": 343 + "lineNumber": 348 }, "deprecated": false }, @@ -526,7 +526,7 @@ ], "source": { "path": "x-pack/plugins/task_manager/server/task.ts", - "lineNumber": 353 + "lineNumber": 358 }, "deprecated": false }, @@ -544,7 +544,7 @@ ], "source": { "path": "x-pack/plugins/task_manager/server/task.ts", - "lineNumber": 358 + "lineNumber": 363 }, "deprecated": false } @@ -766,6 +766,24 @@ }, "deprecated": false }, + { + "parentPluginId": "taskManager", + "id": "def-server.TaskInstance.traceparent", + "type": "string", + "tags": [], + "label": "traceparent", + "description": [ + "\nThe serialized traceparent string of the current APM transaction or span." + ], + "signature": [ + "string | undefined" + ], + "source": { + "path": "x-pack/plugins/task_manager/server/task.ts", + "lineNumber": 263 + }, + "deprecated": false + }, { "parentPluginId": "taskManager", "id": "def-server.TaskInstance.user", @@ -780,7 +798,7 @@ ], "source": { "path": "x-pack/plugins/task_manager/server/task.ts", - "lineNumber": 263 + "lineNumber": 268 }, "deprecated": false }, @@ -798,7 +816,7 @@ ], "source": { "path": "x-pack/plugins/task_manager/server/task.ts", - "lineNumber": 269 + "lineNumber": 274 }, "deprecated": false }, @@ -816,7 +834,7 @@ ], "source": { "path": "x-pack/plugins/task_manager/server/task.ts", - "lineNumber": 274 + "lineNumber": 279 }, "deprecated": false } diff --git a/api_docs/telemetry.json b/api_docs/telemetry.json index 5a4d029dc0938b..6b64191c954007 100644 --- a/api_docs/telemetry.json +++ b/api_docs/telemetry.json @@ -15,7 +15,7 @@ ], "source": { "path": "src/plugins/telemetry/public/plugin.ts", - "lineNumber": 82 + "lineNumber": 90 }, "deprecated": false, "children": [ @@ -30,7 +30,7 @@ ], "source": { "path": "src/plugins/telemetry/public/plugin.ts", - "lineNumber": 84 + "lineNumber": 92 }, "deprecated": false }, @@ -45,7 +45,7 @@ ], "source": { "path": "src/plugins/telemetry/public/plugin.ts", - "lineNumber": 86 + "lineNumber": 94 }, "deprecated": false }, @@ -60,7 +60,7 @@ ], "source": { "path": "src/plugins/telemetry/public/plugin.ts", - "lineNumber": 88 + "lineNumber": 96 }, "deprecated": false }, @@ -75,7 +75,7 @@ ], "source": { "path": "src/plugins/telemetry/public/plugin.ts", - "lineNumber": 90 + "lineNumber": 98 }, "deprecated": false }, @@ -93,7 +93,7 @@ ], "source": { "path": "src/plugins/telemetry/public/plugin.ts", - "lineNumber": 92 + "lineNumber": 100 }, "deprecated": false }, @@ -108,7 +108,7 @@ ], "source": { "path": "src/plugins/telemetry/public/plugin.ts", - "lineNumber": 94 + "lineNumber": 102 }, "deprecated": false }, @@ -126,7 +126,7 @@ ], "source": { "path": "src/plugins/telemetry/public/plugin.ts", - "lineNumber": 96 + "lineNumber": 104 }, "deprecated": false }, @@ -144,7 +144,7 @@ ], "source": { "path": "src/plugins/telemetry/public/plugin.ts", - "lineNumber": 98 + "lineNumber": 106 }, "deprecated": false }, @@ -162,7 +162,7 @@ ], "source": { "path": "src/plugins/telemetry/public/plugin.ts", - "lineNumber": 100 + "lineNumber": 108 }, "deprecated": false } @@ -180,7 +180,7 @@ ], "source": { "path": "src/plugins/telemetry/public/plugin.ts", - "lineNumber": 36 + "lineNumber": 38 }, "deprecated": false, "children": [ @@ -198,7 +198,7 @@ ], "source": { "path": "src/plugins/telemetry/public/plugin.ts", - "lineNumber": 38 + "lineNumber": 40 }, "deprecated": false, "returnComment": [], @@ -215,10 +215,30 @@ ], "source": { "path": "src/plugins/telemetry/public/plugin.ts", - "lineNumber": 40 + "lineNumber": 42 }, "deprecated": false }, + { + "parentPluginId": "telemetry", + "id": "def-public.TelemetryServicePublicApis.canSendTelemetry", + "type": "Function", + "tags": [], + "label": "canSendTelemetry", + "description": [ + "Can phone-home telemetry calls be made? This depends on whether we have opted-in or if we are rendering a report" + ], + "signature": [ + "() => boolean" + ], + "source": { + "path": "src/plugins/telemetry/public/plugin.ts", + "lineNumber": 44 + }, + "deprecated": false, + "returnComment": [], + "children": [] + }, { "parentPluginId": "telemetry", "id": "def-public.TelemetryServicePublicApis.getCanChangeOptInStatus", @@ -233,7 +253,7 @@ ], "source": { "path": "src/plugins/telemetry/public/plugin.ts", - "lineNumber": 42 + "lineNumber": 46 }, "deprecated": false, "returnComment": [], @@ -253,7 +273,7 @@ ], "source": { "path": "src/plugins/telemetry/public/plugin.ts", - "lineNumber": 44 + "lineNumber": 48 }, "deprecated": false, "returnComment": [], @@ -273,7 +293,7 @@ ], "source": { "path": "src/plugins/telemetry/public/plugin.ts", - "lineNumber": 50 + "lineNumber": 54 }, "deprecated": false, "returnComment": [], @@ -289,7 +309,7 @@ ], "source": { "path": "src/plugins/telemetry/public/plugin.ts", - "lineNumber": 50 + "lineNumber": 54 }, "deprecated": false } @@ -313,7 +333,7 @@ ], "source": { "path": "src/plugins/telemetry/public/plugin.ts", - "lineNumber": 64 + "lineNumber": 68 }, "deprecated": false, "children": [ @@ -337,7 +357,7 @@ ], "source": { "path": "src/plugins/telemetry/public/plugin.ts", - "lineNumber": 66 + "lineNumber": 70 }, "deprecated": false }, @@ -355,7 +375,7 @@ ], "source": { "path": "src/plugins/telemetry/public/plugin.ts", - "lineNumber": 68 + "lineNumber": 72 }, "deprecated": false }, @@ -373,7 +393,7 @@ ], "source": { "path": "src/plugins/telemetry/public/plugin.ts", - "lineNumber": 73 + "lineNumber": 77 }, "deprecated": false } @@ -392,7 +412,7 @@ ], "source": { "path": "src/plugins/telemetry/public/plugin.ts", - "lineNumber": 56 + "lineNumber": 60 }, "deprecated": false, "children": [ @@ -416,7 +436,7 @@ ], "source": { "path": "src/plugins/telemetry/public/plugin.ts", - "lineNumber": 58 + "lineNumber": 62 }, "deprecated": false } diff --git a/api_docs/triggers_actions_ui.json b/api_docs/triggers_actions_ui.json index de7a13b3080fe0..b21514a8b450e6 100644 --- a/api_docs/triggers_actions_ui.json +++ b/api_docs/triggers_actions_ui.json @@ -442,7 +442,7 @@ ], "source": { "path": "x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/jira/jira.tsx", - "lineNumber": 62 + "lineNumber": 77 }, "deprecated": false, "children": [], @@ -469,7 +469,7 @@ ], "source": { "path": "x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/resilient/resilient.tsx", - "lineNumber": 67 + "lineNumber": 85 }, "deprecated": false, "children": [], @@ -676,7 +676,7 @@ ], "source": { "path": "x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/servicenow/servicenow.tsx", - "lineNumber": 63 + "lineNumber": 92 }, "deprecated": false, "children": [], @@ -703,7 +703,7 @@ ], "source": { "path": "x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/servicenow/servicenow.tsx", - "lineNumber": 98 + "lineNumber": 128 }, "deprecated": false, "children": [], diff --git a/api_docs/ui_actions.json b/api_docs/ui_actions.json index b623984736ee15..cb35cacedf7bae 100644 --- a/api_docs/ui_actions.json +++ b/api_docs/ui_actions.json @@ -775,7 +775,7 @@ "plugin": "discover", "link": { "path": "src/plugins/discover/public/application/embeddable/search_embeddable.ts", - "lineNumber": 114 + "lineNumber": 115 } }, { diff --git a/api_docs/usage_collection.json b/api_docs/usage_collection.json index ab02b8b567fb8b..219901ba96b6d5 100644 --- a/api_docs/usage_collection.json +++ b/api_docs/usage_collection.json @@ -777,7 +777,7 @@ "\nPossible type values in the schema" ], "signature": [ - "\"boolean\" | \"date\" | \"text\" | \"keyword\" | \"long\" | \"double\" | \"short\" | \"integer\" | \"byte\" | \"float\"" + "\"boolean\" | \"date\" | \"keyword\" | \"text\" | \"long\" | \"double\" | \"short\" | \"integer\" | \"byte\" | \"float\"" ], "source": { "path": "src/plugins/usage_collection/server/collector/types.ts", diff --git a/api_docs/visualizations.json b/api_docs/visualizations.json index 0df428a158a3da..83f9436420dcd2 100644 --- a/api_docs/visualizations.json +++ b/api_docs/visualizations.json @@ -1888,7 +1888,7 @@ "label": "group", "description": [], "signature": [ - "\"buckets\" | \"metrics\" | \"none\"" + "\"none\" | \"buckets\" | \"metrics\"" ], "source": { "path": "src/plugins/visualizations/public/vis_types/types.ts", diff --git a/dev_docs/tutorials/expressions.mdx b/dev_docs/tutorials/expressions.mdx index f0fc1dc595cfa4..4688da98b7b019 100644 --- a/dev_docs/tutorials/expressions.mdx +++ b/dev_docs/tutorials/expressions.mdx @@ -9,23 +9,26 @@ tags: ['kibana', 'onboarding', 'dev', 'architecture'] ## Expressions service -Expression service exposes a registry of reusable functions primary used for fetching and transposing data and a registry of renderer functions that can render data into a DOM element. -Adding functions is easy and so is reusing them. An expression is a chain of functions with provided arguments, which given a single input translates to a single output. +Expression service exposes a registry of reusable functions primary used for fetching and transposing data and a registry of renderer functions that can render data into a DOM element. +Adding functions is easy and so is reusing them. + +An expression is a chain of functions with provided arguments, which given a single input translates to a single output. Each expression is representable by a human friendly string which a user can type. -### creating expressions +### Creating expressions Here is a very simple expression string: - essql 'select column1, column2 from myindex' | mapColumn name=column3 fn='{ column1 + 3 }' | table - +``` +essql 'select column1, column2 from myindex' | mapColumn name=column3 fn='{ column1 + 3 }' | table +``` It consists of 3 functions: - - essql which runs given sql query against elasticsearch and returns the results + - `essql` which runs given sql query against elasticsearch and returns the results - `mapColumn`, which computes a new column from existing ones; - `table`, which prepares the data for rendering in a tabular format. - + The same expression could also be constructed in the code: ```ts @@ -40,7 +43,7 @@ const expression = buildExpression([ Note: Consumers need to be aware which plugin registers specific functions with expressions function registry and import correct type definitions from there. - + The `expressions` service is available on both server and client, with similar APIs. @@ -53,7 +56,7 @@ const executionContract = expressions.execute(expression, input); const result = await executionContract.getData(); ``` - + Check the full spec of execute function [here](https://github.com/elastic/kibana/blob/master/docs/development/plugins/expressions/public/kibana-plugin-plugins-expressions-public.execution.md) @@ -61,13 +64,13 @@ In addition, on the browser side, there are two additional ways to run expressio #### React expression renderer component -This is the easiest way to get expressions rendered inside your application. +This is the easiest way to get expressions rendered inside your application. ```ts ``` - + Check the full spec of ReactExpressionRenderer component props [here](https://github.com/elastic/kibana/blob/master/docs/development/plugins/expressions/public/kibana-plugin-plugins-expressions-public.reactexpressionrendererprops.md) @@ -79,7 +82,7 @@ If you are not using React, you can use the loader expression service provides t const handler = loader(domElement, expression, params); ``` - + Check the full spec of expression loader params [here](https://github.com/elastic/kibana/blob/master/docs/development/plugins/expressions/public/kibana-plugin-plugins-expressions-public.iexpressionloaderparams.md) @@ -102,7 +105,7 @@ const functionDefinition = { expressions.registerFunction(functionDefinition); ``` - + Check the full interface of ExpressionFuntionDefinition [here](https://github.com/elastic/kibana/blob/master/docs/development/plugins/expressions/public/kibana-plugin-plugins-expressions-public.expressionfunctiondefinition.md) @@ -124,6 +127,6 @@ const rendererDefinition = { expressions.registerRenderer(rendererDefinition); ``` - + Check the full interface of ExpressionRendererDefinition [here](https://github.com/elastic/kibana/blob/master/docs/development/plugins/expressions/public/kibana-plugin-plugins-expressions-public.expressionrenderdefinition.md) diff --git a/docs/developer/getting-started/monorepo-packages.asciidoc b/docs/developer/getting-started/monorepo-packages.asciidoc index dbfbe90ec9263e..029ee9ea4faf6c 100644 --- a/docs/developer/getting-started/monorepo-packages.asciidoc +++ b/docs/developer/getting-started/monorepo-packages.asciidoc @@ -85,6 +85,7 @@ yarn kbn watch-bazel - @kbn/logging - @kbn/mapbox-gl - @kbn/monaco +- @kbn/rule-data-utils - @kbn/securitysolution-es-utils - @kbn/securitysolution-io-ts-alerting-types - @kbn/securitysolution-io-ts-list-types diff --git a/docs/developer/plugin-list.asciidoc b/docs/developer/plugin-list.asciidoc index 087626240ff337..7d06562547f70c 100644 --- a/docs/developer/plugin-list.asciidoc +++ b/docs/developer/plugin-list.asciidoc @@ -265,6 +265,10 @@ The plugin exposes the static DefaultEditorController class to consume. |Contains the metric visualization. +|{kib-repo}blob/{branch}/src/plugins/vis_type_pie/README.md[visTypePie] +|Contains the pie chart implementation using the elastic-charts library. The goal is to eventually deprecate the old implementation and keep only this. Until then, the library used is defined by the Legacy charts library advanced setting. + + |{kib-repo}blob/{branch}/src/plugins/vis_type_table/README.md[visTypeTable] |Contains the data table visualization, that allows presenting data in a simple table format. diff --git a/docs/development/core/public/kibana-plugin-core-public.app.md b/docs/development/core/public/kibana-plugin-core-public.app.md index 721d9a2f121c73..d79a12a83367d0 100644 --- a/docs/development/core/public/kibana-plugin-core-public.app.md +++ b/docs/development/core/public/kibana-plugin-core-public.app.md @@ -8,7 +8,7 @@ Signature: ```typescript -export interface App +export interface App extends AppNavOptions ``` ## Properties @@ -21,16 +21,13 @@ export interface App | [chromeless](./kibana-plugin-core-public.app.chromeless.md) | boolean | Hide the UI chrome when the application is mounted. Defaults to false. Takes precedence over chrome service visibility settings. | | [deepLinks](./kibana-plugin-core-public.app.deeplinks.md) | AppDeepLink[] | Input type for registering secondary in-app locations for an application.Deep links must include at least one of path or deepLinks. A deep link that does not have a path represents a topological level in the application's hierarchy, but does not have a destination URL that is user-accessible. | | [defaultPath](./kibana-plugin-core-public.app.defaultpath.md) | string | Allow to define the default path a user should be directed to when navigating to the app. When defined, this value will be used as a default for the path option when calling [navigateToApp](./kibana-plugin-core-public.applicationstart.navigatetoapp.md)\`, and will also be appended to the [application navLink](./kibana-plugin-core-public.chromenavlink.md) in the navigation bar. | -| [euiIconType](./kibana-plugin-core-public.app.euiicontype.md) | string | A EUI iconType that will be used for the app's icon. This icon takes precendence over the icon property. | | [exactRoute](./kibana-plugin-core-public.app.exactroute.md) | boolean | If set to true, the application's route will only be checked against an exact match. Defaults to false. | -| [icon](./kibana-plugin-core-public.app.icon.md) | string | A URL to an image file used as an icon. Used as a fallback if euiIconType is not provided. | | [id](./kibana-plugin-core-public.app.id.md) | string | The unique identifier of the application | | [keywords](./kibana-plugin-core-public.app.keywords.md) | string[] | Optional keywords to match with in deep links search. Omit if this part of the hierarchy does not have a page URL. | | [mount](./kibana-plugin-core-public.app.mount.md) | AppMount<HistoryLocationState> | A mount function called when the user navigates to this app's route. | | [navLinkStatus](./kibana-plugin-core-public.app.navlinkstatus.md) | AppNavLinkStatus | The initial status of the application's navLink. Defaulting to visible if status is accessible and hidden if status is inaccessible See [AppNavLinkStatus](./kibana-plugin-core-public.appnavlinkstatus.md) | -| [order](./kibana-plugin-core-public.app.order.md) | number | An ordinal used to sort nav links relative to one another for display. | +| [searchable](./kibana-plugin-core-public.app.searchable.md) | boolean | The initial flag to determine if the application is searchable in the global search. Defaulting to true if navLinkStatus is visible or omitted. | | [status](./kibana-plugin-core-public.app.status.md) | AppStatus | The initial status of the application. Defaulting to accessible | | [title](./kibana-plugin-core-public.app.title.md) | string | The title of the application. | -| [tooltip](./kibana-plugin-core-public.app.tooltip.md) | string | A tooltip shown when hovering over app link. | | [updater$](./kibana-plugin-core-public.app.updater_.md) | Observable<AppUpdater> | An [AppUpdater](./kibana-plugin-core-public.appupdater.md) observable that can be used to update the application [AppUpdatableFields](./kibana-plugin-core-public.appupdatablefields.md) at runtime. | diff --git a/docs/development/core/public/kibana-plugin-core-public.app.searchable.md b/docs/development/core/public/kibana-plugin-core-public.app.searchable.md new file mode 100644 index 00000000000000..ab1b559a7f6a1d --- /dev/null +++ b/docs/development/core/public/kibana-plugin-core-public.app.searchable.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [App](./kibana-plugin-core-public.app.md) > [searchable](./kibana-plugin-core-public.app.searchable.md) + +## App.searchable property + +The initial flag to determine if the application is searchable in the global search. Defaulting to `true` if `navLinkStatus` is `visible` or omitted. + +Signature: + +```typescript +searchable?: boolean; +``` diff --git a/docs/development/core/public/kibana-plugin-core-public.appdeeplink.md b/docs/development/core/public/kibana-plugin-core-public.appdeeplink.md index 5aa951cffdcb54..30fd3085a4341a 100644 --- a/docs/development/core/public/kibana-plugin-core-public.appdeeplink.md +++ b/docs/development/core/public/kibana-plugin-core-public.appdeeplink.md @@ -16,7 +16,8 @@ export declare type AppDeepLink = { title: string; keywords?: string[]; navLinkStatus?: AppNavLinkStatus; -} & ({ + searchable?: boolean; +} & AppNavOptions & ({ path: string; deepLinks?: AppDeepLink[]; } | { diff --git a/docs/development/core/public/kibana-plugin-core-public.app.euiicontype.md b/docs/development/core/public/kibana-plugin-core-public.appnavoptions.euiicontype.md similarity index 60% rename from docs/development/core/public/kibana-plugin-core-public.app.euiicontype.md rename to docs/development/core/public/kibana-plugin-core-public.appnavoptions.euiicontype.md index ff79d832f92e2b..069eccf63a2351 100644 --- a/docs/development/core/public/kibana-plugin-core-public.app.euiicontype.md +++ b/docs/development/core/public/kibana-plugin-core-public.appnavoptions.euiicontype.md @@ -1,8 +1,8 @@ -[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [App](./kibana-plugin-core-public.app.md) > [euiIconType](./kibana-plugin-core-public.app.euiicontype.md) +[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [AppNavOptions](./kibana-plugin-core-public.appnavoptions.md) > [euiIconType](./kibana-plugin-core-public.appnavoptions.euiicontype.md) -## App.euiIconType property +## AppNavOptions.euiIconType property A EUI iconType that will be used for the app's icon. This icon takes precendence over the `icon` property. diff --git a/docs/development/core/public/kibana-plugin-core-public.app.icon.md b/docs/development/core/public/kibana-plugin-core-public.appnavoptions.icon.md similarity index 61% rename from docs/development/core/public/kibana-plugin-core-public.app.icon.md rename to docs/development/core/public/kibana-plugin-core-public.appnavoptions.icon.md index 98260da5d20219..3b809fc4aec396 100644 --- a/docs/development/core/public/kibana-plugin-core-public.app.icon.md +++ b/docs/development/core/public/kibana-plugin-core-public.appnavoptions.icon.md @@ -1,8 +1,8 @@ -[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [App](./kibana-plugin-core-public.app.md) > [icon](./kibana-plugin-core-public.app.icon.md) +[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [AppNavOptions](./kibana-plugin-core-public.appnavoptions.md) > [icon](./kibana-plugin-core-public.appnavoptions.icon.md) -## App.icon property +## AppNavOptions.icon property A URL to an image file used as an icon. Used as a fallback if `euiIconType` is not provided. diff --git a/docs/development/core/public/kibana-plugin-core-public.appnavoptions.md b/docs/development/core/public/kibana-plugin-core-public.appnavoptions.md new file mode 100644 index 00000000000000..52c28c861dc704 --- /dev/null +++ b/docs/development/core/public/kibana-plugin-core-public.appnavoptions.md @@ -0,0 +1,23 @@ + + +[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [AppNavOptions](./kibana-plugin-core-public.appnavoptions.md) + +## AppNavOptions interface + +App navigation menu options + +Signature: + +```typescript +export interface AppNavOptions +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [euiIconType](./kibana-plugin-core-public.appnavoptions.euiicontype.md) | string | A EUI iconType that will be used for the app's icon. This icon takes precendence over the icon property. | +| [icon](./kibana-plugin-core-public.appnavoptions.icon.md) | string | A URL to an image file used as an icon. Used as a fallback if euiIconType is not provided. | +| [order](./kibana-plugin-core-public.appnavoptions.order.md) | number | An ordinal used to sort nav links relative to one another for display. | +| [tooltip](./kibana-plugin-core-public.appnavoptions.tooltip.md) | string | A tooltip shown when hovering over app link. | + diff --git a/docs/development/core/public/kibana-plugin-core-public.app.order.md b/docs/development/core/public/kibana-plugin-core-public.appnavoptions.order.md similarity index 59% rename from docs/development/core/public/kibana-plugin-core-public.app.order.md rename to docs/development/core/public/kibana-plugin-core-public.appnavoptions.order.md index bb6be116b6b587..ca7ae482a04adb 100644 --- a/docs/development/core/public/kibana-plugin-core-public.app.order.md +++ b/docs/development/core/public/kibana-plugin-core-public.appnavoptions.order.md @@ -1,8 +1,8 @@ -[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [App](./kibana-plugin-core-public.app.md) > [order](./kibana-plugin-core-public.app.order.md) +[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [AppNavOptions](./kibana-plugin-core-public.appnavoptions.md) > [order](./kibana-plugin-core-public.appnavoptions.order.md) -## App.order property +## AppNavOptions.order property An ordinal used to sort nav links relative to one another for display. diff --git a/docs/development/core/public/kibana-plugin-core-public.app.tooltip.md b/docs/development/core/public/kibana-plugin-core-public.appnavoptions.tooltip.md similarity index 56% rename from docs/development/core/public/kibana-plugin-core-public.app.tooltip.md rename to docs/development/core/public/kibana-plugin-core-public.appnavoptions.tooltip.md index e901de0fdccc98..97c18c2e56a1ee 100644 --- a/docs/development/core/public/kibana-plugin-core-public.app.tooltip.md +++ b/docs/development/core/public/kibana-plugin-core-public.appnavoptions.tooltip.md @@ -1,8 +1,8 @@ -[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [App](./kibana-plugin-core-public.app.md) > [tooltip](./kibana-plugin-core-public.app.tooltip.md) +[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [AppNavOptions](./kibana-plugin-core-public.appnavoptions.md) > [tooltip](./kibana-plugin-core-public.appnavoptions.tooltip.md) -## App.tooltip property +## AppNavOptions.tooltip property A tooltip shown when hovering over app link. diff --git a/docs/development/core/public/kibana-plugin-core-public.appupdatablefields.md b/docs/development/core/public/kibana-plugin-core-public.appupdatablefields.md index d7b12d4b707010..c24da05abe7ecd 100644 --- a/docs/development/core/public/kibana-plugin-core-public.appupdatablefields.md +++ b/docs/development/core/public/kibana-plugin-core-public.appupdatablefields.md @@ -9,5 +9,5 @@ Defines the list of fields that can be updated via an [AppUpdater](./kibana-plug Signature: ```typescript -export declare type AppUpdatableFields = Pick; +export declare type AppUpdatableFields = Pick; ``` diff --git a/docs/development/core/public/kibana-plugin-core-public.chromenavlink.md b/docs/development/core/public/kibana-plugin-core-public.chromenavlink.md index dfe8f119505aa8..c7dd461617e344 100644 --- a/docs/development/core/public/kibana-plugin-core-public.chromenavlink.md +++ b/docs/development/core/public/kibana-plugin-core-public.chromenavlink.md @@ -26,5 +26,5 @@ export interface ChromeNavLink | [order](./kibana-plugin-core-public.chromenavlink.order.md) | number | An ordinal used to sort nav links relative to one another for display. | | [title](./kibana-plugin-core-public.chromenavlink.title.md) | string | The title of the application. | | [tooltip](./kibana-plugin-core-public.chromenavlink.tooltip.md) | string | A tooltip shown when hovering over an app link. | -| [url](./kibana-plugin-core-public.chromenavlink.url.md) | string | The route used to open the of an application. If unset, baseUrl will be used instead. | +| [url](./kibana-plugin-core-public.chromenavlink.url.md) | string | The route used to open the default path and the deep links of an application. | diff --git a/docs/development/core/public/kibana-plugin-core-public.chromenavlink.url.md b/docs/development/core/public/kibana-plugin-core-public.chromenavlink.url.md index 833930c4947862..b9d12e450df505 100644 --- a/docs/development/core/public/kibana-plugin-core-public.chromenavlink.url.md +++ b/docs/development/core/public/kibana-plugin-core-public.chromenavlink.url.md @@ -4,10 +4,10 @@ ## ChromeNavLink.url property -The route used to open the of an application. If unset, `baseUrl` will be used instead. +The route used to open the default path and the deep links of an application. Signature: ```typescript -readonly url?: string; +readonly url: string; ``` diff --git a/docs/development/core/public/kibana-plugin-core-public.md b/docs/development/core/public/kibana-plugin-core-public.md index 6239279f275d1c..f341a7cd9315f8 100644 --- a/docs/development/core/public/kibana-plugin-core-public.md +++ b/docs/development/core/public/kibana-plugin-core-public.md @@ -38,6 +38,7 @@ The plugin integrates with the core system via lifecycle events: `setup` | [ApplicationSetup](./kibana-plugin-core-public.applicationsetup.md) | | | [ApplicationStart](./kibana-plugin-core-public.applicationstart.md) | | | [AppMountParameters](./kibana-plugin-core-public.appmountparameters.md) | | +| [AppNavOptions](./kibana-plugin-core-public.appnavoptions.md) | App navigation menu options | | [AsyncPlugin](./kibana-plugin-core-public.asyncplugin.md) | A plugin with asynchronous lifecycle methods. | | [Capabilities](./kibana-plugin-core-public.capabilities.md) | The read-only set of capabilities available for the current UI session. Capabilities are simple key-value pairs of (string, boolean), where the string denotes the capability ID, and the boolean is a flag indicating if the capability is enabled or disabled. | | [ChromeBadge](./kibana-plugin-core-public.chromebadge.md) | | diff --git a/docs/development/core/public/kibana-plugin-core-public.navigatetoappoptions.deeplinkid.md b/docs/development/core/public/kibana-plugin-core-public.navigatetoappoptions.deeplinkid.md new file mode 100644 index 00000000000000..4039e1338fc1c0 --- /dev/null +++ b/docs/development/core/public/kibana-plugin-core-public.navigatetoappoptions.deeplinkid.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [NavigateToAppOptions](./kibana-plugin-core-public.navigatetoappoptions.md) > [deepLinkId](./kibana-plugin-core-public.navigatetoappoptions.deeplinkid.md) + +## NavigateToAppOptions.deepLinkId property + +optional [deep link](./kibana-plugin-core-public.app.deeplinks.md) id inside the application to navigate to. If an additional [path](./kibana-plugin-core-public.navigatetoappoptions.path.md) is defined it will be appended to the deep link path. + +Signature: + +```typescript +deepLinkId?: string; +``` diff --git a/docs/development/core/public/kibana-plugin-core-public.navigatetoappoptions.md b/docs/development/core/public/kibana-plugin-core-public.navigatetoappoptions.md index 79b59a19508e76..7b01bab056d843 100644 --- a/docs/development/core/public/kibana-plugin-core-public.navigatetoappoptions.md +++ b/docs/development/core/public/kibana-plugin-core-public.navigatetoappoptions.md @@ -16,8 +16,9 @@ export interface NavigateToAppOptions | Property | Type | Description | | --- | --- | --- | +| [deepLinkId](./kibana-plugin-core-public.navigatetoappoptions.deeplinkid.md) | string | optional [deep link](./kibana-plugin-core-public.app.deeplinks.md) id inside the application to navigate to. If an additional [path](./kibana-plugin-core-public.navigatetoappoptions.path.md) is defined it will be appended to the deep link path. | | [openInNewTab](./kibana-plugin-core-public.navigatetoappoptions.openinnewtab.md) | boolean | if true, will open the app in new tab, will share session information via window.open if base | -| [path](./kibana-plugin-core-public.navigatetoappoptions.path.md) | string | optional path inside application to deep link to. If undefined, will use [the app's default path](./kibana-plugin-core-public.app.defaultpath.md)\` as default. | +| [path](./kibana-plugin-core-public.navigatetoappoptions.path.md) | string | optional path inside application to deep link to. If undefined, will use [the app's default path](./kibana-plugin-core-public.app.defaultpath.md) as default. | | [replace](./kibana-plugin-core-public.navigatetoappoptions.replace.md) | boolean | if true, will not create a new history entry when navigating (using replace instead of push) | | [state](./kibana-plugin-core-public.navigatetoappoptions.state.md) | unknown | optional state to forward to the application | diff --git a/docs/development/core/public/kibana-plugin-core-public.navigatetoappoptions.path.md b/docs/development/core/public/kibana-plugin-core-public.navigatetoappoptions.path.md index 095553d05778c9..b39fc8c324ad9a 100644 --- a/docs/development/core/public/kibana-plugin-core-public.navigatetoappoptions.path.md +++ b/docs/development/core/public/kibana-plugin-core-public.navigatetoappoptions.path.md @@ -4,7 +4,7 @@ ## NavigateToAppOptions.path property -optional path inside application to deep link to. If undefined, will use [the app's default path](./kibana-plugin-core-public.app.defaultpath.md)\` as default. +optional path inside application to deep link to. If undefined, will use [the app's default path](./kibana-plugin-core-public.app.defaultpath.md) as default. Signature: diff --git a/docs/development/core/public/kibana-plugin-core-public.publicappdeeplinkinfo.md b/docs/development/core/public/kibana-plugin-core-public.publicappdeeplinkinfo.md index d3a6a4de905fdf..40fd98687c6194 100644 --- a/docs/development/core/public/kibana-plugin-core-public.publicappdeeplinkinfo.md +++ b/docs/development/core/public/kibana-plugin-core-public.publicappdeeplinkinfo.md @@ -9,9 +9,10 @@ Public information about a registered app's [deepLinks](./kibana-plugin-core-pub Signature: ```typescript -export declare type PublicAppDeepLinkInfo = Omit & { +export declare type PublicAppDeepLinkInfo = Omit & { deepLinks: PublicAppDeepLinkInfo[]; keywords: string[]; navLinkStatus: AppNavLinkStatus; + searchable: boolean; }; ``` diff --git a/docs/development/core/public/kibana-plugin-core-public.publicappinfo.md b/docs/development/core/public/kibana-plugin-core-public.publicappinfo.md index a5563eae83563f..01d23ae47a0d95 100644 --- a/docs/development/core/public/kibana-plugin-core-public.publicappinfo.md +++ b/docs/development/core/public/kibana-plugin-core-public.publicappinfo.md @@ -9,11 +9,12 @@ Public information about a registered [application](./kibana-plugin-core-public. Signature: ```typescript -export declare type PublicAppInfo = Omit & { +export declare type PublicAppInfo = Omit & { status: AppStatus; navLinkStatus: AppNavLinkStatus; appRoute: string; keywords: string[]; deepLinks: PublicAppDeepLinkInfo[]; + searchable: boolean; }; ``` diff --git a/docs/development/core/public/kibana-plugin-core-public.savedobjectsfindoptions.md b/docs/development/core/public/kibana-plugin-core-public.savedobjectsfindoptions.md index 7be45c6c173b45..706408f81f02a8 100644 --- a/docs/development/core/public/kibana-plugin-core-public.savedobjectsfindoptions.md +++ b/docs/development/core/public/kibana-plugin-core-public.savedobjectsfindoptions.md @@ -30,7 +30,7 @@ export interface SavedObjectsFindOptions | [searchAfter](./kibana-plugin-core-public.savedobjectsfindoptions.searchafter.md) | estypes.Id[] | Use the sort values from the previous page to retrieve the next page of results. | | [searchFields](./kibana-plugin-core-public.savedobjectsfindoptions.searchfields.md) | string[] | The fields to perform the parsed query against. See Elasticsearch Simple Query String fields argument for more information | | [sortField](./kibana-plugin-core-public.savedobjectsfindoptions.sortfield.md) | string | | -| [sortOrder](./kibana-plugin-core-public.savedobjectsfindoptions.sortorder.md) | estypes.SortOrder | | +| [sortOrder](./kibana-plugin-core-public.savedobjectsfindoptions.sortorder.md) | estypes.SearchSortOrder | | | [type](./kibana-plugin-core-public.savedobjectsfindoptions.type.md) | string | string[] | | | [typeToNamespacesMap](./kibana-plugin-core-public.savedobjectsfindoptions.typetonamespacesmap.md) | Map<string, string[] | undefined> | This map defines each type to search for, and the namespace(s) to search for the type in; this is only intended to be used by a saved object client wrapper. If this is defined, it supersedes the type and namespaces fields when building the Elasticsearch query. Any types that are not included in this map will be excluded entirely. If a type is included but its value is undefined, the operation will search for that type in the Default namespace. | diff --git a/docs/development/core/public/kibana-plugin-core-public.savedobjectsfindoptions.sortorder.md b/docs/development/core/public/kibana-plugin-core-public.savedobjectsfindoptions.sortorder.md index 36f99e51ea8c65..506fb9041e353b 100644 --- a/docs/development/core/public/kibana-plugin-core-public.savedobjectsfindoptions.sortorder.md +++ b/docs/development/core/public/kibana-plugin-core-public.savedobjectsfindoptions.sortorder.md @@ -7,5 +7,5 @@ Signature: ```typescript -sortOrder?: estypes.SortOrder; +sortOrder?: estypes.SearchSortOrder; ``` diff --git a/docs/development/core/server/kibana-plugin-core-server.md b/docs/development/core/server/kibana-plugin-core-server.md index 32a2f3312708ce..604cdea1a7fbe6 100644 --- a/docs/development/core/server/kibana-plugin-core-server.md +++ b/docs/development/core/server/kibana-plugin-core-server.md @@ -159,8 +159,6 @@ The plugin integrates with the core system via lifecycle events: `setup` | [SavedObjectsCollectMultiNamespaceReferencesObject](./kibana-plugin-core-server.savedobjectscollectmultinamespacereferencesobject.md) | An object to collect references for. It must be a multi-namespace type (in other words, the object type must be registered with the namespaceType: 'multiple' or namespaceType: 'multiple-isolated' option).Note: if options.purpose is 'updateObjectsSpaces', it must be a shareable type (in other words, the object type must be registered with the namespaceType: 'multiple'). | | [SavedObjectsCollectMultiNamespaceReferencesOptions](./kibana-plugin-core-server.savedobjectscollectmultinamespacereferencesoptions.md) | Options for collecting references. | | [SavedObjectsCollectMultiNamespaceReferencesResponse](./kibana-plugin-core-server.savedobjectscollectmultinamespacereferencesresponse.md) | The response when object references are collected. | -| [SavedObjectsComplexFieldMapping](./kibana-plugin-core-server.savedobjectscomplexfieldmapping.md) | See [SavedObjectsFieldMapping](./kibana-plugin-core-server.savedobjectsfieldmapping.md) for documentation. | -| [SavedObjectsCoreFieldMapping](./kibana-plugin-core-server.savedobjectscorefieldmapping.md) | See [SavedObjectsFieldMapping](./kibana-plugin-core-server.savedobjectsfieldmapping.md) for documentation. | | [SavedObjectsCreateOptions](./kibana-plugin-core-server.savedobjectscreateoptions.md) | | | [SavedObjectsCreatePointInTimeFinderDependencies](./kibana-plugin-core-server.savedobjectscreatepointintimefinderdependencies.md) | | | [SavedObjectsDeleteByNamespaceOptions](./kibana-plugin-core-server.savedobjectsdeletebynamespaceoptions.md) | | diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectscomplexfieldmapping.doc_values.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectscomplexfieldmapping.doc_values.md deleted file mode 100644 index 3f2d81cc97c7c8..00000000000000 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectscomplexfieldmapping.doc_values.md +++ /dev/null @@ -1,11 +0,0 @@ - - -[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [SavedObjectsComplexFieldMapping](./kibana-plugin-core-server.savedobjectscomplexfieldmapping.md) > [doc\_values](./kibana-plugin-core-server.savedobjectscomplexfieldmapping.doc_values.md) - -## SavedObjectsComplexFieldMapping.doc\_values property - -Signature: - -```typescript -doc_values?: boolean; -``` diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectscomplexfieldmapping.dynamic.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectscomplexfieldmapping.dynamic.md deleted file mode 100644 index b01da3c62fda67..00000000000000 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectscomplexfieldmapping.dynamic.md +++ /dev/null @@ -1,15 +0,0 @@ - - -[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [SavedObjectsComplexFieldMapping](./kibana-plugin-core-server.savedobjectscomplexfieldmapping.md) > [dynamic](./kibana-plugin-core-server.savedobjectscomplexfieldmapping.dynamic.md) - -## SavedObjectsComplexFieldMapping.dynamic property - -The dynamic property of the mapping, either `false` or `'strict'`. If unspecified `dynamic: 'strict'` will be inherited from the top-level index mappings. - -Note: To limit the number of mapping fields Saved Object types should \*never\* use `dynamic: true`. - -Signature: - -```typescript -dynamic?: false | 'strict'; -``` diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectscomplexfieldmapping.enabled.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectscomplexfieldmapping.enabled.md deleted file mode 100644 index 08513aa2a849b7..00000000000000 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectscomplexfieldmapping.enabled.md +++ /dev/null @@ -1,11 +0,0 @@ - - -[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [SavedObjectsComplexFieldMapping](./kibana-plugin-core-server.savedobjectscomplexfieldmapping.md) > [enabled](./kibana-plugin-core-server.savedobjectscomplexfieldmapping.enabled.md) - -## SavedObjectsComplexFieldMapping.enabled property - -Signature: - -```typescript -enabled?: boolean; -``` diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectscomplexfieldmapping.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectscomplexfieldmapping.md deleted file mode 100644 index fc262cad54f183..00000000000000 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectscomplexfieldmapping.md +++ /dev/null @@ -1,24 +0,0 @@ - - -[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [SavedObjectsComplexFieldMapping](./kibana-plugin-core-server.savedobjectscomplexfieldmapping.md) - -## SavedObjectsComplexFieldMapping interface - -See [SavedObjectsFieldMapping](./kibana-plugin-core-server.savedobjectsfieldmapping.md) for documentation. - -Signature: - -```typescript -export interface SavedObjectsComplexFieldMapping -``` - -## Properties - -| Property | Type | Description | -| --- | --- | --- | -| [doc\_values](./kibana-plugin-core-server.savedobjectscomplexfieldmapping.doc_values.md) | boolean | | -| [dynamic](./kibana-plugin-core-server.savedobjectscomplexfieldmapping.dynamic.md) | false | 'strict' | The dynamic property of the mapping, either false or 'strict'. If unspecified dynamic: 'strict' will be inherited from the top-level index mappings.Note: To limit the number of mapping fields Saved Object types should \*never\* use dynamic: true. | -| [enabled](./kibana-plugin-core-server.savedobjectscomplexfieldmapping.enabled.md) | boolean | | -| [properties](./kibana-plugin-core-server.savedobjectscomplexfieldmapping.properties.md) | SavedObjectsMappingProperties | | -| [type](./kibana-plugin-core-server.savedobjectscomplexfieldmapping.type.md) | string | | - diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectscomplexfieldmapping.properties.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectscomplexfieldmapping.properties.md deleted file mode 100644 index 613a36a09ba1ed..00000000000000 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectscomplexfieldmapping.properties.md +++ /dev/null @@ -1,11 +0,0 @@ - - -[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [SavedObjectsComplexFieldMapping](./kibana-plugin-core-server.savedobjectscomplexfieldmapping.md) > [properties](./kibana-plugin-core-server.savedobjectscomplexfieldmapping.properties.md) - -## SavedObjectsComplexFieldMapping.properties property - -Signature: - -```typescript -properties: SavedObjectsMappingProperties; -``` diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectscomplexfieldmapping.type.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectscomplexfieldmapping.type.md deleted file mode 100644 index 8aaa524dad43a9..00000000000000 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectscomplexfieldmapping.type.md +++ /dev/null @@ -1,11 +0,0 @@ - - -[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [SavedObjectsComplexFieldMapping](./kibana-plugin-core-server.savedobjectscomplexfieldmapping.md) > [type](./kibana-plugin-core-server.savedobjectscomplexfieldmapping.type.md) - -## SavedObjectsComplexFieldMapping.type property - -Signature: - -```typescript -type?: string; -``` diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectscorefieldmapping.doc_values.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectscorefieldmapping.doc_values.md deleted file mode 100644 index 2a79eafd85a6c2..00000000000000 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectscorefieldmapping.doc_values.md +++ /dev/null @@ -1,11 +0,0 @@ - - -[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [SavedObjectsCoreFieldMapping](./kibana-plugin-core-server.savedobjectscorefieldmapping.md) > [doc\_values](./kibana-plugin-core-server.savedobjectscorefieldmapping.doc_values.md) - -## SavedObjectsCoreFieldMapping.doc\_values property - -Signature: - -```typescript -doc_values?: boolean; -``` diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectscorefieldmapping.fields.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectscorefieldmapping.fields.md deleted file mode 100644 index 4f88b635ca2f7c..00000000000000 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectscorefieldmapping.fields.md +++ /dev/null @@ -1,16 +0,0 @@ - - -[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [SavedObjectsCoreFieldMapping](./kibana-plugin-core-server.savedobjectscorefieldmapping.md) > [fields](./kibana-plugin-core-server.savedobjectscorefieldmapping.fields.md) - -## SavedObjectsCoreFieldMapping.fields property - -Signature: - -```typescript -fields?: { - [subfield: string]: { - type: string; - ignore_above?: number; - }; - }; -``` diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectscorefieldmapping.index.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectscorefieldmapping.index.md deleted file mode 100644 index e3cf685e310d27..00000000000000 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectscorefieldmapping.index.md +++ /dev/null @@ -1,11 +0,0 @@ - - -[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [SavedObjectsCoreFieldMapping](./kibana-plugin-core-server.savedobjectscorefieldmapping.md) > [index](./kibana-plugin-core-server.savedobjectscorefieldmapping.index.md) - -## SavedObjectsCoreFieldMapping.index property - -Signature: - -```typescript -index?: boolean; -``` diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectscorefieldmapping.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectscorefieldmapping.md deleted file mode 100644 index e9b9c2bcf51b55..00000000000000 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectscorefieldmapping.md +++ /dev/null @@ -1,24 +0,0 @@ - - -[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [SavedObjectsCoreFieldMapping](./kibana-plugin-core-server.savedobjectscorefieldmapping.md) - -## SavedObjectsCoreFieldMapping interface - -See [SavedObjectsFieldMapping](./kibana-plugin-core-server.savedobjectsfieldmapping.md) for documentation. - -Signature: - -```typescript -export interface SavedObjectsCoreFieldMapping -``` - -## Properties - -| Property | Type | Description | -| --- | --- | --- | -| [doc\_values](./kibana-plugin-core-server.savedobjectscorefieldmapping.doc_values.md) | boolean | | -| [fields](./kibana-plugin-core-server.savedobjectscorefieldmapping.fields.md) | {
[subfield: string]: {
type: string;
ignore_above?: number;
};
} | | -| [index](./kibana-plugin-core-server.savedobjectscorefieldmapping.index.md) | boolean | | -| [null\_value](./kibana-plugin-core-server.savedobjectscorefieldmapping.null_value.md) | number | boolean | string | | -| [type](./kibana-plugin-core-server.savedobjectscorefieldmapping.type.md) | string | | - diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectscorefieldmapping.null_value.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectscorefieldmapping.null_value.md deleted file mode 100644 index 627ea3695383a0..00000000000000 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectscorefieldmapping.null_value.md +++ /dev/null @@ -1,11 +0,0 @@ - - -[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [SavedObjectsCoreFieldMapping](./kibana-plugin-core-server.savedobjectscorefieldmapping.md) > [null\_value](./kibana-plugin-core-server.savedobjectscorefieldmapping.null_value.md) - -## SavedObjectsCoreFieldMapping.null\_value property - -Signature: - -```typescript -null_value?: number | boolean | string; -``` diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectscorefieldmapping.type.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectscorefieldmapping.type.md deleted file mode 100644 index 94d395d7983e57..00000000000000 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectscorefieldmapping.type.md +++ /dev/null @@ -1,11 +0,0 @@ - - -[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [SavedObjectsCoreFieldMapping](./kibana-plugin-core-server.savedobjectscorefieldmapping.md) > [type](./kibana-plugin-core-server.savedobjectscorefieldmapping.type.md) - -## SavedObjectsCoreFieldMapping.type property - -Signature: - -```typescript -type: string; -``` diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsfieldmapping.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsfieldmapping.md index 925ca4be92e663..85b52bacafa252 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsfieldmapping.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsfieldmapping.md @@ -11,5 +11,7 @@ Please refer to [elasticsearch documentation](https://www.elastic.co/guide/en/el Signature: ```typescript -export declare type SavedObjectsFieldMapping = SavedObjectsCoreFieldMapping | SavedObjectsComplexFieldMapping; +export declare type SavedObjectsFieldMapping = estypes.MappingProperty & { + dynamic?: false | 'strict'; +}; ``` diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsfindoptions.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsfindoptions.md index a92b1f48d08ebc..d3696ee71049a2 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsfindoptions.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsfindoptions.md @@ -30,7 +30,7 @@ export interface SavedObjectsFindOptions | [searchAfter](./kibana-plugin-core-server.savedobjectsfindoptions.searchafter.md) | estypes.Id[] | Use the sort values from the previous page to retrieve the next page of results. | | [searchFields](./kibana-plugin-core-server.savedobjectsfindoptions.searchfields.md) | string[] | The fields to perform the parsed query against. See Elasticsearch Simple Query String fields argument for more information | | [sortField](./kibana-plugin-core-server.savedobjectsfindoptions.sortfield.md) | string | | -| [sortOrder](./kibana-plugin-core-server.savedobjectsfindoptions.sortorder.md) | estypes.SortOrder | | +| [sortOrder](./kibana-plugin-core-server.savedobjectsfindoptions.sortorder.md) | estypes.SearchSortOrder | | | [type](./kibana-plugin-core-server.savedobjectsfindoptions.type.md) | string | string[] | | | [typeToNamespacesMap](./kibana-plugin-core-server.savedobjectsfindoptions.typetonamespacesmap.md) | Map<string, string[] | undefined> | This map defines each type to search for, and the namespace(s) to search for the type in; this is only intended to be used by a saved object client wrapper. If this is defined, it supersedes the type and namespaces fields when building the Elasticsearch query. Any types that are not included in this map will be excluded entirely. If a type is included but its value is undefined, the operation will search for that type in the Default namespace. | diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectsfindoptions.sortorder.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectsfindoptions.sortorder.md index e1c657e3a5171f..dca5a7d8c75836 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectsfindoptions.sortorder.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectsfindoptions.sortorder.md @@ -7,5 +7,5 @@ Signature: ```typescript -sortOrder?: estypes.SortOrder; +sortOrder?: estypes.SearchSortOrder; ``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.ifieldtype.lang.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.ifieldtype.lang.md index a994fc458cfb6f..f99e7ba8b967ec 100644 --- a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.ifieldtype.lang.md +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.ifieldtype.lang.md @@ -7,5 +7,5 @@ Signature: ```typescript -lang?: string; +lang?: estypes.ScriptLanguage; ``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.ifieldtype.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.ifieldtype.md index 4e3dea5549b566..29377ff8fd392a 100644 --- a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.ifieldtype.md +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.ifieldtype.md @@ -26,7 +26,7 @@ export interface IFieldType | [esTypes](./kibana-plugin-plugins-data-public.ifieldtype.estypes.md) | string[] | | | [filterable](./kibana-plugin-plugins-data-public.ifieldtype.filterable.md) | boolean | | | [format](./kibana-plugin-plugins-data-public.ifieldtype.format.md) | any | | -| [lang](./kibana-plugin-plugins-data-public.ifieldtype.lang.md) | string | | +| [lang](./kibana-plugin-plugins-data-public.ifieldtype.lang.md) | estypes.ScriptLanguage | | | [name](./kibana-plugin-plugins-data-public.ifieldtype.name.md) | string | | | [readFromDocValues](./kibana-plugin-plugins-data-public.ifieldtype.readfromdocvalues.md) | boolean | | | [script](./kibana-plugin-plugins-data-public.ifieldtype.script.md) | string | | diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.addscriptedfield.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.addscriptedfield.md index 812f014b15a6c9..e0ee1f0ec15a4c 100644 --- a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.addscriptedfield.md +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.addscriptedfield.md @@ -6,6 +6,7 @@ > Warning: This API is now obsolete. > +> use runtime field instead > Add scripted field to field list diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.getnonscriptedfields.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.getnonscriptedfields.md index 1792a979bf7490..94adbefe535dd3 100644 --- a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.getnonscriptedfields.md +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.getnonscriptedfields.md @@ -6,6 +6,7 @@ > Warning: This API is now obsolete. > +> use runtime field instead > Signature: diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.getscriptedfields.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.getscriptedfields.md index b6b3dcb19bac17..57e1b5f49371bf 100644 --- a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.getscriptedfields.md +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.getscriptedfields.md @@ -6,6 +6,7 @@ > Warning: This API is now obsolete. > +> use runtime field instead > Signature: diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.removescriptedfield.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.removescriptedfield.md index 91f25c09ab197a..d3e1b26810fd74 100644 --- a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.removescriptedfield.md +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.removescriptedfield.md @@ -6,6 +6,7 @@ > Warning: This API is now obsolete. > +> use runtime field instead > Remove scripted field from field list diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfield.lang.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfield.lang.md index b81218eb088866..3666e503e27227 100644 --- a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfield.lang.md +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfield.lang.md @@ -9,7 +9,7 @@ Script field language Signature: ```typescript -get lang(): string | undefined; +get lang(): "painless" | "expression" | "mustache" | "java" | undefined; -set lang(lang: string | undefined); +set lang(lang: "painless" | "expression" | "mustache" | "java" | undefined); ``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfield.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfield.md index 05c807b1cd8457..8cd1a476cf32f8 100644 --- a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfield.md +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfield.md @@ -28,7 +28,7 @@ export declare class IndexPatternField implements IFieldType | [esTypes](./kibana-plugin-plugins-data-public.indexpatternfield.estypes.md) | | string[] | undefined | | | [filterable](./kibana-plugin-plugins-data-public.indexpatternfield.filterable.md) | | boolean | | | [isMapped](./kibana-plugin-plugins-data-public.indexpatternfield.ismapped.md) | | boolean | undefined | Is the field part of the index mapping? | -| [lang](./kibana-plugin-plugins-data-public.indexpatternfield.lang.md) | | string | undefined | Script field language | +| [lang](./kibana-plugin-plugins-data-public.indexpatternfield.lang.md) | | "painless" | "expression" | "mustache" | "java" | undefined | Script field language | | [name](./kibana-plugin-plugins-data-public.indexpatternfield.name.md) | | string | | | [readFromDocValues](./kibana-plugin-plugins-data-public.indexpatternfield.readfromdocvalues.md) | | boolean | | | [runtimeField](./kibana-plugin-plugins-data-public.indexpatternfield.runtimefield.md) | | RuntimeField | undefined | | diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfield.tojson.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfield.tojson.md index f0600dd20658a8..8882fa05ce0c25 100644 --- a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfield.tojson.md +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpatternfield.tojson.md @@ -10,7 +10,7 @@ toJSON(): { count: number; script: string | undefined; - lang: string | undefined; + lang: "painless" | "expression" | "mustache" | "java" | undefined; conflictDescriptions: Record | undefined; name: string; type: string; @@ -28,7 +28,7 @@ toJSON(): { `{ count: number; script: string | undefined; - lang: string | undefined; + lang: "painless" | "expression" | "mustache" | "java" | undefined; conflictDescriptions: Record | undefined; name: string; type: string; diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.phrasefilter.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.phrasefilter.md index 090b78a7078cc5..8d0447d58634c9 100644 --- a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.phrasefilter.md +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.phrasefilter.md @@ -12,7 +12,7 @@ export declare type PhraseFilter = Filter & { script?: { script: { source?: any; - lang?: string; + lang?: estypes.ScriptLanguage; params: any; }; }; diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.rangefilter.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.rangefilter.md index fbe04f5e0a2a94..1cb627ec3a8f93 100644 --- a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.rangefilter.md +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.rangefilter.md @@ -12,7 +12,7 @@ export declare type RangeFilter = Filter & EsRangeFilter & { script?: { script: { params: any; - lang: string; + lang: estypes.ScriptLanguage; source: any; }; }; diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.reason.lang.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.reason.lang.md index 095142cf0f05b1..757d8f34a0c3ab 100644 --- a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.reason.lang.md +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.reason.lang.md @@ -7,5 +7,5 @@ Signature: ```typescript -lang?: string; +lang?: estypes.ScriptLanguage; ``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.reason.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.reason.md index a1a76f2d2a295e..fb39333cf245e0 100644 --- a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.reason.md +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.reason.md @@ -15,7 +15,7 @@ export interface Reason | Property | Type | Description | | --- | --- | --- | | [caused\_by](./kibana-plugin-plugins-data-public.reason.caused_by.md) | {
type: string;
reason: string;
} | | -| [lang](./kibana-plugin-plugins-data-public.reason.lang.md) | string | | +| [lang](./kibana-plugin-plugins-data-public.reason.lang.md) | estypes.ScriptLanguage | | | [position](./kibana-plugin-plugins-data-public.reason.position.md) | {
offset: number;
start: number;
end: number;
} | | | [reason](./kibana-plugin-plugins-data-public.reason.reason.md) | string | | | [script\_stack](./kibana-plugin-plugins-data-public.reason.script_stack.md) | string[] | | diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.ifieldtype.lang.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.ifieldtype.lang.md index d033804cb6fcbb..3d5a757cb8f187 100644 --- a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.ifieldtype.lang.md +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.ifieldtype.lang.md @@ -7,5 +7,5 @@ Signature: ```typescript -lang?: string; +lang?: estypes.ScriptLanguage; ``` diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.ifieldtype.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.ifieldtype.md index 5ac48d26a85d6d..bbc4cc2135d406 100644 --- a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.ifieldtype.md +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.ifieldtype.md @@ -26,7 +26,7 @@ export interface IFieldType | [esTypes](./kibana-plugin-plugins-data-server.ifieldtype.estypes.md) | string[] | | | [filterable](./kibana-plugin-plugins-data-server.ifieldtype.filterable.md) | boolean | | | [format](./kibana-plugin-plugins-data-server.ifieldtype.format.md) | any | | -| [lang](./kibana-plugin-plugins-data-server.ifieldtype.lang.md) | string | | +| [lang](./kibana-plugin-plugins-data-server.ifieldtype.lang.md) | estypes.ScriptLanguage | | | [name](./kibana-plugin-plugins-data-server.ifieldtype.name.md) | string | | | [readFromDocValues](./kibana-plugin-plugins-data-server.ifieldtype.readfromdocvalues.md) | boolean | | | [script](./kibana-plugin-plugins-data-server.ifieldtype.script.md) | string | | diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpattern.addscriptedfield.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpattern.addscriptedfield.md index 981f28a51ae09d..33f1ac5e316605 100644 --- a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpattern.addscriptedfield.md +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpattern.addscriptedfield.md @@ -6,6 +6,7 @@ > Warning: This API is now obsolete. > +> use runtime field instead > Add scripted field to field list diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpattern.getnonscriptedfields.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpattern.getnonscriptedfields.md index cff2c5de98de61..e791dfc7c3738f 100644 --- a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpattern.getnonscriptedfields.md +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpattern.getnonscriptedfields.md @@ -6,6 +6,7 @@ > Warning: This API is now obsolete. > +> use runtime field instead > Signature: diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpattern.getscriptedfields.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpattern.getscriptedfields.md index 62b8f1b62ac787..95f9f31309674c 100644 --- a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpattern.getscriptedfields.md +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpattern.getscriptedfields.md @@ -6,6 +6,7 @@ > Warning: This API is now obsolete. > +> use runtime field instead > Signature: diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpattern.removescriptedfield.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpattern.removescriptedfield.md index f6beed7389e438..b351eba2ace4f6 100644 --- a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpattern.removescriptedfield.md +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpattern.removescriptedfield.md @@ -6,6 +6,7 @@ > Warning: This API is now obsolete. > +> use runtime field instead > Remove scripted field from field list diff --git a/docs/discover/images/discover-search-for-relevance.png b/docs/discover/images/discover-search-for-relevance.png index 4d59ad186ded42..e42ed2416f79ef 100644 Binary files a/docs/discover/images/discover-search-for-relevance.png and b/docs/discover/images/discover-search-for-relevance.png differ diff --git a/docs/discover/images/double-arrow.png b/docs/discover/images/double-arrow.png new file mode 100644 index 00000000000000..ba4ee11ebf7381 Binary files /dev/null and b/docs/discover/images/double-arrow.png differ diff --git a/docs/discover/images/downward-arrow.png b/docs/discover/images/downward-arrow.png new file mode 100644 index 00000000000000..47b03cfe82b348 Binary files /dev/null and b/docs/discover/images/downward-arrow.png differ diff --git a/docs/discover/search-for-relevance.asciidoc b/docs/discover/search-for-relevance.asciidoc index 0232c02b6e0614..f3cf1c3a7f52c6 100644 --- a/docs/discover/search-for-relevance.asciidoc +++ b/docs/discover/search-for-relevance.asciidoc @@ -1,24 +1,36 @@ [[discover-search-for-relevance]] == Search for relevance -Sometimes you might be unsure which documents best match your question. +Sometimes you might be unsure which documents best match your search. {es} assigns a relevancy, or score to each document, so you can can narrow your search to the documents with the most relevant results. The higher the score, the better it matches your query. -For example, suppose you have the <>, and you're a searching for -a flight that arrived or departed from `Warsaw` or `Venice` when the weather was clear. +This example shows how to use *Discover* to list +your documents from most relevant to least relevant. This example uses +the <>, or you can use your own data. -. In *Discover*, open the index pattern dropdown, and select `kibana_sample_data_flight`. -. In the query bar, click *KQL*, and switch to the <>. -. Search for `Warsaw OR Venice OR Clear`. -. If you don't see any results, open the time filter and select a time range that contains data. -. From the list of *Available fields*, add `_score` to the document table. -. In the document table, click the header for the `_score` column, and then sort the column by descending scores. +. In *Discover*, open the index pattern dropdown, and select that data you want to work with. + -The results are currently sorted by first `Time`, and then by `_score`. -. To sort only by `_score`, remove the `Time` field. +For the sample flights data, set the index pattern to *kibana_sample_data_flights*. +. In the query bar, click *KQL*, and then turn it off. + -Your table now shows documents with the best matches, from most to least relevant. +You're now using the <>. +. Run your search. For the sample data, try: ++ +```ts +Warsaw OR Venice OR Clear +``` +. If you don't see any results, expand the <>, for example to *Last 7 days*. +. From the list of *Available fields*, add `_score` and any other fields you want to the document table. +. To sort the `_score` column in descending order, hover over its header, and then click twice on +the arrow icon +image:images/double-arrow.png[Double arrow icon to indicate sorting] so it changes to +image:images/downward-arrow.png[Downward pointing arrow to indicate descending sorting]. ++ +At this point, you're doing a multi-column sort: first by `Time`, and then by `_score`. +. To turn off sorting for the `Time` field, hover over its header, and then click the down arrow. ++ +Your table now sorts documents from most to least relevant. + [role="screenshot"] image::images/discover-search-for-relevance.png["Example of a search for relevance"] diff --git a/docs/maps/index.asciidoc b/docs/maps/index.asciidoc index 45d24bfb5a7e4f..20320c5a938c9e 100644 --- a/docs/maps/index.asciidoc +++ b/docs/maps/index.asciidoc @@ -24,8 +24,8 @@ Create beautiful maps from your geographical data. With **Maps**, you can: diff --git a/docs/settings/fleet-settings.asciidoc b/docs/settings/fleet-settings.asciidoc index 9c054fbc002223..134d9de3f49d88 100644 --- a/docs/settings/fleet-settings.asciidoc +++ b/docs/settings/fleet-settings.asciidoc @@ -39,8 +39,8 @@ See the {fleet-guide}/index.html[{fleet}] docs for more information. |=== | `xpack.fleet.agents.fleet_server.hosts` | Hostnames used by {agent} for accessing {fleet-server}. -| `xpack.fleet.agents.elasticsearch.host` - | The hostname used by {agent} for accessing {es}. +| `xpack.fleet.agents.elasticsearch.hosts` + | Hostnames used by {agent} for accessing {es}. |=== [NOTE] diff --git a/docs/user/dashboard/lens.asciidoc b/docs/user/dashboard/lens.asciidoc index c5718b2a089bfc..3b3a7a9ee527d4 100644 --- a/docs/user/dashboard/lens.asciidoc +++ b/docs/user/dashboard/lens.asciidoc @@ -10,8 +10,8 @@ src="https://play.vidyard.com/embed/v4.js"> diff --git a/docs/user/dashboard/timelion.asciidoc b/docs/user/dashboard/timelion.asciidoc index 675fd03df36484..ec9e8b56f9342c 100644 --- a/docs/user/dashboard/timelion.asciidoc +++ b/docs/user/dashboard/timelion.asciidoc @@ -4,7 +4,7 @@ To use *Timelion*, you define a graph by chaining functions together, using the *Timelion*-specific syntax. The syntax enables some features that classical point series charts don't offer, such as pulling data from different indices or data sources into one graph. -deprecated::[7.0.0,"*Timelion* is still supported. The *Timelion app* is deprecated in 7.0, replaced by dashboard features. In the last 7.x minor version and later, the *Timelion app* is removed from {kib}. To prepare for the removal of *Timelion app*, you must migrate *Timelion app* worksheets to a dashboard. For information on how to migrate *Timelion app* worksheets, refer to the link:https://www.elastic.co/guide/en/kibana/7.10/release-notes-7.10.0.html#deprecation-v7.10.0[7.10.0 Release Notes]."] +deprecated::[7.0.0,"*Timelion* is still supported. The *Timelion app* is deprecated in 7.0, replaced by dashboard features. In 7.16 and later, the *Timelion app* is removed from {kib}. To prepare for the removal of *Timelion app*, you must migrate *Timelion app* worksheets to a dashboard. For information on how to migrate *Timelion app* worksheets, refer to the link:https://www.elastic.co/guide/en/kibana/7.10/release-notes-7.10.0.html#deprecation-v7.10.0[7.10.0 Release Notes]."] [float] ==== Timelion expressions diff --git a/docs/user/introduction.asciidoc b/docs/user/introduction.asciidoc index 38435708aaf997..25780d303eec41 100644 --- a/docs/user/introduction.asciidoc +++ b/docs/user/introduction.asciidoc @@ -26,8 +26,8 @@ which features. diff --git a/examples/search_examples/public/search_sessions/app.tsx b/examples/search_examples/public/search_sessions/app.tsx index a768600db24eea..7fdf91537c977c 100644 --- a/examples/search_examples/public/search_sessions/app.tsx +++ b/examples/search_examples/public/search_sessions/app.tsx @@ -702,7 +702,7 @@ function doSearch( const startTs = performance.now(); // Submit the search request using the `data.search` service. - // @ts-expect-error request.params is incompatible. Filter is not assignable to QueryContainer + // @ts-expect-error request.params is incompatible. Filter is not assignable to QueryDslQueryContainer return data.search .search(req, { sessionId }) .pipe( diff --git a/package.json b/package.json index e0bebcaacd7eaa..7d4d96e8407529 100644 --- a/package.json +++ b/package.json @@ -99,9 +99,9 @@ "dependencies": { "@elastic/apm-rum": "^5.6.1", "@elastic/apm-rum-react": "^1.2.5", - "@elastic/charts": "29.2.0", - "@elastic/datemath": "link:bazel-bin/packages/elastic-datemath/npm_module", - "@elastic/elasticsearch": "npm:@elastic/elasticsearch-canary@^8.0.0-canary.4", + "@elastic/charts": "30.0.0", + "@elastic/datemath": "link:bazel-bin/packages/elastic-datemath", + "@elastic/elasticsearch": "npm:@elastic/elasticsearch-canary@^8.0.0-canary.13", "@elastic/ems-client": "7.13.0", "@elastic/eui": "33.0.0", "@elastic/filesaver": "1.1.2", @@ -111,7 +111,7 @@ "@elastic/numeral": "^2.5.1", "@elastic/react-search-ui": "^1.5.1", "@elastic/request-crypto": "1.1.4", - "@elastic/safer-lodash-set": "link:bazel-bin/packages/elastic-safer-lodash-set/npm_module", + "@elastic/safer-lodash-set": "link:bazel-bin/packages/elastic-safer-lodash-set", "@elastic/search-ui-app-search-connector": "^1.5.0", "@elastic/ui-ace": "0.2.3", "@hapi/accept": "^5.0.2", @@ -124,39 +124,39 @@ "@hapi/inert": "^6.0.3", "@hapi/podium": "^4.1.1", "@hapi/wreck": "^17.1.0", - "@kbn/ace": "link:bazel-bin/packages/kbn-ace/npm_module", - "@kbn/analytics": "link:bazel-bin/packages/kbn-analytics/npm_module", - "@kbn/apm-config-loader": "link:bazel-bin/packages/kbn-apm-config-loader/npm_module", - "@kbn/apm-utils": "link:bazel-bin/packages/kbn-apm-utils/npm_module", - "@kbn/config": "link:bazel-bin/packages/kbn-config/npm_module", - "@kbn/config-schema": "link:bazel-bin/packages/kbn-config-schema/npm_module", - "@kbn/crypto": "link:bazel-bin/packages/kbn-crypto/npm_module", - "@kbn/i18n": "link:bazel-bin/packages/kbn-i18n/npm_module", + "@kbn/ace": "link:bazel-bin/packages/kbn-ace", + "@kbn/analytics": "link:bazel-bin/packages/kbn-analytics", + "@kbn/apm-config-loader": "link:bazel-bin/packages/kbn-apm-config-loader", + "@kbn/apm-utils": "link:bazel-bin/packages/kbn-apm-utils", + "@kbn/config": "link:bazel-bin/packages/kbn-config", + "@kbn/config-schema": "link:bazel-bin/packages/kbn-config-schema", + "@kbn/crypto": "link:bazel-bin/packages/kbn-crypto", + "@kbn/mapbox-gl": "link:bazel-bin/packages/kbn-mapbox-gl", + "@kbn/i18n": "link:bazel-bin/packages/kbn-i18n", "@kbn/interpreter": "link:packages/kbn-interpreter", - "@kbn/io-ts-utils": "link:bazel-bin/packages/kbn-io-ts-utils/npm_module", - "@kbn/legacy-logging": "link:bazel-bin/packages/kbn-legacy-logging/npm_module", - "@kbn/logging": "link:bazel-bin/packages/kbn-logging/npm_module", - "@kbn/mapbox-gl": "link:bazel-bin/packages/kbn-mapbox-gl/npm_module", - "@kbn/monaco": "link:bazel-bin/packages/kbn-monaco/npm_module", - "@kbn/rule-data-utils": "link:packages/kbn-rule-data-utils", - "@kbn/securitysolution-es-utils": "link:bazel-bin/packages/kbn-securitysolution-es-utils/npm_module", - "@kbn/securitysolution-io-ts-alerting-types": "link:bazel-bin/packages/kbn-securitysolution-io-ts-alerting-types/npm_module", - "@kbn/securitysolution-io-ts-list-types": "link:bazel-bin/packages/kbn-securitysolution-io-ts-list-types/npm_module", - "@kbn/securitysolution-io-ts-types": "link:bazel-bin/packages/kbn-securitysolution-io-ts-types/npm_module", - "@kbn/securitysolution-io-ts-utils": "link:bazel-bin/packages/kbn-securitysolution-io-ts-utils/npm_module", - "@kbn/securitysolution-list-api": "link:bazel-bin/packages/kbn-securitysolution-list-api/npm_module", - "@kbn/securitysolution-list-constants": "link:bazel-bin/packages/kbn-securitysolution-list-constants/npm_module", - "@kbn/securitysolution-list-hooks": "link:bazel-bin/packages/kbn-securitysolution-list-hooks/npm_module", - "@kbn/securitysolution-list-utils": "link:bazel-bin/packages/kbn-securitysolution-list-utils/npm_module", - "@kbn/securitysolution-utils": "link:bazel-bin/packages/kbn-securitysolution-utils/npm_module", - "@kbn/server-http-tools": "link:bazel-bin/packages/kbn-server-http-tools/npm_module", + "@kbn/io-ts-utils": "link:bazel-bin/packages/kbn-io-ts-utils", + "@kbn/legacy-logging": "link:bazel-bin/packages/kbn-legacy-logging", + "@kbn/logging": "link:bazel-bin/packages/kbn-logging", + "@kbn/monaco": "link:bazel-bin/packages/kbn-monaco", + "@kbn/rule-data-utils": "link:bazel-bin/packages/kbn-rule-data-utils", + "@kbn/securitysolution-list-constants": "link:bazel-bin/packages/kbn-securitysolution-list-constants", + "@kbn/securitysolution-es-utils": "link:bazel-bin/packages/kbn-securitysolution-es-utils", + "@kbn/securitysolution-io-ts-types": "link:bazel-bin/packages/kbn-securitysolution-io-ts-types", + "@kbn/securitysolution-io-ts-alerting-types": "link:bazel-bin/packages/kbn-securitysolution-io-ts-alerting-types", + "@kbn/securitysolution-io-ts-list-types": "link:bazel-bin/packages/kbn-securitysolution-io-ts-list-types", + "@kbn/securitysolution-io-ts-utils": "link:bazel-bin/packages/kbn-securitysolution-io-ts-utils", + "@kbn/securitysolution-list-api": "link:bazel-bin/packages/kbn-securitysolution-list-api", + "@kbn/securitysolution-list-hooks": "link:bazel-bin/packages/kbn-securitysolution-list-hooks", + "@kbn/securitysolution-list-utils": "link:bazel-bin/packages/kbn-securitysolution-list-utils", + "@kbn/securitysolution-utils": "link:bazel-bin/packages/kbn-securitysolution-utils", + "@kbn/server-http-tools": "link:bazel-bin/packages/kbn-server-http-tools", "@kbn/server-route-repository": "link:packages/kbn-server-route-repository", - "@kbn/std": "link:bazel-bin/packages/kbn-std/npm_module", - "@kbn/tinymath": "link:bazel-bin/packages/kbn-tinymath/npm_module", + "@kbn/std": "link:bazel-bin/packages/kbn-std", + "@kbn/tinymath": "link:bazel-bin/packages/kbn-tinymath", "@kbn/ui-framework": "link:packages/kbn-ui-framework", "@kbn/ui-shared-deps": "link:packages/kbn-ui-shared-deps", - "@kbn/utility-types": "link:bazel-bin/packages/kbn-utility-types/npm_module", - "@kbn/utils": "link:bazel-bin/packages/kbn-utils/npm_module", + "@kbn/utility-types": "link:bazel-bin/packages/kbn-utility-types", + "@kbn/utils": "link:bazel-bin/packages/kbn-utils", "@loaders.gl/core": "^2.3.1", "@loaders.gl/json": "^2.3.1", "@mapbox/geojson-rewind": "^0.5.0", @@ -241,7 +241,6 @@ "get-port": "^5.0.0", "getopts": "^2.2.5", "getos": "^3.1.0", - "git-url-parse": "11.1.2", "github-markdown-css": "^2.10.0", "glob": "^7.1.2", "glob-all": "^3.2.1", @@ -294,7 +293,7 @@ "memoize-one": "^5.0.0", "mime": "^2.4.4", "mime-types": "^2.1.27", - "mini-css-extract-plugin": "0.8.0", + "mini-css-extract-plugin": "1.1.0", "minimatch": "^3.0.4", "moment": "^2.24.0", "moment-duration-format": "^2.3.2", @@ -442,33 +441,33 @@ "@babel/traverse": "^7.12.12", "@babel/types": "^7.12.12", "@bazel/ibazel": "^0.15.10", - "@bazel/typescript": "^3.5.0", + "@bazel/typescript": "^3.5.1", "@cypress/snapshot": "^2.1.7", "@cypress/webpack-preprocessor": "^5.6.0", "@elastic/apm-rum": "^5.6.1", "@elastic/apm-rum-react": "^1.2.5", - "@elastic/eslint-config-kibana": "link:bazel-bin/packages/elastic-eslint-config-kibana/npm_module", + "@elastic/eslint-config-kibana": "link:bazel-bin/packages/elastic-eslint-config-kibana", "@elastic/eslint-plugin-eui": "0.0.2", "@elastic/github-checks-reporter": "0.0.20b3", "@elastic/makelogs": "^6.0.0", "@istanbuljs/schema": "^0.1.2", "@jest/reporters": "^26.6.2", - "@kbn/babel-code-parser": "link:bazel-bin/packages/kbn-babel-code-parser/npm_module", - "@kbn/babel-preset": "link:bazel-bin/packages/kbn-babel-preset/npm_module", + "@kbn/babel-code-parser": "link:bazel-bin/packages/kbn-babel-code-parser", + "@kbn/babel-preset": "link:bazel-bin/packages/kbn-babel-preset", "@kbn/cli-dev-mode": "link:packages/kbn-cli-dev-mode", - "@kbn/dev-utils": "link:bazel-bin/packages/kbn-dev-utils/npm_module", - "@kbn/docs-utils": "link:bazel-bin/packages/kbn-docs-utils/npm_module", - "@kbn/es": "link:bazel-bin/packages/kbn-es/npm_module", + "@kbn/dev-utils": "link:bazel-bin/packages/kbn-dev-utils", + "@kbn/docs-utils": "link:bazel-bin/packages/kbn-docs-utils", + "@kbn/es": "link:bazel-bin/packages/kbn-es", "@kbn/es-archiver": "link:packages/kbn-es-archiver", - "@kbn/eslint-import-resolver-kibana": "link:bazel-bin/packages/kbn-eslint-import-resolver-kibana/npm_module", - "@kbn/eslint-plugin-eslint": "link:bazel-bin/packages/kbn-eslint-plugin-eslint/npm_module", - "@kbn/expect": "link:bazel-bin/packages/kbn-expect/npm_module", + "@kbn/eslint-import-resolver-kibana": "link:bazel-bin/packages/kbn-eslint-import-resolver-kibana", + "@kbn/eslint-plugin-eslint": "link:bazel-bin/packages/kbn-eslint-plugin-eslint", + "@kbn/expect": "link:bazel-bin/packages/kbn-expect", "@kbn/optimizer": "link:packages/kbn-optimizer", - "@kbn/plugin-generator": "link:bazel-bin/packages/kbn-plugin-generator/npm_module", + "@kbn/plugin-generator": "link:bazel-bin/packages/kbn-plugin-generator", "@kbn/plugin-helpers": "link:packages/kbn-plugin-helpers", "@kbn/pm": "link:packages/kbn-pm", "@kbn/storybook": "link:packages/kbn-storybook", - "@kbn/telemetry-tools": "link:bazel-bin/packages/kbn-telemetry-tools/npm_module", + "@kbn/telemetry-tools": "link:bazel-bin/packages/kbn-telemetry-tools", "@kbn/test": "link:packages/kbn-test", "@kbn/test-subj-selector": "link:packages/kbn-test-subj-selector", "@loaders.gl/polyfills": "^2.3.5", @@ -533,7 +532,6 @@ "@types/geojson": "7946.0.7", "@types/getopts": "^2.0.1", "@types/getos": "^3.0.0", - "@types/git-url-parse": "^9.0.0", "@types/glob": "^7.1.2", "@types/gulp": "^4.0.6", "@types/gulp-zip": "^4.0.1", @@ -750,6 +748,7 @@ "jest-cli": "^26.6.3", "jest-diff": "^26.6.2", "jest-environment-jsdom": "^26.6.2", + "jest-environment-jsdom-thirteen": "^1.0.1", "jest-raw-loader": "^1.0.1", "jest-silent-reporter": "^0.5.0", "jest-snapshot": "^26.6.2", diff --git a/packages/BUILD.bazel b/packages/BUILD.bazel index de3498da1a6976..083ae90a031f50 100644 --- a/packages/BUILD.bazel +++ b/packages/BUILD.bazel @@ -28,6 +28,7 @@ filegroup( "//packages/kbn-mapbox-gl:build", "//packages/kbn-monaco:build", "//packages/kbn-plugin-generator:build", + "//packages/kbn-rule-data-utils:build", "//packages/kbn-securitysolution-list-constants:build", "//packages/kbn-securitysolution-io-ts-types:build", "//packages/kbn-securitysolution-io-ts-alerting-types:build", diff --git a/packages/kbn-apm-utils/src/index.ts b/packages/kbn-apm-utils/src/index.ts index f2f537138dad07..384b6683199e5b 100644 --- a/packages/kbn-apm-utils/src/index.ts +++ b/packages/kbn-apm-utils/src/index.ts @@ -16,6 +16,8 @@ export interface SpanOptions { labels?: Record; } +type Span = Exclude; + export function parseSpanOptions(optionsOrName: SpanOptions | string) { const options = typeof optionsOrName === 'string' ? { name: optionsOrName } : optionsOrName; @@ -30,7 +32,7 @@ const runInNewContext = any>(cb: T): ReturnType( optionsOrName: SpanOptions | string, - cb: () => Promise + cb: (span?: Span) => Promise ): Promise { const options = parseSpanOptions(optionsOrName); @@ -71,13 +73,17 @@ export async function withSpan( span.addLabels(labels); } - return cb() + return cb(span) .then((res) => { - span.outcome = 'success'; + if (!span.outcome || span.outcome === 'unknown') { + span.outcome = 'success'; + } return res; }) .catch((err) => { - span.outcome = 'failure'; + if (!span.outcome || span.outcome === 'unknown') { + span.outcome = 'failure'; + } throw err; }) .finally(() => { diff --git a/packages/kbn-babel-code-parser/BUILD.bazel b/packages/kbn-babel-code-parser/BUILD.bazel index c1576ce59aa5c0..dcdc042d7b8029 100644 --- a/packages/kbn-babel-code-parser/BUILD.bazel +++ b/packages/kbn-babel-code-parser/BUILD.bazel @@ -34,10 +34,10 @@ DEPS = [ babel( name = "target", - data = [ + data = DEPS + [ ":srcs", ".babelrc", - ] + DEPS, + ], output_dir = True, # the following arg paths includes $(execpath) as babel runs on the sandbox root args = [ diff --git a/packages/kbn-es-archiver/src/lib/indices/create_index_stream.ts b/packages/kbn-es-archiver/src/lib/indices/create_index_stream.ts index b45a8b18a5776a..fba3df24e896f8 100644 --- a/packages/kbn-es-archiver/src/lib/indices/create_index_stream.ts +++ b/packages/kbn-es-archiver/src/lib/indices/create_index_stream.ts @@ -19,7 +19,7 @@ import { deleteIndex } from './delete_index'; import { ES_CLIENT_HEADERS } from '../../client_headers'; interface DocRecord { - value: estypes.IndexState & { + value: estypes.IndicesIndexState & { index: string; type: string; }; diff --git a/packages/kbn-es-archiver/src/lib/indices/delete_index.ts b/packages/kbn-es-archiver/src/lib/indices/delete_index.ts index 2a42d52e2ca80b..d3d6f85d7a360b 100644 --- a/packages/kbn-es-archiver/src/lib/indices/delete_index.ts +++ b/packages/kbn-es-archiver/src/lib/indices/delete_index.ts @@ -126,7 +126,7 @@ export async function waitForSnapshotCompletion( const { body: repositoryMap } = await client.snapshot.getRepository({} as any); for (const repository of Object.keys(repositoryMap)) { const allInProgress = await getInProgressSnapshots(repository); - const found = allInProgress.find((s: any) => s.indices.includes(index)); + const found = allInProgress?.find((s: any) => s.indices.includes(index)); if (!found) { continue; diff --git a/packages/kbn-es-archiver/src/lib/indices/kibana_index.ts b/packages/kbn-es-archiver/src/lib/indices/kibana_index.ts index 51d4f28d20f2e0..0712d2789a91ae 100644 --- a/packages/kbn-es-archiver/src/lib/indices/kibana_index.ts +++ b/packages/kbn-es-archiver/src/lib/indices/kibana_index.ts @@ -35,7 +35,7 @@ export async function deleteKibanaIndices({ await client.indices.putSettings( { index: indexNames, - body: { index: { blocks: { read_only: false } } }, + body: { settings: { blocks: { read_only: false } } }, }, { headers: ES_CLIENT_HEADERS, diff --git a/packages/kbn-es/BUILD.bazel b/packages/kbn-es/BUILD.bazel index 6c845996ce5e5a..48f0fb58e983fc 100644 --- a/packages/kbn-es/BUILD.bazel +++ b/packages/kbn-es/BUILD.bazel @@ -47,10 +47,10 @@ DEPS = [ babel( name = "target", - data = [ + data = DEPS + [ ":srcs", ".babelrc", - ] + DEPS, + ], output_dir = True, # the following arg paths includes $(execpath) as babel runs on the sandbox root args = [ diff --git a/packages/kbn-expect/BUILD.bazel b/packages/kbn-expect/BUILD.bazel index 82e6200e9688a8..b7eb91a451b9a5 100644 --- a/packages/kbn-expect/BUILD.bazel +++ b/packages/kbn-expect/BUILD.bazel @@ -5,7 +5,7 @@ PKG_REQUIRE_NAME = "@kbn/expect" SOURCE_FILES = glob([ "expect.js", - "expect.js.d.ts", + "expect.d.ts", ]) SRCS = SOURCE_FILES diff --git a/packages/kbn-expect/expect.js.d.ts b/packages/kbn-expect/expect.d.ts similarity index 100% rename from packages/kbn-expect/expect.js.d.ts rename to packages/kbn-expect/expect.d.ts diff --git a/packages/kbn-expect/package.json b/packages/kbn-expect/package.json index 8ca37c7c88673f..2040683c539e2d 100644 --- a/packages/kbn-expect/package.json +++ b/packages/kbn-expect/package.json @@ -1,6 +1,7 @@ { "name": "@kbn/expect", "main": "./expect.js", + "typings": "./expect.d.ts", "version": "1.0.0", "license": "MIT", "private": true, diff --git a/packages/kbn-expect/tsconfig.json b/packages/kbn-expect/tsconfig.json index 7baae093bc3a98..8c0d9f1e34bd0c 100644 --- a/packages/kbn-expect/tsconfig.json +++ b/packages/kbn-expect/tsconfig.json @@ -4,6 +4,6 @@ "incremental": false, }, "include": [ - "expect.js.d.ts" + "expect.d.ts" ] } diff --git a/packages/kbn-legacy-logging/BUILD.bazel b/packages/kbn-legacy-logging/BUILD.bazel index 21cb8c338f89f9..1fd04604dbd244 100644 --- a/packages/kbn-legacy-logging/BUILD.bazel +++ b/packages/kbn-legacy-logging/BUILD.bazel @@ -25,6 +25,7 @@ NPM_MODULE_EXTRA_FILES = [ SRC_DEPS = [ "//packages/kbn-config-schema", + "//packages/kbn-utils", "@npm//@elastic/numeral", "@npm//@hapi/hapi", "@npm//chokidar", diff --git a/packages/kbn-monaco/BUILD.bazel b/packages/kbn-monaco/BUILD.bazel index 3a25568dfd811d..325187cdebc3ab 100644 --- a/packages/kbn-monaco/BUILD.bazel +++ b/packages/kbn-monaco/BUILD.bazel @@ -48,7 +48,7 @@ webpack( name = "target_web", data = DEPS + [ ":src", - ":webpack.config.js", + "webpack.config.js", ], output_dir = True, args = [ @@ -87,7 +87,7 @@ ts_project( js_library( name = PKG_BASE_NAME, srcs = NPM_MODULE_EXTRA_FILES, - deps = DEPS + [":target_web", ":tsc"], + deps = DEPS + [":tsc", ":target_web"], package_name = PKG_REQUIRE_NAME, visibility = ["//visibility:public"], ) diff --git a/packages/kbn-monaco/webpack.config.js b/packages/kbn-monaco/webpack.config.js index d035134565463e..ef482cd55159bf 100644 --- a/packages/kbn-monaco/webpack.config.js +++ b/packages/kbn-monaco/webpack.config.js @@ -22,7 +22,6 @@ const createLangWorkerConfig = (lang) => { filename: `${lang}.editor.worker.js`, }, resolve: { - modules: ['node_modules'], extensions: ['.js', '.ts', '.tsx'], }, stats: 'errors-only', diff --git a/packages/kbn-optimizer/limits.yml b/packages/kbn-optimizer/limits.yml index 6ccf6269751b1e..455453464e9575 100644 --- a/packages/kbn-optimizer/limits.yml +++ b/packages/kbn-optimizer/limits.yml @@ -34,7 +34,7 @@ pageLoadAssetSize: indexManagement: 140608 indexPatternManagement: 28222 infra: 184320 - fleet: 415829 + fleet: 450005 ingestPipelines: 58003 inputControlVis: 172675 inspector: 148711 @@ -110,3 +110,4 @@ pageLoadAssetSize: timelines: 28613 cases: 162385 screenshotMode: 17856 + visTypePie: 35583 diff --git a/packages/kbn-pm/dist/index.js b/packages/kbn-pm/dist/index.js index 29c0457c316f06..5b064e492beb52 100644 --- a/packages/kbn-pm/dist/index.js +++ b/packages/kbn-pm/dist/index.js @@ -23045,7 +23045,7 @@ class Project { ensureValidProjectDependency(project) { const relativePathToProject = normalizePath(path__WEBPACK_IMPORTED_MODULE_1___default.a.relative(this.path, project.path)); - const relativePathToProjectIfBazelPkg = normalizePath(path__WEBPACK_IMPORTED_MODULE_1___default.a.relative(this.path, `${__dirname}/../../../bazel-bin/packages/${path__WEBPACK_IMPORTED_MODULE_1___default.a.basename(project.path)}/npm_module`)); + const relativePathToProjectIfBazelPkg = normalizePath(path__WEBPACK_IMPORTED_MODULE_1___default.a.relative(this.path, `${__dirname}/../../../bazel-bin/packages/${path__WEBPACK_IMPORTED_MODULE_1___default.a.basename(project.path)}`)); const versionInPackageJson = this.allDependencies[project.name]; const expectedVersionInPackageJson = `link:${relativePathToProject}`; const expectedVersionInPackageJsonIfBazelPkg = `link:${relativePathToProjectIfBazelPkg}`; // TODO: after introduce bazel to build all the packages and completely remove the support for kbn packages @@ -23234,7 +23234,7 @@ function transformDependencies(dependencies = {}) { } if (isBazelPackageDependency(depVersion)) { - newDeps[name] = depVersion.replace('link:bazel-bin/', 'file:').replace('/npm_module', ''); + newDeps[name] = depVersion.replace('link:bazel-bin/', 'file:'); continue; } @@ -48471,7 +48471,7 @@ async function runBazelCommandWithRunner(bazelCommandRunner, bazelArgs, offline }); if (offline) { - bazelArgs.push('--config=offline'); + bazelArgs = [...bazelArgs, '--config=offline']; } const bazelProc = Object(_child_process__WEBPACK_IMPORTED_MODULE_4__["spawn"])(bazelCommandRunner, bazelArgs, bazelOpts); diff --git a/packages/kbn-pm/src/utils/bazel/run.ts b/packages/kbn-pm/src/utils/bazel/run.ts index 7b20ea43982e6a..c030081e53daaf 100644 --- a/packages/kbn-pm/src/utils/bazel/run.ts +++ b/packages/kbn-pm/src/utils/bazel/run.ts @@ -30,7 +30,7 @@ async function runBazelCommandWithRunner( }; if (offline) { - bazelArgs.push('--config=offline'); + bazelArgs = [...bazelArgs, '--config=offline']; } const bazelProc = spawn(bazelCommandRunner, bazelArgs, bazelOpts); diff --git a/packages/kbn-pm/src/utils/package_json.ts b/packages/kbn-pm/src/utils/package_json.ts index e635c2566e65ac..a50d8994b5720a 100644 --- a/packages/kbn-pm/src/utils/package_json.ts +++ b/packages/kbn-pm/src/utils/package_json.ts @@ -61,7 +61,7 @@ export function transformDependencies(dependencies: IPackageDependencies = {}) { } if (isBazelPackageDependency(depVersion)) { - newDeps[name] = depVersion.replace('link:bazel-bin/', 'file:').replace('/npm_module', ''); + newDeps[name] = depVersion.replace('link:bazel-bin/', 'file:'); continue; } diff --git a/packages/kbn-pm/src/utils/project.ts b/packages/kbn-pm/src/utils/project.ts index 5d2a0547b25772..8e86b111c6a182 100644 --- a/packages/kbn-pm/src/utils/project.ts +++ b/packages/kbn-pm/src/utils/project.ts @@ -94,7 +94,7 @@ export class Project { const relativePathToProjectIfBazelPkg = normalizePath( Path.relative( this.path, - `${__dirname}/../../../bazel-bin/packages/${Path.basename(project.path)}/npm_module` + `${__dirname}/../../../bazel-bin/packages/${Path.basename(project.path)}` ) ); diff --git a/packages/kbn-rule-data-utils/BUILD.bazel b/packages/kbn-rule-data-utils/BUILD.bazel new file mode 100644 index 00000000000000..ccd1793feb161e --- /dev/null +++ b/packages/kbn-rule-data-utils/BUILD.bazel @@ -0,0 +1,79 @@ +load("@npm//@bazel/typescript:index.bzl", "ts_config", "ts_project") +load("@build_bazel_rules_nodejs//:index.bzl", "js_library", "pkg_npm") + +PKG_BASE_NAME = "kbn-rule-data-utils" +PKG_REQUIRE_NAME = "@kbn/rule-data-utils" + +SOURCE_FILES = glob( + [ + "src/**/*.ts", + ], +) + +SRCS = SOURCE_FILES + +filegroup( + name = "srcs", + srcs = SRCS, +) + +NPM_MODULE_EXTRA_FILES = [ + "package.json", +] + +SRC_DEPS = [ + "@npm//tslib", + "@npm//utility-types", +] + +TYPES_DEPS = [ + "@npm//@types/jest", + "@npm//@types/node", +] + +DEPS = SRC_DEPS + TYPES_DEPS + +ts_config( + name = "tsconfig", + src = "tsconfig.json", + deps = [ + "//:tsconfig.base.json", + ], +) + +ts_project( + name = "tsc", + args = ['--pretty'], + srcs = SRCS, + deps = DEPS, + declaration = True, + declaration_map = True, + incremental = True, + out_dir = "target", + source_map = True, + root_dir = "src", + tsconfig = ":tsconfig", +) + +js_library( + name = PKG_BASE_NAME, + srcs = NPM_MODULE_EXTRA_FILES, + deps = DEPS + [":tsc"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + +pkg_npm( + name = "npm_module", + deps = [ + ":%s" % PKG_BASE_NAME, + ] +) + +filegroup( + name = "build", + srcs = [ + ":npm_module", + ], + visibility = ["//visibility:public"], +) diff --git a/packages/kbn-rule-data-utils/tsconfig.json b/packages/kbn-rule-data-utils/tsconfig.json index 4b1262d11f3aff..852393f01e5941 100644 --- a/packages/kbn-rule-data-utils/tsconfig.json +++ b/packages/kbn-rule-data-utils/tsconfig.json @@ -1,11 +1,12 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { - "incremental": false, + "incremental": true, "outDir": "./target", "stripInternal": false, "declaration": true, "declarationMap": true, + "rootDir": "./src", "sourceMap": true, "sourceRoot": "../../../../packages/kbn-rule-data-utils/src", "types": [ diff --git a/packages/kbn-securitysolution-io-ts-list-types/BUILD.bazel b/packages/kbn-securitysolution-io-ts-list-types/BUILD.bazel index 91e4667c16b4e9..99df07c3d8ea8a 100644 --- a/packages/kbn-securitysolution-io-ts-list-types/BUILD.bazel +++ b/packages/kbn-securitysolution-io-ts-list-types/BUILD.bazel @@ -27,9 +27,10 @@ NPM_MODULE_EXTRA_FILES = [ ] SRC_DEPS = [ + "//packages/elastic-datemath", "//packages/kbn-securitysolution-io-ts-types", "//packages/kbn-securitysolution-io-ts-utils", - "//packages/elastic-datemath", + "//packages/kbn-securitysolution-list-constants", "@npm//fp-ts", "@npm//io-ts", "@npm//lodash", diff --git a/packages/kbn-test/src/functional_test_runner/public_types.ts b/packages/kbn-test/src/functional_test_runner/public_types.ts index 4a30744c09b516..d94f61e23b8b80 100644 --- a/packages/kbn-test/src/functional_test_runner/public_types.ts +++ b/packages/kbn-test/src/functional_test_runner/public_types.ts @@ -74,6 +74,12 @@ export interface GenericFtrProviderContext< getService(serviceName: 'failureMetadata'): FailureMetadata; getService(serviceName: T): ServiceMap[T]; + /** + * Get the instance of a page object + * @param pageObjectName + */ + getPageObject(pageObjectName: K): PageObjectMap[K]; + /** * Get a map of PageObjects * @param pageObjects diff --git a/packages/kbn-test/src/jest/utils/testbed/types.ts b/packages/kbn-test/src/jest/utils/testbed/types.ts index 520a78d03d7013..fdc000215c4f19 100644 --- a/packages/kbn-test/src/jest/utils/testbed/types.ts +++ b/packages/kbn-test/src/jest/utils/testbed/types.ts @@ -121,7 +121,7 @@ export interface TestBed { * * @param switchTestSubject The test subject of the EuiSwitch (can be a nested path. e.g. "myForm.mySwitch"). */ - toggleEuiSwitch: (switchTestSubject: T, isChecked?: boolean) => void; + toggleEuiSwitch: (switchTestSubject: T) => void; /** * The EUI ComboBox is a special input as it needs the ENTER key to be pressed * in order to register the value set. This helpers automatically does that. diff --git a/src/core/public/application/application_service.test.ts b/src/core/public/application/application_service.test.ts index 2e2f1cad49f199..5658d3f6260772 100644 --- a/src/core/public/application/application_service.test.ts +++ b/src/core/public/application/application_service.test.ts @@ -107,6 +107,7 @@ describe('#setup()', () => { status: AppStatus.inaccessible, tooltip: 'App inaccessible due to reason', defaultPath: 'foo/bar', + deepLinks: [{ id: 'subapp2', title: 'Subapp 2', path: '/subapp2' }], })); applications = await applications$.pipe(take(1)).toPromise(); @@ -118,6 +119,9 @@ describe('#setup()', () => { status: AppStatus.inaccessible, defaultPath: 'foo/bar', tooltip: 'App inaccessible due to reason', + deepLinks: [ + expect.objectContaining({ id: 'subapp2', title: 'Subapp 2', path: '/subapp2' }), + ], }) ); expect(applications.get('app2')).toEqual( @@ -814,6 +818,128 @@ describe('#start()', () => { expect(MockHistory.replace).not.toHaveBeenCalled(); }); }); + + describe('deepLinkId option', () => { + beforeEach(() => { + MockHistory.push.mockClear(); + }); + + it('preserves trailing slash when path contains a hash', async () => { + const { register } = service.setup(setupDeps); + + register( + Symbol(), + createApp({ + id: 'app1', + appRoute: '/custom/app-path', + deepLinks: [{ id: 'dl1', title: 'deep link 1', path: '/deep-link' }], + }) + ); + + const { navigateToApp } = await service.start(startDeps); + await navigateToApp('app1', { deepLinkId: 'dl1', path: '#/' }); + expect(MockHistory.push).toHaveBeenLastCalledWith( + '/custom/app-path/deep-link#/', + undefined + ); + + await navigateToApp('app1', { deepLinkId: 'dl1', path: '#/foo/bar/' }); + expect(MockHistory.push).toHaveBeenLastCalledWith( + '/custom/app-path/deep-link#/foo/bar/', + undefined + ); + + await navigateToApp('app1', { deepLinkId: 'dl1', path: '/path#/' }); + expect(MockHistory.push).toHaveBeenLastCalledWith( + '/custom/app-path/deep-link/path#/', + undefined + ); + + await navigateToApp('app1', { deepLinkId: 'dl1', path: '/path#/hash/' }); + expect(MockHistory.push).toHaveBeenLastCalledWith( + '/custom/app-path/deep-link/path#/hash/', + undefined + ); + + await navigateToApp('app1', { deepLinkId: 'dl1', path: '/path/' }); + expect(MockHistory.push).toHaveBeenLastCalledWith( + '/custom/app-path/deep-link/path', + undefined + ); + }); + + it('omits the defaultPath when the deepLinkId parameter is specified', async () => { + const { register } = service.setup(setupDeps); + + register( + Symbol(), + createApp({ + id: 'app1', + defaultPath: 'default/path', + deepLinks: [{ id: 'dl1', title: 'deep link 1', path: '/deep-link' }], + }) + ); + register( + Symbol(), + createApp({ + id: 'app2', + appRoute: '/custom-app-path', + defaultPath: '/my-default', + deepLinks: [{ id: 'dl2', title: 'deep link 2', path: '/deep-link-2' }], + }) + ); + + const { navigateToApp } = await service.start(startDeps); + + await navigateToApp('app1', {}); + expect(MockHistory.push).toHaveBeenLastCalledWith('/app/app1/default/path', undefined); + + await navigateToApp('app1', { deepLinkId: 'dl1' }); + expect(MockHistory.push).toHaveBeenLastCalledWith('/app/app1/deep-link', undefined); + + await navigateToApp('app1', { deepLinkId: 'dl1', path: 'some-other-path' }); + expect(MockHistory.push).toHaveBeenLastCalledWith( + '/app/app1/deep-link/some-other-path', + undefined + ); + + await navigateToApp('app2', {}); + expect(MockHistory.push).toHaveBeenLastCalledWith('/custom-app-path/my-default', undefined); + + await navigateToApp('app2', { deepLinkId: 'dl2' }); + expect(MockHistory.push).toHaveBeenLastCalledWith( + '/custom-app-path/deep-link-2', + undefined + ); + + await navigateToApp('app2', { deepLinkId: 'dl2', path: 'some-other-path' }); + expect(MockHistory.push).toHaveBeenLastCalledWith( + '/custom-app-path/deep-link-2/some-other-path', + undefined + ); + }); + + it('ignores the deepLinkId parameter if it is unknown', async () => { + const { register } = service.setup(setupDeps); + + register( + Symbol(), + createApp({ + id: 'app1', + defaultPath: 'default/path', + deepLinks: [{ id: 'dl1', title: 'deep link 1', path: '/deep-link' }], + }) + ); + + const { navigateToApp } = await service.start(startDeps); + + await navigateToApp('app1', { deepLinkId: 'dl-unknown' }); + expect(MockHistory.push).toHaveBeenLastCalledWith('/app/app1/default/path', undefined); + + await navigateToApp('app1', { deepLinkId: 'dl-unknown', path: 'some-other-path' }); + expect(MockHistory.push).toHaveBeenLastCalledWith('/app/app1/some-other-path', undefined); + }); + }); }); describe('navigateToUrl', () => { diff --git a/src/core/public/application/application_service.tsx b/src/core/public/application/application_service.tsx index bbfea61220b513..32d45b32c32ffd 100644 --- a/src/core/public/application/application_service.tsx +++ b/src/core/public/application/application_service.tsx @@ -64,6 +64,10 @@ const getAppUrl = (mounters: Map, appId: string, path: string = return appendAppPath(appBasePath, path); }; +const getAppDeepLinkPath = (mounters: Map, appId: string, deepLinkId: string) => { + return mounters.get(appId)?.deepLinkPaths[deepLinkId]; +}; + const allApplicationsFilter = '__ALL__'; interface AppUpdaterWrapper { @@ -175,6 +179,7 @@ export class ApplicationService { this.mounters.set(app.id, { appRoute: app.appRoute!, appBasePath: basePath.prepend(app.appRoute!), + deepLinkPaths: toDeepLinkPaths(app.deepLinks), exactRoute: app.exactRoute ?? false, mount: wrapMount(plugin, app), unmountBeforeMounting: false, @@ -226,7 +231,7 @@ export class ApplicationService { const navigateToApp: InternalApplicationStart['navigateToApp'] = async ( appId, - { path, state, replace = false, openInNewTab = false }: NavigateToAppOptions = {} + { deepLinkId, path, state, replace = false, openInNewTab = false }: NavigateToAppOptions = {} ) => { const currentAppId = this.currentAppId$.value; const navigatingToSameApp = currentAppId === appId; @@ -235,6 +240,12 @@ export class ApplicationService { : await this.shouldNavigate(overlays, appId); if (shouldNavigate) { + if (deepLinkId) { + const deepLinkPath = getAppDeepLinkPath(availableMounters, appId, deepLinkId); + if (deepLinkPath) { + path = appendAppPath(deepLinkPath, path); + } + } if (path === undefined) { path = applications$.value.get(appId)?.defaultPath; } @@ -384,8 +395,18 @@ const updateStatus = (app: App, statusUpdaters: AppUpdaterWrapper[]): App => { ...fields, // status and navLinkStatus enums are ordered by reversed priority // if multiple updaters wants to change these fields, we will always follow the priority order. - status: Math.max(changes.status ?? 0, fields.status ?? 0), - navLinkStatus: Math.max(changes.navLinkStatus ?? 0, fields.navLinkStatus ?? 0), + status: Math.max( + changes.status ?? AppStatus.accessible, + fields.status ?? AppStatus.accessible + ), + navLinkStatus: Math.max( + changes.navLinkStatus ?? AppNavLinkStatus.default, + fields.navLinkStatus ?? AppNavLinkStatus.default + ), + // deepLinks take the last defined update + deepLinks: fields.deepLinks + ? populateDeepLinkDefaults(fields.deepLinks) + : changes.deepLinks, }; } }); @@ -396,10 +417,22 @@ const updateStatus = (app: App, statusUpdaters: AppUpdaterWrapper[]): App => { }; const populateDeepLinkDefaults = (deepLinks?: AppDeepLink[]): AppDeepLink[] => { - if (!deepLinks) return []; + if (!deepLinks) { + return []; + } return deepLinks.map((deepLink) => ({ ...deepLink, navLinkStatus: deepLink.navLinkStatus ?? AppNavLinkStatus.default, deepLinks: populateDeepLinkDefaults(deepLink.deepLinks), })); }; + +const toDeepLinkPaths = (deepLinks?: AppDeepLink[]): Mounter['deepLinkPaths'] => { + if (!deepLinks) { + return {}; + } + return deepLinks.reduce((deepLinkPaths: Mounter['deepLinkPaths'], deepLink) => { + if (deepLink.path) deepLinkPaths[deepLink.id] = deepLink.path; + return { ...deepLinkPaths, ...toDeepLinkPaths(deepLink.deepLinks) }; + }, {}); +}; diff --git a/src/core/public/application/index.ts b/src/core/public/application/index.ts index 68e1991646afbd..882555fcd60e09 100644 --- a/src/core/public/application/index.ts +++ b/src/core/public/application/index.ts @@ -17,6 +17,7 @@ export type { AppUnmount, AppMountParameters, AppUpdatableFields, + AppNavOptions, AppUpdater, AppDeepLink, ApplicationSetup, diff --git a/src/core/public/application/integration_tests/utils.tsx b/src/core/public/application/integration_tests/utils.tsx index 40f8f3b7957192..dcf071719c11ad 100644 --- a/src/core/public/application/integration_tests/utils.tsx +++ b/src/core/public/application/integration_tests/utils.tsx @@ -35,12 +35,14 @@ export const createAppMounter = ({ appId, html = `
App ${appId}
`, appRoute = `/app/${appId}`, + deepLinkPaths = {}, exactRoute = false, extraMountHook, }: { appId: string; html?: string; appRoute?: string; + deepLinkPaths?: Record; exactRoute?: boolean; extraMountHook?: (params: AppMountParameters) => void; }): MockedMounterTuple => { @@ -51,6 +53,7 @@ export const createAppMounter = ({ mounter: { appRoute, appBasePath: appRoute, + deepLinkPaths, exactRoute, mount: jest.fn(async (params: AppMountParameters) => { const { appBasePath: basename, element } = params; diff --git a/src/core/public/application/types.ts b/src/core/public/application/types.ts index ffc41955360bdf..60b0dbf158dd91 100644 --- a/src/core/public/application/types.ts +++ b/src/core/public/application/types.ts @@ -63,9 +63,37 @@ export enum AppNavLinkStatus { */ export type AppUpdatableFields = Pick< App, - 'status' | 'navLinkStatus' | 'tooltip' | 'defaultPath' | 'deepLinks' + 'status' | 'navLinkStatus' | 'searchable' | 'tooltip' | 'defaultPath' | 'deepLinks' >; +/** + * App navigation menu options + * @public + */ +export interface AppNavOptions { + /** + * An ordinal used to sort nav links relative to one another for display. + */ + order?: number; + + /** + * A tooltip shown when hovering over app link. + */ + tooltip?: string; + + /** + * A EUI iconType that will be used for the app's icon. This icon + * takes precendence over the `icon` property. + */ + euiIconType?: string; + + /** + * A URL to an image file used as an icon. Used as a fallback + * if `euiIconType` is not provided. + */ + icon?: string; +} + /** * Updater for applications. * see {@link ApplicationSetup} @@ -76,7 +104,7 @@ export type AppUpdater = (app: App) => Partial | undefined; /** * @public */ -export interface App { +export interface App extends AppNavOptions { /** * The unique identifier of the application */ @@ -107,6 +135,12 @@ export interface App { */ navLinkStatus?: AppNavLinkStatus; + /** + * The initial flag to determine if the application is searchable in the global search. + * Defaulting to `true` if `navLinkStatus` is `visible` or omitted. + */ + searchable?: boolean; + /** * Allow to define the default path a user should be directed to when navigating to the app. * When defined, this value will be used as a default for the `path` option when calling {@link ApplicationStart.navigateToApp | navigateToApp}`, @@ -148,28 +182,6 @@ export interface App { */ updater$?: Observable; - /** - * An ordinal used to sort nav links relative to one another for display. - */ - order?: number; - - /** - * A tooltip shown when hovering over app link. - */ - tooltip?: string; - - /** - * A EUI iconType that will be used for the app's icon. This icon - * takes precendence over the `icon` property. - */ - euiIconType?: string; - - /** - * A URL to an image file used as an icon. Used as a fallback - * if `euiIconType` is not provided. - */ - icon?: string; - /** * Custom capabilities defined by the app. */ @@ -261,11 +273,12 @@ export interface App { */ export type PublicAppDeepLinkInfo = Omit< AppDeepLink, - 'deepLinks' | 'keywords' | 'navLinkStatus' + 'deepLinks' | 'keywords' | 'navLinkStatus' | 'searchable' > & { deepLinks: PublicAppDeepLinkInfo[]; keywords: string[]; navLinkStatus: AppNavLinkStatus; + searchable: boolean; }; /** @@ -285,33 +298,40 @@ export type AppDeepLink = { keywords?: string[]; /** Optional status of the chrome navigation, defaults to `hidden` */ navLinkStatus?: AppNavLinkStatus; -} & ( - | { - /** URL path to access this link, relative to the application's appRoute. */ - path: string; - /** Optional array of links that are 'underneath' this section in the hierarchy */ - deepLinks?: AppDeepLink[]; - } - | { - /** Optional path to access this section. Omit if this part of the hierarchy does not have a page URL. */ - path?: string; - /** Array links that are 'underneath' this section in this hierarchy. */ - deepLinks: AppDeepLink[]; - } -); + /** Optional flag to determine if the link is searchable in the global search. Defaulting to `true` if `navLinkStatus` is `visible` or omitted */ + searchable?: boolean; +} & AppNavOptions & + ( + | { + /** URL path to access this link, relative to the application's appRoute. */ + path: string; + /** Optional array of links that are 'underneath' this section in the hierarchy */ + deepLinks?: AppDeepLink[]; + } + | { + /** Optional path to access this section. Omit if this part of the hierarchy does not have a page URL. */ + path?: string; + /** Array links that are 'underneath' this section in this hierarchy. */ + deepLinks: AppDeepLink[]; + } + ); /** * Public information about a registered {@link App | application} * * @public */ -export type PublicAppInfo = Omit & { +export type PublicAppInfo = Omit< + App, + 'mount' | 'updater$' | 'keywords' | 'deepLinks' | 'searchable' +> & { // remove optional on fields populated with default values status: AppStatus; navLinkStatus: AppNavLinkStatus; appRoute: string; keywords: string[]; deepLinks: PublicAppDeepLinkInfo[]; + searchable: boolean; }; /** @@ -592,6 +612,7 @@ export interface AppLeaveActionFactory { export interface Mounter { appRoute: string; appBasePath: string; + deepLinkPaths: Record; mount: AppMount; exactRoute: boolean; unmountBeforeMounting?: boolean; @@ -657,11 +678,17 @@ export interface InternalApplicationSetup extends Pick { appRoute: '/some-route', unmountBeforeMounting: false, exactRoute: false, + deepLinkPaths: {}, mount: async ({ element }: AppMountParameters) => { await promise; const container = document.createElement('div'); @@ -133,6 +134,7 @@ describe('AppContainer', () => { const mounter = { appBasePath: '/base-path/some-route', appRoute: '/some-route', + deepLinkPaths: {}, unmountBeforeMounting: false, exactRoute: false, mount: async ({ element }: AppMountParameters) => { diff --git a/src/core/public/application/utils/get_app_info.test.ts b/src/core/public/application/utils/get_app_info.test.ts index ef4a06707d6664..fa1e2dd9a4537d 100644 --- a/src/core/public/application/utils/get_app_info.test.ts +++ b/src/core/public/application/utils/get_app_info.test.ts @@ -7,7 +7,7 @@ */ import { of } from 'rxjs'; -import { App, AppNavLinkStatus, AppStatus } from '../types'; +import { App, AppDeepLink, AppNavLinkStatus, AppStatus } from '../types'; import { getAppInfo } from './get_app_info'; describe('getAppInfo', () => { @@ -18,10 +18,22 @@ describe('getAppInfo', () => { title: 'some-title', status: AppStatus.accessible, navLinkStatus: AppNavLinkStatus.default, + searchable: true, appRoute: `/app/some-id`, ...props, }); + const createDeepLink = (props: Partial = {}): AppDeepLink => ({ + id: 'some-deep-link-id', + title: 'my deep link', + path: '/my-deep-link', + navLinkStatus: AppNavLinkStatus.default, + searchable: true, + deepLinks: [], + keywords: [], + ...props, + }); + it('converts an application and remove sensitive properties', () => { const app = createApp(); const info = getAppInfo(app); @@ -31,6 +43,7 @@ describe('getAppInfo', () => { title: 'some-title', status: AppStatus.accessible, navLinkStatus: AppNavLinkStatus.visible, + searchable: true, appRoute: `/app/some-id`, keywords: [], deepLinks: [], @@ -54,12 +67,15 @@ describe('getAppInfo', () => { title: 'some-title', status: AppStatus.accessible, navLinkStatus: AppNavLinkStatus.visible, + searchable: true, appRoute: `/app/some-id`, keywords: [], deepLinks: [ { id: 'sub-id', title: 'sub-title', + navLinkStatus: AppNavLinkStatus.hidden, + searchable: true, keywords: [], deepLinks: [ { @@ -67,6 +83,8 @@ describe('getAppInfo', () => { title: 'sub-sub-title', path: '/sub-sub', keywords: [], + navLinkStatus: AppNavLinkStatus.hidden, + searchable: true, deepLinks: [], // default empty array added }, ], @@ -102,7 +120,70 @@ describe('getAppInfo', () => { ); }); - it('adds default meta fields to sublinks when needed', () => { + it('computes the searchable flag depending on the navLinkStatus when needed', () => { + expect( + getAppInfo( + createApp({ + navLinkStatus: AppNavLinkStatus.default, + searchable: undefined, + }) + ) + ).toEqual( + expect.objectContaining({ + searchable: true, + }) + ); + expect( + getAppInfo( + createApp({ + navLinkStatus: AppNavLinkStatus.visible, + searchable: undefined, + }) + ) + ).toEqual( + expect.objectContaining({ + searchable: true, + }) + ); + expect( + getAppInfo( + createApp({ + navLinkStatus: AppNavLinkStatus.disabled, + searchable: undefined, + }) + ) + ).toEqual( + expect.objectContaining({ + searchable: false, + }) + ); + expect( + getAppInfo( + createApp({ + navLinkStatus: AppNavLinkStatus.hidden, + searchable: undefined, + }) + ) + ).toEqual( + expect.objectContaining({ + searchable: false, + }) + ); + expect( + getAppInfo( + createApp({ + navLinkStatus: AppNavLinkStatus.hidden, + searchable: true, + }) + ) + ).toEqual( + expect.objectContaining({ + searchable: true, + }) + ); + }); + + it('adds default deepLinks when needed', () => { const app = createApp({ deepLinks: [ { @@ -126,17 +207,22 @@ describe('getAppInfo', () => { title: 'some-title', status: AppStatus.accessible, navLinkStatus: AppNavLinkStatus.visible, + searchable: true, appRoute: `/app/some-id`, keywords: [], deepLinks: [ { id: 'sub-id', title: 'sub-title', - keywords: [], // default empty array + navLinkStatus: AppNavLinkStatus.hidden, + searchable: true, + keywords: [], deepLinks: [ { id: 'sub-sub-id', title: 'sub-sub-title', + navLinkStatus: AppNavLinkStatus.hidden, + searchable: true, path: '/sub-sub', keywords: ['sub sub'], deepLinks: [], @@ -146,4 +232,127 @@ describe('getAppInfo', () => { ], }); }); + + it('computes the deepLinks navLinkStatus when needed', () => { + expect( + getAppInfo( + createApp({ + deepLinks: [ + createDeepLink({ + navLinkStatus: AppNavLinkStatus.visible, + }), + ], + }) + ) + ).toEqual( + expect.objectContaining({ + deepLinks: [ + expect.objectContaining({ + navLinkStatus: AppNavLinkStatus.visible, + }), + ], + }) + ); + expect( + getAppInfo( + createApp({ + deepLinks: [ + createDeepLink({ + navLinkStatus: AppNavLinkStatus.default, + }), + ], + }) + ) + ).toEqual( + expect.objectContaining({ + deepLinks: [ + expect.objectContaining({ + navLinkStatus: AppNavLinkStatus.hidden, + }), + ], + }) + ); + expect( + getAppInfo( + createApp({ + deepLinks: [ + createDeepLink({ + navLinkStatus: undefined, + }), + ], + }) + ) + ).toEqual( + expect.objectContaining({ + deepLinks: [ + expect.objectContaining({ + navLinkStatus: AppNavLinkStatus.hidden, + }), + ], + }) + ); + }); + + it('computes the deepLinks searchable depending on the navLinkStatus when needed', () => { + expect( + getAppInfo( + createApp({ + deepLinks: [ + createDeepLink({ + navLinkStatus: AppNavLinkStatus.default, + searchable: undefined, + }), + ], + }) + ) + ).toEqual( + expect.objectContaining({ + deepLinks: [ + expect.objectContaining({ + searchable: true, + }), + ], + }) + ); + expect( + getAppInfo( + createApp({ + deepLinks: [ + createDeepLink({ + navLinkStatus: AppNavLinkStatus.hidden, + searchable: undefined, + }), + ], + }) + ) + ).toEqual( + expect.objectContaining({ + deepLinks: [ + expect.objectContaining({ + searchable: false, + }), + ], + }) + ); + expect( + getAppInfo( + createApp({ + deepLinks: [ + createDeepLink({ + navLinkStatus: AppNavLinkStatus.hidden, + searchable: true, + }), + ], + }) + ) + ).toEqual( + expect.objectContaining({ + deepLinks: [ + expect.objectContaining({ + searchable: true, + }), + ], + }) + ); + }); }); diff --git a/src/core/public/application/utils/get_app_info.ts b/src/core/public/application/utils/get_app_info.ts index 4c94e24f501bc4..6c753b7a71a0f7 100644 --- a/src/core/public/application/utils/get_app_info.ts +++ b/src/core/public/application/utils/get_app_info.ts @@ -16,17 +16,19 @@ import { } from '../types'; export function getAppInfo(app: App): PublicAppInfo { - const navLinkStatus = - app.navLinkStatus === AppNavLinkStatus.default - ? app.status === AppStatus.inaccessible - ? AppNavLinkStatus.hidden - : AppNavLinkStatus.visible - : app.navLinkStatus!; - const { updater$, mount, ...infos } = app; + const { updater$, mount, navLinkStatus = AppNavLinkStatus.default, ...infos } = app; return { ...infos, status: app.status!, - navLinkStatus, + navLinkStatus: + navLinkStatus === AppNavLinkStatus.default + ? app.status === AppStatus.inaccessible + ? AppNavLinkStatus.hidden + : AppNavLinkStatus.visible + : navLinkStatus, + searchable: + app.searchable ?? + (navLinkStatus === AppNavLinkStatus.default || navLinkStatus === AppNavLinkStatus.visible), appRoute: app.appRoute!, keywords: app.keywords ?? [], deepLinks: getDeepLinkInfos(app.deepLinks), @@ -37,17 +39,18 @@ function getDeepLinkInfos(deepLinks?: AppDeepLink[]): PublicAppDeepLinkInfo[] { if (!deepLinks) return []; return deepLinks.map( - (rawDeepLink): PublicAppDeepLinkInfo => { - const navLinkStatus = - rawDeepLink.navLinkStatus === AppNavLinkStatus.default - ? AppNavLinkStatus.hidden - : rawDeepLink.navLinkStatus!; + ({ navLinkStatus = AppNavLinkStatus.default, ...rawDeepLink }): PublicAppDeepLinkInfo => { return { id: rawDeepLink.id, title: rawDeepLink.title, path: rawDeepLink.path, keywords: rawDeepLink.keywords ?? [], - navLinkStatus, + navLinkStatus: + navLinkStatus === AppNavLinkStatus.default ? AppNavLinkStatus.hidden : navLinkStatus, + searchable: + rawDeepLink.searchable ?? + (navLinkStatus === AppNavLinkStatus.default || + navLinkStatus === AppNavLinkStatus.visible), deepLinks: getDeepLinkInfos(rawDeepLink.deepLinks), }; } diff --git a/src/core/public/chrome/nav_links/nav_link.ts b/src/core/public/chrome/nav_links/nav_link.ts index 87175ea465b7f1..4e9158cac5cd47 100644 --- a/src/core/public/chrome/nav_links/nav_link.ts +++ b/src/core/public/chrome/nav_links/nav_link.ts @@ -33,10 +33,9 @@ export interface ChromeNavLink { readonly baseUrl: string; /** - * The route used to open the {@link AppBase.defaultPath | default path } of an application. - * If unset, `baseUrl` will be used instead. + * The route used to open the default path and the deep links of an application. */ - readonly url?: string; + readonly url: string; /** * An ordinal used to sort nav links relative to one another for display. diff --git a/src/core/public/chrome/nav_links/nav_links_service.test.ts b/src/core/public/chrome/nav_links/nav_links_service.test.ts index afb902fd6bd83d..e1d537da6959b7 100644 --- a/src/core/public/chrome/nav_links/nav_links_service.test.ts +++ b/src/core/public/chrome/nav_links/nav_links_service.test.ts @@ -20,6 +20,22 @@ const availableApps = new Map([ order: -10, title: 'App 2', euiIconType: 'canvasApp', + deepLinks: [ + { + id: 'deepApp1', + order: 50, + title: 'Deep App 1', + path: '/deepapp1', + deepLinks: [ + { + id: 'deepApp2', + order: 40, + title: 'Deep App 2', + path: '/deepapp2', + }, + ], + }, + ], }, ], ['chromelessApp', { id: 'chromelessApp', order: 20, title: 'Chromless App', chromeless: true }], @@ -66,7 +82,7 @@ describe('NavLinksService', () => { map((links) => links.map((l) => l.id)) ) .toPromise() - ).toEqual(['app2', 'app1']); + ).toEqual(['app2', 'app1', 'app2:deepApp2', 'app2:deepApp1']); }); it('emits multiple values', async () => { @@ -76,7 +92,7 @@ describe('NavLinksService', () => { start.showOnly('app1'); service.stop(); - expect(emittedLinks).toEqual([['app2', 'app1'], ['app1']]); + expect(emittedLinks).toEqual([['app2', 'app1', 'app2:deepApp2', 'app2:deepApp1'], ['app1']]); }); it('completes when service is stopped', async () => { @@ -98,7 +114,12 @@ describe('NavLinksService', () => { describe('#getAll()', () => { it('returns a sorted array of navlinks', () => { - expect(start.getAll().map((l) => l.id)).toEqual(['app2', 'app1']); + expect(start.getAll().map((l) => l.id)).toEqual([ + 'app2', + 'app1', + 'app2:deepApp2', + 'app2:deepApp1', + ]); }); }); @@ -123,7 +144,7 @@ describe('NavLinksService', () => { map((links) => links.map((l) => l.id)) ) .toPromise() - ).toEqual(['app2', 'app1']); + ).toEqual(['app2', 'app1', 'app2:deepApp2', 'app2:deepApp1']); }); it('does nothing on chromeless applications', async () => { @@ -136,7 +157,7 @@ describe('NavLinksService', () => { map((links) => links.map((l) => l.id)) ) .toPromise() - ).toEqual(['app2', 'app1']); + ).toEqual(['app2', 'app1', 'app2:deepApp2', 'app2:deepApp1']); }); it('removes all other links', async () => { @@ -152,6 +173,19 @@ describe('NavLinksService', () => { ).toEqual(['app2']); }); + it('show only deep link', async () => { + start.showOnly('app2:deepApp1'); + expect( + await start + .getNavLinks$() + .pipe( + take(1), + map((links) => links.map((l) => l.id)) + ) + .toPromise() + ).toEqual(['app2:deepApp1']); + }); + it('still removes all other links when availableApps are re-emitted', async () => { start.showOnly('app2'); mockAppService.applications$.next(mockAppService.applications$.value); diff --git a/src/core/public/chrome/nav_links/nav_links_service.ts b/src/core/public/chrome/nav_links/nav_links_service.ts index d41d8ae964d622..af961987a63095 100644 --- a/src/core/public/chrome/nav_links/nav_links_service.ts +++ b/src/core/public/chrome/nav_links/nav_links_service.ts @@ -10,8 +10,8 @@ import { sortBy } from 'lodash'; import { BehaviorSubject, combineLatest, Observable, ReplaySubject } from 'rxjs'; import { map, takeUntil } from 'rxjs/operators'; -import { InternalApplicationStart } from '../../application'; -import { HttpStart } from '../../http'; +import { InternalApplicationStart, PublicAppDeepLinkInfo, PublicAppInfo } from '../../application'; +import { HttpStart, IBasePath } from '../../http'; import { ChromeNavLink, NavLinkWrapper } from './nav_link'; import { toNavLink } from './to_nav_link'; @@ -89,7 +89,13 @@ export class NavLinksService { return new Map( [...apps] .filter(([, app]) => !app.chromeless) - .map(([appId, app]) => [appId, toNavLink(app, http.basePath)]) + .reduce((navLinks: Array<[string, NavLinkWrapper]>, [appId, app]) => { + navLinks.push( + [appId, toNavLink(app, http.basePath)], + ...toNavDeepLinks(app, app.deepLinks, http.basePath) + ); + return navLinks; + }, []) ); }) ); @@ -163,3 +169,21 @@ function sortNavLinks(navLinks: ReadonlyMap) { 'order' ); } + +function toNavDeepLinks( + app: PublicAppInfo, + deepLinks: PublicAppDeepLinkInfo[], + basePath: IBasePath +): Array<[string, NavLinkWrapper]> { + if (!deepLinks) { + return []; + } + return deepLinks.reduce((navDeepLinks: Array<[string, NavLinkWrapper]>, deepLink) => { + const id = `${app.id}:${deepLink.id}`; + if (deepLink.path) { + navDeepLinks.push([id, toNavLink(app, basePath, { ...deepLink, id })]); + } + navDeepLinks.push(...toNavDeepLinks(app, deepLink.deepLinks, basePath)); + return navDeepLinks; + }, []); +} diff --git a/src/core/public/chrome/nav_links/to_nav_link.test.ts b/src/core/public/chrome/nav_links/to_nav_link.test.ts index db783d0028f075..9791f1bd1354b6 100644 --- a/src/core/public/chrome/nav_links/to_nav_link.test.ts +++ b/src/core/public/chrome/nav_links/to_nav_link.test.ts @@ -6,7 +6,12 @@ * Side Public License, v 1. */ -import { PublicAppInfo, AppNavLinkStatus, AppStatus } from '../../application'; +import { + PublicAppInfo, + AppNavLinkStatus, + AppStatus, + PublicAppDeepLinkInfo, +} from '../../application'; import { toNavLink } from './to_nav_link'; import { httpServiceMock } from '../../mocks'; @@ -16,12 +21,24 @@ const app = (props: Partial = {}): PublicAppInfo => ({ title: 'some-title', status: AppStatus.accessible, navLinkStatus: AppNavLinkStatus.default, + searchable: true, appRoute: `/app/some-id`, keywords: [], deepLinks: [], ...props, }); +const deepLink = (props: Partial = {}): PublicAppDeepLinkInfo => ({ + id: 'some-deep-link-id', + title: 'my deep link', + path: '/my-deep-link', + navLinkStatus: AppNavLinkStatus.default, + searchable: true, + deepLinks: [], + keywords: [], + ...props, +}); + describe('toNavLink', () => { const basePath = httpServiceMock.createSetupContract({ basePath: '/base-path' }).basePath; @@ -64,7 +81,7 @@ describe('toNavLink', () => { }), basePath ); - expect(link.properties.url).toEqual('http://localhost/base-path/my-route/my-path'); + expect(link.properties.url).toEqual('/base-path/my-route/my-path'); link = toNavLink( app({ @@ -73,9 +90,7 @@ describe('toNavLink', () => { }), basePath ); - expect(link.properties.url).toEqual( - 'http://localhost/base-path/my-route/my-path/some/default/path' - ); + expect(link.properties.url).toEqual('/base-path/my-route/my-path/some/default/path'); }); it('uses the application status when the navLinkStatus is set to default', () => { @@ -153,4 +168,90 @@ describe('toNavLink', () => { }) ); }); + + describe('deepLink parameter', () => { + it('should be hidden and not disabled by default', () => { + expect(toNavLink(app(), basePath, deepLink()).properties).toEqual( + expect.objectContaining({ + disabled: false, + hidden: true, + }) + ); + }); + + it('should not be hidden when navLinkStatus is visible', () => { + expect( + toNavLink( + app(), + basePath, + deepLink({ + navLinkStatus: AppNavLinkStatus.visible, + }) + ).properties + ).toEqual( + expect.objectContaining({ + disabled: false, + hidden: false, + }) + ); + }); + + it('should be disabled when navLinkStatus is disabled', () => { + expect( + toNavLink( + app(), + basePath, + deepLink({ + navLinkStatus: AppNavLinkStatus.disabled, + }) + ).properties + ).toEqual( + expect.objectContaining({ + disabled: true, + hidden: false, + }) + ); + }); + + it('should have href, baseUrl and url containing the path', () => { + const testApp = app({ + appRoute: '/app/app-id', + defaultPath: '/default-path', + }); + + expect(toNavLink(testApp, basePath).properties).toEqual( + expect.objectContaining({ + baseUrl: 'http://localhost/base-path/app/app-id', + url: '/base-path/app/app-id/default-path', + href: 'http://localhost/base-path/app/app-id/default-path', + }) + ); + + expect( + toNavLink( + testApp, + basePath, + deepLink({ + id: 'deep-link-id', + path: '/my-deep-link', + }) + ).properties + ).toEqual( + expect.objectContaining({ + baseUrl: 'http://localhost/base-path/app/app-id', + url: '/base-path/app/app-id/my-deep-link', + href: 'http://localhost/base-path/app/app-id/my-deep-link', + }) + ); + }); + + it('should use the main app category', () => { + expect(toNavLink(app(), basePath, deepLink()).properties.category).toBeUndefined(); + + const category = { id: 'some-category', label: 'some category' }; + expect(toNavLink(app({ category }), basePath, deepLink()).properties.category).toEqual( + category + ); + }); + }); }); diff --git a/src/core/public/chrome/nav_links/to_nav_link.ts b/src/core/public/chrome/nav_links/to_nav_link.ts index f56d496f42d8f6..6acf37d40f089b 100644 --- a/src/core/public/chrome/nav_links/to_nav_link.ts +++ b/src/core/public/chrome/nav_links/to_nav_link.ts @@ -6,29 +6,50 @@ * Side Public License, v 1. */ -import { PublicAppInfo, AppNavLinkStatus, AppStatus } from '../../application'; +import { + PublicAppInfo, + AppNavLinkStatus, + AppStatus, + PublicAppDeepLinkInfo, +} from '../../application'; import { IBasePath } from '../../http'; import { NavLinkWrapper } from './nav_link'; import { appendAppPath } from '../../application/utils'; -export function toNavLink(app: PublicAppInfo, basePath: IBasePath): NavLinkWrapper { - const useAppStatus = app.navLinkStatus === AppNavLinkStatus.default; +export function toNavLink( + app: PublicAppInfo, + basePath: IBasePath, + deepLink?: PublicAppDeepLinkInfo +): NavLinkWrapper { const relativeBaseUrl = basePath.prepend(app.appRoute!); - const url = relativeToAbsolute(appendAppPath(relativeBaseUrl, app.defaultPath)); + const url = appendAppPath(relativeBaseUrl, deepLink?.path || app.defaultPath); + const href = relativeToAbsolute(url); const baseUrl = relativeToAbsolute(relativeBaseUrl); return new NavLinkWrapper({ - ...app, - hidden: useAppStatus - ? app.status === AppStatus.inaccessible - : app.navLinkStatus === AppNavLinkStatus.hidden, - disabled: useAppStatus ? false : app.navLinkStatus === AppNavLinkStatus.disabled, + ...(deepLink || app), + ...(app.category ? { category: app.category } : {}), // deepLinks use the main app category + hidden: deepLink ? isDeepNavLinkHidden(deepLink) : isAppNavLinkHidden(app), + disabled: (deepLink?.navLinkStatus ?? app.navLinkStatus) === AppNavLinkStatus.disabled, baseUrl, - href: url, + href, url, }); } +function isAppNavLinkHidden(app: PublicAppInfo) { + return app.navLinkStatus === AppNavLinkStatus.default + ? app.status === AppStatus.inaccessible + : app.navLinkStatus === AppNavLinkStatus.hidden; +} + +function isDeepNavLinkHidden(deepLink: PublicAppDeepLinkInfo) { + return ( + deepLink.navLinkStatus === AppNavLinkStatus.default || + deepLink.navLinkStatus === AppNavLinkStatus.hidden + ); +} + /** * @param {string} url - a relative or root relative url. If a relative path is given then the * absolute url returned will depend on the current page where this function is called from. For example diff --git a/src/core/public/chrome/ui/header/__snapshots__/collapsible_nav.test.tsx.snap b/src/core/public/chrome/ui/header/__snapshots__/collapsible_nav.test.tsx.snap index 0f5efe667ec2fc..3668829a6888cd 100644 --- a/src/core/public/chrome/ui/header/__snapshots__/collapsible_nav.test.tsx.snap +++ b/src/core/public/chrome/ui/header/__snapshots__/collapsible_nav.test.tsx.snap @@ -73,6 +73,7 @@ exports[`CollapsibleNav renders links grouped by category 1`] = ` "id": "Custom link", "isActive": true, "title": "Custom link", + "url": "/", }, "closed": false, "hasError": false, @@ -140,6 +141,7 @@ exports[`CollapsibleNav renders links grouped by category 1`] = ` "id": "discover", "isActive": true, "title": "discover", + "url": "/", }, Object { "baseUrl": "/", @@ -154,6 +156,7 @@ exports[`CollapsibleNav renders links grouped by category 1`] = ` "id": "siem", "isActive": true, "title": "siem", + "url": "/", }, Object { "baseUrl": "/", @@ -168,6 +171,7 @@ exports[`CollapsibleNav renders links grouped by category 1`] = ` "id": "metrics", "isActive": true, "title": "metrics", + "url": "/", }, Object { "baseUrl": "/", @@ -182,6 +186,7 @@ exports[`CollapsibleNav renders links grouped by category 1`] = ` "id": "monitoring", "isActive": true, "title": "monitoring", + "url": "/", }, Object { "baseUrl": "/", @@ -196,6 +201,7 @@ exports[`CollapsibleNav renders links grouped by category 1`] = ` "id": "visualize", "isActive": true, "title": "visualize", + "url": "/", }, Object { "baseUrl": "/", @@ -210,6 +216,7 @@ exports[`CollapsibleNav renders links grouped by category 1`] = ` "id": "dashboard", "isActive": true, "title": "dashboard", + "url": "/", }, Object { "baseUrl": "/", @@ -219,6 +226,7 @@ exports[`CollapsibleNav renders links grouped by category 1`] = ` "id": "canvas", "isActive": true, "title": "canvas", + "url": "/", }, Object { "baseUrl": "/", @@ -233,6 +241,7 @@ exports[`CollapsibleNav renders links grouped by category 1`] = ` "id": "logs", "isActive": true, "title": "logs", + "url": "/", }, ], "closed": false, @@ -351,6 +360,7 @@ exports[`CollapsibleNav renders links grouped by category 1`] = ` "values": Array [], } } + url="/" > ) { id: title, href: title, baseUrl: '/', + url: '/', isActive: true, 'data-test-subj': title, }; @@ -50,6 +51,7 @@ function mockProps() { isLocked: false, isNavOpen: false, homeHref: '/', + url: '/', navLinks$: new BehaviorSubject([]), recentlyAccessed$: new BehaviorSubject([]), storage: new StubBrowserStorage(), diff --git a/src/core/public/chrome/ui/header/collapsible_nav.tsx b/src/core/public/chrome/ui/header/collapsible_nav.tsx index b5b2919b659bdf..0e85dbea237cb2 100644 --- a/src/core/public/chrome/ui/header/collapsible_nav.tsx +++ b/src/core/public/chrome/ui/header/collapsible_nav.tsx @@ -107,7 +107,7 @@ export function CollapsibleNav({ link, appId, dataTestSubj: 'collapsibleNavAppLink', - navigateToApp, + navigateToUrl, onClick: closeNav, ...(needsIcon && { basePath }), }); @@ -137,7 +137,7 @@ export function CollapsibleNav({ createEuiListItem({ link: customNavLink, basePath, - navigateToApp, + navigateToUrl, dataTestSubj: 'collapsibleNavCustomNavLink', onClick: closeNav, externalLink: true, diff --git a/src/core/public/chrome/ui/header/header.test.tsx b/src/core/public/chrome/ui/header/header.test.tsx index e0f10fe66c9f06..fdbdde8556eebf 100644 --- a/src/core/public/chrome/ui/header/header.test.tsx +++ b/src/core/public/chrome/ui/header/header.test.tsx @@ -61,13 +61,14 @@ describe('Header', () => { const breadcrumbs$ = new BehaviorSubject([{ text: 'test' }]); const isLocked$ = new BehaviorSubject(false); const navLinks$ = new BehaviorSubject([ - { id: 'kibana', title: 'kibana', baseUrl: '', href: '' }, + { id: 'kibana', title: 'kibana', baseUrl: '', href: '', url: '' }, ]); const headerBanner$ = new BehaviorSubject(undefined); const customNavLink$ = new BehaviorSubject({ id: 'cloud-deployment-link', title: 'Manage cloud deployment', baseUrl: '', + url: '', href: '', }); const recentlyAccessed$ = new BehaviorSubject([ diff --git a/src/core/public/chrome/ui/header/nav_link.tsx b/src/core/public/chrome/ui/header/nav_link.tsx index 84f758e2c737e5..b0ebf7cc5f8e5e 100644 --- a/src/core/public/chrome/ui/header/nav_link.tsx +++ b/src/core/public/chrome/ui/header/nav_link.tsx @@ -23,7 +23,7 @@ interface Props { basePath?: HttpStart['basePath']; dataTestSubj: string; onClick?: Function; - navigateToApp: CoreStart['application']['navigateToApp']; + navigateToUrl: CoreStart['application']['navigateToUrl']; externalLink?: boolean; } @@ -36,11 +36,11 @@ export function createEuiListItem({ appId, basePath, onClick = () => {}, - navigateToApp, + navigateToUrl, dataTestSubj, externalLink = false, }: Props) { - const { href, id, title, disabled, euiIconType, icon, tooltip } = link; + const { href, id, title, disabled, euiIconType, icon, tooltip, url } = link; return { label: tooltip ?? title, @@ -57,7 +57,7 @@ export function createEuiListItem({ !isModifiedOrPrevented(event) ) { event.preventDefault(); - navigateToApp(id); + navigateToUrl(url); } }, isActive: appId === id, diff --git a/src/core/public/index.ts b/src/core/public/index.ts index 24b48683cdd937..32737ff427ef3e 100644 --- a/src/core/public/index.ts +++ b/src/core/public/index.ts @@ -91,6 +91,7 @@ export type { AppLeaveConfirmAction, AppUpdatableFields, AppUpdater, + AppNavOptions, AppDeepLink, PublicAppInfo, PublicAppDeepLinkInfo, diff --git a/src/core/public/public.api.md b/src/core/public/public.api.md index 667863d29623ed..235110aeb4633c 100644 --- a/src/core/public/public.api.md +++ b/src/core/public/public.api.md @@ -53,24 +53,21 @@ import { UserProvidedValues as UserProvidedValues_2 } from 'src/core/server/type export function __kbnBootstrap__(): Promise; // @public (undocumented) -export interface App { +export interface App extends AppNavOptions { appRoute?: string; capabilities?: Partial; category?: AppCategory; chromeless?: boolean; deepLinks?: AppDeepLink[]; defaultPath?: string; - euiIconType?: string; exactRoute?: boolean; - icon?: string; id: string; keywords?: string[]; mount: AppMount; navLinkStatus?: AppNavLinkStatus; - order?: number; + searchable?: boolean; status?: AppStatus; title: string; - tooltip?: string; updater$?: Observable; } @@ -92,7 +89,8 @@ export type AppDeepLink = { title: string; keywords?: string[]; navLinkStatus?: AppNavLinkStatus; -} & ({ + searchable?: boolean; +} & AppNavOptions & ({ path: string; deepLinks?: AppDeepLink[]; } | { @@ -179,6 +177,14 @@ export enum AppNavLinkStatus { visible = 1 } +// @public +export interface AppNavOptions { + euiIconType?: string; + icon?: string; + order?: number; + tooltip?: string; +} + // @public export enum AppStatus { accessible = 0, @@ -189,7 +195,7 @@ export enum AppStatus { export type AppUnmount = () => void; // @public -export type AppUpdatableFields = Pick; +export type AppUpdatableFields = Pick; // @public export type AppUpdater = (app: App) => Partial | undefined; @@ -314,8 +320,7 @@ export interface ChromeNavLink { readonly order?: number; readonly title: string; readonly tooltip?: string; - // Warning: (ae-unresolved-link) The @link reference could not be resolved: The package "kibana" does not have an export "AppBase" - readonly url?: string; + readonly url: string; } // @public @@ -916,10 +921,9 @@ export interface IUiSettingsClient { // @public export type MountPoint = (element: T) => UnmountCallback; -// Warning: (ae-missing-release-tag) "NavigateToAppOptions" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public export interface NavigateToAppOptions { + deepLinkId?: string; openInNewTab?: boolean; path?: string; replace?: boolean; @@ -1067,19 +1071,21 @@ export interface PluginInitializerContext export type PluginOpaqueId = symbol; // @public -export type PublicAppDeepLinkInfo = Omit & { +export type PublicAppDeepLinkInfo = Omit & { deepLinks: PublicAppDeepLinkInfo[]; keywords: string[]; navLinkStatus: AppNavLinkStatus; + searchable: boolean; }; // @public -export type PublicAppInfo = Omit & { +export type PublicAppInfo = Omit & { status: AppStatus; navLinkStatus: AppNavLinkStatus; appRoute: string; keywords: string[]; deepLinks: PublicAppDeepLinkInfo[]; + searchable: boolean; }; // @public @@ -1249,7 +1255,7 @@ export interface SavedObjectsCreateOptions { // @public (undocumented) export interface SavedObjectsFindOptions { // @alpha - aggs?: Record; + aggs?: Record; defaultSearchOperator?: 'AND' | 'OR'; fields?: string[]; // Warning: (ae-forgotten-export) The symbol "KueryNode" needs to be exported by the entry point index.d.ts @@ -1275,7 +1281,7 @@ export interface SavedObjectsFindOptions { // (undocumented) sortField?: string; // (undocumented) - sortOrder?: estypes.SortOrder; + sortOrder?: estypes.SearchSortOrder; // (undocumented) type: string | string[]; typeToNamespacesMap?: Map; diff --git a/src/core/server/elasticsearch/version_check/ensure_es_version.ts b/src/core/server/elasticsearch/version_check/ensure_es_version.ts index 43cd52f1b57211..e1f18f8ad836ad 100644 --- a/src/core/server/elasticsearch/version_check/ensure_es_version.ts +++ b/src/core/server/elasticsearch/version_check/ensure_es_version.ts @@ -31,7 +31,7 @@ export interface PollEsNodesVersionOptions { interface NodeInfo { version: string; ip: string; - http: { + http?: { publish_address: string; }; name: string; diff --git a/src/core/server/http/integration_tests/core_services.test.ts b/src/core/server/http/integration_tests/core_services.test.ts index 5433f0d3c3e31c..99b63fc73687a1 100644 --- a/src/core/server/http/integration_tests/core_services.test.ts +++ b/src/core/server/http/integration_tests/core_services.test.ts @@ -405,7 +405,7 @@ describe('http service', () => { const { body } = await kbnTestServer.request.get(root, '/new-platform/').expect(400); - expect(body.message).toEqual('[error_type]: error_reason'); + expect(body.message).toMatch('[error_type]: error_reason'); }); }); }); diff --git a/src/core/server/index.ts b/src/core/server/index.ts index 2e495657d34104..ef1ee69ff529b5 100644 --- a/src/core/server/index.ts +++ b/src/core/server/index.ts @@ -339,8 +339,6 @@ export type { SavedObjectsDeleteByNamespaceOptions, SavedObjectsIncrementCounterOptions, SavedObjectsIncrementCounterField, - SavedObjectsComplexFieldMapping, - SavedObjectsCoreFieldMapping, SavedObjectsFieldMapping, SavedObjectsTypeMappingDefinition, SavedObjectsMappingProperties, diff --git a/src/plugins/discover/public/application/components/constants.ts b/src/core/server/saved_objects/export/collect_exported_objects.test.mocks.ts similarity index 69% rename from src/plugins/discover/public/application/components/constants.ts rename to src/core/server/saved_objects/export/collect_exported_objects.test.mocks.ts index 42845e83b7435b..1f61788e556503 100644 --- a/src/plugins/discover/public/application/components/constants.ts +++ b/src/core/server/saved_objects/export/collect_exported_objects.test.mocks.ts @@ -6,9 +6,7 @@ * Side Public License, v 1. */ -export const fetchStatuses = { - UNINITIALIZED: 'uninitialized', - LOADING: 'loading', - COMPLETE: 'complete', - ERROR: 'error', -}; +export const applyExportTransformsMock = jest.fn(); +jest.doMock('./apply_export_transforms', () => ({ + applyExportTransforms: applyExportTransformsMock, +})); diff --git a/src/core/server/saved_objects/export/collect_exported_objects.test.ts b/src/core/server/saved_objects/export/collect_exported_objects.test.ts new file mode 100644 index 00000000000000..0929ff0d40910d --- /dev/null +++ b/src/core/server/saved_objects/export/collect_exported_objects.test.ts @@ -0,0 +1,528 @@ +/* + * 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 { applyExportTransformsMock } from './collect_exported_objects.test.mocks'; +import { savedObjectsClientMock } from '../../mocks'; +import { httpServerMock } from '../../http/http_server.mocks'; +import { SavedObject, SavedObjectError } from '../../../types'; +import type { SavedObjectsExportTransform } from './types'; +import { collectExportedObjects } from './collect_exported_objects'; + +const createObject = (parts: Partial): SavedObject => ({ + id: 'id', + type: 'type', + references: [], + attributes: {}, + ...parts, +}); + +const createError = (parts: Partial = {}): SavedObjectError => ({ + error: 'error', + message: 'message', + statusCode: 404, + ...parts, +}); + +const toIdTuple = (obj: SavedObject) => ({ type: obj.type, id: obj.id }); + +describe('collectExportedObjects', () => { + let savedObjectsClient: ReturnType; + let request: ReturnType; + + beforeEach(() => { + savedObjectsClient = savedObjectsClientMock.create(); + request = httpServerMock.createKibanaRequest(); + applyExportTransformsMock.mockImplementation(({ objects }) => objects); + savedObjectsClient.bulkGet.mockResolvedValue({ saved_objects: [] }); + }); + + afterEach(() => { + applyExportTransformsMock.mockReset(); + savedObjectsClient.bulkGet.mockReset(); + }); + + describe('when `includeReferences` is `true`', () => { + it('calls `applyExportTransforms` with the correct parameters', async () => { + const obj1 = createObject({ + type: 'foo', + id: '1', + }); + const obj2 = createObject({ + type: 'foo', + id: '2', + }); + + const fooTransform: SavedObjectsExportTransform = jest.fn(); + + await collectExportedObjects({ + objects: [obj1, obj2], + savedObjectsClient, + request, + exportTransforms: { foo: fooTransform }, + includeReferences: true, + }); + + expect(applyExportTransformsMock).toHaveBeenCalledTimes(1); + expect(applyExportTransformsMock).toHaveBeenCalledWith({ + objects: [obj1, obj2], + transforms: { foo: fooTransform }, + request, + }); + }); + + it('returns the collected objects', async () => { + const foo1 = createObject({ + type: 'foo', + id: '1', + references: [ + { + type: 'bar', + id: '2', + name: 'bar-2', + }, + ], + }); + const bar2 = createObject({ + type: 'bar', + id: '2', + }); + const dolly3 = createObject({ + type: 'dolly', + id: '3', + }); + + applyExportTransformsMock.mockImplementationOnce(({ objects }) => [...objects, dolly3]); + savedObjectsClient.bulkGet.mockResolvedValueOnce({ + saved_objects: [bar2], + }); + + const { objects, missingRefs } = await collectExportedObjects({ + objects: [foo1], + savedObjectsClient, + request, + exportTransforms: {}, + includeReferences: true, + }); + + expect(missingRefs).toHaveLength(0); + expect(objects.map(toIdTuple)).toEqual([foo1, dolly3, bar2].map(toIdTuple)); + }); + + it('returns the missing references', async () => { + const foo1 = createObject({ + type: 'foo', + id: '1', + references: [ + { + type: 'bar', + id: '2', + name: 'bar-2', + }, + { + type: 'missing', + id: '1', + name: 'missing-1', + }, + ], + }); + const bar2 = createObject({ + type: 'bar', + id: '2', + references: [ + { + type: 'missing', + id: '2', + name: 'missing-2', + }, + ], + }); + const missing1 = createObject({ + type: 'missing', + id: '1', + error: createError(), + }); + const missing2 = createObject({ + type: 'missing', + id: '2', + error: createError(), + }); + + savedObjectsClient.bulkGet.mockResolvedValueOnce({ + saved_objects: [bar2, missing1], + }); + savedObjectsClient.bulkGet.mockResolvedValueOnce({ + saved_objects: [missing2], + }); + + const { objects, missingRefs } = await collectExportedObjects({ + objects: [foo1], + savedObjectsClient, + request, + exportTransforms: {}, + includeReferences: true, + }); + + expect(missingRefs).toEqual([missing1, missing2].map(toIdTuple)); + expect(objects.map(toIdTuple)).toEqual([foo1, bar2].map(toIdTuple)); + }); + + it('does not call `client.bulkGet` when no objects have references', async () => { + const obj1 = createObject({ + type: 'foo', + id: '1', + }); + const obj2 = createObject({ + type: 'foo', + id: '2', + }); + + const { objects, missingRefs } = await collectExportedObjects({ + objects: [obj1, obj2], + savedObjectsClient, + request, + exportTransforms: {}, + includeReferences: true, + }); + + expect(missingRefs).toHaveLength(0); + expect(objects.map(toIdTuple)).toEqual([ + { + type: 'foo', + id: '1', + }, + { + type: 'foo', + id: '2', + }, + ]); + + expect(savedObjectsClient.bulkGet).not.toHaveBeenCalled(); + }); + + it('calls `applyExportTransforms` for each iteration', async () => { + const foo1 = createObject({ + type: 'foo', + id: '1', + references: [ + { + type: 'bar', + id: '2', + name: 'bar-2', + }, + ], + }); + const bar2 = createObject({ + type: 'bar', + id: '2', + }); + savedObjectsClient.bulkGet.mockResolvedValueOnce({ + saved_objects: [bar2], + }); + + await collectExportedObjects({ + objects: [foo1], + savedObjectsClient, + request, + exportTransforms: {}, + includeReferences: true, + }); + + expect(savedObjectsClient.bulkGet).toHaveBeenCalledTimes(1); + expect(savedObjectsClient.bulkGet).toHaveBeenCalledWith( + [toIdTuple(bar2)], + expect.any(Object) + ); + + expect(applyExportTransformsMock).toHaveBeenCalledTimes(2); + expect(applyExportTransformsMock).toHaveBeenCalledWith({ + objects: [foo1], + transforms: {}, + request, + }); + expect(applyExportTransformsMock).toHaveBeenCalledWith({ + objects: [bar2], + transforms: {}, + request, + }); + }); + + it('ignores references that are already included in the export', async () => { + const foo1 = createObject({ + type: 'foo', + id: '1', + references: [ + { + type: 'bar', + id: '2', + name: 'bar-2', + }, + ], + }); + const bar2 = createObject({ + type: 'bar', + id: '2', + references: [ + { + type: 'foo', + id: '1', + name: 'foo-1', + }, + { + type: 'dolly', + id: '3', + name: 'dolly-3', + }, + ], + }); + const dolly3 = createObject({ + type: 'dolly', + id: '3', + references: [ + { + type: 'foo', + id: '1', + name: 'foo-1', + }, + ], + }); + + savedObjectsClient.bulkGet.mockResolvedValueOnce({ + saved_objects: [bar2], + }); + savedObjectsClient.bulkGet.mockResolvedValueOnce({ + saved_objects: [foo1, dolly3], + }); + + const { objects } = await collectExportedObjects({ + objects: [foo1], + savedObjectsClient, + request, + exportTransforms: {}, + includeReferences: true, + }); + + expect(savedObjectsClient.bulkGet).toHaveBeenCalledTimes(2); + expect(savedObjectsClient.bulkGet).toHaveBeenNthCalledWith( + 1, + [toIdTuple(bar2)], + expect.any(Object) + ); + expect(savedObjectsClient.bulkGet).toHaveBeenNthCalledWith( + 2, + [toIdTuple(dolly3)], + expect.any(Object) + ); + + expect(objects.map(toIdTuple)).toEqual([foo1, bar2, dolly3].map(toIdTuple)); + }); + + it('does not fetch duplicates of references', async () => { + const foo1 = createObject({ + type: 'foo', + id: '1', + references: [ + { + type: 'dolly', + id: '3', + name: 'dolly-3', + }, + { + type: 'baz', + id: '4', + name: 'baz-4', + }, + ], + }); + const bar2 = createObject({ + type: 'bar', + id: '2', + references: [ + { + type: 'dolly', + id: '3', + name: 'dolly-3', + }, + ], + }); + const dolly3 = createObject({ + type: 'dolly', + id: '3', + }); + const baz4 = createObject({ + type: 'baz', + id: '4', + }); + + savedObjectsClient.bulkGet.mockResolvedValueOnce({ + saved_objects: [dolly3, baz4], + }); + + await collectExportedObjects({ + objects: [foo1, bar2], + savedObjectsClient, + request, + exportTransforms: {}, + includeReferences: true, + }); + + expect(savedObjectsClient.bulkGet).toHaveBeenCalledTimes(1); + expect(savedObjectsClient.bulkGet).toHaveBeenCalledWith( + [dolly3, baz4].map(toIdTuple), + expect.any(Object) + ); + }); + + it('fetch references for additional objects returned by the export transform', async () => { + const foo1 = createObject({ + type: 'foo', + id: '1', + references: [ + { + type: 'baz', + id: '4', + name: 'baz-4', + }, + ], + }); + const bar2 = createObject({ + type: 'bar', + id: '2', + references: [ + { + type: 'dolly', + id: '3', + name: 'dolly-3', + }, + ], + }); + + applyExportTransformsMock.mockImplementationOnce(({ objects }) => [...objects, bar2]); + + savedObjectsClient.bulkGet.mockResolvedValueOnce({ + saved_objects: [], + }); + + await collectExportedObjects({ + objects: [foo1], + savedObjectsClient, + request, + exportTransforms: {}, + includeReferences: true, + }); + + expect(savedObjectsClient.bulkGet).toHaveBeenCalledTimes(1); + expect(savedObjectsClient.bulkGet).toHaveBeenCalledWith( + [ + { type: 'baz', id: '4' }, + { type: 'dolly', id: '3' }, + ], + expect.any(Object) + ); + }); + + it('fetch references for additional objects returned by the export transform of nested references', async () => { + const foo1 = createObject({ + type: 'foo', + id: '1', + references: [ + { + type: 'bar', + id: '2', + name: 'bar-2', + }, + ], + }); + const bar2 = createObject({ + type: 'bar', + id: '2', + references: [], + }); + const dolly3 = createObject({ + type: 'dolly', + id: '3', + references: [ + { + type: 'baz', + id: '4', + name: 'baz-4', + }, + ], + }); + const baz4 = createObject({ + type: 'baz', + id: '4', + }); + + // first call for foo-1 + applyExportTransformsMock.mockImplementationOnce(({ objects }) => [...objects]); + // second call for bar-2 + applyExportTransformsMock.mockImplementationOnce(({ objects }) => [...objects, dolly3]); + + savedObjectsClient.bulkGet.mockResolvedValueOnce({ + saved_objects: [bar2], + }); + savedObjectsClient.bulkGet.mockResolvedValueOnce({ + saved_objects: [baz4], + }); + + await collectExportedObjects({ + objects: [foo1], + savedObjectsClient, + request, + exportTransforms: {}, + includeReferences: true, + }); + + expect(savedObjectsClient.bulkGet).toHaveBeenCalledTimes(2); + expect(savedObjectsClient.bulkGet).toHaveBeenNthCalledWith( + 1, + [toIdTuple(bar2)], + expect.any(Object) + ); + expect(savedObjectsClient.bulkGet).toHaveBeenNthCalledWith( + 2, + [toIdTuple(baz4)], + expect.any(Object) + ); + }); + }); + + describe('when `includeReferences` is `false`', () => { + it('does not fetch the object references', async () => { + const obj1 = createObject({ + type: 'foo', + id: '1', + references: [ + { + id: '2', + type: 'bar', + name: 'bar-2', + }, + ], + }); + + const { objects, missingRefs } = await collectExportedObjects({ + objects: [obj1], + savedObjectsClient, + request, + exportTransforms: {}, + includeReferences: false, + }); + + expect(missingRefs).toHaveLength(0); + expect(objects.map(toIdTuple)).toEqual([ + { + type: 'foo', + id: '1', + }, + ]); + + expect(savedObjectsClient.bulkGet).not.toHaveBeenCalled(); + }); + }); +}); diff --git a/src/core/server/saved_objects/export/collect_exported_objects.ts b/src/core/server/saved_objects/export/collect_exported_objects.ts new file mode 100644 index 00000000000000..d45782a83c2844 --- /dev/null +++ b/src/core/server/saved_objects/export/collect_exported_objects.ts @@ -0,0 +1,128 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import type { SavedObject } from '../../../types'; +import type { KibanaRequest } from '../../http'; +import { SavedObjectsClientContract } from '../types'; +import type { SavedObjectsExportTransform } from './types'; +import { applyExportTransforms } from './apply_export_transforms'; + +interface CollectExportedObjectOptions { + savedObjectsClient: SavedObjectsClientContract; + objects: SavedObject[]; + /** flag to also include all related saved objects in the export stream. */ + includeReferences?: boolean; + /** optional namespace to override the namespace used by the savedObjectsClient. */ + namespace?: string; + /** The http request initiating the export. */ + request: KibanaRequest; + /** export transform per type */ + exportTransforms: Record; +} + +interface CollectExportedObjectResult { + objects: SavedObject[]; + missingRefs: CollectedReference[]; +} + +export const collectExportedObjects = async ({ + objects, + includeReferences = true, + namespace, + request, + exportTransforms, + savedObjectsClient, +}: CollectExportedObjectOptions): Promise => { + const collectedObjects: SavedObject[] = []; + const collectedMissingRefs: CollectedReference[] = []; + const alreadyProcessed: Set = new Set(); + + let currentObjects = objects; + do { + const transformed = ( + await applyExportTransforms({ + request, + objects: currentObjects, + transforms: exportTransforms, + }) + ).filter((object) => !alreadyProcessed.has(objKey(object))); + + transformed.forEach((obj) => alreadyProcessed.add(objKey(obj))); + collectedObjects.push(...transformed); + + if (includeReferences) { + const references = collectReferences(transformed, alreadyProcessed); + if (references.length) { + const { objects: fetchedObjects, missingRefs } = await fetchReferences({ + references, + namespace, + client: savedObjectsClient, + }); + collectedMissingRefs.push(...missingRefs); + currentObjects = fetchedObjects; + } else { + currentObjects = []; + } + } else { + currentObjects = []; + } + } while (includeReferences && currentObjects.length); + + return { + objects: collectedObjects, + missingRefs: collectedMissingRefs, + }; +}; + +const objKey = (obj: { type: string; id: string }) => `${obj.type}:${obj.id}`; + +type ObjectKey = string; + +interface CollectedReference { + id: string; + type: string; +} + +const collectReferences = ( + objects: SavedObject[], + alreadyProcessed: Set +): CollectedReference[] => { + const references: Map = new Map(); + objects.forEach((obj) => { + obj.references?.forEach((ref) => { + const refKey = objKey(ref); + if (!alreadyProcessed.has(refKey)) { + references.set(refKey, { type: ref.type, id: ref.id }); + } + }); + }); + return [...references.values()]; +}; + +interface FetchReferencesResult { + objects: SavedObject[]; + missingRefs: CollectedReference[]; +} + +const fetchReferences = async ({ + references, + client, + namespace, +}: { + references: CollectedReference[]; + client: SavedObjectsClientContract; + namespace?: string; +}): Promise => { + const { saved_objects: savedObjects } = await client.bulkGet(references, { namespace }); + return { + objects: savedObjects.filter((obj) => !obj.error), + missingRefs: savedObjects + .filter((obj) => obj.error) + .map((obj) => ({ type: obj.type, id: obj.id })), + }; +}; diff --git a/src/core/server/saved_objects/export/fetch_nested_dependencies.test.ts b/src/core/server/saved_objects/export/fetch_nested_dependencies.test.ts deleted file mode 100644 index a47c629f9066b1..00000000000000 --- a/src/core/server/saved_objects/export/fetch_nested_dependencies.test.ts +++ /dev/null @@ -1,606 +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 { SavedObject } from '../types'; -import { savedObjectsClientMock } from '../../mocks'; -import { getObjectReferencesToFetch, fetchNestedDependencies } from './fetch_nested_dependencies'; -import { SavedObjectsErrorHelpers } from '..'; - -describe('getObjectReferencesToFetch()', () => { - test('works with no saved objects', () => { - const map = new Map(); - const result = getObjectReferencesToFetch(map); - expect(result).toEqual([]); - }); - - test('excludes already fetched objects', () => { - const map = new Map(); - map.set('index-pattern:1', { - id: '1', - type: 'index-pattern', - attributes: {}, - references: [], - }); - map.set('visualization:2', { - id: '2', - type: 'visualization', - attributes: {}, - references: [ - { - name: 'ref_0', - type: 'index-pattern', - id: '1', - }, - ], - }); - const result = getObjectReferencesToFetch(map); - expect(result).toEqual([]); - }); - - test('returns objects that are missing', () => { - const map = new Map(); - map.set('visualization:2', { - id: '2', - type: 'visualization', - attributes: {}, - references: [ - { - name: 'ref_0', - type: 'index-pattern', - id: '1', - }, - ], - }); - const result = getObjectReferencesToFetch(map); - expect(result).toMatchInlineSnapshot(` - Array [ - Object { - "id": "1", - "type": "index-pattern", - }, - ] - `); - }); - - test('does not fail on circular dependencies', () => { - const map = new Map(); - map.set('index-pattern:1', { - id: '1', - type: 'index-pattern', - attributes: {}, - references: [ - { - name: 'ref_0', - type: 'visualization', - id: '2', - }, - ], - }); - map.set('visualization:2', { - id: '2', - type: 'visualization', - attributes: {}, - references: [ - { - name: 'ref_0', - type: 'index-pattern', - id: '1', - }, - ], - }); - const result = getObjectReferencesToFetch(map); - expect(result).toEqual([]); - }); -}); - -describe('injectNestedDependencies', () => { - const savedObjectsClient = savedObjectsClientMock.create(); - - afterEach(() => { - jest.resetAllMocks(); - }); - - test(`doesn't fetch when no dependencies are missing`, async () => { - const savedObjects = [ - { - id: '1', - type: 'index-pattern', - attributes: {}, - references: [], - }, - ]; - const result = await fetchNestedDependencies(savedObjects, savedObjectsClient); - expect(result).toMatchInlineSnapshot(` - Object { - "missingRefs": Array [], - "objects": Array [ - Object { - "attributes": Object {}, - "id": "1", - "references": Array [], - "type": "index-pattern", - }, - ], - } - `); - }); - - test(`doesn't fetch references that are already fetched`, async () => { - const savedObjects = [ - { - id: '1', - type: 'index-pattern', - attributes: {}, - references: [], - }, - { - id: '2', - type: 'search', - attributes: {}, - references: [ - { - name: 'ref_0', - type: 'index-pattern', - id: '1', - }, - ], - }, - ]; - const result = await fetchNestedDependencies(savedObjects, savedObjectsClient); - expect(result).toMatchInlineSnapshot(` - Object { - "missingRefs": Array [], - "objects": Array [ - Object { - "attributes": Object {}, - "id": "1", - "references": Array [], - "type": "index-pattern", - }, - Object { - "attributes": Object {}, - "id": "2", - "references": Array [ - Object { - "id": "1", - "name": "ref_0", - "type": "index-pattern", - }, - ], - "type": "search", - }, - ], - } - `); - }); - - test('fetches dependencies at least one level deep', async () => { - const savedObjects = [ - { - id: '2', - type: 'search', - attributes: {}, - references: [ - { - name: 'ref_0', - type: 'index-pattern', - id: '1', - }, - ], - }, - ]; - savedObjectsClient.bulkGet.mockResolvedValueOnce({ - saved_objects: [ - { - id: '1', - type: 'index-pattern', - attributes: {}, - references: [], - }, - ], - }); - const result = await fetchNestedDependencies(savedObjects, savedObjectsClient); - expect(result).toMatchInlineSnapshot(` - Object { - "missingRefs": Array [], - "objects": Array [ - Object { - "attributes": Object {}, - "id": "2", - "references": Array [ - Object { - "id": "1", - "name": "ref_0", - "type": "index-pattern", - }, - ], - "type": "search", - }, - Object { - "attributes": Object {}, - "id": "1", - "references": Array [], - "type": "index-pattern", - }, - ], - } - `); - expect(savedObjectsClient.bulkGet).toMatchInlineSnapshot(` - [MockFunction] { - "calls": Array [ - Array [ - Array [ - Object { - "id": "1", - "type": "index-pattern", - }, - ], - Object { - "namespace": undefined, - }, - ], - ], - "results": Array [ - Object { - "type": "return", - "value": Promise {}, - }, - ], - } - `); - }); - - test('fetches dependencies multiple levels deep', async () => { - const savedObjects = [ - { - id: '5', - type: 'dashboard', - attributes: {}, - references: [ - { - name: 'panel_0', - type: 'visualization', - id: '4', - }, - { - name: 'panel_1', - type: 'visualization', - id: '3', - }, - ], - }, - ]; - savedObjectsClient.bulkGet.mockResolvedValueOnce({ - saved_objects: [ - { - id: '4', - type: 'visualization', - attributes: {}, - references: [ - { - name: 'ref_0', - type: 'search', - id: '2', - }, - ], - }, - { - id: '3', - type: 'visualization', - attributes: {}, - references: [ - { - name: 'ref_0', - type: 'index-pattern', - id: '1', - }, - ], - }, - ], - }); - savedObjectsClient.bulkGet.mockResolvedValueOnce({ - saved_objects: [ - { - id: '2', - type: 'search', - attributes: {}, - references: [ - { - name: 'ref_0', - type: 'index-pattern', - id: '1', - }, - ], - }, - { - id: '1', - type: 'index-pattern', - attributes: {}, - references: [], - }, - ], - }); - const result = await fetchNestedDependencies(savedObjects, savedObjectsClient); - expect(result).toMatchInlineSnapshot(` - Object { - "missingRefs": Array [], - "objects": Array [ - Object { - "attributes": Object {}, - "id": "5", - "references": Array [ - Object { - "id": "4", - "name": "panel_0", - "type": "visualization", - }, - Object { - "id": "3", - "name": "panel_1", - "type": "visualization", - }, - ], - "type": "dashboard", - }, - Object { - "attributes": Object {}, - "id": "4", - "references": Array [ - Object { - "id": "2", - "name": "ref_0", - "type": "search", - }, - ], - "type": "visualization", - }, - Object { - "attributes": Object {}, - "id": "3", - "references": Array [ - Object { - "id": "1", - "name": "ref_0", - "type": "index-pattern", - }, - ], - "type": "visualization", - }, - Object { - "attributes": Object {}, - "id": "2", - "references": Array [ - Object { - "id": "1", - "name": "ref_0", - "type": "index-pattern", - }, - ], - "type": "search", - }, - Object { - "attributes": Object {}, - "id": "1", - "references": Array [], - "type": "index-pattern", - }, - ], - } - `); - expect(savedObjectsClient.bulkGet).toMatchInlineSnapshot(` - [MockFunction] { - "calls": Array [ - Array [ - Array [ - Object { - "id": "4", - "type": "visualization", - }, - Object { - "id": "3", - "type": "visualization", - }, - ], - Object { - "namespace": undefined, - }, - ], - Array [ - Array [ - Object { - "id": "2", - "type": "search", - }, - Object { - "id": "1", - "type": "index-pattern", - }, - ], - Object { - "namespace": undefined, - }, - ], - ], - "results": Array [ - Object { - "type": "return", - "value": Promise {}, - }, - Object { - "type": "return", - "value": Promise {}, - }, - ], - } - `); - }); - - test('returns list of missing references', async () => { - const savedObjects = [ - { - id: '1', - type: 'search', - attributes: {}, - references: [ - { - name: 'ref_0', - type: 'index-pattern', - id: '1', - }, - { - name: 'ref_1', - type: 'index-pattern', - id: '2', - }, - ], - }, - ]; - savedObjectsClient.bulkGet.mockResolvedValueOnce({ - saved_objects: [ - { - id: '1', - type: 'index-pattern', - error: SavedObjectsErrorHelpers.createGenericNotFoundError('index-pattern', '1').output - .payload, - attributes: {}, - references: [], - }, - { - id: '2', - type: 'index-pattern', - attributes: {}, - references: [], - }, - ], - }); - const result = await fetchNestedDependencies(savedObjects, savedObjectsClient); - expect(result).toMatchInlineSnapshot(` - Object { - "missingRefs": Array [ - Object { - "id": "1", - "type": "index-pattern", - }, - ], - "objects": Array [ - Object { - "attributes": Object {}, - "id": "1", - "references": Array [ - Object { - "id": "1", - "name": "ref_0", - "type": "index-pattern", - }, - Object { - "id": "2", - "name": "ref_1", - "type": "index-pattern", - }, - ], - "type": "search", - }, - Object { - "attributes": Object {}, - "id": "2", - "references": Array [], - "type": "index-pattern", - }, - ], - } - `); - }); - - test('does not fail on circular dependencies', async () => { - const savedObjects = [ - { - id: '2', - type: 'search', - attributes: {}, - references: [ - { - name: 'ref_0', - type: 'index-pattern', - id: '1', - }, - ], - }, - ]; - savedObjectsClient.bulkGet.mockResolvedValueOnce({ - saved_objects: [ - { - id: '1', - type: 'index-pattern', - attributes: {}, - references: [ - { - name: 'ref_0', - type: 'search', - id: '2', - }, - ], - }, - ], - }); - const result = await fetchNestedDependencies(savedObjects, savedObjectsClient); - expect(result).toMatchInlineSnapshot(` - Object { - "missingRefs": Array [], - "objects": Array [ - Object { - "attributes": Object {}, - "id": "2", - "references": Array [ - Object { - "id": "1", - "name": "ref_0", - "type": "index-pattern", - }, - ], - "type": "search", - }, - Object { - "attributes": Object {}, - "id": "1", - "references": Array [ - Object { - "id": "2", - "name": "ref_0", - "type": "search", - }, - ], - "type": "index-pattern", - }, - ], - } - `); - expect(savedObjectsClient.bulkGet).toMatchInlineSnapshot(` - [MockFunction] { - "calls": Array [ - Array [ - Array [ - Object { - "id": "1", - "type": "index-pattern", - }, - ], - Object { - "namespace": undefined, - }, - ], - ], - "results": Array [ - Object { - "type": "return", - "value": Promise {}, - }, - ], - } - `); - }); -}); diff --git a/src/core/server/saved_objects/export/fetch_nested_dependencies.ts b/src/core/server/saved_objects/export/fetch_nested_dependencies.ts deleted file mode 100644 index 778c01804b8939..00000000000000 --- a/src/core/server/saved_objects/export/fetch_nested_dependencies.ts +++ /dev/null @@ -1,50 +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 { SavedObject, SavedObjectsClientContract } from '../types'; - -export function getObjectReferencesToFetch(savedObjectsMap: Map) { - const objectsToFetch = new Map(); - for (const savedObject of savedObjectsMap.values()) { - for (const ref of savedObject.references || []) { - if (!savedObjectsMap.has(objKey(ref))) { - objectsToFetch.set(objKey(ref), { type: ref.type, id: ref.id }); - } - } - } - return [...objectsToFetch.values()]; -} - -export async function fetchNestedDependencies( - savedObjects: SavedObject[], - savedObjectsClient: SavedObjectsClientContract, - namespace?: string -) { - const savedObjectsMap = new Map(); - for (const savedObject of savedObjects) { - savedObjectsMap.set(objKey(savedObject), savedObject); - } - let objectsToFetch = getObjectReferencesToFetch(savedObjectsMap); - while (objectsToFetch.length > 0) { - const bulkGetResponse = await savedObjectsClient.bulkGet(objectsToFetch, { namespace }); - // Push to array result - for (const savedObject of bulkGetResponse.saved_objects) { - savedObjectsMap.set(objKey(savedObject), savedObject); - } - objectsToFetch = getObjectReferencesToFetch(savedObjectsMap); - } - const allObjects = [...savedObjectsMap.values()]; - return { - objects: allObjects.filter((obj) => !obj.error), - missingRefs: allObjects - .filter((obj) => !!obj.error) - .map((obj) => ({ type: obj.type, id: obj.id })), - }; -} - -const objKey = (obj: { type: string; id: string }) => `${obj.type}:${obj.id}`; diff --git a/src/core/server/saved_objects/export/saved_objects_exporter.ts b/src/core/server/saved_objects/export/saved_objects_exporter.ts index 8cd6934bf1af9c..9d56bb4872a6dc 100644 --- a/src/core/server/saved_objects/export/saved_objects_exporter.ts +++ b/src/core/server/saved_objects/export/saved_objects_exporter.ts @@ -12,7 +12,6 @@ import { Logger } from '../../logging'; import { SavedObject, SavedObjectsClientContract } from '../types'; import { SavedObjectsFindResult } from '../service'; import { ISavedObjectTypeRegistry } from '../saved_objects_type_registry'; -import { fetchNestedDependencies } from './fetch_nested_dependencies'; import { sortObjects } from './sort_objects'; import { SavedObjectsExportResultDetails, @@ -22,7 +21,7 @@ import { SavedObjectsExportTransform, } from './types'; import { SavedObjectsExportError } from './errors'; -import { applyExportTransforms } from './apply_export_transforms'; +import { collectExportedObjects } from './collect_exported_objects'; import { byIdAscComparator, getPreservedOrderComparator, SavedObjectComparator } from './utils'; /** @@ -118,28 +117,21 @@ export class SavedObjectsExporter { }: SavedObjectExportBaseOptions ) { this.#log.debug(`Processing [${savedObjects.length}] saved objects.`); - let exportedObjects: Array>; - let missingReferences: SavedObjectsExportResultDetails['missingReferences'] = []; - savedObjects = await applyExportTransforms({ - request, + const { + objects: collectedObjects, + missingRefs: missingReferences, + } = await collectExportedObjects({ objects: savedObjects, - transforms: this.#exportTransforms, - sortFunction, + includeReferences: includeReferencesDeep, + namespace, + request, + exportTransforms: this.#exportTransforms, + savedObjectsClient: this.#savedObjectsClient, }); - if (includeReferencesDeep) { - this.#log.debug(`Fetching saved objects references.`); - const fetchResult = await fetchNestedDependencies( - savedObjects, - this.#savedObjectsClient, - namespace - ); - exportedObjects = sortObjects(fetchResult.objects); - missingReferences = fetchResult.missingRefs; - } else { - exportedObjects = sortObjects(savedObjects); - } + // sort with the provided sort function then with the default export sorting + const exportedObjects = sortObjects(collectedObjects.sort(sortFunction)); // redact attributes that should not be exported const redactedObjects = includeNamespaces diff --git a/src/core/server/saved_objects/index.ts b/src/core/server/saved_objects/index.ts index 2af25e0cdef3f2..b1b1584d7de88c 100644 --- a/src/core/server/saved_objects/index.ts +++ b/src/core/server/saved_objects/index.ts @@ -72,8 +72,6 @@ export type { } from './service/lib/repository'; export type { - SavedObjectsCoreFieldMapping, - SavedObjectsComplexFieldMapping, SavedObjectsFieldMapping, SavedObjectsMappingProperties, SavedObjectsTypeMappingDefinition, diff --git a/src/core/server/saved_objects/mappings/index.ts b/src/core/server/saved_objects/mappings/index.ts index bf1029e9f3b81d..5da185ace79c63 100644 --- a/src/core/server/saved_objects/mappings/index.ts +++ b/src/core/server/saved_objects/mappings/index.ts @@ -8,8 +8,6 @@ export { getTypes, getProperty, getRootProperties, getRootPropertiesObjects } from './lib'; export type { - SavedObjectsComplexFieldMapping, - SavedObjectsCoreFieldMapping, SavedObjectsTypeMappingDefinition, SavedObjectsTypeMappingDefinitions, SavedObjectsMappingProperties, diff --git a/src/core/server/saved_objects/mappings/lib/get_property.test.ts b/src/core/server/saved_objects/mappings/lib/get_property.test.ts index dab712bbb87add..8732b5e07d3fa7 100644 --- a/src/core/server/saved_objects/mappings/lib/get_property.test.ts +++ b/src/core/server/saved_objects/mappings/lib/get_property.test.ts @@ -34,7 +34,7 @@ const MAPPINGS = { }, }, }, -}; +} as const; function runTest(key: string | string[], mapping: IndexMapping | SavedObjectsFieldMapping) { expect(typeof key === 'string' || Array.isArray(key)).toBeTruthy(); diff --git a/src/core/server/saved_objects/mappings/lib/get_property.ts b/src/core/server/saved_objects/mappings/lib/get_property.ts index c2daa1e70a898a..2a9993bc175ca1 100644 --- a/src/core/server/saved_objects/mappings/lib/get_property.ts +++ b/src/core/server/saved_objects/mappings/lib/get_property.ts @@ -7,7 +7,7 @@ */ import { toPath } from 'lodash'; -import { SavedObjectsCoreFieldMapping, SavedObjectsFieldMapping, IndexMapping } from '../types'; +import { SavedObjectsFieldMapping, IndexMapping } from '../types'; function getPropertyMappingFromObjectMapping( mapping: IndexMapping | SavedObjectsFieldMapping, @@ -15,7 +15,7 @@ function getPropertyMappingFromObjectMapping( ): SavedObjectsFieldMapping | undefined { const props = (mapping && (mapping as IndexMapping).properties) || - (mapping && (mapping as SavedObjectsCoreFieldMapping).fields); + (mapping && (mapping as SavedObjectsFieldMapping).fields); if (!props) { return undefined; diff --git a/src/core/server/saved_objects/mappings/lib/get_root_properties_objects.test.ts b/src/core/server/saved_objects/mappings/lib/get_root_properties_objects.test.ts index 2daca3a1fdd83c..cbc6808418bc06 100644 --- a/src/core/server/saved_objects/mappings/lib/get_root_properties_objects.test.ts +++ b/src/core/server/saved_objects/mappings/lib/get_root_properties_objects.test.ts @@ -15,7 +15,7 @@ test(`returns single object with properties`, () => { properties: {}, }, }, - }; + } as const; const result = getRootPropertiesObjects(mappings); expect(result).toEqual({ @@ -32,7 +32,7 @@ test(`returns single object with type === 'object'`, () => { type: 'object', }, }, - }; + } as const; const result = getRootPropertiesObjects(mappings); expect(result).toEqual({ @@ -75,7 +75,7 @@ test(`returns two objects with type === 'object'`, () => { type: 'object', }, }, - }; + } as const; const result = getRootPropertiesObjects(mappings); expect(result).toEqual({ @@ -95,7 +95,7 @@ test(`excludes objects without properties and type of keyword`, () => { type: 'keyword', }, }, - }; + } as const; const result = getRootPropertiesObjects(mappings); expect(result).toEqual({}); @@ -111,7 +111,7 @@ test(`excludes two objects without properties and type of keyword`, () => { type: 'keyword', }, }, - }; + } as const; const result = getRootPropertiesObjects(mappings); expect(result).toEqual({}); @@ -127,7 +127,7 @@ test(`includes one object with properties and excludes one object without proper type: 'keyword', }, }, - }; + } as const; const result = getRootPropertiesObjects(mappings); expect(result).toEqual({ @@ -147,7 +147,7 @@ test(`includes one object with type === 'object' and excludes one object without type: 'keyword', }, }, - }; + } as const; const result = getRootPropertiesObjects(mappings); expect(result).toEqual({ @@ -170,7 +170,7 @@ test('excludes references and migrationVersion which are part of the blacklist', type: 'object', }, }, - }; + } as const; const result = getRootPropertiesObjects(mappings); expect(result).toEqual({ foo: { diff --git a/src/core/server/saved_objects/mappings/lib/get_root_properties_objects.ts b/src/core/server/saved_objects/mappings/lib/get_root_properties_objects.ts index 3a25865c03b265..54ea4eafc186f9 100644 --- a/src/core/server/saved_objects/mappings/lib/get_root_properties_objects.ts +++ b/src/core/server/saved_objects/mappings/lib/get_root_properties_objects.ts @@ -6,11 +6,7 @@ * Side Public License, v 1. */ -import { - SavedObjectsComplexFieldMapping, - IndexMapping, - SavedObjectsMappingProperties, -} from '../types'; +import { SavedObjectsFieldMapping, IndexMapping, SavedObjectsMappingProperties } from '../types'; import { getRootProperties } from './get_root_properties'; /** @@ -36,7 +32,7 @@ export function getRootPropertiesObjects(mappings: IndexMapping) { // we consider the existence of the properties or type of object to designate that this is an object datatype if ( !omittedRootProps.includes(key) && - ((value as SavedObjectsComplexFieldMapping).properties || value.type === 'object') + ((value as SavedObjectsFieldMapping).properties || value.type === 'object') ) { acc[key] = value; } diff --git a/src/core/server/saved_objects/mappings/types.ts b/src/core/server/saved_objects/mappings/types.ts index 25fb61de935187..e2ad2a91fd000a 100644 --- a/src/core/server/saved_objects/mappings/types.ts +++ b/src/core/server/saved_objects/mappings/types.ts @@ -6,6 +6,7 @@ * Side Public License, v 1. */ +import type { estypes } from '@elastic/elasticsearch'; /** * Describe a saved object type mapping. * @@ -96,9 +97,17 @@ export interface SavedObjectsMappingProperties { * * @public */ -export type SavedObjectsFieldMapping = - | SavedObjectsCoreFieldMapping - | SavedObjectsComplexFieldMapping; +export type SavedObjectsFieldMapping = estypes.MappingProperty & { + /** + * The dynamic property of the mapping, either `false` or `'strict'`. If + * unspecified `dynamic: 'strict'` will be inherited from the top-level + * index mappings. + * + * Note: To limit the number of mapping fields Saved Object types should + * *never* use `dynamic: true`. + */ + dynamic?: false | 'strict'; +}; /** @internal */ export interface IndexMapping { @@ -114,42 +123,3 @@ export interface IndexMappingMeta { // the md5 hash of that mapping's value when the index was created. migrationMappingPropertyHashes?: { [k: string]: string }; } - -/** - * See {@link SavedObjectsFieldMapping} for documentation. - * - * @public - */ -export interface SavedObjectsCoreFieldMapping { - type: string; - null_value?: number | boolean | string; - index?: boolean; - doc_values?: boolean; - fields?: { - [subfield: string]: { - type: string; - ignore_above?: number; - }; - }; -} - -/** - * See {@link SavedObjectsFieldMapping} for documentation. - * - * @public - */ -export interface SavedObjectsComplexFieldMapping { - /** - * The dynamic property of the mapping, either `false` or `'strict'`. If - * unspecified `dynamic: 'strict'` will be inherited from the top-level - * index mappings. - * - * Note: To limit the number of mapping fields Saved Object types should - * *never* use `dynamic: true`. - */ - dynamic?: false | 'strict'; - enabled?: boolean; - doc_values?: boolean; - type?: string; - properties: SavedObjectsMappingProperties; -} diff --git a/src/core/server/saved_objects/migrations/core/build_active_mappings.test.ts b/src/core/server/saved_objects/migrations/core/build_active_mappings.test.ts index 5465da2f620adb..a39fff20abbe71 100644 --- a/src/core/server/saved_objects/migrations/core/build_active_mappings.test.ts +++ b/src/core/server/saved_objects/migrations/core/build_active_mappings.test.ts @@ -19,19 +19,19 @@ describe('buildActiveMappings', () => { const properties = { aaa: { type: 'text' }, bbb: { type: 'long' }, - }; + } as const; expect(buildActiveMappings(properties)).toMatchSnapshot(); }); test('disallows duplicate mappings', () => { - const properties = { type: { type: 'long' } }; + const properties = { type: { type: 'long' } } as const; expect(() => buildActiveMappings(properties)).toThrow(/Cannot redefine core mapping \"type\"/); }); test('disallows mappings with leading underscore', () => { - const properties = { _hm: { type: 'keyword' } }; + const properties = { _hm: { type: 'keyword' } } as const; expect(() => buildActiveMappings(properties)).toThrow( /Invalid mapping \"_hm\"\. Mappings cannot start with _/ @@ -60,7 +60,7 @@ describe('buildActiveMappings', () => { aaa: { type: 'keyword', fields: { a: { type: 'keyword' }, b: { type: 'text' } } }, bbb: { fields: { b: { type: 'text' }, a: { type: 'keyword' } }, type: 'keyword' }, ccc: { fields: { b: { type: 'text' }, a: { type: 'text' } }, type: 'keyword' }, - }; + } as const; const mappings = buildActiveMappings(properties); const hashes = mappings._meta!.migrationMappingPropertyHashes!; diff --git a/src/core/server/saved_objects/migrations/core/build_index_map.test.ts b/src/core/server/saved_objects/migrations/core/build_index_map.test.ts index c7a3251e33ab18..731b7f8c029c24 100644 --- a/src/core/server/saved_objects/migrations/core/build_index_map.test.ts +++ b/src/core/server/saved_objects/migrations/core/build_index_map.test.ts @@ -36,7 +36,7 @@ test('mappings without index pattern goes to default index', () => { type1: { properties: { field1: { - type: 'string', + type: 'text', }, }, }, @@ -48,7 +48,7 @@ test('mappings without index pattern goes to default index', () => { type1: { properties: { field1: { - type: 'string', + type: 'text', }, }, }, @@ -69,7 +69,7 @@ test(`mappings with custom index pattern doesn't go to default index`, () => { type1: { properties: { field1: { - type: 'string', + type: 'text', }, }, }, @@ -81,7 +81,7 @@ test(`mappings with custom index pattern doesn't go to default index`, () => { type1: { properties: { field1: { - type: 'string', + type: 'text', }, }, }, @@ -103,7 +103,7 @@ test('creating a script gets added to the index pattern', () => { type1: { properties: { field1: { - type: 'string', + type: 'text', }, }, }, @@ -116,7 +116,7 @@ test('creating a script gets added to the index pattern', () => { type1: { properties: { field1: { - type: 'string', + type: 'text', }, }, }, @@ -144,18 +144,18 @@ test('throws when two scripts are defined for an index pattern', () => { type1: { properties: { field1: { - type: 'string', + type: 'text', }, }, }, type2: { properties: { field1: { - type: 'string', + type: 'text', }, }, }, - }; + } as const; expect(() => createIndexMap({ kibanaIndexName: defaultIndex, diff --git a/src/core/server/saved_objects/migrations/core/elastic_index.test.ts b/src/core/server/saved_objects/migrations/core/elastic_index.test.ts index 1d2ec6abc0dd14..c9c24cc85a4528 100644 --- a/src/core/server/saved_objects/migrations/core/elastic_index.test.ts +++ b/src/core/server/saved_objects/migrations/core/elastic_index.test.ts @@ -40,10 +40,10 @@ describe('ElasticIndex', () => { return elasticsearchClientMock.createSuccessTransportRequestPromise({ [index]: { aliases: { foo: index }, - mappings: { dynamic: 'strict', properties: { a: 'b' } }, + mappings: { dynamic: 'strict', properties: { a: 'b' } as any }, settings: {}, }, - } as estypes.GetIndexResponse); + } as estypes.IndicesGetResponse); }); const info = await Index.fetchInfo(client, '.baz'); @@ -164,7 +164,7 @@ describe('ElasticIndex', () => { client.tasks.get.mockResolvedValue( elasticsearchClientMock.createSuccessTransportRequestPromise({ completed: true, - } as estypes.GetTaskResponse) + } as estypes.TaskGetResponse) ); const info = { @@ -175,7 +175,7 @@ describe('ElasticIndex', () => { dynamic: 'strict' as const, properties: { foo: { type: 'keyword' } }, }, - }; + } as const; await Index.convertToAlias( client, @@ -248,7 +248,7 @@ describe('ElasticIndex', () => { reason: 'all shards failed', failed_shards: [], }, - } as estypes.GetTaskResponse) + } as estypes.TaskGetResponse) ); const info = { diff --git a/src/core/server/saved_objects/migrations/core/elastic_index.ts b/src/core/server/saved_objects/migrations/core/elastic_index.ts index 76fdd5e73d804f..296a4cee07c11b 100644 --- a/src/core/server/saved_objects/migrations/core/elastic_index.ts +++ b/src/core/server/saved_objects/migrations/core/elastic_index.ts @@ -32,7 +32,7 @@ export interface FullIndexInfo { // saved objects which are no longer used. These saved objects will still be // kept in the outdated index for backup purposes, but won't be available in // the upgraded index. -export const excludeUnusedTypesQuery: estypes.QueryContainer = { +export const excludeUnusedTypesQuery: estypes.QueryDslQueryContainer = { bool: { must_not: [ // https://github.com/elastic/kibana/issues/91869 @@ -401,7 +401,6 @@ async function reindex( task_id: String(task), }); - // @ts-expect-error @elastic/elasticsearch GetTaskResponse doesn't contain `error` property const e = body.error; if (e) { throw new Error(`Re-index failed [${e.type}] ${e.reason} :: ${JSON.stringify(e)}`); diff --git a/src/core/server/saved_objects/migrations/core/index_migrator.test.ts b/src/core/server/saved_objects/migrations/core/index_migrator.test.ts index fcc03f363139b0..64d4fa3609e90f 100644 --- a/src/core/server/saved_objects/migrations/core/index_migrator.test.ts +++ b/src/core/server/saved_objects/migrations/core/index_migrator.test.ts @@ -450,7 +450,7 @@ function withIndex( client.tasks.get.mockReturnValue( elasticsearchClientMock.createSuccessTransportRequestPromise({ completed: true, - } as estypes.GetTaskResponse) + } as estypes.TaskGetResponse) ); client.search.mockReturnValue( elasticsearchClientMock.createSuccessTransportRequestPromise(searchResult(0) as any) diff --git a/src/core/server/saved_objects/migrations/core/migration_context.test.ts b/src/core/server/saved_objects/migrations/core/migration_context.test.ts index 5f2e8a37ec4279..240b41266abb66 100644 --- a/src/core/server/saved_objects/migrations/core/migration_context.test.ts +++ b/src/core/server/saved_objects/migrations/core/migration_context.test.ts @@ -31,7 +31,7 @@ describe('disableUnknownTypeMappingFields', () => { }, }, }, - }; + } as const; const activeMappings = { _meta: { migrationMappingPropertyHashes: { @@ -46,7 +46,7 @@ describe('disableUnknownTypeMappingFields', () => { }, }, }, - }; + } as const; const targetMappings = disableUnknownTypeMappingFields(activeMappings, sourceMappings); it('disables complex field mappings from unknown types in the source mappings', () => { diff --git a/src/core/server/saved_objects/migrations/kibana/kibana_migrator.test.ts b/src/core/server/saved_objects/migrations/kibana/kibana_migrator.test.ts index 37cea5d2de3d2c..d0cc52f2dd9bd1 100644 --- a/src/core/server/saved_objects/migrations/kibana/kibana_migrator.test.ts +++ b/src/core/server/saved_objects/migrations/kibana/kibana_migrator.test.ts @@ -320,7 +320,11 @@ const mockV2MigrationOptions = () => { ) ); options.client.indices.addBlock.mockReturnValue( - elasticsearchClientMock.createSuccessTransportRequestPromise({ acknowledged: true }) + elasticsearchClientMock.createSuccessTransportRequestPromise({ + acknowledged: true, + shards_acknowledged: true, + indices: [], + }) ); options.client.reindex.mockReturnValue( elasticsearchClientMock.createSuccessTransportRequestPromise({ @@ -333,7 +337,7 @@ const mockV2MigrationOptions = () => { error: undefined, failures: [], task: { description: 'task description' } as any, - } as estypes.GetTaskResponse) + } as estypes.TaskGetResponse) ); options.client.search = jest diff --git a/src/core/server/saved_objects/migrationsv2/actions/bulk_overwrite_transformed_documents.test.ts b/src/core/server/saved_objects/migrationsv2/actions/bulk_overwrite_transformed_documents.test.ts new file mode 100644 index 00000000000000..8ff9591798fd4a --- /dev/null +++ b/src/core/server/saved_objects/migrationsv2/actions/bulk_overwrite_transformed_documents.test.ts @@ -0,0 +1,46 @@ +/* + * 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 { catchRetryableEsClientErrors } from './catch_retryable_es_client_errors'; +import { errors as EsErrors } from '@elastic/elasticsearch'; +jest.mock('./catch_retryable_es_client_errors'); +import { elasticsearchClientMock } from '../../../elasticsearch/client/mocks'; +import { bulkOverwriteTransformedDocuments } from './bulk_overwrite_transformed_documents'; + +describe('bulkOverwriteTransformedDocuments', () => { + beforeEach(() => { + jest.clearAllMocks(); + }); + + // Create a mock client that rejects all methods with a 503 status code + // response. + const retryableError = new EsErrors.ResponseError( + elasticsearchClientMock.createApiResponse({ + statusCode: 503, + body: { error: { type: 'es_type', reason: 'es_reason' } }, + }) + ); + const client = elasticsearchClientMock.createInternalClient( + elasticsearchClientMock.createErrorTransportRequestPromise(retryableError) + ); + it('calls catchRetryableEsClientErrors when the promise rejects', async () => { + const task = bulkOverwriteTransformedDocuments({ + client, + index: 'new_index', + transformedDocs: [], + refresh: 'wait_for', + }); + try { + await task(); + } catch (e) { + /** ignore */ + } + + expect(catchRetryableEsClientErrors).toHaveBeenCalledWith(retryableError); + }); +}); diff --git a/src/core/server/saved_objects/migrationsv2/actions/bulk_overwrite_transformed_documents.ts b/src/core/server/saved_objects/migrationsv2/actions/bulk_overwrite_transformed_documents.ts new file mode 100644 index 00000000000000..830a8efccc7eba --- /dev/null +++ b/src/core/server/saved_objects/migrationsv2/actions/bulk_overwrite_transformed_documents.ts @@ -0,0 +1,84 @@ +/* + * 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 * as Either from 'fp-ts/lib/Either'; +import * as TaskEither from 'fp-ts/lib/TaskEither'; +import type { estypes } from '@elastic/elasticsearch'; +import { ElasticsearchClient } from '../../../elasticsearch'; +import type { SavedObjectsRawDoc } from '../../serialization'; +import { + catchRetryableEsClientErrors, + RetryableEsClientError, +} from './catch_retryable_es_client_errors'; +import { WAIT_FOR_ALL_SHARDS_TO_BE_ACTIVE } from './constants'; + +/** @internal */ +export interface BulkOverwriteTransformedDocumentsParams { + client: ElasticsearchClient; + index: string; + transformedDocs: SavedObjectsRawDoc[]; + refresh?: estypes.Refresh; +} +/** + * Write the up-to-date transformed documents to the index, overwriting any + * documents that are still on their outdated version. + */ +export const bulkOverwriteTransformedDocuments = ({ + client, + index, + transformedDocs, + refresh = false, +}: BulkOverwriteTransformedDocumentsParams): TaskEither.TaskEither< + RetryableEsClientError, + 'bulk_index_succeeded' +> => () => { + return client + .bulk({ + // Because we only add aliases in the MARK_VERSION_INDEX_READY step we + // can't bulkIndex to an alias with require_alias=true. This means if + // users tamper during this operation (delete indices or restore a + // snapshot), we could end up auto-creating an index without the correct + // mappings. Such tampering could lead to many other problems and is + // probably unlikely so for now we'll accept this risk and wait till + // system indices puts in place a hard control. + require_alias: false, + wait_for_active_shards: WAIT_FOR_ALL_SHARDS_TO_BE_ACTIVE, + refresh, + filter_path: ['items.*.error'], + body: transformedDocs.flatMap((doc) => { + return [ + { + index: { + _index: index, + _id: doc._id, + // overwrite existing documents + op_type: 'index', + // use optimistic concurrency control to ensure that outdated + // documents are only overwritten once with the latest version + if_seq_no: doc._seq_no, + if_primary_term: doc._primary_term, + }, + }, + doc._source, + ]; + }), + }) + .then((res) => { + // Filter out version_conflict_engine_exception since these just mean + // that another instance already updated these documents + const errors = (res.body.items ?? []).filter( + (item) => item.index?.error?.type !== 'version_conflict_engine_exception' + ); + if (errors.length === 0) { + return Either.right('bulk_index_succeeded' as const); + } else { + throw new Error(JSON.stringify(errors)); + } + }) + .catch(catchRetryableEsClientErrors); +}; diff --git a/src/core/server/saved_objects/migrationsv2/actions/clone_index.test.ts b/src/core/server/saved_objects/migrationsv2/actions/clone_index.test.ts new file mode 100644 index 00000000000000..84b4b00bc7e7fd --- /dev/null +++ b/src/core/server/saved_objects/migrationsv2/actions/clone_index.test.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 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 { errors as EsErrors } from '@elastic/elasticsearch'; +import { cloneIndex } from './clone_index'; +import { setWriteBlock } from './set_write_block'; +import { elasticsearchClientMock } from '../../../elasticsearch/client/mocks'; +import { catchRetryableEsClientErrors } from './catch_retryable_es_client_errors'; +jest.mock('./catch_retryable_es_client_errors'); + +describe('cloneIndex', () => { + beforeEach(() => { + jest.clearAllMocks(); + }); + + // Create a mock client that rejects all methods with a 503 status code + // response. + const retryableError = new EsErrors.ResponseError( + elasticsearchClientMock.createApiResponse({ + statusCode: 503, + body: { error: { type: 'es_type', reason: 'es_reason' } }, + }) + ); + const client = elasticsearchClientMock.createInternalClient( + elasticsearchClientMock.createErrorTransportRequestPromise(retryableError) + ); + + const nonRetryableError = new Error('crash'); + const clientWithNonRetryableError = elasticsearchClientMock.createInternalClient( + elasticsearchClientMock.createErrorTransportRequestPromise(nonRetryableError) + ); + + it('calls catchRetryableEsClientErrors when the promise rejects', async () => { + const task = cloneIndex({ + client, + source: 'my_source_index', + target: 'my_target_index', + }); + try { + await task(); + } catch (e) { + /** ignore */ + } + expect(catchRetryableEsClientErrors).toHaveBeenCalledWith(retryableError); + }); + + it('re-throws non retry-able errors', async () => { + const task = setWriteBlock({ + client: clientWithNonRetryableError, + index: 'my_index', + }); + await task(); + expect(catchRetryableEsClientErrors).toHaveBeenCalledWith(nonRetryableError); + }); +}); diff --git a/src/core/server/saved_objects/migrationsv2/actions/clone_index.ts b/src/core/server/saved_objects/migrationsv2/actions/clone_index.ts new file mode 100644 index 00000000000000..5674535c803287 --- /dev/null +++ b/src/core/server/saved_objects/migrationsv2/actions/clone_index.ts @@ -0,0 +1,141 @@ +/* + * 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 * as Either from 'fp-ts/lib/Either'; +import * as TaskEither from 'fp-ts/lib/TaskEither'; +import { errors as EsErrors } from '@elastic/elasticsearch'; +import { pipe } from 'fp-ts/lib/pipeable'; +import { ElasticsearchClient } from '../../../elasticsearch'; +import { + catchRetryableEsClientErrors, + RetryableEsClientError, +} from './catch_retryable_es_client_errors'; +import type { IndexNotFound, AcknowledgeResponse } from './'; +import { waitForIndexStatusYellow } from './wait_for_index_status_yellow'; +import { + DEFAULT_TIMEOUT, + INDEX_AUTO_EXPAND_REPLICAS, + INDEX_NUMBER_OF_SHARDS, + WAIT_FOR_ALL_SHARDS_TO_BE_ACTIVE, +} from './constants'; +export type CloneIndexResponse = AcknowledgeResponse; + +/** @internal */ +export interface CloneIndexParams { + client: ElasticsearchClient; + source: string; + target: string; + /** only used for testing */ + timeout?: string; +} +/** + * Makes a clone of the source index into the target. + * + * @remarks + * This method adds some additional logic to the ES clone index API: + * - it is idempotent, if it gets called multiple times subsequent calls will + * wait for the first clone operation to complete (up to 60s) + * - the first call will wait up to 120s for the cluster state and all shards + * to be updated. + */ +export const cloneIndex = ({ + client, + source, + target, + timeout = DEFAULT_TIMEOUT, +}: CloneIndexParams): TaskEither.TaskEither< + RetryableEsClientError | IndexNotFound, + CloneIndexResponse +> => { + const cloneTask: TaskEither.TaskEither< + RetryableEsClientError | IndexNotFound, + AcknowledgeResponse + > = () => { + return client.indices + .clone( + { + index: source, + target, + wait_for_active_shards: WAIT_FOR_ALL_SHARDS_TO_BE_ACTIVE, + body: { + settings: { + index: { + // The source we're cloning from will have a write block set, so + // we need to remove it to allow writes to our newly cloned index + 'blocks.write': false, + number_of_shards: INDEX_NUMBER_OF_SHARDS, + auto_expand_replicas: INDEX_AUTO_EXPAND_REPLICAS, + // Set an explicit refresh interval so that we don't inherit the + // value from incorrectly configured index templates (not required + // after we adopt system indices) + refresh_interval: '1s', + // Bump priority so that recovery happens before newer indices + priority: 10, + }, + }, + }, + timeout, + }, + { maxRetries: 0 /** handle retry ourselves for now */ } + ) + .then((res) => { + /** + * - acknowledged=false, we timed out before the cluster state was + * updated with the newly created index, but it probably will be + * created sometime soon. + * - shards_acknowledged=false, we timed out before all shards were + * started + * - acknowledged=true, shards_acknowledged=true, cloning complete + */ + return Either.right({ + acknowledged: res.body.acknowledged, + shardsAcknowledged: res.body.shards_acknowledged, + }); + }) + .catch((error: EsErrors.ResponseError) => { + if (error?.body?.error?.type === 'index_not_found_exception') { + return Either.left({ + type: 'index_not_found_exception' as const, + index: error.body.error.index, + }); + } else if (error?.body?.error?.type === 'resource_already_exists_exception') { + /** + * If the target index already exists it means a previous clone + * operation had already been started. However, we can't be sure + * that all shards were started so return shardsAcknowledged: false + */ + return Either.right({ + acknowledged: true, + shardsAcknowledged: false, + }); + } else { + throw error; + } + }) + .catch(catchRetryableEsClientErrors); + }; + + return pipe( + cloneTask, + TaskEither.chain((res) => { + if (res.acknowledged && res.shardsAcknowledged) { + // If the cluster state was updated and all shards ackd we're done + return TaskEither.right(res); + } else { + // Otherwise, wait until the target index has a 'green' status. + return pipe( + waitForIndexStatusYellow({ client, index: target, timeout }), + TaskEither.map((value) => { + /** When the index status is 'green' we know that all shards were started */ + return { acknowledged: true, shardsAcknowledged: true }; + }) + ); + } + }) + ); +}; diff --git a/src/core/server/saved_objects/migrationsv2/actions/close_pit.test.ts b/src/core/server/saved_objects/migrationsv2/actions/close_pit.test.ts new file mode 100644 index 00000000000000..5d9696239a61e3 --- /dev/null +++ b/src/core/server/saved_objects/migrationsv2/actions/close_pit.test.ts @@ -0,0 +1,40 @@ +/* + * 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 { catchRetryableEsClientErrors } from './catch_retryable_es_client_errors'; +jest.mock('./catch_retryable_es_client_errors'); +import { errors as EsErrors } from '@elastic/elasticsearch'; +import { elasticsearchClientMock } from '../../../elasticsearch/client/mocks'; +import { closePit } from './close_pit'; + +describe('closePit', () => { + beforeEach(() => { + jest.clearAllMocks(); + }); + + // Create a mock client that rejects all methods with a 503 status code + // response. + const retryableError = new EsErrors.ResponseError( + elasticsearchClientMock.createApiResponse({ + statusCode: 503, + body: { error: { type: 'es_type', reason: 'es_reason' } }, + }) + ); + const client = elasticsearchClientMock.createInternalClient( + elasticsearchClientMock.createErrorTransportRequestPromise(retryableError) + ); + + it('calls catchRetryableEsClientErrors when the promise rejects', async () => { + const task = closePit({ client, pitId: 'pitId' }); + try { + await task(); + } catch (e) { + /** ignore */ + } + expect(catchRetryableEsClientErrors).toHaveBeenCalledWith(retryableError); + }); +}); diff --git a/src/core/server/saved_objects/migrationsv2/actions/close_pit.ts b/src/core/server/saved_objects/migrationsv2/actions/close_pit.ts new file mode 100644 index 00000000000000..d421950c839e23 --- /dev/null +++ b/src/core/server/saved_objects/migrationsv2/actions/close_pit.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 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 * as Either from 'fp-ts/lib/Either'; +import * as TaskEither from 'fp-ts/lib/TaskEither'; +import { ElasticsearchClient } from '../../../elasticsearch'; +import { + catchRetryableEsClientErrors, + RetryableEsClientError, +} from './catch_retryable_es_client_errors'; + +/** @internal */ +export interface ClosePitParams { + client: ElasticsearchClient; + pitId: string; +} +/* + * Closes PIT. + * See https://www.elastic.co/guide/en/elasticsearch/reference/current/point-in-time-api.html + * */ +export const closePit = ({ + client, + pitId, +}: ClosePitParams): TaskEither.TaskEither => () => { + return client + .closePointInTime({ + body: { id: pitId }, + }) + .then((response) => { + if (!response.body.succeeded) { + throw new Error(`Failed to close PointInTime with id: ${pitId}`); + } + return Either.right({}); + }) + .catch(catchRetryableEsClientErrors); +}; diff --git a/src/core/server/saved_objects/migrationsv2/actions/constants.ts b/src/core/server/saved_objects/migrationsv2/actions/constants.ts new file mode 100644 index 00000000000000..5d0d2ffe5d695b --- /dev/null +++ b/src/core/server/saved_objects/migrationsv2/actions/constants.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 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. + */ + +/** + * Batch size for updateByQuery and reindex operations. + * Uses the default value of 1000 for Elasticsearch reindex operation. + */ +export const BATCH_SIZE = 1_000; +export const DEFAULT_TIMEOUT = '60s'; +/** Allocate 1 replica if there are enough data nodes, otherwise continue with 0 */ +export const INDEX_AUTO_EXPAND_REPLICAS = '0-1'; +/** ES rule of thumb: shards should be several GB to 10's of GB, so Kibana is unlikely to cross that limit */ +export const INDEX_NUMBER_OF_SHARDS = 1; +/** Wait for all shards to be active before starting an operation */ +export const WAIT_FOR_ALL_SHARDS_TO_BE_ACTIVE = 'all'; diff --git a/src/core/server/saved_objects/migrationsv2/actions/create_index.test.ts b/src/core/server/saved_objects/migrationsv2/actions/create_index.test.ts new file mode 100644 index 00000000000000..d5d906898943cc --- /dev/null +++ b/src/core/server/saved_objects/migrationsv2/actions/create_index.test.ts @@ -0,0 +1,59 @@ +/* + * 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 { catchRetryableEsClientErrors } from './catch_retryable_es_client_errors'; +import { errors as EsErrors } from '@elastic/elasticsearch'; +jest.mock('./catch_retryable_es_client_errors'); +import { elasticsearchClientMock } from '../../../elasticsearch/client/mocks'; +import { createIndex } from './create_index'; +import { setWriteBlock } from './set_write_block'; + +describe('createIndex', () => { + beforeEach(() => { + jest.clearAllMocks(); + }); + + // Create a mock client that rejects all methods with a 503 status code + // response. + const retryableError = new EsErrors.ResponseError( + elasticsearchClientMock.createApiResponse({ + statusCode: 503, + body: { error: { type: 'es_type', reason: 'es_reason' } }, + }) + ); + const client = elasticsearchClientMock.createInternalClient( + elasticsearchClientMock.createErrorTransportRequestPromise(retryableError) + ); + + const nonRetryableError = new Error('crash'); + const clientWithNonRetryableError = elasticsearchClientMock.createInternalClient( + elasticsearchClientMock.createErrorTransportRequestPromise(nonRetryableError) + ); + it('calls catchRetryableEsClientErrors when the promise rejects', async () => { + const task = createIndex({ + client, + indexName: 'new_index', + mappings: { properties: {} }, + }); + try { + await task(); + } catch (e) { + /** ignore */ + } + + expect(catchRetryableEsClientErrors).toHaveBeenCalledWith(retryableError); + }); + it('re-throws non retry-able errors', async () => { + const task = setWriteBlock({ + client: clientWithNonRetryableError, + index: 'my_index', + }); + await task(); + expect(catchRetryableEsClientErrors).toHaveBeenCalledWith(nonRetryableError); + }); +}); diff --git a/src/core/server/saved_objects/migrationsv2/actions/create_index.ts b/src/core/server/saved_objects/migrationsv2/actions/create_index.ts new file mode 100644 index 00000000000000..8e5042a5ff8fe0 --- /dev/null +++ b/src/core/server/saved_objects/migrationsv2/actions/create_index.ts @@ -0,0 +1,145 @@ +/* + * 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 * as Either from 'fp-ts/lib/Either'; +import * as TaskEither from 'fp-ts/lib/TaskEither'; +import { pipe } from 'fp-ts/lib/pipeable'; +import type { estypes } from '@elastic/elasticsearch'; +import { AcknowledgeResponse } from './index'; +import { ElasticsearchClient } from '../../../elasticsearch'; +import { IndexMapping } from '../../mappings'; +import { + catchRetryableEsClientErrors, + RetryableEsClientError, +} from './catch_retryable_es_client_errors'; +import { + DEFAULT_TIMEOUT, + INDEX_AUTO_EXPAND_REPLICAS, + WAIT_FOR_ALL_SHARDS_TO_BE_ACTIVE, +} from './constants'; +import { waitForIndexStatusYellow } from './wait_for_index_status_yellow'; + +function aliasArrayToRecord(aliases: string[]): Record { + const result: Record = {}; + for (const alias of aliases) { + result[alias] = {}; + } + return result; +} + +/** @internal */ +export interface CreateIndexParams { + client: ElasticsearchClient; + indexName: string; + mappings: IndexMapping; + aliases?: string[]; +} +/** + * Creates an index with the given mappings + * + * @remarks + * This method adds some additional logic to the ES create index API: + * - it is idempotent, if it gets called multiple times subsequent calls will + * wait for the first create operation to complete (up to 60s) + * - the first call will wait up to 120s for the cluster state and all shards + * to be updated. + */ +export const createIndex = ({ + client, + indexName, + mappings, + aliases = [], +}: CreateIndexParams): TaskEither.TaskEither => { + const createIndexTask: TaskEither.TaskEither< + RetryableEsClientError, + AcknowledgeResponse + > = () => { + const aliasesObject = aliasArrayToRecord(aliases); + + return client.indices + .create( + { + index: indexName, + // wait until all shards are available before creating the index + // (since number_of_shards=1 this does not have any effect atm) + wait_for_active_shards: WAIT_FOR_ALL_SHARDS_TO_BE_ACTIVE, + // Wait up to 60s for the cluster state to update and all shards to be + // started + timeout: DEFAULT_TIMEOUT, + body: { + mappings, + aliases: aliasesObject, + settings: { + index: { + // ES rule of thumb: shards should be several GB to 10's of GB, so + // Kibana is unlikely to cross that limit. + number_of_shards: 1, + auto_expand_replicas: INDEX_AUTO_EXPAND_REPLICAS, + // Set an explicit refresh interval so that we don't inherit the + // value from incorrectly configured index templates (not required + // after we adopt system indices) + refresh_interval: '1s', + // Bump priority so that recovery happens before newer indices + priority: 10, + }, + }, + }, + }, + { maxRetries: 0 /** handle retry ourselves for now */ } + ) + .then((res) => { + /** + * - acknowledged=false, we timed out before the cluster state was + * updated on all nodes with the newly created index, but it + * probably will be created sometime soon. + * - shards_acknowledged=false, we timed out before all shards were + * started + * - acknowledged=true, shards_acknowledged=true, index creation complete + */ + return Either.right({ + acknowledged: res.body.acknowledged, + shardsAcknowledged: res.body.shards_acknowledged, + }); + }) + .catch((error) => { + if (error?.body?.error?.type === 'resource_already_exists_exception') { + /** + * If the target index already exists it means a previous create + * operation had already been started. However, we can't be sure + * that all shards were started so return shardsAcknowledged: false + */ + return Either.right({ + acknowledged: true, + shardsAcknowledged: false, + }); + } else { + throw error; + } + }) + .catch(catchRetryableEsClientErrors); + }; + + return pipe( + createIndexTask, + TaskEither.chain((res) => { + if (res.acknowledged && res.shardsAcknowledged) { + // If the cluster state was updated and all shards ackd we're done + return TaskEither.right('create_index_succeeded'); + } else { + // Otherwise, wait until the target index has a 'yellow' status. + return pipe( + waitForIndexStatusYellow({ client, index: indexName, timeout: DEFAULT_TIMEOUT }), + TaskEither.map(() => { + /** When the index status is 'yellow' we know that all shards were started */ + return 'create_index_succeeded'; + }) + ); + } + }) + ); +}; diff --git a/src/core/server/saved_objects/migrationsv2/actions/fetch_indices.test.ts b/src/core/server/saved_objects/migrationsv2/actions/fetch_indices.test.ts new file mode 100644 index 00000000000000..0dab1728b6ef2d --- /dev/null +++ b/src/core/server/saved_objects/migrationsv2/actions/fetch_indices.test.ts @@ -0,0 +1,37 @@ +/* + * 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 { catchRetryableEsClientErrors } from './catch_retryable_es_client_errors'; +import { errors as EsErrors } from '@elastic/elasticsearch'; +jest.mock('./catch_retryable_es_client_errors'); +import { elasticsearchClientMock } from '../../../elasticsearch/client/mocks'; +import { fetchIndices } from './fetch_indices'; + +describe('fetchIndices', () => { + beforeEach(() => { + jest.clearAllMocks(); + }); + const retryableError = new EsErrors.ResponseError( + elasticsearchClientMock.createApiResponse({ + statusCode: 503, + body: { error: { type: 'es_type', reason: 'es_reason' } }, + }) + ); + const client = elasticsearchClientMock.createInternalClient( + elasticsearchClientMock.createErrorTransportRequestPromise(retryableError) + ); + it('calls catchRetryableEsClientErrors when the promise rejects', async () => { + const task = fetchIndices({ client, indices: ['my_index'] }); + try { + await task(); + } catch (e) { + /** ignore */ + } + expect(catchRetryableEsClientErrors).toHaveBeenCalledWith(retryableError); + }); +}); diff --git a/src/core/server/saved_objects/migrationsv2/actions/fetch_indices.ts b/src/core/server/saved_objects/migrationsv2/actions/fetch_indices.ts new file mode 100644 index 00000000000000..3847252eb6db15 --- /dev/null +++ b/src/core/server/saved_objects/migrationsv2/actions/fetch_indices.ts @@ -0,0 +1,49 @@ +/* + * 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 * as TaskEither from 'fp-ts/lib/TaskEither'; +import * as Either from 'fp-ts/lib/Either'; +import { IndexMapping } from '../../mappings'; +import { ElasticsearchClient } from '../../../elasticsearch'; +import { + catchRetryableEsClientErrors, + RetryableEsClientError, +} from './catch_retryable_es_client_errors'; +export type FetchIndexResponse = Record< + string, + { aliases: Record; mappings: IndexMapping; settings: unknown } +>; + +/** @internal */ +export interface FetchIndicesParams { + client: ElasticsearchClient; + indices: string[]; +} + +/** + * Fetches information about the given indices including aliases, mappings and + * settings. + */ +export const fetchIndices = ({ + client, + indices, +}: FetchIndicesParams): TaskEither.TaskEither => + // @ts-expect-error @elastic/elasticsearch IndexState.alias and IndexState.mappings should be required + () => { + return client.indices + .get( + { + index: indices, + ignore_unavailable: true, // Don't return an error for missing indices. Note this *will* include closed indices, the docs are misleading https://github.com/elastic/elasticsearch/issues/63607 + }, + { ignore: [404], maxRetries: 0 } + ) + .then(({ body }) => { + return Either.right(body); + }) + .catch(catchRetryableEsClientErrors); + }; diff --git a/src/core/server/saved_objects/migrationsv2/actions/index.test.ts b/src/core/server/saved_objects/migrationsv2/actions/index.test.ts deleted file mode 100644 index 05da335d708840..00000000000000 --- a/src/core/server/saved_objects/migrationsv2/actions/index.test.ts +++ /dev/null @@ -1,346 +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 * as Actions from './'; -import { catchRetryableEsClientErrors } from './catch_retryable_es_client_errors'; -import { errors as EsErrors } from '@elastic/elasticsearch'; -jest.mock('./catch_retryable_es_client_errors'); -import { elasticsearchClientMock } from '../../../elasticsearch/client/mocks'; -import * as Option from 'fp-ts/lib/Option'; - -describe('actions', () => { - beforeEach(() => { - jest.clearAllMocks(); - }); - - // Create a mock client that rejects all methods with a 503 status code - // response. - const retryableError = new EsErrors.ResponseError( - elasticsearchClientMock.createApiResponse({ - statusCode: 503, - body: { error: { type: 'es_type', reason: 'es_reason' } }, - }) - ); - const client = elasticsearchClientMock.createInternalClient( - elasticsearchClientMock.createErrorTransportRequestPromise(retryableError) - ); - - const nonRetryableError = new Error('crash'); - const clientWithNonRetryableError = elasticsearchClientMock.createInternalClient( - elasticsearchClientMock.createErrorTransportRequestPromise(nonRetryableError) - ); - - describe('fetchIndices', () => { - it('calls catchRetryableEsClientErrors when the promise rejects', async () => { - const task = Actions.fetchIndices({ client, indices: ['my_index'] }); - try { - await task(); - } catch (e) { - /** ignore */ - } - expect(catchRetryableEsClientErrors).toHaveBeenCalledWith(retryableError); - }); - }); - - describe('setWriteBlock', () => { - it('calls catchRetryableEsClientErrors when the promise rejects', async () => { - const task = Actions.setWriteBlock({ client, index: 'my_index' }); - try { - await task(); - } catch (e) { - /** ignore */ - } - expect(catchRetryableEsClientErrors).toHaveBeenCalledWith(retryableError); - }); - it('re-throws non retry-able errors', async () => { - const task = Actions.setWriteBlock({ - client: clientWithNonRetryableError, - index: 'my_index', - }); - await task(); - expect(catchRetryableEsClientErrors).toHaveBeenCalledWith(nonRetryableError); - }); - }); - - describe('cloneIndex', () => { - it('calls catchRetryableEsClientErrors when the promise rejects', async () => { - const task = Actions.cloneIndex({ - client, - source: 'my_source_index', - target: 'my_target_index', - }); - try { - await task(); - } catch (e) { - /** ignore */ - } - expect(catchRetryableEsClientErrors).toHaveBeenCalledWith(retryableError); - }); - it('re-throws non retry-able errors', async () => { - const task = Actions.setWriteBlock({ - client: clientWithNonRetryableError, - index: 'my_index', - }); - await task(); - expect(catchRetryableEsClientErrors).toHaveBeenCalledWith(nonRetryableError); - }); - }); - - describe('pickupUpdatedMappings', () => { - it('calls catchRetryableEsClientErrors when the promise rejects', async () => { - const task = Actions.pickupUpdatedMappings(client, 'my_index'); - try { - await task(); - } catch (e) { - /** ignore */ - } - expect(catchRetryableEsClientErrors).toHaveBeenCalledWith(retryableError); - }); - }); - - describe('openPit', () => { - it('calls catchRetryableEsClientErrors when the promise rejects', async () => { - const task = Actions.openPit({ client, index: 'my_index' }); - try { - await task(); - } catch (e) { - /** ignore */ - } - expect(catchRetryableEsClientErrors).toHaveBeenCalledWith(retryableError); - }); - }); - - describe('readWithPit', () => { - it('calls catchRetryableEsClientErrors when the promise rejects', async () => { - const task = Actions.readWithPit({ - client, - pitId: 'pitId', - query: { match_all: {} }, - batchSize: 10_000, - }); - try { - await task(); - } catch (e) { - /** ignore */ - } - expect(catchRetryableEsClientErrors).toHaveBeenCalledWith(retryableError); - }); - }); - - describe('closePit', () => { - it('calls catchRetryableEsClientErrors when the promise rejects', async () => { - const task = Actions.closePit({ client, pitId: 'pitId' }); - try { - await task(); - } catch (e) { - /** ignore */ - } - expect(catchRetryableEsClientErrors).toHaveBeenCalledWith(retryableError); - }); - }); - - describe('reindex', () => { - it('calls catchRetryableEsClientErrors when the promise rejects', async () => { - const task = Actions.reindex({ - client, - sourceIndex: 'my_source_index', - targetIndex: 'my_target_index', - reindexScript: Option.none, - requireAlias: false, - unusedTypesQuery: {}, - }); - try { - await task(); - } catch (e) { - /** ignore */ - } - expect(catchRetryableEsClientErrors).toHaveBeenCalledWith(retryableError); - }); - }); - - describe('waitForReindexTask', () => { - it('calls catchRetryableEsClientErrors when the promise rejects', async () => { - const task = Actions.waitForReindexTask({ client, taskId: 'my task id', timeout: '60s' }); - try { - await task(); - } catch (e) { - /** ignore */ - } - - expect(catchRetryableEsClientErrors).toHaveBeenCalledWith(retryableError); - }); - it('re-throws non retry-able errors', async () => { - const task = Actions.setWriteBlock({ - client: clientWithNonRetryableError, - index: 'my_index', - }); - await task(); - expect(catchRetryableEsClientErrors).toHaveBeenCalledWith(nonRetryableError); - }); - }); - - describe('waitForPickupUpdatedMappingsTask', () => { - it('calls catchRetryableEsClientErrors when the promise rejects', async () => { - const task = Actions.waitForPickupUpdatedMappingsTask({ - client, - taskId: 'my task id', - timeout: '60s', - }); - try { - await task(); - } catch (e) { - /** ignore */ - } - - expect(catchRetryableEsClientErrors).toHaveBeenCalledWith(retryableError); - }); - it('re-throws non retry-able errors', async () => { - const task = Actions.setWriteBlock({ - client: clientWithNonRetryableError, - index: 'my_index', - }); - await task(); - expect(catchRetryableEsClientErrors).toHaveBeenCalledWith(nonRetryableError); - }); - }); - - describe('updateAliases', () => { - it('calls catchRetryableEsClientErrors when the promise rejects', async () => { - const task = Actions.updateAliases({ client, aliasActions: [] }); - try { - await task(); - } catch (e) { - /** ignore */ - } - - expect(catchRetryableEsClientErrors).toHaveBeenCalledWith(retryableError); - }); - it('re-throws non retry-able errors', async () => { - const task = Actions.setWriteBlock({ - client: clientWithNonRetryableError, - index: 'my_index', - }); - await task(); - expect(catchRetryableEsClientErrors).toHaveBeenCalledWith(nonRetryableError); - }); - }); - - describe('createIndex', () => { - it('calls catchRetryableEsClientErrors when the promise rejects', async () => { - const task = Actions.createIndex({ - client, - indexName: 'new_index', - mappings: { properties: {} }, - }); - try { - await task(); - } catch (e) { - /** ignore */ - } - - expect(catchRetryableEsClientErrors).toHaveBeenCalledWith(retryableError); - }); - it('re-throws non retry-able errors', async () => { - const task = Actions.setWriteBlock({ - client: clientWithNonRetryableError, - index: 'my_index', - }); - await task(); - expect(catchRetryableEsClientErrors).toHaveBeenCalledWith(nonRetryableError); - }); - }); - - describe('updateAndPickupMappings', () => { - it('calls catchRetryableEsClientErrors when the promise rejects', async () => { - const task = Actions.updateAndPickupMappings({ - client, - index: 'new_index', - mappings: { properties: {} }, - }); - try { - await task(); - } catch (e) { - /** ignore */ - } - - expect(catchRetryableEsClientErrors).toHaveBeenCalledWith(retryableError); - }); - }); - - describe('searchForOutdatedDocuments', () => { - it('calls catchRetryableEsClientErrors when the promise rejects', async () => { - const task = Actions.searchForOutdatedDocuments(client, { - batchSize: 1000, - targetIndex: 'new_index', - outdatedDocumentsQuery: {}, - }); - - try { - await task(); - } catch (e) { - /** ignore */ - } - - expect(catchRetryableEsClientErrors).toHaveBeenCalledWith(retryableError); - }); - - it('configures request according to given parameters', async () => { - const esClient = elasticsearchClientMock.createInternalClient(); - const query = {}; - const targetIndex = 'new_index'; - const batchSize = 1000; - const task = Actions.searchForOutdatedDocuments(esClient, { - batchSize, - targetIndex, - outdatedDocumentsQuery: query, - }); - - await task(); - - expect(esClient.search).toHaveBeenCalledTimes(1); - expect(esClient.search).toHaveBeenCalledWith( - expect.objectContaining({ - index: targetIndex, - size: batchSize, - body: expect.objectContaining({ query }), - }) - ); - }); - }); - - describe('bulkOverwriteTransformedDocuments', () => { - it('calls catchRetryableEsClientErrors when the promise rejects', async () => { - const task = Actions.bulkOverwriteTransformedDocuments({ - client, - index: 'new_index', - transformedDocs: [], - refresh: 'wait_for', - }); - try { - await task(); - } catch (e) { - /** ignore */ - } - - expect(catchRetryableEsClientErrors).toHaveBeenCalledWith(retryableError); - }); - }); - - describe('refreshIndex', () => { - it('calls catchRetryableEsClientErrors when the promise rejects', async () => { - const task = Actions.refreshIndex({ client, targetIndex: 'target_index' }); - try { - await task(); - } catch (e) { - /** ignore */ - } - - expect(catchRetryableEsClientErrors).toHaveBeenCalledWith(retryableError); - }); - }); -}); diff --git a/src/core/server/saved_objects/migrationsv2/actions/index.ts b/src/core/server/saved_objects/migrationsv2/actions/index.ts index 905d64947298ec..98d7167ffc31a1 100644 --- a/src/core/server/saved_objects/migrationsv2/actions/index.ts +++ b/src/core/server/saved_objects/migrationsv2/actions/index.ts @@ -6,1231 +6,126 @@ * Side Public License, v 1. */ -import * as Either from 'fp-ts/lib/Either'; -import * as TaskEither from 'fp-ts/lib/TaskEither'; -import * as Option from 'fp-ts/lib/Option'; -import type { estypes } from '@elastic/elasticsearch'; -import { errors as EsErrors } from '@elastic/elasticsearch'; -import type { ElasticsearchClientError, ResponseError } from '@elastic/elasticsearch/lib/errors'; -import { pipe } from 'fp-ts/lib/pipeable'; -import { flow } from 'fp-ts/lib/function'; -import { ElasticsearchClient } from '../../../elasticsearch'; -import { IndexMapping } from '../../mappings'; -import type { SavedObjectsRawDoc, SavedObjectsRawDocSource } from '../../serialization'; -import type { TransformRawDocs } from '../types'; -import { - catchRetryableEsClientErrors, - RetryableEsClientError, -} from './catch_retryable_es_client_errors'; -import { - DocumentsTransformFailed, - DocumentsTransformSuccess, -} from '../../migrations/core/migrate_raw_docs'; -export type { RetryableEsClientError }; - -/** - * Batch size for updateByQuery and reindex operations. - * Uses the default value of 1000 for Elasticsearch reindex operation. - */ -const BATCH_SIZE = 1_000; -const DEFAULT_TIMEOUT = '60s'; -/** Allocate 1 replica if there are enough data nodes, otherwise continue with 0 */ -const INDEX_AUTO_EXPAND_REPLICAS = '0-1'; -/** ES rule of thumb: shards should be several GB to 10's of GB, so Kibana is unlikely to cross that limit */ -const INDEX_NUMBER_OF_SHARDS = 1; -/** Wait for all shards to be active before starting an operation */ -const WAIT_FOR_ALL_SHARDS_TO_BE_ACTIVE = 'all'; - -// Map of left response 'type' string -> response interface -export interface ActionErrorTypeMap { - wait_for_task_completion_timeout: WaitForTaskCompletionTimeout; - retryable_es_client_error: RetryableEsClientError; - index_not_found_exception: IndexNotFound; - target_index_had_write_block: TargetIndexHadWriteBlock; - incompatible_mapping_exception: IncompatibleMappingException; - alias_not_found_exception: AliasNotFound; - remove_index_not_a_concrete_index: RemoveIndexNotAConcreteIndex; - documents_transform_failed: DocumentsTransformFailed; -} - -/** - * Type guard for narrowing the type of a left - */ -export function isLeftTypeof( - res: any, - typeString: T -): res is ActionErrorTypeMap[T] { - return res.type === typeString; -} - -export type FetchIndexResponse = Record< - string, - { aliases: Record; mappings: IndexMapping; settings: unknown } ->; +import { RetryableEsClientError } from './catch_retryable_es_client_errors'; +import { DocumentsTransformFailed } from '../../migrations/core/migrate_raw_docs'; -/** @internal */ -export interface FetchIndicesParams { - client: ElasticsearchClient; - indices: string[]; -} - -/** - * Fetches information about the given indices including aliases, mappings and - * settings. - */ -export const fetchIndices = ({ - client, - indices, -}: FetchIndicesParams): TaskEither.TaskEither => - // @ts-expect-error @elastic/elasticsearch IndexState.alias and IndexState.mappings should be required - () => { - return client.indices - .get( - { - index: indices, - ignore_unavailable: true, // Don't return an error for missing indices. Note this *will* include closed indices, the docs are misleading https://github.com/elastic/elasticsearch/issues/63607 - }, - { ignore: [404], maxRetries: 0 } - ) - .then(({ body }) => { - return Either.right(body); - }) - .catch(catchRetryableEsClientErrors); - }; +export { + BATCH_SIZE, + DEFAULT_TIMEOUT, + INDEX_AUTO_EXPAND_REPLICAS, + INDEX_NUMBER_OF_SHARDS, + WAIT_FOR_ALL_SHARDS_TO_BE_ACTIVE, +} from './constants'; -export interface IndexNotFound { - type: 'index_not_found_exception'; - index: string; -} +export type { RetryableEsClientError }; -/** @internal */ -export interface SetWriteBlockParams { - client: ElasticsearchClient; - index: string; -} -/** - * Sets a write block in place for the given index. If the response includes - * `acknowledged: true` all in-progress writes have drained and no further - * writes to this index will be possible. - * - * The first time the write block is added to an index the response will - * include `shards_acknowledged: true` but once the block is in place, - * subsequent calls return `shards_acknowledged: false` - */ -export const setWriteBlock = ({ - client, - index, -}: SetWriteBlockParams): TaskEither.TaskEither< - IndexNotFound | RetryableEsClientError, - 'set_write_block_succeeded' -> => () => { - return ( - client.indices - .addBlock<{ - acknowledged: boolean; - shards_acknowledged: boolean; - }>( - { - index, - block: 'write', - }, - { maxRetries: 0 /** handle retry ourselves for now */ } - ) - // not typed yet - .then((res: any) => { - return res.body.acknowledged === true - ? Either.right('set_write_block_succeeded' as const) - : Either.left({ - type: 'retryable_es_client_error' as const, - message: 'set_write_block_failed', - }); - }) - .catch((e: ElasticsearchClientError) => { - if (e instanceof EsErrors.ResponseError) { - if (e.body?.error?.type === 'index_not_found_exception') { - return Either.left({ type: 'index_not_found_exception' as const, index }); - } - } - throw e; - }) - .catch(catchRetryableEsClientErrors) - ); -}; +// actions/* imports +export type { FetchIndexResponse, FetchIndicesParams } from './fetch_indices'; +export { fetchIndices } from './fetch_indices'; -/** @internal */ -export interface RemoveWriteBlockParams { - client: ElasticsearchClient; - index: string; -} -/** - * Removes a write block from an index - */ -export const removeWriteBlock = ({ - client, - index, -}: RemoveWriteBlockParams): TaskEither.TaskEither< - RetryableEsClientError, - 'remove_write_block_succeeded' -> => () => { - return client.indices - .putSettings<{ - acknowledged: boolean; - shards_acknowledged: boolean; - }>( - { - index, - // Don't change any existing settings - preserve_existing: true, - body: { - index: { - blocks: { - write: false, - }, - }, - }, - }, - { maxRetries: 0 /** handle retry ourselves for now */ } - ) - .then((res) => { - return res.body.acknowledged === true - ? Either.right('remove_write_block_succeeded' as const) - : Either.left({ - type: 'retryable_es_client_error' as const, - message: 'remove_write_block_failed', - }); - }) - .catch(catchRetryableEsClientErrors); -}; +export type { SetWriteBlockParams } from './set_write_block'; +export { setWriteBlock } from './set_write_block'; -/** @internal */ -export interface WaitForIndexStatusYellowParams { - client: ElasticsearchClient; - index: string; - timeout?: string; -} -/** - * A yellow index status means the index's primary shard is allocated and the - * index is ready for searching/indexing documents, but ES wasn't able to - * allocate the replicas. When migrations proceed with a yellow index it means - * we don't have as much data-redundancy as we could have, but waiting for - * replicas would mean that v2 migrations fail where v1 migrations would have - * succeeded. It doesn't feel like it's Kibana's job to force users to keep - * their clusters green and even if it's green when we migrate it can turn - * yellow at any point in the future. So ultimately data-redundancy is up to - * users to maintain. - */ -export const waitForIndexStatusYellow = ({ - client, - index, - timeout = DEFAULT_TIMEOUT, -}: WaitForIndexStatusYellowParams): TaskEither.TaskEither => () => { - return client.cluster - .health({ index, wait_for_status: 'yellow', timeout }) - .then(() => { - return Either.right({}); - }) - .catch(catchRetryableEsClientErrors); -}; +export type { RemoveWriteBlockParams } from './remove_write_block'; +export { removeWriteBlock } from './remove_write_block'; -export type CloneIndexResponse = AcknowledgeResponse; +export type { CloneIndexResponse, CloneIndexParams } from './clone_index'; +export { cloneIndex } from './clone_index'; -/** @internal */ -export interface CloneIndexParams { - client: ElasticsearchClient; - source: string; - target: string; - /** only used for testing */ - timeout?: string; -} -/** - * Makes a clone of the source index into the target. - * - * @remarks - * This method adds some additional logic to the ES clone index API: - * - it is idempotent, if it gets called multiple times subsequent calls will - * wait for the first clone operation to complete (up to 60s) - * - the first call will wait up to 120s for the cluster state and all shards - * to be updated. - */ -export const cloneIndex = ({ - client, - source, - target, - timeout = DEFAULT_TIMEOUT, -}: CloneIndexParams): TaskEither.TaskEither< - RetryableEsClientError | IndexNotFound, - CloneIndexResponse -> => { - const cloneTask: TaskEither.TaskEither< - RetryableEsClientError | IndexNotFound, - AcknowledgeResponse - > = () => { - return client.indices - .clone( - { - index: source, - target, - wait_for_active_shards: WAIT_FOR_ALL_SHARDS_TO_BE_ACTIVE, - body: { - settings: { - index: { - // The source we're cloning from will have a write block set, so - // we need to remove it to allow writes to our newly cloned index - 'blocks.write': false, - number_of_shards: INDEX_NUMBER_OF_SHARDS, - auto_expand_replicas: INDEX_AUTO_EXPAND_REPLICAS, - // Set an explicit refresh interval so that we don't inherit the - // value from incorrectly configured index templates (not required - // after we adopt system indices) - refresh_interval: '1s', - // Bump priority so that recovery happens before newer indices - priority: 10, - }, - }, - }, - timeout, - }, - { maxRetries: 0 /** handle retry ourselves for now */ } - ) - .then((res) => { - /** - * - acknowledged=false, we timed out before the cluster state was - * updated with the newly created index, but it probably will be - * created sometime soon. - * - shards_acknowledged=false, we timed out before all shards were - * started - * - acknowledged=true, shards_acknowledged=true, cloning complete - */ - return Either.right({ - acknowledged: res.body.acknowledged, - shardsAcknowledged: res.body.shards_acknowledged, - }); - }) - .catch((error: EsErrors.ResponseError) => { - if (error?.body?.error?.type === 'index_not_found_exception') { - return Either.left({ - type: 'index_not_found_exception' as const, - index: error.body.error.index, - }); - } else if (error?.body?.error?.type === 'resource_already_exists_exception') { - /** - * If the target index already exists it means a previous clone - * operation had already been started. However, we can't be sure - * that all shards were started so return shardsAcknowledged: false - */ - return Either.right({ - acknowledged: true, - shardsAcknowledged: false, - }); - } else { - throw error; - } - }) - .catch(catchRetryableEsClientErrors); - }; +export type { WaitForIndexStatusYellowParams } from './wait_for_index_status_yellow'; +import { waitForIndexStatusYellow } from './wait_for_index_status_yellow'; - return pipe( - cloneTask, - TaskEither.chain((res) => { - if (res.acknowledged && res.shardsAcknowledged) { - // If the cluster state was updated and all shards ackd we're done - return TaskEither.right(res); - } else { - // Otherwise, wait until the target index has a 'green' status. - return pipe( - waitForIndexStatusYellow({ client, index: target, timeout }), - TaskEither.map((value) => { - /** When the index status is 'green' we know that all shards were started */ - return { acknowledged: true, shardsAcknowledged: true }; - }) - ); - } - }) - ); -}; +export type { WaitForTaskResponse, WaitForTaskCompletionTimeout } from './wait_for_task'; +import { waitForTask, WaitForTaskCompletionTimeout } from './wait_for_task'; -interface WaitForTaskResponse { - error: Option.Option<{ type: string; reason: string; index: string }>; - completed: boolean; - failures: Option.Option; - description?: string; -} +export type { UpdateByQueryResponse } from './pickup_updated_mappings'; +import { pickupUpdatedMappings } from './pickup_updated_mappings'; -/** - * After waiting for the specificed timeout, the task has not yet completed. - * - * When querying the tasks API we use `wait_for_completion=true` to block the - * request until the task completes. If after the `timeout`, the task still has - * not completed we return this error. This does not mean that the task itelf - * has reached a timeout, Elasticsearch will continue to run the task. - */ -export interface WaitForTaskCompletionTimeout { - /** After waiting for the specificed timeout, the task has not yet completed. */ - readonly type: 'wait_for_task_completion_timeout'; - readonly message: string; - readonly error?: Error; -} +export type { OpenPitResponse, OpenPitParams } from './open_pit'; +export { openPit, pitKeepAlive } from './open_pit'; -const catchWaitForTaskCompletionTimeout = ( - e: ResponseError -): Either.Either => { - if ( - e.body?.error?.type === 'timeout_exception' || - e.body?.error?.type === 'receive_timeout_transport_exception' - ) { - return Either.left({ - type: 'wait_for_task_completion_timeout' as const, - message: `[${e.body.error.type}] ${e.body.error.reason}`, - error: e, - }); - } else { - throw e; - } -}; +export type { ReadWithPit, ReadWithPitParams } from './read_with_pit'; +export { readWithPit } from './read_with_pit'; -/** @internal */ -export interface WaitForTaskParams { - client: ElasticsearchClient; - taskId: string; - timeout: string; -} -/** - * Blocks for up to 60s or until a task completes. - * - * TODO: delete completed tasks - */ -const waitForTask = ({ - client, - taskId, - timeout, -}: WaitForTaskParams): TaskEither.TaskEither< - RetryableEsClientError | WaitForTaskCompletionTimeout, - WaitForTaskResponse -> => () => { - return client.tasks - .get({ - task_id: taskId, - wait_for_completion: true, - timeout, - }) - .then((res) => { - const body = res.body; - const failures = body.response?.failures ?? []; - return Either.right({ - completed: body.completed, - // @ts-expect-error @elastic/elasticsearch GetTaskResponse doesn't declare `error` property - error: Option.fromNullable(body.error), - failures: failures.length > 0 ? Option.some(failures) : Option.none, - description: body.task.description, - }); - }) - .catch(catchWaitForTaskCompletionTimeout) - .catch(catchRetryableEsClientErrors); -}; +export type { ClosePitParams } from './close_pit'; +export { closePit } from './close_pit'; -export interface UpdateByQueryResponse { - taskId: string; -} +export type { TransformDocsParams } from './transform_docs'; +export { transformDocs } from './transform_docs'; -/** - * Pickup updated mappings by performing an update by query operation on all - * documents in the index. Returns a task ID which can be - * tracked for progress. - * - * @remarks When mappings are updated to add a field which previously wasn't - * mapped Elasticsearch won't automatically add existing documents to it's - * internal search indices. So search results on this field won't return any - * existing documents. By running an update by query we essentially refresh - * these the internal search indices for all existing documents. - * This action uses `conflicts: 'proceed'` allowing several Kibana instances - * to run this in parallel. - */ -export const pickupUpdatedMappings = ( - client: ElasticsearchClient, - index: string -): TaskEither.TaskEither => () => { - return client - .updateByQuery({ - // Ignore version conflicts that can occur from parallel update by query operations - conflicts: 'proceed', - // Return an error when targeting missing or closed indices - allow_no_indices: false, - index, - // How many documents to update per batch - scroll_size: BATCH_SIZE, - // force a refresh so that we can query the updated index immediately - // after the operation completes - refresh: true, - // Create a task and return task id instead of blocking until complete - wait_for_completion: false, - }) - .then(({ body: { task: taskId } }) => { - return Either.right({ taskId: String(taskId!) }); - }) - .catch(catchRetryableEsClientErrors); -}; +export type { RefreshIndexParams } from './refresh_index'; +export { refreshIndex } from './refresh_index'; -/** @internal */ -export interface OpenPitResponse { - pitId: string; -} +export type { ReindexResponse, ReindexParams } from './reindex'; +export { reindex } from './reindex'; -/** @internal */ -export interface OpenPitParams { - client: ElasticsearchClient; - index: string; -} -// how long ES should keep PIT alive -const pitKeepAlive = '10m'; -/* - * Creates a lightweight view of data when the request has been initiated. - * See https://www.elastic.co/guide/en/elasticsearch/reference/current/point-in-time-api.html - * */ -export const openPit = ({ - client, - index, -}: OpenPitParams): TaskEither.TaskEither => () => { - return client - .openPointInTime({ - index, - keep_alive: pitKeepAlive, - }) - .then((response) => Either.right({ pitId: response.body.id })) - .catch(catchRetryableEsClientErrors); -}; +import type { IncompatibleMappingException } from './wait_for_reindex_task'; +export { waitForReindexTask } from './wait_for_reindex_task'; -/** @internal */ -export interface ReadWithPit { - outdatedDocuments: SavedObjectsRawDoc[]; - readonly lastHitSortValue: number[] | undefined; - readonly totalHits: number | undefined; -} +export type { VerifyReindexParams } from './verify_reindex'; +export { verifyReindex } from './verify_reindex'; -/** @internal */ +import type { AliasNotFound, RemoveIndexNotAConcreteIndex } from './update_aliases'; +export type { AliasAction, UpdateAliasesParams } from './update_aliases'; +export { updateAliases } from './update_aliases'; -export interface ReadWithPitParams { - client: ElasticsearchClient; - pitId: string; - query: estypes.QueryContainer; - batchSize: number; - searchAfter?: number[]; - seqNoPrimaryTerm?: boolean; -} +export type { CreateIndexParams } from './create_index'; +export { createIndex } from './create_index'; -/* - * Requests documents from the index using PIT mechanism. - * */ -export const readWithPit = ({ - client, - pitId, - query, - batchSize, - searchAfter, - seqNoPrimaryTerm, -}: ReadWithPitParams): TaskEither.TaskEither => () => { - return client - .search({ - seq_no_primary_term: seqNoPrimaryTerm, - body: { - // Sort fields are required to use searchAfter - sort: { - // the most efficient option as order is not important for the migration - _shard_doc: { order: 'asc' }, - }, - pit: { id: pitId, keep_alive: pitKeepAlive }, - size: batchSize, - search_after: searchAfter, - /** - * We want to know how many documents we need to process so we can log the progress. - * But we also want to increase the performance of these requests, - * so we ask ES to report the total count only on the first request (when searchAfter does not exist) - */ - track_total_hits: typeof searchAfter === 'undefined', - query, - }, - }) - .then((response) => { - const totalHits = - typeof response.body.hits.total === 'number' - ? response.body.hits.total // This format is to be removed in 8.0 - : response.body.hits.total?.value; - const hits = response.body.hits.hits; +export type { + UpdateAndPickupMappingsResponse, + UpdateAndPickupMappingsParams, +} from './update_and_pickup_mappings'; +export { updateAndPickupMappings } from './update_and_pickup_mappings'; - if (hits.length > 0) { - return Either.right({ - // @ts-expect-error @elastic/elasticsearch _source is optional - outdatedDocuments: hits as SavedObjectsRawDoc[], - lastHitSortValue: hits[hits.length - 1].sort as number[], - totalHits, - }); - } +export { waitForPickupUpdatedMappingsTask } from './wait_for_pickup_updated_mappings_task'; - return Either.right({ - outdatedDocuments: [], - lastHitSortValue: undefined, - totalHits, - }); - }) - .catch(catchRetryableEsClientErrors); -}; +export type { + SearchResponse, + SearchForOutdatedDocumentsOptions, +} from './search_for_outdated_documents'; +export { searchForOutdatedDocuments } from './search_for_outdated_documents'; -/** @internal */ -export interface ClosePitParams { - client: ElasticsearchClient; - pitId: string; -} -/* - * Closes PIT. - * See https://www.elastic.co/guide/en/elasticsearch/reference/current/point-in-time-api.html - * */ -export const closePit = ({ - client, - pitId, -}: ClosePitParams): TaskEither.TaskEither => () => { - return client - .closePointInTime({ - body: { id: pitId }, - }) - .then((response) => { - if (!response.body.succeeded) { - throw new Error(`Failed to close PointInTime with id: ${pitId}`); - } - return Either.right({}); - }) - .catch(catchRetryableEsClientErrors); -}; +export type { BulkOverwriteTransformedDocumentsParams } from './bulk_overwrite_transformed_documents'; +export { bulkOverwriteTransformedDocuments } from './bulk_overwrite_transformed_documents'; -/** @internal */ -export interface TransformDocsParams { - transformRawDocs: TransformRawDocs; - outdatedDocuments: SavedObjectsRawDoc[]; -} -/* - * Transform outdated docs - * */ -export const transformDocs = ({ - transformRawDocs, - outdatedDocuments, -}: TransformDocsParams): TaskEither.TaskEither< - DocumentsTransformFailed, - DocumentsTransformSuccess -> => transformRawDocs(outdatedDocuments); +export { pickupUpdatedMappings, waitForTask, waitForIndexStatusYellow }; +export type { AliasNotFound, RemoveIndexNotAConcreteIndex }; -/** @internal */ -export interface ReindexResponse { - taskId: string; -} - -/** @internal */ -export interface RefreshIndexParams { - client: ElasticsearchClient; - targetIndex: string; -} -/** - * Wait for Elasticsearch to reindex all the changes. - */ -export const refreshIndex = ({ - client, - targetIndex, -}: RefreshIndexParams): TaskEither.TaskEither< - RetryableEsClientError, - { refreshed: boolean } -> => () => { - return client.indices - .refresh({ - index: targetIndex, - }) - .then(() => { - return Either.right({ refreshed: true }); - }) - .catch(catchRetryableEsClientErrors); -}; -/** @internal */ -export interface ReindexParams { - client: ElasticsearchClient; - sourceIndex: string; - targetIndex: string; - reindexScript: Option.Option; - requireAlias: boolean; - /* When reindexing we use a source query to exclude saved objects types which - * are no longer used. These saved objects will still be kept in the outdated - * index for backup purposes, but won't be available in the upgraded index. - */ - unusedTypesQuery: estypes.QueryContainer; +export interface IndexNotFound { + type: 'index_not_found_exception'; + index: string; } -/** - * Reindex documents from the `sourceIndex` into the `targetIndex`. Returns a - * task ID which can be tracked for progress. - * - * @remarks This action is idempotent allowing several Kibana instances to run - * this in parallel. By using `op_type: 'create', conflicts: 'proceed'` there - * will be only one write per reindexed document. - */ -export const reindex = ({ - client, - sourceIndex, - targetIndex, - reindexScript, - requireAlias, - unusedTypesQuery, -}: ReindexParams): TaskEither.TaskEither => () => { - return client - .reindex({ - // Require targetIndex to be an alias. Prevents a new index from being - // created if targetIndex doesn't exist. - require_alias: requireAlias, - body: { - // Ignore version conflicts from existing documents - conflicts: 'proceed', - source: { - index: sourceIndex, - // Set reindex batch size - size: BATCH_SIZE, - // Exclude saved object types - query: unusedTypesQuery, - }, - dest: { - index: targetIndex, - // Don't override existing documents, only create if missing - op_type: 'create', - }, - script: Option.fold( - () => undefined, - (script) => ({ - source: script, - lang: 'painless', - }) - )(reindexScript), - }, - // force a refresh so that we can query the target index - refresh: true, - // Create a task and return task id instead of blocking until complete - wait_for_completion: false, - }) - .then(({ body: { task: taskId } }) => { - return Either.right({ taskId: String(taskId) }); - }) - .catch(catchRetryableEsClientErrors); -}; - -interface WaitForReindexTaskFailure { +export interface WaitForReindexTaskFailure { readonly cause: { type: string; reason: string }; } - -/** @internal */ export interface TargetIndexHadWriteBlock { type: 'target_index_had_write_block'; } -/** @internal */ -export interface IncompatibleMappingException { - type: 'incompatible_mapping_exception'; -} - -export const waitForReindexTask = flow( - waitForTask, - TaskEither.chain( - ( - res - ): TaskEither.TaskEither< - | IndexNotFound - | TargetIndexHadWriteBlock - | IncompatibleMappingException - | RetryableEsClientError - | WaitForTaskCompletionTimeout, - 'reindex_succeeded' - > => { - const failureIsAWriteBlock = ({ cause: { type, reason } }: WaitForReindexTaskFailure) => - type === 'cluster_block_exception' && - reason.match(/index \[.+] blocked by: \[FORBIDDEN\/8\/index write \(api\)\]/); - - const failureIsIncompatibleMappingException = ({ - cause: { type, reason }, - }: WaitForReindexTaskFailure) => - type === 'strict_dynamic_mapping_exception' || type === 'mapper_parsing_exception'; - - if (Option.isSome(res.error)) { - if (res.error.value.type === 'index_not_found_exception') { - return TaskEither.left({ - type: 'index_not_found_exception' as const, - index: res.error.value.index, - }); - } else { - throw new Error('Reindex failed with the following error:\n' + JSON.stringify(res.error)); - } - } else if (Option.isSome(res.failures)) { - if (res.failures.value.every(failureIsAWriteBlock)) { - return TaskEither.left({ type: 'target_index_had_write_block' as const }); - } else if (res.failures.value.every(failureIsIncompatibleMappingException)) { - return TaskEither.left({ type: 'incompatible_mapping_exception' as const }); - } else { - throw new Error( - 'Reindex failed with the following failures:\n' + JSON.stringify(res.failures.value) - ); - } - } else { - return TaskEither.right('reindex_succeeded' as const); - } - } - ) -); - -/** @internal */ -export interface VerifyReindexParams { - client: ElasticsearchClient; - sourceIndex: string; - targetIndex: string; -} - -export const verifyReindex = ({ - client, - sourceIndex, - targetIndex, -}: VerifyReindexParams): TaskEither.TaskEither< - RetryableEsClientError | { type: 'verify_reindex_failed' }, - 'verify_reindex_succeeded' -> => () => { - const count = (index: string) => - client - .count<{ count: number }>({ - index, - // Return an error when targeting missing or closed indices - allow_no_indices: false, - }) - .then((res) => { - return res.body.count; - }); - - return Promise.all([count(sourceIndex), count(targetIndex)]) - .then(([sourceCount, targetCount]) => { - if (targetCount >= sourceCount) { - return Either.right('verify_reindex_succeeded' as const); - } else { - return Either.left({ type: 'verify_reindex_failed' as const }); - } - }) - .catch(catchRetryableEsClientErrors); -}; - -export const waitForPickupUpdatedMappingsTask = flow( - waitForTask, - TaskEither.chain( - ( - res - ): TaskEither.TaskEither< - RetryableEsClientError | WaitForTaskCompletionTimeout, - 'pickup_updated_mappings_succeeded' - > => { - // We don't catch or type failures/errors because they should never - // occur in our migration algorithm and we don't have any business logic - // for dealing with it. If something happens we'll just crash and try - // again. - if (Option.isSome(res.failures)) { - throw new Error( - 'pickupUpdatedMappings task failed with the following failures:\n' + - JSON.stringify(res.failures.value) - ); - } else if (Option.isSome(res.error)) { - throw new Error( - 'pickupUpdatedMappings task failed with the following error:\n' + - JSON.stringify(res.error.value) - ); - } else { - return TaskEither.right('pickup_updated_mappings_succeeded' as const); - } - } - ) -); -export interface AliasNotFound { - type: 'alias_not_found_exception'; -} - -/** @internal */ -export interface RemoveIndexNotAConcreteIndex { - type: 'remove_index_not_a_concrete_index'; -} - -/** @internal */ -export type AliasAction = - | { remove_index: { index: string } } - | { remove: { index: string; alias: string; must_exist: boolean } } - | { add: { index: string; alias: string } }; - -/** @internal */ -export interface UpdateAliasesParams { - client: ElasticsearchClient; - aliasActions: AliasAction[]; -} -/** - * Calls the Update index alias API `_alias` with the provided alias actions. - */ -export const updateAliases = ({ - client, - aliasActions, -}: UpdateAliasesParams): TaskEither.TaskEither< - IndexNotFound | AliasNotFound | RemoveIndexNotAConcreteIndex | RetryableEsClientError, - 'update_aliases_succeeded' -> => () => { - return client.indices - .updateAliases( - { - body: { - actions: aliasActions, - }, - }, - { maxRetries: 0 } - ) - .then(() => { - // Ignore `acknowledged: false`. When the coordinating node accepts - // the new cluster state update but not all nodes have applied the - // update within the timeout `acknowledged` will be false. However, - // retrying this update will always immediately result in `acknowledged: - // true` even if there are still nodes which are falling behind with - // cluster state updates. - // The only impact for using `updateAliases` to mark the version index - // as ready is that it could take longer for other Kibana instances to - // see that the version index is ready so they are more likely to - // perform unecessary duplicate work. - return Either.right('update_aliases_succeeded' as const); - }) - .catch((err: EsErrors.ElasticsearchClientError) => { - if (err instanceof EsErrors.ResponseError) { - if (err?.body?.error?.type === 'index_not_found_exception') { - return Either.left({ - type: 'index_not_found_exception' as const, - index: err.body.error.index, - }); - } else if ( - err?.body?.error?.type === 'illegal_argument_exception' && - err?.body?.error?.reason?.match( - /The provided expression \[.+\] matches an alias, specify the corresponding concrete indices instead./ - ) - ) { - return Either.left({ type: 'remove_index_not_a_concrete_index' as const }); - } else if ( - err?.body?.error?.type === 'aliases_not_found_exception' || - (err?.body?.error?.type === 'resource_not_found_exception' && - err?.body?.error?.reason?.match(/required alias \[.+\] does not exist/)) - ) { - return Either.left({ - type: 'alias_not_found_exception' as const, - }); - } - } - throw err; - }) - .catch(catchRetryableEsClientErrors); -}; - /** @internal */ export interface AcknowledgeResponse { acknowledged: boolean; shardsAcknowledged: boolean; } - -function aliasArrayToRecord(aliases: string[]): Record { - const result: Record = {}; - for (const alias of aliases) { - result[alias] = {}; - } - return result; -} - -/** @internal */ -export interface CreateIndexParams { - client: ElasticsearchClient; - indexName: string; - mappings: IndexMapping; - aliases?: string[]; -} -/** - * Creates an index with the given mappings - * - * @remarks - * This method adds some additional logic to the ES create index API: - * - it is idempotent, if it gets called multiple times subsequent calls will - * wait for the first create operation to complete (up to 60s) - * - the first call will wait up to 120s for the cluster state and all shards - * to be updated. - */ -export const createIndex = ({ - client, - indexName, - mappings, - aliases = [], -}: CreateIndexParams): TaskEither.TaskEither => { - const createIndexTask: TaskEither.TaskEither< - RetryableEsClientError, - AcknowledgeResponse - > = () => { - const aliasesObject = aliasArrayToRecord(aliases); - - return client.indices - .create( - { - index: indexName, - // wait until all shards are available before creating the index - // (since number_of_shards=1 this does not have any effect atm) - wait_for_active_shards: WAIT_FOR_ALL_SHARDS_TO_BE_ACTIVE, - // Wait up to 60s for the cluster state to update and all shards to be - // started - timeout: DEFAULT_TIMEOUT, - body: { - mappings, - aliases: aliasesObject, - settings: { - index: { - // ES rule of thumb: shards should be several GB to 10's of GB, so - // Kibana is unlikely to cross that limit. - number_of_shards: 1, - auto_expand_replicas: INDEX_AUTO_EXPAND_REPLICAS, - // Set an explicit refresh interval so that we don't inherit the - // value from incorrectly configured index templates (not required - // after we adopt system indices) - refresh_interval: '1s', - // Bump priority so that recovery happens before newer indices - priority: 10, - }, - }, - }, - }, - { maxRetries: 0 /** handle retry ourselves for now */ } - ) - .then((res) => { - /** - * - acknowledged=false, we timed out before the cluster state was - * updated on all nodes with the newly created index, but it - * probably will be created sometime soon. - * - shards_acknowledged=false, we timed out before all shards were - * started - * - acknowledged=true, shards_acknowledged=true, index creation complete - */ - return Either.right({ - acknowledged: res.body.acknowledged, - shardsAcknowledged: res.body.shards_acknowledged, - }); - }) - .catch((error) => { - if (error?.body?.error?.type === 'resource_already_exists_exception') { - /** - * If the target index already exists it means a previous create - * operation had already been started. However, we can't be sure - * that all shards were started so return shardsAcknowledged: false - */ - return Either.right({ - acknowledged: true, - shardsAcknowledged: false, - }); - } else { - throw error; - } - }) - .catch(catchRetryableEsClientErrors); - }; - - return pipe( - createIndexTask, - TaskEither.chain((res) => { - if (res.acknowledged && res.shardsAcknowledged) { - // If the cluster state was updated and all shards ackd we're done - return TaskEither.right('create_index_succeeded'); - } else { - // Otherwise, wait until the target index has a 'yellow' status. - return pipe( - waitForIndexStatusYellow({ client, index: indexName, timeout: DEFAULT_TIMEOUT }), - TaskEither.map(() => { - /** When the index status is 'yellow' we know that all shards were started */ - return 'create_index_succeeded'; - }) - ); - } - }) - ); -}; - -/** @internal */ -export interface UpdateAndPickupMappingsResponse { - taskId: string; -} - -/** @internal */ -export interface UpdateAndPickupMappingsParams { - client: ElasticsearchClient; - index: string; - mappings: IndexMapping; -} -/** - * Updates an index's mappings and runs an pickupUpdatedMappings task so that the mapping - * changes are "picked up". Returns a taskId to track progress. - */ -export const updateAndPickupMappings = ({ - client, - index, - mappings, -}: UpdateAndPickupMappingsParams): TaskEither.TaskEither< - RetryableEsClientError, - UpdateAndPickupMappingsResponse -> => { - const putMappingTask: TaskEither.TaskEither< - RetryableEsClientError, - 'update_mappings_succeeded' - > = () => { - return client.indices - .putMapping({ - index, - timeout: DEFAULT_TIMEOUT, - body: mappings, - }) - .then((res) => { - // Ignore `acknowledged: false`. When the coordinating node accepts - // the new cluster state update but not all nodes have applied the - // update within the timeout `acknowledged` will be false. However, - // retrying this update will always immediately result in `acknowledged: - // true` even if there are still nodes which are falling behind with - // cluster state updates. - // For updateAndPickupMappings this means that there is the potential - // that some existing document's fields won't be picked up if the node - // on which the Kibana shard is running has fallen behind with cluster - // state updates and the mapping update wasn't applied before we run - // `pickupUpdatedMappings`. ES tries to limit this risk by blocking - // index operations (including update_by_query used by - // updateAndPickupMappings) if there are pending mappings changes. But - // not all mapping changes will prevent this. - return Either.right('update_mappings_succeeded' as const); - }) - .catch(catchRetryableEsClientErrors); - }; - - return pipe( - putMappingTask, - TaskEither.chain((res) => { - return pickupUpdatedMappings(client, index); - }) - ); -}; - -/** @internal */ -export interface SearchResponse { - outdatedDocuments: SavedObjectsRawDoc[]; -} - -interface SearchForOutdatedDocumentsOptions { - batchSize: number; - targetIndex: string; - outdatedDocumentsQuery?: estypes.QueryContainer; +// Map of left response 'type' string -> response interface +export interface ActionErrorTypeMap { + wait_for_task_completion_timeout: WaitForTaskCompletionTimeout; + retryable_es_client_error: RetryableEsClientError; + index_not_found_exception: IndexNotFound; + target_index_had_write_block: TargetIndexHadWriteBlock; + incompatible_mapping_exception: IncompatibleMappingException; + alias_not_found_exception: AliasNotFound; + remove_index_not_a_concrete_index: RemoveIndexNotAConcreteIndex; + documents_transform_failed: DocumentsTransformFailed; } /** - * Search for outdated saved object documents with the provided query. Will - * return one batch of documents. Searching should be repeated until no more - * outdated documents can be found. - * - * Used for testing only + * Type guard for narrowing the type of a left */ -export const searchForOutdatedDocuments = ( - client: ElasticsearchClient, - options: SearchForOutdatedDocumentsOptions -): TaskEither.TaskEither => () => { - return client - .search({ - index: options.targetIndex, - // Return the _seq_no and _primary_term so we can use optimistic - // concurrency control for updates - seq_no_primary_term: true, - size: options.batchSize, - body: { - query: options.outdatedDocumentsQuery, - // Optimize search performance by sorting by the "natural" index order - sort: ['_doc'], - }, - // Return an error when targeting missing or closed indices - allow_no_indices: false, - // Don't return partial results if timeouts or shard failures are - // encountered. This is important because 0 search hits is interpreted as - // there being no more outdated documents left that require - // transformation. Although the default is `false`, we set this - // explicitly to avoid users overriding the - // search.default_allow_partial_results cluster setting to true. - allow_partial_search_results: false, - // Improve performance by not calculating the total number of hits - // matching the query. - track_total_hits: false, - // Reduce the response payload size by only returning the data we care about - filter_path: [ - 'hits.hits._id', - 'hits.hits._source', - 'hits.hits._seq_no', - 'hits.hits._primary_term', - ], - }) - .then((res) => - Either.right({ outdatedDocuments: (res.body.hits?.hits as SavedObjectsRawDoc[]) ?? [] }) - ) - .catch(catchRetryableEsClientErrors); -}; - -/** @internal */ -export interface BulkOverwriteTransformedDocumentsParams { - client: ElasticsearchClient; - index: string; - transformedDocs: SavedObjectsRawDoc[]; - refresh?: estypes.Refresh; +export function isLeftTypeof( + res: any, + typeString: T +): res is ActionErrorTypeMap[T] { + return res.type === typeString; } -/** - * Write the up-to-date transformed documents to the index, overwriting any - * documents that are still on their outdated version. - */ -export const bulkOverwriteTransformedDocuments = ({ - client, - index, - transformedDocs, - refresh = false, -}: BulkOverwriteTransformedDocumentsParams): TaskEither.TaskEither< - RetryableEsClientError, - 'bulk_index_succeeded' -> => () => { - return client - .bulk({ - // Because we only add aliases in the MARK_VERSION_INDEX_READY step we - // can't bulkIndex to an alias with require_alias=true. This means if - // users tamper during this operation (delete indices or restore a - // snapshot), we could end up auto-creating an index without the correct - // mappings. Such tampering could lead to many other problems and is - // probably unlikely so for now we'll accept this risk and wait till - // system indices puts in place a hard control. - require_alias: false, - wait_for_active_shards: WAIT_FOR_ALL_SHARDS_TO_BE_ACTIVE, - refresh, - filter_path: ['items.*.error'], - body: transformedDocs.flatMap((doc) => { - return [ - { - index: { - _index: index, - _id: doc._id, - // overwrite existing documents - op_type: 'index', - // use optimistic concurrency control to ensure that outdated - // documents are only overwritten once with the latest version - if_seq_no: doc._seq_no, - if_primary_term: doc._primary_term, - }, - }, - doc._source, - ]; - }), - }) - .then((res) => { - // Filter out version_conflict_engine_exception since these just mean - // that another instance already updated these documents - const errors = (res.body.items ?? []).filter( - (item) => item.index?.error?.type !== 'version_conflict_engine_exception' - ); - if (errors.length === 0) { - return Either.right('bulk_index_succeeded' as const); - } else { - throw new Error(JSON.stringify(errors)); - } - }) - .catch(catchRetryableEsClientErrors); -}; diff --git a/src/core/server/saved_objects/migrationsv2/integration_tests/actions.test.ts b/src/core/server/saved_objects/migrationsv2/actions/integration_tests/actions.test.ts similarity index 97% rename from src/core/server/saved_objects/migrationsv2/integration_tests/actions.test.ts rename to src/core/server/saved_objects/migrationsv2/actions/integration_tests/actions.test.ts index 67a2685caf3d61..3fa4d59e383bfa 100644 --- a/src/core/server/saved_objects/migrationsv2/integration_tests/actions.test.ts +++ b/src/core/server/saved_objects/migrationsv2/actions/integration_tests/actions.test.ts @@ -6,11 +6,11 @@ * Side Public License, v 1. */ -import { ElasticsearchClient } from '../../../'; -import { InternalCoreStart } from '../../../internal_types'; -import * as kbnTestServer from '../../../../test_helpers/kbn_server'; -import { Root } from '../../../root'; -import { SavedObjectsRawDoc } from '../../serialization'; +import { ElasticsearchClient } from '../../../../'; +import { InternalCoreStart } from '../../../../internal_types'; +import * as kbnTestServer from '../../../../../test_helpers/kbn_server'; +import { Root } from '../../../../root'; +import { SavedObjectsRawDoc } from '../../../serialization'; import { bulkOverwriteTransformedDocuments, cloneIndex, @@ -37,11 +37,11 @@ import { removeWriteBlock, transformDocs, waitForIndexStatusYellow, -} from '../actions'; +} from '../../actions'; import * as Either from 'fp-ts/lib/Either'; import * as Option from 'fp-ts/lib/Option'; import { ResponseError } from '@elastic/elasticsearch/lib/errors'; -import { DocumentsTransformFailed, DocumentsTransformSuccess } from '../../migrations/core'; +import { DocumentsTransformFailed, DocumentsTransformSuccess } from '../../../migrations/core'; import { TaskEither } from 'fp-ts/lib/TaskEither'; const { startES } = kbnTestServer.createTestServers({ @@ -242,9 +242,7 @@ describe('migration actions', () => { it('rejects if there is a non-retryable error', async () => { expect.assertions(1); const task = removeWriteBlock({ client, index: 'no_such_index' }); - await expect(task()).rejects.toMatchInlineSnapshot( - `[ResponseError: index_not_found_exception]` - ); + await expect(task()).rejects.toThrow('index_not_found_exception'); }); }); @@ -264,7 +262,7 @@ describe('migration actions', () => { // Allocate 1 replica so that this index stays yellow number_of_replicas: '1', // Disable all shard allocation so that the index status is red - index: { routing: { allocation: { enable: 'none' } } }, + routing: { allocation: { enable: 'none' } }, }, }, }, @@ -284,7 +282,7 @@ describe('migration actions', () => { index: 'red_then_yellow_index', body: { // Enable all shard allocation so that the index status turns yellow - index: { routing: { allocation: { enable: 'all' } } }, + settings: { routing: { allocation: { enable: 'all' } } }, }, }); @@ -354,7 +352,7 @@ describe('migration actions', () => { index: 'clone_red_then_yellow_index', body: { // Enable all shard allocation so that the index status goes yellow - index: { routing: { allocation: { enable: 'all' } } }, + settings: { routing: { allocation: { enable: 'all' } } }, }, }); indexYellow = true; @@ -859,9 +857,7 @@ describe('migration actions', () => { sourceIndex: 'no_such_index', targetIndex: 'existing_index_2', }); - await expect(task()).rejects.toMatchInlineSnapshot( - `[ResponseError: index_not_found_exception]` - ); + await expect(task()).rejects.toThrow('index_not_found_exception'); task = verifyReindex({ client, @@ -1142,10 +1138,7 @@ describe('migration actions', () => { timeout: '10s', }); - await expect(task()).rejects.toMatchInlineSnapshot(` - [Error: pickupUpdatedMappings task failed with the following error: - {"type":"index_not_found_exception","reason":"no such index [no_such_index]","resource.type":"index_or_alias","resource.id":"no_such_index","index_uuid":"_na_","index":"no_such_index"}] - `); + await expect(task()).rejects.toThrow('index_not_found_exception'); }); it('resolves left wait_for_task_completion_timeout when the task does not complete within the timeout', async () => { const res = (await pickupUpdatedMappings( @@ -1433,7 +1426,7 @@ describe('migration actions', () => { index: 'red_then_yellow_index', body: { // Disable all shard allocation so that the index status is red - index: { routing: { allocation: { enable: 'all' } } }, + settings: { routing: { allocation: { enable: 'all' } } }, }, }); indexYellow = true; @@ -1455,7 +1448,7 @@ describe('migration actions', () => { // failure await expect( createIndex({ client, indexName: 'existing_index_2_alias', mappings: undefined as any })() - ).rejects.toMatchInlineSnapshot(`[ResponseError: invalid_index_name_exception]`); + ).rejects.toThrow('invalid_index_name_exception'); }); }); diff --git a/src/core/server/saved_objects/migrationsv2/actions/open_pit.test.ts b/src/core/server/saved_objects/migrationsv2/actions/open_pit.test.ts new file mode 100644 index 00000000000000..c8fc29d06f42f7 --- /dev/null +++ b/src/core/server/saved_objects/migrationsv2/actions/open_pit.test.ts @@ -0,0 +1,40 @@ +/* + * 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 { catchRetryableEsClientErrors } from './catch_retryable_es_client_errors'; +import { errors as EsErrors } from '@elastic/elasticsearch'; +jest.mock('./catch_retryable_es_client_errors'); +import { elasticsearchClientMock } from '../../../elasticsearch/client/mocks'; +import { openPit } from './open_pit'; + +describe('openPit', () => { + beforeEach(() => { + jest.clearAllMocks(); + }); + + // Create a mock client that rejects all methods with a 503 status code + // response. + const retryableError = new EsErrors.ResponseError( + elasticsearchClientMock.createApiResponse({ + statusCode: 503, + body: { error: { type: 'es_type', reason: 'es_reason' } }, + }) + ); + const client = elasticsearchClientMock.createInternalClient( + elasticsearchClientMock.createErrorTransportRequestPromise(retryableError) + ); + it('calls catchRetryableEsClientErrors when the promise rejects', async () => { + const task = openPit({ client, index: 'my_index' }); + try { + await task(); + } catch (e) { + /** ignore */ + } + expect(catchRetryableEsClientErrors).toHaveBeenCalledWith(retryableError); + }); +}); diff --git a/src/core/server/saved_objects/migrationsv2/actions/open_pit.ts b/src/core/server/saved_objects/migrationsv2/actions/open_pit.ts new file mode 100644 index 00000000000000..e740dc00ac27ea --- /dev/null +++ b/src/core/server/saved_objects/migrationsv2/actions/open_pit.ts @@ -0,0 +1,43 @@ +/* + * 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 * as Either from 'fp-ts/lib/Either'; +import * as TaskEither from 'fp-ts/lib/TaskEither'; +import { ElasticsearchClient } from '../../../elasticsearch'; +import { + catchRetryableEsClientErrors, + RetryableEsClientError, +} from './catch_retryable_es_client_errors'; +/** @internal */ +export interface OpenPitResponse { + pitId: string; +} + +/** @internal */ +export interface OpenPitParams { + client: ElasticsearchClient; + index: string; +} +// how long ES should keep PIT alive +export const pitKeepAlive = '10m'; +/* + * Creates a lightweight view of data when the request has been initiated. + * See https://www.elastic.co/guide/en/elasticsearch/reference/current/point-in-time-api.html + * */ +export const openPit = ({ + client, + index, +}: OpenPitParams): TaskEither.TaskEither => () => { + return client + .openPointInTime({ + index, + keep_alive: pitKeepAlive, + }) + .then((response) => Either.right({ pitId: response.body.id })) + .catch(catchRetryableEsClientErrors); +}; diff --git a/src/core/server/saved_objects/migrationsv2/actions/pickup_updated_mappings.test.ts b/src/core/server/saved_objects/migrationsv2/actions/pickup_updated_mappings.test.ts new file mode 100644 index 00000000000000..e319d4149dd1af --- /dev/null +++ b/src/core/server/saved_objects/migrationsv2/actions/pickup_updated_mappings.test.ts @@ -0,0 +1,39 @@ +/* + * 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 { errors as EsErrors } from '@elastic/elasticsearch'; +import { catchRetryableEsClientErrors } from './catch_retryable_es_client_errors'; +jest.mock('./catch_retryable_es_client_errors'); +import { elasticsearchClientMock } from '../../../elasticsearch/client/mocks'; +import { pickupUpdatedMappings } from './pickup_updated_mappings'; + +describe('pickupUpdatedMappings', () => { + beforeEach(() => { + jest.clearAllMocks(); + }); + + // Create a mock client that rejects all methods with a 503 status code + // response. + const retryableError = new EsErrors.ResponseError( + elasticsearchClientMock.createApiResponse({ + statusCode: 503, + body: { error: { type: 'es_type', reason: 'es_reason' } }, + }) + ); + const client = elasticsearchClientMock.createInternalClient( + elasticsearchClientMock.createErrorTransportRequestPromise(retryableError) + ); + it('calls catchRetryableEsClientErrors when the promise rejects', async () => { + const task = pickupUpdatedMappings(client, 'my_index'); + try { + await task(); + } catch (e) { + /** ignore */ + } + expect(catchRetryableEsClientErrors).toHaveBeenCalledWith(retryableError); + }); +}); diff --git a/src/core/server/saved_objects/migrationsv2/actions/pickup_updated_mappings.ts b/src/core/server/saved_objects/migrationsv2/actions/pickup_updated_mappings.ts new file mode 100644 index 00000000000000..8cc609e5277bcc --- /dev/null +++ b/src/core/server/saved_objects/migrationsv2/actions/pickup_updated_mappings.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 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 * as Either from 'fp-ts/lib/Either'; +import * as TaskEither from 'fp-ts/lib/TaskEither'; +import { ElasticsearchClient } from '../../../elasticsearch'; +import { + catchRetryableEsClientErrors, + RetryableEsClientError, +} from './catch_retryable_es_client_errors'; +import { BATCH_SIZE } from './constants'; +export interface UpdateByQueryResponse { + taskId: string; +} + +/** + * Pickup updated mappings by performing an update by query operation on all + * documents in the index. Returns a task ID which can be + * tracked for progress. + * + * @remarks When mappings are updated to add a field which previously wasn't + * mapped Elasticsearch won't automatically add existing documents to it's + * internal search indices. So search results on this field won't return any + * existing documents. By running an update by query we essentially refresh + * these the internal search indices for all existing documents. + * This action uses `conflicts: 'proceed'` allowing several Kibana instances + * to run this in parallel. + */ +export const pickupUpdatedMappings = ( + client: ElasticsearchClient, + index: string +): TaskEither.TaskEither => () => { + return client + .updateByQuery({ + // Ignore version conflicts that can occur from parallel update by query operations + conflicts: 'proceed', + // Return an error when targeting missing or closed indices + allow_no_indices: false, + index, + // How many documents to update per batch + scroll_size: BATCH_SIZE, + // force a refresh so that we can query the updated index immediately + // after the operation completes + refresh: true, + // Create a task and return task id instead of blocking until complete + wait_for_completion: false, + }) + .then(({ body: { task: taskId } }) => { + return Either.right({ taskId: String(taskId!) }); + }) + .catch(catchRetryableEsClientErrors); +}; diff --git a/src/core/server/saved_objects/migrationsv2/actions/read_with_pit.test.ts b/src/core/server/saved_objects/migrationsv2/actions/read_with_pit.test.ts new file mode 100644 index 00000000000000..0d8d76b45a57b3 --- /dev/null +++ b/src/core/server/saved_objects/migrationsv2/actions/read_with_pit.test.ts @@ -0,0 +1,45 @@ +/* + * 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 { catchRetryableEsClientErrors } from './catch_retryable_es_client_errors'; +import { errors as EsErrors } from '@elastic/elasticsearch'; +jest.mock('./catch_retryable_es_client_errors'); +import { elasticsearchClientMock } from '../../../elasticsearch/client/mocks'; +import { readWithPit } from './read_with_pit'; + +describe('readWithPit', () => { + beforeEach(() => { + jest.clearAllMocks(); + }); + + // Create a mock client that rejects all methods with a 503 status code + // response. + const retryableError = new EsErrors.ResponseError( + elasticsearchClientMock.createApiResponse({ + statusCode: 503, + body: { error: { type: 'es_type', reason: 'es_reason' } }, + }) + ); + const client = elasticsearchClientMock.createInternalClient( + elasticsearchClientMock.createErrorTransportRequestPromise(retryableError) + ); + it('calls catchRetryableEsClientErrors when the promise rejects', async () => { + const task = readWithPit({ + client, + pitId: 'pitId', + query: { match_all: {} }, + batchSize: 10_000, + }); + try { + await task(); + } catch (e) { + /** ignore */ + } + expect(catchRetryableEsClientErrors).toHaveBeenCalledWith(retryableError); + }); +}); diff --git a/src/core/server/saved_objects/migrationsv2/actions/read_with_pit.ts b/src/core/server/saved_objects/migrationsv2/actions/read_with_pit.ts new file mode 100644 index 00000000000000..b101e7db0141ca --- /dev/null +++ b/src/core/server/saved_objects/migrationsv2/actions/read_with_pit.ts @@ -0,0 +1,92 @@ +/* + * 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 * as Either from 'fp-ts/lib/Either'; +import * as TaskEither from 'fp-ts/lib/TaskEither'; +import type { estypes } from '@elastic/elasticsearch'; +import { ElasticsearchClient } from '../../../elasticsearch'; +import type { SavedObjectsRawDoc } from '../../serialization'; +import { + catchRetryableEsClientErrors, + RetryableEsClientError, +} from './catch_retryable_es_client_errors'; +import { pitKeepAlive } from './open_pit'; + +/** @internal */ +export interface ReadWithPit { + outdatedDocuments: SavedObjectsRawDoc[]; + readonly lastHitSortValue: number[] | undefined; + readonly totalHits: number | undefined; +} + +/** @internal */ +export interface ReadWithPitParams { + client: ElasticsearchClient; + pitId: string; + query: estypes.QueryDslQueryContainer; + batchSize: number; + searchAfter?: number[]; + seqNoPrimaryTerm?: boolean; +} + +/* + * Requests documents from the index using PIT mechanism. + * */ +export const readWithPit = ({ + client, + pitId, + query, + batchSize, + searchAfter, + seqNoPrimaryTerm, +}: ReadWithPitParams): TaskEither.TaskEither => () => { + return client + .search({ + seq_no_primary_term: seqNoPrimaryTerm, + body: { + // Sort fields are required to use searchAfter + sort: { + // the most efficient option as order is not important for the migration + _shard_doc: { order: 'asc' }, + }, + pit: { id: pitId, keep_alive: pitKeepAlive }, + size: batchSize, + search_after: searchAfter, + /** + * We want to know how many documents we need to process so we can log the progress. + * But we also want to increase the performance of these requests, + * so we ask ES to report the total count only on the first request (when searchAfter does not exist) + */ + track_total_hits: typeof searchAfter === 'undefined', + query, + }, + }) + .then((response) => { + const totalHits = + typeof response.body.hits.total === 'number' + ? response.body.hits.total // This format is to be removed in 8.0 + : response.body.hits.total?.value; + const hits = response.body.hits.hits; + + if (hits.length > 0) { + return Either.right({ + // @ts-expect-error @elastic/elasticsearch _source is optional + outdatedDocuments: hits as SavedObjectsRawDoc[], + lastHitSortValue: hits[hits.length - 1].sort as number[], + totalHits, + }); + } + + return Either.right({ + outdatedDocuments: [], + lastHitSortValue: undefined, + totalHits, + }); + }) + .catch(catchRetryableEsClientErrors); +}; diff --git a/src/core/server/saved_objects/migrationsv2/actions/refresh_index.test.ts b/src/core/server/saved_objects/migrationsv2/actions/refresh_index.test.ts new file mode 100644 index 00000000000000..0ebdb2b2b18519 --- /dev/null +++ b/src/core/server/saved_objects/migrationsv2/actions/refresh_index.test.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 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 { catchRetryableEsClientErrors } from './catch_retryable_es_client_errors'; +import { errors as EsErrors } from '@elastic/elasticsearch'; +jest.mock('./catch_retryable_es_client_errors'); +import { elasticsearchClientMock } from '../../../elasticsearch/client/mocks'; +import { refreshIndex } from './refresh_index'; + +describe('refreshIndex', () => { + beforeEach(() => { + jest.clearAllMocks(); + }); + + // Create a mock client that rejects all methods with a 503 status code + // response. + const retryableError = new EsErrors.ResponseError( + elasticsearchClientMock.createApiResponse({ + statusCode: 503, + body: { error: { type: 'es_type', reason: 'es_reason' } }, + }) + ); + const client = elasticsearchClientMock.createInternalClient( + elasticsearchClientMock.createErrorTransportRequestPromise(retryableError) + ); + + it('calls catchRetryableEsClientErrors when the promise rejects', async () => { + const task = refreshIndex({ client, targetIndex: 'target_index' }); + try { + await task(); + } catch (e) { + /** ignore */ + } + + expect(catchRetryableEsClientErrors).toHaveBeenCalledWith(retryableError); + }); +}); diff --git a/src/core/server/saved_objects/migrationsv2/actions/refresh_index.ts b/src/core/server/saved_objects/migrationsv2/actions/refresh_index.ts new file mode 100644 index 00000000000000..e7bcbfb7d2d532 --- /dev/null +++ b/src/core/server/saved_objects/migrationsv2/actions/refresh_index.ts @@ -0,0 +1,40 @@ +/* + * 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 * as Either from 'fp-ts/lib/Either'; +import * as TaskEither from 'fp-ts/lib/TaskEither'; +import { ElasticsearchClient } from '../../../elasticsearch'; + +import { + catchRetryableEsClientErrors, + RetryableEsClientError, +} from './catch_retryable_es_client_errors'; + +/** @internal */ +export interface RefreshIndexParams { + client: ElasticsearchClient; + targetIndex: string; +} +/** + * Wait for Elasticsearch to reindex all the changes. + */ +export const refreshIndex = ({ + client, + targetIndex, +}: RefreshIndexParams): TaskEither.TaskEither< + RetryableEsClientError, + { refreshed: boolean } +> => () => { + return client.indices + .refresh({ + index: targetIndex, + }) + .then(() => { + return Either.right({ refreshed: true }); + }) + .catch(catchRetryableEsClientErrors); +}; diff --git a/src/core/server/saved_objects/migrationsv2/actions/reindex.test.ts b/src/core/server/saved_objects/migrationsv2/actions/reindex.test.ts new file mode 100644 index 00000000000000..f53368bd9321b6 --- /dev/null +++ b/src/core/server/saved_objects/migrationsv2/actions/reindex.test.ts @@ -0,0 +1,48 @@ +/* + * 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 * as Option from 'fp-ts/lib/Option'; +import { catchRetryableEsClientErrors } from './catch_retryable_es_client_errors'; +import { errors as EsErrors } from '@elastic/elasticsearch'; +jest.mock('./catch_retryable_es_client_errors'); +import { elasticsearchClientMock } from '../../../elasticsearch/client/mocks'; +import { reindex } from './reindex'; + +describe('reindex', () => { + beforeEach(() => { + jest.clearAllMocks(); + }); + + // Create a mock client that rejects all methods with a 503 status code + // response. + const retryableError = new EsErrors.ResponseError( + elasticsearchClientMock.createApiResponse({ + statusCode: 503, + body: { error: { type: 'es_type', reason: 'es_reason' } }, + }) + ); + const client = elasticsearchClientMock.createInternalClient( + elasticsearchClientMock.createErrorTransportRequestPromise(retryableError) + ); + + it('calls catchRetryableEsClientErrors when the promise rejects', async () => { + const task = reindex({ + client, + sourceIndex: 'my_source_index', + targetIndex: 'my_target_index', + reindexScript: Option.none, + requireAlias: false, + unusedTypesQuery: {}, + }); + try { + await task(); + } catch (e) { + /** ignore */ + } + expect(catchRetryableEsClientErrors).toHaveBeenCalledWith(retryableError); + }); +}); diff --git a/src/core/server/saved_objects/migrationsv2/actions/reindex.ts b/src/core/server/saved_objects/migrationsv2/actions/reindex.ts new file mode 100644 index 00000000000000..e9cfb4b61dace5 --- /dev/null +++ b/src/core/server/saved_objects/migrationsv2/actions/reindex.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 * as Either from 'fp-ts/lib/Either'; +import * as TaskEither from 'fp-ts/lib/TaskEither'; +import * as Option from 'fp-ts/lib/Option'; +import type { estypes } from '@elastic/elasticsearch'; +import { ElasticsearchClient } from '../../../elasticsearch'; +import { + catchRetryableEsClientErrors, + RetryableEsClientError, +} from './catch_retryable_es_client_errors'; +import { BATCH_SIZE } from './constants'; + +/** @internal */ +export interface ReindexResponse { + taskId: string; +} +/** @internal */ +export interface ReindexParams { + client: ElasticsearchClient; + sourceIndex: string; + targetIndex: string; + reindexScript: Option.Option; + requireAlias: boolean; + /* When reindexing we use a source query to exclude saved objects types which + * are no longer used. These saved objects will still be kept in the outdated + * index for backup purposes, but won't be available in the upgraded index. + */ + unusedTypesQuery: estypes.QueryDslQueryContainer; +} +/** + * Reindex documents from the `sourceIndex` into the `targetIndex`. Returns a + * task ID which can be tracked for progress. + * + * @remarks This action is idempotent allowing several Kibana instances to run + * this in parallel. By using `op_type: 'create', conflicts: 'proceed'` there + * will be only one write per reindexed document. + */ +export const reindex = ({ + client, + sourceIndex, + targetIndex, + reindexScript, + requireAlias, + unusedTypesQuery, +}: ReindexParams): TaskEither.TaskEither => () => { + return client + .reindex({ + // Require targetIndex to be an alias. Prevents a new index from being + // created if targetIndex doesn't exist. + require_alias: requireAlias, + body: { + // Ignore version conflicts from existing documents + conflicts: 'proceed', + source: { + index: sourceIndex, + // Set reindex batch size + size: BATCH_SIZE, + // Exclude saved object types + query: unusedTypesQuery, + }, + dest: { + index: targetIndex, + // Don't override existing documents, only create if missing + op_type: 'create', + }, + script: Option.fold( + () => undefined, + (script) => ({ + source: script, + lang: 'painless', + }) + )(reindexScript), + }, + // force a refresh so that we can query the target index + refresh: true, + // Create a task and return task id instead of blocking until complete + wait_for_completion: false, + }) + .then(({ body: { task: taskId } }) => { + return Either.right({ taskId: String(taskId) }); + }) + .catch(catchRetryableEsClientErrors); +}; diff --git a/src/core/server/saved_objects/migrationsv2/actions/remove_write_block.test.ts b/src/core/server/saved_objects/migrationsv2/actions/remove_write_block.test.ts new file mode 100644 index 00000000000000..497211cb693ab1 --- /dev/null +++ b/src/core/server/saved_objects/migrationsv2/actions/remove_write_block.test.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 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 { removeWriteBlock } from './remove_write_block'; +import { elasticsearchClientMock } from '../../../elasticsearch/client/mocks'; +import { catchRetryableEsClientErrors } from './catch_retryable_es_client_errors'; +import { errors as EsErrors } from '@elastic/elasticsearch'; +jest.mock('./catch_retryable_es_client_errors'); + +describe('removeWriteBlock', () => { + beforeEach(() => { + jest.clearAllMocks(); + }); + + // Create a mock client that rejects all methods with a 503 status code + // response. + const retryableError = new EsErrors.ResponseError( + elasticsearchClientMock.createApiResponse({ + statusCode: 503, + body: { error: { type: 'es_type', reason: 'es_reason' } }, + }) + ); + const client = elasticsearchClientMock.createInternalClient( + elasticsearchClientMock.createErrorTransportRequestPromise(retryableError) + ); + + const nonRetryableError = new Error('crash'); + const clientWithNonRetryableError = elasticsearchClientMock.createInternalClient( + elasticsearchClientMock.createErrorTransportRequestPromise(nonRetryableError) + ); + it('calls catchRetryableEsClientErrors when the promise rejects', async () => { + const task = removeWriteBlock({ client, index: 'my_index' }); + try { + await task(); + } catch (e) { + /** ignore */ + } + expect(catchRetryableEsClientErrors).toHaveBeenCalledWith(retryableError); + }); + it('re-throws non retry-able errors', async () => { + const task = removeWriteBlock({ + client: clientWithNonRetryableError, + index: 'my_index', + }); + await task(); + expect(catchRetryableEsClientErrors).toHaveBeenCalledWith(nonRetryableError); + }); +}); diff --git a/src/core/server/saved_objects/migrationsv2/actions/remove_write_block.ts b/src/core/server/saved_objects/migrationsv2/actions/remove_write_block.ts new file mode 100644 index 00000000000000..b5bf64d5c29f75 --- /dev/null +++ b/src/core/server/saved_objects/migrationsv2/actions/remove_write_block.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 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 * as Either from 'fp-ts/lib/Either'; +import * as TaskEither from 'fp-ts/lib/TaskEither'; +import { ElasticsearchClient } from '../../../elasticsearch'; +import { + catchRetryableEsClientErrors, + RetryableEsClientError, +} from './catch_retryable_es_client_errors'; + +/** @internal */ +export interface RemoveWriteBlockParams { + client: ElasticsearchClient; + index: string; +} +/** + * Removes a write block from an index + */ +export const removeWriteBlock = ({ + client, + index, +}: RemoveWriteBlockParams): TaskEither.TaskEither< + RetryableEsClientError, + 'remove_write_block_succeeded' +> => () => { + return client.indices + .putSettings<{ + acknowledged: boolean; + shards_acknowledged: boolean; + }>( + { + index, + // Don't change any existing settings + preserve_existing: true, + body: { + settings: { + blocks: { + write: false, + }, + }, + }, + }, + { maxRetries: 0 /** handle retry ourselves for now */ } + ) + .then((res) => { + return res.body.acknowledged === true + ? Either.right('remove_write_block_succeeded' as const) + : Either.left({ + type: 'retryable_es_client_error' as const, + message: 'remove_write_block_failed', + }); + }) + .catch(catchRetryableEsClientErrors); +}; diff --git a/src/core/server/saved_objects/migrationsv2/actions/search_for_outdated_documents.test.ts b/src/core/server/saved_objects/migrationsv2/actions/search_for_outdated_documents.test.ts new file mode 100644 index 00000000000000..ab133e9a564be7 --- /dev/null +++ b/src/core/server/saved_objects/migrationsv2/actions/search_for_outdated_documents.test.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 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 { catchRetryableEsClientErrors } from './catch_retryable_es_client_errors'; +import { errors as EsErrors } from '@elastic/elasticsearch'; +jest.mock('./catch_retryable_es_client_errors'); +import { elasticsearchClientMock } from '../../../elasticsearch/client/mocks'; +import { searchForOutdatedDocuments } from './search_for_outdated_documents'; + +describe('searchForOutdatedDocuments', () => { + beforeEach(() => { + jest.clearAllMocks(); + }); + + // Create a mock client that rejects all methods with a 503 status code + // response. + const retryableError = new EsErrors.ResponseError( + elasticsearchClientMock.createApiResponse({ + statusCode: 503, + body: { error: { type: 'es_type', reason: 'es_reason' } }, + }) + ); + const client = elasticsearchClientMock.createInternalClient( + elasticsearchClientMock.createErrorTransportRequestPromise(retryableError) + ); + it('calls catchRetryableEsClientErrors when the promise rejects', async () => { + const task = searchForOutdatedDocuments(client, { + batchSize: 1000, + targetIndex: 'new_index', + outdatedDocumentsQuery: {}, + }); + + try { + await task(); + } catch (e) { + /** ignore */ + } + + expect(catchRetryableEsClientErrors).toHaveBeenCalledWith(retryableError); + }); + + it('configures request according to given parameters', async () => { + const esClient = elasticsearchClientMock.createInternalClient(); + const query = {}; + const targetIndex = 'new_index'; + const batchSize = 1000; + const task = searchForOutdatedDocuments(esClient, { + batchSize, + targetIndex, + outdatedDocumentsQuery: query, + }); + + await task(); + + expect(esClient.search).toHaveBeenCalledTimes(1); + expect(esClient.search).toHaveBeenCalledWith( + expect.objectContaining({ + index: targetIndex, + size: batchSize, + body: expect.objectContaining({ query }), + }) + ); + }); +}); diff --git a/src/core/server/saved_objects/migrationsv2/actions/search_for_outdated_documents.ts b/src/core/server/saved_objects/migrationsv2/actions/search_for_outdated_documents.ts new file mode 100644 index 00000000000000..c27170a78245b2 --- /dev/null +++ b/src/core/server/saved_objects/migrationsv2/actions/search_for_outdated_documents.ts @@ -0,0 +1,77 @@ +/* + * 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 * as Either from 'fp-ts/lib/Either'; +import * as TaskEither from 'fp-ts/lib/TaskEither'; +import type { estypes } from '@elastic/elasticsearch'; +import { ElasticsearchClient } from '../../../elasticsearch'; +import type { SavedObjectsRawDoc, SavedObjectsRawDocSource } from '../../serialization'; +import { + catchRetryableEsClientErrors, + RetryableEsClientError, +} from './catch_retryable_es_client_errors'; + +/** @internal */ +export interface SearchResponse { + outdatedDocuments: SavedObjectsRawDoc[]; +} + +export interface SearchForOutdatedDocumentsOptions { + batchSize: number; + targetIndex: string; + outdatedDocumentsQuery?: estypes.QueryDslQueryContainer; +} + +/** + * Search for outdated saved object documents with the provided query. Will + * return one batch of documents. Searching should be repeated until no more + * outdated documents can be found. + * + * Used for testing only + */ +export const searchForOutdatedDocuments = ( + client: ElasticsearchClient, + options: SearchForOutdatedDocumentsOptions +): TaskEither.TaskEither => () => { + return client + .search({ + index: options.targetIndex, + // Return the _seq_no and _primary_term so we can use optimistic + // concurrency control for updates + seq_no_primary_term: true, + size: options.batchSize, + body: { + query: options.outdatedDocumentsQuery, + // Optimize search performance by sorting by the "natural" index order + sort: ['_doc'], + }, + // Return an error when targeting missing or closed indices + allow_no_indices: false, + // Don't return partial results if timeouts or shard failures are + // encountered. This is important because 0 search hits is interpreted as + // there being no more outdated documents left that require + // transformation. Although the default is `false`, we set this + // explicitly to avoid users overriding the + // search.default_allow_partial_results cluster setting to true. + allow_partial_search_results: false, + // Improve performance by not calculating the total number of hits + // matching the query. + track_total_hits: false, + // Reduce the response payload size by only returning the data we care about + filter_path: [ + 'hits.hits._id', + 'hits.hits._source', + 'hits.hits._seq_no', + 'hits.hits._primary_term', + ], + }) + .then((res) => + Either.right({ outdatedDocuments: (res.body.hits?.hits as SavedObjectsRawDoc[]) ?? [] }) + ) + .catch(catchRetryableEsClientErrors); +}; diff --git a/src/core/server/saved_objects/migrationsv2/actions/set_write_block.test.ts b/src/core/server/saved_objects/migrationsv2/actions/set_write_block.test.ts new file mode 100644 index 00000000000000..cf7b3091f38ffc --- /dev/null +++ b/src/core/server/saved_objects/migrationsv2/actions/set_write_block.test.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 { setWriteBlock } from './set_write_block'; +import { elasticsearchClientMock } from '../../../elasticsearch/client/mocks'; +import { catchRetryableEsClientErrors } from './catch_retryable_es_client_errors'; +import { errors as EsErrors } from '@elastic/elasticsearch'; +jest.mock('./catch_retryable_es_client_errors'); + +describe('setWriteBlock', () => { + beforeEach(() => { + jest.clearAllMocks(); + }); + + // Create a mock client that rejects all methods with a 503 status code + // response. + const retryableError = new EsErrors.ResponseError( + elasticsearchClientMock.createApiResponse({ + statusCode: 503, + body: { error: { type: 'es_type', reason: 'es_reason' } }, + }) + ); + const client = elasticsearchClientMock.createInternalClient( + elasticsearchClientMock.createErrorTransportRequestPromise(retryableError) + ); + + const nonRetryableError = new Error('crash'); + const clientWithNonRetryableError = elasticsearchClientMock.createInternalClient( + elasticsearchClientMock.createErrorTransportRequestPromise(nonRetryableError) + ); + it('calls catchRetryableEsClientErrors when the promise rejects', async () => { + const task = setWriteBlock({ client, index: 'my_index' }); + try { + await task(); + } catch (e) { + /** ignore */ + } + expect(catchRetryableEsClientErrors).toHaveBeenCalledWith(retryableError); + }); + it('re-throws non retry-able errors', async () => { + const task = setWriteBlock({ + client: clientWithNonRetryableError, + index: 'my_index', + }); + await task(); + expect(catchRetryableEsClientErrors).toHaveBeenCalledWith(nonRetryableError); + }); +}); diff --git a/src/core/server/saved_objects/migrationsv2/actions/set_write_block.ts b/src/core/server/saved_objects/migrationsv2/actions/set_write_block.ts new file mode 100644 index 00000000000000..5aed316306cf91 --- /dev/null +++ b/src/core/server/saved_objects/migrationsv2/actions/set_write_block.ts @@ -0,0 +1,73 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import type { ElasticsearchClientError } from '@elastic/elasticsearch/lib/errors'; +import * as Either from 'fp-ts/lib/Either'; +import * as TaskEither from 'fp-ts/lib/TaskEither'; +import { errors as EsErrors } from '@elastic/elasticsearch'; +import { ElasticsearchClient } from '../../../elasticsearch'; +import { + catchRetryableEsClientErrors, + RetryableEsClientError, +} from './catch_retryable_es_client_errors'; +import type { IndexNotFound } from './'; + +/** @internal */ +export interface SetWriteBlockParams { + client: ElasticsearchClient; + index: string; +} +/** + * Sets a write block in place for the given index. If the response includes + * `acknowledged: true` all in-progress writes have drained and no further + * writes to this index will be possible. + * + * The first time the write block is added to an index the response will + * include `shards_acknowledged: true` but once the block is in place, + * subsequent calls return `shards_acknowledged: false` + */ +export const setWriteBlock = ({ + client, + index, +}: SetWriteBlockParams): TaskEither.TaskEither< + IndexNotFound | RetryableEsClientError, + 'set_write_block_succeeded' +> => () => { + return ( + client.indices + .addBlock<{ + acknowledged: boolean; + shards_acknowledged: boolean; + }>( + { + index, + block: 'write', + }, + { maxRetries: 0 /** handle retry ourselves for now */ } + ) + // not typed yet + .then((res: any) => { + return res.body.acknowledged === true + ? Either.right('set_write_block_succeeded' as const) + : Either.left({ + type: 'retryable_es_client_error' as const, + message: 'set_write_block_failed', + }); + }) + .catch((e: ElasticsearchClientError) => { + if (e instanceof EsErrors.ResponseError) { + if (e.body?.error?.type === 'index_not_found_exception') { + return Either.left({ type: 'index_not_found_exception' as const, index }); + } + } + throw e; + }) + .catch(catchRetryableEsClientErrors) + ); +}; +// diff --git a/src/core/server/saved_objects/migrationsv2/actions/transform_docs.ts b/src/core/server/saved_objects/migrationsv2/actions/transform_docs.ts new file mode 100644 index 00000000000000..4c712afcff3a45 --- /dev/null +++ b/src/core/server/saved_objects/migrationsv2/actions/transform_docs.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 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 * as TaskEither from 'fp-ts/lib/TaskEither'; +import type { TransformRawDocs } from '../types'; +import type { SavedObjectsRawDoc } from '../../serialization'; +import { + DocumentsTransformFailed, + DocumentsTransformSuccess, +} from '../../migrations/core/migrate_raw_docs'; + +/** @internal */ +export interface TransformDocsParams { + transformRawDocs: TransformRawDocs; + outdatedDocuments: SavedObjectsRawDoc[]; +} +/* + * Transform outdated docs + * */ +export const transformDocs = ({ + transformRawDocs, + outdatedDocuments, +}: TransformDocsParams): TaskEither.TaskEither< + DocumentsTransformFailed, + DocumentsTransformSuccess +> => transformRawDocs(outdatedDocuments); diff --git a/src/core/server/saved_objects/migrationsv2/actions/update_aliases.test.ts b/src/core/server/saved_objects/migrationsv2/actions/update_aliases.test.ts new file mode 100644 index 00000000000000..e2ea07d40281bf --- /dev/null +++ b/src/core/server/saved_objects/migrationsv2/actions/update_aliases.test.ts @@ -0,0 +1,55 @@ +/* + * 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 { catchRetryableEsClientErrors } from './catch_retryable_es_client_errors'; +import { errors as EsErrors } from '@elastic/elasticsearch'; +jest.mock('./catch_retryable_es_client_errors'); +import { elasticsearchClientMock } from '../../../elasticsearch/client/mocks'; +import { updateAliases } from './update_aliases'; +import { setWriteBlock } from './set_write_block'; + +describe('updateAliases', () => { + beforeEach(() => { + jest.clearAllMocks(); + }); + + // Create a mock client that rejects all methods with a 503 status code + // response. + const retryableError = new EsErrors.ResponseError( + elasticsearchClientMock.createApiResponse({ + statusCode: 503, + body: { error: { type: 'es_type', reason: 'es_reason' } }, + }) + ); + const client = elasticsearchClientMock.createInternalClient( + elasticsearchClientMock.createErrorTransportRequestPromise(retryableError) + ); + + const nonRetryableError = new Error('crash'); + const clientWithNonRetryableError = elasticsearchClientMock.createInternalClient( + elasticsearchClientMock.createErrorTransportRequestPromise(nonRetryableError) + ); + it('calls catchRetryableEsClientErrors when the promise rejects', async () => { + const task = updateAliases({ client, aliasActions: [] }); + try { + await task(); + } catch (e) { + /** ignore */ + } + + expect(catchRetryableEsClientErrors).toHaveBeenCalledWith(retryableError); + }); + it('re-throws non retry-able errors', async () => { + const task = setWriteBlock({ + client: clientWithNonRetryableError, + index: 'my_index', + }); + await task(); + expect(catchRetryableEsClientErrors).toHaveBeenCalledWith(nonRetryableError); + }); +}); diff --git a/src/core/server/saved_objects/migrationsv2/actions/update_aliases.ts b/src/core/server/saved_objects/migrationsv2/actions/update_aliases.ts new file mode 100644 index 00000000000000..ffb8002f092123 --- /dev/null +++ b/src/core/server/saved_objects/migrationsv2/actions/update_aliases.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 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 * as Either from 'fp-ts/lib/Either'; +import * as TaskEither from 'fp-ts/lib/TaskEither'; +import { errors as EsErrors } from '@elastic/elasticsearch'; +import { ElasticsearchClient } from '../../../elasticsearch'; +import { + catchRetryableEsClientErrors, + RetryableEsClientError, +} from './catch_retryable_es_client_errors'; +import { IndexNotFound } from './index'; + +export interface AliasNotFound { + type: 'alias_not_found_exception'; +} + +/** @internal */ +export interface RemoveIndexNotAConcreteIndex { + type: 'remove_index_not_a_concrete_index'; +} + +/** @internal */ +export type AliasAction = + | { remove_index: { index: string } } + | { remove: { index: string; alias: string; must_exist: boolean } } + | { add: { index: string; alias: string } }; + +/** @internal */ +export interface UpdateAliasesParams { + client: ElasticsearchClient; + aliasActions: AliasAction[]; +} +/** + * Calls the Update index alias API `_alias` with the provided alias actions. + */ +export const updateAliases = ({ + client, + aliasActions, +}: UpdateAliasesParams): TaskEither.TaskEither< + IndexNotFound | AliasNotFound | RemoveIndexNotAConcreteIndex | RetryableEsClientError, + 'update_aliases_succeeded' +> => () => { + return client.indices + .updateAliases( + { + body: { + actions: aliasActions, + }, + }, + { maxRetries: 0 } + ) + .then(() => { + // Ignore `acknowledged: false`. When the coordinating node accepts + // the new cluster state update but not all nodes have applied the + // update within the timeout `acknowledged` will be false. However, + // retrying this update will always immediately result in `acknowledged: + // true` even if there are still nodes which are falling behind with + // cluster state updates. + // The only impact for using `updateAliases` to mark the version index + // as ready is that it could take longer for other Kibana instances to + // see that the version index is ready so they are more likely to + // perform unecessary duplicate work. + return Either.right('update_aliases_succeeded' as const); + }) + .catch((err: EsErrors.ElasticsearchClientError) => { + if (err instanceof EsErrors.ResponseError) { + if (err?.body?.error?.type === 'index_not_found_exception') { + return Either.left({ + type: 'index_not_found_exception' as const, + index: err.body.error.index, + }); + } else if ( + err?.body?.error?.type === 'illegal_argument_exception' && + err?.body?.error?.reason?.match( + /The provided expression \[.+\] matches an alias, specify the corresponding concrete indices instead./ + ) + ) { + return Either.left({ type: 'remove_index_not_a_concrete_index' as const }); + } else if ( + err?.body?.error?.type === 'aliases_not_found_exception' || + (err?.body?.error?.type === 'resource_not_found_exception' && + err?.body?.error?.reason?.match(/required alias \[.+\] does not exist/)) + ) { + return Either.left({ + type: 'alias_not_found_exception' as const, + }); + } + } + throw err; + }) + .catch(catchRetryableEsClientErrors); +}; diff --git a/src/core/server/saved_objects/migrationsv2/actions/update_and_pickup_mappings.test.ts b/src/core/server/saved_objects/migrationsv2/actions/update_and_pickup_mappings.test.ts new file mode 100644 index 00000000000000..3ecb990cd9e825 --- /dev/null +++ b/src/core/server/saved_objects/migrationsv2/actions/update_and_pickup_mappings.test.ts @@ -0,0 +1,45 @@ +/* + * 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 { catchRetryableEsClientErrors } from './catch_retryable_es_client_errors'; +import { errors as EsErrors } from '@elastic/elasticsearch'; +jest.mock('./catch_retryable_es_client_errors'); +import { elasticsearchClientMock } from '../../../elasticsearch/client/mocks'; +import { updateAndPickupMappings } from './update_and_pickup_mappings'; + +describe('updateAndPickupMappings', () => { + beforeEach(() => { + jest.clearAllMocks(); + }); + + // Create a mock client that rejects all methods with a 503 status code + // response. + const retryableError = new EsErrors.ResponseError( + elasticsearchClientMock.createApiResponse({ + statusCode: 503, + body: { error: { type: 'es_type', reason: 'es_reason' } }, + }) + ); + const client = elasticsearchClientMock.createInternalClient( + elasticsearchClientMock.createErrorTransportRequestPromise(retryableError) + ); + it('calls catchRetryableEsClientErrors when the promise rejects', async () => { + const task = updateAndPickupMappings({ + client, + index: 'new_index', + mappings: { properties: {} }, + }); + try { + await task(); + } catch (e) { + /** ignore */ + } + + expect(catchRetryableEsClientErrors).toHaveBeenCalledWith(retryableError); + }); +}); diff --git a/src/core/server/saved_objects/migrationsv2/actions/update_and_pickup_mappings.ts b/src/core/server/saved_objects/migrationsv2/actions/update_and_pickup_mappings.ts new file mode 100644 index 00000000000000..8c742005a01ce1 --- /dev/null +++ b/src/core/server/saved_objects/migrationsv2/actions/update_and_pickup_mappings.ts @@ -0,0 +1,80 @@ +/* + * 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 * as Either from 'fp-ts/lib/Either'; +import * as TaskEither from 'fp-ts/lib/TaskEither'; +import { pipe } from 'fp-ts/lib/pipeable'; +import { ElasticsearchClient } from '../../../elasticsearch'; +import { IndexMapping } from '../../mappings'; +import { + catchRetryableEsClientErrors, + RetryableEsClientError, +} from './catch_retryable_es_client_errors'; +import { pickupUpdatedMappings } from './pickup_updated_mappings'; +import { DEFAULT_TIMEOUT } from './constants'; + +/** @internal */ +export interface UpdateAndPickupMappingsResponse { + taskId: string; +} + +/** @internal */ +export interface UpdateAndPickupMappingsParams { + client: ElasticsearchClient; + index: string; + mappings: IndexMapping; +} +/** + * Updates an index's mappings and runs an pickupUpdatedMappings task so that the mapping + * changes are "picked up". Returns a taskId to track progress. + */ +export const updateAndPickupMappings = ({ + client, + index, + mappings, +}: UpdateAndPickupMappingsParams): TaskEither.TaskEither< + RetryableEsClientError, + UpdateAndPickupMappingsResponse +> => { + const putMappingTask: TaskEither.TaskEither< + RetryableEsClientError, + 'update_mappings_succeeded' + > = () => { + return client.indices + .putMapping({ + index, + timeout: DEFAULT_TIMEOUT, + body: mappings, + }) + .then((res) => { + // Ignore `acknowledged: false`. When the coordinating node accepts + // the new cluster state update but not all nodes have applied the + // update within the timeout `acknowledged` will be false. However, + // retrying this update will always immediately result in `acknowledged: + // true` even if there are still nodes which are falling behind with + // cluster state updates. + // For updateAndPickupMappings this means that there is the potential + // that some existing document's fields won't be picked up if the node + // on which the Kibana shard is running has fallen behind with cluster + // state updates and the mapping update wasn't applied before we run + // `pickupUpdatedMappings`. ES tries to limit this risk by blocking + // index operations (including update_by_query used by + // updateAndPickupMappings) if there are pending mappings changes. But + // not all mapping changes will prevent this. + return Either.right('update_mappings_succeeded' as const); + }) + .catch(catchRetryableEsClientErrors); + }; + + return pipe( + putMappingTask, + TaskEither.chain((res) => { + return pickupUpdatedMappings(client, index); + }) + ); +}; diff --git a/src/core/server/saved_objects/migrationsv2/actions/verify_reindex.ts b/src/core/server/saved_objects/migrationsv2/actions/verify_reindex.ts new file mode 100644 index 00000000000000..4db599d8fbadf4 --- /dev/null +++ b/src/core/server/saved_objects/migrationsv2/actions/verify_reindex.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 * as Either from 'fp-ts/lib/Either'; +import * as TaskEither from 'fp-ts/lib/TaskEither'; +import { ElasticsearchClient } from '../../../elasticsearch'; +import { + catchRetryableEsClientErrors, + RetryableEsClientError, +} from './catch_retryable_es_client_errors'; + +/** @internal */ +export interface VerifyReindexParams { + client: ElasticsearchClient; + sourceIndex: string; + targetIndex: string; +} + +export const verifyReindex = ({ + client, + sourceIndex, + targetIndex, +}: VerifyReindexParams): TaskEither.TaskEither< + RetryableEsClientError | { type: 'verify_reindex_failed' }, + 'verify_reindex_succeeded' +> => () => { + const count = (index: string) => + client + .count<{ count: number }>({ + index, + // Return an error when targeting missing or closed indices + allow_no_indices: false, + }) + .then((res) => { + return res.body.count; + }); + + return Promise.all([count(sourceIndex), count(targetIndex)]) + .then(([sourceCount, targetCount]) => { + if (targetCount >= sourceCount) { + return Either.right('verify_reindex_succeeded' as const); + } else { + return Either.left({ type: 'verify_reindex_failed' as const }); + } + }) + .catch(catchRetryableEsClientErrors); +}; diff --git a/src/core/server/saved_objects/migrationsv2/actions/wait_for_index_status_yellow.test.ts b/src/core/server/saved_objects/migrationsv2/actions/wait_for_index_status_yellow.test.ts new file mode 100644 index 00000000000000..8cea34b80ffad1 --- /dev/null +++ b/src/core/server/saved_objects/migrationsv2/actions/wait_for_index_status_yellow.test.ts @@ -0,0 +1,44 @@ +/* + * 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 { errors as EsErrors } from '@elastic/elasticsearch'; +import { waitForIndexStatusYellow } from './wait_for_index_status_yellow'; +import { elasticsearchClientMock } from '../../../elasticsearch/client/mocks'; +import { catchRetryableEsClientErrors } from './catch_retryable_es_client_errors'; +jest.mock('./catch_retryable_es_client_errors'); + +describe('waitForIndexStatusYellow', () => { + beforeEach(() => { + jest.clearAllMocks(); + }); + + // Create a mock client that rejects all methods with a 503 status code + // response. + const retryableError = new EsErrors.ResponseError( + elasticsearchClientMock.createApiResponse({ + statusCode: 503, + body: { error: { type: 'es_type', reason: 'es_reason' } }, + }) + ); + const client = elasticsearchClientMock.createInternalClient( + elasticsearchClientMock.createErrorTransportRequestPromise(retryableError) + ); + + it('calls catchRetryableEsClientErrors when the promise rejects', async () => { + const task = waitForIndexStatusYellow({ + client, + index: 'my_index', + }); + try { + await task(); + } catch (e) { + /** ignore */ + } + expect(catchRetryableEsClientErrors).toHaveBeenCalledWith(retryableError); + }); +}); diff --git a/src/core/server/saved_objects/migrationsv2/actions/wait_for_index_status_yellow.ts b/src/core/server/saved_objects/migrationsv2/actions/wait_for_index_status_yellow.ts new file mode 100644 index 00000000000000..307c77ee5b89c7 --- /dev/null +++ b/src/core/server/saved_objects/migrationsv2/actions/wait_for_index_status_yellow.ts @@ -0,0 +1,45 @@ +/* + * 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 * as Either from 'fp-ts/lib/Either'; +import * as TaskEither from 'fp-ts/lib/TaskEither'; +import { ElasticsearchClient } from '../../../elasticsearch'; +import { + catchRetryableEsClientErrors, + RetryableEsClientError, +} from './catch_retryable_es_client_errors'; +import { DEFAULT_TIMEOUT } from './constants'; + +/** @internal */ +export interface WaitForIndexStatusYellowParams { + client: ElasticsearchClient; + index: string; + timeout?: string; +} +/** + * A yellow index status means the index's primary shard is allocated and the + * index is ready for searching/indexing documents, but ES wasn't able to + * allocate the replicas. When migrations proceed with a yellow index it means + * we don't have as much data-redundancy as we could have, but waiting for + * replicas would mean that v2 migrations fail where v1 migrations would have + * succeeded. It doesn't feel like it's Kibana's job to force users to keep + * their clusters green and even if it's green when we migrate it can turn + * yellow at any point in the future. So ultimately data-redundancy is up to + * users to maintain. + */ +export const waitForIndexStatusYellow = ({ + client, + index, + timeout = DEFAULT_TIMEOUT, +}: WaitForIndexStatusYellowParams): TaskEither.TaskEither => () => { + return client.cluster + .health({ index, wait_for_status: 'yellow', timeout }) + .then(() => { + return Either.right({}); + }) + .catch(catchRetryableEsClientErrors); +}; diff --git a/src/core/server/saved_objects/migrationsv2/actions/wait_for_pickup_updated_mappings_task.test.ts b/src/core/server/saved_objects/migrationsv2/actions/wait_for_pickup_updated_mappings_task.test.ts new file mode 100644 index 00000000000000..f7c380be9427cb --- /dev/null +++ b/src/core/server/saved_objects/migrationsv2/actions/wait_for_pickup_updated_mappings_task.test.ts @@ -0,0 +1,59 @@ +/* + * 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 { catchRetryableEsClientErrors } from './catch_retryable_es_client_errors'; +import { errors as EsErrors } from '@elastic/elasticsearch'; +jest.mock('./catch_retryable_es_client_errors'); +import { elasticsearchClientMock } from '../../../elasticsearch/client/mocks'; +import { waitForPickupUpdatedMappingsTask } from './wait_for_pickup_updated_mappings_task'; +import { setWriteBlock } from './set_write_block'; + +describe('waitForPickupUpdatedMappingsTask', () => { + beforeEach(() => { + jest.clearAllMocks(); + }); + + // Create a mock client that rejects all methods with a 503 status code + // response. + const retryableError = new EsErrors.ResponseError( + elasticsearchClientMock.createApiResponse({ + statusCode: 503, + body: { error: { type: 'es_type', reason: 'es_reason' } }, + }) + ); + const client = elasticsearchClientMock.createInternalClient( + elasticsearchClientMock.createErrorTransportRequestPromise(retryableError) + ); + + const nonRetryableError = new Error('crash'); + const clientWithNonRetryableError = elasticsearchClientMock.createInternalClient( + elasticsearchClientMock.createErrorTransportRequestPromise(nonRetryableError) + ); + it('calls catchRetryableEsClientErrors when the promise rejects', async () => { + const task = waitForPickupUpdatedMappingsTask({ + client, + taskId: 'my task id', + timeout: '60s', + }); + try { + await task(); + } catch (e) { + /** ignore */ + } + + expect(catchRetryableEsClientErrors).toHaveBeenCalledWith(retryableError); + }); + it('re-throws non retry-able errors', async () => { + const task = setWriteBlock({ + client: clientWithNonRetryableError, + index: 'my_index', + }); + await task(); + expect(catchRetryableEsClientErrors).toHaveBeenCalledWith(nonRetryableError); + }); +}); diff --git a/src/core/server/saved_objects/migrationsv2/actions/wait_for_pickup_updated_mappings_task.ts b/src/core/server/saved_objects/migrationsv2/actions/wait_for_pickup_updated_mappings_task.ts new file mode 100644 index 00000000000000..02f7c3455cec90 --- /dev/null +++ b/src/core/server/saved_objects/migrationsv2/actions/wait_for_pickup_updated_mappings_task.ts @@ -0,0 +1,43 @@ +/* + * 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 * as TaskEither from 'fp-ts/lib/TaskEither'; +import * as Option from 'fp-ts/lib/Option'; +import { flow } from 'fp-ts/lib/function'; +import { waitForTask, WaitForTaskCompletionTimeout } from './wait_for_task'; +import { RetryableEsClientError } from './catch_retryable_es_client_errors'; + +export const waitForPickupUpdatedMappingsTask = flow( + waitForTask, + TaskEither.chain( + ( + res + ): TaskEither.TaskEither< + RetryableEsClientError | WaitForTaskCompletionTimeout, + 'pickup_updated_mappings_succeeded' + > => { + // We don't catch or type failures/errors because they should never + // occur in our migration algorithm and we don't have any business logic + // for dealing with it. If something happens we'll just crash and try + // again. + if (Option.isSome(res.failures)) { + throw new Error( + 'pickupUpdatedMappings task failed with the following failures:\n' + + JSON.stringify(res.failures.value) + ); + } else if (Option.isSome(res.error)) { + throw new Error( + 'pickupUpdatedMappings task failed with the following error:\n' + + JSON.stringify(res.error.value) + ); + } else { + return TaskEither.right('pickup_updated_mappings_succeeded' as const); + } + } + ) +); diff --git a/src/core/server/saved_objects/migrationsv2/actions/wait_for_reindex_task.test.ts b/src/core/server/saved_objects/migrationsv2/actions/wait_for_reindex_task.test.ts new file mode 100644 index 00000000000000..f6a236aab5c85b --- /dev/null +++ b/src/core/server/saved_objects/migrationsv2/actions/wait_for_reindex_task.test.ts @@ -0,0 +1,56 @@ +/* + * 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 { catchRetryableEsClientErrors } from './catch_retryable_es_client_errors'; +import { errors as EsErrors } from '@elastic/elasticsearch'; +jest.mock('./catch_retryable_es_client_errors'); +import { elasticsearchClientMock } from '../../../elasticsearch/client/mocks'; +import { waitForReindexTask } from './wait_for_reindex_task'; +import { setWriteBlock } from './set_write_block'; + +describe('waitForReindexTask', () => { + beforeEach(() => { + jest.clearAllMocks(); + }); + + // Create a mock client that rejects all methods with a 503 status code + // response. + const retryableError = new EsErrors.ResponseError( + elasticsearchClientMock.createApiResponse({ + statusCode: 503, + body: { error: { type: 'es_type', reason: 'es_reason' } }, + }) + ); + const client = elasticsearchClientMock.createInternalClient( + elasticsearchClientMock.createErrorTransportRequestPromise(retryableError) + ); + + const nonRetryableError = new Error('crash'); + const clientWithNonRetryableError = elasticsearchClientMock.createInternalClient( + elasticsearchClientMock.createErrorTransportRequestPromise(nonRetryableError) + ); + + it('calls catchRetryableEsClientErrors when the promise rejects', async () => { + const task = waitForReindexTask({ client, taskId: 'my task id', timeout: '60s' }); + try { + await task(); + } catch (e) { + /** ignore */ + } + + expect(catchRetryableEsClientErrors).toHaveBeenCalledWith(retryableError); + }); + it('re-throws non retry-able errors', async () => { + const task = setWriteBlock({ + client: clientWithNonRetryableError, + index: 'my_index', + }); + await task(); + expect(catchRetryableEsClientErrors).toHaveBeenCalledWith(nonRetryableError); + }); +}); diff --git a/src/core/server/saved_objects/migrationsv2/actions/wait_for_reindex_task.ts b/src/core/server/saved_objects/migrationsv2/actions/wait_for_reindex_task.ts new file mode 100644 index 00000000000000..18cf3350292b5c --- /dev/null +++ b/src/core/server/saved_objects/migrationsv2/actions/wait_for_reindex_task.ts @@ -0,0 +1,65 @@ +/* + * 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 * as TaskEither from 'fp-ts/lib/TaskEither'; +import * as Option from 'fp-ts/lib/Option'; +import { flow } from 'fp-ts/lib/function'; +import { RetryableEsClientError } from './catch_retryable_es_client_errors'; +import type { IndexNotFound, WaitForReindexTaskFailure, TargetIndexHadWriteBlock } from './index'; +import { waitForTask, WaitForTaskCompletionTimeout } from './wait_for_task'; + +export interface IncompatibleMappingException { + type: 'incompatible_mapping_exception'; +} +export const waitForReindexTask = flow( + waitForTask, + TaskEither.chain( + ( + res + ): TaskEither.TaskEither< + | IndexNotFound + | TargetIndexHadWriteBlock + | IncompatibleMappingException + | RetryableEsClientError + | WaitForTaskCompletionTimeout, + 'reindex_succeeded' + > => { + const failureIsAWriteBlock = ({ cause: { type, reason } }: WaitForReindexTaskFailure) => + type === 'cluster_block_exception' && + reason.match(/index \[.+] blocked by: \[FORBIDDEN\/8\/index write \(api\)\]/); + + const failureIsIncompatibleMappingException = ({ + cause: { type, reason }, + }: WaitForReindexTaskFailure) => + type === 'strict_dynamic_mapping_exception' || type === 'mapper_parsing_exception'; + + if (Option.isSome(res.error)) { + if (res.error.value.type === 'index_not_found_exception') { + return TaskEither.left({ + type: 'index_not_found_exception' as const, + index: res.error.value.index!, + }); + } else { + throw new Error('Reindex failed with the following error:\n' + JSON.stringify(res.error)); + } + } else if (Option.isSome(res.failures)) { + if (res.failures.value.every(failureIsAWriteBlock)) { + return TaskEither.left({ type: 'target_index_had_write_block' as const }); + } else if (res.failures.value.every(failureIsIncompatibleMappingException)) { + return TaskEither.left({ type: 'incompatible_mapping_exception' as const }); + } else { + throw new Error( + 'Reindex failed with the following failures:\n' + JSON.stringify(res.failures.value) + ); + } + } else { + return TaskEither.right('reindex_succeeded' as const); + } + } + ) +); diff --git a/src/core/server/saved_objects/migrationsv2/actions/wait_for_task.test.ts b/src/core/server/saved_objects/migrationsv2/actions/wait_for_task.test.ts new file mode 100644 index 00000000000000..c7ca9bf36a2c62 --- /dev/null +++ b/src/core/server/saved_objects/migrationsv2/actions/wait_for_task.test.ts @@ -0,0 +1,47 @@ +/* + * 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 { errors as EsErrors } from '@elastic/elasticsearch'; +import { waitForTask } from './wait_for_task'; +import { elasticsearchClientMock } from '../../../elasticsearch/client/mocks'; +import { catchRetryableEsClientErrors } from './catch_retryable_es_client_errors'; +jest.mock('./catch_retryable_es_client_errors'); + +describe('waitForTask', () => { + beforeEach(() => { + jest.clearAllMocks(); + }); + + // Create a mock client that rejects all methods with a 503 status code + // response. + const retryableError = new EsErrors.ResponseError( + elasticsearchClientMock.createApiResponse({ + statusCode: 503, + body: { error: { type: 'es_type', reason: 'es_reason' } }, + }) + ); + const client = elasticsearchClientMock.createInternalClient( + elasticsearchClientMock.createErrorTransportRequestPromise(retryableError) + ); + + describe('waitForPickupUpdatedMappingsTask', () => { + it('calls catchRetryableEsClientErrors when the promise rejects', async () => { + const task = waitForTask({ + client, + taskId: 'my task id', + timeout: '60s', + }); + try { + await task(); + } catch (e) { + /** ignore */ + } + + expect(catchRetryableEsClientErrors).toHaveBeenCalledWith(retryableError); + }); + }); +}); diff --git a/src/core/server/saved_objects/migrationsv2/actions/wait_for_task.ts b/src/core/server/saved_objects/migrationsv2/actions/wait_for_task.ts new file mode 100644 index 00000000000000..0cdaa88c535ab7 --- /dev/null +++ b/src/core/server/saved_objects/migrationsv2/actions/wait_for_task.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 * as Either from 'fp-ts/lib/Either'; +import * as TaskEither from 'fp-ts/lib/TaskEither'; +import * as Option from 'fp-ts/lib/Option'; +import { errors as EsErrors } from '@elastic/elasticsearch'; +import { ElasticsearchClient } from '../../../elasticsearch'; +import { + catchRetryableEsClientErrors, + RetryableEsClientError, +} from './catch_retryable_es_client_errors'; +/** @internal */ +export interface WaitForTaskResponse { + error: Option.Option<{ type: string; reason: string; index?: string }>; + completed: boolean; + failures: Option.Option; + description?: string; +} + +/** + * After waiting for the specificed timeout, the task has not yet completed. + * + * When querying the tasks API we use `wait_for_completion=true` to block the + * request until the task completes. If after the `timeout`, the task still has + * not completed we return this error. This does not mean that the task itelf + * has reached a timeout, Elasticsearch will continue to run the task. + */ +export interface WaitForTaskCompletionTimeout { + /** After waiting for the specificed timeout, the task has not yet completed. */ + readonly type: 'wait_for_task_completion_timeout'; + readonly message: string; + readonly error?: Error; +} + +const catchWaitForTaskCompletionTimeout = ( + e: EsErrors.ResponseError +): Either.Either => { + if ( + e.body?.error?.type === 'timeout_exception' || + e.body?.error?.type === 'receive_timeout_transport_exception' + ) { + return Either.left({ + type: 'wait_for_task_completion_timeout' as const, + message: `[${e.body.error.type}] ${e.body.error.reason}`, + error: e, + }); + } else { + throw e; + } +}; + +/** @internal */ +export interface WaitForTaskParams { + client: ElasticsearchClient; + taskId: string; + timeout: string; +} +/** + * Blocks for up to 60s or until a task completes. + * + * TODO: delete completed tasks + */ +export const waitForTask = ({ + client, + taskId, + timeout, +}: WaitForTaskParams): TaskEither.TaskEither< + RetryableEsClientError | WaitForTaskCompletionTimeout, + WaitForTaskResponse +> => () => { + return client.tasks + .get({ + task_id: taskId, + wait_for_completion: true, + timeout, + }) + .then((res) => { + const body = res.body; + const failures = body.response?.failures ?? []; + return Either.right({ + completed: body.completed, + error: Option.fromNullable(body.error), + failures: failures.length > 0 ? Option.some(failures) : Option.none, + description: body.task.description, + }); + }) + .catch(catchWaitForTaskCompletionTimeout) + .catch(catchRetryableEsClientErrors); +}; diff --git a/src/core/server/saved_objects/migrationsv2/integration_tests/migration.test.ts b/src/core/server/saved_objects/migrationsv2/integration_tests/migration.test.ts index 5e4b8feefbd958..f9d8e7cc4fbaab 100644 --- a/src/core/server/saved_objects/migrationsv2/integration_tests/migration.test.ts +++ b/src/core/server/saved_objects/migrationsv2/integration_tests/migration.test.ts @@ -157,7 +157,10 @@ describe('migration v2', () => { const response = body[migratedIndex]; expect(response).toBeDefined(); - expect(Object.keys(response.aliases).sort()).toEqual(['.kibana', `.kibana_${kibanaVersion}`]); + expect(Object.keys(response.aliases!).sort()).toEqual([ + '.kibana', + `.kibana_${kibanaVersion}`, + ]); }); it('copies all the document of the previous index to the new one', async () => { @@ -216,7 +219,10 @@ describe('migration v2', () => { const response = body[migratedIndex]; expect(response).toBeDefined(); - expect(Object.keys(response.aliases).sort()).toEqual(['.kibana', `.kibana_${kibanaVersion}`]); + expect(Object.keys(response.aliases!).sort()).toEqual([ + '.kibana', + `.kibana_${kibanaVersion}`, + ]); }); it('copies all the document of the previous index to the new one', async () => { diff --git a/src/core/server/saved_objects/migrationsv2/model.test.ts b/src/core/server/saved_objects/migrationsv2/model.test.ts index 186cb24b4a34a8..86dc590aabdad8 100644 --- a/src/core/server/saved_objects/migrationsv2/model.test.ts +++ b/src/core/server/saved_objects/migrationsv2/model.test.ts @@ -244,7 +244,7 @@ describe('migrations v2 model', () => { disabled_saved_object_type: '7997cf5a56cc02bdc9c93361bde732b0', }, }, - }; + } as const; test('INIT -> OUTDATED_DOCUMENTS_SEARCH_OPEN_PIT if .kibana is already pointing to the target index', () => { const res: ResponseType<'INIT'> = Either.right({ @@ -683,7 +683,7 @@ describe('migrations v2 model', () => { disabled_saved_object_type: '7997cf5a56cc02bdc9c93361bde732b0', }, }, - }; + } as const; const waitForYellowSourceState: WaitForYellowSourceState = { ...baseState, diff --git a/src/core/server/saved_objects/migrationsv2/types.ts b/src/core/server/saved_objects/migrationsv2/types.ts index adcd2ad32fd24e..1151e8337d3d59 100644 --- a/src/core/server/saved_objects/migrationsv2/types.ts +++ b/src/core/server/saved_objects/migrationsv2/types.ts @@ -53,7 +53,7 @@ export interface BaseState extends ControlState { readonly tempIndexMappings: IndexMapping; /** Script to apply to a legacy index before it can be used as a migration source */ readonly preMigrationScript: Option.Option; - readonly outdatedDocumentsQuery: estypes.QueryContainer; + readonly outdatedDocumentsQuery: estypes.QueryDslQueryContainer; readonly retryCount: number; readonly retryDelay: number; /** @@ -112,7 +112,7 @@ export interface BaseState extends ControlState { * are no longer used. These saved objects will still be kept in the outdated * index for backup purposes, but won't be available in the upgraded index. */ - readonly unusedTypesQuery: estypes.QueryContainer; + readonly unusedTypesQuery: estypes.QueryDslQueryContainer; } export interface InitState extends BaseState { @@ -132,7 +132,7 @@ export interface PostInitState extends BaseState { /** The target index is the index to which the migration writes */ readonly targetIndex: string; readonly versionIndexReadyActions: Option.Option; - readonly outdatedDocumentsQuery: estypes.QueryContainer; + readonly outdatedDocumentsQuery: estypes.QueryDslQueryContainer; } export interface DoneState extends PostInitState { diff --git a/src/core/server/saved_objects/saved_objects_type_registry.ts b/src/core/server/saved_objects/saved_objects_type_registry.ts index a63837132b652e..ba5960c59239d7 100644 --- a/src/core/server/saved_objects/saved_objects_type_registry.ts +++ b/src/core/server/saved_objects/saved_objects_type_registry.ts @@ -33,7 +33,7 @@ export class SavedObjectTypeRegistry { throw new Error(`Type '${type.name}' is already registered`); } validateType(type); - this.types.set(type.name, deepFreeze(type)); + this.types.set(type.name, deepFreeze(type) as SavedObjectsType); } /** diff --git a/src/core/server/saved_objects/service/lib/aggregations/validation.test.ts b/src/core/server/saved_objects/service/lib/aggregations/validation.test.ts index 57421db76f5b6e..53f1b5c9d78c57 100644 --- a/src/core/server/saved_objects/service/lib/aggregations/validation.test.ts +++ b/src/core/server/saved_objects/service/lib/aggregations/validation.test.ts @@ -9,7 +9,7 @@ import type { estypes } from '@elastic/elasticsearch'; import { validateAndConvertAggregations } from './validation'; -type AggsMap = Record; +type AggsMap = Record; const mockMappings = { properties: { @@ -19,7 +19,9 @@ const mockMappings = { references: { type: 'nested', properties: { - id: 'keyword', + id: { + type: 'keyword', + }, }, }, foo: { @@ -31,7 +33,7 @@ const mockMappings = { type: 'text', }, bytes: { - type: 'number', + type: 'integer', }, }, }, @@ -73,7 +75,7 @@ const mockMappings = { }, }, }, -}; +} as const; describe('validateAndConvertAggregations', () => { it('validates a simple aggregations', () => { diff --git a/src/core/server/saved_objects/service/lib/aggregations/validation.ts b/src/core/server/saved_objects/service/lib/aggregations/validation.ts index cd41a23f4a28b5..5ef89f297a796b 100644 --- a/src/core/server/saved_objects/service/lib/aggregations/validation.ts +++ b/src/core/server/saved_objects/service/lib/aggregations/validation.ts @@ -37,9 +37,9 @@ interface ValidationContext { */ export const validateAndConvertAggregations = ( allowedTypes: string[], - aggs: Record, + aggs: Record, indexMapping: IndexMapping -): Record => { +): Record => { return validateAggregations(aggs, { allowedTypes, indexMapping, @@ -53,16 +53,15 @@ export const validateAndConvertAggregations = ( * Or a nested record of aggregation (`SearchRequest.body.aggs.myAggregation.aggs`) */ const validateAggregations = ( - aggregations: Record, + aggregations: Record, context: ValidationContext ) => { - return Object.entries(aggregations).reduce>( - (memo, [aggrName, aggrContainer]) => { - memo[aggrName] = validateAggregation(aggrContainer, childContext(context, aggrName)); - return memo; - }, - {} - ); + return Object.entries(aggregations).reduce< + Record + >((memo, [aggrName, aggrContainer]) => { + memo[aggrName] = validateAggregation(aggrContainer, childContext(context, aggrName)); + return memo; + }, {}); }; /** @@ -70,7 +69,7 @@ const validateAggregations = ( * from a nested aggregation record, including its potential nested aggregations. */ const validateAggregation = ( - aggregation: estypes.AggregationContainer, + aggregation: estypes.AggregationsAggregationContainer, context: ValidationContext ) => { const container = validateAggregationContainer(aggregation, context); @@ -93,10 +92,10 @@ const validateAggregation = ( * (ignoring its nested aggregations) */ const validateAggregationContainer = ( - container: estypes.AggregationContainer, + container: estypes.AggregationsAggregationContainer, context: ValidationContext ) => { - return Object.entries(container).reduce( + return Object.entries(container).reduce( (memo, [aggName, aggregation]) => { if (aggregationKeys.includes(aggName)) { return memo; diff --git a/src/core/server/saved_objects/service/lib/aggregations/validation_utils.test.ts b/src/core/server/saved_objects/service/lib/aggregations/validation_utils.test.ts index 25c3aea474ecec..0425e46b4477e6 100644 --- a/src/core/server/saved_objects/service/lib/aggregations/validation_utils.test.ts +++ b/src/core/server/saved_objects/service/lib/aggregations/validation_utils.test.ts @@ -6,7 +6,6 @@ * Side Public License, v 1. */ -import { IndexMapping } from '../../../mappings'; import { isRootLevelAttribute, rewriteRootLevelAttribute, @@ -14,7 +13,7 @@ import { rewriteObjectTypeAttribute, } from './validation_utils'; -const mockMappings: IndexMapping = { +const mockMappings = { properties: { updated_at: { type: 'date', @@ -28,7 +27,7 @@ const mockMappings: IndexMapping = { type: 'text', }, bytes: { - type: 'number', + type: 'integer', }, }, }, @@ -70,7 +69,7 @@ const mockMappings: IndexMapping = { }, }, }, -}; +} as const; describe('isRootLevelAttribute', () => { it('returns true when referring to a path to a valid root level field', () => { diff --git a/src/core/server/saved_objects/service/lib/filter_utils.test.ts b/src/core/server/saved_objects/service/lib/filter_utils.test.ts index 2ef5219ccfff16..e6934398862dc0 100644 --- a/src/core/server/saved_objects/service/lib/filter_utils.test.ts +++ b/src/core/server/saved_objects/service/lib/filter_utils.test.ts @@ -31,7 +31,7 @@ const mockMappings = { type: 'text', }, bytes: { - type: 'number', + type: 'integer', }, }, }, @@ -90,7 +90,7 @@ const mockMappings = { }, }, }, -}; +} as const; describe('Filter Utils', () => { describe('#validateConvertFilterToKueryNode', () => { diff --git a/src/core/server/saved_objects/service/lib/repository.ts b/src/core/server/saved_objects/service/lib/repository.ts index c626a2b2acfb58..6b51bd57248a1d 100644 --- a/src/core/server/saved_objects/service/lib/repository.ts +++ b/src/core/server/saved_objects/service/lib/repository.ts @@ -672,7 +672,6 @@ export class SavedObjectsRepository { } const deleteDocNotFound = body.result === 'not_found'; - // @ts-expect-error 'error' does not exist on type 'DeleteResponse' const deleteIndexNotFound = body.error && body.error.type === 'index_not_found_exception'; if (deleteDocNotFound || deleteIndexNotFound) { // see "404s from missing index" above @@ -897,7 +896,7 @@ export class SavedObjectsRepository { per_page: perPage, total: body.hits.total, saved_objects: body.hits.hits.map( - (hit: estypes.Hit): SavedObjectsFindResult => ({ + (hit: estypes.SearchHit): SavedObjectsFindResult => ({ // @ts-expect-error @elastic/elasticsearch declared Id as string | number ...this._rawToSavedObject(hit), score: hit._score!, @@ -1835,13 +1834,9 @@ export class SavedObjectsRepository { ...(preference ? { preference } : {}), }; - const { body, statusCode } = await this.client.openPointInTime( - // @ts-expect-error @elastic/elasticsearch OpenPointInTimeRequest.index expected to accept string[] - esOptions, - { - ignore: [404], - } - ); + const { body, statusCode } = await this.client.openPointInTime(esOptions, { + ignore: [404], + }); if (statusCode === 404) { throw SavedObjectsErrorHelpers.createGenericNotFoundError(); } diff --git a/src/core/server/saved_objects/service/lib/search_dsl/search_dsl.ts b/src/core/server/saved_objects/service/lib/search_dsl/search_dsl.ts index 64b3dd428fb8bf..3196a59ca39ee4 100644 --- a/src/core/server/saved_objects/service/lib/search_dsl/search_dsl.ts +++ b/src/core/server/saved_objects/service/lib/search_dsl/search_dsl.ts @@ -26,7 +26,7 @@ interface GetSearchDslOptions { rootSearchFields?: string[]; searchAfter?: estypes.Id[]; sortField?: string; - sortOrder?: estypes.SortOrder; + sortOrder?: estypes.SearchSortOrder; namespaces?: string[]; pit?: SavedObjectsPitParams; typeToNamespacesMap?: Map; diff --git a/src/core/server/saved_objects/service/lib/search_dsl/sorting_params.test.ts b/src/core/server/saved_objects/service/lib/search_dsl/sorting_params.test.ts index 1376f0d50a9da6..e2a21cc03ce3be 100644 --- a/src/core/server/saved_objects/service/lib/search_dsl/sorting_params.test.ts +++ b/src/core/server/saved_objects/service/lib/search_dsl/sorting_params.test.ts @@ -50,7 +50,7 @@ const MAPPINGS = { }, }, }, -}; +} as const; describe('searchDsl/getSortParams', () => { describe('type, no sortField', () => { diff --git a/src/core/server/saved_objects/service/lib/search_dsl/sorting_params.ts b/src/core/server/saved_objects/service/lib/search_dsl/sorting_params.ts index 64849c308f3f09..592110a5413ec7 100644 --- a/src/core/server/saved_objects/service/lib/search_dsl/sorting_params.ts +++ b/src/core/server/saved_objects/service/lib/search_dsl/sorting_params.ts @@ -16,8 +16,8 @@ export function getSortingParams( mappings: IndexMapping, type: string | string[], sortField?: string, - sortOrder?: estypes.SortOrder -): { sort?: estypes.SortContainer[] } { + sortOrder?: estypes.SearchSortOrder +): { sort?: estypes.SearchSortContainer[] } { if (!sortField) { return {}; } diff --git a/src/core/server/saved_objects/service/lib/update_objects_spaces.ts b/src/core/server/saved_objects/service/lib/update_objects_spaces.ts index 079549265385cd..3131d0240f96b9 100644 --- a/src/core/server/saved_objects/service/lib/update_objects_spaces.ts +++ b/src/core/server/saved_objects/service/lib/update_objects_spaces.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import type { BulkOperationContainer, MultiGetOperation } from '@elastic/elasticsearch/api/types'; +import type { estypes } from '@elastic/elasticsearch'; import intersection from 'lodash/intersection'; import type { ISavedObjectTypeRegistry } from '../../saved_objects_type_registry'; @@ -173,7 +173,7 @@ export async function updateObjectsSpaces({ }; }); - const bulkGetDocs = expectedBulkGetResults.reduce((acc, x) => { + const bulkGetDocs = expectedBulkGetResults.reduce((acc, x) => { if (isRight(x) && x.value.esRequestIndex !== undefined) { acc.push({ _id: serializer.generateRawId(undefined, x.value.type, x.value.id), @@ -192,7 +192,7 @@ export async function updateObjectsSpaces({ const time = new Date().toISOString(); let bulkOperationRequestIndexCounter = 0; - const bulkOperationParams: BulkOperationContainer[] = []; + const bulkOperationParams: estypes.BulkOperationContainer[] = []; const expectedBulkOperationResults: Either[] = expectedBulkGetResults.map( (expectedBulkGetResult) => { if (isLeft(expectedBulkGetResult)) { diff --git a/src/core/server/saved_objects/types.ts b/src/core/server/saved_objects/types.ts index d3bfdcc6923dcf..964ba671b59646 100644 --- a/src/core/server/saved_objects/types.ts +++ b/src/core/server/saved_objects/types.ts @@ -80,7 +80,7 @@ export interface SavedObjectsFindOptions { page?: number; perPage?: number; sortField?: string; - sortOrder?: estypes.SortOrder; + sortOrder?: estypes.SearchSortOrder; /** * An array of fields to include in the results * @example @@ -137,7 +137,7 @@ export interface SavedObjectsFindOptions { * * @alpha */ - aggs?: Record; + aggs?: Record; namespaces?: string[]; /** * This map defines each type to search for, and the namespace(s) to search for the type in; this is only intended to be used by a saved diff --git a/src/core/server/server.api.md b/src/core/server/server.api.md index 379e4147ae024c..acec03902bf6aa 100644 --- a/src/core/server/server.api.md +++ b/src/core/server/server.api.md @@ -2361,38 +2361,6 @@ export interface SavedObjectsCollectMultiNamespaceReferencesResponse { objects: SavedObjectReferenceWithContext[]; } -// @public -export interface SavedObjectsComplexFieldMapping { - // (undocumented) - doc_values?: boolean; - dynamic?: false | 'strict'; - // (undocumented) - enabled?: boolean; - // (undocumented) - properties: SavedObjectsMappingProperties; - // (undocumented) - type?: string; -} - -// @public -export interface SavedObjectsCoreFieldMapping { - // (undocumented) - doc_values?: boolean; - // (undocumented) - fields?: { - [subfield: string]: { - type: string; - ignore_above?: number; - }; - }; - // (undocumented) - index?: boolean; - // (undocumented) - null_value?: number | boolean | string; - // (undocumented) - type: string; -} - // @public (undocumented) export interface SavedObjectsCreateOptions extends SavedObjectsBaseOptions { coreMigrationVersion?: string; @@ -2554,12 +2522,14 @@ export interface SavedObjectsExportTransformContext { } // @public -export type SavedObjectsFieldMapping = SavedObjectsCoreFieldMapping | SavedObjectsComplexFieldMapping; +export type SavedObjectsFieldMapping = estypes.MappingProperty & { + dynamic?: false | 'strict'; +}; // @public (undocumented) export interface SavedObjectsFindOptions { // @alpha - aggs?: Record; + aggs?: Record; defaultSearchOperator?: 'AND' | 'OR'; fields?: string[]; // Warning: (ae-forgotten-export) The symbol "KueryNode" needs to be exported by the entry point index.d.ts @@ -2583,7 +2553,7 @@ export interface SavedObjectsFindOptions { // (undocumented) sortField?: string; // (undocumented) - sortOrder?: estypes.SortOrder; + sortOrder?: estypes.SearchSortOrder; // (undocumented) type: string | string[]; typeToNamespacesMap?: Map; diff --git a/src/plugins/charts/public/index.ts b/src/plugins/charts/public/index.ts index b42407bb10365c..cc1a54c2e25b09 100644 --- a/src/plugins/charts/public/index.ts +++ b/src/plugins/charts/public/index.ts @@ -14,6 +14,7 @@ export { ChartsPluginSetup, ChartsPluginStart } from './plugin'; export * from './static'; export * from './services/palettes/types'; +export { lightenColor } from './services/palettes/lighten_color'; export { PaletteOutput, CustomPaletteArguments, diff --git a/src/plugins/charts/public/static/components/color_picker.tsx b/src/plugins/charts/public/static/components/color_picker.tsx index 4974400a3767a3..813748accd8fdb 100644 --- a/src/plugins/charts/public/static/components/color_picker.tsx +++ b/src/plugins/charts/public/static/components/color_picker.tsx @@ -18,7 +18,7 @@ import { EuiFlexGroup, } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n/react'; - +import { lightenColor } from '../../services/palettes/lighten_color'; import './color_picker.scss'; export const legacyColors: string[] = [ @@ -105,6 +105,14 @@ interface ColorPickerProps { * Callback for onKeyPress event */ onKeyDown?: (e: React.KeyboardEvent) => void; + /** + * Optional define the series maxDepth + */ + maxDepth?: number; + /** + * Optional define the layer index + */ + layerIndex?: number; } const euiColors = euiPaletteColorBlind({ rotations: 4, order: 'group' }); @@ -115,6 +123,8 @@ export const ColorPicker = ({ useLegacyColors = true, colorIsOverwritten = true, onKeyDown, + maxDepth, + layerIndex, }: ColorPickerProps) => { const legendColors = useLegacyColors ? legacyColors : euiColors; @@ -159,13 +169,18 @@ export const ColorPicker = ({ ))} - {legendColors.some((c) => c === selectedColor) && colorIsOverwritten && ( - - onChange(null, e)}> - - - - )} + {legendColors.some( + (c) => + c === selectedColor || + (layerIndex && maxDepth && lightenColor(c, layerIndex, maxDepth) === selectedColor) + ) && + colorIsOverwritten && ( + + onChange(null, e)}> + + + + )} ); }; diff --git a/src/plugins/dashboard/common/types.ts b/src/plugins/dashboard/common/types.ts index 9a6d185ef2ac10..5851ffa045bc7f 100644 --- a/src/plugins/dashboard/common/types.ts +++ b/src/plugins/dashboard/common/types.ts @@ -32,6 +32,14 @@ export interface DashboardPanelState< panelRefName?: string; } +export interface DashboardCapabilities { + showWriteControls: boolean; + saveQuery: boolean; + createNew: boolean; + show: boolean; + [key: string]: boolean; +} + /** * This should always represent the latest dashboard panel shape, after all possible migrations. */ diff --git a/src/plugins/dashboard/public/application/actions/expand_panel_action.tsx b/src/plugins/dashboard/public/application/actions/expand_panel_action.tsx index f90a0cef95bb8f..98f7bbbee3d7cd 100644 --- a/src/plugins/dashboard/public/application/actions/expand_panel_action.tsx +++ b/src/plugins/dashboard/public/application/actions/expand_panel_action.tsx @@ -6,14 +6,11 @@ * Side Public License, v 1. */ -import { dashboardExpandPanelAction } from '../../dashboard_strings'; +import { DashboardContainerInput } from '../..'; import { IEmbeddable } from '../../services/embeddable'; +import { dashboardExpandPanelAction } from '../../dashboard_strings'; import { Action, IncompatibleActionError } from '../../services/ui_actions'; -import { - DASHBOARD_CONTAINER_TYPE, - DashboardContainer, - DashboardContainerInput, -} from '../embeddable'; +import { DASHBOARD_CONTAINER_TYPE, DashboardContainer } from '../embeddable'; export const ACTION_EXPAND_PANEL = 'togglePanel'; diff --git a/src/plugins/dashboard/public/application/dashboard_app.tsx b/src/plugins/dashboard/public/application/dashboard_app.tsx index 93310bb8213615..8db6a0e8a8c7fd 100644 --- a/src/plugins/dashboard/public/application/dashboard_app.tsx +++ b/src/plugins/dashboard/public/application/dashboard_app.tsx @@ -7,35 +7,20 @@ */ import { History } from 'history'; -import { merge, Subject, Subscription } from 'rxjs'; -import React, { useCallback, useEffect, useMemo, useState } from 'react'; +import React, { useEffect, useMemo } from 'react'; -import { debounceTime, finalize, switchMap, tap } from 'rxjs/operators'; +import { useDashboardSelector } from './state'; +import { useDashboardAppState } from './hooks'; import { useKibana } from '../../../kibana_react/public'; -import { DashboardConstants } from '../dashboard_constants'; -import { DashboardTopNav } from './top_nav/dashboard_top_nav'; -import { DashboardAppServices, DashboardEmbedSettings, DashboardRedirect } from './types'; import { - getChangesFromAppStateForContainerState, - getDashboardContainerInput, - getFiltersSubscription, - getInputSubscription, - getOutputSubscription, - getSearchSessionIdFromURL, -} from './dashboard_app_functions'; -import { - useDashboardBreadcrumbs, - useDashboardContainer, - useDashboardStateManager, - useSavedDashboard, -} from './hooks'; - -import { IndexPattern, waitUntilNextSessionCompletes$ } from '../services/data'; + getDashboardBreadcrumb, + getDashboardTitle, + leaveConfirmStrings, +} from '../dashboard_strings'; import { EmbeddableRenderer } from '../services/embeddable'; -import { DashboardContainerInput } from '.'; -import { leaveConfirmStrings } from '../dashboard_strings'; -import { createQueryParamObservable, replaceUrlHashQuery } from '../../../kibana_utils/public'; - +import { DashboardTopNav, isCompleteDashboardAppState } from './top_nav/dashboard_top_nav'; +import { DashboardAppServices, DashboardEmbedSettings, DashboardRedirect } from '../types'; +import { createKbnUrlStateStorage, withNotifyOnErrors } from '../services/kibana_utils'; export interface DashboardAppProps { history: History; savedDashboardId?: string; @@ -50,236 +35,37 @@ export function DashboardApp({ history, }: DashboardAppProps) { const { - data, core, + chrome, + embeddable, onAppLeave, uiSettings, - embeddable, - dashboardCapabilities, - indexPatterns: indexPatternService, } = useKibana().services; - const triggerRefresh$ = useMemo(() => new Subject<{ force?: boolean }>(), []); - const [indexPatterns, setIndexPatterns] = useState([]); - - const savedDashboard = useSavedDashboard(savedDashboardId, history); - - const getIncomingEmbeddable = useCallback( - (removeAfterFetch?: boolean) => { - return embeddable - .getStateTransfer() - .getIncomingEmbeddablePackage(DashboardConstants.DASHBOARDS_ID, removeAfterFetch); - }, - [embeddable] + const kbnUrlStateStorage = useMemo( + () => + createKbnUrlStateStorage({ + history, + useHash: uiSettings.get('state:storeInSessionStorage'), + ...withNotifyOnErrors(core.notifications.toasts), + }), + [core.notifications.toasts, history, uiSettings] ); - const { dashboardStateManager, viewMode, setViewMode } = useDashboardStateManager( - savedDashboard, - history, - getIncomingEmbeddable - ); - const [unsavedChanges, setUnsavedChanges] = useState(false); - const dashboardContainer = useDashboardContainer({ - timeFilter: data.query.timefilter.timefilter, - dashboardStateManager, - getIncomingEmbeddable, - setUnsavedChanges, + const dashboardState = useDashboardSelector((state) => state.dashboardStateReducer); + const dashboardAppState = useDashboardAppState({ history, + redirectTo, + savedDashboardId, + kbnUrlStateStorage, + isEmbeddedExternally: Boolean(embedSettings), }); - const searchSessionIdQuery$ = useMemo( - () => createQueryParamObservable(history, DashboardConstants.SEARCH_SESSION_ID), - [history] - ); - - const refreshDashboardContainer = useCallback( - (force?: boolean) => { - if (!dashboardContainer || !dashboardStateManager) { - return; - } - - const changes = getChangesFromAppStateForContainerState({ - dashboardContainer, - appStateDashboardInput: getDashboardContainerInput({ - isEmbeddedExternally: Boolean(embedSettings), - dashboardStateManager, - lastReloadRequestTime: force ? Date.now() : undefined, - dashboardCapabilities, - query: data.query, - }), - }); - - if (changes) { - // state keys change in which likely won't need a data fetch - const noRefetchKeys: Array = [ - 'viewMode', - 'title', - 'description', - 'expandedPanelId', - 'useMargins', - 'isEmbeddedExternally', - 'isFullScreenMode', - ]; - const shouldRefetch = Object.keys(changes).some( - (changeKey) => !noRefetchKeys.includes(changeKey as keyof DashboardContainerInput) - ); - - const newSearchSessionId: string | undefined = (() => { - // do not update session id if this is irrelevant state change to prevent excessive searches - if (!shouldRefetch) return; - - let searchSessionIdFromURL = getSearchSessionIdFromURL(history); - if (searchSessionIdFromURL) { - if ( - data.search.session.isRestore() && - data.search.session.isCurrentSession(searchSessionIdFromURL) - ) { - // navigating away from a restored session - dashboardStateManager.kbnUrlStateStorage.kbnUrlControls.updateAsync((nextUrl) => { - if (nextUrl.includes(DashboardConstants.SEARCH_SESSION_ID)) { - return replaceUrlHashQuery(nextUrl, (query) => { - delete query[DashboardConstants.SEARCH_SESSION_ID]; - return query; - }); - } - return nextUrl; - }); - searchSessionIdFromURL = undefined; - } else { - data.search.session.restore(searchSessionIdFromURL); - } - } - - return searchSessionIdFromURL ?? data.search.session.start(); - })(); - - if (changes.viewMode) { - setViewMode(changes.viewMode); - } - dashboardContainer.updateInput({ - ...changes, - ...(newSearchSessionId && { searchSessionId: newSearchSessionId }), - }); - } - }, - [ - history, - data.query, - setViewMode, - embedSettings, - dashboardContainer, - data.search.session, - dashboardCapabilities, - dashboardStateManager, - ] - ); - - // Manage dashboard container subscriptions - useEffect(() => { - if (!dashboardStateManager || !dashboardContainer) { - return; - } - const timeFilter = data.query.timefilter.timefilter; - const subscriptions = new Subscription(); - - subscriptions.add( - getInputSubscription({ - dashboardContainer, - dashboardStateManager, - filterManager: data.query.filterManager, - }) - ); - subscriptions.add( - getOutputSubscription({ - dashboardContainer, - indexPatterns: indexPatternService, - onUpdateIndexPatterns: (newIndexPatterns) => setIndexPatterns(newIndexPatterns), - }) - ); - subscriptions.add( - getFiltersSubscription({ - query: data.query, - dashboardStateManager, - }) - ); - subscriptions.add( - merge( - ...[timeFilter.getRefreshIntervalUpdate$(), timeFilter.getTimeUpdate$()] - ).subscribe(() => triggerRefresh$.next()) - ); - - subscriptions.add( - searchSessionIdQuery$.subscribe(() => { - triggerRefresh$.next({ force: true }); - }) - ); - - subscriptions.add( - data.query.timefilter.timefilter - .getAutoRefreshFetch$() - .pipe( - tap(() => { - triggerRefresh$.next({ force: true }); - }), - switchMap((done) => - // best way on a dashboard to estimate that panels are updated is to rely on search session service state - waitUntilNextSessionCompletes$(data.search.session).pipe(finalize(done)) - ) - ) - .subscribe() - ); - - dashboardStateManager.registerChangeListener(() => { - setUnsavedChanges(dashboardStateManager.getIsDirty(data.query.timefilter.timefilter)); - // we aren't checking dirty state because there are changes the container needs to know about - // that won't make the dashboard "dirty" - like a view mode change. - triggerRefresh$.next(); - }); - - // debounce `refreshDashboardContainer()` - // use `forceRefresh=true` in case at least one debounced trigger asked for it - let forceRefresh: boolean = false; - subscriptions.add( - triggerRefresh$ - .pipe( - tap((trigger) => { - forceRefresh = forceRefresh || (trigger?.force ?? false); - }), - debounceTime(50) - ) - .subscribe(() => { - refreshDashboardContainer(forceRefresh); - forceRefresh = false; - }) - ); - - return () => { - subscriptions.unsubscribe(); - }; - }, [ - core.http, - uiSettings, - data.query, - dashboardContainer, - data.search.session, - indexPatternService, - dashboardStateManager, - searchSessionIdQuery$, - triggerRefresh$, - refreshDashboardContainer, - ]); - - // Sync breadcrumbs when Dashboard State Manager changes - useDashboardBreadcrumbs(dashboardStateManager, redirectTo); - - // Build onAppLeave when Dashboard State Manager changes + // Build app leave handler whenever hasUnsavedChanges changes useEffect(() => { - if (!dashboardStateManager || !dashboardContainer) { - return; - } onAppLeave((actions) => { if ( - dashboardStateManager?.getIsDirty() && + dashboardAppState.hasUnsavedChanges && !embeddable.getStateTransfer().isTransferInProgress ) { return actions.confirm( @@ -293,37 +79,36 @@ export function DashboardApp({ // reset on app leave handler so leaving from the listing page doesn't trigger a confirmation onAppLeave((actions) => actions.default()); }; - }, [dashboardStateManager, dashboardContainer, onAppLeave, embeddable]); + }, [onAppLeave, embeddable, dashboardAppState.hasUnsavedChanges]); + + // Set breadcrumbs when dashboard's title or view mode changes + useEffect(() => { + if (!dashboardState.title && savedDashboardId) return; + chrome.setBreadcrumbs([ + { + text: getDashboardBreadcrumb(), + 'data-test-subj': 'dashboardListingBreadcrumb', + onClick: () => { + redirectTo({ destination: 'listing' }); + }, + }, + { + text: getDashboardTitle(dashboardState.title, dashboardState.viewMode, !savedDashboardId), + }, + ]); + }, [chrome, dashboardState.title, dashboardState.viewMode, redirectTo, savedDashboardId]); return ( <> - {savedDashboard && dashboardStateManager && dashboardContainer && viewMode && ( + {isCompleteDashboardAppState(dashboardAppState) && ( <> setUnsavedChanges(false)} - timefilter={data.query.timefilter.timefilter} - onQuerySubmit={(_payload, isUpdate) => { - if (isUpdate === false) { - // The user can still request a reload in the query bar, even if the - // query is the same, and in that case, we have to explicitly ask for - // a reload, since no state changes will cause it. - triggerRefresh$.next({ force: true }); - } - }} + redirectTo={redirectTo} + embedSettings={embedSettings} + dashboardAppState={dashboardAppState} />
- +
)} diff --git a/src/plugins/dashboard/public/application/dashboard_app_functions.ts b/src/plugins/dashboard/public/application/dashboard_app_functions.ts deleted file mode 100644 index 6d51422d4bd23e..00000000000000 --- a/src/plugins/dashboard/public/application/dashboard_app_functions.ts +++ /dev/null @@ -1,277 +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 { History } from 'history'; - -import _, { uniqBy } from 'lodash'; -import deepEqual from 'fast-deep-equal'; -import { merge, Observable, pipe } from 'rxjs'; -import { - debounceTime, - distinctUntilChanged, - filter, - map, - mapTo, - startWith, - switchMap, -} from 'rxjs/operators'; - -import { DashboardCapabilities } from './types'; -import { DashboardConstants } from '../dashboard_constants'; -import { DashboardStateManager } from './dashboard_state_manager'; -import { convertSavedDashboardPanelToPanelState } from '../../common/embeddable/embeddable_saved_object_converters'; -import { - DashboardPanelState, - DashboardContainer, - DashboardContainerInput, - SavedDashboardPanel, -} from '.'; - -import { getQueryParams } from '../services/kibana_utils'; -import { EmbeddablePackageState, isErrorEmbeddable } from '../services/embeddable'; -import { - esFilters, - FilterManager, - IndexPattern, - IndexPatternsContract, - QueryStart, -} from '../services/data'; - -export const getChangesFromAppStateForContainerState = ({ - dashboardContainer, - appStateDashboardInput, -}: { - dashboardContainer: DashboardContainer; - appStateDashboardInput: DashboardContainerInput; -}) => { - if (!dashboardContainer || isErrorEmbeddable(dashboardContainer)) { - return appStateDashboardInput; - } - const containerInput = dashboardContainer.getInput(); - const differences: Partial = {}; - - // Filters shouldn't be compared using regular isEqual - if ( - !esFilters.compareFilters( - containerInput.filters, - appStateDashboardInput.filters, - esFilters.COMPARE_ALL_OPTIONS - ) - ) { - differences.filters = appStateDashboardInput.filters; - } - - Object.keys( - _.omit(containerInput, [ - 'filters', - 'searchSessionId', - 'lastReloadRequestTime', - 'switchViewMode', - ]) - ).forEach((key) => { - const containerValue = (containerInput as { [key: string]: unknown })[key]; - const appStateValue = ((appStateDashboardInput as unknown) as { [key: string]: unknown })[key]; - if (!_.isEqual(containerValue, appStateValue)) { - (differences as { [key: string]: unknown })[key] = appStateValue; - } - }); - - // last reload request time can be undefined without causing a refresh - if ( - appStateDashboardInput.lastReloadRequestTime && - containerInput.lastReloadRequestTime !== appStateDashboardInput.lastReloadRequestTime - ) { - differences.lastReloadRequestTime = appStateDashboardInput.lastReloadRequestTime; - } - - // cloneDeep hack is needed, as there are multiple places, where container's input mutated, - // but values from appStateValue are deeply frozen, as they can't be mutated directly - return Object.values(differences).length === 0 ? undefined : _.cloneDeep(differences); -}; - -export const getDashboardContainerInput = ({ - query, - searchSessionId, - incomingEmbeddable, - isEmbeddedExternally, - lastReloadRequestTime, - dashboardStateManager, - dashboardCapabilities, -}: { - dashboardCapabilities: DashboardCapabilities; - dashboardStateManager: DashboardStateManager; - incomingEmbeddable?: EmbeddablePackageState; - lastReloadRequestTime?: number; - isEmbeddedExternally: boolean; - searchSessionId?: string; - query: QueryStart; -}): DashboardContainerInput => { - const embeddablesMap: { - [key: string]: DashboardPanelState; - } = {}; - dashboardStateManager.getPanels().forEach((panel: SavedDashboardPanel) => { - embeddablesMap[panel.panelIndex] = convertSavedDashboardPanelToPanelState(panel); - }); - - // If the incoming embeddable state's id already exists in the embeddables map, replace the input, retaining the existing gridData for that panel. - if (incomingEmbeddable?.embeddableId && embeddablesMap[incomingEmbeddable.embeddableId]) { - const originalPanelState = embeddablesMap[incomingEmbeddable.embeddableId]; - embeddablesMap[incomingEmbeddable.embeddableId] = { - gridData: originalPanelState.gridData, - type: incomingEmbeddable.type, - explicitInput: { - ...originalPanelState.explicitInput, - ...incomingEmbeddable.input, - id: incomingEmbeddable.embeddableId, - }, - }; - } - - return { - refreshConfig: query.timefilter.timefilter.getRefreshInterval(), - hidePanelTitles: dashboardStateManager.getHidePanelTitles(), - isFullScreenMode: dashboardStateManager.getFullScreenMode(), - expandedPanelId: dashboardStateManager.getExpandedPanelId(), - description: dashboardStateManager.getDescription(), - id: dashboardStateManager.savedDashboard.id || '', - useMargins: dashboardStateManager.getUseMargins(), - syncColors: dashboardStateManager.getSyncColors(), - viewMode: dashboardStateManager.getViewMode(), - filters: query.filterManager.getFilters(), - query: dashboardStateManager.getQuery(), - title: dashboardStateManager.getTitle(), - panels: embeddablesMap, - lastReloadRequestTime, - dashboardCapabilities, - isEmbeddedExternally, - searchSessionId, - timeRange: { - ..._.cloneDeep(query.timefilter.timefilter.getTime()), - }, - }; -}; - -export const getInputSubscription = ({ - dashboardContainer, - dashboardStateManager, - filterManager, -}: { - dashboardContainer: DashboardContainer; - dashboardStateManager: DashboardStateManager; - filterManager: FilterManager; -}) => - dashboardContainer.getInput$().subscribe(() => { - // This has to be first because handleDashboardContainerChanges causes - // appState.save which will cause refreshDashboardContainer to be called. - - if ( - !esFilters.compareFilters( - dashboardContainer.getInput().filters, - filterManager.getFilters(), - esFilters.COMPARE_ALL_OPTIONS - ) - ) { - // Add filters modifies the object passed to it, hence the clone deep. - filterManager.addFilters(_.cloneDeep(dashboardContainer.getInput().filters)); - - dashboardStateManager.applyFilters( - dashboardStateManager.getQuery(), - dashboardContainer.getInput().filters - ); - } - - dashboardStateManager.handleDashboardContainerChanges(dashboardContainer); - }); - -export const getOutputSubscription = ({ - dashboardContainer, - indexPatterns, - onUpdateIndexPatterns, -}: { - dashboardContainer: DashboardContainer; - indexPatterns: IndexPatternsContract; - onUpdateIndexPatterns: (newIndexPatterns: IndexPattern[]) => void; -}) => { - const updateIndexPatternsOperator = pipe( - filter((container: DashboardContainer) => !!container && !isErrorEmbeddable(container)), - map((container: DashboardContainer): IndexPattern[] => { - let panelIndexPatterns: IndexPattern[] = []; - Object.values(container.getChildIds()).forEach((id) => { - const embeddableInstance = container.getChild(id); - if (isErrorEmbeddable(embeddableInstance)) return; - const embeddableIndexPatterns = (embeddableInstance.getOutput() as any).indexPatterns; - if (!embeddableIndexPatterns) return; - panelIndexPatterns.push(...embeddableIndexPatterns); - }); - panelIndexPatterns = uniqBy(panelIndexPatterns, 'id'); - return panelIndexPatterns; - }), - distinctUntilChanged((a, b) => - deepEqual( - a.map((ip) => ip && ip.id), - b.map((ip) => ip && ip.id) - ) - ), - // using switchMap for previous task cancellation - switchMap((panelIndexPatterns: IndexPattern[]) => { - return new Observable((observer) => { - if (panelIndexPatterns && panelIndexPatterns.length > 0) { - if (observer.closed) return; - onUpdateIndexPatterns(panelIndexPatterns); - observer.complete(); - } else { - indexPatterns.getDefault().then((defaultIndexPattern) => { - if (observer.closed) return; - onUpdateIndexPatterns([defaultIndexPattern as IndexPattern]); - observer.complete(); - }); - } - }); - }) - ); - - return merge( - // output of dashboard container itself - dashboardContainer.getOutput$(), - // plus output of dashboard container children, - // children may change, so make sure we subscribe/unsubscribe with switchMap - dashboardContainer.getOutput$().pipe( - map(() => dashboardContainer!.getChildIds()), - distinctUntilChanged(deepEqual), - switchMap((newChildIds: string[]) => - merge(...newChildIds.map((childId) => dashboardContainer!.getChild(childId).getOutput$())) - ) - ) - ) - .pipe( - mapTo(dashboardContainer), - startWith(dashboardContainer), // to trigger initial index pattern update - updateIndexPatternsOperator - ) - .subscribe(); -}; - -export const getFiltersSubscription = ({ - query, - dashboardStateManager, -}: { - query: QueryStart; - dashboardStateManager: DashboardStateManager; -}) => { - return merge(query.filterManager.getUpdates$(), query.queryString.getUpdates$()) - .pipe(debounceTime(100)) - .subscribe(() => { - dashboardStateManager.applyFilters( - query.queryString.getQuery(), - query.filterManager.getFilters() - ); - }); -}; - -export const getSearchSessionIdFromURL = (history: History): string | undefined => - getQueryParams(history.location)[DashboardConstants.SEARCH_SESSION_ID] as string | undefined; diff --git a/src/plugins/dashboard/public/application/dashboard_router.tsx b/src/plugins/dashboard/public/application/dashboard_router.tsx index be279ed98492e7..e77353000ced46 100644 --- a/src/plugins/dashboard/public/application/dashboard_router.tsx +++ b/src/plugins/dashboard/public/application/dashboard_router.tsx @@ -8,36 +8,37 @@ import './index.scss'; import React from 'react'; +import { History } from 'history'; +import { Provider } from 'react-redux'; +import { first } from 'rxjs/operators'; import { I18nProvider } from '@kbn/i18n/react'; import { parse, ParsedQuery } from 'query-string'; import { render, unmountComponentAtNode } from 'react-dom'; import { Switch, Route, RouteComponentProps, HashRouter, Redirect } from 'react-router-dom'; -import { first } from 'rxjs/operators'; import { DashboardListing } from './listing'; +import { dashboardStateStore } from './state'; import { DashboardApp } from './dashboard_app'; -import { addHelpMenuToAppChrome, DashboardPanelStorage } from './lib'; +import { DashboardNoMatch } from './listing/dashboard_no_match'; +import { KibanaContextProvider } from '../services/kibana_react'; +import { addHelpMenuToAppChrome, DashboardSessionStorage } from './lib'; import { createDashboardListingFilterUrl } from '../dashboard_constants'; -import { getDashboardPageTitle, dashboardReadonlyBadge } from '../dashboard_strings'; import { createDashboardEditUrl, DashboardConstants } from '../dashboard_constants'; -import { DashboardAppServices, DashboardEmbedSettings, RedirectToProps } from './types'; +import { getDashboardPageTitle, dashboardReadonlyBadge } from '../dashboard_strings'; +import { createKbnUrlStateStorage, withNotifyOnErrors } from '../services/kibana_utils'; +import { DashboardAppServices, DashboardEmbedSettings, RedirectToProps } from '../types'; import { DashboardFeatureFlagConfig, DashboardSetupDependencies, DashboardStart, DashboardStartDependencies, } from '../plugin'; - -import { createKbnUrlStateStorage, withNotifyOnErrors } from '../services/kibana_utils'; -import { KibanaContextProvider } from '../services/kibana_react'; - import { AppMountParameters, CoreSetup, PluginInitializerContext, ScopedHistory, } from '../services/core'; -import { DashboardNoMatch } from './listing/dashboard_no_match'; export const dashboardUrlParams = { showTopMenu: 'show-top-menu', @@ -89,12 +90,14 @@ export async function mountApp({ const activeSpaceId = spacesApi && (await spacesApi.getActiveSpace$().pipe(first()).toPromise())?.id; let globalEmbedSettings: DashboardEmbedSettings | undefined; + let routerHistory: History; const dashboardServices: DashboardAppServices = { navigation, onAppLeave, savedObjects, urlForwarding, + visualizations, usageCollection, core: coreStart, data: dataStart, @@ -109,10 +112,6 @@ export async function mountApp({ indexPatterns: dataStart.indexPatterns, savedQueryService: dataStart.query.savedQueries, savedObjectsClient: coreStart.savedObjects.client, - dashboardPanelStorage: new DashboardPanelStorage( - core.notifications.toasts, - activeSpaceId || 'default' - ), savedDashboards: dashboardStart.getSavedDashboardLoader(), savedObjectsTagging: savedObjectsTaggingOss?.getTaggingApi(), allowByValueEmbeddables: initializerContext.config.get() @@ -127,7 +126,10 @@ export async function mountApp({ visualizeCapabilities: { save: Boolean(coreStart.application.capabilities.visualize?.save) }, storeSearchSession: Boolean(coreStart.application.capabilities.dashboard.storeSearchSession), }, - visualizations, + dashboardSessionStorage: new DashboardSessionStorage( + core.notifications.toasts, + activeSpaceId || 'default' + ), }; const getUrlStateStorage = (history: RouteComponentProps['history']) => @@ -137,10 +139,9 @@ export async function mountApp({ ...withNotifyOnErrors(core.notifications.toasts), }); - const redirect = (routeProps: RouteComponentProps, redirectTo: RedirectToProps) => { - const historyFunction = redirectTo.useReplace - ? routeProps.history.replace - : routeProps.history.push; + const redirect = (redirectTo: RedirectToProps) => { + if (!routerHistory) return; + const historyFunction = redirectTo.useReplace ? routerHistory.replace : routerHistory.push; let destination; if (redirectTo.destination === 'dashboard') { destination = redirectTo.id @@ -168,12 +169,15 @@ export async function mountApp({ if (routeParams.embed && !globalEmbedSettings) { globalEmbedSettings = getDashboardEmbedSettings(routeParams); } + if (!routerHistory) { + routerHistory = routeProps.history; + } return ( redirect(routeProps, props)} + redirectTo={redirect} /> ); }; @@ -183,13 +187,15 @@ export async function mountApp({ const routeParams = parse(routeProps.history.location.search); const title = (routeParams.title as string) || undefined; const filter = (routeParams.filter as string) || undefined; - + if (!routerHistory) { + routerHistory = routeProps.history; + } return ( redirect(routeProps, props)} + redirectTo={redirect} /> ); }; @@ -215,26 +221,32 @@ export async function mountApp({ const app = ( - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + ); diff --git a/src/plugins/dashboard/public/application/dashboard_state.test.ts b/src/plugins/dashboard/public/application/dashboard_state.test.ts deleted file mode 100644 index ffe5c80febe026..00000000000000 --- a/src/plugins/dashboard/public/application/dashboard_state.test.ts +++ /dev/null @@ -1,272 +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 { createBrowserHistory } from 'history'; -import { getSavedDashboardMock } from './test_helpers'; -import { DashboardContainer, DashboardContainerInput, DashboardPanelState } from '.'; -import { DashboardStateManager } from './dashboard_state_manager'; -import { DashboardContainerServices } from './embeddable/dashboard_container'; - -import { EmbeddableInput, ViewMode } from '../services/embeddable'; -import { createKbnUrlStateStorage } from '../services/kibana_utils'; -import { InputTimeRange, TimefilterContract, TimeRange } from '../services/data'; - -import { embeddablePluginMock } from 'src/plugins/embeddable/public/mocks'; -import { coreMock } from '../../../../core/public/mocks'; - -describe('DashboardState', function () { - let dashboardState: DashboardStateManager; - const savedDashboard = getSavedDashboardMock(); - - let mockTime: TimeRange = { to: 'now', from: 'now-15m' }; - const mockTimefilter = { - getTime: () => { - return mockTime; - }, - setTime: (time: InputTimeRange) => { - mockTime = time as TimeRange; - }, - } as TimefilterContract; - - // TS is *very* picky with type guards / predicates. can't just use jest.fn() - function mockHasTaggingCapabilities(obj: any): obj is any { - return false; - } - - function initDashboardState() { - dashboardState = new DashboardStateManager({ - savedDashboard, - hideWriteControls: false, - allowByValueEmbeddables: false, - hasPendingEmbeddable: () => false, - kibanaVersion: '7.0.0', - kbnUrlStateStorage: createKbnUrlStateStorage(), - history: createBrowserHistory(), - toasts: coreMock.createStart().notifications.toasts, - hasTaggingCapabilities: mockHasTaggingCapabilities, - }); - } - - function initDashboardContainer(initialInput?: Partial) { - const { doStart } = embeddablePluginMock.createInstance(); - const defaultInput: DashboardContainerInput = { - id: '123', - viewMode: ViewMode.EDIT, - filters: [] as DashboardContainerInput['filters'], - query: {} as DashboardContainerInput['query'], - timeRange: {} as DashboardContainerInput['timeRange'], - useMargins: true, - syncColors: false, - title: 'ultra awesome test dashboard', - isFullScreenMode: false, - panels: {} as DashboardContainerInput['panels'], - }; - const input = { ...defaultInput, ...(initialInput ?? {}) }; - return new DashboardContainer(input, { embeddable: doStart() } as DashboardContainerServices); - } - - describe('syncTimefilterWithDashboard', function () { - test('syncs quick time', function () { - savedDashboard.timeRestore = true; - savedDashboard.timeFrom = 'now/w'; - savedDashboard.timeTo = 'now/w'; - - mockTime.from = '2015-09-19 06:31:44.000'; - mockTime.to = '2015-09-29 06:31:44.000'; - - initDashboardState(); - dashboardState.syncTimefilterWithDashboardTime(mockTimefilter); - - expect(mockTime.to).toBe('now/w'); - expect(mockTime.from).toBe('now/w'); - }); - - test('syncs relative time', function () { - savedDashboard.timeRestore = true; - savedDashboard.timeFrom = 'now-13d'; - savedDashboard.timeTo = 'now'; - - mockTime.from = '2015-09-19 06:31:44.000'; - mockTime.to = '2015-09-29 06:31:44.000'; - - initDashboardState(); - dashboardState.syncTimefilterWithDashboardTime(mockTimefilter); - - expect(mockTime.to).toBe('now'); - expect(mockTime.from).toBe('now-13d'); - }); - - test('syncs absolute time', function () { - savedDashboard.timeRestore = true; - savedDashboard.timeFrom = '2015-09-19 06:31:44.000'; - savedDashboard.timeTo = '2015-09-29 06:31:44.000'; - - mockTime.from = 'now/w'; - mockTime.to = 'now/w'; - - initDashboardState(); - dashboardState.syncTimefilterWithDashboardTime(mockTimefilter); - - expect(mockTime.to).toBe(savedDashboard.timeTo); - expect(mockTime.from).toBe(savedDashboard.timeFrom); - }); - }); - - describe('Dashboard Container Changes', () => { - beforeEach(() => { - initDashboardState(); - }); - - test('expanedPanelId in container input casues state update', () => { - dashboardState.setExpandedPanelId = jest.fn(); - - const dashboardContainer = initDashboardContainer({ - expandedPanelId: 'theCoolestPanelOnThisDashboard', - panels: { - theCoolestPanelOnThisDashboard: { - explicitInput: { id: 'theCoolestPanelOnThisDashboard' }, - } as DashboardPanelState, - }, - }); - - dashboardState.handleDashboardContainerChanges(dashboardContainer); - expect(dashboardState.setExpandedPanelId).toHaveBeenCalledWith( - 'theCoolestPanelOnThisDashboard' - ); - }); - - test('expanedPanelId is not updated when it is the same', () => { - dashboardState.setExpandedPanelId = jest - .fn() - .mockImplementation(dashboardState.setExpandedPanelId); - - const dashboardContainer = initDashboardContainer({ - expandedPanelId: 'theCoolestPanelOnThisDashboard', - panels: { - theCoolestPanelOnThisDashboard: { - explicitInput: { id: 'theCoolestPanelOnThisDashboard' }, - } as DashboardPanelState, - }, - }); - - dashboardState.handleDashboardContainerChanges(dashboardContainer); - dashboardState.handleDashboardContainerChanges(dashboardContainer); - expect(dashboardState.setExpandedPanelId).toHaveBeenCalledTimes(1); - }); - - test('expandedPanelId is set to undefined if panel does not exist in input', () => { - dashboardState.setExpandedPanelId = jest - .fn() - .mockImplementation(dashboardState.setExpandedPanelId); - const dashboardContainer = initDashboardContainer({ - expandedPanelId: 'theCoolestPanelOnThisDashboard', - panels: { - theCoolestPanelOnThisDashboard: { - explicitInput: { id: 'theCoolestPanelOnThisDashboard' }, - } as DashboardPanelState, - }, - }); - - dashboardState.handleDashboardContainerChanges(dashboardContainer); - expect(dashboardState.setExpandedPanelId).toHaveBeenCalledWith( - 'theCoolestPanelOnThisDashboard' - ); - - dashboardContainer.updateInput({ expandedPanelId: 'theLeastCoolPanelOnThisDashboard' }); - dashboardState.handleDashboardContainerChanges(dashboardContainer); - expect(dashboardState.setExpandedPanelId).toHaveBeenCalledWith(undefined); - }); - }); - - describe('isDirty', function () { - beforeAll(() => { - initDashboardState(); - }); - - test('getIsDirty is true if isDirty is true and editing', () => { - dashboardState.switchViewMode(ViewMode.EDIT); - dashboardState.isDirty = true; - expect(dashboardState.getIsDirty()).toBeTruthy(); - }); - - test('getIsDirty is false if isDirty is true and editing', () => { - dashboardState.switchViewMode(ViewMode.VIEW); - dashboardState.isDirty = true; - expect(dashboardState.getIsDirty()).toBeFalsy(); - }); - }); - - describe('initial view mode', () => { - test('initial view mode set to view when hideWriteControls is true', () => { - const initialViewModeDashboardState = new DashboardStateManager({ - savedDashboard, - hideWriteControls: true, - allowByValueEmbeddables: false, - hasPendingEmbeddable: () => false, - kibanaVersion: '7.0.0', - kbnUrlStateStorage: createKbnUrlStateStorage(), - history: createBrowserHistory(), - toasts: coreMock.createStart().notifications.toasts, - hasTaggingCapabilities: mockHasTaggingCapabilities, - }); - expect(initialViewModeDashboardState.getViewMode()).toBe(ViewMode.VIEW); - }); - - test('initial view mode set to edit if edit mode specified in URL', () => { - const kbnUrlStateStorage = createKbnUrlStateStorage(); - kbnUrlStateStorage.set('_a', { viewMode: ViewMode.EDIT }); - - const initialViewModeDashboardState = new DashboardStateManager({ - savedDashboard, - kbnUrlStateStorage, - kibanaVersion: '7.0.0', - hideWriteControls: false, - allowByValueEmbeddables: false, - history: createBrowserHistory(), - hasPendingEmbeddable: () => false, - toasts: coreMock.createStart().notifications.toasts, - hasTaggingCapabilities: mockHasTaggingCapabilities, - }); - expect(initialViewModeDashboardState.getViewMode()).toBe(ViewMode.EDIT); - }); - - test('initial view mode set to edit if the dashboard is new', () => { - const newDashboard = getSavedDashboardMock(); - newDashboard.id = undefined; - const initialViewModeDashboardState = new DashboardStateManager({ - savedDashboard: newDashboard, - kibanaVersion: '7.0.0', - hideWriteControls: false, - allowByValueEmbeddables: false, - history: createBrowserHistory(), - hasPendingEmbeddable: () => false, - kbnUrlStateStorage: createKbnUrlStateStorage(), - toasts: coreMock.createStart().notifications.toasts, - hasTaggingCapabilities: mockHasTaggingCapabilities, - }); - expect(initialViewModeDashboardState.getViewMode()).toBe(ViewMode.EDIT); - }); - - test('initial view mode set to edit if there is a pending embeddable', () => { - const newDashboard = getSavedDashboardMock(); - newDashboard.id = undefined; - const initialViewModeDashboardState = new DashboardStateManager({ - savedDashboard: newDashboard, - kibanaVersion: '7.0.0', - hideWriteControls: false, - allowByValueEmbeddables: false, - history: createBrowserHistory(), - hasPendingEmbeddable: () => true, - kbnUrlStateStorage: createKbnUrlStateStorage(), - toasts: coreMock.createStart().notifications.toasts, - hasTaggingCapabilities: mockHasTaggingCapabilities, - }); - expect(initialViewModeDashboardState.getViewMode()).toBe(ViewMode.EDIT); - }); - }); -}); diff --git a/src/plugins/dashboard/public/application/dashboard_state_manager.ts b/src/plugins/dashboard/public/application/dashboard_state_manager.ts deleted file mode 100644 index 58b413f4303e66..00000000000000 --- a/src/plugins/dashboard/public/application/dashboard_state_manager.ts +++ /dev/null @@ -1,771 +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 _ from 'lodash'; -import { Moment } from 'moment'; -import { i18n } from '@kbn/i18n'; -import { History } from 'history'; -import { Observable, Subscription } from 'rxjs'; - -import { FilterUtils } from './lib/filter_utils'; -import { DashboardContainer } from './embeddable'; -import { DashboardSavedObject } from '../saved_dashboards'; -import { migrateLegacyQuery } from './lib/migrate_legacy_query'; -import { - getAppStateDefaults, - migrateAppState, - getDashboardIdFromUrl, - DashboardPanelStorage, -} from './lib'; -import { convertPanelStateToSavedDashboardPanel } from '../../common/embeddable/embeddable_saved_object_converters'; -import { - DashboardAppState, - DashboardAppStateDefaults, - DashboardAppStateInUrl, - DashboardAppStateTransitions, - SavedDashboardPanel, -} from '../types'; - -import { ViewMode } from '../services/embeddable'; -import { UsageCollectionSetup } from '../services/usage_collection'; -import { Filter, Query, TimefilterContract as Timefilter } from '../services/data'; -import type { SavedObjectTagDecoratorTypeGuard } from '../services/saved_objects_tagging_oss'; -import { - createStateContainer, - IKbnUrlStateStorage, - ISyncStateRef, - ReduxLikeStateContainer, - syncState, -} from '../services/kibana_utils'; -import { STATE_STORAGE_KEY } from '../url_generator'; -import { NotificationsStart } from '../services/core'; -import { getMigratedToastText } from '../dashboard_strings'; - -/** - * Dashboard state manager handles connecting angular and redux state between the angular and react portions of the - * app. There are two "sources of truth" that need to stay in sync - AppState (aka the `_a` portion of the url) and - * the Store. They aren't complete duplicates of each other as AppState has state that the Store doesn't, and vice - * versa. They should be as decoupled as possible so updating the store won't affect bwc of urls. - */ -export class DashboardStateManager { - public savedDashboard: DashboardSavedObject; - public lastSavedDashboardFilters: { - timeTo?: string | Moment; - timeFrom?: string | Moment; - filterBars: Filter[]; - query: Query; - }; - private stateDefaults: DashboardAppStateDefaults; - private toasts: NotificationsStart['toasts']; - private hideWriteControls: boolean; - private kibanaVersion: string; - public isDirty: boolean; - private changeListeners: Array<(status: { dirty: boolean }) => void>; - private hasShownMigrationToast = false; - - public get appState(): DashboardAppState { - return this.stateContainer.get(); - } - - public get appState$(): Observable { - return this.stateContainer.state$; - } - - private readonly stateContainer: ReduxLikeStateContainer< - DashboardAppState, - DashboardAppStateTransitions - >; - private readonly stateContainerChangeSub: Subscription; - private readonly dashboardPanelStorage?: DashboardPanelStorage; - public readonly kbnUrlStateStorage: IKbnUrlStateStorage; - private readonly stateSyncRef: ISyncStateRef; - private readonly allowByValueEmbeddables: boolean; - - private readonly usageCollection: UsageCollectionSetup | undefined; - public readonly hasTaggingCapabilities: SavedObjectTagDecoratorTypeGuard; - private hasPendingEmbeddable: () => boolean; - - /** - * - * @param savedDashboard - * @param hideWriteControls true if write controls should be hidden. - * @param kibanaVersion current kibanaVersion - * @param - */ - constructor({ - toasts, - history, - kibanaVersion, - savedDashboard, - usageCollection, - hideWriteControls, - kbnUrlStateStorage, - hasPendingEmbeddable, - dashboardPanelStorage, - hasTaggingCapabilities, - allowByValueEmbeddables, - }: { - history: History; - kibanaVersion: string; - hideWriteControls: boolean; - hasPendingEmbeddable: () => boolean; - allowByValueEmbeddables: boolean; - savedDashboard: DashboardSavedObject; - toasts: NotificationsStart['toasts']; - usageCollection?: UsageCollectionSetup; - kbnUrlStateStorage: IKbnUrlStateStorage; - dashboardPanelStorage?: DashboardPanelStorage; - hasTaggingCapabilities: SavedObjectTagDecoratorTypeGuard; - }) { - this.toasts = toasts; - this.kibanaVersion = kibanaVersion; - this.savedDashboard = savedDashboard; - this.hideWriteControls = hideWriteControls; - this.usageCollection = usageCollection; - this.hasTaggingCapabilities = hasTaggingCapabilities; - this.allowByValueEmbeddables = allowByValueEmbeddables; - this.hasPendingEmbeddable = hasPendingEmbeddable; - this.dashboardPanelStorage = dashboardPanelStorage; - this.kbnUrlStateStorage = kbnUrlStateStorage; - - // get state defaults from saved dashboard, make sure it is migrated - const viewMode = this.getInitialViewMode(); - this.stateDefaults = migrateAppState( - getAppStateDefaults(viewMode, this.savedDashboard, this.hasTaggingCapabilities), - kibanaVersion, - usageCollection - ); - - // setup initial state by merging defaults with state from url & panels storage - // also run migration, as state in url could be of older version - const initialUrlState = this.kbnUrlStateStorage.get(STATE_STORAGE_KEY); - - const initialState = migrateAppState( - { - ...this.stateDefaults, - ...this.getUnsavedPanelState(), - ...initialUrlState, - }, - kibanaVersion, - usageCollection - ); - - this.isDirty = false; - - if (initialUrlState?.panels && !_.isEqual(initialUrlState.panels, this.stateDefaults.panels)) { - this.isDirty = true; - this.setUnsavedPanels(initialState.panels); - } - - // setup state container using initial state both from defaults and from url - this.stateContainer = createStateContainer( - initialState, - { - set: (state) => (prop, value) => ({ ...state, [prop]: value }), - setOption: (state) => (option, value) => ({ - ...state, - options: { - ...state.options, - [option]: value, - }, - }), - } - ); - - // We can't compare the filters stored on this.appState to this.savedDashboard because in order to apply - // the filters to the visualizations, we need to save it on the dashboard. We keep track of the original - // filter state in order to let the user know if their filters changed and provide this specific information - // in the 'lose changes' warning message. - this.lastSavedDashboardFilters = this.getFilterState(); - - this.changeListeners = []; - - this.stateContainerChangeSub = this.stateContainer.state$.subscribe(() => { - this.isDirty = this.checkIsDirty(); - this.changeListeners.forEach((listener) => listener({ dirty: this.isDirty })); - }); - - // setup state syncing utils. state container will be synced with url into `STATE_STORAGE_KEY` query param - this.stateSyncRef = syncState({ - storageKey: STATE_STORAGE_KEY, - stateContainer: { - ...this.stateContainer, - get: () => this.toUrlState(this.stateContainer.get()), - set: (stateFromUrl: DashboardAppStateInUrl | null) => { - // sync state required state container to be able to handle null - // overriding set() so it could handle null coming from url - if (stateFromUrl) { - // Skip this update if current dashboardId in the url is different from what we have in the current instance of state manager - // As dashboard is driven by angular at the moment, the destroy cycle happens async, - // If the dashboardId has changed it means this instance - // is going to be destroyed soon and we shouldn't sync state anymore, - // as it could potentially trigger further url updates - const currentDashboardIdInUrl = getDashboardIdFromUrl(history.location.pathname); - if (currentDashboardIdInUrl !== this.savedDashboard.id) return; - - // set View mode before the rest of the state so unsaved panels can be added correctly. - if (this.appState.viewMode !== stateFromUrl.viewMode) { - this.switchViewMode(stateFromUrl.viewMode); - } - - this.stateContainer.set({ - ...this.stateDefaults, - ...this.getUnsavedPanelState(), - ...stateFromUrl, - }); - } else { - // Do nothing in case when state from url is empty, - // this fixes: https://github.com/elastic/kibana/issues/57789 - // There are not much cases when state in url could become empty: - // 1. User manually removed `_a` from the url - // 2. Browser is navigating away from the page and most likely there is no `_a` in the url. - // In this case we don't want to do any state updates - // and just allow $scope.$on('destroy') fire later and clean up everything - } - }, - }, - stateStorage: this.kbnUrlStateStorage, - }); - } - - public startStateSyncing() { - this.saveState({ replace: true }); - this.stateSyncRef.start(); - } - - public registerChangeListener(callback: (status: { dirty: boolean }) => void) { - this.changeListeners.push(callback); - } - - public handleDashboardContainerChanges(dashboardContainer: DashboardContainer) { - let dirty = false; - let dirtyBecauseOfInitialStateMigration = false; - - const savedDashboardPanelMap: { [key: string]: SavedDashboardPanel } = {}; - - const input = dashboardContainer.getInput(); - - this.getPanels().forEach((savedDashboardPanel) => { - if (input.panels[savedDashboardPanel.panelIndex] !== undefined) { - savedDashboardPanelMap[savedDashboardPanel.panelIndex] = savedDashboardPanel; - } else { - // A panel was deleted. - dirty = true; - } - }); - - const convertedPanelStateMap: { [key: string]: SavedDashboardPanel } = {}; - - let expandedPanelValid = false; - Object.values(input.panels).forEach((panelState) => { - if (savedDashboardPanelMap[panelState.explicitInput.id] === undefined) { - dirty = true; - } - - if (panelState.explicitInput.id === input.expandedPanelId) { - expandedPanelValid = true; - } - - convertedPanelStateMap[panelState.explicitInput.id] = convertPanelStateToSavedDashboardPanel( - panelState, - this.kibanaVersion - ); - - if ( - !_.isEqual( - convertedPanelStateMap[panelState.explicitInput.id], - savedDashboardPanelMap[panelState.explicitInput.id] - ) - ) { - // A panel was changed - dirty = true; - - const oldVersion = savedDashboardPanelMap[panelState.explicitInput.id]?.version; - const newVersion = convertedPanelStateMap[panelState.explicitInput.id]?.version; - if (oldVersion && newVersion && oldVersion !== newVersion) { - dirtyBecauseOfInitialStateMigration = true; - } - } - }); - - if (dirty) { - this.stateContainer.transitions.set('panels', Object.values(convertedPanelStateMap)); - if (dirtyBecauseOfInitialStateMigration) { - if (this.getIsEditMode() && !this.hasShownMigrationToast) { - this.toasts.addSuccess(getMigratedToastText()); - this.hasShownMigrationToast = true; - } - this.saveState({ replace: true }); - } - - // If a panel has been changed, and the state is now equal to the state in the saved object, remove the unsaved panels - if (!this.isDirty && this.getIsEditMode()) { - this.clearUnsavedPanels(); - } else { - this.setUnsavedPanels(this.getPanels()); - } - } - - if (input.isFullScreenMode !== this.getFullScreenMode()) { - this.setFullScreenMode(input.isFullScreenMode); - } - - if (expandedPanelValid && input.expandedPanelId !== this.getExpandedPanelId()) { - this.setExpandedPanelId(input.expandedPanelId); - } else if (!expandedPanelValid && this.getExpandedPanelId()) { - this.setExpandedPanelId(undefined); - } - - if (!_.isEqual(input.query, this.getQuery())) { - this.setQuery(input.query); - } - - this.changeListeners.forEach((listener) => listener({ dirty })); - } - - public getFullScreenMode() { - return this.appState.fullScreenMode; - } - - public setFullScreenMode(fullScreenMode: boolean) { - this.stateContainer.transitions.set('fullScreenMode', fullScreenMode); - } - - public getExpandedPanelId() { - return this.appState.expandedPanelId; - } - - public setExpandedPanelId(expandedPanelId?: string) { - this.stateContainer.transitions.set('expandedPanelId', expandedPanelId); - } - - public setFilters(filters: Filter[]) { - this.stateContainer.transitions.set('filters', filters); - } - - /** - * Resets the state back to the last saved version of the dashboard. - */ - public resetState() { - // In order to show the correct warning, we have to store the unsaved - // title on the dashboard object. We should fix this at some point, but this is how all the other object - // save panels work at the moment. - this.savedDashboard.title = this.savedDashboard.lastSavedTitle; - - // appState.reset uses the internal defaults to reset the state, but some of the default settings (e.g. the panels - // array) point to the same object that is stored on appState and is getting modified. - // The right way to fix this might be to ensure the defaults object stored on state is a deep - // clone, but given how much code uses the state object, I determined that to be too risky of a change for - // now. TODO: revisit this! - const currentViewMode = this.stateContainer.get().viewMode; - this.stateDefaults = migrateAppState( - getAppStateDefaults(currentViewMode, this.savedDashboard, this.hasTaggingCapabilities), - this.kibanaVersion, - this.usageCollection - ); - // The original query won't be restored by the above because the query on this.savedDashboard is applied - // in place in order for it to affect the visualizations. - this.stateDefaults.query = this.lastSavedDashboardFilters.query; - // Need to make a copy to ensure they are not overwritten. - this.stateDefaults.filters = [...this.getLastSavedFilterBars()]; - this.isDirty = false; - - this.stateContainer.set(this.stateDefaults); - } - - /** - * Returns an object which contains the current filter state of this.savedDashboard. - */ - public getFilterState() { - return { - timeTo: this.savedDashboard.timeTo, - timeFrom: this.savedDashboard.timeFrom, - filterBars: this.savedDashboard.getFilters(), - query: this.savedDashboard.getQuery(), - }; - } - - public getTitle() { - return this.appState.title; - } - - public isSaved() { - return !!this.savedDashboard.id; - } - - public isNew() { - return !this.isSaved(); - } - - public getDescription() { - return this.appState.description; - } - - public getTags() { - return this.appState.tags; - } - - public setDescription(description: string) { - this.stateContainer.transitions.set('description', description); - } - - public setTitle(title: string) { - this.savedDashboard.title = title; - this.stateContainer.transitions.set('title', title); - } - - public setTags(tags: string[]) { - this.stateContainer.transitions.set('tags', tags); - } - - public getAppState() { - return this.stateContainer.get(); - } - - public getQuery(): Query { - return migrateLegacyQuery(this.stateContainer.get().query); - } - - public getSavedQueryId() { - return this.stateContainer.get().savedQuery; - } - - public setSavedQueryId(id?: string) { - this.stateContainer.transitions.set('savedQuery', id); - } - - public getUseMargins() { - // Existing dashboards that don't define this should default to false. - return this.appState.options.useMargins === undefined - ? false - : this.appState.options.useMargins; - } - - public setUseMargins(useMargins: boolean) { - this.stateContainer.transitions.setOption('useMargins', useMargins); - } - - public getSyncColors() { - // Existing dashboards that don't define this should default to true. - return this.appState.options.syncColors === undefined ? true : this.appState.options.syncColors; - } - - public setSyncColors(syncColors: boolean) { - this.stateContainer.transitions.setOption('syncColors', syncColors); - } - - public getHidePanelTitles() { - return this.appState.options.hidePanelTitles; - } - - public setHidePanelTitles(hidePanelTitles: boolean) { - this.stateContainer.transitions.setOption('hidePanelTitles', hidePanelTitles); - } - - public getTimeRestore() { - return this.appState.timeRestore; - } - - public setTimeRestore(timeRestore: boolean) { - this.stateContainer.transitions.set('timeRestore', timeRestore); - } - - public getIsTimeSavedWithDashboard() { - return this.savedDashboard.timeRestore; - } - - public getLastSavedFilterBars(): Filter[] { - return this.lastSavedDashboardFilters.filterBars; - } - - public getLastSavedQuery() { - return this.lastSavedDashboardFilters.query; - } - - /** - * @returns True if the query changed since the last time the dashboard was saved, or if it's a - * new dashboard, if the query differs from the default. - */ - public getQueryChanged() { - const currentQuery = this.appState.query; - const lastSavedQuery = this.getLastSavedQuery(); - - const query = migrateLegacyQuery(currentQuery); - - const isLegacyStringQuery = - _.isString(lastSavedQuery) && _.isPlainObject(currentQuery) && _.has(currentQuery, 'query'); - if (isLegacyStringQuery) { - return lastSavedQuery !== query.query; - } - - return !_.isEqual(currentQuery, lastSavedQuery); - } - - /** - * @returns True if the filter bar state has changed since the last time the dashboard was saved, - * or if it's a new dashboard, if the query differs from the default. - */ - public getFilterBarChanged() { - return !_.isEqual( - FilterUtils.cleanFiltersForComparison(this.appState.filters), - FilterUtils.cleanFiltersForComparison(this.getLastSavedFilterBars()) - ); - } - - /** - * @param timeFilter - * @returns True if the time state has changed since the time saved with the dashboard. - */ - public getTimeChanged(timeFilter: Timefilter) { - return ( - !FilterUtils.areTimesEqual( - this.lastSavedDashboardFilters.timeFrom, - timeFilter.getTime().from - ) || - !FilterUtils.areTimesEqual(this.lastSavedDashboardFilters.timeTo, timeFilter.getTime().to) - ); - } - - public getViewMode() { - if (this.hideWriteControls) { - return ViewMode.VIEW; - } - if (this.stateContainer) { - return this.appState.viewMode; - } - // get viewMode should work properly even before the state container is created - return this.getInitialViewMode(); - } - - public getIsViewMode() { - return this.getViewMode() === ViewMode.VIEW; - } - - public getIsEditMode() { - return this.getViewMode() === ViewMode.EDIT; - } - - /** - * - * @returns True if the dashboard has changed since the last save (or, is new). - */ - public getIsDirty(timeFilter?: Timefilter) { - // Filter bar comparison is done manually (see cleanFiltersForComparison for the reason) and time picker - // changes are not tracked by the state monitor. - const hasTimeFilterChanged = timeFilter ? this.getFiltersChanged(timeFilter) : false; - return ( - this.hasUnsavedPanelState() || - (this.getIsEditMode() && (this.isDirty || hasTimeFilterChanged)) - ); - } - - public getPanels(): SavedDashboardPanel[] { - return this.appState.panels; - } - - public updatePanel(panelIndex: string, panelAttributes: any) { - const foundPanel = this.getPanels().find( - (panel: SavedDashboardPanel) => panel.panelIndex === panelIndex - ); - Object.assign(foundPanel, panelAttributes); - return foundPanel; - } - - /** - * @param timeFilter - * @returns An array of user friendly strings indicating the filter types that have changed. - */ - public getChangedFilterTypes(timeFilter: Timefilter) { - const changedFilters = []; - if (this.getFilterBarChanged()) { - changedFilters.push('filter'); - } - if (this.getQueryChanged()) { - changedFilters.push('query'); - } - if (this.savedDashboard.timeRestore && this.getTimeChanged(timeFilter)) { - changedFilters.push('time range'); - } - return changedFilters; - } - - /** - * @returns True if filters (query, filter bar filters, and time picker if time is stored - * with the dashboard) have changed since the last saved state (or if the dashboard hasn't been saved, - * the default state). - */ - public getFiltersChanged(timeFilter: Timefilter) { - return this.getChangedFilterTypes(timeFilter).length > 0; - } - - /** - * Updates timeFilter to match the time saved with the dashboard. - * @param timeFilter - * @param timeFilter.setTime - * @param timeFilter.setRefreshInterval - */ - public syncTimefilterWithDashboardTime(timeFilter: Timefilter) { - if (!this.getIsTimeSavedWithDashboard()) { - throw new Error( - i18n.translate('dashboard.stateManager.timeNotSavedWithDashboardErrorMessage', { - defaultMessage: 'The time is not saved with this dashboard so should not be synced.', - }) - ); - } - - if (this.savedDashboard.timeFrom && this.savedDashboard.timeTo) { - timeFilter.setTime({ - from: this.savedDashboard.timeFrom, - to: this.savedDashboard.timeTo, - }); - } - } - - /** - * Updates timeFilter to match the refreshInterval saved with the dashboard. - * @param timeFilter - */ - public syncTimefilterWithDashboardRefreshInterval(timeFilter: Timefilter) { - if (!this.getIsTimeSavedWithDashboard()) { - throw new Error( - i18n.translate('dashboard.stateManager.timeNotSavedWithDashboardErrorMessage', { - defaultMessage: 'The time is not saved with this dashboard so should not be synced.', - }) - ); - } - - if (this.savedDashboard.refreshInterval) { - timeFilter.setRefreshInterval(this.savedDashboard.refreshInterval); - } - } - - /** - * Synchronously writes current state to url - * returned boolean indicates whether the update happened and if history was updated - */ - private saveState({ replace }: { replace: boolean }): boolean { - // schedules setting current state to url - this.kbnUrlStateStorage.set( - STATE_STORAGE_KEY, - this.toUrlState(this.stateContainer.get()) - ); - // immediately forces scheduled updates and changes location - return !!this.kbnUrlStateStorage.kbnUrlControls.flush(replace); - } - - public setQuery(query: Query) { - this.stateContainer.transitions.set('query', query); - } - - /** - * Applies the current filter state to the dashboard. - * @param filter An array of filter bar filters. - */ - public applyFilters(query: Query, filters: Filter[]) { - this.savedDashboard.searchSource.setField('query', query); - this.savedDashboard.searchSource.setField('filter', filters); - this.stateContainer.transitions.set('query', query); - } - - public switchViewMode(newMode: ViewMode) { - this.stateContainer.transitions.set('viewMode', newMode); - this.restorePanels(); - } - - /** - * Destroys and cleans up this object when it's no longer used. - */ - public destroy() { - this.stateContainerChangeSub.unsubscribe(); - this.savedDashboard.destroy(); - if (this.stateSyncRef) { - this.stateSyncRef.stop(); - } - } - - public restorePanels() { - const unsavedState = this.getUnsavedPanelState(); - if (!unsavedState || unsavedState.panels?.length === 0) { - return; - } - this.stateContainer.set( - migrateAppState( - { - ...this.stateDefaults, - ...unsavedState, - ...this.kbnUrlStateStorage.get(STATE_STORAGE_KEY), - viewMode: this.getViewMode(), - }, - this.kibanaVersion, - this.usageCollection - ) - ); - } - - public clearUnsavedPanels() { - if (!this.allowByValueEmbeddables || !this.dashboardPanelStorage) { - return; - } - this.dashboardPanelStorage.clearPanels(this.savedDashboard?.id); - } - - public hasUnsavedPanelState(): boolean { - const panels = this.dashboardPanelStorage?.getPanels(this.savedDashboard?.id); - return panels !== undefined && panels.length > 0; - } - - private getUnsavedPanelState(): { panels?: SavedDashboardPanel[] } { - if (!this.allowByValueEmbeddables || this.getIsViewMode() || !this.dashboardPanelStorage) { - return {}; - } - const panels = this.dashboardPanelStorage.getPanels(this.savedDashboard?.id); - return panels ? { panels } : {}; - } - - private setUnsavedPanels(newPanels: SavedDashboardPanel[]) { - if ( - !this.allowByValueEmbeddables || - this.getIsViewMode() || - !this.getIsDirty() || - !this.dashboardPanelStorage - ) { - return; - } - this.dashboardPanelStorage.setPanels(this.savedDashboard?.id, newPanels); - } - - private toUrlState(state: DashboardAppState): DashboardAppStateInUrl { - if (this.getIsEditMode() && !this.allowByValueEmbeddables) { - return state; - } - const { panels, ...stateWithoutPanels } = state; - return stateWithoutPanels; - } - - private getInitialViewMode() { - if (this.hideWriteControls) { - return ViewMode.VIEW; - } - const viewModeFromUrl = this.kbnUrlStateStorage.get(STATE_STORAGE_KEY) - ?.viewMode; - if (viewModeFromUrl) { - return viewModeFromUrl; - } - return !this.savedDashboard.id || this.hasPendingEmbeddable() ? ViewMode.EDIT : ViewMode.VIEW; - } - - private checkIsDirty() { - // Filters need to be compared manually because they sometimes have a $$hashkey stored on the object. - // Query needs to be compared manually because saved legacy queries get migrated in app state automatically - const propsToIgnore: Array = ['viewMode', 'filters', 'query']; - - const initial = _.omit(this.stateDefaults, propsToIgnore); - const current = _.omit(this.stateContainer.get(), propsToIgnore); - return !_.isEqual(initial, current); - } -} diff --git a/src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx b/src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx index 92b0727d2458cf..b6e2a7c4b8f021 100644 --- a/src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx +++ b/src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx @@ -6,6 +6,7 @@ * Side Public License, v 1. */ +import _ from 'lodash'; import React from 'react'; import ReactDOM from 'react-dom'; import { I18nProvider } from '@kbn/i18n/react'; @@ -20,7 +21,6 @@ import { Container, PanelState, IEmbeddable, - ContainerInput, EmbeddableInput, EmbeddableStart, EmbeddableOutput, @@ -36,30 +36,13 @@ import { KibanaReactContextValue, } from '../../services/kibana_react'; import { PLACEHOLDER_EMBEDDABLE } from './placeholder'; -import { PanelPlacementMethod, IPanelPlacementArgs } from './panel/dashboard_panel_placement'; -import { DashboardCapabilities } from '../types'; +import { DashboardAppCapabilities, DashboardContainerInput } from '../../types'; import { PresentationUtilPluginStart } from '../../services/presentation_util'; +import { PanelPlacementMethod, IPanelPlacementArgs } from './panel/dashboard_panel_placement'; -export interface DashboardContainerInput extends ContainerInput { - dashboardCapabilities?: DashboardCapabilities; - refreshConfig?: RefreshInterval; - isEmbeddedExternally?: boolean; - isFullScreenMode: boolean; - expandedPanelId?: string; - timeRange: TimeRange; - description?: string; - useMargins: boolean; - syncColors?: boolean; - viewMode: ViewMode; - filters: Filter[]; - title: string; - query: Query; - panels: { - [panelId: string]: DashboardPanelState; - }; -} export interface DashboardContainerServices { ExitFullScreenButton: React.ComponentType; + presentationUtil: PresentationUtilPluginStart; SavedObjectFinder: React.ComponentType; notifications: CoreStart['notifications']; application: CoreStart['application']; @@ -69,7 +52,6 @@ export interface DashboardContainerServices { embeddable: EmbeddableStart; uiActions: UiActionsStart; http: CoreStart['http']; - presentationUtil: PresentationUtilPluginStart; } interface IndexSignature { @@ -91,7 +73,7 @@ export interface InheritedChildInput extends IndexSignature { export type DashboardReactContextValue = KibanaReactContextValue; export type DashboardReactContext = KibanaReactContext; -const defaultCapabilities: DashboardCapabilities = { +const defaultCapabilities: DashboardAppCapabilities = { show: false, createNew: false, saveQuery: false, @@ -104,7 +86,6 @@ const defaultCapabilities: DashboardCapabilities = { export class DashboardContainer extends Container { public readonly type = DASHBOARD_CONTAINER_TYPE; - public switchViewMode?: (newViewMode: ViewMode) => void; public getPanelCount = () => { return Object.keys(this.getInput().panels).length; @@ -134,7 +115,8 @@ export class DashboardContainer extends Container = {} ): DashboardPanelState { const panelState = super.createNewPanelState(factory, partial); - return createPanelState(panelState, this.input.panels); + const { newPanel } = createPanelState(panelState, this.input.panels); + return newPanel; } public showPlaceholderUntil( @@ -155,7 +137,8 @@ export class DashboardContainer extends Container; - const placeholderPanelState = createPanelState( + + const { otherPanels, newPanel: placeholderPanelState } = createPanelState( originalPanelState, this.input.panels, placementMethod, @@ -164,7 +147,7 @@ export class DashboardContainer extends Container - + , diff --git a/src/plugins/dashboard/public/application/embeddable/dashboard_container_by_value_renderer.tsx b/src/plugins/dashboard/public/application/embeddable/dashboard_container_by_value_renderer.tsx index 05e1e7eb9ec356..a4d96b557ac978 100644 --- a/src/plugins/dashboard/public/application/embeddable/dashboard_container_by_value_renderer.tsx +++ b/src/plugins/dashboard/public/application/embeddable/dashboard_container_by_value_renderer.tsx @@ -7,7 +7,7 @@ */ import * as React from 'react'; -import { DashboardContainerInput } from './dashboard_container'; +import { DashboardContainerInput } from '../..'; import { DashboardContainerFactory } from './dashboard_container_factory'; import { EmbeddableRenderer } from '../../services/embeddable'; diff --git a/src/plugins/dashboard/public/application/embeddable/dashboard_container_factory.tsx b/src/plugins/dashboard/public/application/embeddable/dashboard_container_factory.tsx index ff592742488f5d..2e984ccfa5ba9e 100644 --- a/src/plugins/dashboard/public/application/embeddable/dashboard_container_factory.tsx +++ b/src/plugins/dashboard/public/application/embeddable/dashboard_container_factory.tsx @@ -8,6 +8,10 @@ import { i18n } from '@kbn/i18n'; import { EmbeddablePersistableStateService } from 'src/plugins/embeddable/common'; + +import { DashboardContainerInput } from '../..'; +import { DASHBOARD_CONTAINER_TYPE } from './dashboard_constants'; +import { DashboardContainer, DashboardContainerServices } from './dashboard_container'; import { Container, ErrorEmbeddable, @@ -15,12 +19,6 @@ import { EmbeddableFactory, EmbeddableFactoryDefinition, } from '../../services/embeddable'; -import { - DashboardContainer, - DashboardContainerInput, - DashboardContainerServices, -} from './dashboard_container'; -import { DASHBOARD_CONTAINER_TYPE } from './dashboard_constants'; import { createExtract, createInject, diff --git a/src/plugins/dashboard/public/application/embeddable/empty_screen/__snapshots__/dashboard_empty_screen.test.tsx.snap b/src/plugins/dashboard/public/application/embeddable/empty_screen/__snapshots__/dashboard_empty_screen.test.tsx.snap index 44beed5e4a89be..9f56740fdac221 100644 --- a/src/plugins/dashboard/public/application/embeddable/empty_screen/__snapshots__/dashboard_empty_screen.test.tsx.snap +++ b/src/plugins/dashboard/public/application/embeddable/empty_screen/__snapshots__/dashboard_empty_screen.test.tsx.snap @@ -590,10 +590,12 @@ exports[`DashboardEmptyScreen renders correctly with readonly mode 1`] = `

- Click - -   - - - - - -   - - in the menu bar above to start adding panels. + Click edit in the menu bar above to start adding panels.

diff --git a/src/plugins/dashboard/public/application/embeddable/empty_screen/dashboard_empty_screen.tsx b/src/plugins/dashboard/public/application/embeddable/empty_screen/dashboard_empty_screen.tsx index 10fd2eea7dad53..b2f1302c65c9c6 100644 --- a/src/plugins/dashboard/public/application/embeddable/empty_screen/dashboard_empty_screen.tsx +++ b/src/plugins/dashboard/public/application/embeddable/empty_screen/dashboard_empty_screen.tsx @@ -10,7 +10,6 @@ import React from 'react'; import { I18nProvider } from '@kbn/i18n/react'; import { EuiIcon, - EuiLink, EuiSpacer, EuiPageContent, EuiPageBody, @@ -24,7 +23,6 @@ import { emptyScreenStrings } from '../../../dashboard_strings'; export interface DashboardEmptyScreenProps { isEditMode?: boolean; - onLinkClick: () => void; uiSettings: IUiSettingsClient; http: HttpStart; isReadonlyMode?: boolean; @@ -32,7 +30,6 @@ export interface DashboardEmptyScreenProps { export function DashboardEmptyScreen({ isEditMode, - onLinkClick, uiSettings, http, isReadonlyMode, @@ -41,36 +38,14 @@ export function DashboardEmptyScreen({ const emptyStateGraphicURL = IS_DARK_THEME ? '/plugins/home/assets/welcome_graphic_dark_2x.png' : '/plugins/home/assets/welcome_graphic_light_2x.png'; - const paragraph = ( - description1: string | null, - description2: string, - linkText: string, - ariaLabel: string, - dataTestSubj?: string - ) => { - return ( - -

- {description1} - {description1 &&  } - - {linkText} - -   - {description2} -

-
- ); - }; - const enterEditModeParagraph = paragraph( - emptyScreenStrings.getHowToStartWorkingOnNewDashboardDescription1(), - emptyScreenStrings.getHowToStartWorkingOnNewDashboardDescription2(), - emptyScreenStrings.getHowToStartWorkingOnNewDashboardEditLinkText(), - emptyScreenStrings.getHowToStartWorkingOnNewDashboardEditLinkAriaLabel() - ); + const page = (mainText: string, showAdditionalParagraph?: boolean, additionalText?: string) => { return ( - + -
{enterEditModeParagraph}
+
+ +

{emptyScreenStrings.getHowToStartWorkingOnNewDashboardDescription()}

+
+
) : null}
diff --git a/src/plugins/dashboard/public/application/embeddable/index.ts b/src/plugins/dashboard/public/application/embeddable/index.ts index 24b5362359d25b..a678dbea16a55f 100644 --- a/src/plugins/dashboard/public/application/embeddable/index.ts +++ b/src/plugins/dashboard/public/application/embeddable/index.ts @@ -10,7 +10,7 @@ export { DashboardContainerFactoryDefinition, DashboardContainerFactory, } from './dashboard_container_factory'; -export { DashboardContainer, DashboardContainerInput } from './dashboard_container'; +export { DashboardContainer } from './dashboard_container'; export { createPanelState } from './panel'; export * from './types'; diff --git a/src/plugins/dashboard/public/application/embeddable/panel/create_panel_state.test.ts b/src/plugins/dashboard/public/application/embeddable/panel/create_panel_state.test.ts index 7563d07154d6e7..97e078246aca6b 100644 --- a/src/plugins/dashboard/public/application/embeddable/panel/create_panel_state.test.ts +++ b/src/plugins/dashboard/public/application/embeddable/panel/create_panel_state.test.ts @@ -18,7 +18,7 @@ interface TestInput extends EmbeddableInput { const panels: { [key: string]: DashboardPanelState } = {}; test('createPanelState adds a new panel state in 0,0 position', () => { - const panelState = createPanelState( + const { newPanel: panelState } = createPanelState( { type: CONTACT_CARD_EMBEDDABLE, explicitInput: { test: 'hi', id: '123' }, @@ -37,7 +37,7 @@ test('createPanelState adds a new panel state in 0,0 position', () => { }); test('createPanelState adds a second new panel state', () => { - const panelState = createPanelState( + const { newPanel: panelState } = createPanelState( { type: CONTACT_CARD_EMBEDDABLE, explicitInput: { test: 'bye', id: '456' } }, panels ); @@ -51,7 +51,7 @@ test('createPanelState adds a second new panel state', () => { }); test('createPanelState adds a third new panel state', () => { - const panelState = createPanelState( + const { newPanel: panelState } = createPanelState( { type: CONTACT_CARD_EMBEDDABLE, explicitInput: { test: 'bye', id: '789' }, @@ -68,7 +68,7 @@ test('createPanelState adds a third new panel state', () => { test('createPanelState adds a new panel state in the top most position', () => { delete panels['456']; - const panelState = createPanelState( + const { newPanel: panelState } = createPanelState( { type: CONTACT_CARD_EMBEDDABLE, explicitInput: { test: 'bye', id: '987' }, diff --git a/src/plugins/dashboard/public/application/embeddable/panel/create_panel_state.ts b/src/plugins/dashboard/public/application/embeddable/panel/create_panel_state.ts index 775ac7d7078ad1..46a75ca06bdb53 100644 --- a/src/plugins/dashboard/public/application/embeddable/panel/create_panel_state.ts +++ b/src/plugins/dashboard/public/application/embeddable/panel/create_panel_state.ts @@ -26,7 +26,10 @@ export function createPanelState< currentPanels: { [key: string]: DashboardPanelState }, placementMethod?: PanelPlacementMethod, placementArgs?: TPlacementMethodArgs -): DashboardPanelState { +): { + newPanel: DashboardPanelState; + otherPanels: { [key: string]: DashboardPanelState }; +} { const defaultPlacementArgs = { width: DEFAULT_PANEL_WIDTH, height: DEFAULT_PANEL_HEIGHT, @@ -39,15 +42,18 @@ export function createPanelState< } : defaultPlacementArgs; - const gridDataLocation = placementMethod + const { newPanelPlacement, otherPanels } = placementMethod ? placementMethod(finalPlacementArgs as TPlacementMethodArgs) : findTopLeftMostOpenSpace(defaultPlacementArgs); return { - gridData: { - ...gridDataLocation, - i: panelState.explicitInput.id, + newPanel: { + gridData: { + ...newPanelPlacement, + i: panelState.explicitInput.id, + }, + ...panelState, }, - ...panelState, + otherPanels, }; } diff --git a/src/plugins/dashboard/public/application/embeddable/panel/dashboard_panel_placement.ts b/src/plugins/dashboard/public/application/embeddable/panel/dashboard_panel_placement.ts index c8e5fcbe4240b8..64b398200db1d3 100644 --- a/src/plugins/dashboard/public/application/embeddable/panel/dashboard_panel_placement.ts +++ b/src/plugins/dashboard/public/application/embeddable/panel/dashboard_panel_placement.ts @@ -13,7 +13,12 @@ import { DashboardPanelState, DASHBOARD_GRID_COLUMN_COUNT } from '..'; export type PanelPlacementMethod = ( args: PlacementArgs -) => Omit; +) => PanelPlacementMethodReturn; + +interface PanelPlacementMethodReturn { + newPanelPlacement: Omit; + otherPanels: { [key: string]: DashboardPanelState }; +} export interface IPanelPlacementArgs { width: number; @@ -30,7 +35,7 @@ export function findTopLeftMostOpenSpace({ width, height, currentPanels, -}: IPanelPlacementArgs): Omit { +}: IPanelPlacementArgs): PanelPlacementMethodReturn { let maxY = -1; const currentPanelsArray = Object.values(currentPanels); @@ -40,7 +45,7 @@ export function findTopLeftMostOpenSpace({ // Handle case of empty grid. if (maxY < 0) { - return { x: 0, y: 0, w: width, h: height }; + return { newPanelPlacement: { x: 0, y: 0, w: width, h: height }, otherPanels: currentPanels }; } const grid = new Array(maxY); @@ -80,7 +85,10 @@ export function findTopLeftMostOpenSpace({ if (spaceIsEmpty && fitsPanelWidth && fitsPanelHeight) { // Found space - return { x, y, w: width, h: height }; + return { + newPanelPlacement: { x, y, w: width, h: height }, + otherPanels: currentPanels, + }; } else if (grid[h][w] === 1) { // x, y spot doesn't work, break. break; @@ -90,7 +98,7 @@ export function findTopLeftMostOpenSpace({ } } } - return { x: 0, y: maxY, w: width, h: height }; + return { newPanelPlacement: { x: 0, y: maxY, w: width, h: height }, otherPanels: currentPanels }; } interface IplacementDirection { @@ -123,15 +131,15 @@ export function placePanelBeside({ height, currentPanels, placeBesideId, -}: IPanelPlacementBesideArgs): Omit { +}: IPanelPlacementBesideArgs): PanelPlacementMethodReturn { const panelToPlaceBeside = currentPanels[placeBesideId]; if (!panelToPlaceBeside) { throw new PanelNotFoundError(); } const beside = panelToPlaceBeside.gridData; - const otherPanels: GridData[] = []; + const otherPanelGridData: GridData[] = []; _.forOwn(currentPanels, (panel: DashboardPanelState, key: string | undefined) => { - otherPanels.push(panel.gridData); + otherPanelGridData.push(panel.gridData); }); const possiblePlacementDirections: IplacementDirection[] = [ @@ -147,7 +155,7 @@ export function placePanelBeside({ direction.grid.x + direction.grid.w <= DASHBOARD_GRID_COLUMN_COUNT && direction.grid.y >= 0 ) { - const intersection = otherPanels.some((currentPanelGrid: GridData) => { + const intersection = otherPanelGridData.some((currentPanelGrid: GridData) => { return ( direction.grid.x + direction.grid.w > currentPanelGrid.x && direction.grid.x < currentPanelGrid.x + currentPanelGrid.w && @@ -156,7 +164,7 @@ export function placePanelBeside({ ); }); if (!intersection) { - return direction.grid; + return { newPanelPlacement: direction.grid, otherPanels: currentPanels }; } } else { direction.fits = false; @@ -168,7 +176,8 @@ export function placePanelBeside({ * 2. place the cloned panel to the bottom * 3. reposition the panels after the cloned panel in the grid */ - const grid = otherPanels.sort(comparePanels); + const otherPanels = { ...currentPanels }; + const grid = otherPanelGridData.sort(comparePanels); let position = 0; for (position; position < grid.length; position++) { @@ -182,13 +191,13 @@ export function placePanelBeside({ const diff = bottomPlacement.grid.y + bottomPlacement.grid.h - - currentPanels[originalPositionInTheGrid].gridData.y; + otherPanels[originalPositionInTheGrid].gridData.y; for (let j = position + 1; j < grid.length; j++) { originalPositionInTheGrid = grid[j].i; - const movedPanel = _.cloneDeep(currentPanels[originalPositionInTheGrid]); + const movedPanel = _.cloneDeep(otherPanels[originalPositionInTheGrid]); movedPanel.gridData.y = movedPanel.gridData.y + diff; - currentPanels[originalPositionInTheGrid] = movedPanel; + otherPanels[originalPositionInTheGrid] = movedPanel; } - return bottomPlacement.grid; + return { newPanelPlacement: bottomPlacement.grid, otherPanels }; } diff --git a/src/plugins/dashboard/public/application/embeddable/viewport/dashboard_viewport.tsx b/src/plugins/dashboard/public/application/embeddable/viewport/dashboard_viewport.tsx index 442bae8dd1dff4..cbe10438e578aa 100644 --- a/src/plugins/dashboard/public/application/embeddable/viewport/dashboard_viewport.tsx +++ b/src/plugins/dashboard/public/application/embeddable/viewport/dashboard_viewport.tsx @@ -15,7 +15,6 @@ import { context } from '../../../services/kibana_react'; import { DashboardEmptyScreen } from '../empty_screen/dashboard_empty_screen'; export interface DashboardViewportProps { - switchViewMode?: (newViewMode: ViewMode) => void; container: DashboardContainer; } @@ -120,7 +119,6 @@ export class DashboardViewport extends React.Component this.props.switchViewMode?.(ViewMode.EDIT)} isEditMode={isEditMode} uiSettings={this.context.services.uiSettings} http={this.context.services.http} diff --git a/src/plugins/dashboard/public/application/hooks/index.ts b/src/plugins/dashboard/public/application/hooks/index.ts index 09b7aea9c6a6da..d9c3cd231c3c3b 100644 --- a/src/plugins/dashboard/public/application/hooks/index.ts +++ b/src/plugins/dashboard/public/application/hooks/index.ts @@ -6,7 +6,4 @@ * Side Public License, v 1. */ -export { useSavedDashboard } from './use_saved_dashboard'; -export { useDashboardContainer } from './use_dashboard_container'; -export { useDashboardBreadcrumbs } from './use_dashboard_breadcrumbs'; -export { useDashboardStateManager } from './use_dashboard_state_manager'; +export { useDashboardAppState } from './use_dashboard_app_state'; diff --git a/src/plugins/dashboard/public/application/hooks/use_dashboard_app_state.test.tsx b/src/plugins/dashboard/public/application/hooks/use_dashboard_app_state.test.tsx new file mode 100644 index 00000000000000..0e15c655749678 --- /dev/null +++ b/src/plugins/dashboard/public/application/hooks/use_dashboard_app_state.test.tsx @@ -0,0 +1,337 @@ +/* + * 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 React from 'react'; +import { of } from 'rxjs'; +import { Provider } from 'react-redux'; +import { createBrowserHistory } from 'history'; +import { renderHook, act, RenderHookResult } from '@testing-library/react-hooks'; + +import { DashboardContainer } from '..'; +import { DashboardSessionStorage } from '../lib'; +import { coreMock } from '../../../../../core/public/mocks'; +import { DashboardConstants } from '../../dashboard_constants'; +import { dataPluginMock } from '../../../../data/public/mocks'; +import { SavedObjectLoader } from '../../services/saved_objects'; +import { DashboardAppServices, DashboardAppState } from '../../types'; +import { KibanaContextProvider } from '../../../../kibana_react/public'; +import { EmbeddableFactory, ViewMode } from '../../services/embeddable'; +import { dashboardStateStore, setDescription, setViewMode } from '../state'; +import { DashboardContainerServices } from '../embeddable/dashboard_container'; +import { createKbnUrlStateStorage, defer } from '../../../../kibana_utils/public'; +import { Filter, IIndexPattern, IndexPatternsContract } from '../../services/data'; +import { useDashboardAppState, UseDashboardStateProps } from './use_dashboard_app_state'; +import { + getSampleDashboardInput, + getSavedDashboardMock, + makeDefaultServices, +} from '../test_helpers'; + +interface SetupEmbeddableFactoryReturn { + finalizeEmbeddableCreation: () => void; + dashboardContainer: DashboardContainer; + dashboardDestroySpy: jest.SpyInstance; +} + +interface RenderDashboardStateHookReturn { + embeddableFactoryResult: SetupEmbeddableFactoryReturn; + renderHookResult: RenderHookResult, DashboardAppState>; + services: DashboardAppServices; + props: UseDashboardStateProps; +} + +const originalDashboardEmbeddableId = 'originalDashboardEmbeddableId'; + +const createDashboardAppStateProps = (): UseDashboardStateProps => ({ + kbnUrlStateStorage: createKbnUrlStateStorage(), + savedDashboardId: 'testDashboardId', + history: createBrowserHistory(), + isEmbeddedExternally: false, + redirectTo: jest.fn(), +}); + +const createDashboardAppStateServices = () => { + const defaults = makeDefaultServices(); + const indexPatterns = {} as IndexPatternsContract; + const defaultIndexPattern = { id: 'foo', fields: [{ name: 'bar' }] } as IIndexPattern; + indexPatterns.ensureDefaultIndexPattern = jest + .fn() + .mockImplementation(() => Promise.resolve(true)); + indexPatterns.getDefault = jest + .fn() + .mockImplementation(() => Promise.resolve(defaultIndexPattern)); + + const data = dataPluginMock.createStartContract(); + data.query.filterManager.getUpdates$ = jest.fn().mockImplementation(() => of(void 0)); + data.query.queryString.getUpdates$ = jest.fn().mockImplementation(() => of({})); + data.query.timefilter.timefilter.getTimeUpdate$ = jest.fn().mockImplementation(() => of(void 0)); + data.query.timefilter.timefilter.getRefreshIntervalUpdate$ = jest + .fn() + .mockImplementation(() => of(void 0)); + + return { ...defaults, indexPatterns, data }; +}; + +const setupEmbeddableFactory = ( + services: DashboardAppServices, + id: string +): SetupEmbeddableFactoryReturn => { + const coreStart = coreMock.createStart(); + const containerOptions = ({ + notifications: services.core.notifications, + savedObjectMetaData: {} as unknown, + ExitFullScreenButton: () => null, + embeddable: services.embeddable, + uiSettings: services.uiSettings, + SavedObjectFinder: () => null, + overlays: coreStart.overlays, + application: {} as unknown, + inspector: {} as unknown, + uiActions: {} as unknown, + http: coreStart.http, + } as unknown) as DashboardContainerServices; + + const dashboardContainer = new DashboardContainer( + { ...getSampleDashboardInput(), id }, + containerOptions + ); + const deferEmbeddableCreate = defer(); + services.embeddable.getEmbeddableFactory = jest.fn().mockImplementation( + () => + (({ + create: () => deferEmbeddableCreate.promise, + } as unknown) as EmbeddableFactory) + ); + const dashboardDestroySpy = jest.spyOn(dashboardContainer, 'destroy'); + + return { + dashboardContainer, + dashboardDestroySpy, + finalizeEmbeddableCreation: () => { + act(() => { + deferEmbeddableCreate.resolve(dashboardContainer); + }); + }, + }; +}; + +const renderDashboardAppStateHook = ({ + partialProps, + partialServices, +}: { + partialProps?: Partial; + partialServices?: Partial; +}): RenderDashboardStateHookReturn => { + const props = { ...createDashboardAppStateProps(), ...(partialProps ?? {}) }; + const services = { ...createDashboardAppStateServices(), ...(partialServices ?? {}) }; + const embeddableFactoryResult = setupEmbeddableFactory(services, originalDashboardEmbeddableId); + const renderHookResult = renderHook( + (replaceProps: Partial) => + useDashboardAppState({ ...props, ...replaceProps }), + { + wrapper: ({ children }) => ( + + {children} + + ), + } + ); + return { embeddableFactoryResult, renderHookResult, services, props }; +}; + +describe('Dashboard container lifecycle', () => { + test('Dashboard container is destroyed on unmount', async () => { + const { renderHookResult, embeddableFactoryResult } = renderDashboardAppStateHook({}); + embeddableFactoryResult.finalizeEmbeddableCreation(); + await renderHookResult.waitForNextUpdate(); + + expect(embeddableFactoryResult.dashboardContainer).toBe( + renderHookResult.result.current.dashboardContainer + ); + expect(embeddableFactoryResult.dashboardDestroySpy).not.toBeCalled(); + renderHookResult.unmount(); + expect(embeddableFactoryResult.dashboardDestroySpy).toBeCalled(); + }); + + test('Old dashboard container is destroyed when new dashboardId is given', async () => { + const { renderHookResult, embeddableFactoryResult, services } = renderDashboardAppStateHook({}); + const getResult = () => renderHookResult.result.current; + + // on initial render dashboard container is undefined + expect(getResult().dashboardContainer).toBeUndefined(); + embeddableFactoryResult.finalizeEmbeddableCreation(); + + await renderHookResult.waitForNextUpdate(); + expect(embeddableFactoryResult.dashboardContainer).toBe(getResult().dashboardContainer); + expect(embeddableFactoryResult.dashboardDestroySpy).not.toBeCalled(); + + const newDashboardId = 'wow_a_new_dashboard_id'; + const embeddableFactoryNew = setupEmbeddableFactory(services, newDashboardId); + renderHookResult.rerender({ savedDashboardId: newDashboardId }); + + embeddableFactoryNew.finalizeEmbeddableCreation(); + await renderHookResult.waitForNextUpdate(); + + expect(embeddableFactoryNew.dashboardContainer).toEqual(getResult().dashboardContainer); + expect(embeddableFactoryNew.dashboardDestroySpy).not.toBeCalled(); + expect(embeddableFactoryResult.dashboardDestroySpy).toBeCalled(); + }); + + test('Dashboard container is destroyed if dashboard id is changed before container is resolved', async () => { + const { renderHookResult, embeddableFactoryResult, services } = renderDashboardAppStateHook({}); + const getResult = () => renderHookResult.result.current; + + // on initial render dashboard container is undefined + expect(getResult().dashboardContainer).toBeUndefined(); + await act(() => Promise.resolve()); // wait for the original savedDashboard to be loaded... + + const newDashboardId = 'wow_a_new_dashboard_id'; + const embeddableFactoryNew = setupEmbeddableFactory(services, newDashboardId); + + renderHookResult.rerender({ savedDashboardId: newDashboardId }); + await act(() => Promise.resolve()); // wait for the new savedDashboard to be loaded... + embeddableFactoryNew.finalizeEmbeddableCreation(); + await renderHookResult.waitForNextUpdate(); + expect(embeddableFactoryNew.dashboardContainer).toBe(getResult().dashboardContainer); + expect(embeddableFactoryNew.dashboardDestroySpy).not.toBeCalled(); + + embeddableFactoryResult.finalizeEmbeddableCreation(); + await act(() => Promise.resolve()); // Can't use waitFor from hooks, because there is no hook update + expect(embeddableFactoryNew.dashboardContainer).toBe(getResult().dashboardContainer); + expect(embeddableFactoryNew.dashboardDestroySpy).not.toBeCalled(); + expect(embeddableFactoryResult.dashboardDestroySpy).toBeCalled(); + }); +}); + +describe('Dashboard initial state', () => { + it('Extracts state from Dashboard Saved Object', async () => { + const { renderHookResult, embeddableFactoryResult } = renderDashboardAppStateHook({}); + const getResult = () => renderHookResult.result.current; + + // saved dashboard isn't applied until after the dashboard embeddable has been created. + expect(getResult().savedDashboard).toBeUndefined(); + + embeddableFactoryResult.finalizeEmbeddableCreation(); + await renderHookResult.waitForNextUpdate(); + + expect(getResult().savedDashboard).toBeDefined(); + expect(getResult().savedDashboard?.title).toEqual( + getResult().getLatestDashboardState?.().title + ); + }); + + it('Sets initial time range and filters from saved dashboard', async () => { + const savedDashboards = {} as SavedObjectLoader; + savedDashboards.get = jest.fn().mockImplementation((id?: string) => + Promise.resolve( + getSavedDashboardMock({ + getFilters: () => [({ meta: { test: 'filterMeTimbers' } } as unknown) as Filter], + timeRestore: true, + timeFrom: 'now-13d', + timeTo: 'now', + id, + }) + ) + ); + const partialServices: Partial = { savedDashboards }; + const { renderHookResult, embeddableFactoryResult, services } = renderDashboardAppStateHook({ + partialServices, + }); + const getResult = () => renderHookResult.result.current; + + embeddableFactoryResult.finalizeEmbeddableCreation(); + await renderHookResult.waitForNextUpdate(); + + expect(getResult().getLatestDashboardState?.().timeRestore).toEqual(true); + expect(services.data.query.timefilter.timefilter.setTime).toHaveBeenCalledWith({ + from: 'now-13d', + to: 'now', + }); + expect(services.data.query.filterManager.setAppFilters).toHaveBeenCalledWith([ + ({ meta: { test: 'filterMeTimbers' } } as unknown) as Filter, + ]); + }); + + it('Combines session state and URL state into initial state', async () => { + const dashboardSessionStorage = ({ + getState: jest + .fn() + .mockReturnValue({ viewMode: ViewMode.EDIT, description: 'this should be overwritten' }), + } as unknown) as DashboardSessionStorage; + const kbnUrlStateStorage = createKbnUrlStateStorage(); + kbnUrlStateStorage.set('_a', { description: 'with this' }); + const { renderHookResult, embeddableFactoryResult } = renderDashboardAppStateHook({ + partialProps: { kbnUrlStateStorage }, + partialServices: { dashboardSessionStorage }, + }); + const getResult = () => renderHookResult.result.current; + + embeddableFactoryResult.finalizeEmbeddableCreation(); + await renderHookResult.waitForNextUpdate(); + expect(getResult().getLatestDashboardState?.().description).toEqual('with this'); + expect(getResult().getLatestDashboardState?.().viewMode).toEqual(ViewMode.EDIT); + }); +}); + +describe('Dashboard state sync', () => { + let defaultDashboardAppStateHookResult: RenderDashboardStateHookReturn; + const getResult = () => defaultDashboardAppStateHookResult.renderHookResult.result.current; + + beforeEach(async () => { + DashboardConstants.CHANGE_APPLY_DEBOUNCE = 0; + DashboardConstants.CHANGE_CHECK_DEBOUNCE = 0; + defaultDashboardAppStateHookResult = renderDashboardAppStateHook({}); + defaultDashboardAppStateHookResult.embeddableFactoryResult.finalizeEmbeddableCreation(); + await defaultDashboardAppStateHookResult.renderHookResult.waitForNextUpdate(); + }); + + it('Updates Dashboard container input when state changes', async () => { + const { embeddableFactoryResult } = defaultDashboardAppStateHookResult; + embeddableFactoryResult.dashboardContainer.updateInput = jest.fn(); + act(() => { + dashboardStateStore.dispatch(setDescription('Well hello there new description')); + }); + await act(async () => { + await new Promise((resolve) => setTimeout(resolve, 3)); // So that $triggerDashboardRefresh.next is called + }); + expect(embeddableFactoryResult.dashboardContainer.updateInput).toHaveBeenCalledWith( + expect.objectContaining({ description: 'Well hello there new description' }) + ); + }); + + it('Updates state when dashboard container input changes', async () => { + const { embeddableFactoryResult } = defaultDashboardAppStateHookResult; + expect(getResult().getLatestDashboardState?.().fullScreenMode).toBe(false); + act(() => { + embeddableFactoryResult.dashboardContainer.updateInput({ + isFullScreenMode: true, + }); + }); + await act(() => Promise.resolve()); + expect(getResult().getLatestDashboardState?.().fullScreenMode).toBe(true); + }); + + it('pushes unsaved changes to the session storage', async () => { + const { services } = defaultDashboardAppStateHookResult; + expect(getResult().getLatestDashboardState?.().fullScreenMode).toBe(false); + act(() => { + dashboardStateStore.dispatch(setViewMode(ViewMode.EDIT)); // session storage is only populated in edit mode + dashboardStateStore.dispatch(setDescription('Wow an even cooler description.')); + }); + await act(async () => { + await new Promise((resolve) => setTimeout(resolve, 3)); + }); + expect(services.dashboardSessionStorage.setState).toHaveBeenCalledWith( + 'testDashboardId', + expect.objectContaining({ + description: 'Wow an even cooler description.', + viewMode: ViewMode.EDIT, + }) + ); + }); +}); diff --git a/src/plugins/dashboard/public/application/hooks/use_dashboard_app_state.ts b/src/plugins/dashboard/public/application/hooks/use_dashboard_app_state.ts new file mode 100644 index 00000000000000..e9a5275300ffe9 --- /dev/null +++ b/src/plugins/dashboard/public/application/hooks/use_dashboard_app_state.ts @@ -0,0 +1,351 @@ +/* + * 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 _ from 'lodash'; +import { History } from 'history'; +import { debounceTime } from 'rxjs/operators'; +import { useCallback, useEffect, useMemo, useState } from 'react'; +import { BehaviorSubject, combineLatest, Subject } from 'rxjs'; + +import { DashboardConstants } from '../..'; +import { ViewMode } from '../../services/embeddable'; +import { useKibana } from '../../services/kibana_react'; +import { getNewDashboardTitle } from '../../dashboard_strings'; +import { IKbnUrlStateStorage } from '../../services/kibana_utils'; +import { setDashboardState, useDashboardDispatch, useDashboardSelector } from '../state'; +import { + DashboardBuildContext, + DashboardAppServices, + DashboardAppState, + DashboardRedirect, + DashboardState, +} from '../../types'; +import { + tryDestroyDashboardContainer, + syncDashboardContainerInput, + savedObjectToDashboardState, + syncDashboardIndexPatterns, + syncDashboardFilterState, + loadSavedDashboardState, + buildDashboardContainer, + loadDashboardUrlState, + diffDashboardState, + areTimeRangesEqual, +} from '../lib'; + +export interface UseDashboardStateProps { + history: History; + savedDashboardId?: string; + redirectTo: DashboardRedirect; + isEmbeddedExternally: boolean; + kbnUrlStateStorage: IKbnUrlStateStorage; +} + +export const useDashboardAppState = ({ + history, + redirectTo, + savedDashboardId, + kbnUrlStateStorage, + isEmbeddedExternally, +}: UseDashboardStateProps) => { + const dispatchDashboardStateChange = useDashboardDispatch(); + const dashboardState = useDashboardSelector((state) => state.dashboardStateReducer); + + /** + * Dashboard app state is the return value for this hook and contains interaction points that the rest of the app can use + * to read or manipulate dashboard state. + */ + const [dashboardAppState, setDashboardAppState] = useState(() => ({ + $onDashboardStateChange: new BehaviorSubject({} as DashboardState), + $triggerDashboardRefresh: new Subject<{ force?: boolean }>(), + })); + + /** + * Last saved state is diffed against the current dashboard state any time either changes. This is used to set the + * unsaved changes portion of the dashboardAppState. + */ + const [lastSavedState, setLastSavedState] = useState(); + const $onLastSavedStateChange = useMemo(() => new Subject(), []); + + /** + * Unpack services + */ + const services = useKibana().services; + const { + data, + core, + chrome, + embeddable, + indexPatterns, + usageCollection, + savedDashboards, + initializerContext, + savedObjectsTagging, + dashboardCapabilities, + dashboardSessionStorage, + } = services; + const { docTitle } = chrome; + const { notifications } = core; + const { query, search } = data; + const { getStateTransfer } = embeddable; + const { version: kibanaVersion } = initializerContext.env.packageInfo; + + /** + * This useEffect triggers when the dashboard ID changes, and is in charge of loading the saved dashboard, + * fetching the initial state, building the Dashboard Container embeddable, and setting up all state syncing. + */ + useEffect(() => { + // fetch incoming embeddable from state transfer service. + const incomingEmbeddable = getStateTransfer().getIncomingEmbeddablePackage( + DashboardConstants.DASHBOARDS_ID, + true + ); + + let canceled = false; + let onDestroy: () => void; + + /** + * The dashboard build context is a collection of all of the services and props required in subsequent steps to build the dashboard + * from the dashboardId. This build context doesn't contain any extrenuous services. + */ + const dashboardBuildContext: DashboardBuildContext = { + query, + search, + history, + embeddable, + indexPatterns, + notifications, + kibanaVersion, + savedDashboards, + kbnUrlStateStorage, + initializerContext, + isEmbeddedExternally, + dashboardCapabilities, + dispatchDashboardStateChange, + $checkForUnsavedChanges: new Subject(), + $onDashboardStateChange: dashboardAppState.$onDashboardStateChange, + $triggerDashboardRefresh: dashboardAppState.$triggerDashboardRefresh, + getLatestDashboardState: () => dashboardAppState.$onDashboardStateChange.value, + }; + + (async () => { + /** + * Load and unpack state from dashboard saved object. + */ + const loadSavedDashboardResult = await loadSavedDashboardState({ + ...dashboardBuildContext, + savedDashboardId, + }); + if (canceled || !loadSavedDashboardResult) return; + const { savedDashboard, savedDashboardState } = loadSavedDashboardResult; + + /** + * Combine initial state from the saved object, session storage, and URL, then dispatch it to Redux. + */ + const dashboardSessionStorageState = dashboardSessionStorage.getState(savedDashboardId) || {}; + const dashboardURLState = loadDashboardUrlState(dashboardBuildContext); + const initialDashboardState = { + ...savedDashboardState, + ...dashboardSessionStorageState, + ...dashboardURLState, + + // if there is an incoming embeddable, dashboard always needs to be in edit mode to receive it. + ...(incomingEmbeddable ? { viewMode: ViewMode.EDIT } : {}), + }; + dispatchDashboardStateChange(setDashboardState(initialDashboardState)); + + /** + * Start syncing dashboard state with the Query, Filters and Timepicker from the Query Service. + */ + const { applyFilters, stopSyncingDashboardFilterState } = syncDashboardFilterState({ + ...dashboardBuildContext, + initialDashboardState, + savedDashboard, + }); + + /** + * Build the dashboard container embeddable, and apply the incoming embeddable if it exists. + */ + const dashboardContainer = await buildDashboardContainer({ + ...dashboardBuildContext, + initialDashboardState, + incomingEmbeddable, + savedDashboard, + data, + }); + if (canceled || !dashboardContainer) { + tryDestroyDashboardContainer(dashboardContainer); + return; + } + + /** + * Start syncing index patterns between the Query Service and the Dashboard Container. + */ + const indexPatternsSubscription = syncDashboardIndexPatterns({ + dashboardContainer, + indexPatterns: dashboardBuildContext.indexPatterns, + onUpdateIndexPatterns: (newIndexPatterns) => + setDashboardAppState((s) => ({ ...s, indexPatterns: newIndexPatterns })), + }); + + /** + * Set up the two way syncing between the Dashboard Container and the Redux Store. + */ + const stopSyncingContainerInput = syncDashboardContainerInput({ + ...dashboardBuildContext, + dashboardContainer, + savedDashboard, + applyFilters, + }); + + /** + * Any time the redux state, or the last saved state changes, compare them, set the unsaved + * changes state, and and push the unsaved changes to session storage. + */ + const { timefilter } = dashboardBuildContext.query.timefilter; + const lastSavedSubscription = combineLatest([ + $onLastSavedStateChange, + dashboardAppState.$onDashboardStateChange, + dashboardBuildContext.$checkForUnsavedChanges, + ]) + .pipe(debounceTime(DashboardConstants.CHANGE_CHECK_DEBOUNCE)) + .subscribe((states) => { + const [lastSaved, current] = states; + const unsavedChanges = + current.viewMode === ViewMode.EDIT ? diffDashboardState(lastSaved, current) : {}; + + if (current.viewMode === ViewMode.EDIT) { + const savedTimeChanged = + lastSaved.timeRestore && + !areTimeRangesEqual( + { + from: savedDashboard?.timeFrom, + to: savedDashboard?.timeTo, + }, + timefilter.getTime() + ); + const hasUnsavedChanges = Object.keys(unsavedChanges).length > 0 || savedTimeChanged; + setDashboardAppState((s) => ({ ...s, hasUnsavedChanges })); + } + + unsavedChanges.viewMode = current.viewMode; // always push view mode into session store. + dashboardSessionStorage.setState(savedDashboardId, unsavedChanges); + }); + + /** + * initialize the last saved state, and build a callback which can be used to update + * the last saved state on save. + */ + setLastSavedState(savedDashboardState); + dashboardBuildContext.$checkForUnsavedChanges.next(); + const updateLastSavedState = () => { + setLastSavedState( + savedObjectToDashboardState({ + hideWriteControls: dashboardBuildContext.dashboardCapabilities.hideWriteControls, + version: dashboardBuildContext.kibanaVersion, + savedObjectsTagging, + usageCollection, + savedDashboard, + }) + ); + }; + + /** + * Apply changes to the dashboard app state, and set the document title + */ + docTitle.change(savedDashboardState.title || getNewDashboardTitle()); + setDashboardAppState((s) => ({ + ...s, + applyFilters, + savedDashboard, + dashboardContainer, + updateLastSavedState, + getLatestDashboardState: dashboardBuildContext.getLatestDashboardState, + })); + + onDestroy = () => { + stopSyncingContainerInput(); + stopSyncingDashboardFilterState(); + lastSavedSubscription.unsubscribe(); + indexPatternsSubscription.unsubscribe(); + tryDestroyDashboardContainer(dashboardContainer); + setDashboardAppState((state) => ({ + ...state, + dashboardContainer: undefined, + })); + }; + })(); + return () => { + canceled = true; + onDestroy?.(); + }; + }, [ + dashboardAppState.$triggerDashboardRefresh, + dashboardAppState.$onDashboardStateChange, + dispatchDashboardStateChange, + $onLastSavedStateChange, + dashboardSessionStorage, + dashboardCapabilities, + isEmbeddedExternally, + kbnUrlStateStorage, + savedObjectsTagging, + initializerContext, + savedDashboardId, + getStateTransfer, + savedDashboards, + usageCollection, + notifications, + indexPatterns, + kibanaVersion, + embeddable, + docTitle, + history, + search, + query, + data, + ]); + + /** + * rebuild reset to last saved state callback whenever last saved state changes + */ + const resetToLastSavedState = useCallback(() => { + if ( + !lastSavedState || + !dashboardAppState.savedDashboard || + !dashboardAppState.getLatestDashboardState + ) { + return; + } + + if (dashboardAppState.getLatestDashboardState().timeRestore) { + const { timefilter } = data.query.timefilter; + const { timeFrom: from, timeTo: to, refreshInterval } = dashboardAppState.savedDashboard; + if (from && to) timefilter.setTime({ from, to }); + if (refreshInterval) timefilter.setRefreshInterval(refreshInterval); + } + dispatchDashboardStateChange(setDashboardState(lastSavedState)); + }, [lastSavedState, dashboardAppState, data.query.timefilter, dispatchDashboardStateChange]); + + /** + * publish state to the state change observable when redux state changes + */ + useEffect(() => { + if (!dashboardState || Object.keys(dashboardState).length === 0) return; + dashboardAppState.$onDashboardStateChange.next(dashboardState); + }, [dashboardAppState.$onDashboardStateChange, dashboardState]); + + /** + * push last saved state to the state change observable when last saved state changes + */ + useEffect(() => { + if (!lastSavedState) return; + $onLastSavedStateChange.next(lastSavedState); + }, [$onLastSavedStateChange, lastSavedState]); + + return { ...dashboardAppState, resetToLastSavedState }; +}; diff --git a/src/plugins/dashboard/public/application/hooks/use_dashboard_breadcrumbs.ts b/src/plugins/dashboard/public/application/hooks/use_dashboard_breadcrumbs.ts deleted file mode 100644 index 50465cc4ab58b2..00000000000000 --- a/src/plugins/dashboard/public/application/hooks/use_dashboard_breadcrumbs.ts +++ /dev/null @@ -1,53 +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 { useEffect } from 'react'; -import _ from 'lodash'; - -import { useKibana } from '../../services/kibana_react'; - -import { DashboardStateManager } from '../dashboard_state_manager'; -import { getDashboardBreadcrumb, getDashboardTitle } from '../../dashboard_strings'; -import { DashboardAppServices, DashboardRedirect } from '../types'; - -export const useDashboardBreadcrumbs = ( - dashboardStateManager: DashboardStateManager | null, - redirectTo: DashboardRedirect -) => { - const { data, core, chrome } = useKibana().services; - - // Destructure and rename services; makes the Effect hook more specific, makes later - // abstraction of service dependencies easier. - const { setBreadcrumbs } = chrome; - const { timefilter } = data.query.timefilter; - const { openConfirm } = core.overlays; - - // Sync breadcrumbs when Dashboard State Manager changes - useEffect(() => { - if (!dashboardStateManager) { - return; - } - - setBreadcrumbs([ - { - text: getDashboardBreadcrumb(), - 'data-test-subj': 'dashboardListingBreadcrumb', - onClick: () => { - redirectTo({ destination: 'listing' }); - }, - }, - { - text: getDashboardTitle( - dashboardStateManager.getTitle(), - dashboardStateManager.getViewMode(), - dashboardStateManager.isNew() - ), - }, - ]); - }, [dashboardStateManager, timefilter, openConfirm, redirectTo, setBreadcrumbs]); -}; diff --git a/src/plugins/dashboard/public/application/hooks/use_dashboard_container.test.tsx b/src/plugins/dashboard/public/application/hooks/use_dashboard_container.test.tsx deleted file mode 100644 index b2fc7c917d285e..00000000000000 --- a/src/plugins/dashboard/public/application/hooks/use_dashboard_container.test.tsx +++ /dev/null @@ -1,199 +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 { useDashboardContainer } from './use_dashboard_container'; -import { renderHook, act } from '@testing-library/react-hooks'; -import { KibanaContextProvider } from '../../../../kibana_react/public'; -import React from 'react'; -import { DashboardStateManager } from '../dashboard_state_manager'; -import { getSavedDashboardMock } from '../test_helpers'; -import { createKbnUrlStateStorage, defer } from '../../../../kibana_utils/public'; -import { createBrowserHistory } from 'history'; -import { dataPluginMock } from '../../../../data/public/mocks'; -import { embeddablePluginMock } from '../../../../embeddable/public/mocks'; -import { DashboardCapabilities } from '../types'; -import { EmbeddableFactory } from '../../../../embeddable/public'; -import { HelloWorldEmbeddable } from '../../../../embeddable/public/tests/fixtures'; -import { DashboardContainer } from '../embeddable'; -import { coreMock } from 'src/core/public/mocks'; - -const savedDashboard = getSavedDashboardMock(); - -// TS is *very* picky with type guards / predicates. can't just use jest.fn() -function mockHasTaggingCapabilities(obj: any): obj is any { - return false; -} - -const history = createBrowserHistory(); -const createDashboardState = () => - new DashboardStateManager({ - savedDashboard, - kibanaVersion: '7.0.0', - hideWriteControls: false, - allowByValueEmbeddables: false, - history: createBrowserHistory(), - hasPendingEmbeddable: () => false, - kbnUrlStateStorage: createKbnUrlStateStorage(), - hasTaggingCapabilities: mockHasTaggingCapabilities, - toasts: coreMock.createStart().notifications.toasts, - }); - -const defaultCapabilities: DashboardCapabilities = { - show: false, - createNew: false, - saveQuery: false, - createShortUrl: false, - hideWriteControls: true, - mapsCapabilities: { save: false }, - visualizeCapabilities: { save: false }, - storeSearchSession: true, -}; - -const getIncomingEmbeddable = () => undefined; - -const services = { - dashboardCapabilities: defaultCapabilities, - data: dataPluginMock.createStartContract(), - embeddable: embeddablePluginMock.createStartContract(), - scopedHistory: history, -}; - -const setupEmbeddableFactory = () => { - const embeddable = new HelloWorldEmbeddable({ id: 'id' }); - const deferEmbeddableCreate = defer(); - services.embeddable.getEmbeddableFactory.mockImplementation( - () => - (({ - create: () => deferEmbeddableCreate.promise, - } as unknown) as EmbeddableFactory) - ); - const destroySpy = jest.spyOn(embeddable, 'destroy'); - - return { - destroySpy, - embeddable, - createEmbeddable: () => { - act(() => { - deferEmbeddableCreate.resolve(embeddable); - }); - }, - }; -}; - -test('container is destroyed on unmount', async () => { - const { createEmbeddable, destroySpy, embeddable } = setupEmbeddableFactory(); - - const dashboardStateManager = createDashboardState(); - const { result, unmount, waitForNextUpdate } = renderHook( - () => - useDashboardContainer({ - getIncomingEmbeddable, - dashboardStateManager, - history, - }), - { - wrapper: ({ children }) => ( - {children} - ), - } - ); - - expect(result.current).toBeNull(); // null on initial render - - createEmbeddable(); - - await waitForNextUpdate(); - - expect(embeddable).toBe(result.current); - expect(destroySpy).not.toBeCalled(); - - unmount(); - - expect(destroySpy).toBeCalled(); -}); - -test('old container is destroyed on new dashboardStateManager', async () => { - const embeddableFactoryOld = setupEmbeddableFactory(); - - const { result, waitForNextUpdate, rerender } = renderHook< - DashboardStateManager, - DashboardContainer | null - >( - (dashboardStateManager) => - useDashboardContainer({ - getIncomingEmbeddable, - dashboardStateManager, - history, - }), - { - wrapper: ({ children }) => ( - {children} - ), - initialProps: createDashboardState(), - } - ); - - expect(result.current).toBeNull(); // null on initial render - - embeddableFactoryOld.createEmbeddable(); - - await waitForNextUpdate(); - - expect(embeddableFactoryOld.embeddable).toBe(result.current); - expect(embeddableFactoryOld.destroySpy).not.toBeCalled(); - - const embeddableFactoryNew = setupEmbeddableFactory(); - rerender(createDashboardState()); - - embeddableFactoryNew.createEmbeddable(); - - await waitForNextUpdate(); - - expect(embeddableFactoryNew.embeddable).toBe(result.current); - - expect(embeddableFactoryNew.destroySpy).not.toBeCalled(); - expect(embeddableFactoryOld.destroySpy).toBeCalled(); -}); - -test('destroyed if rerendered before resolved', async () => { - const embeddableFactoryOld = setupEmbeddableFactory(); - - const { result, waitForNextUpdate, rerender } = renderHook< - DashboardStateManager, - DashboardContainer | null - >( - (dashboardStateManager) => - useDashboardContainer({ - getIncomingEmbeddable, - dashboardStateManager, - history, - }), - { - wrapper: ({ children }) => ( - {children} - ), - initialProps: createDashboardState(), - } - ); - - expect(result.current).toBeNull(); // null on initial render - - const embeddableFactoryNew = setupEmbeddableFactory(); - rerender(createDashboardState()); - embeddableFactoryNew.createEmbeddable(); - await waitForNextUpdate(); - expect(embeddableFactoryNew.embeddable).toBe(result.current); - expect(embeddableFactoryNew.destroySpy).not.toBeCalled(); - - embeddableFactoryOld.createEmbeddable(); - - await act(() => Promise.resolve()); // Can't use waitFor from hooks, because there is no hook update - expect(embeddableFactoryNew.embeddable).toBe(result.current); - expect(embeddableFactoryNew.destroySpy).not.toBeCalled(); - expect(embeddableFactoryOld.destroySpy).toBeCalled(); -}); diff --git a/src/plugins/dashboard/public/application/hooks/use_dashboard_container.ts b/src/plugins/dashboard/public/application/hooks/use_dashboard_container.ts deleted file mode 100644 index d715fb70ec91a8..00000000000000 --- a/src/plugins/dashboard/public/application/hooks/use_dashboard_container.ts +++ /dev/null @@ -1,169 +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 { useEffect, useState } from 'react'; -import { History } from 'history'; - -import { useKibana } from '../../services/kibana_react'; -import { - ContainerOutput, - EmbeddableFactoryNotFoundError, - EmbeddableInput, - EmbeddablePackageState, - ErrorEmbeddable, - isErrorEmbeddable, - ViewMode, -} from '../../services/embeddable'; - -import { DashboardStateManager } from '../dashboard_state_manager'; -import { getDashboardContainerInput, getSearchSessionIdFromURL } from '../dashboard_app_functions'; -import { DashboardContainer, DashboardContainerInput } from '../..'; -import { DashboardAppServices } from '../types'; -import { DASHBOARD_CONTAINER_TYPE } from '..'; -import { TimefilterContract } from '../../services/data'; - -export const useDashboardContainer = ({ - history, - timeFilter, - setUnsavedChanges, - getIncomingEmbeddable, - dashboardStateManager, - isEmbeddedExternally, -}: { - history: History; - isEmbeddedExternally?: boolean; - timeFilter?: TimefilterContract; - setUnsavedChanges?: (dirty: boolean) => void; - dashboardStateManager: DashboardStateManager | null; - getIncomingEmbeddable: (removeAfterFetch?: boolean) => EmbeddablePackageState | undefined; -}) => { - const { - dashboardCapabilities, - data, - embeddable, - scopedHistory, - } = useKibana().services; - - // Destructure and rename services; makes the Effect hook more specific, makes later - // abstraction of service dependencies easier. - const { query } = data; - const { session: searchSession } = data.search; - - const [dashboardContainer, setDashboardContainer] = useState(null); - - useEffect(() => { - if (!dashboardStateManager) { - return; - } - - // Load dashboard container - const dashboardFactory = embeddable.getEmbeddableFactory< - DashboardContainerInput, - ContainerOutput, - DashboardContainer - >(DASHBOARD_CONTAINER_TYPE); - - if (!dashboardFactory) { - throw new EmbeddableFactoryNotFoundError( - 'dashboard app requires dashboard embeddable factory' - ); - } - - const searchSessionIdFromURL = getSearchSessionIdFromURL(history); - - if (searchSessionIdFromURL) { - searchSession.restore(searchSessionIdFromURL); - } - - const incomingEmbeddable = getIncomingEmbeddable(true); - - let canceled = false; - let pendingContainer: DashboardContainer | ErrorEmbeddable | null | undefined; - (async function createContainer() { - const existingSession = searchSession.getSessionId(); - pendingContainer = await dashboardFactory.create( - getDashboardContainerInput({ - isEmbeddedExternally: Boolean(isEmbeddedExternally), - dashboardCapabilities, - dashboardStateManager, - incomingEmbeddable, - query, - searchSessionId: - searchSessionIdFromURL ?? - (existingSession && incomingEmbeddable ? existingSession : searchSession.start()), - }) - ); - - // already new container is being created - // no longer interested in the pending one - if (canceled) { - try { - pendingContainer?.destroy(); - pendingContainer = null; - } catch (e) { - // destroy could throw if something has already destroyed the container - // eslint-disable-next-line no-console - console.warn(e); - } - - return; - } - - if (!pendingContainer || isErrorEmbeddable(pendingContainer)) { - return; - } - - // inject switch view mode callback for the empty screen to use - pendingContainer.switchViewMode = (newViewMode: ViewMode) => - dashboardStateManager.switchViewMode(newViewMode); - - // If the incoming embeddable is newly created, or doesn't exist in the current panels list, - // add it with `addNewEmbeddable` - if ( - incomingEmbeddable && - (!incomingEmbeddable?.embeddableId || - (incomingEmbeddable.embeddableId && - !pendingContainer.getInput().panels[incomingEmbeddable.embeddableId])) - ) { - pendingContainer.addNewEmbeddable( - incomingEmbeddable.type, - incomingEmbeddable.input - ); - } - setDashboardContainer(pendingContainer); - setUnsavedChanges?.(dashboardStateManager.getIsDirty(data.query.timefilter.timefilter)); - })(); - return () => { - canceled = true; - try { - pendingContainer?.destroy(); - } catch (e) { - // destroy could throw if something has already destroyed the container - // eslint-disable-next-line no-console - console.warn(e); - } - - setDashboardContainer(null); - }; - }, [ - data.query.timefilter.timefilter, - dashboardCapabilities, - dashboardStateManager, - getIncomingEmbeddable, - isEmbeddedExternally, - setUnsavedChanges, - searchSession, - scopedHistory, - timeFilter, - embeddable, - history, - query, - ]); - - return dashboardContainer; -}; diff --git a/src/plugins/dashboard/public/application/hooks/use_dashboard_state_manager.ts b/src/plugins/dashboard/public/application/hooks/use_dashboard_state_manager.ts deleted file mode 100644 index 72b43723f07fbf..00000000000000 --- a/src/plugins/dashboard/public/application/hooks/use_dashboard_state_manager.ts +++ /dev/null @@ -1,220 +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 { useEffect, useState } from 'react'; -import { History } from 'history'; -import _ from 'lodash'; -import { map } from 'rxjs/operators'; - -import { createKbnUrlStateStorage, withNotifyOnErrors } from '../../services/kibana_utils'; -import { useKibana } from '../../services/kibana_react'; -import { - connectToQueryState, - esFilters, - noSearchSessionStorageCapabilityMessage, - QueryState, - syncQueryStateWithUrl, -} from '../../services/data'; -import { SavedObject } from '../../services/saved_objects'; -import type { TagDecoratedSavedObject } from '../../services/saved_objects_tagging_oss'; - -import { DashboardSavedObject } from '../../saved_dashboards'; -import { migrateLegacyQuery } from '../lib/migrate_legacy_query'; -import { createSessionRestorationDataProvider } from '../lib/session_restoration'; -import { DashboardStateManager } from '../dashboard_state_manager'; -import { getDashboardTitle } from '../../dashboard_strings'; -import { DashboardAppServices } from '../types'; -import { EmbeddablePackageState, ViewMode } from '../../services/embeddable'; - -// TS is picky with type guards, we can't just inline `() => false` -function defaultTaggingGuard(_obj: SavedObject): _obj is TagDecoratedSavedObject { - return false; -} - -interface DashboardStateManagerReturn { - dashboardStateManager: DashboardStateManager | null; - viewMode: ViewMode | null; - setViewMode: (value: ViewMode) => void; -} - -export const useDashboardStateManager = ( - savedDashboard: DashboardSavedObject | null, - history: History, - getIncomingEmbeddable: () => EmbeddablePackageState | undefined -): DashboardStateManagerReturn => { - const { - data: dataPlugin, - core, - uiSettings, - usageCollection, - initializerContext, - savedObjectsTagging, - dashboardCapabilities, - dashboardPanelStorage, - allowByValueEmbeddables, - } = useKibana().services; - - // Destructure and rename services; makes the Effect hook more specific, makes later - // abstraction of service dependencies easier. - const { query: queryService } = dataPlugin; - const { session: searchSession } = dataPlugin.search; - const { filterManager, queryString: queryStringManager } = queryService; - const { timefilter } = queryService.timefilter; - const { toasts } = core.notifications; - const { hideWriteControls } = dashboardCapabilities; - const { version: kibanaVersion } = initializerContext.env.packageInfo; - - const [dashboardStateManager, setDashboardStateManager] = useState( - null - ); - const [viewMode, setViewMode] = useState(null); - - const hasTaggingCapabilities = savedObjectsTagging?.ui.hasTagDecoration || defaultTaggingGuard; - - useEffect(() => { - if (!savedDashboard) { - return; - } - - const kbnUrlStateStorage = createKbnUrlStateStorage({ - history, - useHash: uiSettings.get('state:storeInSessionStorage'), - ...withNotifyOnErrors(toasts), - }); - - const stateManager = new DashboardStateManager({ - hasPendingEmbeddable: () => Boolean(getIncomingEmbeddable()), - toasts: core.notifications.toasts, - hasTaggingCapabilities, - dashboardPanelStorage, - hideWriteControls, - history, - kbnUrlStateStorage, - kibanaVersion, - savedDashboard, - usageCollection, - allowByValueEmbeddables, - }); - - // sync initial app filters from state to filterManager - // if there is an existing similar global filter, then leave it as global - filterManager.setAppFilters(_.cloneDeep(stateManager.appState.filters)); - queryStringManager.setQuery(migrateLegacyQuery(stateManager.appState.query)); - - // setup syncing of app filters between appState and filterManager - const stopSyncingAppFilters = connectToQueryState( - queryService, - { - set: ({ filters, query }) => { - stateManager.setFilters(filters || []); - stateManager.setQuery(query || queryStringManager.getDefaultQuery()); - }, - get: () => ({ - filters: stateManager.appState.filters, - query: stateManager.getQuery(), - }), - state$: stateManager.appState$.pipe( - map((appState) => ({ - filters: appState.filters, - query: queryStringManager.formatQuery(appState.query), - })) - ), - }, - { - filters: esFilters.FilterStateStore.APP_STATE, - query: true, - } - ); - - // Apply initial filters to Dashboard State Manager - stateManager.applyFilters( - stateManager.getQuery() || queryStringManager.getDefaultQuery(), - filterManager.getFilters() - ); - - // The hash check is so we only update the time filter on dashboard open, not during - // normal cross app navigation. - if (stateManager.getIsTimeSavedWithDashboard()) { - const initialGlobalStateInUrl = kbnUrlStateStorage.get('_g'); - if (!initialGlobalStateInUrl?.time) { - stateManager.syncTimefilterWithDashboardTime(timefilter); - } - if (!initialGlobalStateInUrl?.refreshInterval) { - stateManager.syncTimefilterWithDashboardRefreshInterval(timefilter); - } - } - - // starts syncing `_g` portion of url with query services - // it is important to start this syncing after `dashboardStateManager.syncTimefilterWithDashboard(timefilter);` above is run, - // otherwise it will case redundant browser history records - const { stop: stopSyncingQueryServiceStateWithUrl } = syncQueryStateWithUrl( - queryService, - kbnUrlStateStorage - ); - - // starts syncing `_a` portion of url - stateManager.startStateSyncing(); - - const dashboardTitle = getDashboardTitle( - stateManager.getTitle(), - stateManager.getViewMode(), - stateManager.isNew() - ); - - searchSession.enableStorage( - createSessionRestorationDataProvider({ - data: dataPlugin, - getDashboardTitle: () => dashboardTitle, - getDashboardId: () => savedDashboard?.id || '', - getAppState: () => stateManager.getAppState(), - }), - { - isDisabled: () => - dashboardCapabilities.storeSearchSession - ? { disabled: false } - : { - disabled: true, - reasonText: noSearchSessionStorageCapabilityMessage, - }, - } - ); - - setDashboardStateManager(stateManager); - setViewMode(stateManager.getViewMode()); - - return () => { - stateManager?.destroy(); - setDashboardStateManager(null); - stopSyncingAppFilters(); - stopSyncingQueryServiceStateWithUrl(); - }; - }, [ - dataPlugin, - filterManager, - hasTaggingCapabilities, - initializerContext.config, - dashboardPanelStorage, - getIncomingEmbeddable, - hideWriteControls, - history, - kibanaVersion, - queryService, - queryStringManager, - savedDashboard, - searchSession, - timefilter, - toasts, - uiSettings, - usageCollection, - allowByValueEmbeddables, - core.notifications.toasts, - dashboardCapabilities.storeSearchSession, - ]); - - return { dashboardStateManager, viewMode, setViewMode }; -}; diff --git a/src/plugins/dashboard/public/application/hooks/use_saved_dashboard.ts b/src/plugins/dashboard/public/application/hooks/use_saved_dashboard.ts deleted file mode 100644 index 639bc830803a44..00000000000000 --- a/src/plugins/dashboard/public/application/hooks/use_saved_dashboard.ts +++ /dev/null @@ -1,66 +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 { useEffect, useState } from 'react'; -import { History } from 'history'; -import _ from 'lodash'; - -import { useKibana } from '../../services/kibana_react'; - -import { DashboardConstants } from '../..'; -import { DashboardSavedObject } from '../../saved_dashboards'; -import { getDashboard60Warning, getNewDashboardTitle } from '../../dashboard_strings'; -import { DashboardAppServices } from '../types'; - -export const useSavedDashboard = (savedDashboardId: string | undefined, history: History) => { - const { data, core, chrome, savedDashboards } = useKibana().services; - const [savedDashboard, setSavedDashboard] = useState(null); - - // Destructure and rename services; makes the Effect hook more specific, makes later - // abstraction of service dependencies easier. - const { indexPatterns } = data; - const { recentlyAccessed: recentlyAccessedPaths, docTitle } = chrome; - const { toasts } = core.notifications; - - useEffect(() => { - (async function loadSavedDashboard() { - if (savedDashboardId === 'create') { - history.replace({ - ...history.location, // preserve query, - pathname: DashboardConstants.CREATE_NEW_DASHBOARD_URL, - }); - - toasts.addWarning(getDashboard60Warning()); - return; - } - - await indexPatterns.ensureDefaultIndexPattern(); - - try { - const dashboard = (await savedDashboards.get(savedDashboardId)) as DashboardSavedObject; - docTitle.change(dashboard.title || getNewDashboardTitle()); - setSavedDashboard(dashboard); - } catch (error) { - // E.g. a corrupt or deleted dashboard - toasts.addDanger(error.message); - history.push(DashboardConstants.LANDING_PAGE_PATH); - } - })(); - return () => setSavedDashboard(null); - }, [ - toasts, - docTitle, - history, - indexPatterns, - recentlyAccessedPaths, - savedDashboardId, - savedDashboards, - ]); - - return savedDashboard; -}; diff --git a/src/plugins/dashboard/public/application/lib/build_dashboard_container.ts b/src/plugins/dashboard/public/application/lib/build_dashboard_container.ts new file mode 100644 index 00000000000000..cb8c5ac5745e4c --- /dev/null +++ b/src/plugins/dashboard/public/application/lib/build_dashboard_container.ts @@ -0,0 +1,160 @@ +/* + * 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 _ from 'lodash'; +import { DashboardSavedObject } from '../../saved_dashboards'; +import { DashboardContainer, DASHBOARD_CONTAINER_TYPE } from '../embeddable'; +import { + DashboardBuildContext, + DashboardState, + DashboardContainerInput, + DashboardAppServices, +} from '../../types'; +import { + enableDashboardSearchSessions, + getSearchSessionIdFromURL, + stateToDashboardContainerInput, +} from '.'; +import { + ContainerOutput, + EmbeddableFactoryNotFoundError, + EmbeddableInput, + EmbeddablePackageState, + ErrorEmbeddable, + isErrorEmbeddable, +} from '../../services/embeddable'; + +type BuildDashboardContainerProps = DashboardBuildContext & { + data: DashboardAppServices['data']; // the whole data service is required here because it is required by getUrlGeneratorState + savedDashboard: DashboardSavedObject; + initialDashboardState: DashboardState; + incomingEmbeddable?: EmbeddablePackageState; +}; + +/** + * Builds the dashboard container and manages initial search session + */ +export const buildDashboardContainer = async ({ + getLatestDashboardState, + initialDashboardState, + isEmbeddedExternally, + dashboardCapabilities, + incomingEmbeddable, + savedDashboard, + kibanaVersion, + embeddable, + history, + data, +}: BuildDashboardContainerProps) => { + const { + search: { session }, + } = data; + + // set up search session + enableDashboardSearchSessions({ + data, + kibanaVersion, + savedDashboard, + initialDashboardState, + getLatestDashboardState, + canStoreSearchSession: dashboardCapabilities.storeSearchSession, + }); + const searchSessionIdFromURL = getSearchSessionIdFromURL(history); + if (searchSessionIdFromURL) { + session.restore(searchSessionIdFromURL); + } + + const dashboardFactory = embeddable.getEmbeddableFactory< + DashboardContainerInput, + ContainerOutput, + DashboardContainer + >(DASHBOARD_CONTAINER_TYPE); + + if (!dashboardFactory) { + throw new EmbeddableFactoryNotFoundError('dashboard app requires dashboard embeddable factory'); + } + + /** + * Use an existing session instead of starting a new one if there is a session already, and dashboard is being created with an incoming + * embeddable. + */ + const existingSession = session.getSessionId(); + const searchSessionId = + searchSessionIdFromURL ?? + (existingSession && incomingEmbeddable ? existingSession : session.start()); + + // Build the initial input for the dashboard container based on the dashboard state. + const initialInput = stateToDashboardContainerInput({ + isEmbeddedExternally: Boolean(isEmbeddedExternally), + dashboardState: initialDashboardState, + dashboardCapabilities, + incomingEmbeddable, + query: data.query, + searchSessionId, + savedDashboard, + }); + + /** + * Handle the Incoming Embeddable Part 1: + * If the incoming embeddable already exists e.g. if it has been edited by value, the incoming state for that panel needs to replace the + * state for the matching panel already in the dashboard. This needs to happen BEFORE the dashboard container is built, so that the panel + * retains the same placement. + */ + if (incomingEmbeddable?.embeddableId && initialInput.panels[incomingEmbeddable.embeddableId]) { + const originalPanelState = initialInput.panels[incomingEmbeddable.embeddableId]; + initialInput.panels = { + ...initialInput.panels, + [incomingEmbeddable.embeddableId]: { + gridData: originalPanelState.gridData, + type: incomingEmbeddable.type, + explicitInput: { + ...originalPanelState.explicitInput, + ...incomingEmbeddable.input, + id: incomingEmbeddable.embeddableId, + }, + }, + }; + } + + const dashboardContainer = await dashboardFactory.create(initialInput); + if (!dashboardContainer || isErrorEmbeddable(dashboardContainer)) { + tryDestroyDashboardContainer(dashboardContainer); + return; + } + + /** + * Handle the Incoming Embeddable Part 2: + * If the incoming embeddable is new, we can add it to the container using `addNewEmbeddable` after the container is created + * this lets the container handle the placement of it (using the default placement algorithm "top left most open space") + */ + if ( + incomingEmbeddable && + (!incomingEmbeddable?.embeddableId || + (incomingEmbeddable.embeddableId && + !dashboardContainer.getInput().panels[incomingEmbeddable.embeddableId])) + ) { + dashboardContainer.addNewEmbeddable( + incomingEmbeddable.type, + incomingEmbeddable.input + ); + } + + return dashboardContainer; +}; + +export const tryDestroyDashboardContainer = ( + container: DashboardContainer | ErrorEmbeddable | undefined +) => { + try { + container?.destroy(); + } catch (e) { + // destroy could throw if something has already destroyed the container + // eslint-disable-next-line no-console + console.warn(e); + } +}; diff --git a/src/plugins/dashboard/public/application/lib/convert_dashboard_state.ts b/src/plugins/dashboard/public/application/lib/convert_dashboard_state.ts new file mode 100644 index 00000000000000..ee2ec2bb14fe47 --- /dev/null +++ b/src/plugins/dashboard/public/application/lib/convert_dashboard_state.ts @@ -0,0 +1,143 @@ +/* + * 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 _ from 'lodash'; +import { DashboardSavedObject } from '../../saved_dashboards'; +import { getTagsFromSavedDashboard, migrateAppState } from '.'; +import { EmbeddablePackageState, ViewMode } from '../../services/embeddable'; +import { + convertPanelStateToSavedDashboardPanel, + convertSavedDashboardPanelToPanelState, +} from '../../../common/embeddable/embeddable_saved_object_converters'; +import { + DashboardState, + RawDashboardState, + DashboardPanelMap, + SavedDashboardPanel, + DashboardAppServices, + DashboardContainerInput, + DashboardBuildContext, +} from '../../types'; + +interface SavedObjectToDashboardStateProps { + version: string; + hideWriteControls: boolean; + savedDashboard: DashboardSavedObject; + usageCollection: DashboardAppServices['usageCollection']; + savedObjectsTagging: DashboardAppServices['savedObjectsTagging']; +} + +interface StateToDashboardContainerInputProps { + searchSessionId?: string; + isEmbeddedExternally?: boolean; + dashboardState: DashboardState; + savedDashboard: DashboardSavedObject; + query: DashboardBuildContext['query']; + incomingEmbeddable?: EmbeddablePackageState; + dashboardCapabilities: DashboardBuildContext['dashboardCapabilities']; +} + +interface StateToRawDashboardStateProps { + version: string; + state: DashboardState; +} +/** + * Converts a dashboard saved object to a dashboard state by extracting raw state from the given Dashboard + * Saved Object migrating the panel states to the latest version, then converting each panel from a saved + * dashboard panel to a panel state. + */ +export const savedObjectToDashboardState = ({ + version, + hideWriteControls, + savedDashboard, + usageCollection, + savedObjectsTagging, +}: SavedObjectToDashboardStateProps): DashboardState => { + const rawState = migrateAppState( + { + fullScreenMode: false, + title: savedDashboard.title, + query: savedDashboard.getQuery(), + filters: savedDashboard.getFilters(), + timeRestore: savedDashboard.timeRestore, + description: savedDashboard.description || '', + tags: getTagsFromSavedDashboard(savedDashboard, savedObjectsTagging), + panels: savedDashboard.panelsJSON ? JSON.parse(savedDashboard.panelsJSON) : [], + viewMode: savedDashboard.id || hideWriteControls ? ViewMode.VIEW : ViewMode.EDIT, + options: savedDashboard.optionsJSON ? JSON.parse(savedDashboard.optionsJSON) : {}, + }, + version, + usageCollection + ); + + const panels: DashboardPanelMap = {}; + rawState.panels?.forEach((panel: SavedDashboardPanel) => { + panels[panel.panelIndex] = convertSavedDashboardPanelToPanelState(panel); + }); + return { ...rawState, panels }; +}; + +/** + * Converts a dashboard state object to dashboard container input + */ +export const stateToDashboardContainerInput = ({ + dashboardCapabilities, + isEmbeddedExternally, + query: queryService, + searchSessionId, + savedDashboard, + dashboardState, +}: StateToDashboardContainerInputProps): DashboardContainerInput => { + const { filterManager, timefilter: timefilterService } = queryService; + const { timefilter } = timefilterService; + + const { + expandedPanelId, + fullScreenMode, + description, + options, + viewMode, + panels, + query, + title, + } = dashboardState; + + return { + refreshConfig: timefilter.getRefreshInterval(), + filters: filterManager.getFilters(), + isFullScreenMode: fullScreenMode, + id: savedDashboard.id || '', + dashboardCapabilities, + isEmbeddedExternally, + ...(options || {}), + searchSessionId, + expandedPanelId, + description, + viewMode, + panels, + query, + title, + timeRange: { + ..._.cloneDeep(timefilter.getTime()), + }, + }; +}; + +/** + * Converts a given dashboard state object to raw dashboard state. This is useful for sharing, and session restoration, as + * they require panels to be formatted as an array. + */ +export const stateToRawDashboardState = ({ + version, + state, +}: StateToRawDashboardStateProps): RawDashboardState => { + const savedDashboardPanels = Object.values(state.panels).map((panel) => + convertPanelStateToSavedDashboardPanel(panel, version) + ); + return { ..._.omit(state, 'panels'), panels: savedDashboardPanels }; +}; diff --git a/src/plugins/dashboard/public/application/lib/dashboard_session_restoration.ts b/src/plugins/dashboard/public/application/lib/dashboard_session_restoration.ts new file mode 100644 index 00000000000000..7dd2b53a581558 --- /dev/null +++ b/src/plugins/dashboard/public/application/lib/dashboard_session_restoration.ts @@ -0,0 +1,131 @@ +/* + * 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 { History } from 'history'; +import { DashboardConstants } from '../..'; +import { DashboardState } from '../../types'; +import { getDashboardTitle } from '../../dashboard_strings'; +import { DashboardSavedObject } from '../../saved_dashboards'; +import { getQueryParams } from '../../services/kibana_utils'; +import { createQueryParamObservable } from '../../../../kibana_utils/public'; +import { DASHBOARD_APP_URL_GENERATOR, DashboardUrlGeneratorState } from '../../url_generator'; +import { + DataPublicPluginStart, + noSearchSessionStorageCapabilityMessage, +} from '../../services/data'; +import { stateToRawDashboardState } from './convert_dashboard_state'; + +export const getSearchSessionIdFromURL = (history: History): string | undefined => + getQueryParams(history.location)[DashboardConstants.SEARCH_SESSION_ID] as string | undefined; + +export const getSessionURLObservable = (history: History) => + createQueryParamObservable(history, DashboardConstants.SEARCH_SESSION_ID); + +export function createSessionRestorationDataProvider(deps: { + kibanaVersion: string; + data: DataPublicPluginStart; + getAppState: () => DashboardState; + getDashboardTitle: () => string; + getDashboardId: () => string; +}) { + return { + getName: async () => deps.getDashboardTitle(), + getUrlGeneratorData: async () => { + return { + urlGeneratorId: DASHBOARD_APP_URL_GENERATOR, + initialState: getUrlGeneratorState({ ...deps, shouldRestoreSearchSession: false }), + restoreState: getUrlGeneratorState({ ...deps, shouldRestoreSearchSession: true }), + }; + }, + }; +} + +/** + * Enables dashboard search sessions. + */ +export function enableDashboardSearchSessions({ + canStoreSearchSession, + initialDashboardState, + getLatestDashboardState, + savedDashboard, + kibanaVersion, + data, +}: { + kibanaVersion: string; + data: DataPublicPluginStart; + canStoreSearchSession: boolean; + savedDashboard: DashboardSavedObject; + initialDashboardState: DashboardState; + getLatestDashboardState: () => DashboardState; +}) { + const dashboardTitle = getDashboardTitle( + initialDashboardState.title, + initialDashboardState.viewMode, + !savedDashboard.id + ); + + data.search.session.enableStorage( + createSessionRestorationDataProvider({ + data, + kibanaVersion, + getDashboardTitle: () => dashboardTitle, + getDashboardId: () => savedDashboard?.id || '', + getAppState: getLatestDashboardState, + }), + { + isDisabled: () => + canStoreSearchSession + ? { disabled: false } + : { + disabled: true, + reasonText: noSearchSessionStorageCapabilityMessage, + }, + } + ); +} + +/** + * Fetches the state to store when a session is saved so that this dashboard can be recreated exactly + * as it was. + */ +function getUrlGeneratorState({ + data, + getAppState, + kibanaVersion, + getDashboardId, + shouldRestoreSearchSession, +}: { + kibanaVersion: string; + data: DataPublicPluginStart; + getAppState: () => DashboardState; + getDashboardId: () => string; + shouldRestoreSearchSession: boolean; +}): DashboardUrlGeneratorState { + const appState = stateToRawDashboardState({ state: getAppState(), version: kibanaVersion }); + const { filterManager, queryString } = data.query; + const { timefilter } = data.query.timefilter; + + return { + timeRange: shouldRestoreSearchSession ? timefilter.getAbsoluteTime() : timefilter.getTime(), + searchSessionId: shouldRestoreSearchSession ? data.search.session.getSessionId() : undefined, + panels: getDashboardId() ? undefined : appState.panels, + query: queryString.formatQuery(appState.query), + filters: filterManager.getFilters(), + savedQuery: appState.savedQuery, + dashboardId: getDashboardId(), + preserveSavedFilters: false, + viewMode: appState.viewMode, + useHash: false, + refreshInterval: shouldRestoreSearchSession + ? { + pause: true, // force pause refresh interval when restoring a session + value: 0, + } + : undefined, + }; +} diff --git a/src/plugins/dashboard/public/application/lib/dashboard_panel_storage.ts b/src/plugins/dashboard/public/application/lib/dashboard_session_storage.ts similarity index 72% rename from src/plugins/dashboard/public/application/lib/dashboard_panel_storage.ts rename to src/plugins/dashboard/public/application/lib/dashboard_session_storage.ts index 02890f6aaa7904..7d0e60c0609a8e 100644 --- a/src/plugins/dashboard/public/application/lib/dashboard_panel_storage.ts +++ b/src/plugins/dashboard/public/application/lib/dashboard_session_storage.ts @@ -10,19 +10,19 @@ import { set } from '@elastic/safer-lodash-set'; import { Storage } from '../../services/kibana_utils'; import { NotificationsStart } from '../../services/core'; import { panelStorageErrorStrings } from '../../dashboard_strings'; -import { SavedDashboardPanel } from '..'; +import { DashboardState } from '../../types'; export const DASHBOARD_PANELS_UNSAVED_ID = 'unsavedDashboard'; const DASHBOARD_PANELS_SESSION_KEY = 'dashboardStateManagerPanels'; -export class DashboardPanelStorage { +export class DashboardSessionStorage { private sessionStorage: Storage; constructor(private toasts: NotificationsStart['toasts'], private activeSpaceId: string) { this.sessionStorage = new Storage(sessionStorage); } - public clearPanels(id = DASHBOARD_PANELS_UNSAVED_ID) { + public clearState(id = DASHBOARD_PANELS_UNSAVED_ID) { try { const sessionStorage = this.sessionStorage.get(DASHBOARD_PANELS_SESSION_KEY); const sessionStorageForSpace = sessionStorage?.[this.activeSpaceId] || {}; @@ -38,7 +38,7 @@ export class DashboardPanelStorage { } } - public getPanels(id = DASHBOARD_PANELS_UNSAVED_ID): SavedDashboardPanel[] | undefined { + public getState(id = DASHBOARD_PANELS_UNSAVED_ID): Partial | undefined { try { return this.sessionStorage.get(DASHBOARD_PANELS_SESSION_KEY)?.[this.activeSpaceId]?.[id]; } catch (e) { @@ -49,11 +49,11 @@ export class DashboardPanelStorage { } } - public setPanels(id = DASHBOARD_PANELS_UNSAVED_ID, newPanels: SavedDashboardPanel[]) { + public setState(id = DASHBOARD_PANELS_UNSAVED_ID, newState: Partial) { try { - const sessionStoragePanels = this.sessionStorage.get(DASHBOARD_PANELS_SESSION_KEY) || {}; - set(sessionStoragePanels, [this.activeSpaceId, id], newPanels); - this.sessionStorage.set(DASHBOARD_PANELS_SESSION_KEY, sessionStoragePanels); + const sessionStateStorage = this.sessionStorage.get(DASHBOARD_PANELS_SESSION_KEY) || {}; + set(sessionStateStorage, [this.activeSpaceId, id], newState); + this.sessionStorage.set(DASHBOARD_PANELS_SESSION_KEY, sessionStateStorage); } catch (e) { this.toasts.addDanger({ title: panelStorageErrorStrings.getPanelsSetError(e.message), @@ -64,9 +64,18 @@ export class DashboardPanelStorage { public getDashboardIdsWithUnsavedChanges() { try { - return Object.keys( - this.sessionStorage.get(DASHBOARD_PANELS_SESSION_KEY)?.[this.activeSpaceId] || {} - ); + const dashboardStatesInSpace = + this.sessionStorage.get(DASHBOARD_PANELS_SESSION_KEY)?.[this.activeSpaceId] || {}; + const dashboardsWithUnsavedChanges: string[] = []; + Object.keys(dashboardStatesInSpace).map((dashboardId) => { + if ( + Object.keys(dashboardStatesInSpace[dashboardId]).some( + (stateKey) => stateKey !== 'viewMode' + ) + ) + dashboardsWithUnsavedChanges.push(dashboardId); + }); + return dashboardsWithUnsavedChanges; } catch (e) { this.toasts.addDanger({ title: panelStorageErrorStrings.getPanelsGetError(e.message), diff --git a/src/plugins/dashboard/public/application/lib/dashboard_tagging.ts b/src/plugins/dashboard/public/application/lib/dashboard_tagging.ts new file mode 100644 index 00000000000000..df2521044d1a3f --- /dev/null +++ b/src/plugins/dashboard/public/application/lib/dashboard_tagging.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 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 { DashboardSavedObject } from '../..'; +import { SavedObject } from '../../services/saved_objects'; +import { SavedObjectsTaggingApi } from '../../services/saved_objects_tagging_oss'; +import type { TagDecoratedSavedObject } from '../../services/saved_objects_tagging_oss'; + +// TS is picky with type guards, we can't just inline `() => false` +function defaultTaggingGuard(_obj: SavedObject): _obj is TagDecoratedSavedObject { + return false; +} + +export const getTagsFromSavedDashboard = ( + savedDashboard: DashboardSavedObject, + api?: SavedObjectsTaggingApi +) => { + const hasTaggingCapabilities = getHasTaggingCapabilitiesGuard(api); + return hasTaggingCapabilities(savedDashboard) ? savedDashboard.getTags() : []; +}; + +export const getHasTaggingCapabilitiesGuard = (api?: SavedObjectsTaggingApi) => + api?.ui.hasTagDecoration || defaultTaggingGuard; diff --git a/src/plugins/dashboard/public/application/lib/diff_dashboard_state.ts b/src/plugins/dashboard/public/application/lib/diff_dashboard_state.ts new file mode 100644 index 00000000000000..b1abba44891fcf --- /dev/null +++ b/src/plugins/dashboard/public/application/lib/diff_dashboard_state.ts @@ -0,0 +1,129 @@ +/* + * 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 _ from 'lodash'; +import { DashboardPanelState } from '..'; +import { esFilters, Filter } from '../../services/data'; +import { + DashboardContainerInput, + DashboardOptions, + DashboardPanelMap, + DashboardState, +} from '../../types'; + +interface DashboardDiffCommon { + [key: string]: unknown; +} + +type DashboardDiffCommonFilters = DashboardDiffCommon & { filters: Filter[] }; + +export const diffDashboardContainerInput = ( + originalInput: DashboardContainerInput, + newInput: DashboardContainerInput +) => { + return commonDiffFilters( + (originalInput as unknown) as DashboardDiffCommonFilters, + (newInput as unknown) as DashboardDiffCommonFilters, + ['searchSessionId', 'lastReloadRequestTime'] + ); +}; + +export const diffDashboardState = ( + original: DashboardState, + newState: DashboardState +): Partial => { + const common = commonDiffFilters( + (original as unknown) as DashboardDiffCommonFilters, + (newState as unknown) as DashboardDiffCommonFilters, + ['viewMode', 'panels', 'options', 'savedQuery', 'expandedPanelId'], + true + ); + + return { + ...common, + ...(panelsAreEqual(original.panels, newState.panels) ? {} : { panels: newState.panels }), + ...(optionsAreEqual(original.options, newState.options) ? {} : { options: newState.options }), + }; +}; + +const optionsAreEqual = (optionsA: DashboardOptions, optionsB: DashboardOptions): boolean => { + const optionKeys = [...Object.keys(optionsA), ...Object.keys(optionsB)]; + for (const key of optionKeys) { + if ( + Boolean(((optionsA as unknown) as { [key: string]: boolean })[key]) !== + Boolean(((optionsB as unknown) as { [key: string]: boolean })[key]) + ) { + return false; + } + } + return true; +}; + +const panelsAreEqual = (panelsA: DashboardPanelMap, panelsB: DashboardPanelMap): boolean => { + const embeddableIdsA = Object.keys(panelsA); + const embeddableIdsB = Object.keys(panelsB); + if ( + embeddableIdsA.length !== embeddableIdsB.length || + _.xor(embeddableIdsA, embeddableIdsB).length > 0 + ) { + return false; + } + // embeddable ids are equal so let's compare individual panels. + for (const id of embeddableIdsA) { + if ( + Object.keys( + commonDiff( + (panelsA[id] as unknown) as DashboardDiffCommon, + (panelsB[id] as unknown) as DashboardDiffCommon, + ['panelRefName'] + ) + ).length > 0 + ) { + return false; + } + } + + return true; +}; + +const commonDiffFilters = ( + originalObj: DashboardDiffCommonFilters, + newObj: DashboardDiffCommonFilters, + omitKeys: string[], + ignorePinned?: boolean +): Partial => { + const filtersAreDifferent = () => + !esFilters.compareFilters( + originalObj.filters, + ignorePinned ? newObj.filters.filter((f) => !esFilters.isFilterPinned(f)) : newObj.filters, + esFilters.COMPARE_ALL_OPTIONS + ); + const otherDifferences = commonDiff(originalObj, newObj, [...omitKeys, 'filters']); + return _.cloneDeep({ + ...otherDifferences, + ...(filtersAreDifferent() ? { filters: newObj.filters } : {}), + }); +}; + +const commonDiff = ( + originalObj: DashboardDiffCommon, + newObj: DashboardDiffCommon, + omitKeys: string[] +) => { + const differences: Partial = {}; + const keys = [...Object.keys(originalObj), ...Object.keys(newObj)].filter( + (key) => !omitKeys.includes(key) + ); + keys.forEach((key) => { + if (key === undefined) return; + if (!_.isEqual(originalObj[key], newObj[key])) { + (differences as { [key: string]: unknown })[key] = newObj[key]; + } + }); + return differences; +}; diff --git a/src/plugins/dashboard/public/application/lib/filter_utils.ts b/src/plugins/dashboard/public/application/lib/filter_utils.ts index 83dd036285a512..51acc4676c5433 100644 --- a/src/plugins/dashboard/public/application/lib/filter_utils.ts +++ b/src/plugins/dashboard/public/application/lib/filter_utils.ts @@ -8,59 +8,68 @@ import _ from 'lodash'; import moment, { Moment } from 'moment'; -import { Filter } from '../../services/data'; +import { Optional } from '@kbn/utility-types'; + +import { Filter, TimeRange } from '../../services/data'; + +type TimeRangeCompare = Optional; /** - * @typedef {Object} QueryFilter - * @property query_string {Object} - * @property query_string.query {String} + * Converts the time to a utc formatted string. If the time is not valid (e.g. it might be in a relative format like + * 'now-15m', then it just returns what it was passed). + * @param time {string|Moment} + * @returns the time represented in utc format, or if the time range was not able to be parsed into a moment + * object, it returns the same object it was given. */ - -export class FilterUtils { - /** - * Converts the time to a utc formatted string. If the time is not valid (e.g. it might be in a relative format like - * 'now-15m', then it just returns what it was passed). - * @param time {string|Moment} - * @returns the time represented in utc format, or if the time range was not able to be parsed into a moment - * object, it returns the same object it was given. - */ - public static convertTimeToUTCString(time?: string | Moment): undefined | string { - if (moment(time).isValid()) { - return moment(time).utc().format('YYYY-MM-DDTHH:mm:ss.SSS[Z]'); - } else { - // If it's not a valid moment date, then it should be a string representing a relative time - // like 'now' or 'now-15m'. - return time as string; - } +export const convertTimeToUTCString = (time?: string | Moment): undefined | string => { + if (moment(time).isValid()) { + return moment(time).utc().format('YYYY-MM-DDTHH:mm:ss.SSS[Z]'); + } else { + // If it's not a valid moment date, then it should be a string representing a relative time + // like 'now' or 'now-15m'. + return time as string; } +}; - /** - * Compares the two times, making sure they are in both compared in string format. Absolute times - * are sometimes stored as moment objects, but converted to strings when reloaded. Relative times are - * strings that are not convertible to moment objects. - * @param timeA {string|Moment} - * @param timeB {string|Moment} - * @returns {boolean} - */ - public static areTimesEqual(timeA?: string | Moment, timeB?: string | Moment) { - return this.convertTimeToUTCString(timeA) === this.convertTimeToUTCString(timeB); - } +export const areTimeRangesEqual = (rangeA: TimeRangeCompare, rangeB: TimeRangeCompare): boolean => { + return areTimesEqual(rangeA.from, rangeB.from) && areTimesEqual(rangeA.to, rangeB.to); +}; - /** - * Depending on how a dashboard is loaded, the filter object may contain a $$hashKey and $state that will throw - * off a filter comparison. This removes those variables. - * @param filters {Array.} - * @returns {Array.} - */ - public static cleanFiltersForComparison(filters: Filter[]) { - return _.map(filters, (filter) => { - const f: Partial = _.omit(filter, ['$$hashKey', '$state']); - if (f.meta) { - // f.meta.value is the value displayed in the filter bar. - // It may also be loaded differently and shouldn't be used in this comparison. - return _.omit(f.meta, ['value']); - } - return f; - }); - } -} +/** + * Compares the two times, making sure they are in both compared in string format. Absolute times + * are sometimes stored as moment objects, but converted to strings when reloaded. Relative times are + * strings that are not convertible to moment objects. + * @param timeA {string|Moment} + * @param timeB {string|Moment} + * @returns {boolean} + */ +export const areTimesEqual = (timeA?: string | Moment, timeB?: string | Moment) => { + return convertTimeToUTCString(timeA) === convertTimeToUTCString(timeB); +}; + +/** + * Depending on how a dashboard is loaded, the filter object may contain a $$hashKey and $state that will throw + * off a filter comparison. This removes those variables. + * @param filters {Array.} + * @returns {Array.} + */ +export const cleanFiltersForComparison = (filters: Filter[]) => { + return _.map(filters, (filter) => { + const f: Partial = _.omit(filter, ['$$hashKey', '$state']); + if (f.meta) { + // f.meta.value is the value displayed in the filter bar. + // It may also be loaded differently and shouldn't be used in this comparison. + return _.omit(f.meta, ['value']); + } + return f; + }); +}; + +export const cleanFiltersForSerialize = (filters: Filter[]): Filter[] => { + return filters.map((filter) => { + if (filter.meta.value) { + delete filter.meta.value; + } + return filter; + }); +}; diff --git a/src/plugins/dashboard/public/application/lib/get_app_state_defaults.ts b/src/plugins/dashboard/public/application/lib/get_app_state_defaults.ts deleted file mode 100644 index d8d335317c2b23..00000000000000 --- a/src/plugins/dashboard/public/application/lib/get_app_state_defaults.ts +++ /dev/null @@ -1,31 +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 type { SavedObjectTagDecoratorTypeGuard } from '../../services/saved_objects_tagging_oss'; -import { ViewMode } from '../../services/embeddable'; -import { DashboardSavedObject } from '../../saved_dashboards'; -import { DashboardAppStateDefaults } from '../../types'; - -export function getAppStateDefaults( - viewMode: ViewMode, - savedDashboard: DashboardSavedObject, - hasTaggingCapabilities: SavedObjectTagDecoratorTypeGuard -): DashboardAppStateDefaults { - return { - fullScreenMode: false, - title: savedDashboard.title, - description: savedDashboard.description || '', - tags: hasTaggingCapabilities(savedDashboard) ? savedDashboard.getTags() : [], - timeRestore: savedDashboard.timeRestore, - panels: savedDashboard.panelsJSON ? JSON.parse(savedDashboard.panelsJSON) : [], - options: savedDashboard.optionsJSON ? JSON.parse(savedDashboard.optionsJSON) : {}, - query: savedDashboard.getQuery(), - filters: savedDashboard.getFilters(), - viewMode, - }; -} diff --git a/src/plugins/dashboard/public/application/lib/index.ts b/src/plugins/dashboard/public/application/lib/index.ts index f457589c7588ea..937c1d2a77c06b 100644 --- a/src/plugins/dashboard/public/application/lib/index.ts +++ b/src/plugins/dashboard/public/application/lib/index.ts @@ -6,11 +6,28 @@ * Side Public License, v 1. */ +export * from './filter_utils'; +export { getDashboardIdFromUrl } from './url'; export { saveDashboard } from './save_dashboard'; -export { getAppStateDefaults } from './get_app_state_defaults'; export { migrateAppState } from './migrate_app_state'; -export { getDashboardIdFromUrl } from './url'; -export { createSessionRestorationDataProvider } from './session_restoration'; export { addHelpMenuToAppChrome } from './help_menu_util'; +export { getTagsFromSavedDashboard } from './dashboard_tagging'; +export { loadDashboardUrlState } from './load_dashboard_url_state'; +export { DashboardSessionStorage } from './dashboard_session_storage'; +export { loadSavedDashboardState } from './load_saved_dashboard_state'; export { attemptLoadDashboardByTitle } from './load_dashboard_by_title'; -export { DashboardPanelStorage } from './dashboard_panel_storage'; +export { syncDashboardFilterState } from './sync_dashboard_filter_state'; +export { syncDashboardIndexPatterns } from './sync_dashboard_index_patterns'; +export { syncDashboardContainerInput } from './sync_dashboard_container_input'; +export { diffDashboardContainerInput, diffDashboardState } from './diff_dashboard_state'; +export { buildDashboardContainer, tryDestroyDashboardContainer } from './build_dashboard_container'; +export { + stateToDashboardContainerInput, + savedObjectToDashboardState, +} from './convert_dashboard_state'; +export { + createSessionRestorationDataProvider, + enableDashboardSearchSessions, + getSearchSessionIdFromURL, + getSessionURLObservable, +} from './dashboard_session_restoration'; diff --git a/src/plugins/dashboard/public/application/lib/load_dashboard_url_state.ts b/src/plugins/dashboard/public/application/lib/load_dashboard_url_state.ts new file mode 100644 index 00000000000000..efff2ba6bc0870 --- /dev/null +++ b/src/plugins/dashboard/public/application/lib/load_dashboard_url_state.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 _ from 'lodash'; + +import { migrateAppState } from '.'; +import { replaceUrlHashQuery } from '../../../../kibana_utils/public'; +import { DASHBOARD_STATE_STORAGE_KEY } from '../../dashboard_constants'; +import { convertSavedDashboardPanelToPanelState } from '../../../common/embeddable/embeddable_saved_object_converters'; +import { + DashboardBuildContext, + DashboardPanelMap, + DashboardState, + RawDashboardState, + SavedDashboardPanel, +} from '../../types'; +import { migrateLegacyQuery } from './migrate_legacy_query'; + +/** + * Loads any dashboard state from the URL, and removes the state from the URL. + */ +export const loadDashboardUrlState = ({ + kibanaVersion, + usageCollection, + kbnUrlStateStorage, +}: DashboardBuildContext): Partial => { + const rawAppStateInUrl = kbnUrlStateStorage.get(DASHBOARD_STATE_STORAGE_KEY); + if (!rawAppStateInUrl) return {}; + + const panelsMap: DashboardPanelMap = {}; + if (rawAppStateInUrl.panels && rawAppStateInUrl.panels.length > 0) { + const rawState = migrateAppState(rawAppStateInUrl, kibanaVersion, usageCollection); + rawState.panels?.forEach((panel: SavedDashboardPanel) => { + panelsMap[panel.panelIndex] = convertSavedDashboardPanelToPanelState(panel); + }); + } + + const migratedQuery = rawAppStateInUrl.query + ? migrateLegacyQuery(rawAppStateInUrl.query) + : undefined; + + // remove state from URL + kbnUrlStateStorage.kbnUrlControls.updateAsync((nextUrl) => { + if (nextUrl.includes(DASHBOARD_STATE_STORAGE_KEY)) { + return replaceUrlHashQuery(nextUrl, (query) => { + delete query[DASHBOARD_STATE_STORAGE_KEY]; + return query; + }); + } + return nextUrl; + }, true); + + return { + ..._.omit(rawAppStateInUrl, ['panels', 'query']), + ...(migratedQuery ? { query: migratedQuery } : {}), + ...(rawAppStateInUrl.panels ? { panels: panelsMap } : {}), + }; +}; diff --git a/src/plugins/dashboard/public/application/lib/load_saved_dashboard_state.ts b/src/plugins/dashboard/public/application/lib/load_saved_dashboard_state.ts new file mode 100644 index 00000000000000..9069173c15e8f8 --- /dev/null +++ b/src/plugins/dashboard/public/application/lib/load_saved_dashboard_state.ts @@ -0,0 +1,82 @@ +/* + * 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 _ from 'lodash'; + +import { savedObjectToDashboardState } from './convert_dashboard_state'; +import { DashboardState, DashboardBuildContext } from '../../types'; +import { DashboardConstants, DashboardSavedObject } from '../..'; +import { getDashboard60Warning } from '../../dashboard_strings'; +import { migrateLegacyQuery } from './migrate_legacy_query'; +import { cleanFiltersForSerialize } from './filter_utils'; +import { ViewMode } from '../../services/embeddable'; + +interface LoadSavedDashboardStateReturn { + savedDashboardState: DashboardState; + savedDashboard: DashboardSavedObject; +} + +/** + * Loads, migrates, and returns state from a dashboard saved object. + */ +export const loadSavedDashboardState = async ({ + query, + history, + notifications, + indexPatterns, + savedDashboards, + usageCollection, + savedDashboardId, + initializerContext, + savedObjectsTagging, + dashboardCapabilities, +}: DashboardBuildContext & { savedDashboardId?: string }): Promise< + LoadSavedDashboardStateReturn | undefined +> => { + const { hideWriteControls } = dashboardCapabilities; + const { queryString } = query; + + // BWC - remove for 8.0 + if (savedDashboardId === 'create') { + history.replace({ + ...history.location, // preserve query, + pathname: DashboardConstants.CREATE_NEW_DASHBOARD_URL, + }); + + notifications.toasts.addWarning(getDashboard60Warning()); + return; + } + await indexPatterns.ensureDefaultIndexPattern(); + let savedDashboard: DashboardSavedObject | undefined; + try { + savedDashboard = (await savedDashboards.get(savedDashboardId)) as DashboardSavedObject; + } catch (error) { + // E.g. a corrupt or deleted dashboard + notifications.toasts.addDanger(error.message); + history.push(DashboardConstants.LANDING_PAGE_PATH); + return; + } + if (!savedDashboard) return; + + const savedDashboardState = savedObjectToDashboardState({ + savedDashboard, + usageCollection, + hideWriteControls, + savedObjectsTagging, + version: initializerContext.env.packageInfo.version, + }); + + const isViewMode = hideWriteControls || Boolean(savedDashboard.id); + savedDashboardState.viewMode = isViewMode ? ViewMode.VIEW : ViewMode.EDIT; + savedDashboardState.filters = cleanFiltersForSerialize(savedDashboardState.filters); + savedDashboardState.query = migrateLegacyQuery( + savedDashboardState.query || queryString.getDefaultQuery() + ); + + return { savedDashboardState, savedDashboard }; +}; diff --git a/src/plugins/dashboard/public/application/lib/migrate_app_state.ts b/src/plugins/dashboard/public/application/lib/migrate_app_state.ts index 9f60b3b539e269..fb8ef1b9ba2da1 100644 --- a/src/plugins/dashboard/public/application/lib/migrate_app_state.ts +++ b/src/plugins/dashboard/public/application/lib/migrate_app_state.ts @@ -11,7 +11,7 @@ import { i18n } from '@kbn/i18n'; import { METRIC_TYPE } from '@kbn/analytics'; import { UsageCollectionSetup } from '../../services/usage_collection'; -import { DashboardAppState, SavedDashboardPanel } from '../../types'; +import { RawDashboardState, SavedDashboardPanel } from '../../types'; import { migratePanelsTo730, SavedDashboardPanelTo60, @@ -28,10 +28,10 @@ import { * Once we hit a major version, we can remove support for older style URLs and get rid of this logic. */ export function migrateAppState( - appState: { [key: string]: any } & DashboardAppState, + appState: { [key: string]: any } & RawDashboardState, kibanaVersion: string, usageCollection?: UsageCollectionSetup -): DashboardAppState { +): RawDashboardState { if (!appState.panels) { throw new Error( i18n.translate('dashboard.panel.invalidData', { diff --git a/src/plugins/dashboard/public/application/lib/save_dashboard.ts b/src/plugins/dashboard/public/application/lib/save_dashboard.ts index 684d8b4c5e8d80..960d7d9cc86872 100644 --- a/src/plugins/dashboard/public/application/lib/save_dashboard.ts +++ b/src/plugins/dashboard/public/application/lib/save_dashboard.ts @@ -6,40 +6,110 @@ * Side Public License, v 1. */ -import { TimefilterContract } from '../../services/data'; +import _ from 'lodash'; + +import { convertTimeToUTCString } from '.'; +import { NotificationsStart } from '../../services/core'; +import { DashboardSavedObject } from '../../saved_dashboards'; +import { DashboardRedirect, DashboardState } from '../../types'; import { SavedObjectSaveOpts } from '../../services/saved_objects'; -import { updateSavedDashboard } from './update_saved_dashboard'; -import { DashboardStateManager } from '../dashboard_state_manager'; +import { dashboardSaveToastStrings } from '../../dashboard_strings'; +import { getHasTaggingCapabilitiesGuard } from './dashboard_tagging'; +import { SavedObjectsTaggingApi } from '../../services/saved_objects_tagging_oss'; +import { RefreshInterval, TimefilterContract, esFilters } from '../../services/data'; +import { convertPanelStateToSavedDashboardPanel } from '../../../common/embeddable/embeddable_saved_object_converters'; +import { DashboardSessionStorage } from './dashboard_session_storage'; export type SavedDashboardSaveOpts = SavedObjectSaveOpts & { stayInEditMode?: boolean }; -/** - * Saves the dashboard. - * @param toJson A custom toJson function. Used because the previous code used - * the angularized toJson version, and it was unclear whether there was a reason not to use - * JSON.stringify - * @returns A promise that if resolved, will contain the id of the newly saved - * dashboard. - */ -export function saveDashboard( - toJson: (obj: any) => string, - timeFilter: TimefilterContract, - dashboardStateManager: DashboardStateManager, - saveOptions: SavedDashboardSaveOpts -): Promise { - const savedDashboard = dashboardStateManager.savedDashboard; - const appState = dashboardStateManager.appState; - const hasTaggingCapabilities = dashboardStateManager.hasTaggingCapabilities; - - updateSavedDashboard(savedDashboard, appState, timeFilter, hasTaggingCapabilities, toJson); - - return savedDashboard.save(saveOptions).then((id: string) => { - if (id) { - // reset state only when save() was successful - // e.g. save() could be interrupted if title is duplicated and not confirmed - dashboardStateManager.lastSavedDashboardFilters = dashboardStateManager.getFilterState(); - } - - return id; - }); +interface SaveDashboardProps { + version: string; + redirectTo: DashboardRedirect; + currentState: DashboardState; + timefilter: TimefilterContract; + saveOptions: SavedDashboardSaveOpts; + toasts: NotificationsStart['toasts']; + savedDashboard: DashboardSavedObject; + savedObjectsTagging?: SavedObjectsTaggingApi; + dashboardSessionStorage: DashboardSessionStorage; } + +export const saveDashboard = async ({ + toasts, + version, + redirectTo, + timefilter, + saveOptions, + currentState, + savedDashboard, + savedObjectsTagging, + dashboardSessionStorage, +}: SaveDashboardProps): Promise<{ id?: string; redirected?: boolean; error?: any }> => { + const lastDashboardId = savedDashboard.id; + const hasTaggingCapabilities = getHasTaggingCapabilitiesGuard(savedObjectsTagging); + + const { panels, title, tags, description, timeRestore, options } = currentState; + + const savedDashboardPanels = Object.values(panels).map((panel) => + convertPanelStateToSavedDashboardPanel(panel, version) + ); + + savedDashboard.title = title; + savedDashboard.description = description; + savedDashboard.timeRestore = timeRestore; + savedDashboard.optionsJSON = JSON.stringify(options); + savedDashboard.panelsJSON = JSON.stringify(savedDashboardPanels); + + if (hasTaggingCapabilities(savedDashboard)) { + savedDashboard.setTags(tags); + } + + const { from, to } = timefilter.getTime(); + savedDashboard.timeFrom = savedDashboard.timeRestore ? convertTimeToUTCString(from) : undefined; + savedDashboard.timeTo = savedDashboard.timeRestore ? convertTimeToUTCString(to) : undefined; + + const timeRestoreObj: RefreshInterval = _.pick(timefilter.getRefreshInterval(), [ + 'display', + 'pause', + 'section', + 'value', + ]) as RefreshInterval; + savedDashboard.refreshInterval = savedDashboard.timeRestore ? timeRestoreObj : undefined; + + // only save unpinned filters + const unpinnedFilters = savedDashboard + .getFilters() + .filter((filter) => !esFilters.isFilterPinned(filter)); + savedDashboard.searchSource.setField('filter', unpinnedFilters); + + try { + const newId = await savedDashboard.save(saveOptions); + if (newId) { + toasts.addSuccess({ + title: dashboardSaveToastStrings.getSuccessString(currentState.title), + 'data-test-subj': 'saveDashboardSuccess', + }); + + /** + * If the dashboard id has been changed, redirect to the new ID to keep the url param in sync. + */ + if (newId !== lastDashboardId) { + dashboardSessionStorage.clearState(lastDashboardId); + redirectTo({ + id: newId, + editMode: true, + useReplace: true, + destination: 'dashboard', + }); + return { redirected: true, id: newId }; + } + } + return { id: newId }; + } catch (error) { + toasts.addDanger({ + title: dashboardSaveToastStrings.getFailureString(currentState.title, error.message), + 'data-test-subj': 'saveDashboardFailure', + }); + return { error }; + } +}; diff --git a/src/plugins/dashboard/public/application/lib/session_restoration.test.ts b/src/plugins/dashboard/public/application/lib/session_restoration.test.ts index a6740d8647825c..c8366387471452 100644 --- a/src/plugins/dashboard/public/application/lib/session_restoration.test.ts +++ b/src/plugins/dashboard/public/application/lib/session_restoration.test.ts @@ -6,23 +6,24 @@ * Side Public License, v 1. */ -import { dataPluginMock } from '../../../../data/public/mocks'; -import { createSessionRestorationDataProvider } from './session_restoration'; -import { getAppStateDefaults } from './get_app_state_defaults'; import { getSavedDashboardMock } from '../test_helpers'; -import { SavedObjectTagDecoratorTypeGuard } from '../../../../saved_objects_tagging_oss/public'; -import { ViewMode } from '../../services/embeddable'; +import { dataPluginMock } from '../../../../data/public/mocks'; +import { createSessionRestorationDataProvider, savedObjectToDashboardState } from '.'; describe('createSessionRestorationDataProvider', () => { const mockDataPlugin = dataPluginMock.createStartContract(); + const version = '8.0.0'; const searchSessionInfoProvider = createSessionRestorationDataProvider({ + kibanaVersion: version, data: mockDataPlugin, getAppState: () => - getAppStateDefaults( - ViewMode.VIEW, - getSavedDashboardMock(), - ((() => false) as unknown) as SavedObjectTagDecoratorTypeGuard - ), + savedObjectToDashboardState({ + version, + hideWriteControls: false, + usageCollection: undefined, + savedObjectsTagging: undefined, + savedDashboard: getSavedDashboardMock(), + }), getDashboardTitle: () => 'Dashboard', getDashboardId: () => 'Id', }); diff --git a/src/plugins/dashboard/public/application/lib/session_restoration.ts b/src/plugins/dashboard/public/application/lib/session_restoration.ts deleted file mode 100644 index 231119eef8d2c1..00000000000000 --- a/src/plugins/dashboard/public/application/lib/session_restoration.ts +++ /dev/null @@ -1,63 +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 { DASHBOARD_APP_URL_GENERATOR, DashboardUrlGeneratorState } from '../../url_generator'; -import { DataPublicPluginStart } from '../../services/data'; -import { DashboardAppState } from '../../types'; - -export function createSessionRestorationDataProvider(deps: { - data: DataPublicPluginStart; - getAppState: () => DashboardAppState; - getDashboardTitle: () => string; - getDashboardId: () => string; -}) { - return { - getName: async () => deps.getDashboardTitle(), - getUrlGeneratorData: async () => { - return { - urlGeneratorId: DASHBOARD_APP_URL_GENERATOR, - initialState: getUrlGeneratorState({ ...deps, shouldRestoreSearchSession: false }), - restoreState: getUrlGeneratorState({ ...deps, shouldRestoreSearchSession: true }), - }; - }, - }; -} - -function getUrlGeneratorState({ - data, - getAppState, - getDashboardId, - shouldRestoreSearchSession, -}: { - data: DataPublicPluginStart; - getAppState: () => DashboardAppState; - getDashboardId: () => string; - shouldRestoreSearchSession: boolean; -}): DashboardUrlGeneratorState { - const appState = getAppState(); - return { - dashboardId: getDashboardId(), - timeRange: shouldRestoreSearchSession - ? data.query.timefilter.timefilter.getAbsoluteTime() - : data.query.timefilter.timefilter.getTime(), - filters: data.query.filterManager.getFilters(), - query: data.query.queryString.formatQuery(appState.query), - savedQuery: appState.savedQuery, - useHash: false, - preserveSavedFilters: false, - viewMode: appState.viewMode, - panels: getDashboardId() ? undefined : appState.panels, - searchSessionId: shouldRestoreSearchSession ? data.search.session.getSessionId() : undefined, - refreshInterval: shouldRestoreSearchSession - ? { - pause: true, // force pause refresh interval when restoring a session - value: 0, - } - : undefined, - }; -} diff --git a/src/plugins/dashboard/public/application/lib/sync_dashboard_container_input.ts b/src/plugins/dashboard/public/application/lib/sync_dashboard_container_input.ts new file mode 100644 index 00000000000000..21010158dc46d8 --- /dev/null +++ b/src/plugins/dashboard/public/application/lib/sync_dashboard_container_input.ts @@ -0,0 +1,201 @@ +/* + * 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 _ from 'lodash'; +import { Subscription } from 'rxjs'; +import { debounceTime, tap } from 'rxjs/operators'; + +import { DashboardContainer } from '../embeddable'; +import { esFilters, Filter, Query } from '../../services/data'; +import { DashboardConstants, DashboardSavedObject } from '../..'; +import { setExpandedPanelId, setFullScreenMode, setPanels, setQuery } from '../state'; +import { diffDashboardContainerInput } from './diff_dashboard_state'; +import { replaceUrlHashQuery } from '../../../../kibana_utils/public'; +import { DashboardBuildContext, DashboardContainerInput } from '../../types'; +import { + getSearchSessionIdFromURL, + getSessionURLObservable, + stateToDashboardContainerInput, +} from '.'; + +type SyncDashboardContainerCommon = DashboardBuildContext & { + dashboardContainer: DashboardContainer; + savedDashboard: DashboardSavedObject; +}; + +type ApplyStateChangesToContainerProps = SyncDashboardContainerCommon & { + force: boolean; +}; + +type ApplyContainerChangesToStateProps = SyncDashboardContainerCommon & { + applyFilters: (query: Query, filters: Filter[]) => void; +}; + +type SyncDashboardContainerProps = SyncDashboardContainerCommon & ApplyContainerChangesToStateProps; + +/** + * Sets up two way binding between dashboard container and redux state. + */ +export const syncDashboardContainerInput = ( + syncDashboardContainerProps: SyncDashboardContainerProps +) => { + const { + history, + dashboardContainer, + $onDashboardStateChange, + $triggerDashboardRefresh, + } = syncDashboardContainerProps; + const subscriptions = new Subscription(); + subscriptions.add( + dashboardContainer + .getInput$() + .subscribe(() => applyContainerChangesToState(syncDashboardContainerProps)) + ); + subscriptions.add($onDashboardStateChange.subscribe(() => $triggerDashboardRefresh.next())); + subscriptions.add( + getSessionURLObservable(history).subscribe(() => { + $triggerDashboardRefresh.next({ force: true }); + }) + ); + + let forceRefresh: boolean = false; + subscriptions.add( + $triggerDashboardRefresh + .pipe( + tap((trigger) => { + forceRefresh = forceRefresh || (trigger?.force ?? false); + }), + debounceTime(DashboardConstants.CHANGE_APPLY_DEBOUNCE) + ) + .subscribe(() => { + applyStateChangesToContainer({ ...syncDashboardContainerProps, force: forceRefresh }); + forceRefresh = false; + }) + ); + + return () => subscriptions.unsubscribe(); +}; + +export const applyContainerChangesToState = ({ + query, + applyFilters, + dashboardContainer, + getLatestDashboardState, + dispatchDashboardStateChange, +}: ApplyContainerChangesToStateProps) => { + const input = dashboardContainer.getInput(); + const latestState = getLatestDashboardState(); + if (Object.keys(latestState).length === 0) { + return; + } + const { filterManager } = query; + if ( + !esFilters.compareFilters( + input.filters, + filterManager.getFilters(), + esFilters.COMPARE_ALL_OPTIONS + ) + ) { + // Add filters modifies the object passed to it, hence the clone deep. + filterManager.addFilters(_.cloneDeep(input.filters)); + applyFilters(latestState.query, input.filters); + } + + if (!_.isEqual(input.panels, latestState.panels)) { + dispatchDashboardStateChange(setPanels(input.panels)); + } + + if (!_.isEqual(input.query, latestState.query)) { + dispatchDashboardStateChange(setQuery(input.query)); + } + + if (!_.isEqual(input.expandedPanelId, latestState.expandedPanelId)) { + dispatchDashboardStateChange(setExpandedPanelId(input.expandedPanelId)); + } + dispatchDashboardStateChange(setFullScreenMode(input.isFullScreenMode)); +}; + +export const applyStateChangesToContainer = ({ + force, + search, + history, + savedDashboard, + dashboardContainer, + kbnUrlStateStorage, + query: queryService, + isEmbeddedExternally, + dashboardCapabilities, + getLatestDashboardState, +}: ApplyStateChangesToContainerProps) => { + const latestState = getLatestDashboardState(); + if (Object.keys(latestState).length === 0) { + return; + } + const currentDashboardStateAsInput = stateToDashboardContainerInput({ + dashboardState: latestState, + isEmbeddedExternally, + dashboardCapabilities, + query: queryService, + savedDashboard, + }); + const differences = diffDashboardContainerInput( + dashboardContainer.getInput(), + currentDashboardStateAsInput + ); + if (force) { + differences.lastReloadRequestTime = Date.now(); + } + + if (Object.keys(differences).length !== 0) { + const shouldRefetch = Object.keys(differences).some( + (changeKey) => !noRefetchKeys.includes(changeKey as keyof DashboardContainerInput) + ); + + const newSearchSessionId: string | undefined = (() => { + // do not update session id if this is irrelevant state change to prevent excessive searches + if (!shouldRefetch) return; + + const sessionApi = search.session; + let searchSessionIdFromURL = getSearchSessionIdFromURL(history); + if (searchSessionIdFromURL) { + if (sessionApi.isRestore() && sessionApi.isCurrentSession(searchSessionIdFromURL)) { + // navigating away from a restored session + kbnUrlStateStorage.kbnUrlControls.updateAsync((nextUrl) => { + if (nextUrl.includes(DashboardConstants.SEARCH_SESSION_ID)) { + return replaceUrlHashQuery(nextUrl, (query) => { + delete query[DashboardConstants.SEARCH_SESSION_ID]; + return query; + }); + } + return nextUrl; + }); + searchSessionIdFromURL = undefined; + } else { + sessionApi.restore(searchSessionIdFromURL); + } + } + + return searchSessionIdFromURL ?? sessionApi.start(); + })(); + + dashboardContainer.updateInput({ + ...differences, + ...(newSearchSessionId && { searchSessionId: newSearchSessionId }), + }); + } +}; + +const noRefetchKeys: Readonly> = [ + 'title', + 'viewMode', + 'useMargins', + 'description', + 'expandedPanelId', + 'isFullScreenMode', + 'isEmbeddedExternally', +] as const; diff --git a/src/plugins/dashboard/public/application/lib/sync_dashboard_filter_state.ts b/src/plugins/dashboard/public/application/lib/sync_dashboard_filter_state.ts new file mode 100644 index 00000000000000..2cfd7da6145ee8 --- /dev/null +++ b/src/plugins/dashboard/public/application/lib/sync_dashboard_filter_state.ts @@ -0,0 +1,157 @@ +/* + * 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 _ from 'lodash'; +import { merge } from 'rxjs'; +import { debounceTime, finalize, map, switchMap, tap } from 'rxjs/operators'; + +import { setQuery } from '../state'; +import { DashboardBuildContext, DashboardState } from '../../types'; +import { DashboardSavedObject } from '../../saved_dashboards'; +import { setFiltersAndQuery } from '../state/dashboard_state_slice'; +import { + syncQueryStateWithUrl, + connectToQueryState, + Filter, + Query, + waitUntilNextSessionCompletes$, + QueryState, +} from '../../services/data'; +import { cleanFiltersForSerialize } from '.'; + +type SyncDashboardFilterStateProps = DashboardBuildContext & { + initialDashboardState: DashboardState; + savedDashboard: DashboardSavedObject; +}; + +/** + * Applies initial state to the query service, and the saved dashboard search source, then + * Sets up syncing and subscriptions between the filter state from the Data plugin + * and the dashboard Redux store. + */ +export const syncDashboardFilterState = ({ + search, + savedDashboard, + kbnUrlStateStorage, + query: queryService, + initialDashboardState, + $checkForUnsavedChanges, + $onDashboardStateChange, + $triggerDashboardRefresh, + dispatchDashboardStateChange, +}: SyncDashboardFilterStateProps) => { + const { filterManager, queryString, timefilter } = queryService; + const { timefilter: timefilterService } = timefilter; + + // apply initial filters to the query service and to the saved dashboard + filterManager.setAppFilters(_.cloneDeep(initialDashboardState.filters)); + savedDashboard.searchSource.setField('filter', initialDashboardState.filters); + + // apply initial query to the query service and to the saved dashboard + queryString.setQuery(initialDashboardState.query); + savedDashboard.searchSource.setField('query', initialDashboardState.query); + + /** + * If a global time range is not set explicitly and the time range was saved with the dashboard, apply + * initial time range and refresh interval to the query service. + */ + if (initialDashboardState.timeRestore) { + const initialGlobalQueryState = kbnUrlStateStorage.get('_g'); + if (!initialGlobalQueryState?.time) { + if (savedDashboard.timeFrom && savedDashboard.timeTo) { + timefilterService.setTime({ + from: savedDashboard.timeFrom, + to: savedDashboard.timeTo, + }); + } + } + if (!initialGlobalQueryState?.refreshInterval) { + if (savedDashboard.refreshInterval) { + timefilterService.setRefreshInterval(savedDashboard.refreshInterval); + } + } + } + + // this callback will be used any time new filters and query need to be applied. + const applyFilters = (query: Query, filters: Filter[]) => { + savedDashboard.searchSource.setField('query', query); + savedDashboard.searchSource.setField('filter', filters); + dispatchDashboardStateChange(setQuery(query)); + }; + + // starts syncing `_g` portion of url with query services + const { stop: stopSyncingQueryServiceStateWithUrl } = syncQueryStateWithUrl( + queryService, + kbnUrlStateStorage + ); + + // starts syncing app filters between dashboard state and filterManager + const intermediateFilterState: { filters: Filter[]; query: Query } = { + query: initialDashboardState.query ?? queryString.getDefaultQuery(), + filters: initialDashboardState.filters ?? [], + }; + const stopSyncingAppFilters = connectToQueryState( + queryService, + { + get: () => intermediateFilterState, + set: ({ filters, query }) => { + intermediateFilterState.filters = cleanFiltersForSerialize(filters ?? []) || []; + intermediateFilterState.query = query || queryString.getDefaultQuery(); + dispatchDashboardStateChange(setFiltersAndQuery(intermediateFilterState)); + }, + state$: $onDashboardStateChange.pipe( + map((appState) => ({ + filters: appState.filters, + query: appState.query, + })) + ), + }, + { + query: true, + filters: true, + } + ); + + // apply filters when the filter manager changes + const filterManagerSubscription = merge(filterManager.getUpdates$(), queryString.getUpdates$()) + .pipe(debounceTime(100)) + .subscribe(() => applyFilters(queryString.getQuery(), filterManager.getFilters())); + + const timeRefreshSubscription = merge( + ...[timefilterService.getRefreshIntervalUpdate$(), timefilterService.getTimeUpdate$()] + ).subscribe(() => { + $triggerDashboardRefresh.next(); + + // manually check for unsaved changes here because the time range is not stored on the dashboardState, + // but it could trigger the unsaved changes badge. + $checkForUnsavedChanges.next(); + }); + + const forceRefreshSubscription = timefilterService + .getAutoRefreshFetch$() + .pipe( + tap(() => { + $triggerDashboardRefresh.next({ force: true }); + }), + switchMap((done) => + // best way on a dashboard to estimate that panels are updated is to rely on search session service state + waitUntilNextSessionCompletes$(search.session).pipe(finalize(done)) + ) + ) + .subscribe(); + + const stopSyncingDashboardFilterState = () => { + filterManagerSubscription.unsubscribe(); + forceRefreshSubscription.unsubscribe(); + timeRefreshSubscription.unsubscribe(); + stopSyncingQueryServiceStateWithUrl(); + stopSyncingAppFilters(); + }; + + return { applyFilters, stopSyncingDashboardFilterState }; +}; diff --git a/src/plugins/dashboard/public/application/lib/sync_dashboard_index_patterns.ts b/src/plugins/dashboard/public/application/lib/sync_dashboard_index_patterns.ts new file mode 100644 index 00000000000000..b2873febee0d88 --- /dev/null +++ b/src/plugins/dashboard/public/application/lib/sync_dashboard_index_patterns.ts @@ -0,0 +1,86 @@ +/* + * 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 { uniqBy } from 'lodash'; +import deepEqual from 'fast-deep-equal'; +import { merge, Observable, pipe } from 'rxjs'; +import { distinctUntilChanged, switchMap, startWith, filter, mapTo, map } from 'rxjs/operators'; + +import { DashboardContainer } from '..'; +import { isErrorEmbeddable } from '../../services/embeddable'; +import { IndexPattern, IndexPatternsContract } from '../../services/data'; + +interface SyncDashboardIndexPatternsProps { + dashboardContainer: DashboardContainer; + indexPatterns: IndexPatternsContract; + onUpdateIndexPatterns: (newIndexPatterns: IndexPattern[]) => void; +} + +export const syncDashboardIndexPatterns = ({ + dashboardContainer, + indexPatterns, + onUpdateIndexPatterns, +}: SyncDashboardIndexPatternsProps) => { + const updateIndexPatternsOperator = pipe( + filter((container: DashboardContainer) => !!container && !isErrorEmbeddable(container)), + map((container: DashboardContainer): IndexPattern[] => { + let panelIndexPatterns: IndexPattern[] = []; + Object.values(container.getChildIds()).forEach((id) => { + const embeddableInstance = container.getChild(id); + if (isErrorEmbeddable(embeddableInstance)) return; + const embeddableIndexPatterns = (embeddableInstance.getOutput() as any).indexPatterns; + if (!embeddableIndexPatterns) return; + panelIndexPatterns.push(...embeddableIndexPatterns); + }); + panelIndexPatterns = uniqBy(panelIndexPatterns, 'id'); + return panelIndexPatterns; + }), + distinctUntilChanged((a, b) => + deepEqual( + a.map((ip) => ip && ip.id), + b.map((ip) => ip && ip.id) + ) + ), + // using switchMap for previous task cancellation + switchMap((panelIndexPatterns: IndexPattern[]) => { + return new Observable((observer) => { + if (panelIndexPatterns && panelIndexPatterns.length > 0) { + if (observer.closed) return; + onUpdateIndexPatterns(panelIndexPatterns); + observer.complete(); + } else { + indexPatterns.getDefault().then((defaultIndexPattern) => { + if (observer.closed) return; + onUpdateIndexPatterns([defaultIndexPattern as IndexPattern]); + observer.complete(); + }); + } + }); + }) + ); + + return merge( + // output of dashboard container itself + dashboardContainer.getOutput$(), + // plus output of dashboard container children, + // children may change, so make sure we subscribe/unsubscribe with switchMap + dashboardContainer.getOutput$().pipe( + map(() => dashboardContainer!.getChildIds()), + distinctUntilChanged(deepEqual), + switchMap((newChildIds: string[]) => + merge(...newChildIds.map((childId) => dashboardContainer!.getChild(childId).getOutput$())) + ) + ) + ) + .pipe( + mapTo(dashboardContainer), + startWith(dashboardContainer), // to trigger initial index pattern update + updateIndexPatternsOperator + ) + .subscribe(); +}; diff --git a/src/plugins/dashboard/public/application/lib/update_saved_dashboard.ts b/src/plugins/dashboard/public/application/lib/update_saved_dashboard.ts deleted file mode 100644 index 286414ed30eacf..00000000000000 --- a/src/plugins/dashboard/public/application/lib/update_saved_dashboard.ts +++ /dev/null @@ -1,52 +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 _ from 'lodash'; -import type { SavedObjectTagDecoratorTypeGuard } from '../../services/saved_objects_tagging_oss'; -import { RefreshInterval, TimefilterContract, esFilters } from '../../services/data'; -import { FilterUtils } from './filter_utils'; -import { DashboardSavedObject } from '../../saved_dashboards'; -import { DashboardAppState } from '../../types'; - -export function updateSavedDashboard( - savedDashboard: DashboardSavedObject, - appState: DashboardAppState, - timeFilter: TimefilterContract, - hasTaggingCapabilities: SavedObjectTagDecoratorTypeGuard, - toJson: (object: T) => string -) { - savedDashboard.title = appState.title; - savedDashboard.description = appState.description; - savedDashboard.timeRestore = appState.timeRestore; - savedDashboard.panelsJSON = toJson(appState.panels); - savedDashboard.optionsJSON = toJson(appState.options); - - if (hasTaggingCapabilities(savedDashboard)) { - savedDashboard.setTags(appState.tags); - } - - savedDashboard.timeFrom = savedDashboard.timeRestore - ? FilterUtils.convertTimeToUTCString(timeFilter.getTime().from) - : undefined; - savedDashboard.timeTo = savedDashboard.timeRestore - ? FilterUtils.convertTimeToUTCString(timeFilter.getTime().to) - : undefined; - const timeRestoreObj: RefreshInterval = _.pick(timeFilter.getRefreshInterval(), [ - 'display', - 'pause', - 'section', - 'value', - ]) as RefreshInterval; - savedDashboard.refreshInterval = savedDashboard.timeRestore ? timeRestoreObj : undefined; - - // save only unpinned filters - const unpinnedFilters = savedDashboard - .getFilters() - .filter((filter) => !esFilters.isFilterPinned(filter)); - savedDashboard.searchSource.setField('filter', unpinnedFilters); -} diff --git a/src/plugins/dashboard/public/application/listing/confirm_overlays.tsx b/src/plugins/dashboard/public/application/listing/confirm_overlays.tsx index 726d647abe2128..e3f7b32ef82230 100644 --- a/src/plugins/dashboard/public/application/listing/confirm_overlays.tsx +++ b/src/plugins/dashboard/public/application/listing/confirm_overlays.tsx @@ -19,13 +19,10 @@ import { EUI_MODAL_CANCEL_BUTTON, } from '@elastic/eui'; import React from 'react'; + import { OverlayStart } from '../../../../../core/public'; -import { - createConfirmStrings, - discardConfirmStrings, - leaveEditModeConfirmStrings, -} from '../../dashboard_strings'; import { toMountPoint } from '../../services/kibana_react'; +import { createConfirmStrings, discardConfirmStrings } from '../../dashboard_strings'; export type DiscardOrKeepSelection = 'cancel' | 'discard' | 'keep'; @@ -44,76 +41,6 @@ export const confirmDiscardUnsavedChanges = (overlays: OverlayStart, discardCall } }); -export const confirmDiscardOrKeepUnsavedChanges = ( - overlays: OverlayStart -): Promise => { - const titleId = 'confirmDiscardOrKeepTitle'; - const descriptionId = 'confirmDiscardOrKeepDescription'; - - return new Promise((resolve) => { - const session = overlays.openModal( - toMountPoint( - - session.close()}> -
- - -

{leaveEditModeConfirmStrings.getLeaveEditModeTitle()}

-
-
- - - -

{leaveEditModeConfirmStrings.getLeaveEditModeSubtitle()}

-
-
- - - session.close()} - > - {leaveEditModeConfirmStrings.getLeaveEditModeCancelButtonText()} - - { - session.close(); - resolve('discard'); - }} - > - {leaveEditModeConfirmStrings.getLeaveEditModeDiscardButtonText()} - - { - session.close(); - resolve('keep'); - }} - > - {leaveEditModeConfirmStrings.getLeaveEditModeKeepChangesText()} - - -
-
-
- ), - { - 'data-test-subj': 'dashboardDiscardConfirmModal', - maxWidth: 550, - } - ); - }); -}; - export const confirmCreateWithUnsaved = ( overlays: OverlayStart, startBlankCallback: () => void, diff --git a/src/plugins/dashboard/public/application/listing/dashboard_listing.test.tsx b/src/plugins/dashboard/public/application/listing/dashboard_listing.test.tsx index 022c830b180b67..7602b2ed68b62d 100644 --- a/src/plugins/dashboard/public/application/listing/dashboard_listing.test.tsx +++ b/src/plugins/dashboard/public/application/listing/dashboard_listing.test.tsx @@ -6,80 +6,16 @@ * Side Public License, v 1. */ +import React from 'react'; import { mount } from 'enzyme'; -import { - IUiSettingsClient, - PluginInitializerContext, - ScopedHistory, - SimpleSavedObject, -} from '../../../../../core/public'; +import { I18nProvider } from '@kbn/i18n/react'; -import { SavedObjectLoader, SavedObjectLoaderFindOptions } from '../../services/saved_objects'; -import { IndexPatternsContract, SavedQueryService } from '../../services/data'; -import { NavigationPublicPluginStart } from '../../services/navigation'; +import { DashboardAppServices } from '../../types'; +import { SimpleSavedObject } from '../../../../../core/public'; import { KibanaContextProvider } from '../../services/kibana_react'; import { createKbnUrlStateStorage } from '../../services/kibana_utils'; - -import { savedObjectsPluginMock } from '../../../../saved_objects/public/mocks'; import { DashboardListing, DashboardListingProps } from './dashboard_listing'; -import { embeddablePluginMock } from '../../../../embeddable/public/mocks'; -import { visualizationsPluginMock } from '../../../../visualizations/public/mocks'; -import { DashboardAppServices, DashboardCapabilities } from '../types'; -import { dataPluginMock } from '../../../../data/public/mocks'; -import { chromeServiceMock, coreMock } from '../../../../../core/public/mocks'; -import { I18nProvider } from '@kbn/i18n/react'; -import React from 'react'; -import { UrlForwardingStart } from '../../../../url_forwarding/public'; -import { DashboardPanelStorage } from '../lib'; - -function makeDefaultServices(): DashboardAppServices { - const core = coreMock.createStart(); - const savedDashboards = {} as SavedObjectLoader; - savedDashboards.find = (search: string, sizeOrOptions: number | SavedObjectLoaderFindOptions) => { - const size = typeof sizeOrOptions === 'number' ? sizeOrOptions : sizeOrOptions.size ?? 10; - const hits = []; - for (let i = 0; i < size; i++) { - hits.push({ - id: `dashboard${i}`, - title: `dashboard${i} - ${search} - title`, - description: `dashboard${i} desc`, - }); - } - return Promise.resolve({ - total: size, - hits, - }); - }; - const dashboardPanelStorage = ({ - getDashboardIdsWithUnsavedChanges: jest - .fn() - .mockResolvedValue(['dashboardUnsavedOne', 'dashboardUnsavedTwo']), - } as unknown) as DashboardPanelStorage; - - return { - savedObjects: savedObjectsPluginMock.createStartContract(), - embeddable: embeddablePluginMock.createInstance().doStart(), - dashboardCapabilities: {} as DashboardCapabilities, - initializerContext: {} as PluginInitializerContext, - chrome: chromeServiceMock.createStartContract(), - navigation: {} as NavigationPublicPluginStart, - savedObjectsClient: core.savedObjects.client, - data: dataPluginMock.createStartContract(), - indexPatterns: {} as IndexPatternsContract, - scopedHistory: () => ({} as ScopedHistory), - savedQueryService: {} as SavedQueryService, - setHeaderActionMenu: (mountPoint) => {}, - urlForwarding: {} as UrlForwardingStart, - uiSettings: {} as IUiSettingsClient, - restorePreviousUrl: () => {}, - onAppLeave: (handler) => {}, - allowByValueEmbeddables: true, - dashboardPanelStorage, - savedDashboards, - core, - visualizations: visualizationsPluginMock.createStartContract(), - }; -} +import { makeDefaultServices } from '../test_helpers'; function makeDefaultProps(): DashboardListingProps { return { diff --git a/src/plugins/dashboard/public/application/listing/dashboard_listing.tsx b/src/plugins/dashboard/public/application/listing/dashboard_listing.tsx index e2c11d614d7970..eaa47465660026 100644 --- a/src/plugins/dashboard/public/application/listing/dashboard_listing.tsx +++ b/src/plugins/dashboard/public/application/listing/dashboard_listing.tsx @@ -10,7 +10,7 @@ import { FormattedMessage } from '@kbn/i18n/react'; import { EuiLink, EuiButton, EuiEmptyPrompt } from '@elastic/eui'; import React, { Fragment, useCallback, useEffect, useMemo, useState } from 'react'; import { attemptLoadDashboardByTitle } from '../lib'; -import { DashboardAppServices, DashboardRedirect } from '../types'; +import { DashboardAppServices, DashboardRedirect } from '../../types'; import { getDashboardBreadcrumb, dashboardListingTable } from '../../dashboard_strings'; import { ApplicationStart, SavedObjectsFindOptionsReference } from '../../../../../core/public'; import { syncQueryStateWithUrl } from '../../services/data'; @@ -43,13 +43,13 @@ export const DashboardListing = ({ savedObjectsClient, savedObjectsTagging, dashboardCapabilities, - dashboardPanelStorage, + dashboardSessionStorage, chrome: { setBreadcrumbs }, }, } = useKibana(); const [unsavedDashboardIds, setUnsavedDashboardIds] = useState( - dashboardPanelStorage.getDashboardIdsWithUnsavedChanges() + dashboardSessionStorage.getDashboardIdsWithUnsavedChanges() ); // Set breadcrumbs useEffect @@ -104,19 +104,19 @@ export const DashboardListing = ({ ); const createItem = useCallback(() => { - if (!dashboardPanelStorage.dashboardHasUnsavedEdits()) { + if (!dashboardSessionStorage.dashboardHasUnsavedEdits()) { redirectTo({ destination: 'dashboard' }); } else { confirmCreateWithUnsaved( core.overlays, () => { - dashboardPanelStorage.clearPanels(); + dashboardSessionStorage.clearState(); redirectTo({ destination: 'dashboard' }); }, () => redirectTo({ destination: 'dashboard' }) ); } - }, [dashboardPanelStorage, redirectTo, core.overlays]); + }, [dashboardSessionStorage, redirectTo, core.overlays]); const emptyPrompt = useMemo( () => getNoItemsMessage(hideWriteControls, core.application, createItem), @@ -145,11 +145,11 @@ export const DashboardListing = ({ const deleteItems = useCallback( (dashboards: Array<{ id: string }>) => { - dashboards.map((d) => dashboardPanelStorage.clearPanels(d.id)); - setUnsavedDashboardIds(dashboardPanelStorage.getDashboardIdsWithUnsavedChanges()); + dashboards.map((d) => dashboardSessionStorage.clearState(d.id)); + setUnsavedDashboardIds(dashboardSessionStorage.getDashboardIdsWithUnsavedChanges()); return savedDashboards.delete(dashboards.map((d) => d.id)); }, - [savedDashboards, dashboardPanelStorage] + [savedDashboards, dashboardSessionStorage] ); const editItem = useCallback( @@ -196,7 +196,7 @@ export const DashboardListing = ({ redirectTo={redirectTo} unsavedDashboardIds={unsavedDashboardIds} refreshUnsavedDashboards={() => - setUnsavedDashboardIds(dashboardPanelStorage.getDashboardIdsWithUnsavedChanges()) + setUnsavedDashboardIds(dashboardSessionStorage.getDashboardIdsWithUnsavedChanges()) } /> diff --git a/src/plugins/dashboard/public/application/listing/dashboard_no_match.tsx b/src/plugins/dashboard/public/application/listing/dashboard_no_match.tsx index a649bf37dfae9d..03f7b0e162229c 100644 --- a/src/plugins/dashboard/public/application/listing/dashboard_no_match.tsx +++ b/src/plugins/dashboard/public/application/listing/dashboard_no_match.tsx @@ -6,14 +6,14 @@ * Side Public License, v 1. */ -import React, { useEffect } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import React, { useEffect } from 'react'; import { EuiCallOut } from '@elastic/eui'; - +import { FormattedMessage } from '@kbn/i18n/react'; import { RouteComponentProps } from 'react-router-dom'; + import { useKibana, toMountPoint } from '../../services/kibana_react'; -import { DashboardAppServices } from '../types'; +import { DashboardAppServices } from '../../types'; import { DashboardConstants } from '../..'; let bannerId: string | undefined; diff --git a/src/plugins/dashboard/public/application/listing/dashboard_unsaved_listing.test.tsx b/src/plugins/dashboard/public/application/listing/dashboard_unsaved_listing.test.tsx index 13688b4061be93..8f53c16749fe67 100644 --- a/src/plugins/dashboard/public/application/listing/dashboard_unsaved_listing.test.tsx +++ b/src/plugins/dashboard/public/application/listing/dashboard_unsaved_listing.test.tsx @@ -11,14 +11,14 @@ import { findTestSubject } from '@elastic/eui/lib/test'; import { waitFor } from '@testing-library/react'; import { mount } from 'enzyme'; import React from 'react'; + import { DashboardSavedObject } from '../..'; -import { coreMock } from '../../../../../core/public/mocks'; -import { KibanaContextProvider } from '../../services/kibana_react'; +import { DashboardAppServices } from '../../types'; import { SavedObjectLoader } from '../../services/saved_objects'; -import { DashboardPanelStorage } from '../lib'; -import { DASHBOARD_PANELS_UNSAVED_ID } from '../lib/dashboard_panel_storage'; -import { DashboardAppServices } from '../types'; +import { KibanaContextProvider } from '../../services/kibana_react'; +import { DASHBOARD_PANELS_UNSAVED_ID } from '../lib/dashboard_session_storage'; import { DashboardUnsavedListing, DashboardUnsavedListingProps } from './dashboard_unsaved_listing'; +import { makeDefaultServices } from '../test_helpers'; const mockedDashboards: { [key: string]: DashboardSavedObject } = { dashboardUnsavedOne: { @@ -35,20 +35,16 @@ const mockedDashboards: { [key: string]: DashboardSavedObject } = { } as DashboardSavedObject, }; -function makeDefaultServices(): DashboardAppServices { - const core = coreMock.createStart(); - core.overlays.openConfirm = jest.fn().mockResolvedValue(true); +function makeServices(): DashboardAppServices { + const services = makeDefaultServices(); const savedDashboards = {} as SavedObjectLoader; savedDashboards.get = jest .fn() .mockImplementation((id: string) => Promise.resolve(mockedDashboards[id])); - const dashboardPanelStorage = {} as DashboardPanelStorage; - dashboardPanelStorage.clearPanels = jest.fn(); - return ({ - dashboardPanelStorage, + return { + ...services, savedDashboards, - core, - } as unknown) as DashboardAppServices; + }; } const makeDefaultProps = (): DashboardUnsavedListingProps => ({ @@ -64,7 +60,7 @@ function mountWith({ services?: DashboardAppServices; props?: DashboardUnsavedListingProps; }) { - const services = incomingServices ?? makeDefaultServices(); + const services = incomingServices ?? makeServices(); const props = incomingProps ?? makeDefaultProps(); const wrappingComponent: React.FC<{ children: React.ReactNode; @@ -140,14 +136,14 @@ describe('Unsaved listing', () => { waitFor(() => { component.update(); expect(services.core.overlays.openConfirm).toHaveBeenCalled(); - expect(services.dashboardPanelStorage.clearPanels).toHaveBeenCalledWith( + expect(services.dashboardSessionStorage.clearState).toHaveBeenCalledWith( 'dashboardUnsavedOne' ); }); }); it('removes unsaved changes from any dashboard which errors on fetch', async () => { - const services = makeDefaultServices(); + const services = makeServices(); const props = makeDefaultProps(); services.savedDashboards.get = jest.fn().mockImplementation((id: string) => { if (id === 'failCase1' || id === 'failCase2') { @@ -166,12 +162,12 @@ describe('Unsaved listing', () => { const { component } = mountWith({ services, props }); waitFor(() => { component.update(); - expect(services.dashboardPanelStorage.clearPanels).toHaveBeenCalledWith('failCase1'); - expect(services.dashboardPanelStorage.clearPanels).toHaveBeenCalledWith('failCase2'); + expect(services.dashboardSessionStorage.clearState).toHaveBeenCalledWith('failCase1'); + expect(services.dashboardSessionStorage.clearState).toHaveBeenCalledWith('failCase2'); // clearing panels from dashboard with errors should cause getDashboardIdsWithUnsavedChanges to be called again. expect( - services.dashboardPanelStorage.getDashboardIdsWithUnsavedChanges + services.dashboardSessionStorage.getDashboardIdsWithUnsavedChanges ).toHaveBeenCalledTimes(2); }); }); diff --git a/src/plugins/dashboard/public/application/listing/dashboard_unsaved_listing.tsx b/src/plugins/dashboard/public/application/listing/dashboard_unsaved_listing.tsx index 66e8b2348490a1..acff60d9bac3d8 100644 --- a/src/plugins/dashboard/public/application/listing/dashboard_unsaved_listing.tsx +++ b/src/plugins/dashboard/public/application/listing/dashboard_unsaved_listing.tsx @@ -19,8 +19,8 @@ import React, { useCallback, useEffect, useState } from 'react'; import { DashboardSavedObject } from '../..'; import { dashboardUnsavedListingStrings, getNewDashboardTitle } from '../../dashboard_strings'; import { useKibana } from '../../services/kibana_react'; -import { DASHBOARD_PANELS_UNSAVED_ID } from '../lib/dashboard_panel_storage'; -import { DashboardAppServices, DashboardRedirect } from '../types'; +import { DASHBOARD_PANELS_UNSAVED_ID } from '../lib/dashboard_session_storage'; +import { DashboardAppServices, DashboardRedirect } from '../../types'; import { confirmDiscardUnsavedChanges } from './confirm_overlays'; const DashboardUnsavedItem = ({ @@ -115,7 +115,7 @@ export const DashboardUnsavedListing = ({ }: DashboardUnsavedListingProps) => { const { services: { - dashboardPanelStorage, + dashboardSessionStorage, savedDashboards, core: { overlays }, }, @@ -133,11 +133,11 @@ export const DashboardUnsavedListing = ({ const onDiscard = useCallback( (id?: string) => { confirmDiscardUnsavedChanges(overlays, () => { - dashboardPanelStorage.clearPanels(id); + dashboardSessionStorage.clearState(id); refreshUnsavedDashboards(); }); }, - [overlays, refreshUnsavedDashboards, dashboardPanelStorage] + [overlays, refreshUnsavedDashboards, dashboardSessionStorage] ); useEffect(() => { @@ -161,7 +161,7 @@ export const DashboardUnsavedListing = ({ const newItems = dashboards.reduce((map, dashboard) => { if (typeof dashboard === 'string') { hasError = true; - dashboardPanelStorage.clearPanels(dashboard); + dashboardSessionStorage.clearState(dashboard); return map; } return { @@ -178,7 +178,7 @@ export const DashboardUnsavedListing = ({ return () => { canceled = true; }; - }, [savedDashboards, dashboardPanelStorage, refreshUnsavedDashboards, unsavedDashboardIds]); + }, [savedDashboards, dashboardSessionStorage, refreshUnsavedDashboards, unsavedDashboardIds]); return unsavedDashboardIds.length === 0 ? null : ( <> diff --git a/src/plugins/dashboard/public/application/state/dashboard_state_hooks.ts b/src/plugins/dashboard/public/application/state/dashboard_state_hooks.ts new file mode 100644 index 00000000000000..abc346d4bbaa34 --- /dev/null +++ b/src/plugins/dashboard/public/application/state/dashboard_state_hooks.ts @@ -0,0 +1,12 @@ +/* + * 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 { TypedUseSelectorHook, useDispatch, useSelector } from 'react-redux'; +import type { DashboardRootState, DashboardDispatch } from './dashboard_state_store'; + +export const useDashboardDispatch = () => useDispatch(); +export const useDashboardSelector: TypedUseSelectorHook = useSelector; diff --git a/src/plugins/dashboard/public/application/state/dashboard_state_slice.ts b/src/plugins/dashboard/public/application/state/dashboard_state_slice.ts new file mode 100644 index 00000000000000..1acf806ae2f0d7 --- /dev/null +++ b/src/plugins/dashboard/public/application/state/dashboard_state_slice.ts @@ -0,0 +1,112 @@ +/* + * 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 { createSlice, PayloadAction } from '@reduxjs/toolkit'; + +import { Filter, Query } from '../../services/data'; +import { ViewMode } from '../../services/embeddable'; +import { DashboardOptions, DashboardPanelMap, DashboardState } from '../../types'; + +export const dashboardStateSlice = createSlice({ + name: 'dashboardState', + initialState: {} as DashboardState, + reducers: { + setDashboardState: (state, action: PayloadAction) => { + return action.payload; + }, + updateState: (state, action: PayloadAction>) => { + state = { ...state, ...action.payload }; + }, + setDashboardOptions: (state, action: PayloadAction) => { + state.options = action.payload; + }, + setStateFromSaveModal: ( + state, + action: PayloadAction<{ + title: string; + description: string; + tags?: string[]; + timeRestore: boolean; + }> + ) => { + state.title = action.payload.title; + state.description = action.payload.description; + state.timeRestore = action.payload.timeRestore; + if (action.payload.tags) { + state.tags = action.payload.tags; + } + }, + setUseMargins: (state, action: PayloadAction) => { + state.options.useMargins = action.payload; + }, + setSyncColors: (state, action: PayloadAction) => { + state.options.syncColors = action.payload; + }, + setHidePanelTitles: (state, action: PayloadAction) => { + state.options.hidePanelTitles = action.payload; + }, + setPanels: (state, action: PayloadAction) => { + state.panels = action.payload; + }, + setExpandedPanelId: (state, action: PayloadAction) => { + state.expandedPanelId = action.payload; + }, + setFullScreenMode: (state, action: PayloadAction) => { + state.fullScreenMode = action.payload; + }, + setSavedQueryId: (state, action: PayloadAction) => { + state.savedQuery = action.payload; + }, + setTimeRestore: (state, action: PayloadAction) => { + state.timeRestore = action.payload; + }, + setDescription: (state, action: PayloadAction) => { + state.description = action.payload; + }, + setViewMode: (state, action: PayloadAction) => { + state.viewMode = action.payload; + }, + setFiltersAndQuery: (state, action: PayloadAction<{ filters: Filter[]; query: Query }>) => { + state.filters = action.payload.filters; + state.query = action.payload.query; + }, + setFilters: (state, action: PayloadAction) => { + state.filters = action.payload; + }, + setTags: (state, action: PayloadAction) => { + state.tags = action.payload; + }, + setTitle: (state, action: PayloadAction) => { + state.description = action.payload; + }, + setQuery: (state, action: PayloadAction) => { + state.query = action.payload; + }, + }, +}); + +export const { + setStateFromSaveModal, + setDashboardOptions, + setExpandedPanelId, + setHidePanelTitles, + setFiltersAndQuery, + setDashboardState, + setFullScreenMode, + setSavedQueryId, + setDescription, + setTimeRestore, + setSyncColors, + setUseMargins, + setViewMode, + setFilters, + setPanels, + setTitle, + setQuery, + setTags, +} = dashboardStateSlice.actions; diff --git a/src/plugins/dashboard/public/application/state/dashboard_state_store.ts b/src/plugins/dashboard/public/application/state/dashboard_state_store.ts new file mode 100644 index 00000000000000..76bc2c2fb1c773 --- /dev/null +++ b/src/plugins/dashboard/public/application/state/dashboard_state_store.ts @@ -0,0 +1,17 @@ +/* + * 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 { configureStore } from '@reduxjs/toolkit'; +import { dashboardStateSlice } from './dashboard_state_slice'; + +export const dashboardStateStore = configureStore({ + reducer: { dashboardStateReducer: dashboardStateSlice.reducer }, +}); + +export type DashboardRootState = ReturnType; +export type DashboardDispatch = typeof dashboardStateStore.dispatch; diff --git a/src/plugins/dashboard/public/application/state/index.ts b/src/plugins/dashboard/public/application/state/index.ts new file mode 100644 index 00000000000000..d394876173160d --- /dev/null +++ b/src/plugins/dashboard/public/application/state/index.ts @@ -0,0 +1,12 @@ +/* + * 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 * from './dashboard_state_slice'; + +export { dashboardStateStore } from './dashboard_state_store'; +export { useDashboardDispatch, useDashboardSelector } from './dashboard_state_hooks'; diff --git a/src/plugins/dashboard/public/application/test_helpers/get_sample_dashboard_input.ts b/src/plugins/dashboard/public/application/test_helpers/get_sample_dashboard_input.ts index fb160568fa4f4d..46be5b3b16d849 100644 --- a/src/plugins/dashboard/public/application/test_helpers/get_sample_dashboard_input.ts +++ b/src/plugins/dashboard/public/application/test_helpers/get_sample_dashboard_input.ts @@ -6,8 +6,9 @@ * Side Public License, v 1. */ +import { DashboardContainerInput } from '../..'; +import { DashboardPanelState } from '../embeddable'; import { ViewMode, EmbeddableInput } from '../../services/embeddable'; -import { DashboardContainerInput, DashboardPanelState } from '../embeddable'; export function getSampleDashboardInput( overrides?: Partial diff --git a/src/plugins/dashboard/public/application/test_helpers/index.ts b/src/plugins/dashboard/public/application/test_helpers/index.ts index d782fb67d039b6..d26eadec8f1c9c 100644 --- a/src/plugins/dashboard/public/application/test_helpers/index.ts +++ b/src/plugins/dashboard/public/application/test_helpers/index.ts @@ -8,3 +8,4 @@ export { getSampleDashboardInput, getSampleDashboardPanel } from './get_sample_dashboard_input'; export { getSavedDashboardMock } from './get_saved_dashboard_mock'; +export { makeDefaultServices } from './make_default_services'; diff --git a/src/plugins/dashboard/public/application/test_helpers/make_default_services.ts b/src/plugins/dashboard/public/application/test_helpers/make_default_services.ts new file mode 100644 index 00000000000000..41da74dbba778a --- /dev/null +++ b/src/plugins/dashboard/public/application/test_helpers/make_default_services.ts @@ -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 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 { DashboardSessionStorage } from '../lib'; +import { dataPluginMock } from '../../../../data/public/mocks'; +import { getSavedDashboardMock } from './get_saved_dashboard_mock'; +import { UrlForwardingStart } from '../../../../url_forwarding/public'; +import { NavigationPublicPluginStart } from '../../services/navigation'; +import { DashboardAppServices, DashboardAppCapabilities } from '../../types'; +import { embeddablePluginMock } from '../../../../embeddable/public/mocks'; +import { IndexPatternsContract, SavedQueryService } from '../../services/data'; +import { savedObjectsPluginMock } from '../../../../saved_objects/public/mocks'; +import { visualizationsPluginMock } from '../../../../visualizations/public/mocks'; +import { PluginInitializerContext, ScopedHistory } from '../../../../../core/public'; +import { SavedObjectLoader, SavedObjectLoaderFindOptions } from '../../services/saved_objects'; +import { + chromeServiceMock, + coreMock, + uiSettingsServiceMock, +} from '../../../../../core/public/mocks'; + +export function makeDefaultServices(): DashboardAppServices { + const core = coreMock.createStart(); + core.overlays.openConfirm = jest.fn().mockResolvedValue(true); + + const savedDashboards = {} as SavedObjectLoader; + savedDashboards.find = (search: string, sizeOrOptions: number | SavedObjectLoaderFindOptions) => { + const size = typeof sizeOrOptions === 'number' ? sizeOrOptions : sizeOrOptions.size ?? 10; + const hits = []; + for (let i = 0; i < size; i++) { + hits.push({ + id: `dashboard${i}`, + title: `dashboard${i} - ${search} - title`, + description: `dashboard${i} desc`, + }); + } + return Promise.resolve({ + total: size, + hits, + }); + }; + savedDashboards.get = jest + .fn() + .mockImplementation((id?: string) => Promise.resolve(getSavedDashboardMock({ id }))); + + const dashboardSessionStorage = ({ + getDashboardIdsWithUnsavedChanges: jest + .fn() + .mockResolvedValue(['dashboardUnsavedOne', 'dashboardUnsavedTwo']), + getState: jest.fn().mockReturnValue(undefined), + setState: jest.fn(), + } as unknown) as DashboardSessionStorage; + dashboardSessionStorage.clearState = jest.fn(); + + const defaultCapabilities: DashboardAppCapabilities = { + show: true, + createNew: true, + saveQuery: true, + createShortUrl: true, + hideWriteControls: false, + storeSearchSession: true, + mapsCapabilities: { save: true }, + visualizeCapabilities: { save: true }, + }; + const initializerContext = { + env: { packageInfo: { version: '8.0.0' } }, + } as PluginInitializerContext; + + return { + visualizations: visualizationsPluginMock.createStartContract(), + savedObjects: savedObjectsPluginMock.createStartContract(), + embeddable: embeddablePluginMock.createInstance().doStart(), + uiSettings: uiSettingsServiceMock.createStartContract(), + chrome: chromeServiceMock.createStartContract(), + navigation: {} as NavigationPublicPluginStart, + savedObjectsClient: core.savedObjects.client, + dashboardCapabilities: defaultCapabilities, + data: dataPluginMock.createStartContract(), + indexPatterns: {} as IndexPatternsContract, + savedQueryService: {} as SavedQueryService, + scopedHistory: () => ({} as ScopedHistory), + setHeaderActionMenu: (mountPoint) => {}, + urlForwarding: {} as UrlForwardingStart, + allowByValueEmbeddables: true, + restorePreviousUrl: () => {}, + onAppLeave: (handler) => {}, + dashboardSessionStorage, + initializerContext, + savedDashboards, + core, + }; +} diff --git a/src/plugins/dashboard/public/application/top_nav/dashboard_top_nav.tsx b/src/plugins/dashboard/public/application/top_nav/dashboard_top_nav.tsx index e1a62fe980f552..1cfa39d5e0e79b 100644 --- a/src/plugins/dashboard/public/application/top_nav/dashboard_top_nav.tsx +++ b/src/plugins/dashboard/public/application/top_nav/dashboard_top_nav.tsx @@ -7,92 +7,94 @@ */ import { METRIC_TYPE } from '@kbn/analytics'; +import { Required } from '@kbn/utility-types'; import { EuiHorizontalRule } from '@elastic/eui'; -import { i18n } from '@kbn/i18n'; -import angular from 'angular'; +import UseUnmount from 'react-use/lib/useUnmount'; import React, { useCallback, useEffect, useMemo, useState } from 'react'; -import UseUnmount from 'react-use/lib/useUnmount'; +import { saveDashboard } from '../lib'; +import { TopNavIds } from './top_nav_ids'; +import { EditorMenu } from './editor_menu'; import { UI_SETTINGS } from '../../../common'; +import { SavedQuery } from '../../services/data'; +import { DashboardSaveModal } from './save_modal'; +import { showCloneModal } from './show_clone_modal'; +import { ShowShareModal } from './show_share_modal'; +import { getTopNavConfig } from './get_top_nav_config'; +import { OverlayRef } from '../../../../../core/public'; +import { useKibana } from '../../services/kibana_react'; +import { showOptionsPopover } from './show_options_popover'; +import { DashboardConstants } from '../../dashboard_constants'; +import { TopNavMenuProps } from '../../../../navigation/public'; +import { confirmDiscardUnsavedChanges } from '../listing/confirm_overlays'; import { BaseVisType, VisTypeAlias } from '../../../../visualizations/public'; +import { DashboardAppState, DashboardSaveOptions, NavAction } from '../../types'; +import { isErrorEmbeddable, openAddPanelFlyout, ViewMode } from '../../services/embeddable'; +import { DashboardAppServices, DashboardEmbedSettings, DashboardRedirect } from '../../types'; +import { getSavedObjectFinder, SaveResult, showSaveModal } from '../../services/saved_objects'; +import { getCreateVisualizationButtonTitle, unsavedChangesBadge } from '../../dashboard_strings'; +import { + setFullScreenMode, + setHidePanelTitles, + setSavedQueryId, + setStateFromSaveModal, + setSyncColors, + setUseMargins, + setViewMode, + useDashboardDispatch, + useDashboardSelector, +} from '../state'; + import { AddFromLibraryButton, + LazyLabsFlyout, PrimaryActionButton, QuickButtonGroup, - SolutionToolbar, QuickButtonProps, + SolutionToolbar, + withSuspense, } from '../../../../presentation_util/public'; -import { useKibana } from '../../services/kibana_react'; -import { IndexPattern, SavedQuery, TimefilterContract } from '../../services/data'; -import { isErrorEmbeddable, openAddPanelFlyout, ViewMode } from '../../services/embeddable'; -import { - getSavedObjectFinder, - SavedObjectSaveOpts, - SaveResult, - showSaveModal, -} from '../../services/saved_objects'; -import { LazyLabsFlyout, withSuspense } from '../../../../presentation_util/public'; - -import { NavAction } from '../../types'; -import { DashboardSavedObject } from '../..'; -import { DashboardStateManager } from '../dashboard_state_manager'; -import { saveDashboard } from '../lib'; -import { - DashboardAppServices, - DashboardEmbedSettings, - DashboardRedirect, - DashboardSaveOptions, -} from '../types'; -import { getTopNavConfig } from './get_top_nav_config'; -import { DashboardSaveModal } from './save_modal'; -import { showCloneModal } from './show_clone_modal'; -import { showOptionsPopover } from './show_options_popover'; -import { TopNavIds } from './top_nav_ids'; -import { ShowShareModal } from './show_share_modal'; -import { confirmDiscardOrKeepUnsavedChanges } from '../listing/confirm_overlays'; -import { OverlayRef } from '../../../../../core/public'; -import { DashboardConstants } from '../../dashboard_constants'; -import { getNewDashboardTitle, unsavedChangesBadge } from '../../dashboard_strings'; -import { DASHBOARD_PANELS_UNSAVED_ID } from '../lib/dashboard_panel_storage'; -import { DashboardContainer } from '..'; -import { EditorMenu } from './editor_menu'; export interface DashboardTopNavState { chromeIsVisible: boolean; addPanelOverlay?: OverlayRef; savedQuery?: SavedQuery; + isSaveInProgress?: boolean; } +type CompleteDashboardAppState = Required< + DashboardAppState, + | 'getLatestDashboardState' + | 'dashboardContainer' + | 'savedDashboard' + | 'indexPatterns' + | 'applyFilters' +>; + +export const isCompleteDashboardAppState = ( + state: DashboardAppState +): state is CompleteDashboardAppState => { + return ( + Boolean(state.getLatestDashboardState) && + Boolean(state.dashboardContainer) && + Boolean(state.savedDashboard) && + Boolean(state.indexPatterns) && + Boolean(state.applyFilters) + ); +}; + export interface DashboardTopNavProps { - onQuerySubmit: (_payload: unknown, isUpdate: boolean | undefined) => void; - dashboardStateManager: DashboardStateManager; - dashboardContainer: DashboardContainer; + dashboardAppState: CompleteDashboardAppState; embedSettings?: DashboardEmbedSettings; - savedDashboard: DashboardSavedObject; - timefilter: TimefilterContract; - indexPatterns: IndexPattern[]; redirectTo: DashboardRedirect; - unsavedChanges: boolean; - clearUnsavedChanges: () => void; - lastDashboardId?: string; - viewMode: ViewMode; } -const Flyout = withSuspense(LazyLabsFlyout, null); +const LabsFlyout = withSuspense(LazyLabsFlyout, null); export function DashboardTopNav({ - dashboardStateManager, - clearUnsavedChanges, - dashboardContainer, - lastDashboardId, - unsavedChanges, - savedDashboard, - onQuerySubmit, + dashboardAppState, embedSettings, - indexPatterns, redirectTo, - timefilter, - viewMode, }: DashboardTopNavProps) { const { core, @@ -102,17 +104,24 @@ export function DashboardTopNav({ embeddable, navigation, uiSettings, - setHeaderActionMenu, + visualizations, + usageCollection, + initializerContext, savedObjectsTagging, + setHeaderActionMenu, dashboardCapabilities, - dashboardPanelStorage, + dashboardSessionStorage, allowByValueEmbeddables, - visualizations, - usageCollection, } = useKibana().services; + const { version: kibanaVersion } = initializerContext.env.packageInfo; + const timefilter = data.query.timefilter.timefilter; + const toasts = core.notifications.toasts; + + const dispatchDashboardStateChange = useDashboardDispatch(); + const dashboardState = useDashboardSelector((state) => state.dashboardStateReducer); + const [mounted, setMounted] = useState(true); const [state, setState] = useState({ chromeIsVisible: false }); - const [isSaveInProgress, setIsSaveInProgress] = useState(false); const [isLabsShown, setIsLabsShown] = useState(false); const lensAlias = visualizations.getAliases().find(({ name }) => name === 'lens'); @@ -130,25 +139,25 @@ export function DashboardTopNav({ const visibleSubscription = chrome.getIsVisible$().subscribe((chromeIsVisible) => { setState((s) => ({ ...s, chromeIsVisible })); }); - const { id, title, getFullEditPath } = savedDashboard; - if (id || allowByValueEmbeddables) { + const { id, title, getFullEditPath } = dashboardAppState.savedDashboard; + if (id && title) { chrome.recentlyAccessed.add( - getFullEditPath(dashboardStateManager.getIsEditMode()), - title || getNewDashboardTitle(), - id || DASHBOARD_PANELS_UNSAVED_ID + getFullEditPath(dashboardState.viewMode === ViewMode.EDIT), + title, + id ); } return () => { visibleSubscription.unsubscribe(); }; - }, [chrome, allowByValueEmbeddables, dashboardStateManager, savedDashboard]); + }, [chrome, allowByValueEmbeddables, dashboardState.viewMode, dashboardAppState.savedDashboard]); const addFromLibrary = useCallback(() => { - if (!isErrorEmbeddable(dashboardContainer)) { + if (!isErrorEmbeddable(dashboardAppState.dashboardContainer)) { setState((s) => ({ ...s, addPanelOverlay: openAddPanelFlyout({ - embeddable: dashboardContainer, + embeddable: dashboardAppState.dashboardContainer, getAllFactories: embeddable.getEmbeddableFactories, getFactory: embeddable.getEmbeddableFactory, notifications: core.notifications, @@ -158,9 +167,9 @@ export function DashboardTopNav({ })); } }, [ + dashboardAppState.dashboardContainer, embeddable.getEmbeddableFactories, embeddable.getEmbeddableFactory, - dashboardContainer, core.notifications, core.savedObjects, core.overlays, @@ -209,291 +218,220 @@ export function DashboardTopNav({ const onChangeViewMode = useCallback( (newMode: ViewMode) => { clearAddPanel(); - const isPageRefresh = newMode === dashboardStateManager.getViewMode(); - const isLeavingEditMode = !isPageRefresh && newMode === ViewMode.VIEW; - const willLoseChanges = isLeavingEditMode && dashboardStateManager.getIsDirty(timefilter); - - function switchViewMode() { - dashboardStateManager.switchViewMode(newMode); - - if (savedDashboard?.id && allowByValueEmbeddables) { - const { getFullEditPath, title, id } = savedDashboard; - chrome.recentlyAccessed.add(getFullEditPath(newMode === ViewMode.EDIT), title, id); - } - } + const willLoseChanges = newMode === ViewMode.VIEW && dashboardAppState.hasUnsavedChanges; if (!willLoseChanges) { - switchViewMode(); + dispatchDashboardStateChange(setViewMode(newMode)); return; } - function discardChanges() { - dashboardStateManager.resetState(); - dashboardStateManager.clearUnsavedPanels(); - - // We need to do a hard reset of the timepicker. appState will not reload like - // it does on 'open' because it's been saved to the url and the getAppState.previouslyStored() check on - // reload will cause it not to sync. - if (dashboardStateManager.getIsTimeSavedWithDashboard()) { - dashboardStateManager.syncTimefilterWithDashboardTime(timefilter); - dashboardStateManager.syncTimefilterWithDashboardRefreshInterval(timefilter); - } - dashboardStateManager.switchViewMode(ViewMode.VIEW); - } - confirmDiscardOrKeepUnsavedChanges(core.overlays).then((selection) => { - if (selection === 'discard') { - discardChanges(); - } - if (selection !== 'cancel') { - switchViewMode(); - } - }); - }, - [ - timefilter, - core.overlays, - clearAddPanel, - savedDashboard, - dashboardStateManager, - allowByValueEmbeddables, - chrome.recentlyAccessed, - ] - ); - - /** - * Saves the dashboard. - * - * @param {object} [saveOptions={}] - * @property {boolean} [saveOptions.confirmOverwrite=false] - If true, attempts to create the source so it - * can confirm an overwrite if a document with the id already exists. - * @property {boolean} [saveOptions.isTitleDuplicateConfirmed=false] - If true, save allowed with duplicate title - * @property {func} [saveOptions.onTitleDuplicate] - function called if duplicate title exists. - * When not provided, confirm modal will be displayed asking user to confirm or cancel save. - * @return {Promise} - * @resolved {String} - The id of the doc - */ - const save = useCallback( - async (saveOptions: SavedObjectSaveOpts) => { - setIsSaveInProgress(true); - return saveDashboard(angular.toJson, timefilter, dashboardStateManager, saveOptions) - .then(function (id) { - if (id) { - core.notifications.toasts.addSuccess({ - title: i18n.translate('dashboard.dashboardWasSavedSuccessMessage', { - defaultMessage: `Dashboard '{dashTitle}' was saved`, - values: { dashTitle: dashboardStateManager.savedDashboard.title }, - }), - 'data-test-subj': 'saveDashboardSuccess', - }); - - dashboardPanelStorage.clearPanels(lastDashboardId); - if (id !== lastDashboardId) { - redirectTo({ - id, - // editMode: true, - destination: 'dashboard', - useReplace: true, - }); - } else { - dashboardStateManager.resetState(); - chrome.docTitle.change(dashboardStateManager.savedDashboard.lastSavedTitle); - } - } - setIsSaveInProgress(false); - return { id }; - }) - .catch((error) => { - core.notifications?.toasts.addDanger({ - title: i18n.translate('dashboard.dashboardWasNotSavedDangerMessage', { - defaultMessage: `Dashboard '{dashTitle}' was not saved. Error: {errorMessage}`, - values: { - dashTitle: dashboardStateManager.savedDashboard.title, - errorMessage: error.message, - }, - }), - 'data-test-subj': 'saveDashboardFailure', - }); - return { error }; - }); + confirmDiscardUnsavedChanges(core.overlays, () => + dashboardAppState.resetToLastSavedState?.() + ); }, - [ - core.notifications.toasts, - dashboardStateManager, - dashboardPanelStorage, - lastDashboardId, - chrome.docTitle, - redirectTo, - timefilter, - ] + [clearAddPanel, core.overlays, dashboardAppState, dispatchDashboardStateChange] ); - const runSave = useCallback(async () => { - const currentTitle = dashboardStateManager.getTitle(); - const currentDescription = dashboardStateManager.getDescription(); - const currentTimeRestore = dashboardStateManager.getTimeRestore(); - - let currentTags: string[] = []; - if (savedObjectsTagging) { - const dashboard = dashboardStateManager.savedDashboard; - if (savedObjectsTagging.ui.hasTagDecoration(dashboard)) { - currentTags = dashboard.getTags(); - } - } - - const onSave = ({ + const runSaveAs = useCallback(async () => { + const currentState = dashboardAppState.getLatestDashboardState(); + const onSave = async ({ + newTags, newTitle, newDescription, newCopyOnSave, newTimeRestore, onTitleDuplicate, isTitleDuplicateConfirmed, - newTags, }: DashboardSaveOptions): Promise => { - dashboardStateManager.setTitle(newTitle); - dashboardStateManager.setDescription(newDescription); - dashboardStateManager.savedDashboard.copyOnSave = newCopyOnSave; - dashboardStateManager.setTimeRestore(newTimeRestore); - if (savedObjectsTagging && newTags) { - dashboardStateManager.setTags(newTags); - } - const saveOptions = { confirmOverwrite: false, isTitleDuplicateConfirmed, onTitleDuplicate, }; + const stateFromSaveModal = { + title: newTitle, + description: newDescription, + timeRestore: newTimeRestore, + tags: [] as string[], + }; + if (savedObjectsTagging && newTags) { + stateFromSaveModal.tags = newTags; + } - return save(saveOptions).then((response: SaveResult) => { - // If the save wasn't successful, put the original values back. - if (!(response as { id: string }).id) { - dashboardStateManager.setTitle(currentTitle); - dashboardStateManager.setDescription(currentDescription); - dashboardStateManager.setTimeRestore(currentTimeRestore); - if (savedObjectsTagging) { - dashboardStateManager.setTags(currentTags); - } - } - return response; + dashboardAppState.savedDashboard.copyOnSave = newCopyOnSave; + const saveResult = await saveDashboard({ + toasts, + timefilter, + redirectTo, + saveOptions, + savedObjectsTagging, + version: kibanaVersion, + dashboardSessionStorage, + savedDashboard: dashboardAppState.savedDashboard, + currentState: { ...currentState, ...stateFromSaveModal }, }); + if (saveResult.id && !saveResult.redirected) { + dispatchDashboardStateChange(setStateFromSaveModal(stateFromSaveModal)); + dashboardAppState.updateLastSavedState?.(); + chrome.docTitle.change(stateFromSaveModal.title); + } + return saveResult.id ? { id: saveResult.id } : { error: saveResult.error }; }; + const lastDashboardId = dashboardAppState.savedDashboard.id; + const currentTags = savedObjectsTagging?.ui.hasTagDecoration(dashboardAppState.savedDashboard) + ? dashboardAppState.savedDashboard.getTags() + : []; const dashboardSaveModal = ( {}} - title={currentTitle} - description={currentDescription} tags={currentTags} + title={currentState.title} + timeRestore={currentState.timeRestore} + description={currentState.description} savedObjectsTagging={savedObjectsTagging} - timeRestore={currentTimeRestore} showCopyOnSave={lastDashboardId ? true : false} /> ); clearAddPanel(); showSaveModal(dashboardSaveModal, core.i18n.Context); }, [ - save, - clearAddPanel, - lastDashboardId, - core.i18n.Context, + dispatchDashboardStateChange, + dashboardSessionStorage, savedObjectsTagging, - dashboardStateManager, + dashboardAppState, + core.i18n.Context, + chrome.docTitle, + clearAddPanel, + kibanaVersion, + timefilter, + redirectTo, + toasts, ]); const runQuickSave = useCallback(async () => { - const currentTitle = dashboardStateManager.getTitle(); - const currentDescription = dashboardStateManager.getDescription(); - const currentTimeRestore = dashboardStateManager.getTimeRestore(); - - let currentTags: string[] = []; - if (savedObjectsTagging) { - const dashboard = dashboardStateManager.savedDashboard; - if (savedObjectsTagging.ui.hasTagDecoration(dashboard)) { - currentTags = dashboard.getTags(); - } - } - - setIsSaveInProgress(true); - save({}).then((response: SaveResult) => { - // If the save wasn't successful, put the original values back. - if (!(response as { id: string }).id) { - dashboardStateManager.setTitle(currentTitle); - dashboardStateManager.setDescription(currentDescription); - dashboardStateManager.setTimeRestore(currentTimeRestore); - if (savedObjectsTagging) { - dashboardStateManager.setTags(currentTags); - } - } else { - clearUnsavedChanges(); - } - setIsSaveInProgress(false); - return response; + setState((s) => ({ ...s, isSaveInProgress: true })); + const currentState = dashboardAppState.getLatestDashboardState(); + const saveResult = await saveDashboard({ + toasts, + timefilter, + redirectTo, + currentState, + saveOptions: {}, + savedObjectsTagging, + version: kibanaVersion, + dashboardSessionStorage, + savedDashboard: dashboardAppState.savedDashboard, }); - }, [save, savedObjectsTagging, dashboardStateManager, clearUnsavedChanges]); + if (saveResult.id && !saveResult.redirected) { + dashboardAppState.updateLastSavedState?.(); + } + // turn off save in progress after the next change check. This prevents the save button from flashing + setTimeout(() => { + if (!mounted) return; + setState((s) => ({ ...s, isSaveInProgress: false })); + }, DashboardConstants.CHANGE_CHECK_DEBOUNCE); + }, [ + dashboardSessionStorage, + savedObjectsTagging, + dashboardAppState, + kibanaVersion, + timefilter, + redirectTo, + mounted, + toasts, + ]); const runClone = useCallback(() => { - const currentTitle = dashboardStateManager.getTitle(); + const currentState = dashboardAppState.getLatestDashboardState(); const onClone = async ( newTitle: string, isTitleDuplicateConfirmed: boolean, onTitleDuplicate: () => void ) => { - dashboardStateManager.savedDashboard.copyOnSave = true; - dashboardStateManager.setTitle(newTitle); + dashboardAppState.savedDashboard.copyOnSave = true; const saveOptions = { confirmOverwrite: false, isTitleDuplicateConfirmed, onTitleDuplicate, }; - return save(saveOptions).then((response: { id?: string } | { error: Error }) => { - // If the save wasn't successful, put the original title back. - if ((response as { error: Error }).error) { - dashboardStateManager.setTitle(currentTitle); - } - return response; + const saveResult = await saveDashboard({ + toasts, + timefilter, + redirectTo, + saveOptions, + savedObjectsTagging, + version: kibanaVersion, + dashboardSessionStorage, + savedDashboard: dashboardAppState.savedDashboard, + currentState: { ...currentState, title: newTitle }, }); + return saveResult.id ? { id: saveResult.id } : { error: saveResult.error }; }; + showCloneModal(onClone, currentState.title); + }, [ + dashboardSessionStorage, + savedObjectsTagging, + dashboardAppState, + kibanaVersion, + redirectTo, + timefilter, + toasts, + ]); - showCloneModal(onClone, currentTitle); - }, [dashboardStateManager, save]); + const showOptions = useCallback( + (anchorElement: HTMLElement) => { + const currentState = dashboardAppState.getLatestDashboardState(); + showOptionsPopover({ + anchorElement, + useMargins: currentState.options.useMargins, + onUseMarginsChange: (isChecked: boolean) => { + dispatchDashboardStateChange(setUseMargins(isChecked)); + }, + syncColors: Boolean(currentState.options.syncColors), + onSyncColorsChange: (isChecked: boolean) => { + dispatchDashboardStateChange(setSyncColors(isChecked)); + }, + hidePanelTitles: currentState.options.hidePanelTitles, + onHidePanelTitlesChange: (isChecked: boolean) => { + dispatchDashboardStateChange(setHidePanelTitles(isChecked)); + }, + }); + }, + [dashboardAppState, dispatchDashboardStateChange] + ); + + const showShare = useCallback( + (anchorElement: HTMLElement) => { + if (!share) return; + const currentState = dashboardAppState.getLatestDashboardState(); + ShowShareModal({ + share, + kibanaVersion, + anchorElement, + dashboardCapabilities, + currentDashboardState: currentState, + savedDashboard: dashboardAppState.savedDashboard, + isDirty: Boolean(dashboardAppState.hasUnsavedChanges), + }); + }, + [dashboardAppState, dashboardCapabilities, share, kibanaVersion] + ); const dashboardTopNavActions = useMemo(() => { const actions = { - [TopNavIds.FULL_SCREEN]: () => { - dashboardStateManager.setFullScreenMode(true); - }, + [TopNavIds.FULL_SCREEN]: () => dispatchDashboardStateChange(setFullScreenMode(true)), [TopNavIds.EXIT_EDIT_MODE]: () => onChangeViewMode(ViewMode.VIEW), [TopNavIds.ENTER_EDIT_MODE]: () => onChangeViewMode(ViewMode.EDIT), - [TopNavIds.SAVE]: runSave, [TopNavIds.QUICK_SAVE]: runQuickSave, + [TopNavIds.OPTIONS]: showOptions, + [TopNavIds.SAVE]: runSaveAs, [TopNavIds.CLONE]: runClone, - [TopNavIds.OPTIONS]: (anchorElement) => { - showOptionsPopover({ - anchorElement, - useMargins: dashboardStateManager.getUseMargins(), - onUseMarginsChange: (isChecked: boolean) => { - dashboardStateManager.setUseMargins(isChecked); - }, - syncColors: dashboardStateManager.getSyncColors(), - onSyncColorsChange: (isChecked: boolean) => { - dashboardStateManager.setSyncColors(isChecked); - }, - hidePanelTitles: dashboardStateManager.getHidePanelTitles(), - onHidePanelTitlesChange: (isChecked: boolean) => { - dashboardStateManager.setHidePanelTitles(isChecked); - }, - }); - }, } as { [key: string]: NavAction }; + if (share) { - actions[TopNavIds.SHARE] = (anchorElement) => - ShowShareModal({ - share, - anchorElement, - savedDashboard, - dashboardStateManager, - dashboardCapabilities, - }); + actions[TopNavIds.SHARE] = showShare; } if (isLabsEnabled) { @@ -503,13 +441,13 @@ export function DashboardTopNav({ } return actions; }, [ - dashboardCapabilities, - dashboardStateManager, + dispatchDashboardStateChange, onChangeViewMode, - savedDashboard, - runClone, - runSave, runQuickSave, + showOptions, + runSaveAs, + showShare, + runClone, share, isLabsEnabled, isLabsShown, @@ -517,43 +455,49 @@ export function DashboardTopNav({ UseUnmount(() => { clearAddPanel(); + setMounted(false); }); - const getNavBarProps = () => { + const getNavBarProps = (): TopNavMenuProps => { + const { hasUnsavedChanges, savedDashboard } = dashboardAppState; const shouldShowNavBarComponent = (forceShow: boolean): boolean => - (forceShow || state.chromeIsVisible) && !dashboardStateManager.getFullScreenMode(); + (forceShow || state.chromeIsVisible) && !dashboardState.fullScreenMode; const shouldShowFilterBar = (forceHide: boolean): boolean => !forceHide && - (data.query.filterManager.getFilters().length > 0 || - !dashboardStateManager.getFullScreenMode()); + (data.query.filterManager.getFilters().length > 0 || !dashboardState.fullScreenMode); - const isFullScreenMode = dashboardStateManager.getFullScreenMode(); - const screenTitle = dashboardStateManager.getTitle(); + const isFullScreenMode = dashboardState.fullScreenMode; const showTopNavMenu = shouldShowNavBarComponent(Boolean(embedSettings?.forceShowTopNavMenu)); const showQueryInput = shouldShowNavBarComponent(Boolean(embedSettings?.forceShowQueryInput)); const showDatePicker = shouldShowNavBarComponent(Boolean(embedSettings?.forceShowDatePicker)); - const showQueryBar = showQueryInput || showDatePicker; const showFilterBar = shouldShowFilterBar(Boolean(embedSettings?.forceHideFilterBar)); + const showQueryBar = showQueryInput || showDatePicker; const showSearchBar = showQueryBar || showFilterBar; + const screenTitle = dashboardState.title; + + const topNav = getTopNavConfig( + dashboardAppState.getLatestDashboardState().viewMode, + dashboardTopNavActions, + { + hideWriteControls: dashboardCapabilities.hideWriteControls, + isDirty: Boolean(dashboardAppState.hasUnsavedChanges), + isSaveInProgress: state.isSaveInProgress, + isNewDashboard: !savedDashboard.id, + isLabsEnabled, + } + ); - const topNav = getTopNavConfig(viewMode, dashboardTopNavActions, { - hideWriteControls: dashboardCapabilities.hideWriteControls, - isNewDashboard: !savedDashboard.id, - isDirty: dashboardStateManager.getIsDirty(timefilter), - isSaveInProgress, - isLabsEnabled, - }); - - const badges = unsavedChanges - ? [ - { - 'data-test-subj': 'dashboardUnsavedChangesBadge', - badgeText: unsavedChangesBadge.getUnsavedChangedBadgeText(), - color: 'secondary', - }, - ] - : undefined; + const badges = + hasUnsavedChanges && dashboardState.viewMode === ViewMode.EDIT + ? [ + { + 'data-test-subj': 'dashboardUnsavedChangesBadge', + badgeText: unsavedChangesBadge.getUnsavedChangedBadgeText(), + color: 'secondary', + }, + ] + : undefined; return { badges, @@ -561,36 +505,25 @@ export function DashboardTopNav({ config: showTopNavMenu ? topNav : undefined, className: isFullScreenMode ? 'kbnTopNavMenu-isFullScreen' : undefined, screenTitle, - showTopNavMenu, showSearchBar, showQueryBar, showQueryInput, showDatePicker, showFilterBar, setMenuMountPoint: embedSettings ? undefined : setHeaderActionMenu, - indexPatterns, + indexPatterns: dashboardAppState.indexPatterns, showSaveQuery: dashboardCapabilities.saveQuery, useDefaultBehaviors: true, - onQuerySubmit, - onSavedQueryUpdated: (savedQuery: SavedQuery) => { - const allFilters = data.query.filterManager.getFilters(); - data.query.filterManager.setFilters(allFilters); - dashboardStateManager.applyFilters(savedQuery.attributes.query, allFilters); - if (savedQuery.attributes.timefilter) { - timefilter.setTime({ - from: savedQuery.attributes.timefilter.from, - to: savedQuery.attributes.timefilter.to, - }); - if (savedQuery.attributes.timefilter.refreshInterval) { - timefilter.setRefreshInterval(savedQuery.attributes.timefilter.refreshInterval); - } + savedQuery: state.savedQuery, + savedQueryId: dashboardState.savedQuery, + onQuerySubmit: (_payload, isUpdate) => { + if (isUpdate === false) { + dashboardAppState.$triggerDashboardRefresh.next({ force: true }); } - setState((s) => ({ ...s, savedQuery })); }, - savedQuery: state.savedQuery, - savedQueryId: dashboardStateManager.getSavedQueryId(), - onSavedQueryIdChange: (newId: string | undefined) => - dashboardStateManager.setSavedQueryId(newId), + onSavedQueryIdChange: (newId: string | undefined) => { + dispatchDashboardStateChange(setSavedQueryId(newId)); + }, }; }; @@ -636,9 +569,9 @@ export function DashboardTopNav({ <> {isLabsEnabled && isLabsShown ? ( - setIsLabsShown(false)} /> + setIsLabsShown(false)} /> ) : null} - {viewMode !== ViewMode.VIEW ? ( + {dashboardState.viewMode !== ViewMode.VIEW ? ( <> @@ -646,9 +579,7 @@ export function DashboardTopNav({ primaryActionButton: ( , ], }} diff --git a/src/plugins/dashboard/public/application/top_nav/editor_menu.tsx b/src/plugins/dashboard/public/application/top_nav/editor_menu.tsx index 5205f5b294c4fc..90cf0fcd571a15 100644 --- a/src/plugins/dashboard/public/application/top_nav/editor_menu.tsx +++ b/src/plugins/dashboard/public/application/top_nav/editor_menu.tsx @@ -18,7 +18,7 @@ import { BaseVisType, VisGroups, VisTypeAlias } from '../../../../visualizations import { SolutionToolbarPopover } from '../../../../presentation_util/public'; import { EmbeddableFactoryDefinition, EmbeddableInput } from '../../services/embeddable'; import { useKibana } from '../../services/kibana_react'; -import { DashboardAppServices } from '../types'; +import { DashboardAppServices } from '../../types'; import { DashboardContainer } from '..'; import { DashboardConstants } from '../../dashboard_constants'; import { dashboardReplacePanelAction } from '../../dashboard_strings'; diff --git a/src/plugins/dashboard/public/application/top_nav/save_modal.tsx b/src/plugins/dashboard/public/application/top_nav/save_modal.tsx index 5b1fbe7374dac6..79ac3917fb9680 100644 --- a/src/plugins/dashboard/public/application/top_nav/save_modal.tsx +++ b/src/plugins/dashboard/public/application/top_nav/save_modal.tsx @@ -12,7 +12,7 @@ import { EuiFormRow, EuiTextArea, EuiSwitch } from '@elastic/eui'; import type { SavedObjectsTaggingApi } from '../../services/saved_objects_tagging_oss'; import { SavedObjectSaveModal } from '../../services/saved_objects'; -import { DashboardSaveOptions } from '../types'; +import { DashboardSaveOptions } from '../../types'; interface Props { onSave: ({ diff --git a/src/plugins/dashboard/public/application/top_nav/show_share_modal.tsx b/src/plugins/dashboard/public/application/top_nav/show_share_modal.tsx index 56823adf6bc142..239d2bf72b9c11 100644 --- a/src/plugins/dashboard/public/application/top_nav/show_share_modal.tsx +++ b/src/plugins/dashboard/public/application/top_nav/show_share_modal.tsx @@ -14,34 +14,38 @@ import { DashboardSavedObject } from '../..'; import { setStateToKbnUrl, unhashUrl } from '../../services/kibana_utils'; import { SharePluginStart } from '../../services/share'; import { dashboardUrlParams } from '../dashboard_router'; -import { DashboardStateManager } from '../dashboard_state_manager'; import { shareModalStrings } from '../../dashboard_strings'; -import { DashboardCapabilities } from '../types'; +import { DashboardAppCapabilities, DashboardState } from '../../types'; +import { stateToRawDashboardState } from '../lib/convert_dashboard_state'; const showFilterBarId = 'showFilterBar'; interface ShowShareModalProps { + isDirty: boolean; + kibanaVersion: string; share: SharePluginStart; anchorElement: HTMLElement; savedDashboard: DashboardSavedObject; - dashboardCapabilities: DashboardCapabilities; - dashboardStateManager: DashboardStateManager; + currentDashboardState: DashboardState; + dashboardCapabilities: DashboardAppCapabilities; } export const showPublicUrlSwitch = (anonymousUserCapabilities: Capabilities) => { if (!anonymousUserCapabilities.dashboard) return false; - const dashboard = (anonymousUserCapabilities.dashboard as unknown) as DashboardCapabilities; + const dashboard = (anonymousUserCapabilities.dashboard as unknown) as DashboardAppCapabilities; return !!dashboard.show; }; export function ShowShareModal({ share, + isDirty, + kibanaVersion, anchorElement, savedDashboard, dashboardCapabilities, - dashboardStateManager, + currentDashboardState, }: ShowShareModalProps) { const EmbedUrlParamExtension = ({ setParamValue, @@ -101,12 +105,13 @@ export function ShowShareModal({ }; share.toggleShareContextMenu({ + isDirty, anchorElement, allowEmbed: true, allowShortUrl: dashboardCapabilities.createShortUrl, shareableUrl: setStateToKbnUrl( '_a', - dashboardStateManager.getAppState(), + stateToRawDashboardState({ state: currentDashboardState, version: kibanaVersion }), { useHash: false, storeInHashQuery: true }, unhashUrl(window.location.href) ), @@ -115,7 +120,6 @@ export function ShowShareModal({ sharingData: { title: savedDashboard.title, }, - isDirty: dashboardStateManager.getIsDirty(), embedUrlParamExtensions: [ { paramName: 'embed', diff --git a/src/plugins/dashboard/public/application/types.ts b/src/plugins/dashboard/public/application/types.ts deleted file mode 100644 index dd291291ce9d61..00000000000000 --- a/src/plugins/dashboard/public/application/types.ts +++ /dev/null @@ -1,88 +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 { - AppMountParameters, - CoreStart, - SavedObjectsClientContract, - ScopedHistory, - ChromeStart, - IUiSettingsClient, - PluginInitializerContext, -} from 'kibana/public'; - -import { SharePluginStart } from '../services/share'; -import { EmbeddableStart } from '../services/embeddable'; -import { UsageCollectionSetup } from '../services/usage_collection'; -import { NavigationPublicPluginStart } from '../services/navigation'; -import { SavedObjectsTaggingApi } from '../services/saved_objects_tagging_oss'; -import { DataPublicPluginStart, IndexPatternsContract } from '../services/data'; -import { SavedObjectLoader, SavedObjectsStart } from '../services/saved_objects'; -import { DashboardPanelStorage } from './lib'; -import { UrlForwardingStart } from '../../../url_forwarding/public'; -import { VisualizationsStart } from '../../../visualizations/public'; - -export type DashboardRedirect = (props: RedirectToProps) => void; -export type RedirectToProps = - | { destination: 'dashboard'; id?: string; useReplace?: boolean; editMode?: boolean } - | { destination: 'listing'; filter?: string; useReplace?: boolean }; - -export interface DashboardEmbedSettings { - forceShowTopNavMenu?: boolean; - forceShowQueryInput?: boolean; - forceShowDatePicker?: boolean; - forceHideFilterBar?: boolean; -} - -export interface DashboardSaveOptions { - newTitle: string; - newTags?: string[]; - newDescription: string; - newCopyOnSave: boolean; - newTimeRestore: boolean; - onTitleDuplicate: () => void; - isTitleDuplicateConfirmed: boolean; -} - -export interface DashboardCapabilities { - visualizeCapabilities: { save: boolean }; - mapsCapabilities: { save: boolean }; - hideWriteControls: boolean; - createShortUrl: boolean; - saveQuery: boolean; - createNew: boolean; - show: boolean; - storeSearchSession: boolean; -} - -export interface DashboardAppServices { - core: CoreStart; - chrome: ChromeStart; - share?: SharePluginStart; - embeddable: EmbeddableStart; - data: DataPublicPluginStart; - uiSettings: IUiSettingsClient; - restorePreviousUrl: () => void; - savedObjects: SavedObjectsStart; - allowByValueEmbeddables: boolean; - urlForwarding: UrlForwardingStart; - savedDashboards: SavedObjectLoader; - scopedHistory: () => ScopedHistory; - indexPatterns: IndexPatternsContract; - usageCollection?: UsageCollectionSetup; - navigation: NavigationPublicPluginStart; - dashboardPanelStorage: DashboardPanelStorage; - dashboardCapabilities: DashboardCapabilities; - initializerContext: PluginInitializerContext; - onAppLeave: AppMountParameters['onAppLeave']; - savedObjectsTagging?: SavedObjectsTaggingApi; - savedObjectsClient: SavedObjectsClientContract; - setHeaderActionMenu: AppMountParameters['setHeaderActionMenu']; - savedQueryService: DataPublicPluginStart['query']['savedQueries']; - visualizations: VisualizationsStart; -} diff --git a/src/plugins/dashboard/public/dashboard_constants.ts b/src/plugins/dashboard/public/dashboard_constants.ts index 16cb74209dd79e..7d5123ac27cb68 100644 --- a/src/plugins/dashboard/public/dashboard_constants.ts +++ b/src/plugins/dashboard/public/dashboard_constants.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -const DASHBOARD_STATE_STORAGE_KEY = '_a'; +export const DASHBOARD_STATE_STORAGE_KEY = '_a'; export const DashboardConstants = { LANDING_PAGE_PATH: '/list', @@ -17,6 +17,8 @@ export const DashboardConstants = { DASHBOARDS_ID: 'dashboards', DASHBOARD_ID: 'dashboard', SEARCH_SESSION_ID: 'searchSessionId', + CHANGE_CHECK_DEBOUNCE: 100, + CHANGE_APPLY_DEBOUNCE: 50, }; export function createDashboardEditUrl(id?: string, editMode?: boolean) { diff --git a/src/plugins/dashboard/public/dashboard_strings.ts b/src/plugins/dashboard/public/dashboard_strings.ts index 531ff815312cfe..ef158a149c3770 100644 --- a/src/plugins/dashboard/public/dashboard_strings.ts +++ b/src/plugins/dashboard/public/dashboard_strings.ts @@ -215,6 +215,22 @@ export const dashboardReadonlyBadge = { }), }; +export const dashboardSaveToastStrings = { + getSuccessString: (dashTitle: string) => + i18n.translate('dashboard.dashboardWasSavedSuccessMessage', { + defaultMessage: `Dashboard '{dashTitle}' was saved`, + values: { dashTitle }, + }), + getFailureString: (dashTitle: string, errorMessage: string) => + i18n.translate('dashboard.dashboardWasNotSavedDangerMessage', { + defaultMessage: `Dashboard '{dashTitle}' was not saved. Error: {errorMessage}`, + values: { + dashTitle, + errorMessage, + }, + }), +}; + /* Modals */ @@ -359,17 +375,9 @@ export const emptyScreenStrings = { i18n.translate('dashboard.fillDashboardTitle', { defaultMessage: 'This dashboard is empty. Let\u2019s fill it up!', }), - getHowToStartWorkingOnNewDashboardDescription1: () => - i18n.translate('dashboard.howToStartWorkingOnNewDashboardDescription1', { - defaultMessage: 'Click', - }), - getHowToStartWorkingOnNewDashboardDescription2: () => - i18n.translate('dashboard.howToStartWorkingOnNewDashboardDescription2', { - defaultMessage: 'in the menu bar above to start adding panels.', - }), - getHowToStartWorkingOnNewDashboardEditLinkText: () => - i18n.translate('dashboard.howToStartWorkingOnNewDashboardEditLinkText', { - defaultMessage: 'Edit', + getHowToStartWorkingOnNewDashboardDescription: () => + i18n.translate('dashboard.howToStartWorkingOnNewDashboardDescription', { + defaultMessage: 'Click edit in the menu bar above to start adding panels.', }), getHowToStartWorkingOnNewDashboardEditLinkAriaLabel: () => i18n.translate('dashboard.howToStartWorkingOnNewDashboardEditLinkAriaLabel', { @@ -442,3 +450,8 @@ export const dashboardUnsavedListingStrings = { defaultMessage: 'Discard changes', }), }; + +export const getCreateVisualizationButtonTitle = () => + i18n.translate('dashboard.solutionToolbar.addPanelButtonLabel', { + defaultMessage: 'Create visualization', + }); diff --git a/src/plugins/dashboard/public/index.ts b/src/plugins/dashboard/public/index.ts index 1acd1995b7290a..c584b44286e075 100644 --- a/src/plugins/dashboard/public/index.ts +++ b/src/plugins/dashboard/public/index.ts @@ -11,7 +11,6 @@ import { DashboardPlugin } from './plugin'; export { DashboardContainer, - DashboardContainerInput, DashboardContainerFactoryDefinition, DASHBOARD_CONTAINER_TYPE, } from './application'; @@ -29,7 +28,7 @@ export { DashboardUrlGeneratorState, } from './url_generator'; export { DashboardSavedObject } from './saved_dashboards'; -export { SavedDashboardPanel } from './types'; +export { SavedDashboardPanel, DashboardContainerInput } from './types'; export function plugin(initializerContext: PluginInitializerContext) { return new DashboardPlugin(initializerContext); diff --git a/src/plugins/dashboard/public/plugin.tsx b/src/plugins/dashboard/public/plugin.tsx index 230918399d88f8..b73fe5f2ba410d 100644 --- a/src/plugins/dashboard/public/plugin.tsx +++ b/src/plugins/dashboard/public/plugin.tsx @@ -65,6 +65,7 @@ import { AddToLibraryAction, LibraryNotificationAction, CopyToDashboardAction, + DashboardCapabilities, } from './application'; import { createDashboardUrlGenerator, @@ -351,6 +352,9 @@ export class DashboardPlugin const { notifications, overlays, application } = core; const { uiActions, data, share, presentationUtil, embeddable } = plugins; + const dashboardCapabilities: Readonly = application.capabilities + .dashboard as DashboardCapabilities; + const SavedObjectFinder = getSavedObjectFinder(core.savedObjects, core.uiSettings); const expandPanelAction = new ExpandPanelAction(); @@ -395,8 +399,8 @@ export class DashboardPlugin overlays, embeddable.getStateTransfer(), { - canCreateNew: Boolean(application.capabilities.dashboard.createNew), - canEditExisting: !Boolean(application.capabilities.dashboard.hideWriteControls), + canCreateNew: Boolean(dashboardCapabilities.createNew), + canEditExisting: Boolean(dashboardCapabilities.showWriteControls), }, presentationUtil.ContextProvider ); diff --git a/src/plugins/dashboard/public/saved_dashboards/saved_dashboard.ts b/src/plugins/dashboard/public/saved_dashboards/saved_dashboard.ts index 1c9125f8a064e4..7c056e04c1cd63 100644 --- a/src/plugins/dashboard/public/saved_dashboards/saved_dashboard.ts +++ b/src/plugins/dashboard/public/saved_dashboards/saved_dashboard.ts @@ -14,6 +14,7 @@ import { createDashboardEditUrl } from '../dashboard_constants'; import { extractReferences, injectReferences } from '../../common/saved_dashboard_references'; import { SavedObjectAttributes, SavedObjectReference } from '../../../../core/types'; +import { DashboardOptions } from '../types'; export interface DashboardSavedObject extends SavedObject { id?: string; @@ -97,9 +98,10 @@ export function createSavedDashboardClass( panelsJSON: '[]', optionsJSON: JSON.stringify({ // for BWC reasons we can't default dashboards that already exist without this setting to true. - useMargins: !id, + useMargins: true, + syncColors: false, hidePanelTitles: false, - }), + } as DashboardOptions), version: 1, timeRestore: false, timeTo: undefined, diff --git a/src/plugins/dashboard/public/types.ts b/src/plugins/dashboard/public/types.ts index 9285944bfe5fe7..89c9adb5721426 100644 --- a/src/plugins/dashboard/public/types.ts +++ b/src/plugins/dashboard/public/types.ts @@ -6,109 +6,195 @@ * Side Public License, v 1. */ -import { SavedObject as SavedObjectType, SavedObjectAttributes } from 'src/core/public'; -import { Query, Filter } from './services/data'; -import { ViewMode } from './services/embeddable'; +import { + AppMountParameters, + CoreStart, + SavedObjectsClientContract, + ScopedHistory, + ChromeStart, + IUiSettingsClient, + PluginInitializerContext, +} from 'kibana/public'; -import { SavedDashboardPanel } from '../common/types'; -export { SavedDashboardPanel }; +import { History } from 'history'; +import { AnyAction, Dispatch } from 'redux'; +import { BehaviorSubject, Subject } from 'rxjs'; +import { Query, Filter, IndexPattern, RefreshInterval, TimeRange } from './services/data'; +import { ContainerInput, EmbeddableInput, ViewMode } from './services/embeddable'; +import { SharePluginStart } from './services/share'; +import { EmbeddableStart } from './services/embeddable'; +import { DashboardSessionStorage } from './application/lib'; +import { UrlForwardingStart } from '../../url_forwarding/public'; +import { UsageCollectionSetup } from './services/usage_collection'; +import { NavigationPublicPluginStart } from './services/navigation'; +import { DashboardPanelState, SavedDashboardPanel } from '../common/types'; +import { SavedObjectsTaggingApi } from './services/saved_objects_tagging_oss'; +import { DataPublicPluginStart, IndexPatternsContract } from './services/data'; +import { SavedObjectLoader, SavedObjectsStart } from './services/saved_objects'; +import { IKbnUrlStateStorage } from './services/kibana_utils'; +import { DashboardContainer, DashboardSavedObject } from '.'; +import { VisualizationsStart } from '../../visualizations/public'; -// TODO: Replace Saved object interfaces by the ones Core will provide when it is ready. -export type SavedObjectAttribute = - | string - | number - | boolean - | null - | undefined - | SavedObjectAttributes - | SavedObjectAttributes[]; - -export interface SimpleSavedObject { - attributes: T; - _version?: SavedObjectType['version']; - id: SavedObjectType['id']; - type: SavedObjectType['type']; - migrationVersion: SavedObjectType['migrationVersion']; - error: SavedObjectType['error']; - references: SavedObjectType['references']; - get(key: string): any; - set(key: string, value: any): T; - has(key: string): boolean; - save(): Promise>; - delete(): void; -} +export { SavedDashboardPanel }; -interface FieldSubType { - multi?: { parent: string }; - nested?: { path: string }; +export type NavAction = (anchorElement?: any) => void; +export interface SavedDashboardPanelMap { + [key: string]: SavedDashboardPanel; } -export interface Field { - name: string; - type: string; - // esTypes might be undefined on old index patterns that have not been refreshed since we added - // this prop. It is also undefined on scripted fields. - esTypes?: string[]; - aggregatable: boolean; - filterable: boolean; - searchable: boolean; - subType?: FieldSubType; +export interface DashboardPanelMap { + [key: string]: DashboardPanelState; } -export type NavAction = (anchorElement?: any) => void; - -export interface DashboardAppState { - panels: SavedDashboardPanel[]; - fullScreenMode: boolean; +/** + * DashboardState contains all pieces of tracked state for an individual dashboard + */ +export interface DashboardState { + query: Query; title: string; - description: string; tags: string[]; - timeRestore: boolean; - options: { - hidePanelTitles: boolean; - useMargins: boolean; - syncColors?: boolean; - }; - query: Query | string; filters: Filter[]; viewMode: ViewMode; - expandedPanelId?: string; + description: string; savedQuery?: string; + timeRestore: boolean; + fullScreenMode: boolean; + expandedPanelId?: string; + options: DashboardOptions; + panels: DashboardPanelMap; } -export type DashboardAppStateDefaults = DashboardAppState & { +/** + * RawDashboardState is the dashboard state as directly loaded from the panelJSON + */ +export type RawDashboardState = Omit & { panels: SavedDashboardPanel[] }; + +export interface DashboardContainerInput extends ContainerInput { + dashboardCapabilities?: DashboardAppCapabilities; + refreshConfig?: RefreshInterval; + isEmbeddedExternally?: boolean; + isFullScreenMode: boolean; + expandedPanelId?: string; + timeRange: TimeRange; description?: string; -}; + useMargins: boolean; + syncColors?: boolean; + viewMode: ViewMode; + filters: Filter[]; + title: string; + query: Query; + panels: { + [panelId: string]: DashboardPanelState; + }; +} /** - * Panels are not added to the URL + * DashboardAppState contains all the tools the dashboard application uses to track, + * update, and view its state. */ -export type DashboardAppStateInUrl = Omit & { - panels?: SavedDashboardPanel[]; +export interface DashboardAppState { + hasUnsavedChanges?: boolean; + indexPatterns?: IndexPattern[]; + updateLastSavedState?: () => void; + resetToLastSavedState?: () => void; + savedDashboard?: DashboardSavedObject; + dashboardContainer?: DashboardContainer; + getLatestDashboardState?: () => DashboardState; + $triggerDashboardRefresh: Subject<{ force?: boolean }>; + $onDashboardStateChange: BehaviorSubject; + applyFilters?: (query: Query, filters: Filter[]) => void; +} + +/** + * The shared services and tools used to build a dashboard from a saved object ID. + */ +export type DashboardBuildContext = Pick< + DashboardAppServices, + | 'embeddable' + | 'indexPatterns' + | 'savedDashboards' + | 'usageCollection' + | 'initializerContext' + | 'savedObjectsTagging' + | 'dashboardCapabilities' +> & { + query: DashboardAppServices['data']['query']; + search: DashboardAppServices['data']['search']; + notifications: DashboardAppServices['core']['notifications']; + + history: History; + kibanaVersion: string; + isEmbeddedExternally: boolean; + kbnUrlStateStorage: IKbnUrlStateStorage; + $checkForUnsavedChanges: Subject; + getLatestDashboardState: () => DashboardState; + dispatchDashboardStateChange: Dispatch; + $triggerDashboardRefresh: Subject<{ force?: boolean }>; + $onDashboardStateChange: BehaviorSubject; }; -export interface DashboardAppStateTransitions { - set: ( - state: DashboardAppState - ) => ( - prop: T, - value: DashboardAppState[T] - ) => DashboardAppState; - setOption: ( - state: DashboardAppState - ) => ( - prop: T, - value: DashboardAppState['options'][T] - ) => DashboardAppState; +export interface DashboardOptions { + hidePanelTitles: boolean; + useMargins: boolean; + syncColors: boolean; } -export interface SavedDashboardPanelMap { - [key: string]: SavedDashboardPanel; +export type DashboardRedirect = (props: RedirectToProps) => void; +export type RedirectToProps = + | { destination: 'dashboard'; id?: string; useReplace?: boolean; editMode?: boolean } + | { destination: 'listing'; filter?: string; useReplace?: boolean }; + +export interface DashboardEmbedSettings { + forceHideFilterBar?: boolean; + forceShowTopNavMenu?: boolean; + forceShowQueryInput?: boolean; + forceShowDatePicker?: boolean; +} + +export interface DashboardSaveOptions { + newTitle: string; + newTags?: string[]; + newDescription: string; + newCopyOnSave: boolean; + newTimeRestore: boolean; + onTitleDuplicate: () => void; + isTitleDuplicateConfirmed: boolean; +} + +export interface DashboardAppCapabilities { + show: boolean; + createNew: boolean; + saveQuery: boolean; + createShortUrl: boolean; + hideWriteControls: boolean; + storeSearchSession: boolean; + mapsCapabilities: { save: boolean }; + visualizeCapabilities: { save: boolean }; } -export interface StagedFilter { - field: string; - value: string; - operator: string; - index: string; +export interface DashboardAppServices { + core: CoreStart; + chrome: ChromeStart; + share?: SharePluginStart; + embeddable: EmbeddableStart; + data: DataPublicPluginStart; + uiSettings: IUiSettingsClient; + restorePreviousUrl: () => void; + savedObjects: SavedObjectsStart; + allowByValueEmbeddables: boolean; + urlForwarding: UrlForwardingStart; + savedDashboards: SavedObjectLoader; + scopedHistory: () => ScopedHistory; + visualizations: VisualizationsStart; + indexPatterns: IndexPatternsContract; + usageCollection?: UsageCollectionSetup; + navigation: NavigationPublicPluginStart; + dashboardCapabilities: DashboardAppCapabilities; + initializerContext: PluginInitializerContext; + onAppLeave: AppMountParameters['onAppLeave']; + savedObjectsTagging?: SavedObjectsTaggingApi; + savedObjectsClient: SavedObjectsClientContract; + dashboardSessionStorage: DashboardSessionStorage; + setHeaderActionMenu: AppMountParameters['setHeaderActionMenu']; + savedQueryService: DataPublicPluginStart['query']['savedQueries']; } diff --git a/src/plugins/dashboard/server/capabilities_provider.ts b/src/plugins/dashboard/server/capabilities_provider.ts index 25457c1a487d90..c5b740c5812941 100644 --- a/src/plugins/dashboard/server/capabilities_provider.ts +++ b/src/plugins/dashboard/server/capabilities_provider.ts @@ -6,7 +6,11 @@ * Side Public License, v 1. */ -export const capabilitiesProvider = () => ({ +import { DashboardCapabilities } from '../common/types'; + +export const capabilitiesProvider = (): { + dashboard: DashboardCapabilities; +} => ({ dashboard: { createNew: true, show: true, diff --git a/src/plugins/data/common/es_query/filters/phrase_filter.ts b/src/plugins/data/common/es_query/filters/phrase_filter.ts index 2a7f2458a27de8..85562435e68d02 100644 --- a/src/plugins/data/common/es_query/filters/phrase_filter.ts +++ b/src/plugins/data/common/es_query/filters/phrase_filter.ts @@ -5,7 +5,7 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ - +import type { estypes } from '@elastic/elasticsearch'; import { get, isPlainObject } from 'lodash'; import { Filter, FilterMeta } from './meta_filter'; import { IIndexPattern, IFieldType } from '../../index_patterns'; @@ -23,7 +23,7 @@ export type PhraseFilter = Filter & { script?: { script: { source?: any; - lang?: string; + lang?: estypes.ScriptLanguage; params: any; }; }; diff --git a/src/plugins/data/common/es_query/filters/range_filter.ts b/src/plugins/data/common/es_query/filters/range_filter.ts index fb8426655583ee..a082b93c0a79a1 100644 --- a/src/plugins/data/common/es_query/filters/range_filter.ts +++ b/src/plugins/data/common/es_query/filters/range_filter.ts @@ -5,7 +5,7 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ - +import type { estypes } from '@elastic/elasticsearch'; import { map, reduce, mapValues, get, keys, pickBy } from 'lodash'; import { Filter, FilterMeta } from './meta_filter'; import { IIndexPattern, IFieldType } from '../../index_patterns'; @@ -63,7 +63,7 @@ export type RangeFilter = Filter & script?: { script: { params: any; - lang: string; + lang: estypes.ScriptLanguage; source: any; }; }; diff --git a/src/plugins/data/common/index_patterns/fields/__snapshots__/index_pattern_field.test.ts.snap b/src/plugins/data/common/index_patterns/fields/__snapshots__/index_pattern_field.test.ts.snap index 6b1d01e5ba1429..681aba41a609c0 100644 --- a/src/plugins/data/common/index_patterns/fields/__snapshots__/index_pattern_field.test.ts.snap +++ b/src/plugins/data/common/index_patterns/fields/__snapshots__/index_pattern_field.test.ts.snap @@ -16,7 +16,7 @@ Object { "esTypes": Array [ "keyword", ], - "lang": "lang", + "lang": "java", "name": "name", "readFromDocValues": false, "script": "script", @@ -58,7 +58,7 @@ Object { }, }, "isMapped": undefined, - "lang": "lang", + "lang": "java", "name": "name", "readFromDocValues": false, "runtimeField": Object { diff --git a/src/plugins/data/common/index_patterns/fields/index_pattern_field.test.ts b/src/plugins/data/common/index_patterns/fields/index_pattern_field.test.ts index 48342a9e02a2bd..73f015ca5517c3 100644 --- a/src/plugins/data/common/index_patterns/fields/index_pattern_field.test.ts +++ b/src/plugins/data/common/index_patterns/fields/index_pattern_field.test.ts @@ -24,7 +24,7 @@ describe('Field', function () { name: 'name', type: 'string', script: 'script', - lang: 'lang', + lang: 'java' as const, count: 1, esTypes: ['text'], // note, this will get replaced by the runtime field type aggregatable: true, diff --git a/src/plugins/data/common/index_patterns/fields/types.ts b/src/plugins/data/common/index_patterns/fields/types.ts index 565dd6d9269488..0fb7a46c2cf73d 100644 --- a/src/plugins/data/common/index_patterns/fields/types.ts +++ b/src/plugins/data/common/index_patterns/fields/types.ts @@ -5,7 +5,7 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ - +import type { estypes } from '@elastic/elasticsearch'; import { FieldSpec, IFieldSubType, IndexPattern } from '../..'; /** @@ -16,7 +16,7 @@ export interface IFieldType { name: string; type: string; script?: string; - lang?: string; + lang?: estypes.ScriptLanguage; count?: number; // esTypes might be undefined on old index patterns that have not been refreshed since we added // this prop. It is also undefined on scripted fields. diff --git a/src/plugins/data/common/index_patterns/types.ts b/src/plugins/data/common/index_patterns/types.ts index 0fcdea1a878ebc..07aa8967b905e4 100644 --- a/src/plugins/data/common/index_patterns/types.ts +++ b/src/plugins/data/common/index_patterns/types.ts @@ -5,7 +5,7 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ - +import type { estypes } from '@elastic/elasticsearch'; import { ToastInputFields, ErrorToastOptions } from 'src/core/public/notifications'; // eslint-disable-next-line import type { SavedObject } from 'src/core/server'; @@ -167,7 +167,7 @@ export type FieldSpecConflictDescriptions = Record; export interface FieldSpecExportFmt { count?: number; script?: string; - lang?: string; + lang?: estypes.ScriptLanguage; conflictDescriptions?: FieldSpecConflictDescriptions; name: string; type: KBN_FIELD_TYPES; @@ -197,7 +197,7 @@ export interface FieldSpec { * Scripted field langauge * Painless is the only valid scripted field language */ - lang?: string; + lang?: estypes.ScriptLanguage; conflictDescriptions?: Record; format?: SerializedFieldFormat; name: string; diff --git a/src/plugins/data/common/search/aggs/agg_configs.ts b/src/plugins/data/common/search/aggs/agg_configs.ts index 6f8a8d38a4a286..8593a0b0ed0fa3 100644 --- a/src/plugins/data/common/search/aggs/agg_configs.ts +++ b/src/plugins/data/common/search/aggs/agg_configs.ts @@ -10,7 +10,7 @@ import moment from 'moment'; import _, { cloneDeep } from 'lodash'; import { i18n } from '@kbn/i18n'; import { Assign } from '@kbn/utility-types'; -import { Aggregate, Bucket } from '@elastic/elasticsearch/api/types'; +import type { estypes } from '@elastic/elasticsearch'; import { IEsSearchResponse, @@ -57,7 +57,9 @@ export interface AggConfigsOptions { export type CreateAggConfigParams = Assign; -export type GenericBucket = Bucket & { [property: string]: Aggregate }; +export type GenericBucket = estypes.AggregationsBucket & { + [property: string]: estypes.AggregationsAggregate; +}; /** * @name AggConfigs @@ -412,7 +414,7 @@ export class AggConfigs { const transformedRawResponse = cloneDeep(response.rawResponse); if (!transformedRawResponse.aggregations) { transformedRawResponse.aggregations = { - doc_count: response.rawResponse.hits?.total as Aggregate, + doc_count: response.rawResponse.hits?.total as estypes.AggregationsAggregate, }; } const aggCursor = transformedRawResponse.aggregations!; diff --git a/src/plugins/data/common/search/aggs/utils/time_splits.ts b/src/plugins/data/common/search/aggs/utils/time_splits.ts index 4ac47efaea3476..75c1c091e07561 100644 --- a/src/plugins/data/common/search/aggs/utils/time_splits.ts +++ b/src/plugins/data/common/search/aggs/utils/time_splits.ts @@ -8,12 +8,7 @@ import moment from 'moment'; import _, { isArray } from 'lodash'; -import { - Aggregate, - FiltersAggregate, - FiltersBucketItem, - MultiBucketAggregate, -} from '@elastic/elasticsearch/api/types'; +import type { estypes } from '@elastic/elasticsearch'; import { AggGroupNames } from '../agg_groups'; import { GenericBucket, AggConfigs, getTime, AggConfig } from '../../../../common'; @@ -156,12 +151,15 @@ import { IBucketAggConfig } from '../buckets'; } // ... * ``` - * - * + * + * * @param aggConfigs The agg configs instance * @param aggCursor The root aggregations object from the response which will be mutated in place */ -export function mergeTimeShifts(aggConfigs: AggConfigs, aggCursor: Record) { +export function mergeTimeShifts( + aggConfigs: AggConfigs, + aggCursor: Record +) { const timeShifts = aggConfigs.getTimeShifts(); const hasMultipleTimeShifts = Object.keys(timeShifts).length > 1; const requestAggs = aggConfigs.getRequestAggs(); @@ -200,7 +198,7 @@ export function mergeTimeShifts(aggConfigs: AggConfigs, aggCursor: Record @@ -212,7 +210,7 @@ export function mergeTimeShifts(aggConfigs: AggConfigs, aggCursor: Record bucketAgg.type.orderBuckets(bucketAgg, a, b)); } else if (baseBuckets && buckets && !isArray(baseBuckets)) { @@ -249,7 +247,10 @@ export function mergeTimeShifts(aggConfigs: AggConfigs, aggCursor: Record, aggIndex: number): undefined => { + const transformTimeShift = ( + cursor: Record, + aggIndex: number + ): undefined => { const shouldSplit = aggConfigs.aggs[aggIndex].type.splitForTimeShift( aggConfigs.aggs[aggIndex], aggConfigs @@ -257,10 +258,8 @@ export function mergeTimeShifts(aggConfigs: AggConfigs, aggCursor: Record; + const timeShiftedBuckets = (cursor.time_offset_split as estypes.AggregationsFiltersAggregate) + .buckets as Record; const subTree = {}; Object.entries(timeShifts).forEach(([key, shift]) => { mergeAggLevel( @@ -301,7 +300,7 @@ export function mergeTimeShifts(aggConfigs: AggConfigs, aggCursor: Record = { export const createSearchSourceMock = (fields?: SearchSourceFields) => new SearchSource(fields, { getConfig: uiSettingsServiceMock.createStartContract().get, - search: jest.fn(), + search: jest + .fn() + .mockReturnValue( + of({ rawResponse: { hits: { hits: [], total: 0 } }, isPartial: false, isRunning: false }) + ), onResponse: jest.fn().mockImplementation((req, res) => res), }); diff --git a/src/plugins/data/common/search/search_source/search_source.ts b/src/plugins/data/common/search/search_source/search_source.ts index 7633382bb87631..19e80c7a487dcb 100644 --- a/src/plugins/data/common/search/search_source/search_source.ts +++ b/src/plugins/data/common/search/search_source/search_source.ts @@ -699,7 +699,7 @@ export class SearchSource { searchRequest.body = searchRequest.body || {}; const { body, index, query, filters, highlightAll } = searchRequest; searchRequest.indexType = this.getIndexType(index); - const metaFields = getConfig(UI_SETTINGS.META_FIELDS); + const metaFields = getConfig(UI_SETTINGS.META_FIELDS) ?? []; // get some special field types from the index pattern const { docvalueFields, scriptFields, storedFields, runtimeFields } = index diff --git a/src/plugins/data/common/search/search_source/types.ts b/src/plugins/data/common/search/search_source/types.ts index 507fda0dc9e474..40e92f45af1436 100644 --- a/src/plugins/data/common/search/search_source/types.ts +++ b/src/plugins/data/common/search/search_source/types.ts @@ -5,7 +5,7 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ - +import type { estypes } from '@elastic/elasticsearch'; import { NameList } from 'elasticsearch'; import { IAggConfigs } from 'src/plugins/data/public'; import { Query } from '../..'; @@ -156,7 +156,7 @@ export interface ShardFailure { type: string; }; reason: string; - lang?: string; + lang?: estypes.ScriptLanguage; script?: string; script_stack?: string[]; type: string; diff --git a/src/plugins/data/public/autocomplete/providers/kql_query_suggestion/field.test.ts b/src/plugins/data/public/autocomplete/providers/kql_query_suggestion/field.test.ts index f1eced06a33ea1..84ed4315ee16f7 100644 --- a/src/plugins/data/public/autocomplete/providers/kql_query_suggestion/field.test.ts +++ b/src/plugins/data/public/autocomplete/providers/kql_query_suggestion/field.test.ts @@ -41,6 +41,7 @@ describe('Kuery field suggestions', () => { querySuggestionsArgs, mockKueryNode({ prefix, suffix }) ); + // @ts-expect-error indexPatternResponse is not properly typed json const filterableFields = indexPatternResponse.fields.filter(indexPatternsUtils.isFilterable); expect(suggestions.length).toBe(filterableFields.length); diff --git a/src/plugins/data/public/public.api.md b/src/plugins/data/public/public.api.md index 9f5c2ef5fad3df..5ef499840fa6de 100644 --- a/src/plugins/data/public/public.api.md +++ b/src/plugins/data/public/public.api.md @@ -7,13 +7,11 @@ import { $Values } from '@kbn/utility-types'; import { Action } from 'history'; import { Adapters as Adapters_2 } from 'src/plugins/inspector/common'; -import { Aggregate } from '@elastic/elasticsearch/api/types'; import { ApiResponse } from '@elastic/elasticsearch/lib/Transport'; import { ApplicationStart } from 'kibana/public'; import { Assign } from '@kbn/utility-types'; import { BfetchPublicSetup } from 'src/plugins/bfetch/public'; import Boom from '@hapi/boom'; -import { Bucket } from '@elastic/elasticsearch/api/types'; import { ConfigDeprecationProvider } from '@kbn/config'; import { CoreSetup } from 'src/core/public'; import { CoreSetup as CoreSetup_2 } from 'kibana/public'; @@ -1245,7 +1243,7 @@ export interface IFieldType { // (undocumented) format?: any; // (undocumented) - lang?: string; + lang?: estypes.ScriptLanguage; // (undocumented) name: string; // (undocumented) @@ -1520,8 +1518,8 @@ export class IndexPatternField implements IFieldType { // (undocumented) get filterable(): boolean; get isMapped(): boolean | undefined; - get lang(): string | undefined; - set lang(lang: string | undefined); + get lang(): "painless" | "expression" | "mustache" | "java" | undefined; + set lang(lang: "painless" | "expression" | "mustache" | "java" | undefined); // (undocumented) get name(): string; // (undocumented) @@ -1545,7 +1543,7 @@ export class IndexPatternField implements IFieldType { toJSON(): { count: number; script: string | undefined; - lang: string | undefined; + lang: "painless" | "expression" | "mustache" | "java" | undefined; conflictDescriptions: Record | undefined; name: string; type: string; @@ -1990,7 +1988,7 @@ export type PhraseFilter = Filter & { script?: { script: { source?: any; - lang?: string; + lang?: estypes.ScriptLanguage; params: any; }; }; @@ -2208,7 +2206,7 @@ export type RangeFilter = Filter & EsRangeFilter & { script?: { script: { params: any; - lang: string; + lang: estypes.ScriptLanguage; source: any; }; }; @@ -2254,7 +2252,7 @@ export interface Reason { reason: string; }; // (undocumented) - lang?: string; + lang?: estypes.ScriptLanguage; // (undocumented) position?: { offset: number; diff --git a/src/plugins/data/public/query/query_string/query_string_manager.mock.ts b/src/plugins/data/public/query/query_string/query_string_manager.mock.ts index 0038ba0e87e06d..976d3ce13e7de7 100644 --- a/src/plugins/data/public/query/query_string/query_string_manager.mock.ts +++ b/src/plugins/data/public/query/query_string/query_string_manager.mock.ts @@ -7,12 +7,13 @@ */ import { QueryStringContract } from '.'; +import { Observable } from 'rxjs'; const createSetupContractMock = () => { const queryStringManagerMock: jest.Mocked = { getQuery: jest.fn(), setQuery: jest.fn(), - getUpdates$: jest.fn(), + getUpdates$: jest.fn(() => new Observable()), getDefaultQuery: jest.fn(), formatQuery: jest.fn(), clearQuery: jest.fn(), diff --git a/src/plugins/data/public/query/timefilter/timefilter_service.mock.ts b/src/plugins/data/public/query/timefilter/timefilter_service.mock.ts index c22f62f45a709f..f1f02a010e98c6 100644 --- a/src/plugins/data/public/query/timefilter/timefilter_service.mock.ts +++ b/src/plugins/data/public/query/timefilter/timefilter_service.mock.ts @@ -21,7 +21,7 @@ const createSetupContractMock = () => { getTimeUpdate$: jest.fn(), getRefreshIntervalUpdate$: jest.fn(), getAutoRefreshFetch$: jest.fn(() => new Observable<() => void>()), - getFetch$: jest.fn(), + getFetch$: jest.fn(() => new Observable<() => void>()), getTime: jest.fn(), setTime: jest.fn(), setRefreshInterval: jest.fn(), diff --git a/src/plugins/data/public/search/errors/painless_error.test.tsx b/src/plugins/data/public/search/errors/painless_error.test.tsx index f07f078ea03a3f..833573786594b2 100644 --- a/src/plugins/data/public/search/errors/painless_error.test.tsx +++ b/src/plugins/data/public/search/errors/painless_error.test.tsx @@ -23,6 +23,7 @@ describe('PainlessError', () => { const e = new PainlessError({ statusCode: 400, message: 'search_phase_execution_exception', + // @ts-expect-error searchPhaseException is not properly typed json attributes: searchPhaseException.error, }); const component = mount(e.getErrorMessage(startMock.application)); diff --git a/src/plugins/data/public/search/errors/types.ts b/src/plugins/data/public/search/errors/types.ts index 445293fe47ea35..13c5d0c242ed00 100644 --- a/src/plugins/data/public/search/errors/types.ts +++ b/src/plugins/data/public/search/errors/types.ts @@ -5,7 +5,7 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ - +import type { estypes } from '@elastic/elasticsearch'; import { KibanaServerError } from '../../../../kibana_utils/common'; export interface FailedShard { @@ -24,7 +24,7 @@ export interface Reason { start: number; end: number; }; - lang?: string; + lang?: estypes.ScriptLanguage; script?: string; caused_by?: { type: string; diff --git a/src/plugins/data/public/search/search_interceptor/search_interceptor.test.ts b/src/plugins/data/public/search/search_interceptor/search_interceptor.test.ts index dfbc912453d6e0..fe66d4b6e99370 100644 --- a/src/plugins/data/public/search/search_interceptor/search_interceptor.test.ts +++ b/src/plugins/data/public/search/search_interceptor/search_interceptor.test.ts @@ -135,6 +135,7 @@ describe('SearchInterceptor', () => { new PainlessError({ statusCode: 400, message: 'search_phase_execution_exception', + // @ts-expect-error searchPhaseException is not properly typed json attributes: searchPhaseException.error, }) ); diff --git a/src/plugins/data/public/ui/shard_failure_modal/shard_failure_types.ts b/src/plugins/data/public/ui/shard_failure_modal/shard_failure_types.ts index c34a47dc1c6dd6..83e4abf55d5256 100644 --- a/src/plugins/data/public/ui/shard_failure_modal/shard_failure_types.ts +++ b/src/plugins/data/public/ui/shard_failure_modal/shard_failure_types.ts @@ -5,7 +5,7 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ - +import type { estypes } from '@elastic/elasticsearch'; export interface ShardFailureRequest { docvalue_fields: string[]; _source: unknown; @@ -24,7 +24,7 @@ export interface ShardFailure { type: string; }; reason: string; - lang?: string; + lang?: estypes.ScriptLanguage; script?: string; script_stack?: string[]; type: string; diff --git a/src/plugins/data/server/autocomplete/value_suggestions_route.ts b/src/plugins/data/server/autocomplete/value_suggestions_route.ts index b2568a5a43611b..8fa14f8cbbd427 100644 --- a/src/plugins/data/server/autocomplete/value_suggestions_route.ts +++ b/src/plugins/data/server/autocomplete/value_suggestions_route.ts @@ -78,7 +78,7 @@ async function getBody( { timeout, terminate_after }: Record, field: IFieldType | string, query: string, - filters: estypes.QueryContainer[] = [] + filters: estypes.QueryDslQueryContainer[] = [] ) { const isFieldObject = (f: any): f is IFieldType => Boolean(f && f.name); diff --git a/src/plugins/data/server/index_patterns/fetcher/lib/field_capabilities/field_caps_response.ts b/src/plugins/data/server/index_patterns/fetcher/lib/field_capabilities/field_caps_response.ts index c4c1ffa3cf9f91..6db9254b815280 100644 --- a/src/plugins/data/server/index_patterns/fetcher/lib/field_capabilities/field_caps_response.ts +++ b/src/plugins/data/server/index_patterns/fetcher/lib/field_capabilities/field_caps_response.ts @@ -69,7 +69,7 @@ import { FieldDescriptor } from '../../../fetcher'; * @return {Array} */ export function readFieldCapsResponse( - fieldCapsResponse: estypes.FieldCapabilitiesResponse + fieldCapsResponse: estypes.FieldCapsResponse ): FieldDescriptor[] { const capsByNameThenType = fieldCapsResponse.fields; diff --git a/src/plugins/data/server/search/routes/call_msearch.ts b/src/plugins/data/server/search/routes/call_msearch.ts index 0c238adf831bd9..4a7db9517c688b 100644 --- a/src/plugins/data/server/search/routes/call_msearch.ts +++ b/src/plugins/data/server/search/routes/call_msearch.ts @@ -8,7 +8,8 @@ import { Observable } from 'rxjs'; import { first } from 'rxjs/operators'; -import { IUiSettingsClient, IScopedClusterClient, SharedGlobalConfig } from 'src/core/server'; +import type { IUiSettingsClient, IScopedClusterClient, SharedGlobalConfig } from 'src/core/server'; +import type { estypes } from '@elastic/elasticsearch'; import type { MsearchRequestBody, MsearchResponse } from '../../../common/search/search_source'; import { getKbnServerError } from '../../../../kibana_utils/server'; @@ -78,7 +79,9 @@ export function getCallMsearch(dependencies: CallMsearchDependencies) { body: { ...response, body: { - responses: response.body.responses?.map((r) => shimHitsTotal(r)), + responses: response.body.responses?.map((r) => + shimHitsTotal(r as estypes.SearchResponse) + ), }, }, }; diff --git a/src/plugins/data/server/search/routes/msearch.test.ts b/src/plugins/data/server/search/routes/msearch.test.ts index 6ae8612cceb1e9..303f83582f737e 100644 --- a/src/plugins/data/server/search/routes/msearch.test.ts +++ b/src/plugins/data/server/search/routes/msearch.test.ts @@ -116,7 +116,7 @@ describe('msearch route', () => { const error: any = mockResponse.customError.mock.calls[0][0]; expect(error.statusCode).toBe(400); - expect(error.body.message).toBe('json_e_o_f_exception'); + expect(error.body.message).toMatch(/json_e_o_f_exception/); expect(error.body.attributes).toBe(jsonEofException.error); }); diff --git a/src/plugins/data/server/search/strategies/eql_search/eql_search_strategy.ts b/src/plugins/data/server/search/strategies/eql_search/eql_search_strategy.ts index 0e3acedfe12f67..91de0fca3674c9 100644 --- a/src/plugins/data/server/search/strategies/eql_search/eql_search_strategy.ts +++ b/src/plugins/data/server/search/strategies/eql_search/eql_search_strategy.ts @@ -54,7 +54,8 @@ export const eqlSearchStrategyProvider = ( }; const promise = id ? client.get({ ...params, id }, request.options) - : client.search(params as EqlSearchStrategyRequest['params'], request.options); + : // @ts-expect-error EqlRequestParams | undefined is not assignable to EqlRequestParams + client.search(params as EqlSearchStrategyRequest['params'], request.options); const response = await shimAbortSignal(promise, options.abortSignal); return toEqlKibanaSearchResponse(response as ApiResponse); }; diff --git a/src/plugins/data/server/search/strategies/ese_search/ese_search_strategy.test.ts b/src/plugins/data/server/search/strategies/ese_search/ese_search_strategy.test.ts index 216318339622f0..56b26a7ebe02cc 100644 --- a/src/plugins/data/server/search/strategies/ese_search/ese_search_strategy.test.ts +++ b/src/plugins/data/server/search/strategies/ese_search/ese_search_strategy.test.ts @@ -293,7 +293,7 @@ describe('ES search strategy', () => { expect(mockGetCaller).toBeCalled(); const request = mockGetCaller.mock.calls[0][0]; - expect(request).toEqual({ id, body: { keep_alive: keepAlive } }); + expect(request).toEqual({ id, keep_alive: keepAlive }); }); it('throws normalized error on ElasticsearchClientError', async () => { diff --git a/src/plugins/data/server/search/strategies/ese_search/ese_search_strategy.ts b/src/plugins/data/server/search/strategies/ese_search/ese_search_strategy.ts index ab6162f756ea89..d6af00ada80fa6 100644 --- a/src/plugins/data/server/search/strategies/ese_search/ese_search_strategy.ts +++ b/src/plugins/data/server/search/strategies/ese_search/ese_search_strategy.ts @@ -177,7 +177,7 @@ export const enhancedEsSearchStrategyProvider = ( const client = useInternalUser ? esClient.asInternalUser : esClient.asCurrentUser; await client.asyncSearch.get({ id, - body: { keep_alive: keepAlive }, + keep_alive: keepAlive, }); } catch (e) { throw getKbnServerError(e); diff --git a/src/plugins/data/server/server.api.md b/src/plugins/data/server/server.api.md index f57ba274881033..ff265ccf533015 100644 --- a/src/plugins/data/server/server.api.md +++ b/src/plugins/data/server/server.api.md @@ -6,10 +6,8 @@ import { $Values } from '@kbn/utility-types'; import { Adapters } from 'src/plugins/inspector/common'; -import { Aggregate } from '@elastic/elasticsearch/api/types'; import { Assign } from '@kbn/utility-types'; import { BfetchServerSetup } from 'src/plugins/bfetch/server'; -import { Bucket } from '@elastic/elasticsearch/api/types'; import { ConfigDeprecationProvider } from '@kbn/config'; import { CoreSetup } from 'src/core/server'; import { CoreSetup as CoreSetup_2 } from 'kibana/server'; @@ -713,7 +711,7 @@ export interface IFieldType { // (undocumented) format?: any; // (undocumented) - lang?: string; + lang?: estypes.ScriptLanguage; // (undocumented) name: string; // (undocumented) @@ -1420,22 +1418,22 @@ export const shimAbortSignal: (promise: TransportRequestPromise, signal?: export function shimHitsTotal(response: estypes.SearchResponse, { legacyHitsTotal }?: ISearchOptions): { hits: { total: any; - hits: estypes.Hit[]; + hits: estypes.SearchHit[]; max_score?: number | undefined; }; took: number; timed_out: boolean; _shards: estypes.ShardStatistics; - aggregations?: Record | undefined; + aggregations?: Record | undefined; _clusters?: estypes.ClusterStatistics | undefined; documents?: unknown[] | undefined; fields?: Record | undefined; max_score?: number | undefined; num_reduce_phases?: number | undefined; - profile?: estypes.Profile | undefined; + profile?: estypes.SearchProfile | undefined; pit_id?: string | undefined; _scroll_id?: string | undefined; - suggest?: Record[]> | undefined; + suggest?: Record[]> | undefined; terminated_early?: boolean | undefined; }; diff --git a/src/plugins/discover/public/__mocks__/index_pattern.ts b/src/plugins/discover/public/__mocks__/index_pattern.ts index 4fbeac80b09723..67aac96889424f 100644 --- a/src/plugins/discover/public/__mocks__/index_pattern.ts +++ b/src/plugins/discover/public/__mocks__/index_pattern.ts @@ -65,6 +65,10 @@ fields.getByName = (name: string) => { return fields.find((field) => field.name === name); }; +fields.getAll = () => { + return fields; +}; + const indexPattern = ({ id: 'the-index-pattern-id', title: 'the-index-pattern-title', diff --git a/src/plugins/discover/public/__mocks__/index_pattern_with_timefield.ts b/src/plugins/discover/public/__mocks__/index_pattern_with_timefield.ts index ad84518af9de3a..f1c3c537dd5e18 100644 --- a/src/plugins/discover/public/__mocks__/index_pattern_with_timefield.ts +++ b/src/plugins/discover/public/__mocks__/index_pattern_with_timefield.ts @@ -56,6 +56,9 @@ const fields = [ fields.getByName = (name: string) => { return fields.find((field) => field.name === name); }; +fields.getAll = () => { + return fields; +}; const indexPattern = ({ id: 'index-pattern-with-timefield-id', @@ -72,5 +75,8 @@ const indexPattern = ({ indexPattern.flattenHit = indexPatterns.flattenHitWrapper(indexPattern, indexPattern.metaFields); indexPattern.isTimeBased = () => !!indexPattern.timeFieldName; +indexPattern.formatField = (hit: Record, fieldName: string) => { + return fieldName === '_source' ? hit._source : indexPattern.flattenHit(hit)[fieldName]; +}; export const indexPatternWithTimefieldMock = indexPattern; diff --git a/src/plugins/discover/public/__mocks__/saved_search.ts b/src/plugins/discover/public/__mocks__/saved_search.ts index 8f07391571987c..6f48c56b0810e4 100644 --- a/src/plugins/discover/public/__mocks__/saved_search.ts +++ b/src/plugins/discover/public/__mocks__/saved_search.ts @@ -7,6 +7,8 @@ */ import { SavedSearch } from '../saved_searches'; +import { createSearchSourceMock } from '../../../data/public/mocks'; +import { indexPatternMock } from './index_pattern'; export const savedSearchMock = ({ id: 'the-saved-search-id', @@ -27,4 +29,5 @@ export const savedSearchMock = ({ ], migrationVersion: { search: '7.5.0' }, error: undefined, + searchSource: createSearchSourceMock({ index: indexPatternMock }), } as unknown) as SavedSearch; diff --git a/src/plugins/discover/public/__mocks__/search_session.ts b/src/plugins/discover/public/__mocks__/search_session.ts new file mode 100644 index 00000000000000..a9037217a303ae --- /dev/null +++ b/src/plugins/discover/public/__mocks__/search_session.ts @@ -0,0 +1,27 @@ +/* + * 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 { createMemoryHistory } from 'history'; +import { dataPluginMock } from '../../../data/public/mocks'; +import { DataPublicPluginStart } from '../../../data/public'; +import { DiscoverSearchSessionManager } from '../application/apps/main/services/discover_search_session'; + +export function createSearchSessionMock() { + const history = createMemoryHistory(); + const session = dataPluginMock.createStartContract().search.session as jest.Mocked< + DataPublicPluginStart['search']['session'] + >; + const searchSessionManager = new DiscoverSearchSessionManager({ + history, + session, + }); + return { + history, + session, + searchSessionManager, + }; +} diff --git a/src/plugins/discover/public/__mocks__/services.ts b/src/plugins/discover/public/__mocks__/services.ts new file mode 100644 index 00000000000000..8a047625303d2a --- /dev/null +++ b/src/plugins/discover/public/__mocks__/services.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 { DiscoverServices } from '../build_services'; +import { dataPluginMock } from '../../../data/public/mocks'; +import { chromeServiceMock, coreMock, docLinksServiceMock } from '../../../../core/public/mocks'; +import { DEFAULT_COLUMNS_SETTING } from '../../common'; +import { savedSearchMock } from './saved_search'; +import { UI_SETTINGS } from '../../../data/common'; +import { TopNavMenu } from '../../../navigation/public'; +const dataPlugin = dataPluginMock.createStartContract(); + +export const discoverServiceMock = ({ + core: coreMock.createStart(), + chrome: chromeServiceMock.createStartContract(), + history: () => ({ + location: { + search: '', + }, + }), + data: dataPlugin, + docLinks: docLinksServiceMock.createStartContract(), + capabilities: { + visualize: { + show: true, + }, + discover: { + save: false, + }, + advancedSettings: { + save: true, + }, + }, + filterManager: dataPlugin.query.filterManager, + uiSettings: { + get: (key: string) => { + if (key === 'fields:popularLimit') { + return 5; + } else if (key === DEFAULT_COLUMNS_SETTING) { + return []; + } else if (key === UI_SETTINGS.META_FIELDS) { + return []; + } + }, + }, + indexPatternFieldEditor: { + openEditor: jest.fn(), + userPermissions: { + editIndexPattern: jest.fn(), + }, + }, + getSavedSearchById: (id?: string) => Promise.resolve(savedSearchMock), + navigation: { + ui: { TopNavMenu }, + }, + metadata: { + branch: 'test', + }, +} as unknown) as DiscoverServices; diff --git a/src/plugins/discover/public/application/angular/create_discover_directive.ts b/src/plugins/discover/public/application/angular/create_discover_directive.ts new file mode 100644 index 00000000000000..ae0d978322bcd0 --- /dev/null +++ b/src/plugins/discover/public/application/angular/create_discover_directive.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 { DiscoverMainApp } from '../apps/main'; + +// eslint-disable-next-line @typescript-eslint/no-explicit-any +export function createDiscoverDirective(reactDirective: any) { + return reactDirective(DiscoverMainApp, [ + ['indexPattern', { watchDepth: 'reference' }], + ['opts', { watchDepth: 'reference' }], + ]); +} diff --git a/src/plugins/discover/public/application/components/create_discover_grid_directive.tsx b/src/plugins/discover/public/application/angular/create_discover_grid_directive.tsx similarity index 95% rename from src/plugins/discover/public/application/components/create_discover_grid_directive.tsx rename to src/plugins/discover/public/application/angular/create_discover_grid_directive.tsx index 39a9df89260238..1fc8edcb4d0659 100644 --- a/src/plugins/discover/public/application/components/create_discover_grid_directive.tsx +++ b/src/plugins/discover/public/application/angular/create_discover_grid_directive.tsx @@ -7,7 +7,7 @@ */ import React, { useState } from 'react'; import { I18nProvider } from '@kbn/i18n/react'; -import { DiscoverGrid, DiscoverGridProps } from './discover_grid/discover_grid'; +import { DiscoverGrid, DiscoverGridProps } from '../components/discover_grid/discover_grid'; import { getServices } from '../../kibana_services'; import { ElasticSearchHit } from '../doc_views/doc_views_types'; diff --git a/src/plugins/discover/public/application/angular/directives/debounce/debounce.js b/src/plugins/discover/public/application/angular/directives/debounce/debounce.js deleted file mode 100644 index bca1a9c785fd68..00000000000000 --- a/src/plugins/discover/public/application/angular/directives/debounce/debounce.js +++ /dev/null @@ -1,57 +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 _ from 'lodash'; -// Debounce service, angularized version of lodash debounce -// borrowed heavily from https://github.com/shahata/angular-debounce - -export function createDebounceProviderTimeout($timeout) { - return function (func, wait, options) { - let timeout; - let args; - let self; - let result; - options = _.defaults(options || {}, { - leading: false, - trailing: true, - invokeApply: true, - }); - - function debounce() { - self = this; - args = arguments; - - const later = function () { - timeout = null; - if (!options.leading || options.trailing) { - result = func.apply(self, args); - } - }; - - const callNow = options.leading && !timeout; - - if (timeout) { - $timeout.cancel(timeout); - } - timeout = $timeout(later, wait, options.invokeApply); - - if (callNow) { - result = func.apply(self, args); - } - - return result; - } - - debounce.cancel = function () { - $timeout.cancel(timeout); - timeout = null; - }; - - return debounce; - }; -} diff --git a/src/plugins/discover/public/application/angular/directives/debounce/debounce.test.ts b/src/plugins/discover/public/application/angular/directives/debounce/debounce.test.ts deleted file mode 100644 index 0c033fd066eabe..00000000000000 --- a/src/plugins/discover/public/application/angular/directives/debounce/debounce.test.ts +++ /dev/null @@ -1,127 +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 sinon, { SinonSpy } from 'sinon'; -import angular, { auto, ITimeoutService } from 'angular'; -import 'angular-mocks'; -import 'angular-sanitize'; -import 'angular-route'; - -// @ts-expect-error -import { createDebounceProviderTimeout } from './debounce'; -import { coreMock } from '../../../../../../../core/public/mocks'; -import { initializeInnerAngularModule } from '../../../../get_inner_angular'; -import { navigationPluginMock } from '../../../../../../navigation/public/mocks'; -import { dataPluginMock } from '../../../../../../data/public/mocks'; -import { initAngularBootstrap } from '../../../../../../kibana_legacy/public'; - -describe('debounce service', function () { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - let debounce: (fn: () => void, timeout: number, options?: any) => any; - let $timeout: ITimeoutService; - let spy: SinonSpy; - - beforeEach(() => { - spy = sinon.spy(); - - initAngularBootstrap(); - - initializeInnerAngularModule( - 'app/discover', - coreMock.createStart(), - navigationPluginMock.createStartContract(), - dataPluginMock.createStartContract() - ); - - angular.mock.module('app/discover'); - - angular.mock.inject(($injector: auto.IInjectorService, _$timeout_: ITimeoutService) => { - $timeout = _$timeout_; - - debounce = createDebounceProviderTimeout($timeout); - }); - }); - - it('should have a cancel method', function () { - const bouncer = debounce(() => {}, 100); - - expect(bouncer).toHaveProperty('cancel'); - }); - - describe('delayed execution', function () { - const sandbox = sinon.createSandbox(); - - beforeEach(() => sandbox.useFakeTimers()); - afterEach(() => sandbox.restore()); - - it('should delay execution', function () { - const bouncer = debounce(spy, 100); - - bouncer(); - sinon.assert.notCalled(spy); - $timeout.flush(); - sinon.assert.calledOnce(spy); - - spy.resetHistory(); - }); - - it('should fire on leading edge', function () { - const bouncer = debounce(spy, 100, { leading: true }); - - bouncer(); - sinon.assert.calledOnce(spy); - $timeout.flush(); - sinon.assert.calledTwice(spy); - - spy.resetHistory(); - }); - - it('should only fire on leading edge', function () { - const bouncer = debounce(spy, 100, { leading: true, trailing: false }); - - bouncer(); - sinon.assert.calledOnce(spy); - $timeout.flush(); - sinon.assert.calledOnce(spy); - - spy.resetHistory(); - }); - - it('should reset delayed execution', function () { - const cancelSpy = sinon.spy($timeout, 'cancel'); - const bouncer = debounce(spy, 100); - - bouncer(); - sandbox.clock.tick(1); - - bouncer(); - sinon.assert.notCalled(spy); - $timeout.flush(); - sinon.assert.calledOnce(spy); - sinon.assert.calledOnce(cancelSpy); - - spy.resetHistory(); - cancelSpy.resetHistory(); - }); - }); - - describe('cancel', function () { - it('should cancel the $timeout', function () { - const cancelSpy = sinon.spy($timeout, 'cancel'); - const bouncer = debounce(spy, 100); - - bouncer(); - bouncer.cancel(); - sinon.assert.calledOnce(cancelSpy); - // throws if pending timeouts - $timeout.verifyNoPendingTasks(); - - cancelSpy.resetHistory(); - }); - }); -}); diff --git a/src/plugins/discover/public/application/angular/discover.js b/src/plugins/discover/public/application/angular/discover.js index c66ca19c967437..aa1344a67fbec9 100644 --- a/src/plugins/discover/public/application/angular/discover.js +++ b/src/plugins/discover/public/application/angular/discover.js @@ -6,47 +6,17 @@ * Side Public License, v 1. */ -import _ from 'lodash'; -import { merge, Subject, Subscription } from 'rxjs'; -import { debounceTime, tap, filter } from 'rxjs/operators'; import { i18n } from '@kbn/i18n'; -import { createSearchSessionRestorationDataProvider, getState, splitState } from './discover_state'; -import { RequestAdapter } from '../../../../inspector/public'; -import { - connectToQueryState, - esFilters, - indexPatterns as indexPatternsUtils, - noSearchSessionStorageCapabilityMessage, - syncQueryStateWithUrl, -} from '../../../../data/public'; -import { getSortArray } from './doc_table'; +import { getState } from '../apps/main/services/discover_state'; import indexTemplateLegacy from './discover_legacy.html'; -import { discoverResponseHandler } from './response_handler'; import { getAngularModule, - getHeaderActionMenuMounter, getServices, getUrlTracker, redirectWhenMissing, - subscribeWithScope, - tabifyAggResponse, } from '../../kibana_services'; import { getRootBreadcrumbs, getSavedSearchBreadcrumbs } from '../helpers/breadcrumbs'; -import { getStateDefaults } from '../helpers/get_state_defaults'; -import { getResultState } from '../helpers/get_result_state'; -import { validateTimeRange } from '../helpers/validate_time_range'; -import { addFatalError } from '../../../../kibana_legacy/public'; -import { - SAMPLE_SIZE_SETTING, - SEARCH_FIELDS_FROM_SOURCE, - SEARCH_ON_PAGE_LOAD_SETTING, -} from '../../../common'; -import { loadIndexPattern, resolveIndexPattern } from '../helpers/resolve_index_pattern'; -import { updateSearchSource } from '../helpers/update_search_source'; -import { calcFieldCounts } from '../helpers/calc_field_counts'; -import { DiscoverSearchSessionManager } from './discover_search_session'; -import { applyAggsToSearchSource, getDimensions } from '../components/histogram'; -import { fetchStatuses } from '../components/constants'; +import { loadIndexPattern, resolveIndexPattern } from '../apps/main/utils/resolve_index_pattern'; const services = getServices(); @@ -56,8 +26,6 @@ const { chrome, data, history: getHistory, - filterManager, - timefilter, toastNotifications, uiSettings: config, } = getServices(); @@ -147,390 +115,29 @@ app.directive('discoverApp', function () { }); function discoverController($route, $scope) { - const { isDefault: isDefaultType } = indexPatternsUtils; - const subscriptions = new Subscription(); - const refetch$ = new Subject(); - - let isChangingIndexPattern = false; const savedSearch = $route.current.locals.savedObjects.savedSearch; - const persistentSearchSource = savedSearch.searchSource; $scope.indexPattern = resolveIndexPattern( $route.current.locals.savedObjects.ip, - persistentSearchSource, + savedSearch.searchSource, toastNotifications ); - $scope.useNewFieldsApi = !config.get(SEARCH_FIELDS_FROM_SOURCE); - - //used for functional testing - $scope.fetchCounter = 0; - - const getTimeField = () => { - return isDefaultType($scope.indexPattern) ? $scope.indexPattern.timeFieldName : undefined; - }; const history = getHistory(); - const searchSessionManager = new DiscoverSearchSessionManager({ - history, - session: data.search.session, - }); - - const stateContainer = getState({ - getStateDefaults: () => - getStateDefaults({ - config, - data, - indexPattern: $scope.indexPattern, - savedSearch, - searchSource: persistentSearchSource, - }), - storeInSessionStorage: config.get('state:storeInSessionStorage'), - history, - toasts: core.notifications.toasts, - uiSettings: config, - }); - - const { - appStateContainer, - startSync: startStateSync, - stopSync: stopStateSync, - setAppState, - replaceUrlAppState, - kbnUrlStateStorage, - getPreviousAppState, - } = stateContainer; - - if (appStateContainer.getState().index !== $scope.indexPattern.id) { - //used index pattern is different than the given by url/state which is invalid - setAppState({ index: $scope.indexPattern.id }); - } - $scope.state = { ...appStateContainer.getState() }; - - // syncs `_g` portion of url with query services - const { stop: stopSyncingGlobalStateWithUrl } = syncQueryStateWithUrl( - data.query, - kbnUrlStateStorage - ); - - // sync initial app filters from state to filterManager - filterManager.setAppFilters(_.cloneDeep(appStateContainer.getState().filters)); - data.query.queryString.setQuery(appStateContainer.getState().query); - - const stopSyncingQueryAppStateWithStateContainer = connectToQueryState( - data.query, - appStateContainer, - { - filters: esFilters.FilterStateStore.APP_STATE, - query: true, - } - ); - const showUnmappedFields = $scope.useNewFieldsApi; - const updateSearchSourceHelper = () => { - const { indexPattern, useNewFieldsApi } = $scope; - const { columns, sort } = $scope.state; - updateSearchSource({ - persistentSearchSource, - volatileSearchSource: $scope.volatileSearchSource, - indexPattern, - services, - sort, - columns, - useNewFieldsApi, - showUnmappedFields, - }); - }; - - const appStateUnsubscribe = appStateContainer.subscribe(async (newState) => { - const { state: newStatePartial } = splitState(newState); - const { state: oldStatePartial } = splitState(getPreviousAppState()); - - if (!_.isEqual(newStatePartial, oldStatePartial)) { - $scope.$evalAsync(async () => { - // NOTE: this is also called when navigating from discover app to context app - if (newStatePartial.index && oldStatePartial.index !== newStatePartial.index) { - //in case of index pattern switch the route has currently to be reloaded, legacy - isChangingIndexPattern = true; - $route.reload(); - return; - } - - $scope.state = { ...newState }; - - // detect changes that should trigger fetching of new data - const changes = ['interval', 'sort'].filter( - (prop) => !_.isEqual(newStatePartial[prop], oldStatePartial[prop]) - ); - - if (oldStatePartial.hideChart && !newStatePartial.hideChart) { - // in case the histogram is hidden, no data is requested - // so when changing this state data needs to be fetched - changes.push(true); - } - - if (changes.length) { - refetch$.next(); - } - }); - } - }); - - // this listener is waiting for such a path http://localhost:5601/app/discover#/ - // which could be set through pressing "New" button in top nav or go to "Discover" plugin from the sidebar - // to reload the page in a right way - const unlistenHistoryBasePath = history.listen(({ pathname, search, hash }) => { - if (!search && !hash && pathname === '/') { - $route.reload(); - } - }); - - data.search.session.enableStorage( - createSearchSessionRestorationDataProvider({ - appStateContainer, - data, - getSavedSearch: () => savedSearch, - }), - { - isDisabled: () => - capabilities.discover.storeSearchSession - ? { disabled: false } - : { - disabled: true, - reasonText: noSearchSessionStorageCapabilityMessage, - }, - } - ); $scope.opts = { - // number of records to fetch, then paginate through - sampleSize: config.get(SAMPLE_SIZE_SETTING), - timefield: getTimeField(), - savedSearch: savedSearch, + savedSearch, + history, services, indexPatternList: $route.current.locals.savedObjects.ip.list, - config: config, - setHeaderActionMenu: getHeaderActionMenuMounter(), - filterManager, - setAppState, - data, - stateContainer, - searchSessionManager, - refetch$, - }; - - const inspectorAdapters = ($scope.opts.inspectorAdapters = { - requests: new RequestAdapter(), - }); - - const shouldSearchOnPageLoad = () => { - // A saved search is created on every page load, so we check the ID to see if we're loading a - // previously saved search or if it is just transient - return ( - config.get(SEARCH_ON_PAGE_LOAD_SETTING) || - savedSearch.id !== undefined || - timefilter.getRefreshInterval().pause === false || - searchSessionManager.hasSearchSessionIdInURL() - ); + navigateTo: (path) => { + $scope.$evalAsync(() => { + history.push(path); + }); + }, }; - $scope.fetchStatus = fetchStatuses.UNINITIALIZED; - $scope.resultState = shouldSearchOnPageLoad() ? 'loading' : 'uninitialized'; - - let abortController; $scope.$on('$destroy', () => { - if (abortController) abortController.abort(); savedSearch.destroy(); - subscriptions.unsubscribe(); - if (!isChangingIndexPattern) { - // HACK: - // do not clear session when changing index pattern due to how state management around it is setup - // it will be cleared by searchSessionManager on controller reload instead - data.search.session.clear(); - } - appStateUnsubscribe(); - stopStateSync(); - stopSyncingGlobalStateWithUrl(); - stopSyncingQueryAppStateWithStateContainer(); - unlistenHistoryBasePath(); - }); - - $scope.opts.getFieldCounts = async () => { - // the field counts aren't set until we have the data back, - // so we wait for the fetch to be done before proceeding - if ($scope.fetchStatus === fetchStatuses.COMPLETE) { - return $scope.fieldCounts; - } - - return await new Promise((resolve) => { - const unwatch = $scope.$watch('fetchStatus', (newValue) => { - if (newValue === fetchStatuses.COMPLETE) { - unwatch(); - resolve($scope.fieldCounts); - } - }); - }); - }; - $scope.opts.navigateTo = (path) => { - $scope.$evalAsync(() => { - history.push(path); - }); - }; - - persistentSearchSource.setField('index', $scope.indexPattern); - - // searchSource which applies time range - const volatileSearchSource = savedSearch.searchSource.create(); - - if (isDefaultType($scope.indexPattern)) { - volatileSearchSource.setField('filter', () => { - return timefilter.createFilter($scope.indexPattern); - }); - } - - volatileSearchSource.setParent(persistentSearchSource); - $scope.volatileSearchSource = volatileSearchSource; - $scope.state.index = $scope.indexPattern.id; - $scope.state.sort = getSortArray($scope.state.sort, $scope.indexPattern); - - $scope.opts.fetch = $scope.fetch = async function () { - $scope.fetchCounter++; - $scope.fetchError = undefined; - if (!validateTimeRange(timefilter.getTime(), toastNotifications)) { - $scope.resultState = 'none'; - } - - // Abort any in-progress requests before fetching again - if (abortController) abortController.abort(); - abortController = new AbortController(); - - const searchSessionId = searchSessionManager.getNextSearchSessionId(); - updateSearchSourceHelper(); - - $scope.opts.chartAggConfigs = applyAggsToSearchSource( - getTimeField() && !$scope.state.hideChart, - volatileSearchSource, - $scope.state.interval, - $scope.indexPattern, - data - ); - - $scope.fetchStatus = fetchStatuses.LOADING; - $scope.resultState = getResultState($scope.fetchStatus, $scope.rows); - - inspectorAdapters.requests.reset(); - return $scope.volatileSearchSource - .fetch$({ - abortSignal: abortController.signal, - sessionId: searchSessionId, - inspector: { - adapter: inspectorAdapters.requests, - title: i18n.translate('discover.inspectorRequestDataTitle', { - defaultMessage: 'data', - }), - description: i18n.translate('discover.inspectorRequestDescription', { - defaultMessage: 'This request queries Elasticsearch to fetch the data for the search.', - }), - }, - }) - .toPromise() - .then(({ rawResponse }) => onResults(rawResponse)) - .catch((error) => { - // If the request was aborted then no need to surface this error in the UI - if (error instanceof Error && error.name === 'AbortError') return; - - $scope.fetchStatus = fetchStatuses.NO_RESULTS; - $scope.fetchError = error; - data.search.showError(error); - }) - .finally(() => { - $scope.resultState = getResultState($scope.fetchStatus, $scope.rows); - $scope.$apply(); - }); - }; - - function onResults(resp) { - if (getTimeField() && !$scope.state.hideChart) { - const tabifiedData = tabifyAggResponse($scope.opts.chartAggConfigs, resp); - $scope.volatileSearchSource.rawResponse = resp; - const dimensions = getDimensions($scope.opts.chartAggConfigs, data); - if (dimensions) { - $scope.histogramData = discoverResponseHandler(tabifiedData, dimensions); - } - } - - $scope.hits = resp.hits.total; - $scope.rows = resp.hits.hits; - - $scope.fieldCounts = calcFieldCounts( - $scope.fieldCounts || {}, - resp.hits.hits, - $scope.indexPattern - ); - $scope.fetchStatus = fetchStatuses.COMPLETE; - } - - $scope.refreshAppState = async () => { - $scope.hits = []; - $scope.rows = []; - $scope.fieldCounts = {}; - await refetch$.next(); - }; - - $scope.resetQuery = function () { - history.push( - $route.current.params.id ? `/view/${encodeURIComponent($route.current.params.id)}` : '/' - ); - $route.reload(); - }; - - $scope.newQuery = function () { - history.push('/'); - }; - - $scope.unmappedFieldsConfig = { - showUnmappedFields, - }; - - // handler emitted by `timefilter.getAutoRefreshFetch$()` - // to notify when data completed loading and to start a new autorefresh loop - let autoRefreshDoneCb; - const fetch$ = merge( - refetch$, - filterManager.getFetches$(), - timefilter.getFetch$(), - timefilter.getAutoRefreshFetch$().pipe( - tap((done) => { - autoRefreshDoneCb = done; - }), - filter(() => $scope.fetchStatus !== fetchStatuses.LOADING) - ), - data.query.queryString.getUpdates$(), - searchSessionManager.newSearchSessionIdFromURL$ - ).pipe(debounceTime(100)); - - subscriptions.add( - subscribeWithScope( - $scope, - fetch$, - { - next: async () => { - try { - await $scope.fetch(); - } finally { - // if there is a saved `autoRefreshDoneCb`, notify auto refresh service that - // the last fetch is completed so it starts the next auto refresh loop if needed - autoRefreshDoneCb?.(); - autoRefreshDoneCb = undefined; - } - }, - }, - (error) => addFatalError(core.fatalErrors, error) - ) - ); - - // Propagate current app state to url, then start syncing and fetching - replaceUrlAppState().then(() => { - startStateSync(); - if (shouldSearchOnPageLoad()) { - refetch$.next(); - } + data.search.session.clear(); }); } diff --git a/src/plugins/discover/public/application/angular/discover_datagrid.html b/src/plugins/discover/public/application/angular/discover_datagrid.html index 42218568a838db..fa1181fd0d6cd6 100644 --- a/src/plugins/discover/public/application/angular/discover_datagrid.html +++ b/src/plugins/discover/public/application/angular/discover_datagrid.html @@ -1,31 +1,11 @@ diff --git a/src/plugins/discover/public/application/angular/discover_legacy.html b/src/plugins/discover/public/application/angular/discover_legacy.html index fa3656d1529d28..025a4490faf1f2 100644 --- a/src/plugins/discover/public/application/angular/discover_legacy.html +++ b/src/plugins/discover/public/application/angular/discover_legacy.html @@ -1,22 +1,7 @@ + > - \ No newline at end of file + diff --git a/src/plugins/discover/public/application/angular/doc_table/actions/columns.test.ts b/src/plugins/discover/public/application/angular/doc_table/actions/columns.test.ts index 43044d08f6ac06..e1aa96f4625de5 100644 --- a/src/plugins/discover/public/application/angular/doc_table/actions/columns.test.ts +++ b/src/plugins/discover/public/application/angular/doc_table/actions/columns.test.ts @@ -11,7 +11,7 @@ import { configMock } from '../../../../__mocks__/config'; import { indexPatternMock } from '../../../../__mocks__/index_pattern'; import { indexPatternsMock } from '../../../../__mocks__/index_patterns'; import { Capabilities } from '../../../../../../../core/types'; -import { AppState } from '../../discover_state'; +import { AppState } from '../../../apps/main/services/discover_state'; function getStateColumnAction(state: {}, setAppState: (state: Partial) => void) { return getStateColumnActions({ diff --git a/src/plugins/discover/public/application/angular/doc_table/actions/columns.ts b/src/plugins/discover/public/application/angular/doc_table/actions/columns.ts index 0907844aa1c54d..9ef5d45947afb0 100644 --- a/src/plugins/discover/public/application/angular/doc_table/actions/columns.ts +++ b/src/plugins/discover/public/application/angular/doc_table/actions/columns.ts @@ -11,7 +11,7 @@ import { IndexPattern, IndexPatternsContract } from '../../../../kibana_services import { AppState as DiscoverState, GetStateReturn as DiscoverGetStateReturn, -} from '../../discover_state'; +} from '../../../apps/main/services/discover_state'; import { AppState as ContextState, GetStateReturn as ContextGetStateReturn, diff --git a/src/plugins/discover/public/application/angular/doc_table/components/row_headers.test.js b/src/plugins/discover/public/application/angular/doc_table/components/row_headers.test.js index 270f366bddbf24..a087ac86971838 100644 --- a/src/plugins/discover/public/application/angular/doc_table/components/row_headers.test.js +++ b/src/plugins/discover/public/application/angular/doc_table/components/row_headers.test.js @@ -19,7 +19,7 @@ import { setScopedHistory, setServices, setDocViewsRegistry } from '../../../../ import { coreMock } from '../../../../../../../core/public/mocks'; import { dataPluginMock } from '../../../../../../data/public/mocks'; import { navigationPluginMock } from '../../../../../../navigation/public/mocks'; -import { getInnerAngularModule } from '../../../../get_inner_angular'; +import { getInnerAngularModule } from '../../get_inner_angular'; import { createBrowserHistory } from 'history'; const fakeRowVals = { diff --git a/src/plugins/discover/public/application/angular/doc_table/create_doc_table_react.tsx b/src/plugins/discover/public/application/angular/doc_table/create_doc_table_react.tsx index b8e8bf1fe7d6ce..681418c1bd7cfe 100644 --- a/src/plugins/discover/public/application/angular/doc_table/create_doc_table_react.tsx +++ b/src/plugins/discover/public/application/angular/doc_table/create_doc_table_react.tsx @@ -13,17 +13,17 @@ import type { estypes } from '@elastic/elasticsearch'; import { EuiButtonEmpty } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n/react'; import { getServices, IIndexPattern } from '../../../kibana_services'; -import { IndexPatternField } from '../../../../../data/common/index_patterns'; -import { SkipBottomButton } from '../../components/skip_bottom_button'; +import { IndexPatternField } from '../../../../../data/common'; +import { SkipBottomButton } from '../../apps/main/components/skip_bottom_button'; export interface DocTableLegacyProps { columns: string[]; searchDescription?: string; searchTitle?: string; onFilter: (field: IndexPatternField | string, value: string, type: '+' | '-') => void; - rows: estypes.Hit[]; + rows: estypes.SearchHit[]; indexPattern: IIndexPattern; - minimumVisibleRows: number; + minimumVisibleRows?: number; onAddColumn?: (column: string) => void; onBackToTop: () => void; onSort?: (sort: string[][]) => void; @@ -119,11 +119,9 @@ export function DocTableLegacy(renderProps: DocTableLegacyProps) { }, [setMinimumVisibleRows, renderProps.rows]); useEffect(() => { - if (minimumVisibleRows > 50) { - setMinimumVisibleRows(50); - } + setMinimumVisibleRows(50); setRows(renderProps.rows); - }, [renderProps.rows, minimumVisibleRows, setMinimumVisibleRows]); + }, [renderProps.rows, setMinimumVisibleRows]); useEffect(() => { if (ref && ref.current && !scope.current) { @@ -133,7 +131,7 @@ export function DocTableLegacy(renderProps: DocTableLegacyProps) { }); } else if (scope && scope.current) { scope.current.renderProps = { ...renderProps, rows, minimumVisibleRows }; - scope.current.$apply(); + scope.current.$applyAsync(); } }, [renderProps, minimumVisibleRows, rows]); diff --git a/src/plugins/discover/public/application/angular/doc_table/doc_table.test.js b/src/plugins/discover/public/application/angular/doc_table/doc_table.test.js index 1765bae07eed72..1db35ddf18089e 100644 --- a/src/plugins/discover/public/application/angular/doc_table/doc_table.test.js +++ b/src/plugins/discover/public/application/angular/doc_table/doc_table.test.js @@ -18,7 +18,7 @@ import { coreMock } from '../../../../../../core/public/mocks'; import { dataPluginMock } from '../../../../../data/public/mocks'; import { navigationPluginMock } from '../../../../../navigation/public/mocks'; import { setScopedHistory, setServices } from '../../../kibana_services'; -import { getInnerAngularModule } from '../../../get_inner_angular'; +import { getInnerAngularModule } from '../get_inner_angular'; let $parentScope; diff --git a/src/plugins/discover/public/get_inner_angular.ts b/src/plugins/discover/public/application/angular/get_inner_angular.ts similarity index 78% rename from src/plugins/discover/public/get_inner_angular.ts rename to src/plugins/discover/public/application/angular/get_inner_angular.ts index c36312a87ce9ad..26d64d5adc8a33 100644 --- a/src/plugins/discover/public/get_inner_angular.ts +++ b/src/plugins/discover/public/application/angular/get_inner_angular.ts @@ -9,29 +9,29 @@ // inner angular imports // these are necessary to bootstrap the local angular. // They can stay even after NP cutover -import './application/index.scss'; +import '../index.scss'; import angular from 'angular'; // required for `ngSanitize` angular module import 'angular-sanitize'; import { EuiIcon } from '@elastic/eui'; import { i18nDirective, i18nFilter, I18nProvider } from '@kbn/i18n/angular'; import { CoreStart, PluginInitializerContext } from 'kibana/public'; -import { DataPublicPluginStart } from '../../data/public'; -import { Storage } from '../../kibana_utils/public'; -import { NavigationPublicPluginStart as NavigationStart } from '../../navigation/public'; -import { createDocTableDirective } from './application/angular/doc_table'; -import { createTableHeaderDirective } from './application/angular/doc_table/components/table_header'; +import { DataPublicPluginStart } from '../../../../data/public'; +import { Storage } from '../../../../kibana_utils/public'; +import { NavigationPublicPluginStart as NavigationStart } from '../../../../navigation/public'; +import { createDocTableDirective } from './doc_table'; +import { createTableHeaderDirective } from './doc_table/components/table_header'; import { createToolBarPagerButtonsDirective, createToolBarPagerTextDirective, -} from './application/angular/doc_table/components/pager'; -import { createContextAppLegacy } from './application/components/context_app/context_app_legacy_directive'; -import { createTableRowDirective } from './application/angular/doc_table/components/table_row'; -import { createPagerFactory } from './application/angular/doc_table/lib/pager/pager_factory'; -import { createInfiniteScrollDirective } from './application/angular/doc_table/infinite_scroll'; -import { createDocViewerDirective } from './application/angular/doc_viewer'; -import { createDiscoverGridDirective } from './application/components/create_discover_grid_directive'; -import { createRenderCompleteDirective } from './application/angular/directives/render_complete'; +} from './doc_table/components/pager'; +import { createContextAppLegacy } from '../components/context_app/context_app_legacy_directive'; +import { createTableRowDirective } from './doc_table/components/table_row'; +import { createPagerFactory } from './doc_table/lib/pager/pager_factory'; +import { createInfiniteScrollDirective } from './doc_table/infinite_scroll'; +import { createDocViewerDirective } from './doc_viewer'; +import { createDiscoverGridDirective } from './create_discover_grid_directive'; +import { createRenderCompleteDirective } from './directives/render_complete'; import { initAngularBootstrap, configureAppAngularModule, @@ -39,10 +39,10 @@ import { PromiseServiceCreator, registerListenEventListener, watchMultiDecorator, -} from '../../kibana_legacy/public'; -import { DiscoverStartPlugins } from './plugin'; -import { getScopedHistory } from './kibana_services'; -import { createDiscoverDirective } from './application/components/create_discover_directive'; +} from '../../../../kibana_legacy/public'; +import { DiscoverStartPlugins } from '../../plugin'; +import { getScopedHistory } from '../../kibana_services'; +import { createDiscoverDirective } from './create_discover_directive'; /** * returns the main inner angular module, it contains all the parts of Angular Discover diff --git a/src/plugins/discover/public/application/angular/helpers/index.ts b/src/plugins/discover/public/application/angular/helpers/index.ts index 1dd194436cdfb0..3d2c0b1c63b332 100644 --- a/src/plugins/discover/public/application/angular/helpers/index.ts +++ b/src/plugins/discover/public/application/angular/helpers/index.ts @@ -6,6 +6,5 @@ * Side Public License, v 1. */ -export { buildPointSeriesData } from './point_series'; export { formatRow, formatTopLevelObject } from './row_formatter'; export { handleSourceColumnState } from './state_helpers'; diff --git a/src/plugins/discover/public/application/angular/index.ts b/src/plugins/discover/public/application/angular/index.ts index b45357439a1eeb..e75add7910b745 100644 --- a/src/plugins/discover/public/application/angular/index.ts +++ b/src/plugins/discover/public/application/angular/index.ts @@ -16,4 +16,3 @@ import './doc'; import './context'; import './doc_viewer'; import './redirect'; -import './directives'; diff --git a/src/plugins/discover/public/application/angular/response_handler.js b/src/plugins/discover/public/application/angular/response_handler.js deleted file mode 100644 index 301fd98f1e34c2..00000000000000 --- a/src/plugins/discover/public/application/angular/response_handler.js +++ /dev/null @@ -1,109 +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 { getServices } from '../../kibana_services'; -import { buildPointSeriesData } from './helpers'; - -function tableResponseHandler(table, dimensions) { - const converted = { tables: [] }; - const split = dimensions.splitColumn || dimensions.splitRow; - - if (split) { - converted.direction = dimensions.splitRow ? 'row' : 'column'; - const splitColumnIndex = split[0].accessor; - const splitColumnFormatter = getServices().data.fieldFormats.deserialize(split[0].format); - const splitColumn = table.columns[splitColumnIndex]; - const splitMap = {}; - let splitIndex = 0; - - table.rows.forEach((row, rowIndex) => { - const splitValue = row[splitColumn.id]; - - if (!splitMap.hasOwnProperty(splitValue)) { - splitMap[splitValue] = splitIndex++; - const tableGroup = { - $parent: converted, - title: `${splitColumnFormatter.convert(splitValue)}: ${splitColumn.name}`, - name: splitColumn.name, - key: splitValue, - column: splitColumnIndex, - row: rowIndex, - table, - tables: [], - }; - tableGroup.tables.push({ - $parent: tableGroup, - columns: table.columns, - rows: [], - }); - - converted.tables.push(tableGroup); - } - - const tableIndex = splitMap[splitValue]; - converted.tables[tableIndex].tables[0].rows.push(row); - }); - } else { - converted.tables.push({ - columns: table.columns, - rows: table.rows, - }); - } - - return converted; -} - -function convertTableGroup(tableGroup, convertTable) { - const tables = tableGroup.tables; - - if (!tables.length) return; - - const firstChild = tables[0]; - if (firstChild.columns) { - const chart = convertTable(firstChild); - // if chart is within a split, assign group title to its label - if (tableGroup.$parent) { - chart.label = tableGroup.title; - } - return chart; - } - - const out = {}; - let outList; - - tables.forEach(function (table) { - if (!outList) { - const direction = tableGroup.direction === 'row' ? 'rows' : 'columns'; - outList = out[direction] = []; - } - - let output; - if ((output = convertTableGroup(table, convertTable))) { - outList.push(output); - } - }); - - return out; -} - -export const discoverResponseHandler = (response, dimensions) => { - const tableGroup = tableResponseHandler(response, dimensions); - - let converted = convertTableGroup(tableGroup, (table) => { - return buildPointSeriesData(table, dimensions); - }); - if (!converted) { - // mimic a row of tables that doesn't have any tables - // https://github.com/elastic/kibana/blob/7bfb68cd24ed42b1b257682f93c50cd8d73e2520/src/kibana/components/vislib/components/zero_injection/inject_zeros.js#L32 - converted = { rows: [] }; - } - - converted.hits = response.rows.length; - - return converted; -}; diff --git a/src/plugins/discover/public/application/apps/main/components/chart/discover_chart.tsx b/src/plugins/discover/public/application/apps/main/components/chart/discover_chart.tsx new file mode 100644 index 00000000000000..210313aac53662 --- /dev/null +++ b/src/plugins/discover/public/application/apps/main/components/chart/discover_chart.tsx @@ -0,0 +1,145 @@ +/* + * 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 React, { useCallback } from 'react'; +import moment from 'moment'; +import { EuiFlexGroup, EuiFlexItem, EuiButtonEmpty, EuiSpacer } from '@elastic/eui'; +import { IUiSettingsClient } from 'kibana/public'; +import { i18n } from '@kbn/i18n'; +import { HitsCounter } from '../hits_counter'; +import { DataPublicPluginStart, IndexPattern, search } from '../../../../../../../data/public'; +import { TimechartHeader } from '../timechart_header'; +import { SavedSearch } from '../../../../../saved_searches'; +import { AppState, GetStateReturn } from '../../services/discover_state'; +import { TimechartBucketInterval } from '../timechart_header/timechart_header'; +import { Chart as IChart } from './point_series'; +import { DiscoverHistogram } from './histogram'; + +const TimechartHeaderMemoized = React.memo(TimechartHeader); +const DiscoverHistogramMemoized = React.memo(DiscoverHistogram); +export function DiscoverChart({ + config, + data, + bucketInterval, + chartData, + hits, + isLegacy, + resetQuery, + savedSearch, + state, + stateContainer, + timefield, +}: { + config: IUiSettingsClient; + data: DataPublicPluginStart; + bucketInterval?: TimechartBucketInterval; + chartData?: IChart; + hits?: number; + indexPattern: IndexPattern; + isLegacy: boolean; + resetQuery: () => void; + savedSearch: SavedSearch; + state: AppState; + stateContainer: GetStateReturn; + timefield?: string; +}) { + const toggleHideChart = useCallback(() => { + stateContainer.setAppState({ hideChart: !state.hideChart }); + }, [state, stateContainer]); + + const onChangeInterval = useCallback( + (interval: string) => { + if (interval) { + stateContainer.setAppState({ interval }); + } + }, + [stateContainer] + ); + + const timefilterUpdateHandler = useCallback( + (ranges: { from: number; to: number }) => { + data.query.timefilter.timefilter.setTime({ + from: moment(ranges.from).toISOString(), + to: moment(ranges.to).toISOString(), + mode: 'absolute', + }); + }, + [data] + ); + + return ( + + + + + + + {!state.hideChart && ( + + + + )} + {timefield && ( + + { + toggleHideChart(); + }} + data-test-subj="discoverChartToggle" + > + {!state.hideChart + ? i18n.translate('discover.hideChart', { + defaultMessage: 'Hide chart', + }) + : i18n.translate('discover.showChart', { + defaultMessage: 'Show chart', + })} + + + )} + + + {!state.hideChart && chartData && ( + +
+
+ +
+
+ +
+ )} +
+ ); +} diff --git a/src/plugins/discover/public/application/angular/directives/histogram.tsx b/src/plugins/discover/public/application/apps/main/components/chart/histogram.tsx similarity index 97% rename from src/plugins/discover/public/application/angular/directives/histogram.tsx rename to src/plugins/discover/public/application/apps/main/components/chart/histogram.tsx index 616a0692dbba42..92b212d5739b52 100644 --- a/src/plugins/discover/public/application/angular/directives/histogram.tsx +++ b/src/plugins/discover/public/application/apps/main/components/chart/histogram.tsx @@ -27,14 +27,14 @@ import { import { IUiSettingsClient } from 'kibana/public'; import { EuiChartThemeType } from '@elastic/eui/dist/eui_charts_theme'; import { Subscription, combineLatest } from 'rxjs'; -import { getServices } from '../../../kibana_services'; -import { Chart as IChart } from '../helpers/point_series'; +import { getServices } from '../../../../../kibana_services'; +import { Chart as IChart } from './point_series'; import { CurrentTime, Endzones, getAdjustedInterval, renderEndzoneTooltip, -} from '../../../../../charts/public'; +} from '../../../../../../../charts/public'; export interface DiscoverHistogramProps { chartData: IChart; diff --git a/src/plugins/discover/public/application/angular/directives/debounce/index.js b/src/plugins/discover/public/application/apps/main/components/chart/index.ts similarity index 85% rename from src/plugins/discover/public/application/angular/directives/debounce/index.js rename to src/plugins/discover/public/application/apps/main/components/chart/index.ts index 774876af70d4c6..d5d5a85d1d0f2c 100644 --- a/src/plugins/discover/public/application/angular/directives/debounce/index.js +++ b/src/plugins/discover/public/application/apps/main/components/chart/index.ts @@ -6,4 +6,4 @@ * Side Public License, v 1. */ -export { createDebounceProviderTimeout } from './debounce'; +export { DiscoverChart } from './discover_chart'; diff --git a/src/plugins/discover/public/application/angular/helpers/point_series.ts b/src/plugins/discover/public/application/apps/main/components/chart/point_series.ts similarity index 90% rename from src/plugins/discover/public/application/angular/helpers/point_series.ts rename to src/plugins/discover/public/application/apps/main/components/chart/point_series.ts index dae70d9b8e55ba..1245b712e6fd7b 100644 --- a/src/plugins/discover/public/application/angular/helpers/point_series.ts +++ b/src/plugins/discover/public/application/apps/main/components/chart/point_series.ts @@ -9,8 +9,7 @@ import { uniq } from 'lodash'; import { Duration, Moment } from 'moment'; import { Unit } from '@elastic/datemath'; - -import { SerializedFieldFormat } from '../../../../../expressions/common/types'; +import { SerializedFieldFormat } from '../../../../../../../expressions/common'; export interface Column { id: string; @@ -26,20 +25,23 @@ export interface Table { rows: Row[]; } +export interface HistogramParamsBounds { + min: Moment; + max: Moment; +} + interface HistogramParams { date: true; interval: Duration; intervalESValue: number; intervalESUnit: Unit; format: string; - bounds: { - min: Moment; - max: Moment; - }; + bounds: HistogramParamsBounds; } export interface Dimension { accessor: 0 | 1; format: SerializedFieldFormat<{ pattern: string }>; + label: string; } export interface Dimensions { @@ -68,7 +70,7 @@ export interface Chart { ordered: Ordered; } -export const buildPointSeriesData = (table: Table, dimensions: Dimensions) => { +export const buildPointSeriesData = (table: Table, dimensions: Dimensions): Chart => { const { x, y } = dimensions; const xAccessor = table.columns[x.accessor].id; const yAccessor = table.columns[y.accessor].id; diff --git a/src/plugins/discover/public/application/components/hits_counter/hits_counter.scss b/src/plugins/discover/public/application/apps/main/components/hits_counter/hits_counter.scss similarity index 100% rename from src/plugins/discover/public/application/components/hits_counter/hits_counter.scss rename to src/plugins/discover/public/application/apps/main/components/hits_counter/hits_counter.scss diff --git a/src/plugins/discover/public/application/components/hits_counter/hits_counter.test.tsx b/src/plugins/discover/public/application/apps/main/components/hits_counter/hits_counter.test.tsx similarity index 100% rename from src/plugins/discover/public/application/components/hits_counter/hits_counter.test.tsx rename to src/plugins/discover/public/application/apps/main/components/hits_counter/hits_counter.test.tsx diff --git a/src/plugins/discover/public/application/components/hits_counter/hits_counter.tsx b/src/plugins/discover/public/application/apps/main/components/hits_counter/hits_counter.tsx similarity index 94% rename from src/plugins/discover/public/application/components/hits_counter/hits_counter.tsx rename to src/plugins/discover/public/application/apps/main/components/hits_counter/hits_counter.tsx index 6ce6129f56b5e9..0850a8ff03d967 100644 --- a/src/plugins/discover/public/application/components/hits_counter/hits_counter.tsx +++ b/src/plugins/discover/public/application/apps/main/components/hits_counter/hits_counter.tsx @@ -12,13 +12,13 @@ import React from 'react'; import { EuiButtonEmpty, EuiFlexGroup, EuiFlexItem, EuiText } from '@elastic/eui'; import { FormattedMessage, I18nProvider } from '@kbn/i18n/react'; import { i18n } from '@kbn/i18n'; -import { formatNumWithCommas } from '../../helpers'; +import { formatNumWithCommas } from '../../../../helpers'; export interface HitsCounterProps { /** * the number of query hits */ - hits: number; + hits?: number; /** * displays the reset button */ @@ -30,6 +30,9 @@ export interface HitsCounterProps { } export function HitsCounter({ hits, showResetButton, onResetQuery }: HitsCounterProps) { + if (typeof hits === 'undefined') { + return null; + } return ( { + return { from: '2020-05-14T11:05:13.590', to: '2020-05-14T11:20:13.590' }; + }; + + const indexPatternList = ([indexPattern].map((ip) => { + return { ...ip, ...{ attributes: { title: ip.title } } }; + }) as unknown) as Array>; + + const savedSearch$ = new BehaviorSubject({ + state: FetchStatus.COMPLETE, + rows: esHits, + fetchCounter: 1, + fieldCounts: {}, + hits: Number(esHits.length), + }) as SavedSearchDataSubject; + + return { + indexPattern, + indexPatternList, + navigateTo: jest.fn(), + resetQuery: jest.fn(), + savedSearch: savedSearchMock, + savedSearchData$: savedSearch$, + savedSearchRefetch$: new Subject(), + searchSessionManager: {} as DiscoverSearchSessionManager, + searchSource: searchSourceMock, + services, + state: { columns: [] }, + stateContainer: {} as GetStateReturn, + }; +} + +describe('Discover component', () => { + test('selected index pattern without time field displays no chart toggle', () => { + const component = mountWithIntl(); + expect(component.find('[data-test-subj="discoverChartToggle"]').exists()).toBeFalsy(); + }); + test('selected index pattern with time field displays chart toggle', () => { + const component = mountWithIntl( + + ); + expect(component.find('[data-test-subj="discoverChartToggle"]').exists()).toBeTruthy(); + }); +}); diff --git a/src/plugins/discover/public/application/components/discover.tsx b/src/plugins/discover/public/application/apps/main/components/layout/discover_layout.tsx similarity index 52% rename from src/plugins/discover/public/application/components/discover.tsx rename to src/plugins/discover/public/application/apps/main/components/layout/discover_layout.tsx index f962c56cc4690c..ce987e2870466b 100644 --- a/src/plugins/discover/public/application/components/discover.tsx +++ b/src/plugins/discover/public/application/apps/main/components/layout/discover_layout.tsx @@ -5,10 +5,10 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ -import './discover.scss'; +import './discover_layout.scss'; import React, { useState, useRef, useMemo, useCallback, useEffect } from 'react'; import { - EuiButtonEmpty, + EuiSpacer, EuiButtonIcon, EuiFlexGroup, EuiFlexItem, @@ -17,99 +17,141 @@ import { EuiPage, EuiPageBody, EuiPageContent, - EuiSpacer, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import moment from 'moment'; import { METRIC_TYPE } from '@kbn/analytics'; import { FormattedMessage, I18nProvider } from '@kbn/i18n/react'; import classNames from 'classnames'; -import { HitsCounter } from './hits_counter'; -import { TimechartHeader } from './timechart_header'; -import { DiscoverHistogram, DiscoverUninitialized } from '../angular/directives'; -import { DiscoverNoResults } from './no_results'; -import { LoadingSpinner } from './loading_spinner/loading_spinner'; -import { DocTableLegacy } from '../angular/doc_table/create_doc_table_react'; -import { esFilters, IndexPatternField, search } from '../../../../data/public'; -import { DiscoverSidebarResponsive } from './sidebar'; -import { DiscoverProps } from './types'; -import { SortPairArr } from '../angular/doc_table/lib/get_sort'; +import { DiscoverNoResults } from '../no_results'; +import { LoadingSpinner } from '../loading_spinner/loading_spinner'; +import { DocTableLegacy } from '../../../../angular/doc_table/create_doc_table_react'; +import { + esFilters, + IndexPatternField, + indexPatterns as indexPatternsUtils, +} from '../../../../../../../data/public'; +import { DiscoverSidebarResponsive } from '../sidebar'; +import { DiscoverLayoutProps } from './types'; +import { SortPairArr } from '../../../../angular/doc_table/lib/get_sort'; import { DOC_HIDE_TIME_COLUMN_SETTING, DOC_TABLE_LEGACY, + MODIFY_COLUMNS_ON_SWITCH, + SAMPLE_SIZE_SETTING, SEARCH_FIELDS_FROM_SOURCE, -} from '../../../common'; -import { popularizeField } from '../helpers/popularize_field'; -import { DocViewFilterFn } from '../doc_views/doc_views_types'; -import { DiscoverGrid } from './discover_grid/discover_grid'; -import { DiscoverTopNav } from './discover_topnav'; -import { ElasticSearchHit } from '../doc_views/doc_views_types'; -import { setBreadcrumbsTitle } from '../helpers/breadcrumbs'; -import { addHelpMenuToAppChrome } from './help_menu/help_menu_util'; -import { InspectorSession } from '../../../../inspector/public'; -import { useDataGridColumns } from '../helpers/use_data_grid_columns'; + SORT_DEFAULT_ORDER_SETTING, +} from '../../../../../../common'; +import { popularizeField } from '../../../../helpers/popularize_field'; +import { DocViewFilterFn } from '../../../../doc_views/doc_views_types'; +import { DiscoverGrid } from '../../../../components/discover_grid/discover_grid'; +import { DiscoverTopNav } from '../top_nav/discover_topnav'; +import { ElasticSearchHit } from '../../../../doc_views/doc_views_types'; +import { DiscoverChart } from '../chart'; +import { getResultState } from '../../utils/get_result_state'; +import { InspectorSession } from '../../../../../../../inspector/public'; +import { DiscoverUninitialized } from '../uninitialized/uninitialized'; +import { SavedSearchDataMessage } from '../../services/use_saved_search'; +import { useDataGridColumns } from '../../../../helpers/use_data_grid_columns'; +import { getSwitchIndexPatternAppState } from '../../utils/get_switch_index_pattern_app_state'; +import { FetchStatus } from '../../../../types'; const DocTableLegacyMemoized = React.memo(DocTableLegacy); const SidebarMemoized = React.memo(DiscoverSidebarResponsive); const DataGridMemoized = React.memo(DiscoverGrid); const TopNavMemoized = React.memo(DiscoverTopNav); -const TimechartHeaderMemoized = React.memo(TimechartHeader); -const DiscoverHistogramMemoized = React.memo(DiscoverHistogram); +const DiscoverChartMemoized = React.memo(DiscoverChart); -export function Discover({ - fetch, - fetchCounter, - fetchError, - fieldCounts, - fetchStatus, - histogramData, - hits, +interface DiscoverLayoutFetchState extends SavedSearchDataMessage { + state: FetchStatus; + fetchCounter: number; + fieldCounts: Record; + rows: ElasticSearchHit[]; +} + +export function DiscoverLayout({ indexPattern, - minimumVisibleRows, - opts, + indexPatternList, + navigateTo, + savedSearchRefetch$, resetQuery, - resultState, - rows, + savedSearchData$, + savedSearch, + searchSessionManager, searchSource, + services, state, - unmappedFieldsConfig, - refreshAppState, -}: DiscoverProps) { + stateContainer, +}: DiscoverLayoutProps) { + const { + trackUiMetric, + capabilities, + indexPatterns, + data, + uiSettings: config, + filterManager, + } = services; + + const sampleSize = useMemo(() => config.get(SAMPLE_SIZE_SETTING), [config]); const [expandedDoc, setExpandedDoc] = useState(undefined); const [inspectorSession, setInspectorSession] = useState(undefined); const scrollableDesktop = useRef(null); const collapseIcon = useRef(null); + + const [fetchState, setFetchState] = useState({ + state: savedSearchData$.getValue().state, + fetchCounter: 0, + fieldCounts: {}, + rows: [], + }); + const { state: fetchStatus, fetchCounter, inspectorAdapters, rows } = fetchState; + + useEffect(() => { + const subscription = savedSearchData$.subscribe((next) => { + if ( + (next.state && next.state !== fetchState.state) || + (next.fetchCounter && next.fetchCounter !== fetchState.fetchCounter) || + (next.rows && next.rows !== fetchState.rows) || + (next.chartData && next.chartData !== fetchState.chartData) + ) { + setFetchState({ ...fetchState, ...next }); + } + }); + return () => { + subscription.unsubscribe(); + }; + }, [savedSearchData$, fetchState]); + const isMobile = () => { // collapse icon isn't displayed in mobile view, use it to detect which view is displayed return collapseIcon && !collapseIcon.current; }; - const toggleHideChart = useCallback(() => { - const newState = { ...state, hideChart: !state.hideChart }; - opts.stateContainer.setAppState(newState); - }, [state, opts]); - const hideChart = useMemo(() => state.hideChart, [state]); - const { savedSearch, indexPatternList, config, services, data, setAppState } = opts; - const { trackUiMetric, capabilities, indexPatterns, chrome, docLinks } = services; + const timeField = useMemo(() => { + return indexPatternsUtils.isDefault(indexPattern) ? indexPattern.timeFieldName : undefined; + }, [indexPattern]); const [isSidebarClosed, setIsSidebarClosed] = useState(false); - const bucketInterval = useMemo(() => { - const bucketAggConfig = opts.chartAggConfigs?.aggs[1]; - return bucketAggConfig && search.aggs.isDateHistogramBucketAggConfig(bucketAggConfig) - ? bucketAggConfig.buckets?.getInterval() - : undefined; - }, [opts.chartAggConfigs]); + const isLegacy = useMemo(() => services.uiSettings.get(DOC_TABLE_LEGACY), [services]); + const useNewFieldsApi = useMemo(() => !services.uiSettings.get(SEARCH_FIELDS_FROM_SOURCE), [ + services, + ]); + + const unmappedFieldsConfig = useMemo( + () => ({ + showUnmappedFields: useNewFieldsApi, + }), + [useNewFieldsApi] + ); + + const resultState = useMemo(() => getResultState(fetchStatus, rows!), [fetchStatus, rows]); - const contentCentered = resultState === 'uninitialized'; - const isLegacy = services.uiSettings.get(DOC_TABLE_LEGACY); - const useNewFieldsApi = !services.uiSettings.get(SEARCH_FIELDS_FROM_SOURCE); const updateQuery = useCallback( (_payload, isUpdate?: boolean) => { if (isUpdate === false) { - opts.searchSessionManager.removeSearchSessionIdFromURL({ replace: false }); - opts.refetch$.next(); + searchSessionManager.removeSearchSessionIdFromURL({ replace: false }); + savedSearchRefetch$.next(); } }, - [opts] + [savedSearchRefetch$, searchSessionManager] ); const { columns, onAddColumn, onRemoveColumn, onMoveColumn, onSetColumns } = useDataGridColumns({ @@ -117,27 +159,21 @@ export function Discover({ config, indexPattern, indexPatterns, - setAppState, + setAppState: stateContainer.setAppState, state, useNewFieldsApi, }); - useEffect(() => { - const pageTitleSuffix = savedSearch.id && savedSearch.title ? `: ${savedSearch.title}` : ''; - chrome.docTitle.change(`Discover${pageTitleSuffix}`); - - setBreadcrumbsTitle(savedSearch, chrome); - addHelpMenuToAppChrome(chrome, docLinks); - }, [savedSearch, chrome, docLinks]); - const onOpenInspector = useCallback(() => { // prevent overlapping - setExpandedDoc(undefined); - const session = services.inspector.open(opts.inspectorAdapters, { - title: savedSearch.title, - }); - setInspectorSession(session); - }, [setExpandedDoc, opts.inspectorAdapters, savedSearch, services.inspector]); + if (inspectorAdapters) { + setExpandedDoc(undefined); + const session = services.inspector.open(inspectorAdapters, { + title: savedSearch.title, + }); + setInspectorSession(session); + } + }, [setExpandedDoc, inspectorAdapters, savedSearch, services.inspector]); useEffect(() => { return () => { @@ -150,9 +186,9 @@ export function Discover({ const onSort = useCallback( (sort: string[][]) => { - setAppState({ sort }); + stateContainer.setAppState({ sort }); }, - [setAppState] + [stateContainer] ); const onAddFilter = useCallback( @@ -160,7 +196,7 @@ export function Discover({ const fieldName = typeof field === 'string' ? field : field.name; popularizeField(indexPattern, fieldName, indexPatterns); const newFilters = esFilters.generateFilters( - opts.filterManager, + filterManager, field, values, operation, @@ -169,31 +205,13 @@ export function Discover({ if (trackUiMetric) { trackUiMetric(METRIC_TYPE.CLICK, 'filter_added'); } - return opts.filterManager.addFilters(newFilters); - }, - [opts, indexPattern, indexPatterns, trackUiMetric] - ); - - const onChangeInterval = useCallback( - (interval: string) => { - if (interval) { - setAppState({ interval }); - } - }, - [setAppState] - ); - - const timefilterUpdateHandler = useCallback( - (ranges: { from: number; to: number }) => { - data.query.timefilter.timefilter.setTime({ - from: moment(ranges.from).toISOString(), - to: moment(ranges.to).toISOString(), - mode: 'absolute', - }); + return filterManager.addFilters(newFilters); }, - [data] + [filterManager, indexPattern, indexPatterns, trackUiMetric] ); - + /** + * Legacy function, remove once legacy grid is removed + */ const onBackToTop = useCallback(() => { if (scrollableDesktop && scrollableDesktop.current) { scrollableDesktop.current.focus(); @@ -214,28 +232,69 @@ export function Discover({ width: colSettings.width, }; const newGrid = { ...grid, columns: newColumns }; - opts.setAppState({ grid: newGrid }); + stateContainer.setAppState({ grid: newGrid }); }, - [opts, state] + [stateContainer, state] ); - const onEditRuntimeField = () => { - if (refreshAppState) { - refreshAppState(); - } - }; + const onEditRuntimeField = useCallback(() => { + savedSearchRefetch$.next('reset'); + }, [savedSearchRefetch$]); + + const contentCentered = resultState === 'uninitialized'; + const showTimeCol = useMemo( + () => !config.get(DOC_HIDE_TIME_COLUMN_SETTING, false) && !!indexPattern.timeFieldName, + [config, indexPattern.timeFieldName] + ); + + const onChangeIndexPattern = useCallback( + async (id: string) => { + const nextIndexPattern = await indexPatterns.get(id); + if (nextIndexPattern && indexPattern) { + /** + * Without resetting the fetch state, e.g. a time column would be displayed when switching + * from a index pattern without to a index pattern with time filter for a brief moment + * That's because appState is updated before savedSearchData$ + * The following line of code catches this, but should be improved + */ + savedSearchData$.next({ rows: [], state: FetchStatus.LOADING, fieldCounts: {} }); + + const nextAppState = getSwitchIndexPatternAppState( + indexPattern, + nextIndexPattern, + state.columns || [], + (state.sort || []) as SortPairArr[], + config.get(MODIFY_COLUMNS_ON_SWITCH), + config.get(SORT_DEFAULT_ORDER_SETTING) + ); + stateContainer.setAppState(nextAppState); + } + }, + [ + config, + indexPattern, + indexPatterns, + savedSearchData$, + state.columns, + state.sort, + stateContainer, + ] + ); return (

@@ -244,18 +303,16 @@ export function Discover({ {resultState === 'none' && ( )} - {resultState === 'uninitialized' && } + {resultState === 'uninitialized' && ( + savedSearchRefetch$.next()} /> + )} {resultState === 'loading' && } {resultState === 'ready' && ( - - - - 0 ? hits : 0} - showResetButton={!!(savedSearch && savedSearch.id)} - onResetQuery={resetQuery} - /> - - {!hideChart && ( - - - - )} - {opts.timefield && ( - - { - toggleHideChart(); - }} - data-test-subj="discoverChartToggle" - > - {!hideChart - ? i18n.translate('discover.hideChart', { - defaultMessage: 'Hide chart', - }) - : i18n.translate('discover.showChart', { - defaultMessage: 'Show chart', - })} - - - )} - + + - {!hideChart && opts.timefield && ( - -
- {opts.chartAggConfigs && histogramData && rows.length !== 0 && ( -
- -
- )} -
- -
- )} - @@ -403,18 +405,17 @@ export function Discover({ )} @@ -428,18 +429,15 @@ export function Discover({ isLoading={fetchStatus === 'loading'} rows={rows} sort={(state.sort as SortPairArr[]) || []} - sampleSize={opts.sampleSize} - searchDescription={opts.savedSearch.description} - searchTitle={opts.savedSearch.lastSavedTitle} + sampleSize={sampleSize} + searchDescription={savedSearch.description} + searchTitle={savedSearch.lastSavedTitle} setExpandedDoc={setExpandedDoc} - showTimeCol={ - !config.get(DOC_HIDE_TIME_COLUMN_SETTING, false) && - !!indexPattern.timeFieldName - } + showTimeCol={showTimeCol} services={services} settings={state.grid} - onFilter={onAddFilter as DocViewFilterFn} onAddColumn={onAddColumn} + onFilter={onAddFilter as DocViewFilterFn} onRemoveColumn={onRemoveColumn} onSetColumns={onSetColumns} onSort={onSort} diff --git a/src/plugins/discover/public/application/angular/directives/index.ts b/src/plugins/discover/public/application/apps/main/components/layout/index.ts similarity index 77% rename from src/plugins/discover/public/application/angular/directives/index.ts rename to src/plugins/discover/public/application/apps/main/components/layout/index.ts index 4478d8bb319793..592e893cf8ba84 100644 --- a/src/plugins/discover/public/application/angular/directives/index.ts +++ b/src/plugins/discover/public/application/apps/main/components/layout/index.ts @@ -6,5 +6,4 @@ * Side Public License, v 1. */ -export { DiscoverUninitialized } from './uninitialized'; -export { DiscoverHistogram } from './histogram'; +export { DiscoverLayout } from './discover_layout'; diff --git a/src/plugins/discover/public/application/apps/main/components/layout/types.ts b/src/plugins/discover/public/application/apps/main/components/layout/types.ts new file mode 100644 index 00000000000000..d8d6338fbe41a3 --- /dev/null +++ b/src/plugins/discover/public/application/apps/main/components/layout/types.ts @@ -0,0 +1,34 @@ +/* + * 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 { + IndexPattern, + IndexPatternAttributes, + SavedObject, +} from '../../../../../../../data/common'; +import { ISearchSource } from '../../../../../../../data/public'; +import { DiscoverSearchSessionManager } from '../../services/discover_search_session'; +import { AppState, GetStateReturn } from '../../services/discover_state'; +import { SavedSearchRefetchSubject, SavedSearchDataSubject } from '../../services/use_saved_search'; +import { DiscoverServices } from '../../../../../build_services'; +import { SavedSearch } from '../../../../../saved_searches'; + +export interface DiscoverLayoutProps { + indexPattern: IndexPattern; + indexPatternList: Array>; + resetQuery: () => void; + navigateTo: (url: string) => void; + savedSearch: SavedSearch; + savedSearchData$: SavedSearchDataSubject; + savedSearchRefetch$: SavedSearchRefetchSubject; + searchSessionManager: DiscoverSearchSessionManager; + searchSource: ISearchSource; + services: DiscoverServices; + state: AppState; + stateContainer: GetStateReturn; +} diff --git a/src/plugins/discover/public/application/components/loading_spinner/loading_spinner.scss b/src/plugins/discover/public/application/apps/main/components/loading_spinner/loading_spinner.scss similarity index 100% rename from src/plugins/discover/public/application/components/loading_spinner/loading_spinner.scss rename to src/plugins/discover/public/application/apps/main/components/loading_spinner/loading_spinner.scss diff --git a/src/plugins/discover/public/application/components/loading_spinner/loading_spinner.test.tsx b/src/plugins/discover/public/application/apps/main/components/loading_spinner/loading_spinner.test.tsx similarity index 100% rename from src/plugins/discover/public/application/components/loading_spinner/loading_spinner.test.tsx rename to src/plugins/discover/public/application/apps/main/components/loading_spinner/loading_spinner.test.tsx diff --git a/src/plugins/discover/public/application/components/loading_spinner/loading_spinner.tsx b/src/plugins/discover/public/application/apps/main/components/loading_spinner/loading_spinner.tsx similarity index 100% rename from src/plugins/discover/public/application/components/loading_spinner/loading_spinner.tsx rename to src/plugins/discover/public/application/apps/main/components/loading_spinner/loading_spinner.tsx diff --git a/src/plugins/discover/public/application/components/no_results/_no_results.scss b/src/plugins/discover/public/application/apps/main/components/no_results/_no_results.scss similarity index 100% rename from src/plugins/discover/public/application/components/no_results/_no_results.scss rename to src/plugins/discover/public/application/apps/main/components/no_results/_no_results.scss diff --git a/src/plugins/discover/public/application/components/no_results/index.ts b/src/plugins/discover/public/application/apps/main/components/no_results/index.ts similarity index 100% rename from src/plugins/discover/public/application/components/no_results/index.ts rename to src/plugins/discover/public/application/apps/main/components/no_results/index.ts diff --git a/src/plugins/discover/public/application/components/no_results/no_results.test.tsx b/src/plugins/discover/public/application/apps/main/components/no_results/no_results.test.tsx similarity index 98% rename from src/plugins/discover/public/application/components/no_results/no_results.test.tsx rename to src/plugins/discover/public/application/apps/main/components/no_results/no_results.test.tsx index 9a115fb5a66b62..e7af82cf9504c7 100644 --- a/src/plugins/discover/public/application/components/no_results/no_results.test.tsx +++ b/src/plugins/discover/public/application/apps/main/components/no_results/no_results.test.tsx @@ -12,7 +12,7 @@ import { findTestSubject } from '@elastic/eui/lib/test'; import { DiscoverNoResults, DiscoverNoResultsProps } from './no_results'; -jest.mock('../../../kibana_services', () => { +jest.mock('../../../../../kibana_services', () => { return { getServices: () => ({ docLinks: { diff --git a/src/plugins/discover/public/application/components/no_results/no_results.tsx b/src/plugins/discover/public/application/apps/main/components/no_results/no_results.tsx similarity index 94% rename from src/plugins/discover/public/application/components/no_results/no_results.tsx rename to src/plugins/discover/public/application/apps/main/components/no_results/no_results.tsx index c23de80ec99373..07deb45d1fda24 100644 --- a/src/plugins/discover/public/application/components/no_results/no_results.tsx +++ b/src/plugins/discover/public/application/apps/main/components/no_results/no_results.tsx @@ -9,8 +9,8 @@ import React, { Fragment } from 'react'; import { FormattedMessage } from '@kbn/i18n/react'; import { EuiButton, EuiCallOut, EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; -import { getServices } from '../../../kibana_services'; -import { DataPublicPluginStart } from '../../../../../data/public'; +import { getServices } from '../../../../../kibana_services'; +import { DataPublicPluginStart } from '../../../../../../../data/public'; import { getLuceneQueryMessage, getTimeFieldMessage } from './no_results_helper'; import './_no_results.scss'; diff --git a/src/plugins/discover/public/application/components/no_results/no_results_helper.tsx b/src/plugins/discover/public/application/apps/main/components/no_results/no_results_helper.tsx similarity index 100% rename from src/plugins/discover/public/application/components/no_results/no_results_helper.tsx rename to src/plugins/discover/public/application/apps/main/components/no_results/no_results_helper.tsx diff --git a/src/plugins/discover/public/application/components/sidebar/__snapshots__/discover_field_details_footer.test.tsx.snap b/src/plugins/discover/public/application/apps/main/components/sidebar/__snapshots__/discover_field_details_footer.test.tsx.snap similarity index 100% rename from src/plugins/discover/public/application/components/sidebar/__snapshots__/discover_field_details_footer.test.tsx.snap rename to src/plugins/discover/public/application/apps/main/components/sidebar/__snapshots__/discover_field_details_footer.test.tsx.snap diff --git a/src/plugins/discover/public/application/components/sidebar/__snapshots__/discover_index_pattern.test.tsx.snap b/src/plugins/discover/public/application/apps/main/components/sidebar/__snapshots__/discover_index_pattern.test.tsx.snap similarity index 100% rename from src/plugins/discover/public/application/components/sidebar/__snapshots__/discover_index_pattern.test.tsx.snap rename to src/plugins/discover/public/application/apps/main/components/sidebar/__snapshots__/discover_index_pattern.test.tsx.snap diff --git a/src/plugins/discover/public/application/components/sidebar/__snapshots__/discover_index_pattern_management.test.tsx.snap b/src/plugins/discover/public/application/apps/main/components/sidebar/__snapshots__/discover_index_pattern_management.test.tsx.snap similarity index 100% rename from src/plugins/discover/public/application/components/sidebar/__snapshots__/discover_index_pattern_management.test.tsx.snap rename to src/plugins/discover/public/application/apps/main/components/sidebar/__snapshots__/discover_index_pattern_management.test.tsx.snap diff --git a/src/plugins/discover/public/application/components/sidebar/change_indexpattern.tsx b/src/plugins/discover/public/application/apps/main/components/sidebar/change_indexpattern.tsx similarity index 100% rename from src/plugins/discover/public/application/components/sidebar/change_indexpattern.tsx rename to src/plugins/discover/public/application/apps/main/components/sidebar/change_indexpattern.tsx diff --git a/src/plugins/discover/public/application/components/sidebar/discover_field.scss b/src/plugins/discover/public/application/apps/main/components/sidebar/discover_field.scss similarity index 100% rename from src/plugins/discover/public/application/components/sidebar/discover_field.scss rename to src/plugins/discover/public/application/apps/main/components/sidebar/discover_field.scss diff --git a/src/plugins/discover/public/application/components/sidebar/discover_field.test.tsx b/src/plugins/discover/public/application/apps/main/components/sidebar/discover_field.test.tsx similarity index 91% rename from src/plugins/discover/public/application/components/sidebar/discover_field.test.tsx rename to src/plugins/discover/public/application/apps/main/components/sidebar/discover_field.test.tsx index 2041a8dfdc6379..82e37dd2b427cb 100644 --- a/src/plugins/discover/public/application/components/sidebar/discover_field.test.tsx +++ b/src/plugins/discover/public/application/apps/main/components/sidebar/discover_field.test.tsx @@ -8,15 +8,16 @@ import React from 'react'; import { findTestSubject } from '@elastic/eui/lib/test'; -// @ts-expect-error -import stubbedLogstashFields from '../../../__fixtures__/logstash_fields'; import { mountWithIntl } from '@kbn/test/jest'; + +// @ts-expect-error +import stubbedLogstashFields from '../../../../../__fixtures__/logstash_fields'; import { DiscoverField } from './discover_field'; -import { coreMock } from '../../../../../../core/public/mocks'; -import { IndexPatternField } from '../../../../../data/public'; -import { getStubIndexPattern } from '../../../../../data/public/test_utils'; +import { coreMock } from '../../../../../../../../core/public/mocks'; +import { IndexPatternField } from '../../../../../../../data/public'; +import { getStubIndexPattern } from '../../../../../../../data/public/test_utils'; -jest.mock('../../../kibana_services', () => ({ +jest.mock('../../../../../kibana_services', () => ({ getServices: () => ({ history: () => ({ location: { diff --git a/src/plugins/discover/public/application/components/sidebar/discover_field.tsx b/src/plugins/discover/public/application/apps/main/components/sidebar/discover_field.tsx similarity index 99% rename from src/plugins/discover/public/application/components/sidebar/discover_field.tsx rename to src/plugins/discover/public/application/apps/main/components/sidebar/discover_field.tsx index a53809cfa2c7ef..e60dabd1d8d8c7 100644 --- a/src/plugins/discover/public/application/components/sidebar/discover_field.tsx +++ b/src/plugins/discover/public/application/apps/main/components/sidebar/discover_field.tsx @@ -23,9 +23,9 @@ import { i18n } from '@kbn/i18n'; import { UiCounterMetricType } from '@kbn/analytics'; import classNames from 'classnames'; import { DiscoverFieldDetails } from './discover_field_details'; -import { FieldIcon, FieldButton } from '../../../../../kibana_react/public'; +import { FieldIcon, FieldButton } from '../../../../../../../kibana_react/public'; import { FieldDetails } from './types'; -import { IndexPatternField, IndexPattern } from '../../../../../data/public'; +import { IndexPatternField, IndexPattern } from '../../../../../../../data/public'; import { getFieldTypeName } from './lib/get_field_type_name'; import { DiscoverFieldDetailsFooter } from './discover_field_details_footer'; diff --git a/src/plugins/discover/public/application/components/sidebar/discover_field_bucket.scss b/src/plugins/discover/public/application/apps/main/components/sidebar/discover_field_bucket.scss similarity index 100% rename from src/plugins/discover/public/application/components/sidebar/discover_field_bucket.scss rename to src/plugins/discover/public/application/apps/main/components/sidebar/discover_field_bucket.scss diff --git a/src/plugins/discover/public/application/components/sidebar/discover_field_bucket.tsx b/src/plugins/discover/public/application/apps/main/components/sidebar/discover_field_bucket.tsx similarity index 98% rename from src/plugins/discover/public/application/components/sidebar/discover_field_bucket.tsx rename to src/plugins/discover/public/application/apps/main/components/sidebar/discover_field_bucket.tsx index e433c3419e24af..7dab8cecf28a96 100644 --- a/src/plugins/discover/public/application/components/sidebar/discover_field_bucket.tsx +++ b/src/plugins/discover/public/application/apps/main/components/sidebar/discover_field_bucket.tsx @@ -11,7 +11,7 @@ import { EuiText, EuiButtonIcon, EuiFlexGroup, EuiFlexItem, EuiSpacer } from '@e import { i18n } from '@kbn/i18n'; import { StringFieldProgressBar } from './string_progress_bar'; import { Bucket } from './types'; -import { IndexPatternField } from '../../../../../data/public'; +import { IndexPatternField } from '../../../../../../../data/public'; import './discover_field_bucket.scss'; interface Props { diff --git a/src/plugins/discover/public/application/components/sidebar/discover_field_details.scss b/src/plugins/discover/public/application/apps/main/components/sidebar/discover_field_details.scss similarity index 100% rename from src/plugins/discover/public/application/components/sidebar/discover_field_details.scss rename to src/plugins/discover/public/application/apps/main/components/sidebar/discover_field_details.scss diff --git a/src/plugins/discover/public/application/components/sidebar/discover_field_details.test.tsx b/src/plugins/discover/public/application/apps/main/components/sidebar/discover_field_details.test.tsx similarity index 88% rename from src/plugins/discover/public/application/components/sidebar/discover_field_details.test.tsx rename to src/plugins/discover/public/application/apps/main/components/sidebar/discover_field_details.test.tsx index f82154af33d1ea..a798abb60b833a 100644 --- a/src/plugins/discover/public/application/components/sidebar/discover_field_details.test.tsx +++ b/src/plugins/discover/public/application/apps/main/components/sidebar/discover_field_details.test.tsx @@ -8,13 +8,13 @@ import React from 'react'; import { findTestSubject } from '@elastic/eui/lib/test'; -// @ts-expect-error -import stubbedLogstashFields from '../../../__fixtures__/logstash_fields'; import { mountWithIntl } from '@kbn/test/jest'; +// @ts-expect-error +import stubbedLogstashFields from '../../../../../__fixtures__/logstash_fields'; import { DiscoverFieldDetails } from './discover_field_details'; -import { coreMock } from '../../../../../../core/public/mocks'; -import { IndexPatternField } from '../../../../../data/public'; -import { getStubIndexPattern } from '../../../../../data/public/test_utils'; +import { coreMock } from '../../../../../../../../core/public/mocks'; +import { IndexPatternField } from '../../../../../../../data/public'; +import { getStubIndexPattern } from '../../../../../../../data/public/test_utils'; const indexPattern = getStubIndexPattern( 'logstash-*', diff --git a/src/plugins/discover/public/application/components/sidebar/discover_field_details.tsx b/src/plugins/discover/public/application/apps/main/components/sidebar/discover_field_details.tsx similarity index 99% rename from src/plugins/discover/public/application/components/sidebar/discover_field_details.tsx rename to src/plugins/discover/public/application/apps/main/components/sidebar/discover_field_details.tsx index e2ffb79551aab2..d7008ba3e310f3 100644 --- a/src/plugins/discover/public/application/components/sidebar/discover_field_details.tsx +++ b/src/plugins/discover/public/application/apps/main/components/sidebar/discover_field_details.tsx @@ -18,7 +18,7 @@ import { getVisualizeHref, } from './lib/visualize_trigger_utils'; import { Bucket, FieldDetails } from './types'; -import { IndexPatternField, IndexPattern } from '../../../../../data/public'; +import { IndexPatternField, IndexPattern } from '../../../../../../../data/public'; import './discover_field_details.scss'; import { DiscoverFieldDetailsFooter } from './discover_field_details_footer'; diff --git a/src/plugins/discover/public/application/components/sidebar/discover_field_details_footer.test.tsx b/src/plugins/discover/public/application/apps/main/components/sidebar/discover_field_details_footer.test.tsx similarity index 87% rename from src/plugins/discover/public/application/components/sidebar/discover_field_details_footer.test.tsx rename to src/plugins/discover/public/application/apps/main/components/sidebar/discover_field_details_footer.test.tsx index 73e906cb62f5fc..aa93b2a6637362 100644 --- a/src/plugins/discover/public/application/components/sidebar/discover_field_details_footer.test.tsx +++ b/src/plugins/discover/public/application/apps/main/components/sidebar/discover_field_details_footer.test.tsx @@ -8,12 +8,12 @@ import React from 'react'; import { findTestSubject } from '@elastic/eui/lib/test'; -// @ts-expect-error -import stubbedLogstashFields from '../../../__fixtures__/logstash_fields'; import { mountWithIntl } from '@kbn/test/jest'; -import { coreMock } from '../../../../../../core/public/mocks'; -import { IndexPatternField } from '../../../../../data/public'; -import { getStubIndexPattern } from '../../../../../data/public/test_utils'; +// @ts-expect-error +import stubbedLogstashFields from '../../../../../__fixtures__/logstash_fields'; +import { coreMock } from '../../../../../../../../core/public/mocks'; +import { IndexPatternField } from '../../../../../../../data/public'; +import { getStubIndexPattern } from '../../../../../../../data/public/test_utils'; import { DiscoverFieldDetailsFooter } from './discover_field_details_footer'; const indexPattern = getStubIndexPattern( diff --git a/src/plugins/discover/public/application/components/sidebar/discover_field_details_footer.tsx b/src/plugins/discover/public/application/apps/main/components/sidebar/discover_field_details_footer.tsx similarity index 91% rename from src/plugins/discover/public/application/components/sidebar/discover_field_details_footer.tsx rename to src/plugins/discover/public/application/apps/main/components/sidebar/discover_field_details_footer.tsx index bea302087938ab..148dfc67c3e416 100644 --- a/src/plugins/discover/public/application/components/sidebar/discover_field_details_footer.tsx +++ b/src/plugins/discover/public/application/apps/main/components/sidebar/discover_field_details_footer.tsx @@ -9,8 +9,8 @@ import React from 'react'; import { EuiLink, EuiPopoverFooter, EuiText } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n/react'; -import { IndexPatternField } from '../../../../../data/common/index_patterns/fields'; -import { IndexPattern } from '../../../../../data/common/index_patterns/index_patterns'; +import { IndexPatternField } from '../../../../../../../data/common/index_patterns/fields'; +import { IndexPattern } from '../../../../../../../data/common/index_patterns/index_patterns'; import { FieldDetails } from './types'; interface DiscoverFieldDetailsFooterProps { diff --git a/src/plugins/discover/public/application/components/sidebar/discover_field_search.scss b/src/plugins/discover/public/application/apps/main/components/sidebar/discover_field_search.scss similarity index 100% rename from src/plugins/discover/public/application/components/sidebar/discover_field_search.scss rename to src/plugins/discover/public/application/apps/main/components/sidebar/discover_field_search.scss diff --git a/src/plugins/discover/public/application/components/sidebar/discover_field_search.test.tsx b/src/plugins/discover/public/application/apps/main/components/sidebar/discover_field_search.test.tsx similarity index 100% rename from src/plugins/discover/public/application/components/sidebar/discover_field_search.test.tsx rename to src/plugins/discover/public/application/apps/main/components/sidebar/discover_field_search.test.tsx diff --git a/src/plugins/discover/public/application/components/sidebar/discover_field_search.tsx b/src/plugins/discover/public/application/apps/main/components/sidebar/discover_field_search.tsx similarity index 100% rename from src/plugins/discover/public/application/components/sidebar/discover_field_search.tsx rename to src/plugins/discover/public/application/apps/main/components/sidebar/discover_field_search.tsx diff --git a/src/plugins/discover/public/application/components/sidebar/discover_index_pattern.test.tsx b/src/plugins/discover/public/application/apps/main/components/sidebar/discover_index_pattern.test.tsx similarity index 89% rename from src/plugins/discover/public/application/components/sidebar/discover_index_pattern.test.tsx rename to src/plugins/discover/public/application/apps/main/components/sidebar/discover_index_pattern.test.tsx index f6d577de564ade..45d6faa9606e10 100644 --- a/src/plugins/discover/public/application/components/sidebar/discover_index_pattern.test.tsx +++ b/src/plugins/discover/public/application/apps/main/components/sidebar/discover_index_pattern.test.tsx @@ -15,8 +15,7 @@ import { SavedObject } from 'kibana/server'; import { DiscoverIndexPattern, DiscoverIndexPatternProps } from './discover_index_pattern'; import { EuiSelectable } from '@elastic/eui'; import { IndexPattern, IndexPatternAttributes } from 'src/plugins/data/public'; -import { configMock } from '../../../__mocks__/config'; -import { indexPatternsMock } from '../../../__mocks__/index_patterns'; +import { indexPatternsMock } from '../../../../../__mocks__/index_patterns'; const indexPattern = { id: 'the-index-pattern-id-first', @@ -38,13 +37,11 @@ const indexPattern2 = { } as SavedObject; const defaultProps = { - config: configMock, indexPatternList: [indexPattern1, indexPattern2], selectedIndexPattern: indexPattern, - state: {}, - setAppState: jest.fn(), useNewFieldsApi: true, indexPatterns: indexPatternsMock, + onChangeIndexPattern: jest.fn(), }; function getIndexPatternPickerList(instance: ShallowWrapper) { @@ -72,7 +69,7 @@ describe('DiscoverIndexPattern', () => { const props = ({ indexPatternList: null, selectedIndexPattern: null, - setIndexPattern: jest.fn(), + onChangeIndexPattern: jest.fn(), } as unknown) as DiscoverIndexPatternProps; expect(shallow()).toMatchSnapshot(`""`); @@ -92,10 +89,6 @@ describe('DiscoverIndexPattern', () => { await act(async () => { selectIndexPatternPickerOption(instance, 'test2 title'); }); - expect(defaultProps.setAppState).toHaveBeenCalledWith({ - index: 'the-index-pattern-id', - columns: [], - sort: [], - }); + expect(defaultProps.onChangeIndexPattern).toHaveBeenCalledWith('the-index-pattern-id'); }); }); diff --git a/src/plugins/discover/public/application/components/sidebar/discover_index_pattern.tsx b/src/plugins/discover/public/application/apps/main/components/sidebar/discover_index_pattern.tsx similarity index 57% rename from src/plugins/discover/public/application/components/sidebar/discover_index_pattern.tsx rename to src/plugins/discover/public/application/apps/main/components/sidebar/discover_index_pattern.tsx index 021d5a0252f7ca..356c86dded97a9 100644 --- a/src/plugins/discover/public/application/components/sidebar/discover_index_pattern.tsx +++ b/src/plugins/discover/public/application/apps/main/components/sidebar/discover_index_pattern.tsx @@ -6,58 +6,35 @@ * Side Public License, v 1. */ -import React, { useState, useEffect, useCallback } from 'react'; -import { IUiSettingsClient, SavedObject } from 'kibana/public'; -import { - IndexPattern, - IndexPatternAttributes, - IndexPatternsContract, -} from 'src/plugins/data/public'; +import React, { useState, useEffect } from 'react'; import { I18nProvider } from '@kbn/i18n/react'; +import { SavedObject } from 'kibana/public'; +import { IndexPattern, IndexPatternAttributes } from 'src/plugins/data/public'; import { IndexPatternRef } from './types'; import { ChangeIndexPattern } from './change_indexpattern'; -import { getSwitchIndexPatternAppState } from '../../helpers/get_switch_index_pattern_app_state'; -import { SortPairArr } from '../../angular/doc_table/lib/get_sort'; -import { MODIFY_COLUMNS_ON_SWITCH, SORT_DEFAULT_ORDER_SETTING } from '../../../../common'; -import { AppState } from '../../angular/discover_state'; export interface DiscoverIndexPatternProps { - /** - * Client of uiSettings - */ - config: IUiSettingsClient; /** * list of available index patterns, if length > 1, component offers a "change" link */ indexPatternList: Array>; /** - * Index patterns service + * Callback function when changing an index pattern */ - indexPatterns: IndexPatternsContract; + onChangeIndexPattern: (id: string) => void; /** * currently selected index pattern, due to angular issues it's undefined at first rendering */ selectedIndexPattern: IndexPattern; - /** - * Function to set the current state - */ - setAppState: (state: Partial) => void; - /** - * Discover App state - */ - state: AppState; } /** * Component allows you to select an index pattern in discovers side bar */ export function DiscoverIndexPattern({ - config, indexPatternList, + onChangeIndexPattern, selectedIndexPattern, - indexPatterns, - state, - setAppState, }: DiscoverIndexPatternProps) { const options: IndexPatternRef[] = (indexPatternList || []).map((entity) => ({ id: entity.id, @@ -65,24 +42,6 @@ export function DiscoverIndexPattern({ })); const { id: selectedId, title: selectedTitle } = selectedIndexPattern || {}; - const setIndexPattern = useCallback( - async (id: string) => { - const nextIndexPattern = await indexPatterns.get(id); - if (nextIndexPattern && selectedIndexPattern) { - const nextAppState = getSwitchIndexPatternAppState( - selectedIndexPattern, - nextIndexPattern, - state.columns || [], - (state.sort || []) as SortPairArr[], - config.get(MODIFY_COLUMNS_ON_SWITCH), - config.get(SORT_DEFAULT_ORDER_SETTING) - ); - setAppState(nextAppState); - } - }, - [selectedIndexPattern, state, config, indexPatterns, setAppState] - ); - const [selected, setSelected] = useState({ id: selectedId, title: selectedTitle || '', @@ -108,7 +67,7 @@ export function DiscoverIndexPattern({ onChangeIndexPattern={(id) => { const indexPattern = options.find((pattern) => pattern.id === id); if (indexPattern) { - setIndexPattern(id); + onChangeIndexPattern(id); setSelected(indexPattern); } }} diff --git a/src/plugins/discover/public/application/components/sidebar/discover_index_pattern_management.test.tsx b/src/plugins/discover/public/application/apps/main/components/sidebar/discover_index_pattern_management.test.tsx similarity index 90% rename from src/plugins/discover/public/application/components/sidebar/discover_index_pattern_management.test.tsx rename to src/plugins/discover/public/application/apps/main/components/sidebar/discover_index_pattern_management.test.tsx index 6f9ff63d69782f..d81ecb79a42211 100644 --- a/src/plugins/discover/public/application/components/sidebar/discover_index_pattern_management.test.tsx +++ b/src/plugins/discover/public/application/apps/main/components/sidebar/discover_index_pattern_management.test.tsx @@ -6,16 +6,16 @@ * Side Public License, v 1. */ -import { getStubIndexPattern } from '../../../../../data/public/index_patterns/index_pattern.stub'; -import { coreMock } from '../../../../../../core/public/mocks'; -import { DiscoverServices } from '../../../build_services'; -// @ts-expect-error -import stubbedLogstashFields from '../../../__fixtures__/logstash_fields'; -import { mountWithIntl } from '@kbn/test/jest'; import React from 'react'; -import { DiscoverIndexPatternManagement } from './discover_index_pattern_management'; +import { mountWithIntl } from '@kbn/test/jest'; import { EuiContextMenuPanel, EuiPopover, EuiContextMenuItem } from '@elastic/eui'; import { findTestSubject } from '@kbn/test/jest'; +import { getStubIndexPattern } from '../../../../../../../data/public/index_patterns/index_pattern.stub'; +import { coreMock } from '../../../../../../../../core/public/mocks'; +import { DiscoverServices } from '../../../../../build_services'; +// @ts-expect-error +import stubbedLogstashFields from '../../../../../__fixtures__/logstash_fields'; +import { DiscoverIndexPatternManagement } from './discover_index_pattern_management'; const mockServices = ({ history: () => ({ diff --git a/src/plugins/discover/public/application/components/sidebar/discover_index_pattern_management.tsx b/src/plugins/discover/public/application/apps/main/components/sidebar/discover_index_pattern_management.tsx similarity index 95% rename from src/plugins/discover/public/application/components/sidebar/discover_index_pattern_management.tsx rename to src/plugins/discover/public/application/apps/main/components/sidebar/discover_index_pattern_management.tsx index 9a9dfd579b96d5..125172f47b7c42 100644 --- a/src/plugins/discover/public/application/components/sidebar/discover_index_pattern_management.tsx +++ b/src/plugins/discover/public/application/apps/main/components/sidebar/discover_index_pattern_management.tsx @@ -9,8 +9,8 @@ import React, { useState } from 'react'; import { EuiButtonIcon, EuiContextMenuItem, EuiContextMenuPanel, EuiPopover } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { DiscoverServices } from '../../../build_services'; -import { IndexPattern } from '../../../../../data/common/index_patterns/index_patterns'; +import { DiscoverServices } from '../../../../../build_services'; +import { IndexPattern } from '../../../../../../../data/common/index_patterns/index_patterns'; export interface DiscoverIndexPatternManagementProps { /** diff --git a/src/plugins/discover/public/application/components/sidebar/discover_sidebar.scss b/src/plugins/discover/public/application/apps/main/components/sidebar/discover_sidebar.scss similarity index 100% rename from src/plugins/discover/public/application/components/sidebar/discover_sidebar.scss rename to src/plugins/discover/public/application/apps/main/components/sidebar/discover_sidebar.scss diff --git a/src/plugins/discover/public/application/components/sidebar/discover_sidebar.test.tsx b/src/plugins/discover/public/application/apps/main/components/sidebar/discover_sidebar.test.tsx similarity index 71% rename from src/plugins/discover/public/application/components/sidebar/discover_sidebar.test.tsx rename to src/plugins/discover/public/application/apps/main/components/sidebar/discover_sidebar.test.tsx index 35d93095a1da31..304ab05516f92a 100644 --- a/src/plugins/discover/public/application/components/sidebar/discover_sidebar.test.tsx +++ b/src/plugins/discover/public/application/apps/main/components/sidebar/discover_sidebar.test.tsx @@ -10,54 +10,23 @@ import { each, cloneDeep } from 'lodash'; import { ReactWrapper } from 'enzyme'; import { findTestSubject } from '@elastic/eui/lib/test'; // @ts-expect-error -import realHits from '../../../__fixtures__/real_hits.js'; +import realHits from '../../../../../__fixtures__/real_hits.js'; // @ts-expect-error -import stubbedLogstashFields from '../../../__fixtures__/logstash_fields'; +import stubbedLogstashFields from '../../../../../__fixtures__/logstash_fields'; import { mountWithIntl } from '@kbn/test/jest'; import React from 'react'; import { DiscoverSidebarProps } from './discover_sidebar'; -import { coreMock } from '../../../../../../core/public/mocks'; -import { IndexPatternAttributes } from '../../../../../data/common'; -import { getStubIndexPattern } from '../../../../../data/public/test_utils'; -import { SavedObject } from '../../../../../../core/types'; +import { coreMock } from '../../../../../../../../core/public/mocks'; +import { IndexPatternAttributes } from '../../../../../../../data/common'; +import { getStubIndexPattern } from '../../../../../../../data/public/test_utils'; +import { SavedObject } from '../../../../../../../../core/types'; import { getDefaultFieldFilter } from './lib/field_filter'; import { DiscoverSidebar } from './discover_sidebar'; -import { DiscoverServices } from '../../../build_services'; -import { ElasticSearchHit } from '../../doc_views/doc_views_types'; -import { configMock } from '../../../__mocks__/config'; -import { indexPatternsMock } from '../../../__mocks__/index_patterns'; +import { ElasticSearchHit } from '../../../../doc_views/doc_views_types'; +import { discoverServiceMock as mockDiscoverServices } from '../../../../../__mocks__/services'; -const mockServices = ({ - history: () => ({ - location: { - search: '', - }, - }), - capabilities: { - visualize: { - show: true, - }, - discover: { - save: false, - }, - }, - uiSettings: { - get: (key: string) => { - if (key === 'fields:popularLimit') { - return 5; - } - }, - }, - indexPatternFieldEditor: { - openEditor: jest.fn(), - userPermissions: { - editIndexPattern: jest.fn(), - }, - }, -} as unknown) as DiscoverServices; - -jest.mock('../../../kibana_services', () => ({ - getServices: () => mockServices, +jest.mock('../../../../../kibana_services', () => ({ + getServices: () => mockDiscoverServices, })); jest.mock('./lib/get_index_pattern_field_list', () => ({ @@ -92,22 +61,20 @@ function getCompProps(): DiscoverSidebarProps { } } return { - config: configMock, columns: ['extension'], fieldCounts, hits, indexPatternList, - indexPatterns: indexPatternsMock, + onChangeIndexPattern: jest.fn(), onAddFilter: jest.fn(), onAddField: jest.fn(), onRemoveField: jest.fn(), selectedIndexPattern: indexPattern, - services: mockServices, + services: mockDiscoverServices, state: {}, trackUiMetric: jest.fn(), fieldFilter: getDefaultFieldFilter(), setFieldFilter: jest.fn(), - setAppState: jest.fn(), onEditRuntimeField: jest.fn(), editField: jest.fn(), }; diff --git a/src/plugins/discover/public/application/components/sidebar/discover_sidebar.tsx b/src/plugins/discover/public/application/apps/main/components/sidebar/discover_sidebar.tsx similarity index 97% rename from src/plugins/discover/public/application/components/sidebar/discover_sidebar.tsx rename to src/plugins/discover/public/application/apps/main/components/sidebar/discover_sidebar.tsx index aaaf72f7706305..0bebec61657b4a 100644 --- a/src/plugins/discover/public/application/components/sidebar/discover_sidebar.tsx +++ b/src/plugins/discover/public/application/apps/main/components/sidebar/discover_sidebar.tsx @@ -27,9 +27,9 @@ import { FormattedMessage } from '@kbn/i18n/react'; import { DiscoverField } from './discover_field'; import { DiscoverIndexPattern } from './discover_index_pattern'; import { DiscoverFieldSearch } from './discover_field_search'; -import { FIELDS_LIMIT_SETTING } from '../../../../common'; +import { FIELDS_LIMIT_SETTING } from '../../../../../../common'; import { groupFields } from './lib/group_fields'; -import { IndexPatternField } from '../../../../../data/public'; +import { IndexPatternField } from '../../../../../../../data/public'; import { getDetails } from './lib/get_details'; import { FieldFilterState, getDefaultFieldFilter, setFieldFilterProp } from './lib/field_filter'; import { getIndexPatternFieldList } from './lib/get_index_pattern_field_list'; @@ -68,30 +68,28 @@ export interface DiscoverSidebarProps extends DiscoverSidebarResponsiveProps { export function DiscoverSidebar({ alwaysShowActionButtons = false, columns, - config, fieldCounts, fieldFilter, hits, indexPatternList, - indexPatterns, onAddField, onAddFilter, onRemoveField, selectedIndexPattern, services, - setAppState, setFieldFilter, - state, trackUiMetric, useNewFieldsApi = false, useFlyout = false, unmappedFieldsConfig, onEditRuntimeField, + onChangeIndexPattern, setFieldEditorRef, closeFlyout, editField, }: DiscoverSidebarProps) { const [fields, setFields] = useState(null); + const { indexPatternFieldEditor } = services; const indexPatternFieldEditPermission = indexPatternFieldEditor?.userPermissions.editIndexPattern(); const canEditIndexPatternField = !!indexPatternFieldEditPermission && useNewFieldsApi; @@ -282,12 +280,9 @@ export function DiscoverSidebar({ o.attributes.title)} - indexPatterns={indexPatterns} - state={state} - setAppState={setAppState} + onChangeIndexPattern={onChangeIndexPattern} /> @@ -323,12 +318,9 @@ export function DiscoverSidebar({ o.attributes.title)} - indexPatterns={indexPatterns} - state={state} - setAppState={setAppState} + onChangeIndexPattern={onChangeIndexPattern} /> diff --git a/src/plugins/discover/public/application/components/sidebar/discover_sidebar_responsive.test.tsx b/src/plugins/discover/public/application/apps/main/components/sidebar/discover_sidebar_responsive.test.tsx similarity index 84% rename from src/plugins/discover/public/application/components/sidebar/discover_sidebar_responsive.test.tsx rename to src/plugins/discover/public/application/apps/main/components/sidebar/discover_sidebar_responsive.test.tsx index caa0e436f40910..2ad75806173eb0 100644 --- a/src/plugins/discover/public/application/components/sidebar/discover_sidebar_responsive.test.tsx +++ b/src/plugins/discover/public/application/apps/main/components/sidebar/discover_sidebar_responsive.test.tsx @@ -10,23 +10,21 @@ import { each, cloneDeep } from 'lodash'; import { ReactWrapper } from 'enzyme'; import { findTestSubject } from '@elastic/eui/lib/test'; // @ts-expect-error -import realHits from '../../../__fixtures__/real_hits.js'; +import realHits from '../../../../../__fixtures__/real_hits.js'; // @ts-expect-error -import stubbedLogstashFields from '../../../__fixtures__/logstash_fields'; +import stubbedLogstashFields from '../../../../../__fixtures__/logstash_fields'; import { mountWithIntl } from '@kbn/test/jest'; import React from 'react'; -import { coreMock } from '../../../../../../core/public/mocks'; -import { IndexPatternAttributes } from '../../../../../data/common'; -import { getStubIndexPattern } from '../../../../../data/public/test_utils'; -import { SavedObject } from '../../../../../../core/types'; +import { coreMock } from '../../../../../../../../core/public/mocks'; +import { IndexPatternAttributes } from '../../../../../../../data/common'; +import { getStubIndexPattern } from '../../../../../../../data/public/test_utils'; +import { SavedObject } from '../../../../../../../../core/types'; import { DiscoverSidebarResponsive, DiscoverSidebarResponsiveProps, } from './discover_sidebar_responsive'; -import { DiscoverServices } from '../../../build_services'; -import { ElasticSearchHit } from '../../doc_views/doc_views_types'; -import { configMock } from '../../../__mocks__/config'; -import { indexPatternsMock } from '../../../__mocks__/index_patterns'; +import { DiscoverServices } from '../../../../../build_services'; +import { ElasticSearchHit } from '../../../../doc_views/doc_views_types'; import { DiscoverSidebar } from './discover_sidebar'; const mockServices = ({ @@ -52,7 +50,7 @@ const mockServices = ({ }, } as unknown) as DiscoverServices; -jest.mock('../../../kibana_services', () => ({ +jest.mock('../../../../../kibana_services', () => ({ getServices: () => mockServices, })); @@ -89,17 +87,15 @@ function getCompProps(): DiscoverSidebarResponsiveProps { } return { columns: ['extension'], - config: configMock, fieldCounts, hits, indexPatternList, - indexPatterns: indexPatternsMock, + onChangeIndexPattern: jest.fn(), onAddFilter: jest.fn(), onAddField: jest.fn(), onRemoveField: jest.fn(), selectedIndexPattern: indexPattern, services: mockServices, - setAppState: jest.fn(), state: {}, trackUiMetric: jest.fn(), onEditRuntimeField: jest.fn(), diff --git a/src/plugins/discover/public/application/components/sidebar/discover_sidebar_responsive.tsx b/src/plugins/discover/public/application/apps/main/components/sidebar/discover_sidebar_responsive.tsx similarity index 91% rename from src/plugins/discover/public/application/components/sidebar/discover_sidebar_responsive.tsx rename to src/plugins/discover/public/application/apps/main/components/sidebar/discover_sidebar_responsive.tsx index 6b8918e2d99656..cc33601f77728f 100644 --- a/src/plugins/discover/public/application/components/sidebar/discover_sidebar_responsive.tsx +++ b/src/plugins/discover/public/application/apps/main/components/sidebar/discover_sidebar_responsive.tsx @@ -11,7 +11,6 @@ import { sortBy } from 'lodash'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n/react'; import { UiCounterMetricType } from '@kbn/analytics'; -import { IUiSettingsClient } from 'kibana/public'; import { EuiTitle, EuiHideFor, @@ -28,14 +27,14 @@ import { EuiFlexItem, } from '@elastic/eui'; import { DiscoverIndexPattern } from './discover_index_pattern'; -import { IndexPatternAttributes, IndexPatternsContract } from '../../../../../data/common'; -import { SavedObject } from '../../../../../../core/types'; -import { IndexPatternField, IndexPattern } from '../../../../../data/public'; +import { IndexPatternAttributes } from '../../../../../../../data/common'; +import { SavedObject } from '../../../../../../../../core/types'; +import { IndexPatternField, IndexPattern } from '../../../../../../../data/public'; import { getDefaultFieldFilter } from './lib/field_filter'; import { DiscoverSidebar } from './discover_sidebar'; -import { DiscoverServices } from '../../../build_services'; -import { ElasticSearchHit } from '../../doc_views/doc_views_types'; -import { AppState } from '../../angular/discover_state'; +import { DiscoverServices } from '../../../../../build_services'; +import { ElasticSearchHit } from '../../../../doc_views/doc_views_types'; +import { AppState } from '../../services/discover_state'; import { DiscoverIndexPatternManagement } from './discover_index_pattern_management'; export interface DiscoverSidebarResponsiveProps { @@ -47,10 +46,6 @@ export interface DiscoverSidebarResponsiveProps { * the selected columns displayed in the doc table in discover */ columns: string[]; - /** - * Client of uiSettings - */ - config: IUiSettingsClient; /** * a statistics of the distribution of fields in the given hits */ @@ -63,10 +58,6 @@ export interface DiscoverSidebarResponsiveProps { * List of available index patterns */ indexPatternList: Array>; - /** - * Index patterns service - */ - indexPatterns: IndexPatternsContract; /** * Has been toggled closed */ @@ -79,6 +70,10 @@ export interface DiscoverSidebarResponsiveProps { * Callback function when adding a filter from sidebar */ onAddFilter: (field: IndexPatternField | string, value: string, type: '+' | '-') => void; + /** + * Callback function when changing an index pattern + */ + onChangeIndexPattern: (id: string) => void; /** * Callback function when removing a field * @param fieldName @@ -92,10 +87,6 @@ export interface DiscoverSidebarResponsiveProps { * Discover plugin services; */ services: DiscoverServices; - /** - * Function to set the current state - */ - setAppState: (state: Partial) => void; /** * Discover App state */ @@ -114,7 +105,6 @@ export interface DiscoverSidebarResponsiveProps { * Read from the Fields API */ useNewFieldsApi?: boolean; - /** * an object containing properties for proper handling of unmapped fields */ @@ -215,12 +205,9 @@ export function DiscoverSidebarResponsive(props: DiscoverSidebarResponsiveProps) o.attributes.title)} - indexPatterns={props.indexPatterns} - state={props.state} - setAppState={props.setAppState} /> diff --git a/src/plugins/discover/public/application/components/sidebar/index.ts b/src/plugins/discover/public/application/apps/main/components/sidebar/index.ts similarity index 100% rename from src/plugins/discover/public/application/components/sidebar/index.ts rename to src/plugins/discover/public/application/apps/main/components/sidebar/index.ts diff --git a/src/plugins/discover/public/application/components/sidebar/lib/field_calculator.js b/src/plugins/discover/public/application/apps/main/components/sidebar/lib/field_calculator.js similarity index 100% rename from src/plugins/discover/public/application/components/sidebar/lib/field_calculator.js rename to src/plugins/discover/public/application/apps/main/components/sidebar/lib/field_calculator.js diff --git a/src/plugins/discover/public/application/components/sidebar/lib/field_calculator.test.ts b/src/plugins/discover/public/application/apps/main/components/sidebar/lib/field_calculator.test.ts similarity index 94% rename from src/plugins/discover/public/application/components/sidebar/lib/field_calculator.test.ts rename to src/plugins/discover/public/application/apps/main/components/sidebar/lib/field_calculator.test.ts index 2cdd99774c2a8a..501f18116dc6f7 100644 --- a/src/plugins/discover/public/application/components/sidebar/lib/field_calculator.test.ts +++ b/src/plugins/discover/public/application/apps/main/components/sidebar/lib/field_calculator.test.ts @@ -10,12 +10,12 @@ import _ from 'lodash'; // @ts-expect-error -import realHits from '../../../../__fixtures__/real_hits.js'; +import realHits from '../../../../../../__fixtures__/real_hits.js'; // @ts-expect-error -import stubbedLogstashFields from '../../../../__fixtures__/logstash_fields'; -import { coreMock } from '../../../../../../../core/public/mocks'; -import { IndexPattern } from '../../../../../../data/public'; -import { getStubIndexPattern } from '../../../../../../data/public/test_utils'; +import stubbedLogstashFields from '../../../../../../__fixtures__/logstash_fields'; +import { coreMock } from '../../../../../../../../../core/public/mocks'; +import { IndexPattern } from '../../../../../../../../data/public'; +import { getStubIndexPattern } from '../../../../../../../../data/public/test_utils'; // @ts-expect-error import { fieldCalculator } from './field_calculator'; diff --git a/src/plugins/discover/public/application/components/sidebar/lib/field_filter.test.ts b/src/plugins/discover/public/application/apps/main/components/sidebar/lib/field_filter.test.ts similarity index 97% rename from src/plugins/discover/public/application/components/sidebar/lib/field_filter.test.ts rename to src/plugins/discover/public/application/apps/main/components/sidebar/lib/field_filter.test.ts index 04217c07f66381..8d7c543157ead7 100644 --- a/src/plugins/discover/public/application/components/sidebar/lib/field_filter.test.ts +++ b/src/plugins/discover/public/application/apps/main/components/sidebar/lib/field_filter.test.ts @@ -7,7 +7,7 @@ */ import { getDefaultFieldFilter, setFieldFilterProp, isFieldFiltered } from './field_filter'; -import { IndexPatternField } from '../../../../../../data/public'; +import { IndexPatternField } from '../../../../../../../../data/public'; describe('field_filter', function () { it('getDefaultFieldFilter should return default filter state', function () { diff --git a/src/plugins/discover/public/application/components/sidebar/lib/field_filter.ts b/src/plugins/discover/public/application/apps/main/components/sidebar/lib/field_filter.ts similarity index 96% rename from src/plugins/discover/public/application/components/sidebar/lib/field_filter.ts rename to src/plugins/discover/public/application/apps/main/components/sidebar/lib/field_filter.ts index 8c7e48f173031d..25a8309d3d9634 100644 --- a/src/plugins/discover/public/application/components/sidebar/lib/field_filter.ts +++ b/src/plugins/discover/public/application/apps/main/components/sidebar/lib/field_filter.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { IndexPatternField } from '../../../../../../data/public'; +import { IndexPatternField } from '../../../../../../../../data/public'; export interface FieldFilterState { missing: boolean; diff --git a/src/plugins/discover/public/application/components/sidebar/lib/get_details.ts b/src/plugins/discover/public/application/apps/main/components/sidebar/lib/get_details.ts similarity index 91% rename from src/plugins/discover/public/application/components/sidebar/lib/get_details.ts rename to src/plugins/discover/public/application/apps/main/components/sidebar/lib/get_details.ts index 1e35717d249f8b..ab991f2cfb6563 100644 --- a/src/plugins/discover/public/application/components/sidebar/lib/get_details.ts +++ b/src/plugins/discover/public/application/apps/main/components/sidebar/lib/get_details.ts @@ -8,8 +8,8 @@ // @ts-expect-error import { fieldCalculator } from './field_calculator'; -import { IndexPattern, IndexPatternField } from '../../../../../../data/public'; -import { ElasticSearchHit } from '../../../doc_views/doc_views_types'; +import { IndexPattern, IndexPatternField } from '../../../../../../../../data/public'; +import { ElasticSearchHit } from '../../../../../doc_views/doc_views_types'; export function getDetails( field: IndexPatternField, diff --git a/src/plugins/discover/public/application/components/sidebar/lib/get_field_type_name.ts b/src/plugins/discover/public/application/apps/main/components/sidebar/lib/get_field_type_name.ts similarity index 100% rename from src/plugins/discover/public/application/components/sidebar/lib/get_field_type_name.ts rename to src/plugins/discover/public/application/apps/main/components/sidebar/lib/get_field_type_name.ts diff --git a/src/plugins/discover/public/application/components/sidebar/lib/get_index_pattern_field_list.ts b/src/plugins/discover/public/application/apps/main/components/sidebar/lib/get_index_pattern_field_list.ts similarity index 95% rename from src/plugins/discover/public/application/components/sidebar/lib/get_index_pattern_field_list.ts rename to src/plugins/discover/public/application/apps/main/components/sidebar/lib/get_index_pattern_field_list.ts index 1586c2b26eefe0..8f2e18c64a5ebf 100644 --- a/src/plugins/discover/public/application/components/sidebar/lib/get_index_pattern_field_list.ts +++ b/src/plugins/discover/public/application/apps/main/components/sidebar/lib/get_index_pattern_field_list.ts @@ -8,7 +8,7 @@ import { difference } from 'lodash'; import { IndexPattern, IndexPatternField } from 'src/plugins/data/public'; -import { isNestedFieldParent } from '../../../helpers/nested_fields'; +import { isNestedFieldParent } from '../../../utils/nested_fields'; export function getIndexPatternFieldList( indexPattern?: IndexPattern, diff --git a/src/plugins/discover/public/application/components/sidebar/lib/get_warnings.ts b/src/plugins/discover/public/application/apps/main/components/sidebar/lib/get_warnings.ts similarity index 92% rename from src/plugins/discover/public/application/components/sidebar/lib/get_warnings.ts rename to src/plugins/discover/public/application/apps/main/components/sidebar/lib/get_warnings.ts index 05634973fae8c5..60ce5351e2cd3a 100644 --- a/src/plugins/discover/public/application/components/sidebar/lib/get_warnings.ts +++ b/src/plugins/discover/public/application/apps/main/components/sidebar/lib/get_warnings.ts @@ -7,7 +7,7 @@ */ import { i18n } from '@kbn/i18n'; -import { IndexPatternField } from '../../../../../../data/public'; +import { IndexPatternField } from '../../../../../../../../data/public'; export function getWarnings(field: IndexPatternField) { let warnings = []; diff --git a/src/plugins/discover/public/application/components/sidebar/lib/group_fields.test.ts b/src/plugins/discover/public/application/apps/main/components/sidebar/lib/group_fields.test.ts similarity index 98% rename from src/plugins/discover/public/application/components/sidebar/lib/group_fields.test.ts rename to src/plugins/discover/public/application/apps/main/components/sidebar/lib/group_fields.test.ts index e8eb07784cf9fc..58697206356214 100644 --- a/src/plugins/discover/public/application/components/sidebar/lib/group_fields.test.ts +++ b/src/plugins/discover/public/application/apps/main/components/sidebar/lib/group_fields.test.ts @@ -8,7 +8,7 @@ import { groupFields } from './group_fields'; import { getDefaultFieldFilter } from './field_filter'; -import { IndexPatternField } from '../../../../../../data/common/index_patterns/fields'; +import { IndexPatternField } from '../../../../../../../../data/common/index_patterns/fields'; const fields = [ { diff --git a/src/plugins/discover/public/application/components/sidebar/lib/group_fields.tsx b/src/plugins/discover/public/application/apps/main/components/sidebar/lib/group_fields.tsx similarity index 100% rename from src/plugins/discover/public/application/components/sidebar/lib/group_fields.tsx rename to src/plugins/discover/public/application/apps/main/components/sidebar/lib/group_fields.tsx diff --git a/src/plugins/discover/public/application/components/sidebar/lib/visualize_trigger_utils.ts b/src/plugins/discover/public/application/apps/main/components/sidebar/lib/visualize_trigger_utils.ts similarity index 95% rename from src/plugins/discover/public/application/components/sidebar/lib/visualize_trigger_utils.ts rename to src/plugins/discover/public/application/apps/main/components/sidebar/lib/visualize_trigger_utils.ts index 1a6cc38a4259bd..2fabaa0ddd1003 100644 --- a/src/plugins/discover/public/application/components/sidebar/lib/visualize_trigger_utils.ts +++ b/src/plugins/discover/public/application/apps/main/components/sidebar/lib/visualize_trigger_utils.ts @@ -11,9 +11,9 @@ import { VISUALIZE_GEO_FIELD_TRIGGER, visualizeFieldTrigger, visualizeGeoFieldTrigger, -} from '../../../../../../ui_actions/public'; -import { getUiActions } from '../../../../kibana_services'; -import { IndexPatternField, KBN_FIELD_TYPES } from '../../../../../../data/public'; +} from '../../../../../../../../ui_actions/public'; +import { getUiActions } from '../../../../../../kibana_services'; +import { IndexPatternField, KBN_FIELD_TYPES } from '../../../../../../../../data/public'; function getTriggerConstant(type: string) { return type === KBN_FIELD_TYPES.GEO_POINT || type === KBN_FIELD_TYPES.GEO_SHAPE diff --git a/src/plugins/discover/public/application/components/sidebar/string_progress_bar.tsx b/src/plugins/discover/public/application/apps/main/components/sidebar/string_progress_bar.tsx similarity index 100% rename from src/plugins/discover/public/application/components/sidebar/string_progress_bar.tsx rename to src/plugins/discover/public/application/apps/main/components/sidebar/string_progress_bar.tsx diff --git a/src/plugins/discover/public/application/components/sidebar/types.ts b/src/plugins/discover/public/application/apps/main/components/sidebar/types.ts similarity index 100% rename from src/plugins/discover/public/application/components/sidebar/types.ts rename to src/plugins/discover/public/application/apps/main/components/sidebar/types.ts diff --git a/src/plugins/discover/public/application/components/skip_bottom_button/index.ts b/src/plugins/discover/public/application/apps/main/components/skip_bottom_button/index.ts similarity index 100% rename from src/plugins/discover/public/application/components/skip_bottom_button/index.ts rename to src/plugins/discover/public/application/apps/main/components/skip_bottom_button/index.ts diff --git a/src/plugins/discover/public/application/components/skip_bottom_button/skip_bottom_button.test.tsx b/src/plugins/discover/public/application/apps/main/components/skip_bottom_button/skip_bottom_button.test.tsx similarity index 100% rename from src/plugins/discover/public/application/components/skip_bottom_button/skip_bottom_button.test.tsx rename to src/plugins/discover/public/application/apps/main/components/skip_bottom_button/skip_bottom_button.test.tsx diff --git a/src/plugins/discover/public/application/components/skip_bottom_button/skip_bottom_button.tsx b/src/plugins/discover/public/application/apps/main/components/skip_bottom_button/skip_bottom_button.tsx similarity index 100% rename from src/plugins/discover/public/application/components/skip_bottom_button/skip_bottom_button.tsx rename to src/plugins/discover/public/application/apps/main/components/skip_bottom_button/skip_bottom_button.tsx diff --git a/src/plugins/discover/public/application/components/timechart_header/index.ts b/src/plugins/discover/public/application/apps/main/components/timechart_header/index.ts similarity index 100% rename from src/plugins/discover/public/application/components/timechart_header/index.ts rename to src/plugins/discover/public/application/apps/main/components/timechart_header/index.ts diff --git a/src/plugins/discover/public/application/components/timechart_header/timechart_header.scss b/src/plugins/discover/public/application/apps/main/components/timechart_header/timechart_header.scss similarity index 100% rename from src/plugins/discover/public/application/components/timechart_header/timechart_header.scss rename to src/plugins/discover/public/application/apps/main/components/timechart_header/timechart_header.scss diff --git a/src/plugins/discover/public/application/components/timechart_header/timechart_header.test.tsx b/src/plugins/discover/public/application/apps/main/components/timechart_header/timechart_header.test.tsx similarity index 97% rename from src/plugins/discover/public/application/components/timechart_header/timechart_header.test.tsx rename to src/plugins/discover/public/application/apps/main/components/timechart_header/timechart_header.test.tsx index 0da1fdd92d2cce..a68dc9a3b3756c 100644 --- a/src/plugins/discover/public/application/components/timechart_header/timechart_header.test.tsx +++ b/src/plugins/discover/public/application/apps/main/components/timechart_header/timechart_header.test.tsx @@ -12,7 +12,7 @@ import { ReactWrapper } from 'enzyme'; import { TimechartHeader, TimechartHeaderProps } from './timechart_header'; import { EuiIconTip } from '@elastic/eui'; import { findTestSubject } from '@elastic/eui/lib/test'; -import { DataPublicPluginStart } from '../../../../../data/public'; +import { DataPublicPluginStart } from '../../../../../../../data/public'; describe('timechart header', function () { let props: TimechartHeaderProps; diff --git a/src/plugins/discover/public/application/components/timechart_header/timechart_header.tsx b/src/plugins/discover/public/application/apps/main/components/timechart_header/timechart_header.tsx similarity index 95% rename from src/plugins/discover/public/application/components/timechart_header/timechart_header.tsx rename to src/plugins/discover/public/application/apps/main/components/timechart_header/timechart_header.tsx index a2fc17e05a203e..ec94679ece6759 100644 --- a/src/plugins/discover/public/application/components/timechart_header/timechart_header.tsx +++ b/src/plugins/discover/public/application/apps/main/components/timechart_header/timechart_header.tsx @@ -18,8 +18,14 @@ import { import moment from 'moment'; import { i18n } from '@kbn/i18n'; import dateMath from '@elastic/datemath'; -import { DataPublicPluginStart } from '../../../../../data/public'; import './timechart_header.scss'; +import { DataPublicPluginStart } from '../../../../../../../data/public'; + +export interface TimechartBucketInterval { + scaled?: boolean; + description?: string; + scale?: number; +} export interface TimechartHeaderProps { /** @@ -29,11 +35,7 @@ export interface TimechartHeaderProps { /** * Interval for the buckets of the recent request */ - bucketInterval?: { - scaled?: boolean; - description?: string; - scale?: number; - }; + bucketInterval?: TimechartBucketInterval; data: DataPublicPluginStart; /** * Interval Options diff --git a/src/plugins/discover/public/application/components/top_nav/__snapshots__/open_search_panel.test.tsx.snap b/src/plugins/discover/public/application/apps/main/components/top_nav/__snapshots__/open_search_panel.test.tsx.snap similarity index 100% rename from src/plugins/discover/public/application/components/top_nav/__snapshots__/open_search_panel.test.tsx.snap rename to src/plugins/discover/public/application/apps/main/components/top_nav/__snapshots__/open_search_panel.test.tsx.snap diff --git a/src/plugins/discover/public/application/apps/main/components/top_nav/discover_topnav.test.tsx b/src/plugins/discover/public/application/apps/main/components/top_nav/discover_topnav.test.tsx new file mode 100644 index 00000000000000..687532cd94f083 --- /dev/null +++ b/src/plugins/discover/public/application/apps/main/components/top_nav/discover_topnav.test.tsx @@ -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 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 React from 'react'; +import { shallowWithIntl } from '@kbn/test/jest'; +import { indexPatternMock } from '../../../../../__mocks__/index_pattern'; +import { savedSearchMock } from '../../../../../__mocks__/saved_search'; +import { DiscoverTopNav, DiscoverTopNavProps } from './discover_topnav'; +import { TopNavMenuData } from '../../../../../../../navigation/public'; +import { ISearchSource, Query } from '../../../../../../../data/common'; +import { GetStateReturn } from '../../services/discover_state'; +import { setHeaderActionMenuMounter } from '../../../../../kibana_services'; +import { discoverServiceMock } from '../../../../../__mocks__/services'; + +setHeaderActionMenuMounter(jest.fn()); + +function getProps(savePermissions = true): DiscoverTopNavProps { + discoverServiceMock.capabilities.discover!.save = savePermissions; + + return { + stateContainer: {} as GetStateReturn, + indexPattern: indexPatternMock, + savedSearch: savedSearchMock, + navigateTo: jest.fn(), + services: discoverServiceMock, + query: {} as Query, + savedQuery: '', + updateQuery: jest.fn(), + onOpenInspector: jest.fn(), + searchSource: {} as ISearchSource, + }; +} + +describe('Discover topnav component', () => { + test('generated config of TopNavMenu config is correct when discover save permissions are assigned', () => { + const props = getProps(true); + const component = shallowWithIntl(); + const topMenuConfig = component.props().config.map((obj: TopNavMenuData) => obj.id); + expect(topMenuConfig).toEqual(['options', 'new', 'save', 'open', 'share', 'inspect']); + }); + + test('generated config of TopNavMenu config is correct when no discover save permissions are assigned', () => { + const props = getProps(false); + const component = shallowWithIntl(); + const topMenuConfig = component.props().config.map((obj: TopNavMenuData) => obj.id); + expect(topMenuConfig).toEqual(['options', 'new', 'open', 'share', 'inspect']); + }); +}); diff --git a/src/plugins/discover/public/application/components/discover_topnav.tsx b/src/plugins/discover/public/application/apps/main/components/top_nav/discover_topnav.tsx similarity index 60% rename from src/plugins/discover/public/application/components/discover_topnav.tsx rename to src/plugins/discover/public/application/apps/main/components/top_nav/discover_topnav.tsx index c5c0df6e6f74a1..9afda734010845 100644 --- a/src/plugins/discover/public/application/components/discover_topnav.tsx +++ b/src/plugins/discover/public/application/apps/main/components/top_nav/discover_topnav.tsx @@ -6,45 +6,53 @@ * Side Public License, v 1. */ import React, { useMemo } from 'react'; -import { DiscoverProps } from './types'; -import { getTopNavLinks } from './top_nav/get_top_nav_links'; -import { Query, TimeRange } from '../../../../data/common/query'; +import { DiscoverLayoutProps } from '../layout/types'; +import { getTopNavLinks } from './get_top_nav_links'; +import { Query, TimeRange } from '../../../../../../../data/common/query'; +import { getHeaderActionMenuMounter } from '../../../../../kibana_services'; +import { GetStateReturn } from '../../services/discover_state'; -export type DiscoverTopNavProps = Pick & { +export type DiscoverTopNavProps = Pick< + DiscoverLayoutProps, + 'indexPattern' | 'navigateTo' | 'savedSearch' | 'services' | 'searchSource' +> & { onOpenInspector: () => void; query?: Query; savedQuery?: string; updateQuery: (payload: { dateRange: TimeRange; query?: Query }, isUpdate?: boolean) => void; + stateContainer: GetStateReturn; }; export const DiscoverTopNav = ({ indexPattern, - opts, onOpenInspector, query, savedQuery, + stateContainer, updateQuery, searchSource, + navigateTo, + savedSearch, + services, }: DiscoverTopNavProps) => { const showDatePicker = useMemo(() => indexPattern.isTimeBased(), [indexPattern]); - const { TopNavMenu } = opts.services.navigation.ui; + const { TopNavMenu } = services.navigation.ui; const topNavMenu = useMemo( () => getTopNavLinks({ - getFieldCounts: opts.getFieldCounts, indexPattern, - navigateTo: opts.navigateTo, - savedSearch: opts.savedSearch, - services: opts.services, - state: opts.stateContainer, + navigateTo, + savedSearch, + services, + state: stateContainer, onOpenInspector, searchSource, }), - [indexPattern, opts, onOpenInspector, searchSource] + [indexPattern, navigateTo, onOpenInspector, searchSource, stateContainer, savedSearch, services] ); const updateSavedQueryId = (newSavedQueryId: string | undefined) => { - const { appStateContainer, setAppState } = opts.stateContainer; + const { appStateContainer, setAppState } = stateContainer; if (newSavedQueryId) { setAppState({ savedQuery: newSavedQueryId }); } else { @@ -56,6 +64,10 @@ export const DiscoverTopNav = ({ appStateContainer.set(newState); } }; + const setMenuMountPoint = useMemo(() => { + return getHeaderActionMenuMounter(); + }, []); + return ( diff --git a/src/plugins/discover/public/application/components/top_nav/get_top_nav_links.test.ts b/src/plugins/discover/public/application/apps/main/components/top_nav/get_top_nav_links.test.ts similarity index 87% rename from src/plugins/discover/public/application/components/top_nav/get_top_nav_links.test.ts rename to src/plugins/discover/public/application/apps/main/components/top_nav/get_top_nav_links.test.ts index 2c50ce61c8afb7..6a6fb8a44a5cfe 100644 --- a/src/plugins/discover/public/application/components/top_nav/get_top_nav_links.test.ts +++ b/src/plugins/discover/public/application/apps/main/components/top_nav/get_top_nav_links.test.ts @@ -8,10 +8,10 @@ import { ISearchSource } from 'src/plugins/data/public'; import { getTopNavLinks } from './get_top_nav_links'; -import { indexPatternMock } from '../../../__mocks__/index_pattern'; -import { savedSearchMock } from '../../../__mocks__/saved_search'; -import { DiscoverServices } from '../../../build_services'; -import { GetStateReturn } from '../../angular/discover_state'; +import { indexPatternMock } from '../../../../../__mocks__/index_pattern'; +import { savedSearchMock } from '../../../../../__mocks__/saved_search'; +import { DiscoverServices } from '../../../../../build_services'; +import { GetStateReturn } from '../../services/discover_state'; const services = ({ capabilities: { @@ -28,7 +28,6 @@ const state = ({} as unknown) as GetStateReturn; test('getTopNavLinks result', () => { const topNavLinks = getTopNavLinks({ - getFieldCounts: jest.fn(), indexPattern: indexPatternMock, navigateTo: jest.fn(), onOpenInspector: jest.fn(), diff --git a/src/plugins/discover/public/application/components/top_nav/get_top_nav_links.ts b/src/plugins/discover/public/application/apps/main/components/top_nav/get_top_nav_links.ts similarity index 90% rename from src/plugins/discover/public/application/components/top_nav/get_top_nav_links.ts rename to src/plugins/discover/public/application/apps/main/components/top_nav/get_top_nav_links.ts index 38bc831225c682..f19b30cda5f8a3 100644 --- a/src/plugins/discover/public/application/components/top_nav/get_top_nav_links.ts +++ b/src/plugins/discover/public/application/apps/main/components/top_nav/get_top_nav_links.ts @@ -9,20 +9,19 @@ import { i18n } from '@kbn/i18n'; import moment from 'moment'; import { showOpenSearchPanel } from './show_open_search_panel'; -import { getSharingData, showPublicUrlSwitch } from '../../helpers/get_sharing_data'; -import { unhashUrl } from '../../../../../kibana_utils/public'; -import { DiscoverServices } from '../../../build_services'; -import { SavedSearch } from '../../../saved_searches'; +import { getSharingData, showPublicUrlSwitch } from '../../utils/get_sharing_data'; +import { unhashUrl } from '../../../../../../../kibana_utils/public'; +import { DiscoverServices } from '../../../../../build_services'; +import { SavedSearch } from '../../../../../saved_searches'; import { onSaveSearch } from './on_save_search'; -import { GetStateReturn } from '../../angular/discover_state'; -import { IndexPattern, ISearchSource } from '../../../kibana_services'; +import { GetStateReturn } from '../../services/discover_state'; +import { IndexPattern, ISearchSource } from '../../../../../kibana_services'; import { openOptionsPopover } from './open_options_popover'; /** * Helper function to build the top nav links */ export const getTopNavLinks = ({ - getFieldCounts, indexPattern, navigateTo, savedSearch, @@ -31,7 +30,6 @@ export const getTopNavLinks = ({ onOpenInspector, searchSource, }: { - getFieldCounts: () => Promise>; indexPattern: IndexPattern; navigateTo: (url: string) => void; savedSearch: SavedSearch; diff --git a/src/plugins/discover/public/application/components/top_nav/on_save_search.test.tsx b/src/plugins/discover/public/application/apps/main/components/top_nav/on_save_search.test.tsx similarity index 63% rename from src/plugins/discover/public/application/components/top_nav/on_save_search.test.tsx rename to src/plugins/discover/public/application/apps/main/components/top_nav/on_save_search.test.tsx index ed79d16fd5ff1c..e5f44a0fbf2149 100644 --- a/src/plugins/discover/public/application/components/top_nav/on_save_search.test.tsx +++ b/src/plugins/discover/public/application/apps/main/components/top_nav/on_save_search.test.tsx @@ -6,15 +6,15 @@ * Side Public License, v 1. */ -import { showSaveModal } from '../../../../../saved_objects/public'; -jest.mock('../../../../../saved_objects/public'); +import { showSaveModal } from '../../../../../../../saved_objects/public'; +jest.mock('../../../../../../../saved_objects/public'); import { onSaveSearch } from './on_save_search'; -import { indexPatternMock } from '../../../__mocks__/index_pattern'; -import { savedSearchMock } from '../../../__mocks__/saved_search'; -import { DiscoverServices } from '../../../build_services'; -import { GetStateReturn } from '../../angular/discover_state'; -import { i18nServiceMock } from '../../../../../../core/public/mocks'; +import { indexPatternMock } from '../../../../../__mocks__/index_pattern'; +import { savedSearchMock } from '../../../../../__mocks__/saved_search'; +import { DiscoverServices } from '../../../../../build_services'; +import { GetStateReturn } from '../../services/discover_state'; +import { i18nServiceMock } from '../../../../../../../../core/public/mocks'; test('onSaveSearch', async () => { const serviceMock = ({ diff --git a/src/plugins/discover/public/application/components/top_nav/on_save_search.tsx b/src/plugins/discover/public/application/apps/main/components/top_nav/on_save_search.tsx similarity index 89% rename from src/plugins/discover/public/application/components/top_nav/on_save_search.tsx rename to src/plugins/discover/public/application/apps/main/components/top_nav/on_save_search.tsx index a0271acec22cfb..f4b969e977254b 100644 --- a/src/plugins/discover/public/application/components/top_nav/on_save_search.tsx +++ b/src/plugins/discover/public/application/apps/main/components/top_nav/on_save_search.tsx @@ -8,13 +8,13 @@ import React from 'react'; import { i18n } from '@kbn/i18n'; -import { SavedObjectSaveModal, showSaveModal } from '../../../../../saved_objects/public'; -import { SavedSearch } from '../../../saved_searches'; -import { IndexPattern } from '../../../../../data/common/index_patterns/index_patterns'; -import { DiscoverServices } from '../../../build_services'; -import { GetStateReturn } from '../../angular/discover_state'; -import { setBreadcrumbsTitle } from '../../helpers/breadcrumbs'; -import { persistSavedSearch } from '../../helpers/persist_saved_search'; +import { SavedObjectSaveModal, showSaveModal } from '../../../../../../../saved_objects/public'; +import { SavedSearch } from '../../../../../saved_searches'; +import { IndexPattern } from '../../../../../../../data/common/index_patterns/index_patterns'; +import { DiscoverServices } from '../../../../../build_services'; +import { GetStateReturn } from '../../services/discover_state'; +import { setBreadcrumbsTitle } from '../../../../helpers/breadcrumbs'; +import { persistSavedSearch } from '../../utils/persist_saved_search'; async function saveDataSource({ indexPattern, diff --git a/src/plugins/discover/public/application/components/top_nav/open_options_popover.scss b/src/plugins/discover/public/application/apps/main/components/top_nav/open_options_popover.scss similarity index 100% rename from src/plugins/discover/public/application/components/top_nav/open_options_popover.scss rename to src/plugins/discover/public/application/apps/main/components/top_nav/open_options_popover.scss diff --git a/src/plugins/discover/public/application/components/top_nav/open_options_popover.test.tsx b/src/plugins/discover/public/application/apps/main/components/top_nav/open_options_popover.test.tsx similarity index 93% rename from src/plugins/discover/public/application/components/top_nav/open_options_popover.test.tsx rename to src/plugins/discover/public/application/apps/main/components/top_nav/open_options_popover.test.tsx index 5b3d1656d77e74..28e57aed7b6605 100644 --- a/src/plugins/discover/public/application/components/top_nav/open_options_popover.test.tsx +++ b/src/plugins/discover/public/application/apps/main/components/top_nav/open_options_popover.test.tsx @@ -9,9 +9,9 @@ import React from 'react'; import { mountWithIntl } from '@kbn/test/jest'; import { findTestSubject } from '@elastic/eui/lib/test'; -import { getServices } from '../../../kibana_services'; +import { getServices } from '../../../../../kibana_services'; -jest.mock('../../../kibana_services', () => { +jest.mock('../../../../../kibana_services', () => { const mockUiSettings = new Map(); return { getServices: () => ({ diff --git a/src/plugins/discover/public/application/components/top_nav/open_options_popover.tsx b/src/plugins/discover/public/application/apps/main/components/top_nav/open_options_popover.tsx similarity index 77% rename from src/plugins/discover/public/application/components/top_nav/open_options_popover.tsx rename to src/plugins/discover/public/application/apps/main/components/top_nav/open_options_popover.tsx index 280144d400216a..6e90c702c2bfde 100644 --- a/src/plugins/discover/public/application/components/top_nav/open_options_popover.tsx +++ b/src/plugins/discover/public/application/apps/main/components/top_nav/open_options_popover.tsx @@ -11,11 +11,21 @@ import ReactDOM from 'react-dom'; import { I18nStart } from 'kibana/public'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n/react'; -import { EuiSpacer, EuiButton, EuiText, EuiWrappingPopover, EuiCode } from '@elastic/eui'; -import { getServices } from '../../../kibana_services'; +import { + EuiSpacer, + EuiButton, + EuiText, + EuiWrappingPopover, + EuiCode, + EuiHorizontalRule, + EuiButtonEmpty, + EuiTextAlign, +} from '@elastic/eui'; import './open_options_popover.scss'; -import { DOC_TABLE_LEGACY } from '../../../../common'; +import { DOC_TABLE_LEGACY } from '../../../../../../common'; +import { getServices } from '../../../../../kibana_services'; +const container = document.createElement('div'); let isOpen = false; interface OptionsPopoverProps { @@ -77,11 +87,29 @@ export function OptionsPopover(props: OptionsPopoverProps) { defaultMessage: 'Get started', })} + + + + {i18n.translate('discover.openOptionsPopover.gotToAllSettings', { + defaultMessage: 'All Discover options', + })} + + ); } +function onClose() { + ReactDOM.unmountComponentAtNode(container); + document.body.removeChild(container); + isOpen = false; +} + export function openOptionsPopover({ I18nContext, anchorElement, @@ -90,17 +118,11 @@ export function openOptionsPopover({ anchorElement: HTMLElement; }) { if (isOpen) { + onClose(); return; } isOpen = true; - const container = document.createElement('div'); - const onClose = () => { - ReactDOM.unmountComponentAtNode(container); - document.body.removeChild(container); - isOpen = false; - }; - document.body.appendChild(container); const element = ( diff --git a/src/plugins/discover/public/application/components/top_nav/open_search_panel.test.tsx b/src/plugins/discover/public/application/apps/main/components/top_nav/open_search_panel.test.tsx similarity index 93% rename from src/plugins/discover/public/application/components/top_nav/open_search_panel.test.tsx rename to src/plugins/discover/public/application/apps/main/components/top_nav/open_search_panel.test.tsx index 856d8c5f712362..b34abab728eb19 100644 --- a/src/plugins/discover/public/application/components/top_nav/open_search_panel.test.tsx +++ b/src/plugins/discover/public/application/apps/main/components/top_nav/open_search_panel.test.tsx @@ -9,7 +9,7 @@ import React from 'react'; import { shallow } from 'enzyme'; -jest.mock('../../../kibana_services', () => { +jest.mock('../../../../../kibana_services', () => { return { getServices: () => ({ core: { uiSettings: {}, savedObjects: {} }, diff --git a/src/plugins/discover/public/application/components/top_nav/open_search_panel.tsx b/src/plugins/discover/public/application/apps/main/components/top_nav/open_search_panel.tsx similarity index 95% rename from src/plugins/discover/public/application/components/top_nav/open_search_panel.tsx rename to src/plugins/discover/public/application/apps/main/components/top_nav/open_search_panel.tsx index f6881d1856566a..e63f010a8dffc1 100644 --- a/src/plugins/discover/public/application/components/top_nav/open_search_panel.tsx +++ b/src/plugins/discover/public/application/apps/main/components/top_nav/open_search_panel.tsx @@ -20,8 +20,8 @@ import { EuiFlyoutBody, EuiTitle, } from '@elastic/eui'; -import { SavedObjectFinderUi } from '../../../../../saved_objects/public'; -import { getServices } from '../../../kibana_services'; +import { SavedObjectFinderUi } from '../../../../../../../saved_objects/public'; +import { getServices } from '../../../../../kibana_services'; const SEARCH_OBJECT_TYPE = 'search'; diff --git a/src/plugins/discover/public/application/components/top_nav/show_open_search_panel.tsx b/src/plugins/discover/public/application/apps/main/components/top_nav/show_open_search_panel.tsx similarity index 100% rename from src/plugins/discover/public/application/components/top_nav/show_open_search_panel.tsx rename to src/plugins/discover/public/application/apps/main/components/top_nav/show_open_search_panel.tsx diff --git a/src/plugins/discover/public/application/angular/directives/uninitialized.tsx b/src/plugins/discover/public/application/apps/main/components/uninitialized/uninitialized.tsx similarity index 100% rename from src/plugins/discover/public/application/angular/directives/uninitialized.tsx rename to src/plugins/discover/public/application/apps/main/components/uninitialized/uninitialized.tsx diff --git a/src/plugins/discover/public/application/apps/main/discover_main_app.test.tsx b/src/plugins/discover/public/application/apps/main/discover_main_app.test.tsx new file mode 100644 index 00000000000000..0caa5f3f527c67 --- /dev/null +++ b/src/plugins/discover/public/application/apps/main/discover_main_app.test.tsx @@ -0,0 +1,46 @@ +/* + * 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 React from 'react'; +import { mountWithIntl } from '@kbn/test/jest'; +import { indexPatternMock } from '../../../__mocks__/index_pattern'; +import { DiscoverMainApp } from './discover_main_app'; +import { discoverServiceMock } from '../../../__mocks__/services'; +import { savedSearchMock } from '../../../__mocks__/saved_search'; +import { createSearchSessionMock } from '../../../__mocks__/search_session'; +import { SavedObject } from '../../../../../../core/types'; +import { IndexPatternAttributes } from '../../../../../data/common'; +import { setHeaderActionMenuMounter } from '../../../kibana_services'; +import { findTestSubject } from '@elastic/eui/lib/test'; + +setHeaderActionMenuMounter(jest.fn()); + +describe('DiscoverMainApp', () => { + test('renders', () => { + const { history } = createSearchSessionMock(); + const indexPatternList = ([indexPatternMock].map((ip) => { + return { ...ip, ...{ attributes: { title: ip.title } } }; + }) as unknown) as Array>; + + const component = mountWithIntl( + + ); + + expect(findTestSubject(component, 'indexPattern-switch-link').text()).toBe( + indexPatternMock.title + ); + }); +}); diff --git a/src/plugins/discover/public/application/apps/main/discover_main_app.tsx b/src/plugins/discover/public/application/apps/main/discover_main_app.tsx new file mode 100644 index 00000000000000..5cc7147b49ff98 --- /dev/null +++ b/src/plugins/discover/public/application/apps/main/discover_main_app.tsx @@ -0,0 +1,145 @@ +/* + * 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 React, { useMemo, useCallback, useEffect } from 'react'; +import { History } from 'history'; +import { DiscoverLayout } from './components/layout'; +import { SEARCH_FIELDS_FROM_SOURCE } from '../../../../common'; +import { useSavedSearch as useSavedSearchData } from './services/use_saved_search'; +import { setBreadcrumbsTitle } from '../../helpers/breadcrumbs'; +import { addHelpMenuToAppChrome } from '../../components/help_menu/help_menu_util'; +import { useDiscoverState } from './services/use_discover_state'; +import { useSearchSession } from './services/use_search_session'; +import { useUrl } from './services/use_url'; +import { IndexPattern, IndexPatternAttributes, SavedObject } from '../../../../../data/common'; +import { DiscoverServices } from '../../../build_services'; +import { SavedSearch } from '../../../saved_searches'; + +const DiscoverLayoutMemoized = React.memo(DiscoverLayout); + +export interface DiscoverMainProps { + /** + * Current IndexPattern + */ + indexPattern: IndexPattern; + + opts: { + /** + * Use angular router for navigation + */ + navigateTo: () => void; + /** + * Instance of browser history + */ + history: History; + /** + * List of available index patterns + */ + indexPatternList: Array>; + /** + * Kibana core services used by discover + */ + services: DiscoverServices; + /** + * Current instance of SavedSearch + */ + savedSearch: SavedSearch; + }; +} + +export function DiscoverMainApp(props: DiscoverMainProps) { + const { services, history, navigateTo, indexPatternList } = props.opts; + const { chrome, docLinks, uiSettings: config, data } = services; + + const useNewFieldsApi = useMemo(() => !config.get(SEARCH_FIELDS_FROM_SOURCE), [config]); + + /** + * State related logic + */ + const { + stateContainer, + state, + indexPattern, + searchSource, + savedSearch, + resetSavedSearch, + } = useDiscoverState({ + services, + history, + initialIndexPattern: props.indexPattern, + initialSavedSearch: props.opts.savedSearch, + }); + + /** + * Url / Routing logic + */ + useUrl({ history, resetSavedSearch }); + + /** + * Search session logic + */ + const searchSessionManager = useSearchSession({ services, history, stateContainer, savedSearch }); + + /** + * Data fetching logic + */ + const { data$, refetch$ } = useSavedSearchData({ + indexPattern, + savedSearch, + searchSessionManager, + searchSource, + services, + state, + stateContainer, + useNewFieldsApi, + }); + + /** + * SavedSearch depended initializing + */ + useEffect(() => { + const pageTitleSuffix = savedSearch.id && savedSearch.title ? `: ${savedSearch.title}` : ''; + chrome.docTitle.change(`Discover${pageTitleSuffix}`); + setBreadcrumbsTitle(savedSearch, chrome); + return () => { + data.search.session.clear(); + }; + }, [savedSearch, chrome, docLinks, refetch$, stateContainer, data, config]); + + /** + * Initializing syncing with state and help menu + */ + useEffect(() => { + addHelpMenuToAppChrome(chrome, docLinks); + stateContainer.replaceUrlAppState({}).then(() => { + stateContainer.startSync(); + }); + + return () => stateContainer.stopSync(); + }, [stateContainer, chrome, docLinks]); + + const resetQuery = useCallback(() => { + resetSavedSearch(savedSearch.id); + }, [resetSavedSearch, savedSearch]); + + return ( + + ); +} diff --git a/src/plugins/vis_type_xy/server/index.ts b/src/plugins/discover/public/application/apps/main/index.ts similarity index 76% rename from src/plugins/vis_type_xy/server/index.ts rename to src/plugins/discover/public/application/apps/main/index.ts index bfd8b7d28a98dd..af30b0c9534346 100644 --- a/src/plugins/vis_type_xy/server/index.ts +++ b/src/plugins/discover/public/application/apps/main/index.ts @@ -6,6 +6,4 @@ * Side Public License, v 1. */ -import { VisTypeXyServerPlugin } from './plugin'; - -export const plugin = () => new VisTypeXyServerPlugin(); +export { DiscoverMainApp } from './discover_main_app'; diff --git a/src/plugins/discover/public/application/angular/discover_search_session.test.ts b/src/plugins/discover/public/application/apps/main/services/discover_search_session.test.ts similarity index 83% rename from src/plugins/discover/public/application/angular/discover_search_session.test.ts rename to src/plugins/discover/public/application/apps/main/services/discover_search_session.test.ts index 8e6fb11acb9633..97c6ada3636d5d 100644 --- a/src/plugins/discover/public/application/angular/discover_search_session.test.ts +++ b/src/plugins/discover/public/application/apps/main/services/discover_search_session.test.ts @@ -6,20 +6,10 @@ * Side Public License, v 1. */ -import { DiscoverSearchSessionManager } from './discover_search_session'; -import { createMemoryHistory } from 'history'; -import { dataPluginMock } from '../../../../data/public/mocks'; -import { DataPublicPluginStart } from '../../../../data/public'; +import { createSearchSessionMock } from '../../../../__mocks__/search_session'; describe('DiscoverSearchSessionManager', () => { - const history = createMemoryHistory(); - const session = dataPluginMock.createStartContract().search.session as jest.Mocked< - DataPublicPluginStart['search']['session'] - >; - const searchSessionManager = new DiscoverSearchSessionManager({ - history, - session, - }); + const { history, session, searchSessionManager } = createSearchSessionMock(); beforeEach(() => { history.push('/'); diff --git a/src/plugins/discover/public/application/angular/discover_search_session.ts b/src/plugins/discover/public/application/apps/main/services/discover_search_session.ts similarity index 93% rename from src/plugins/discover/public/application/angular/discover_search_session.ts rename to src/plugins/discover/public/application/apps/main/services/discover_search_session.ts index a3cdfa42c40dd2..81ab578229d198 100644 --- a/src/plugins/discover/public/application/angular/discover_search_session.ts +++ b/src/plugins/discover/public/application/apps/main/services/discover_search_session.ts @@ -8,13 +8,13 @@ import { History } from 'history'; import { filter } from 'rxjs/operators'; -import { DataPublicPluginStart } from '../../../../data/public'; +import { DataPublicPluginStart } from '../../../../../../data/public'; import { createQueryParamObservable, getQueryParams, removeQueryParam, -} from '../../../../kibana_utils/public'; -import { SEARCH_SESSION_ID_QUERY_PARAM } from '../../url_generator'; +} from '../../../../../../kibana_utils/public'; +import { SEARCH_SESSION_ID_QUERY_PARAM } from '../../../../url_generator'; export interface DiscoverSearchSessionManagerDeps { history: History; diff --git a/src/plugins/discover/public/application/angular/discover_state.test.ts b/src/plugins/discover/public/application/apps/main/services/discover_state.test.ts similarity index 97% rename from src/plugins/discover/public/application/angular/discover_state.test.ts rename to src/plugins/discover/public/application/apps/main/services/discover_state.test.ts index ddb4e874ccc64b..11f6954af97b0e 100644 --- a/src/plugins/discover/public/application/angular/discover_state.test.ts +++ b/src/plugins/discover/public/application/apps/main/services/discover_state.test.ts @@ -13,9 +13,9 @@ import { createSearchSessionRestorationDataProvider, } from './discover_state'; import { createBrowserHistory, History } from 'history'; -import { dataPluginMock } from '../../../../data/public/mocks'; -import { SavedSearch } from '../../saved_searches'; -import { SEARCH_FIELDS_FROM_SOURCE } from '../../../common'; +import { dataPluginMock } from '../../../../../../data/public/mocks'; +import { SavedSearch } from '../../../../saved_searches'; +import { SEARCH_FIELDS_FROM_SOURCE } from '../../../../../common'; let history: History; let state: GetStateReturn; diff --git a/src/plugins/discover/public/application/angular/discover_state.ts b/src/plugins/discover/public/application/apps/main/services/discover_state.ts similarity index 95% rename from src/plugins/discover/public/application/angular/discover_state.ts rename to src/plugins/discover/public/application/apps/main/services/discover_state.ts index f71e3ac651f532..e90e62da16ba99 100644 --- a/src/plugins/discover/public/application/angular/discover_state.ts +++ b/src/plugins/discover/public/application/apps/main/services/discover_state.ts @@ -18,19 +18,19 @@ import { StateContainer, syncState, withNotifyOnErrors, -} from '../../../../kibana_utils/public'; +} from '../../../../../../kibana_utils/public'; import { DataPublicPluginStart, esFilters, Filter, Query, SearchSessionInfoProvider, -} from '../../../../data/public'; -import { migrateLegacyQuery } from '../helpers/migrate_legacy_query'; -import { DiscoverGridSettings } from '../components/discover_grid/types'; -import { DISCOVER_APP_URL_GENERATOR, DiscoverUrlGeneratorState } from '../../url_generator'; -import { SavedSearch } from '../../saved_searches'; -import { handleSourceColumnState } from './helpers'; +} from '../../../../../../data/public'; +import { migrateLegacyQuery } from '../../../helpers/migrate_legacy_query'; +import { DiscoverGridSettings } from '../../../components/discover_grid/types'; +import { DISCOVER_APP_URL_GENERATOR, DiscoverUrlGeneratorState } from '../../../../url_generator'; +import { SavedSearch } from '../../../../saved_searches'; +import { handleSourceColumnState } from '../../../angular/helpers'; export interface AppState { /** diff --git a/src/plugins/discover/public/application/apps/main/services/use_discover_state.test.ts b/src/plugins/discover/public/application/apps/main/services/use_discover_state.test.ts new file mode 100644 index 00000000000000..051a2d2dcd9cc7 --- /dev/null +++ b/src/plugins/discover/public/application/apps/main/services/use_discover_state.test.ts @@ -0,0 +1,82 @@ +/* + * 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 { renderHook, act } from '@testing-library/react-hooks'; +import { createSearchSessionMock } from '../../../../__mocks__/search_session'; +import { discoverServiceMock } from '../../../../__mocks__/services'; +import { savedSearchMock } from '../../../../__mocks__/saved_search'; +import { useDiscoverState } from './use_discover_state'; +import { indexPatternMock } from '../../../../__mocks__/index_pattern'; +import { SearchSource } from '../../../../../../data/common'; + +describe('test useDiscoverState', () => { + test('return is valid', async () => { + const { history } = createSearchSessionMock(); + + const { result } = renderHook(() => { + return useDiscoverState({ + services: discoverServiceMock, + history, + initialIndexPattern: indexPatternMock, + initialSavedSearch: savedSearchMock, + }); + }); + expect(result.current.state.index).toBe(indexPatternMock.id); + expect(result.current.stateContainer).toBeInstanceOf(Object); + expect(result.current.setState).toBeInstanceOf(Function); + expect(result.current.savedSearch.id).toBe(savedSearchMock.id); + expect(result.current.searchSource).toBeInstanceOf(SearchSource); + }); + + test('setState', async () => { + const { history } = createSearchSessionMock(); + + const { result } = renderHook(() => { + return useDiscoverState({ + services: discoverServiceMock, + history, + initialIndexPattern: indexPatternMock, + initialSavedSearch: savedSearchMock, + }); + }); + await act(async () => { + result.current.setState({ columns: ['123'] }); + }); + expect(result.current.state.columns).toEqual(['123']); + }); + + test('resetSavedSearch', async () => { + const { history } = createSearchSessionMock(); + + const { result, waitForValueToChange } = renderHook(() => { + return useDiscoverState({ + services: discoverServiceMock, + history, + initialIndexPattern: indexPatternMock, + initialSavedSearch: savedSearchMock, + }); + }); + + await act(async () => { + result.current.stateContainer.startSync(); + }); + + const initialColumns = result.current.state.columns; + await act(async () => { + result.current.setState({ columns: ['123'] }); + }); + expect(result.current.state.columns).toEqual(['123']); + + result.current.resetSavedSearch('the-saved-search-id'); + await waitForValueToChange(() => { + return result.current.state; + }); + + expect(result.current.state.columns).toEqual(initialColumns); + }); +}); diff --git a/src/plugins/discover/public/application/apps/main/services/use_discover_state.ts b/src/plugins/discover/public/application/apps/main/services/use_discover_state.ts new file mode 100644 index 00000000000000..a3546d54cd4932 --- /dev/null +++ b/src/plugins/discover/public/application/apps/main/services/use_discover_state.ts @@ -0,0 +1,155 @@ +/* + * 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 { useMemo, useEffect, useState, useCallback } from 'react'; +import { cloneDeep } from 'lodash'; +import { History } from 'history'; +import { getState } from './discover_state'; +import { getStateDefaults } from '../utils/get_state_defaults'; +import { + esFilters, + connectToQueryState, + syncQueryStateWithUrl, + IndexPattern, +} from '../../../../../../data/public'; +import { DiscoverServices } from '../../../../build_services'; +import { SavedSearch } from '../../../../saved_searches'; +import { loadIndexPattern } from '../utils/resolve_index_pattern'; + +export function useDiscoverState({ + services, + history, + initialIndexPattern, + initialSavedSearch, +}: { + services: DiscoverServices; + initialSavedSearch: SavedSearch; + history: History; + initialIndexPattern: IndexPattern; +}) { + const { uiSettings: config, data, filterManager } = services; + const [indexPattern, setIndexPattern] = useState(initialIndexPattern); + const [savedSearch, setSavedSearch] = useState(initialSavedSearch); + + const searchSource = useMemo(() => { + savedSearch.searchSource.setField('index', indexPattern); + return savedSearch.searchSource.createChild(); + }, [savedSearch.searchSource, indexPattern]); + + const stateContainer = useMemo( + () => + getState({ + getStateDefaults: () => + getStateDefaults({ + config, + data, + savedSearch, + }), + storeInSessionStorage: config.get('state:storeInSessionStorage'), + history, + toasts: services.core.notifications.toasts, + uiSettings: config, + }), + [config, data, history, savedSearch, services.core.notifications.toasts] + ); + + const { appStateContainer, getPreviousAppState } = stateContainer; + + const [state, setState] = useState(appStateContainer.getState()); + + useEffect(() => { + if (stateContainer.appStateContainer.getState().index !== indexPattern.id) { + // used index pattern is different than the given by url/state which is invalid + stateContainer.setAppState({ index: indexPattern.id }); + } + // sync initial app filters from state to filterManager + const filters = appStateContainer.getState().filters; + if (filters) { + filterManager.setAppFilters(cloneDeep(filters)); + } + const query = appStateContainer.getState().query; + if (query) { + data.query.queryString.setQuery(query); + } + + const stopSyncingQueryAppStateWithStateContainer = connectToQueryState( + data.query, + appStateContainer, + { + filters: esFilters.FilterStateStore.APP_STATE, + query: true, + } + ); + + // syncs `_g` portion of url with query services + const { stop: stopSyncingGlobalStateWithUrl } = syncQueryStateWithUrl( + data.query, + stateContainer.kbnUrlStateStorage + ); + return () => { + stopSyncingQueryAppStateWithStateContainer(); + stopSyncingGlobalStateWithUrl(); + }; + }, [ + appStateContainer, + config, + data.query, + data.search.session, + getPreviousAppState, + indexPattern.id, + filterManager, + services.indexPatterns, + stateContainer, + ]); + + useEffect(() => { + const unsubscribe = stateContainer.appStateContainer.subscribe(async (nextState) => { + // NOTE: this is also called when navigating from discover app to context app + if (nextState.index && state.index !== nextState.index) { + const nextIndexPattern = await loadIndexPattern( + nextState.index, + services.indexPatterns, + config + ); + + if (nextIndexPattern) { + setIndexPattern(nextIndexPattern.loaded); + } + } + setState(nextState); + }); + return () => unsubscribe(); + }, [config, services.indexPatterns, state.index, stateContainer.appStateContainer, setState]); + + const resetSavedSearch = useCallback( + async (id?: string) => { + const newSavedSearch = await services.getSavedSearchById(id); + newSavedSearch.searchSource.setField('index', indexPattern); + const newAppState = getStateDefaults({ + config, + data, + savedSearch: newSavedSearch, + }); + await stateContainer.replaceUrlAppState(newAppState); + setState(newAppState); + if (savedSearch.id !== newSavedSearch.id) { + setSavedSearch(newSavedSearch); + } + }, + [services, indexPattern, config, data, stateContainer, savedSearch.id] + ); + + return { + state, + setState, + stateContainer, + indexPattern, + searchSource, + savedSearch, + resetSavedSearch, + }; +} diff --git a/src/plugins/discover/public/application/apps/main/services/use_saved_search.test.ts b/src/plugins/discover/public/application/apps/main/services/use_saved_search.test.ts new file mode 100644 index 00000000000000..5976c8fea5ea4f --- /dev/null +++ b/src/plugins/discover/public/application/apps/main/services/use_saved_search.test.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 { Subject } from 'rxjs'; +import { renderHook } from '@testing-library/react-hooks'; +import { createSearchSessionMock } from '../../../../__mocks__/search_session'; +import { discoverServiceMock } from '../../../../__mocks__/services'; +import { savedSearchMock } from '../../../../__mocks__/saved_search'; +import { indexPatternMock } from '../../../../__mocks__/index_pattern'; +import { useSavedSearch } from './use_saved_search'; +import { AppState, getState } from './discover_state'; +import { uiSettingsMock } from '../../../../__mocks__/ui_settings'; +import { useDiscoverState } from './use_discover_state'; + +describe('test useSavedSearch', () => { + test('useSavedSearch return is valid', async () => { + const { history, searchSessionManager } = createSearchSessionMock(); + const stateContainer = getState({ + getStateDefaults: () => ({ index: 'the-index-pattern-id' }), + history, + uiSettings: uiSettingsMock, + }); + + const { result } = renderHook(() => { + return useSavedSearch({ + indexPattern: indexPatternMock, + savedSearch: savedSearchMock, + searchSessionManager, + searchSource: savedSearchMock.searchSource.createCopy(), + services: discoverServiceMock, + state: {} as AppState, + stateContainer, + useNewFieldsApi: true, + }); + }); + + expect(result.current.refetch$).toBeInstanceOf(Subject); + expect(result.current.data$.value).toMatchInlineSnapshot(` + Object { + "state": "loading", + } + `); + }); + test('refetch$ triggers a search', async () => { + const { history, searchSessionManager } = createSearchSessionMock(); + const stateContainer = getState({ + getStateDefaults: () => ({ index: 'the-index-pattern-id' }), + history, + uiSettings: uiSettingsMock, + }); + + discoverServiceMock.data.query.timefilter.timefilter.getTime = jest.fn(() => { + return { from: '2021-05-01T20:00:00Z', to: '2021-05-02T20:00:00Z' }; + }); + + const { result: resultState } = renderHook(() => { + return useDiscoverState({ + services: discoverServiceMock, + history, + initialIndexPattern: indexPatternMock, + initialSavedSearch: savedSearchMock, + }); + }); + + const { result, waitForValueToChange } = renderHook(() => { + return useSavedSearch({ + indexPattern: indexPatternMock, + savedSearch: savedSearchMock, + searchSessionManager, + searchSource: resultState.current.searchSource, + services: discoverServiceMock, + state: {} as AppState, + stateContainer, + useNewFieldsApi: true, + }); + }); + + result.current.refetch$.next(); + + await waitForValueToChange(() => { + return result.current.data$.value.state === 'complete'; + }); + + expect(result.current.data$.value.hits).toBe(0); + expect(result.current.data$.value.rows).toEqual([]); + }); +}); diff --git a/src/plugins/discover/public/application/apps/main/services/use_saved_search.ts b/src/plugins/discover/public/application/apps/main/services/use_saved_search.ts new file mode 100644 index 00000000000000..2b0d9517248694 --- /dev/null +++ b/src/plugins/discover/public/application/apps/main/services/use_saved_search.ts @@ -0,0 +1,337 @@ +/* + * 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 { useEffect, useRef, useCallback, useMemo } from 'react'; +import { i18n } from '@kbn/i18n'; +import { merge, Subject, BehaviorSubject } from 'rxjs'; +import { debounceTime, tap, filter } from 'rxjs/operators'; +import { isEqual } from 'lodash'; +import { DiscoverServices } from '../../../../build_services'; +import { DiscoverSearchSessionManager } from './discover_search_session'; +import { + IndexPattern, + isCompleteResponse, + SearchSource, + tabifyAggResponse, +} from '../../../../../../data/common'; +import { SavedSearch } from '../../../../saved_searches'; +import { AppState, GetStateReturn } from './discover_state'; +import { ElasticSearchHit } from '../../../doc_views/doc_views_types'; +import { RequestAdapter } from '../../../../../../inspector/public'; +import { AutoRefreshDoneFn, search } from '../../../../../../data/public'; +import { calcFieldCounts } from '../utils/calc_field_counts'; +import { SEARCH_ON_PAGE_LOAD_SETTING } from '../../../../../common'; +import { validateTimeRange } from '../utils/validate_time_range'; +import { updateSearchSource } from '../utils/update_search_source'; +import { SortOrder } from '../../../../saved_searches/types'; +import { getDimensions, getChartAggConfigs } from '../utils'; +import { buildPointSeriesData, Chart } from '../components/chart/point_series'; +import { TimechartBucketInterval } from '../components/timechart_header/timechart_header'; +import { useSingleton } from '../utils/use_singleton'; +import { FetchStatus } from '../../../types'; + +export type SavedSearchDataSubject = BehaviorSubject; +export type SavedSearchRefetchSubject = Subject; + +export interface UseSavedSearch { + refetch$: SavedSearchRefetchSubject; + data$: SavedSearchDataSubject; +} + +export type SavedSearchRefetchMsg = 'reset' | undefined; + +export interface SavedSearchDataMessage { + bucketInterval?: TimechartBucketInterval; + chartData?: Chart; + fetchCounter?: number; + fetchError?: Error; + fieldCounts?: Record; + hits?: number; + inspectorAdapters?: { requests: RequestAdapter }; + rows?: ElasticSearchHit[]; + state: FetchStatus; +} + +/** + * This hook return 2 observables, refetch$ allows to trigger data fetching, data$ to subscribe + * to the data fetching + * @param indexPattern + * @param savedSearch + * @param searchSessionManager + * @param searchSource + * @param services + * @param state + * @param stateContainer + * @param useNewFieldsApi + */ +export const useSavedSearch = ({ + indexPattern, + savedSearch, + searchSessionManager, + searchSource, + services, + state, + stateContainer, + useNewFieldsApi, +}: { + indexPattern: IndexPattern; + savedSearch: SavedSearch; + searchSessionManager: DiscoverSearchSessionManager; + searchSource: SearchSource; + services: DiscoverServices; + state: AppState; + stateContainer: GetStateReturn; + useNewFieldsApi: boolean; +}): UseSavedSearch => { + const { data, filterManager, uiSettings } = services; + const timefilter = data.query.timefilter.timefilter; + + const initFetchState: FetchStatus = useMemo(() => { + // A saved search is created on every page load, so we check the ID to see if we're loading a + // previously saved search or if it is just transient + const shouldSearchOnPageLoad = + uiSettings.get(SEARCH_ON_PAGE_LOAD_SETTING) || + savedSearch.id !== undefined || + timefilter.getRefreshInterval().pause === false || + searchSessionManager.hasSearchSessionIdInURL(); + return shouldSearchOnPageLoad ? FetchStatus.LOADING : FetchStatus.UNINITIALIZED; + }, [uiSettings, savedSearch.id, searchSessionManager, timefilter]); + + /** + * The observable the UI (aka React component) subscribes to get notified about + * the changes in the data fetching process (high level: fetching started, data was received) + */ + const data$: SavedSearchDataSubject = useSingleton( + () => + new BehaviorSubject({ + state: initFetchState, + }) + ); + /** + * The observable to trigger data fetching in UI + * By refetch$.next('reset') rows and fieldcounts are reset to allow e.g. editing of runtime fields + * to be processed correctly + */ + const refetch$ = useSingleton(() => new Subject()); + + /** + * Values that shouldn't trigger re-rendering when changed + */ + const refs = useRef<{ + abortController?: AbortController; + /** + * used to compare a new state against an old one, to evaluate if data needs to be fetched + */ + appState: AppState; + /** + * handler emitted by `timefilter.getAutoRefreshFetch$()` + * to notify when data completed loading and to start a new autorefresh loop + */ + autoRefreshDoneCb?: AutoRefreshDoneFn; + fetchCounter: number; + /** + * needed to right auto refresh behavior, a new auto refresh shouldnt be triggered when + * loading is still ongoing + */ + fetchStatus: FetchStatus; + /** + * needed for merging new with old field counts, high likely legacy, but kept this behavior + * because not 100% sure in this case + */ + fieldCounts: Record; + }>({ + appState: state, + fetchCounter: 0, + fieldCounts: {}, + fetchStatus: initFetchState, + }); + + const fetchAll = useCallback( + (reset = false) => { + if (!validateTimeRange(timefilter.getTime(), services.toastNotifications)) { + return Promise.reject(); + } + const inspectorAdapters = { requests: new RequestAdapter() }; + + if (refs.current.abortController) refs.current.abortController.abort(); + refs.current.abortController = new AbortController(); + const sessionId = searchSessionManager.getNextSearchSessionId(); + + // Let the UI know, data fetching started + const loadingMessage: SavedSearchDataMessage = { + state: FetchStatus.LOADING, + fetchCounter: ++refs.current.fetchCounter, + }; + + if (reset) { + // when runtime field was added, changed, deleted, index pattern was switched + loadingMessage.rows = []; + loadingMessage.fieldCounts = {}; + loadingMessage.chartData = undefined; + loadingMessage.bucketInterval = undefined; + } + data$.next(loadingMessage); + refs.current.fetchStatus = loadingMessage.state; + + const { sort } = stateContainer.appStateContainer.getState(); + updateSearchSource(searchSource, false, { + indexPattern, + services, + sort: sort as SortOrder[], + useNewFieldsApi, + }); + const chartAggConfigs = + indexPattern.timeFieldName && !state.hideChart && state.interval + ? getChartAggConfigs(searchSource, state.interval, data) + : undefined; + + if (!chartAggConfigs) { + searchSource.removeField('aggs'); + } else { + searchSource.setField('aggs', chartAggConfigs.toDsl()); + } + + const searchSourceFetch$ = searchSource.fetch$({ + abortSignal: refs.current.abortController.signal, + sessionId, + inspector: { + adapter: inspectorAdapters.requests, + title: i18n.translate('discover.inspectorRequestDataTitle', { + defaultMessage: 'data', + }), + description: i18n.translate('discover.inspectorRequestDescriptionDocument', { + defaultMessage: 'This request queries Elasticsearch to fetch the data for the search.', + }), + }, + }); + + searchSourceFetch$.pipe(filter((res) => isCompleteResponse(res))).subscribe( + (res) => { + const documents = res.rawResponse.hits.hits; + + const message: SavedSearchDataMessage = { + state: FetchStatus.COMPLETE, + rows: documents, + inspectorAdapters, + fieldCounts: calcFieldCounts( + reset ? {} : refs.current.fieldCounts, + documents, + indexPattern + ), + hits: res.rawResponse.hits.total as number, + }; + + if (chartAggConfigs) { + const bucketAggConfig = chartAggConfigs!.aggs[1]; + const tabifiedData = tabifyAggResponse(chartAggConfigs, res.rawResponse); + const dimensions = getDimensions(chartAggConfigs, data); + if (dimensions) { + if (bucketAggConfig && search.aggs.isDateHistogramBucketAggConfig(bucketAggConfig)) { + message.bucketInterval = bucketAggConfig.buckets?.getInterval(); + } + message.chartData = buildPointSeriesData(tabifiedData, dimensions); + } + } + refs.current.fieldCounts = message.fieldCounts!; + refs.current.fetchStatus = message.state; + data$.next(message); + }, + (error) => { + if (error instanceof Error && error.name === 'AbortError') return; + data.search.showError(error); + refs.current.fetchStatus = FetchStatus.ERROR; + data$.next({ + state: FetchStatus.ERROR, + inspectorAdapters, + fetchError: error, + }); + }, + () => { + refs.current.autoRefreshDoneCb?.(); + refs.current.autoRefreshDoneCb = undefined; + } + ); + }, + [ + timefilter, + services, + stateContainer.appStateContainer, + searchSource, + indexPattern, + useNewFieldsApi, + state.hideChart, + state.interval, + data, + searchSessionManager, + data$, + ] + ); + + /** + * This part takes care of triggering the data fetching by creating and subscribing + * to an observable of various possible changes in state + */ + useEffect(() => { + const fetch$ = merge( + refetch$, + filterManager.getFetches$(), + timefilter.getFetch$(), + timefilter.getAutoRefreshFetch$().pipe( + tap((done) => { + refs.current.autoRefreshDoneCb = done; + }), + filter(() => refs.current.fetchStatus !== FetchStatus.LOADING) + ), + data.query.queryString.getUpdates$(), + searchSessionManager.newSearchSessionIdFromURL$.pipe(filter((sessionId) => !!sessionId)) + ).pipe(debounceTime(100)); + + const subscription = fetch$.subscribe((val) => { + fetchAll(val === 'reset'); + }); + + return () => { + subscription.unsubscribe(); + }; + }, [ + data.query.queryString, + filterManager, + refetch$, + searchSessionManager.newSearchSessionIdFromURL$, + timefilter, + fetchAll, + ]); + + /** + * Track state changes that should trigger a fetch + */ + useEffect(() => { + const prevAppState = refs.current.appState; + + // chart was hidden, now it should be displayed, so data is needed + const chartDisplayChanged = state.hideChart !== prevAppState.hideChart && !state.hideChart; + const chartIntervalChanged = state.interval !== prevAppState.interval; + const docTableSortChanged = !isEqual(state.sort, prevAppState.sort); + const indexPatternChanged = !isEqual(state.index, prevAppState.index); + + refs.current.appState = state; + if (chartDisplayChanged || chartIntervalChanged || docTableSortChanged || indexPatternChanged) { + refetch$.next(indexPatternChanged ? 'reset' : undefined); + } + }, [refetch$, state.interval, state.sort, state]); + + useEffect(() => { + if (initFetchState === FetchStatus.LOADING) { + refetch$.next(); + } + }, [initFetchState, refetch$]); + + return { + refetch$, + data$, + }; +}; diff --git a/src/plugins/discover/public/application/apps/main/services/use_search_session.test.ts b/src/plugins/discover/public/application/apps/main/services/use_search_session.test.ts new file mode 100644 index 00000000000000..8aa6e0764d8ec7 --- /dev/null +++ b/src/plugins/discover/public/application/apps/main/services/use_search_session.test.ts @@ -0,0 +1,39 @@ +/* + * 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 { useSearchSession } from './use_search_session'; +import { renderHook } from '@testing-library/react-hooks'; +import { createSearchSessionMock } from '../../../../__mocks__/search_session'; +import { discoverServiceMock } from '../../../../__mocks__/services'; +import { savedSearchMock } from '../../../../__mocks__/saved_search'; +import { getState } from './discover_state'; +import { uiSettingsMock } from '../../../../__mocks__/ui_settings'; + +describe('test useSearchSession', () => { + test('getting the next session id', async () => { + const { history } = createSearchSessionMock(); + const stateContainer = getState({ + getStateDefaults: () => ({ index: 'test' }), + history, + uiSettings: uiSettingsMock, + }); + + const nextId = 'id'; + discoverServiceMock.data.search.session.start = jest.fn(() => nextId); + + const { result } = renderHook(() => { + return useSearchSession({ + services: discoverServiceMock, + history, + stateContainer, + savedSearch: savedSearchMock, + }); + }); + expect(result.current.getNextSearchSessionId()).toBe('id'); + }); +}); diff --git a/src/plugins/discover/public/application/apps/main/services/use_search_session.ts b/src/plugins/discover/public/application/apps/main/services/use_search_session.ts new file mode 100644 index 00000000000000..e37e8f6f338394 --- /dev/null +++ b/src/plugins/discover/public/application/apps/main/services/use_search_session.ts @@ -0,0 +1,65 @@ +/* + * 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 { useMemo, useEffect } from 'react'; +import { History } from 'history'; +import { DiscoverSearchSessionManager } from './discover_search_session'; +import { createSearchSessionRestorationDataProvider, GetStateReturn } from './discover_state'; +import { noSearchSessionStorageCapabilityMessage } from '../../../../../../data/public'; +import { DiscoverServices } from '../../../../build_services'; +import { SavedSearch } from '../../../../saved_searches'; + +export function useSearchSession({ + services, + history, + stateContainer, + savedSearch, +}: { + services: DiscoverServices; + stateContainer: GetStateReturn; + history: History; + savedSearch: SavedSearch; +}) { + const { data, capabilities } = services; + /** + * Search session logic + */ + const searchSessionManager = useMemo( + () => + new DiscoverSearchSessionManager({ + history, + session: data.search.session, + }), + [data.search.session, history] + ); + + useEffect(() => { + data.search.session.enableStorage( + createSearchSessionRestorationDataProvider({ + appStateContainer: stateContainer.appStateContainer, + data, + getSavedSearch: () => savedSearch, + }), + { + isDisabled: () => + capabilities.discover.storeSearchSession + ? { disabled: false } + : { + disabled: true, + reasonText: noSearchSessionStorageCapabilityMessage, + }, + } + ); + }, [ + capabilities.discover.storeSearchSession, + data, + savedSearch, + stateContainer.appStateContainer, + ]); + + return searchSessionManager; +} diff --git a/src/plugins/discover/public/application/apps/main/services/use_url.test.ts b/src/plugins/discover/public/application/apps/main/services/use_url.test.ts new file mode 100644 index 00000000000000..740ca2bd140d78 --- /dev/null +++ b/src/plugins/discover/public/application/apps/main/services/use_url.test.ts @@ -0,0 +1,27 @@ +/* + * 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 { renderHook } from '@testing-library/react-hooks'; +import { createSearchSessionMock } from '../../../../__mocks__/search_session'; +import { useUrl } from './use_url'; + +describe('test useUrl', () => { + test('resetSavedSearch is triggered once path it changed to /', () => { + const { history } = createSearchSessionMock(); + history.push('/view'); + const props = { + history, + resetSavedSearch: jest.fn(), + }; + renderHook(() => useUrl(props)); + history.push('/new'); + expect(props.resetSavedSearch).toHaveBeenCalledTimes(0); + + history.push('/'); + expect(props.resetSavedSearch).toHaveBeenCalledTimes(1); + }); +}); diff --git a/src/plugins/discover/public/application/apps/main/services/use_url.ts b/src/plugins/discover/public/application/apps/main/services/use_url.ts new file mode 100644 index 00000000000000..bc5554c35b36f7 --- /dev/null +++ b/src/plugins/discover/public/application/apps/main/services/use_url.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. + */ +import { useEffect } from 'react'; +import { History } from 'history'; +export function useUrl({ + history, + resetSavedSearch, +}: { + history: History; + resetSavedSearch: (val?: string) => void; +}) { + /** + * Url / Routing logic + */ + useEffect(() => { + // this listener is waiting for such a path http://localhost:5601/app/discover#/ + // which could be set through pressing "New" button in top nav or go to "Discover" plugin from the sidebar + // to reload the page in a right way + const unlistenHistoryBasePath = history.listen(({ pathname, search, hash }) => { + if (!search && !hash && pathname === '/') { + resetSavedSearch(); + } + }); + return () => unlistenHistoryBasePath(); + }, [history, resetSavedSearch]); +} diff --git a/src/plugins/discover/public/application/helpers/calc_field_counts.test.ts b/src/plugins/discover/public/application/apps/main/utils/calc_field_counts.test.ts similarity index 83% rename from src/plugins/discover/public/application/helpers/calc_field_counts.test.ts rename to src/plugins/discover/public/application/apps/main/utils/calc_field_counts.test.ts index cf12b336c5b580..bdea6611d3b7eb 100644 --- a/src/plugins/discover/public/application/helpers/calc_field_counts.test.ts +++ b/src/plugins/discover/public/application/apps/main/utils/calc_field_counts.test.ts @@ -7,14 +7,15 @@ */ import { calcFieldCounts } from './calc_field_counts'; -import { indexPatternMock } from '../../__mocks__/index_pattern'; +import { indexPatternMock } from '../../../../__mocks__/index_pattern'; +import { ElasticSearchHit } from '../../../doc_views/doc_views_types'; describe('calcFieldCounts', () => { test('returns valid field count data', async () => { - const rows = [ + const rows = ([ { _id: 1, _source: { message: 'test1', bytes: 20 } }, { _id: 2, _source: { name: 'test2', extension: 'jpg' } }, - ]; + ] as unknown) as ElasticSearchHit[]; const result = calcFieldCounts({}, rows, indexPatternMock); expect(result).toMatchInlineSnapshot(` Object { @@ -28,10 +29,10 @@ describe('calcFieldCounts', () => { `); }); test('updates field count data', async () => { - const rows = [ + const rows = ([ { _id: 1, _source: { message: 'test1', bytes: 20 } }, { _id: 2, _source: { name: 'test2', extension: 'jpg' } }, - ]; + ] as unknown) as ElasticSearchHit[]; const result = calcFieldCounts({ message: 2 }, rows, indexPatternMock); expect(result).toMatchInlineSnapshot(` Object { diff --git a/src/plugins/discover/public/application/helpers/calc_field_counts.ts b/src/plugins/discover/public/application/apps/main/utils/calc_field_counts.ts similarity index 84% rename from src/plugins/discover/public/application/helpers/calc_field_counts.ts rename to src/plugins/discover/public/application/apps/main/utils/calc_field_counts.ts index edeaa0b9bce52f..43c9a57a70f221 100644 --- a/src/plugins/discover/public/application/helpers/calc_field_counts.ts +++ b/src/plugins/discover/public/application/apps/main/utils/calc_field_counts.ts @@ -6,7 +6,8 @@ * Side Public License, v 1. */ -import { IndexPattern } from '../../kibana_services'; +import { IndexPattern } from '../../../../kibana_services'; +import { ElasticSearchHit } from '../../../doc_views/doc_views_types'; /** * This function is recording stats of the available fields, for usage in sidebar and sharing @@ -14,7 +15,7 @@ import { IndexPattern } from '../../kibana_services'; */ export function calcFieldCounts( counts = {} as Record, - rows: Array>, + rows: ElasticSearchHit[], indexPattern: IndexPattern ) { for (const hit of rows) { diff --git a/src/plugins/discover/public/application/apps/main/utils/get_chart_agg_config.test.ts b/src/plugins/discover/public/application/apps/main/utils/get_chart_agg_config.test.ts new file mode 100644 index 00000000000000..19820508746508 --- /dev/null +++ b/src/plugins/discover/public/application/apps/main/utils/get_chart_agg_config.test.ts @@ -0,0 +1,59 @@ +/* + * 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 { indexPatternWithTimefieldMock } from '../../../../__mocks__/index_pattern_with_timefield'; +import { SearchSource } from '../../../../../../data/public'; +import { dataPluginMock } from '../../../../../../data/public/mocks'; +import { getChartAggConfigs } from './get_chart_agg_configs'; + +describe('getChartAggConfigs', () => { + test('is working', () => { + const indexPattern = indexPatternWithTimefieldMock; + const setField = jest.fn(); + const searchSource = ({ + setField, + getField: (name: string) => { + if (name === 'index') { + return indexPattern; + } + }, + removeField: jest.fn(), + } as unknown) as SearchSource; + + const dataMock = dataPluginMock.createStartContract(); + + const aggsConfig = getChartAggConfigs(searchSource, 'auto', dataMock); + + expect(aggsConfig!.aggs).toMatchInlineSnapshot(` + Array [ + Object { + "enabled": true, + "id": "1", + "params": Object {}, + "schema": "metric", + "type": "count", + }, + Object { + "enabled": true, + "id": "2", + "params": Object { + "drop_partials": false, + "extended_bounds": Object {}, + "field": "timestamp", + "interval": "auto", + "min_doc_count": 1, + "scaleMetricValues": false, + "useNormalizedEsInterval": true, + "used_interval": "0ms", + }, + "schema": "segment", + "type": "date_histogram", + }, + ] + `); + }); +}); diff --git a/src/plugins/discover/public/application/components/histogram/apply_aggs_to_search_source.ts b/src/plugins/discover/public/application/apps/main/utils/get_chart_agg_configs.ts similarity index 60% rename from src/plugins/discover/public/application/components/histogram/apply_aggs_to_search_source.ts rename to src/plugins/discover/public/application/apps/main/utils/get_chart_agg_configs.ts index c5fb366f81c8cd..2665254027fd91 100644 --- a/src/plugins/discover/public/application/components/histogram/apply_aggs_to_search_source.ts +++ b/src/plugins/discover/public/application/apps/main/utils/get_chart_agg_configs.ts @@ -5,27 +5,19 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ -import { IndexPattern, SearchSource } from '../../../../../data/common'; -import { DataPublicPluginStart } from '../../../../../data/public'; +import { SearchSource } from '../../../../../../data/common'; +import { DataPublicPluginStart } from '../../../../../../data/public'; /** * Helper function to apply or remove aggregations to a given search source used for gaining data * for Discover's histogram vis */ -export function applyAggsToSearchSource( - enabled: boolean, +export function getChartAggConfigs( searchSource: SearchSource, histogramInterval: string, - indexPattern: IndexPattern, data: DataPublicPluginStart ) { - if (!enabled) { - if (searchSource.getField('aggs')) { - // clean up fields in case it was set before - searchSource.removeField('aggs'); - } - return; - } + const indexPattern = searchSource.getField('index')!; const visStateAggs = [ { type: 'count', @@ -41,10 +33,5 @@ export function applyAggsToSearchSource( }, }, ]; - const chartAggConfigs = data.search.aggs.createAggConfigs(indexPattern, visStateAggs); - - searchSource.setField('aggs', function () { - return chartAggConfigs.toDsl(); - }); - return chartAggConfigs; + return data.search.aggs.createAggConfigs(indexPattern, visStateAggs); } diff --git a/src/plugins/discover/public/application/apps/main/utils/get_dimensions.test.ts b/src/plugins/discover/public/application/apps/main/utils/get_dimensions.test.ts new file mode 100644 index 00000000000000..443fc634ba5430 --- /dev/null +++ b/src/plugins/discover/public/application/apps/main/utils/get_dimensions.test.ts @@ -0,0 +1,70 @@ +/* + * 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 { dataPluginMock } from '../../../../../../data/public/mocks'; + +import { getDimensions } from './get_dimensions'; +import { indexPatternWithTimefieldMock } from '../../../../__mocks__/index_pattern_with_timefield'; +import { SearchSource, calculateBounds } from '../../../../../../data/common'; +import { getChartAggConfigs } from './get_chart_agg_configs'; + +test('getDimensions', () => { + const indexPattern = indexPatternWithTimefieldMock; + const setField = jest.fn(); + const searchSource = ({ + setField, + removeField: jest.fn(), + getField: (name: string) => { + if (name === 'index') { + return indexPattern; + } + }, + } as unknown) as SearchSource; + + const dataMock = dataPluginMock.createStartContract(); + dataMock.query.timefilter.timefilter.getTime = () => { + return { from: '1991-03-29T08:04:00.694Z', to: '2021-03-29T07:04:00.695Z' }; + }; + dataMock.query.timefilter.timefilter.calculateBounds = (timeRange) => { + return calculateBounds(timeRange); + }; + + const aggsConfig = getChartAggConfigs(searchSource, 'auto', dataMock); + const actual = getDimensions(aggsConfig!, dataMock); + expect(actual).toMatchInlineSnapshot(` + Object { + "x": Object { + "accessor": 0, + "format": Object { + "id": "date", + "params": Object { + "pattern": "HH:mm:ss.SSS", + }, + }, + "label": "timestamp per 0 milliseconds", + "params": Object { + "bounds": Object { + "max": "2021-03-29T07:04:00.695Z", + "min": "1991-03-29T08:04:00.694Z", + }, + "date": true, + "format": "HH:mm:ss.SSS", + "interval": "P0D", + "intervalESUnit": "ms", + "intervalESValue": 0, + }, + }, + "y": Object { + "accessor": 1, + "format": Object { + "id": "number", + }, + "label": "Count", + }, + } + `); +}); diff --git a/src/plugins/discover/public/application/components/histogram/get_dimensions.ts b/src/plugins/discover/public/application/apps/main/utils/get_dimensions.ts similarity index 72% rename from src/plugins/discover/public/application/components/histogram/get_dimensions.ts rename to src/plugins/discover/public/application/apps/main/utils/get_dimensions.ts index 6743c1c8431b9b..40b378f1c16983 100644 --- a/src/plugins/discover/public/application/components/histogram/get_dimensions.ts +++ b/src/plugins/discover/public/application/apps/main/utils/get_dimensions.ts @@ -7,10 +7,14 @@ */ import moment from 'moment'; import dateMath from '@elastic/datemath'; -import { IAggConfigs, TimeRangeBounds } from '../../../../../data/common'; -import { DataPublicPluginStart, search } from '../../../../../data/public'; +import { IAggConfigs } from '../../../../../../data/common'; +import { DataPublicPluginStart, search } from '../../../../../../data/public'; +import { Dimensions, HistogramParamsBounds } from '../components/chart/point_series'; -export function getDimensions(aggs: IAggConfigs, data: DataPublicPluginStart) { +export function getDimensions( + aggs: IAggConfigs, + data: DataPublicPluginStart +): Dimensions | undefined { const [metric, agg] = aggs.aggs; const { from, to } = data.query.timefilter.timefilter.getTime(); agg.params.timeRange = { @@ -18,16 +22,16 @@ export function getDimensions(aggs: IAggConfigs, data: DataPublicPluginStart) { to: dateMath.parse(to, { roundUp: true }), }; const bounds = agg.params.timeRange - ? data.query.timefilter.timefilter.calculateBounds(agg.params.timeRange) + ? (data.query.timefilter.timefilter.calculateBounds( + agg.params.timeRange + ) as HistogramParamsBounds) : null; const buckets = search.aggs.isDateHistogramBucketAggConfig(agg) ? agg.buckets : undefined; - if (!buckets) { + if (!buckets || !bounds) { return; } - buckets.setBounds(bounds as TimeRangeBounds); - const { esUnit, esValue } = buckets.getInterval(); return { x: { @@ -40,7 +44,7 @@ export function getDimensions(aggs: IAggConfigs, data: DataPublicPluginStart) { intervalESValue: esValue, intervalESUnit: esUnit, format: buckets.getScaledDateFormat(), - bounds: buckets.getBounds(), + bounds, }, }, y: { diff --git a/src/plugins/discover/public/application/helpers/get_result_state.test.ts b/src/plugins/discover/public/application/apps/main/utils/get_result_state.test.ts similarity index 71% rename from src/plugins/discover/public/application/helpers/get_result_state.test.ts rename to src/plugins/discover/public/application/apps/main/utils/get_result_state.test.ts index 98e2b854ca5abe..512bc4240352c7 100644 --- a/src/plugins/discover/public/application/helpers/get_result_state.test.ts +++ b/src/plugins/discover/public/application/apps/main/utils/get_result_state.test.ts @@ -6,40 +6,40 @@ * Side Public License, v 1. */ import { getResultState, resultStatuses } from './get_result_state'; -import { fetchStatuses } from '../components/constants'; -import { ElasticSearchHit } from '../doc_views/doc_views_types'; +import { ElasticSearchHit } from '../../../doc_views/doc_views_types'; +import { FetchStatus } from '../../../types'; describe('getResultState', () => { test('fetching uninitialized', () => { - const actual = getResultState(fetchStatuses.UNINITIALIZED, []); + const actual = getResultState(FetchStatus.UNINITIALIZED, []); expect(actual).toBe(resultStatuses.UNINITIALIZED); }); test('fetching complete with no records', () => { - const actual = getResultState(fetchStatuses.COMPLETE, []); + const actual = getResultState(FetchStatus.COMPLETE, []); expect(actual).toBe(resultStatuses.NO_RESULTS); }); test('fetching ongoing aka loading', () => { - const actual = getResultState(fetchStatuses.LOADING, []); + const actual = getResultState(FetchStatus.LOADING, []); expect(actual).toBe(resultStatuses.LOADING); }); test('fetching ready', () => { const record = ({ _id: 123 } as unknown) as ElasticSearchHit; - const actual = getResultState(fetchStatuses.COMPLETE, [record]); + const actual = getResultState(FetchStatus.COMPLETE, [record]); expect(actual).toBe(resultStatuses.READY); }); test('re-fetching after already data is available', () => { const record = ({ _id: 123 } as unknown) as ElasticSearchHit; - const actual = getResultState(fetchStatuses.LOADING, [record]); + const actual = getResultState(FetchStatus.LOADING, [record]); expect(actual).toBe(resultStatuses.READY); }); test('after a fetch error when data was successfully fetched before ', () => { const record = ({ _id: 123 } as unknown) as ElasticSearchHit; - const actual = getResultState(fetchStatuses.ERROR, [record]); + const actual = getResultState(FetchStatus.ERROR, [record]); expect(actual).toBe(resultStatuses.READY); }); }); diff --git a/src/plugins/discover/public/application/helpers/get_result_state.ts b/src/plugins/discover/public/application/apps/main/utils/get_result_state.ts similarity index 73% rename from src/plugins/discover/public/application/helpers/get_result_state.ts rename to src/plugins/discover/public/application/apps/main/utils/get_result_state.ts index 6f69832f369fd1..80d25566ea5784 100644 --- a/src/plugins/discover/public/application/helpers/get_result_state.ts +++ b/src/plugins/discover/public/application/apps/main/utils/get_result_state.ts @@ -5,8 +5,8 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ -import { ElasticSearchHit } from '../doc_views/doc_views_types'; -import { fetchStatuses } from '../components/constants'; +import { ElasticSearchHit } from '../../../doc_views/doc_views_types'; +import { FetchStatus } from '../../../types'; export const resultStatuses = { UNINITIALIZED: 'uninitialized', @@ -19,13 +19,13 @@ export const resultStatuses = { * Returns the current state of the result, depends on fetchStatus and the given fetched rows * Determines what is displayed in Discover main view (loading view, data view, empty data view, ...) */ -export function getResultState(fetchStatus: string, rows: ElasticSearchHit[]) { - if (fetchStatus === fetchStatuses.UNINITIALIZED) { +export function getResultState(fetchStatus: FetchStatus, rows: ElasticSearchHit[]) { + if (fetchStatus === FetchStatus.UNINITIALIZED) { return resultStatuses.UNINITIALIZED; } const rowsEmpty = !Array.isArray(rows) || rows.length === 0; - if (rowsEmpty && fetchStatus === fetchStatuses.LOADING) return resultStatuses.LOADING; + if (rowsEmpty && fetchStatus === FetchStatus.LOADING) return resultStatuses.LOADING; else if (!rowsEmpty) return resultStatuses.READY; else return resultStatuses.NO_RESULTS; } diff --git a/src/plugins/discover/public/application/helpers/get_sharing_data.test.ts b/src/plugins/discover/public/application/apps/main/utils/get_sharing_data.test.ts similarity index 96% rename from src/plugins/discover/public/application/helpers/get_sharing_data.test.ts rename to src/plugins/discover/public/application/apps/main/utils/get_sharing_data.test.ts index 6a51c085ebbc98..ffad3d955c1a3c 100644 --- a/src/plugins/discover/public/application/helpers/get_sharing_data.test.ts +++ b/src/plugins/discover/public/application/apps/main/utils/get_sharing_data.test.ts @@ -8,9 +8,9 @@ import { Capabilities, IUiSettingsClient } from 'kibana/public'; import { IndexPattern } from 'src/plugins/data/public'; -import { createSearchSourceMock } from '../../../../data/common/search/search_source/mocks'; -import { DOC_HIDE_TIME_COLUMN_SETTING, SORT_DEFAULT_ORDER_SETTING } from '../../../common'; -import { indexPatternMock } from '../../__mocks__/index_pattern'; +import { createSearchSourceMock } from '../../../../../../data/common/search/search_source/mocks'; +import { DOC_HIDE_TIME_COLUMN_SETTING, SORT_DEFAULT_ORDER_SETTING } from '../../../../../common'; +import { indexPatternMock } from '../../../../__mocks__/index_pattern'; import { getSharingData, showPublicUrlSwitch } from './get_sharing_data'; describe('getSharingData', () => { diff --git a/src/plugins/discover/public/application/helpers/get_sharing_data.ts b/src/plugins/discover/public/application/apps/main/utils/get_sharing_data.ts similarity index 87% rename from src/plugins/discover/public/application/helpers/get_sharing_data.ts rename to src/plugins/discover/public/application/apps/main/utils/get_sharing_data.ts index 47be4b80371522..00473956c57e3a 100644 --- a/src/plugins/discover/public/application/helpers/get_sharing_data.ts +++ b/src/plugins/discover/public/application/apps/main/utils/get_sharing_data.ts @@ -7,11 +7,11 @@ */ import type { Capabilities, IUiSettingsClient } from 'kibana/public'; -import { ISearchSource } from '../../../../data/common'; -import { DOC_HIDE_TIME_COLUMN_SETTING, SORT_DEFAULT_ORDER_SETTING } from '../../../common'; -import type { SavedSearch, SortOrder } from '../../saved_searches/types'; -import { AppState } from '../angular/discover_state'; -import { getSortForSearchSource } from '../angular/doc_table'; +import { ISearchSource } from '../../../../../../data/common'; +import { DOC_HIDE_TIME_COLUMN_SETTING, SORT_DEFAULT_ORDER_SETTING } from '../../../../../common'; +import type { SavedSearch, SortOrder } from '../../../../saved_searches/types'; +import { AppState } from '../services/discover_state'; +import { getSortForSearchSource } from '../../../angular/doc_table'; /** * Preparing data to share the current state as link or CSV/Report diff --git a/src/plugins/discover/public/application/helpers/get_state_defaults.test.ts b/src/plugins/discover/public/application/apps/main/utils/get_state_defaults.test.ts similarity index 74% rename from src/plugins/discover/public/application/helpers/get_state_defaults.test.ts rename to src/plugins/discover/public/application/apps/main/utils/get_state_defaults.test.ts index 7ce5b9286c775c..17f1802a47327a 100644 --- a/src/plugins/discover/public/application/helpers/get_state_defaults.test.ts +++ b/src/plugins/discover/public/application/apps/main/utils/get_state_defaults.test.ts @@ -7,20 +7,19 @@ */ import { getStateDefaults } from './get_state_defaults'; -import { createSearchSourceMock, dataPluginMock } from '../../../../data/public/mocks'; -import { uiSettingsMock } from '../../__mocks__/ui_settings'; -import { indexPatternWithTimefieldMock } from '../../__mocks__/index_pattern_with_timefield'; -import { savedSearchMock } from '../../__mocks__/saved_search'; -import { indexPatternMock } from '../../__mocks__/index_pattern'; +import { createSearchSourceMock, dataPluginMock } from '../../../../../../data/public/mocks'; +import { uiSettingsMock } from '../../../../__mocks__/ui_settings'; +import { indexPatternWithTimefieldMock } from '../../../../__mocks__/index_pattern_with_timefield'; +import { savedSearchMock } from '../../../../__mocks__/saved_search'; +import { indexPatternMock } from '../../../../__mocks__/index_pattern'; describe('getStateDefaults', () => { test('index pattern with timefield', () => { + savedSearchMock.searchSource = createSearchSourceMock({ index: indexPatternWithTimefieldMock }); const actual = getStateDefaults({ config: uiSettingsMock, data: dataPluginMock.createStartContract(), - indexPattern: indexPatternWithTimefieldMock, savedSearch: savedSearchMock, - searchSource: createSearchSourceMock({ index: indexPatternWithTimefieldMock }), }); expect(actual).toMatchInlineSnapshot(` Object { @@ -42,12 +41,12 @@ describe('getStateDefaults', () => { }); test('index pattern without timefield', () => { + savedSearchMock.searchSource = createSearchSourceMock({ index: indexPatternMock }); + const actual = getStateDefaults({ config: uiSettingsMock, data: dataPluginMock.createStartContract(), - indexPattern: indexPatternMock, savedSearch: savedSearchMock, - searchSource: createSearchSourceMock({ index: indexPatternMock }), }); expect(actual).toMatchInlineSnapshot(` Object { diff --git a/src/plugins/discover/public/application/helpers/get_state_defaults.ts b/src/plugins/discover/public/application/apps/main/utils/get_state_defaults.ts similarity index 71% rename from src/plugins/discover/public/application/helpers/get_state_defaults.ts rename to src/plugins/discover/public/application/apps/main/utils/get_state_defaults.ts index 3e012a1f85fd6b..426272fa8ce1cf 100644 --- a/src/plugins/discover/public/application/helpers/get_state_defaults.ts +++ b/src/plugins/discover/public/application/apps/main/utils/get_state_defaults.ts @@ -8,14 +8,13 @@ import { cloneDeep } from 'lodash'; import { IUiSettingsClient } from 'kibana/public'; -import { DEFAULT_COLUMNS_SETTING, SORT_DEFAULT_ORDER_SETTING } from '../../../common'; -import { getSortArray } from '../angular/doc_table'; -import { getDefaultSort } from '../angular/doc_table/lib/get_default_sort'; -import { SavedSearch } from '../../saved_searches'; -import { SearchSource } from '../../../../data/common/search/search_source'; -import { DataPublicPluginStart, IndexPattern } from '../../../../data/public'; +import { DEFAULT_COLUMNS_SETTING, SORT_DEFAULT_ORDER_SETTING } from '../../../../../common'; +import { getSortArray } from '../../../angular/doc_table'; +import { getDefaultSort } from '../../../angular/doc_table/lib/get_default_sort'; +import { SavedSearch } from '../../../../saved_searches'; +import { DataPublicPluginStart } from '../../../../../../data/public'; -import { AppState } from '../angular/discover_state'; +import { AppState } from '../services/discover_state'; function getDefaultColumns(savedSearch: SavedSearch, config: IUiSettingsClient) { if (savedSearch.columns && savedSearch.columns.length > 0) { @@ -27,18 +26,16 @@ function getDefaultColumns(savedSearch: SavedSearch, config: IUiSettingsClient) export function getStateDefaults({ config, data, - indexPattern, savedSearch, - searchSource, }: { config: IUiSettingsClient; data: DataPublicPluginStart; - indexPattern: IndexPattern; savedSearch: SavedSearch; - searchSource: SearchSource; }) { + const searchSource = savedSearch.searchSource; + const indexPattern = savedSearch.searchSource.getField('index'); const query = searchSource.getField('query') || data.query.queryString.getDefaultQuery(); - const sort = getSortArray(savedSearch.sort, indexPattern); + const sort = getSortArray(savedSearch.sort, indexPattern!); const columns = getDefaultColumns(savedSearch, config); const defaultState = { @@ -47,7 +44,7 @@ export function getStateDefaults({ ? getDefaultSort(indexPattern, config.get(SORT_DEFAULT_ORDER_SETTING, 'desc')) : sort, columns, - index: indexPattern.id, + index: indexPattern!.id, interval: 'auto', filters: cloneDeep(searchSource.getOwnField('filter')), } as AppState; diff --git a/src/plugins/discover/public/application/helpers/get_switch_index_pattern_app_state.test.ts b/src/plugins/discover/public/application/apps/main/utils/get_switch_index_pattern_app_state.test.ts similarity index 98% rename from src/plugins/discover/public/application/helpers/get_switch_index_pattern_app_state.test.ts rename to src/plugins/discover/public/application/apps/main/utils/get_switch_index_pattern_app_state.test.ts index 31addd807b78dc..9f9071ed403ced 100644 --- a/src/plugins/discover/public/application/helpers/get_switch_index_pattern_app_state.test.ts +++ b/src/plugins/discover/public/application/apps/main/utils/get_switch_index_pattern_app_state.test.ts @@ -7,7 +7,7 @@ */ import { getSwitchIndexPatternAppState } from './get_switch_index_pattern_app_state'; -import { IndexPattern } from '../../../../data/common/index_patterns'; +import { IndexPattern } from '../../../../../../data/common/index_patterns'; /** * Helper function returning an index pattern diff --git a/src/plugins/discover/public/application/helpers/get_switch_index_pattern_app_state.ts b/src/plugins/discover/public/application/apps/main/utils/get_switch_index_pattern_app_state.ts similarity index 90% rename from src/plugins/discover/public/application/helpers/get_switch_index_pattern_app_state.ts rename to src/plugins/discover/public/application/apps/main/utils/get_switch_index_pattern_app_state.ts index 9756fc8fd448ba..f7154b26c7ed62 100644 --- a/src/plugins/discover/public/application/helpers/get_switch_index_pattern_app_state.ts +++ b/src/plugins/discover/public/application/apps/main/utils/get_switch_index_pattern_app_state.ts @@ -6,9 +6,9 @@ * Side Public License, v 1. */ -import { getSortArray } from '../angular/doc_table'; -import { SortPairArr } from '../angular/doc_table/lib/get_sort'; -import { IndexPattern } from '../../kibana_services'; +import { getSortArray } from '../../../angular/doc_table'; +import { SortPairArr } from '../../../angular/doc_table/lib/get_sort'; +import { IndexPattern } from '../../../../kibana_services'; /** * Helper function to remove or adapt the currently selected columns/sort to be valid with the next diff --git a/src/plugins/discover/public/application/components/histogram/index.ts b/src/plugins/discover/public/application/apps/main/utils/index.ts similarity index 84% rename from src/plugins/discover/public/application/components/histogram/index.ts rename to src/plugins/discover/public/application/apps/main/utils/index.ts index 4af75de0a029d8..a79dea526ec557 100644 --- a/src/plugins/discover/public/application/components/histogram/index.ts +++ b/src/plugins/discover/public/application/apps/main/utils/index.ts @@ -6,5 +6,5 @@ * Side Public License, v 1. */ -export { applyAggsToSearchSource } from './apply_aggs_to_search_source'; +export { getChartAggConfigs } from './get_chart_agg_configs'; export { getDimensions } from './get_dimensions'; diff --git a/src/plugins/discover/public/application/helpers/nested_fields.ts b/src/plugins/discover/public/application/apps/main/utils/nested_fields.ts similarity index 100% rename from src/plugins/discover/public/application/helpers/nested_fields.ts rename to src/plugins/discover/public/application/apps/main/utils/nested_fields.ts diff --git a/src/plugins/discover/public/application/helpers/persist_saved_search.ts b/src/plugins/discover/public/application/apps/main/utils/persist_saved_search.ts similarity index 75% rename from src/plugins/discover/public/application/helpers/persist_saved_search.ts rename to src/plugins/discover/public/application/apps/main/utils/persist_saved_search.ts index f44d4650da56a2..a5e1e2bb6c2ea6 100644 --- a/src/plugins/discover/public/application/helpers/persist_saved_search.ts +++ b/src/plugins/discover/public/application/apps/main/utils/persist_saved_search.ts @@ -7,12 +7,12 @@ */ import { updateSearchSource } from './update_search_source'; -import { IndexPattern } from '../../../../data/public'; -import { SavedSearch } from '../../saved_searches'; -import { AppState } from '../angular/discover_state'; -import { SortOrder } from '../../saved_searches/types'; -import { SavedObjectSaveOpts } from '../../../../saved_objects/public'; -import { DiscoverServices } from '../../build_services'; +import { IndexPattern } from '../../../../../../data/public'; +import { SavedSearch } from '../../../../saved_searches'; +import { AppState } from '../services/discover_state'; +import { SortOrder } from '../../../../saved_searches/types'; +import { SavedObjectSaveOpts } from '../../../../../../saved_objects/public'; +import { DiscoverServices } from '../../../../build_services'; /** * Helper function to update and persist the given savedSearch @@ -35,12 +35,10 @@ export async function persistSavedSearch( state: AppState; } ) { - updateSearchSource({ - persistentSearchSource: savedSearch.searchSource, + updateSearchSource(savedSearch.searchSource, true, { indexPattern, services, sort: state.sort as SortOrder[], - columns: state.columns || [], useNewFieldsApi: false, }); diff --git a/src/plugins/discover/public/application/helpers/resolve_index_pattern.test.ts b/src/plugins/discover/public/application/apps/main/utils/resolve_index_pattern.test.ts similarity index 89% rename from src/plugins/discover/public/application/helpers/resolve_index_pattern.test.ts rename to src/plugins/discover/public/application/apps/main/utils/resolve_index_pattern.test.ts index 50ff068086b0ac..9ebbeafd28e10e 100644 --- a/src/plugins/discover/public/application/helpers/resolve_index_pattern.test.ts +++ b/src/plugins/discover/public/application/apps/main/utils/resolve_index_pattern.test.ts @@ -11,9 +11,9 @@ import { getFallbackIndexPatternId, IndexPatternSavedObject, } from './resolve_index_pattern'; -import { indexPatternsMock } from '../../__mocks__/index_patterns'; -import { indexPatternMock } from '../../__mocks__/index_pattern'; -import { configMock } from '../../__mocks__/config'; +import { indexPatternsMock } from '../../../../__mocks__/index_patterns'; +import { indexPatternMock } from '../../../../__mocks__/index_pattern'; +import { configMock } from '../../../../__mocks__/config'; describe('Resolve index pattern tests', () => { test('returns valid data for an existing index pattern', async () => { diff --git a/src/plugins/discover/public/application/helpers/resolve_index_pattern.ts b/src/plugins/discover/public/application/apps/main/utils/resolve_index_pattern.ts similarity index 95% rename from src/plugins/discover/public/application/helpers/resolve_index_pattern.ts rename to src/plugins/discover/public/application/apps/main/utils/resolve_index_pattern.ts index 3e22917f3f482f..a5149ea2b3dd7b 100644 --- a/src/plugins/discover/public/application/helpers/resolve_index_pattern.ts +++ b/src/plugins/discover/public/application/apps/main/utils/resolve_index_pattern.ts @@ -8,8 +8,8 @@ import { i18n } from '@kbn/i18n'; import { IUiSettingsClient, SavedObject, ToastsStart } from 'kibana/public'; -import { IndexPattern } from '../../kibana_services'; -import { IndexPatternsService, SearchSource } from '../../../../data/common'; +import { IndexPattern } from '../../../../kibana_services'; +import { IndexPatternsContract, SearchSource } from '../../../../../../data/common'; export type IndexPatternSavedObject = SavedObject & { title: string }; @@ -77,7 +77,7 @@ export function getIndexPatternId( */ export async function loadIndexPattern( id: string, - indexPatterns: IndexPatternsService, + indexPatterns: IndexPatternsContract, config: IUiSettingsClient ): Promise { const indexPatternList = ((await indexPatterns.getCache()) as unknown) as IndexPatternSavedObject[]; diff --git a/src/plugins/discover/public/application/helpers/update_search_source.test.ts b/src/plugins/discover/public/application/apps/main/utils/update_search_source.test.ts similarity index 66% rename from src/plugins/discover/public/application/helpers/update_search_source.test.ts rename to src/plugins/discover/public/application/apps/main/utils/update_search_source.test.ts index d4e52c4e7d4fe8..9deabf96732b1e 100644 --- a/src/plugins/discover/public/application/helpers/update_search_source.test.ts +++ b/src/plugins/discover/public/application/apps/main/utils/update_search_source.test.ts @@ -7,25 +7,27 @@ */ import { updateSearchSource } from './update_search_source'; -import { createSearchSourceMock } from '../../../../data/common/search/search_source/mocks'; -import { indexPatternMock } from '../../__mocks__/index_pattern'; +import { createSearchSourceMock } from '../../../../../../data/common/search/search_source/mocks'; +import { indexPatternMock } from '../../../../__mocks__/index_pattern'; import { IUiSettingsClient } from 'kibana/public'; -import { DiscoverServices } from '../../build_services'; -import { dataPluginMock } from '../../../../data/public/mocks'; -import { SAMPLE_SIZE_SETTING } from '../../../common'; -import { SortOrder } from '../../saved_searches/types'; +import { DiscoverServices } from '../../../../build_services'; +import { dataPluginMock } from '../../../../../../data/public/mocks'; +import { SAMPLE_SIZE_SETTING } from '../../../../../common'; +import { SortOrder } from '../../../../saved_searches/types'; describe('updateSearchSource', () => { test('updates a given search source', async () => { const persistentSearchSourceMock = createSearchSourceMock({}); const volatileSearchSourceMock = createSearchSourceMock({}); + volatileSearchSourceMock.setParent(persistentSearchSourceMock); const sampleSize = 250; - updateSearchSource({ - persistentSearchSource: persistentSearchSourceMock, - volatileSearchSource: volatileSearchSourceMock, + updateSearchSource(volatileSearchSourceMock, false, { indexPattern: indexPatternMock, services: ({ data: dataPluginMock.createStartContract(), + timefilter: { + createFilter: jest.fn(), + }, uiSettings: ({ get: (key: string) => { if (key === SAMPLE_SIZE_SETTING) { @@ -36,7 +38,6 @@ describe('updateSearchSource', () => { } as unknown) as IUiSettingsClient, } as unknown) as DiscoverServices, sort: [] as SortOrder[], - columns: [], useNewFieldsApi: false, }); expect(persistentSearchSourceMock.getField('index')).toEqual(indexPatternMock); @@ -47,13 +48,15 @@ describe('updateSearchSource', () => { test('updates a given search source with the usage of the new fields api', async () => { const persistentSearchSourceMock = createSearchSourceMock({}); const volatileSearchSourceMock = createSearchSourceMock({}); + volatileSearchSourceMock.setParent(persistentSearchSourceMock); const sampleSize = 250; - updateSearchSource({ - persistentSearchSource: persistentSearchSourceMock, - volatileSearchSource: volatileSearchSourceMock, + updateSearchSource(volatileSearchSourceMock, false, { indexPattern: indexPatternMock, services: ({ data: dataPluginMock.createStartContract(), + timefilter: { + createFilter: jest.fn(), + }, uiSettings: ({ get: (key: string) => { if (key === SAMPLE_SIZE_SETTING) { @@ -64,41 +67,10 @@ describe('updateSearchSource', () => { } as unknown) as IUiSettingsClient, } as unknown) as DiscoverServices, sort: [] as SortOrder[], - columns: [], useNewFieldsApi: true, }); expect(persistentSearchSourceMock.getField('index')).toEqual(indexPatternMock); expect(volatileSearchSourceMock.getField('size')).toEqual(sampleSize); - expect(volatileSearchSourceMock.getField('fields')).toEqual([{ field: '*' }]); - expect(volatileSearchSourceMock.getField('fieldsFromSource')).toBe(undefined); - }); - - test('requests unmapped fields when the flag is provided, using the new fields api', async () => { - const persistentSearchSourceMock = createSearchSourceMock({}); - const volatileSearchSourceMock = createSearchSourceMock({}); - const sampleSize = 250; - updateSearchSource({ - persistentSearchSource: persistentSearchSourceMock, - volatileSearchSource: volatileSearchSourceMock, - indexPattern: indexPatternMock, - services: ({ - data: dataPluginMock.createStartContract(), - uiSettings: ({ - get: (key: string) => { - if (key === SAMPLE_SIZE_SETTING) { - return sampleSize; - } - return false; - }, - } as unknown) as IUiSettingsClient, - } as unknown) as DiscoverServices, - sort: [] as SortOrder[], - columns: [], - useNewFieldsApi: true, - showUnmappedFields: true, - }); - expect(persistentSearchSourceMock.getField('index')).toEqual(indexPatternMock); - expect(volatileSearchSourceMock.getField('size')).toEqual(sampleSize); expect(volatileSearchSourceMock.getField('fields')).toEqual([ { field: '*', include_unmapped: 'true' }, ]); @@ -108,13 +80,15 @@ describe('updateSearchSource', () => { test('updates a given search source when showUnmappedFields option is set to true', async () => { const persistentSearchSourceMock = createSearchSourceMock({}); const volatileSearchSourceMock = createSearchSourceMock({}); + volatileSearchSourceMock.setParent(persistentSearchSourceMock); const sampleSize = 250; - updateSearchSource({ - persistentSearchSource: persistentSearchSourceMock, - volatileSearchSource: volatileSearchSourceMock, + updateSearchSource(volatileSearchSourceMock, false, { indexPattern: indexPatternMock, services: ({ data: dataPluginMock.createStartContract(), + timefilter: { + createFilter: jest.fn(), + }, uiSettings: ({ get: (key: string) => { if (key === SAMPLE_SIZE_SETTING) { @@ -125,9 +99,7 @@ describe('updateSearchSource', () => { } as unknown) as IUiSettingsClient, } as unknown) as DiscoverServices, sort: [] as SortOrder[], - columns: [], useNewFieldsApi: true, - showUnmappedFields: true, }); expect(persistentSearchSourceMock.getField('index')).toEqual(indexPatternMock); expect(volatileSearchSourceMock.getField('size')).toEqual(sampleSize); @@ -140,13 +112,15 @@ describe('updateSearchSource', () => { test('does not explicitly request fieldsFromSource when not using fields API', async () => { const persistentSearchSourceMock = createSearchSourceMock({}); const volatileSearchSourceMock = createSearchSourceMock({}); + volatileSearchSourceMock.setParent(persistentSearchSourceMock); const sampleSize = 250; - updateSearchSource({ - persistentSearchSource: persistentSearchSourceMock, - volatileSearchSource: volatileSearchSourceMock, + updateSearchSource(volatileSearchSourceMock, false, { indexPattern: indexPatternMock, services: ({ data: dataPluginMock.createStartContract(), + timefilter: { + createFilter: jest.fn(), + }, uiSettings: ({ get: (key: string) => { if (key === SAMPLE_SIZE_SETTING) { @@ -157,9 +131,7 @@ describe('updateSearchSource', () => { } as unknown) as IUiSettingsClient, } as unknown) as DiscoverServices, sort: [] as SortOrder[], - columns: [], useNewFieldsApi: false, - showUnmappedFields: false, }); expect(persistentSearchSourceMock.getField('index')).toEqual(indexPatternMock); expect(volatileSearchSourceMock.getField('size')).toEqual(sampleSize); diff --git a/src/plugins/discover/public/application/helpers/update_search_source.ts b/src/plugins/discover/public/application/apps/main/utils/update_search_source.ts similarity index 50% rename from src/plugins/discover/public/application/helpers/update_search_source.ts rename to src/plugins/discover/public/application/apps/main/utils/update_search_source.ts index 07529ac8cb0d68..c72e207102e814 100644 --- a/src/plugins/discover/public/application/helpers/update_search_source.ts +++ b/src/plugins/discover/public/application/apps/main/utils/update_search_source.ts @@ -6,48 +6,47 @@ * Side Public License, v 1. */ -import { getSortForSearchSource } from '../angular/doc_table'; -import { SAMPLE_SIZE_SETTING, SORT_DEFAULT_ORDER_SETTING } from '../../../common'; -import { IndexPattern, ISearchSource } from '../../../../data/common/'; -import { SortOrder } from '../../saved_searches/types'; -import { DiscoverServices } from '../../build_services'; +import { getSortForSearchSource } from '../../../angular/doc_table'; +import { SAMPLE_SIZE_SETTING, SORT_DEFAULT_ORDER_SETTING } from '../../../../../common'; +import { IndexPattern, ISearchSource } from '../../../../../../data/common'; +import { SortOrder } from '../../../../saved_searches/types'; +import { DiscoverServices } from '../../../../build_services'; +import { indexPatterns as indexPatternsUtils } from '../../../../../../data/public'; /** * Helper function to update the given searchSource before fetching/sharing/persisting */ -export function updateSearchSource({ - indexPattern, - services, - sort, - columns, - useNewFieldsApi, - showUnmappedFields, - persistentSearchSource, - volatileSearchSource, -}: { - indexPattern: IndexPattern; - services: DiscoverServices; - sort: SortOrder[]; - columns: string[]; - useNewFieldsApi: boolean; - showUnmappedFields?: boolean; - persistentSearchSource: ISearchSource; - volatileSearchSource?: ISearchSource; -}) { +export function updateSearchSource( + searchSource: ISearchSource, + persist = true, + { + indexPattern, + services, + sort, + useNewFieldsApi, + }: { + indexPattern: IndexPattern; + services: DiscoverServices; + sort: SortOrder[]; + useNewFieldsApi: boolean; + } +) { const { uiSettings, data } = services; const usedSort = getSortForSearchSource( sort, indexPattern, uiSettings.get(SORT_DEFAULT_ORDER_SETTING) ); + const usedSearchSource = persist ? searchSource : searchSource.getParent()!; - persistentSearchSource + usedSearchSource .setField('index', indexPattern) .setField('query', data.query.queryString.getQuery() || null) .setField('filter', data.query.filterManager.getFilters()); - if (volatileSearchSource) { - volatileSearchSource + if (!persist) { + searchSource + .setField('trackTotalHits', true) .setField('size', uiSettings.get(SAMPLE_SIZE_SETTING)) .setField('sort', usedSort) .setField('highlightAll', true) @@ -56,15 +55,20 @@ export function updateSearchSource({ // document-like response. .setPreferredSearchStrategyId('default'); + // this is not the default index pattern, it determines that it's not of type rollup + if (indexPatternsUtils.isDefault(indexPattern)) { + searchSource.setField('filter', data.query.timefilter.timefilter.createFilter(indexPattern)); + } + if (useNewFieldsApi) { - volatileSearchSource.removeField('fieldsFromSource'); + searchSource.removeField('fieldsFromSource'); const fields: Record = { field: '*' }; - if (showUnmappedFields) { - fields.include_unmapped = 'true'; - } - volatileSearchSource.setField('fields', [fields]); + + fields.include_unmapped = 'true'; + + searchSource.setField('fields', [fields]); } else { - volatileSearchSource.removeField('fields'); + searchSource.removeField('fields'); } } } diff --git a/src/plugins/discover/public/application/apps/main/utils/use_singleton.ts b/src/plugins/discover/public/application/apps/main/utils/use_singleton.ts new file mode 100644 index 00000000000000..bac195896caa3a --- /dev/null +++ b/src/plugins/discover/public/application/apps/main/utils/use_singleton.ts @@ -0,0 +1,26 @@ +/* + * 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 { useRef } from 'react'; + +/** + * Allows lazy initialization of a singleton + * Context: https://reactjs.org/docs/hooks-faq.html#how-to-create-expensive-objects-lazily + * Why not using useMemo: We're using the useMemo here also kind of as a guarantee to + * only instantiate that subject once. Unfortunately useMemo explicitly does not give + * those guarantees: + * https://reactjs.org/docs/hooks-reference.html#usememo + */ +export function useSingleton(initialize: () => T): T { + const ref = useRef(null); + + if (ref.current === null) { + ref.current = initialize(); + } + + return ref.current; +} diff --git a/src/plugins/discover/public/application/helpers/validate_time_range.test.ts b/src/plugins/discover/public/application/apps/main/utils/validate_time_range.test.ts similarity index 94% rename from src/plugins/discover/public/application/helpers/validate_time_range.test.ts rename to src/plugins/discover/public/application/apps/main/utils/validate_time_range.test.ts index cd90be434aa5e0..8d9d9adc4e8dcb 100644 --- a/src/plugins/discover/public/application/helpers/validate_time_range.test.ts +++ b/src/plugins/discover/public/application/apps/main/utils/validate_time_range.test.ts @@ -7,7 +7,7 @@ */ import { validateTimeRange } from './validate_time_range'; -import { notificationServiceMock } from '../../../../../core/public/mocks'; +import { notificationServiceMock } from '../../../../../../../core/public/mocks'; describe('Discover validateTimeRange', () => { test('validates given time ranges correctly', async () => { diff --git a/src/plugins/discover/public/application/helpers/validate_time_range.ts b/src/plugins/discover/public/application/apps/main/utils/validate_time_range.ts similarity index 100% rename from src/plugins/discover/public/application/helpers/validate_time_range.ts rename to src/plugins/discover/public/application/apps/main/utils/validate_time_range.ts diff --git a/src/plugins/discover/public/application/components/create_discover_directive.ts b/src/plugins/discover/public/application/components/create_discover_directive.ts deleted file mode 100644 index 049c9ac177eeab..00000000000000 --- a/src/plugins/discover/public/application/components/create_discover_directive.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 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 { Discover } from './discover'; - -// eslint-disable-next-line @typescript-eslint/no-explicit-any -export function createDiscoverDirective(reactDirective: any) { - return reactDirective(Discover, [ - ['fetch', { watchDepth: 'reference' }], - ['fetchCounter', { watchDepth: 'reference' }], - ['fetchError', { watchDepth: 'reference' }], - ['fieldCounts', { watchDepth: 'reference' }], - ['histogramData', { watchDepth: 'reference' }], - ['hits', { watchDepth: 'reference' }], - ['indexPattern', { watchDepth: 'reference' }], - ['opts', { watchDepth: 'reference' }], - ['resetQuery', { watchDepth: 'reference' }], - ['resultState', { watchDepth: 'reference' }], - ['fetchStatus', { watchDepth: 'reference' }], - ['rows', { watchDepth: 'reference' }], - ['savedSearch', { watchDepth: 'reference' }], - ['searchSource', { watchDepth: 'reference' }], - ['showSaveQuery', { watchDepth: 'reference' }], - ['state', { watchDepth: 'reference' }], - ['topNavMenu', { watchDepth: 'reference' }], - ['updateQuery', { watchDepth: 'reference' }], - ['updateSavedQueryId', { watchDepth: 'reference' }], - ['unmappedFieldsConfig', { watchDepth: 'value' }], - ['refreshAppState', { watchDepth: 'reference' }], - ]); -} diff --git a/src/plugins/discover/public/application/components/discover.test.tsx b/src/plugins/discover/public/application/components/discover.test.tsx deleted file mode 100644 index d804d608704219..00000000000000 --- a/src/plugins/discover/public/application/components/discover.test.tsx +++ /dev/null @@ -1,106 +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 React from 'react'; -import { shallowWithIntl } from '@kbn/test/jest'; -import { Discover } from './discover'; -import { esHits } from '../../__mocks__/es_hits'; -import { indexPatternMock } from '../../__mocks__/index_pattern'; -import { DiscoverServices } from '../../build_services'; -import { GetStateReturn } from '../angular/discover_state'; -import { savedSearchMock } from '../../__mocks__/saved_search'; -import { createSearchSourceMock } from '../../../../data/common/search/search_source/mocks'; -import { dataPluginMock } from '../../../../data/public/mocks'; -import { createFilterManagerMock } from '../../../../data/public/query/filter_manager/filter_manager.mock'; -import { uiSettingsMock as mockUiSettings } from '../../__mocks__/ui_settings'; -import { IndexPattern, IndexPatternAttributes } from '../../../../data/common/index_patterns'; -import { SavedObject } from '../../../../../core/types'; -import { navigationPluginMock } from '../../../../navigation/public/mocks'; -import { indexPatternWithTimefieldMock } from '../../__mocks__/index_pattern_with_timefield'; -import { calcFieldCounts } from '../helpers/calc_field_counts'; -import { DiscoverProps } from './types'; -import { RequestAdapter } from '../../../../inspector/common'; -import { Subject } from 'rxjs'; -import { DiscoverSearchSessionManager } from '../angular/discover_search_session'; - -const mockNavigation = navigationPluginMock.createStartContract(); - -jest.mock('../../kibana_services', () => { - return { - getServices: () => ({ - metadata: { - branch: 'test', - }, - capabilities: { - discover: { - save: true, - }, - }, - navigation: mockNavigation, - uiSettings: mockUiSettings, - }), - }; -}); - -function getProps(indexPattern: IndexPattern): DiscoverProps { - const searchSourceMock = createSearchSourceMock({}); - const services = ({ - capabilities: { - discover: { - save: true, - }, - }, - uiSettings: mockUiSettings, - } as unknown) as DiscoverServices; - - return { - fetch: jest.fn(), - fetchCounter: 0, - fetchError: undefined, - fetchStatus: 'loading', - fieldCounts: calcFieldCounts({}, esHits, indexPattern), - hits: esHits.length, - indexPattern, - minimumVisibleRows: 10, - onSkipBottomButtonClick: jest.fn(), - opts: { - config: mockUiSettings, - data: dataPluginMock.createStartContract(), - filterManager: createFilterManagerMock(), - getFieldCounts: jest.fn(), - indexPatternList: (indexPattern as unknown) as Array>, - inspectorAdapters: { requests: {} as RequestAdapter }, - navigateTo: jest.fn(), - refetch$: {} as Subject, - sampleSize: 10, - savedSearch: savedSearchMock, - searchSessionManager: {} as DiscoverSearchSessionManager, - setHeaderActionMenu: jest.fn(), - timefield: indexPattern.timeFieldName || '', - setAppState: jest.fn(), - services, - stateContainer: {} as GetStateReturn, - }, - resetQuery: jest.fn(), - resultState: 'ready', - rows: esHits, - searchSource: searchSourceMock, - state: { columns: [] }, - }; -} - -describe('Discover component', () => { - test('selected index pattern without time field displays no chart toggle', () => { - const component = shallowWithIntl(); - expect(component.find('[data-test-subj="discoverChartToggle"]').length).toBe(0); - }); - test('selected index pattern with time field displays chart toggle', () => { - const component = shallowWithIntl(); - expect(component.find('[data-test-subj="discoverChartToggle"]').length).toBe(1); - }); -}); diff --git a/src/plugins/discover/public/application/components/discover_grid/discover_grid.scss b/src/plugins/discover/public/application/components/discover_grid/discover_grid.scss index 053b405b90acb2..48b99458377ade 100644 --- a/src/plugins/discover/public/application/components/discover_grid/discover_grid.scss +++ b/src/plugins/discover/public/application/components/discover_grid/discover_grid.scss @@ -47,6 +47,9 @@ // We only truncate if the cell is not a control column. .euiDataGridHeader { + // This display property is temporary until https://github.com/elastic/eui/issues/4729 is resolved. + display: flex; + .euiDataGridHeaderCell__content { @include euiTextTruncate; overflow: hidden; diff --git a/src/plugins/discover/public/application/components/discover_topnav.test.tsx b/src/plugins/discover/public/application/components/discover_topnav.test.tsx deleted file mode 100644 index d30e5bda1abe7e..00000000000000 --- a/src/plugins/discover/public/application/components/discover_topnav.test.tsx +++ /dev/null @@ -1,77 +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 React from 'react'; -import { mountWithIntl } from '@kbn/test/jest'; -import { indexPatternMock } from '../../__mocks__/index_pattern'; -import { DiscoverServices } from '../../build_services'; -import { GetStateReturn } from '../angular/discover_state'; -import { savedSearchMock } from '../../__mocks__/saved_search'; -import { dataPluginMock } from '../../../../data/public/mocks'; -import { createFilterManagerMock } from '../../../../data/public/query/filter_manager/filter_manager.mock'; -import { uiSettingsMock as mockUiSettings } from '../../__mocks__/ui_settings'; -import { IndexPatternAttributes } from '../../../../data/common/index_patterns'; -import { SavedObject } from '../../../../../core/types'; -import { DiscoverTopNav, DiscoverTopNavProps } from './discover_topnav'; -import { RequestAdapter } from '../../../../inspector/common/adapters/request'; -import { TopNavMenu } from '../../../../navigation/public'; -import { ISearchSource, Query } from '../../../../data/common'; -import { DiscoverSearchSessionManager } from '../angular/discover_search_session'; -import { Subject } from 'rxjs'; - -function getProps(): DiscoverTopNavProps { - const services = ({ - navigation: { - ui: { TopNavMenu }, - }, - capabilities: { - discover: { - save: true, - }, - advancedSettings: { - save: true, - }, - }, - uiSettings: mockUiSettings, - } as unknown) as DiscoverServices; - const indexPattern = indexPatternMock; - return { - indexPattern: indexPatternMock, - opts: { - config: mockUiSettings, - data: dataPluginMock.createStartContract(), - filterManager: createFilterManagerMock(), - getFieldCounts: jest.fn(), - indexPatternList: (indexPattern as unknown) as Array>, - inspectorAdapters: { requests: {} as RequestAdapter }, - navigateTo: jest.fn(), - refetch$: {} as Subject, - sampleSize: 10, - savedSearch: savedSearchMock, - searchSessionManager: {} as DiscoverSearchSessionManager, - services, - setAppState: jest.fn(), - setHeaderActionMenu: jest.fn(), - stateContainer: {} as GetStateReturn, - timefield: indexPattern.timeFieldName || '', - }, - query: {} as Query, - savedQuery: '', - updateQuery: jest.fn(), - onOpenInspector: jest.fn(), - searchSource: {} as ISearchSource, - }; -} - -describe('Discover topnav component', () => { - test('setHeaderActionMenu was called', () => { - const props = getProps(); - mountWithIntl(); - expect(props.opts.setHeaderActionMenu).toHaveBeenCalled(); - }); -}); diff --git a/src/plugins/discover/public/application/components/doc/use_es_doc_search.ts b/src/plugins/discover/public/application/components/doc/use_es_doc_search.ts index 6b8e912bbffba4..7a3320d43c8b51 100644 --- a/src/plugins/discover/public/application/components/doc/use_es_doc_search.ts +++ b/src/plugins/discover/public/application/components/doc/use_es_doc_search.ts @@ -33,7 +33,7 @@ export function buildSearchBody( useNewFieldsApi: boolean ): RequestBody | undefined { const computedFields = indexPattern.getComputedFields(); - const runtimeFields = computedFields.runtimeFields as estypes.RuntimeFields; + const runtimeFields = computedFields.runtimeFields as estypes.MappingRuntimeFields; const request: RequestBody = { body: { query: { diff --git a/src/plugins/discover/public/application/components/histogram/apply_aggs_to_search_source.test.ts b/src/plugins/discover/public/application/components/histogram/apply_aggs_to_search_source.test.ts deleted file mode 100644 index 5d2be533065e7a..00000000000000 --- a/src/plugins/discover/public/application/components/histogram/apply_aggs_to_search_source.test.ts +++ /dev/null @@ -1,89 +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 { indexPatternWithTimefieldMock } from '../../../__mocks__/index_pattern_with_timefield'; -import { SearchSource } from '../../../../../data/public'; -import { dataPluginMock } from '../../../../../data/public/mocks'; -import { applyAggsToSearchSource } from './apply_aggs_to_search_source'; - -describe('applyAggsToSearchSource', () => { - test('enabled = true', () => { - const indexPattern = indexPatternWithTimefieldMock; - const setField = jest.fn(); - const searchSource = ({ - setField, - removeField: jest.fn(), - } as unknown) as SearchSource; - - const dataMock = dataPluginMock.createStartContract(); - - const aggsConfig = applyAggsToSearchSource(true, searchSource, 'auto', indexPattern, dataMock); - - expect(aggsConfig!.aggs).toMatchInlineSnapshot(` - Array [ - Object { - "enabled": true, - "id": "1", - "params": Object {}, - "schema": "metric", - "type": "count", - }, - Object { - "enabled": true, - "id": "2", - "params": Object { - "drop_partials": false, - "extended_bounds": Object {}, - "field": "timestamp", - "interval": "auto", - "min_doc_count": 1, - "scaleMetricValues": false, - "useNormalizedEsInterval": true, - "used_interval": "0ms", - }, - "schema": "segment", - "type": "date_histogram", - }, - ] - `); - - expect(setField).toHaveBeenCalledWith('aggs', expect.any(Function)); - const dslFn = setField.mock.calls[0][1]; - expect(dslFn()).toMatchInlineSnapshot(` - Object { - "2": Object { - "date_histogram": Object { - "field": "timestamp", - "min_doc_count": 1, - "time_zone": "America/New_York", - }, - }, - } - `); - }); - - test('enabled = false', () => { - const indexPattern = indexPatternWithTimefieldMock; - const setField = jest.fn(); - const getField = jest.fn(() => { - return true; - }); - const removeField = jest.fn(); - const searchSource = ({ - getField, - setField, - removeField, - } as unknown) as SearchSource; - - const dataMock = dataPluginMock.createStartContract(); - - const aggsConfig = applyAggsToSearchSource(false, searchSource, 'auto', indexPattern, dataMock); - expect(aggsConfig).toBeFalsy(); - expect(getField).toHaveBeenCalledWith('aggs'); - expect(removeField).toHaveBeenCalledWith('aggs'); - }); -}); diff --git a/src/plugins/discover/public/application/components/histogram/get_dimensions.test.ts b/src/plugins/discover/public/application/components/histogram/get_dimensions.test.ts deleted file mode 100644 index ad7031f3319924..00000000000000 --- a/src/plugins/discover/public/application/components/histogram/get_dimensions.test.ts +++ /dev/null @@ -1,63 +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 { dataPluginMock } from '../../../../../data/public/mocks'; - -import { getDimensions } from './get_dimensions'; -import { indexPatternWithTimefieldMock } from '../../../__mocks__/index_pattern_with_timefield'; -import { SearchSource } from '../../../../../data/common/search/search_source'; -import { applyAggsToSearchSource } from './apply_aggs_to_search_source'; -import { calculateBounds } from '../../../../../data/common/query/timefilter'; - -test('getDimensions', () => { - const indexPattern = indexPatternWithTimefieldMock; - const setField = jest.fn(); - const searchSource = ({ - setField, - removeField: jest.fn(), - } as unknown) as SearchSource; - - const dataMock = dataPluginMock.createStartContract(); - dataMock.query.timefilter.timefilter.getTime = () => { - return { from: 'now-30y', to: 'now' }; - }; - dataMock.query.timefilter.timefilter.calculateBounds = (timeRange) => { - return calculateBounds(timeRange); - }; - - const aggsConfig = applyAggsToSearchSource(true, searchSource, 'auto', indexPattern, dataMock); - const actual = getDimensions(aggsConfig!, dataMock); - expect(actual).toMatchInlineSnapshot(` - Object { - "x": Object { - "accessor": 0, - "format": Object { - "id": "date", - "params": Object { - "pattern": "HH:mm:ss.SSS", - }, - }, - "label": "timestamp per 0 milliseconds", - "params": Object { - "bounds": undefined, - "date": true, - "format": "HH:mm:ss.SSS", - "interval": "P365D", - "intervalESUnit": "d", - "intervalESValue": 365, - }, - }, - "y": Object { - "accessor": 1, - "format": Object { - "id": "number", - }, - "label": "Count", - }, - } - `); -}); diff --git a/src/plugins/discover/public/application/components/table/table.tsx b/src/plugins/discover/public/application/components/table/table.tsx index 093b445267241b..7a100d24c386e0 100644 --- a/src/plugins/discover/public/application/components/table/table.tsx +++ b/src/plugins/discover/public/application/components/table/table.tsx @@ -10,7 +10,7 @@ import React, { useState, useEffect, useCallback } from 'react'; import { i18n } from '@kbn/i18n'; import { DocViewTableRow } from './table_row'; import { trimAngularSpan } from './table_helper'; -import { isNestedFieldParent } from '../../helpers/nested_fields'; +import { isNestedFieldParent } from '../../apps/main/utils/nested_fields'; import { DocViewRenderProps } from '../../doc_views/doc_views_types'; const COLLAPSE_LINE_LENGTH = 350; diff --git a/src/plugins/discover/public/application/components/types.ts b/src/plugins/discover/public/application/components/types.ts deleted file mode 100644 index 93620bc1d6bca5..00000000000000 --- a/src/plugins/discover/public/application/components/types.ts +++ /dev/null @@ -1,172 +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 { IUiSettingsClient, MountPoint, SavedObject } from 'kibana/public'; -import { Subject } from 'rxjs'; -import { Chart } from '../angular/helpers/point_series'; -import { IndexPattern } from '../../../../data/common/index_patterns/index_patterns'; -import { ElasticSearchHit } from '../doc_views/doc_views_types'; -import { AggConfigs } from '../../../../data/common/search/aggs'; - -import { - DataPublicPluginStart, - FilterManager, - IndexPatternAttributes, - ISearchSource, -} from '../../../../data/public'; -import { SavedSearch } from '../../saved_searches'; -import { AppState, GetStateReturn } from '../angular/discover_state'; -import { RequestAdapter } from '../../../../inspector/common'; -import { DiscoverServices } from '../../build_services'; -import { DiscoverSearchSessionManager } from '../angular/discover_search_session'; - -export interface DiscoverProps { - /** - * Function to fetch documents from Elasticsearch - */ - fetch: () => void; - /** - * Counter how often data was fetched (used for testing) - */ - fetchCounter: number; - /** - * Error in case of a failing document fetch - */ - fetchError?: Error; - /** - * Statistics by fields calculated using the fetched documents - */ - fieldCounts: Record; - /** - * Current state of data fetching - */ - fetchStatus: string; - /** - * Histogram aggregation data - */ - histogramData?: Chart; - /** - * Number of documents found by recent fetch - */ - hits: number; - /** - * Current IndexPattern - */ - indexPattern: IndexPattern; - /** - * Value needed for legacy "infinite" loading functionality - * Determins how much records are rendered using the legacy table - * Increased when scrolling down - */ - minimumVisibleRows: number; - /** - * Function to scroll down the legacy table to the bottom - */ - onSkipBottomButtonClick: () => void; - opts: { - /** - * Date histogram aggregation config - */ - chartAggConfigs?: AggConfigs; - /** - * Client of uiSettings - */ - config: IUiSettingsClient; - /** - * returns field statistics based on the loaded data sample - */ - getFieldCounts: () => Promise>; - /** - * Use angular router for navigation - */ - navigateTo: () => void; - /** - * Inspect, for analyzing requests and responses - */ - inspectorAdapters: { requests: RequestAdapter }; - /** - * Data plugin - */ - data: DataPublicPluginStart; - /** - * Data plugin filter manager - */ - filterManager: FilterManager; - /** - * List of available index patterns - */ - indexPatternList: Array>; - /** - * Refetch observable - */ - refetch$: Subject; - /** - * Kibana core services used by discover - */ - services: DiscoverServices; - /** - * Helps with state management of search session - */ - searchSessionManager: DiscoverSearchSessionManager; - /** - * The number of documents that can be displayed in the table/grid - */ - sampleSize: number; - /** - * Current instance of SavedSearch - */ - savedSearch: SavedSearch; - /** - * Function to set the header menu - */ - setHeaderActionMenu: (menuMount: MountPoint | undefined) => void; - /** - * Timefield of the currently used index pattern - */ - timefield: string; - /** - * Function to set the current state - */ - setAppState: (state: Partial) => void; - /** - * State container providing globalState, appState and functions - */ - stateContainer: GetStateReturn; - }; - /** - * Function to reset the current query - */ - resetQuery: () => void; - /** - * Current state of the actual query, one of 'uninitialized', 'loading' ,'ready', 'none' - */ - resultState: string; - /** - * Array of document of the recent successful search request - */ - rows: ElasticSearchHit[]; - /** - * Instance of SearchSource, the high level search API - */ - searchSource: ISearchSource; - /** - * Current app state of URL - */ - state: AppState; - /** - * An object containing properties for unmapped fields behavior - */ - unmappedFieldsConfig?: { - /** - * determines whether to display unmapped fields - */ - showUnmappedFields: boolean; - }; - - refreshAppState?: () => void; -} diff --git a/src/plugins/discover/public/application/helpers/use_data_grid_columns.ts b/src/plugins/discover/public/application/helpers/use_data_grid_columns.ts index c913b9abd1b433..418cbf6eac9cdb 100644 --- a/src/plugins/discover/public/application/helpers/use_data_grid_columns.ts +++ b/src/plugins/discover/public/application/helpers/use_data_grid_columns.ts @@ -13,7 +13,7 @@ import { IndexPattern, IndexPatternsContract } from '../../kibana_services'; import { AppState as DiscoverState, GetStateReturn as DiscoverGetStateReturn, -} from '../angular/discover_state'; +} from '../apps/main/services/discover_state'; import { AppState as ContextState, GetStateReturn as ContextGetStateReturn, diff --git a/src/plugins/discover/public/application/types.ts b/src/plugins/discover/public/application/types.ts new file mode 100644 index 00000000000000..4d7f47182e98a3 --- /dev/null +++ b/src/plugins/discover/public/application/types.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 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 enum FetchStatus { + UNINITIALIZED = 'uninitialized', + LOADING = 'loading', + COMPLETE = 'complete', + ERROR = 'error', +} diff --git a/src/plugins/discover/public/build_services.ts b/src/plugins/discover/public/build_services.ts index 19ee06aa517985..b42bf6a81742c6 100644 --- a/src/plugins/discover/public/build_services.ts +++ b/src/plugins/discover/public/build_services.ts @@ -56,7 +56,7 @@ export interface DiscoverServices { urlForwarding: UrlForwardingStart; timefilter: TimefilterContract; toastNotifications: ToastsStart; - getSavedSearchById: (id: string) => Promise; + getSavedSearchById: (id?: string) => Promise; getSavedSearchUrlById: (id: string) => Promise; getEmbeddableInjector: () => Promise; uiSettings: IUiSettingsClient; @@ -87,7 +87,7 @@ export async function buildServices( theme: plugins.charts.theme, filterManager: plugins.data.query.filterManager, getEmbeddableInjector, - getSavedSearchById: async (id: string) => savedObjectService.get(id), + getSavedSearchById: async (id?: string) => savedObjectService.get(id), getSavedSearchUrlById: async (id: string) => savedObjectService.urlFor(id), history: getHistory, indexPatterns: plugins.data.indexPatterns, diff --git a/src/plugins/discover/public/plugin.tsx b/src/plugins/discover/public/plugin.tsx index 3f55ab76372bc4..139b23d28a1d43 100644 --- a/src/plugins/discover/public/plugin.tsx +++ b/src/plugins/discover/public/plugin.tsx @@ -329,7 +329,7 @@ export class DiscoverPlugin return; } // this is used by application mount and tests - const { getInnerAngularModule } = await import('./get_inner_angular'); + const { getInnerAngularModule } = await import('./application/angular/get_inner_angular'); const module = getInnerAngularModule( innerAngularName, core, @@ -400,7 +400,9 @@ export class DiscoverPlugin } const { core, plugins } = await this.initializeServices(); getServices().kibanaLegacy.loadFontAwesome(); - const { getInnerAngularModuleEmbeddable } = await import('./get_inner_angular'); + const { getInnerAngularModuleEmbeddable } = await import( + './application/angular/get_inner_angular' + ); getInnerAngularModuleEmbeddable(embeddableAngularName, core, plugins); const mountpoint = document.createElement('div'); this.embeddableInjector = angular.bootstrap(mountpoint, [embeddableAngularName]); diff --git a/src/plugins/discover/public/shared/index.ts b/src/plugins/discover/public/shared/index.ts index b1e4d9d87000ec..c82ac074db1114 100644 --- a/src/plugins/discover/public/shared/index.ts +++ b/src/plugins/discover/public/shared/index.ts @@ -10,5 +10,5 @@ * Allows the getSharingData function to be lazy loadable */ export async function loadSharingDataHelpers() { - return await import('../application/helpers/get_sharing_data'); + return await import('../application/apps/main/utils/get_sharing_data'); } diff --git a/src/plugins/discover/public/url_generator.ts b/src/plugins/discover/public/url_generator.ts index 21bdbf225d6aa5..63dea20fecc0a1 100644 --- a/src/plugins/discover/public/url_generator.ts +++ b/src/plugins/discover/public/url_generator.ts @@ -6,16 +6,10 @@ * Side Public License, v 1. */ -import { - TimeRange, - Filter, - Query, - esFilters, - QueryState, - RefreshInterval, -} from '../../data/public'; +import type { UrlGeneratorsDefinition } from '../../share/public'; +import type { TimeRange, Filter, Query, QueryState, RefreshInterval } from '../../data/public'; +import { esFilters } from '../../data/public'; import { setStateToKbnUrl } from '../../kibana_utils/public'; -import { UrlGeneratorsDefinition } from '../../share/public'; export const DISCOVER_APP_URL_GENERATOR = 'DISCOVER_APP_URL_GENERATOR'; @@ -71,10 +65,12 @@ export interface DiscoverUrlGeneratorState { * Used interval of the histogram */ interval?: string; + /** * Array of the used sorting [[field,direction],...] */ sort?: string[][]; + /** * id of the used saved query */ diff --git a/src/plugins/embeddable/public/lib/attribute_service/attribute_service.tsx b/src/plugins/embeddable/public/lib/attribute_service/attribute_service.tsx index 3e6d28e0664698..9eb743a3911c2c 100644 --- a/src/plugins/embeddable/public/lib/attribute_service/attribute_service.tsx +++ b/src/plugins/embeddable/public/lib/attribute_service/attribute_service.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { i18n } from '@kbn/i18n'; -import { get } from 'lodash'; +import { get, omit } from 'lodash'; import { I18nStart, NotificationsStart } from 'src/core/public'; import { SavedObjectSaveModal, OnSaveProps, SaveResult } from '../../../../saved_objects/public'; import { @@ -150,12 +150,10 @@ export class AttributeService< const wrappedInput = (await this.wrapAttributes(newAttributes, true)) as RefType; // Remove unneeded attributes from the original input. - delete (input as { [ATTRIBUTE_SERVICE_KEY]?: SavedObjectAttributes })[ - ATTRIBUTE_SERVICE_KEY - ]; + const newInput = omit(input, ATTRIBUTE_SERVICE_KEY); // Combine input and wrapped input to preserve any passed in explicit Input. - resolve({ ...input, ...wrappedInput }); + resolve({ ...newInput, ...wrappedInput }); return { id: wrappedInput.savedObjectId }; } catch (error) { reject(error); diff --git a/src/plugins/home/server/services/sample_data/data_sets/ecommerce/saved_objects.ts b/src/plugins/home/server/services/sample_data/data_sets/ecommerce/saved_objects.ts index dc5831aa00a0bc..a12a2ff195211d 100644 --- a/src/plugins/home/server/services/sample_data/data_sets/ecommerce/saved_objects.ts +++ b/src/plugins/home/server/services/sample_data/data_sets/ecommerce/saved_objects.ts @@ -45,7 +45,7 @@ export const getSavedObjects = (): SavedObject[] => [ defaultMessage: '[eCommerce] Sales by Gender', }), visState: - '{"title":"[eCommerce] Sales by Gender","type":"pie","params":{"type":"pie","addTooltip":true,"addLegend":true,"legendPosition":"right","isDonut":true,"labels":{"show":true,"values":true,"last_level":true,"truncate":100}},"aggs":[{"id":"1","enabled":true,"type":"count","schema":"metric","params":{}},{"id":"2","enabled":true,"type":"terms","schema":"segment","params":{"field":"customer_gender","size":5,"order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","missingBucket":false,"missingBucketLabel":"Missing"}}]}', + '{"title":"[eCommerce] Sales by Gender","type":"pie","params":{"type":"pie","addTooltip":true,"addLegend":true,"legendPosition":"right","isDonut":true,"labels":{"show":true,"values":true,"last_level":true,"truncate":100},"palette":{"type":"palette","name":"default"}},"aggs":[{"id":"1","enabled":true,"type":"count","schema":"metric","params":{}},{"id":"2","enabled":true,"type":"terms","schema":"segment","params":{"field":"customer_gender","size":5,"order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","missingBucket":false,"missingBucketLabel":"Missing"}}]}', uiStateJSON: '{}', description: '', version: 1, diff --git a/src/plugins/home/server/services/sample_data/data_sets/flights/saved_objects.ts b/src/plugins/home/server/services/sample_data/data_sets/flights/saved_objects.ts index 1fa19189b8c848..05a3d012d707c1 100644 --- a/src/plugins/home/server/services/sample_data/data_sets/flights/saved_objects.ts +++ b/src/plugins/home/server/services/sample_data/data_sets/flights/saved_objects.ts @@ -100,7 +100,7 @@ export const getSavedObjects = (): SavedObject[] => [ defaultMessage: '[Flights] Airline Carrier', }), visState: - '{"title":"[Flights] Airline Carrier","type":"pie","params":{"type":"pie","addTooltip":true,"addLegend":true,"legendPosition":"right","isDonut":true,"labels":{"show":true,"values":true,"last_level":true,"truncate":100}},"aggs":[{"id":"1","enabled":true,"type":"count","schema":"metric","params":{}},{"id":"2","enabled":true,"type":"terms","schema":"segment","params":{"field":"Carrier","size":5,"order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","missingBucket":false,"missingBucketLabel":"Missing"}}]}', + '{"title":"[Flights] Airline Carrier","type":"pie","params":{"type":"pie","addTooltip":true,"addLegend":true,"legendPosition":"right","isDonut":true,"labels":{"show":true,"values":true,"last_level":true,"truncate":100},"palette":{"type":"palette","name":"default"}},"aggs":[{"id":"1","enabled":true,"type":"count","schema":"metric","params":{}},{"id":"2","enabled":true,"type":"terms","schema":"segment","params":{"field":"Carrier","size":5,"order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","missingBucket":false,"missingBucketLabel":"Missing"}}]}', uiStateJSON: '{"vis":{"legendOpen":false}}', description: '', version: 1, diff --git a/src/plugins/home/server/services/sample_data/data_sets/logs/saved_objects.ts b/src/plugins/home/server/services/sample_data/data_sets/logs/saved_objects.ts index 4a17f96bf89bac..661e6ca0ce50f3 100644 --- a/src/plugins/home/server/services/sample_data/data_sets/logs/saved_objects.ts +++ b/src/plugins/home/server/services/sample_data/data_sets/logs/saved_objects.ts @@ -234,7 +234,7 @@ export const getSavedObjects = (): SavedObject[] => [ defaultMessage: '[Logs] Visitors by OS', }), visState: - '{"title":"[Logs] Visitors by OS","type":"pie","params":{"type":"pie","addTooltip":true,"addLegend":true,"legendPosition":"right","isDonut":true,"labels":{"show":true,"values":true,"last_level":true,"truncate":100}},"aggs":[{"id":"1","enabled":true,"type":"count","schema":"metric","params":{}},{"id":"2","enabled":true,"type":"terms","schema":"segment","params":{"field":"machine.os.keyword","otherBucket":true,"otherBucketLabel":"Other","missingBucket":false,"missingBucketLabel":"Missing","size":10,"order":"desc","orderBy":"1"}}]}', + '{"title":"[Logs] Visitors by OS","type":"pie","params":{"type":"pie","addTooltip":true,"addLegend":true,"legendPosition":"right","isDonut":true,"labels":{"show":true,"values":true,"last_level":true,"truncate":100},"palette":{"type":"palette","name":"default"}},"aggs":[{"id":"1","enabled":true,"type":"count","schema":"metric","params":{}},{"id":"2","enabled":true,"type":"terms","schema":"segment","params":{"field":"machine.os.keyword","otherBucket":true,"otherBucketLabel":"Other","missingBucket":false,"missingBucketLabel":"Missing","size":10,"order":"desc","orderBy":"1"}}]}', uiStateJSON: '{}', description: '', version: 1, diff --git a/src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/components/confirmation_modal/confirmation_modal.test.tsx b/src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/components/confirmation_modal/confirmation_modal.test.tsx index 96f78a088fff49..bacab18d285095 100644 --- a/src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/components/confirmation_modal/confirmation_modal.test.tsx +++ b/src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/components/confirmation_modal/confirmation_modal.test.tsx @@ -15,6 +15,7 @@ describe('DeleteScritpedFieldConfirmationModal', () => { test('should render normally', () => { const component = shallow( {}} hideDeleteConfirmationModal={() => {}} diff --git a/src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/components/table/table.test.tsx b/src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/components/table/table.test.tsx index 83ac96f6c1695b..5a9f4eb8711816 100644 --- a/src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/components/table/table.test.tsx +++ b/src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/components/table/table.test.tsx @@ -15,6 +15,7 @@ import { IIndexPattern } from 'src/plugins/data/public'; const getIndexPatternMock = (mockedFields: any = {}) => ({ ...mockedFields } as IIndexPattern); +// @ts-expect-error invalid lang type const items: ScriptedFieldItem[] = [{ name: '1', lang: 'Elastic', script: '' }]; describe('Table', () => { diff --git a/src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/scripted_field_table.test.tsx b/src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/scripted_field_table.test.tsx index 08a5f22723628c..e6aa87172ca0b7 100644 --- a/src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/scripted_field_table.test.tsx +++ b/src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/scripted_field_table.test.tsx @@ -155,6 +155,7 @@ describe('ScriptedFieldsTable', () => { ); await component.update(); // Fire `componentWillMount()` + // @ts-expect-error lang is not valid component.instance().startDeleteField({ name: 'ScriptedField', lang: '', script: '' }); await component.update(); @@ -179,6 +180,7 @@ describe('ScriptedFieldsTable', () => { ); await component.update(); // Fire `componentWillMount()` + // @ts-expect-error lang is not valid component.instance().startDeleteField({ name: 'ScriptedField', lang: '', script: '' }); await component.update(); diff --git a/src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/scripted_fields_table.tsx b/src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/scripted_fields_table.tsx index 77ba2f734d3fea..7fd5170b669f7c 100644 --- a/src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/scripted_fields_table.tsx +++ b/src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/scripted_fields_table.tsx @@ -65,7 +65,7 @@ export class ScriptedFieldsTable extends Component< const supportedLangs = getSupportedScriptingLanguages(); for (const field of fields) { - const lang: string = field.lang; + const lang = field.lang; if (deprecatedLangs.includes(lang) || !supportedLangs.includes(lang)) { deprecatedLangsInUse.push(lang); } diff --git a/src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/types.ts b/src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/types.ts index 3348f5eb052eb7..5c6adc824d225e 100644 --- a/src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/types.ts +++ b/src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/types.ts @@ -5,10 +5,10 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ - +import type { estypes } from '@elastic/elasticsearch'; /** @internal **/ export interface ScriptedFieldItem { name: string; - lang: string; + lang: estypes.ScriptLanguage; script: string; } diff --git a/src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx b/src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx index f0da57a5f9b6f3..b05ddaed064cdc 100644 --- a/src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx +++ b/src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx @@ -5,7 +5,7 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ - +import type { estypes } from '@elastic/elasticsearch'; import React, { PureComponent, Fragment } from 'react'; import { intersection, union, get } from 'lodash'; @@ -100,7 +100,7 @@ export interface FieldEditorState { isReady: boolean; isCreating: boolean; isDeprecatedLang: boolean; - scriptingLangs: string[]; + scriptingLangs: estypes.ScriptLanguage[]; fieldTypes: string[]; fieldTypeFormats: FieldTypeFormat[]; existingFieldNames: string[]; @@ -131,8 +131,8 @@ export class FieldEditor extends PureComponent { + onLangChange = (lang: estypes.ScriptLanguage) => { const { spec } = this.state; const fieldTypes = get(FIELD_TYPES_BY_LANG, lang, DEFAULT_FIELD_TYPES); spec.lang = lang; @@ -373,7 +374,7 @@ export class FieldEditor extends PureComponent { - this.onLangChange(e.target.value); + this.onLangChange(e.target.value as estypes.ScriptLanguage); }} /> diff --git a/src/plugins/index_pattern_management/public/scripting_languages/index.ts b/src/plugins/index_pattern_management/public/scripting_languages/index.ts index c6b2f3c4b6b27a..aeb38c8172be02 100644 --- a/src/plugins/index_pattern_management/public/scripting_languages/index.ts +++ b/src/plugins/index_pattern_management/public/scripting_languages/index.ts @@ -5,15 +5,15 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ - +import type { estypes } from '@elastic/elasticsearch'; import { i18n } from '@kbn/i18n'; import { HttpStart, NotificationsStart } from 'src/core/public'; -export function getSupportedScriptingLanguages(): string[] { +export function getSupportedScriptingLanguages(): estypes.ScriptLanguage[] { return ['painless']; } -export function getDeprecatedScriptingLanguages(): string[] { +export function getDeprecatedScriptingLanguages(): estypes.ScriptLanguage[] { return []; } diff --git a/src/plugins/kibana_react/public/app_links/redirect_app_link.tsx b/src/plugins/kibana_react/public/app_links/redirect_app_link.tsx index d9ea8be9f5cdd8..744a186a201cad 100644 --- a/src/plugins/kibana_react/public/app_links/redirect_app_link.tsx +++ b/src/plugins/kibana_react/public/app_links/redirect_app_link.tsx @@ -12,7 +12,7 @@ import useObservable from 'react-use/lib/useObservable'; import { ApplicationStart } from 'src/core/public'; import { createNavigateToUrlClickHandler } from './click_handler'; -interface RedirectCrossAppLinksProps { +interface RedirectCrossAppLinksProps extends React.HTMLAttributes { application: ApplicationStart; className?: string; 'data-test-subj'?: string; diff --git a/src/plugins/kibana_usage_collection/server/collectors/application_usage/schema.ts b/src/plugins/kibana_usage_collection/server/collectors/application_usage/schema.ts index e033da875080f4..1fa7d8e846c9da 100644 --- a/src/plugins/kibana_usage_collection/server/collectors/application_usage/schema.ts +++ b/src/plugins/kibana_usage_collection/server/collectors/application_usage/schema.ts @@ -142,6 +142,7 @@ export const applicationUsageSchema = { metrics: commonSchema, infra: commonSchema, // It's a forward app so we'll likely never report it fleet: commonSchema, + integrations: commonSchema, ingestManager: commonSchema, lens: commonSchema, maps: commonSchema, diff --git a/src/plugins/share/common/url_service/__tests__/locators.test.ts b/src/plugins/share/common/url_service/__tests__/locators.test.ts new file mode 100644 index 00000000000000..45d727df7de48c --- /dev/null +++ b/src/plugins/share/common/url_service/__tests__/locators.test.ts @@ -0,0 +1,165 @@ +/* + * 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 { of } from 'src/plugins/kibana_utils/common'; +import { testLocator, TestLocatorState, urlServiceTestSetup } from './setup'; + +describe('locators', () => { + test('can start locators service', () => { + const { + service: { locators }, + } = urlServiceTestSetup(); + + expect(typeof locators).toBe('object'); + expect(typeof locators.create).toBe('function'); + expect(typeof locators.get).toBe('function'); + }); + + test('returns "undefined" for unregistered locator', () => { + const { + service: { locators }, + } = urlServiceTestSetup(); + + expect(locators.get(testLocator.id)).toBe(undefined); + }); + + test('can register a locator', () => { + const { + service: { locators }, + } = urlServiceTestSetup(); + + locators.create(testLocator); + expect(typeof locators.get(testLocator.id)).toBe('object'); + }); + + test('getLocation() returns KibanaLocation generated by the locator', async () => { + const { + service: { locators }, + } = urlServiceTestSetup(); + + locators.create(testLocator); + + const locator = locators.get(testLocator.id); + const location = await locator?.getLocation({ + savedObjectId: 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', + pageNumber: 21, + showFlyout: true, + }); + + expect(location).toEqual({ + app: 'test_app', + route: '/my-object/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx?page=21', + state: { isFlyoutOpen: true }, + }); + }); + + describe('.navigate()', () => { + test('throws if navigation method is not implemented', async () => { + const { + service: { locators }, + } = urlServiceTestSetup(); + const locator = locators.create(testLocator); + const [, error] = await of( + locator.navigate({ + pageNumber: 1, + savedObjectId: 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', + showFlyout: false, + }) + ); + + expect(error).toBeInstanceOf(Error); + expect(error.message).toBe('not implemented'); + }); + + test('navigates user when .navigate() method is called', async () => { + const { + service: { locators }, + deps, + } = urlServiceTestSetup({ + navigate: jest.fn(async () => {}), + }); + const locator = locators.create(testLocator); + const [, error] = await of( + locator.navigate({ + pageNumber: 1, + savedObjectId: 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', + showFlyout: false, + }) + ); + + expect(error).toBe(undefined); + expect(deps.navigate).toHaveBeenCalledTimes(1); + expect(deps.navigate).toHaveBeenCalledWith( + { + app: 'test_app', + route: '/my-object/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx?page=1', + state: { + isFlyoutOpen: false, + }, + }, + { replace: false } + ); + }); + + test('can specify "replace" navigation parameter', async () => { + const { + service: { locators }, + deps, + } = urlServiceTestSetup({ + navigate: jest.fn(async () => {}), + }); + const locator = locators.create(testLocator); + + await locator.navigate( + { + pageNumber: 1, + savedObjectId: 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', + showFlyout: false, + }, + { + replace: false, + } + ); + + expect(deps.navigate).toHaveBeenCalledTimes(1); + expect(deps.navigate).toHaveBeenCalledWith( + { + app: 'test_app', + route: '/my-object/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx?page=1', + state: { + isFlyoutOpen: false, + }, + }, + { replace: false } + ); + + await locator.navigate( + { + pageNumber: 2, + savedObjectId: 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', + showFlyout: false, + }, + { + replace: true, + } + ); + + expect(deps.navigate).toHaveBeenCalledTimes(2); + expect(deps.navigate).toHaveBeenCalledWith( + { + app: 'test_app', + route: '/my-object/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx?page=2', + state: { + isFlyoutOpen: false, + }, + }, + { replace: true } + ); + }); + }); +}); diff --git a/src/plugins/share/common/url_service/__tests__/setup.ts b/src/plugins/share/common/url_service/__tests__/setup.ts new file mode 100644 index 00000000000000..ad13bb8d8d2160 --- /dev/null +++ b/src/plugins/share/common/url_service/__tests__/setup.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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import type { SerializableState } from 'src/plugins/kibana_utils/common'; +import { LocatorDefinition } from '../locators'; +import { UrlService, UrlServiceDependencies } from '../url_service'; + +export interface TestLocatorState extends SerializableState { + savedObjectId: string; + showFlyout: boolean; + pageNumber: number; +} + +export const testLocator: LocatorDefinition = { + id: 'TEST_LOCATOR', + getLocation: async ({ savedObjectId, pageNumber, showFlyout }) => { + return { + app: 'test_app', + route: `/my-object/${savedObjectId}?page=${pageNumber}`, + state: { + isFlyoutOpen: showFlyout, + }, + }; + }, +}; + +export const urlServiceTestSetup = (partialDeps: Partial = {}) => { + const deps: UrlServiceDependencies = { + navigate: async () => { + throw new Error('not implemented'); + }, + ...partialDeps, + }; + const service = new UrlService(deps); + + return { service, deps }; +}; diff --git a/src/plugins/share/common/url_service/index.ts b/src/plugins/share/common/url_service/index.ts new file mode 100644 index 00000000000000..84f74356bcf186 --- /dev/null +++ b/src/plugins/share/common/url_service/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 * from './url_service'; +export * from './locators'; diff --git a/src/plugins/share/common/url_service/locators/index.ts b/src/plugins/share/common/url_service/locators/index.ts new file mode 100644 index 00000000000000..f9f87215eb4db5 --- /dev/null +++ b/src/plugins/share/common/url_service/locators/index.ts @@ -0,0 +1,11 @@ +/* + * 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 * from './types'; +export * from './locator'; +export * from './locator_client'; diff --git a/src/plugins/share/common/url_service/locators/locator.ts b/src/plugins/share/common/url_service/locators/locator.ts new file mode 100644 index 00000000000000..68c3b05a7f4111 --- /dev/null +++ b/src/plugins/share/common/url_service/locators/locator.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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import type { SavedObjectReference } from 'kibana/server'; +import type { PersistableState, SerializableState } from 'src/plugins/kibana_utils/common'; +import type { + LocatorDefinition, + LocatorPublic, + KibanaLocation, + LocatorNavigationParams, +} from './types'; + +export interface LocatorDependencies { + navigate: (location: KibanaLocation, params?: LocatorNavigationParams) => Promise; +} + +export class Locator

implements PersistableState

, LocatorPublic

{ + public readonly migrations: PersistableState

['migrations']; + + constructor( + public readonly definition: LocatorDefinition

, + protected readonly deps: LocatorDependencies + ) { + this.migrations = definition.migrations || {}; + } + + // PersistableState

------------------------------------------------------- + + public readonly telemetry: PersistableState

['telemetry'] = ( + state: P, + stats: Record + ): Record => { + return this.definition.telemetry ? this.definition.telemetry(state, stats) : stats; + }; + + public readonly inject: PersistableState

['inject'] = ( + state: P, + references: SavedObjectReference[] + ): P => { + return this.definition.inject ? this.definition.inject(state, references) : state; + }; + + public readonly extract: PersistableState

['extract'] = ( + state: P + ): { state: P; references: SavedObjectReference[] } => { + return this.definition.extract ? this.definition.extract(state) : { state, references: [] }; + }; + + // LocatorPublic

---------------------------------------------------------- + + public async getLocation(params: P): Promise { + return await this.definition.getLocation(params); + } + + public async navigate( + params: P, + { replace = false }: LocatorNavigationParams = {} + ): Promise { + const location = await this.getLocation(params); + await this.deps.navigate(location, { + replace, + }); + } +} diff --git a/src/plugins/share/common/url_service/locators/locator_client.ts b/src/plugins/share/common/url_service/locators/locator_client.ts new file mode 100644 index 00000000000000..168cc02d03ff15 --- /dev/null +++ b/src/plugins/share/common/url_service/locators/locator_client.ts @@ -0,0 +1,47 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import type { SerializableState } from 'src/plugins/kibana_utils/common'; +import type { LocatorDependencies } from './locator'; +import type { LocatorDefinition, LocatorPublic, ILocatorClient } from './types'; +import { Locator } from './locator'; + +export type LocatorClientDependencies = LocatorDependencies; + +export class LocatorClient implements ILocatorClient { + /** + * Collection of registered locators. + */ + protected locators: Map> = new Map(); + + constructor(protected readonly deps: LocatorClientDependencies) {} + + /** + * Creates and register a URL locator. + * + * @param definition A definition of URL locator. + * @returns A public interface of URL locator. + */ + public create

(definition: LocatorDefinition

): LocatorPublic

{ + const locator = new Locator

(definition, this.deps); + + this.locators.set(definition.id, locator); + + return locator; + } + + /** + * Returns a previously registered URL locator. + * + * @param id ID of a URL locator. + * @returns A public interface of a registered URL locator. + */ + public get

(id: string): undefined | LocatorPublic

{ + return this.locators.get(id); + } +} diff --git a/src/plugins/share/common/url_service/locators/types.ts b/src/plugins/share/common/url_service/locators/types.ts new file mode 100644 index 00000000000000..d811ae0fd4aa23 --- /dev/null +++ b/src/plugins/share/common/url_service/locators/types.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 { PersistableState, SerializableState } from 'src/plugins/kibana_utils/common'; + +/** + * URL locator registry. + */ +export interface ILocatorClient { + /** + * Create and register a new locator. + * + * @param urlGenerator Definition of the new locator. + */ + create

(locatorDefinition: LocatorDefinition

): LocatorPublic

; + + /** + * Retrieve a previously registered locator. + * + * @param id Unique ID of the locator. + */ + get

(id: string): undefined | LocatorPublic

; +} + +/** + * A convenience interface used to define and register a locator. + */ +export interface LocatorDefinition

+ extends Partial> { + /** + * Unique ID of the locator. Should be constant and unique across Kibana. + */ + id: string; + + /** + * Returns a deep link, including location state, which can be used for + * navigation in Kibana. + * + * @param params Parameters from which to generate a Kibana location. + */ + getLocation(params: P): Promise; +} + +/** + * Public interface of a registered locator. + */ +export interface LocatorPublic

{ + /** + * Returns a relative URL to the client-side redirect endpoint using this + * locator. (This method is necessary for compatibility with URL generators.) + */ + getLocation(params: P): Promise; + + /** + * Navigate using the `core.application.navigateToApp()` method to a Kibana + * location generated by this locator. This method is available only on the + * browser. + */ + navigate(params: P, navigationParams?: LocatorNavigationParams): Promise; +} + +export interface LocatorNavigationParams { + replace?: boolean; +} + +/** + * This interface represents a location in Kibana to which one can navigate + * using the `core.application.navigateToApp()` method. + */ +export interface KibanaLocation { + /** + * Kibana application ID. + */ + app: string; + + /** + * A URL route within a Kibana application. + */ + route: string; + + /** + * A serializable location state object, which the app can use to determine + * what should be displayed on the screen. + */ + state: S; +} diff --git a/src/plugins/share/common/url_service/url_service.ts b/src/plugins/share/common/url_service/url_service.ts new file mode 100644 index 00000000000000..0c3a0aabb750bc --- /dev/null +++ b/src/plugins/share/common/url_service/url_service.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 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 { LocatorClient, LocatorClientDependencies } from './locators'; + +export type UrlServiceDependencies = LocatorClientDependencies; + +/** + * Common URL Service client interface for server-side and client-side. + */ +export class UrlService { + /** + * Client to work with locators. + */ + locators: LocatorClient = new LocatorClient(this.deps); + + constructor(protected readonly deps: UrlServiceDependencies) {} +} diff --git a/src/plugins/share/public/plugin.ts b/src/plugins/share/public/plugin.ts index 14d74e055cbd9a..eb7c46cdaef867 100644 --- a/src/plugins/share/public/plugin.ts +++ b/src/plugins/share/public/plugin.ts @@ -18,6 +18,7 @@ import { UrlGeneratorsSetup, UrlGeneratorsStart, } from './url_generators/url_generator_service'; +import { UrlService } from '../common/url_service'; export interface ShareSetupDependencies { securityOss?: SecurityOssPluginSetup; @@ -27,16 +28,60 @@ export interface ShareStartDependencies { securityOss?: SecurityOssPluginStart; } +/** @public */ +export type SharePluginSetup = ShareMenuRegistrySetup & { + /** + * @deprecated + * + * URL Generators are deprecated use UrlService instead. + */ + urlGenerators: UrlGeneratorsSetup; + + /** + * Utilities to work with URL locators and short URLs. + */ + url: UrlService; +}; + +/** @public */ +export type SharePluginStart = ShareMenuManagerStart & { + /** + * @deprecated + * + * URL Generators are deprecated use UrlService instead. + */ + urlGenerators: UrlGeneratorsStart; + + /** + * Utilities to work with URL locators and short URLs. + */ + url: UrlService; +}; + export class SharePlugin implements Plugin { private readonly shareMenuRegistry = new ShareMenuRegistry(); private readonly shareContextMenu = new ShareMenuManager(); private readonly urlGeneratorsService = new UrlGeneratorsService(); + private url?: UrlService; public setup(core: CoreSetup, plugins: ShareSetupDependencies): SharePluginSetup { core.application.register(createShortUrlRedirectApp(core, window.location)); + + this.url = new UrlService({ + navigate: async (location, { replace = false } = {}) => { + const [start] = await core.getStartServices(); + await start.application.navigateToApp(location.app, { + path: location.route, + state: location.state, + replace, + }); + }, + }); + return { ...this.shareMenuRegistry.setup(), urlGenerators: this.urlGeneratorsService.setup(core), + url: this.url, }; } @@ -48,16 +93,7 @@ export class SharePlugin implements Plugin { plugins.securityOss?.anonymousAccess ), urlGenerators: this.urlGeneratorsService.start(core), + url: this.url!, }; } } - -/** @public */ -export type SharePluginSetup = ShareMenuRegistrySetup & { - urlGenerators: UrlGeneratorsSetup; -}; - -/** @public */ -export type SharePluginStart = ShareMenuManagerStart & { - urlGenerators: UrlGeneratorsStart; -}; diff --git a/src/plugins/share/public/url_generators/README.md b/src/plugins/share/public/url_generators/README.md index 39ee5f2901e916..f948354aad9593 100644 --- a/src/plugins/share/public/url_generators/README.md +++ b/src/plugins/share/public/url_generators/README.md @@ -1,3 +1,9 @@ +# URL Generators are deprecated + +__Below is documentation of URL Generators, which are now deprecated and will be removed in favor of URL locators in 7.14.__ + +--- + ## URL Generator Services Developers who maintain pages in Kibana that other developers may want to link to diff --git a/src/plugins/share/public/url_generators/url_generator_service.ts b/src/plugins/share/public/url_generators/url_generator_service.ts index 982f0692102df6..5a8e7a1b5c17a8 100644 --- a/src/plugins/share/public/url_generators/url_generator_service.ts +++ b/src/plugins/share/public/url_generators/url_generator_service.ts @@ -13,10 +13,20 @@ import { UrlGeneratorInternal } from './url_generator_internal'; import { UrlGeneratorContract } from './url_generator_contract'; export interface UrlGeneratorsStart { + /** + * @deprecated + * + * URL Generators are deprecated, use URL locators in UrlService instead. + */ getUrlGenerator: (urlGeneratorId: T) => UrlGeneratorContract; } export interface UrlGeneratorsSetup { + /** + * @deprecated + * + * URL Generators are deprecated, use URL locators in UrlService instead. + */ registerUrlGenerator: ( generator: UrlGeneratorsDefinition ) => UrlGeneratorContract; diff --git a/src/plugins/share/server/plugin.ts b/src/plugins/share/server/plugin.ts index 744a4148215c3e..6e3c68935f77bf 100644 --- a/src/plugins/share/server/plugin.ts +++ b/src/plugins/share/server/plugin.ts @@ -12,11 +12,30 @@ import { CoreSetup, Plugin, PluginInitializerContext } from 'kibana/server'; import { createRoutes } from './routes/create_routes'; import { url } from './saved_objects'; import { CSV_SEPARATOR_SETTING, CSV_QUOTE_VALUES_SETTING } from '../common/constants'; +import { UrlService } from '../common/url_service'; + +/** @public */ +export interface SharePluginSetup { + url: UrlService; +} + +/** @public */ +export interface SharePluginStart { + url: UrlService; +} + +export class SharePlugin implements Plugin { + private url?: UrlService; -export class SharePlugin implements Plugin { constructor(private readonly initializerContext: PluginInitializerContext) {} public setup(core: CoreSetup) { + this.url = new UrlService({ + navigate: async () => { + throw new Error('Locator .navigate() does not work on server.'); + }, + }); + createRoutes(core, this.initializerContext.logger.get()); core.savedObjects.registerType(url); core.uiSettings.register({ @@ -41,10 +60,18 @@ export class SharePlugin implements Plugin { schema: schema.boolean(), }, }); + + return { + url: this.url, + }; } public start() { this.initializerContext.logger.get().debug('Starting plugin'); + + return { + url: this.url!, + }; } public stop() { diff --git a/src/plugins/telemetry/schema/oss_plugins.json b/src/plugins/telemetry/schema/oss_plugins.json index 1d37c25f52fd49..7b6c4ba9788f14 100644 --- a/src/plugins/telemetry/schema/oss_plugins.json +++ b/src/plugins/telemetry/schema/oss_plugins.json @@ -3184,6 +3184,137 @@ } } }, + "integrations": { + "properties": { + "appId": { + "type": "keyword", + "_meta": { + "description": "The application being tracked" + } + }, + "viewId": { + "type": "keyword", + "_meta": { + "description": "Always `main`" + } + }, + "clicks_total": { + "type": "long", + "_meta": { + "description": "General number of clicks in the application since we started counting them" + } + }, + "clicks_7_days": { + "type": "long", + "_meta": { + "description": "General number of clicks in the application over the last 7 days" + } + }, + "clicks_30_days": { + "type": "long", + "_meta": { + "description": "General number of clicks in the application over the last 30 days" + } + }, + "clicks_90_days": { + "type": "long", + "_meta": { + "description": "General number of clicks in the application over the last 90 days" + } + }, + "minutes_on_screen_total": { + "type": "float", + "_meta": { + "description": "Minutes the application is active and on-screen since we started counting them." + } + }, + "minutes_on_screen_7_days": { + "type": "float", + "_meta": { + "description": "Minutes the application is active and on-screen over the last 7 days" + } + }, + "minutes_on_screen_30_days": { + "type": "float", + "_meta": { + "description": "Minutes the application is active and on-screen over the last 30 days" + } + }, + "minutes_on_screen_90_days": { + "type": "float", + "_meta": { + "description": "Minutes the application is active and on-screen over the last 90 days" + } + }, + "views": { + "type": "array", + "items": { + "properties": { + "appId": { + "type": "keyword", + "_meta": { + "description": "The application being tracked" + } + }, + "viewId": { + "type": "keyword", + "_meta": { + "description": "The application view being tracked" + } + }, + "clicks_total": { + "type": "long", + "_meta": { + "description": "General number of clicks in the application sub view since we started counting them" + } + }, + "clicks_7_days": { + "type": "long", + "_meta": { + "description": "General number of clicks in the active application sub view over the last 7 days" + } + }, + "clicks_30_days": { + "type": "long", + "_meta": { + "description": "General number of clicks in the active application sub view over the last 30 days" + } + }, + "clicks_90_days": { + "type": "long", + "_meta": { + "description": "General number of clicks in the active application sub view over the last 90 days" + } + }, + "minutes_on_screen_total": { + "type": "float", + "_meta": { + "description": "Minutes the application sub view is active and on-screen since we started counting them." + } + }, + "minutes_on_screen_7_days": { + "type": "float", + "_meta": { + "description": "Minutes the application is active and on-screen active application sub view over the last 7 days" + } + }, + "minutes_on_screen_30_days": { + "type": "float", + "_meta": { + "description": "Minutes the application is active and on-screen active application sub view over the last 30 days" + } + }, + "minutes_on_screen_90_days": { + "type": "float", + "_meta": { + "description": "Minutes the application is active and on-screen active application sub view over the last 90 days" + } + } + } + } + } + } + }, "ingestManager": { "properties": { "appId": { diff --git a/src/plugins/telemetry/server/telemetry_collection/get_local_stats.test.ts b/src/plugins/telemetry/server/telemetry_collection/get_local_stats.test.ts index 7fd6ca4080d6af..bacfa5e77107fe 100644 --- a/src/plugins/telemetry/server/telemetry_collection/get_local_stats.test.ts +++ b/src/plugins/telemetry/server/telemetry_collection/get_local_stats.test.ts @@ -188,7 +188,7 @@ describe('get_local_stats', () => { describe('handleLocalStats', () => { it('returns expected object without xpack or kibana data', () => { const result = handleLocalStats( - clusterInfo as estypes.RootNodeInfoResponse, + clusterInfo as estypes.InfoResponse, clusterStatsWithNodesUsage, void 0, void 0, @@ -205,7 +205,7 @@ describe('get_local_stats', () => { it('returns expected object with xpack', () => { const result = handleLocalStats( - clusterInfo as estypes.RootNodeInfoResponse, + clusterInfo as estypes.InfoResponse, clusterStatsWithNodesUsage, void 0, void 0, diff --git a/src/plugins/telemetry/server/telemetry_collection/get_local_stats.ts b/src/plugins/telemetry/server/telemetry_collection/get_local_stats.ts index 7fdcb50b704afe..7860949e098aa1 100644 --- a/src/plugins/telemetry/server/telemetry_collection/get_local_stats.ts +++ b/src/plugins/telemetry/server/telemetry_collection/get_local_stats.ts @@ -28,7 +28,7 @@ import { getDataTelemetry, DATA_TELEMETRY_ID, DataTelemetryPayload } from './get */ export function handleLocalStats( // eslint-disable-next-line @typescript-eslint/naming-convention - { cluster_name, cluster_uuid, version }: estypes.RootNodeInfoResponse, + { cluster_name, cluster_uuid, version }: estypes.InfoResponse, { _nodes, cluster_name: clusterName, ...clusterStats }: ClusterStats, kibana: KibanaUsageStats | undefined, dataTelemetry: DataTelemetryPayload | undefined, diff --git a/src/plugins/telemetry/server/telemetry_collection/get_nodes_usage.ts b/src/plugins/telemetry/server/telemetry_collection/get_nodes_usage.ts index c35b8a3d24498e..0d58d80ed59653 100644 --- a/src/plugins/telemetry/server/telemetry_collection/get_nodes_usage.ts +++ b/src/plugins/telemetry/server/telemetry_collection/get_nodes_usage.ts @@ -14,7 +14,7 @@ import { TIMEOUT } from './constants'; * Data returned by GET /_nodes/usage, but flattened as an array of {@link estypes.NodeUsageInformation} * with the node ID set in the field `node_id`. */ -export interface NodeUsage extends estypes.NodeUsageInformation { +export interface NodeUsage extends estypes.NodesUsageNodeUsage { /** * The Node ID as reported by ES */ diff --git a/src/plugins/timelion/public/components/timelion_deprecation.tsx b/src/plugins/timelion/public/components/timelion_deprecation.tsx index efcef88b3d0a26..117aabed6773cb 100644 --- a/src/plugins/timelion/public/components/timelion_deprecation.tsx +++ b/src/plugins/timelion/public/components/timelion_deprecation.tsx @@ -19,7 +19,7 @@ export const TimelionDeprecation = ({ links }: DocLinksStart) => { title={ diff --git a/src/plugins/timelion/server/deprecations.ts b/src/plugins/timelion/server/deprecations.ts index e65d72cb460dfb..3c344e1d4a8d80 100644 --- a/src/plugins/timelion/server/deprecations.ts +++ b/src/plugins/timelion/server/deprecations.ts @@ -30,7 +30,7 @@ export const showWarningMessageIfTimelionSheetWasFound = async ( const count = await getTimelionSheetsCount(savedObjectsClient); if (count > 0) { logger.warn( - 'Deprecated since 7.0, the Timelion app will be removed in the last 7.x minor version. To continue using your Timelion worksheets, migrate them to a dashboard. See https://www.elastic.co/guide/en/kibana/current/create-panels-with-timelion.html.' + 'Deprecated since 7.0, the Timelion app will be removed in 7.16. To continue using your Timelion worksheets, migrate them to a dashboard. See https://www.elastic.co/guide/en/kibana/current/create-panels-with-timelion.html.' ); } }; @@ -49,7 +49,7 @@ export async function getDeprecations({ if (count > 0) { deprecations.push({ - message: `You have ${count} Timelion worksheets. The Timelion app will be removed in the last 7.x minor version. To continue using your Timelion worksheets, migrate them to a dashboard.`, + message: `You have ${count} Timelion worksheets. The Timelion app will be removed in 7.16. To continue using your Timelion worksheets, migrate them to a dashboard.`, documentationUrl: 'https://www.elastic.co/guide/en/kibana/current/create-panels-with-timelion.html', level: 'warning', diff --git a/src/plugins/vis_type_pie/README.md b/src/plugins/vis_type_pie/README.md new file mode 100644 index 00000000000000..41b8131a5381d0 --- /dev/null +++ b/src/plugins/vis_type_pie/README.md @@ -0,0 +1 @@ +Contains the pie chart implementation using the elastic-charts library. The goal is to eventually deprecate the old implementation and keep only this. Until then, the library used is defined by the Legacy charts library advanced setting. \ No newline at end of file diff --git a/src/plugins/vis_type_pie/common/index.ts b/src/plugins/vis_type_pie/common/index.ts new file mode 100644 index 00000000000000..1aa1680530b324 --- /dev/null +++ b/src/plugins/vis_type_pie/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 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 const DEFAULT_PERCENT_DECIMALS = 2; diff --git a/src/plugins/vis_type_pie/jest.config.js b/src/plugins/vis_type_pie/jest.config.js new file mode 100644 index 00000000000000..e4900ef4a35c8f --- /dev/null +++ b/src/plugins/vis_type_pie/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: ['/src/plugins/vis_type_pie'], +}; diff --git a/src/plugins/vis_type_pie/kibana.json b/src/plugins/vis_type_pie/kibana.json new file mode 100644 index 00000000000000..c2d51fba8260dd --- /dev/null +++ b/src/plugins/vis_type_pie/kibana.json @@ -0,0 +1,8 @@ +{ + "id": "visTypePie", + "version": "kibana", + "ui": true, + "requiredPlugins": ["charts", "data", "expressions", "visualizations", "usageCollection"], + "requiredBundles": ["visDefaultEditor"] + } + \ No newline at end of file diff --git a/src/plugins/vis_type_pie/public/__snapshots__/pie_fn.test.ts.snap b/src/plugins/vis_type_pie/public/__snapshots__/pie_fn.test.ts.snap new file mode 100644 index 00000000000000..dc83d9fdf48ac5 --- /dev/null +++ b/src/plugins/vis_type_pie/public/__snapshots__/pie_fn.test.ts.snap @@ -0,0 +1,73 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`interpreter/functions#pie returns an object with the correct structure 1`] = ` +Object { + "as": "pie_vis", + "type": "render", + "value": Object { + "params": Object { + "listenOnChange": true, + }, + "syncColors": false, + "visConfig": Object { + "addLegend": true, + "addTooltip": true, + "buckets": undefined, + "dimensions": Object { + "buckets": undefined, + "metric": Object { + "accessor": 0, + "aggType": "count", + "format": Object { + "id": "number", + }, + "params": Object {}, + }, + "splitColumn": undefined, + "splitRow": undefined, + }, + "distinctColors": false, + "isDonut": true, + "labels": Object { + "percentDecimals": 2, + "position": "default", + "show": false, + "truncate": 100, + "values": true, + "valuesFormat": "percent", + }, + "legendPosition": "right", + "metric": Object { + "accessor": 0, + "aggType": "count", + "format": Object { + "id": "number", + }, + "params": Object {}, + }, + "nestedLegend": true, + "palette": Object { + "name": "kibana_palette", + "type": "palette", + }, + "splitColumn": undefined, + "splitRow": undefined, + }, + "visData": Object { + "columns": Array [ + Object { + "id": "col-0-1", + "name": "Count", + }, + ], + "rows": Array [ + Object { + "col-0-1": 0, + }, + ], + "type": "datatable", + }, + "visType": "pie", + }, +} +`; diff --git a/src/plugins/vis_type_pie/public/__snapshots__/to_ast.test.ts.snap b/src/plugins/vis_type_pie/public/__snapshots__/to_ast.test.ts.snap new file mode 100644 index 00000000000000..0c8398a142027c --- /dev/null +++ b/src/plugins/vis_type_pie/public/__snapshots__/to_ast.test.ts.snap @@ -0,0 +1,122 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`vis type pie vis toExpressionAst function should match basic snapshot 1`] = ` +Object { + "chain": Array [ + Object { + "arguments": Object { + "aggs": Array [], + "index": Array [ + Object { + "chain": Array [ + Object { + "arguments": Object { + "id": Array [ + "123", + ], + }, + "function": "indexPatternLoad", + "type": "function", + }, + ], + "type": "expression", + }, + ], + "metricsAtAllLevels": Array [ + true, + ], + "partialRows": Array [ + false, + ], + }, + "function": "esaggs", + "type": "function", + }, + Object { + "arguments": Object { + "addLegend": Array [ + true, + ], + "addTooltip": Array [ + true, + ], + "buckets": Array [ + Object { + "chain": Array [ + Object { + "arguments": Object { + "accessor": Array [ + 1, + ], + "format": Array [ + "terms", + ], + "formatParams": Array [ + "{\\"id\\":\\"string\\",\\"otherBucketLabel\\":\\"Other\\",\\"missingBucketLabel\\":\\"Missing\\",\\"parsedUrl\\":{\\"origin\\":\\"http://localhost:5801\\",\\"pathname\\":\\"/app/visualize\\",\\"basePath\\":\\"\\"}}", + ], + }, + "function": "visdimension", + "type": "function", + }, + ], + "type": "expression", + }, + ], + "isDonut": Array [ + true, + ], + "labels": Array [ + Object { + "chain": Array [ + Object { + "arguments": Object { + "lastLevel": Array [ + true, + ], + "show": Array [ + true, + ], + "truncate": Array [ + 100, + ], + "values": Array [ + true, + ], + }, + "function": "pielabels", + "type": "function", + }, + ], + "type": "expression", + }, + ], + "legendPosition": Array [ + "right", + ], + "metric": Array [ + Object { + "chain": Array [ + Object { + "arguments": Object { + "accessor": Array [ + 0, + ], + "format": Array [ + "number", + ], + }, + "function": "visdimension", + "type": "function", + }, + ], + "type": "expression", + }, + ], + }, + "function": "pie_vis", + "type": "function", + }, + ], + "type": "expression", +} +`; diff --git a/src/plugins/vis_type_pie/public/chart.scss b/src/plugins/vis_type_pie/public/chart.scss new file mode 100644 index 00000000000000..8c098b13581f50 --- /dev/null +++ b/src/plugins/vis_type_pie/public/chart.scss @@ -0,0 +1,18 @@ +.pieChart__wrapper, +.pieChart__container { + display: flex; + flex: 1 1 auto; + min-height: 0; + min-width: 0; +} + +.pieChart__container { + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0; + padding: $euiSizeS; + margin-left: auto; + margin-right: auto; +} diff --git a/src/plugins/vis_type_pie/public/components/chart_split.tsx b/src/plugins/vis_type_pie/public/components/chart_split.tsx new file mode 100644 index 00000000000000..46f841113c03d4 --- /dev/null +++ b/src/plugins/vis_type_pie/public/components/chart_split.tsx @@ -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 React from 'react'; +import { Accessor, AccessorFn, GroupBy, GroupBySort, SmallMultiples } from '@elastic/charts'; +import { DatatableColumn } from '../../../expressions/public'; +import { SplitDimensionParams } from '../types'; + +interface ChartSplitProps { + splitColumnAccessor?: Accessor | AccessorFn; + splitRowAccessor?: Accessor | AccessorFn; + splitDimension?: DatatableColumn; +} + +const CHART_SPLIT_ID = '__pie_chart_split__'; +export const SMALL_MULTIPLES_ID = '__pie_chart_sm__'; + +export const ChartSplit = ({ + splitColumnAccessor, + splitRowAccessor, + splitDimension, +}: ChartSplitProps) => { + if (!splitColumnAccessor && !splitRowAccessor) return null; + let sort: GroupBySort = 'alphaDesc'; + if (splitDimension?.meta?.params?.id === 'terms') { + const params = splitDimension?.meta?.sourceParams?.params as SplitDimensionParams; + sort = params?.order === 'asc' ? 'alphaAsc' : 'alphaDesc'; + } + + return ( + <> + { + const splitTypeAccessor = splitColumnAccessor || splitRowAccessor; + if (splitTypeAccessor) { + return typeof splitTypeAccessor === 'function' + ? splitTypeAccessor(datum) + : datum[splitTypeAccessor]; + } + return spec.id; + }} + sort={sort} + /> + + + ); +}; diff --git a/src/plugins/vis_type_pie/public/editor/collections.ts b/src/plugins/vis_type_pie/public/editor/collections.ts new file mode 100644 index 00000000000000..d65e933a8835c4 --- /dev/null +++ b/src/plugins/vis_type_pie/public/editor/collections.ts @@ -0,0 +1,40 @@ +/* + * 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 { i18n } from '@kbn/i18n'; +import { LabelPositions, ValueFormats } from '../types'; + +export const getLabelPositions = [ + { + text: i18n.translate('visTypePie.labelPositions.insideText', { + defaultMessage: 'Inside', + }), + value: LabelPositions.INSIDE, + }, + { + text: i18n.translate('visTypePie.labelPositions.insideOrOutsideText', { + defaultMessage: 'Inside or outside', + }), + value: LabelPositions.DEFAULT, + }, +]; + +export const getValuesFormats = [ + { + text: i18n.translate('visTypePie.valuesFormats.percent', { + defaultMessage: 'Show percent', + }), + value: ValueFormats.PERCENT, + }, + { + text: i18n.translate('visTypePie.valuesFormats.value', { + defaultMessage: 'Show value', + }), + value: ValueFormats.VALUE, + }, +]; diff --git a/src/plugins/vis_type_pie/public/editor/components/index.tsx b/src/plugins/vis_type_pie/public/editor/components/index.tsx new file mode 100644 index 00000000000000..6bc31208fbdb0e --- /dev/null +++ b/src/plugins/vis_type_pie/public/editor/components/index.tsx @@ -0,0 +1,26 @@ +/* + * 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 React, { lazy } from 'react'; +import { VisEditorOptionsProps } from '../../../../visualizations/public'; +import { PieVisParams, PieTypeProps } from '../../types'; + +const PieOptionsLazy = lazy(() => import('./pie')); + +export const getPieOptions = ({ + showElasticChartsOptions, + palettes, + trackUiMetric, +}: PieTypeProps) => (props: VisEditorOptionsProps) => ( + +); diff --git a/src/plugins/vis_type_pie/public/editor/components/pie.test.tsx b/src/plugins/vis_type_pie/public/editor/components/pie.test.tsx new file mode 100644 index 00000000000000..524986524fd7e5 --- /dev/null +++ b/src/plugins/vis_type_pie/public/editor/components/pie.test.tsx @@ -0,0 +1,124 @@ +/* + * 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 React from 'react'; +import { mountWithIntl } from '@kbn/test/jest'; +import { ReactWrapper } from 'enzyme'; +import PieOptions, { PieOptionsProps } from './pie'; +import { chartPluginMock } from '../../../../charts/public/mocks'; +import { findTestSubject } from '@elastic/eui/lib/test'; +import { act } from 'react-dom/test-utils'; + +describe('PalettePicker', function () { + let props: PieOptionsProps; + let component: ReactWrapper; + + beforeAll(() => { + props = ({ + palettes: chartPluginMock.createSetupContract().palettes, + showElasticChartsOptions: true, + vis: { + type: { + editorConfig: { + collections: { + legendPositions: [ + { + text: 'Top', + value: 'top', + }, + { + text: 'Left', + value: 'left', + }, + { + text: 'Right', + value: 'right', + }, + { + text: 'Bottom', + value: 'bottom', + }, + ], + }, + }, + }, + }, + stateParams: { + isDonut: true, + legendPosition: 'left', + labels: { + show: true, + }, + }, + setValue: jest.fn(), + } as unknown) as PieOptionsProps; + }); + + it('renders the nested legend switch for the elastic charts implementation', async () => { + component = mountWithIntl(); + await act(async () => { + expect(findTestSubject(component, 'visTypePieNestedLegendSwitch').length).toBe(1); + }); + }); + + it('not renders the nested legend switch for the vislib implementation', async () => { + component = mountWithIntl(); + await act(async () => { + expect(findTestSubject(component, 'visTypePieNestedLegendSwitch').length).toBe(0); + }); + }); + + it('renders the label position dropdown for the elastic charts implementation', async () => { + component = mountWithIntl(); + await act(async () => { + expect(findTestSubject(component, 'visTypePieLabelPositionSelect').length).toBe(1); + }); + }); + + it('not renders the label position dropdown for the vislib implementation', async () => { + component = mountWithIntl(); + await act(async () => { + expect(findTestSubject(component, 'visTypePieLabelPositionSelect').length).toBe(0); + }); + }); + + it('renders the top level switch for the elastic charts implementation', async () => { + component = mountWithIntl(); + await act(async () => { + expect(findTestSubject(component, 'visTypePieTopLevelSwitch').length).toBe(1); + }); + }); + + it('renders the top level switch for the vislib implementation', async () => { + component = mountWithIntl(); + await act(async () => { + expect(findTestSubject(component, 'visTypePieTopLevelSwitch').length).toBe(1); + }); + }); + + it('renders the value format dropdown for the elastic charts implementation', async () => { + component = mountWithIntl(); + await act(async () => { + expect(findTestSubject(component, 'visTypePieValueFormatsSelect').length).toBe(1); + }); + }); + + it('not renders the value format dropdown for the vislib implementation', async () => { + component = mountWithIntl(); + await act(async () => { + expect(findTestSubject(component, 'visTypePieValueFormatsSelect').length).toBe(0); + }); + }); + + it('renders the percent slider for the elastic charts implementation', async () => { + component = mountWithIntl(); + await act(async () => { + expect(findTestSubject(component, 'visTypePieValueDecimals').length).toBe(1); + }); + }); +}); diff --git a/src/plugins/vis_type_pie/public/editor/components/pie.tsx b/src/plugins/vis_type_pie/public/editor/components/pie.tsx new file mode 100644 index 00000000000000..8ce4f4defbaed8 --- /dev/null +++ b/src/plugins/vis_type_pie/public/editor/components/pie.tsx @@ -0,0 +1,287 @@ +/* + * 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 React, { useState, useEffect } from 'react'; +import { METRIC_TYPE } from '@kbn/analytics'; +import { + EuiPanel, + EuiTitle, + EuiSpacer, + EuiRange, + EuiFormRow, + EuiIconTip, + EuiFlexItem, + EuiFlexGroup, +} from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; +import { FormattedMessage } from '@kbn/i18n/react'; + +import { + BasicOptions, + SwitchOption, + SelectOption, + PalettePicker, +} from '../../../../vis_default_editor/public'; +import { VisEditorOptionsProps } from '../../../../visualizations/public'; +import { TruncateLabelsOption } from './truncate_labels'; +import { PaletteRegistry } from '../../../../charts/public'; +import { DEFAULT_PERCENT_DECIMALS } from '../../../common'; +import { PieVisParams, LabelPositions, ValueFormats, PieTypeProps } from '../../types'; +import { getLabelPositions, getValuesFormats } from '../collections'; +import { getLegendPositions } from '../positions'; + +export interface PieOptionsProps extends VisEditorOptionsProps, PieTypeProps {} + +function DecimalSlider({ + paramName, + value, + setValue, +}: { + value: number; + paramName: ParamName; + setValue: (paramName: ParamName, value: number) => void; +}) { + return ( + + { + setValue(paramName, Number(e.currentTarget.value)); + }} + /> + + ); +} + +const PieOptions = (props: PieOptionsProps) => { + const { stateParams, setValue, aggs } = props; + const setLabels = ( + paramName: T, + value: PieVisParams['labels'][T] + ) => setValue('labels', { ...stateParams.labels, [paramName]: value }); + const legendUiStateValue = props.uiState?.get('vis.legendOpen'); + const [palettesRegistry, setPalettesRegistry] = useState(undefined); + const [legendVisibility, setLegendVisibility] = useState(() => { + const bwcLegendStateDefault = stateParams.addLegend == null ? false : stateParams.addLegend; + return props.uiState?.get('vis.legendOpen', bwcLegendStateDefault) as boolean; + }); + const hasSplitChart = Boolean(aggs?.aggs?.find((agg) => agg.schema === 'split' && agg.enabled)); + const segments = aggs?.aggs?.filter((agg) => agg.schema === 'segment' && agg.enabled) ?? []; + + useEffect(() => { + setLegendVisibility(legendUiStateValue); + }, [legendUiStateValue]); + + useEffect(() => { + const fetchPalettes = async () => { + const palettes = await props.palettes?.getPalettes(); + setPalettesRegistry(palettes); + }; + fetchPalettes(); + }, [props.palettes]); + + return ( + <> + + +

+ +

+ + + + + {props.showElasticChartsOptions && ( + <> + + + + + + + + + + + { + setLegendVisibility(value); + setValue(paramName, value); + }} + data-test-subj="visTypePieAddLegendSwitch" + /> + { + if (props.trackUiMetric) { + props.trackUiMetric(METRIC_TYPE.CLICK, 'nested_legend_switched'); + } + setValue(paramName, value); + }} + data-test-subj="visTypePieNestedLegendSwitch" + /> + + )} + {props.showElasticChartsOptions && palettesRegistry && ( + { + if (props.trackUiMetric) { + props.trackUiMetric(METRIC_TYPE.CLICK, 'palette_selected'); + } + setValue(paramName, value); + }} + /> + )} + + + + + + +

+ +

+
+ + + {props.showElasticChartsOptions && ( + { + if (props.trackUiMetric) { + props.trackUiMetric(METRIC_TYPE.CLICK, 'label_position_selected'); + } + setLabels(paramName, value); + }} + data-test-subj="visTypePieLabelPositionSelect" + /> + )} + + + {props.showElasticChartsOptions && ( + <> + { + if (props.trackUiMetric) { + props.trackUiMetric(METRIC_TYPE.CLICK, 'values_format_selected'); + } + setLabels(paramName, value); + }} + data-test-subj="visTypePieValueFormatsSelect" + /> + + + )} + +
+ + ); +}; + +// default export required for React.Lazy +// eslint-disable-next-line import/no-default-export +export { PieOptions as default }; diff --git a/src/plugins/vis_type_pie/public/editor/components/truncate_labels.test.tsx b/src/plugins/vis_type_pie/public/editor/components/truncate_labels.test.tsx new file mode 100644 index 00000000000000..1d4bb238dcb50e --- /dev/null +++ b/src/plugins/vis_type_pie/public/editor/components/truncate_labels.test.tsx @@ -0,0 +1,51 @@ +/* + * 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 React from 'react'; +import { mountWithIntl } from '@kbn/test/jest'; +import { ReactWrapper } from 'enzyme'; +import { TruncateLabelsOption, TruncateLabelsOptionProps } from './truncate_labels'; +import { findTestSubject } from '@elastic/eui/lib/test'; + +describe('TruncateLabelsOption', function () { + let props: TruncateLabelsOptionProps; + let component: ReactWrapper; + + beforeAll(() => { + props = { + disabled: false, + value: 20, + setValue: jest.fn(), + }; + }); + + it('renders an input type number', () => { + component = mountWithIntl(); + expect(findTestSubject(component, 'pieLabelTruncateInput').length).toBe(1); + }); + + it('renders the value on the input number', function () { + component = mountWithIntl(); + const input = findTestSubject(component, 'pieLabelTruncateInput'); + expect(input.props().value).toBe(20); + }); + + it('disables the input if disabled prop is given', function () { + const newProps = { ...props, disabled: true }; + component = mountWithIntl(); + const input = findTestSubject(component, 'pieLabelTruncateInput'); + expect(input.props().disabled).toBe(true); + }); + + it('should set the new value', function () { + component = mountWithIntl(); + const input = findTestSubject(component, 'pieLabelTruncateInput'); + input.simulate('change', { target: { value: 100 } }); + expect(props.setValue).toHaveBeenCalled(); + }); +}); diff --git a/src/plugins/vis_type_pie/public/editor/components/truncate_labels.tsx b/src/plugins/vis_type_pie/public/editor/components/truncate_labels.tsx new file mode 100644 index 00000000000000..e6eb56725753c6 --- /dev/null +++ b/src/plugins/vis_type_pie/public/editor/components/truncate_labels.tsx @@ -0,0 +1,43 @@ +/* + * 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 React, { ChangeEvent } from 'react'; +import { i18n } from '@kbn/i18n'; +import { EuiFormRow, EuiFieldNumber } from '@elastic/eui'; + +export interface TruncateLabelsOptionProps { + disabled?: boolean; + value?: number | null; + setValue: (paramName: 'truncate', value: null | number) => void; +} + +function TruncateLabelsOption({ disabled, value = null, setValue }: TruncateLabelsOptionProps) { + const onChange = (ev: ChangeEvent) => + setValue('truncate', ev.target.value === '' ? null : parseFloat(ev.target.value)); + + return ( + + + + ); +} + +export { TruncateLabelsOption }; diff --git a/src/plugins/vis_type_pie/public/editor/positions.ts b/src/plugins/vis_type_pie/public/editor/positions.ts new file mode 100644 index 00000000000000..ea099a23cf9b41 --- /dev/null +++ b/src/plugins/vis_type_pie/public/editor/positions.ts @@ -0,0 +1,37 @@ +/* + * 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 { i18n } from '@kbn/i18n'; +import { Position } from '@elastic/charts'; + +export const getLegendPositions = [ + { + text: i18n.translate('visTypePie.legendPositions.topText', { + defaultMessage: 'Top', + }), + value: Position.Top, + }, + { + text: i18n.translate('visTypePie.legendPositions.leftText', { + defaultMessage: 'Left', + }), + value: Position.Left, + }, + { + text: i18n.translate('visTypePie.legendPositions.rightText', { + defaultMessage: 'Right', + }), + value: Position.Right, + }, + { + text: i18n.translate('visTypePie.legendPositions.bottomText', { + defaultMessage: 'Bottom', + }), + value: Position.Bottom, + }, +]; diff --git a/src/plugins/vis_type_pie/public/expression_functions/pie_labels.ts b/src/plugins/vis_type_pie/public/expression_functions/pie_labels.ts new file mode 100644 index 00000000000000..269d5d5f779d6c --- /dev/null +++ b/src/plugins/vis_type_pie/public/expression_functions/pie_labels.ts @@ -0,0 +1,113 @@ +/* + * 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 { i18n } from '@kbn/i18n'; +import { + ExpressionFunctionDefinition, + Datatable, + ExpressionValueBoxed, +} from '../../../expressions/public'; + +interface Arguments { + show: boolean; + position: string; + values: boolean; + truncate: number | null; + valuesFormat: string; + lastLevel: boolean; + percentDecimals: number; +} + +export type ExpressionValuePieLabels = ExpressionValueBoxed< + 'pie_labels', + { + show: boolean; + position: string; + values: boolean; + truncate: number | null; + valuesFormat: string; + last_level: boolean; + percentDecimals: number; + } +>; + +export const pieLabels = (): ExpressionFunctionDefinition< + 'pielabels', + Datatable | null, + Arguments, + ExpressionValuePieLabels +> => ({ + name: 'pielabels', + help: i18n.translate('visTypePie.function.pieLabels.help', { + defaultMessage: 'Generates the pie labels object', + }), + type: 'pie_labels', + args: { + show: { + types: ['boolean'], + help: i18n.translate('visTypePie.function.pieLabels.show.help', { + defaultMessage: 'Displays the pie labels', + }), + required: true, + }, + position: { + types: ['string'], + default: 'default', + help: i18n.translate('visTypePie.function.pieLabels.position.help', { + defaultMessage: 'Defines the label position', + }), + }, + values: { + types: ['boolean'], + help: i18n.translate('visTypePie.function.pieLabels.values.help', { + defaultMessage: 'Displays the values inside the slices', + }), + default: true, + }, + percentDecimals: { + types: ['number'], + help: i18n.translate('visTypePie.function.pieLabels.percentDecimals.help', { + defaultMessage: 'Defines the number of decimals that will appear on the values as percent', + }), + default: 2, + }, + lastLevel: { + types: ['boolean'], + help: i18n.translate('visTypePie.function.pieLabels.lastLevel.help', { + defaultMessage: 'Show top level labels only', + }), + default: true, + }, + truncate: { + types: ['number', 'null'], + help: i18n.translate('visTypePie.function.pieLabels.truncate.help', { + defaultMessage: 'Defines the number of characters that the slice value will display', + }), + default: null, + }, + valuesFormat: { + types: ['string'], + default: 'percent', + help: i18n.translate('visTypePie.function.pieLabels.valuesFormat.help', { + defaultMessage: 'Defines the format of the values', + }), + }, + }, + fn: (context, args) => { + return { + type: 'pie_labels', + show: args.show, + position: args.position, + percentDecimals: args.percentDecimals, + values: args.values, + truncate: args.truncate, + valuesFormat: args.valuesFormat, + last_level: args.lastLevel, + }; + }, +}); diff --git a/src/plugins/vis_type_pie/public/index.ts b/src/plugins/vis_type_pie/public/index.ts new file mode 100644 index 00000000000000..adf8b2d073f390 --- /dev/null +++ b/src/plugins/vis_type_pie/public/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 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 { VisTypePiePlugin } from './plugin'; + +export { pieVisType } from './vis_type'; +export { Dimensions, Dimension } from './types'; + +export const plugin = () => new VisTypePiePlugin(); diff --git a/src/plugins/vis_type_pie/public/mocks.ts b/src/plugins/vis_type_pie/public/mocks.ts new file mode 100644 index 00000000000000..53579422e44eba --- /dev/null +++ b/src/plugins/vis_type_pie/public/mocks.ts @@ -0,0 +1,328 @@ +/* + * 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 { Datatable } from '../../expressions/public'; +import { BucketColumns, PieVisParams, LabelPositions, ValueFormats } from './types'; + +export const createMockBucketColumns = (): BucketColumns[] => { + return [ + { + id: 'col-0-2', + name: 'Carrier: Descending', + meta: { + type: 'string', + field: 'Carrier', + index: 'kibana_sample_data_flights', + params: { + id: 'terms', + params: { + id: 'string', + otherBucketLabel: 'Other', + missingBucketLabel: 'Missing', + }, + }, + source: 'esaggs', + sourceParams: { + indexPatternId: 'd3d7af60-4c81-11e8-b3d7-01146121b73d', + id: '2', + enabled: true, + type: 'terms', + params: { + field: 'Carrier', + orderBy: '1', + order: 'desc', + size: 5, + otherBucket: false, + otherBucketLabel: 'Other', + missingBucket: false, + missingBucketLabel: 'Missing', + }, + schema: 'segment', + }, + }, + format: { + id: 'terms', + params: { + id: 'string', + }, + }, + }, + { + id: 'col-2-3', + name: 'Cancelled: Descending', + meta: { + type: 'boolean', + field: 'Cancelled', + index: 'kibana_sample_data_flights', + params: { + id: 'terms', + params: { + id: 'boolean', + otherBucketLabel: 'Other', + missingBucketLabel: 'Missing', + }, + }, + source: 'esaggs', + sourceParams: { + indexPatternId: 'd3d7af60-4c81-11e8-b3d7-01146121b73d', + id: '3', + enabled: true, + type: 'terms', + params: { + field: 'Cancelled', + orderBy: '1', + order: 'desc', + size: 5, + otherBucket: false, + otherBucketLabel: 'Other', + missingBucket: false, + missingBucketLabel: 'Missing', + }, + schema: 'segment', + }, + }, + format: { + id: 'terms', + params: { + id: 'boolean', + }, + }, + }, + ]; +}; + +export const createMockVisData = (): Datatable => { + return { + type: 'datatable', + rows: [ + { + 'col-0-2': 'Logstash Airways', + 'col-2-3': 0, + 'col-1-1': 797, + 'col-3-1': 689, + }, + { + 'col-0-2': 'Logstash Airways', + 'col-2-3': 1, + 'col-1-1': 797, + 'col-3-1': 108, + }, + { + 'col-0-2': 'JetBeats', + 'col-2-3': 0, + 'col-1-1': 766, + 'col-3-1': 654, + }, + { + 'col-0-2': 'JetBeats', + 'col-2-3': 1, + 'col-1-1': 766, + 'col-3-1': 112, + }, + { + 'col-0-2': 'ES-Air', + 'col-2-3': 0, + 'col-1-1': 744, + 'col-3-1': 665, + }, + { + 'col-0-2': 'ES-Air', + 'col-2-3': 1, + 'col-1-1': 744, + 'col-3-1': 79, + }, + { + 'col-0-2': 'Kibana Airlines', + 'col-2-3': 0, + 'col-1-1': 731, + 'col-3-1': 655, + }, + { + 'col-0-2': 'Kibana Airlines', + 'col-2-3': 1, + 'col-1-1': 731, + 'col-3-1': 76, + }, + ], + columns: [ + { + id: 'col-0-2', + name: 'Carrier: Descending', + meta: { + type: 'string', + field: 'Carrier', + index: 'kibana_sample_data_flights', + params: { + id: 'terms', + params: { + id: 'string', + otherBucketLabel: 'Other', + missingBucketLabel: 'Missing', + }, + }, + source: 'esaggs', + sourceParams: { + indexPatternId: 'd3d7af60-4c81-11e8-b3d7-01146121b73d', + id: '2', + enabled: true, + type: 'terms', + params: { + field: 'Carrier', + orderBy: '1', + order: 'desc', + size: 5, + otherBucket: false, + otherBucketLabel: 'Other', + missingBucket: false, + missingBucketLabel: 'Missing', + }, + schema: 'segment', + }, + }, + }, + { + id: 'col-1-1', + name: 'Count', + meta: { + type: 'number', + index: 'kibana_sample_data_flights', + params: { + id: 'number', + }, + source: 'esaggs', + sourceParams: { + indexPatternId: 'd3d7af60-4c81-11e8-b3d7-01146121b73d', + id: '1', + enabled: true, + type: 'count', + params: {}, + schema: 'metric', + }, + }, + }, + { + id: 'col-2-3', + name: 'Cancelled: Descending', + meta: { + type: 'boolean', + field: 'Cancelled', + index: 'kibana_sample_data_flights', + params: { + id: 'terms', + params: { + id: 'boolean', + otherBucketLabel: 'Other', + missingBucketLabel: 'Missing', + }, + }, + source: 'esaggs', + sourceParams: { + indexPatternId: 'd3d7af60-4c81-11e8-b3d7-01146121b73d', + id: '3', + enabled: true, + type: 'terms', + params: { + field: 'Cancelled', + orderBy: '1', + order: 'desc', + size: 5, + otherBucket: false, + otherBucketLabel: 'Other', + missingBucket: false, + missingBucketLabel: 'Missing', + }, + schema: 'segment', + }, + }, + }, + { + id: 'col-3-1', + name: 'Count', + meta: { + type: 'number', + index: 'kibana_sample_data_flights', + params: { + id: 'number', + }, + source: 'esaggs', + sourceParams: { + indexPatternId: 'd3d7af60-4c81-11e8-b3d7-01146121b73d', + id: '1', + enabled: true, + type: 'count', + params: {}, + schema: 'metric', + }, + }, + }, + ], + }; +}; + +export const createMockPieParams = (): PieVisParams => { + return ({ + addLegend: true, + addTooltip: true, + isDonut: true, + labels: { + position: LabelPositions.DEFAULT, + show: true, + truncate: 100, + values: true, + valuesFormat: ValueFormats.PERCENT, + percentDecimals: 2, + }, + legendPosition: 'right', + nestedLegend: false, + distinctColors: false, + palette: { + name: 'default', + type: 'palette', + }, + type: 'pie', + dimensions: { + metric: { + accessor: 1, + format: { + id: 'number', + }, + params: {}, + label: 'Count', + aggType: 'count', + }, + buckets: [ + { + accessor: 0, + format: { + id: 'terms', + params: { + id: 'string', + otherBucketLabel: 'Other', + missingBucketLabel: 'Missing', + }, + }, + label: 'Carrier: Descending', + aggType: 'terms', + }, + { + accessor: 2, + format: { + id: 'terms', + params: { + id: 'boolean', + otherBucketLabel: 'Other', + missingBucketLabel: 'Missing', + }, + }, + label: 'Cancelled: Descending', + aggType: 'terms', + }, + ], + }, + } as unknown) as PieVisParams; +}; diff --git a/src/plugins/vis_type_pie/public/pie_component.test.tsx b/src/plugins/vis_type_pie/public/pie_component.test.tsx new file mode 100644 index 00000000000000..177396f25adb67 --- /dev/null +++ b/src/plugins/vis_type_pie/public/pie_component.test.tsx @@ -0,0 +1,123 @@ +/* + * 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 React from 'react'; +import { Settings, TooltipType, SeriesIdentifier } from '@elastic/charts'; +import { chartPluginMock } from '../../charts/public/mocks'; +import { dataPluginMock } from '../../data/public/mocks'; +import { shallow, mount } from 'enzyme'; +import { findTestSubject } from '@elastic/eui/lib/test'; +import { act } from 'react-dom/test-utils'; +import PieComponent, { PieComponentProps } from './pie_component'; +import { createMockPieParams, createMockVisData } from './mocks'; + +jest.mock('@elastic/charts', () => { + const original = jest.requireActual('@elastic/charts'); + + return { + ...original, + getSpecId: jest.fn(() => {}), + }; +}); + +const chartsThemeService = chartPluginMock.createSetupContract().theme; +const palettesRegistry = chartPluginMock.createPaletteRegistry(); +const visParams = createMockPieParams(); +const visData = createMockVisData(); + +const mockState = new Map(); +const uiState = { + get: jest + .fn() + .mockImplementation((key, fallback) => (mockState.has(key) ? mockState.get(key) : fallback)), + set: jest.fn().mockImplementation((key, value) => mockState.set(key, value)), + emit: jest.fn(), + setSilent: jest.fn(), +} as any; + +describe('PieComponent', function () { + let wrapperProps: PieComponentProps; + + beforeAll(() => { + wrapperProps = { + chartsThemeService, + palettesRegistry, + visParams, + visData, + uiState, + syncColors: false, + fireEvent: jest.fn(), + renderComplete: jest.fn(), + services: dataPluginMock.createStartContract(), + }; + }); + + it('renders the legend on the correct position', () => { + const component = shallow(); + expect(component.find(Settings).prop('legendPosition')).toEqual('right'); + }); + + it('renders the legend toggle component', async () => { + const component = mount(); + await act(async () => { + expect(findTestSubject(component, 'vislibToggleLegend').length).toBe(1); + }); + }); + + it('hides the legend if the legend toggle is clicked', async () => { + const component = mount(); + findTestSubject(component, 'vislibToggleLegend').simulate('click'); + await act(async () => { + expect(component.find(Settings).prop('showLegend')).toEqual(false); + }); + }); + + it('defaults on showing the legend for the inner cicle', () => { + const component = shallow(); + expect(component.find(Settings).prop('legendMaxDepth')).toBe(1); + }); + + it('shows the nested legend when the user requests it', () => { + const newParams = { ...visParams, nestedLegend: true }; + const newProps = { ...wrapperProps, visParams: newParams }; + const component = shallow(); + expect(component.find(Settings).prop('legendMaxDepth')).toBeUndefined(); + }); + + it('defaults on displaying the tooltip', () => { + const component = shallow(); + expect(component.find(Settings).prop('tooltip')).toStrictEqual({ type: TooltipType.Follow }); + }); + + it('doesnt show the tooltip when the user requests it', () => { + const newParams = { ...visParams, addTooltip: false }; + const newProps = { ...wrapperProps, visParams: newParams }; + const component = shallow(); + expect(component.find(Settings).prop('tooltip')).toStrictEqual({ type: TooltipType.None }); + }); + + it('calls filter callback', () => { + const component = shallow(); + component.find(Settings).first().prop('onElementClick')!([ + [ + [ + { + groupByRollup: 6, + value: 6, + depth: 1, + path: [], + sortIndex: 1, + smAccessorValue: 'Logstash Airways', + }, + ], + {} as SeriesIdentifier, + ], + ]); + expect(wrapperProps.fireEvent).toHaveBeenCalled(); + }); +}); diff --git a/src/plugins/vis_type_pie/public/pie_component.tsx b/src/plugins/vis_type_pie/public/pie_component.tsx new file mode 100644 index 00000000000000..b79eed2087a168 --- /dev/null +++ b/src/plugins/vis_type_pie/public/pie_component.tsx @@ -0,0 +1,355 @@ +/* + * 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 React, { memo, useCallback, useMemo, useState, useEffect, useRef } from 'react'; + +import { + Chart, + Datum, + LayerValue, + Partition, + Position, + Settings, + RenderChangeListener, + TooltipProps, + TooltipType, + SeriesIdentifier, +} from '@elastic/charts'; +import { + LegendToggle, + ClickTriggerEvent, + ChartsPluginSetup, + PaletteRegistry, +} from '../../charts/public'; +import { DataPublicPluginStart, FieldFormat } from '../../data/public'; +import type { PersistedState } from '../../visualizations/public'; +import { Datatable, DatatableColumn, IInterpreterRenderHandlers } from '../../expressions/public'; +import { DEFAULT_PERCENT_DECIMALS } from '../common'; +import { PieVisParams, BucketColumns, ValueFormats, PieContainerDimensions } from './types'; +import { + getColorPicker, + getLayers, + getLegendActions, + canFilter, + getFilterClickData, + getFilterEventData, + getConfig, + getColumns, + getSplitDimensionAccessor, +} from './utils'; +import { ChartSplit, SMALL_MULTIPLES_ID } from './components/chart_split'; + +import './chart.scss'; + +declare global { + interface Window { + /** + * Flag used to enable debugState on elastic charts + */ + _echDebugStateFlag?: boolean; + } +} + +export interface PieComponentProps { + visParams: PieVisParams; + visData: Datatable; + uiState: PersistedState; + fireEvent: IInterpreterRenderHandlers['event']; + renderComplete: IInterpreterRenderHandlers['done']; + chartsThemeService: ChartsPluginSetup['theme']; + palettesRegistry: PaletteRegistry; + services: DataPublicPluginStart; + syncColors: boolean; +} + +const PieComponent = (props: PieComponentProps) => { + const chartTheme = props.chartsThemeService.useChartsTheme(); + const chartBaseTheme = props.chartsThemeService.useChartsBaseTheme(); + const [showLegend, setShowLegend] = useState(() => { + const bwcLegendStateDefault = + props.visParams.addLegend == null ? false : props.visParams.addLegend; + return props.uiState?.get('vis.legendOpen', bwcLegendStateDefault) as boolean; + }); + const [dimensions, setDimensions] = useState(); + + const parentRef = useRef(null); + + useEffect(() => { + if (parentRef && parentRef.current) { + const parentHeight = parentRef.current!.getBoundingClientRect().height; + const parentWidth = parentRef.current!.getBoundingClientRect().width; + setDimensions({ width: parentWidth, height: parentHeight }); + } + }, [parentRef]); + + const onRenderChange = useCallback( + (isRendered) => { + if (isRendered) { + props.renderComplete(); + } + }, + [props] + ); + + // handles slice click event + const handleSliceClick = useCallback( + ( + clickedLayers: LayerValue[], + bucketColumns: Array>, + visData: Datatable, + splitChartDimension?: DatatableColumn, + splitChartFormatter?: FieldFormat + ): void => { + const data = getFilterClickData( + clickedLayers, + bucketColumns, + visData, + splitChartDimension, + splitChartFormatter + ); + const event = { + name: 'filterBucket', + data: { data }, + }; + props.fireEvent(event); + }, + [props] + ); + + // handles legend action event data + const getLegendActionEventData = useCallback( + (visData: Datatable) => (series: SeriesIdentifier): ClickTriggerEvent | null => { + const data = getFilterEventData(visData, series); + + return { + name: 'filterBucket', + data: { + negate: false, + data, + }, + }; + }, + [] + ); + + const handleLegendAction = useCallback( + (event: ClickTriggerEvent, negate = false) => { + props.fireEvent({ + ...event, + data: { + ...event.data, + negate, + }, + }); + }, + [props] + ); + + const toggleLegend = useCallback(() => { + setShowLegend((value) => { + const newValue = !value; + props.uiState?.set('vis.legendOpen', newValue); + return newValue; + }); + }, [props.uiState]); + + useEffect(() => { + setShowLegend(props.visParams.addLegend); + props.uiState?.set('vis.legendOpen', props.visParams.addLegend); + }, [props.uiState, props.visParams.addLegend]); + + const setColor = useCallback( + (newColor: string | null, seriesLabel: string | number) => { + const colors = props.uiState?.get('vis.colors') || {}; + if (colors[seriesLabel] === newColor || !newColor) { + delete colors[seriesLabel]; + } else { + colors[seriesLabel] = newColor; + } + props.uiState?.setSilent('vis.colors', null); + props.uiState?.set('vis.colors', colors); + props.uiState?.emit('reload'); + }, + [props.uiState] + ); + + const { visData, visParams, services, syncColors } = props; + + function getSliceValue(d: Datum, metricColumn: DatatableColumn) { + if (typeof d[metricColumn.id] === 'number' && d[metricColumn.id] !== 0) { + return d[metricColumn.id]; + } + return Number.EPSILON; + } + + // formatters + const metricFieldFormatter = services.fieldFormats.deserialize( + visParams.dimensions.metric.format + ); + const splitChartFormatter = visParams.dimensions.splitColumn + ? services.fieldFormats.deserialize(visParams.dimensions.splitColumn[0].format) + : visParams.dimensions.splitRow + ? services.fieldFormats.deserialize(visParams.dimensions.splitRow[0].format) + : undefined; + const percentFormatter = services.fieldFormats.deserialize({ + id: 'percent', + params: { + pattern: `0,0.[${'0'.repeat(visParams.labels.percentDecimals ?? DEFAULT_PERCENT_DECIMALS)}]%`, + }, + }); + + const { bucketColumns, metricColumn } = useMemo(() => getColumns(visParams, visData), [ + visData, + visParams, + ]); + + const layers = useMemo( + () => + getLayers( + bucketColumns, + visParams, + props.uiState?.get('vis.colors', {}), + visData.rows, + props.palettesRegistry, + services.fieldFormats, + syncColors + ), + [ + bucketColumns, + visParams, + props.uiState, + props.palettesRegistry, + visData.rows, + services.fieldFormats, + syncColors, + ] + ); + const config = useMemo(() => getConfig(visParams, chartTheme, dimensions), [ + chartTheme, + visParams, + dimensions, + ]); + const tooltip: TooltipProps = { + type: visParams.addTooltip ? TooltipType.Follow : TooltipType.None, + }; + const legendPosition = visParams.legendPosition ?? Position.Right; + + const legendColorPicker = useMemo( + () => + getColorPicker( + legendPosition, + setColor, + bucketColumns, + visParams.palette.name, + visData.rows, + props.uiState, + visParams.distinctColors + ), + [ + legendPosition, + setColor, + bucketColumns, + visParams.palette.name, + visParams.distinctColors, + visData.rows, + props.uiState, + ] + ); + + const splitChartColumnAccessor = visParams.dimensions.splitColumn + ? getSplitDimensionAccessor( + services.fieldFormats, + visData.columns + )(visParams.dimensions.splitColumn[0]) + : undefined; + const splitChartRowAccessor = visParams.dimensions.splitRow + ? getSplitDimensionAccessor( + services.fieldFormats, + visData.columns + )(visParams.dimensions.splitRow[0]) + : undefined; + + const splitChartDimension = visParams.dimensions.splitColumn + ? visData.columns[visParams.dimensions.splitColumn[0].accessor] + : visParams.dimensions.splitRow + ? visData.columns[visParams.dimensions.splitRow[0].accessor] + : undefined; + + return ( +
+
+ + + + { + handleSliceClick( + args[0][0] as LayerValue[], + bucketColumns, + visData, + splitChartDimension, + splitChartFormatter + ); + }} + legendAction={getLegendActions( + canFilter, + getLegendActionEventData(visData), + handleLegendAction, + visParams, + services.actions, + services.fieldFormats + )} + theme={chartTheme} + baseTheme={chartBaseTheme} + onRenderChange={onRenderChange} + /> + getSliceValue(d, metricColumn)} + percentFormatter={(d: number) => percentFormatter.convert(d / 100)} + valueGetter={ + !visParams.labels.show || + visParams.labels.valuesFormat === ValueFormats.VALUE || + !visParams.labels.values + ? undefined + : 'percent' + } + valueFormatter={(d: number) => + !visParams.labels.show || !visParams.labels.values + ? '' + : metricFieldFormatter.convert(d) + } + layers={layers} + config={config} + topGroove={!visParams.labels.show ? 0 : undefined} + /> + +
+
+ ); +}; + +// eslint-disable-next-line import/no-default-export +export default memo(PieComponent); diff --git a/src/plugins/vis_type_pie/public/pie_fn.test.ts b/src/plugins/vis_type_pie/public/pie_fn.test.ts new file mode 100644 index 00000000000000..d387d4035e8ab5 --- /dev/null +++ b/src/plugins/vis_type_pie/public/pie_fn.test.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 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 { functionWrapper } from '../../expressions/common/expression_functions/specs/tests/utils'; +import { createPieVisFn } from './pie_fn'; + +describe('interpreter/functions#pie', () => { + const fn = functionWrapper(createPieVisFn()); + const context = { + type: 'datatable', + rows: [{ 'col-0-1': 0 }], + columns: [{ id: 'col-0-1', name: 'Count' }], + }; + const visConfig = { + addTooltip: true, + addLegend: true, + legendPosition: 'right', + isDonut: true, + nestedLegend: true, + distinctColors: false, + palette: 'kibana_palette', + labels: { + show: false, + values: true, + position: 'default', + valuesFormat: 'percent', + percentDecimals: 2, + truncate: 100, + }, + metric: { + accessor: 0, + format: { + id: 'number', + }, + params: {}, + aggType: 'count', + }, + }; + + beforeEach(() => { + jest.clearAllMocks(); + }); + + it('returns an object with the correct structure', async () => { + const actual = await fn(context, visConfig); + expect(actual).toMatchSnapshot(); + }); +}); diff --git a/src/plugins/vis_type_pie/public/pie_fn.ts b/src/plugins/vis_type_pie/public/pie_fn.ts new file mode 100644 index 00000000000000..1b5b8574f93117 --- /dev/null +++ b/src/plugins/vis_type_pie/public/pie_fn.ts @@ -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 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 { i18n } from '@kbn/i18n'; +import { ExpressionFunctionDefinition, Datatable, Render } from '../../expressions/public'; +import { PieVisParams, PieVisConfig } from './types'; + +export const vislibPieName = 'pie_vis'; + +export interface RenderValue { + visData: Datatable; + visType: string; + visConfig: PieVisParams; + syncColors: boolean; +} + +export type VisTypePieExpressionFunctionDefinition = ExpressionFunctionDefinition< + typeof vislibPieName, + Datatable, + PieVisConfig, + Render +>; + +export const createPieVisFn = (): VisTypePieExpressionFunctionDefinition => ({ + name: vislibPieName, + type: 'render', + inputTypes: ['datatable'], + help: i18n.translate('visTypePie.functions.help', { + defaultMessage: 'Pie visualization', + }), + args: { + metric: { + types: ['vis_dimension'], + help: i18n.translate('visTypePie.function.args.metricHelpText', { + defaultMessage: 'Metric dimensions config', + }), + required: true, + }, + buckets: { + types: ['vis_dimension'], + help: i18n.translate('visTypePie.function.args.bucketsHelpText', { + defaultMessage: 'Buckets dimensions config', + }), + multi: true, + }, + splitColumn: { + types: ['vis_dimension'], + help: i18n.translate('visTypePie.function.args.splitColumnHelpText', { + defaultMessage: 'Split by column dimension config', + }), + multi: true, + }, + splitRow: { + types: ['vis_dimension'], + help: i18n.translate('visTypePie.function.args.splitRowHelpText', { + defaultMessage: 'Split by row dimension config', + }), + multi: true, + }, + addTooltip: { + types: ['boolean'], + help: i18n.translate('visTypePie.function.args.addTooltipHelpText', { + defaultMessage: 'Show tooltip on slice hover', + }), + default: true, + }, + addLegend: { + types: ['boolean'], + help: i18n.translate('visTypePie.function.args.addLegendHelpText', { + defaultMessage: 'Show legend chart legend', + }), + }, + legendPosition: { + types: ['string'], + help: i18n.translate('visTypePie.function.args.legendPositionHelpText', { + defaultMessage: 'Position the legend on top, bottom, left, right of the chart', + }), + }, + nestedLegend: { + types: ['boolean'], + help: i18n.translate('visTypePie.function.args.nestedLegendHelpText', { + defaultMessage: 'Show a more detailed legend', + }), + default: false, + }, + distinctColors: { + types: ['boolean'], + help: i18n.translate('visTypePie.function.args.distinctColorsHelpText', { + defaultMessage: + 'Maps different color per slice. Slices with the same value have the same color', + }), + default: false, + }, + isDonut: { + types: ['boolean'], + help: i18n.translate('visTypePie.function.args.isDonutHelpText', { + defaultMessage: 'Displays the pie chart as donut', + }), + default: false, + }, + palette: { + types: ['string'], + help: i18n.translate('visTypePie.function.args.paletteHelpText', { + defaultMessage: 'Defines the chart palette name', + }), + default: 'default', + }, + labels: { + types: ['pie_labels'], + help: i18n.translate('visTypePie.function.args.labelsHelpText', { + defaultMessage: 'Pie labels config', + }), + }, + }, + fn(context, args, handlers) { + const visConfig = { + ...args, + palette: { + type: 'palette', + name: args.palette, + }, + dimensions: { + metric: args.metric, + buckets: args.buckets, + splitColumn: args.splitColumn, + splitRow: args.splitRow, + }, + } as PieVisParams; + + if (handlers?.inspectorAdapters?.tables) { + handlers.inspectorAdapters.tables.logDatatable('default', context); + } + + return { + type: 'render', + as: vislibPieName, + value: { + visData: context, + visConfig, + syncColors: handlers?.isSyncColorsEnabled?.() ?? false, + visType: 'pie', + params: { + listenOnChange: true, + }, + }, + }; + }, +}); diff --git a/src/plugins/vis_type_pie/public/pie_renderer.tsx b/src/plugins/vis_type_pie/public/pie_renderer.tsx new file mode 100644 index 00000000000000..bcd4cad4efa66f --- /dev/null +++ b/src/plugins/vis_type_pie/public/pie_renderer.tsx @@ -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 React, { lazy } from 'react'; +import { render, unmountComponentAtNode } from 'react-dom'; +import { I18nProvider } from '@kbn/i18n/react'; +import { ExpressionRenderDefinition } from '../../expressions/public'; +import { VisualizationContainer } from '../../visualizations/public'; +import type { PersistedState } from '../../visualizations/public'; +import { VisTypePieDependencies } from './plugin'; + +import { RenderValue, vislibPieName } from './pie_fn'; + +const PieComponent = lazy(() => import('./pie_component')); + +function shouldShowNoResultsMessage(visData: any): boolean { + const rows: object[] | undefined = visData?.rows; + const isZeroHits = visData?.hits === 0 || (rows && !rows.length); + + return Boolean(isZeroHits); +} + +export const getPieVisRenderer: ( + deps: VisTypePieDependencies +) => ExpressionRenderDefinition = ({ theme, palettes, getStartDeps }) => ({ + name: vislibPieName, + displayName: 'Pie visualization', + reuseDomNode: true, + render: async (domNode, { visConfig, visData, syncColors }, handlers) => { + const showNoResult = shouldShowNoResultsMessage(visData); + + handlers.onDestroy(() => { + unmountComponentAtNode(domNode); + }); + + const services = await getStartDeps(); + const palettesRegistry = await palettes.getPalettes(); + + render( + + + + + , + domNode + ); + }, +}); diff --git a/src/plugins/vis_type_pie/public/plugin.ts b/src/plugins/vis_type_pie/public/plugin.ts new file mode 100644 index 00000000000000..440a3a75a2eb19 --- /dev/null +++ b/src/plugins/vis_type_pie/public/plugin.ts @@ -0,0 +1,73 @@ +/* + * 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 { CoreSetup, DocLinksStart } from 'src/core/public'; +import { VisualizationsSetup } from '../../visualizations/public'; +import { Plugin as ExpressionsPublicPlugin } from '../../expressions/public'; +import { ChartsPluginSetup } from '../../charts/public'; +import { UsageCollectionSetup } from '../../usage_collection/public'; +import { DataPublicPluginStart } from '../../data/public'; +import { LEGACY_CHARTS_LIBRARY } from '../../visualizations/common/constants'; +import { pieLabels as pieLabelsExpressionFunction } from './expression_functions/pie_labels'; +import { createPieVisFn } from './pie_fn'; +import { getPieVisRenderer } from './pie_renderer'; +import { pieVisType } from './vis_type'; + +/** @internal */ +export interface VisTypePieSetupDependencies { + visualizations: VisualizationsSetup; + expressions: ReturnType; + charts: ChartsPluginSetup; + usageCollection: UsageCollectionSetup; +} + +/** @internal */ +export interface VisTypePiePluginStartDependencies { + data: DataPublicPluginStart; +} + +/** @internal */ +export interface VisTypePieDependencies { + theme: ChartsPluginSetup['theme']; + palettes: ChartsPluginSetup['palettes']; + getStartDeps: () => Promise<{ data: DataPublicPluginStart; docLinks: DocLinksStart }>; +} + +export class VisTypePiePlugin { + setup( + core: CoreSetup, + { expressions, visualizations, charts, usageCollection }: VisTypePieSetupDependencies + ) { + if (!core.uiSettings.get(LEGACY_CHARTS_LIBRARY, false)) { + const getStartDeps = async () => { + const [coreStart, deps] = await core.getStartServices(); + return { + data: deps.data, + docLinks: coreStart.docLinks, + }; + }; + const trackUiMetric = usageCollection?.reportUiCounter.bind(usageCollection, 'vis_type_pie'); + + expressions.registerFunction(createPieVisFn); + expressions.registerRenderer( + getPieVisRenderer({ theme: charts.theme, palettes: charts.palettes, getStartDeps }) + ); + expressions.registerFunction(pieLabelsExpressionFunction); + visualizations.createBaseVisualization( + pieVisType({ + showElasticChartsOptions: true, + palettes: charts.palettes, + trackUiMetric, + }) + ); + } + return {}; + } + + start() {} +} diff --git a/src/plugins/vis_type_pie/public/sample_vis.test.mocks.ts b/src/plugins/vis_type_pie/public/sample_vis.test.mocks.ts new file mode 100644 index 00000000000000..3b07743e79f457 --- /dev/null +++ b/src/plugins/vis_type_pie/public/sample_vis.test.mocks.ts @@ -0,0 +1,1332 @@ +/* + * 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 const samplePieVis = { + type: { + name: 'pie', + title: 'Pie', + description: 'Compare parts of a whole', + icon: 'visPie', + stage: 'production', + options: { + showTimePicker: true, + showQueryBar: true, + showFilterBar: true, + showIndexSelection: true, + hierarchicalData: false, + }, + visConfig: { + defaults: { + type: 'pie', + addTooltip: true, + addLegend: true, + legendPosition: 'right', + isDonut: true, + nestedLegend: true, + distinctColors: false, + palette: 'kibana_palette', + labels: { + show: false, + values: true, + last_level: true, + valuesFormat: 'percent', + percentDecimals: 2, + truncate: 100, + }, + }, + }, + editorConfig: { + collections: { + legendPositions: [ + { + text: 'Top', + value: 'top', + }, + { + text: 'Left', + value: 'left', + }, + { + text: 'Right', + value: 'right', + }, + { + text: 'Bottom', + value: 'bottom', + }, + ], + }, + schemas: { + all: [ + { + group: 'metrics', + name: 'metric', + title: 'Slice size', + min: 1, + max: 1, + aggFilter: ['sum', 'count', 'cardinality', 'top_hits'], + defaults: [ + { + schema: 'metric', + type: 'count', + }, + ], + editor: false, + params: [], + }, + { + group: 'buckets', + name: 'segment', + title: 'Split slices', + min: 0, + max: null, + aggFilter: ['!geohash_grid', '!geotile_grid', '!filter'], + editor: false, + params: [], + }, + { + group: 'buckets', + name: 'split', + title: 'Split chart', + mustBeFirst: true, + min: 0, + max: 1, + aggFilter: ['!geohash_grid', '!geotile_grid', '!filter'], + params: [ + { + name: 'row', + default: true, + }, + ], + editor: false, + }, + ], + buckets: [null, null], + metrics: [null], + }, + }, + hidden: false, + hierarchicalData: true, + }, + title: '[Flights] Airline Carrier', + description: '', + params: { + type: 'pie', + addTooltip: true, + addLegend: true, + legendPosition: 'right', + isDonut: true, + labels: { + show: true, + values: true, + last_level: true, + truncate: 100, + }, + }, + data: { + indexPattern: { id: '123' }, + searchSource: { + id: 'data_source1', + requestStartHandlers: [], + inheritOptions: {}, + history: [], + fields: { + filter: [], + query: { + query: '', + language: 'kuery', + }, + index: { + id: 'd3d7af60-4c81-11e8-b3d7-01146121b73d', + title: 'kibana_sample_data_flights', + fieldFormatMap: { + AvgTicketPrice: { + id: 'number', + params: { + parsedUrl: { + origin: 'http://localhost:5801', + pathname: '/app/visualize', + basePath: '', + }, + pattern: '$0,0.[00]', + }, + }, + hour_of_day: { + id: 'number', + params: { + pattern: '00', + }, + }, + }, + fields: [ + { + count: 0, + name: 'AvgTicketPrice', + type: 'number', + esTypes: ['float'], + scripted: false, + searchable: true, + aggregatable: true, + readFromDocValues: true, + }, + { + count: 0, + name: 'Cancelled', + type: 'boolean', + esTypes: ['boolean'], + scripted: false, + searchable: true, + aggregatable: true, + readFromDocValues: true, + }, + { + count: 0, + name: 'Carrier', + type: 'string', + esTypes: ['keyword'], + scripted: false, + searchable: true, + aggregatable: true, + readFromDocValues: true, + }, + { + count: 0, + name: 'Dest', + type: 'string', + esTypes: ['keyword'], + scripted: false, + searchable: true, + aggregatable: true, + readFromDocValues: true, + }, + { + count: 0, + name: 'DestAirportID', + type: 'string', + esTypes: ['keyword'], + scripted: false, + searchable: true, + aggregatable: true, + readFromDocValues: true, + }, + { + count: 0, + name: 'DestCityName', + type: 'string', + esTypes: ['keyword'], + scripted: false, + searchable: true, + aggregatable: true, + readFromDocValues: true, + }, + { + count: 0, + name: 'DestCountry', + type: 'string', + esTypes: ['keyword'], + scripted: false, + searchable: true, + aggregatable: true, + readFromDocValues: true, + }, + { + count: 0, + name: 'DestLocation', + type: 'geo_point', + esTypes: ['geo_point'], + scripted: false, + searchable: true, + aggregatable: true, + readFromDocValues: true, + }, + { + count: 0, + name: 'DestRegion', + type: 'string', + esTypes: ['keyword'], + scripted: false, + searchable: true, + aggregatable: true, + readFromDocValues: true, + }, + { + count: 0, + name: 'DestWeather', + type: 'string', + esTypes: ['keyword'], + scripted: false, + searchable: true, + aggregatable: true, + readFromDocValues: true, + }, + { + count: 0, + name: 'DistanceKilometers', + type: 'number', + esTypes: ['float'], + scripted: false, + searchable: true, + aggregatable: true, + readFromDocValues: true, + }, + { + count: 0, + name: 'DistanceMiles', + type: 'number', + esTypes: ['float'], + scripted: false, + searchable: true, + aggregatable: true, + readFromDocValues: true, + }, + { + count: 0, + name: 'FlightDelay', + type: 'boolean', + esTypes: ['boolean'], + scripted: false, + searchable: true, + aggregatable: true, + readFromDocValues: true, + }, + { + count: 0, + name: 'FlightDelayMin', + type: 'number', + esTypes: ['integer'], + scripted: false, + searchable: true, + aggregatable: true, + readFromDocValues: true, + }, + { + count: 0, + name: 'FlightDelayType', + type: 'string', + esTypes: ['keyword'], + scripted: false, + searchable: true, + aggregatable: true, + readFromDocValues: true, + }, + { + count: 0, + name: 'FlightNum', + type: 'string', + esTypes: ['keyword'], + scripted: false, + searchable: true, + aggregatable: true, + readFromDocValues: true, + }, + { + count: 0, + name: 'FlightTimeHour', + type: 'string', + esTypes: ['keyword'], + scripted: false, + searchable: true, + aggregatable: true, + readFromDocValues: true, + }, + { + count: 0, + name: 'FlightTimeMin', + type: 'number', + esTypes: ['float'], + scripted: false, + searchable: true, + aggregatable: true, + readFromDocValues: true, + }, + { + count: 0, + name: 'Origin', + type: 'string', + esTypes: ['keyword'], + scripted: false, + searchable: true, + aggregatable: true, + readFromDocValues: true, + }, + { + count: 0, + name: 'OriginAirportID', + type: 'string', + esTypes: ['keyword'], + scripted: false, + searchable: true, + aggregatable: true, + readFromDocValues: true, + }, + { + count: 0, + name: 'OriginCityName', + type: 'string', + esTypes: ['keyword'], + scripted: false, + searchable: true, + aggregatable: true, + readFromDocValues: true, + }, + { + count: 0, + name: 'OriginCountry', + type: 'string', + esTypes: ['keyword'], + scripted: false, + searchable: true, + aggregatable: true, + readFromDocValues: true, + }, + { + count: 0, + name: 'OriginLocation', + type: 'geo_point', + esTypes: ['geo_point'], + scripted: false, + searchable: true, + aggregatable: true, + readFromDocValues: true, + }, + { + count: 0, + name: 'OriginRegion', + type: 'string', + esTypes: ['keyword'], + scripted: false, + searchable: true, + aggregatable: true, + readFromDocValues: true, + }, + { + count: 0, + name: 'OriginWeather', + type: 'string', + esTypes: ['keyword'], + scripted: false, + searchable: true, + aggregatable: true, + readFromDocValues: true, + }, + { + count: 0, + name: '_id', + type: 'string', + esTypes: ['_id'], + scripted: false, + searchable: true, + aggregatable: true, + readFromDocValues: false, + }, + { + count: 0, + name: '_index', + type: 'string', + esTypes: ['_index'], + scripted: false, + searchable: true, + aggregatable: true, + readFromDocValues: false, + }, + { + count: 0, + name: '_score', + type: 'number', + scripted: false, + searchable: false, + aggregatable: false, + readFromDocValues: false, + }, + { + count: 0, + name: '_source', + type: '_source', + esTypes: ['_source'], + scripted: false, + searchable: false, + aggregatable: false, + readFromDocValues: false, + }, + { + count: 0, + name: '_type', + type: 'string', + esTypes: ['_type'], + scripted: false, + searchable: true, + aggregatable: true, + readFromDocValues: false, + }, + { + count: 0, + name: 'dayOfWeek', + type: 'number', + esTypes: ['integer'], + scripted: false, + searchable: true, + aggregatable: true, + readFromDocValues: true, + }, + { + count: 0, + name: 'timestamp', + type: 'date', + esTypes: ['date'], + scripted: false, + searchable: true, + aggregatable: true, + readFromDocValues: true, + }, + { + count: 0, + script: "doc['timestamp'].value.hourOfDay", + lang: 'painless', + name: 'hour_of_day', + type: 'number', + scripted: true, + searchable: true, + aggregatable: true, + readFromDocValues: false, + }, + ], + timeFieldName: 'timestamp', + metaFields: ['_source', '_id', '_type', '_index', '_score'], + version: 'WzM1LDFd', + originalSavedObjectBody: { + title: 'kibana_sample_data_flights', + timeFieldName: 'timestamp', + fields: + '[{"count":0,"name":"AvgTicketPrice","type":"number","esTypes":["float"],"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"count":0,"name":"Cancelled","type":"boolean","esTypes":["boolean"],"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"count":0,"name":"Carrier","type":"string","esTypes":["keyword"],"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"count":0,"name":"Dest","type":"string","esTypes":["keyword"],"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"count":0,"name":"DestAirportID","type":"string","esTypes":["keyword"],"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"count":0,"name":"DestCityName","type":"string","esTypes":["keyword"],"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"count":0,"name":"DestCountry","type":"string","esTypes":["keyword"],"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"count":0,"name":"DestLocation","type":"geo_point","esTypes":["geo_point"],"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"count":0,"name":"DestRegion","type":"string","esTypes":["keyword"],"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"count":0,"name":"DestWeather","type":"string","esTypes":["keyword"],"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"count":0,"name":"DistanceKilometers","type":"number","esTypes":["float"],"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"count":0,"name":"DistanceMiles","type":"number","esTypes":["float"],"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"count":0,"name":"FlightDelay","type":"boolean","esTypes":["boolean"],"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"count":0,"name":"FlightDelayMin","type":"number","esTypes":["integer"],"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"count":0,"name":"FlightDelayType","type":"string","esTypes":["keyword"],"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"count":0,"name":"FlightNum","type":"string","esTypes":["keyword"],"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"count":0,"name":"FlightTimeHour","type":"string","esTypes":["keyword"],"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"count":0,"name":"FlightTimeMin","type":"number","esTypes":["float"],"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"count":0,"name":"Origin","type":"string","esTypes":["keyword"],"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"count":0,"name":"OriginAirportID","type":"string","esTypes":["keyword"],"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"count":0,"name":"OriginCityName","type":"string","esTypes":["keyword"],"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"count":0,"name":"OriginCountry","type":"string","esTypes":["keyword"],"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"count":0,"name":"OriginLocation","type":"geo_point","esTypes":["geo_point"],"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"count":0,"name":"OriginRegion","type":"string","esTypes":["keyword"],"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"count":0,"name":"OriginWeather","type":"string","esTypes":["keyword"],"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"count":0,"name":"_id","type":"string","esTypes":["_id"],"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":false},{"count":0,"name":"_index","type":"string","esTypes":["_index"],"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":false},{"count":0,"name":"_score","type":"number","scripted":false,"searchable":false,"aggregatable":false,"readFromDocValues":false},{"count":0,"name":"_source","type":"_source","esTypes":["_source"],"scripted":false,"searchable":false,"aggregatable":false,"readFromDocValues":false},{"count":0,"name":"_type","type":"string","esTypes":["_type"],"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":false},{"count":0,"name":"dayOfWeek","type":"number","esTypes":["integer"],"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"count":0,"name":"timestamp","type":"date","esTypes":["date"],"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"count":0,"script":"doc[\'timestamp\'].value.hourOfDay","lang":"painless","name":"hour_of_day","type":"number","scripted":true,"searchable":true,"aggregatable":true,"readFromDocValues":false}]', + fieldFormatMap: + '{"AvgTicketPrice":{"id":"number","params":{"parsedUrl":{"origin":"http://localhost:5801","pathname":"/app/visualize","basePath":""},"pattern":"$0,0.[00]"}},"hour_of_day":{"id":"number","params":{"parsedUrl":{"origin":"http://localhost:5801","pathname":"/app/visualize","basePath":""},"pattern":"00"}}}', + }, + shortDotsEnable: false, + fieldFormats: { + fieldFormats: {}, + defaultMap: { + ip: { + id: 'ip', + params: {}, + }, + date: { + id: 'date', + params: {}, + }, + date_nanos: { + id: 'date_nanos', + params: {}, + es: true, + }, + number: { + id: 'number', + params: {}, + }, + boolean: { + id: 'boolean', + params: {}, + }, + _source: { + id: '_source', + params: {}, + }, + _default_: { + id: 'string', + params: {}, + }, + }, + metaParamsOptions: {}, + }, + }, + }, + dependencies: { + legacy: { + loadingCount$: { + _isScalar: false, + observers: [ + { + closed: false, + _parentOrParents: { + closed: false, + _parentOrParents: { + closed: false, + _parentOrParents: { + closed: false, + _parentOrParents: { + closed: false, + _parentOrParents: { + closed: false, + _parentOrParents: { + closed: false, + _parentOrParents: { + closed: false, + _parentOrParents: null, + _subscriptions: [null], + syncErrorValue: null, + syncErrorThrown: false, + syncErrorThrowable: true, + isStopped: false, + destination: { + closed: false, + _parentOrParents: null, + _subscriptions: null, + syncErrorValue: null, + syncErrorThrown: false, + syncErrorThrowable: false, + isStopped: false, + destination: { + closed: true, + }, + _context: {}, + }, + }, + _subscriptions: [null], + syncErrorValue: null, + syncErrorThrown: false, + syncErrorThrowable: true, + isStopped: false, + count: 1, + }, + _subscriptions: [null], + syncErrorValue: null, + syncErrorThrown: false, + syncErrorThrowable: true, + isStopped: false, + hasPrev: true, + prev: 0, + }, + _subscriptions: [null], + syncErrorValue: null, + syncErrorThrown: false, + syncErrorThrowable: false, + isStopped: false, + parent: { + closed: true, + _parentOrParents: null, + _subscriptions: null, + syncErrorValue: null, + syncErrorThrown: false, + syncErrorThrowable: true, + isStopped: true, + concurrent: 1, + hasCompleted: true, + buffer: [], + active: 1, + index: 2, + }, + }, + _subscriptions: [null], + syncErrorValue: null, + syncErrorThrown: false, + syncErrorThrowable: false, + isStopped: false, + parent: { + closed: true, + _parentOrParents: null, + _subscriptions: null, + syncErrorValue: null, + syncErrorThrown: false, + syncErrorThrowable: false, + isStopped: true, + concurrent: 1, + hasCompleted: true, + buffer: [ + { + _isScalar: false, + }, + ], + active: 1, + index: 1, + }, + }, + _subscriptions: [ + { + closed: false, + _subscriptions: [ + { + closed: false, + _subscriptions: null, + subject: { + _isScalar: false, + observers: [ + { + closed: false, + _parentOrParents: { + closed: false, + _parentOrParents: { + closed: false, + _parentOrParents: { + closed: false, + _parentOrParents: { + closed: false, + _parentOrParents: { + closed: false, + _parentOrParents: { + closed: false, + _parentOrParents: null, + _subscriptions: [null], + syncErrorValue: null, + syncErrorThrown: false, + syncErrorThrowable: true, + isStopped: false, + destination: { + closed: false, + _parentOrParents: null, + _subscriptions: null, + syncErrorValue: null, + syncErrorThrown: false, + syncErrorThrowable: false, + isStopped: false, + _context: {}, + }, + }, + _subscriptions: [null], + syncErrorValue: null, + syncErrorThrown: false, + syncErrorThrowable: true, + isStopped: false, + count: 13, + }, + _subscriptions: [null], + syncErrorValue: null, + syncErrorThrown: false, + syncErrorThrowable: true, + isStopped: false, + hasPrev: true, + prev: 0, + }, + _subscriptions: [null], + syncErrorValue: null, + syncErrorThrown: false, + syncErrorThrowable: false, + isStopped: false, + parent: { + closed: true, + _parentOrParents: null, + _subscriptions: null, + syncErrorValue: null, + syncErrorThrown: false, + syncErrorThrowable: true, + isStopped: true, + concurrent: 1, + hasCompleted: true, + buffer: [], + active: 1, + index: 2, + }, + }, + _subscriptions: [null], + syncErrorValue: null, + syncErrorThrown: false, + syncErrorThrowable: false, + isStopped: false, + parent: { + closed: true, + _parentOrParents: null, + _subscriptions: null, + syncErrorValue: null, + syncErrorThrown: false, + syncErrorThrowable: false, + isStopped: true, + concurrent: 1, + hasCompleted: true, + buffer: [ + { + _isScalar: false, + }, + ], + active: 1, + index: 1, + }, + }, + _subscriptions: [ + null, + { + closed: false, + _subscriptions: [ + { + closed: false, + _subscriptions: [ + { + closed: false, + _subscriptions: null, + subject: { + _isScalar: false, + observers: [null], + closed: false, + isStopped: false, + hasError: false, + thrownError: null, + _value: 0, + }, + }, + ], + syncErrorValue: null, + syncErrorThrown: false, + syncErrorThrowable: false, + isStopped: false, + hasKey: true, + key: 0, + }, + ], + syncErrorValue: null, + syncErrorThrown: false, + syncErrorThrowable: false, + isStopped: false, + }, + ], + syncErrorValue: null, + syncErrorThrown: false, + syncErrorThrowable: false, + isStopped: false, + seenValue: false, + }, + _subscriptions: [ + { + closed: false, + _subscriptions: null, + }, + ], + syncErrorValue: null, + syncErrorThrown: false, + syncErrorThrowable: false, + isStopped: false, + }, + { + closed: false, + _parentOrParents: { + closed: false, + _parentOrParents: { + closed: false, + _parentOrParents: { + closed: false, + _parentOrParents: { + closed: false, + _parentOrParents: { + closed: false, + _parentOrParents: { + closed: false, + _parentOrParents: null, + _subscriptions: [null], + syncErrorValue: null, + syncErrorThrown: false, + syncErrorThrowable: true, + isStopped: false, + destination: { + closed: false, + _parentOrParents: null, + _subscriptions: null, + syncErrorValue: null, + syncErrorThrown: false, + syncErrorThrowable: false, + isStopped: false, + _context: {}, + }, + }, + _subscriptions: [null], + syncErrorValue: null, + syncErrorThrown: false, + syncErrorThrowable: true, + isStopped: false, + count: 1, + }, + _subscriptions: [null], + syncErrorValue: null, + syncErrorThrown: false, + syncErrorThrowable: true, + isStopped: false, + hasPrev: true, + prev: 0, + }, + _subscriptions: [null], + syncErrorValue: null, + syncErrorThrown: false, + syncErrorThrowable: false, + isStopped: false, + parent: { + closed: true, + _parentOrParents: null, + _subscriptions: null, + syncErrorValue: null, + syncErrorThrown: false, + syncErrorThrowable: true, + isStopped: true, + concurrent: 1, + hasCompleted: true, + buffer: [], + active: 1, + index: 2, + }, + }, + _subscriptions: [null], + syncErrorValue: null, + syncErrorThrown: false, + syncErrorThrowable: false, + isStopped: false, + parent: { + closed: true, + _parentOrParents: null, + _subscriptions: null, + syncErrorValue: null, + syncErrorThrown: false, + syncErrorThrowable: false, + isStopped: true, + concurrent: 1, + hasCompleted: true, + buffer: [ + { + _isScalar: false, + }, + ], + active: 1, + index: 1, + }, + }, + _subscriptions: [ + null, + { + closed: false, + _subscriptions: [ + { + closed: false, + _subscriptions: [ + { + closed: false, + _subscriptions: null, + subject: { + _isScalar: false, + observers: [null], + closed: false, + isStopped: false, + hasError: false, + thrownError: null, + _value: 0, + }, + }, + ], + syncErrorValue: null, + syncErrorThrown: false, + syncErrorThrowable: false, + isStopped: false, + hasKey: true, + key: 0, + }, + ], + syncErrorValue: null, + syncErrorThrown: false, + syncErrorThrowable: false, + isStopped: false, + }, + ], + syncErrorValue: null, + syncErrorThrown: false, + syncErrorThrowable: false, + isStopped: false, + seenValue: false, + }, + _subscriptions: [ + { + closed: false, + _subscriptions: null, + }, + ], + syncErrorValue: null, + syncErrorThrown: false, + syncErrorThrowable: false, + isStopped: false, + }, + { + closed: false, + _parentOrParents: { + closed: false, + _parentOrParents: { + closed: false, + _parentOrParents: { + closed: false, + _parentOrParents: { + closed: false, + _parentOrParents: { + closed: false, + _parentOrParents: { + closed: false, + _parentOrParents: null, + _subscriptions: [null], + syncErrorValue: null, + syncErrorThrown: false, + syncErrorThrowable: true, + isStopped: false, + destination: { + closed: false, + _parentOrParents: null, + _subscriptions: null, + syncErrorValue: null, + syncErrorThrown: false, + syncErrorThrowable: false, + isStopped: false, + _context: {}, + }, + }, + _subscriptions: [null], + syncErrorValue: null, + syncErrorThrown: false, + syncErrorThrowable: true, + isStopped: false, + count: 1, + }, + _subscriptions: [null], + syncErrorValue: null, + syncErrorThrown: false, + syncErrorThrowable: true, + isStopped: false, + hasPrev: true, + prev: 0, + }, + _subscriptions: [null], + syncErrorValue: null, + syncErrorThrown: false, + syncErrorThrowable: false, + isStopped: false, + parent: { + closed: true, + _parentOrParents: null, + _subscriptions: null, + syncErrorValue: null, + syncErrorThrown: false, + syncErrorThrowable: true, + isStopped: true, + concurrent: 1, + hasCompleted: true, + buffer: [], + active: 1, + index: 2, + }, + }, + _subscriptions: [null], + syncErrorValue: null, + syncErrorThrown: false, + syncErrorThrowable: false, + isStopped: false, + parent: { + closed: true, + _parentOrParents: null, + _subscriptions: null, + syncErrorValue: null, + syncErrorThrown: false, + syncErrorThrowable: false, + isStopped: true, + concurrent: 1, + hasCompleted: true, + buffer: [ + { + _isScalar: false, + }, + ], + active: 1, + index: 1, + }, + }, + _subscriptions: [ + null, + { + closed: false, + _subscriptions: [ + { + closed: false, + _subscriptions: [ + { + closed: false, + _subscriptions: null, + subject: { + _isScalar: false, + observers: [null], + closed: false, + isStopped: false, + hasError: false, + thrownError: null, + _value: 0, + }, + }, + ], + syncErrorValue: null, + syncErrorThrown: false, + syncErrorThrowable: false, + isStopped: false, + hasKey: true, + key: 0, + }, + ], + syncErrorValue: null, + syncErrorThrown: false, + syncErrorThrowable: false, + isStopped: false, + }, + ], + syncErrorValue: null, + syncErrorThrown: false, + syncErrorThrowable: false, + isStopped: false, + seenValue: false, + }, + _subscriptions: [ + { + closed: false, + _subscriptions: null, + }, + ], + syncErrorValue: null, + syncErrorThrown: false, + syncErrorThrowable: false, + isStopped: false, + }, + { + closed: false, + _parentOrParents: { + closed: false, + _parentOrParents: { + closed: false, + _parentOrParents: { + closed: false, + _parentOrParents: { + closed: false, + _parentOrParents: { + closed: false, + _parentOrParents: { + closed: false, + _parentOrParents: null, + _subscriptions: [null], + syncErrorValue: null, + syncErrorThrown: false, + syncErrorThrowable: true, + isStopped: false, + destination: { + closed: false, + _parentOrParents: null, + _subscriptions: null, + syncErrorValue: null, + syncErrorThrown: false, + syncErrorThrowable: false, + isStopped: false, + _context: {}, + }, + }, + _subscriptions: [null], + syncErrorValue: null, + syncErrorThrown: false, + syncErrorThrowable: true, + isStopped: false, + count: 3, + }, + _subscriptions: [null], + syncErrorValue: null, + syncErrorThrown: false, + syncErrorThrowable: true, + isStopped: false, + hasPrev: true, + prev: 0, + }, + _subscriptions: [null], + syncErrorValue: null, + syncErrorThrown: false, + syncErrorThrowable: false, + isStopped: false, + parent: { + closed: true, + _parentOrParents: null, + _subscriptions: null, + syncErrorValue: null, + syncErrorThrown: false, + syncErrorThrowable: true, + isStopped: true, + concurrent: 1, + hasCompleted: true, + buffer: [], + active: 1, + index: 2, + }, + }, + _subscriptions: [null], + syncErrorValue: null, + syncErrorThrown: false, + syncErrorThrowable: false, + isStopped: false, + parent: { + closed: true, + _parentOrParents: null, + _subscriptions: null, + syncErrorValue: null, + syncErrorThrown: false, + syncErrorThrowable: false, + isStopped: true, + concurrent: 1, + hasCompleted: true, + buffer: [ + { + _isScalar: false, + }, + ], + active: 1, + index: 1, + }, + }, + _subscriptions: [ + null, + { + closed: false, + _subscriptions: [ + { + closed: false, + _subscriptions: [ + { + closed: false, + _subscriptions: null, + subject: { + _isScalar: false, + observers: [null], + closed: false, + isStopped: false, + hasError: false, + thrownError: null, + _value: 0, + }, + }, + ], + syncErrorValue: null, + syncErrorThrown: false, + syncErrorThrowable: false, + isStopped: false, + hasKey: true, + key: 0, + }, + ], + syncErrorValue: null, + syncErrorThrown: false, + syncErrorThrowable: false, + isStopped: false, + }, + ], + syncErrorValue: null, + syncErrorThrown: false, + syncErrorThrowable: false, + isStopped: false, + seenValue: false, + }, + _subscriptions: [ + { + closed: false, + _subscriptions: null, + }, + ], + syncErrorValue: null, + syncErrorThrown: false, + syncErrorThrowable: false, + isStopped: false, + }, + null, + ], + closed: false, + isStopped: false, + hasError: false, + thrownError: null, + }, + }, + ], + syncErrorValue: null, + syncErrorThrown: false, + syncErrorThrowable: false, + isStopped: false, + }, + null, + ], + syncErrorValue: null, + syncErrorThrown: false, + syncErrorThrowable: false, + isStopped: false, + seenValue: false, + }, + _subscriptions: [null], + syncErrorValue: null, + syncErrorThrown: false, + syncErrorThrowable: false, + isStopped: false, + }, + _subscriptions: [ + { + closed: false, + _subscriptions: null, + }, + ], + syncErrorValue: null, + syncErrorThrown: false, + syncErrorThrowable: false, + isStopped: false, + hasKey: true, + key: 0, + }, + ], + closed: false, + isStopped: false, + hasError: false, + thrownError: null, + _value: 0, + }, + }, + }, + }, + aggs: { + typesRegistry: {}, + getResponseAggs: () => [ + { + id: '1', + enabled: true, + type: 'count', + params: {}, + schema: 'metric', + toSerializedFieldFormat: () => ({ + id: 'number', + }), + }, + { + id: '2', + enabled: true, + type: 'terms', + params: { + field: 'Carrier', + orderBy: '1', + order: 'desc', + size: 5, + otherBucket: false, + otherBucketLabel: 'Other', + missingBucket: false, + missingBucketLabel: 'Missing', + }, + schema: 'segment', + toSerializedFieldFormat: () => ({ + id: 'terms', + params: { + id: 'string', + otherBucketLabel: 'Other', + missingBucketLabel: 'Missing', + parsedUrl: { + origin: 'http://localhost:5801', + pathname: '/app/visualize', + basePath: '', + }, + }, + }), + }, + ], + aggs: [], + }, + }, + isHierarchical: () => true, + uiState: { + vis: { + legendOpen: false, + }, + }, +}; diff --git a/src/plugins/vis_type_pie/public/to_ast.test.ts b/src/plugins/vis_type_pie/public/to_ast.test.ts new file mode 100644 index 00000000000000..019c6e21767105 --- /dev/null +++ b/src/plugins/vis_type_pie/public/to_ast.test.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. + */ + +import { Vis } from '../../visualizations/public'; + +import { PieVisParams } from './types'; +import { samplePieVis } from './sample_vis.test.mocks'; +import { toExpressionAst } from './to_ast'; + +describe('vis type pie vis toExpressionAst function', () => { + let vis: Vis; + const params = { + timefilter: {}, + timeRange: {}, + abortSignal: {}, + } as any; + + beforeEach(() => { + vis = samplePieVis as any; + }); + + it('should match basic snapshot', async () => { + const actual = await toExpressionAst(vis, params); + expect(actual).toMatchSnapshot(); + }); +}); diff --git a/src/plugins/vis_type_pie/public/to_ast.ts b/src/plugins/vis_type_pie/public/to_ast.ts new file mode 100644 index 00000000000000..e8c9f301b4366d --- /dev/null +++ b/src/plugins/vis_type_pie/public/to_ast.ts @@ -0,0 +1,71 @@ +/* + * 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 { getVisSchemas, VisToExpressionAst, SchemaConfig } from '../../visualizations/public'; +import { buildExpression, buildExpressionFunction } from '../../expressions/public'; +import { PieVisParams, LabelsParams } from './types'; +import { vislibPieName, VisTypePieExpressionFunctionDefinition } from './pie_fn'; +import { getEsaggsFn } from './to_ast_esaggs'; + +const prepareDimension = (params: SchemaConfig) => { + const visdimension = buildExpressionFunction('visdimension', { accessor: params.accessor }); + + if (params.format) { + visdimension.addArgument('format', params.format.id); + visdimension.addArgument('formatParams', JSON.stringify(params.format.params)); + } + + return buildExpression([visdimension]); +}; + +const prepareLabels = (params: LabelsParams) => { + const pieLabels = buildExpressionFunction('pielabels', { + show: params.show, + lastLevel: params.last_level, + values: params.values, + truncate: params.truncate, + }); + if (params.position) { + pieLabels.addArgument('position', params.position); + } + if (params.valuesFormat) { + pieLabels.addArgument('valuesFormat', params.valuesFormat); + } + if (params.percentDecimals != null) { + pieLabels.addArgument('percentDecimals', params.percentDecimals); + } + return buildExpression([pieLabels]); +}; + +export const toExpressionAst: VisToExpressionAst = async (vis, params) => { + const schemas = getVisSchemas(vis, params); + const args = { + // explicitly pass each param to prevent extra values trapping + addTooltip: vis.params.addTooltip, + addLegend: vis.params.addLegend, + legendPosition: vis.params.legendPosition, + nestedLegend: vis.params?.nestedLegend, + distinctColors: vis.params?.distinctColors, + isDonut: vis.params.isDonut, + palette: vis.params?.palette?.name, + labels: prepareLabels(vis.params.labels), + metric: schemas.metric.map(prepareDimension), + buckets: schemas.segment?.map(prepareDimension), + splitColumn: schemas.split_column?.map(prepareDimension), + splitRow: schemas.split_row?.map(prepareDimension), + }; + + const visTypePie = buildExpressionFunction( + vislibPieName, + args + ); + + const ast = buildExpression([getEsaggsFn(vis), visTypePie]); + + return ast.toAst(); +}; diff --git a/src/plugins/vis_type_pie/public/to_ast_esaggs.ts b/src/plugins/vis_type_pie/public/to_ast_esaggs.ts new file mode 100644 index 00000000000000..9b760bd4bebcc0 --- /dev/null +++ b/src/plugins/vis_type_pie/public/to_ast_esaggs.ts @@ -0,0 +1,33 @@ +/* + * 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 { Vis } from '../../visualizations/public'; +import { buildExpression, buildExpressionFunction } from '../../expressions/public'; +import { + EsaggsExpressionFunctionDefinition, + IndexPatternLoadExpressionFunctionDefinition, +} from '../../data/public'; + +import { PieVisParams } from './types'; + +/** + * Get esaggs expressions function + * @param vis + */ +export function getEsaggsFn(vis: Vis) { + return buildExpressionFunction('esaggs', { + index: buildExpression([ + buildExpressionFunction('indexPatternLoad', { + id: vis.data.indexPattern!.id!, + }), + ]), + metricsAtAllLevels: vis.isHierarchical(), + partialRows: false, + aggs: vis.data.aggs!.aggs.map((agg) => buildExpression(agg.toExpressionAst())), + }); +} diff --git a/src/plugins/vis_type_pie/public/types/index.ts b/src/plugins/vis_type_pie/public/types/index.ts new file mode 100644 index 00000000000000..12594660136d8f --- /dev/null +++ b/src/plugins/vis_type_pie/public/types/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 * from './types'; diff --git a/src/plugins/vis_type_pie/public/types/types.ts b/src/plugins/vis_type_pie/public/types/types.ts new file mode 100644 index 00000000000000..4f3365545d0628 --- /dev/null +++ b/src/plugins/vis_type_pie/public/types/types.ts @@ -0,0 +1,96 @@ +/* + * 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 { Position } from '@elastic/charts'; +import { UiCounterMetricType } from '@kbn/analytics'; +import { DatatableColumn, SerializedFieldFormat } from '../../../expressions/public'; +import { ExpressionValueVisDimension } from '../../../visualizations/public'; +import { ExpressionValuePieLabels } from '../expression_functions/pie_labels'; +import { PaletteOutput, ChartsPluginSetup } from '../../../charts/public'; + +export interface Dimension { + accessor: number; + format: { + id?: string; + params?: SerializedFieldFormat; + }; +} + +export interface Dimensions { + metric: Dimension; + buckets?: Dimension[]; + splitRow?: Dimension[]; + splitColumn?: Dimension[]; +} + +interface PieCommonParams { + addTooltip: boolean; + addLegend: boolean; + legendPosition: Position; + nestedLegend: boolean; + distinctColors: boolean; + isDonut: boolean; +} + +export interface LabelsParams { + show: boolean; + last_level: boolean; + position: LabelPositions; + values: boolean; + truncate: number | null; + valuesFormat: ValueFormats; + percentDecimals: number; +} + +export interface PieVisParams extends PieCommonParams { + dimensions: Dimensions; + labels: LabelsParams; + palette: PaletteOutput; +} + +export interface PieVisConfig extends PieCommonParams { + buckets?: ExpressionValueVisDimension[]; + metric: ExpressionValueVisDimension; + splitColumn?: ExpressionValueVisDimension[]; + splitRow?: ExpressionValueVisDimension[]; + labels: ExpressionValuePieLabels; + palette: string; +} + +export interface BucketColumns extends DatatableColumn { + format?: { + id?: string; + params?: SerializedFieldFormat; + }; +} + +export enum LabelPositions { + INSIDE = 'inside', + DEFAULT = 'default', +} + +export enum ValueFormats { + PERCENT = 'percent', + VALUE = 'value', +} + +export interface PieTypeProps { + showElasticChartsOptions?: boolean; + palettes?: ChartsPluginSetup['palettes']; + trackUiMetric?: (metricType: UiCounterMetricType, eventName: string | string[]) => void; +} + +export interface SplitDimensionParams { + order?: string; + orderBy?: string; +} + +export interface PieContainerDimensions { + width: number; + height: number; +} diff --git a/src/plugins/vis_type_pie/public/utils/filter_helpers.test.ts b/src/plugins/vis_type_pie/public/utils/filter_helpers.test.ts new file mode 100644 index 00000000000000..3f532cf4c384ff --- /dev/null +++ b/src/plugins/vis_type_pie/public/utils/filter_helpers.test.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 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 { DatatableColumn } from '../../../expressions/public'; +import { getFilterClickData, getFilterEventData } from './filter_helpers'; +import { createMockBucketColumns, createMockVisData } from '../mocks'; + +const bucketColumns = createMockBucketColumns(); +const visData = createMockVisData(); + +describe('getFilterClickData', () => { + it('returns the correct filter data for the specific layer', () => { + const clickedLayers = [ + { + groupByRollup: 'Logstash Airways', + value: 729, + depth: 1, + path: [], + sortIndex: 1, + smAccessorValue: '', + }, + ]; + const data = getFilterClickData(clickedLayers, bucketColumns, visData); + expect(data.length).toEqual(clickedLayers.length); + expect(data[0].value).toEqual('Logstash Airways'); + expect(data[0].row).toEqual(0); + expect(data[0].column).toEqual(0); + }); + + it('changes the filter if the user clicks on another layer', () => { + const clickedLayers = [ + { + groupByRollup: 'ES-Air', + value: 572, + depth: 1, + path: [], + sortIndex: 1, + smAccessorValue: '', + }, + ]; + const data = getFilterClickData(clickedLayers, bucketColumns, visData); + expect(data.length).toEqual(clickedLayers.length); + expect(data[0].value).toEqual('ES-Air'); + expect(data[0].row).toEqual(4); + expect(data[0].column).toEqual(0); + }); + + it('returns the correct filters for small multiples', () => { + const clickedLayers = [ + { + groupByRollup: 'ES-Air', + value: 572, + depth: 1, + path: [], + sortIndex: 1, + smAccessorValue: 1, + }, + ]; + const splitDimension = { + id: 'col-2-3', + name: 'Cancelled: Descending', + } as DatatableColumn; + const data = getFilterClickData(clickedLayers, bucketColumns, visData, splitDimension); + expect(data.length).toEqual(2); + expect(data[0].value).toEqual('ES-Air'); + expect(data[0].row).toEqual(5); + expect(data[0].column).toEqual(0); + expect(data[1].value).toEqual(1); + }); +}); + +describe('getFilterEventData', () => { + it('returns the correct filter data for the specific series', () => { + const series = { + key: 'Kibana Airlines', + specId: 'pie', + }; + const data = getFilterEventData(visData, series); + expect(data[0].value).toEqual('Kibana Airlines'); + expect(data[0].row).toEqual(6); + expect(data[0].column).toEqual(0); + }); + + it('changes the filter if the user clicks on another series', () => { + const series = { + key: 'JetBeats', + specId: 'pie', + }; + const data = getFilterEventData(visData, series); + expect(data[0].value).toEqual('JetBeats'); + expect(data[0].row).toEqual(2); + expect(data[0].column).toEqual(0); + }); +}); diff --git a/src/plugins/vis_type_pie/public/utils/filter_helpers.ts b/src/plugins/vis_type_pie/public/utils/filter_helpers.ts new file mode 100644 index 00000000000000..251ff8acc698e9 --- /dev/null +++ b/src/plugins/vis_type_pie/public/utils/filter_helpers.ts @@ -0,0 +1,89 @@ +/* + * 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 { LayerValue, SeriesIdentifier } from '@elastic/charts'; +import { Datatable, DatatableColumn } from '../../../expressions/public'; +import { DataPublicPluginStart, FieldFormat } from '../../../data/public'; +import { ClickTriggerEvent } from '../../../charts/public'; +import { ValueClickContext } from '../../../embeddable/public'; +import { BucketColumns } from '../types'; + +export const canFilter = async ( + event: ClickTriggerEvent | null, + actions: DataPublicPluginStart['actions'] +): Promise => { + if (!event) { + return false; + } + const filters = await actions.createFiltersFromValueClickAction(event.data); + return Boolean(filters.length); +}; + +export const getFilterClickData = ( + clickedLayers: LayerValue[], + bucketColumns: Array>, + visData: Datatable, + splitChartDimension?: DatatableColumn, + splitChartFormatter?: FieldFormat +): ValueClickContext['data']['data'] => { + const data: ValueClickContext['data']['data'] = []; + const matchingIndex = visData.rows.findIndex((row) => + clickedLayers.every((layer, index) => { + const columnId = bucketColumns[index].id; + if (!columnId) return; + const isCurrentLayer = row[columnId] === layer.groupByRollup; + if (!splitChartDimension) { + return isCurrentLayer; + } + const value = + splitChartFormatter?.convert(row[splitChartDimension.id]) || row[splitChartDimension.id]; + return isCurrentLayer && value === layer.smAccessorValue; + }) + ); + + data.push( + ...clickedLayers.map((clickedLayer, index) => ({ + column: visData.columns.findIndex((col) => col.id === bucketColumns[index].id), + row: matchingIndex, + value: clickedLayer.groupByRollup, + table: visData, + })) + ); + + // Allows filtering with the small multiples value + if (splitChartDimension) { + data.push({ + column: visData.columns.findIndex((col) => col.id === splitChartDimension.id), + row: matchingIndex, + table: visData, + value: clickedLayers[0].smAccessorValue, + }); + } + + return data; +}; + +export const getFilterEventData = ( + visData: Datatable, + series: SeriesIdentifier +): ValueClickContext['data']['data'] => { + return visData.columns.reduce((acc, { id }, column) => { + const value = series.key; + const row = visData.rows.findIndex((r) => r[id] === value); + if (row > -1) { + acc.push({ + table: visData, + column, + row, + value, + }); + } + + return acc; + }, []); +}; diff --git a/src/plugins/vis_type_pie/public/utils/get_color_picker.test.tsx b/src/plugins/vis_type_pie/public/utils/get_color_picker.test.tsx new file mode 100644 index 00000000000000..5e9087947b95e7 --- /dev/null +++ b/src/plugins/vis_type_pie/public/utils/get_color_picker.test.tsx @@ -0,0 +1,116 @@ +/* + * 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 React from 'react'; +import { LegendColorPickerProps } from '@elastic/charts'; +import { EuiPopover } from '@elastic/eui'; +import { mountWithIntl } from '@kbn/test/jest'; +import { ComponentType, ReactWrapper } from 'enzyme'; +import { getColorPicker } from './get_color_picker'; +import { ColorPicker } from '../../../charts/public'; +import type { PersistedState } from '../../../visualizations/public'; +import { createMockBucketColumns, createMockVisData } from '../mocks'; + +const bucketColumns = createMockBucketColumns(); +const visData = createMockVisData(); + +jest.mock('@elastic/charts', () => { + const original = jest.requireActual('@elastic/charts'); + + return { + ...original, + getSpecId: jest.fn(() => {}), + }; +}); + +describe('getColorPicker', function () { + const mockState = new Map(); + const uiState = ({ + get: jest + .fn() + .mockImplementation((key, fallback) => (mockState.has(key) ? mockState.get(key) : fallback)), + set: jest.fn().mockImplementation((key, value) => mockState.set(key, value)), + emit: jest.fn(), + setSilent: jest.fn(), + } as unknown) as PersistedState; + + let wrapperProps: LegendColorPickerProps; + const Component: ComponentType = getColorPicker( + 'left', + jest.fn(), + bucketColumns, + 'default', + visData.rows, + uiState, + false + ); + let wrapper: ReactWrapper; + + beforeAll(() => { + wrapperProps = { + color: 'rgb(109, 204, 177)', + onClose: jest.fn(), + onChange: jest.fn(), + anchor: document.createElement('div'), + seriesIdentifiers: [ + { + key: 'Logstash Airways', + specId: 'pie', + }, + ], + }; + }); + + it('renders the color picker for default palette and inner layer', () => { + wrapper = mountWithIntl(); + expect(wrapper.find(ColorPicker).length).toBe(1); + }); + + it('renders the picker on the correct position', () => { + wrapper = mountWithIntl(); + expect(wrapper.find(EuiPopover).prop('anchorPosition')).toEqual('rightCenter'); + }); + + it('converts the color to the right hex and passes it to the color picker', () => { + wrapper = mountWithIntl(); + expect(wrapper.find(ColorPicker).prop('color')).toEqual('#6dccb1'); + }); + + it('doesnt render the picker for default palette and not inner layer', () => { + const newProps = { ...wrapperProps, seriesIdentifier: { key: '1', specId: 'pie' } }; + wrapper = mountWithIntl(); + expect(wrapper).toEqual({}); + }); + + it('renders the color picker with the colorIsOverwritten prop set to false if color is not overwritten for the specific series', () => { + wrapper = mountWithIntl(); + expect(wrapper.find(ColorPicker).prop('colorIsOverwritten')).toBe(false); + }); + + it('renders the color picker with the colorIsOverwritten prop set to true if color is overwritten for the specific series', () => { + uiState.set('vis.colors', { 'Logstash Airways': '#6092c0' }); + wrapper = mountWithIntl(); + expect(wrapper.find(ColorPicker).prop('colorIsOverwritten')).toBe(true); + }); + + it('renders the picker for kibana palette and not distinctColors', () => { + const LegacyPaletteComponent: ComponentType = getColorPicker( + 'left', + jest.fn(), + bucketColumns, + 'kibana_palette', + visData.rows, + uiState, + true + ); + const newProps = { ...wrapperProps, seriesIdentifier: { key: '1', specId: 'pie' } }; + wrapper = mountWithIntl(); + expect(wrapper.find(ColorPicker).length).toBe(1); + expect(wrapper.find(ColorPicker).prop('useLegacyColors')).toBe(true); + }); +}); diff --git a/src/plugins/vis_type_pie/public/utils/get_color_picker.tsx b/src/plugins/vis_type_pie/public/utils/get_color_picker.tsx new file mode 100644 index 00000000000000..436ce81d3ce3c5 --- /dev/null +++ b/src/plugins/vis_type_pie/public/utils/get_color_picker.tsx @@ -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 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 React, { useCallback } from 'react'; +import Color from 'color'; +import { LegendColorPicker, Position } from '@elastic/charts'; +import { PopoverAnchorPosition, EuiPopover, EuiOutsideClickDetector } from '@elastic/eui'; +import { DatatableRow } from '../../../expressions/public'; +import type { PersistedState } from '../../../visualizations/public'; +import { ColorPicker } from '../../../charts/public'; +import { BucketColumns } from '../types'; + +const KEY_CODE_ENTER = 13; + +function getAnchorPosition(legendPosition: Position): PopoverAnchorPosition { + switch (legendPosition) { + case Position.Bottom: + return 'upCenter'; + case Position.Top: + return 'downCenter'; + case Position.Left: + return 'rightCenter'; + default: + return 'leftCenter'; + } +} + +function getLayerIndex( + seriesKey: string, + data: DatatableRow[], + layers: Array> +): number { + const row = data.find((d) => Object.keys(d).find((key) => d[key] === seriesKey)); + const bucketId = row && Object.keys(row).find((key) => row[key] === seriesKey); + return layers.findIndex((layer) => layer.id === bucketId) + 1; +} + +function isOnInnerLayer( + firstBucket: Partial, + data: DatatableRow[], + seriesKey: string +): DatatableRow | undefined { + return data.find((d) => firstBucket.id && d[firstBucket.id] === seriesKey); +} + +export const getColorPicker = ( + legendPosition: Position, + setColor: (newColor: string | null, seriesKey: string | number) => void, + bucketColumns: Array>, + palette: string, + data: DatatableRow[], + uiState: PersistedState, + distinctColors: boolean +): LegendColorPicker => ({ + anchor, + color, + onClose, + onChange, + seriesIdentifiers: [seriesIdentifier], +}) => { + const seriesName = seriesIdentifier.key; + const overwriteColors: Record = uiState?.get('vis.colors', {}) ?? {}; + const colorIsOverwritten = Object.keys(overwriteColors).includes(seriesName.toString()); + let keyDownEventOn = false; + const handleChange = (newColor: string | null) => { + if (newColor) { + onChange(newColor); + } + setColor(newColor, seriesName); + // close the popover if no color is applied or the user has clicked a color + if (!newColor || !keyDownEventOn) { + onClose(); + } + }; + + const onKeyDown = (e: React.KeyboardEvent) => { + if (e.keyCode === KEY_CODE_ENTER) { + onClose?.(); + } + keyDownEventOn = true; + }; + + const handleOutsideClick = useCallback(() => { + onClose?.(); + }, [onClose]); + + if (!distinctColors) { + const enablePicker = isOnInnerLayer(bucketColumns[0], data, seriesName) || !bucketColumns[0].id; + if (!enablePicker) return null; + } + const hexColor = new Color(color).hex(); + return ( + + + + + + ); +}; diff --git a/src/plugins/vis_type_pie/public/utils/get_columns.test.ts b/src/plugins/vis_type_pie/public/utils/get_columns.test.ts new file mode 100644 index 00000000000000..3170628ec2e125 --- /dev/null +++ b/src/plugins/vis_type_pie/public/utils/get_columns.test.ts @@ -0,0 +1,222 @@ +/* + * 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 { getColumns } from './get_columns'; +import { PieVisParams } from '../types'; +import { createMockPieParams, createMockVisData } from '../mocks'; + +const visParams = createMockPieParams(); +const visData = createMockVisData(); + +describe('getColumns', () => { + it('should return the correct bucket columns if visParams returns dimensions', () => { + const { bucketColumns } = getColumns(visParams, visData); + expect(bucketColumns.length).toEqual(visParams.dimensions.buckets?.length); + expect(bucketColumns).toEqual([ + { + format: { + id: 'terms', + params: { + id: 'string', + missingBucketLabel: 'Missing', + otherBucketLabel: 'Other', + }, + }, + id: 'col-0-2', + meta: { + field: 'Carrier', + index: 'kibana_sample_data_flights', + params: { + id: 'terms', + params: { + id: 'string', + missingBucketLabel: 'Missing', + otherBucketLabel: 'Other', + }, + }, + source: 'esaggs', + sourceParams: { + enabled: true, + id: '2', + indexPatternId: 'd3d7af60-4c81-11e8-b3d7-01146121b73d', + params: { + field: 'Carrier', + missingBucket: false, + missingBucketLabel: 'Missing', + order: 'desc', + orderBy: '1', + otherBucket: false, + otherBucketLabel: 'Other', + size: 5, + }, + schema: 'segment', + type: 'terms', + }, + type: 'string', + }, + name: 'Carrier: Descending', + }, + { + format: { + id: 'terms', + params: { + id: 'boolean', + missingBucketLabel: 'Missing', + otherBucketLabel: 'Other', + }, + }, + id: 'col-2-3', + meta: { + field: 'Cancelled', + index: 'kibana_sample_data_flights', + params: { + id: 'terms', + params: { + id: 'boolean', + missingBucketLabel: 'Missing', + otherBucketLabel: 'Other', + }, + }, + source: 'esaggs', + sourceParams: { + enabled: true, + id: '3', + indexPatternId: 'd3d7af60-4c81-11e8-b3d7-01146121b73d', + params: { + field: 'Cancelled', + missingBucket: false, + missingBucketLabel: 'Missing', + order: 'desc', + orderBy: '1', + otherBucket: false, + otherBucketLabel: 'Other', + size: 5, + }, + schema: 'segment', + type: 'terms', + }, + type: 'boolean', + }, + name: 'Cancelled: Descending', + }, + ]); + }); + + it('should return the correct metric column if visParams returns dimensions', () => { + const { metricColumn } = getColumns(visParams, visData); + expect(metricColumn).toEqual({ + id: 'col-3-1', + meta: { + index: 'kibana_sample_data_flights', + params: { id: 'number' }, + source: 'esaggs', + sourceParams: { + enabled: true, + id: '1', + indexPatternId: 'd3d7af60-4c81-11e8-b3d7-01146121b73d', + params: {}, + schema: 'metric', + type: 'count', + }, + type: 'number', + }, + name: 'Count', + }); + }); + + it('should return the first data column if no buckets specified', () => { + const visParamsOnlyMetric = ({ + addLegend: true, + addTooltip: true, + isDonut: true, + labels: { + position: 'default', + show: true, + truncate: 100, + values: true, + valuesFormat: 'percent', + percentDecimals: 2, + }, + legendPosition: 'right', + nestedLegend: false, + palette: { + name: 'default', + type: 'palette', + }, + type: 'pie', + dimensions: { + metric: { + accessor: 1, + format: { + id: 'number', + }, + params: {}, + label: 'Count', + aggType: 'count', + }, + }, + } as unknown) as PieVisParams; + const { metricColumn } = getColumns(visParamsOnlyMetric, visData); + expect(metricColumn).toEqual({ + id: 'col-1-1', + meta: { + index: 'kibana_sample_data_flights', + params: { + id: 'number', + }, + source: 'esaggs', + sourceParams: { + enabled: true, + id: '1', + indexPatternId: 'd3d7af60-4c81-11e8-b3d7-01146121b73d', + params: {}, + schema: 'metric', + type: 'count', + }, + type: 'number', + }, + name: 'Count', + }); + }); + + it('should return an object with the name of the metric if no buckets specified', () => { + const visParamsOnlyMetric = ({ + addLegend: true, + addTooltip: true, + isDonut: true, + labels: { + position: 'default', + show: true, + truncate: 100, + values: true, + valuesFormat: 'percent', + percentDecimals: 2, + }, + legendPosition: 'right', + nestedLegend: false, + palette: { + name: 'default', + type: 'palette', + }, + type: 'pie', + dimensions: { + metric: { + accessor: 1, + format: { + id: 'number', + }, + params: {}, + label: 'Count', + aggType: 'count', + }, + }, + } as unknown) as PieVisParams; + const { bucketColumns, metricColumn } = getColumns(visParamsOnlyMetric, visData); + expect(bucketColumns).toEqual([{ name: metricColumn.name }]); + }); +}); diff --git a/src/plugins/vis_type_pie/public/utils/get_columns.ts b/src/plugins/vis_type_pie/public/utils/get_columns.ts new file mode 100644 index 00000000000000..4a32466d808da1 --- /dev/null +++ b/src/plugins/vis_type_pie/public/utils/get_columns.ts @@ -0,0 +1,43 @@ +/* + * 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 { DatatableColumn, Datatable } from '../../../expressions/public'; +import { BucketColumns, PieVisParams } from '../types'; + +export const getColumns = ( + visParams: PieVisParams, + visData: Datatable +): { + metricColumn: DatatableColumn; + bucketColumns: Array>; +} => { + if (visParams.dimensions.buckets && visParams.dimensions.buckets.length > 0) { + const bucketColumns: Array> = visParams.dimensions.buckets.map( + ({ accessor, format }) => ({ + ...visData.columns[accessor], + format, + }) + ); + const lastBucketId = bucketColumns[bucketColumns.length - 1].id; + const matchingIndex = visData.columns.findIndex((col) => col.id === lastBucketId); + return { + bucketColumns, + metricColumn: visData.columns[matchingIndex + 1], + }; + } + const metricAccessor = visParams?.dimensions?.metric.accessor ?? 0; + const metricColumn = visData.columns[metricAccessor]; + return { + metricColumn, + bucketColumns: [ + { + name: metricColumn.name, + }, + ], + }; +}; diff --git a/src/plugins/vis_type_pie/public/utils/get_config.ts b/src/plugins/vis_type_pie/public/utils/get_config.ts new file mode 100644 index 00000000000000..a8a4edb01cd9c8 --- /dev/null +++ b/src/plugins/vis_type_pie/public/utils/get_config.ts @@ -0,0 +1,76 @@ +/* + * 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 { PartitionConfig, PartitionLayout, RecursivePartial, Theme } from '@elastic/charts'; +import { LabelPositions, PieVisParams, PieContainerDimensions } from '../types'; +const MAX_SIZE = 1000; + +export const getConfig = ( + visParams: PieVisParams, + chartTheme: RecursivePartial, + dimensions?: PieContainerDimensions +): RecursivePartial => { + // On small multiples we want the labels to only appear inside + const isSplitChart = Boolean(visParams.dimensions.splitColumn || visParams.dimensions.splitRow); + const usingMargin = + dimensions && !isSplitChart + ? { + margin: { + top: (1 - Math.min(1, MAX_SIZE / dimensions?.height)) / 2, + bottom: (1 - Math.min(1, MAX_SIZE / dimensions?.height)) / 2, + left: (1 - Math.min(1, MAX_SIZE / dimensions?.width)) / 2, + right: (1 - Math.min(1, MAX_SIZE / dimensions?.width)) / 2, + }, + } + : null; + + const usingOuterSizeRatio = + dimensions && !isSplitChart + ? { + outerSizeRatio: MAX_SIZE / Math.min(dimensions?.width, dimensions?.height), + } + : null; + const config: RecursivePartial = { + partitionLayout: PartitionLayout.sunburst, + fontFamily: chartTheme.barSeriesStyle?.displayValue?.fontFamily, + ...usingOuterSizeRatio, + specialFirstInnermostSector: false, + minFontSize: 10, + maxFontSize: 16, + linkLabel: { + maxCount: 5, + fontSize: 11, + textColor: chartTheme.axes?.axisTitle?.fill, + maxTextLength: visParams.labels.truncate ?? undefined, + }, + sectorLineStroke: chartTheme.lineSeriesStyle?.point?.fill, + sectorLineWidth: 1.5, + circlePadding: 4, + emptySizeRatio: visParams.isDonut ? 0.3 : 0, + ...usingMargin, + }; + if (!visParams.labels.show) { + // Force all labels to be linked, then prevent links from showing + config.linkLabel = { maxCount: 0, maximumSection: Number.POSITIVE_INFINITY }; + } + + if (visParams.labels.last_level && visParams.labels.show) { + config.linkLabel = { + maxCount: Number.POSITIVE_INFINITY, + maximumSection: Number.POSITIVE_INFINITY, + }; + } + + if ( + (visParams.labels.position === LabelPositions.INSIDE || isSplitChart) && + visParams.labels.show + ) { + config.linkLabel = { maxCount: 0 }; + } + return config; +}; diff --git a/src/plugins/vis_type_pie/public/utils/get_distinct_series.test.ts b/src/plugins/vis_type_pie/public/utils/get_distinct_series.test.ts new file mode 100644 index 00000000000000..3d700614a07ed2 --- /dev/null +++ b/src/plugins/vis_type_pie/public/utils/get_distinct_series.test.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 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 { getDistinctSeries } from './get_distinct_series'; +import { createMockVisData, createMockBucketColumns } from '../mocks'; + +const visData = createMockVisData(); +const buckets = createMockBucketColumns(); + +describe('getDistinctSeries', () => { + it('should return the distinct values for all buckets', () => { + const { allSeries } = getDistinctSeries(visData.rows, buckets); + expect(allSeries).toEqual(['Logstash Airways', 'JetBeats', 'ES-Air', 'Kibana Airlines', 0, 1]); + }); + + it('should return only the distinct values for the parent bucket', () => { + const { parentSeries } = getDistinctSeries(visData.rows, buckets); + expect(parentSeries).toEqual(['Logstash Airways', 'JetBeats', 'ES-Air', 'Kibana Airlines']); + }); + + it('should return empty array for empty buckets', () => { + const { parentSeries } = getDistinctSeries(visData.rows, [{ name: 'Count' }]); + expect(parentSeries.length).toEqual(0); + }); +}); diff --git a/src/plugins/vis_type_pie/public/utils/get_distinct_series.ts b/src/plugins/vis_type_pie/public/utils/get_distinct_series.ts new file mode 100644 index 00000000000000..ba5042dfc210c5 --- /dev/null +++ b/src/plugins/vis_type_pie/public/utils/get_distinct_series.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. + */ +import { DatatableRow } from '../../../expressions/public'; +import { BucketColumns } from '../types'; + +export const getDistinctSeries = (rows: DatatableRow[], buckets: Array>) => { + const parentBucketId = buckets[0].id; + const parentSeries: string[] = []; + const allSeries: string[] = []; + buckets.forEach(({ id }) => { + if (!id) return; + rows.forEach((row) => { + const name = row[id]; + if (!allSeries.includes(name)) { + allSeries.push(name); + } + if (id === parentBucketId && !parentSeries.includes(row[parentBucketId])) { + parentSeries.push(row[parentBucketId]); + } + }); + }); + return { + allSeries, + parentSeries, + }; +}; diff --git a/src/plugins/vis_type_pie/public/utils/get_layers.test.ts b/src/plugins/vis_type_pie/public/utils/get_layers.test.ts new file mode 100644 index 00000000000000..e0658eaa295f95 --- /dev/null +++ b/src/plugins/vis_type_pie/public/utils/get_layers.test.ts @@ -0,0 +1,114 @@ +/* + * 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 { ShapeTreeNode } from '@elastic/charts'; +import { PaletteDefinition, SeriesLayer } from '../../../charts/public'; +import { computeColor } from './get_layers'; +import { createMockVisData, createMockBucketColumns, createMockPieParams } from '../mocks'; + +const visData = createMockVisData(); +const buckets = createMockBucketColumns(); +const visParams = createMockPieParams(); +const colors = ['color1', 'color2', 'color3', 'color4']; +export const getPaletteRegistry = () => { + const mockPalette1: jest.Mocked = { + id: 'default', + title: 'My Palette', + getCategoricalColor: jest.fn((layer: SeriesLayer[]) => colors[layer[0].rankAtDepth]), + getCategoricalColors: jest.fn((num: number) => colors), + toExpression: jest.fn(() => ({ + type: 'expression', + chain: [ + { + type: 'function', + function: 'system_palette', + arguments: { + name: ['default'], + }, + }, + ], + })), + }; + + return { + get: () => mockPalette1, + getAll: () => [mockPalette1], + }; +}; + +describe('computeColor', () => { + it('should return the correct color based on the parent sortIndex', () => { + const d = ({ + dataName: 'ES-Air', + depth: 1, + sortIndex: 0, + parent: { + children: [['ES-Air'], ['Kibana Airlines']], + depth: 0, + sortIndex: 0, + }, + } as unknown) as ShapeTreeNode; + const color = computeColor( + d, + false, + {}, + buckets, + visData.rows, + visParams, + getPaletteRegistry(), + false + ); + expect(color).toEqual(colors[0]); + }); + + it('slices with the same label should have the same color for small multiples', () => { + const d = ({ + dataName: 'ES-Air', + depth: 1, + sortIndex: 0, + parent: { + children: [['ES-Air'], ['Kibana Airlines']], + depth: 0, + sortIndex: 0, + }, + } as unknown) as ShapeTreeNode; + const color = computeColor( + d, + true, + {}, + buckets, + visData.rows, + visParams, + getPaletteRegistry(), + false + ); + expect(color).toEqual('color3'); + }); + it('returns the overwriteColor if exists', () => { + const d = ({ + dataName: 'ES-Air', + depth: 1, + sortIndex: 0, + parent: { + children: [['ES-Air'], ['Kibana Airlines']], + depth: 0, + sortIndex: 0, + }, + } as unknown) as ShapeTreeNode; + const color = computeColor( + d, + true, + { 'ES-Air': '#000028' }, + buckets, + visData.rows, + visParams, + getPaletteRegistry(), + false + ); + expect(color).toEqual('#000028'); + }); +}); diff --git a/src/plugins/vis_type_pie/public/utils/get_layers.ts b/src/plugins/vis_type_pie/public/utils/get_layers.ts new file mode 100644 index 00000000000000..27dcf2d379811d --- /dev/null +++ b/src/plugins/vis_type_pie/public/utils/get_layers.ts @@ -0,0 +1,186 @@ +/* + * 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 { i18n } from '@kbn/i18n'; +import { + Datum, + PartitionFillLabel, + PartitionLayer, + ShapeTreeNode, + ArrayEntry, +} from '@elastic/charts'; +import { isEqual } from 'lodash'; +import { SeriesLayer, PaletteRegistry, lightenColor } from '../../../charts/public'; +import { DataPublicPluginStart } from '../../../data/public'; +import { DatatableRow } from '../../../expressions/public'; +import { BucketColumns, PieVisParams, SplitDimensionParams } from '../types'; +import { getDistinctSeries } from './get_distinct_series'; + +const EMPTY_SLICE = Symbol('empty_slice'); + +export const computeColor = ( + d: ShapeTreeNode, + isSplitChart: boolean, + overwriteColors: { [key: string]: string }, + columns: Array>, + rows: DatatableRow[], + visParams: PieVisParams, + palettes: PaletteRegistry | null, + syncColors: boolean +) => { + const { parentSeries, allSeries } = getDistinctSeries(rows, columns); + + if (visParams.distinctColors) { + const dataName = d.dataName; + if (Object.keys(overwriteColors).includes(dataName.toString())) { + return overwriteColors[dataName]; + } + + const index = allSeries.findIndex((name) => isEqual(name, dataName)); + const isSplitParentLayer = isSplitChart && parentSeries.includes(dataName); + return palettes?.get(visParams.palette.name).getCategoricalColor( + [ + { + name: dataName, + rankAtDepth: isSplitParentLayer + ? parentSeries.findIndex((name) => name === dataName) + : index > -1 + ? index + : 0, + totalSeriesAtDepth: isSplitParentLayer ? parentSeries.length : allSeries.length || 1, + }, + ], + { + maxDepth: 1, + totalSeries: allSeries.length || 1, + behindText: visParams.labels.show, + syncColors, + } + ); + } + const seriesLayers: SeriesLayer[] = []; + let tempParent: typeof d | typeof d['parent'] = d; + while (tempParent.parent && tempParent.depth > 0) { + const seriesName = String(tempParent.parent.children[tempParent.sortIndex][0]); + const isSplitParentLayer = isSplitChart && parentSeries.includes(seriesName); + seriesLayers.unshift({ + name: seriesName, + rankAtDepth: isSplitParentLayer + ? parentSeries.findIndex((name) => name === seriesName) + : tempParent.sortIndex, + totalSeriesAtDepth: isSplitParentLayer + ? parentSeries.length + : tempParent.parent.children.length, + }); + tempParent = tempParent.parent; + } + + let overwriteColor; + seriesLayers.forEach((layer) => { + if (Object.keys(overwriteColors).includes(layer.name)) { + overwriteColor = overwriteColors[layer.name]; + } + }); + + if (overwriteColor) { + return lightenColor(overwriteColor, seriesLayers.length, columns.length); + } + return palettes?.get(visParams.palette.name).getCategoricalColor(seriesLayers, { + behindText: visParams.labels.show, + maxDepth: columns.length, + totalSeries: rows.length, + syncColors, + }); +}; + +export const getLayers = ( + columns: Array>, + visParams: PieVisParams, + overwriteColors: { [key: string]: string }, + rows: DatatableRow[], + palettes: PaletteRegistry | null, + formatter: DataPublicPluginStart['fieldFormats'], + syncColors: boolean +): PartitionLayer[] => { + const fillLabel: Partial = { + textInvertible: true, + valueFont: { + fontWeight: 700, + }, + }; + + if (!visParams.labels.values) { + fillLabel.valueFormatter = () => ''; + } + const isSplitChart = Boolean(visParams.dimensions.splitColumn || visParams.dimensions.splitRow); + return columns.map((col) => { + return { + groupByRollup: (d: Datum) => { + return col.id ? d[col.id] : col.name; + }, + showAccessor: (d: Datum) => d !== EMPTY_SLICE, + nodeLabel: (d: unknown) => { + if (d === '') { + return i18n.translate('visTypePie.emptyLabelValue', { + defaultMessage: '(empty)', + }); + } + if (col.format) { + const formattedLabel = formatter.deserialize(col.format).convert(d) ?? ''; + if (visParams.labels.truncate && formattedLabel.length <= visParams.labels.truncate) { + return formattedLabel; + } else { + return `${formattedLabel.slice(0, Number(visParams.labels.truncate))}\u2026`; + } + } + return String(d); + }, + sortPredicate: ([name1, node1]: ArrayEntry, [name2, node2]: ArrayEntry) => { + const params = col.meta?.sourceParams?.params as SplitDimensionParams | undefined; + const sort: string | undefined = params?.orderBy; + // unconditionally put "Other" to the end (as the "Other" slice may be larger than a regular slice, yet should be at the end) + if (name1 === '__other__' && name2 !== '__other__') return 1; + if (name2 === '__other__' && name1 !== '__other__') return -1; + // metric sorting + if (sort !== '_key') { + if (params?.order === 'desc') { + return node2.value - node1.value; + } else { + return node1.value - node2.value; + } + // alphabetical sorting + } else { + if (name1 > name2) { + return params?.order === 'desc' ? -1 : 1; + } + if (name2 > name1) { + return params?.order === 'desc' ? 1 : -1; + } + } + return 0; + }, + fillLabel, + shape: { + fillColor: (d) => { + const outputColor = computeColor( + d, + isSplitChart, + overwriteColors, + columns, + rows, + visParams, + palettes, + syncColors + ); + + return outputColor || 'rgba(0,0,0,0)'; + }, + }, + }; + }); +}; diff --git a/src/plugins/vis_type_pie/public/utils/get_legend_actions.tsx b/src/plugins/vis_type_pie/public/utils/get_legend_actions.tsx new file mode 100644 index 00000000000000..9f1d5e0db4583a --- /dev/null +++ b/src/plugins/vis_type_pie/public/utils/get_legend_actions.tsx @@ -0,0 +1,117 @@ +/* + * 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 React, { useState, useEffect } from 'react'; + +import { i18n } from '@kbn/i18n'; +import { EuiContextMenuPanelDescriptor, EuiIcon, EuiPopover, EuiContextMenu } from '@elastic/eui'; +import { LegendAction, SeriesIdentifier } from '@elastic/charts'; +import { DataPublicPluginStart } from '../../../data/public'; +import { PieVisParams } from '../types'; +import { ClickTriggerEvent } from '../../../charts/public'; + +export const getLegendActions = ( + canFilter: ( + data: ClickTriggerEvent | null, + actions: DataPublicPluginStart['actions'] + ) => Promise, + getFilterEventData: (series: SeriesIdentifier) => ClickTriggerEvent | null, + onFilter: (data: ClickTriggerEvent, negate?: any) => void, + visParams: PieVisParams, + actions: DataPublicPluginStart['actions'], + formatter: DataPublicPluginStart['fieldFormats'] +): LegendAction => { + return ({ series: [pieSeries] }) => { + const [popoverOpen, setPopoverOpen] = useState(false); + const [isfilterable, setIsfilterable] = useState(true); + const filterData = getFilterEventData(pieSeries); + + useEffect(() => { + (async () => setIsfilterable(await canFilter(filterData, actions)))(); + }, [filterData]); + + if (!isfilterable || !filterData) { + return null; + } + + let formattedTitle = ''; + if (visParams.dimensions.buckets) { + const column = visParams.dimensions.buckets.find( + (bucket) => bucket.accessor === filterData.data.data[0].column + ); + formattedTitle = formatter.deserialize(column?.format).convert(pieSeries.key) ?? ''; + } + + const title = formattedTitle || pieSeries.key; + const panels: EuiContextMenuPanelDescriptor[] = [ + { + id: 'main', + title: `${title}`, + items: [ + { + name: i18n.translate('visTypePie.legend.filterForValueButtonAriaLabel', { + defaultMessage: 'Filter for value', + }), + 'data-test-subj': `legend-${title}-filterIn`, + icon: , + onClick: () => { + setPopoverOpen(false); + onFilter(filterData); + }, + }, + { + name: i18n.translate('visTypePie.legend.filterOutValueButtonAriaLabel', { + defaultMessage: 'Filter out value', + }), + 'data-test-subj': `legend-${title}-filterOut`, + icon: , + onClick: () => { + setPopoverOpen(false); + onFilter(filterData, true); + }, + }, + ], + }, + ]; + + const Button = ( +
undefined} + onClick={() => setPopoverOpen(!popoverOpen)} + > + +
+ ); + + return ( + setPopoverOpen(false)} + panelPaddingSize="none" + anchorPosition="upLeft" + title={i18n.translate('visTypePie.legend.filterOptionsLegend', { + defaultMessage: '{legendDataLabel}, filter options', + values: { legendDataLabel: title }, + })} + > + + + ); + }; +}; diff --git a/src/plugins/vis_type_pie/public/utils/get_split_dimension_accessor.ts b/src/plugins/vis_type_pie/public/utils/get_split_dimension_accessor.ts new file mode 100644 index 00000000000000..e1029b11a7b758 --- /dev/null +++ b/src/plugins/vis_type_pie/public/utils/get_split_dimension_accessor.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. + */ +import { AccessorFn } from '@elastic/charts'; +import { FieldFormatsStart } from '../../../data/public'; +import { DatatableColumn } from '../../../expressions/public'; +import { Dimension } from '../types'; + +export const getSplitDimensionAccessor = ( + fieldFormats: FieldFormatsStart, + columns: DatatableColumn[] +) => (splitDimension: Dimension): AccessorFn => { + const formatter = fieldFormats.deserialize(splitDimension.format); + const splitChartColumn = columns[splitDimension.accessor]; + const accessor = splitChartColumn.id; + + const fn: AccessorFn = (d) => { + const v = d[accessor]; + if (v === undefined) { + return; + } + const f = formatter.convert(v); + return f; + }; + + return fn; +}; diff --git a/src/plugins/vis_type_pie/public/utils/index.ts b/src/plugins/vis_type_pie/public/utils/index.ts new file mode 100644 index 00000000000000..0cf4292ad565a9 --- /dev/null +++ b/src/plugins/vis_type_pie/public/utils/index.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. + */ + +export { getLayers } from './get_layers'; +export { getColorPicker } from './get_color_picker'; +export { getLegendActions } from './get_legend_actions'; +export { canFilter, getFilterClickData, getFilterEventData } from './filter_helpers'; +export { getConfig } from './get_config'; +export { getColumns } from './get_columns'; +export { getSplitDimensionAccessor } from './get_split_dimension_accessor'; +export { getDistinctSeries } from './get_distinct_series'; diff --git a/src/plugins/vis_type_pie/public/vis_type/index.ts b/src/plugins/vis_type_pie/public/vis_type/index.ts new file mode 100644 index 00000000000000..e02e802028a352 --- /dev/null +++ b/src/plugins/vis_type_pie/public/vis_type/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 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 { getPieVisTypeDefinition } from './pie'; +import type { PieTypeProps } from '../types'; + +export const pieVisType = (props: PieTypeProps) => { + return getPieVisTypeDefinition(props); +}; diff --git a/src/plugins/vis_type_pie/public/vis_type/pie.ts b/src/plugins/vis_type_pie/public/vis_type/pie.ts new file mode 100644 index 00000000000000..9d1556ac33ad7e --- /dev/null +++ b/src/plugins/vis_type_pie/public/vis_type/pie.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 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 { i18n } from '@kbn/i18n'; +import { Position } from '@elastic/charts'; +import { AggGroupNames } from '../../../data/public'; +import { VIS_EVENT_TO_TRIGGER, VisTypeDefinition } from '../../../visualizations/public'; +import { DEFAULT_PERCENT_DECIMALS } from '../../common'; +import { PieVisParams, LabelPositions, ValueFormats, PieTypeProps } from '../types'; +import { toExpressionAst } from '../to_ast'; +import { getPieOptions } from '../editor/components'; + +export const getPieVisTypeDefinition = ({ + showElasticChartsOptions = false, + palettes, + trackUiMetric, +}: PieTypeProps): VisTypeDefinition => ({ + name: 'pie', + title: i18n.translate('visTypePie.pie.pieTitle', { defaultMessage: 'Pie' }), + icon: 'visPie', + description: i18n.translate('visTypePie.pie.pieDescription', { + defaultMessage: 'Compare data in proportion to a whole.', + }), + toExpressionAst, + getSupportedTriggers: () => [VIS_EVENT_TO_TRIGGER.filter], + visConfig: { + defaults: { + type: 'pie', + addTooltip: true, + addLegend: !showElasticChartsOptions, + legendPosition: Position.Right, + nestedLegend: false, + distinctColors: false, + isDonut: true, + palette: { + type: 'palette', + name: 'default', + }, + labels: { + show: true, + last_level: !showElasticChartsOptions, + values: true, + valuesFormat: ValueFormats.PERCENT, + percentDecimals: DEFAULT_PERCENT_DECIMALS, + truncate: 100, + position: LabelPositions.DEFAULT, + }, + }, + }, + editorConfig: { + optionsTemplate: getPieOptions({ + showElasticChartsOptions, + palettes, + trackUiMetric, + }), + schemas: [ + { + group: AggGroupNames.Metrics, + name: 'metric', + title: i18n.translate('visTypePie.pie.metricTitle', { + defaultMessage: 'Slice size', + }), + min: 1, + max: 1, + aggFilter: ['sum', 'count', 'cardinality', 'top_hits'], + defaults: [{ schema: 'metric', type: 'count' }], + }, + { + group: AggGroupNames.Buckets, + name: 'segment', + title: i18n.translate('visTypePie.pie.segmentTitle', { + defaultMessage: 'Split slices', + }), + min: 0, + max: Infinity, + aggFilter: ['!geohash_grid', '!geotile_grid', '!filter'], + }, + { + group: AggGroupNames.Buckets, + name: 'split', + title: i18n.translate('visTypePie.pie.splitTitle', { + defaultMessage: 'Split chart', + }), + mustBeFirst: true, + min: 0, + max: 1, + aggFilter: ['!geohash_grid', '!geotile_grid', '!filter'], + }, + ], + }, + hierarchicalData: true, + requiresSearch: true, +}); diff --git a/src/plugins/vis_type_pie/tsconfig.json b/src/plugins/vis_type_pie/tsconfig.json new file mode 100644 index 00000000000000..f12db316f19723 --- /dev/null +++ b/src/plugins/vis_type_pie/tsconfig.json @@ -0,0 +1,24 @@ +{ + "extends": "../../../tsconfig.base.json", + "compilerOptions": { + "composite": true, + "outDir": "./target/types", + "emitDeclarationOnly": true, + "declaration": true, + "declarationMap": true + }, + "include": [ + "common/**/*", + "public/**/*", + "server/**/*" + ], + "references": [ + { "path": "../../core/tsconfig.json" }, + { "path": "../charts/tsconfig.json" }, + { "path": "../data/tsconfig.json" }, + { "path": "../expressions/tsconfig.json" }, + { "path": "../visualizations/tsconfig.json" }, + { "path": "../usage_collection/tsconfig.json" }, + { "path": "../vis_default_editor/tsconfig.json" }, + ] + } \ No newline at end of file diff --git a/src/plugins/vis_type_timeseries/common/fields_utils.test.ts b/src/plugins/vis_type_timeseries/common/fields_utils.test.ts index 9550697e228512..f056c38b0c0c30 100644 --- a/src/plugins/vis_type_timeseries/common/fields_utils.test.ts +++ b/src/plugins/vis_type_timeseries/common/fields_utils.test.ts @@ -12,7 +12,7 @@ import type { FieldSpec } from '../../data/common'; describe('fields_utils', () => { describe('toSanitizedFieldType', () => { const mockedField = { - lang: 'lang', + lang: 'painless', conflictDescriptions: {}, aggregatable: true, name: 'name', diff --git a/src/plugins/vis_type_vega/public/data_model/types.ts b/src/plugins/vis_type_vega/public/data_model/types.ts index 255bd9774f9df8..9e3cf0a5421c1c 100644 --- a/src/plugins/vis_type_vega/public/data_model/types.ts +++ b/src/plugins/vis_type_vega/public/data_model/types.ts @@ -17,7 +17,7 @@ import { EmsFileParser } from './ems_file_parser'; import { UrlParser } from './url_parser'; interface Body { - aggs?: Record; + aggs?: Record; query?: Query; timeout?: string; } diff --git a/src/plugins/vis_type_vislib/kibana.json b/src/plugins/vis_type_vislib/kibana.json index 175c21f47c182a..56dfba0aca59c0 100644 --- a/src/plugins/vis_type_vislib/kibana.json +++ b/src/plugins/vis_type_vislib/kibana.json @@ -4,5 +4,5 @@ "server": true, "ui": true, "requiredPlugins": ["charts", "data", "expressions", "visualizations", "kibanaLegacy"], - "requiredBundles": ["kibanaUtils", "visDefaultEditor", "visTypeXy"] + "requiredBundles": ["kibanaUtils", "visDefaultEditor", "visTypeXy", "visTypePie"] } diff --git a/src/plugins/vis_type_vislib/public/editor/components/index.tsx b/src/plugins/vis_type_vislib/public/editor/components/index.tsx index a90aaeab58503d..34547dc7115e28 100644 --- a/src/plugins/vis_type_vislib/public/editor/components/index.tsx +++ b/src/plugins/vis_type_vislib/public/editor/components/index.tsx @@ -10,21 +10,15 @@ import React, { lazy } from 'react'; import { VisEditorOptionsProps } from 'src/plugins/visualizations/public'; import { GaugeVisParams } from '../../gauge'; -import { PieVisParams } from '../../pie'; import { HeatmapVisParams } from '../../heatmap'; const GaugeOptionsLazy = lazy(() => import('./gauge')); -const PieOptionsLazy = lazy(() => import('./pie')); const HeatmapOptionsLazy = lazy(() => import('./heatmap')); export const GaugeOptions = (props: VisEditorOptionsProps) => ( ); -export const PieOptions = (props: VisEditorOptionsProps) => ( - -); - export const HeatmapOptions = (props: VisEditorOptionsProps) => ( ); diff --git a/src/plugins/vis_type_vislib/public/editor/components/pie.tsx b/src/plugins/vis_type_vislib/public/editor/components/pie.tsx deleted file mode 100644 index 6c84bc744676a9..00000000000000 --- a/src/plugins/vis_type_vislib/public/editor/components/pie.tsx +++ /dev/null @@ -1,97 +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 React from 'react'; - -import { EuiPanel, EuiTitle, EuiSpacer } from '@elastic/eui'; -import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; - -import { VisEditorOptionsProps } from 'src/plugins/visualizations/public'; -import { BasicOptions, SwitchOption } from '../../../../vis_default_editor/public'; -import { TruncateLabelsOption, getPositions } from '../../../../vis_type_xy/public'; - -import { PieVisParams } from '../../pie'; - -const legendPositions = getPositions(); - -function PieOptions(props: VisEditorOptionsProps) { - const { stateParams, setValue } = props; - const setLabels = ( - paramName: T, - value: PieVisParams['labels'][T] - ) => setValue('labels', { ...stateParams.labels, [paramName]: value }); - - return ( - <> - - -

- -

-
- - - -
- - - - - -

- -

-
- - - - - -
- - ); -} - -// default export required for React.Lazy -// eslint-disable-next-line import/no-default-export -export { PieOptions as default }; diff --git a/src/plugins/vis_type_vislib/public/pie.ts b/src/plugins/vis_type_vislib/public/pie.ts index d1d8d2a5279feb..4f6eb7e5365092 100644 --- a/src/plugins/vis_type_vislib/public/pie.ts +++ b/src/plugins/vis_type_vislib/public/pie.ts @@ -6,14 +6,9 @@ * Side Public License, v 1. */ -import { i18n } from '@kbn/i18n'; -import { Position } from '@elastic/charts'; - -import { AggGroupNames } from '../../data/public'; -import { VisTypeDefinition, VIS_EVENT_TO_TRIGGER } from '../../visualizations/public'; - +import { pieVisType } from '../../vis_type_pie/public'; +import { VisTypeDefinition } from '../../visualizations/public'; import { CommonVislibParams } from './types'; -import { PieOptions } from './editor'; import { toExpressionAst } from './to_ast_pie'; export interface PieVisParams extends CommonVislibParams { @@ -27,67 +22,7 @@ export interface PieVisParams extends CommonVislibParams { }; } -export const pieVisTypeDefinition: VisTypeDefinition = { - name: 'pie', - title: i18n.translate('visTypeVislib.pie.pieTitle', { defaultMessage: 'Pie' }), - icon: 'visPie', - description: i18n.translate('visTypeVislib.pie.pieDescription', { - defaultMessage: 'Compare data in proportion to a whole.', - }), - getSupportedTriggers: () => [VIS_EVENT_TO_TRIGGER.filter], +export const pieVisTypeDefinition = { + ...pieVisType({}), toExpressionAst, - visConfig: { - defaults: { - type: 'pie', - addTooltip: true, - addLegend: true, - legendPosition: Position.Right, - isDonut: true, - labels: { - show: false, - values: true, - last_level: true, - truncate: 100, - }, - }, - }, - editorConfig: { - optionsTemplate: PieOptions, - schemas: [ - { - group: AggGroupNames.Metrics, - name: 'metric', - title: i18n.translate('visTypeVislib.pie.metricTitle', { - defaultMessage: 'Slice size', - }), - min: 1, - max: 1, - aggFilter: ['sum', 'count', 'cardinality', 'top_hits'], - defaults: [{ schema: 'metric', type: 'count' }], - }, - { - group: AggGroupNames.Buckets, - name: 'segment', - title: i18n.translate('visTypeVislib.pie.segmentTitle', { - defaultMessage: 'Split slices', - }), - min: 0, - max: Infinity, - aggFilter: ['!geohash_grid', '!geotile_grid', '!filter'], - }, - { - group: AggGroupNames.Buckets, - name: 'split', - title: i18n.translate('visTypeVislib.pie.splitTitle', { - defaultMessage: 'Split chart', - }), - mustBeFirst: true, - min: 0, - max: 1, - aggFilter: ['!geohash_grid', '!geotile_grid', '!filter'], - }, - ], - }, - hierarchicalData: true, - requiresSearch: true, -}; +} as VisTypeDefinition; diff --git a/src/plugins/vis_type_vislib/public/plugin.ts b/src/plugins/vis_type_vislib/public/plugin.ts index 9d329c92bede0c..52faf8a74778c3 100644 --- a/src/plugins/vis_type_vislib/public/plugin.ts +++ b/src/plugins/vis_type_vislib/public/plugin.ts @@ -13,7 +13,7 @@ import { VisualizationsSetup } from '../../visualizations/public'; import { ChartsPluginSetup } from '../../charts/public'; import { DataPublicPluginStart } from '../../data/public'; import { KibanaLegacyStart } from '../../kibana_legacy/public'; -import { LEGACY_CHARTS_LIBRARY } from '../../vis_type_xy/public'; +import { LEGACY_CHARTS_LIBRARY } from '../../visualizations/common/constants'; import { createVisTypeVislibVisFn } from './vis_type_vislib_vis_fn'; import { createPieVisFn } from './pie_fn'; @@ -53,9 +53,8 @@ export class VisTypeVislibPlugin if (!core.uiSettings.get(LEGACY_CHARTS_LIBRARY, false)) { // Register only non-replaced vis types convertedTypeDefinitions.forEach(visualizations.createBaseVisualization); - visualizations.createBaseVisualization(pieVisTypeDefinition); expressions.registerRenderer(getVislibVisRenderer(core, charts)); - [createVisTypeVislibVisFn(), createPieVisFn()].forEach(expressions.registerFunction); + expressions.registerFunction(createVisTypeVislibVisFn()); } else { // Register all vis types visLibVisTypeDefinitions.forEach(visualizations.createBaseVisualization); diff --git a/src/plugins/vis_type_vislib/public/to_ast_pie.test.ts b/src/plugins/vis_type_vislib/public/to_ast_pie.test.ts index 3ca52f27e3fa18..3178c23ee8fa0d 100644 --- a/src/plugins/vis_type_vislib/public/to_ast_pie.test.ts +++ b/src/plugins/vis_type_vislib/public/to_ast_pie.test.ts @@ -10,7 +10,7 @@ import { Vis } from '../../visualizations/public'; import { buildExpression } from '../../expressions/public'; import { PieVisParams } from './pie'; -import { samplePieVis } from '../../vis_type_xy/public/sample_vis.test.mocks'; +import { samplePieVis } from '../../vis_type_pie/public/sample_vis.test.mocks'; import { toExpressionAst } from './to_ast_pie'; jest.mock('../../expressions/public', () => ({ diff --git a/src/plugins/vis_type_vislib/public/vislib/helpers/hierarchical/build_hierarchical_data.test.ts b/src/plugins/vis_type_vislib/public/vislib/helpers/hierarchical/build_hierarchical_data.test.ts index 71f692b80b531f..de91053b6dc4df 100644 --- a/src/plugins/vis_type_vislib/public/vislib/helpers/hierarchical/build_hierarchical_data.test.ts +++ b/src/plugins/vis_type_vislib/public/vislib/helpers/hierarchical/build_hierarchical_data.test.ts @@ -5,8 +5,8 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ - -import { buildHierarchicalData, Dimensions, Dimension } from './build_hierarchical_data'; +import type { Dimensions, Dimension } from '../../../../../vis_type_pie/public'; +import { buildHierarchicalData } from './build_hierarchical_data'; import { Table, TableParent } from '../../types'; function tableVisResponseHandler(table: Table, dimensions: Dimensions) { diff --git a/src/plugins/vis_type_vislib/public/vislib/helpers/hierarchical/build_hierarchical_data.ts b/src/plugins/vis_type_vislib/public/vislib/helpers/hierarchical/build_hierarchical_data.ts index b235d3936ae0fd..da10edf9591fbf 100644 --- a/src/plugins/vis_type_vislib/public/vislib/helpers/hierarchical/build_hierarchical_data.ts +++ b/src/plugins/vis_type_vislib/public/vislib/helpers/hierarchical/build_hierarchical_data.ts @@ -7,24 +7,9 @@ */ import { toArray } from 'lodash'; -import { SerializedFieldFormat } from '../../../../../expressions/common/types'; import { getFormatService } from '../../../services'; import { Table } from '../../types'; - -export interface Dimension { - accessor: number; - format: { - id?: string; - params?: SerializedFieldFormat; - }; -} - -export interface Dimensions { - metric: Dimension; - buckets?: Dimension[]; - splitRow?: Dimension[]; - splitColumn?: Dimension[]; -} +import type { Dimensions } from '../../../../../vis_type_pie/public'; interface Slice { name: string; diff --git a/src/plugins/vis_type_vislib/tsconfig.json b/src/plugins/vis_type_vislib/tsconfig.json index 74bc1440d9dbc6..5bf1af9ba75fea 100644 --- a/src/plugins/vis_type_vislib/tsconfig.json +++ b/src/plugins/vis_type_vislib/tsconfig.json @@ -22,5 +22,6 @@ { "path": "../kibana_utils/tsconfig.json" }, { "path": "../vis_default_editor/tsconfig.json" }, { "path": "../vis_type_xy/tsconfig.json" }, + { "path": "../vis_type_pie/tsconfig.json" }, ] } diff --git a/src/plugins/vis_type_xy/common/index.ts b/src/plugins/vis_type_xy/common/index.ts index a80946f7c62fa3..f17bc8476d9a68 100644 --- a/src/plugins/vis_type_xy/common/index.ts +++ b/src/plugins/vis_type_xy/common/index.ts @@ -19,5 +19,3 @@ export enum ChartType { * Type of xy visualizations */ export type XyVisType = ChartType | 'horizontal_bar'; - -export const LEGACY_CHARTS_LIBRARY = 'visualization:visualize:legacyChartsLibrary'; diff --git a/src/plugins/vis_type_xy/kibana.json b/src/plugins/vis_type_xy/kibana.json index 619fa8e71c0dde..a32b1e4d1d8b51 100644 --- a/src/plugins/vis_type_xy/kibana.json +++ b/src/plugins/vis_type_xy/kibana.json @@ -1,7 +1,6 @@ { "id": "visTypeXy", "version": "kibana", - "server": true, "ui": true, "requiredPlugins": ["charts", "data", "expressions", "visualizations", "usageCollection"], "requiredBundles": ["kibanaUtils", "visDefaultEditor"] diff --git a/src/plugins/vis_type_xy/public/config/get_axis.ts b/src/plugins/vis_type_xy/public/config/get_axis.ts index 91647f02e2a1e6..08b17c882eea6b 100644 --- a/src/plugins/vis_type_xy/public/config/get_axis.ts +++ b/src/plugins/vis_type_xy/public/config/get_axis.ts @@ -169,7 +169,7 @@ function getAxisDomain( const { min, max, defaultYExtents, boundsMargin } = scale; const fit = defaultYExtents; - const padding = boundsMargin; + const padding = boundsMargin || undefined; if (!isNil(min) && !isNil(max)) { return { fit, padding, min, max }; diff --git a/src/plugins/vis_type_xy/public/plugin.ts b/src/plugins/vis_type_xy/public/plugin.ts index 7bdb4f78bc631d..e8d53127765b4c 100644 --- a/src/plugins/vis_type_xy/public/plugin.ts +++ b/src/plugins/vis_type_xy/public/plugin.ts @@ -23,7 +23,7 @@ import { } from './services'; import { visTypesDefinitions } from './vis_types'; -import { LEGACY_CHARTS_LIBRARY } from '../common'; +import { LEGACY_CHARTS_LIBRARY } from '../../visualizations/common/constants'; import { xyVisRenderer } from './vis_renderer'; import * as expressionFunctions from './expression_functions'; diff --git a/src/plugins/vis_type_xy/public/sample_vis.test.mocks.ts b/src/plugins/vis_type_xy/public/sample_vis.test.mocks.ts index 39370d941b52ac..8fafd4c7230557 100644 --- a/src/plugins/vis_type_xy/public/sample_vis.test.mocks.ts +++ b/src/plugins/vis_type_xy/public/sample_vis.test.mocks.ts @@ -5,1325 +5,6 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ - -export const samplePieVis = { - type: { - name: 'pie', - title: 'Pie', - description: 'Compare parts of a whole', - icon: 'visPie', - stage: 'production', - options: { - showTimePicker: true, - showQueryBar: true, - showFilterBar: true, - showIndexSelection: true, - hierarchicalData: false, - }, - visConfig: { - defaults: { - type: 'pie', - addTooltip: true, - addLegend: true, - legendPosition: 'right', - isDonut: true, - labels: { - show: false, - values: true, - last_level: true, - truncate: 100, - }, - }, - }, - editorConfig: { - collections: { - legendPositions: [ - { - text: 'Top', - value: 'top', - }, - { - text: 'Left', - value: 'left', - }, - { - text: 'Right', - value: 'right', - }, - { - text: 'Bottom', - value: 'bottom', - }, - ], - }, - schemas: { - all: [ - { - group: 'metrics', - name: 'metric', - title: 'Slice size', - min: 1, - max: 1, - aggFilter: ['sum', 'count', 'cardinality', 'top_hits'], - defaults: [ - { - schema: 'metric', - type: 'count', - }, - ], - editor: false, - params: [], - }, - { - group: 'buckets', - name: 'segment', - title: 'Split slices', - min: 0, - max: null, - aggFilter: ['!geohash_grid', '!geotile_grid', '!filter'], - editor: false, - params: [], - }, - { - group: 'buckets', - name: 'split', - title: 'Split chart', - mustBeFirst: true, - min: 0, - max: 1, - aggFilter: ['!geohash_grid', '!geotile_grid', '!filter'], - params: [ - { - name: 'row', - default: true, - }, - ], - editor: false, - }, - ], - buckets: [null, null], - metrics: [null], - }, - }, - hidden: false, - hierarchicalData: true, - }, - title: '[Flights] Airline Carrier', - description: '', - params: { - type: 'pie', - addTooltip: true, - addLegend: true, - legendPosition: 'right', - isDonut: true, - labels: { - show: true, - values: true, - last_level: true, - truncate: 100, - }, - }, - data: { - searchSource: { - id: 'data_source1', - requestStartHandlers: [], - inheritOptions: {}, - history: [], - fields: { - filter: [], - query: { - query: '', - language: 'kuery', - }, - index: { - id: 'd3d7af60-4c81-11e8-b3d7-01146121b73d', - title: 'kibana_sample_data_flights', - fieldFormatMap: { - AvgTicketPrice: { - id: 'number', - params: { - parsedUrl: { - origin: 'http://localhost:5801', - pathname: '/app/visualize', - basePath: '', - }, - pattern: '$0,0.[00]', - }, - }, - hour_of_day: { - id: 'number', - params: { - pattern: '00', - }, - }, - }, - fields: [ - { - count: 0, - name: 'AvgTicketPrice', - type: 'number', - esTypes: ['float'], - scripted: false, - searchable: true, - aggregatable: true, - readFromDocValues: true, - }, - { - count: 0, - name: 'Cancelled', - type: 'boolean', - esTypes: ['boolean'], - scripted: false, - searchable: true, - aggregatable: true, - readFromDocValues: true, - }, - { - count: 0, - name: 'Carrier', - type: 'string', - esTypes: ['keyword'], - scripted: false, - searchable: true, - aggregatable: true, - readFromDocValues: true, - }, - { - count: 0, - name: 'Dest', - type: 'string', - esTypes: ['keyword'], - scripted: false, - searchable: true, - aggregatable: true, - readFromDocValues: true, - }, - { - count: 0, - name: 'DestAirportID', - type: 'string', - esTypes: ['keyword'], - scripted: false, - searchable: true, - aggregatable: true, - readFromDocValues: true, - }, - { - count: 0, - name: 'DestCityName', - type: 'string', - esTypes: ['keyword'], - scripted: false, - searchable: true, - aggregatable: true, - readFromDocValues: true, - }, - { - count: 0, - name: 'DestCountry', - type: 'string', - esTypes: ['keyword'], - scripted: false, - searchable: true, - aggregatable: true, - readFromDocValues: true, - }, - { - count: 0, - name: 'DestLocation', - type: 'geo_point', - esTypes: ['geo_point'], - scripted: false, - searchable: true, - aggregatable: true, - readFromDocValues: true, - }, - { - count: 0, - name: 'DestRegion', - type: 'string', - esTypes: ['keyword'], - scripted: false, - searchable: true, - aggregatable: true, - readFromDocValues: true, - }, - { - count: 0, - name: 'DestWeather', - type: 'string', - esTypes: ['keyword'], - scripted: false, - searchable: true, - aggregatable: true, - readFromDocValues: true, - }, - { - count: 0, - name: 'DistanceKilometers', - type: 'number', - esTypes: ['float'], - scripted: false, - searchable: true, - aggregatable: true, - readFromDocValues: true, - }, - { - count: 0, - name: 'DistanceMiles', - type: 'number', - esTypes: ['float'], - scripted: false, - searchable: true, - aggregatable: true, - readFromDocValues: true, - }, - { - count: 0, - name: 'FlightDelay', - type: 'boolean', - esTypes: ['boolean'], - scripted: false, - searchable: true, - aggregatable: true, - readFromDocValues: true, - }, - { - count: 0, - name: 'FlightDelayMin', - type: 'number', - esTypes: ['integer'], - scripted: false, - searchable: true, - aggregatable: true, - readFromDocValues: true, - }, - { - count: 0, - name: 'FlightDelayType', - type: 'string', - esTypes: ['keyword'], - scripted: false, - searchable: true, - aggregatable: true, - readFromDocValues: true, - }, - { - count: 0, - name: 'FlightNum', - type: 'string', - esTypes: ['keyword'], - scripted: false, - searchable: true, - aggregatable: true, - readFromDocValues: true, - }, - { - count: 0, - name: 'FlightTimeHour', - type: 'string', - esTypes: ['keyword'], - scripted: false, - searchable: true, - aggregatable: true, - readFromDocValues: true, - }, - { - count: 0, - name: 'FlightTimeMin', - type: 'number', - esTypes: ['float'], - scripted: false, - searchable: true, - aggregatable: true, - readFromDocValues: true, - }, - { - count: 0, - name: 'Origin', - type: 'string', - esTypes: ['keyword'], - scripted: false, - searchable: true, - aggregatable: true, - readFromDocValues: true, - }, - { - count: 0, - name: 'OriginAirportID', - type: 'string', - esTypes: ['keyword'], - scripted: false, - searchable: true, - aggregatable: true, - readFromDocValues: true, - }, - { - count: 0, - name: 'OriginCityName', - type: 'string', - esTypes: ['keyword'], - scripted: false, - searchable: true, - aggregatable: true, - readFromDocValues: true, - }, - { - count: 0, - name: 'OriginCountry', - type: 'string', - esTypes: ['keyword'], - scripted: false, - searchable: true, - aggregatable: true, - readFromDocValues: true, - }, - { - count: 0, - name: 'OriginLocation', - type: 'geo_point', - esTypes: ['geo_point'], - scripted: false, - searchable: true, - aggregatable: true, - readFromDocValues: true, - }, - { - count: 0, - name: 'OriginRegion', - type: 'string', - esTypes: ['keyword'], - scripted: false, - searchable: true, - aggregatable: true, - readFromDocValues: true, - }, - { - count: 0, - name: 'OriginWeather', - type: 'string', - esTypes: ['keyword'], - scripted: false, - searchable: true, - aggregatable: true, - readFromDocValues: true, - }, - { - count: 0, - name: '_id', - type: 'string', - esTypes: ['_id'], - scripted: false, - searchable: true, - aggregatable: true, - readFromDocValues: false, - }, - { - count: 0, - name: '_index', - type: 'string', - esTypes: ['_index'], - scripted: false, - searchable: true, - aggregatable: true, - readFromDocValues: false, - }, - { - count: 0, - name: '_score', - type: 'number', - scripted: false, - searchable: false, - aggregatable: false, - readFromDocValues: false, - }, - { - count: 0, - name: '_source', - type: '_source', - esTypes: ['_source'], - scripted: false, - searchable: false, - aggregatable: false, - readFromDocValues: false, - }, - { - count: 0, - name: '_type', - type: 'string', - esTypes: ['_type'], - scripted: false, - searchable: true, - aggregatable: true, - readFromDocValues: false, - }, - { - count: 0, - name: 'dayOfWeek', - type: 'number', - esTypes: ['integer'], - scripted: false, - searchable: true, - aggregatable: true, - readFromDocValues: true, - }, - { - count: 0, - name: 'timestamp', - type: 'date', - esTypes: ['date'], - scripted: false, - searchable: true, - aggregatable: true, - readFromDocValues: true, - }, - { - count: 0, - script: "doc['timestamp'].value.hourOfDay", - lang: 'painless', - name: 'hour_of_day', - type: 'number', - scripted: true, - searchable: true, - aggregatable: true, - readFromDocValues: false, - }, - ], - timeFieldName: 'timestamp', - metaFields: ['_source', '_id', '_type', '_index', '_score'], - version: 'WzM1LDFd', - originalSavedObjectBody: { - title: 'kibana_sample_data_flights', - timeFieldName: 'timestamp', - fields: - '[{"count":0,"name":"AvgTicketPrice","type":"number","esTypes":["float"],"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"count":0,"name":"Cancelled","type":"boolean","esTypes":["boolean"],"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"count":0,"name":"Carrier","type":"string","esTypes":["keyword"],"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"count":0,"name":"Dest","type":"string","esTypes":["keyword"],"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"count":0,"name":"DestAirportID","type":"string","esTypes":["keyword"],"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"count":0,"name":"DestCityName","type":"string","esTypes":["keyword"],"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"count":0,"name":"DestCountry","type":"string","esTypes":["keyword"],"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"count":0,"name":"DestLocation","type":"geo_point","esTypes":["geo_point"],"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"count":0,"name":"DestRegion","type":"string","esTypes":["keyword"],"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"count":0,"name":"DestWeather","type":"string","esTypes":["keyword"],"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"count":0,"name":"DistanceKilometers","type":"number","esTypes":["float"],"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"count":0,"name":"DistanceMiles","type":"number","esTypes":["float"],"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"count":0,"name":"FlightDelay","type":"boolean","esTypes":["boolean"],"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"count":0,"name":"FlightDelayMin","type":"number","esTypes":["integer"],"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"count":0,"name":"FlightDelayType","type":"string","esTypes":["keyword"],"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"count":0,"name":"FlightNum","type":"string","esTypes":["keyword"],"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"count":0,"name":"FlightTimeHour","type":"string","esTypes":["keyword"],"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"count":0,"name":"FlightTimeMin","type":"number","esTypes":["float"],"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"count":0,"name":"Origin","type":"string","esTypes":["keyword"],"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"count":0,"name":"OriginAirportID","type":"string","esTypes":["keyword"],"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"count":0,"name":"OriginCityName","type":"string","esTypes":["keyword"],"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"count":0,"name":"OriginCountry","type":"string","esTypes":["keyword"],"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"count":0,"name":"OriginLocation","type":"geo_point","esTypes":["geo_point"],"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"count":0,"name":"OriginRegion","type":"string","esTypes":["keyword"],"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"count":0,"name":"OriginWeather","type":"string","esTypes":["keyword"],"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"count":0,"name":"_id","type":"string","esTypes":["_id"],"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":false},{"count":0,"name":"_index","type":"string","esTypes":["_index"],"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":false},{"count":0,"name":"_score","type":"number","scripted":false,"searchable":false,"aggregatable":false,"readFromDocValues":false},{"count":0,"name":"_source","type":"_source","esTypes":["_source"],"scripted":false,"searchable":false,"aggregatable":false,"readFromDocValues":false},{"count":0,"name":"_type","type":"string","esTypes":["_type"],"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":false},{"count":0,"name":"dayOfWeek","type":"number","esTypes":["integer"],"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"count":0,"name":"timestamp","type":"date","esTypes":["date"],"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"count":0,"script":"doc[\'timestamp\'].value.hourOfDay","lang":"painless","name":"hour_of_day","type":"number","scripted":true,"searchable":true,"aggregatable":true,"readFromDocValues":false}]', - fieldFormatMap: - '{"AvgTicketPrice":{"id":"number","params":{"parsedUrl":{"origin":"http://localhost:5801","pathname":"/app/visualize","basePath":""},"pattern":"$0,0.[00]"}},"hour_of_day":{"id":"number","params":{"parsedUrl":{"origin":"http://localhost:5801","pathname":"/app/visualize","basePath":""},"pattern":"00"}}}', - }, - shortDotsEnable: false, - fieldFormats: { - fieldFormats: {}, - defaultMap: { - ip: { - id: 'ip', - params: {}, - }, - date: { - id: 'date', - params: {}, - }, - date_nanos: { - id: 'date_nanos', - params: {}, - es: true, - }, - number: { - id: 'number', - params: {}, - }, - boolean: { - id: 'boolean', - params: {}, - }, - _source: { - id: '_source', - params: {}, - }, - _default_: { - id: 'string', - params: {}, - }, - }, - metaParamsOptions: {}, - }, - }, - }, - dependencies: { - legacy: { - loadingCount$: { - _isScalar: false, - observers: [ - { - closed: false, - _parentOrParents: { - closed: false, - _parentOrParents: { - closed: false, - _parentOrParents: { - closed: false, - _parentOrParents: { - closed: false, - _parentOrParents: { - closed: false, - _parentOrParents: { - closed: false, - _parentOrParents: { - closed: false, - _parentOrParents: null, - _subscriptions: [null], - syncErrorValue: null, - syncErrorThrown: false, - syncErrorThrowable: true, - isStopped: false, - destination: { - closed: false, - _parentOrParents: null, - _subscriptions: null, - syncErrorValue: null, - syncErrorThrown: false, - syncErrorThrowable: false, - isStopped: false, - destination: { - closed: true, - }, - _context: {}, - }, - }, - _subscriptions: [null], - syncErrorValue: null, - syncErrorThrown: false, - syncErrorThrowable: true, - isStopped: false, - count: 1, - }, - _subscriptions: [null], - syncErrorValue: null, - syncErrorThrown: false, - syncErrorThrowable: true, - isStopped: false, - hasPrev: true, - prev: 0, - }, - _subscriptions: [null], - syncErrorValue: null, - syncErrorThrown: false, - syncErrorThrowable: false, - isStopped: false, - parent: { - closed: true, - _parentOrParents: null, - _subscriptions: null, - syncErrorValue: null, - syncErrorThrown: false, - syncErrorThrowable: true, - isStopped: true, - concurrent: 1, - hasCompleted: true, - buffer: [], - active: 1, - index: 2, - }, - }, - _subscriptions: [null], - syncErrorValue: null, - syncErrorThrown: false, - syncErrorThrowable: false, - isStopped: false, - parent: { - closed: true, - _parentOrParents: null, - _subscriptions: null, - syncErrorValue: null, - syncErrorThrown: false, - syncErrorThrowable: false, - isStopped: true, - concurrent: 1, - hasCompleted: true, - buffer: [ - { - _isScalar: false, - }, - ], - active: 1, - index: 1, - }, - }, - _subscriptions: [ - { - closed: false, - _subscriptions: [ - { - closed: false, - _subscriptions: null, - subject: { - _isScalar: false, - observers: [ - { - closed: false, - _parentOrParents: { - closed: false, - _parentOrParents: { - closed: false, - _parentOrParents: { - closed: false, - _parentOrParents: { - closed: false, - _parentOrParents: { - closed: false, - _parentOrParents: { - closed: false, - _parentOrParents: null, - _subscriptions: [null], - syncErrorValue: null, - syncErrorThrown: false, - syncErrorThrowable: true, - isStopped: false, - destination: { - closed: false, - _parentOrParents: null, - _subscriptions: null, - syncErrorValue: null, - syncErrorThrown: false, - syncErrorThrowable: false, - isStopped: false, - _context: {}, - }, - }, - _subscriptions: [null], - syncErrorValue: null, - syncErrorThrown: false, - syncErrorThrowable: true, - isStopped: false, - count: 13, - }, - _subscriptions: [null], - syncErrorValue: null, - syncErrorThrown: false, - syncErrorThrowable: true, - isStopped: false, - hasPrev: true, - prev: 0, - }, - _subscriptions: [null], - syncErrorValue: null, - syncErrorThrown: false, - syncErrorThrowable: false, - isStopped: false, - parent: { - closed: true, - _parentOrParents: null, - _subscriptions: null, - syncErrorValue: null, - syncErrorThrown: false, - syncErrorThrowable: true, - isStopped: true, - concurrent: 1, - hasCompleted: true, - buffer: [], - active: 1, - index: 2, - }, - }, - _subscriptions: [null], - syncErrorValue: null, - syncErrorThrown: false, - syncErrorThrowable: false, - isStopped: false, - parent: { - closed: true, - _parentOrParents: null, - _subscriptions: null, - syncErrorValue: null, - syncErrorThrown: false, - syncErrorThrowable: false, - isStopped: true, - concurrent: 1, - hasCompleted: true, - buffer: [ - { - _isScalar: false, - }, - ], - active: 1, - index: 1, - }, - }, - _subscriptions: [ - null, - { - closed: false, - _subscriptions: [ - { - closed: false, - _subscriptions: [ - { - closed: false, - _subscriptions: null, - subject: { - _isScalar: false, - observers: [null], - closed: false, - isStopped: false, - hasError: false, - thrownError: null, - _value: 0, - }, - }, - ], - syncErrorValue: null, - syncErrorThrown: false, - syncErrorThrowable: false, - isStopped: false, - hasKey: true, - key: 0, - }, - ], - syncErrorValue: null, - syncErrorThrown: false, - syncErrorThrowable: false, - isStopped: false, - }, - ], - syncErrorValue: null, - syncErrorThrown: false, - syncErrorThrowable: false, - isStopped: false, - seenValue: false, - }, - _subscriptions: [ - { - closed: false, - _subscriptions: null, - }, - ], - syncErrorValue: null, - syncErrorThrown: false, - syncErrorThrowable: false, - isStopped: false, - }, - { - closed: false, - _parentOrParents: { - closed: false, - _parentOrParents: { - closed: false, - _parentOrParents: { - closed: false, - _parentOrParents: { - closed: false, - _parentOrParents: { - closed: false, - _parentOrParents: { - closed: false, - _parentOrParents: null, - _subscriptions: [null], - syncErrorValue: null, - syncErrorThrown: false, - syncErrorThrowable: true, - isStopped: false, - destination: { - closed: false, - _parentOrParents: null, - _subscriptions: null, - syncErrorValue: null, - syncErrorThrown: false, - syncErrorThrowable: false, - isStopped: false, - _context: {}, - }, - }, - _subscriptions: [null], - syncErrorValue: null, - syncErrorThrown: false, - syncErrorThrowable: true, - isStopped: false, - count: 1, - }, - _subscriptions: [null], - syncErrorValue: null, - syncErrorThrown: false, - syncErrorThrowable: true, - isStopped: false, - hasPrev: true, - prev: 0, - }, - _subscriptions: [null], - syncErrorValue: null, - syncErrorThrown: false, - syncErrorThrowable: false, - isStopped: false, - parent: { - closed: true, - _parentOrParents: null, - _subscriptions: null, - syncErrorValue: null, - syncErrorThrown: false, - syncErrorThrowable: true, - isStopped: true, - concurrent: 1, - hasCompleted: true, - buffer: [], - active: 1, - index: 2, - }, - }, - _subscriptions: [null], - syncErrorValue: null, - syncErrorThrown: false, - syncErrorThrowable: false, - isStopped: false, - parent: { - closed: true, - _parentOrParents: null, - _subscriptions: null, - syncErrorValue: null, - syncErrorThrown: false, - syncErrorThrowable: false, - isStopped: true, - concurrent: 1, - hasCompleted: true, - buffer: [ - { - _isScalar: false, - }, - ], - active: 1, - index: 1, - }, - }, - _subscriptions: [ - null, - { - closed: false, - _subscriptions: [ - { - closed: false, - _subscriptions: [ - { - closed: false, - _subscriptions: null, - subject: { - _isScalar: false, - observers: [null], - closed: false, - isStopped: false, - hasError: false, - thrownError: null, - _value: 0, - }, - }, - ], - syncErrorValue: null, - syncErrorThrown: false, - syncErrorThrowable: false, - isStopped: false, - hasKey: true, - key: 0, - }, - ], - syncErrorValue: null, - syncErrorThrown: false, - syncErrorThrowable: false, - isStopped: false, - }, - ], - syncErrorValue: null, - syncErrorThrown: false, - syncErrorThrowable: false, - isStopped: false, - seenValue: false, - }, - _subscriptions: [ - { - closed: false, - _subscriptions: null, - }, - ], - syncErrorValue: null, - syncErrorThrown: false, - syncErrorThrowable: false, - isStopped: false, - }, - { - closed: false, - _parentOrParents: { - closed: false, - _parentOrParents: { - closed: false, - _parentOrParents: { - closed: false, - _parentOrParents: { - closed: false, - _parentOrParents: { - closed: false, - _parentOrParents: { - closed: false, - _parentOrParents: null, - _subscriptions: [null], - syncErrorValue: null, - syncErrorThrown: false, - syncErrorThrowable: true, - isStopped: false, - destination: { - closed: false, - _parentOrParents: null, - _subscriptions: null, - syncErrorValue: null, - syncErrorThrown: false, - syncErrorThrowable: false, - isStopped: false, - _context: {}, - }, - }, - _subscriptions: [null], - syncErrorValue: null, - syncErrorThrown: false, - syncErrorThrowable: true, - isStopped: false, - count: 1, - }, - _subscriptions: [null], - syncErrorValue: null, - syncErrorThrown: false, - syncErrorThrowable: true, - isStopped: false, - hasPrev: true, - prev: 0, - }, - _subscriptions: [null], - syncErrorValue: null, - syncErrorThrown: false, - syncErrorThrowable: false, - isStopped: false, - parent: { - closed: true, - _parentOrParents: null, - _subscriptions: null, - syncErrorValue: null, - syncErrorThrown: false, - syncErrorThrowable: true, - isStopped: true, - concurrent: 1, - hasCompleted: true, - buffer: [], - active: 1, - index: 2, - }, - }, - _subscriptions: [null], - syncErrorValue: null, - syncErrorThrown: false, - syncErrorThrowable: false, - isStopped: false, - parent: { - closed: true, - _parentOrParents: null, - _subscriptions: null, - syncErrorValue: null, - syncErrorThrown: false, - syncErrorThrowable: false, - isStopped: true, - concurrent: 1, - hasCompleted: true, - buffer: [ - { - _isScalar: false, - }, - ], - active: 1, - index: 1, - }, - }, - _subscriptions: [ - null, - { - closed: false, - _subscriptions: [ - { - closed: false, - _subscriptions: [ - { - closed: false, - _subscriptions: null, - subject: { - _isScalar: false, - observers: [null], - closed: false, - isStopped: false, - hasError: false, - thrownError: null, - _value: 0, - }, - }, - ], - syncErrorValue: null, - syncErrorThrown: false, - syncErrorThrowable: false, - isStopped: false, - hasKey: true, - key: 0, - }, - ], - syncErrorValue: null, - syncErrorThrown: false, - syncErrorThrowable: false, - isStopped: false, - }, - ], - syncErrorValue: null, - syncErrorThrown: false, - syncErrorThrowable: false, - isStopped: false, - seenValue: false, - }, - _subscriptions: [ - { - closed: false, - _subscriptions: null, - }, - ], - syncErrorValue: null, - syncErrorThrown: false, - syncErrorThrowable: false, - isStopped: false, - }, - { - closed: false, - _parentOrParents: { - closed: false, - _parentOrParents: { - closed: false, - _parentOrParents: { - closed: false, - _parentOrParents: { - closed: false, - _parentOrParents: { - closed: false, - _parentOrParents: { - closed: false, - _parentOrParents: null, - _subscriptions: [null], - syncErrorValue: null, - syncErrorThrown: false, - syncErrorThrowable: true, - isStopped: false, - destination: { - closed: false, - _parentOrParents: null, - _subscriptions: null, - syncErrorValue: null, - syncErrorThrown: false, - syncErrorThrowable: false, - isStopped: false, - _context: {}, - }, - }, - _subscriptions: [null], - syncErrorValue: null, - syncErrorThrown: false, - syncErrorThrowable: true, - isStopped: false, - count: 3, - }, - _subscriptions: [null], - syncErrorValue: null, - syncErrorThrown: false, - syncErrorThrowable: true, - isStopped: false, - hasPrev: true, - prev: 0, - }, - _subscriptions: [null], - syncErrorValue: null, - syncErrorThrown: false, - syncErrorThrowable: false, - isStopped: false, - parent: { - closed: true, - _parentOrParents: null, - _subscriptions: null, - syncErrorValue: null, - syncErrorThrown: false, - syncErrorThrowable: true, - isStopped: true, - concurrent: 1, - hasCompleted: true, - buffer: [], - active: 1, - index: 2, - }, - }, - _subscriptions: [null], - syncErrorValue: null, - syncErrorThrown: false, - syncErrorThrowable: false, - isStopped: false, - parent: { - closed: true, - _parentOrParents: null, - _subscriptions: null, - syncErrorValue: null, - syncErrorThrown: false, - syncErrorThrowable: false, - isStopped: true, - concurrent: 1, - hasCompleted: true, - buffer: [ - { - _isScalar: false, - }, - ], - active: 1, - index: 1, - }, - }, - _subscriptions: [ - null, - { - closed: false, - _subscriptions: [ - { - closed: false, - _subscriptions: [ - { - closed: false, - _subscriptions: null, - subject: { - _isScalar: false, - observers: [null], - closed: false, - isStopped: false, - hasError: false, - thrownError: null, - _value: 0, - }, - }, - ], - syncErrorValue: null, - syncErrorThrown: false, - syncErrorThrowable: false, - isStopped: false, - hasKey: true, - key: 0, - }, - ], - syncErrorValue: null, - syncErrorThrown: false, - syncErrorThrowable: false, - isStopped: false, - }, - ], - syncErrorValue: null, - syncErrorThrown: false, - syncErrorThrowable: false, - isStopped: false, - seenValue: false, - }, - _subscriptions: [ - { - closed: false, - _subscriptions: null, - }, - ], - syncErrorValue: null, - syncErrorThrown: false, - syncErrorThrowable: false, - isStopped: false, - }, - null, - ], - closed: false, - isStopped: false, - hasError: false, - thrownError: null, - }, - }, - ], - syncErrorValue: null, - syncErrorThrown: false, - syncErrorThrowable: false, - isStopped: false, - }, - null, - ], - syncErrorValue: null, - syncErrorThrown: false, - syncErrorThrowable: false, - isStopped: false, - seenValue: false, - }, - _subscriptions: [null], - syncErrorValue: null, - syncErrorThrown: false, - syncErrorThrowable: false, - isStopped: false, - }, - _subscriptions: [ - { - closed: false, - _subscriptions: null, - }, - ], - syncErrorValue: null, - syncErrorThrown: false, - syncErrorThrowable: false, - isStopped: false, - hasKey: true, - key: 0, - }, - ], - closed: false, - isStopped: false, - hasError: false, - thrownError: null, - _value: 0, - }, - }, - }, - }, - aggs: { - typesRegistry: {}, - getResponseAggs: () => [ - { - id: '1', - enabled: true, - type: 'count', - params: {}, - schema: 'metric', - toSerializedFieldFormat: () => ({ - id: 'number', - }), - }, - { - id: '2', - enabled: true, - type: 'terms', - params: { - field: 'Carrier', - orderBy: '1', - order: 'desc', - size: 5, - otherBucket: false, - otherBucketLabel: 'Other', - missingBucket: false, - missingBucketLabel: 'Missing', - }, - schema: 'segment', - toSerializedFieldFormat: () => ({ - id: 'terms', - params: { - id: 'string', - otherBucketLabel: 'Other', - missingBucketLabel: 'Missing', - parsedUrl: { - origin: 'http://localhost:5801', - pathname: '/app/visualize', - basePath: '', - }, - }, - }), - }, - ], - }, - }, - isHierarchical: () => true, - uiState: { - vis: { - legendOpen: false, - }, - }, -}; - export const sampleAreaVis = { type: { name: 'area', diff --git a/src/plugins/vis_type_xy/server/plugin.ts b/src/plugins/vis_type_xy/server/plugin.ts deleted file mode 100644 index 08aefdeb836b0e..00000000000000 --- a/src/plugins/vis_type_xy/server/plugin.ts +++ /dev/null @@ -1,46 +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 { i18n } from '@kbn/i18n'; -import { schema } from '@kbn/config-schema'; - -import { CoreSetup, Plugin, UiSettingsParams } from 'kibana/server'; - -import { LEGACY_CHARTS_LIBRARY } from '../common'; - -export const getUiSettingsConfig: () => Record> = () => ({ - // TODO: Remove this when vis_type_vislib is removed - // https://github.com/elastic/kibana/issues/56143 - [LEGACY_CHARTS_LIBRARY]: { - name: i18n.translate('visTypeXy.advancedSettings.visualization.legacyChartsLibrary.name', { - defaultMessage: 'Legacy charts library', - }), - requiresPageReload: true, - value: false, - description: i18n.translate( - 'visTypeXy.advancedSettings.visualization.legacyChartsLibrary.description', - { - defaultMessage: 'Enables legacy charts library for area, line and bar charts in visualize.', - } - ), - category: ['visualization'], - schema: schema.boolean(), - }, -}); - -export class VisTypeXyServerPlugin implements Plugin { - public setup(core: CoreSetup) { - core.uiSettings.register(getUiSettingsConfig()); - - return {}; - } - - public start() { - return {}; - } -} diff --git a/src/plugins/visualizations/common/constants.ts b/src/plugins/visualizations/common/constants.ts index a8a0963ac89480..a33e74b498a2ce 100644 --- a/src/plugins/visualizations/common/constants.ts +++ b/src/plugins/visualizations/common/constants.ts @@ -7,3 +7,4 @@ */ export const VISUALIZE_ENABLE_LABS_SETTING = 'visualize:enableLabs'; +export const LEGACY_CHARTS_LIBRARY = 'visualization:visualize:legacyChartsLibrary'; diff --git a/src/plugins/visualizations/kibana.json b/src/plugins/visualizations/kibana.json index 0ced74e2733d31..939b331414166c 100644 --- a/src/plugins/visualizations/kibana.json +++ b/src/plugins/visualizations/kibana.json @@ -12,5 +12,6 @@ "savedObjects" ], "optionalPlugins": ["usageCollection"], - "requiredBundles": ["kibanaUtils", "discover"] + "requiredBundles": ["kibanaUtils", "discover"], + "extraPublicDirs": ["common/constants"] } diff --git a/src/plugins/visualizations/server/embeddable/visualize_embeddable_factory.test.ts b/src/plugins/visualizations/server/embeddable/visualize_embeddable_factory.test.ts new file mode 100644 index 00000000000000..fe0f1a766e8aca --- /dev/null +++ b/src/plugins/visualizations/server/embeddable/visualize_embeddable_factory.test.ts @@ -0,0 +1,27 @@ +/* + * 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 semverGte from 'semver/functions/gte'; +import { visualizeEmbeddableFactory } from './visualize_embeddable_factory'; +import { visualizationSavedObjectTypeMigrations } from '../migrations/visualization_saved_object_migrations'; + +describe('saved object migrations and embeddable migrations', () => { + test('should have same versions registered (>7.13.0)', () => { + const savedObjectMigrationVersions = Object.keys(visualizationSavedObjectTypeMigrations).filter( + (version) => { + return semverGte(version, '7.13.1'); + } + ); + const embeddableMigrationVersions = visualizeEmbeddableFactory()?.migrations; + if (embeddableMigrationVersions) { + expect(savedObjectMigrationVersions.sort()).toEqual( + Object.keys(embeddableMigrationVersions).sort() + ); + } + }); +}); diff --git a/src/plugins/visualizations/server/embeddable/visualize_embeddable_factory.ts b/src/plugins/visualizations/server/embeddable/visualize_embeddable_factory.ts index 212c033a65c263..edfd05b84dfc8e 100644 --- a/src/plugins/visualizations/server/embeddable/visualize_embeddable_factory.ts +++ b/src/plugins/visualizations/server/embeddable/visualize_embeddable_factory.ts @@ -13,6 +13,7 @@ import { commonAddSupportOfDualIndexSelectionModeInTSVB, commonHideTSVBLastValueIndicator, commonRemoveDefaultIndexPatternAndTimeFieldFromTSVBModel, + commonMigrateVislibPie, commonAddEmptyValueColorRule, } from '../migrations/visualization_common_migrations'; @@ -44,6 +45,13 @@ const byValueAddEmptyValueColorRule = (state: SerializableState) => { }; }; +const byValueMigrateVislibPie = (state: SerializableState) => { + return { + ...state, + savedVis: commonMigrateVislibPie(state.savedVis), + }; +}; + export const visualizeEmbeddableFactory = (): EmbeddableRegistryDefinition => { return { id: 'visualization', @@ -55,7 +63,7 @@ export const visualizeEmbeddableFactory = (): EmbeddableRegistryDefinition => { byValueHideTSVBLastValueIndicator, byValueRemoveDefaultIndexPatternAndTimeFieldFromTSVBModel )(state), - '7.14.0': (state) => flow(byValueAddEmptyValueColorRule)(state), + '7.14.0': (state) => flow(byValueAddEmptyValueColorRule, byValueMigrateVislibPie)(state), }, }; }; diff --git a/src/plugins/visualizations/server/migrations/visualization_common_migrations.ts b/src/plugins/visualizations/server/migrations/visualization_common_migrations.ts index 13b8d8c4a0f982..f5afeee0ff35ea 100644 --- a/src/plugins/visualizations/server/migrations/visualization_common_migrations.ts +++ b/src/plugins/visualizations/server/migrations/visualization_common_migrations.ts @@ -91,3 +91,26 @@ export const commonAddEmptyValueColorRule = (visState: any) => { return visState; }; + +export const commonMigrateVislibPie = (visState: any) => { + if (visState && visState.type === 'pie') { + const { params } = visState; + const hasPalette = params?.palette; + + return { + ...visState, + params: { + ...visState.params, + ...(!hasPalette && { + palette: { + type: 'palette', + name: 'kibana_palette', + }, + }), + distinctColors: true, + }, + }; + } + + return visState; +}; diff --git a/src/plugins/visualizations/server/migrations/visualization_saved_object_migrations.test.ts b/src/plugins/visualizations/server/migrations/visualization_saved_object_migrations.test.ts index 36e1635ad4730e..7ee43f36c864e2 100644 --- a/src/plugins/visualizations/server/migrations/visualization_saved_object_migrations.test.ts +++ b/src/plugins/visualizations/server/migrations/visualization_saved_object_migrations.test.ts @@ -2114,4 +2114,52 @@ describe('migration visualization', () => { checkRuleIsNotAddedToArray('gauge_color_rules', params, migratedParams, rule4); }); }); + + describe('7.14.0 update pie visualization defaults', () => { + const migrate = (doc: any) => + visualizationSavedObjectTypeMigrations['7.14.0']( + doc as Parameters[0], + savedObjectMigrationContext + ); + const getTestDoc = (hasPalette = false) => ({ + attributes: { + title: 'My Vis', + description: 'This is my super cool vis.', + visState: JSON.stringify({ + type: 'pie', + title: '[Flights] Delay Type', + params: { + type: 'pie', + ...(hasPalette && { + palette: { + type: 'palette', + name: 'default', + }, + }), + }, + }), + }, + }); + + it('should decorate existing docs with the kibana legacy palette if the palette is not defined - pie', () => { + const migratedTestDoc = migrate(getTestDoc()); + const { palette } = JSON.parse(migratedTestDoc.attributes.visState).params; + + expect(palette.name).toEqual('kibana_palette'); + }); + + it('should not overwrite the palette with the legacy one if the palette already exists in the saved object', () => { + const migratedTestDoc = migrate(getTestDoc(true)); + const { palette } = JSON.parse(migratedTestDoc.attributes.visState).params; + + expect(palette.name).toEqual('default'); + }); + + it('should default the distinct colors per slice setting to true', () => { + const migratedTestDoc = migrate(getTestDoc()); + const { distinctColors } = JSON.parse(migratedTestDoc.attributes.visState).params; + + expect(distinctColors).toBe(true); + }); + }); }); diff --git a/src/plugins/visualizations/server/migrations/visualization_saved_object_migrations.ts b/src/plugins/visualizations/server/migrations/visualization_saved_object_migrations.ts index c5050b4a6940b7..f386d9eb12091e 100644 --- a/src/plugins/visualizations/server/migrations/visualization_saved_object_migrations.ts +++ b/src/plugins/visualizations/server/migrations/visualization_saved_object_migrations.ts @@ -15,6 +15,7 @@ import { commonAddSupportOfDualIndexSelectionModeInTSVB, commonHideTSVBLastValueIndicator, commonRemoveDefaultIndexPatternAndTimeFieldFromTSVBModel, + commonMigrateVislibPie, commonAddEmptyValueColorRule, } from './visualization_common_migrations'; @@ -990,6 +991,29 @@ const addEmptyValueColorRule: SavedObjectMigrationFn = (doc) => { return doc; }; +// [Pie Chart] Migrate vislib pie chart to use the new plugin vis_type_pie +const migrateVislibPie: SavedObjectMigrationFn = (doc) => { + const visStateJSON = get(doc, 'attributes.visState'); + let visState; + + if (visStateJSON) { + try { + visState = JSON.parse(visStateJSON); + } catch (e) { + // Let it go, the data is invalid and we'll leave it as is + } + const newVisState = commonMigrateVislibPie(visState); + return { + ...doc, + attributes: { + ...doc.attributes, + visState: JSON.stringify(newVisState), + }, + }; + } + return doc; +}; + export const visualizationSavedObjectTypeMigrations = { /** * We need to have this migration twice, once with a version prior to 7.0.0 once with a version @@ -1036,5 +1060,5 @@ export const visualizationSavedObjectTypeMigrations = { hideTSVBLastValueIndicator, removeDefaultIndexPatternAndTimeFieldFromTSVBModel ), - '7.14.0': flow(addEmptyValueColorRule), + '7.14.0': flow(addEmptyValueColorRule, migrateVislibPie), }; diff --git a/src/plugins/visualizations/server/plugin.ts b/src/plugins/visualizations/server/plugin.ts index 5a5a80b2689d6e..1fec63f2bb45ad 100644 --- a/src/plugins/visualizations/server/plugin.ts +++ b/src/plugins/visualizations/server/plugin.ts @@ -18,7 +18,7 @@ import { Logger, } from '../../../core/server'; -import { VISUALIZE_ENABLE_LABS_SETTING } from '../common/constants'; +import { VISUALIZE_ENABLE_LABS_SETTING, LEGACY_CHARTS_LIBRARY } from '../common/constants'; import { visualizationSavedObjectType } from './saved_objects'; @@ -58,6 +58,27 @@ export class VisualizationsPlugin category: ['visualization'], schema: schema.boolean(), }, + // TODO: Remove this when vis_type_vislib is removed + // https://github.com/elastic/kibana/issues/56143 + [LEGACY_CHARTS_LIBRARY]: { + name: i18n.translate( + 'visualizations.advancedSettings.visualization.legacyChartsLibrary.name', + { + defaultMessage: 'Legacy charts library', + } + ), + requiresPageReload: true, + value: false, + description: i18n.translate( + 'visualizations.advancedSettings.visualization.legacyChartsLibrary.description', + { + defaultMessage: + 'Enables legacy charts library for area, line, bar, pie charts in visualize.', + } + ), + category: ['visualization'], + schema: schema.boolean(), + }, }); if (plugins.usageCollection) { diff --git a/test/accessibility/apps/dashboard.ts b/test/accessibility/apps/dashboard.ts index 08d577b3df08cd..20b18583d0d72f 100644 --- a/test/accessibility/apps/dashboard.ts +++ b/test/accessibility/apps/dashboard.ts @@ -110,13 +110,12 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); it('Exit out of edit mode', async () => { - await PageObjects.dashboard.clickDiscardChanges(false); + await PageObjects.dashboard.clickCancelOutOfEditMode(false); await a11y.testAppSnapshot(); }); it('Discard changes', async () => { - await testSubjects.exists('dashboardDiscardConfirmDiscard'); - await testSubjects.click('dashboardDiscardConfirmDiscard'); + await PageObjects.common.clickConfirmOnModal(); await PageObjects.dashboard.getIsInViewMode(); await a11y.testAppSnapshot(); }); diff --git a/test/accessibility/ftr_provider_context.d.ts b/test/accessibility/ftr_provider_context.ts similarity index 78% rename from test/accessibility/ftr_provider_context.d.ts rename to test/accessibility/ftr_provider_context.ts index 4c827393e1ef3b..a1a29f50b77611 100644 --- a/test/accessibility/ftr_provider_context.d.ts +++ b/test/accessibility/ftr_provider_context.ts @@ -6,9 +6,10 @@ * Side Public License, v 1. */ -import { GenericFtrProviderContext } from '@kbn/test'; +import { GenericFtrProviderContext, GenericFtrService } from '@kbn/test'; import { pageObjects } from './page_objects'; import { services } from './services'; export type FtrProviderContext = GenericFtrProviderContext; +export class FtrService extends GenericFtrService {} diff --git a/test/accessibility/services/a11y/a11y.ts b/test/accessibility/services/a11y/a11y.ts index ea205e8121eba0..4b01b0dd3b9531 100644 --- a/test/accessibility/services/a11y/a11y.ts +++ b/test/accessibility/services/a11y/a11y.ts @@ -9,7 +9,7 @@ import chalk from 'chalk'; import testSubjectToCss from '@kbn/test-subj-selector'; -import { FtrProviderContext } from '../../ftr_provider_context'; +import { FtrService } from '../../ftr_provider_context'; import { AxeReport, printResult } from './axe_report'; // @ts-ignore JS that is run in browser as is import { analyzeWithAxe, analyzeWithAxeWithClient } from './analyze_with_axe'; @@ -33,86 +33,84 @@ export const normalizeResult = (report: any) => { return report.result as false | AxeReport; }; -export function A11yProvider({ getService }: FtrProviderContext) { - const browser = getService('browser'); - const Wd = getService('__webdriver__'); - - /** - * Accessibility testing service using the Axe (https://www.deque.com/axe/) - * toolset to validate a11y rules similar to ESLint. In order to test against - * the rules we must load up the UI and feed a full HTML snapshot into Axe. - */ - return new (class Accessibility { - public async testAppSnapshot(options: TestOptions = {}) { - const context = this.getAxeContext(true, options.excludeTestSubj); - const report = await this.captureAxeReport(context); - await this.testAxeReport(report); - } +/** + * Accessibility testing service using the Axe (https://www.deque.com/axe/) + * toolset to validate a11y rules similar to ESLint. In order to test against + * the rules we must load up the UI and feed a full HTML snapshot into Axe. + */ +export class AccessibilityService extends FtrService { + private readonly browser = this.ctx.getService('browser'); + private readonly Wd = this.ctx.getService('__webdriver__'); + + public async testAppSnapshot(options: TestOptions = {}) { + const context = this.getAxeContext(true, options.excludeTestSubj); + const report = await this.captureAxeReport(context); + this.assertValidAxeReport(report); + } - public async testGlobalSnapshot(options: TestOptions = {}) { - const context = this.getAxeContext(false, options.excludeTestSubj); - const report = await this.captureAxeReport(context); - await this.testAxeReport(report); - } + public async testGlobalSnapshot(options: TestOptions = {}) { + const context = this.getAxeContext(false, options.excludeTestSubj); + const report = await this.captureAxeReport(context); + this.assertValidAxeReport(report); + } - private getAxeContext(global: boolean, excludeTestSubj?: string | string[]): AxeContext { - return { - include: global ? undefined : [testSubjectToCss('appA11yRoot')], - exclude: ([] as string[]) - .concat(excludeTestSubj || []) - .map((ts) => [testSubjectToCss(ts)]) - .concat([['[role="graphics-document"][aria-roledescription="visualization"]']]), - }; - } + private getAxeContext(global: boolean, excludeTestSubj?: string | string[]): AxeContext { + return { + include: global ? undefined : [testSubjectToCss('appA11yRoot')], + exclude: ([] as string[]) + .concat(excludeTestSubj || []) + .map((ts) => [testSubjectToCss(ts)]) + .concat([['[role="graphics-document"][aria-roledescription="visualization"]']]), + }; + } - private testAxeReport(report: AxeReport) { - const errorMsgs = []; + private assertValidAxeReport(report: AxeReport) { + const errorMsgs = []; - for (const result of report.violations) { - errorMsgs.push(printResult(chalk.red('VIOLATION'), result)); - } + for (const result of report.violations) { + errorMsgs.push(printResult(chalk.red('VIOLATION'), result)); + } - if (errorMsgs.length) { - throw new Error(`a11y report:\n${errorMsgs.join('\n')}`); - } + if (errorMsgs.length) { + throw new Error(`a11y report:\n${errorMsgs.join('\n')}`); } + } - private async captureAxeReport(context: AxeContext): Promise { - const axeOptions = { - reporter: 'v2', - runOnly: ['wcag2a', 'wcag2aa'], - rules: { - 'color-contrast': { - enabled: false, // disabled because we have too many failures - }, - bypass: { - enabled: false, // disabled because it's too flaky - }, + private async captureAxeReport(context: AxeContext): Promise { + const axeOptions = { + reporter: 'v2', + runOnly: ['wcag2a', 'wcag2aa'], + rules: { + 'color-contrast': { + enabled: false, // disabled because we have too many failures }, - }; - - await (Wd.driver.manage() as any).setTimeouts({ - ...(await (Wd.driver.manage() as any).getTimeouts()), - script: 600000, - }); + bypass: { + enabled: false, // disabled because it's too flaky + }, + }, + }; - const report = normalizeResult( - await browser.executeAsync(analyzeWithAxe, context, axeOptions) - ); + await this.Wd.driver.manage().setTimeouts({ + ...(await this.Wd.driver.manage().getTimeouts()), + script: 600000, + }); - if (report !== false) { - return report; - } + const report = normalizeResult( + await this.browser.executeAsync(analyzeWithAxe, context, axeOptions) + ); - const withClientReport = normalizeResult( - await browser.executeAsync(analyzeWithAxeWithClient, context, axeOptions) - ); + if (report !== false) { + return report; + } - if (withClientReport === false) { - throw new Error('Attempted to analyze with axe but failed to load axe client'); - } + const withClientReport = normalizeResult( + await this.browser.executeAsync(analyzeWithAxeWithClient, context, axeOptions) + ); - return withClientReport; + if (withClientReport === false) { + throw new Error('Attempted to analyze with axe but failed to load axe client'); } - })(); + + return withClientReport; + } } diff --git a/test/accessibility/services/a11y/index.ts b/test/accessibility/services/a11y/index.ts index 79912dd99d326f..642b170c4e0771 100644 --- a/test/accessibility/services/a11y/index.ts +++ b/test/accessibility/services/a11y/index.ts @@ -6,4 +6,4 @@ * Side Public License, v 1. */ -export { A11yProvider } from './a11y'; +export * from './a11y'; diff --git a/test/accessibility/services/index.ts b/test/accessibility/services/index.ts index ec3bf534590b34..ef5674d4011fbb 100644 --- a/test/accessibility/services/index.ts +++ b/test/accessibility/services/index.ts @@ -7,9 +7,9 @@ */ import { services as kibanaFunctionalServices } from '../../functional/services'; -import { A11yProvider } from './a11y'; +import { AccessibilityService } from './a11y'; export const services = { ...kibanaFunctionalServices, - a11y: A11yProvider, + a11y: AccessibilityService, }; diff --git a/test/api_integration/apis/saved_objects/migrations.ts b/test/api_integration/apis/saved_objects/migrations.ts index d009a66e9df55f..0877998ca6c1f3 100644 --- a/test/api_integration/apis/saved_objects/migrations.ts +++ b/test/api_integration/apis/saved_objects/migrations.ts @@ -87,7 +87,7 @@ export default ({ getService }: FtrProviderContext) => { const mappingProperties = { foo: { properties: { name: { type: 'text' } } }, bar: { properties: { mynum: { type: 'integer' } } }, - }; + } as const; const savedObjectTypes: SavedObjectsType[] = [ { @@ -221,7 +221,7 @@ export default ({ getService }: FtrProviderContext) => { const mappingProperties = { foo: { properties: { name: { type: 'text' } } }, bar: { properties: { mynum: { type: 'integer' } } }, - }; + } as const; let savedObjectTypes: SavedObjectsType[] = [ { @@ -357,7 +357,7 @@ export default ({ getService }: FtrProviderContext) => { const mappingProperties = { 'fleet-agent-event': { properties: { name: { type: 'text' } } }, bar: { properties: { mynum: { type: 'integer' } } }, - }; + } as const; let savedObjectTypes: SavedObjectsType[] = [ FLEET_AGENT_EVENT_TYPE, @@ -417,7 +417,7 @@ export default ({ getService }: FtrProviderContext) => { const mappingProperties = { foo: { properties: { name: { type: 'text' } } }, - }; + } as const; const savedObjectTypes: SavedObjectsType[] = [ { @@ -510,7 +510,7 @@ export default ({ getService }: FtrProviderContext) => { foo: { properties: { name: { type: 'text' } } }, bar: { properties: { nomnom: { type: 'integer' } } }, baz: { properties: { title: { type: 'keyword' } } }, - }; + } as const; const savedObjectTypes: SavedObjectsType[] = [ { @@ -677,7 +677,7 @@ async function createIndex({ coreMigrationVersion: { type: 'keyword', }, - }; + } as const; await esClient.indices.create({ index, body: { mappings: { dynamic: 'strict', properties } }, diff --git a/test/api_integration/apis/search/verify_error.ts b/test/api_integration/apis/search/verify_error.ts index d6b729f59d8d4e..1973fe4e4ab361 100644 --- a/test/api_integration/apis/search/verify_error.ts +++ b/test/api_integration/apis/search/verify_error.ts @@ -16,7 +16,7 @@ export const verifyErrorResponse = ( ) => { expect(r.statusCode).to.be(expectedCode); if (message) { - expect(r.message).to.be(message); + expect(r.message).to.include.string(message); } if (shouldHaveAttrs) { expect(r).to.have.property('attributes'); diff --git a/test/api_integration/apis/ui_counters/ui_counters.ts b/test/api_integration/apis/ui_counters/ui_counters.ts index ab3ca2e8dd3a7b..2be6ea4341fb08 100644 --- a/test/api_integration/apis/ui_counters/ui_counters.ts +++ b/test/api_integration/apis/ui_counters/ui_counters.ts @@ -15,6 +15,7 @@ import { UsageCountersSavedObject } from '../../../../src/plugins/usage_collecti export default function ({ getService }: FtrProviderContext) { const supertest = getService('supertest'); const esArchiver = getService('esArchiver'); + const retry = getService('retry'); const createUiCounterEvent = (eventName: string, type: UiCounterMetricType, count = 1) => ({ eventName, @@ -23,16 +24,24 @@ export default function ({ getService }: FtrProviderContext) { count, }); - const sendReport = async (report: Report) => { + const fetchUsageCountersObjects = async (): Promise => { + const { + body: { saved_objects: savedObjects }, + } = await supertest + .get('/api/saved_objects/_find?type=usage-counters') + .set('kbn-xsrf', 'kibana') + .expect(200); + + return savedObjects; + }; + + const sendReport = async (report: Report): Promise => { await supertest .post('/api/ui_counters/_report') .set('kbn-xsrf', 'kibana') .set('content-type', 'application/json') .send({ report }) .expect(200); - - // wait for SO to index data into ES - await new Promise((res) => setTimeout(res, 5 * 1000)); }; const getCounterById = ( @@ -47,8 +56,7 @@ export default function ({ getService }: FtrProviderContext) { return savedObject; }; - // FLAKY: https://github.com/elastic/kibana/issues/98240 - describe.skip('UI Counters API', () => { + describe('UI Counters API', () => { const dayDate = moment().format('DDMMYYYY'); before(async () => await esArchiver.emptyKibanaIndex()); @@ -61,18 +69,15 @@ export default function ({ getService }: FtrProviderContext) { await sendReport(report); - const { - body: { saved_objects: savedObjects }, - } = await supertest - .get('/api/saved_objects/_find?type=usage-counters') - .set('kbn-xsrf', 'kibana') - .expect(200); - - const countTypeEvent = getCounterById( - savedObjects, - `uiCounter:${dayDate}:${METRIC_TYPE.COUNT}:myApp:my_event` - ); - expect(countTypeEvent.attributes.count).to.eql(1); + await retry.waitForWithTimeout('reported events to be stored into ES', 8000, async () => { + const savedObjects = await fetchUsageCountersObjects(); + const countTypeEvent = getCounterById( + savedObjects, + `uiCounter:${dayDate}:${METRIC_TYPE.COUNT}:myApp:my_event` + ); + expect(countTypeEvent.attributes.count).to.eql(1); + return true; + }); }); it('supports multiple events', async () => { @@ -87,31 +92,27 @@ export default function ({ getService }: FtrProviderContext) { ]); await sendReport(report); - - const { - body: { saved_objects: savedObjects }, - } = await supertest - .get('/api/saved_objects/_find?type=usage-counters&fields=count') - .set('kbn-xsrf', 'kibana') - .expect(200); - - const countTypeEvent = getCounterById( - savedObjects, - `uiCounter:${dayDate}:${METRIC_TYPE.COUNT}:myApp:${uniqueEventName}` - ); - expect(countTypeEvent.attributes.count).to.eql(1); - - const clickTypeEvent = getCounterById( - savedObjects, - `uiCounter:${dayDate}:${METRIC_TYPE.CLICK}:myApp:${uniqueEventName}` - ); - expect(clickTypeEvent.attributes.count).to.eql(2); - - const secondEvent = getCounterById( - savedObjects, - `uiCounter:${dayDate}:${METRIC_TYPE.COUNT}:myApp:${uniqueEventName}_2` - ); - expect(secondEvent.attributes.count).to.eql(1); + await retry.waitForWithTimeout('reported events to be stored into ES', 8000, async () => { + const savedObjects = await fetchUsageCountersObjects(); + const countTypeEvent = getCounterById( + savedObjects, + `uiCounter:${dayDate}:${METRIC_TYPE.COUNT}:myApp:${uniqueEventName}` + ); + expect(countTypeEvent.attributes.count).to.eql(1); + + const clickTypeEvent = getCounterById( + savedObjects, + `uiCounter:${dayDate}:${METRIC_TYPE.CLICK}:myApp:${uniqueEventName}` + ); + expect(clickTypeEvent.attributes.count).to.eql(2); + + const secondEvent = getCounterById( + savedObjects, + `uiCounter:${dayDate}:${METRIC_TYPE.COUNT}:myApp:${uniqueEventName}_2` + ); + expect(secondEvent.attributes.count).to.eql(1); + return true; + }); }); }); } diff --git a/test/common/services/saved_object_info.ts b/test/common/services/saved_object_info.ts index 1558b364f53916..2be17636508942 100644 --- a/test/common/services/saved_object_info.ts +++ b/test/common/services/saved_object_info.ts @@ -8,7 +8,7 @@ import { inspect } from 'util'; -import { TermsAggregate } from '@elastic/elasticsearch/api/types'; +import type { estypes } from '@elastic/elasticsearch'; import { FtrService } from '../ftr_provider_context'; @@ -32,7 +32,7 @@ export class SavedObjectInfoService extends FtrService { }); const agg = body.aggregations?.savedobjs as - | TermsAggregate<{ key: string; doc_count: number }> + | estypes.AggregationsTermsAggregate<{ key: string; doc_count: number }> | undefined; if (!agg?.buckets) { diff --git a/test/examples/embeddables/dashboard.ts b/test/examples/embeddables/dashboard.ts index 597846ab6a43d4..69788ebad2af2f 100644 --- a/test/examples/embeddables/dashboard.ts +++ b/test/examples/embeddables/dashboard.ts @@ -97,7 +97,8 @@ export default function ({ getService, getPageObjects }: PluginFunctionalProvide const pieChart = getService('pieChart'); const browser = getService('browser'); const dashboardExpect = getService('dashboardExpect'); - const PageObjects = getPageObjects(['common']); + const elasticChart = getService('elasticChart'); + const PageObjects = getPageObjects(['common', 'visChart']); describe('dashboard container', () => { before(async () => { @@ -109,6 +110,9 @@ export default function ({ getService, getPageObjects }: PluginFunctionalProvide }); it('pie charts', async () => { + if (await PageObjects.visChart.isNewChartsLibraryEnabled()) { + await elasticChart.setNewChartUiDebugFlag(); + } await pieChart.expectPieSliceCount(5); }); diff --git a/test/functional/apps/dashboard/dashboard_state.ts b/test/functional/apps/dashboard/dashboard_state.ts index acb2bd869819d4..047681e1a8ace7 100644 --- a/test/functional/apps/dashboard/dashboard_state.ts +++ b/test/functional/apps/dashboard/dashboard_state.ts @@ -34,6 +34,13 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const dashboardPanelActions = getService('dashboardPanelActions'); const dashboardAddPanel = getService('dashboardAddPanel'); + const enableNewChartLibraryDebug = async () => { + if (await PageObjects.visChart.isNewChartsLibraryEnabled()) { + await elasticChart.setNewChartUiDebugFlag(); + await queryBar.submitQuery(); + } + }; + describe('dashboard state', function describeIndexTests() { // Used to track flag before and after reset let isNewChartsLibraryEnabled = false; @@ -84,10 +91,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.dashboard.gotoDashboardLandingPage(); await PageObjects.dashboard.loadSavedDashboard(dashboarName); - if (await PageObjects.visChart.isNewChartsLibraryEnabled()) { - await elasticChart.setNewChartUiDebugFlag(); - await queryBar.submitQuery(); - } + await enableNewChartLibraryDebug(); const colorChoiceRetained = await PageObjects.visChart.doesSelectedLegendColorExist( overwriteColor @@ -149,11 +153,11 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('Saved search will update when the query is changed in the URL', async () => { const currentQuery = await queryBar.getQueryString(); expect(currentQuery).to.equal(''); - const currentUrl = await browser.getCurrentUrl(); - const newUrl = currentUrl.replace('query:%27%27', 'query:%27abc12345678910%27'); - // Don't add the timestamp to the url or it will cause a hard refresh and we want to test a - // soft refresh. - await browser.get(newUrl.toString(), false); + const currentUrl = await getUrlFromShare(); + const newUrl = currentUrl.replace(`query:''`, `query:'abc12345678910'`); + + // We need to add a timestamp to the URL because URL changes now only work with a hard refresh. + await browser.get(newUrl.toString()); await PageObjects.header.waitUntilLoadingHasFinished(); const headers = await PageObjects.discover.getColumnHeaders(); @@ -200,20 +204,34 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { return sharedUrl; }; + const hardRefresh = async (newUrl: string) => { + // We need to add a timestamp to the URL because URL changes now only work with a hard refresh. + await browser.get(newUrl.toString()); + const alert = await browser.getAlert(); + await alert?.accept(); + await enableNewChartLibraryDebug(); + await PageObjects.dashboard.waitForRenderComplete(); + }; + describe('Directly modifying url updates dashboard state', () => { - it('for query parameter', async function () { + before(async () => { await PageObjects.dashboard.gotoDashboardLandingPage(); await PageObjects.dashboard.clickNewDashboard(); + await PageObjects.timePicker.setHistoricalDataRange(); + }); + it('for query parameter', async function () { const currentQuery = await queryBar.getQueryString(); expect(currentQuery).to.equal(''); - const currentUrl = await browser.getCurrentUrl(); - const newUrl = currentUrl.replace('query:%27%27', 'query:%27hi%27'); - // Don't add the timestamp to the url or it will cause a hard refresh and we want to test a - // soft refresh. - await browser.get(newUrl.toString(), false); + const currentUrl = await getUrlFromShare(); + const newUrl = currentUrl.replace(`query:''`, `query:'hi:hello'`); + + // We need to add a timestamp to the URL because URL changes now only work with a hard refresh. + await browser.get(newUrl.toString()); const newQuery = await queryBar.getQueryString(); - expect(newQuery).to.equal('hi'); + expect(newQuery).to.equal('hi:hello'); + await queryBar.clearQuery(); + await queryBar.clickQuerySubmitButton(); }); it('for panel size parameters', async function () { @@ -224,7 +242,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { `w:${DEFAULT_PANEL_WIDTH}`, `w:${DEFAULT_PANEL_WIDTH * 2}` ); - await browser.get(newUrl.toString(), false); + await hardRefresh(newUrl); + await retry.try(async () => { const newPanelDimensions = await PageObjects.dashboard.getPanelDimensions(); if (newPanelDimensions.length < 0) { @@ -247,7 +266,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.dashboard.waitForRenderComplete(); const currentUrl = await getUrlFromShare(); const newUrl = currentUrl.replace(/panels:\!\(.*\),query/, 'panels:!(),query'); - await browser.get(newUrl.toString(), false); + await hardRefresh(newUrl); await retry.try(async () => { const newPanelCount = await PageObjects.dashboard.getPanelCount(); @@ -256,8 +275,15 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); describe('for embeddable config color parameters on a visualization', () => { - it('updates a pie slice color on a soft refresh', async function () { + let originalPieSliceStyle = ''; + + before(async () => { await dashboardAddPanel.addVisualization(PIE_CHART_VIS_NAME); + await enableNewChartLibraryDebug(); + originalPieSliceStyle = await pieChart.getPieSliceStyle(`80,000`); + }); + + it('updates a pie slice color on a hard refresh', async function () { await PageObjects.visChart.openLegendOptionColors( '80,000', `[data-title="${PIE_CHART_VIS_NAME}"]` @@ -265,14 +291,14 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.visChart.selectNewLegendColorChoice('#F9D9F9'); const currentUrl = await getUrlFromShare(); const newUrl = currentUrl.replace('F9D9F9', 'FFFFFF'); - await browser.get(newUrl.toString(), false); + await hardRefresh(newUrl); await PageObjects.header.waitUntilLoadingHasFinished(); await retry.try(async () => { const allPieSlicesColor = await pieChart.getAllPieSliceStyles('80,000'); let whitePieSliceCounts = 0; allPieSlicesColor.forEach((style) => { - if (style.indexOf('rgb(255, 255, 255)') > 0) { + if (style.indexOf('rgb(255, 255, 255)') > -1) { whitePieSliceCounts++; } }); @@ -290,14 +316,18 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('resets a pie slice color to the original when removed', async function () { const currentUrl = await getUrlFromShare(); - const newUrl = currentUrl.replace(`vis:(colors:('80,000':%23FFFFFF))`, ''); - await browser.get(newUrl.toString(), false); + const newUrl = isNewChartsLibraryEnabled + ? currentUrl.replace(`'80000':%23FFFFFF`, '') + : currentUrl.replace(`vis:(colors:('80,000':%23FFFFFF))`, ''); + + await hardRefresh(newUrl); await PageObjects.header.waitUntilLoadingHasFinished(); await retry.try(async () => { - const pieSliceStyle = await pieChart.getPieSliceStyle(`80,000`); - // The default green color that was stored with the visualization before any dashboard overrides. - expect(pieSliceStyle.indexOf('rgb(87, 193, 123)')).to.be.greaterThan(0); + const pieSliceStyle = await pieChart.getPieSliceStyle('80,000'); + + // After removing all overrides, pie slice style should match original. + expect(pieSliceStyle).to.be(originalPieSliceStyle); }); }); diff --git a/test/functional/apps/dashboard/panel_expand_toggle.ts b/test/functional/apps/dashboard/panel_expand_toggle.ts index 45642542cc0aca..256109c669138a 100644 --- a/test/functional/apps/dashboard/panel_expand_toggle.ts +++ b/test/functional/apps/dashboard/panel_expand_toggle.ts @@ -12,7 +12,6 @@ import { FtrProviderContext } from '../../ftr_provider_context'; export default function ({ getService, getPageObjects }: FtrProviderContext) { const retry = getService('retry'); - const browser = getService('browser'); const esArchiver = getService('esArchiver'); const kibanaServer = getService('kibanaServer'); const dashboardPanelActions = getService('dashboardPanelActions'); @@ -53,18 +52,5 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { expect(panelCountAfterMaxThenMinimize).to.be(panelCount); }); }); - - it('minimizes using the browser back button', async () => { - const panelCount = await PageObjects.dashboard.getPanelCount(); - - await dashboardPanelActions.openContextMenu(); - await dashboardPanelActions.clickExpandPanelToggle(); - - await browser.goBack(); - await retry.try(async () => { - const panelCountAfterMaxThenMinimize = await PageObjects.dashboard.getPanelCount(); - expect(panelCountAfterMaxThenMinimize).to.be(panelCount); - }); - }); }); } diff --git a/test/functional/apps/dashboard/view_edit.ts b/test/functional/apps/dashboard/view_edit.ts index 99a78ebd069c5d..9a883c5a527ff9 100644 --- a/test/functional/apps/dashboard/view_edit.ts +++ b/test/functional/apps/dashboard/view_edit.ts @@ -15,7 +15,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const esArchiver = getService('esArchiver'); const kibanaServer = getService('kibanaServer'); const dashboardAddPanel = getService('dashboardAddPanel'); - const testSubjects = getService('testSubjects'); const PageObjects = getPageObjects(['dashboard', 'header', 'common', 'visualize', 'timePicker']); const dashboardName = 'dashboard with filter'; const filterBar = getService('filterBar'); @@ -33,7 +32,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('create new dashboard opens in edit mode', async function () { await PageObjects.dashboard.gotoDashboardLandingPage(); await PageObjects.dashboard.clickNewDashboard(); - await PageObjects.dashboard.clickCancelOutOfEditMode(); + const isInViewMode = await PageObjects.dashboard.getIsInViewMode(); + expect(isInViewMode).to.be(false); }); it('existing dashboard opens in view mode', async function () { @@ -72,7 +72,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { 'Sep 19, 2013 @ 06:31:44.000', 'Sep 19, 2013 @ 06:31:44.000' ); - await PageObjects.dashboard.clickDiscardChanges(); + await PageObjects.dashboard.clickCancelOutOfEditMode(); const newTime = await PageObjects.timePicker.getTimeConfig(); @@ -85,7 +85,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await queryBar.setQuery(`${originalQuery}and extra stuff`); await queryBar.submitQuery(); - await PageObjects.dashboard.clickDiscardChanges(); + await PageObjects.dashboard.clickCancelOutOfEditMode(); const query = await queryBar.getQueryString(); expect(query).to.equal(originalQuery); @@ -105,7 +105,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { hasFilter = await filterBar.hasFilter('animal', 'dog'); expect(hasFilter).to.be(false); - await PageObjects.dashboard.clickDiscardChanges(); + await PageObjects.dashboard.clickCancelOutOfEditMode(); hasFilter = await filterBar.hasFilter('animal', 'dog'); expect(hasFilter).to.be(true); @@ -122,13 +122,12 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { redirectToOrigin: true, }); - await PageObjects.dashboard.clickDiscardChanges(false); + await PageObjects.dashboard.clickCancelOutOfEditMode(false); // for this sleep see https://github.com/elastic/kibana/issues/22299 await PageObjects.common.sleep(500); // confirm lose changes - await testSubjects.exists('dashboardDiscardConfirmDiscard'); - await testSubjects.click('dashboardDiscardConfirmDiscard'); + await PageObjects.common.clickConfirmOnModal(); const panelCount = await PageObjects.dashboard.getPanelCount(); expect(panelCount).to.eql(originalPanelCount); @@ -138,7 +137,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const originalPanelCount = await PageObjects.dashboard.getPanelCount(); await dashboardAddPanel.addVisualization('new viz panel'); - await PageObjects.dashboard.clickDiscardChanges(); + await PageObjects.dashboard.clickCancelOutOfEditMode(); const panelCount = await PageObjects.dashboard.getPanelCount(); expect(panelCount).to.eql(originalPanelCount); @@ -158,10 +157,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { 'Sep 19, 2015 @ 06:31:44.000', 'Sep 19, 2015 @ 06:31:44.000' ); - await PageObjects.dashboard.clickDiscardChanges(false); + await PageObjects.dashboard.clickCancelOutOfEditMode(false); - await testSubjects.exists('dashboardDiscardConfirmCancel'); - await testSubjects.click('dashboardDiscardConfirmCancel'); + await PageObjects.common.clickCancelOnModal(); await PageObjects.dashboard.saveDashboard(dashboardName, { storeTimeWithDashboard: true, }); @@ -188,10 +186,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { ); const newTime = await PageObjects.timePicker.getTimeConfig(); - await PageObjects.dashboard.clickDiscardChanges(false); + await PageObjects.dashboard.clickCancelOutOfEditMode(false); - await testSubjects.exists('dashboardDiscardConfirmCancel'); - await testSubjects.click('dashboardDiscardConfirmCancel'); + await PageObjects.common.clickCancelOnModal(); await PageObjects.dashboard.saveDashboard(dashboardName, { storeTimeWithDashboard: true }); await PageObjects.dashboard.loadSavedDashboard(dashboardName); diff --git a/test/functional/apps/discover/_discover.ts b/test/functional/apps/discover/_discover.ts index 8ed54f88afea3a..b5279eaaa1f122 100644 --- a/test/functional/apps/discover/_discover.ts +++ b/test/functional/apps/discover/_discover.ts @@ -327,10 +327,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const intervalS = 5; await PageObjects.timePicker.startAutoRefresh(intervalS); - // check inspector panel request stats for timestamp - await inspector.open(); - const getRequestTimestamp = async () => { + // check inspector panel request stats for timestamp + await inspector.open(); const requestStats = await inspector.getTableData(); const requestStatsRow = requestStats.filter( (r) => r && r[0] && r[0].includes('Request timestamp') @@ -338,6 +337,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { if (!requestStatsRow || !requestStatsRow[0] || !requestStatsRow[0][1]) { return ''; } + await inspector.close(); return requestStatsRow[0][1]; }; diff --git a/test/functional/apps/discover/_indexpattern_without_timefield.ts b/test/functional/apps/discover/_indexpattern_without_timefield.ts index cef02a0f54f052..a1050222937ece 100644 --- a/test/functional/apps/discover/_indexpattern_without_timefield.ts +++ b/test/functional/apps/discover/_indexpattern_without_timefield.ts @@ -5,7 +5,7 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ - +import expect from '@kbn/expect'; import { FtrProviderContext } from '../../ftr_provider_context'; export default function ({ getService, getPageObjects }: FtrProviderContext) { @@ -13,18 +13,24 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const esArchiver = getService('esArchiver'); const kibanaServer = getService('kibanaServer'); const security = getService('security'); + const testSubjects = getService('testSubjects'); const PageObjects = getPageObjects(['common', 'timePicker', 'discover']); describe('indexpattern without timefield', () => { before(async () => { await security.testUser.setRoles(['kibana_admin', 'kibana_timefield']); await esArchiver.loadIfNeeded('index_pattern_without_timefield'); - await kibanaServer.uiSettings.replace({ defaultIndex: 'without-timefield' }); + await kibanaServer.uiSettings.replace({ + defaultIndex: 'without-timefield', + 'timepicker:timeDefaults': '{ "from": "2019-01-18T19:37:13.000Z", "to": "now"}', + }); await PageObjects.common.navigateToApp('discover'); }); after(async () => { await security.testUser.restoreDefaults(); + await kibanaServer.uiSettings.unset('timepicker:timeDefaults'); + await kibanaServer.uiSettings.unset('defaultIndex'); await esArchiver.unload('index_pattern_without_timefield'); }); @@ -34,6 +40,16 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { } }); + it('should adapt sidebar fields when switching', async () => { + await PageObjects.discover.selectIndexPattern('with-timefield'); + const timefieldExistsWithTimefield = await testSubjects.exists('field-@timestamp'); + expect(timefieldExistsWithTimefield).to.be(true); + await PageObjects.discover.selectIndexPattern('without-timefield'); + await PageObjects.discover.waitForDocTableLoadingComplete(); + const timefieldExistsWithoutTimefield = await testSubjects.exists('field-@timestamp'); + expect(timefieldExistsWithoutTimefield).to.be(false); + }); + it('should display a timepicker after switching to an index pattern with timefield', async () => { await PageObjects.discover.selectIndexPattern('with-timefield'); if (!(await PageObjects.timePicker.timePickerExists())) { diff --git a/test/functional/apps/discover/_inspector.ts b/test/functional/apps/discover/_inspector.ts index ca8539df9a9260..85bd163bdc50ca 100644 --- a/test/functional/apps/discover/_inspector.ts +++ b/test/functional/apps/discover/_inspector.ts @@ -20,7 +20,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const STATS_ROW_VALUE_INDEX = 1; function getHitCount(requestStats: string[][]): string | undefined { const hitsCountStatsRow = requestStats.find((statsRow) => { - return statsRow[STATS_ROW_NAME_INDEX] === 'Hits (total)'; + return statsRow[STATS_ROW_NAME_INDEX] === 'Hits'; }); if (!hitsCountStatsRow) { @@ -61,7 +61,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await inspector.open(); const requestStats = await inspector.getTableData(); - expect(getHitCount(requestStats)).to.be('14004'); + expect(getHitCount(requestStats)).to.be('500'); }); }); } diff --git a/test/functional/apps/discover/_runtime_fields_editor.ts b/test/functional/apps/discover/_runtime_fields_editor.ts index 62045e3c9a6b17..407b74c4fd0188 100644 --- a/test/functional/apps/discover/_runtime_fields_editor.ts +++ b/test/functional/apps/discover/_runtime_fields_editor.ts @@ -56,7 +56,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('allows creation of a new field', async function () { await createRuntimeField('runtimefield'); await PageObjects.header.waitUntilLoadingHasFinished(); - expect((await PageObjects.discover.getAllFieldNames()).includes('runtimefield')).to.be(true); + await retry.waitFor('fieldNames to include runtimefield', async () => { + const fieldNames = await PageObjects.discover.getAllFieldNames(); + return fieldNames.includes('runtimefield'); + }); }); it('allows editing of a newly created field', async function () { @@ -65,10 +68,11 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await fieldEditor.save(); await fieldEditor.confirmSave(); await PageObjects.header.waitUntilLoadingHasFinished(); - expect((await PageObjects.discover.getAllFieldNames()).includes('runtimefield')).to.be(false); - expect((await PageObjects.discover.getAllFieldNames()).includes('runtimefield edited')).to.be( - true - ); + + await retry.waitFor('fieldNames to include edits', async () => { + const fieldNames = await PageObjects.discover.getAllFieldNames(); + return fieldNames.includes('runtimefield edited'); + }); }); it('allows creation of a new field and use it in a saved search', async function () { @@ -94,7 +98,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.discover.removeField('delete'); await fieldEditor.confirmDelete(); await PageObjects.header.waitUntilLoadingHasFinished(); - expect((await PageObjects.discover.getAllFieldNames()).includes('delete')).to.be(false); + await retry.waitFor('fieldNames to include edits', async () => { + const fieldNames = await PageObjects.discover.getAllFieldNames(); + return !fieldNames.includes('delete'); + }); }); it('doc view includes runtime fields', async function () { diff --git a/test/functional/apps/management/_kibana_settings.js b/test/functional/apps/management/_kibana_settings.js index 43f6631efb5c13..cfe4e88cda21de 100644 --- a/test/functional/apps/management/_kibana_settings.js +++ b/test/functional/apps/management/_kibana_settings.js @@ -37,14 +37,9 @@ export default function ({ getService, getPageObjects }) { describe('state:storeInSessionStorage', () => { async function getStateFromUrl() { const currentUrl = await browser.getCurrentUrl(); - let match = currentUrl.match(/(.*)?_g=(.*)&_a=(.*)/); - if (match) return [match[2], match[3]]; - match = currentUrl.match(/(.*)?_a=(.*)&_g=(.*)/); - if (match) return [match[3], match[2]]; - - if (!match) { - throw new Error('State in url is missing or malformed: ' + currentUrl); - } + const match = currentUrl.match(/(.*)?_g=(.*)/); + if (match) return match[2]; + throw new Error('State in url is missing or malformed: ' + currentUrl); } it('defaults to null', async () => { @@ -59,12 +54,11 @@ export default function ({ getService, getPageObjects }) { await PageObjects.common.navigateToApp('dashboard'); await PageObjects.dashboard.clickNewDashboard(); await PageObjects.timePicker.setDefaultAbsoluteRange(); - const [globalState, appState] = await getStateFromUrl(); + const globalState = await getStateFromUrl(); // We don't have to be exact, just need to ensure it's greater than when the hashed variation is being used, // which is less than 20 characters. expect(globalState.length).to.be.greaterThan(20); - expect(appState.length).to.be.greaterThan(20); }); it('setting to true change is preserved', async function () { @@ -81,12 +75,11 @@ export default function ({ getService, getPageObjects }) { await PageObjects.common.navigateToApp('dashboard'); await PageObjects.dashboard.clickNewDashboard(); await PageObjects.timePicker.setDefaultAbsoluteRange(); - const [globalState, appState] = await getStateFromUrl(); + const globalState = await getStateFromUrl(); // We don't have to be exact, just need to ensure it's less than the unhashed version, which will be // greater than 20 characters with the default state plus a time. expect(globalState.length).to.be.lessThan(20); - expect(appState.length).to.be.lessThan(20); }); it("changing 'state:storeInSessionStorage' also takes effect without full page reload", async () => { @@ -95,11 +88,10 @@ export default function ({ getService, getPageObjects }) { await PageObjects.settings.clickKibanaSettings(); await PageObjects.settings.toggleAdvancedSettingCheckbox('state:storeInSessionStorage'); await PageObjects.header.clickDashboard(); - const [globalState, appState] = await getStateFromUrl(); + const globalState = await getStateFromUrl(); // We don't have to be exact, just need to ensure it's greater than when the hashed variation is being used, // which is less than 20 characters. expect(globalState.length).to.be.greaterThan(20); - expect(appState.length).to.be.greaterThan(20); }); }); diff --git a/test/functional/apps/visualize/_area_chart.ts b/test/functional/apps/visualize/_area_chart.ts index 99f65458bb6063..be777607c78361 100644 --- a/test/functional/apps/visualize/_area_chart.ts +++ b/test/functional/apps/visualize/_area_chart.ts @@ -34,8 +34,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { ); describe('area charts', function indexPatternCreation() { + let isNewChartsLibraryEnabled = false; before(async () => { - await PageObjects.visualize.initTests(); + isNewChartsLibraryEnabled = await PageObjects.visChart.isNewChartsLibraryEnabled(); + await PageObjects.visualize.initTests(isNewChartsLibraryEnabled); }); const initAreaChart = async () => { log.debug('navigateToApp visualize'); diff --git a/test/functional/apps/visualize/_line_chart_split_chart.ts b/test/functional/apps/visualize/_line_chart_split_chart.ts index 91c1db533cee9b..9b1c12de9666e4 100644 --- a/test/functional/apps/visualize/_line_chart_split_chart.ts +++ b/test/functional/apps/visualize/_line_chart_split_chart.ts @@ -25,6 +25,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { ]); describe('line charts - split chart', function () { + let isNewChartsLibraryEnabled = false; const initLineChart = async function () { log.debug('navigateToApp visualize'); await PageObjects.visualize.navigateToNewAggBasedVisualization(); @@ -44,7 +45,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }; before(async () => { - await PageObjects.visualize.initTests(); + isNewChartsLibraryEnabled = await PageObjects.visChart.isNewChartsLibraryEnabled(); + await PageObjects.visualize.initTests(isNewChartsLibraryEnabled); await initLineChart(); }); diff --git a/test/functional/apps/visualize/_line_chart_split_series.ts b/test/functional/apps/visualize/_line_chart_split_series.ts index 6630690b89c2c1..1c4b34b855cdea 100644 --- a/test/functional/apps/visualize/_line_chart_split_series.ts +++ b/test/functional/apps/visualize/_line_chart_split_series.ts @@ -25,6 +25,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { ]); describe('line charts - split series', function () { + let isNewChartsLibraryEnabled = false; const initLineChart = async function () { log.debug('navigateToApp visualize'); await PageObjects.visualize.navigateToNewAggBasedVisualization(); @@ -42,7 +43,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }; before(async () => { - await PageObjects.visualize.initTests(); + isNewChartsLibraryEnabled = await PageObjects.visChart.isNewChartsLibraryEnabled(); + await PageObjects.visualize.initTests(isNewChartsLibraryEnabled); await initLineChart(); }); diff --git a/test/functional/apps/visualize/_pie_chart.ts b/test/functional/apps/visualize/_pie_chart.ts index dd58ca6514c362..744ba3caa719e4 100644 --- a/test/functional/apps/visualize/_pie_chart.ts +++ b/test/functional/apps/visualize/_pie_chart.ts @@ -15,6 +15,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const filterBar = getService('filterBar'); const pieChart = getService('pieChart'); const inspector = getService('inspector'); + const PageObjects = getPageObjects([ 'common', 'visualize', @@ -25,9 +26,13 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { ]); describe('pie chart', function () { + // Used to track flag before and after reset + let isNewChartsLibraryEnabled = false; const vizName1 = 'Visualization PieChart'; before(async function () { - await PageObjects.visualize.initTests(); + isNewChartsLibraryEnabled = await PageObjects.visChart.isNewChartsLibraryEnabled(); + await PageObjects.visualize.initTests(isNewChartsLibraryEnabled); + log.debug('navigateToApp visualize'); await PageObjects.visualize.navigateToNewAggBasedVisualization(); log.debug('clickPieChart'); @@ -84,7 +89,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { describe('other bucket', () => { it('should show other and missing bucket', async function () { - const expectedTableData = ['win 8', 'win xp', 'win 7', 'ios', 'Missing', 'Other']; + const expectedTableData = ['Missing', 'Other', 'ios', 'win 7', 'win 8', 'win xp']; await PageObjects.visualize.navigateToNewAggBasedVisualization(); log.debug('clickPieChart'); @@ -168,7 +173,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { 'ID', 'BR', 'Other', - ]; + ].sort(); await PageObjects.visEditor.toggleOpenEditor(2, 'false'); await PageObjects.visEditor.clickBucket('Split slices'); @@ -190,7 +195,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); it('should show correct result with one agg disabled', async () => { - const expectedTableData = ['win 8', 'win xp', 'win 7', 'ios', 'osx']; + const expectedTableData = ['ios', 'osx', 'win 7', 'win 8', 'win xp']; await PageObjects.visEditor.clickBucket('Split slices'); await PageObjects.visEditor.selectAggregation('Terms'); @@ -207,7 +212,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.visualize.loadSavedVisualization(vizName1); await PageObjects.visChart.waitForRenderingCount(); - const expectedTableData = ['win 8', 'win xp', 'win 7', 'ios', 'osx']; + const expectedTableData = ['ios', 'osx', 'win 7', 'win 8', 'win xp']; await pieChart.expectPieChartLabels(expectedTableData); }); @@ -276,7 +281,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { 'ios', 'win 8', 'osx', - ]; + ].sort(); await pieChart.expectPieChartLabels(expectedTableData); }); @@ -426,7 +431,14 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { 'CN', '360,000', 'CN', - ]; + ].sort(); + if (await PageObjects.visChart.isNewLibraryChart('visTypePieChart')) { + await PageObjects.visEditor.clickOptionsTab(); + await PageObjects.visEditor.togglePieLegend(); + await PageObjects.visEditor.togglePieNestedLegend(); + await PageObjects.visEditor.clickDataTab(); + await PageObjects.visEditor.clickGo(); + } await PageObjects.visChart.filterLegend('CN'); await PageObjects.visChart.waitForVisualization(); await pieChart.expectPieChartLabels(expectedTableData); diff --git a/test/functional/apps/visualize/_point_series_options.ts b/test/functional/apps/visualize/_point_series_options.ts index b81feaf29e1945..ee64fdf7ddda3b 100644 --- a/test/functional/apps/visualize/_point_series_options.ts +++ b/test/functional/apps/visualize/_point_series_options.ts @@ -60,9 +60,11 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.visEditor.clickGo(); } - describe('vlad point series', function describeIndexTests() { + describe('point series', function describeIndexTests() { + let isNewChartsLibraryEnabled = false; before(async () => { - await PageObjects.visualize.initTests(); + isNewChartsLibraryEnabled = await PageObjects.visChart.isNewChartsLibraryEnabled(); + await PageObjects.visualize.initTests(isNewChartsLibraryEnabled); await initChart(); }); diff --git a/test/functional/apps/visualize/_vertical_bar_chart.ts b/test/functional/apps/visualize/_vertical_bar_chart.ts index 1fe0d2f9a955bd..a728757a485e1a 100644 --- a/test/functional/apps/visualize/_vertical_bar_chart.ts +++ b/test/functional/apps/visualize/_vertical_bar_chart.ts @@ -19,8 +19,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const PageObjects = getPageObjects(['visualize', 'visEditor', 'visChart', 'timePicker']); describe('vertical bar chart', function () { + let isNewChartsLibraryEnabled = false; before(async () => { - await PageObjects.visualize.initTests(); + isNewChartsLibraryEnabled = await PageObjects.visChart.isNewChartsLibraryEnabled(); + await PageObjects.visualize.initTests(isNewChartsLibraryEnabled); }); const vizName1 = 'Visualization VerticalBarChart'; diff --git a/test/functional/apps/visualize/_vertical_bar_chart_nontimeindex.ts b/test/functional/apps/visualize/_vertical_bar_chart_nontimeindex.ts index 5f066e96c6e7cf..97817315b5801f 100644 --- a/test/functional/apps/visualize/_vertical_bar_chart_nontimeindex.ts +++ b/test/functional/apps/visualize/_vertical_bar_chart_nontimeindex.ts @@ -18,6 +18,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { describe('vertical bar chart with index without time filter', function () { const vizName1 = 'Visualization VerticalBarChart without time filter'; + let isNewChartsLibraryEnabled = false; const initBarChart = async () => { log.debug('navigateToApp visualize'); @@ -40,7 +41,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }; before(async () => { - await PageObjects.visualize.initTests(); + isNewChartsLibraryEnabled = await PageObjects.visChart.isNewChartsLibraryEnabled(); + await PageObjects.visualize.initTests(isNewChartsLibraryEnabled); await initBarChart(); }); diff --git a/test/functional/apps/visualize/index.ts b/test/functional/apps/visualize/index.ts index b87184bab3c0d7..1e0e12a7d31bba 100644 --- a/test/functional/apps/visualize/index.ts +++ b/test/functional/apps/visualize/index.ts @@ -49,6 +49,7 @@ export default function ({ getService, loadTestFile }: FtrProviderContext) { loadTestFile(require.resolve('./_point_series_options')); loadTestFile(require.resolve('./_vertical_bar_chart')); loadTestFile(require.resolve('./_vertical_bar_chart_nontimeindex')); + loadTestFile(require.resolve('./_pie_chart')); }); describe('visualize ciGroup9', function () { diff --git a/test/functional/fixtures/es_archiver/index_pattern_without_timefield/data.json b/test/functional/fixtures/es_archiver/index_pattern_without_timefield/data.json index 9493408a30040d..0888079ec7c52c 100644 --- a/test/functional/fixtures/es_archiver/index_pattern_without_timefield/data.json +++ b/test/functional/fixtures/es_archiver/index_pattern_without_timefield/data.json @@ -5,7 +5,7 @@ "index": ".kibana", "source": { "index-pattern": { - "fields": "[{\"name\":\"referer\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"agent\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.og:image:width\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.og:type\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"xss.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"headings.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.og:description\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"meta.user.lastname\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.article:tag.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"geo.dest\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.twitter:image\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.article:section.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"utc_time\",\"type\":\"date\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.twitter:card\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"meta.char\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"clientip\",\"type\":\"ip\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.og:image:height\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"host\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"machine.ram\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"links\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"id\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"@tags.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"phpmemory\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.twitter:card.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"ip\",\"type\":\"ip\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.og:image\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.article:modified_time\",\"type\":\"date\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"index\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.url\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.og:site_name.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"request.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.article:tag\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"agent.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"spaces\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.twitter:site.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"headings\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"_source\",\"type\":\"_source\",\"count\":0,\"scripted\":false,\"indexed\":false,\"analyzed\":false,\"doc_values\":false},{\"name\":\"relatedContent.og:image.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"request\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"index.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"extension\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"memory\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"_index\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":false,\"analyzed\":false,\"doc_values\":false},{\"name\":\"relatedContent.twitter:site\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.twitter:description\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.og:url\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"geo.coordinates\",\"type\":\"geo_point\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.url.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"meta.related\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.twitter:title.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.og:title.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"response.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"@message.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"machine.os\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.article:section\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.og:url.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"xss\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"links.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.og:title\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"geo.srcdest\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"url.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"extension.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"machine.os.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"@tags\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"host.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.og:type.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"geo.src\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"spaces.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.og:image:height.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"url\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.twitter:description.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.og:site_name\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.twitter:title\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"@message\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.twitter:image.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"@timestamp\",\"type\":\"date\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"bytes\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"response\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"meta.user.firstname\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.og:image:width.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.og:description.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.article:published_time\",\"type\":\"date\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"_id\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":false,\"analyzed\":false,\"doc_values\":false},{\"name\":\"_type\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":false,\"analyzed\":false,\"doc_values\":false},{\"name\":\"_score\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"indexed\":false,\"analyzed\":false,\"doc_values\":false}]", + "fields": "[]", "title": "without-timefield" }, "type": "index-pattern" @@ -20,7 +20,6 @@ "index": "without-timefield", "source": { "@message" : "5", - "@timestamp": "2019-09-22T23:50:13.253Z", "referer": "http://twitter.com/error/takuya-onishi", "request": "/uploads/dafydd-williams.jpg", "response": "200", @@ -37,7 +36,7 @@ "index": ".kibana", "source": { "index-pattern": { - "fields": "[{\"name\":\"referer\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"agent\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.og:image:width\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.og:type\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"xss.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"headings.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.og:description\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"meta.user.lastname\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.article:tag.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"geo.dest\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.twitter:image\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.article:section.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"utc_time\",\"type\":\"date\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.twitter:card\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"meta.char\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"clientip\",\"type\":\"ip\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.og:image:height\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"host\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"machine.ram\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"links\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"id\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"@tags.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"phpmemory\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.twitter:card.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"ip\",\"type\":\"ip\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.og:image\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.article:modified_time\",\"type\":\"date\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"index\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.url\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.og:site_name.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"request.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.article:tag\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"agent.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"spaces\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.twitter:site.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"headings\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"_source\",\"type\":\"_source\",\"count\":0,\"scripted\":false,\"indexed\":false,\"analyzed\":false,\"doc_values\":false},{\"name\":\"relatedContent.og:image.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"request\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"index.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"extension\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"memory\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"_index\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":false,\"analyzed\":false,\"doc_values\":false},{\"name\":\"relatedContent.twitter:site\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.twitter:description\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.og:url\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"geo.coordinates\",\"type\":\"geo_point\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.url.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"meta.related\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.twitter:title.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.og:title.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"response.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"@message.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"machine.os\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.article:section\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.og:url.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"xss\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"links.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.og:title\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"geo.srcdest\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"url.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"extension.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"machine.os.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"@tags\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"host.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.og:type.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"geo.src\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"spaces.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.og:image:height.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"url\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.twitter:description.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.og:site_name\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.twitter:title\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"@message\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.twitter:image.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"@timestamp\",\"type\":\"date\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"bytes\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"response\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"meta.user.firstname\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.og:image:width.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.og:description.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.article:published_time\",\"type\":\"date\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"_id\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":false,\"analyzed\":false,\"doc_values\":false},{\"name\":\"_type\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":false,\"analyzed\":false,\"doc_values\":false},{\"name\":\"_score\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"indexed\":false,\"analyzed\":false,\"doc_values\":false}]", + "fields": "[]", "title": "with-timefield", "timeFieldName": "@timestamp" }, diff --git a/test/functional/fixtures/es_archiver/index_pattern_without_timefield/mappings.json b/test/functional/fixtures/es_archiver/index_pattern_without_timefield/mappings.json index 00961119239511..dd41e01592a7b6 100644 --- a/test/functional/fixtures/es_archiver/index_pattern_without_timefield/mappings.json +++ b/test/functional/fixtures/es_archiver/index_pattern_without_timefield/mappings.json @@ -2,13 +2,6 @@ "type": "index", "value": { "index": "without-timefield", - "mappings": { - "properties": { - "@timestamp": { - "type": "date" - } - } - }, "settings": { "index": { "number_of_replicas": "0", diff --git a/test/functional/fixtures/es_archiver/saved_objects_management/nested_export_transform/data.json b/test/functional/fixtures/es_archiver/saved_objects_management/nested_export_transform/data.json new file mode 100644 index 00000000000000..caac89461b9ef0 --- /dev/null +++ b/test/functional/fixtures/es_archiver/saved_objects_management/nested_export_transform/data.json @@ -0,0 +1,87 @@ +{ + "type": "doc", + "value": { + "index": ".kibana", + "type": "doc", + "id": "test-export-transform:type_1-obj_1", + "source": { + "test-export-transform": { + "title": "test_1-obj_1", + "enabled": true + }, + "type": "test-export-transform", + "migrationVersion": {}, + "updated_at": "2018-12-21T00:43:07.096Z", + "references": [ + { + "type": "test-export-transform", + "id": "type_1-obj_2", + "name": "ref-1" + }, + { + "type": "test-export-add", + "id": "type_2-obj_1", + "name": "ref-2" + } + ] + } + } +} + +{ + "type": "doc", + "value": { + "index": ".kibana", + "type": "doc", + "id": "test-export-transform:type_1-obj_2", + "source": { + "test-export-transform": { + "title": "test_1-obj_2", + "enabled": true + }, + "type": "test-export-transform", + "migrationVersion": {}, + "updated_at": "2018-12-21T00:43:07.096Z" + } + } +} + +{ + "type": "doc", + "value": { + "index": ".kibana", + "type": "doc", + "id": "test-export-add:type_2-obj_1", + "source": { + "test-export-add": { + "title": "test_2-obj_1" + }, + "type": "test-export-add", + "migrationVersion": {}, + "updated_at": "2018-12-21T00:43:07.096Z" + } + } +} + +{ + "type": "doc", + "value": { + "index": ".kibana", + "type": "doc", + "id": "test-export-add-dep:type_dep-obj_1", + "source": { + "test-export-add-dep": { + "title": "type_dep-obj_1" + }, + "type": "test-export-add-dep", + "migrationVersion": {}, + "updated_at": "2018-12-21T00:43:07.096Z", + "references": [ + { + "type": "test-export-add", + "id": "type_2-obj_1" + } + ] + } + } +} diff --git a/test/functional/fixtures/es_archiver/saved_objects_management/nested_export_transform/mappings.json b/test/functional/fixtures/es_archiver/saved_objects_management/nested_export_transform/mappings.json new file mode 100644 index 00000000000000..43b851e817fa81 --- /dev/null +++ b/test/functional/fixtures/es_archiver/saved_objects_management/nested_export_transform/mappings.json @@ -0,0 +1,499 @@ +{ + "type": "index", + "value": { + "index": ".kibana", + "settings": { + "index": { + "number_of_shards": "1", + "auto_expand_replicas": "0-1", + "number_of_replicas": "0" + } + }, + "mappings": { + "dynamic": "strict", + "properties": { + "test-export-transform": { + "properties": { + "title": { "type": "text" }, + "enabled": { "type": "boolean" } + } + }, + "test-export-add": { + "properties": { + "title": { "type": "text" } + } + }, + "test-export-add-dep": { + "properties": { + "title": { "type": "text" } + } + }, + "test-export-transform-error": { + "properties": { + "title": { "type": "text" } + } + }, + "test-export-invalid-transform": { + "properties": { + "title": { "type": "text" } + } + }, + "apm-telemetry": { + "properties": { + "has_any_services": { + "type": "boolean" + }, + "services_per_agent": { + "properties": { + "go": { + "type": "long", + "null_value": 0 + }, + "java": { + "type": "long", + "null_value": 0 + }, + "js-base": { + "type": "long", + "null_value": 0 + }, + "nodejs": { + "type": "long", + "null_value": 0 + }, + "python": { + "type": "long", + "null_value": 0 + }, + "ruby": { + "type": "long", + "null_value": 0 + } + } + } + } + }, + "canvas-workpad": { + "dynamic": "false", + "properties": { + "@created": { + "type": "date" + }, + "@timestamp": { + "type": "date" + }, + "id": { + "type": "text", + "index": false + }, + "name": { + "type": "text", + "fields": { + "keyword": { + "type": "keyword" + } + } + } + } + }, + "config": { + "dynamic": "true", + "properties": { + "accessibility:disableAnimations": { + "type": "boolean" + }, + "buildNum": { + "type": "keyword" + }, + "dateFormat:tz": { + "type": "text", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 256 + } + } + }, + "defaultIndex": { + "type": "text", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 256 + } + } + }, + "telemetry:optIn": { + "type": "boolean" + } + } + }, + "dashboard": { + "properties": { + "description": { + "type": "text" + }, + "hits": { + "type": "integer" + }, + "kibanaSavedObjectMeta": { + "properties": { + "searchSourceJSON": { + "type": "text" + } + } + }, + "optionsJSON": { + "type": "text" + }, + "panelsJSON": { + "type": "text" + }, + "refreshInterval": { + "properties": { + "display": { + "type": "keyword" + }, + "pause": { + "type": "boolean" + }, + "section": { + "type": "integer" + }, + "value": { + "type": "integer" + } + } + }, + "timeFrom": { + "type": "keyword" + }, + "timeRestore": { + "type": "boolean" + }, + "timeTo": { + "type": "keyword" + }, + "title": { + "type": "text" + }, + "uiStateJSON": { + "type": "text" + }, + "version": { + "type": "integer" + } + } + }, + "map": { + "properties": { + "bounds": { + "dynamic": false, + "properties": {} + }, + "description": { + "type": "text" + }, + "layerListJSON": { + "type": "text" + }, + "mapStateJSON": { + "type": "text" + }, + "title": { + "type": "text" + }, + "uiStateJSON": { + "type": "text" + }, + "version": { + "type": "integer" + } + } + }, + "graph-workspace": { + "properties": { + "description": { + "type": "text" + }, + "kibanaSavedObjectMeta": { + "properties": { + "searchSourceJSON": { + "type": "text" + } + } + }, + "numLinks": { + "type": "integer" + }, + "numVertices": { + "type": "integer" + }, + "title": { + "type": "text" + }, + "version": { + "type": "integer" + }, + "wsState": { + "type": "text" + } + } + }, + "index-pattern": { + "properties": { + "fieldFormatMap": { + "type": "text" + }, + "fields": { + "type": "text" + }, + "intervalName": { + "type": "keyword" + }, + "notExpandable": { + "type": "boolean" + }, + "sourceFilters": { + "type": "text" + }, + "timeFieldName": { + "type": "keyword" + }, + "title": { + "type": "text" + }, + "type": { + "type": "keyword" + }, + "typeMeta": { + "type": "keyword" + } + } + }, + "kql-telemetry": { + "properties": { + "optInCount": { + "type": "long" + }, + "optOutCount": { + "type": "long" + } + } + }, + "migrationVersion": { + "dynamic": "true", + "properties": { + "index-pattern": { + "type": "text", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 256 + } + } + }, + "space": { + "type": "text", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 256 + } + } + } + } + }, + "namespace": { + "type": "keyword" + }, + "search": { + "properties": { + "columns": { + "type": "keyword" + }, + "description": { + "type": "text" + }, + "hits": { + "type": "integer" + }, + "kibanaSavedObjectMeta": { + "properties": { + "searchSourceJSON": { + "type": "text" + } + } + }, + "sort": { + "type": "keyword" + }, + "title": { + "type": "text" + }, + "version": { + "type": "integer" + } + } + }, + "server": { + "properties": { + "uuid": { + "type": "keyword" + } + } + }, + "space": { + "properties": { + "_reserved": { + "type": "boolean" + }, + "color": { + "type": "keyword" + }, + "description": { + "type": "text" + }, + "disabledFeatures": { + "type": "keyword" + }, + "initials": { + "type": "keyword" + }, + "name": { + "type": "text", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 2048 + } + } + } + } + }, + "spaceId": { + "type": "keyword" + }, + "telemetry": { + "properties": { + "enabled": { + "type": "boolean" + } + } + }, + "timelion-sheet": { + "properties": { + "description": { + "type": "text" + }, + "hits": { + "type": "integer" + }, + "kibanaSavedObjectMeta": { + "properties": { + "searchSourceJSON": { + "type": "text" + } + } + }, + "timelion_chart_height": { + "type": "integer" + }, + "timelion_columns": { + "type": "integer" + }, + "timelion_interval": { + "type": "keyword" + }, + "timelion_other_interval": { + "type": "keyword" + }, + "timelion_rows": { + "type": "integer" + }, + "timelion_sheet": { + "type": "text" + }, + "title": { + "type": "text" + }, + "version": { + "type": "integer" + } + } + }, + "type": { + "type": "keyword" + }, + "updated_at": { + "type": "date" + }, + "url": { + "properties": { + "accessCount": { + "type": "long" + }, + "accessDate": { + "type": "date" + }, + "createDate": { + "type": "date" + }, + "url": { + "type": "text", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 2048 + } + } + } + } + }, + "visualization": { + "properties": { + "description": { + "type": "text" + }, + "kibanaSavedObjectMeta": { + "properties": { + "searchSourceJSON": { + "type": "text" + } + } + }, + "savedSearchId": { + "type": "keyword" + }, + "title": { + "type": "text" + }, + "uiStateJSON": { + "type": "text" + }, + "version": { + "type": "integer" + }, + "visState": { + "type": "text" + } + } + }, + "references": { + "properties": { + "id": { + "type": "keyword" + }, + "name": { + "type": "keyword" + }, + "type": { + "type": "keyword" + } + }, + "type": "nested" + } + } + } + } +} diff --git a/test/functional/page_objects/common_page.ts b/test/functional/page_objects/common_page.ts index bc60b8ce5f19c2..49d56d6f437847 100644 --- a/test/functional/page_objects/common_page.ts +++ b/test/functional/page_objects/common_page.ts @@ -11,470 +11,465 @@ import expect from '@kbn/expect'; // @ts-ignore import fetch from 'node-fetch'; import { getUrl } from '@kbn/test'; -import { FtrProviderContext } from '../ftr_provider_context'; - -export function CommonPageProvider({ getService, getPageObjects }: FtrProviderContext) { - const log = getService('log'); - const config = getService('config'); - const browser = getService('browser'); - const retry = getService('retry'); - const find = getService('find'); - const globalNav = getService('globalNav'); - const testSubjects = getService('testSubjects'); - const PageObjects = getPageObjects(['login']); - - const defaultTryTimeout = config.get('timeouts.try'); - const defaultFindTimeout = config.get('timeouts.find'); - - interface NavigateProps { - appConfig: {}; - ensureCurrentUrl: boolean; - shouldLoginIfPrompted: boolean; - useActualUrl: boolean; - insertTimestamp: boolean; - } - - class CommonPage { - /** - * Logins to Kibana as default user and navigates to provided app - * @param appUrl Kibana URL - */ - private async loginIfPrompted(appUrl: string, insertTimestamp: boolean) { - // Disable the welcome screen. This is relevant for environments - // which don't allow to use the yml setting, e.g. cloud production. - // It is done here so it applies to logins but also to a login re-use. - await browser.setLocalStorageItem('home:welcome:show', 'false'); - - let currentUrl = await browser.getCurrentUrl(); - log.debug(`currentUrl = ${currentUrl}\n appUrl = ${appUrl}`); - await testSubjects.find('kibanaChrome', 6 * defaultFindTimeout); // 60 sec waiting - const loginPage = currentUrl.includes('/login'); - const wantedLoginPage = appUrl.includes('/login') || appUrl.includes('/logout'); - - if (loginPage && !wantedLoginPage) { - log.debug('Found login page'); - if (config.get('security.disableTestUser')) { - await PageObjects.login.login( - config.get('servers.kibana.username'), - config.get('servers.kibana.password') - ); - } else { - await PageObjects.login.login('test_user', 'changeme'); - } - - await find.byCssSelector( - '[data-test-subj="kibanaChrome"] nav:not(.ng-hide)', - 6 * defaultFindTimeout +import { FtrService } from '../ftr_provider_context'; + +interface NavigateProps { + appConfig: {}; + ensureCurrentUrl: boolean; + shouldLoginIfPrompted: boolean; + useActualUrl: boolean; + insertTimestamp: boolean; +} +export class CommonPageObject extends FtrService { + private readonly log = this.ctx.getService('log'); + private readonly config = this.ctx.getService('config'); + private readonly browser = this.ctx.getService('browser'); + private readonly retry = this.ctx.getService('retry'); + private readonly find = this.ctx.getService('find'); + private readonly globalNav = this.ctx.getService('globalNav'); + private readonly testSubjects = this.ctx.getService('testSubjects'); + private readonly loginPage = this.ctx.getPageObject('login'); + + private readonly defaultTryTimeout = this.config.get('timeouts.try'); + private readonly defaultFindTimeout = this.config.get('timeouts.find'); + + /** + * Logins to Kibana as default user and navigates to provided app + * @param appUrl Kibana URL + */ + private async loginIfPrompted(appUrl: string, insertTimestamp: boolean) { + // Disable the welcome screen. This is relevant for environments + // which don't allow to use the yml setting, e.g. cloud production. + // It is done here so it applies to logins but also to a login re-use. + await this.browser.setLocalStorageItem('home:welcome:show', 'false'); + + let currentUrl = await this.browser.getCurrentUrl(); + this.log.debug(`currentUrl = ${currentUrl}\n appUrl = ${appUrl}`); + await this.testSubjects.find('kibanaChrome', 6 * this.defaultFindTimeout); // 60 sec waiting + const loginPage = currentUrl.includes('/login'); + const wantedLoginPage = appUrl.includes('/login') || appUrl.includes('/logout'); + + if (loginPage && !wantedLoginPage) { + this.log.debug('Found login page'); + if (this.config.get('security.disableTestUser')) { + await this.loginPage.login( + this.config.get('servers.kibana.username'), + this.config.get('servers.kibana.password') ); - await browser.get(appUrl, insertTimestamp); - currentUrl = await browser.getCurrentUrl(); - log.debug(`Finished login process currentUrl = ${currentUrl}`); + } else { + await this.loginPage.login('test_user', 'changeme'); } - return currentUrl; - } - private async navigate(navigateProps: NavigateProps) { - const { - appConfig, - ensureCurrentUrl, - shouldLoginIfPrompted, - useActualUrl, - insertTimestamp, - } = navigateProps; - const appUrl = getUrl.noAuth(config.get('servers.kibana'), appConfig); - - await retry.try(async () => { - if (useActualUrl) { - log.debug(`navigateToActualUrl ${appUrl}`); - await browser.get(appUrl); - } else { - log.debug(`navigateToUrl ${appUrl}`); - await browser.get(appUrl, insertTimestamp); - } + await this.find.byCssSelector( + '[data-test-subj="kibanaChrome"] nav:not(.ng-hide)', + 6 * this.defaultFindTimeout + ); + await this.browser.get(appUrl, insertTimestamp); + currentUrl = await this.browser.getCurrentUrl(); + this.log.debug(`Finished login process currentUrl = ${currentUrl}`); + } + return currentUrl; + } - // accept alert if it pops up - const alert = await browser.getAlert(); - await alert?.accept(); + private async navigate(navigateProps: NavigateProps) { + const { + appConfig, + ensureCurrentUrl, + shouldLoginIfPrompted, + useActualUrl, + insertTimestamp, + } = navigateProps; + const appUrl = getUrl.noAuth(this.config.get('servers.kibana'), appConfig); + + await this.retry.try(async () => { + if (useActualUrl) { + this.log.debug(`navigateToActualUrl ${appUrl}`); + await this.browser.get(appUrl); + } else { + this.log.debug(`navigateToUrl ${appUrl}`); + await this.browser.get(appUrl, insertTimestamp); + } - const currentUrl = shouldLoginIfPrompted - ? await this.loginIfPrompted(appUrl, insertTimestamp) - : await browser.getCurrentUrl(); + // accept alert if it pops up + const alert = await this.browser.getAlert(); + await alert?.accept(); - if (ensureCurrentUrl && !currentUrl.includes(appUrl)) { - throw new Error(`expected ${currentUrl}.includes(${appUrl})`); - } - }); - } + const currentUrl = shouldLoginIfPrompted + ? await this.loginIfPrompted(appUrl, insertTimestamp) + : await this.browser.getCurrentUrl(); - /** - * Navigates browser using the pathname from the appConfig and subUrl as the hash - * @param appName As defined in the apps config, e.g. 'home' - * @param subUrl The route after the hash (#), e.g. '/tutorial_directory/sampleData' - * @param args additional arguments - */ - public async navigateToUrl( - appName: string, - subUrl?: string, - { - basePath = '', - ensureCurrentUrl = true, - shouldLoginIfPrompted = true, - useActualUrl = false, - insertTimestamp = true, - shouldUseHashForSubUrl = true, - } = {} - ) { - const appConfig: { pathname: string; hash?: string } = { - pathname: `${basePath}${config.get(['apps', appName]).pathname}`, - }; - - if (shouldUseHashForSubUrl) { - appConfig.hash = useActualUrl ? subUrl : `/${appName}/${subUrl}`; - } else { - appConfig.pathname += `/${subUrl}`; + if (ensureCurrentUrl && !currentUrl.includes(appUrl)) { + throw new Error(`expected ${currentUrl}.includes(${appUrl})`); } + }); + } - await this.navigate({ - appConfig, - ensureCurrentUrl, - shouldLoginIfPrompted, - useActualUrl, - insertTimestamp, - }); + /** + * Navigates browser using the pathname from the appConfig and subUrl as the hash + * @param appName As defined in the apps config, e.g. 'home' + * @param subUrl The route after the hash (#), e.g. '/tutorial_directory/sampleData' + * @param args additional arguments + */ + public async navigateToUrl( + appName: string, + subUrl?: string, + { + basePath = '', + ensureCurrentUrl = true, + shouldLoginIfPrompted = true, + useActualUrl = false, + insertTimestamp = true, + shouldUseHashForSubUrl = true, + } = {} + ) { + const appConfig: { pathname: string; hash?: string } = { + pathname: `${basePath}${this.config.get(['apps', appName]).pathname}`, + }; + + if (shouldUseHashForSubUrl) { + appConfig.hash = useActualUrl ? subUrl : `/${appName}/${subUrl}`; + } else { + appConfig.pathname += `/${subUrl}`; } - /** - * Navigates browser using the pathname from the appConfig and subUrl as the extended path. - * This was added to be able to test an application that uses browser history over hash history. - * @param appName As defined in the apps config, e.g. 'home' - * @param subUrl The route after the appUrl, e.g. '/tutorial_directory/sampleData' - * @param args additional arguments - */ - public async navigateToUrlWithBrowserHistory( - appName: string, - subUrl?: string, - search?: string, - { - basePath = '', - ensureCurrentUrl = true, - shouldLoginIfPrompted = true, - useActualUrl = true, - insertTimestamp = true, - } = {} - ) { - const appConfig = { - // subUrl following the basePath, assumes no hashes. Ex: 'app/endpoint/management' - pathname: `${basePath}${config.get(['apps', appName]).pathname}${subUrl}`, - search, - }; - - await this.navigate({ - appConfig, - ensureCurrentUrl, - shouldLoginIfPrompted, - useActualUrl, - insertTimestamp, - }); - } + await this.navigate({ + appConfig, + ensureCurrentUrl, + shouldLoginIfPrompted, + useActualUrl, + insertTimestamp, + }); + } - /** - * Navigates browser using only the pathname from the appConfig - * @param appName As defined in the apps config, e.g. 'kibana' - * @param hash The route after the hash (#), e.g. 'management/kibana/settings' - * @param args additional arguments - */ - async navigateToActualUrl( - appName: string, - hash?: string, - { basePath = '', ensureCurrentUrl = true, shouldLoginIfPrompted = true } = {} - ) { - await this.navigateToUrl(appName, hash, { - basePath, - ensureCurrentUrl, - shouldLoginIfPrompted, - useActualUrl: true, - }); - } + /** + * Navigates browser using the pathname from the appConfig and subUrl as the extended path. + * This was added to be able to test an application that uses browser history over hash history. + * @param appName As defined in the apps config, e.g. 'home' + * @param subUrl The route after the appUrl, e.g. '/tutorial_directory/sampleData' + * @param args additional arguments + */ + public async navigateToUrlWithBrowserHistory( + appName: string, + subUrl?: string, + search?: string, + { + basePath = '', + ensureCurrentUrl = true, + shouldLoginIfPrompted = true, + useActualUrl = true, + insertTimestamp = true, + } = {} + ) { + const appConfig = { + // subUrl following the basePath, assumes no hashes. Ex: 'app/endpoint/management' + pathname: `${basePath}${this.config.get(['apps', appName]).pathname}${subUrl}`, + search, + }; + + await this.navigate({ + appConfig, + ensureCurrentUrl, + shouldLoginIfPrompted, + useActualUrl, + insertTimestamp, + }); + } - async sleep(sleepMilliseconds: number) { - log.debug(`... sleep(${sleepMilliseconds}) start`); - await delay(sleepMilliseconds); - log.debug(`... sleep(${sleepMilliseconds}) end`); - } + /** + * Navigates browser using only the pathname from the appConfig + * @param appName As defined in the apps config, e.g. 'kibana' + * @param hash The route after the hash (#), e.g. 'management/kibana/settings' + * @param args additional arguments + */ + async navigateToActualUrl( + appName: string, + hash?: string, + { basePath = '', ensureCurrentUrl = true, shouldLoginIfPrompted = true } = {} + ) { + await this.navigateToUrl(appName, hash, { + basePath, + ensureCurrentUrl, + shouldLoginIfPrompted, + useActualUrl: true, + }); + } - async navigateToApp( - appName: string, - { basePath = '', shouldLoginIfPrompted = true, hash = '', insertTimestamp = true } = {} - ) { - let appUrl: string; - if (config.has(['apps', appName])) { - // Legacy applications - const appConfig = config.get(['apps', appName]); - appUrl = getUrl.noAuth(config.get('servers.kibana'), { - pathname: `${basePath}${appConfig.pathname}`, - hash: hash || appConfig.hash, - }); - } else { - appUrl = getUrl.noAuth(config.get('servers.kibana'), { - pathname: `${basePath}/app/${appName}`, - hash, - }); - } + async sleep(sleepMilliseconds: number) { + this.log.debug(`... sleep(${sleepMilliseconds}) start`); + await delay(sleepMilliseconds); + this.log.debug(`... sleep(${sleepMilliseconds}) end`); + } - log.debug('navigating to ' + appName + ' url: ' + appUrl); - - await retry.tryForTime(defaultTryTimeout * 2, async () => { - let lastUrl = await retry.try(async () => { - // since we're using hash URLs, always reload first to force re-render - log.debug('navigate to: ' + appUrl); - await browser.get(appUrl, insertTimestamp); - // accept alert if it pops up - const alert = await browser.getAlert(); - await alert?.accept(); - await this.sleep(700); - log.debug('returned from get, calling refresh'); - await browser.refresh(); - let currentUrl = shouldLoginIfPrompted - ? await this.loginIfPrompted(appUrl, insertTimestamp) - : await browser.getCurrentUrl(); - - if (currentUrl.includes('app/kibana')) { - await testSubjects.find('kibanaChrome'); - } - - currentUrl = (await browser.getCurrentUrl()).replace(/\/\/\w+:\w+@/, '//'); - - const navSuccessful = currentUrl - .replace(':80/', '/') - .replace(':443/', '/') - .startsWith(appUrl); - - if (!navSuccessful) { - const msg = `App failed to load: ${appName} in ${defaultFindTimeout}ms appUrl=${appUrl} currentUrl=${currentUrl}`; - log.debug(msg); - throw new Error(msg); - } - return currentUrl; - }); - - await retry.tryForTime(defaultFindTimeout, async () => { - await this.sleep(501); - const currentUrl = await browser.getCurrentUrl(); - log.debug('in navigateTo url = ' + currentUrl); - if (lastUrl !== currentUrl) { - lastUrl = currentUrl; - throw new Error('URL changed, waiting for it to settle'); - } - }); + async navigateToApp( + appName: string, + { basePath = '', shouldLoginIfPrompted = true, hash = '', insertTimestamp = true } = {} + ) { + let appUrl: string; + if (this.config.has(['apps', appName])) { + // Legacy applications + const appConfig = this.config.get(['apps', appName]); + appUrl = getUrl.noAuth(this.config.get('servers.kibana'), { + pathname: `${basePath}${appConfig.pathname}`, + hash: hash || appConfig.hash, + }); + } else { + appUrl = getUrl.noAuth(this.config.get('servers.kibana'), { + pathname: `${basePath}/app/${appName}`, + hash, }); } - async waitUntilUrlIncludes(path: string) { - await retry.try(async () => { - const url = await browser.getCurrentUrl(); - if (!url.includes(path)) { - throw new Error('Url not found'); + this.log.debug('navigating to ' + appName + ' url: ' + appUrl); + + await this.retry.tryForTime(this.defaultTryTimeout * 2, async () => { + let lastUrl = await this.retry.try(async () => { + // since we're using hash URLs, always reload first to force re-render + this.log.debug('navigate to: ' + appUrl); + await this.browser.get(appUrl, insertTimestamp); + // accept alert if it pops up + const alert = await this.browser.getAlert(); + await alert?.accept(); + await this.sleep(700); + this.log.debug('returned from get, calling refresh'); + await this.browser.refresh(); + let currentUrl = shouldLoginIfPrompted + ? await this.loginIfPrompted(appUrl, insertTimestamp) + : await this.browser.getCurrentUrl(); + + if (currentUrl.includes('app/kibana')) { + await this.testSubjects.find('kibanaChrome'); } - }); - } - async getSharedItemTitleAndDescription() { - const cssSelector = '[data-shared-item][data-title][data-description]'; - const element = await find.byCssSelector(cssSelector); + currentUrl = (await this.browser.getCurrentUrl()).replace(/\/\/\w+:\w+@/, '//'); - return { - title: await element.getAttribute('data-title'), - description: await element.getAttribute('data-description'), - }; - } + const navSuccessful = currentUrl + .replace(':80/', '/') + .replace(':443/', '/') + .startsWith(appUrl); - async getSharedItemContainers() { - const cssSelector = '[data-shared-items-container]'; - return find.allByCssSelector(cssSelector); - } + if (!navSuccessful) { + const msg = `App failed to load: ${appName} in ${this.defaultFindTimeout}ms appUrl=${appUrl} currentUrl=${currentUrl}`; + this.log.debug(msg); + throw new Error(msg); + } + return currentUrl; + }); - async ensureModalOverlayHidden() { - return retry.try(async () => { - const shown = await testSubjects.exists('confirmModalTitleText'); - if (shown) { - throw new Error('Modal overlay is showing'); + await this.retry.tryForTime(this.defaultFindTimeout, async () => { + await this.sleep(501); + const currentUrl = await this.browser.getCurrentUrl(); + this.log.debug('in navigateTo url = ' + currentUrl); + if (lastUrl !== currentUrl) { + lastUrl = currentUrl; + throw new Error('URL changed, waiting for it to settle'); } }); - } + }); + } - async clickConfirmOnModal(ensureHidden = true) { - log.debug('Clicking modal confirm'); - // make sure this data-test-subj 'confirmModalTitleText' exists because we're going to wait for it to be gone later - await testSubjects.exists('confirmModalTitleText'); - await testSubjects.click('confirmModalConfirmButton'); - if (ensureHidden) { - await this.ensureModalOverlayHidden(); + async waitUntilUrlIncludes(path: string) { + await this.retry.try(async () => { + const url = await this.browser.getCurrentUrl(); + if (!url.includes(path)) { + throw new Error('Url not found'); } - } + }); + } - async pressEnterKey() { - await browser.pressKeys(browser.keys.ENTER); - } + async getSharedItemTitleAndDescription() { + const cssSelector = '[data-shared-item][data-title][data-description]'; + const element = await this.find.byCssSelector(cssSelector); - async pressTabKey() { - await browser.pressKeys(browser.keys.TAB); - } + return { + title: await element.getAttribute('data-title'), + description: await element.getAttribute('data-description'), + }; + } - // Pause the browser at a certain place for debugging - // Not meant for usage in CI, only for dev-usage - async pause() { - return browser.pause(); - } + async getSharedItemContainers() { + const cssSelector = '[data-shared-items-container]'; + return this.find.allByCssSelector(cssSelector); + } - /** - * Clicks cancel button on modal - * @param overlayWillStay pass in true if your test will show multiple modals in succession - */ - async clickCancelOnModal(overlayWillStay = true) { - log.debug('Clicking modal cancel'); - await testSubjects.click('confirmModalCancelButton'); - if (!overlayWillStay) { - await this.ensureModalOverlayHidden(); + async ensureModalOverlayHidden() { + return this.retry.try(async () => { + const shown = await this.testSubjects.exists('confirmModalTitleText'); + if (shown) { + throw new Error('Modal overlay is showing'); } - } + }); + } - async expectConfirmModalOpenState(state: boolean) { - log.debug(`expectConfirmModalOpenState(${state})`); - // we use retry here instead of a simple .exists() check because the modal - // fades in/out, which takes time, and we really only care that at some point - // the modal is either open or closed - await retry.try(async () => { - const actualState = await testSubjects.exists('confirmModalCancelButton'); - expect(actualState).to.equal( - state, - state ? 'Confirm modal should be present' : 'Confirm modal should be hidden' - ); - }); + async clickConfirmOnModal(ensureHidden = true) { + this.log.debug('Clicking modal confirm'); + // make sure this data-test-subj 'confirmModalTitleText' exists because we're going to wait for it to be gone later + await this.testSubjects.exists('confirmModalTitleText'); + await this.testSubjects.click('confirmModalConfirmButton'); + if (ensureHidden) { + await this.ensureModalOverlayHidden(); } + } - async isChromeVisible() { - const globalNavShown = await globalNav.exists(); - return globalNavShown; - } + async pressEnterKey() { + await this.browser.pressKeys(this.browser.keys.ENTER); + } - async isChromeHidden() { - const globalNavShown = await globalNav.exists(); - return !globalNavShown; - } + async pressTabKey() { + await this.browser.pressKeys(this.browser.keys.TAB); + } - async waitForTopNavToBeVisible() { - await retry.try(async () => { - const isNavVisible = await testSubjects.exists('top-nav'); - if (!isNavVisible) { - throw new Error('Local nav not visible yet'); - } - }); + // Pause the browser at a certain place for debugging + // Not meant for usage in CI, only for dev-usage + async pause() { + return this.browser.pause(); + } + + /** + * Clicks cancel button on modal + * @param overlayWillStay pass in true if your test will show multiple modals in succession + */ + async clickCancelOnModal(overlayWillStay = true) { + this.log.debug('Clicking modal cancel'); + await this.testSubjects.click('confirmModalCancelButton'); + if (!overlayWillStay) { + await this.ensureModalOverlayHidden(); } + } - async closeToast() { - const toast = await find.byCssSelector('.euiToast', 6 * defaultFindTimeout); - await toast.moveMouseTo(); - const title = await (await find.byCssSelector('.euiToastHeader__title')).getVisibleText(); + async expectConfirmModalOpenState(state: boolean) { + this.log.debug(`expectConfirmModalOpenState(${state})`); + // we use retry here instead of a simple .exists() check because the modal + // fades in/out, which takes time, and we really only care that at some point + // the modal is either open or closed + await this.retry.try(async () => { + const actualState = await this.testSubjects.exists('confirmModalCancelButton'); + expect(actualState).to.equal( + state, + state ? 'Confirm modal should be present' : 'Confirm modal should be hidden' + ); + }); + } - await find.clickByCssSelector('.euiToast__closeButton'); - return title; - } + async isChromeVisible() { + const globalNavShown = await this.globalNav.exists(); + return globalNavShown; + } - async closeToastIfExists() { - const toastShown = await find.existsByCssSelector('.euiToast'); - if (toastShown) { - try { - await find.clickByCssSelector('.euiToast__closeButton'); - } catch (err) { - // ignore errors, toast clear themselves after timeout - } - } - } + async isChromeHidden() { + const globalNavShown = await this.globalNav.exists(); + return !globalNavShown; + } - async clearAllToasts() { - const toasts = await find.allByCssSelector('.euiToast'); - for (const toastElement of toasts) { - try { - await toastElement.moveMouseTo(); - const closeBtn = await toastElement.findByCssSelector('.euiToast__closeButton'); - await closeBtn.click(); - } catch (err) { - // ignore errors, toast clear themselves after timeout - } + async waitForTopNavToBeVisible() { + await this.retry.try(async () => { + const isNavVisible = await this.testSubjects.exists('top-nav'); + if (!isNavVisible) { + throw new Error('Local nav not visible yet'); } - } + }); + } - async getJsonBodyText() { - if (await find.existsByCssSelector('a[id=rawdata-tab]', defaultFindTimeout)) { - // Firefox has 3 tabs and requires navigation to see Raw output - await find.clickByCssSelector('a[id=rawdata-tab]'); - } - const msgElements = await find.allByCssSelector('body pre'); - if (msgElements.length > 0) { - return await msgElements[0].getVisibleText(); - } else { - // Sometimes Firefox renders Timelion page without tabs and with div#json - const jsonElement = await find.byCssSelector('body div#json'); - return await jsonElement.getVisibleText(); + async closeToast() { + const toast = await this.find.byCssSelector('.euiToast', 6 * this.defaultFindTimeout); + await toast.moveMouseTo(); + const title = await (await this.find.byCssSelector('.euiToastHeader__title')).getVisibleText(); + + await this.find.clickByCssSelector('.euiToast__closeButton'); + return title; + } + + async closeToastIfExists() { + const toastShown = await this.find.existsByCssSelector('.euiToast'); + if (toastShown) { + try { + await this.find.clickByCssSelector('.euiToast__closeButton'); + } catch (err) { + // ignore errors, toast clear themselves after timeout } } + } - async getBodyText() { - const body = await find.byCssSelector('body'); - return await body.getVisibleText(); + async clearAllToasts() { + const toasts = await this.find.allByCssSelector('.euiToast'); + for (const toastElement of toasts) { + try { + await toastElement.moveMouseTo(); + const closeBtn = await toastElement.findByCssSelector('.euiToast__closeButton'); + await closeBtn.click(); + } catch (err) { + // ignore errors, toast clear themselves after timeout + } } + } - async waitForSaveModalToClose() { - log.debug('Waiting for save modal to close'); - await retry.try(async () => { - if (await testSubjects.exists('savedObjectSaveModal')) { - throw new Error('save modal still open'); - } - }); + async getJsonBodyText() { + if (await this.find.existsByCssSelector('a[id=rawdata-tab]', this.defaultFindTimeout)) { + // Firefox has 3 tabs and requires navigation to see Raw output + await this.find.clickByCssSelector('a[id=rawdata-tab]'); } - - async setFileInputPath(path: string) { - log.debug(`Setting the path '${path}' on the file input`); - const input = await find.byCssSelector('.euiFilePicker__input'); - await input.type(path); + const msgElements = await this.find.allByCssSelector('body pre'); + if (msgElements.length > 0) { + return await msgElements[0].getVisibleText(); + } else { + // Sometimes Firefox renders Timelion page without tabs and with div#json + const jsonElement = await this.find.byCssSelector('body div#json'); + return await jsonElement.getVisibleText(); } + } - async scrollKibanaBodyTop() { - await browser.setScrollToById('kibana-body', 0, 0); - } + async getBodyText() { + const body = await this.find.byCssSelector('body'); + return await body.getVisibleText(); + } - /** - * Dismiss Banner if available. - */ - async dismissBanner() { - if (await testSubjects.exists('global-banner-item')) { - const button = await find.byButtonText('Dismiss'); - await button.click(); + async waitForSaveModalToClose() { + this.log.debug('Waiting for save modal to close'); + await this.retry.try(async () => { + if (await this.testSubjects.exists('savedObjectSaveModal')) { + throw new Error('save modal still open'); } - } + }); + } - /** - * Get visible text of the Welcome Banner - */ - async getWelcomeText() { - return await testSubjects.getVisibleText('global-banner-item'); - } + async setFileInputPath(path: string) { + this.log.debug(`Setting the path '${path}' on the file input`); + const input = await this.find.byCssSelector('.euiFilePicker__input'); + await input.type(path); + } + + async scrollKibanaBodyTop() { + await this.browser.setScrollToById('kibana-body', 0, 0); + } - /** - * Clicks on an element, and validates that the desired effect has taken place - * by confirming the existence of a validator - */ - async clickAndValidate( - clickTarget: string, - validator: string, - isValidatorCssString: boolean = false, - topOffset?: number - ) { - await testSubjects.click(clickTarget, undefined, topOffset); - const validate = isValidatorCssString ? find.byCssSelector : testSubjects.exists; - await validate(validator); + /** + * Dismiss Banner if available. + */ + async dismissBanner() { + if (await this.testSubjects.exists('global-banner-item')) { + const button = await this.find.byButtonText('Dismiss'); + await button.click(); } } - return new CommonPage(); + /** + * Get visible text of the Welcome Banner + */ + async getWelcomeText() { + return await this.testSubjects.getVisibleText('global-banner-item'); + } + + /** + * Clicks on an element, and validates that the desired effect has taken place + * by confirming the existence of a validator + */ + async clickAndValidate( + clickTarget: string, + validator: string, + isValidatorCssString: boolean = false, + topOffset?: number + ) { + await this.testSubjects.click(clickTarget, undefined, topOffset); + const validate = isValidatorCssString ? this.find.byCssSelector : this.testSubjects.exists; + await validate(validator); + } } diff --git a/test/functional/page_objects/console_page.ts b/test/functional/page_objects/console_page.ts index 6fb554e6d34a0c..77c87f6066e854 100644 --- a/test/functional/page_objects/console_page.ts +++ b/test/functional/page_objects/console_page.ts @@ -7,102 +7,98 @@ */ import { Key } from 'selenium-webdriver'; -import { FtrProviderContext } from '../ftr_provider_context'; +import { FtrService } from '../ftr_provider_context'; import { WebElementWrapper } from '../services/lib/web_element_wrapper'; -export function ConsolePageProvider({ getService }: FtrProviderContext) { - const testSubjects = getService('testSubjects'); - const retry = getService('retry'); - const find = getService('find'); +export class ConsolePageObject extends FtrService { + private readonly testSubjects = this.ctx.getService('testSubjects'); + private readonly retry = this.ctx.getService('retry'); + private readonly find = this.ctx.getService('find'); - class ConsolePage { - public async getVisibleTextFromAceEditor(editor: WebElementWrapper) { - const lines = await editor.findAllByClassName('ace_line_group'); - const linesText = await Promise.all(lines.map(async (line) => await line.getVisibleText())); - return linesText.join('\n'); - } + public async getVisibleTextFromAceEditor(editor: WebElementWrapper) { + const lines = await editor.findAllByClassName('ace_line_group'); + const linesText = await Promise.all(lines.map(async (line) => await line.getVisibleText())); + return linesText.join('\n'); + } - public async getRequestEditor() { - return await testSubjects.find('request-editor'); - } + public async getRequestEditor() { + return await this.testSubjects.find('request-editor'); + } - public async getRequest() { - const requestEditor = await this.getRequestEditor(); - return await this.getVisibleTextFromAceEditor(requestEditor); - } + public async getRequest() { + const requestEditor = await this.getRequestEditor(); + return await this.getVisibleTextFromAceEditor(requestEditor); + } - public async getResponse() { - const responseEditor = await testSubjects.find('response-editor'); - return await this.getVisibleTextFromAceEditor(responseEditor); - } + public async getResponse() { + const responseEditor = await this.testSubjects.find('response-editor'); + return await this.getVisibleTextFromAceEditor(responseEditor); + } - public async clickPlay() { - await testSubjects.click('sendRequestButton'); - } + public async clickPlay() { + await this.testSubjects.click('sendRequestButton'); + } - public async collapseHelp() { - await testSubjects.click('help-close-button'); - } + public async collapseHelp() { + await this.testSubjects.click('help-close-button'); + } - public async openSettings() { - await testSubjects.click('consoleSettingsButton'); - } + public async openSettings() { + await this.testSubjects.click('consoleSettingsButton'); + } - public async setFontSizeSetting(newSize: number) { - await this.openSettings(); + public async setFontSizeSetting(newSize: number) { + await this.openSettings(); - // while the settings form opens/loads this may fail, so retry for a while - await retry.try(async () => { - const fontSizeInput = await testSubjects.find('setting-font-size-input'); - await fontSizeInput.clearValue({ withJS: true }); - await fontSizeInput.click(); - await fontSizeInput.type(String(newSize)); - }); + // while the settings form opens/loads this may fail, so retry for a while + await this.retry.try(async () => { + const fontSizeInput = await this.testSubjects.find('setting-font-size-input'); + await fontSizeInput.clearValue({ withJS: true }); + await fontSizeInput.click(); + await fontSizeInput.type(String(newSize)); + }); - await testSubjects.click('settings-save-button'); - } + await this.testSubjects.click('settings-save-button'); + } - public async getFontSize(editor: WebElementWrapper) { - const aceLine = await editor.findByClassName('ace_line'); - return await aceLine.getComputedStyle('font-size'); - } + public async getFontSize(editor: WebElementWrapper) { + const aceLine = await editor.findByClassName('ace_line'); + return await aceLine.getComputedStyle('font-size'); + } - public async getRequestFontSize() { - return await this.getFontSize(await this.getRequestEditor()); - } + public async getRequestFontSize() { + return await this.getFontSize(await this.getRequestEditor()); + } - public async getEditor() { - return testSubjects.find('console-application'); - } + public async getEditor() { + return this.testSubjects.find('console-application'); + } - public async dismissTutorial() { - try { - const closeButton = await testSubjects.find('help-close-button'); - await closeButton.click(); - } catch (e) { - // Ignore because it is probably not there. - } + public async dismissTutorial() { + try { + const closeButton = await this.testSubjects.find('help-close-button'); + await closeButton.click(); + } catch (e) { + // Ignore because it is probably not there. } + } - public async promptAutocomplete() { - // This focusses the cursor on the bottom of the text area - const editor = await this.getEditor(); - const content = await editor.findByCssSelector('.ace_content'); - await content.click(); - const textArea = await testSubjects.find('console-textarea'); - // There should be autocomplete for this on all license levels - await textArea.pressKeys('\nGET s'); - await textArea.pressKeys([Key.CONTROL, Key.SPACE]); - } + public async promptAutocomplete() { + // This focusses the cursor on the bottom of the text area + const editor = await this.getEditor(); + const content = await editor.findByCssSelector('.ace_content'); + await content.click(); + const textArea = await this.testSubjects.find('console-textarea'); + // There should be autocomplete for this on all license levels + await textArea.pressKeys('\nGET s'); + await textArea.pressKeys([Key.CONTROL, Key.SPACE]); + } - public async hasAutocompleter(): Promise { - try { - return Boolean(await find.byCssSelector('.ace_autocomplete')); - } catch (e) { - return false; - } + public async hasAutocompleter(): Promise { + try { + return Boolean(await this.find.byCssSelector('.ace_autocomplete')); + } catch (e) { + return false; } } - - return new ConsolePage(); } diff --git a/test/functional/page_objects/context_page.ts b/test/functional/page_objects/context_page.ts index b758423d9346dd..05ea89cb65b3d0 100644 --- a/test/functional/page_objects/context_page.ts +++ b/test/functional/page_objects/context_page.ts @@ -8,93 +8,91 @@ import rison from 'rison-node'; import { getUrl } from '@kbn/test'; -import { FtrProviderContext } from '../ftr_provider_context'; +import { FtrService } from '../ftr_provider_context'; const DEFAULT_INITIAL_STATE = { columns: ['@message'], }; -export function ContextPageProvider({ getService, getPageObjects }: FtrProviderContext) { - const browser = getService('browser'); - const config = getService('config'); - const retry = getService('retry'); - const testSubjects = getService('testSubjects'); - const PageObjects = getPageObjects(['header', 'common']); - const log = getService('log'); +export class ContextPageObject extends FtrService { + private readonly browser = this.ctx.getService('browser'); + private readonly config = this.ctx.getService('config'); + private readonly retry = this.ctx.getService('retry'); + private readonly testSubjects = this.ctx.getService('testSubjects'); + private readonly header = this.ctx.getPageObject('header'); + private readonly common = this.ctx.getPageObject('common'); + private readonly log = this.ctx.getService('log'); - class ContextPage { - public async navigateTo(indexPattern: string, anchorId: string, overrideInitialState = {}) { - const initialState = rison.encode({ - ...DEFAULT_INITIAL_STATE, - ...overrideInitialState, - }); - const appUrl = getUrl.noAuth(config.get('servers.kibana'), { - ...config.get('apps.context'), - hash: `${config.get('apps.context.hash')}/${indexPattern}/${anchorId}?_a=${initialState}`, - }); + public async navigateTo(indexPattern: string, anchorId: string, overrideInitialState = {}) { + const initialState = rison.encode({ + ...DEFAULT_INITIAL_STATE, + ...overrideInitialState, + }); + const contextHash = this.config.get('apps.context.hash'); + const appUrl = getUrl.noAuth(this.config.get('servers.kibana'), { + ...this.config.get('apps.context'), + hash: `${contextHash}/${indexPattern}/${anchorId}?_a=${initialState}`, + }); - log.debug(`browser.get(${appUrl})`); + this.log.debug(`browser.get(${appUrl})`); - await browser.get(appUrl); - await PageObjects.header.awaitGlobalLoadingIndicatorHidden(); - await this.waitUntilContextLoadingHasFinished(); - // For lack of a better way, using a sleep to ensure page is loaded before proceeding - await PageObjects.common.sleep(1000); - } - - public async getPredecessorCountPicker() { - return await testSubjects.find('predecessorsCountPicker'); - } + await this.browser.get(appUrl); + await this.header.awaitGlobalLoadingIndicatorHidden(); + await this.waitUntilContextLoadingHasFinished(); + // For lack of a better way, using a sleep to ensure page is loaded before proceeding + await this.common.sleep(1000); + } - public async getSuccessorCountPicker() { - return await testSubjects.find('successorsCountPicker'); - } + public async getPredecessorCountPicker() { + return await this.testSubjects.find('predecessorsCountPicker'); + } - public async getPredecessorLoadMoreButton() { - return await testSubjects.find('predecessorsLoadMoreButton'); - } + public async getSuccessorCountPicker() { + return await this.testSubjects.find('successorsCountPicker'); + } - public async getSuccessorLoadMoreButton() { - return await testSubjects.find('successorsLoadMoreButton'); - } + public async getPredecessorLoadMoreButton() { + return await this.testSubjects.find('predecessorsLoadMoreButton'); + } - public async clickPredecessorLoadMoreButton() { - log.debug('Click Predecessor Load More Button'); - await retry.try(async () => { - const predecessorButton = await this.getPredecessorLoadMoreButton(); - await predecessorButton.click(); - }); - await this.waitUntilContextLoadingHasFinished(); - await PageObjects.header.waitUntilLoadingHasFinished(); - } + public async getSuccessorLoadMoreButton() { + return await this.testSubjects.find('successorsLoadMoreButton'); + } - public async clickSuccessorLoadMoreButton() { - log.debug('Click Successor Load More Button'); - await retry.try(async () => { - const sucessorButton = await this.getSuccessorLoadMoreButton(); - await sucessorButton.click(); - }); - await this.waitUntilContextLoadingHasFinished(); - await PageObjects.header.waitUntilLoadingHasFinished(); - } + public async clickPredecessorLoadMoreButton() { + this.log.debug('Click Predecessor Load More Button'); + await this.retry.try(async () => { + const predecessorButton = await this.getPredecessorLoadMoreButton(); + await predecessorButton.click(); + }); + await this.waitUntilContextLoadingHasFinished(); + await this.header.waitUntilLoadingHasFinished(); + } - public async waitUntilContextLoadingHasFinished() { - return await retry.try(async () => { - const successorLoadMoreButton = await this.getSuccessorLoadMoreButton(); - const predecessorLoadMoreButton = await this.getPredecessorLoadMoreButton(); - if ( - !( - (await successorLoadMoreButton.isEnabled()) && - (await successorLoadMoreButton.isDisplayed()) && - (await predecessorLoadMoreButton.isEnabled()) && - (await predecessorLoadMoreButton.isDisplayed()) - ) - ) { - throw new Error('loading context rows'); - } - }); - } + public async clickSuccessorLoadMoreButton() { + this.log.debug('Click Successor Load More Button'); + await this.retry.try(async () => { + const sucessorButton = await this.getSuccessorLoadMoreButton(); + await sucessorButton.click(); + }); + await this.waitUntilContextLoadingHasFinished(); + await this.header.waitUntilLoadingHasFinished(); } - return new ContextPage(); + public async waitUntilContextLoadingHasFinished() { + return await this.retry.try(async () => { + const successorLoadMoreButton = await this.getSuccessorLoadMoreButton(); + const predecessorLoadMoreButton = await this.getPredecessorLoadMoreButton(); + if ( + !( + (await successorLoadMoreButton.isEnabled()) && + (await successorLoadMoreButton.isDisplayed()) && + (await predecessorLoadMoreButton.isEnabled()) && + (await predecessorLoadMoreButton.isDisplayed()) + ) + ) { + throw new Error('loading context rows'); + } + }); + } } diff --git a/test/functional/page_objects/dashboard_page.ts b/test/functional/page_objects/dashboard_page.ts index ba75ab75cc6e89..37dd4520a48f4c 100644 --- a/test/functional/page_objects/dashboard_page.ts +++ b/test/functional/page_objects/dashboard_page.ts @@ -9,668 +9,665 @@ export const PIE_CHART_VIS_NAME = 'Visualization PieChart'; export const AREA_CHART_VIS_NAME = 'Visualization漢字 AreaChart'; export const LINE_CHART_VIS_NAME = 'Visualization漢字 LineChart'; -import { FtrProviderContext } from '../ftr_provider_context'; - -export function DashboardPageProvider({ getService, getPageObjects }: FtrProviderContext) { - const log = getService('log'); - const find = getService('find'); - const retry = getService('retry'); - const browser = getService('browser'); - const globalNav = getService('globalNav'); - const esArchiver = getService('esArchiver'); - const kibanaServer = getService('kibanaServer'); - const testSubjects = getService('testSubjects'); - const dashboardAddPanel = getService('dashboardAddPanel'); - const renderable = getService('renderable'); - const listingTable = getService('listingTable'); - const elasticChart = getService('elasticChart'); - const PageObjects = getPageObjects(['common', 'header', 'visualize', 'discover']); - - interface SaveDashboardOptions { - /** - * @default true - */ - waitDialogIsClosed?: boolean; - exitFromEditMode?: boolean; - needsConfirm?: boolean; - storeTimeWithDashboard?: boolean; - saveAsNew?: boolean; - tags?: string[]; - } - - class DashboardPage { - async initTests({ kibanaIndex = 'dashboard/legacy', defaultIndex = 'logstash-*' } = {}) { - log.debug('load kibana index with visualizations and log data'); - await esArchiver.load(kibanaIndex); - await kibanaServer.uiSettings.replace({ defaultIndex }); - await PageObjects.common.navigateToApp('dashboard'); - } - - public async preserveCrossAppState() { - const url = await browser.getCurrentUrl(); - await browser.get(url, false); - await PageObjects.header.waitUntilLoadingHasFinished(); - } - - public async clickFullScreenMode() { - log.debug(`clickFullScreenMode`); - await testSubjects.click('dashboardFullScreenMode'); - await testSubjects.exists('exitFullScreenModeLogo'); - await this.waitForRenderComplete(); - } - - public async exitFullScreenMode() { - log.debug(`exitFullScreenMode`); - const logoButton = await this.getExitFullScreenLogoButton(); - await logoButton.moveMouseTo(); - await this.clickExitFullScreenTextButton(); - } - - public async fullScreenModeMenuItemExists() { - return await testSubjects.exists('dashboardFullScreenMode'); - } +import { FtrService } from '../ftr_provider_context'; + +interface SaveDashboardOptions { + /** + * @default true + */ + waitDialogIsClosed?: boolean; + exitFromEditMode?: boolean; + needsConfirm?: boolean; + storeTimeWithDashboard?: boolean; + saveAsNew?: boolean; + tags?: string[]; +} - public async exitFullScreenTextButtonExists() { - return await testSubjects.exists('exitFullScreenModeText'); - } +export class DashboardPageObject extends FtrService { + private readonly log = this.ctx.getService('log'); + private readonly find = this.ctx.getService('find'); + private readonly retry = this.ctx.getService('retry'); + private readonly browser = this.ctx.getService('browser'); + private readonly globalNav = this.ctx.getService('globalNav'); + private readonly esArchiver = this.ctx.getService('esArchiver'); + private readonly kibanaServer = this.ctx.getService('kibanaServer'); + private readonly testSubjects = this.ctx.getService('testSubjects'); + private readonly dashboardAddPanel = this.ctx.getService('dashboardAddPanel'); + private readonly renderable = this.ctx.getService('renderable'); + private readonly listingTable = this.ctx.getService('listingTable'); + private readonly elasticChart = this.ctx.getService('elasticChart'); + private readonly common = this.ctx.getPageObject('common'); + private readonly header = this.ctx.getPageObject('header'); + private readonly visualize = this.ctx.getPageObject('visualize'); + private readonly discover = this.ctx.getPageObject('discover'); + + async initTests({ kibanaIndex = 'dashboard/legacy', defaultIndex = 'logstash-*' } = {}) { + this.log.debug('load kibana index with visualizations and log data'); + await this.esArchiver.load(kibanaIndex); + await this.kibanaServer.uiSettings.replace({ defaultIndex }); + await this.common.navigateToApp('dashboard'); + } - public async getExitFullScreenTextButton() { - return await testSubjects.find('exitFullScreenModeText'); - } + public async preserveCrossAppState() { + const url = await this.browser.getCurrentUrl(); + await this.browser.get(url, false); + await this.header.waitUntilLoadingHasFinished(); + } - public async exitFullScreenLogoButtonExists() { - return await testSubjects.exists('exitFullScreenModeLogo'); - } + public async clickFullScreenMode() { + this.log.debug(`clickFullScreenMode`); + await this.testSubjects.click('dashboardFullScreenMode'); + await this.testSubjects.exists('exitFullScreenModeLogo'); + await this.waitForRenderComplete(); + } - public async getExitFullScreenLogoButton() { - return await testSubjects.find('exitFullScreenModeLogo'); - } + public async exitFullScreenMode() { + this.log.debug(`exitFullScreenMode`); + const logoButton = await this.getExitFullScreenLogoButton(); + await logoButton.moveMouseTo(); + await this.clickExitFullScreenTextButton(); + } - public async clickExitFullScreenLogoButton() { - await testSubjects.click('exitFullScreenModeLogo'); - await this.waitForRenderComplete(); - } + public async fullScreenModeMenuItemExists() { + return await this.testSubjects.exists('dashboardFullScreenMode'); + } - public async clickExitFullScreenTextButton() { - await testSubjects.click('exitFullScreenModeText'); - await this.waitForRenderComplete(); - } + public async exitFullScreenTextButtonExists() { + return await this.testSubjects.exists('exitFullScreenModeText'); + } - public async getDashboardIdFromCurrentUrl() { - const currentUrl = await browser.getCurrentUrl(); - const id = this.getDashboardIdFromUrl(currentUrl); + public async getExitFullScreenTextButton() { + return await this.testSubjects.find('exitFullScreenModeText'); + } - log.debug(`Dashboard id extracted from ${currentUrl} is ${id}`); + public async exitFullScreenLogoButtonExists() { + return await this.testSubjects.exists('exitFullScreenModeLogo'); + } - return id; - } + public async getExitFullScreenLogoButton() { + return await this.testSubjects.find('exitFullScreenModeLogo'); + } - public getDashboardIdFromUrl(url: string) { - const urlSubstring = '#/view/'; - const startOfIdIndex = url.indexOf(urlSubstring) + urlSubstring.length; - const endIndex = url.indexOf('?'); - const id = url.substring(startOfIdIndex, endIndex < 0 ? url.length : endIndex); - return id; - } + public async clickExitFullScreenLogoButton() { + await this.testSubjects.click('exitFullScreenModeLogo'); + await this.waitForRenderComplete(); + } - public async expectUnsavedChangesListingExists(title: string) { - log.debug(`Expect Unsaved Changes Listing Exists for `, title); - await testSubjects.existOrFail(`edit-unsaved-${title.split(' ').join('-')}`); - } + public async clickExitFullScreenTextButton() { + await this.testSubjects.click('exitFullScreenModeText'); + await this.waitForRenderComplete(); + } - public async expectUnsavedChangesDoesNotExist(title: string) { - log.debug(`Expect Unsaved Changes Listing Does Not Exist for `, title); - await testSubjects.missingOrFail(`edit-unsaved-${title.split(' ').join('-')}`); - } + public async getDashboardIdFromCurrentUrl() { + const currentUrl = await this.browser.getCurrentUrl(); + const id = this.getDashboardIdFromUrl(currentUrl); - public async clickUnsavedChangesContinueEditing(title: string) { - log.debug(`Click Unsaved Changes Continue Editing `, title); - await testSubjects.existOrFail(`edit-unsaved-${title.split(' ').join('-')}`); - await testSubjects.click(`edit-unsaved-${title.split(' ').join('-')}`); - } + this.log.debug(`Dashboard id extracted from ${currentUrl} is ${id}`); - public async clickUnsavedChangesDiscard(title: string, confirmDiscard = true) { - log.debug(`Click Unsaved Changes Discard for `, title); - await testSubjects.existOrFail(`discard-unsaved-${title.split(' ').join('-')}`); - await testSubjects.click(`discard-unsaved-${title.split(' ').join('-')}`); - if (confirmDiscard) { - await PageObjects.common.clickConfirmOnModal(); - } else { - await PageObjects.common.clickCancelOnModal(); - } - } + return id; + } - /** - * Returns true if already on the dashboard landing page (that page doesn't have a link to itself). - * @returns {Promise} - */ - public async onDashboardLandingPage() { - log.debug(`onDashboardLandingPage`); - return await listingTable.onListingPage('dashboard'); - } + public getDashboardIdFromUrl(url: string) { + const urlSubstring = '#/view/'; + const startOfIdIndex = url.indexOf(urlSubstring) + urlSubstring.length; + const endIndex = url.indexOf('?'); + const id = url.substring(startOfIdIndex, endIndex < 0 ? url.length : endIndex); + return id; + } - public async expectExistsDashboardLandingPage() { - log.debug(`expectExistsDashboardLandingPage`); - await testSubjects.existOrFail('dashboardLandingPage'); - } + public async expectUnsavedChangesListingExists(title: string) { + this.log.debug(`Expect Unsaved Changes Listing Exists for `, title); + await this.testSubjects.existOrFail(`edit-unsaved-${title.split(' ').join('-')}`); + } - public async clickDashboardBreadcrumbLink() { - log.debug('clickDashboardBreadcrumbLink'); - await testSubjects.click('breadcrumb dashboardListingBreadcrumb first'); - } + public async expectUnsavedChangesDoesNotExist(title: string) { + this.log.debug(`Expect Unsaved Changes Listing Does Not Exist for `, title); + await this.testSubjects.missingOrFail(`edit-unsaved-${title.split(' ').join('-')}`); + } - public async expectOnDashboard(dashboardTitle: string) { - await retry.waitFor( - 'last breadcrumb to have dashboard title', - async () => (await globalNav.getLastBreadcrumb()) === dashboardTitle - ); - } + public async clickUnsavedChangesContinueEditing(title: string) { + this.log.debug(`Click Unsaved Changes Continue Editing `, title); + await this.testSubjects.existOrFail(`edit-unsaved-${title.split(' ').join('-')}`); + await this.testSubjects.click(`edit-unsaved-${title.split(' ').join('-')}`); + } - public async gotoDashboardLandingPage(ignorePageLeaveWarning = true) { - log.debug('gotoDashboardLandingPage'); - const onPage = await this.onDashboardLandingPage(); - if (!onPage) { - await this.clickDashboardBreadcrumbLink(); - await retry.try(async () => { - const warning = await testSubjects.exists('confirmModalTitleText'); - if (warning) { - await testSubjects.click( - ignorePageLeaveWarning ? 'confirmModalConfirmButton' : 'confirmModalCancelButton' - ); - } - }); - await this.expectExistsDashboardLandingPage(); - } + public async clickUnsavedChangesDiscard(title: string, confirmDiscard = true) { + this.log.debug(`Click Unsaved Changes Discard for `, title); + await this.testSubjects.existOrFail(`discard-unsaved-${title.split(' ').join('-')}`); + await this.testSubjects.click(`discard-unsaved-${title.split(' ').join('-')}`); + if (confirmDiscard) { + await this.common.clickConfirmOnModal(); + } else { + await this.common.clickCancelOnModal(); } + } - public async clickClone() { - log.debug('Clicking clone'); - await testSubjects.click('dashboardClone'); - } + /** + * Returns true if already on the dashboard landing page (that page doesn't have a link to itself). + * @returns {Promise} + */ + public async onDashboardLandingPage() { + this.log.debug(`onDashboardLandingPage`); + return await this.listingTable.onListingPage('dashboard'); + } - public async getCloneTitle() { - return await testSubjects.getAttribute('clonedDashboardTitle', 'value'); - } + public async expectExistsDashboardLandingPage() { + this.log.debug(`expectExistsDashboardLandingPage`); + await this.testSubjects.existOrFail('dashboardLandingPage'); + } - public async confirmClone() { - log.debug('Confirming clone'); - await testSubjects.click('cloneConfirmButton'); - } + public async clickDashboardBreadcrumbLink() { + this.log.debug('clickDashboardBreadcrumbLink'); + await this.testSubjects.click('breadcrumb dashboardListingBreadcrumb first'); + } - public async cancelClone() { - log.debug('Canceling clone'); - await testSubjects.click('cloneCancelButton'); - } + public async expectOnDashboard(dashboardTitle: string) { + await this.retry.waitFor( + 'last breadcrumb to have dashboard title', + async () => (await this.globalNav.getLastBreadcrumb()) === dashboardTitle + ); + } - public async setClonedDashboardTitle(title: string) { - await testSubjects.setValue('clonedDashboardTitle', title); + public async gotoDashboardLandingPage(ignorePageLeaveWarning = true) { + this.log.debug('gotoDashboardLandingPage'); + const onPage = await this.onDashboardLandingPage(); + if (!onPage) { + await this.clickDashboardBreadcrumbLink(); + await this.retry.try(async () => { + const warning = await this.testSubjects.exists('confirmModalTitleText'); + if (warning) { + await this.testSubjects.click( + ignorePageLeaveWarning ? 'confirmModalConfirmButton' : 'confirmModalCancelButton' + ); + } + }); + await this.expectExistsDashboardLandingPage(); } + } - /** - * Asserts that the duplicate title warning is either displayed or not displayed. - * @param { displayed: boolean } - */ - public async expectDuplicateTitleWarningDisplayed({ displayed = true }) { - if (displayed) { - await testSubjects.existOrFail('titleDupicateWarnMsg'); - } else { - await testSubjects.missingOrFail('titleDupicateWarnMsg'); - } - } + public async clickClone() { + this.log.debug('Clicking clone'); + await this.testSubjects.click('dashboardClone'); + } - /** - * Asserts that the toolbar pagination (count and arrows) is either displayed or not displayed. + public async getCloneTitle() { + return await this.testSubjects.getAttribute('clonedDashboardTitle', 'value'); + } - */ - public async expectToolbarPaginationDisplayed() { - const isLegacyDefault = PageObjects.discover.useLegacyTable(); - if (isLegacyDefault) { - const subjects = ['btnPrevPage', 'btnNextPage', 'toolBarPagerText']; - await Promise.all(subjects.map(async (subj) => await testSubjects.existOrFail(subj))); - } else { - const subjects = ['pagination-button-previous', 'pagination-button-next']; + public async confirmClone() { + this.log.debug('Confirming clone'); + await this.testSubjects.click('cloneConfirmButton'); + } - await Promise.all(subjects.map(async (subj) => await testSubjects.existOrFail(subj))); - const paginationListExists = await find.existsByCssSelector('.euiPagination__list'); - if (!paginationListExists) { - throw new Error(`expected discover data grid pagination list to exist`); - } - } - } + public async cancelClone() { + this.log.debug('Canceling clone'); + await this.testSubjects.click('cloneCancelButton'); + } - public async switchToEditMode() { - log.debug('Switching to edit mode'); - await testSubjects.click('dashboardEditMode'); - // wait until the count of dashboard panels equals the count of toggle menu icons - await retry.waitFor('in edit mode', async () => { - const panels = await testSubjects.findAll('embeddablePanel', 2500); - const menuIcons = await testSubjects.findAll('embeddablePanelToggleMenuIcon', 2500); - return panels.length === menuIcons.length; - }); - } + public async setClonedDashboardTitle(title: string) { + await this.testSubjects.setValue('clonedDashboardTitle', title); + } - public async getIsInViewMode() { - log.debug('getIsInViewMode'); - return await testSubjects.exists('dashboardEditMode'); + /** + * Asserts that the duplicate title warning is either displayed or not displayed. + * @param { displayed: boolean } + */ + public async expectDuplicateTitleWarningDisplayed({ displayed = true }) { + if (displayed) { + await this.testSubjects.existOrFail('titleDupicateWarnMsg'); + } else { + await this.testSubjects.missingOrFail('titleDupicateWarnMsg'); } + } - public async clickCancelOutOfEditMode(accept = true) { - log.debug('clickCancelOutOfEditMode'); - await testSubjects.click('dashboardViewOnlyMode'); - if (accept) { - const confirmation = await testSubjects.exists('dashboardDiscardConfirmKeep'); - if (confirmation) { - await testSubjects.click('dashboardDiscardConfirmKeep'); - } + /** + * Asserts that the toolbar pagination (count and arrows) is either displayed or not displayed. + + */ + public async expectToolbarPaginationDisplayed() { + const isLegacyDefault = this.discover.useLegacyTable(); + if (isLegacyDefault) { + const subjects = ['btnPrevPage', 'btnNextPage', 'toolBarPagerText']; + await Promise.all(subjects.map(async (subj) => await this.testSubjects.existOrFail(subj))); + } else { + const subjects = ['pagination-button-previous', 'pagination-button-next']; + + await Promise.all(subjects.map(async (subj) => await this.testSubjects.existOrFail(subj))); + const paginationListExists = await this.find.existsByCssSelector('.euiPagination__list'); + if (!paginationListExists) { + throw new Error(`expected discover data grid pagination list to exist`); } } + } - public async clickDiscardChanges(accept = true) { - log.debug('clickDiscardChanges'); - await testSubjects.click('dashboardViewOnlyMode'); - if (accept) { - const confirmation = await testSubjects.exists('dashboardDiscardConfirmDiscard'); - if (confirmation) { - await testSubjects.click('dashboardDiscardConfirmDiscard'); - } - } - } + public async switchToEditMode() { + this.log.debug('Switching to edit mode'); + if (await this.testSubjects.exists('dashboardEditMode')) { + // if the dashboard is not already in edit mode + await this.testSubjects.click('dashboardEditMode'); + } + // wait until the count of dashboard panels equals the count of toggle menu icons + await this.retry.waitFor('in edit mode', async () => { + const panels = await this.testSubjects.findAll('embeddablePanel', 2500); + const menuIcons = await this.testSubjects.findAll('embeddablePanelToggleMenuIcon', 2500); + return panels.length === menuIcons.length; + }); + } - public async clickQuickSave() { - await this.expectQuickSaveButtonEnabled(); - log.debug('clickQuickSave'); - await testSubjects.click('dashboardQuickSaveMenuItem'); - } + public async getIsInViewMode() { + this.log.debug('getIsInViewMode'); + return await this.testSubjects.exists('dashboardEditMode'); + } - public async clickNewDashboard(continueEditing = false) { - await listingTable.clickNewButton('createDashboardPromptButton'); - if (await testSubjects.exists('dashboardCreateConfirm')) { - if (continueEditing) { - await testSubjects.click('dashboardCreateConfirmContinue'); - } else { - await testSubjects.click('dashboardCreateConfirmStartOver'); - } + public async clickCancelOutOfEditMode(accept = true) { + this.log.debug('clickCancelOutOfEditMode'); + if (await this.getIsInViewMode()) return; + await this.retry.waitFor('leave edit mode button enabled', async () => { + const leaveEditModeButton = await this.testSubjects.find('dashboardViewOnlyMode'); + const isDisabled = await leaveEditModeButton.getAttribute('disabled'); + return !isDisabled; + }); + await this.testSubjects.click('dashboardViewOnlyMode'); + if (accept) { + const confirmation = await this.testSubjects.exists('confirmModalTitleText'); + if (confirmation) { + await this.common.clickConfirmOnModal(); } - // make sure the dashboard page is shown - await this.waitForRenderComplete(); } + } + + public async clickQuickSave() { + await this.expectQuickSaveButtonEnabled(); + this.log.debug('clickQuickSave'); + await this.testSubjects.click('dashboardQuickSaveMenuItem'); + } - public async clickNewDashboardExpectWarning(continueEditing = false) { - await listingTable.clickNewButton('createDashboardPromptButton'); - await testSubjects.existOrFail('dashboardCreateConfirm'); + public async clickNewDashboard(continueEditing = false) { + await this.listingTable.clickNewButton('createDashboardPromptButton'); + if (await this.testSubjects.exists('dashboardCreateConfirm')) { if (continueEditing) { - await testSubjects.click('dashboardCreateConfirmContinue'); + await this.testSubjects.click('dashboardCreateConfirmContinue'); } else { - await testSubjects.click('dashboardCreateConfirmStartOver'); + await this.testSubjects.click('dashboardCreateConfirmStartOver'); } - // make sure the dashboard page is shown - await this.waitForRenderComplete(); - } - - public async clickCreateDashboardPrompt() { - await testSubjects.click('createDashboardPromptButton'); } + // make sure the dashboard page is shown + await this.waitForRenderComplete(); + } - public async getCreateDashboardPromptExists() { - return await testSubjects.exists('createDashboardPromptButton'); + public async clickNewDashboardExpectWarning(continueEditing = false) { + await this.listingTable.clickNewButton('createDashboardPromptButton'); + await this.testSubjects.existOrFail('dashboardCreateConfirm'); + if (continueEditing) { + await this.testSubjects.click('dashboardCreateConfirmContinue'); + } else { + await this.testSubjects.click('dashboardCreateConfirmStartOver'); } + // make sure the dashboard page is shown + await this.waitForRenderComplete(); + } - public async isOptionsOpen() { - log.debug('isOptionsOpen'); - return await testSubjects.exists('dashboardOptionsMenu'); - } + public async clickCreateDashboardPrompt() { + await this.testSubjects.click('createDashboardPromptButton'); + } - public async openOptions() { - log.debug('openOptions'); - const isOpen = await this.isOptionsOpen(); - if (!isOpen) { - return await testSubjects.click('dashboardOptionsButton'); - } - } + public async getCreateDashboardPromptExists() { + return await this.testSubjects.exists('createDashboardPromptButton'); + } - // avoids any 'Object with id x not found' errors when switching tests. - public async clearSavedObjectsFromAppLinks() { - await PageObjects.header.clickVisualize(); - await PageObjects.visualize.gotoLandingPage(); - await PageObjects.header.clickDashboard(); - await this.gotoDashboardLandingPage(); - } + public async isOptionsOpen() { + this.log.debug('isOptionsOpen'); + return await this.testSubjects.exists('dashboardOptionsMenu'); + } - public async isMarginsOn() { - log.debug('isMarginsOn'); - await this.openOptions(); - return await testSubjects.getAttribute('dashboardMarginsCheckbox', 'checked'); + public async openOptions() { + this.log.debug('openOptions'); + const isOpen = await this.isOptionsOpen(); + if (!isOpen) { + return await this.testSubjects.click('dashboardOptionsButton'); } + } - public async useMargins(on = true) { - await this.openOptions(); - const isMarginsOn = await this.isMarginsOn(); - if (isMarginsOn !== 'on') { - return await testSubjects.click('dashboardMarginsCheckbox'); - } - } + // avoids any 'Object with id x not found' errors when switching tests. + public async clearSavedObjectsFromAppLinks() { + await this.header.clickVisualize(); + await this.visualize.gotoLandingPage(); + await this.header.clickDashboard(); + await this.gotoDashboardLandingPage(); + } - public async isColorSyncOn() { - log.debug('isColorSyncOn'); - await this.openOptions(); - return await testSubjects.getAttribute('dashboardSyncColorsCheckbox', 'checked'); - } + public async isMarginsOn() { + this.log.debug('isMarginsOn'); + await this.openOptions(); + return await this.testSubjects.getAttribute('dashboardMarginsCheckbox', 'checked'); + } - public async useColorSync(on = true) { - await this.openOptions(); - const isColorSyncOn = await this.isColorSyncOn(); - if (isColorSyncOn !== 'on') { - return await testSubjects.click('dashboardSyncColorsCheckbox'); - } + public async useMargins(on = true) { + await this.openOptions(); + const isMarginsOn = await this.isMarginsOn(); + if (isMarginsOn !== 'on') { + return await this.testSubjects.click('dashboardMarginsCheckbox'); } + } - public async gotoDashboardEditMode(dashboardName: string) { - await this.loadSavedDashboard(dashboardName); - await this.switchToEditMode(); - } + public async isColorSyncOn() { + this.log.debug('isColorSyncOn'); + await this.openOptions(); + return await this.testSubjects.getAttribute('dashboardSyncColorsCheckbox', 'checked'); + } - public async renameDashboard(dashboardName: string) { - log.debug(`Naming dashboard ` + dashboardName); - await testSubjects.click('dashboardRenameButton'); - await testSubjects.setValue('savedObjectTitle', dashboardName); + public async useColorSync(on = true) { + await this.openOptions(); + const isColorSyncOn = await this.isColorSyncOn(); + if (isColorSyncOn !== 'on') { + return await this.testSubjects.click('dashboardSyncColorsCheckbox'); } + } - /** - * Save the current dashboard with the specified name and options and - * verify that the save was successful, close the toast and return the - * toast message - * - * @param dashboardName {String} - * @param saveOptions {{storeTimeWithDashboard: boolean, saveAsNew: boolean, needsConfirm: false, waitDialogIsClosed: boolean }} - */ - public async saveDashboard( - dashboardName: string, - saveOptions: SaveDashboardOptions = { waitDialogIsClosed: true, exitFromEditMode: true } - ) { - await retry.try(async () => { - await this.enterDashboardTitleAndClickSave(dashboardName, saveOptions); - - if (saveOptions.needsConfirm) { - await this.ensureDuplicateTitleCallout(); - await this.clickSave(); - } + public async gotoDashboardEditMode(dashboardName: string) { + await this.loadSavedDashboard(dashboardName); + await this.switchToEditMode(); + } - // Confirm that the Dashboard has actually been saved - await testSubjects.existOrFail('saveDashboardSuccess'); - }); - const message = await PageObjects.common.closeToast(); - await PageObjects.header.waitUntilLoadingHasFinished(); - await PageObjects.common.waitForSaveModalToClose(); + public async renameDashboard(dashboardName: string) { + this.log.debug(`Naming dashboard ` + dashboardName); + await this.testSubjects.click('dashboardRenameButton'); + await this.testSubjects.setValue('savedObjectTitle', dashboardName); + } - const isInViewMode = await testSubjects.exists('dashboardEditMode'); - if (saveOptions.exitFromEditMode && !isInViewMode) { - await this.clickCancelOutOfEditMode(); + /** + * Save the current dashboard with the specified name and options and + * verify that the save was successful, close the toast and return the + * toast message + * + * @param dashboardName {String} + * @param saveOptions {{storeTimeWithDashboard: boolean, saveAsNew: boolean, needsConfirm: false, waitDialogIsClosed: boolean }} + */ + public async saveDashboard( + dashboardName: string, + saveOptions: SaveDashboardOptions = { waitDialogIsClosed: true, exitFromEditMode: true } + ) { + await this.retry.try(async () => { + await this.enterDashboardTitleAndClickSave(dashboardName, saveOptions); + + if (saveOptions.needsConfirm) { + await this.ensureDuplicateTitleCallout(); + await this.clickSave(); } - await PageObjects.header.waitUntilLoadingHasFinished(); - return message; - } + // Confirm that the Dashboard has actually been saved + await this.testSubjects.existOrFail('saveDashboardSuccess'); + }); + const message = await this.common.closeToast(); + await this.header.waitUntilLoadingHasFinished(); + await this.common.waitForSaveModalToClose(); - public async cancelSave() { - log.debug('Canceling save'); - await testSubjects.click('saveCancelButton'); + const isInViewMode = await this.testSubjects.exists('dashboardEditMode'); + if (saveOptions.exitFromEditMode && !isInViewMode) { + await this.clickCancelOutOfEditMode(); } + await this.header.waitUntilLoadingHasFinished(); - public async clickSave() { - log.debug('DashboardPage.clickSave'); - await testSubjects.click('confirmSaveSavedObjectButton'); - } + return message; + } - /** - * - * @param dashboardTitle {String} - * @param saveOptions {{storeTimeWithDashboard: boolean, saveAsNew: boolean, waitDialogIsClosed: boolean}} - */ - public async enterDashboardTitleAndClickSave( - dashboardTitle: string, - saveOptions: SaveDashboardOptions = { waitDialogIsClosed: true } - ) { - await testSubjects.click('dashboardSaveMenuItem'); - const modalDialog = await testSubjects.find('savedObjectSaveModal'); - - log.debug('entering new title'); - await testSubjects.setValue('savedObjectTitle', dashboardTitle); - - if (saveOptions.storeTimeWithDashboard !== undefined) { - await this.setStoreTimeWithDashboard(saveOptions.storeTimeWithDashboard); - } + public async cancelSave() { + this.log.debug('Canceling save'); + await this.testSubjects.click('saveCancelButton'); + } - const saveAsNewCheckboxExists = await testSubjects.exists('saveAsNewCheckbox'); - if (saveAsNewCheckboxExists) { - await this.setSaveAsNewCheckBox(Boolean(saveOptions.saveAsNew)); - } + public async clickSave() { + this.log.debug('DashboardPage.clickSave'); + await this.testSubjects.click('confirmSaveSavedObjectButton'); + } - if (saveOptions.tags) { - await this.selectDashboardTags(saveOptions.tags); - } + /** + * + * @param dashboardTitle {String} + * @param saveOptions {{storeTimeWithDashboard: boolean, saveAsNew: boolean, waitDialogIsClosed: boolean}} + */ + public async enterDashboardTitleAndClickSave( + dashboardTitle: string, + saveOptions: SaveDashboardOptions = { waitDialogIsClosed: true } + ) { + await this.testSubjects.click('dashboardSaveMenuItem'); + const modalDialog = await this.testSubjects.find('savedObjectSaveModal'); - await this.clickSave(); - if (saveOptions.waitDialogIsClosed) { - await testSubjects.waitForDeleted(modalDialog); - } + this.log.debug('entering new title'); + await this.testSubjects.setValue('savedObjectTitle', dashboardTitle); + + if (saveOptions.storeTimeWithDashboard !== undefined) { + await this.setStoreTimeWithDashboard(saveOptions.storeTimeWithDashboard); } - public async ensureDuplicateTitleCallout() { - await testSubjects.existOrFail('titleDupicateWarnMsg'); + const saveAsNewCheckboxExists = await this.testSubjects.exists('saveAsNewCheckbox'); + if (saveAsNewCheckboxExists) { + await this.setSaveAsNewCheckBox(Boolean(saveOptions.saveAsNew)); } - public async selectDashboardTags(tagNames: string[]) { - await testSubjects.click('savedObjectTagSelector'); - for (const tagName of tagNames) { - await testSubjects.click(`tagSelectorOption-${tagName.replace(' ', '_')}`); - } - await testSubjects.click('savedObjectTitle'); + if (saveOptions.tags) { + await this.selectDashboardTags(saveOptions.tags); } - /** - * @param dashboardTitle {String} - */ - public async enterDashboardTitleAndPressEnter(dashboardTitle: string) { - await testSubjects.click('dashboardSaveMenuItem'); - const modalDialog = await testSubjects.find('savedObjectSaveModal'); + await this.clickSave(); + if (saveOptions.waitDialogIsClosed) { + await this.testSubjects.waitForDeleted(modalDialog); + } + } - log.debug('entering new title'); - await testSubjects.setValue('savedObjectTitle', dashboardTitle); + public async ensureDuplicateTitleCallout() { + await this.testSubjects.existOrFail('titleDupicateWarnMsg'); + } - await PageObjects.common.pressEnterKey(); - await testSubjects.waitForDeleted(modalDialog); + public async selectDashboardTags(tagNames: string[]) { + await this.testSubjects.click('savedObjectTagSelector'); + for (const tagName of tagNames) { + await this.testSubjects.click(`tagSelectorOption-${tagName.replace(' ', '_')}`); } + await this.testSubjects.click('savedObjectTitle'); + } - // use the search filter box to narrow the results down to a single - // entry, or at least to a single page of results - public async loadSavedDashboard(dashboardName: string) { - log.debug(`Load Saved Dashboard ${dashboardName}`); + /** + * @param dashboardTitle {String} + */ + public async enterDashboardTitleAndPressEnter(dashboardTitle: string) { + await this.testSubjects.click('dashboardSaveMenuItem'); + const modalDialog = await this.testSubjects.find('savedObjectSaveModal'); - await this.gotoDashboardLandingPage(); + this.log.debug('entering new title'); + await this.testSubjects.setValue('savedObjectTitle', dashboardTitle); - await listingTable.searchForItemWithName(dashboardName); - await retry.try(async () => { - await listingTable.clickItemLink('dashboard', dashboardName); - await PageObjects.header.waitUntilLoadingHasFinished(); - // check Dashboard landing page is not present - await testSubjects.missingOrFail('dashboardLandingPage', { timeout: 10000 }); - }); - } + await this.common.pressEnterKey(); + await this.testSubjects.waitForDeleted(modalDialog); + } - public async getPanelTitles() { - log.debug('in getPanelTitles'); - const titleObjects = await testSubjects.findAll('dashboardPanelTitle'); - return await Promise.all(titleObjects.map(async (title) => await title.getVisibleText())); - } + // use the search filter box to narrow the results down to a single + // entry, or at least to a single page of results + public async loadSavedDashboard(dashboardName: string) { + this.log.debug(`Load Saved Dashboard ${dashboardName}`); - public async getPanelDimensions() { - const panels = await find.allByCssSelector('.react-grid-item'); // These are gridster-defined elements and classes - return await Promise.all( - panels.map(async (panel) => { - const size = await panel.getSize(); - return { - width: size.width, - height: size.height, - }; - }) - ); - } + await this.gotoDashboardLandingPage(); - public async getPanelCount() { - log.debug('getPanelCount'); - const panels = await testSubjects.findAll('embeddablePanel'); - return panels.length; - } + await this.listingTable.searchForItemWithName(dashboardName); + await this.retry.try(async () => { + await this.listingTable.clickItemLink('dashboard', dashboardName); + await this.header.waitUntilLoadingHasFinished(); + // check Dashboard landing page is not present + await this.testSubjects.missingOrFail('dashboardLandingPage', { timeout: 10000 }); + }); + } - public getTestVisualizations() { - return [ - { name: PIE_CHART_VIS_NAME, description: 'PieChart' }, - { name: 'Visualization☺ VerticalBarChart', description: 'VerticalBarChart' }, - { name: AREA_CHART_VIS_NAME, description: 'AreaChart' }, - { name: 'Visualization☺漢字 DataTable', description: 'DataTable' }, - { name: LINE_CHART_VIS_NAME, description: 'LineChart' }, - { name: 'Visualization TileMap', description: 'TileMap' }, - { name: 'Visualization MetricChart', description: 'MetricChart' }, - ]; - } + public async getPanelTitles() { + this.log.debug('in getPanelTitles'); + const titleObjects = await this.testSubjects.findAll('dashboardPanelTitle'); + return await Promise.all(titleObjects.map(async (title) => await title.getVisibleText())); + } - public getTestVisualizationNames() { - return this.getTestVisualizations().map((visualization) => visualization.name); - } + public async getPanelDimensions() { + const panels = await this.find.allByCssSelector('.react-grid-item'); // These are gridster-defined elements and classes + return await Promise.all( + panels.map(async (panel) => { + const size = await panel.getSize(); + return { + width: size.width, + height: size.height, + }; + }) + ); + } - public getTestVisualizationDescriptions() { - return this.getTestVisualizations().map((visualization) => visualization.description); - } + public async getPanelCount() { + this.log.debug('getPanelCount'); + const panels = await this.testSubjects.findAll('embeddablePanel'); + return panels.length; + } - public async getDashboardPanels() { - return await testSubjects.findAll('embeddablePanel'); - } + public getTestVisualizations() { + return [ + { name: PIE_CHART_VIS_NAME, description: 'PieChart' }, + { name: 'Visualization☺ VerticalBarChart', description: 'VerticalBarChart' }, + { name: AREA_CHART_VIS_NAME, description: 'AreaChart' }, + { name: 'Visualization☺漢字 DataTable', description: 'DataTable' }, + { name: LINE_CHART_VIS_NAME, description: 'LineChart' }, + { name: 'Visualization TileMap', description: 'TileMap' }, + { name: 'Visualization MetricChart', description: 'MetricChart' }, + ]; + } - public async addVisualizations(visualizations: string[]) { - await dashboardAddPanel.addVisualizations(visualizations); - } + public getTestVisualizationNames() { + return this.getTestVisualizations().map((visualization) => visualization.name); + } - public async setSaveAsNewCheckBox(checked: boolean) { - log.debug('saveAsNewCheckbox: ' + checked); - let saveAsNewCheckbox = await testSubjects.find('saveAsNewCheckbox'); - const isAlreadyChecked = (await saveAsNewCheckbox.getAttribute('aria-checked')) === 'true'; - if (isAlreadyChecked !== checked) { - log.debug('Flipping save as new checkbox'); - saveAsNewCheckbox = await testSubjects.find('saveAsNewCheckbox'); - await retry.try(() => saveAsNewCheckbox.click()); - } - } + public getTestVisualizationDescriptions() { + return this.getTestVisualizations().map((visualization) => visualization.description); + } - public async setStoreTimeWithDashboard(checked: boolean) { - log.debug('Storing time with dashboard: ' + checked); - let storeTimeCheckbox = await testSubjects.find('storeTimeWithDashboard'); - const isAlreadyChecked = (await storeTimeCheckbox.getAttribute('aria-checked')) === 'true'; - if (isAlreadyChecked !== checked) { - log.debug('Flipping store time checkbox'); - storeTimeCheckbox = await testSubjects.find('storeTimeWithDashboard'); - await retry.try(() => storeTimeCheckbox.click()); - } - } + public async getDashboardPanels() { + return await this.testSubjects.findAll('embeddablePanel'); + } - public async getSharedItemsCount() { - log.debug('in getSharedItemsCount'); - const attributeName = 'data-shared-items-count'; - const element = await find.byCssSelector(`[${attributeName}]`); - if (element) { - return await element.getAttribute(attributeName); - } + public async addVisualizations(visualizations: string[]) { + await this.dashboardAddPanel.addVisualizations(visualizations); + } - throw new Error('no element'); + public async setSaveAsNewCheckBox(checked: boolean) { + this.log.debug('saveAsNewCheckbox: ' + checked); + let saveAsNewCheckbox = await this.testSubjects.find('saveAsNewCheckbox'); + const isAlreadyChecked = (await saveAsNewCheckbox.getAttribute('aria-checked')) === 'true'; + if (isAlreadyChecked !== checked) { + this.log.debug('Flipping save as new checkbox'); + saveAsNewCheckbox = await this.testSubjects.find('saveAsNewCheckbox'); + await this.retry.try(() => saveAsNewCheckbox.click()); } + } - public async waitForRenderComplete() { - log.debug('waitForRenderComplete'); - const count = await this.getSharedItemsCount(); - // eslint-disable-next-line radix - await renderable.waitForRender(parseInt(count)); + public async setStoreTimeWithDashboard(checked: boolean) { + this.log.debug('Storing time with dashboard: ' + checked); + let storeTimeCheckbox = await this.testSubjects.find('storeTimeWithDashboard'); + const isAlreadyChecked = (await storeTimeCheckbox.getAttribute('aria-checked')) === 'true'; + if (isAlreadyChecked !== checked) { + this.log.debug('Flipping store time checkbox'); + storeTimeCheckbox = await this.testSubjects.find('storeTimeWithDashboard'); + await this.retry.try(() => storeTimeCheckbox.click()); } + } - public async getSharedContainerData() { - log.debug('getSharedContainerData'); - const sharedContainer = await find.byCssSelector('[data-shared-items-container]'); - return { - title: await sharedContainer.getAttribute('data-title'), - description: await sharedContainer.getAttribute('data-description'), - count: await sharedContainer.getAttribute('data-shared-items-count'), - }; + public async getSharedItemsCount() { + this.log.debug('in getSharedItemsCount'); + const attributeName = 'data-shared-items-count'; + const element = await this.find.byCssSelector(`[${attributeName}]`); + if (element) { + return await element.getAttribute(attributeName); } - public async getPanelSharedItemData() { - log.debug('in getPanelSharedItemData'); - const sharedItemscontainer = await find.byCssSelector('[data-shared-items-count]'); - const $ = await sharedItemscontainer.parseDomContent(); - return $('[data-shared-item]') - .toArray() - .map((item) => { - return { - title: $(item).attr('data-title'), - description: $(item).attr('data-description'), - }; - }); - } + throw new Error('no element'); + } - public async checkHideTitle() { - log.debug('ensure that you can click on hide title checkbox'); - await this.openOptions(); - return await testSubjects.click('dashboardPanelTitlesCheckbox'); - } + public async waitForRenderComplete() { + this.log.debug('waitForRenderComplete'); + const count = await this.getSharedItemsCount(); + // eslint-disable-next-line radix + await this.renderable.waitForRender(parseInt(count)); + } - public async expectMissingSaveOption() { - await testSubjects.missingOrFail('dashboardSaveMenuItem'); - } + public async getSharedContainerData() { + this.log.debug('getSharedContainerData'); + const sharedContainer = await this.find.byCssSelector('[data-shared-items-container]'); + return { + title: await sharedContainer.getAttribute('data-title'), + description: await sharedContainer.getAttribute('data-description'), + count: await sharedContainer.getAttribute('data-shared-items-count'), + }; + } - public async expectMissingQuickSaveOption() { - await testSubjects.missingOrFail('dashboardQuickSaveMenuItem'); - } - public async expectExistsQuickSaveOption() { - await testSubjects.existOrFail('dashboardQuickSaveMenuItem'); - } + public async getPanelSharedItemData() { + this.log.debug('in getPanelSharedItemData'); + const sharedItemscontainer = await this.find.byCssSelector('[data-shared-items-count]'); + const $ = await sharedItemscontainer.parseDomContent(); + return $('[data-shared-item]') + .toArray() + .map((item) => { + return { + title: $(item).attr('data-title'), + description: $(item).attr('data-description'), + }; + }); + } - public async expectQuickSaveButtonEnabled() { - log.debug('expectQuickSaveButtonEnabled'); - const quickSaveButton = await testSubjects.find('dashboardQuickSaveMenuItem'); - const isDisabled = await quickSaveButton.getAttribute('disabled'); - if (isDisabled) { - throw new Error('Quick save button disabled'); - } - } + public async checkHideTitle() { + this.log.debug('ensure that you can click on hide title checkbox'); + await this.openOptions(); + return await this.testSubjects.click('dashboardPanelTitlesCheckbox'); + } - public async getNotLoadedVisualizations(vizList: string[]) { - const checkList = []; - for (const name of vizList) { - const isPresent = await testSubjects.exists( - `embeddablePanelHeading-${name.replace(/\s+/g, '')}`, - { timeout: 10000 } - ); - checkList.push({ name, isPresent }); - } + public async expectMissingSaveOption() { + await this.testSubjects.missingOrFail('dashboardSaveMenuItem'); + } + + public async expectMissingQuickSaveOption() { + await this.testSubjects.missingOrFail('dashboardQuickSaveMenuItem'); + } + public async expectExistsQuickSaveOption() { + await this.testSubjects.existOrFail('dashboardQuickSaveMenuItem'); + } - return checkList.filter((viz) => viz.isPresent === false).map((viz) => viz.name); + public async expectQuickSaveButtonEnabled() { + this.log.debug('expectQuickSaveButtonEnabled'); + const quickSaveButton = await this.testSubjects.find('dashboardQuickSaveMenuItem'); + const isDisabled = await quickSaveButton.getAttribute('disabled'); + if (isDisabled) { + throw new Error('Quick save button disabled'); } + } - public async getPanelDrilldownCount(panelIndex = 0): Promise { - log.debug('getPanelDrilldownCount'); - const panel = (await this.getDashboardPanels())[panelIndex]; - try { - const count = await panel.findByTestSubject( - 'embeddablePanelNotification-ACTION_PANEL_NOTIFICATIONS' - ); - return Number.parseInt(await count.getVisibleText(), 10); - } catch (e) { - // if not found then this is 0 (we don't show badge with 0) - return 0; - } + public async getNotLoadedVisualizations(vizList: string[]) { + const checkList = []; + for (const name of vizList) { + const isPresent = await this.testSubjects.exists( + `embeddablePanelHeading-${name.replace(/\s+/g, '')}`, + { timeout: 10000 } + ); + checkList.push({ name, isPresent }); } - public async getPanelChartDebugState(panelIndex: number) { - return await elasticChart.getChartDebugData(undefined, panelIndex); + return checkList.filter((viz) => viz.isPresent === false).map((viz) => viz.name); + } + + public async getPanelDrilldownCount(panelIndex = 0): Promise { + this.log.debug('getPanelDrilldownCount'); + const panel = (await this.getDashboardPanels())[panelIndex]; + try { + const count = await panel.findByTestSubject( + 'embeddablePanelNotification-ACTION_PANEL_NOTIFICATIONS' + ); + return Number.parseInt(await count.getVisibleText(), 10); + } catch (e) { + // if not found then this is 0 (we don't show badge with 0) + return 0; } } - return new DashboardPage(); + public async getPanelChartDebugState(panelIndex: number) { + return await this.elasticChart.getChartDebugData(undefined, panelIndex); + } } diff --git a/test/functional/page_objects/discover_page.ts b/test/functional/page_objects/discover_page.ts index 436d22d659aec6..41c4441a1c95de 100644 --- a/test/functional/page_objects/discover_page.ts +++ b/test/functional/page_objects/discover_page.ts @@ -6,511 +6,510 @@ * Side Public License, v 1. */ -import { FtrProviderContext } from '../ftr_provider_context'; - -export function DiscoverPageProvider({ getService, getPageObjects }: FtrProviderContext) { - const retry = getService('retry'); - const testSubjects = getService('testSubjects'); - const find = getService('find'); - const flyout = getService('flyout'); - const { header } = getPageObjects(['header']); - const browser = getService('browser'); - const globalNav = getService('globalNav'); - const elasticChart = getService('elasticChart'); - const docTable = getService('docTable'); - const config = getService('config'); - const defaultFindTimeout = config.get('timeouts.find'); - const dataGrid = getService('dataGrid'); - const kibanaServer = getService('kibanaServer'); - - class DiscoverPage { - public async getChartTimespan() { - const el = await find.byCssSelector('[data-test-subj="discoverIntervalDateRange"]'); - return await el.getVisibleText(); - } +import { FtrService } from '../ftr_provider_context'; + +export class DiscoverPageObject extends FtrService { + private readonly retry = this.ctx.getService('retry'); + private readonly testSubjects = this.ctx.getService('testSubjects'); + private readonly find = this.ctx.getService('find'); + private readonly flyout = this.ctx.getService('flyout'); + private readonly header = this.ctx.getPageObject('header'); + private readonly browser = this.ctx.getService('browser'); + private readonly globalNav = this.ctx.getService('globalNav'); + private readonly elasticChart = this.ctx.getService('elasticChart'); + private readonly docTable = this.ctx.getService('docTable'); + private readonly config = this.ctx.getService('config'); + private readonly dataGrid = this.ctx.getService('dataGrid'); + private readonly kibanaServer = this.ctx.getService('kibanaServer'); + + private readonly defaultFindTimeout = this.config.get('timeouts.find'); + + public async getChartTimespan() { + const el = await this.find.byCssSelector('[data-test-subj="discoverIntervalDateRange"]'); + return await el.getVisibleText(); + } - public async getDocTable() { - const isLegacyDefault = await this.useLegacyTable(); - if (isLegacyDefault) { - return docTable; - } else { - return dataGrid; - } + public async getDocTable() { + const isLegacyDefault = await this.useLegacyTable(); + if (isLegacyDefault) { + return this.docTable; + } else { + return this.dataGrid; } + } - public async findFieldByName(name: string) { - const fieldSearch = await testSubjects.find('fieldFilterSearchInput'); - await fieldSearch.type(name); - } + public async findFieldByName(name: string) { + const fieldSearch = await this.testSubjects.find('fieldFilterSearchInput'); + await fieldSearch.type(name); + } - public async clearFieldSearchInput() { - const fieldSearch = await testSubjects.find('fieldFilterSearchInput'); - await fieldSearch.clearValue(); - } + public async clearFieldSearchInput() { + const fieldSearch = await this.testSubjects.find('fieldFilterSearchInput'); + await fieldSearch.clearValue(); + } - public async saveSearch(searchName: string) { - await this.clickSaveSearchButton(); - // preventing an occasional flakiness when the saved object wasn't set and the form can't be submitted - await retry.waitFor( - `saved search title is set to ${searchName} and save button is clickable`, - async () => { - const saveButton = await testSubjects.find('confirmSaveSavedObjectButton'); - await testSubjects.setValue('savedObjectTitle', searchName); - return (await saveButton.getAttribute('disabled')) !== 'true'; - } - ); - await testSubjects.click('confirmSaveSavedObjectButton'); - await header.waitUntilLoadingHasFinished(); - // LeeDr - this additional checking for the saved search name was an attempt - // to cause this method to wait for the reloading of the page to complete so - // that the next action wouldn't have to retry. But it doesn't really solve - // that issue. But it does typically take about 3 retries to - // complete with the expected searchName. - await retry.waitFor(`saved search was persisted with name ${searchName}`, async () => { - return (await this.getCurrentQueryName()) === searchName; - }); - } + public async saveSearch(searchName: string) { + await this.clickSaveSearchButton(); + // preventing an occasional flakiness when the saved object wasn't set and the form can't be submitted + await this.retry.waitFor( + `saved search title is set to ${searchName} and save button is clickable`, + async () => { + const saveButton = await this.testSubjects.find('confirmSaveSavedObjectButton'); + await this.testSubjects.setValue('savedObjectTitle', searchName); + return (await saveButton.getAttribute('disabled')) !== 'true'; + } + ); + await this.testSubjects.click('confirmSaveSavedObjectButton'); + await this.header.waitUntilLoadingHasFinished(); + // LeeDr - this additional checking for the saved search name was an attempt + // to cause this method to wait for the reloading of the page to complete so + // that the next action wouldn't have to retry. But it doesn't really solve + // that issue. But it does typically take about 3 retries to + // complete with the expected searchName. + await this.retry.waitFor(`saved search was persisted with name ${searchName}`, async () => { + return (await this.getCurrentQueryName()) === searchName; + }); + } - public async inputSavedSearchTitle(searchName: string) { - await testSubjects.setValue('savedObjectTitle', searchName); - } + public async inputSavedSearchTitle(searchName: string) { + await this.testSubjects.setValue('savedObjectTitle', searchName); + } - public async clickConfirmSavedSearch() { - await testSubjects.click('confirmSaveSavedObjectButton'); - } + public async clickConfirmSavedSearch() { + await this.testSubjects.click('confirmSaveSavedObjectButton'); + } - public async openAddFilterPanel() { - await testSubjects.click('addFilter'); - } + public async openAddFilterPanel() { + await this.testSubjects.click('addFilter'); + } - public async waitUntilSearchingHasFinished() { - await testSubjects.missingOrFail('loadingSpinner', { timeout: defaultFindTimeout * 10 }); + public async waitUntilSearchingHasFinished() { + await this.testSubjects.missingOrFail('loadingSpinner', { + timeout: this.defaultFindTimeout * 10, + }); + } + + public async getColumnHeaders() { + const isLegacy = await this.useLegacyTable(); + if (isLegacy) { + return await this.docTable.getHeaderFields('embeddedSavedSearchDocTable'); } + const table = await this.getDocTable(); + return await table.getHeaderFields(); + } - public async getColumnHeaders() { - const isLegacy = await this.useLegacyTable(); - if (isLegacy) { - return await docTable.getHeaderFields('embeddedSavedSearchDocTable'); - } - const table = await this.getDocTable(); - return await table.getHeaderFields(); + public async openLoadSavedSearchPanel() { + let isOpen = await this.testSubjects.exists('loadSearchForm'); + if (isOpen) { + return; } - public async openLoadSavedSearchPanel() { - let isOpen = await testSubjects.exists('loadSearchForm'); - if (isOpen) { - return; - } + // We need this try loop here because previous actions in Discover like + // saving a search cause reloading of the page and the "Open" menu item goes stale. + await this.retry.waitFor('saved search panel is opened', async () => { + await this.clickLoadSavedSearchButton(); + await this.header.waitUntilLoadingHasFinished(); + isOpen = await this.testSubjects.exists('loadSearchForm'); + return isOpen === true; + }); + } - // We need this try loop here because previous actions in Discover like - // saving a search cause reloading of the page and the "Open" menu item goes stale. - await retry.waitFor('saved search panel is opened', async () => { - await this.clickLoadSavedSearchButton(); - await header.waitUntilLoadingHasFinished(); - isOpen = await testSubjects.exists('loadSearchForm'); - return isOpen === true; - }); - } + public async closeLoadSaveSearchPanel() { + await this.flyout.ensureClosed('loadSearchForm'); + } - public async closeLoadSaveSearchPanel() { - await flyout.ensureClosed('loadSearchForm'); - } + public async hasSavedSearch(searchName: string) { + const searchLink = await this.find.byButtonText(searchName); + return await searchLink.isDisplayed(); + } - public async hasSavedSearch(searchName: string) { - const searchLink = await find.byButtonText(searchName); - return await searchLink.isDisplayed(); - } + public async loadSavedSearch(searchName: string) { + await this.openLoadSavedSearchPanel(); + await this.testSubjects.click(`savedObjectTitle${searchName.split(' ').join('-')}`); + await this.header.waitUntilLoadingHasFinished(); + } - public async loadSavedSearch(searchName: string) { - await this.openLoadSavedSearchPanel(); - await testSubjects.click(`savedObjectTitle${searchName.split(' ').join('-')}`); - await header.waitUntilLoadingHasFinished(); - } + public async clickNewSearchButton() { + await this.testSubjects.click('discoverNewButton'); + await this.header.waitUntilLoadingHasFinished(); + } - public async clickNewSearchButton() { - await testSubjects.click('discoverNewButton'); - await header.waitUntilLoadingHasFinished(); - } + public async clickSaveSearchButton() { + await this.testSubjects.click('discoverSaveButton'); + } - public async clickSaveSearchButton() { - await testSubjects.click('discoverSaveButton'); - } + public async clickLoadSavedSearchButton() { + await this.testSubjects.moveMouseTo('discoverOpenButton'); + await this.testSubjects.click('discoverOpenButton'); + } - public async clickLoadSavedSearchButton() { - await testSubjects.moveMouseTo('discoverOpenButton'); - await testSubjects.click('discoverOpenButton'); - } + public async clickResetSavedSearchButton() { + await this.testSubjects.moveMouseTo('resetSavedSearch'); + await this.testSubjects.click('resetSavedSearch'); + await this.header.waitUntilLoadingHasFinished(); + } - public async clickResetSavedSearchButton() { - await testSubjects.moveMouseTo('resetSavedSearch'); - await testSubjects.click('resetSavedSearch'); - await header.waitUntilLoadingHasFinished(); - } + public async closeLoadSavedSearchPanel() { + await this.testSubjects.click('euiFlyoutCloseButton'); + } - public async closeLoadSavedSearchPanel() { - await testSubjects.click('euiFlyoutCloseButton'); - } + public async clickHistogramBar() { + await this.elasticChart.waitForRenderComplete(); + const el = await this.elasticChart.getCanvas(); - public async clickHistogramBar() { - await elasticChart.waitForRenderComplete(); - const el = await elasticChart.getCanvas(); + await this.browser.getActions().move({ x: 0, y: 0, origin: el._webElement }).click().perform(); + } - await browser.getActions().move({ x: 0, y: 0, origin: el._webElement }).click().perform(); - } + public async brushHistogram() { + await this.elasticChart.waitForRenderComplete(); + const el = await this.elasticChart.getCanvas(); - public async brushHistogram() { - await elasticChart.waitForRenderComplete(); - const el = await elasticChart.getCanvas(); + await this.browser.dragAndDrop( + { location: el, offset: { x: -300, y: 20 } }, + { location: el, offset: { x: -100, y: 30 } } + ); + } - await browser.dragAndDrop( - { location: el, offset: { x: -300, y: 20 } }, - { location: el, offset: { x: -100, y: 30 } } - ); - } + public async getCurrentQueryName() { + return await this.globalNav.getLastBreadcrumb(); + } - public async getCurrentQueryName() { - return await globalNav.getLastBreadcrumb(); - } + public async getChartInterval() { + const selectedValue = await this.testSubjects.getAttribute('discoverIntervalSelect', 'value'); + const selectedOption = await this.find.byCssSelector(`option[value="${selectedValue}"]`); + return selectedOption.getVisibleText(); + } - public async getChartInterval() { - const selectedValue = await testSubjects.getAttribute('discoverIntervalSelect', 'value'); - const selectedOption = await find.byCssSelector(`option[value="${selectedValue}"]`); - return selectedOption.getVisibleText(); - } + public async getChartIntervalWarningIcon() { + await this.header.waitUntilLoadingHasFinished(); + return await this.find.existsByCssSelector('.euiToolTipAnchor'); + } - public async getChartIntervalWarningIcon() { - await header.waitUntilLoadingHasFinished(); - return await find.existsByCssSelector('.euiToolTipAnchor'); - } + public async setChartInterval(interval: string) { + const optionElement = await this.find.byCssSelector(`option[label="${interval}"]`, 5000); + await optionElement.click(); + return await this.header.waitUntilLoadingHasFinished(); + } - public async setChartInterval(interval: string) { - const optionElement = await find.byCssSelector(`option[label="${interval}"]`, 5000); - await optionElement.click(); - return await header.waitUntilLoadingHasFinished(); - } + public async getHitCount() { + await this.header.waitUntilLoadingHasFinished(); + return await this.testSubjects.getVisibleText('discoverQueryHits'); + } - public async getHitCount() { - await header.waitUntilLoadingHasFinished(); - return await testSubjects.getVisibleText('discoverQueryHits'); - } + public async getDocHeader() { + const table = await this.getDocTable(); + const docHeader = await table.getHeaders(); + return docHeader.join(); + } - public async getDocHeader() { - const table = await this.getDocTable(); - const docHeader = await table.getHeaders(); - return docHeader.join(); - } + public async getDocTableRows() { + await this.header.waitUntilLoadingHasFinished(); + const table = await this.getDocTable(); + return await table.getBodyRows(); + } - public async getDocTableRows() { - await header.waitUntilLoadingHasFinished(); - const table = await this.getDocTable(); - return await table.getBodyRows(); - } + public async useLegacyTable() { + return (await this.kibanaServer.uiSettings.get('doc_table:legacy')) !== false; + } - public async useLegacyTable() { - return (await kibanaServer.uiSettings.get('doc_table:legacy')) !== false; + public async getDocTableIndex(index: number) { + const isLegacyDefault = await this.useLegacyTable(); + if (isLegacyDefault) { + const row = await this.find.byCssSelector(`tr.kbnDocTable__row:nth-child(${index})`); + return await row.getVisibleText(); } - public async getDocTableIndex(index: number) { - const isLegacyDefault = await this.useLegacyTable(); - if (isLegacyDefault) { - const row = await find.byCssSelector(`tr.kbnDocTable__row:nth-child(${index})`); - return await row.getVisibleText(); - } + const row = await this.dataGrid.getRow({ rowIndex: index - 1 }); + const result = await Promise.all(row.map(async (cell) => await cell.getVisibleText())); + // Remove control columns + return result.slice(2).join(' '); + } - const row = await dataGrid.getRow({ rowIndex: index - 1 }); - const result = await Promise.all(row.map(async (cell) => await cell.getVisibleText())); - // Remove control columns - return result.slice(2).join(' '); - } + public async getDocTableIndexLegacy(index: number) { + const row = await this.find.byCssSelector(`tr.kbnDocTable__row:nth-child(${index})`); + return await row.getVisibleText(); + } - public async getDocTableIndexLegacy(index: number) { - const row = await find.byCssSelector(`tr.kbnDocTable__row:nth-child(${index})`); - return await row.getVisibleText(); + public async getDocTableField(index: number, cellIdx: number = -1) { + const isLegacyDefault = await this.useLegacyTable(); + const usedDefaultCellIdx = isLegacyDefault ? 0 : 2; + const usedCellIdx = cellIdx === -1 ? usedDefaultCellIdx : cellIdx; + if (isLegacyDefault) { + const fields = await this.find.allByCssSelector( + `tr.kbnDocTable__row:nth-child(${index}) [data-test-subj='docTableField']` + ); + return await fields[usedCellIdx].getVisibleText(); } + const row = await this.dataGrid.getRow({ rowIndex: index - 1 }); + const result = await Promise.all(row.map(async (cell) => await cell.getVisibleText())); + return result[usedCellIdx]; + } - public async getDocTableField(index: number, cellIdx: number = -1) { - const isLegacyDefault = await this.useLegacyTable(); - const usedDefaultCellIdx = isLegacyDefault ? 0 : 2; - const usedCellIdx = cellIdx === -1 ? usedDefaultCellIdx : cellIdx; - if (isLegacyDefault) { - const fields = await find.allByCssSelector( - `tr.kbnDocTable__row:nth-child(${index}) [data-test-subj='docTableField']` - ); - return await fields[usedCellIdx].getVisibleText(); - } - const row = await dataGrid.getRow({ rowIndex: index - 1 }); - const result = await Promise.all(row.map(async (cell) => await cell.getVisibleText())); - return result[usedCellIdx]; - } + public async skipToEndOfDocTable() { + // add the focus to the button to make it appear + const skipButton = await this.testSubjects.find('discoverSkipTableButton'); + // force focus on it, to make it interactable + skipButton.focus(); + // now click it! + return skipButton.click(); + } - public async skipToEndOfDocTable() { - // add the focus to the button to make it appear - const skipButton = await testSubjects.find('discoverSkipTableButton'); - // force focus on it, to make it interactable - skipButton.focus(); - // now click it! - return skipButton.click(); - } + /** + * When scrolling down the legacy table there's a link to scroll up + * So this is done by this function + */ + public async backToTop() { + const skipButton = await this.testSubjects.find('discoverBackToTop'); + return skipButton.click(); + } - /** - * When scrolling down the legacy table there's a link to scroll up - * So this is done by this function - */ - public async backToTop() { - const skipButton = await testSubjects.find('discoverBackToTop'); - return skipButton.click(); - } + public async getDocTableFooter() { + return await this.testSubjects.find('discoverDocTableFooter'); + } - public async getDocTableFooter() { - return await testSubjects.find('discoverDocTableFooter'); + public async clickDocSortDown() { + const isLegacyDefault = await this.useLegacyTable(); + if (isLegacyDefault) { + await this.find.clickByCssSelector('.fa-sort-down'); + } else { + await this.dataGrid.clickDocSortAsc(); } + } - public async clickDocSortDown() { - const isLegacyDefault = await this.useLegacyTable(); - if (isLegacyDefault) { - await find.clickByCssSelector('.fa-sort-down'); - } else { - await dataGrid.clickDocSortAsc(); - } + public async clickDocSortUp() { + const isLegacyDefault = await this.useLegacyTable(); + if (isLegacyDefault) { + await this.find.clickByCssSelector('.fa-sort-up'); + } else { + await this.dataGrid.clickDocSortDesc(); } + } - public async clickDocSortUp() { - const isLegacyDefault = await this.useLegacyTable(); - if (isLegacyDefault) { - await find.clickByCssSelector('.fa-sort-up'); - } else { - await dataGrid.clickDocSortDesc(); - } - } + public async isShowingDocViewer() { + return await this.testSubjects.exists('kbnDocViewer'); + } - public async isShowingDocViewer() { - return await testSubjects.exists('kbnDocViewer'); - } + public async getMarks() { + const table = await this.docTable.getTable(); + const marks = await table.findAllByTagName('mark'); + return await Promise.all(marks.map((mark) => mark.getVisibleText())); + } - public async getMarks() { - const table = await docTable.getTable(); - const marks = await table.findAllByTagName('mark'); - return await Promise.all(marks.map((mark) => mark.getVisibleText())); - } + public async toggleSidebarCollapse() { + return await this.testSubjects.click('collapseSideBarButton'); + } - public async toggleSidebarCollapse() { - return await testSubjects.click('collapseSideBarButton'); - } + public async getAllFieldNames() { + const sidebar = await this.testSubjects.find('discover-sidebar'); + const $ = await sidebar.parseDomContent(); + return $('.dscSidebarField__name') + .toArray() + .map((field) => $(field).text()); + } - public async getAllFieldNames() { - const sidebar = await testSubjects.find('discover-sidebar'); - const $ = await sidebar.parseDomContent(); - return $('.dscSidebarField__name') - .toArray() - .map((field) => $(field).text()); - } + public async editField(field: string) { + await this.retry.try(async () => { + await this.testSubjects.click(`field-${field}`); + await this.testSubjects.click(`discoverFieldListPanelEdit-${field}`); + await this.find.byClassName('indexPatternFieldEditor__form'); + }); + } - public async editField(field: string) { - await retry.try(async () => { - await testSubjects.click(`field-${field}`); - await testSubjects.click(`discoverFieldListPanelEdit-${field}`); - await find.byClassName('indexPatternFieldEditor__form'); - }); - } + public async removeField(field: string) { + await this.testSubjects.click(`field-${field}`); + await this.testSubjects.click(`discoverFieldListPanelDelete-${field}`); + await this.testSubjects.existOrFail('runtimeFieldDeleteConfirmModal'); + } - public async removeField(field: string) { - await testSubjects.click(`field-${field}`); - await testSubjects.click(`discoverFieldListPanelDelete-${field}`); - await testSubjects.existOrFail('runtimeFieldDeleteConfirmModal'); - } + public async clickIndexPatternActions() { + await this.retry.try(async () => { + await this.testSubjects.click('discoverIndexPatternActions'); + await this.testSubjects.existOrFail('discover-addRuntimeField-popover'); + }); + } - public async clickIndexPatternActions() { - await retry.try(async () => { - await testSubjects.click('discoverIndexPatternActions'); - await testSubjects.existOrFail('discover-addRuntimeField-popover'); - }); - } + public async clickAddNewField() { + await this.retry.try(async () => { + await this.testSubjects.click('indexPattern-add-field'); + await this.find.byClassName('indexPatternFieldEditor__form'); + }); + } - public async clickAddNewField() { - await retry.try(async () => { - await testSubjects.click('indexPattern-add-field'); - await find.byClassName('indexPatternFieldEditor__form'); - }); - } + public async hasNoResults() { + return await this.testSubjects.exists('discoverNoResults'); + } - public async hasNoResults() { - return await testSubjects.exists('discoverNoResults'); - } + public async hasNoResultsTimepicker() { + return await this.testSubjects.exists('discoverNoResultsTimefilter'); + } - public async hasNoResultsTimepicker() { - return await testSubjects.exists('discoverNoResultsTimefilter'); - } + public async clickFieldListItem(field: string) { + return await this.testSubjects.click(`field-${field}`); + } - public async clickFieldListItem(field: string) { - return await testSubjects.click(`field-${field}`); + public async clickFieldSort(field: string, text = 'Sort New-Old') { + const isLegacyDefault = await this.useLegacyTable(); + if (isLegacyDefault) { + return await this.testSubjects.click(`docTableHeaderFieldSort_${field}`); } + return await this.dataGrid.clickDocSortAsc(field, text); + } - public async clickFieldSort(field: string, text = 'Sort New-Old') { - const isLegacyDefault = await this.useLegacyTable(); - if (isLegacyDefault) { - return await testSubjects.click(`docTableHeaderFieldSort_${field}`); - } - return await dataGrid.clickDocSortAsc(field, text); - } + public async clickFieldListItemToggle(field: string) { + await this.testSubjects.moveMouseTo(`field-${field}`); + await this.testSubjects.click(`fieldToggle-${field}`); + } - public async clickFieldListItemToggle(field: string) { - await testSubjects.moveMouseTo(`field-${field}`); - await testSubjects.click(`fieldToggle-${field}`); - } + public async clickFieldListItemAdd(field: string) { + // a filter check may make sense here, but it should be properly handled to make + // it work with the _score and _source fields as well + await this.clickFieldListItemToggle(field); + } - public async clickFieldListItemAdd(field: string) { - // a filter check may make sense here, but it should be properly handled to make - // it work with the _score and _source fields as well - await this.clickFieldListItemToggle(field); + public async clickFieldListItemRemove(field: string) { + if (!(await this.testSubjects.exists('fieldList-selected'))) { + return; } - - public async clickFieldListItemRemove(field: string) { - if (!(await testSubjects.exists('fieldList-selected'))) { - return; - } - const selectedList = await testSubjects.find('fieldList-selected'); - if (await testSubjects.descendantExists(`field-${field}`, selectedList)) { - await this.clickFieldListItemToggle(field); - } + const selectedList = await this.testSubjects.find('fieldList-selected'); + if (await this.testSubjects.descendantExists(`field-${field}`, selectedList)) { + await this.clickFieldListItemToggle(field); } + } - public async clickFieldListItemVisualize(fieldName: string) { - const field = await testSubjects.find(`field-${fieldName}-showDetails`); - const isActive = await field.elementHasClass('dscSidebarItem--active'); + public async clickFieldListItemVisualize(fieldName: string) { + const field = await this.testSubjects.find(`field-${fieldName}-showDetails`); + const isActive = await field.elementHasClass('dscSidebarItem--active'); - if (!isActive) { - // expand the field to show the "Visualize" button - await field.click(); - } - - await testSubjects.click(`fieldVisualize-${fieldName}`); + if (!isActive) { + // expand the field to show the "Visualize" button + await field.click(); } - public async expectFieldListItemVisualize(field: string) { - await testSubjects.existOrFail(`fieldVisualize-${field}`); - } + await this.testSubjects.click(`fieldVisualize-${fieldName}`); + } - public async expectMissingFieldListItemVisualize(field: string) { - await testSubjects.missingOrFail(`fieldVisualize-${field}`); - } + public async expectFieldListItemVisualize(field: string) { + await this.testSubjects.existOrFail(`fieldVisualize-${field}`); + } - public async clickFieldListPlusFilter(field: string, value: string) { - const plusFilterTestSubj = `plus-${field}-${value}`; - if (!(await testSubjects.exists(plusFilterTestSubj))) { - // field has to be open - await this.clickFieldListItem(field); - } - // testSubjects.find doesn't handle spaces in the data-test-subj value - await testSubjects.click(plusFilterTestSubj); - await header.waitUntilLoadingHasFinished(); - } + public async expectMissingFieldListItemVisualize(field: string) { + await this.testSubjects.missingOrFail(`fieldVisualize-${field}`); + } - public async clickFieldListMinusFilter(field: string, value: string) { - // this method requires the field details to be open from clickFieldListItem() - // testSubjects.find doesn't handle spaces in the data-test-subj value - await testSubjects.click(`minus-${field}-${value}`); - await header.waitUntilLoadingHasFinished(); + public async clickFieldListPlusFilter(field: string, value: string) { + const plusFilterTestSubj = `plus-${field}-${value}`; + if (!(await this.testSubjects.exists(plusFilterTestSubj))) { + // field has to be open + await this.clickFieldListItem(field); } + // this.testSubjects.find doesn't handle spaces in the data-test-subj value + await this.testSubjects.click(plusFilterTestSubj); + await this.header.waitUntilLoadingHasFinished(); + } - public async selectIndexPattern(indexPattern: string) { - await testSubjects.click('indexPattern-switch-link'); - await find.setValue('[data-test-subj="indexPattern-switcher"] input', indexPattern); - await find.clickByCssSelector( - `[data-test-subj="indexPattern-switcher"] [title="${indexPattern}"]` - ); - await header.waitUntilLoadingHasFinished(); - } + public async clickFieldListMinusFilter(field: string, value: string) { + // this method requires the field details to be open from clickFieldListItem() + // this.testSubjects.find doesn't handle spaces in the data-test-subj value + await this.testSubjects.click(`minus-${field}-${value}`); + await this.header.waitUntilLoadingHasFinished(); + } - public async removeHeaderColumn(name: string) { - const isLegacyDefault = await this.useLegacyTable(); - if (isLegacyDefault) { - await testSubjects.moveMouseTo(`docTableHeader-${name}`); - await testSubjects.click(`docTableRemoveHeader-${name}`); - } else { - await dataGrid.clickRemoveColumn(name); - } - } + public async selectIndexPattern(indexPattern: string) { + await this.testSubjects.click('indexPattern-switch-link'); + await this.find.setValue('[data-test-subj="indexPattern-switcher"] input', indexPattern); + await this.find.clickByCssSelector( + `[data-test-subj="indexPattern-switcher"] [title="${indexPattern}"]` + ); + await this.header.waitUntilLoadingHasFinished(); + } - public async openSidebarFieldFilter() { - await testSubjects.click('toggleFieldFilterButton'); - await testSubjects.existOrFail('filterSelectionPanel'); + public async removeHeaderColumn(name: string) { + const isLegacyDefault = await this.useLegacyTable(); + if (isLegacyDefault) { + await this.testSubjects.moveMouseTo(`docTableHeader-${name}`); + await this.testSubjects.click(`docTableRemoveHeader-${name}`); + } else { + await this.dataGrid.clickRemoveColumn(name); } + } - public async closeSidebarFieldFilter() { - await testSubjects.click('toggleFieldFilterButton'); - await testSubjects.missingOrFail('filterSelectionPanel'); - } + public async openSidebarFieldFilter() { + await this.testSubjects.click('toggleFieldFilterButton'); + await this.testSubjects.existOrFail('filterSelectionPanel'); + } - public async waitForChartLoadingComplete(renderCount: number) { - await elasticChart.waitForRenderingCount(renderCount, 'discoverChart'); - } + public async closeSidebarFieldFilter() { + await this.testSubjects.click('toggleFieldFilterButton'); + await this.testSubjects.missingOrFail('filterSelectionPanel'); + } - public async waitForDocTableLoadingComplete() { - await testSubjects.waitForAttributeToChange( - 'discoverDocTable', - 'data-render-complete', - 'true' - ); - } - public async getNrOfFetches() { - const el = await find.byCssSelector('[data-fetch-counter]'); - const nr = await el.getAttribute('data-fetch-counter'); - return Number(nr); - } + public async waitForChartLoadingComplete(renderCount: number) { + await this.elasticChart.waitForRenderingCount(renderCount, 'discoverChart'); + } - /** - * Check if Discover app is currently rendered on the screen. - */ - public async isDiscoverAppOnScreen(): Promise { - const result = await find.allByCssSelector('discover-app'); - return result.length === 1; - } + public async waitForDocTableLoadingComplete() { + await this.testSubjects.waitForAttributeToChange( + 'discoverDocTable', + 'data-render-complete', + 'true' + ); + } + public async getNrOfFetches() { + const el = await this.find.byCssSelector('[data-fetch-counter]'); + const nr = await el.getAttribute('data-fetch-counter'); + return Number(nr); + } - /** - * Wait until Discover app is rendered on the screen. - */ - public async waitForDiscoverAppOnScreen() { - await retry.waitFor('Discover app on screen', async () => { - return await this.isDiscoverAppOnScreen(); - }); - } + /** + * Check if Discover app is currently rendered on the screen. + */ + public async isDiscoverAppOnScreen(): Promise { + const result = await this.find.allByCssSelector('discover-app'); + return result.length === 1; + } - public async showAllFilterActions() { - await testSubjects.click('showFilterActions'); - } + /** + * Wait until Discover app is rendered on the screen. + */ + public async waitForDiscoverAppOnScreen() { + await this.retry.waitFor('Discover app on screen', async () => { + return await this.isDiscoverAppOnScreen(); + }); + } - public async clickSavedQueriesPopOver() { - await testSubjects.click('saved-query-management-popover-button'); - } + public async showAllFilterActions() { + await this.testSubjects.click('showFilterActions'); + } - public async clickCurrentSavedQuery() { - await testSubjects.click('saved-query-management-save-button'); - } + public async clickSavedQueriesPopOver() { + await this.testSubjects.click('saved-query-management-popover-button'); + } - public async setSaveQueryFormTitle(savedQueryName: string) { - await testSubjects.setValue('saveQueryFormTitle', savedQueryName); - } + public async clickCurrentSavedQuery() { + await this.testSubjects.click('saved-query-management-save-button'); + } - public async toggleIncludeFilters() { - await testSubjects.click('saveQueryFormIncludeFiltersOption'); - } + public async setSaveQueryFormTitle(savedQueryName: string) { + await this.testSubjects.setValue('saveQueryFormTitle', savedQueryName); + } - public async saveCurrentSavedQuery() { - await testSubjects.click('savedQueryFormSaveButton'); - } + public async toggleIncludeFilters() { + await this.testSubjects.click('saveQueryFormIncludeFiltersOption'); + } - public async deleteSavedQuery() { - await testSubjects.click('delete-saved-query-TEST-button'); - } + public async saveCurrentSavedQuery() { + await this.testSubjects.click('savedQueryFormSaveButton'); + } - public async confirmDeletionOfSavedQuery() { - await testSubjects.click('confirmModalConfirmButton'); - } + public async deleteSavedQuery() { + await this.testSubjects.click('delete-saved-query-TEST-button'); + } - public async clearSavedQuery() { - await testSubjects.click('saved-query-management-clear-button'); - } + public async confirmDeletionOfSavedQuery() { + await this.testSubjects.click('confirmModalConfirmButton'); } - return new DiscoverPage(); + public async clearSavedQuery() { + await this.testSubjects.click('saved-query-management-clear-button'); + } } diff --git a/test/functional/page_objects/error_page.ts b/test/functional/page_objects/error_page.ts index e3d5a7fdf57c24..b0166e3753dd55 100644 --- a/test/functional/page_objects/error_page.ts +++ b/test/functional/page_objects/error_page.ts @@ -6,29 +6,25 @@ * Side Public License, v 1. */ -import expect from '@kbn/expect/expect.js'; -import { FtrProviderContext } from '../ftr_provider_context'; +import expect from '@kbn/expect'; +import { FtrService } from '../ftr_provider_context'; -export function ErrorPageProvider({ getPageObjects }: FtrProviderContext) { - const { common } = getPageObjects(['common']); +export class ErrorPageObject extends FtrService { + private readonly common = this.ctx.getPageObject('common'); - class ErrorPage { - public async expectForbidden() { - const messageText = await common.getBodyText(); - expect(messageText).to.contain('You do not have permission to access the requested page'); - } - - public async expectNotFound() { - const messageText = await common.getJsonBodyText(); - expect(messageText).to.eql( - JSON.stringify({ - statusCode: 404, - error: 'Not Found', - message: 'Not Found', - }) - ); - } + public async expectForbidden() { + const messageText = await this.common.getBodyText(); + expect(messageText).to.contain('You do not have permission to access the requested page'); } - return new ErrorPage(); + public async expectNotFound() { + const messageText = await this.common.getJsonBodyText(); + expect(messageText).to.eql( + JSON.stringify({ + statusCode: 404, + error: 'Not Found', + message: 'Not Found', + }) + ); + } } diff --git a/test/functional/page_objects/header_page.ts b/test/functional/page_objects/header_page.ts index c5a796a1eb13be..8597a4b4ee2fbb 100644 --- a/test/functional/page_objects/header_page.ts +++ b/test/functional/page_objects/header_page.ts @@ -6,92 +6,88 @@ * Side Public License, v 1. */ -import { FtrProviderContext } from '../ftr_provider_context'; +import { FtrService } from '../ftr_provider_context'; -export function HeaderPageProvider({ getService, getPageObjects }: FtrProviderContext) { - const config = getService('config'); - const log = getService('log'); - const retry = getService('retry'); - const testSubjects = getService('testSubjects'); - const appsMenu = getService('appsMenu'); - const PageObjects = getPageObjects(['common']); +export class HeaderPageObject extends FtrService { + private readonly config = this.ctx.getService('config'); + private readonly log = this.ctx.getService('log'); + private readonly retry = this.ctx.getService('retry'); + private readonly testSubjects = this.ctx.getService('testSubjects'); + private readonly appsMenu = this.ctx.getService('appsMenu'); + private readonly common = this.ctx.getPageObject('common'); - const defaultFindTimeout = config.get('timeouts.find'); + private readonly defaultFindTimeout = this.config.get('timeouts.find'); - class HeaderPage { - public async clickDiscover(ignoreAppLeaveWarning = false) { - await appsMenu.clickLink('Discover', { category: 'kibana' }); - await this.onAppLeaveWarning(ignoreAppLeaveWarning); - await PageObjects.common.waitForTopNavToBeVisible(); - await this.awaitGlobalLoadingIndicatorHidden(); - } + public async clickDiscover(ignoreAppLeaveWarning = false) { + await this.appsMenu.clickLink('Discover', { category: 'kibana' }); + await this.onAppLeaveWarning(ignoreAppLeaveWarning); + await this.common.waitForTopNavToBeVisible(); + await this.awaitGlobalLoadingIndicatorHidden(); + } - public async clickVisualize(ignoreAppLeaveWarning = false) { - await appsMenu.clickLink('Visualize Library', { category: 'kibana' }); - await this.onAppLeaveWarning(ignoreAppLeaveWarning); - await this.awaitGlobalLoadingIndicatorHidden(); - await retry.waitFor('Visualize app to be loaded', async () => { - const isNavVisible = await testSubjects.exists('top-nav'); - return isNavVisible; - }); - } + public async clickVisualize(ignoreAppLeaveWarning = false) { + await this.appsMenu.clickLink('Visualize Library', { category: 'kibana' }); + await this.onAppLeaveWarning(ignoreAppLeaveWarning); + await this.awaitGlobalLoadingIndicatorHidden(); + await this.retry.waitFor('Visualize app to be loaded', async () => { + const isNavVisible = await this.testSubjects.exists('top-nav'); + return isNavVisible; + }); + } - public async clickDashboard() { - await appsMenu.clickLink('Dashboard', { category: 'kibana' }); - await retry.waitFor('dashboard app to be loaded', async () => { - const isNavVisible = await testSubjects.exists('top-nav'); - const isLandingPageVisible = await testSubjects.exists('dashboardLandingPage'); - return isNavVisible || isLandingPageVisible; - }); - await this.awaitGlobalLoadingIndicatorHidden(); - } + public async clickDashboard() { + await this.appsMenu.clickLink('Dashboard', { category: 'kibana' }); + await this.retry.waitFor('dashboard app to be loaded', async () => { + const isNavVisible = await this.testSubjects.exists('top-nav'); + const isLandingPageVisible = await this.testSubjects.exists('dashboardLandingPage'); + return isNavVisible || isLandingPageVisible; + }); + await this.awaitGlobalLoadingIndicatorHidden(); + } - public async clickStackManagement() { - await appsMenu.clickLink('Stack Management', { category: 'management' }); - await this.awaitGlobalLoadingIndicatorHidden(); - } + public async clickStackManagement() { + await this.appsMenu.clickLink('Stack Management', { category: 'management' }); + await this.awaitGlobalLoadingIndicatorHidden(); + } - public async waitUntilLoadingHasFinished() { - try { - await this.isGlobalLoadingIndicatorVisible(); - } catch (exception) { - if (exception.name === 'ElementNotVisible') { - // selenium might just have been too slow to catch it - } else { - throw exception; - } + public async waitUntilLoadingHasFinished() { + try { + await this.isGlobalLoadingIndicatorVisible(); + } catch (exception) { + if (exception.name === 'ElementNotVisible') { + // selenium might just have been too slow to catch it + } else { + throw exception; } - await this.awaitGlobalLoadingIndicatorHidden(); - } - - public async isGlobalLoadingIndicatorVisible() { - log.debug('isGlobalLoadingIndicatorVisible'); - return await testSubjects.exists('globalLoadingIndicator', { timeout: 1500 }); } + await this.awaitGlobalLoadingIndicatorHidden(); + } - public async awaitGlobalLoadingIndicatorHidden() { - await testSubjects.existOrFail('globalLoadingIndicator-hidden', { - allowHidden: true, - timeout: defaultFindTimeout * 10, - }); - } + public async isGlobalLoadingIndicatorVisible() { + this.log.debug('isGlobalLoadingIndicatorVisible'); + return await this.testSubjects.exists('globalLoadingIndicator', { timeout: 1500 }); + } - public async awaitKibanaChrome() { - log.debug('awaitKibanaChrome'); - await testSubjects.find('kibanaChrome', defaultFindTimeout * 10); - } + public async awaitGlobalLoadingIndicatorHidden() { + await this.testSubjects.existOrFail('globalLoadingIndicator-hidden', { + allowHidden: true, + timeout: this.defaultFindTimeout * 10, + }); + } - public async onAppLeaveWarning(ignoreWarning = false) { - await retry.try(async () => { - const warning = await testSubjects.exists('confirmModalTitleText'); - if (warning) { - await testSubjects.click( - ignoreWarning ? 'confirmModalConfirmButton' : 'confirmModalCancelButton' - ); - } - }); - } + public async awaitKibanaChrome() { + this.log.debug('awaitKibanaChrome'); + await this.testSubjects.find('kibanaChrome', this.defaultFindTimeout * 10); } - return new HeaderPage(); + public async onAppLeaveWarning(ignoreWarning = false) { + await this.retry.try(async () => { + const warning = await this.testSubjects.exists('confirmModalTitleText'); + if (warning) { + await this.testSubjects.click( + ignoreWarning ? 'confirmModalConfirmButton' : 'confirmModalCancelButton' + ); + } + }); + } } diff --git a/test/functional/page_objects/home_page.ts b/test/functional/page_objects/home_page.ts index f03f74ef8c61d9..33de6a33c50f54 100644 --- a/test/functional/page_objects/home_page.ts +++ b/test/functional/page_objects/home_page.ts @@ -6,138 +6,134 @@ * Side Public License, v 1. */ -import { FtrProviderContext } from '../ftr_provider_context'; +import { FtrService } from '../ftr_provider_context'; -export function HomePageProvider({ getService, getPageObjects }: FtrProviderContext) { - const testSubjects = getService('testSubjects'); - const retry = getService('retry'); - const find = getService('find'); - const PageObjects = getPageObjects(['common']); +export class HomePageObject extends FtrService { + private readonly testSubjects = this.ctx.getService('testSubjects'); + private readonly retry = this.ctx.getService('retry'); + private readonly find = this.ctx.getService('find'); + private readonly common = this.ctx.getPageObject('common'); - class HomePage { - async clickSynopsis(title: string) { - await testSubjects.click(`homeSynopsisLink${title}`); - } - - async doesSynopsisExist(title: string) { - return await testSubjects.exists(`homeSynopsisLink${title}`); - } + async clickSynopsis(title: string) { + await this.testSubjects.click(`homeSynopsisLink${title}`); + } - async doesSampleDataSetExist(id: string) { - return await testSubjects.exists(`sampleDataSetCard${id}`); - } + async doesSynopsisExist(title: string) { + return await this.testSubjects.exists(`homeSynopsisLink${title}`); + } - async isSampleDataSetInstalled(id: string) { - return !(await testSubjects.exists(`addSampleDataSet${id}`)); - } + async doesSampleDataSetExist(id: string) { + return await this.testSubjects.exists(`sampleDataSetCard${id}`); + } - async getVisibileSolutions() { - const solutionPanels = await testSubjects.findAll('~homSolutionPanel', 2000); - const panelAttributes = await Promise.all( - solutionPanels.map((panel) => panel.getAttribute('data-test-subj')) - ); - return panelAttributes.map((attributeValue) => attributeValue.split('homSolutionPanel_')[1]); - } + async isSampleDataSetInstalled(id: string) { + return !(await this.testSubjects.exists(`addSampleDataSet${id}`)); + } - async addSampleDataSet(id: string) { - const isInstalled = await this.isSampleDataSetInstalled(id); - if (!isInstalled) { - await testSubjects.click(`addSampleDataSet${id}`); - await this._waitForSampleDataLoadingAction(id); - } - } + async getVisibileSolutions() { + const solutionPanels = await this.testSubjects.findAll('~homSolutionPanel', 2000); + const panelAttributes = await Promise.all( + solutionPanels.map((panel) => panel.getAttribute('data-test-subj')) + ); + return panelAttributes.map((attributeValue) => attributeValue.split('homSolutionPanel_')[1]); + } - async removeSampleDataSet(id: string) { - // looks like overkill but we're hitting flaky cases where we click but it doesn't remove - await testSubjects.waitForEnabled(`removeSampleDataSet${id}`); - // https://github.com/elastic/kibana/issues/65949 - // Even after waiting for the "Remove" button to be enabled we still have failures - // where it appears the click just didn't work. - await PageObjects.common.sleep(1010); - await testSubjects.click(`removeSampleDataSet${id}`); + async addSampleDataSet(id: string) { + const isInstalled = await this.isSampleDataSetInstalled(id); + if (!isInstalled) { + await this.testSubjects.click(`addSampleDataSet${id}`); await this._waitForSampleDataLoadingAction(id); } + } - // loading action is either uninstall and install - async _waitForSampleDataLoadingAction(id: string) { - const sampleDataCard = await testSubjects.find(`sampleDataSetCard${id}`); - await retry.try(async () => { - // waitForDeletedByCssSelector needs to be inside retry because it will timeout at least once - // before action is complete - await sampleDataCard.waitForDeletedByCssSelector('.euiLoadingSpinner'); - }); - } + async removeSampleDataSet(id: string) { + // looks like overkill but we're hitting flaky cases where we click but it doesn't remove + await this.testSubjects.waitForEnabled(`removeSampleDataSet${id}`); + // https://github.com/elastic/kibana/issues/65949 + // Even after waiting for the "Remove" button to be enabled we still have failures + // where it appears the click just didn't work. + await this.common.sleep(1010); + await this.testSubjects.click(`removeSampleDataSet${id}`); + await this._waitForSampleDataLoadingAction(id); + } - async launchSampleDashboard(id: string) { - await this.launchSampleDataSet(id); - await find.clickByLinkText('Dashboard'); - } + // loading action is either uninstall and install + async _waitForSampleDataLoadingAction(id: string) { + const sampleDataCard = await this.testSubjects.find(`sampleDataSetCard${id}`); + await this.retry.try(async () => { + // waitForDeletedByCssSelector needs to be inside retry because it will timeout at least once + // before action is complete + await sampleDataCard.waitForDeletedByCssSelector('.euiLoadingSpinner'); + }); + } - async launchSampleDataSet(id: string) { - await this.addSampleDataSet(id); - await testSubjects.click(`launchSampleDataSet${id}`); - } + async launchSampleDashboard(id: string) { + await this.launchSampleDataSet(id); + await this.find.clickByLinkText('Dashboard'); + } - async clickAllKibanaPlugins() { - await testSubjects.click('allPlugins'); - } + async launchSampleDataSet(id: string) { + await this.addSampleDataSet(id); + await this.testSubjects.click(`launchSampleDataSet${id}`); + } - async clickVisualizeExplorePlugins() { - await testSubjects.click('tab-data'); - } + async clickAllKibanaPlugins() { + await this.testSubjects.click('allPlugins'); + } - async clickAdminPlugin() { - await testSubjects.click('tab-admin'); - } + async clickVisualizeExplorePlugins() { + await this.testSubjects.click('tab-data'); + } - async clickOnConsole() { - await this.clickSynopsis('console'); - } - async clickOnLogo() { - await testSubjects.click('logo'); - } + async clickAdminPlugin() { + await this.testSubjects.click('tab-admin'); + } - async clickOnAddData() { - await this.clickSynopsis('home_tutorial_directory'); - } + async clickOnConsole() { + await this.clickSynopsis('console'); + } + async clickOnLogo() { + await this.testSubjects.click('logo'); + } - // clicks on Active MQ logs - async clickOnLogsTutorial() { - await this.clickSynopsis('activemqlogs'); - } + async clickOnAddData() { + await this.clickSynopsis('home_tutorial_directory'); + } - // clicks on cloud tutorial link - async clickOnCloudTutorial() { - await testSubjects.click('onCloudTutorial'); - } + // clicks on Active MQ logs + async clickOnLogsTutorial() { + await this.clickSynopsis('activemqlogs'); + } - // click on side nav toggle button to see all of side nav - async clickOnToggleNavButton() { - await testSubjects.click('toggleNavButton'); - } + // clicks on cloud tutorial link + async clickOnCloudTutorial() { + await this.testSubjects.click('onCloudTutorial'); + } - // collapse the observability side nav details - async collapseObservabibilitySideNav() { - await testSubjects.click('collapsibleNavGroup-observability'); - } + // click on side nav toggle button to see all of side nav + async clickOnToggleNavButton() { + await this.testSubjects.click('toggleNavButton'); + } - // dock the side nav - async dockTheSideNav() { - await testSubjects.click('collapsible-nav-lock'); - } + // collapse the observability side nav details + async collapseObservabibilitySideNav() { + await this.testSubjects.click('collapsibleNavGroup-observability'); + } - async loadSavedObjects() { - await retry.try(async () => { - await testSubjects.click('loadSavedObjects'); - const successMsgExists = await testSubjects.exists('loadSavedObjects_success', { - timeout: 5000, - }); - if (!successMsgExists) { - throw new Error('Failed to load saved objects'); - } - }); - } + // dock the side nav + async dockTheSideNav() { + await this.testSubjects.click('collapsible-nav-lock'); } - return new HomePage(); + async loadSavedObjects() { + await this.retry.try(async () => { + await this.testSubjects.click('loadSavedObjects'); + const successMsgExists = await this.testSubjects.exists('loadSavedObjects_success', { + timeout: 5000, + }); + if (!successMsgExists) { + throw new Error('Failed to load saved objects'); + } + }); + } } diff --git a/test/functional/page_objects/index.ts b/test/functional/page_objects/index.ts index 413e0aef1444b5..7c06344c1a1ad5 100644 --- a/test/functional/page_objects/index.ts +++ b/test/functional/page_objects/index.ts @@ -6,54 +6,54 @@ * Side Public License, v 1. */ -import { CommonPageProvider } from './common_page'; -import { ConsolePageProvider } from './console_page'; -import { ContextPageProvider } from './context_page'; -import { DashboardPageProvider } from './dashboard_page'; -import { DiscoverPageProvider } from './discover_page'; -import { ErrorPageProvider } from './error_page'; -import { HeaderPageProvider } from './header_page'; -import { HomePageProvider } from './home_page'; -import { NewsfeedPageProvider } from './newsfeed_page'; -import { SettingsPageProvider } from './settings_page'; -import { SharePageProvider } from './share_page'; -import { LoginPageProvider } from './login_page'; -import { TimePickerProvider } from './time_picker'; -import { TimelionPageProvider } from './timelion_page'; -import { VisualBuilderPageProvider } from './visual_builder_page'; -import { VisualizePageProvider } from './visualize_page'; -import { VisualizeEditorPageProvider } from './visualize_editor_page'; -import { VisualizeChartPageProvider } from './visualize_chart_page'; -import { TileMapPageProvider } from './tile_map_page'; -import { TimeToVisualizePageProvider } from './time_to_visualize_page'; -import { TagCloudPageProvider } from './tag_cloud_page'; -import { VegaChartPageProvider } from './vega_chart_page'; -import { SavedObjectsPageProvider } from './management/saved_objects_page'; -import { LegacyDataTableVisProvider } from './legacy/data_table_vis'; +import { CommonPageObject } from './common_page'; +import { ConsolePageObject } from './console_page'; +import { ContextPageObject } from './context_page'; +import { DashboardPageObject } from './dashboard_page'; +import { DiscoverPageObject } from './discover_page'; +import { ErrorPageObject } from './error_page'; +import { HeaderPageObject } from './header_page'; +import { HomePageObject } from './home_page'; +import { NewsfeedPageObject } from './newsfeed_page'; +import { SettingsPageObject } from './settings_page'; +import { SharePageObject } from './share_page'; +import { LoginPageObject } from './login_page'; +import { TimePickerPageObject } from './time_picker'; +import { TimelionPageObject } from './timelion_page'; +import { VisualBuilderPageObject } from './visual_builder_page'; +import { VisualizePageObject } from './visualize_page'; +import { VisualizeEditorPageObject } from './visualize_editor_page'; +import { VisualizeChartPageObject } from './visualize_chart_page'; +import { TileMapPageObject } from './tile_map_page'; +import { TimeToVisualizePageObject } from './time_to_visualize_page'; +import { TagCloudPageObject } from './tag_cloud_page'; +import { VegaChartPageObject } from './vega_chart_page'; +import { SavedObjectsPageObject } from './management/saved_objects_page'; +import { LegacyDataTableVisPageObject } from './legacy/data_table_vis'; export const pageObjects = { - common: CommonPageProvider, - console: ConsolePageProvider, - context: ContextPageProvider, - dashboard: DashboardPageProvider, - discover: DiscoverPageProvider, - error: ErrorPageProvider, - header: HeaderPageProvider, - home: HomePageProvider, - newsfeed: NewsfeedPageProvider, - settings: SettingsPageProvider, - share: SharePageProvider, - legacyDataTableVis: LegacyDataTableVisProvider, - login: LoginPageProvider, - timelion: TimelionPageProvider, - timePicker: TimePickerProvider, - visualBuilder: VisualBuilderPageProvider, - visualize: VisualizePageProvider, - visEditor: VisualizeEditorPageProvider, - visChart: VisualizeChartPageProvider, - tileMap: TileMapPageProvider, - timeToVisualize: TimeToVisualizePageProvider, - tagCloud: TagCloudPageProvider, - vegaChart: VegaChartPageProvider, - savedObjects: SavedObjectsPageProvider, + common: CommonPageObject, + console: ConsolePageObject, + context: ContextPageObject, + dashboard: DashboardPageObject, + discover: DiscoverPageObject, + error: ErrorPageObject, + header: HeaderPageObject, + home: HomePageObject, + newsfeed: NewsfeedPageObject, + settings: SettingsPageObject, + share: SharePageObject, + legacyDataTableVis: LegacyDataTableVisPageObject, + login: LoginPageObject, + timelion: TimelionPageObject, + timePicker: TimePickerPageObject, + visualBuilder: VisualBuilderPageObject, + visualize: VisualizePageObject, + visEditor: VisualizeEditorPageObject, + visChart: VisualizeChartPageObject, + tileMap: TileMapPageObject, + timeToVisualize: TimeToVisualizePageObject, + tagCloud: TagCloudPageObject, + vegaChart: VegaChartPageObject, + savedObjects: SavedObjectsPageObject, }; diff --git a/test/functional/page_objects/legacy/data_table_vis.ts b/test/functional/page_objects/legacy/data_table_vis.ts index ef787263f2ab9d..122409f28de900 100644 --- a/test/functional/page_objects/legacy/data_table_vis.ts +++ b/test/functional/page_objects/legacy/data_table_vis.ts @@ -6,80 +6,79 @@ * Side Public License, v 1. */ -import { FtrProviderContext } from 'test/functional/ftr_provider_context'; -import { WebElementWrapper } from 'test/functional/services/lib/web_element_wrapper'; +import { FtrService } from '../../ftr_provider_context'; +import { WebElementWrapper } from '../../services/lib/web_element_wrapper'; -export function LegacyDataTableVisProvider({ getService, getPageObjects }: FtrProviderContext) { - const testSubjects = getService('testSubjects'); - const retry = getService('retry'); +export class LegacyDataTableVisPageObject extends FtrService { + private readonly testSubjects = this.ctx.getService('testSubjects'); + private readonly retry = this.ctx.getService('retry'); - class LegacyDataTableVis { - /** - * Converts the table data into nested array - * [ [cell1_in_row1, cell2_in_row1], [cell1_in_row2, cell2_in_row2] ] - * @param element table - */ - private async getDataFromElement(element: WebElementWrapper): Promise { - const $ = await element.parseDomContent(); - return $('tr') - .toArray() - .map((row) => - $(row) - .find('td') - .toArray() - .map((cell) => - $(cell) - .text() - .replace(/ /g, '') - .trim() - ) - ); - } - - public async getTableVisContent({ stripEmptyRows = true } = {}) { - return await retry.try(async () => { - const container = await testSubjects.find('tableVis'); - const allTables = await testSubjects.findAllDescendant('paginated-table-body', container); + /** + * Converts the table data into nested array + * [ [cell1_in_row1, cell2_in_row1], [cell1_in_row2, cell2_in_row2] ] + * @param element table + */ + private async getDataFromElement(element: WebElementWrapper): Promise { + const $ = await element.parseDomContent(); + return $('tr') + .toArray() + .map((row) => + $(row) + .find('td') + .toArray() + .map((cell) => + $(cell) + .text() + .replace(/ /g, '') + .trim() + ) + ); + } - if (allTables.length === 0) { - return []; - } + public async getTableVisContent({ stripEmptyRows = true } = {}) { + return await this.retry.try(async () => { + const container = await this.testSubjects.find('tableVis'); + const allTables = await this.testSubjects.findAllDescendant( + 'paginated-table-body', + container + ); - const allData = await Promise.all( - allTables.map(async (t) => { - let data = await this.getDataFromElement(t); - if (stripEmptyRows) { - data = data.filter( - (row) => row.length > 0 && row.some((cell) => cell.trim().length > 0) - ); - } - return data; - }) - ); + if (allTables.length === 0) { + return []; + } - if (allTables.length === 1) { - // If there was only one table we return only the data for that table - // This prevents an unnecessary array around that single table, which - // is the case we have in most tests. - return allData[0]; - } + const allData = await Promise.all( + allTables.map(async (t) => { + let data = await this.getDataFromElement(t); + if (stripEmptyRows) { + data = data.filter( + (row) => row.length > 0 && row.some((cell) => cell.trim().length > 0) + ); + } + return data; + }) + ); - return allData; - }); - } + if (allTables.length === 1) { + // If there was only one table we return only the data for that table + // This prevents an unnecessary array around that single table, which + // is the case we have in most tests. + return allData[0]; + } - public async filterOnTableCell(columnIndex: number, rowIndex: number) { - await retry.try(async () => { - const tableVis = await testSubjects.find('tableVis'); - const cell = await tableVis.findByCssSelector( - `tbody tr:nth-child(${rowIndex}) td:nth-child(${columnIndex})` - ); - await cell.moveMouseTo(); - const filterBtn = await testSubjects.findDescendant('filterForCellValue', cell); - await filterBtn.click(); - }); - } + return allData; + }); } - return new LegacyDataTableVis(); + public async filterOnTableCell(columnIndex: number, rowIndex: number) { + await this.retry.try(async () => { + const tableVis = await this.testSubjects.find('tableVis'); + const cell = await tableVis.findByCssSelector( + `tbody tr:nth-child(${rowIndex}) td:nth-child(${columnIndex})` + ); + await cell.moveMouseTo(); + const filterBtn = await this.testSubjects.findDescendant('filterForCellValue', cell); + await filterBtn.click(); + }); + } } diff --git a/test/functional/page_objects/login_page.ts b/test/functional/page_objects/login_page.ts index 606ddf4643c405..5318a2b2d0c154 100644 --- a/test/functional/page_objects/login_page.ts +++ b/test/functional/page_objects/login_page.ts @@ -7,65 +7,61 @@ */ import { delay } from 'bluebird'; -import { FtrProviderContext } from '../ftr_provider_context'; +import { FtrService } from '../ftr_provider_context'; -export function LoginPageProvider({ getService }: FtrProviderContext) { - const testSubjects = getService('testSubjects'); - const log = getService('log'); - const find = getService('find'); +export class LoginPageObject extends FtrService { + private readonly testSubjects = this.ctx.getService('testSubjects'); + private readonly log = this.ctx.getService('log'); + private readonly find = this.ctx.getService('find'); - const regularLogin = async (user: string, pwd: string) => { - await testSubjects.setValue('loginUsername', user); - await testSubjects.setValue('loginPassword', pwd); - await testSubjects.click('loginSubmit'); - await find.waitForDeletedByCssSelector('.kibanaWelcomeLogo'); - await find.byCssSelector('[data-test-subj="kibanaChrome"]', 60000); // 60 sec waiting - }; - - const samlLogin = async (user: string, pwd: string) => { - try { - await find.clickByButtonText('Login using SAML'); - await find.setValue('input[name="email"]', user); - await find.setValue('input[type="password"]', pwd); - await find.clickByCssSelector('.auth0-label-submit'); - await find.byCssSelector('[data-test-subj="kibanaChrome"]', 60000); // 60 sec waiting - } catch (err) { - log.debug(`${err} \nFailed to find Auth0 login page, trying the Auth0 last login page`); - await find.clickByCssSelector('.auth0-lock-social-button'); + async login(user: string, pwd: string) { + const loginType = process.env.VM || ''; + if (loginType.includes('oidc') || loginType.includes('saml')) { + await this.samlLogin(user, pwd); + return; } - }; - class LoginPage { - async login(user: string, pwd: string) { - const loginType = process.env.VM || ''; - if (loginType.includes('oidc') || loginType.includes('saml')) { - await samlLogin(user, pwd); - return; - } + await this.regularLogin(user, pwd); + } - await regularLogin(user, pwd); - } + async logoutLogin(user: string, pwd: string) { + await this.logout(); + await this.sleep(3002); + await this.login(user, pwd); + } - async logoutLogin(user: string, pwd: string) { - await this.logout(); - await this.sleep(3002); - await this.login(user, pwd); - } + async logout() { + await this.testSubjects.click('userMenuButton'); + await this.sleep(500); + await this.testSubjects.click('logoutLink'); + this.log.debug('### found and clicked log out--------------------------'); + await this.sleep(8002); + } - async logout() { - await testSubjects.click('userMenuButton'); - await this.sleep(500); - await testSubjects.click('logoutLink'); - log.debug('### found and clicked log out--------------------------'); - await this.sleep(8002); - } + async sleep(sleepMilliseconds: number) { + this.log.debug(`... sleep(${sleepMilliseconds}) start`); + await delay(sleepMilliseconds); + this.log.debug(`... sleep(${sleepMilliseconds}) end`); + } - async sleep(sleepMilliseconds: number) { - log.debug(`... sleep(${sleepMilliseconds}) start`); - await delay(sleepMilliseconds); - log.debug(`... sleep(${sleepMilliseconds}) end`); - } + private async regularLogin(user: string, pwd: string) { + await this.testSubjects.setValue('loginUsername', user); + await this.testSubjects.setValue('loginPassword', pwd); + await this.testSubjects.click('loginSubmit'); + await this.find.waitForDeletedByCssSelector('.kibanaWelcomeLogo'); + await this.find.byCssSelector('[data-test-subj="kibanaChrome"]', 60000); // 60 sec waiting } - return new LoginPage(); + private async samlLogin(user: string, pwd: string) { + try { + await this.find.clickByButtonText('Login using SAML'); + await this.find.setValue('input[name="email"]', user); + await this.find.setValue('input[type="password"]', pwd); + await this.find.clickByCssSelector('.auth0-label-submit'); + await this.find.byCssSelector('[data-test-subj="kibanaChrome"]', 60000); // 60 sec waiting + } catch (err) { + this.log.debug(`${err} \nFailed to find Auth0 login page, trying the Auth0 last login page`); + await this.find.clickByCssSelector('.auth0-lock-social-button'); + } + } } diff --git a/test/functional/page_objects/management/saved_objects_page.ts b/test/functional/page_objects/management/saved_objects_page.ts index fc4de6ed7f82f8..9f48a6f57c8d81 100644 --- a/test/functional/page_objects/management/saved_objects_page.ts +++ b/test/functional/page_objects/management/saved_objects_page.ts @@ -8,328 +8,325 @@ import { keyBy } from 'lodash'; import { map as mapAsync } from 'bluebird'; -import { FtrProviderContext } from '../../ftr_provider_context'; - -export function SavedObjectsPageProvider({ getService, getPageObjects }: FtrProviderContext) { - const log = getService('log'); - const retry = getService('retry'); - const browser = getService('browser'); - const find = getService('find'); - const testSubjects = getService('testSubjects'); - const PageObjects = getPageObjects(['header', 'common']); - - class SavedObjectsPage { - async searchForObject(objectName: string) { - const searchBox = await testSubjects.find('savedObjectSearchBar'); - await searchBox.clearValue(); - await searchBox.type(objectName); - await searchBox.pressKeys(browser.keys.ENTER); - await PageObjects.header.waitUntilLoadingHasFinished(); - await this.waitTableIsLoaded(); - } - - async getCurrentSearchValue() { - const searchBox = await testSubjects.find('savedObjectSearchBar'); - return await searchBox.getAttribute('value'); - } +import { FtrService } from '../../ftr_provider_context'; + +export class SavedObjectsPageObject extends FtrService { + private readonly log = this.ctx.getService('log'); + private readonly retry = this.ctx.getService('retry'); + private readonly browser = this.ctx.getService('browser'); + private readonly find = this.ctx.getService('find'); + private readonly testSubjects = this.ctx.getService('testSubjects'); + private readonly common = this.ctx.getPageObject('common'); + private readonly header = this.ctx.getPageObject('header'); + + async searchForObject(objectName: string) { + const searchBox = await this.testSubjects.find('savedObjectSearchBar'); + await searchBox.clearValue(); + await searchBox.type(objectName); + await searchBox.pressKeys(this.browser.keys.ENTER); + await this.header.waitUntilLoadingHasFinished(); + await this.waitTableIsLoaded(); + } - async importFile(path: string, overwriteAll = true) { - log.debug(`importFile(${path})`); + async getCurrentSearchValue() { + const searchBox = await this.testSubjects.find('savedObjectSearchBar'); + return await searchBox.getAttribute('value'); + } - log.debug(`Clicking importObjects`); - await testSubjects.click('importObjects'); - await PageObjects.common.setFileInputPath(path); + async importFile(path: string, overwriteAll = true) { + this.log.debug(`importFile(${path})`); - if (!overwriteAll) { - log.debug(`Toggling overwriteAll`); - const radio = await testSubjects.find( - 'savedObjectsManagement-importModeControl-overwriteRadioGroup' - ); - // a radio button consists of a div tag that contains an input, a div, and a label - // we can't click the input directly, need to go up one level and click the parent div - const div = await radio.findByXpath("//div[input[@id='overwriteDisabled']]"); - await div.click(); - } else { - log.debug(`Leaving overwriteAll alone`); - } - await testSubjects.click('importSavedObjectsImportBtn'); - log.debug(`done importing the file`); + this.log.debug(`Clicking importObjects`); + await this.testSubjects.click('importObjects'); + await this.common.setFileInputPath(path); - // Wait for all the saves to happen - await PageObjects.header.waitUntilLoadingHasFinished(); + if (!overwriteAll) { + this.log.debug(`Toggling overwriteAll`); + const radio = await this.testSubjects.find( + 'savedObjectsManagement-importModeControl-overwriteRadioGroup' + ); + // a radio button consists of a div tag that contains an input, a div, and a label + // we can't click the input directly, need to go up one level and click the parent div + const div = await radio.findByXpath("//div[input[@id='overwriteDisabled']]"); + await div.click(); + } else { + this.log.debug(`Leaving overwriteAll alone`); } + await this.testSubjects.click('importSavedObjectsImportBtn'); + this.log.debug(`done importing the file`); - async checkImportSucceeded() { - await testSubjects.existOrFail('importSavedObjectsSuccess', { timeout: 20000 }); - } + // Wait for all the saves to happen + await this.header.waitUntilLoadingHasFinished(); + } - async checkNoneImported() { - await testSubjects.existOrFail('importSavedObjectsSuccessNoneImported', { timeout: 20000 }); - } + async checkImportSucceeded() { + await this.testSubjects.existOrFail('importSavedObjectsSuccess', { timeout: 20000 }); + } - async checkImportConflictsWarning() { - await testSubjects.existOrFail('importSavedObjectsConflictsWarning', { timeout: 20000 }); - } + async checkNoneImported() { + await this.testSubjects.existOrFail('importSavedObjectsSuccessNoneImported', { + timeout: 20000, + }); + } - async checkImportLegacyWarning() { - await testSubjects.existOrFail('importSavedObjectsLegacyWarning', { timeout: 20000 }); - } + async checkImportConflictsWarning() { + await this.testSubjects.existOrFail('importSavedObjectsConflictsWarning', { timeout: 20000 }); + } - async checkImportFailedWarning() { - await testSubjects.existOrFail('importSavedObjectsFailedWarning', { timeout: 20000 }); - } + async checkImportLegacyWarning() { + await this.testSubjects.existOrFail('importSavedObjectsLegacyWarning', { timeout: 20000 }); + } - async checkImportError() { - await testSubjects.existOrFail('importSavedObjectsErrorText', { timeout: 20000 }); - } + async checkImportFailedWarning() { + await this.testSubjects.existOrFail('importSavedObjectsFailedWarning', { timeout: 20000 }); + } - async getImportErrorText() { - return await testSubjects.getVisibleText('importSavedObjectsErrorText'); - } + async checkImportError() { + await this.testSubjects.existOrFail('importSavedObjectsErrorText', { timeout: 20000 }); + } - async clickImportDone() { - await testSubjects.click('importSavedObjectsDoneBtn'); - await this.waitTableIsLoaded(); - } + async getImportErrorText() { + return await this.testSubjects.getVisibleText('importSavedObjectsErrorText'); + } - async clickConfirmChanges() { - await testSubjects.click('importSavedObjectsConfirmBtn'); - } + async clickImportDone() { + await this.testSubjects.click('importSavedObjectsDoneBtn'); + await this.waitTableIsLoaded(); + } - async waitTableIsLoaded() { - return retry.try(async () => { - const isLoaded = await find.existsByDisplayedByCssSelector( - '*[data-test-subj="savedObjectsTable"] :not(.euiBasicTable-loading)' - ); + async clickConfirmChanges() { + await this.testSubjects.click('importSavedObjectsConfirmBtn'); + } - if (isLoaded) { - return true; - } else { - throw new Error('Waiting'); - } - }); - } + async waitTableIsLoaded() { + return this.retry.try(async () => { + const isLoaded = await this.find.existsByDisplayedByCssSelector( + '*[data-test-subj="savedObjectsTable"] :not(.euiBasicTable-loading)' + ); - async clickRelationshipsByTitle(title: string) { - const table = keyBy(await this.getElementsInTable(), 'title'); - // should we check if table size > 0 and log error if not? - if (table[title].menuElement) { - log.debug(`we found a context menu element for (${title}) so click it`); - await table[title].menuElement?.click(); - // Wait for context menu to render - const menuPanel = await find.byCssSelector('.euiContextMenuPanel'); - await (await menuPanel.findByTestSubject('savedObjectsTableAction-relationships')).click(); + if (isLoaded) { + return true; } else { - log.debug( - `we didn't find a menu element so should be a relastionships element for (${title}) to click` - ); - // or the action elements are on the row without the menu - await table[title].relationshipsElement?.click(); + throw new Error('Waiting'); } - } + }); + } - async setOverriddenIndexPatternValue(oldName: string, newName: string) { - const select = await testSubjects.find(`managementChangeIndexSelection-${oldName}`); - const option = await testSubjects.findDescendant(`indexPatternOption-${newName}`, select); - await option.click(); + async clickRelationshipsByTitle(title: string) { + const table = keyBy(await this.getElementsInTable(), 'title'); + // should we check if table size > 0 and log error if not? + if (table[title].menuElement) { + this.log.debug(`we found a context menu element for (${title}) so click it`); + await table[title].menuElement?.click(); + // Wait for context menu to render + const menuPanel = await this.find.byCssSelector('.euiContextMenuPanel'); + await (await menuPanel.findByTestSubject('savedObjectsTableAction-relationships')).click(); + } else { + this.log.debug( + `we didn't find a menu element so should be a relastionships element for (${title}) to click` + ); + // or the action elements are on the row without the menu + await table[title].relationshipsElement?.click(); } + } - async clickCopyToSpaceByTitle(title: string) { - const table = keyBy(await this.getElementsInTable(), 'title'); - // should we check if table size > 0 and log error if not? - if (table[title].menuElement) { - log.debug(`we found a context menu element for (${title}) so click it`); - await table[title].menuElement?.click(); - // Wait for context menu to render - const menuPanel = await find.byCssSelector('.euiContextMenuPanel'); - await ( - await menuPanel.findByTestSubject('savedObjectsTableAction-copy_saved_objects_to_space') - ).click(); - } else { - log.debug( - `we didn't find a menu element so should be a "copy to space" element for (${title}) to click` - ); - // or the action elements are on the row without the menu - await table[title].copySaveObjectsElement?.click(); - } - } + async setOverriddenIndexPatternValue(oldName: string, newName: string) { + const select = await this.testSubjects.find(`managementChangeIndexSelection-${oldName}`); + const option = await this.testSubjects.findDescendant(`indexPatternOption-${newName}`, select); + await option.click(); + } - async clickInspectByTitle(title: string) { - const table = keyBy(await this.getElementsInTable(), 'title'); - if (table[title].menuElement) { - await table[title].menuElement?.click(); - // Wait for context menu to render - const menuPanel = await find.byCssSelector('.euiContextMenuPanel'); - const panelButton = await menuPanel.findByTestSubject('savedObjectsTableAction-inspect'); - await panelButton.click(); - } else { - // or the action elements are on the row without the menu - await table[title].copySaveObjectsElement?.click(); - } + async clickCopyToSpaceByTitle(title: string) { + const table = keyBy(await this.getElementsInTable(), 'title'); + // should we check if table size > 0 and log error if not? + if (table[title].menuElement) { + this.log.debug(`we found a context menu element for (${title}) so click it`); + await table[title].menuElement?.click(); + // Wait for context menu to render + const menuPanel = await this.find.byCssSelector('.euiContextMenuPanel'); + await ( + await menuPanel.findByTestSubject('savedObjectsTableAction-copy_saved_objects_to_space') + ).click(); + } else { + this.log.debug( + `we didn't find a menu element so should be a "copy to space" element for (${title}) to click` + ); + // or the action elements are on the row without the menu + await table[title].copySaveObjectsElement?.click(); } + } - async clickCheckboxByTitle(title: string) { - const table = keyBy(await this.getElementsInTable(), 'title'); - // should we check if table size > 0 and log error if not? - await table[title].checkbox.click(); + async clickInspectByTitle(title: string) { + const table = keyBy(await this.getElementsInTable(), 'title'); + if (table[title].menuElement) { + await table[title].menuElement?.click(); + // Wait for context menu to render + const menuPanel = await this.find.byCssSelector('.euiContextMenuPanel'); + const panelButton = await menuPanel.findByTestSubject('savedObjectsTableAction-inspect'); + await panelButton.click(); + } else { + // or the action elements are on the row without the menu + await table[title].copySaveObjectsElement?.click(); } + } - async getObjectTypeByTitle(title: string) { - const table = keyBy(await this.getElementsInTable(), 'title'); - // should we check if table size > 0 and log error if not? - return table[title].objectType; - } + async clickCheckboxByTitle(title: string) { + const table = keyBy(await this.getElementsInTable(), 'title'); + // should we check if table size > 0 and log error if not? + await table[title].checkbox.click(); + } - async getElementsInTable() { - const rows = await testSubjects.findAll('~savedObjectsTableRow'); - return mapAsync(rows, async (row) => { - const checkbox = await row.findByCssSelector('[data-test-subj*="checkboxSelectRow"]'); - // return the object type aria-label="index patterns" - const objectType = await row.findByTestSubject('objectType'); - const titleElement = await row.findByTestSubject('savedObjectsTableRowTitle'); - // not all rows have inspect button - Advanced Settings objects don't - // Advanced Settings has 2 actions, - // data-test-subj="savedObjectsTableAction-relationships" - // data-test-subj="savedObjectsTableAction-copy_saved_objects_to_space" - // Some other objects have the ... - // data-test-subj="euiCollapsedItemActionsButton" - // Maybe some objects still have the inspect element visible? - // !!! Also note that since we don't have spaces on OSS, the actions for the same object can be different depending on OSS or not - let menuElement = null; - let inspectElement = null; - let relationshipsElement = null; - let copySaveObjectsElement = null; - const actions = await row.findByClassName('euiTableRowCell--hasActions'); - // getting the innerHTML and checking if it 'includes' a string is faster than a timeout looking for each element - const actionsHTML = await actions.getAttribute('innerHTML'); - if (actionsHTML.includes('euiCollapsedItemActionsButton')) { - menuElement = await row.findByTestSubject('euiCollapsedItemActionsButton'); - } - if (actionsHTML.includes('savedObjectsTableAction-inspect')) { - inspectElement = await row.findByTestSubject('savedObjectsTableAction-inspect'); - } - if (actionsHTML.includes('savedObjectsTableAction-relationships')) { - relationshipsElement = await row.findByTestSubject( - 'savedObjectsTableAction-relationships' - ); - } - if (actionsHTML.includes('savedObjectsTableAction-copy_saved_objects_to_space')) { - copySaveObjectsElement = await row.findByTestSubject( - 'savedObjectsTableAction-copy_saved_objects_to_space' - ); - } - return { - checkbox, - objectType: await objectType.getAttribute('aria-label'), - titleElement, - title: await titleElement.getVisibleText(), - menuElement, - inspectElement, - relationshipsElement, - copySaveObjectsElement, - }; - }); - } + async getObjectTypeByTitle(title: string) { + const table = keyBy(await this.getElementsInTable(), 'title'); + // should we check if table size > 0 and log error if not? + return table[title].objectType; + } - async getRowTitles() { - await this.waitTableIsLoaded(); - const table = await testSubjects.find('savedObjectsTable'); - const $ = await table.parseDomContent(); - return $.findTestSubjects('savedObjectsTableRowTitle') - .toArray() - .map((cell) => $(cell).find('.euiTableCellContent').text()); - } + async getElementsInTable() { + const rows = await this.testSubjects.findAll('~savedObjectsTableRow'); + return mapAsync(rows, async (row) => { + const checkbox = await row.findByCssSelector('[data-test-subj*="checkboxSelectRow"]'); + // return the object type aria-label="index patterns" + const objectType = await row.findByTestSubject('objectType'); + const titleElement = await row.findByTestSubject('savedObjectsTableRowTitle'); + // not all rows have inspect button - Advanced Settings objects don't + // Advanced Settings has 2 actions, + // data-test-subj="savedObjectsTableAction-relationships" + // data-test-subj="savedObjectsTableAction-copy_saved_objects_to_space" + // Some other objects have the ... + // data-test-subj="euiCollapsedItemActionsButton" + // Maybe some objects still have the inspect element visible? + // !!! Also note that since we don't have spaces on OSS, the actions for the same object can be different depending on OSS or not + let menuElement = null; + let inspectElement = null; + let relationshipsElement = null; + let copySaveObjectsElement = null; + const actions = await row.findByClassName('euiTableRowCell--hasActions'); + // getting the innerHTML and checking if it 'includes' a string is faster than a timeout looking for each element + const actionsHTML = await actions.getAttribute('innerHTML'); + if (actionsHTML.includes('euiCollapsedItemActionsButton')) { + menuElement = await row.findByTestSubject('euiCollapsedItemActionsButton'); + } + if (actionsHTML.includes('savedObjectsTableAction-inspect')) { + inspectElement = await row.findByTestSubject('savedObjectsTableAction-inspect'); + } + if (actionsHTML.includes('savedObjectsTableAction-relationships')) { + relationshipsElement = await row.findByTestSubject('savedObjectsTableAction-relationships'); + } + if (actionsHTML.includes('savedObjectsTableAction-copy_saved_objects_to_space')) { + copySaveObjectsElement = await row.findByTestSubject( + 'savedObjectsTableAction-copy_saved_objects_to_space' + ); + } + return { + checkbox, + objectType: await objectType.getAttribute('aria-label'), + titleElement, + title: await titleElement.getVisibleText(), + menuElement, + inspectElement, + relationshipsElement, + copySaveObjectsElement, + }; + }); + } - async getRelationshipFlyout() { - const rows = await testSubjects.findAll('relationshipsTableRow'); - return mapAsync(rows, async (row) => { - const objectType = await row.findByTestSubject('relationshipsObjectType'); - const relationship = await row.findByTestSubject('directRelationship'); - const titleElement = await row.findByTestSubject('relationshipsTitle'); - const inspectElement = await row.findByTestSubject('relationshipsTableAction-inspect'); - return { - objectType: await objectType.getAttribute('aria-label'), - relationship: await relationship.getVisibleText(), - titleElement, - title: await titleElement.getVisibleText(), - inspectElement, - }; - }); - } + async getRowTitles() { + await this.waitTableIsLoaded(); + const table = await this.testSubjects.find('savedObjectsTable'); + const $ = await table.parseDomContent(); + return $.findTestSubjects('savedObjectsTableRowTitle') + .toArray() + .map((cell) => $(cell).find('.euiTableCellContent').text()); + } - async getInvalidRelations() { - const rows = await testSubjects.findAll('invalidRelationshipsTableRow'); - return mapAsync(rows, async (row) => { - const objectType = await row.findByTestSubject('relationshipsObjectType'); - const objectId = await row.findByTestSubject('relationshipsObjectId'); - const relationship = await row.findByTestSubject('directRelationship'); - const error = await row.findByTestSubject('relationshipsError'); + async getRelationshipFlyout() { + const rows = await this.testSubjects.findAll('relationshipsTableRow'); + return mapAsync(rows, async (row) => { + const objectType = await row.findByTestSubject('relationshipsObjectType'); + const relationship = await row.findByTestSubject('directRelationship'); + const titleElement = await row.findByTestSubject('relationshipsTitle'); + const inspectElement = await row.findByTestSubject('relationshipsTableAction-inspect'); + return { + objectType: await objectType.getAttribute('aria-label'), + relationship: await relationship.getVisibleText(), + titleElement, + title: await titleElement.getVisibleText(), + inspectElement, + }; + }); + } + + async getInvalidRelations() { + const rows = await this.testSubjects.findAll('invalidRelationshipsTableRow'); + return mapAsync(rows, async (row) => { + const objectType = await row.findByTestSubject('relationshipsObjectType'); + const objectId = await row.findByTestSubject('relationshipsObjectId'); + const relationship = await row.findByTestSubject('directRelationship'); + const error = await row.findByTestSubject('relationshipsError'); + return { + type: await objectType.getVisibleText(), + id: await objectId.getVisibleText(), + relationship: await relationship.getVisibleText(), + error: await error.getVisibleText(), + }; + }); + } + + async getTableSummary() { + const table = await this.testSubjects.find('savedObjectsTable'); + const $ = await table.parseDomContent(); + return $('tbody tr') + .toArray() + .map((row) => { return { - type: await objectType.getVisibleText(), - id: await objectId.getVisibleText(), - relationship: await relationship.getVisibleText(), - error: await error.getVisibleText(), + title: $(row).find('td:nth-child(3) .euiTableCellContent').text(), + canViewInApp: Boolean($(row).find('td:nth-child(3) a').length), }; }); - } + } - async getTableSummary() { - const table = await testSubjects.find('savedObjectsTable'); - const $ = await table.parseDomContent(); - return $('tbody tr') - .toArray() - .map((row) => { - return { - title: $(row).find('td:nth-child(3) .euiTableCellContent').text(), - canViewInApp: Boolean($(row).find('td:nth-child(3) a').length), - }; - }); - } + async clickTableSelectAll() { + await this.testSubjects.click('checkboxSelectAll'); + } - async clickTableSelectAll() { - await testSubjects.click('checkboxSelectAll'); - } + async canBeDeleted() { + return await this.testSubjects.isEnabled('savedObjectsManagementDelete'); + } - async canBeDeleted() { - return await testSubjects.isEnabled('savedObjectsManagementDelete'); + async clickDelete({ confirmDelete = true }: { confirmDelete?: boolean } = {}) { + await this.testSubjects.click('savedObjectsManagementDelete'); + if (confirmDelete) { + await this.testSubjects.click('confirmModalConfirmButton'); + await this.waitTableIsLoaded(); } + } - async clickDelete({ confirmDelete = true }: { confirmDelete?: boolean } = {}) { - await testSubjects.click('savedObjectsManagementDelete'); - if (confirmDelete) { - await testSubjects.click('confirmModalConfirmButton'); - await this.waitTableIsLoaded(); - } - } + async getImportWarnings() { + const elements = await this.testSubjects.findAll('importSavedObjectsWarning'); + return Promise.all( + elements.map(async (element) => { + const message = await element + .findByClassName('euiCallOutHeader__title') + .then((titleEl) => titleEl.getVisibleText()); + const buttons = await element.findAllByClassName('euiButton'); + return { + message, + type: buttons.length ? 'action_required' : 'simple', + }; + }) + ); + } - async getImportWarnings() { - const elements = await testSubjects.findAll('importSavedObjectsWarning'); - return Promise.all( - elements.map(async (element) => { - const message = await element - .findByClassName('euiCallOutHeader__title') - .then((titleEl) => titleEl.getVisibleText()); - const buttons = await element.findAllByClassName('euiButton'); - return { - message, - type: buttons.length ? 'action_required' : 'simple', - }; - }) - ); + async getImportErrorsCount() { + this.log.debug(`Toggling overwriteAll`); + const errorCountNode = await this.testSubjects.find('importSavedObjectsErrorsCount'); + const errorCountText = await errorCountNode.getVisibleText(); + const match = errorCountText.match(/(\d)+/); + if (!match) { + throw Error(`unable to parse error count from text ${errorCountText}`); } - async getImportErrorsCount() { - log.debug(`Toggling overwriteAll`); - const errorCountNode = await testSubjects.find('importSavedObjectsErrorsCount'); - const errorCountText = await errorCountNode.getVisibleText(); - const match = errorCountText.match(/(\d)+/); - if (!match) { - throw Error(`unable to parse error count from text ${errorCountText}`); - } - - return +match[1]; - } + return +match[1]; } - - return new SavedObjectsPage(); } diff --git a/test/functional/page_objects/newsfeed_page.ts b/test/functional/page_objects/newsfeed_page.ts index 1fa9bb5b900020..3a4bbee9245528 100644 --- a/test/functional/page_objects/newsfeed_page.ts +++ b/test/functional/page_objects/newsfeed_page.ts @@ -6,58 +6,54 @@ * Side Public License, v 1. */ -import { FtrProviderContext } from '../ftr_provider_context'; - -export function NewsfeedPageProvider({ getService, getPageObjects }: FtrProviderContext) { - const log = getService('log'); - const find = getService('find'); - const retry = getService('retry'); - const flyout = getService('flyout'); - const testSubjects = getService('testSubjects'); - const PageObjects = getPageObjects(['common']); - - class NewsfeedPage { - async resetPage() { - await PageObjects.common.navigateToUrl('home', '', { useActualUrl: true }); - } - - async closeNewsfeedPanel() { - await flyout.ensureClosed('NewsfeedFlyout'); - log.debug('clickNewsfeed icon'); - await retry.waitFor('newsfeed flyout', async () => { - if (await testSubjects.exists('NewsfeedFlyout')) { - await testSubjects.click('NewsfeedFlyout > euiFlyoutCloseButton'); - return false; - } - return true; - }); - } +import { FtrService } from '../ftr_provider_context'; + +export class NewsfeedPageObject extends FtrService { + private readonly log = this.ctx.getService('log'); + private readonly find = this.ctx.getService('find'); + private readonly retry = this.ctx.getService('retry'); + private readonly flyout = this.ctx.getService('flyout'); + private readonly testSubjects = this.ctx.getService('testSubjects'); + private readonly common = this.ctx.getPageObject('common'); + + async resetPage() { + await this.common.navigateToUrl('home', '', { useActualUrl: true }); + } - async openNewsfeedPanel() { - log.debug('clickNewsfeed icon'); - return await testSubjects.exists('NewsfeedFlyout'); - } + async closeNewsfeedPanel() { + await this.flyout.ensureClosed('NewsfeedFlyout'); + this.log.debug('clickNewsfeed icon'); + await this.retry.waitFor('newsfeed flyout', async () => { + if (await this.testSubjects.exists('NewsfeedFlyout')) { + await this.testSubjects.click('NewsfeedFlyout > euiFlyoutCloseButton'); + return false; + } + return true; + }); + } - async getRedButtonSign() { - return await find.existsByCssSelector('.euiHeaderSectionItemButton__notification--dot'); - } + async openNewsfeedPanel() { + this.log.debug('clickNewsfeed icon'); + return await this.testSubjects.exists('NewsfeedFlyout'); + } - async getNewsfeedList() { - const list = await testSubjects.find('NewsfeedFlyout'); - const cells = await list.findAllByTestSubject('newsHeadAlert'); + async getRedButtonSign() { + return await this.find.existsByCssSelector('.euiHeaderSectionItemButton__notification--dot'); + } - const objects = []; - for (const cell of cells) { - objects.push(await cell.getVisibleText()); - } + async getNewsfeedList() { + const list = await this.testSubjects.find('NewsfeedFlyout'); + const cells = await list.findAllByTestSubject('newsHeadAlert'); - return objects; + const objects = []; + for (const cell of cells) { + objects.push(await cell.getVisibleText()); } - async openNewsfeedEmptyPanel() { - return await testSubjects.exists('emptyNewsfeed'); - } + return objects; } - return new NewsfeedPage(); + async openNewsfeedEmptyPanel() { + return await this.testSubjects.exists('emptyNewsfeed'); + } } diff --git a/test/functional/page_objects/settings_page.ts b/test/functional/page_objects/settings_page.ts index 699165a51ca8c9..7d7da79b4a3974 100644 --- a/test/functional/page_objects/settings_page.ts +++ b/test/functional/page_objects/settings_page.ts @@ -8,731 +8,730 @@ import { map as mapAsync } from 'bluebird'; import expect from '@kbn/expect'; -import { FtrProviderContext } from '../ftr_provider_context'; - -export function SettingsPageProvider({ getService, getPageObjects }: FtrProviderContext) { - const log = getService('log'); - const retry = getService('retry'); - const browser = getService('browser'); - const find = getService('find'); - const flyout = getService('flyout'); - const testSubjects = getService('testSubjects'); - const comboBox = getService('comboBox'); - const PageObjects = getPageObjects(['header', 'common', 'savedObjects']); - - class SettingsPage { - async clickNavigation() { - await find.clickDisplayedByCssSelector('.app-link:nth-child(5) a'); - } +import { FtrService } from '../ftr_provider_context'; + +export class SettingsPageObject extends FtrService { + private readonly log = this.ctx.getService('log'); + private readonly retry = this.ctx.getService('retry'); + private readonly browser = this.ctx.getService('browser'); + private readonly find = this.ctx.getService('find'); + private readonly flyout = this.ctx.getService('flyout'); + private readonly testSubjects = this.ctx.getService('testSubjects'); + private readonly comboBox = this.ctx.getService('comboBox'); + private readonly header = this.ctx.getPageObject('header'); + private readonly common = this.ctx.getPageObject('common'); + private readonly savedObjects = this.ctx.getPageObject('savedObjects'); + + async clickNavigation() { + await this.find.clickDisplayedByCssSelector('.app-link:nth-child(5) a'); + } - async clickLinkText(text: string) { - await find.clickByDisplayedLinkText(text); - } + async clickLinkText(text: string) { + await this.find.clickByDisplayedLinkText(text); + } - async clickKibanaSettings() { - await testSubjects.click('settings'); - await PageObjects.header.waitUntilLoadingHasFinished(); - await testSubjects.existOrFail('managementSettingsTitle'); - } + async clickKibanaSettings() { + await this.testSubjects.click('settings'); + await this.header.waitUntilLoadingHasFinished(); + await this.testSubjects.existOrFail('managementSettingsTitle'); + } - async clickKibanaSavedObjects() { - await testSubjects.click('objects'); - await PageObjects.savedObjects.waitTableIsLoaded(); - } + async clickKibanaSavedObjects() { + await this.testSubjects.click('objects'); + await this.savedObjects.waitTableIsLoaded(); + } - async clickKibanaIndexPatterns() { - log.debug('clickKibanaIndexPatterns link'); - await testSubjects.click('indexPatterns'); + async clickKibanaIndexPatterns() { + this.log.debug('clickKibanaIndexPatterns link'); + await this.testSubjects.click('indexPatterns'); - await PageObjects.header.waitUntilLoadingHasFinished(); - } + await this.header.waitUntilLoadingHasFinished(); + } - async getAdvancedSettings(propertyName: string) { - log.debug('in getAdvancedSettings'); - return await testSubjects.getAttribute(`advancedSetting-editField-${propertyName}`, 'value'); - } + async getAdvancedSettings(propertyName: string) { + this.log.debug('in getAdvancedSettings'); + return await this.testSubjects.getAttribute( + `advancedSetting-editField-${propertyName}`, + 'value' + ); + } - async expectDisabledAdvancedSetting(propertyName: string) { - expect( - await testSubjects.getAttribute(`advancedSetting-editField-${propertyName}`, 'disabled') - ).to.eql('true'); - } + async expectDisabledAdvancedSetting(propertyName: string) { + expect( + await this.testSubjects.getAttribute(`advancedSetting-editField-${propertyName}`, 'disabled') + ).to.eql('true'); + } - async getAdvancedSettingCheckbox(propertyName: string) { - log.debug('in getAdvancedSettingCheckbox'); - return await testSubjects.getAttribute( - `advancedSetting-editField-${propertyName}`, - 'checked' - ); - } + async getAdvancedSettingCheckbox(propertyName: string) { + this.log.debug('in getAdvancedSettingCheckbox'); + return await this.testSubjects.getAttribute( + `advancedSetting-editField-${propertyName}`, + 'checked' + ); + } - async clearAdvancedSettings(propertyName: string) { - await testSubjects.click(`advancedSetting-resetField-${propertyName}`); - await PageObjects.header.waitUntilLoadingHasFinished(); - await testSubjects.click(`advancedSetting-saveButton`); - await PageObjects.header.waitUntilLoadingHasFinished(); - } + async clearAdvancedSettings(propertyName: string) { + await this.testSubjects.click(`advancedSetting-resetField-${propertyName}`); + await this.header.waitUntilLoadingHasFinished(); + await this.testSubjects.click(`advancedSetting-saveButton`); + await this.header.waitUntilLoadingHasFinished(); + } - async setAdvancedSettingsSelect(propertyName: string, propertyValue: string) { - await find.clickByCssSelector( - `[data-test-subj="advancedSetting-editField-${propertyName}"] option[value="${propertyValue}"]` - ); - await PageObjects.header.waitUntilLoadingHasFinished(); - await testSubjects.click(`advancedSetting-saveButton`); - await PageObjects.header.waitUntilLoadingHasFinished(); - } + async setAdvancedSettingsSelect(propertyName: string, propertyValue: string) { + await this.find.clickByCssSelector( + `[data-test-subj="advancedSetting-editField-${propertyName}"] option[value="${propertyValue}"]` + ); + await this.header.waitUntilLoadingHasFinished(); + await this.testSubjects.click(`advancedSetting-saveButton`); + await this.header.waitUntilLoadingHasFinished(); + } - async setAdvancedSettingsInput(propertyName: string, propertyValue: string) { - const input = await testSubjects.find(`advancedSetting-editField-${propertyName}`); - await input.clearValue(); - await input.type(propertyValue); - await testSubjects.click(`advancedSetting-saveButton`); - await PageObjects.header.waitUntilLoadingHasFinished(); - } + async setAdvancedSettingsInput(propertyName: string, propertyValue: string) { + const input = await this.testSubjects.find(`advancedSetting-editField-${propertyName}`); + await input.clearValue(); + await input.type(propertyValue); + await this.testSubjects.click(`advancedSetting-saveButton`); + await this.header.waitUntilLoadingHasFinished(); + } - async setAdvancedSettingsTextArea(propertyName: string, propertyValue: string) { - const wrapper = await testSubjects.find(`advancedSetting-editField-${propertyName}`); - const textarea = await wrapper.findByTagName('textarea'); - await textarea.focus(); - // only way to properly replace the value of the ace editor is via the JS api - await browser.execute( - (editor: string, value: string) => { - return (window as any).ace.edit(editor).setValue(value); - }, - `advancedSetting-editField-${propertyName}-editor`, - propertyValue - ); - await testSubjects.click(`advancedSetting-saveButton`); - await PageObjects.header.waitUntilLoadingHasFinished(); - } + async setAdvancedSettingsTextArea(propertyName: string, propertyValue: string) { + const wrapper = await this.testSubjects.find(`advancedSetting-editField-${propertyName}`); + const textarea = await wrapper.findByTagName('textarea'); + await textarea.focus(); + // only way to properly replace the value of the ace editor is via the JS api + await this.browser.execute( + (editor: string, value: string) => { + return (window as any).ace.edit(editor).setValue(value); + }, + `advancedSetting-editField-${propertyName}-editor`, + propertyValue + ); + await this.testSubjects.click(`advancedSetting-saveButton`); + await this.header.waitUntilLoadingHasFinished(); + } - async toggleAdvancedSettingCheckbox(propertyName: string) { - await testSubjects.click(`advancedSetting-editField-${propertyName}`); - await PageObjects.header.waitUntilLoadingHasFinished(); - await testSubjects.click(`advancedSetting-saveButton`); - await PageObjects.header.waitUntilLoadingHasFinished(); - } + async toggleAdvancedSettingCheckbox(propertyName: string) { + await this.testSubjects.click(`advancedSetting-editField-${propertyName}`); + await this.header.waitUntilLoadingHasFinished(); + await this.testSubjects.click(`advancedSetting-saveButton`); + await this.header.waitUntilLoadingHasFinished(); + } - async navigateTo() { - await PageObjects.common.navigateToApp('settings'); - } + async navigateTo() { + await this.common.navigateToApp('settings'); + } - async getIndexPatternField() { - return await testSubjects.find('createIndexPatternNameInput'); - } + async getIndexPatternField() { + return await this.testSubjects.find('createIndexPatternNameInput'); + } - async clickTimeFieldNameField() { - return await testSubjects.click('createIndexPatternTimeFieldSelect'); - } + async clickTimeFieldNameField() { + return await this.testSubjects.click('createIndexPatternTimeFieldSelect'); + } - async getTimeFieldNameField() { - return await testSubjects.find('createIndexPatternTimeFieldSelect'); - } + async getTimeFieldNameField() { + return await this.testSubjects.find('createIndexPatternTimeFieldSelect'); + } - async selectTimeFieldOption(selection: string) { - // open dropdown - await this.clickTimeFieldNameField(); - // close dropdown, keep focus - await this.clickTimeFieldNameField(); - await PageObjects.header.waitUntilLoadingHasFinished(); - return await retry.try(async () => { - log.debug(`selectTimeFieldOption(${selection})`); - const timeFieldOption = await this.getTimeFieldOption(selection); - await timeFieldOption.click(); - const selected = await timeFieldOption.isSelected(); - if (!selected) throw new Error('option not selected: ' + selected); - }); - } + async selectTimeFieldOption(selection: string) { + // open dropdown + await this.clickTimeFieldNameField(); + // close dropdown, keep focus + await this.clickTimeFieldNameField(); + await this.header.waitUntilLoadingHasFinished(); + return await this.retry.try(async () => { + this.log.debug(`selectTimeFieldOption(${selection})`); + const timeFieldOption = await this.getTimeFieldOption(selection); + await timeFieldOption.click(); + const selected = await timeFieldOption.isSelected(); + if (!selected) throw new Error('option not selected: ' + selected); + }); + } - async getTimeFieldOption(selection: string) { - return await find.displayedByCssSelector('option[value="' + selection + '"]'); - } + async getTimeFieldOption(selection: string) { + return await this.find.displayedByCssSelector('option[value="' + selection + '"]'); + } - async getCreateIndexPatternButton() { - return await testSubjects.find('createIndexPatternButton'); - } + async getCreateIndexPatternButton() { + return await this.testSubjects.find('createIndexPatternButton'); + } - async getCreateButton() { - return await find.displayedByCssSelector('[type="submit"]'); - } + async getCreateButton() { + return await this.find.displayedByCssSelector('[type="submit"]'); + } - async clickDefaultIndexButton() { - await testSubjects.click('setDefaultIndexPatternButton'); - await PageObjects.header.waitUntilLoadingHasFinished(); - } + async clickDefaultIndexButton() { + await this.testSubjects.click('setDefaultIndexPatternButton'); + await this.header.waitUntilLoadingHasFinished(); + } - async clickDeletePattern() { - await testSubjects.click('deleteIndexPatternButton'); - } + async clickDeletePattern() { + await this.testSubjects.click('deleteIndexPatternButton'); + } - async getIndexPageHeading() { - return await testSubjects.getVisibleText('indexPatternTitle'); - } + async getIndexPageHeading() { + return await this.testSubjects.getVisibleText('indexPatternTitle'); + } - async getConfigureHeader() { - return await find.byCssSelector('h1'); - } + async getConfigureHeader() { + return await this.find.byCssSelector('h1'); + } - async getTableHeader() { - return await find.allByCssSelector('table.euiTable thead tr th'); - } + async getTableHeader() { + return await this.find.allByCssSelector('table.euiTable thead tr th'); + } - async sortBy(columnName: string) { - const chartTypes = await find.allByCssSelector('table.euiTable thead tr th button'); + async sortBy(columnName: string) { + const chartTypes = await this.find.allByCssSelector('table.euiTable thead tr th button'); - async function getChartType(chart: Record) { - const chartString = await chart.getVisibleText(); - if (chartString === columnName) { - await chart.click(); - await PageObjects.header.waitUntilLoadingHasFinished(); - } + const getChartType = async (chart: Record) => { + const chartString = await chart.getVisibleText(); + if (chartString === columnName) { + await chart.click(); + await this.header.waitUntilLoadingHasFinished(); } + }; - const getChartTypesPromises = chartTypes.map(getChartType); - return Promise.all(getChartTypesPromises); - } + const getChartTypesPromises = chartTypes.map(getChartType); + return Promise.all(getChartTypesPromises); + } - async getTableRow(rowNumber: number, colNumber: number) { - // passing in zero-based index, but adding 1 for css 1-based indexes - return await find.byCssSelector( - 'table.euiTable tbody tr:nth-child(' + - (rowNumber + 1) + - ') td.euiTableRowCell:nth-child(' + - (colNumber + 1) + - ')' - ); - } + async getTableRow(rowNumber: number, colNumber: number) { + // passing in zero-based index, but adding 1 for css 1-based indexes + return await this.find.byCssSelector( + 'table.euiTable tbody tr:nth-child(' + + (rowNumber + 1) + + ') td.euiTableRowCell:nth-child(' + + (colNumber + 1) + + ')' + ); + } - async getFieldsTabCount() { - return retry.try(async () => { - const text = await testSubjects.getVisibleText('tab-indexedFields'); - return text.split(' ')[1].replace(/\((.*)\)/, '$1'); - }); - } + async getFieldsTabCount() { + return this.retry.try(async () => { + const text = await this.testSubjects.getVisibleText('tab-indexedFields'); + return text.split(' ')[1].replace(/\((.*)\)/, '$1'); + }); + } - async getScriptedFieldsTabCount() { - return await retry.try(async () => { - const text = await testSubjects.getVisibleText('tab-scriptedFields'); - return text.split(' ')[2].replace(/\((.*)\)/, '$1'); - }); - } + async getScriptedFieldsTabCount() { + return await this.retry.try(async () => { + const text = await this.testSubjects.getVisibleText('tab-scriptedFields'); + return text.split(' ')[2].replace(/\((.*)\)/, '$1'); + }); + } - async getFieldNames() { - const fieldNameCells = await testSubjects.findAll('editIndexPattern > indexedFieldName'); - return await mapAsync(fieldNameCells, async (cell) => { - return (await cell.getVisibleText()).trim(); - }); - } + async getFieldNames() { + const fieldNameCells = await this.testSubjects.findAll('editIndexPattern > indexedFieldName'); + return await mapAsync(fieldNameCells, async (cell) => { + return (await cell.getVisibleText()).trim(); + }); + } - async getFieldTypes() { - const fieldNameCells = await testSubjects.findAll('editIndexPattern > indexedFieldType'); - return await mapAsync(fieldNameCells, async (cell) => { - return (await cell.getVisibleText()).trim(); - }); - } + async getFieldTypes() { + const fieldNameCells = await this.testSubjects.findAll('editIndexPattern > indexedFieldType'); + return await mapAsync(fieldNameCells, async (cell) => { + return (await cell.getVisibleText()).trim(); + }); + } - async getScriptedFieldLangs() { - const fieldNameCells = await testSubjects.findAll('editIndexPattern > scriptedFieldLang'); - return await mapAsync(fieldNameCells, async (cell) => { - return (await cell.getVisibleText()).trim(); - }); - } + async getScriptedFieldLangs() { + const fieldNameCells = await this.testSubjects.findAll('editIndexPattern > scriptedFieldLang'); + return await mapAsync(fieldNameCells, async (cell) => { + return (await cell.getVisibleText()).trim(); + }); + } - async setFieldTypeFilter(type: string) { - await find.clickByCssSelector( - 'select[data-test-subj="indexedFieldTypeFilterDropdown"] > option[value="' + type + '"]' - ); - } + async setFieldTypeFilter(type: string) { + await this.find.clickByCssSelector( + 'select[data-test-subj="indexedFieldTypeFilterDropdown"] > option[value="' + type + '"]' + ); + } - async setScriptedFieldLanguageFilter(language: string) { - await find.clickByCssSelector( - 'select[data-test-subj="scriptedFieldLanguageFilterDropdown"] > option[value="' + - language + - '"]' - ); - } + async setScriptedFieldLanguageFilter(language: string) { + await this.find.clickByCssSelector( + 'select[data-test-subj="scriptedFieldLanguageFilterDropdown"] > option[value="' + + language + + '"]' + ); + } - async filterField(name: string) { - const input = await testSubjects.find('indexPatternFieldFilter'); - await input.clearValue(); - await input.type(name); - } + async filterField(name: string) { + const input = await this.testSubjects.find('indexPatternFieldFilter'); + await input.clearValue(); + await input.type(name); + } - async openControlsByName(name: string) { - await this.filterField(name); - const tableFields = await ( - await find.byCssSelector( - 'table.euiTable tbody tr.euiTableRow td.euiTableRowCell:first-child' - ) - ).getVisibleText(); - - await find.clickByCssSelector( - `table.euiTable tbody tr.euiTableRow:nth-child(${tableFields.indexOf(name) + 1}) - td:nth-last-child(2) button` - ); - } + async openControlsByName(name: string) { + await this.filterField(name); + const tableFields = await ( + await this.find.byCssSelector( + 'table.euiTable tbody tr.euiTableRow td.euiTableRowCell:first-child' + ) + ).getVisibleText(); + + await this.find.clickByCssSelector( + `table.euiTable tbody tr.euiTableRow:nth-child(${tableFields.indexOf(name) + 1}) + td:nth-last-child(2) button` + ); + } - async increasePopularity() { - await testSubjects.setValue('editorFieldCount', '1', { clearWithKeyboard: true }); - } + async increasePopularity() { + await this.testSubjects.setValue('editorFieldCount', '1', { clearWithKeyboard: true }); + } - async getPopularity() { - return await testSubjects.getAttribute('editorFieldCount', 'value'); - } + async getPopularity() { + return await this.testSubjects.getAttribute('editorFieldCount', 'value'); + } - async controlChangeCancel() { - await testSubjects.click('fieldCancelButton'); - await PageObjects.header.waitUntilLoadingHasFinished(); - } + async controlChangeCancel() { + await this.testSubjects.click('fieldCancelButton'); + await this.header.waitUntilLoadingHasFinished(); + } - async controlChangeSave() { - await testSubjects.click('fieldSaveButton'); - await PageObjects.header.waitUntilLoadingHasFinished(); - } + async controlChangeSave() { + await this.testSubjects.click('fieldSaveButton'); + await this.header.waitUntilLoadingHasFinished(); + } - async hasIndexPattern(name: string) { - return await find.existsByLinkText(name); - } + async hasIndexPattern(name: string) { + return await this.find.existsByLinkText(name); + } - async clickIndexPatternByName(name: string) { - const indexLink = await find.byXPath(`//a[descendant::*[text()='${name}']]`); - await indexLink.click(); - } + async clickIndexPatternByName(name: string) { + const indexLink = await this.find.byXPath(`//a[descendant::*[text()='${name}']]`); + await indexLink.click(); + } - async clickIndexPatternLogstash() { - await this.clickIndexPatternByName('logstash-*'); - } + async clickIndexPatternLogstash() { + await this.clickIndexPatternByName('logstash-*'); + } - async getIndexPatternList() { - await testSubjects.existOrFail('indexPatternTable', { timeout: 5000 }); - return await find.allByCssSelector( - '[data-test-subj="indexPatternTable"] .euiTable .euiTableRow' - ); - } + async getIndexPatternList() { + await this.testSubjects.existOrFail('indexPatternTable', { timeout: 5000 }); + return await this.find.allByCssSelector( + '[data-test-subj="indexPatternTable"] .euiTable .euiTableRow' + ); + } - async getAllIndexPatternNames() { - const indexPatterns = await this.getIndexPatternList(); - return await mapAsync(indexPatterns, async (index) => { - return await index.getVisibleText(); - }); - } + async getAllIndexPatternNames() { + const indexPatterns = await this.getIndexPatternList(); + return await mapAsync(indexPatterns, async (index) => { + return await index.getVisibleText(); + }); + } - async isIndexPatternListEmpty() { - return !(await testSubjects.exists('indexPatternTable', { timeout: 5000 })); - } + async isIndexPatternListEmpty() { + return !(await this.testSubjects.exists('indexPatternTable', { timeout: 5000 })); + } - async removeLogstashIndexPatternIfExist() { - if (!(await this.isIndexPatternListEmpty())) { - await this.clickIndexPatternLogstash(); - await this.removeIndexPattern(); - } + async removeLogstashIndexPatternIfExist() { + if (!(await this.isIndexPatternListEmpty())) { + await this.clickIndexPatternLogstash(); + await this.removeIndexPattern(); } + } - async createIndexPattern( - indexPatternName: string, - // null to bypass default value - timefield: string | null = '@timestamp', - isStandardIndexPattern = true - ) { - await retry.try(async () => { - await PageObjects.header.waitUntilLoadingHasFinished(); - await this.clickKibanaIndexPatterns(); - const exists = await this.hasIndexPattern(indexPatternName); - - if (exists) { - await this.clickIndexPatternByName(indexPatternName); - return; - } + async createIndexPattern( + indexPatternName: string, + // null to bypass default value + timefield: string | null = '@timestamp', + isStandardIndexPattern = true + ) { + await this.retry.try(async () => { + await this.header.waitUntilLoadingHasFinished(); + await this.clickKibanaIndexPatterns(); + const exists = await this.hasIndexPattern(indexPatternName); + + if (exists) { + await this.clickIndexPatternByName(indexPatternName); + return; + } - await PageObjects.header.waitUntilLoadingHasFinished(); - await this.clickAddNewIndexPatternButton(); - if (!isStandardIndexPattern) { - await this.clickCreateNewRollupButton(); - } - await PageObjects.header.waitUntilLoadingHasFinished(); - await retry.try(async () => { - await this.setIndexPatternField(indexPatternName); - }); - - const btn = await this.getCreateIndexPatternGoToStep2Button(); - await retry.waitFor(`index pattern Go To Step 2 button to be enabled`, async () => { - return await btn.isEnabled(); - }); - await btn.click(); - - await PageObjects.common.sleep(2000); - if (timefield) { - await this.selectTimeFieldOption(timefield); - } - await (await this.getCreateIndexPatternButton()).click(); + await this.header.waitUntilLoadingHasFinished(); + await this.clickAddNewIndexPatternButton(); + if (!isStandardIndexPattern) { + await this.clickCreateNewRollupButton(); + } + await this.header.waitUntilLoadingHasFinished(); + await this.retry.try(async () => { + await this.setIndexPatternField(indexPatternName); }); - await PageObjects.header.waitUntilLoadingHasFinished(); - await retry.try(async () => { - const currentUrl = await browser.getCurrentUrl(); - log.info('currentUrl', currentUrl); - if (!currentUrl.match(/indexPatterns\/.+\?/)) { - throw new Error('Index pattern not created'); - } else { - log.debug('Index pattern created: ' + currentUrl); - } + + const btn = await this.getCreateIndexPatternGoToStep2Button(); + await this.retry.waitFor(`index pattern Go To Step 2 button to be enabled`, async () => { + return await btn.isEnabled(); }); + await btn.click(); - return await this.getIndexPatternIdFromUrl(); - } + await this.common.sleep(2000); + if (timefield) { + await this.selectTimeFieldOption(timefield); + } + await (await this.getCreateIndexPatternButton()).click(); + }); + await this.header.waitUntilLoadingHasFinished(); + await this.retry.try(async () => { + const currentUrl = await this.browser.getCurrentUrl(); + this.log.info('currentUrl', currentUrl); + if (!currentUrl.match(/indexPatterns\/.+\?/)) { + throw new Error('Index pattern not created'); + } else { + this.log.debug('Index pattern created: ' + currentUrl); + } + }); - async clickAddNewIndexPatternButton() { - await PageObjects.common.scrollKibanaBodyTop(); - await testSubjects.click('createIndexPatternButton'); - } + return await this.getIndexPatternIdFromUrl(); + } - async clickCreateNewRollupButton() { - await testSubjects.click('createRollupIndexPatternButton'); - } + async clickAddNewIndexPatternButton() { + await this.common.scrollKibanaBodyTop(); + await this.testSubjects.click('createIndexPatternButton'); + } - async getIndexPatternIdFromUrl() { - const currentUrl = await browser.getCurrentUrl(); - const indexPatternId = currentUrl.match(/.*\/(.*)/)![1]; + async clickCreateNewRollupButton() { + await this.testSubjects.click('createRollupIndexPatternButton'); + } - log.debug('index pattern ID: ', indexPatternId); + async getIndexPatternIdFromUrl() { + const currentUrl = await this.browser.getCurrentUrl(); + const indexPatternId = currentUrl.match(/.*\/(.*)/)![1]; - return indexPatternId; - } + this.log.debug('index pattern ID: ', indexPatternId); - async setIndexPatternField(indexPatternName = 'logstash-*') { - log.debug(`setIndexPatternField(${indexPatternName})`); - const field = await this.getIndexPatternField(); - await field.clearValue(); - if ( - indexPatternName.charAt(0) === '*' && - indexPatternName.charAt(indexPatternName.length - 1) === '*' - ) { - // this is a special case when the index pattern name starts with '*' - // like '*:makelogs-*' where the UI will not append * - await field.type(indexPatternName, { charByChar: true }); - } else if (indexPatternName.charAt(indexPatternName.length - 1) === '*') { - // the common case where the UI will append '*' automatically so we won't type it - const tempName = indexPatternName.slice(0, -1); - await field.type(tempName, { charByChar: true }); - } else { - // case where we don't want the * appended so we'll remove it if it was added - await field.type(indexPatternName, { charByChar: true }); - const tempName = await field.getAttribute('value'); - if (tempName.length > indexPatternName.length) { - await field.type(browser.keys.DELETE, { charByChar: true }); - } + return indexPatternId; + } + + async setIndexPatternField(indexPatternName = 'logstash-*') { + this.log.debug(`setIndexPatternField(${indexPatternName})`); + const field = await this.getIndexPatternField(); + await field.clearValue(); + if ( + indexPatternName.charAt(0) === '*' && + indexPatternName.charAt(indexPatternName.length - 1) === '*' + ) { + // this is a special case when the index pattern name starts with '*' + // like '*:makelogs-*' where the UI will not append * + await field.type(indexPatternName, { charByChar: true }); + } else if (indexPatternName.charAt(indexPatternName.length - 1) === '*') { + // the common case where the UI will append '*' automatically so we won't type it + const tempName = indexPatternName.slice(0, -1); + await field.type(tempName, { charByChar: true }); + } else { + // case where we don't want the * appended so we'll remove it if it was added + await field.type(indexPatternName, { charByChar: true }); + const tempName = await field.getAttribute('value'); + if (tempName.length > indexPatternName.length) { + await field.type(this.browser.keys.DELETE, { charByChar: true }); } - const currentName = await field.getAttribute('value'); - log.debug(`setIndexPatternField set to ${currentName}`); - expect(currentName).to.eql(indexPatternName); } + const currentName = await field.getAttribute('value'); + this.log.debug(`setIndexPatternField set to ${currentName}`); + expect(currentName).to.eql(indexPatternName); + } - async getCreateIndexPatternGoToStep2Button() { - return await testSubjects.find('createIndexPatternGoToStep2Button'); - } + async getCreateIndexPatternGoToStep2Button() { + return await this.testSubjects.find('createIndexPatternGoToStep2Button'); + } - async removeIndexPattern() { - let alertText; - await retry.try(async () => { - log.debug('click delete index pattern button'); - await this.clickDeletePattern(); - }); - await retry.try(async () => { - log.debug('getAlertText'); - alertText = await testSubjects.getVisibleText('confirmModalTitleText'); - }); - await retry.try(async () => { - log.debug('acceptConfirmation'); - await testSubjects.click('confirmModalConfirmButton'); - }); - await retry.try(async () => { - const currentUrl = await browser.getCurrentUrl(); - if (currentUrl.match(/index_patterns\/.+\?/)) { - throw new Error('Index pattern not removed'); - } - }); - return alertText; - } + async removeIndexPattern() { + let alertText; + await this.retry.try(async () => { + this.log.debug('click delete index pattern button'); + await this.clickDeletePattern(); + }); + await this.retry.try(async () => { + this.log.debug('getAlertText'); + alertText = await this.testSubjects.getVisibleText('confirmModalTitleText'); + }); + await this.retry.try(async () => { + this.log.debug('acceptConfirmation'); + await this.testSubjects.click('confirmModalConfirmButton'); + }); + await this.retry.try(async () => { + const currentUrl = await this.browser.getCurrentUrl(); + if (currentUrl.match(/index_patterns\/.+\?/)) { + throw new Error('Index pattern not removed'); + } + }); + return alertText; + } - async clickFieldsTab() { - log.debug('click Fields tab'); - await testSubjects.click('tab-indexedFields'); - } + async clickFieldsTab() { + this.log.debug('click Fields tab'); + await this.testSubjects.click('tab-indexedFields'); + } - async clickScriptedFieldsTab() { - log.debug('click Scripted Fields tab'); - await testSubjects.click('tab-scriptedFields'); - } + async clickScriptedFieldsTab() { + this.log.debug('click Scripted Fields tab'); + await this.testSubjects.click('tab-scriptedFields'); + } - async clickSourceFiltersTab() { - log.debug('click Source Filters tab'); - await testSubjects.click('tab-sourceFilters'); - } + async clickSourceFiltersTab() { + this.log.debug('click Source Filters tab'); + await this.testSubjects.click('tab-sourceFilters'); + } - async editScriptedField(name: string) { - await this.filterField(name); - await find.clickByCssSelector('.euiTableRowCell--hasActions button:first-child'); - } + async editScriptedField(name: string) { + await this.filterField(name); + await this.find.clickByCssSelector('.euiTableRowCell--hasActions button:first-child'); + } - async addScriptedField( - name: string, - language: string, - type: string, - format: Record, - popularity: string, - script: string - ) { - await this.clickAddScriptedField(); - await this.setScriptedFieldName(name); - if (language) await this.setScriptedFieldLanguage(language); - if (type) await this.setScriptedFieldType(type); - if (format) { - await this.setFieldFormat(format.format); - // null means leave - default - which has no other settings - // Url adds Type, Url Template, and Label Template - // Date adds moment.js format pattern (Default: "MMMM Do YYYY, HH:mm:ss.SSS") - // String adds Transform - switch (format.format) { - case 'url': - await this.setScriptedFieldUrlType(format.type); - await this.setScriptedFieldUrlTemplate(format.template); - await this.setScriptedFieldUrlLabelTemplate(format.labelTemplate); - break; - case 'date': - await this.setScriptedFieldDatePattern(format.datePattern); - break; - case 'string': - await this.setScriptedFieldStringTransform(format.stringTransform); - break; - } + async addScriptedField( + name: string, + language: string, + type: string, + format: Record, + popularity: string, + script: string + ) { + await this.clickAddScriptedField(); + await this.setScriptedFieldName(name); + if (language) await this.setScriptedFieldLanguage(language); + if (type) await this.setScriptedFieldType(type); + if (format) { + await this.setFieldFormat(format.format); + // null means leave - default - which has no other settings + // Url adds Type, Url Template, and Label Template + // Date adds moment.js format pattern (Default: "MMMM Do YYYY, HH:mm:ss.SSS") + // String adds Transform + switch (format.format) { + case 'url': + await this.setScriptedFieldUrlType(format.type); + await this.setScriptedFieldUrlTemplate(format.template); + await this.setScriptedFieldUrlLabelTemplate(format.labelTemplate); + break; + case 'date': + await this.setScriptedFieldDatePattern(format.datePattern); + break; + case 'string': + await this.setScriptedFieldStringTransform(format.stringTransform); + break; } - if (popularity) await this.setScriptedFieldPopularity(popularity); - await this.setScriptedFieldScript(script); - await this.clickSaveScriptedField(); } + if (popularity) await this.setScriptedFieldPopularity(popularity); + await this.setScriptedFieldScript(script); + await this.clickSaveScriptedField(); + } - async addRuntimeField(name: string, type: string, script: string) { - await this.clickAddField(); - await this.setFieldName(name); - await this.setFieldType(type); - if (script) { - await this.setFieldScript(script); - } - await this.clickSaveField(); - await this.closeIndexPatternFieldEditor(); + async addRuntimeField(name: string, type: string, script: string) { + await this.clickAddField(); + await this.setFieldName(name); + await this.setFieldType(type); + if (script) { + await this.setFieldScript(script); } + await this.clickSaveField(); + await this.closeIndexPatternFieldEditor(); + } - public async confirmSave() { - await testSubjects.setValue('saveModalConfirmText', 'change'); - await testSubjects.click('confirmModalConfirmButton'); - } + public async confirmSave() { + await this.testSubjects.setValue('saveModalConfirmText', 'change'); + await this.testSubjects.click('confirmModalConfirmButton'); + } - public async confirmDelete() { - await testSubjects.setValue('deleteModalConfirmText', 'remove'); - await testSubjects.click('confirmModalConfirmButton'); - } + public async confirmDelete() { + await this.testSubjects.setValue('deleteModalConfirmText', 'remove'); + await this.testSubjects.click('confirmModalConfirmButton'); + } - async closeIndexPatternFieldEditor() { - await retry.waitFor('field editor flyout to close', async () => { - return !(await testSubjects.exists('euiFlyoutCloseButton')); - }); - } + async closeIndexPatternFieldEditor() { + await this.retry.waitFor('field editor flyout to close', async () => { + return !(await this.testSubjects.exists('euiFlyoutCloseButton')); + }); + } - async clickAddField() { - log.debug('click Add Field'); - await testSubjects.click('addField'); - } + async clickAddField() { + this.log.debug('click Add Field'); + await this.testSubjects.click('addField'); + } - async clickSaveField() { - log.debug('click Save'); - await testSubjects.click('fieldSaveButton'); - } + async clickSaveField() { + this.log.debug('click Save'); + await this.testSubjects.click('fieldSaveButton'); + } - async setFieldName(name: string) { - log.debug('set field name = ' + name); - await testSubjects.setValue('nameField', name); - } + async setFieldName(name: string) { + this.log.debug('set field name = ' + name); + await this.testSubjects.setValue('nameField', name); + } - async setFieldType(type: string) { - log.debug('set type = ' + type); - await testSubjects.setValue('typeField', type); - } + async setFieldType(type: string) { + this.log.debug('set type = ' + type); + await this.testSubjects.setValue('typeField', type); + } - async setFieldScript(script: string) { - log.debug('set script = ' + script); - const formatRow = await testSubjects.find('valueRow'); - const formatRowToggle = ( - await formatRow.findAllByCssSelector('[data-test-subj="toggle"]') - )[0]; - - await formatRowToggle.click(); - const getMonacoTextArea = async () => (await formatRow.findAllByCssSelector('textarea'))[0]; - retry.waitFor('monaco editor is ready', async () => !!(await getMonacoTextArea())); - const monacoTextArea = await getMonacoTextArea(); - await monacoTextArea.focus(); - browser.pressKeys(script); - } + async setFieldScript(script: string) { + this.log.debug('set script = ' + script); + const formatRow = await this.testSubjects.find('valueRow'); + const formatRowToggle = (await formatRow.findAllByCssSelector('[data-test-subj="toggle"]'))[0]; + + await formatRowToggle.click(); + const getMonacoTextArea = async () => (await formatRow.findAllByCssSelector('textarea'))[0]; + this.retry.waitFor('monaco editor is ready', async () => !!(await getMonacoTextArea())); + const monacoTextArea = await getMonacoTextArea(); + await monacoTextArea.focus(); + this.browser.pressKeys(script); + } - async changeFieldScript(script: string) { - log.debug('set script = ' + script); - const formatRow = await testSubjects.find('valueRow'); - const getMonacoTextArea = async () => (await formatRow.findAllByCssSelector('textarea'))[0]; - retry.waitFor('monaco editor is ready', async () => !!(await getMonacoTextArea())); - const monacoTextArea = await getMonacoTextArea(); - await monacoTextArea.focus(); - browser.pressKeys(browser.keys.DELETE.repeat(30)); - browser.pressKeys(script); - } + async changeFieldScript(script: string) { + this.log.debug('set script = ' + script); + const formatRow = await this.testSubjects.find('valueRow'); + const getMonacoTextArea = async () => (await formatRow.findAllByCssSelector('textarea'))[0]; + this.retry.waitFor('monaco editor is ready', async () => !!(await getMonacoTextArea())); + const monacoTextArea = await getMonacoTextArea(); + await monacoTextArea.focus(); + this.browser.pressKeys(this.browser.keys.DELETE.repeat(30)); + this.browser.pressKeys(script); + } - async clickAddScriptedField() { - log.debug('click Add Scripted Field'); - await testSubjects.click('addScriptedFieldLink'); - } + async clickAddScriptedField() { + this.log.debug('click Add Scripted Field'); + await this.testSubjects.click('addScriptedFieldLink'); + } - async clickSaveScriptedField() { - log.debug('click Save Scripted Field'); - await testSubjects.click('fieldSaveButton'); - await PageObjects.header.waitUntilLoadingHasFinished(); - } + async clickSaveScriptedField() { + this.log.debug('click Save Scripted Field'); + await this.testSubjects.click('fieldSaveButton'); + await this.header.waitUntilLoadingHasFinished(); + } - async setScriptedFieldName(name: string) { - log.debug('set scripted field name = ' + name); - await testSubjects.setValue('editorFieldName', name); - } + async setScriptedFieldName(name: string) { + this.log.debug('set scripted field name = ' + name); + await this.testSubjects.setValue('editorFieldName', name); + } - async setScriptedFieldLanguage(language: string) { - log.debug('set scripted field language = ' + language); - await find.clickByCssSelector( - 'select[data-test-subj="editorFieldLang"] > option[value="' + language + '"]' - ); - } + async setScriptedFieldLanguage(language: string) { + this.log.debug('set scripted field language = ' + language); + await this.find.clickByCssSelector( + 'select[data-test-subj="editorFieldLang"] > option[value="' + language + '"]' + ); + } - async setScriptedFieldType(type: string) { - log.debug('set scripted field type = ' + type); - await find.clickByCssSelector( - 'select[data-test-subj="editorFieldType"] > option[value="' + type + '"]' - ); - } + async setScriptedFieldType(type: string) { + this.log.debug('set scripted field type = ' + type); + await this.find.clickByCssSelector( + 'select[data-test-subj="editorFieldType"] > option[value="' + type + '"]' + ); + } - async setFieldFormat(format: string) { - log.debug('set scripted field format = ' + format); - await find.clickByCssSelector( - 'select[data-test-subj="editorSelectedFormatId"] > option[value="' + format + '"]' - ); - } + async setFieldFormat(format: string) { + this.log.debug('set scripted field format = ' + format); + await this.find.clickByCssSelector( + 'select[data-test-subj="editorSelectedFormatId"] > option[value="' + format + '"]' + ); + } - async setScriptedFieldUrlType(type: string) { - log.debug('set scripted field Url type = ' + type); - await find.clickByCssSelector( - 'select[data-test-subj="urlEditorType"] > option[value="' + type + '"]' - ); - } + async setScriptedFieldUrlType(type: string) { + this.log.debug('set scripted field Url type = ' + type); + await this.find.clickByCssSelector( + 'select[data-test-subj="urlEditorType"] > option[value="' + type + '"]' + ); + } - async setScriptedFieldUrlTemplate(template: string) { - log.debug('set scripted field Url Template = ' + template); - const urlTemplateField = await find.byCssSelector( - 'input[data-test-subj="urlEditorUrlTemplate"]' - ); - await urlTemplateField.type(template); - } + async setScriptedFieldUrlTemplate(template: string) { + this.log.debug('set scripted field Url Template = ' + template); + const urlTemplateField = await this.find.byCssSelector( + 'input[data-test-subj="urlEditorUrlTemplate"]' + ); + await urlTemplateField.type(template); + } - async setScriptedFieldUrlLabelTemplate(labelTemplate: string) { - log.debug('set scripted field Url Label Template = ' + labelTemplate); - const urlEditorLabelTemplate = await find.byCssSelector( - 'input[data-test-subj="urlEditorLabelTemplate"]' - ); - await urlEditorLabelTemplate.type(labelTemplate); - } + async setScriptedFieldUrlLabelTemplate(labelTemplate: string) { + this.log.debug('set scripted field Url Label Template = ' + labelTemplate); + const urlEditorLabelTemplate = await this.find.byCssSelector( + 'input[data-test-subj="urlEditorLabelTemplate"]' + ); + await urlEditorLabelTemplate.type(labelTemplate); + } - async setScriptedFieldDatePattern(datePattern: string) { - log.debug('set scripted field Date Pattern = ' + datePattern); - const datePatternField = await find.byCssSelector( - 'input[data-test-subj="dateEditorPattern"]' - ); - // clearValue does not work here - // Send Backspace event for each char in value string to clear field - await datePatternField.clearValueWithKeyboard({ charByChar: true }); - await datePatternField.type(datePattern); - } + async setScriptedFieldDatePattern(datePattern: string) { + this.log.debug('set scripted field Date Pattern = ' + datePattern); + const datePatternField = await this.find.byCssSelector( + 'input[data-test-subj="dateEditorPattern"]' + ); + // clearValue does not work here + // Send Backspace event for each char in value string to clear field + await datePatternField.clearValueWithKeyboard({ charByChar: true }); + await datePatternField.type(datePattern); + } - async setScriptedFieldStringTransform(stringTransform: string) { - log.debug('set scripted field string Transform = ' + stringTransform); - await find.clickByCssSelector( - 'select[data-test-subj="stringEditorTransform"] > option[value="' + stringTransform + '"]' - ); - } + async setScriptedFieldStringTransform(stringTransform: string) { + this.log.debug('set scripted field string Transform = ' + stringTransform); + await this.find.clickByCssSelector( + 'select[data-test-subj="stringEditorTransform"] > option[value="' + stringTransform + '"]' + ); + } - async setScriptedFieldPopularity(popularity: string) { - log.debug('set scripted field popularity = ' + popularity); - await testSubjects.setValue('editorFieldCount', popularity); - } + async setScriptedFieldPopularity(popularity: string) { + this.log.debug('set scripted field popularity = ' + popularity); + await this.testSubjects.setValue('editorFieldCount', popularity); + } - async setScriptedFieldScript(script: string) { - log.debug('set scripted field script = ' + script); - const aceEditorCssSelector = '[data-test-subj="editorFieldScript"] .ace_editor'; - const editor = await find.byCssSelector(aceEditorCssSelector); - await editor.click(); - const existingText = await editor.getVisibleText(); - for (let i = 0; i < existingText.length; i++) { - await browser.pressKeys(browser.keys.BACK_SPACE); - } - await browser.pressKeys(...script.split('')); + async setScriptedFieldScript(script: string) { + this.log.debug('set scripted field script = ' + script); + const aceEditorCssSelector = '[data-test-subj="editorFieldScript"] .ace_editor'; + const editor = await this.find.byCssSelector(aceEditorCssSelector); + await editor.click(); + const existingText = await editor.getVisibleText(); + for (let i = 0; i < existingText.length; i++) { + await this.browser.pressKeys(this.browser.keys.BACK_SPACE); } + await this.browser.pressKeys(...script.split('')); + } - async openScriptedFieldHelp(activeTab: string) { - log.debug('open Scripted Fields help'); - let isOpen = await testSubjects.exists('scriptedFieldsHelpFlyout'); - if (!isOpen) { - await retry.try(async () => { - await testSubjects.click('scriptedFieldsHelpLink'); - isOpen = await testSubjects.exists('scriptedFieldsHelpFlyout'); - if (!isOpen) { - throw new Error('Failed to open scripted fields help'); - } - }); - } - - if (activeTab) { - await testSubjects.click(activeTab); - } + async openScriptedFieldHelp(activeTab: string) { + this.log.debug('open Scripted Fields help'); + let isOpen = await this.testSubjects.exists('scriptedFieldsHelpFlyout'); + if (!isOpen) { + await this.retry.try(async () => { + await this.testSubjects.click('scriptedFieldsHelpLink'); + isOpen = await this.testSubjects.exists('scriptedFieldsHelpFlyout'); + if (!isOpen) { + throw new Error('Failed to open scripted fields help'); + } + }); } - async closeScriptedFieldHelp() { - await flyout.ensureClosed('scriptedFieldsHelpFlyout'); + if (activeTab) { + await this.testSubjects.click(activeTab); } + } - async executeScriptedField(script: string, additionalField: string) { - log.debug('execute Scripted Fields help'); - await this.closeScriptedFieldHelp(); // ensure script help is closed so script input is not blocked - await this.setScriptedFieldScript(script); - await this.openScriptedFieldHelp('testTab'); - if (additionalField) { - await comboBox.set('additionalFieldsSelect', additionalField); - await testSubjects.find('scriptedFieldPreview'); - await testSubjects.click('runScriptButton'); - await testSubjects.waitForDeleted('.euiLoadingSpinner'); - } - let scriptResults; - await retry.try(async () => { - scriptResults = await testSubjects.getVisibleText('scriptedFieldPreview'); - }); - return scriptResults; - } + async closeScriptedFieldHelp() { + await this.flyout.ensureClosed('scriptedFieldsHelpFlyout'); + } - async clickEditFieldFormat() { - await testSubjects.click('editFieldFormat'); - } + async executeScriptedField(script: string, additionalField: string) { + this.log.debug('execute Scripted Fields help'); + await this.closeScriptedFieldHelp(); // ensure script help is closed so script input is not blocked + await this.setScriptedFieldScript(script); + await this.openScriptedFieldHelp('testTab'); + if (additionalField) { + await this.comboBox.set('additionalFieldsSelect', additionalField); + await this.testSubjects.find('scriptedFieldPreview'); + await this.testSubjects.click('runScriptButton'); + await this.testSubjects.waitForDeleted('.euiLoadingSpinner'); + } + let scriptResults; + await this.retry.try(async () => { + scriptResults = await this.testSubjects.getVisibleText('scriptedFieldPreview'); + }); + return scriptResults; + } - async associateIndexPattern(oldIndexPatternId: string, newIndexPatternTitle: string) { - await find.clickByCssSelector( - `select[data-test-subj="managementChangeIndexSelection-${oldIndexPatternId}"] > - [data-test-subj="indexPatternOption-${newIndexPatternTitle}"]` - ); - } + async clickEditFieldFormat() { + await this.testSubjects.click('editFieldFormat'); + } - async clickChangeIndexConfirmButton() { - await testSubjects.click('changeIndexConfirmButton'); - } + async associateIndexPattern(oldIndexPatternId: string, newIndexPatternTitle: string) { + await this.find.clickByCssSelector( + `select[data-test-subj="managementChangeIndexSelection-${oldIndexPatternId}"] > + [data-test-subj="indexPatternOption-${newIndexPatternTitle}"]` + ); } - return new SettingsPage(); + async clickChangeIndexConfirmButton() { + await this.testSubjects.click('changeIndexConfirmButton'); + } } diff --git a/test/functional/page_objects/share_page.ts b/test/functional/page_objects/share_page.ts index aa58341600599b..ce1dc4c45e21fb 100644 --- a/test/functional/page_objects/share_page.ts +++ b/test/functional/page_objects/share_page.ts @@ -6,76 +6,72 @@ * Side Public License, v 1. */ -import { FtrProviderContext } from '../ftr_provider_context'; +import { FtrService } from '../ftr_provider_context'; -export function SharePageProvider({ getService }: FtrProviderContext) { - const testSubjects = getService('testSubjects'); - const find = getService('find'); - const log = getService('log'); +export class SharePageObject extends FtrService { + private readonly testSubjects = this.ctx.getService('testSubjects'); + private readonly find = this.ctx.getService('find'); + private readonly log = this.ctx.getService('log'); - class SharePage { - async isShareMenuOpen() { - return await testSubjects.exists('shareContextMenu'); - } - - async clickShareTopNavButton() { - return testSubjects.click('shareTopNavButton'); - } + async isShareMenuOpen() { + return await this.testSubjects.exists('shareContextMenu'); + } - async openShareMenuItem(itemTitle: string) { - log.debug(`openShareMenuItem title:${itemTitle}`); - const isShareMenuOpen = await this.isShareMenuOpen(); - if (!isShareMenuOpen) { - await this.clickShareTopNavButton(); - } else { - // there is no easy way to ensure the menu is at the top level - // so just close the existing menu - await this.clickShareTopNavButton(); - // and then re-open the menu - await this.clickShareTopNavButton(); - } - const menuPanel = await find.byCssSelector('div.euiContextMenuPanel'); - await testSubjects.click(`sharePanel-${itemTitle.replace(' ', '')}`); - await testSubjects.waitForDeleted(menuPanel); - } + async clickShareTopNavButton() { + return this.testSubjects.click('shareTopNavButton'); + } - /** - * if there are more entries in the share menu, the permalinks entry has to be clicked first - * else the selection isn't displayed. this happens if you're testing against an instance - * with xpack features enabled, where there's also a csv sharing option - * in a pure OSS environment, the permalinks sharing panel is displayed initially - */ - async openPermaLinks() { - if (await testSubjects.exists('sharePanel-Permalinks')) { - await testSubjects.click(`sharePanel-Permalinks`); - } + async openShareMenuItem(itemTitle: string) { + this.log.debug(`openShareMenuItem title:${itemTitle}`); + const isShareMenuOpen = await this.isShareMenuOpen(); + if (!isShareMenuOpen) { + await this.clickShareTopNavButton(); + } else { + // there is no easy way to ensure the menu is at the top level + // so just close the existing menu + await this.clickShareTopNavButton(); + // and then re-open the menu + await this.clickShareTopNavButton(); } + const menuPanel = await this.find.byCssSelector('div.euiContextMenuPanel'); + await this.testSubjects.click(`sharePanel-${itemTitle.replace(' ', '')}`); + await this.testSubjects.waitForDeleted(menuPanel); + } - async getSharedUrl() { - await this.openPermaLinks(); - return await testSubjects.getAttribute('copyShareUrlButton', 'data-share-url'); + /** + * if there are more entries in the share menu, the permalinks entry has to be clicked first + * else the selection isn't displayed. this happens if you're testing against an instance + * with xpack features enabled, where there's also a csv sharing option + * in a pure OSS environment, the permalinks sharing panel is displayed initially + */ + async openPermaLinks() { + if (await this.testSubjects.exists('sharePanel-Permalinks')) { + await this.testSubjects.click(`sharePanel-Permalinks`); } + } - async createShortUrlExistOrFail() { - await testSubjects.existOrFail('createShortUrl'); - } + async getSharedUrl() { + await this.openPermaLinks(); + return await this.testSubjects.getAttribute('copyShareUrlButton', 'data-share-url'); + } - async createShortUrlMissingOrFail() { - await testSubjects.missingOrFail('createShortUrl'); - } + async createShortUrlExistOrFail() { + await this.testSubjects.existOrFail('createShortUrl'); + } - async checkShortenUrl() { - await this.openPermaLinks(); - const shareForm = await testSubjects.find('shareUrlForm'); - await testSubjects.setCheckbox('useShortUrl', 'check'); - await shareForm.waitForDeletedByCssSelector('.euiLoadingSpinner'); - } + async createShortUrlMissingOrFail() { + await this.testSubjects.missingOrFail('createShortUrl'); + } - async exportAsSavedObject() { - await this.openPermaLinks(); - return await testSubjects.click('exportAsSavedObject'); - } + async checkShortenUrl() { + await this.openPermaLinks(); + const shareForm = await this.testSubjects.find('shareUrlForm'); + await this.testSubjects.setCheckbox('useShortUrl', 'check'); + await shareForm.waitForDeletedByCssSelector('.euiLoadingSpinner'); } - return new SharePage(); + async exportAsSavedObject() { + await this.openPermaLinks(); + return await this.testSubjects.click('exportAsSavedObject'); + } } diff --git a/test/functional/page_objects/tag_cloud_page.ts b/test/functional/page_objects/tag_cloud_page.ts index fa977618e64d77..61e844c813df8c 100644 --- a/test/functional/page_objects/tag_cloud_page.ts +++ b/test/functional/page_objects/tag_cloud_page.ts @@ -6,36 +6,33 @@ * Side Public License, v 1. */ -import { FtrProviderContext } from '../ftr_provider_context'; +import { FtrService } from '../ftr_provider_context'; import { WebElementWrapper } from '../services/lib/web_element_wrapper'; -export function TagCloudPageProvider({ getService, getPageObjects }: FtrProviderContext) { - const find = getService('find'); - const testSubjects = getService('testSubjects'); - const { header, visChart } = getPageObjects(['header', 'visChart']); +export class TagCloudPageObject extends FtrService { + private readonly find = this.ctx.getService('find'); + private readonly testSubjects = this.ctx.getService('testSubjects'); + private readonly header = this.ctx.getPageObject('header'); + private readonly visChart = this.ctx.getPageObject('visChart'); - class TagCloudPage { - public async selectTagCloudTag(tagDisplayText: string) { - await testSubjects.click(tagDisplayText); - await header.waitUntilLoadingHasFinished(); - } + public async selectTagCloudTag(tagDisplayText: string) { + await this.testSubjects.click(tagDisplayText); + await this.header.waitUntilLoadingHasFinished(); + } - public async getTextTag() { - await visChart.waitForVisualization(); - const elements = await find.allByCssSelector('text'); - return await Promise.all(elements.map(async (element) => await element.getVisibleText())); - } + public async getTextTag() { + await this.visChart.waitForVisualization(); + const elements = await this.find.allByCssSelector('text'); + return await Promise.all(elements.map(async (element) => await element.getVisibleText())); + } - public async getTextSizes() { - const tags = await find.allByCssSelector('text'); - async function returnTagSize(tag: WebElementWrapper) { - const style = await tag.getAttribute('style'); - const fontSize = style.match(/font-size: ([^;]*);/); - return fontSize ? fontSize[1] : ''; - } - return await Promise.all(tags.map(returnTagSize)); + public async getTextSizes() { + const tags = await this.find.allByCssSelector('text'); + async function returnTagSize(tag: WebElementWrapper) { + const style = await tag.getAttribute('style'); + const fontSize = style.match(/font-size: ([^;]*);/); + return fontSize ? fontSize[1] : ''; } + return await Promise.all(tags.map(returnTagSize)); } - - return new TagCloudPage(); } diff --git a/test/functional/page_objects/tile_map_page.ts b/test/functional/page_objects/tile_map_page.ts index 6008d7434bf1d3..079ca919543e22 100644 --- a/test/functional/page_objects/tile_map_page.ts +++ b/test/functional/page_objects/tile_map_page.ts @@ -6,92 +6,88 @@ * Side Public License, v 1. */ -import { FtrProviderContext } from '../ftr_provider_context'; - -export function TileMapPageProvider({ getService, getPageObjects }: FtrProviderContext) { - const find = getService('find'); - const testSubjects = getService('testSubjects'); - const retry = getService('retry'); - const log = getService('log'); - const inspector = getService('inspector'); - const monacoEditor = getService('monacoEditor'); - const { header } = getPageObjects(['header']); - - class TileMapPage { - public async getZoomSelectors(zoomSelector: string) { - return await find.allByCssSelector(zoomSelector); - } - - public async clickMapButton(zoomSelector: string, waitForLoading?: boolean) { - await retry.try(async () => { - const zooms = await this.getZoomSelectors(zoomSelector); - for (let i = 0; i < zooms.length; i++) { - await zooms[i].click(); - } - if (waitForLoading) { - await header.waitUntilLoadingHasFinished(); - } - }); - } +import { FtrService } from '../ftr_provider_context'; + +export class TileMapPageObject extends FtrService { + private readonly find = this.ctx.getService('find'); + private readonly testSubjects = this.ctx.getService('testSubjects'); + private readonly retry = this.ctx.getService('retry'); + private readonly log = this.ctx.getService('log'); + private readonly inspector = this.ctx.getService('inspector'); + private readonly monacoEditor = this.ctx.getService('monacoEditor'); + private readonly header = this.ctx.getPageObject('header'); + + public async getZoomSelectors(zoomSelector: string) { + return await this.find.allByCssSelector(zoomSelector); + } - public async getVisualizationRequest() { - log.debug('getVisualizationRequest'); - await inspector.open(); - await testSubjects.click('inspectorViewChooser'); - await testSubjects.click('inspectorViewChooserRequests'); - await testSubjects.click('inspectorRequestDetailRequest'); - await find.byCssSelector('.react-monaco-editor-container'); + public async clickMapButton(zoomSelector: string, waitForLoading?: boolean) { + await this.retry.try(async () => { + const zooms = await this.getZoomSelectors(zoomSelector); + for (let i = 0; i < zooms.length; i++) { + await zooms[i].click(); + } + if (waitForLoading) { + await this.header.waitUntilLoadingHasFinished(); + } + }); + } - return await monacoEditor.getCodeEditorValue(1); - } + public async getVisualizationRequest() { + this.log.debug('getVisualizationRequest'); + await this.inspector.open(); + await this.testSubjects.click('inspectorViewChooser'); + await this.testSubjects.click('inspectorViewChooserRequests'); + await this.testSubjects.click('inspectorRequestDetailRequest'); + await this.find.byCssSelector('.react-monaco-editor-container'); - public async getMapBounds(): Promise { - const request = await this.getVisualizationRequest(); - const requestObject = JSON.parse(request); + return await this.monacoEditor.getCodeEditorValue(1); + } - return requestObject.aggs.filter_agg.filter.geo_bounding_box['geo.coordinates']; - } + public async getMapBounds(): Promise { + const request = await this.getVisualizationRequest(); + const requestObject = JSON.parse(request); - public async clickMapZoomIn(waitForLoading = true) { - await this.clickMapButton('a.leaflet-control-zoom-in', waitForLoading); - } + return requestObject.aggs.filter_agg.filter.geo_bounding_box['geo.coordinates']; + } - public async clickMapZoomOut(waitForLoading = true) { - await this.clickMapButton('a.leaflet-control-zoom-out', waitForLoading); - } + public async clickMapZoomIn(waitForLoading = true) { + await this.clickMapButton('a.leaflet-control-zoom-in', waitForLoading); + } - public async getMapZoomEnabled(zoomSelector: string): Promise { - const zooms = await this.getZoomSelectors(zoomSelector); - const classAttributes = await Promise.all( - zooms.map(async (zoom) => await zoom.getAttribute('class')) - ); - return !classAttributes.join('').includes('leaflet-disabled'); - } + public async clickMapZoomOut(waitForLoading = true) { + await this.clickMapButton('a.leaflet-control-zoom-out', waitForLoading); + } - public async zoomAllTheWayOut(): Promise { - // we can tell we're at level 1 because zoom out is disabled - return await retry.try(async () => { - await this.clickMapZoomOut(); - const enabled = await this.getMapZoomOutEnabled(); - // should be able to zoom more as current config has 0 as min level. - if (enabled) { - throw new Error('Not fully zoomed out yet'); - } - }); - } + public async getMapZoomEnabled(zoomSelector: string): Promise { + const zooms = await this.getZoomSelectors(zoomSelector); + const classAttributes = await Promise.all( + zooms.map(async (zoom) => await zoom.getAttribute('class')) + ); + return !classAttributes.join('').includes('leaflet-disabled'); + } - public async getMapZoomInEnabled() { - return await this.getMapZoomEnabled('a.leaflet-control-zoom-in'); - } + public async zoomAllTheWayOut(): Promise { + // we can tell we're at level 1 because zoom out is disabled + return await this.retry.try(async () => { + await this.clickMapZoomOut(); + const enabled = await this.getMapZoomOutEnabled(); + // should be able to zoom more as current config has 0 as min level. + if (enabled) { + throw new Error('Not fully zoomed out yet'); + } + }); + } - public async getMapZoomOutEnabled() { - return await this.getMapZoomEnabled('a.leaflet-control-zoom-out'); - } + public async getMapZoomInEnabled() { + return await this.getMapZoomEnabled('a.leaflet-control-zoom-in'); + } - public async clickMapFitDataBounds() { - return await this.clickMapButton('a.fa-crop'); - } + public async getMapZoomOutEnabled() { + return await this.getMapZoomEnabled('a.leaflet-control-zoom-out'); } - return new TileMapPage(); + public async clickMapFitDataBounds() { + return await this.clickMapButton('a.fa-crop'); + } } diff --git a/test/functional/page_objects/time_picker.ts b/test/functional/page_objects/time_picker.ts index 4d0930c3ff932d..e8f6afc365f5d1 100644 --- a/test/functional/page_objects/time_picker.ts +++ b/test/functional/page_objects/time_picker.ts @@ -7,7 +7,7 @@ */ import moment from 'moment'; -import { FtrProviderContext } from '../ftr_provider_context'; +import { FtrService } from '../ftr_provider_context'; import { WebElementWrapper } from '../services/lib/web_element_wrapper'; export type CommonlyUsed = @@ -22,275 +22,270 @@ export type CommonlyUsed = | 'Last_90 days' | 'Last_1 year'; -export function TimePickerProvider({ getService, getPageObjects }: FtrProviderContext) { - const log = getService('log'); - const find = getService('find'); - const browser = getService('browser'); - const retry = getService('retry'); - const testSubjects = getService('testSubjects'); - const { header } = getPageObjects(['header']); - const kibanaServer = getService('kibanaServer'); - const menuToggle = getService('menuToggle'); - - const quickSelectTimeMenuToggle = menuToggle.create({ +export class TimePickerPageObject extends FtrService { + private readonly log = this.ctx.getService('log'); + private readonly find = this.ctx.getService('find'); + private readonly browser = this.ctx.getService('browser'); + private readonly retry = this.ctx.getService('retry'); + private readonly testSubjects = this.ctx.getService('testSubjects'); + private readonly header = this.ctx.getPageObject('header'); + private readonly kibanaServer = this.ctx.getService('kibanaServer'); + + private readonly quickSelectTimeMenuToggle = this.ctx.getService('menuToggle').create({ name: 'QuickSelectTime Menu', menuTestSubject: 'superDatePickerQuickMenu', toggleButtonTestSubject: 'superDatePickerToggleQuickMenuButton', }); - class TimePicker { - defaultStartTime = 'Sep 19, 2015 @ 06:31:44.000'; - defaultEndTime = 'Sep 23, 2015 @ 18:31:44.000'; - defaultStartTimeUTC = '2015-09-18T06:31:44.000Z'; - defaultEndTimeUTC = '2015-09-23T18:31:44.000Z'; - - async setDefaultAbsoluteRange() { - await this.setAbsoluteRange(this.defaultStartTime, this.defaultEndTime); - } + public readonly defaultStartTime = 'Sep 19, 2015 @ 06:31:44.000'; + public readonly defaultEndTime = 'Sep 23, 2015 @ 18:31:44.000'; + public readonly defaultStartTimeUTC = '2015-09-18T06:31:44.000Z'; + public readonly defaultEndTimeUTC = '2015-09-23T18:31:44.000Z'; - async ensureHiddenNoDataPopover() { - const isVisible = await testSubjects.exists('noDataPopoverDismissButton'); - if (isVisible) { - await testSubjects.click('noDataPopoverDismissButton'); - } - } + async setDefaultAbsoluteRange() { + await this.setAbsoluteRange(this.defaultStartTime, this.defaultEndTime); + } - /** - * the provides a quicker way to set the timepicker to the default range, saves a few seconds - */ - async setDefaultAbsoluteRangeViaUiSettings() { - await kibanaServer.uiSettings.update({ - 'timepicker:timeDefaults': `{ "from": "${this.defaultStartTimeUTC}", "to": "${this.defaultEndTimeUTC}"}`, - }); + async ensureHiddenNoDataPopover() { + const isVisible = await this.testSubjects.exists('noDataPopoverDismissButton'); + if (isVisible) { + await this.testSubjects.click('noDataPopoverDismissButton'); } + } - async resetDefaultAbsoluteRangeViaUiSettings() { - await kibanaServer.uiSettings.replace({}); - } + /** + * the provides a quicker way to set the timepicker to the default range, saves a few seconds + */ + async setDefaultAbsoluteRangeViaUiSettings() { + await this.kibanaServer.uiSettings.update({ + 'timepicker:timeDefaults': `{ "from": "${this.defaultStartTimeUTC}", "to": "${this.defaultEndTimeUTC}"}`, + }); + } - private async getTimePickerPanel() { - return await retry.try(async () => { - return await find.byCssSelector('div.euiPopover__panel-isOpen'); - }); - } + async resetDefaultAbsoluteRangeViaUiSettings() { + await this.kibanaServer.uiSettings.replace({}); + } - private async waitPanelIsGone(panelElement: WebElementWrapper) { - await find.waitForElementStale(panelElement); - } + private async getTimePickerPanel() { + return await this.retry.try(async () => { + return await this.find.byCssSelector('div.euiPopover__panel-isOpen'); + }); + } - public async timePickerExists() { - return await testSubjects.exists('superDatePickerToggleQuickMenuButton'); - } + private async waitPanelIsGone(panelElement: WebElementWrapper) { + await this.find.waitForElementStale(panelElement); + } - /** - * Sets commonly used time - * @param option 'Today' | 'This_week' | 'Last_15 minutes' | 'Last_24 hours' ... - */ - async setCommonlyUsedTime(option: CommonlyUsed | string) { - await testSubjects.click('superDatePickerToggleQuickMenuButton'); - await testSubjects.click(`superDatePickerCommonlyUsed_${option}`); - } + public async timePickerExists() { + return await this.testSubjects.exists('superDatePickerToggleQuickMenuButton'); + } - public async inputValue(dataTestSubj: string, value: string) { - if (browser.isFirefox) { - const input = await testSubjects.find(dataTestSubj); - await input.clearValue(); - await input.type(value); - } else { - await testSubjects.setValue(dataTestSubj, value); - } - } + /** + * Sets commonly used time + * @param option 'Today' | 'This_week' | 'Last_15 minutes' | 'Last_24 hours' ... + */ + async setCommonlyUsedTime(option: CommonlyUsed | string) { + await this.testSubjects.click('superDatePickerToggleQuickMenuButton'); + await this.testSubjects.click(`superDatePickerCommonlyUsed_${option}`); + } - private async showStartEndTimes() { - // This first await makes sure the superDatePicker has loaded before we check for the ShowDatesButton - await testSubjects.exists('superDatePickerToggleQuickMenuButton', { timeout: 20000 }); - const isShowDatesButton = await testSubjects.exists('superDatePickerShowDatesButton'); - if (isShowDatesButton) { - await testSubjects.click('superDatePickerShowDatesButton'); - } - await testSubjects.exists('superDatePickerstartDatePopoverButton'); + public async inputValue(dataTestSubj: string, value: string) { + if (this.browser.isFirefox) { + const input = await this.testSubjects.find(dataTestSubj); + await input.clearValue(); + await input.type(value); + } else { + await this.testSubjects.setValue(dataTestSubj, value); } + } - /** - * @param {String} fromTime MMM D, YYYY @ HH:mm:ss.SSS - * @param {String} toTime MMM D, YYYY @ HH:mm:ss.SSS - */ - public async setAbsoluteRange(fromTime: string, toTime: string) { - log.debug(`Setting absolute range to ${fromTime} to ${toTime}`); - await this.showStartEndTimes(); - - // set to time - await testSubjects.click('superDatePickerendDatePopoverButton'); - let panel = await this.getTimePickerPanel(); - await testSubjects.click('superDatePickerAbsoluteTab'); - await testSubjects.click('superDatePickerAbsoluteDateInput'); - await this.inputValue('superDatePickerAbsoluteDateInput', toTime); - await browser.pressKeys(browser.keys.ESCAPE); // close popover because sometimes browser can't find start input - - // set from time - await testSubjects.click('superDatePickerstartDatePopoverButton'); - await this.waitPanelIsGone(panel); - panel = await this.getTimePickerPanel(); - await testSubjects.click('superDatePickerAbsoluteTab'); - await testSubjects.click('superDatePickerAbsoluteDateInput'); - await this.inputValue('superDatePickerAbsoluteDateInput', fromTime); - - const superDatePickerApplyButtonExists = await testSubjects.exists( - 'superDatePickerApplyTimeButton' - ); - if (superDatePickerApplyButtonExists) { - // Timepicker is in top nav - // Click super date picker apply button to apply time range - await testSubjects.click('superDatePickerApplyTimeButton'); - } else { - // Timepicker is embedded in query bar - // click query bar submit button to apply time range - await testSubjects.click('querySubmitButton'); - } - - await this.waitPanelIsGone(panel); - await header.awaitGlobalLoadingIndicatorHidden(); + private async showStartEndTimes() { + // This first await makes sure the superDatePicker has loaded before we check for the ShowDatesButton + await this.testSubjects.exists('superDatePickerToggleQuickMenuButton', { timeout: 20000 }); + const isShowDatesButton = await this.testSubjects.exists('superDatePickerShowDatesButton'); + if (isShowDatesButton) { + await this.testSubjects.click('superDatePickerShowDatesButton'); } + await this.testSubjects.exists('superDatePickerstartDatePopoverButton'); + } - public async isOff() { - return await find.existsByCssSelector('.euiDatePickerRange--readOnly'); + /** + * @param {String} fromTime MMM D, YYYY @ HH:mm:ss.SSS + * @param {String} toTime MMM D, YYYY @ HH:mm:ss.SSS + */ + public async setAbsoluteRange(fromTime: string, toTime: string) { + this.log.debug(`Setting absolute range to ${fromTime} to ${toTime}`); + await this.showStartEndTimes(); + + // set to time + await this.testSubjects.click('superDatePickerendDatePopoverButton'); + let panel = await this.getTimePickerPanel(); + await this.testSubjects.click('superDatePickerAbsoluteTab'); + await this.testSubjects.click('superDatePickerAbsoluteDateInput'); + await this.inputValue('superDatePickerAbsoluteDateInput', toTime); + await this.browser.pressKeys(this.browser.keys.ESCAPE); // close popover because sometimes browser can't find start input + + // set from time + await this.testSubjects.click('superDatePickerstartDatePopoverButton'); + await this.waitPanelIsGone(panel); + panel = await this.getTimePickerPanel(); + await this.testSubjects.click('superDatePickerAbsoluteTab'); + await this.testSubjects.click('superDatePickerAbsoluteDateInput'); + await this.inputValue('superDatePickerAbsoluteDateInput', fromTime); + + const superDatePickerApplyButtonExists = await this.testSubjects.exists( + 'superDatePickerApplyTimeButton' + ); + if (superDatePickerApplyButtonExists) { + // Timepicker is in top nav + // Click super date picker apply button to apply time range + await this.testSubjects.click('superDatePickerApplyTimeButton'); + } else { + // Timepicker is embedded in query bar + // click query bar submit button to apply time range + await this.testSubjects.click('querySubmitButton'); } - public async getRefreshConfig(keepQuickSelectOpen = false) { - await quickSelectTimeMenuToggle.open(); - const interval = await testSubjects.getAttribute( - 'superDatePickerRefreshIntervalInput', - 'value' - ); - - let selectedUnit; - const select = await testSubjects.find('superDatePickerRefreshIntervalUnitsSelect'); - const options = await find.allDescendantDisplayedByCssSelector('option', select); - await Promise.all( - options.map(async (optionElement) => { - const isSelected = await optionElement.isSelected(); - if (isSelected) { - selectedUnit = await optionElement.getVisibleText(); - } - }) - ); - - const toggleButtonText = await testSubjects.getVisibleText( - 'superDatePickerToggleRefreshButton' - ); - if (!keepQuickSelectOpen) { - await quickSelectTimeMenuToggle.close(); - } - - return { - interval, - units: selectedUnit, - isPaused: toggleButtonText === 'Start' ? true : false, - }; - } + await this.waitPanelIsGone(panel); + await this.header.awaitGlobalLoadingIndicatorHidden(); + } - public async getTimeConfig() { - await this.showStartEndTimes(); - const start = await testSubjects.getVisibleText('superDatePickerstartDatePopoverButton'); - const end = await testSubjects.getVisibleText('superDatePickerendDatePopoverButton'); - return { - start, - end, - }; - } + public async isOff() { + return await this.find.existsByCssSelector('.euiDatePickerRange--readOnly'); + } - public async getShowDatesButtonText() { - const button = await testSubjects.find('superDatePickerShowDatesButton'); - const text = await button.getVisibleText(); - return text; + public async getRefreshConfig(keepQuickSelectOpen = false) { + await this.quickSelectTimeMenuToggle.open(); + const interval = await this.testSubjects.getAttribute( + 'superDatePickerRefreshIntervalInput', + 'value' + ); + + let selectedUnit; + const select = await this.testSubjects.find('superDatePickerRefreshIntervalUnitsSelect'); + const options = await this.find.allDescendantDisplayedByCssSelector('option', select); + await Promise.all( + options.map(async (optionElement) => { + const isSelected = await optionElement.isSelected(); + if (isSelected) { + selectedUnit = await optionElement.getVisibleText(); + } + }) + ); + + const toggleButtonText = await this.testSubjects.getVisibleText( + 'superDatePickerToggleRefreshButton' + ); + if (!keepQuickSelectOpen) { + await this.quickSelectTimeMenuToggle.close(); } - public async getTimeDurationForSharing() { - return await testSubjects.getAttribute( - 'dataSharedTimefilterDuration', - 'data-shared-timefilter-duration' - ); - } + return { + interval, + units: selectedUnit, + isPaused: toggleButtonText === 'Start' ? true : false, + }; + } - public async getTimeConfigAsAbsoluteTimes() { - await this.showStartEndTimes(); - - // get to time - await testSubjects.click('superDatePickerendDatePopoverButton'); - const panel = await this.getTimePickerPanel(); - await testSubjects.click('superDatePickerAbsoluteTab'); - const end = await testSubjects.getAttribute('superDatePickerAbsoluteDateInput', 'value'); - - // get from time - await testSubjects.click('superDatePickerstartDatePopoverButton'); - await this.waitPanelIsGone(panel); - await testSubjects.click('superDatePickerAbsoluteTab'); - const start = await testSubjects.getAttribute('superDatePickerAbsoluteDateInput', 'value'); - - return { - start, - end, - }; - } + public async getTimeConfig() { + await this.showStartEndTimes(); + const start = await this.testSubjects.getVisibleText('superDatePickerstartDatePopoverButton'); + const end = await this.testSubjects.getVisibleText('superDatePickerendDatePopoverButton'); + return { + start, + end, + }; + } - public async getTimeDurationInHours() { - const DEFAULT_DATE_FORMAT = 'MMM D, YYYY @ HH:mm:ss.SSS'; - const { start, end } = await this.getTimeConfigAsAbsoluteTimes(); - const startMoment = moment(start, DEFAULT_DATE_FORMAT); - const endMoment = moment(end, DEFAULT_DATE_FORMAT); - return moment.duration(endMoment.diff(startMoment)).asHours(); - } + public async getShowDatesButtonText() { + const button = await this.testSubjects.find('superDatePickerShowDatesButton'); + const text = await button.getVisibleText(); + return text; + } - public async startAutoRefresh(intervalS = 3) { - await quickSelectTimeMenuToggle.open(); - await this.inputValue('superDatePickerRefreshIntervalInput', intervalS.toString()); - const refreshConfig = await this.getRefreshConfig(true); - if (refreshConfig.isPaused) { - log.debug('start auto refresh'); - await testSubjects.click('superDatePickerToggleRefreshButton'); - } - await quickSelectTimeMenuToggle.close(); - } + public async getTimeDurationForSharing() { + return await this.testSubjects.getAttribute( + 'dataSharedTimefilterDuration', + 'data-shared-timefilter-duration' + ); + } - public async pauseAutoRefresh() { - log.debug('pauseAutoRefresh'); - const refreshConfig = await this.getRefreshConfig(true); + public async getTimeConfigAsAbsoluteTimes() { + await this.showStartEndTimes(); + + // get to time + await this.testSubjects.click('superDatePickerendDatePopoverButton'); + const panel = await this.getTimePickerPanel(); + await this.testSubjects.click('superDatePickerAbsoluteTab'); + const end = await this.testSubjects.getAttribute('superDatePickerAbsoluteDateInput', 'value'); + + // get from time + await this.testSubjects.click('superDatePickerstartDatePopoverButton'); + await this.waitPanelIsGone(panel); + await this.testSubjects.click('superDatePickerAbsoluteTab'); + const start = await this.testSubjects.getAttribute('superDatePickerAbsoluteDateInput', 'value'); + + return { + start, + end, + }; + } - if (!refreshConfig.isPaused) { - log.debug('pause auto refresh'); - await testSubjects.click('superDatePickerToggleRefreshButton'); - } + public async getTimeDurationInHours() { + const DEFAULT_DATE_FORMAT = 'MMM D, YYYY @ HH:mm:ss.SSS'; + const { start, end } = await this.getTimeConfigAsAbsoluteTimes(); + const startMoment = moment(start, DEFAULT_DATE_FORMAT); + const endMoment = moment(end, DEFAULT_DATE_FORMAT); + return moment.duration(endMoment.diff(startMoment)).asHours(); + } - await quickSelectTimeMenuToggle.close(); + public async startAutoRefresh(intervalS = 3) { + await this.quickSelectTimeMenuToggle.open(); + await this.inputValue('superDatePickerRefreshIntervalInput', intervalS.toString()); + const refreshConfig = await this.getRefreshConfig(true); + if (refreshConfig.isPaused) { + this.log.debug('start auto refresh'); + await this.testSubjects.click('superDatePickerToggleRefreshButton'); } + await this.quickSelectTimeMenuToggle.close(); + } - public async resumeAutoRefresh() { - log.debug('resumeAutoRefresh'); - const refreshConfig = await this.getRefreshConfig(true); - if (refreshConfig.isPaused) { - log.debug('resume auto refresh'); - await testSubjects.click('superDatePickerToggleRefreshButton'); - } + public async pauseAutoRefresh() { + this.log.debug('pauseAutoRefresh'); + const refreshConfig = await this.getRefreshConfig(true); - await quickSelectTimeMenuToggle.close(); + if (!refreshConfig.isPaused) { + this.log.debug('pause auto refresh'); + await this.testSubjects.click('superDatePickerToggleRefreshButton'); } - public async setHistoricalDataRange() { - await this.setDefaultAbsoluteRange(); - } + await this.quickSelectTimeMenuToggle.close(); + } - public async setDefaultDataRange() { - const fromTime = 'Jan 1, 2018 @ 00:00:00.000'; - const toTime = 'Apr 13, 2018 @ 00:00:00.000'; - await this.setAbsoluteRange(fromTime, toTime); + public async resumeAutoRefresh() { + this.log.debug('resumeAutoRefresh'); + const refreshConfig = await this.getRefreshConfig(true); + if (refreshConfig.isPaused) { + this.log.debug('resume auto refresh'); + await this.testSubjects.click('superDatePickerToggleRefreshButton'); } - public async setLogstashDataRange() { - const fromTime = 'Apr 9, 2018 @ 00:00:00.000'; - const toTime = 'Apr 13, 2018 @ 00:00:00.000'; - await this.setAbsoluteRange(fromTime, toTime); - } + await this.quickSelectTimeMenuToggle.close(); } - return new TimePicker(); + public async setHistoricalDataRange() { + await this.setDefaultAbsoluteRange(); + } + + public async setDefaultDataRange() { + const fromTime = 'Jan 1, 2018 @ 00:00:00.000'; + const toTime = 'Apr 13, 2018 @ 00:00:00.000'; + await this.setAbsoluteRange(fromTime, toTime); + } + + public async setLogstashDataRange() { + const fromTime = 'Apr 9, 2018 @ 00:00:00.000'; + const toTime = 'Apr 13, 2018 @ 00:00:00.000'; + await this.setAbsoluteRange(fromTime, toTime); + } } diff --git a/test/functional/page_objects/time_to_visualize_page.ts b/test/functional/page_objects/time_to_visualize_page.ts index 458b4dd3e60a13..287b03ec60d88a 100644 --- a/test/functional/page_objects/time_to_visualize_page.ts +++ b/test/functional/page_objects/time_to_visualize_page.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { FtrProviderContext } from '../ftr_provider_context'; +import { FtrService } from '../ftr_provider_context'; interface SaveModalArgs { addToDashboard?: 'new' | 'existing' | null; @@ -21,117 +21,108 @@ type DashboardPickerOption = | 'existing-dashboard-option' | 'new-dashboard-option'; -export function TimeToVisualizePageProvider({ getService, getPageObjects }: FtrProviderContext) { - const testSubjects = getService('testSubjects'); - const log = getService('log'); - const find = getService('find'); - const { common, dashboard } = getPageObjects(['common', 'dashboard']); +export class TimeToVisualizePageObject extends FtrService { + private readonly testSubjects = this.ctx.getService('testSubjects'); + private readonly log = this.ctx.getService('log'); + private readonly find = this.ctx.getService('find'); + private readonly common = this.ctx.getPageObject('common'); + private readonly dashboard = this.ctx.getPageObject('dashboard'); - class TimeToVisualizePage { - public async ensureSaveModalIsOpen() { - await testSubjects.exists('savedObjectSaveModal', { timeout: 5000 }); - } + public async ensureSaveModalIsOpen() { + await this.testSubjects.exists('savedObjectSaveModal', { timeout: 5000 }); + } - public async ensureDashboardOptionsAreDisabled() { - const dashboardSelector = await testSubjects.find('add-to-dashboard-options'); - await dashboardSelector.findByCssSelector(`input[id="new-dashboard-option"]:disabled`); - await dashboardSelector.findByCssSelector(`input[id="existing-dashboard-option"]:disabled`); + public async ensureDashboardOptionsAreDisabled() { + const dashboardSelector = await this.testSubjects.find('add-to-dashboard-options'); + await dashboardSelector.findByCssSelector(`input[id="new-dashboard-option"]:disabled`); + await dashboardSelector.findByCssSelector(`input[id="existing-dashboard-option"]:disabled`); - const librarySelector = await testSubjects.find('add-to-library-checkbox'); - await librarySelector.findByCssSelector(`input[id="add-to-library-checkbox"]:disabled`); - } - - public async resetNewDashboard() { - await common.navigateToApp('dashboard'); - await dashboard.gotoDashboardLandingPage(true); - await dashboard.clickNewDashboard(false); - } + const librarySelector = await this.testSubjects.find('add-to-library-checkbox'); + await librarySelector.findByCssSelector(`input[id="add-to-library-checkbox"]:disabled`); + } - public async setSaveModalValues( - vizName: string, - { - saveAsNew, - redirectToOrigin, - addToDashboard, - dashboardId, - saveToLibrary, - }: SaveModalArgs = {} - ) { - await testSubjects.setValue('savedObjectTitle', vizName); - - const hasSaveAsNew = await testSubjects.exists('saveAsNewCheckbox'); - if (hasSaveAsNew && saveAsNew !== undefined) { - const state = saveAsNew ? 'check' : 'uncheck'; - log.debug('save as new checkbox exists. Setting its state to', state); - await testSubjects.setEuiSwitch('saveAsNewCheckbox', state); - } + public async resetNewDashboard() { + await this.common.navigateToApp('dashboard'); + await this.dashboard.gotoDashboardLandingPage(true); + await this.dashboard.clickNewDashboard(false); + } - const hasDashboardSelector = await testSubjects.exists('add-to-dashboard-options'); - if (hasDashboardSelector && addToDashboard !== undefined) { - let option: DashboardPickerOption = 'add-to-library-option'; - if (addToDashboard) { - option = dashboardId ? 'existing-dashboard-option' : 'new-dashboard-option'; - } - log.debug('save modal dashboard selector, choosing option:', option); - const dashboardSelector = await testSubjects.find('add-to-dashboard-options'); - const label = await dashboardSelector.findByCssSelector(`label[for="${option}"]`); - await label.click(); + public async setSaveModalValues( + vizName: string, + { saveAsNew, redirectToOrigin, addToDashboard, dashboardId, saveToLibrary }: SaveModalArgs = {} + ) { + await this.testSubjects.setValue('savedObjectTitle', vizName); + + const hasSaveAsNew = await this.testSubjects.exists('saveAsNewCheckbox'); + if (hasSaveAsNew && saveAsNew !== undefined) { + const state = saveAsNew ? 'check' : 'uncheck'; + this.log.debug('save as new checkbox exists. Setting its state to', state); + await this.testSubjects.setEuiSwitch('saveAsNewCheckbox', state); + } - if (dashboardId) { - await testSubjects.setValue('dashboardPickerInput', dashboardId); - await find.clickByButtonText(dashboardId); - } + const hasDashboardSelector = await this.testSubjects.exists('add-to-dashboard-options'); + if (hasDashboardSelector && addToDashboard !== undefined) { + let option: DashboardPickerOption = 'add-to-library-option'; + if (addToDashboard) { + option = dashboardId ? 'existing-dashboard-option' : 'new-dashboard-option'; } - - const hasSaveToLibrary = await testSubjects.exists('add-to-library-checkbox'); - if (hasSaveToLibrary && saveToLibrary !== undefined) { - const libraryCheckbox = await find.byCssSelector('#add-to-library-checkbox'); - const isChecked = await libraryCheckbox.isSelected(); - const needsClick = isChecked !== saveToLibrary; - const state = saveToLibrary ? 'check' : 'uncheck'; - - log.debug('save to library checkbox exists. Setting its state to', state); - if (needsClick) { - const selector = await testSubjects.find('add-to-library-checkbox'); - const label = await selector.findByCssSelector(`label[for="add-to-library-checkbox"]`); - await label.click(); - } + this.log.debug('save modal dashboard selector, choosing option:', option); + const dashboardSelector = await this.testSubjects.find('add-to-dashboard-options'); + const label = await dashboardSelector.findByCssSelector(`label[for="${option}"]`); + await label.click(); + + if (dashboardId) { + await this.testSubjects.setValue('dashboardPickerInput', dashboardId); + await this.find.clickByButtonText(dashboardId); } + } - const hasRedirectToOrigin = await testSubjects.exists('returnToOriginModeSwitch'); - if (hasRedirectToOrigin && redirectToOrigin !== undefined) { - const state = redirectToOrigin ? 'check' : 'uncheck'; - log.debug('redirect to origin checkbox exists. Setting its state to', state); - await testSubjects.setEuiSwitch('returnToOriginModeSwitch', state); + const hasSaveToLibrary = await this.testSubjects.exists('add-to-library-checkbox'); + if (hasSaveToLibrary && saveToLibrary !== undefined) { + const libraryCheckbox = await this.find.byCssSelector('#add-to-library-checkbox'); + const isChecked = await libraryCheckbox.isSelected(); + const needsClick = isChecked !== saveToLibrary; + const state = saveToLibrary ? 'check' : 'uncheck'; + + this.log.debug('save to library checkbox exists. Setting its state to', state); + if (needsClick) { + const selector = await this.testSubjects.find('add-to-library-checkbox'); + const label = await selector.findByCssSelector(`label[for="add-to-library-checkbox"]`); + await label.click(); } } - public async libraryNotificationExists(panelTitle: string) { - log.debug('searching for library modal on panel:', panelTitle); - const panel = await testSubjects.find( - `embeddablePanelHeading-${panelTitle.replace(/ /g, '')}` - ); - const libraryActionExists = await testSubjects.descendantExists( - 'embeddablePanelNotification-ACTION_LIBRARY_NOTIFICATION', - panel - ); - return libraryActionExists; + const hasRedirectToOrigin = await this.testSubjects.exists('returnToOriginModeSwitch'); + if (hasRedirectToOrigin && redirectToOrigin !== undefined) { + const state = redirectToOrigin ? 'check' : 'uncheck'; + this.log.debug('redirect to origin checkbox exists. Setting its state to', state); + await this.testSubjects.setEuiSwitch('returnToOriginModeSwitch', state); } + } - public async saveFromModal( - vizName: string, - saveModalArgs: SaveModalArgs = { addToDashboard: null } - ) { - await this.ensureSaveModalIsOpen(); + public async libraryNotificationExists(panelTitle: string) { + this.log.debug('searching for library modal on panel:', panelTitle); + const panel = await this.testSubjects.find( + `embeddablePanelHeading-${panelTitle.replace(/ /g, '')}` + ); + const libraryActionExists = await this.testSubjects.descendantExists( + 'embeddablePanelNotification-ACTION_LIBRARY_NOTIFICATION', + panel + ); + return libraryActionExists; + } - await this.setSaveModalValues(vizName, saveModalArgs); - log.debug('Click Save Visualization button'); + public async saveFromModal( + vizName: string, + saveModalArgs: SaveModalArgs = { addToDashboard: null } + ) { + await this.ensureSaveModalIsOpen(); - await testSubjects.click('confirmSaveSavedObjectButton'); + await this.setSaveModalValues(vizName, saveModalArgs); + this.log.debug('Click Save Visualization button'); - await common.waitForSaveModalToClose(); - } - } + await this.testSubjects.click('confirmSaveSavedObjectButton'); - return new TimeToVisualizePage(); + await this.common.waitForSaveModalToClose(); + } } diff --git a/test/functional/page_objects/timelion_page.ts b/test/functional/page_objects/timelion_page.ts index 7f4c4eb125c8e1..57913f8e2413dc 100644 --- a/test/functional/page_objects/timelion_page.ts +++ b/test/functional/page_objects/timelion_page.ts @@ -6,79 +6,75 @@ * Side Public License, v 1. */ -import { FtrProviderContext } from '../ftr_provider_context'; +import { FtrService } from '../ftr_provider_context'; -export function TimelionPageProvider({ getService, getPageObjects }: FtrProviderContext) { - const testSubjects = getService('testSubjects'); - const log = getService('log'); - const PageObjects = getPageObjects(['common', 'header']); - const esArchiver = getService('esArchiver'); - const kibanaServer = getService('kibanaServer'); +export class TimelionPageObject extends FtrService { + private readonly testSubjects = this.ctx.getService('testSubjects'); + private readonly log = this.ctx.getService('log'); + private readonly common = this.ctx.getPageObject('common'); + private readonly esArchiver = this.ctx.getService('esArchiver'); + private readonly kibanaServer = this.ctx.getService('kibanaServer'); - class TimelionPage { - public async initTests() { - await kibanaServer.uiSettings.replace({ - defaultIndex: 'logstash-*', - }); + public async initTests() { + await this.kibanaServer.uiSettings.replace({ + defaultIndex: 'logstash-*', + }); - log.debug('load kibana index'); - await esArchiver.load('timelion'); + this.log.debug('load kibana index'); + await this.esArchiver.load('timelion'); - await PageObjects.common.navigateToApp('timelion'); - } - - public async setExpression(expression: string) { - const input = await testSubjects.find('timelionExpressionTextArea'); - await input.clearValue(); - await input.type(expression); - } + await this.common.navigateToApp('timelion'); + } - public async updateExpression(updates: string) { - const input = await testSubjects.find('timelionExpressionTextArea'); - await input.type(updates); - await PageObjects.common.sleep(1000); - } + public async setExpression(expression: string) { + const input = await this.testSubjects.find('timelionExpressionTextArea'); + await input.clearValue(); + await input.type(expression); + } - public async getExpression() { - const input = await testSubjects.find('timelionExpressionTextArea'); - return input.getVisibleText(); - } + public async updateExpression(updates: string) { + const input = await this.testSubjects.find('timelionExpressionTextArea'); + await input.type(updates); + await this.common.sleep(1000); + } - public async getSuggestionItemsText() { - const elements = await testSubjects.findAll('timelionSuggestionListItem'); - return await Promise.all(elements.map(async (element) => await element.getVisibleText())); - } + public async getExpression() { + const input = await this.testSubjects.find('timelionExpressionTextArea'); + return input.getVisibleText(); + } - public async clickSuggestion(suggestionIndex = 0, waitTime = 1000) { - const elements = await testSubjects.findAll('timelionSuggestionListItem'); - if (suggestionIndex > elements.length) { - throw new Error( - `Unable to select suggestion ${suggestionIndex}, only ${elements.length} suggestions available.` - ); - } - await elements[suggestionIndex].click(); - // Wait for timelion expression to be updated after clicking suggestions - await PageObjects.common.sleep(waitTime); - } + public async getSuggestionItemsText() { + const elements = await this.testSubjects.findAll('timelionSuggestionListItem'); + return await Promise.all(elements.map(async (element) => await element.getVisibleText())); + } - public async saveTimelionSheet() { - await testSubjects.click('timelionSaveButton'); - await testSubjects.click('timelionSaveAsSheetButton'); - await testSubjects.click('timelionFinishSaveButton'); - await testSubjects.existOrFail('timelionSaveSuccessToast'); - await testSubjects.waitForDeleted('timelionSaveSuccessToast'); + public async clickSuggestion(suggestionIndex = 0, waitTime = 1000) { + const elements = await this.testSubjects.findAll('timelionSuggestionListItem'); + if (suggestionIndex > elements.length) { + throw new Error( + `Unable to select suggestion ${suggestionIndex}, only ${elements.length} suggestions available.` + ); } + await elements[suggestionIndex].click(); + // Wait for timelion expression to be updated after clicking suggestions + await this.common.sleep(waitTime); + } - public async expectWriteControls() { - await testSubjects.existOrFail('timelionSaveButton'); - await testSubjects.existOrFail('timelionDeleteButton'); - } + public async saveTimelionSheet() { + await this.testSubjects.click('timelionSaveButton'); + await this.testSubjects.click('timelionSaveAsSheetButton'); + await this.testSubjects.click('timelionFinishSaveButton'); + await this.testSubjects.existOrFail('timelionSaveSuccessToast'); + await this.testSubjects.waitForDeleted('timelionSaveSuccessToast'); + } - public async expectMissingWriteControls() { - await testSubjects.missingOrFail('timelionSaveButton'); - await testSubjects.missingOrFail('timelionDeleteButton'); - } + public async expectWriteControls() { + await this.testSubjects.existOrFail('timelionSaveButton'); + await this.testSubjects.existOrFail('timelionDeleteButton'); } - return new TimelionPage(); + public async expectMissingWriteControls() { + await this.testSubjects.missingOrFail('timelionSaveButton'); + await this.testSubjects.missingOrFail('timelionDeleteButton'); + } } diff --git a/test/functional/page_objects/vega_chart_page.ts b/test/functional/page_objects/vega_chart_page.ts index 3e165b3434f8a4..f83c5e193034eb 100644 --- a/test/functional/page_objects/vega_chart_page.ts +++ b/test/functional/page_objects/vega_chart_page.ts @@ -7,110 +7,103 @@ */ import expect from '@kbn/expect'; -import { FtrProviderContext } from '../ftr_provider_context'; +import { FtrService } from '../ftr_provider_context'; const compareSpecs = (first: string, second: string) => { const normalizeSpec = (spec: string) => spec.replace(/[\n ]/g, ''); return normalizeSpec(first) === normalizeSpec(second); }; -export function VegaChartPageProvider({ - getService, - getPageObjects, -}: FtrProviderContext & { updateBaselines: boolean }) { - const find = getService('find'); - const testSubjects = getService('testSubjects'); - const browser = getService('browser'); - const retry = getService('retry'); - - class VegaChartPage { - public getEditor() { - return testSubjects.find('vega-editor'); - } +export class VegaChartPageObject extends FtrService { + private readonly find = this.ctx.getService('find'); + private readonly testSubjects = this.ctx.getService('testSubjects'); + private readonly browser = this.ctx.getService('browser'); + private readonly retry = this.ctx.getService('retry'); - public getViewContainer() { - return find.byCssSelector('div.vgaVis__view'); - } + public getEditor() { + return this.testSubjects.find('vega-editor'); + } - public getControlContainer() { - return find.byCssSelector('div.vgaVis__controls'); - } + public getViewContainer() { + return this.find.byCssSelector('div.vgaVis__view'); + } - public getYAxisContainer() { - return find.byCssSelector('[aria-label^="Y-axis"]'); - } + public getControlContainer() { + return this.find.byCssSelector('div.vgaVis__controls'); + } - public async getAceGutterContainer() { - const editor = await this.getEditor(); - return editor.findByClassName('ace_gutter'); - } + public getYAxisContainer() { + return this.find.byCssSelector('[aria-label^="Y-axis"]'); + } - public async getRawSpec() { - // Adapted from console_page.js:getVisibleTextFromAceEditor(). Is there a common utilities file? - const editor = await this.getEditor(); - const lines = await editor.findAllByClassName('ace_line_group'); + public async getAceGutterContainer() { + const editor = await this.getEditor(); + return editor.findByClassName('ace_gutter'); + } - return await Promise.all( - lines.map(async (line) => { - return await line.getVisibleText(); - }) - ); - } + public async getRawSpec() { + // Adapted from console_page.js:getVisibleTextFromAceEditor(). Is there a common utilities file? + const editor = await this.getEditor(); + const lines = await editor.findAllByClassName('ace_line_group'); - public async getSpec() { - return (await this.getRawSpec()).join('\n'); - } + return await Promise.all( + lines.map(async (line) => { + return await line.getVisibleText(); + }) + ); + } - public async focusEditor() { - const editor = await this.getEditor(); - const textarea = await editor.findByClassName('ace_content'); + public async getSpec() { + return (await this.getRawSpec()).join('\n'); + } - await textarea.click(); - } + public async focusEditor() { + const editor = await this.getEditor(); + const textarea = await editor.findByClassName('ace_content'); - public async fillSpec(newSpec: string) { - await retry.try(async () => { - await this.cleanSpec(); - await this.focusEditor(); - await browser.pressKeys(newSpec); + await textarea.click(); + } - expect(compareSpecs(await this.getSpec(), newSpec)).to.be(true); - }); - } + public async fillSpec(newSpec: string) { + await this.retry.try(async () => { + await this.cleanSpec(); + await this.focusEditor(); + await this.browser.pressKeys(newSpec); - public async typeInSpec(text: string) { - const aceGutter = await this.getAceGutterContainer(); + expect(compareSpecs(await this.getSpec(), newSpec)).to.be(true); + }); + } - await aceGutter.doubleClick(); - await browser.pressKeys(browser.keys.RIGHT); - await browser.pressKeys(browser.keys.LEFT); - await browser.pressKeys(browser.keys.LEFT); - await browser.pressKeys(text); - } + public async typeInSpec(text: string) { + const aceGutter = await this.getAceGutterContainer(); - public async cleanSpec() { - const aceGutter = await this.getAceGutterContainer(); + await aceGutter.doubleClick(); + await this.browser.pressKeys(this.browser.keys.RIGHT); + await this.browser.pressKeys(this.browser.keys.LEFT); + await this.browser.pressKeys(this.browser.keys.LEFT); + await this.browser.pressKeys(text); + } - await retry.try(async () => { - await aceGutter.doubleClick(); - await browser.pressKeys(browser.keys.BACK_SPACE); + public async cleanSpec() { + const aceGutter = await this.getAceGutterContainer(); - expect(await this.getSpec()).to.be(''); - }); - } + await this.retry.try(async () => { + await aceGutter.doubleClick(); + await this.browser.pressKeys(this.browser.keys.BACK_SPACE); - public async getYAxisLabels() { - const yAxis = await this.getYAxisContainer(); - const tickGroup = await yAxis.findByClassName('role-axis-label'); - const labels = await tickGroup.findAllByCssSelector('text'); - const labelTexts: string[] = []; + expect(await this.getSpec()).to.be(''); + }); + } + + public async getYAxisLabels() { + const yAxis = await this.getYAxisContainer(); + const tickGroup = await yAxis.findByClassName('role-axis-label'); + const labels = await tickGroup.findAllByCssSelector('text'); + const labelTexts: string[] = []; - for (const label of labels) { - labelTexts.push(await label.getVisibleText()); - } - return labelTexts; + for (const label of labels) { + labelTexts.push(await label.getVisibleText()); } + return labelTexts; } - - return new VegaChartPage(); } diff --git a/test/functional/page_objects/visual_builder_page.ts b/test/functional/page_objects/visual_builder_page.ts index 997a1127005ee5..d796067372fa87 100644 --- a/test/functional/page_objects/visual_builder_page.ts +++ b/test/functional/page_objects/visual_builder_page.ts @@ -6,654 +6,651 @@ * Side Public License, v 1. */ -import { FtrProviderContext } from '../ftr_provider_context'; +import { FtrService } from '../ftr_provider_context'; import { WebElementWrapper } from '../services/lib/web_element_wrapper'; -export function VisualBuilderPageProvider({ getService, getPageObjects }: FtrProviderContext) { - const find = getService('find'); - const log = getService('log'); - const retry = getService('retry'); - const testSubjects = getService('testSubjects'); - const comboBox = getService('comboBox'); - const PageObjects = getPageObjects(['common', 'header', 'visualize', 'timePicker', 'visChart']); - - type Duration = - | 'Milliseconds' - | 'Seconds' - | 'Minutes' - | 'Hours' - | 'Days' - | 'Weeks' - | 'Months' - | 'Years'; - - type FromDuration = Duration | 'Picoseconds' | 'Nanoseconds' | 'Microseconds'; - type ToDuration = Duration | 'Human readable'; - - class VisualBuilderPage { - public async resetPage( - fromTime = 'Sep 19, 2015 @ 06:31:44.000', - toTime = 'Sep 22, 2015 @ 18:31:44.000' - ) { - await PageObjects.common.navigateToUrl('visualize', 'create?type=metrics', { - useActualUrl: true, - }); - log.debug('Wait for initializing TSVB editor'); - await this.checkVisualBuilderIsPresent(); - log.debug('Set absolute time range from "' + fromTime + '" to "' + toTime + '"'); - await PageObjects.timePicker.setAbsoluteRange(fromTime, toTime); - // 2 sec sleep until https://github.com/elastic/kibana/issues/46353 is fixed - await PageObjects.common.sleep(2000); - } +type Duration = + | 'Milliseconds' + | 'Seconds' + | 'Minutes' + | 'Hours' + | 'Days' + | 'Weeks' + | 'Months' + | 'Years'; + +type FromDuration = Duration | 'Picoseconds' | 'Nanoseconds' | 'Microseconds'; +type ToDuration = Duration | 'Human readable'; + +export class VisualBuilderPageObject extends FtrService { + private readonly find = this.ctx.getService('find'); + private readonly log = this.ctx.getService('log'); + private readonly retry = this.ctx.getService('retry'); + private readonly testSubjects = this.ctx.getService('testSubjects'); + private readonly comboBox = this.ctx.getService('comboBox'); + private readonly common = this.ctx.getPageObject('common'); + private readonly header = this.ctx.getPageObject('header'); + private readonly timePicker = this.ctx.getPageObject('timePicker'); + private readonly visChart = this.ctx.getPageObject('visChart'); + + public async resetPage( + fromTime = 'Sep 19, 2015 @ 06:31:44.000', + toTime = 'Sep 22, 2015 @ 18:31:44.000' + ) { + await this.common.navigateToUrl('visualize', 'create?type=metrics', { + useActualUrl: true, + }); + this.log.debug('Wait for initializing TSVB editor'); + await this.checkVisualBuilderIsPresent(); + this.log.debug('Set absolute time range from "' + fromTime + '" to "' + toTime + '"'); + await this.timePicker.setAbsoluteRange(fromTime, toTime); + // 2 sec sleep until https://github.com/elastic/kibana/issues/46353 is fixed + await this.common.sleep(2000); + } - public async checkTabIsLoaded(testSubj: string, name: string) { - let isPresent = false; - await retry.try(async () => { - isPresent = await testSubjects.exists(testSubj, { timeout: 20000 }); - if (!isPresent) { - isPresent = await testSubjects.exists('visNoResult', { timeout: 1000 }); - } - }); + public async checkTabIsLoaded(testSubj: string, name: string) { + let isPresent = false; + await this.retry.try(async () => { + isPresent = await this.testSubjects.exists(testSubj, { timeout: 20000 }); if (!isPresent) { - throw new Error(`TSVB ${name} tab is not loaded`); + isPresent = await this.testSubjects.exists('visNoResult', { timeout: 1000 }); } + }); + if (!isPresent) { + throw new Error(`TSVB ${name} tab is not loaded`); } + } - public async checkTabIsSelected(chartType: string) { - const chartTypeBtn = await testSubjects.find(`${chartType}TsvbTypeBtn`); - const isSelected = await chartTypeBtn.getAttribute('aria-selected'); + public async checkTabIsSelected(chartType: string) { + const chartTypeBtn = await this.testSubjects.find(`${chartType}TsvbTypeBtn`); + const isSelected = await chartTypeBtn.getAttribute('aria-selected'); - if (isSelected !== 'true') { - throw new Error(`TSVB ${chartType} tab is not selected`); - } + if (isSelected !== 'true') { + throw new Error(`TSVB ${chartType} tab is not selected`); } + } - public async checkPanelConfigIsPresent(chartType: string) { - await testSubjects.existOrFail(`tvbPanelConfig__${chartType}`); - } + public async checkPanelConfigIsPresent(chartType: string) { + await this.testSubjects.existOrFail(`tvbPanelConfig__${chartType}`); + } - public async checkVisualBuilderIsPresent() { - await this.checkTabIsLoaded('tvbVisEditor', 'Time Series'); - } + public async checkVisualBuilderIsPresent() { + await this.checkTabIsLoaded('tvbVisEditor', 'Time Series'); + } - public async checkTimeSeriesChartIsPresent() { - const isPresent = await find.existsByCssSelector('.tvbVisTimeSeries'); - if (!isPresent) { - throw new Error(`TimeSeries chart is not loaded`); - } + public async checkTimeSeriesChartIsPresent() { + const isPresent = await this.find.existsByCssSelector('.tvbVisTimeSeries'); + if (!isPresent) { + throw new Error(`TimeSeries chart is not loaded`); } + } - public async checkTimeSeriesIsLight() { - return await find.existsByCssSelector('.tvbVisTimeSeriesLight'); - } + public async checkTimeSeriesIsLight() { + return await this.find.existsByCssSelector('.tvbVisTimeSeriesLight'); + } - public async checkTimeSeriesLegendIsPresent() { - const isPresent = await find.existsByCssSelector('.echLegend'); - if (!isPresent) { - throw new Error(`TimeSeries legend is not loaded`); - } + public async checkTimeSeriesLegendIsPresent() { + const isPresent = await this.find.existsByCssSelector('.echLegend'); + if (!isPresent) { + throw new Error(`TimeSeries legend is not loaded`); } + } - public async checkMetricTabIsPresent() { - await this.checkTabIsLoaded('tsvbMetricValue', 'Metric'); - } + public async checkMetricTabIsPresent() { + await this.checkTabIsLoaded('tsvbMetricValue', 'Metric'); + } - public async checkGaugeTabIsPresent() { - await this.checkTabIsLoaded('tvbVisGaugeContainer', 'Gauge'); - } + public async checkGaugeTabIsPresent() { + await this.checkTabIsLoaded('tvbVisGaugeContainer', 'Gauge'); + } - public async checkTopNTabIsPresent() { - await this.checkTabIsLoaded('tvbVisTopNTable', 'TopN'); - } + public async checkTopNTabIsPresent() { + await this.checkTabIsLoaded('tvbVisTopNTable', 'TopN'); + } - public async clickMetric() { - const button = await testSubjects.find('metricTsvbTypeBtn'); - await button.click(); - } + public async clickMetric() { + const button = await this.testSubjects.find('metricTsvbTypeBtn'); + await button.click(); + } - public async clickMarkdown() { - const button = await testSubjects.find('markdownTsvbTypeBtn'); - await button.click(); - } + public async clickMarkdown() { + const button = await this.testSubjects.find('markdownTsvbTypeBtn'); + await button.click(); + } - public async getMetricValue() { - await PageObjects.visChart.waitForVisualizationRenderingStabilized(); - const metricValue = await find.byCssSelector('.tvbVisMetric__value--primary'); - return metricValue.getVisibleText(); - } + public async getMetricValue() { + await this.visChart.waitForVisualizationRenderingStabilized(); + const metricValue = await this.find.byCssSelector('.tvbVisMetric__value--primary'); + return metricValue.getVisibleText(); + } - public async enterMarkdown(markdown: string) { - await this.clearMarkdown(); - const input = await find.byCssSelector('.tvbMarkdownEditor__editor textarea'); - await input.type(markdown); - await PageObjects.common.sleep(3000); - } + public async enterMarkdown(markdown: string) { + await this.clearMarkdown(); + const input = await this.find.byCssSelector('.tvbMarkdownEditor__editor textarea'); + await input.type(markdown); + await this.common.sleep(3000); + } - public async clearMarkdown() { - // Since we use ACE editor and that isn't really storing its value inside - // a textarea we must really select all text and remove it, and cannot use - // clearValue(). - await retry.waitForWithTimeout('text area is cleared', 20000, async () => { - const editor = await testSubjects.find('codeEditorContainer'); - const $ = await editor.parseDomContent(); - const value = $('.ace_line').text(); - if (value.length > 0) { - log.debug('Clearing text area input'); - this.waitForMarkdownTextAreaCleaned(); - } - - return value.length === 0; - }); - } + public async clearMarkdown() { + // Since we use ACE editor and that isn't really storing its value inside + // a textarea we must really select all text and remove it, and cannot use + // clearValue(). + await this.retry.waitForWithTimeout('text area is cleared', 20000, async () => { + const editor = await this.testSubjects.find('codeEditorContainer'); + const $ = await editor.parseDomContent(); + const value = $('.ace_line').text(); + if (value.length > 0) { + this.log.debug('Clearing text area input'); + this.waitForMarkdownTextAreaCleaned(); + } - public async waitForMarkdownTextAreaCleaned() { - const input = await find.byCssSelector('.tvbMarkdownEditor__editor textarea'); - await input.clearValueWithKeyboard(); - const text = await this.getMarkdownText(); - return text.length === 0; - } + return value.length === 0; + }); + } - public async getMarkdownText(): Promise { - const el = await find.byCssSelector('.tvbVis'); - const text = await el.getVisibleText(); - return text; - } + public async waitForMarkdownTextAreaCleaned() { + const input = await this.find.byCssSelector('.tvbMarkdownEditor__editor textarea'); + await input.clearValueWithKeyboard(); + const text = await this.getMarkdownText(); + return text.length === 0; + } - /** - * - * getting all markdown variables list which located on `table` section - * - * **Note**: if `table` not have variables, use `getMarkdownTableNoVariables` method instead - * @see {getMarkdownTableNoVariables} - * @returns {Promise>} - * @memberof VisualBuilderPage - */ - public async getMarkdownTableVariables(): Promise< - Array<{ key: string; value: string; selector: WebElementWrapper }> - > { - const testTableVariables = await testSubjects.find('tsvbMarkdownVariablesTable'); - const variablesSelector = 'tbody tr'; - const exists = await find.existsByCssSelector(variablesSelector); - if (!exists) { - log.debug('variable list is empty'); - return []; - } - const variables = await testTableVariables.findAllByCssSelector(variablesSelector); - - const variablesKeyValueSelectorMap = await Promise.all( - variables.map(async (variable) => { - const subVars = await variable.findAllByCssSelector('td'); - const selector = await subVars[0].findByTagName('a'); - const key = await selector.getVisibleText(); - const value = await subVars[1].getVisibleText(); - log.debug(`markdown table variables table is: ${key} ${value}`); - return { key, value, selector }; - }) - ); - return variablesKeyValueSelectorMap; - } + public async getMarkdownText(): Promise { + const el = await this.find.byCssSelector('.tvbVis'); + const text = await el.getVisibleText(); + return text; + } - /** - * return variable table message, if `table` is empty it will be fail - * - * **Note:** if `table` have variables, use `getMarkdownTableVariables` method instead - * @see {@link VisualBuilderPage#getMarkdownTableVariables} - * @returns - * @memberof VisualBuilderPage - */ - public async getMarkdownTableNoVariables() { - return await testSubjects.getVisibleText('tvbMarkdownEditor__noVariables'); - } + /** + * + * getting all markdown variables list which located on `table` section + * + * **Note**: if `table` not have variables, use `getMarkdownTableNoVariables` method instead + * @see {getMarkdownTableNoVariables} + * @returns {Promise>} + * @memberof VisualBuilderPage + */ + public async getMarkdownTableVariables(): Promise< + Array<{ key: string; value: string; selector: WebElementWrapper }> + > { + const testTableVariables = await this.testSubjects.find('tsvbMarkdownVariablesTable'); + const variablesSelector = 'tbody tr'; + const exists = await this.find.existsByCssSelector(variablesSelector); + if (!exists) { + this.log.debug('variable list is empty'); + return []; + } + const variables = await testTableVariables.findAllByCssSelector(variablesSelector); + + const variablesKeyValueSelectorMap = await Promise.all( + variables.map(async (variable) => { + const subVars = await variable.findAllByCssSelector('td'); + const selector = await subVars[0].findByTagName('a'); + const key = await selector.getVisibleText(); + const value = await subVars[1].getVisibleText(); + this.log.debug(`markdown table variables table is: ${key} ${value}`); + return { key, value, selector }; + }) + ); + return variablesKeyValueSelectorMap; + } - /** - * get all sub-tabs count for `time series`, `metric`, `top n`, `gauge`, `markdown` or `table` tab. - * - * @returns {Promise} - * @memberof VisualBuilderPage - */ - public async getSubTabs(): Promise { - return await find.allByCssSelector('[data-test-subj$="-subtab"]'); - } + /** + * return variable table message, if `table` is empty it will be fail + * + * **Note:** if `table` have variables, use `getMarkdownTableVariables` method instead + * @see {@link VisualBuilderPage#getMarkdownTableVariables} + * @returns + * @memberof VisualBuilderPage + */ + public async getMarkdownTableNoVariables() { + return await this.testSubjects.getVisibleText('tvbMarkdownEditor__noVariables'); + } - /** - * switch markdown sub-tab for visualization - * - * @param {'data' | 'options'| 'markdown'} subTab - * @memberof VisualBuilderPage - */ - public async markdownSwitchSubTab(subTab: 'data' | 'options' | 'markdown') { - const tab = await testSubjects.find(`${subTab}-subtab`); - const isSelected = await tab.getAttribute('aria-selected'); - if (isSelected !== 'true') { - await tab.click(); - } - } + /** + * get all sub-tabs count for `time series`, `metric`, `top n`, `gauge`, `markdown` or `table` tab. + * + * @returns {Promise} + * @memberof VisualBuilderPage + */ + public async getSubTabs(): Promise { + return await this.find.allByCssSelector('[data-test-subj$="-subtab"]'); + } - /** - * setting label for markdown visualization - * - * @param {string} variableName - * @param type - * @memberof VisualBuilderPage - */ - public async setMarkdownDataVariable(variableName: string, type: 'variable' | 'label') { - const SELECTOR = type === 'label' ? '[placeholder="Label"]' : '[placeholder="Variable name"]'; - if (variableName) { - await find.setValue(SELECTOR, variableName); - } else { - const input = await find.byCssSelector(SELECTOR); - await input.clearValueWithKeyboard({ charByChar: true }); - } + /** + * switch markdown sub-tab for visualization + * + * @param {'data' | 'options'| 'markdown'} subTab + * @memberof VisualBuilderPage + */ + public async markdownSwitchSubTab(subTab: 'data' | 'options' | 'markdown') { + const tab = await this.testSubjects.find(`${subTab}-subtab`); + const isSelected = await tab.getAttribute('aria-selected'); + if (isSelected !== 'true') { + await tab.click(); } + } - public async clickSeriesOption(nth = 0) { - const el = await testSubjects.findAll('seriesOptions'); - await el[nth].click(); + /** + * setting label for markdown visualization + * + * @param {string} variableName + * @param type + * @memberof VisualBuilderPage + */ + public async setMarkdownDataVariable(variableName: string, type: 'variable' | 'label') { + const SELECTOR = type === 'label' ? '[placeholder="Label"]' : '[placeholder="Variable name"]'; + if (variableName) { + await this.find.setValue(SELECTOR, variableName); + } else { + const input = await this.find.byCssSelector(SELECTOR); + await input.clearValueWithKeyboard({ charByChar: true }); } + } - public async clearOffsetSeries() { - const el = await testSubjects.find('offsetTimeSeries'); - await el.clearValue(); - } + public async clickSeriesOption(nth = 0) { + const el = await this.testSubjects.findAll('seriesOptions'); + await el[nth].click(); + } - public async toggleAutoApplyChanges() { - await find.clickByCssSelector('#tsvbAutoApplyInput'); - } + public async clearOffsetSeries() { + const el = await this.testSubjects.find('offsetTimeSeries'); + await el.clearValue(); + } - public async applyChanges() { - await testSubjects.clickWhenNotDisabled('applyBtn'); - } + public async toggleAutoApplyChanges() { + await this.find.clickByCssSelector('#tsvbAutoApplyInput'); + } - /** - * change the data formatter for template in an `options` label tab - * - * @param formatter - typeof formatter which you can use for presenting data. By default kibana show `Number` formatter - */ - public async changeDataFormatter( - formatter: 'Bytes' | 'Number' | 'Percent' | 'Duration' | 'Custom' - ) { - const formatterEl = await testSubjects.find('tsvbDataFormatPicker'); - await comboBox.setElement(formatterEl, formatter, { clickWithMouse: true }); - } + public async applyChanges() { + await this.testSubjects.clickWhenNotDisabled('applyBtn'); + } - /** - * set duration formatter additional settings - * - * @param from start format - * @param to end format - * @param decimalPlaces decimals count - */ - public async setDurationFormatterSettings({ - from, - to, - decimalPlaces, - }: { - from?: FromDuration; - to?: ToDuration; - decimalPlaces?: string; - }) { - if (from) { - await retry.try(async () => { - const fromCombobox = await find.byCssSelector('[id$="from-row"] .euiComboBox'); - await comboBox.setElement(fromCombobox, from, { clickWithMouse: true }); - }); - } - if (to) { - const toCombobox = await find.byCssSelector('[id$="to-row"] .euiComboBox'); - await comboBox.setElement(toCombobox, to, { clickWithMouse: true }); - } - if (decimalPlaces) { - const decimalPlacesInput = await find.byCssSelector('[id$="decimal"]'); - await decimalPlacesInput.type(decimalPlaces); - } - } + /** + * change the data formatter for template in an `options` label tab + * + * @param formatter - typeof formatter which you can use for presenting data. By default kibana show `Number` formatter + */ + public async changeDataFormatter( + formatter: 'Bytes' | 'Number' | 'Percent' | 'Duration' | 'Custom' + ) { + const formatterEl = await this.testSubjects.find('tsvbDataFormatPicker'); + await this.comboBox.setElement(formatterEl, formatter, { clickWithMouse: true }); + } - /** - * write template for aggregation row in the `option` tab - * - * @param template always should contain `{{value}}` - * @example - * await visualBuilder.enterSeriesTemplate('$ {{value}}') // add `$` symbol for value - */ - public async enterSeriesTemplate(template: string) { - const el = await testSubjects.find('tsvb_series_value'); - await el.clearValueWithKeyboard(); - await el.type(template); + /** + * set duration formatter additional settings + * + * @param from start format + * @param to end format + * @param decimalPlaces decimals count + */ + public async setDurationFormatterSettings({ + from, + to, + decimalPlaces, + }: { + from?: FromDuration; + to?: ToDuration; + decimalPlaces?: string; + }) { + if (from) { + await this.retry.try(async () => { + const fromCombobox = await this.find.byCssSelector('[id$="from-row"] .euiComboBox'); + await this.comboBox.setElement(fromCombobox, from, { clickWithMouse: true }); + }); } - - public async enterOffsetSeries(value: string) { - const el = await testSubjects.find('offsetTimeSeries'); - await el.clearValue(); - await el.type(value); + if (to) { + const toCombobox = await this.find.byCssSelector('[id$="to-row"] .euiComboBox'); + await this.comboBox.setElement(toCombobox, to, { clickWithMouse: true }); } - - public async getRhythmChartLegendValue(nth = 0) { - await PageObjects.visChart.waitForVisualizationRenderingStabilized(); - const metricValue = ( - await find.allByCssSelector(`.echLegendItem .echLegendItem__extra`, 20000) - )[nth]; - await metricValue.moveMouseTo(); - return await metricValue.getVisibleText(); + if (decimalPlaces) { + const decimalPlacesInput = await this.find.byCssSelector('[id$="decimal"]'); + await decimalPlacesInput.type(decimalPlaces); } + } - public async clickGauge() { - await testSubjects.click('gaugeTsvbTypeBtn'); - } + /** + * write template for aggregation row in the `option` tab + * + * @param template always should contain `{{value}}` + * @example + * await visualBuilder.enterSeriesTemplate('$ {{value}}') // add `$` symbol for value + */ + public async enterSeriesTemplate(template: string) { + const el = await this.testSubjects.find('tsvb_series_value'); + await el.clearValueWithKeyboard(); + await el.type(template); + } - public async getGaugeLabel() { - const gaugeLabel = await find.byCssSelector('.tvbVisGauge__label'); - return await gaugeLabel.getVisibleText(); - } + public async enterOffsetSeries(value: string) { + const el = await this.testSubjects.find('offsetTimeSeries'); + await el.clearValue(); + await el.type(value); + } - public async getGaugeCount() { - const gaugeCount = await find.byCssSelector('.tvbVisGauge__value'); - return await gaugeCount.getVisibleText(); - } + public async getRhythmChartLegendValue(nth = 0) { + await this.visChart.waitForVisualizationRenderingStabilized(); + const metricValue = ( + await this.find.allByCssSelector(`.echLegendItem .echLegendItem__extra`, 20000) + )[nth]; + await metricValue.moveMouseTo(); + return await metricValue.getVisibleText(); + } - public async clickTopN() { - await testSubjects.click('top_nTsvbTypeBtn'); - } + public async clickGauge() { + await this.testSubjects.click('gaugeTsvbTypeBtn'); + } - public async getTopNLabel() { - const topNLabel = await find.byCssSelector('.tvbVisTopN__label'); - return await topNLabel.getVisibleText(); - } + public async getGaugeLabel() { + const gaugeLabel = await this.find.byCssSelector('.tvbVisGauge__label'); + return await gaugeLabel.getVisibleText(); + } - public async getTopNCount() { - const gaugeCount = await find.byCssSelector('.tvbVisTopN__value'); - return await gaugeCount.getVisibleText(); - } + public async getGaugeCount() { + const gaugeCount = await this.find.byCssSelector('.tvbVisGauge__value'); + return await gaugeCount.getVisibleText(); + } - public async clickTable() { - await testSubjects.click('tableTsvbTypeBtn'); - } + public async clickTopN() { + await this.testSubjects.click('top_nTsvbTypeBtn'); + } - public async createNewAgg(nth = 0) { - const prevAggs = await testSubjects.findAll('aggSelector'); - const elements = await testSubjects.findAll('addMetricAddBtn'); - await elements[nth].click(); - await PageObjects.visChart.waitForVisualizationRenderingStabilized(); - await retry.waitFor('new agg is added', async () => { - const currentAggs = await testSubjects.findAll('aggSelector'); - return currentAggs.length > prevAggs.length; - }); - } + public async getTopNLabel() { + const topNLabel = await this.find.byCssSelector('.tvbVisTopN__label'); + return await topNLabel.getVisibleText(); + } - public async selectAggType(value: string, nth = 0) { - const elements = await testSubjects.findAll('aggSelector'); - await comboBox.setElement(elements[nth], value); - return await PageObjects.header.waitUntilLoadingHasFinished(); - } + public async getTopNCount() { + const gaugeCount = await this.find.byCssSelector('.tvbVisTopN__value'); + return await gaugeCount.getVisibleText(); + } - public async fillInExpression(expression: string, nth = 0) { - const expressions = await testSubjects.findAll('mathExpression'); - await expressions[nth].type(expression); - return await PageObjects.header.waitUntilLoadingHasFinished(); - } + public async clickTable() { + await this.testSubjects.click('tableTsvbTypeBtn'); + } - public async fillInVariable(name = 'test', metric = 'Count', nth = 0) { - const elements = await testSubjects.findAll('varRow'); - const varNameInput = await elements[nth].findByCssSelector('.tvbAggs__varName'); - await varNameInput.type(name); - const metricSelectWrapper = await elements[nth].findByCssSelector( - '.tvbAggs__varMetricWrapper' - ); - await comboBox.setElement(metricSelectWrapper, metric); - return await PageObjects.header.waitUntilLoadingHasFinished(); - } + public async createNewAgg(nth = 0) { + const prevAggs = await this.testSubjects.findAll('aggSelector'); + const elements = await this.testSubjects.findAll('addMetricAddBtn'); + await elements[nth].click(); + await this.visChart.waitForVisualizationRenderingStabilized(); + await this.retry.waitFor('new agg is added', async () => { + const currentAggs = await this.testSubjects.findAll('aggSelector'); + return currentAggs.length > prevAggs.length; + }); + } - public async selectGroupByField(fieldName: string) { - await comboBox.set('groupByField', fieldName); - } + public async selectAggType(value: string, nth = 0) { + const elements = await this.testSubjects.findAll('aggSelector'); + await this.comboBox.setElement(elements[nth], value); + return await this.header.waitUntilLoadingHasFinished(); + } - public async setColumnLabelValue(value: string) { - const el = await testSubjects.find('columnLabelName'); - await el.clearValue(); - await el.type(value); - await PageObjects.header.waitUntilLoadingHasFinished(); - } + public async fillInExpression(expression: string, nth = 0) { + const expressions = await this.testSubjects.findAll('mathExpression'); + await expressions[nth].type(expression); + return await this.header.waitUntilLoadingHasFinished(); + } - /** - * get values for rendered table - * - * **Note:** this work only for table visualization - * - * @returns {Promise} - * @memberof VisualBuilderPage - */ - public async getViewTable(): Promise { - const tableView = await testSubjects.find('tableView', 20000); - return await tableView.getVisibleText(); - } + public async fillInVariable(name = 'test', metric = 'Count', nth = 0) { + const elements = await this.testSubjects.findAll('varRow'); + const varNameInput = await elements[nth].findByCssSelector('.tvbAggs__varName'); + await varNameInput.type(name); + const metricSelectWrapper = await elements[nth].findByCssSelector('.tvbAggs__varMetricWrapper'); + await this.comboBox.setElement(metricSelectWrapper, metric); + return await this.header.waitUntilLoadingHasFinished(); + } - public async clickPanelOptions(tabName: string) { - await testSubjects.click(`${tabName}EditorPanelOptionsBtn`); - await PageObjects.header.waitUntilLoadingHasFinished(); - } + public async selectGroupByField(fieldName: string) { + await this.comboBox.set('groupByField', fieldName); + } - public async clickDataTab(tabName: string) { - await testSubjects.click(`${tabName}EditorDataBtn`); - await PageObjects.header.waitUntilLoadingHasFinished(); - } + public async setColumnLabelValue(value: string) { + const el = await this.testSubjects.find('columnLabelName'); + await el.clearValue(); + await el.type(value); + await this.header.waitUntilLoadingHasFinished(); + } - public async switchIndexPatternSelectionMode(useKibanaIndices: boolean) { - await testSubjects.click('switchIndexPatternSelectionModePopover'); - await testSubjects.setEuiSwitch( - 'switchIndexPatternSelectionMode', - useKibanaIndices ? 'check' : 'uncheck' - ); - } + /** + * get values for rendered table + * + * **Note:** this work only for table visualization + * + * @returns {Promise} + * @memberof VisualBuilderPage + */ + public async getViewTable(): Promise { + const tableView = await this.testSubjects.find('tableView', 20000); + return await tableView.getVisibleText(); + } - public async setIndexPatternValue(value: string, useKibanaIndices?: boolean) { - const metricsIndexPatternInput = 'metricsIndexPatternInput'; + public async clickPanelOptions(tabName: string) { + await this.testSubjects.click(`${tabName}EditorPanelOptionsBtn`); + await this.header.waitUntilLoadingHasFinished(); + } - if (useKibanaIndices !== undefined) { - await this.switchIndexPatternSelectionMode(useKibanaIndices); - } + public async clickDataTab(tabName: string) { + await this.testSubjects.click(`${tabName}EditorDataBtn`); + await this.header.waitUntilLoadingHasFinished(); + } - if (useKibanaIndices === false) { - const el = await testSubjects.find(metricsIndexPatternInput); - await el.clearValue(); - if (value) { - await el.type(value, { charByChar: true }); - } - } else { - await comboBox.clearInputField(metricsIndexPatternInput); - if (value) { - await comboBox.setCustom(metricsIndexPatternInput, value); - } - } + public async switchIndexPatternSelectionMode(useKibanaIndices: boolean) { + await this.testSubjects.click('switchIndexPatternSelectionModePopover'); + await this.testSubjects.setEuiSwitch( + 'switchIndexPatternSelectionMode', + useKibanaIndices ? 'check' : 'uncheck' + ); + } + + public async setIndexPatternValue(value: string, useKibanaIndices?: boolean) { + const metricsIndexPatternInput = 'metricsIndexPatternInput'; - await PageObjects.header.waitUntilLoadingHasFinished(); + if (useKibanaIndices !== undefined) { + await this.switchIndexPatternSelectionMode(useKibanaIndices); } - public async setIntervalValue(value: string) { - const el = await testSubjects.find('metricsIndexPatternInterval'); + if (useKibanaIndices === false) { + const el = await this.testSubjects.find(metricsIndexPatternInput); await el.clearValue(); - await el.type(value); - await PageObjects.header.waitUntilLoadingHasFinished(); + if (value) { + await el.type(value, { charByChar: true }); + } + } else { + await this.comboBox.clearInputField(metricsIndexPatternInput); + if (value) { + await this.comboBox.setCustom(metricsIndexPatternInput, value); + } } - public async setDropLastBucket(value: boolean) { - const option = await testSubjects.find(`metricsDropLastBucket-${value ? 'yes' : 'no'}`); - (await option.findByCssSelector('label')).click(); - await PageObjects.header.waitUntilLoadingHasFinished(); - } + await this.header.waitUntilLoadingHasFinished(); + } - public async waitForIndexPatternTimeFieldOptionsLoaded() { - await retry.waitFor('combobox options loaded', async () => { - const options = await comboBox.getOptions('metricsIndexPatternFieldsSelect'); - log.debug(`-- optionsCount=${options.length}`); - return options.length > 0; - }); - } + public async setIntervalValue(value: string) { + const el = await this.testSubjects.find('metricsIndexPatternInterval'); + await el.clearValue(); + await el.type(value); + await this.header.waitUntilLoadingHasFinished(); + } - public async selectIndexPatternTimeField(timeField: string) { - await retry.try(async () => { - await comboBox.clearInputField('metricsIndexPatternFieldsSelect'); - await comboBox.set('metricsIndexPatternFieldsSelect', timeField); - }); - } + public async setDropLastBucket(value: boolean) { + const option = await this.testSubjects.find(`metricsDropLastBucket-${value ? 'yes' : 'no'}`); + (await option.findByCssSelector('label')).click(); + await this.header.waitUntilLoadingHasFinished(); + } - /** - * check that table visualization is visible and ready for interact - * - * @returns {Promise} - * @memberof VisualBuilderPage - */ - public async checkTableTabIsPresent(): Promise { - await testSubjects.existOrFail('visualizationLoader'); - const isDataExists = await testSubjects.exists('tableView'); - log.debug(`data is already rendered: ${isDataExists}`); - if (!isDataExists) { - await this.checkPreviewIsDisabled(); - } - } + public async waitForIndexPatternTimeFieldOptionsLoaded() { + await this.retry.waitFor('combobox options loaded', async () => { + const options = await this.comboBox.getOptions('metricsIndexPatternFieldsSelect'); + this.log.debug(`-- optionsCount=${options.length}`); + return options.length > 0; + }); + } - /** - * set label name for aggregation - * - * @param {string} labelName - * @param {number} [nth=0] - * @memberof VisualBuilderPage - */ - public async setLabel(labelName: string, nth: number = 0): Promise { - const input = (await find.allByCssSelector('[placeholder="Label"]'))[nth]; - await input.type(labelName); - } + public async selectIndexPatternTimeField(timeField: string) { + await this.retry.try(async () => { + await this.comboBox.clearInputField('metricsIndexPatternFieldsSelect'); + await this.comboBox.set('metricsIndexPatternFieldsSelect', timeField); + }); + } - /** - * set field for type of aggregation - * - * @param {string} field name of field - * @param {number} [aggNth=0] number of aggregation. Start by zero - * @default 0 - * @memberof VisualBuilderPage - */ - public async setFieldForAggregation(field: string, aggNth: number = 0): Promise { - const fieldEl = await this.getFieldForAggregation(aggNth); - - await comboBox.setElement(fieldEl, field); + /** + * check that table visualization is visible and ready for interact + * + * @returns {Promise} + * @memberof VisualBuilderPage + */ + public async checkTableTabIsPresent(): Promise { + await this.testSubjects.existOrFail('visualizationLoader'); + const isDataExists = await this.testSubjects.exists('tableView'); + this.log.debug(`data is already rendered: ${isDataExists}`); + if (!isDataExists) { + await this.checkPreviewIsDisabled(); } + } - public async checkFieldForAggregationValidity(aggNth: number = 0): Promise { - const fieldEl = await this.getFieldForAggregation(aggNth); + /** + * set label name for aggregation + * + * @param {string} labelName + * @param {number} [nth=0] + * @memberof VisualBuilderPage + */ + public async setLabel(labelName: string, nth: number = 0): Promise { + const input = (await this.find.allByCssSelector('[placeholder="Label"]'))[nth]; + await input.type(labelName); + } - return await comboBox.checkValidity(fieldEl); - } + /** + * set field for type of aggregation + * + * @param {string} field name of field + * @param {number} [aggNth=0] number of aggregation. Start by zero + * @default 0 + * @memberof VisualBuilderPage + */ + public async setFieldForAggregation(field: string, aggNth: number = 0): Promise { + const fieldEl = await this.getFieldForAggregation(aggNth); + + await this.comboBox.setElement(fieldEl, field); + } - public async getFieldForAggregation(aggNth: number = 0): Promise { - const labels = await testSubjects.findAll('aggRow'); - const label = labels[aggNth]; + public async checkFieldForAggregationValidity(aggNth: number = 0): Promise { + const fieldEl = await this.getFieldForAggregation(aggNth); - return (await label.findAllByTestSubject('comboBoxInput'))[1]; - } + return await this.comboBox.checkValidity(fieldEl); + } - public async clickColorPicker(): Promise { - const picker = await find.byCssSelector('.tvbColorPicker button'); - await picker.clickMouseButton(); - } + public async getFieldForAggregation(aggNth: number = 0): Promise { + const labels = await this.testSubjects.findAll('aggRow'); + const label = labels[aggNth]; - public async setBackgroundColor(colorHex: string): Promise { - await this.clickColorPicker(); - await this.checkColorPickerPopUpIsPresent(); - await find.setValue('.euiColorPicker input', colorHex); - await this.clickColorPicker(); - await PageObjects.visChart.waitForVisualizationRenderingStabilized(); - } + return (await label.findAllByTestSubject('comboBoxInput'))[1]; + } - public async checkColorPickerPopUpIsPresent(): Promise { - log.debug(`Check color picker popup is present`); - await testSubjects.existOrFail('colorPickerPopover', { timeout: 5000 }); - } + public async clickColorPicker(): Promise { + const picker = await this.find.byCssSelector('.tvbColorPicker button'); + await picker.clickMouseButton(); + } - public async changePanelPreview(nth: number = 0): Promise { - const prevRenderingCount = await PageObjects.visChart.getVisualizationRenderingCount(); - const changePreviewBtnArray = await testSubjects.findAll('AddActivatePanelBtn'); - await changePreviewBtnArray[nth].click(); - await PageObjects.visChart.waitForRenderingCount(prevRenderingCount + 1); - } + public async setBackgroundColor(colorHex: string): Promise { + await this.clickColorPicker(); + await this.checkColorPickerPopUpIsPresent(); + await this.find.setValue('.euiColorPicker input', colorHex); + await this.clickColorPicker(); + await this.visChart.waitForVisualizationRenderingStabilized(); + } - public async checkPreviewIsDisabled(): Promise { - log.debug(`Check no data message is present`); - await testSubjects.existOrFail('timeseriesVis > visNoResult', { timeout: 5000 }); - } + public async checkColorPickerPopUpIsPresent(): Promise { + this.log.debug(`Check color picker popup is present`); + await this.testSubjects.existOrFail('colorPickerPopover', { timeout: 5000 }); + } - public async cloneSeries(nth: number = 0): Promise { - const cloneBtnArray = await testSubjects.findAll('AddCloneBtn'); - await cloneBtnArray[nth].click(); - await PageObjects.visChart.waitForVisualizationRenderingStabilized(); - } + public async changePanelPreview(nth: number = 0): Promise { + const prevRenderingCount = await this.visChart.getVisualizationRenderingCount(); + const changePreviewBtnArray = await this.testSubjects.findAll('AddActivatePanelBtn'); + await changePreviewBtnArray[nth].click(); + await this.visChart.waitForRenderingCount(prevRenderingCount + 1); + } - /** - * Get aggregation count for the current series - * - * @param {number} [nth=0] series - * @returns {Promise} - * @memberof VisualBuilderPage - */ - public async getAggregationCount(nth: number = 0): Promise { - const series = await this.getSeries(); - const aggregation = await series[nth].findAllByTestSubject('draggable'); - return aggregation.length; - } + public async checkPreviewIsDisabled(): Promise { + this.log.debug(`Check no data message is present`); + await this.testSubjects.existOrFail('timeseriesVis > visNoResult', { timeout: 5000 }); + } - public async deleteSeries(nth: number = 0): Promise { - const prevRenderingCount = await PageObjects.visChart.getVisualizationRenderingCount(); - const cloneBtnArray = await testSubjects.findAll('AddDeleteBtn'); - await cloneBtnArray[nth].click(); - await PageObjects.visChart.waitForRenderingCount(prevRenderingCount + 1); - } + public async cloneSeries(nth: number = 0): Promise { + const cloneBtnArray = await this.testSubjects.findAll('AddCloneBtn'); + await cloneBtnArray[nth].click(); + await this.visChart.waitForVisualizationRenderingStabilized(); + } - public async getLegendItems(): Promise { - return await find.allByCssSelector('.echLegendItem'); - } + /** + * Get aggregation count for the current series + * + * @param {number} [nth=0] series + * @returns {Promise} + * @memberof VisualBuilderPage + */ + public async getAggregationCount(nth: number = 0): Promise { + const series = await this.getSeries(); + const aggregation = await series[nth].findAllByTestSubject('draggable'); + return aggregation.length; + } - public async getLegendItemsContent(): Promise { - const legendList = await find.byCssSelector('.echLegendList'); - const $ = await legendList.parseDomContent(); + public async deleteSeries(nth: number = 0): Promise { + const prevRenderingCount = await this.visChart.getVisualizationRenderingCount(); + const cloneBtnArray = await this.testSubjects.findAll('AddDeleteBtn'); + await cloneBtnArray[nth].click(); + await this.visChart.waitForRenderingCount(prevRenderingCount + 1); + } - return $('li') - .toArray() - .map((li) => { - const label = $(li).find('.echLegendItem__label').text(); - const value = $(li).find('.echLegendItem__extra').text(); + public async getLegendItems(): Promise { + return await this.find.allByCssSelector('.echLegendItem'); + } - return `${label}: ${value}`; - }); - } + public async getLegendItemsContent(): Promise { + const legendList = await this.find.byCssSelector('.echLegendList'); + const $ = await legendList.parseDomContent(); - public async getSeries(): Promise { - return await find.allByCssSelector('.tvbSeriesEditor'); - } + return $('li') + .toArray() + .map((li) => { + const label = $(li).find('.echLegendItem__label').text(); + const value = $(li).find('.echLegendItem__extra').text(); - public async setMetricsGroupByTerms(field: string) { - const groupBy = await find.byCssSelector( - '.tvbAggRow--split [data-test-subj="comboBoxInput"]' - ); - await comboBox.setElement(groupBy, 'Terms', { clickWithMouse: true }); - await PageObjects.common.sleep(1000); - const byField = await testSubjects.find('groupByField'); - await comboBox.setElement(byField, field); - } + return `${label}: ${value}`; + }); + } - public async checkSelectedMetricsGroupByValue(value: string) { - const groupBy = await find.byCssSelector( - '.tvbAggRow--split [data-test-subj="comboBoxInput"]' - ); - return await comboBox.isOptionSelected(groupBy, value); - } + public async getSeries(): Promise { + return await this.find.allByCssSelector('.tvbSeriesEditor'); + } - public async setMetricsDataTimerangeMode(value: string) { - const dataTimeRangeMode = await testSubjects.find('dataTimeRangeMode'); - return await comboBox.setElement(dataTimeRangeMode, value); - } + public async setMetricsGroupByTerms(field: string) { + const groupBy = await this.find.byCssSelector( + '.tvbAggRow--split [data-test-subj="comboBoxInput"]' + ); + await this.comboBox.setElement(groupBy, 'Terms', { clickWithMouse: true }); + await this.common.sleep(1000); + const byField = await this.testSubjects.find('groupByField'); + await this.comboBox.setElement(byField, field); + } - public async checkSelectedDataTimerangeMode(value: string) { - const dataTimeRangeMode = await testSubjects.find('dataTimeRangeMode'); - return await comboBox.isOptionSelected(dataTimeRangeMode, value); - } + public async checkSelectedMetricsGroupByValue(value: string) { + const groupBy = await this.find.byCssSelector( + '.tvbAggRow--split [data-test-subj="comboBoxInput"]' + ); + return await this.comboBox.isOptionSelected(groupBy, value); } - return new VisualBuilderPage(); + public async setMetricsDataTimerangeMode(value: string) { + const dataTimeRangeMode = await this.testSubjects.find('dataTimeRangeMode'); + return await this.comboBox.setElement(dataTimeRangeMode, value); + } + + public async checkSelectedDataTimerangeMode(value: string) { + const dataTimeRangeMode = await this.testSubjects.find('dataTimeRangeMode'); + return await this.comboBox.isOptionSelected(dataTimeRangeMode, value); + } } diff --git a/test/functional/page_objects/visualize_chart_page.ts b/test/functional/page_objects/visualize_chart_page.ts index 7b69101b92475c..c8587f4ffd3469 100644 --- a/test/functional/page_objects/visualize_chart_page.ts +++ b/test/functional/page_objects/visualize_chart_page.ts @@ -7,588 +7,620 @@ */ import { Position } from '@elastic/charts'; +import Color from 'color'; -import { FtrProviderContext } from '../ftr_provider_context'; - -const elasticChartSelector = 'visTypeXyChart'; - -export function VisualizeChartPageProvider({ getService, getPageObjects }: FtrProviderContext) { - const testSubjects = getService('testSubjects'); - const config = getService('config'); - const find = getService('find'); - const log = getService('log'); - const retry = getService('retry'); - const kibanaServer = getService('kibanaServer'); - const elasticChart = getService('elasticChart'); - const dataGrid = getService('dataGrid'); - const defaultFindTimeout = config.get('timeouts.find'); - const { common } = getPageObjects(['common']); - - class VisualizeChart { - private async getDebugState() { - return await elasticChart.getChartDebugData(elasticChartSelector); - } +import { FtrService } from '../ftr_provider_context'; - /** - * Is new charts library advanced setting enabled - */ - public async isNewChartsLibraryEnabled(): Promise { - const legacyChartsLibrary = - Boolean(await kibanaServer.uiSettings.get('visualization:visualize:legacyChartsLibrary')) ?? - true; - const enabled = !legacyChartsLibrary; - log.debug(`-- isNewChartsLibraryEnabled = ${enabled}`); - - return enabled; - } +const xyChartSelector = 'visTypeXyChart'; +const pieChartSelector = 'visTypePieChart'; - /** - * Is new charts library enabled and an area, line or histogram chart exists - */ - private async isVisTypeXYChart(): Promise { - const enabled = await this.isNewChartsLibraryEnabled(); +export class VisualizeChartPageObject extends FtrService { + private readonly testSubjects = this.ctx.getService('testSubjects'); + private readonly config = this.ctx.getService('config'); + private readonly find = this.ctx.getService('find'); + private readonly log = this.ctx.getService('log'); + private readonly retry = this.ctx.getService('retry'); + private readonly kibanaServer = this.ctx.getService('kibanaServer'); + private readonly elasticChart = this.ctx.getService('elasticChart'); + private readonly dataGrid = this.ctx.getService('dataGrid'); + private readonly common = this.ctx.getPageObject('common'); - if (!enabled) { - log.debug(`-- isVisTypeXYChart = false`); - return false; - } + private readonly defaultFindTimeout = this.config.get('timeouts.find'); - // check if enabled but not a line, area or histogram chart - if (await find.existsByCssSelector('.visLib__chart', 1)) { - const chart = await find.byCssSelector('.visLib__chart'); - const chartType = await chart.getAttribute('data-vislib-chart-type'); + public async getEsChartDebugState(chartSelector: string) { + return await this.elasticChart.getChartDebugData(chartSelector); + } - if (!['line', 'area', 'histogram'].includes(chartType)) { - log.debug(`-- isVisTypeXYChart = false`); - return false; - } - } + /** + * Is new charts library advanced setting enabled + */ + public async isNewChartsLibraryEnabled(): Promise { + const legacyChartsLibrary = + Boolean( + await this.kibanaServer.uiSettings.get('visualization:visualize:legacyChartsLibrary') + ) ?? true; + const enabled = !legacyChartsLibrary; + this.log.debug(`-- isNewChartsLibraryEnabled = ${enabled}`); + + return enabled; + } - if (!(await elasticChart.hasChart(elasticChartSelector, 1))) { - // not be a vislib chart type - log.debug(`-- isVisTypeXYChart = false`); - return false; - } + /** + * Is new charts library enabled and an area, line or histogram chart exists + */ + public async isNewLibraryChart(chartSelector: string): Promise { + const enabled = await this.isNewChartsLibraryEnabled(); - log.debug(`-- isVisTypeXYChart = true`); - return true; + if (!enabled) { + this.log.debug(`-- isNewLibraryChart = false`); + return false; } - /** - * Helper method to get expected values that are slightly different - * between vislib and elastic-chart inplementations - * @param vislibValue value expected for vislib chart - * @param elasticChartsValue value expected for `@elastic/charts` chart - */ - public async getExpectedValue(vislibValue: T, elasticChartsValue: T): Promise { - if (await this.isVisTypeXYChart()) { - return elasticChartsValue; + // check if enabled but not a line, area, histogram or pie chart + if (await this.find.existsByCssSelector('.visLib__chart', 1)) { + const chart = await this.find.byCssSelector('.visLib__chart'); + const chartType = await chart.getAttribute('data-vislib-chart-type'); + + if (!['line', 'area', 'histogram', 'pie'].includes(chartType)) { + this.log.debug(`-- isNewLibraryChart = false`); + return false; } + } - return vislibValue; + if (!(await this.elasticChart.hasChart(chartSelector, 1))) { + // not be a vislib chart type + this.log.debug(`-- isNewLibraryChart = false`); + return false; } - public async getYAxisTitle() { - if (await this.isVisTypeXYChart()) { - const xAxis = (await this.getDebugState())?.axes?.y ?? []; - return xAxis[0]?.title; - } + this.log.debug(`-- isNewLibraryChart = true`); + return true; + } - const title = await find.byCssSelector('.y-axis-div .y-axis-title text'); - return await title.getVisibleText(); + /** + * Helper method to get expected values that are slightly different + * between vislib and elastic-chart inplementations + * @param vislibValue value expected for vislib chart + * @param elasticChartsValue value expected for `@elastic/charts` chart + */ + public async getExpectedValue(vislibValue: T, elasticChartsValue: T): Promise { + if (await this.isNewLibraryChart(xyChartSelector)) { + return elasticChartsValue; } - public async getXAxisLabels() { - if (await this.isVisTypeXYChart()) { - const [xAxis] = (await this.getDebugState())?.axes?.x ?? []; - return xAxis?.labels; - } + return vislibValue; + } - const xAxis = await find.byCssSelector('.visAxis--x.visAxis__column--bottom'); - const $ = await xAxis.parseDomContent(); - return $('.x > g > text') - .toArray() - .map((tick) => $(tick).text().trim()); + public async getYAxisTitle() { + if (await this.isNewLibraryChart(xyChartSelector)) { + const xAxis = (await this.getEsChartDebugState(xyChartSelector))?.axes?.y ?? []; + return xAxis[0]?.title; } - public async getYAxisLabels() { - if (await this.isVisTypeXYChart()) { - const [yAxis] = (await this.getDebugState())?.axes?.y ?? []; - return yAxis?.labels; - } + const title = await this.find.byCssSelector('.y-axis-div .y-axis-title text'); + return await title.getVisibleText(); + } - const yAxis = await find.byCssSelector('.visAxis__column--y.visAxis__column--left'); - const $ = await yAxis.parseDomContent(); - return $('.y > g > text') - .toArray() - .map((tick) => $(tick).text().trim()); + public async getXAxisLabels() { + if (await this.isNewLibraryChart(xyChartSelector)) { + const [xAxis] = (await this.getEsChartDebugState(xyChartSelector))?.axes?.x ?? []; + return xAxis?.labels; } - public async getYAxisLabelsAsNumbers() { - if (await this.isVisTypeXYChart()) { - const [yAxis] = (await this.getDebugState())?.axes?.y ?? []; - return yAxis?.values; - } + const xAxis = await this.find.byCssSelector('.visAxis--x.visAxis__column--bottom'); + const $ = await xAxis.parseDomContent(); + return $('.x > g > text') + .toArray() + .map((tick) => $(tick).text().trim()); + } - return (await this.getYAxisLabels()).map((label) => Number(label.replace(',', ''))); + public async getYAxisLabels() { + if (await this.isNewLibraryChart(xyChartSelector)) { + const [yAxis] = (await this.getEsChartDebugState(xyChartSelector))?.axes?.y ?? []; + return yAxis?.labels; } - /** - * Gets the chart data and scales it based on chart height and label. - * @param dataLabel data-label value - * @param axis axis value, 'ValueAxis-1' by default - * - * Returns an array of height values - */ - public async getAreaChartData(dataLabel: string, axis = 'ValueAxis-1') { - if (await this.isVisTypeXYChart()) { - const areas = (await this.getDebugState())?.areas ?? []; - const points = areas.find(({ name }) => name === dataLabel)?.lines.y1.points ?? []; - return points.map(({ y }) => y); - } + const yAxis = await this.find.byCssSelector('.visAxis__column--y.visAxis__column--left'); + const $ = await yAxis.parseDomContent(); + return $('.y > g > text') + .toArray() + .map((tick) => $(tick).text().trim()); + } - const yAxisRatio = await this.getChartYAxisRatio(axis); + public async getYAxisLabelsAsNumbers() { + if (await this.isNewLibraryChart(xyChartSelector)) { + const [yAxis] = (await this.getEsChartDebugState(xyChartSelector))?.axes?.y ?? []; + return yAxis?.values; + } - const rectangle = await find.byCssSelector('rect.background'); - const yAxisHeight = Number(await rectangle.getAttribute('height')); - log.debug(`height --------- ${yAxisHeight}`); + return (await this.getYAxisLabels()).map((label) => Number(label.replace(',', ''))); + } - const path = await retry.try( - async () => - await find.byCssSelector(`path[data-label="${dataLabel}"]`, defaultFindTimeout * 2) - ); - const data = await path.getAttribute('d'); - log.debug(data); - // This area chart data starts with a 'M'ove to a x,y location, followed - // by a bunch of 'L'ines from that point to the next. Those points are - // the values we're going to use to calculate the data values we're testing. - // So git rid of the one 'M' and split the rest on the 'L's. - const tempArray = data - .replace('M ', '') - .replace('M', '') - .replace(/ L /g, 'L') - .replace(/ /g, ',') - .split('L'); - const chartSections = tempArray.length / 2; - const chartData = []; - for (let i = 0; i < chartSections; i++) { - chartData[i] = Math.round((yAxisHeight - Number(tempArray[i].split(',')[1])) * yAxisRatio); - log.debug('chartData[i] =' + chartData[i]); - } - return chartData; - } + /** + * Gets the chart data and scales it based on chart height and label. + * @param dataLabel data-label value + * @param axis axis value, 'ValueAxis-1' by default + * + * Returns an array of height values + */ + public async getAreaChartData(dataLabel: string, axis = 'ValueAxis-1') { + if (await this.isNewLibraryChart(xyChartSelector)) { + const areas = (await this.getEsChartDebugState(xyChartSelector))?.areas ?? []; + const points = areas.find(({ name }) => name === dataLabel)?.lines.y1.points ?? []; + return points.map(({ y }) => y); + } + + const yAxisRatio = await this.getChartYAxisRatio(axis); + + const rectangle = await this.find.byCssSelector('rect.background'); + const yAxisHeight = Number(await rectangle.getAttribute('height')); + this.log.debug(`height --------- ${yAxisHeight}`); + + const path = await this.retry.try( + async () => + await this.find.byCssSelector( + `path[data-label="${dataLabel}"]`, + this.defaultFindTimeout * 2 + ) + ); + const data = await path.getAttribute('d'); + this.log.debug(data); + // This area chart data starts with a 'M'ove to a x,y location, followed + // by a bunch of 'L'ines from that point to the next. Those points are + // the values we're going to use to calculate the data values we're testing. + // So git rid of the one 'M' and split the rest on the 'L's. + const tempArray = data + .replace('M ', '') + .replace('M', '') + .replace(/ L /g, 'L') + .replace(/ /g, ',') + .split('L'); + const chartSections = tempArray.length / 2; + const chartData = []; + for (let i = 0; i < chartSections; i++) { + chartData[i] = Math.round((yAxisHeight - Number(tempArray[i].split(',')[1])) * yAxisRatio); + this.log.debug('chartData[i] =' + chartData[i]); + } + return chartData; + } - /** - * Returns the paths that compose an area chart. - * @param dataLabel data-label value - */ - public async getAreaChartPaths(dataLabel: string) { - if (await this.isVisTypeXYChart()) { - const areas = (await this.getDebugState())?.areas ?? []; - const path = areas.find(({ name }) => name === dataLabel)?.path ?? ''; - return path.split('L'); - } + /** + * Returns the paths that compose an area chart. + * @param dataLabel data-label value + */ + public async getAreaChartPaths(dataLabel: string) { + if (await this.isNewLibraryChart(xyChartSelector)) { + const areas = (await this.getEsChartDebugState(xyChartSelector))?.areas ?? []; + const path = areas.find(({ name }) => name === dataLabel)?.path ?? ''; + return path.split('L'); + } + + const path = await this.retry.try( + async () => + await this.find.byCssSelector( + `path[data-label="${dataLabel}"]`, + this.defaultFindTimeout * 2 + ) + ); + const data = await path.getAttribute('d'); + this.log.debug(data); + // This area chart data starts with a 'M'ove to a x,y location, followed + // by a bunch of 'L'ines from that point to the next. Those points are + // the values we're going to use to calculate the data values we're testing. + // So git rid of the one 'M' and split the rest on the 'L's. + return data.split('L'); + } - const path = await retry.try( - async () => - await find.byCssSelector(`path[data-label="${dataLabel}"]`, defaultFindTimeout * 2) - ); - const data = await path.getAttribute('d'); - log.debug(data); - // This area chart data starts with a 'M'ove to a x,y location, followed - // by a bunch of 'L'ines from that point to the next. Those points are - // the values we're going to use to calculate the data values we're testing. - // So git rid of the one 'M' and split the rest on the 'L's. - return data.split('L'); - } + /** + * Gets the dots and normalizes their height. + * @param dataLabel data-label value + * @param axis axis value, 'ValueAxis-1' by default + */ + public async getLineChartData(dataLabel = 'Count', axis = 'ValueAxis-1') { + if (await this.isNewLibraryChart(xyChartSelector)) { + // For now lines are rendered as areas to enable stacking + const areas = (await this.getEsChartDebugState(xyChartSelector))?.areas ?? []; + const lines = areas.map(({ lines: { y1 }, name, color }) => ({ ...y1, name, color })); + const points = lines.find(({ name }) => name === dataLabel)?.points ?? []; + return points.map(({ y }) => y); + } + + // 1). get the range/pixel ratio + const yAxisRatio = await this.getChartYAxisRatio(axis); + // 2). find and save the y-axis pixel size (the chart height) + const rectangle = await this.find.byCssSelector('clipPath rect'); + const yAxisHeight = Number(await rectangle.getAttribute('height')); + // 3). get the visWrapper__chart elements + const chartTypes = await this.retry.try( + async () => + await this.find.allByCssSelector( + `.visWrapper__chart circle[data-label="${dataLabel}"][fill-opacity="1"]`, + this.defaultFindTimeout * 2 + ) + ); + // 4). for each chart element, find the green circle, then the cy position + const chartData = await Promise.all( + chartTypes.map(async (chart) => { + const cy = Number(await chart.getAttribute('cy')); + // the point_series_options test has data in the billions range and + // getting 11 digits of precision with these calculations is very hard + return Math.round(Number(((yAxisHeight - cy) * yAxisRatio).toPrecision(6))); + }) + ); + + return chartData; + } - /** - * Gets the dots and normalizes their height. - * @param dataLabel data-label value - * @param axis axis value, 'ValueAxis-1' by default - */ - public async getLineChartData(dataLabel = 'Count', axis = 'ValueAxis-1') { - if (await this.isVisTypeXYChart()) { - // For now lines are rendered as areas to enable stacking - const areas = (await this.getDebugState())?.areas ?? []; - const lines = areas.map(({ lines: { y1 }, name, color }) => ({ ...y1, name, color })); - const points = lines.find(({ name }) => name === dataLabel)?.points ?? []; - return points.map(({ y }) => y); - } + /** + * Returns bar chart data in pixels + * @param dataLabel data-label value + * @param axis axis value, 'ValueAxis-1' by default + */ + public async getBarChartData(dataLabel = 'Count', axis = 'ValueAxis-1') { + if (await this.isNewLibraryChart(xyChartSelector)) { + const bars = (await this.getEsChartDebugState(xyChartSelector))?.bars ?? []; + const values = bars.find(({ name }) => name === dataLabel)?.bars ?? []; + return values.map(({ y }) => y); + } + + const yAxisRatio = await this.getChartYAxisRatio(axis); + const svg = await this.find.byCssSelector('div.chart'); + const $ = await svg.parseDomContent(); + const chartData = $(`g > g.series > rect[data-label="${dataLabel}"]`) + .toArray() + .map((chart) => { + const barHeight = Number($(chart).attr('height')); + return Math.round(barHeight * yAxisRatio); + }); - // 1). get the range/pixel ratio - const yAxisRatio = await this.getChartYAxisRatio(axis); - // 2). find and save the y-axis pixel size (the chart height) - const rectangle = await find.byCssSelector('clipPath rect'); - const yAxisHeight = Number(await rectangle.getAttribute('height')); - // 3). get the visWrapper__chart elements - const chartTypes = await retry.try( - async () => - await find.allByCssSelector( - `.visWrapper__chart circle[data-label="${dataLabel}"][fill-opacity="1"]`, - defaultFindTimeout * 2 - ) - ); - // 4). for each chart element, find the green circle, then the cy position - const chartData = await Promise.all( - chartTypes.map(async (chart) => { - const cy = Number(await chart.getAttribute('cy')); - // the point_series_options test has data in the billions range and - // getting 11 digits of precision with these calculations is very hard - return Math.round(Number(((yAxisHeight - cy) * yAxisRatio).toPrecision(6))); - }) - ); + return chartData; + } - return chartData; - } + /** + * Returns the range/pixel ratio + * @param axis axis value, 'ValueAxis-1' by default + */ + private async getChartYAxisRatio(axis = 'ValueAxis-1') { + // 1). get the maximum chart Y-Axis marker value and Y position + const maxYAxisChartMarker = await this.retry.try( + async () => + await this.find.byCssSelector( + `div.visAxis__splitAxes--y > div > svg > g.${axis} > g:last-of-type.tick` + ) + ); + const maxYLabel = (await maxYAxisChartMarker.getVisibleText()).replace(/,/g, ''); + const maxYLabelYPosition = (await maxYAxisChartMarker.getPosition()).y; + this.log.debug(`maxYLabel = ${maxYLabel}, maxYLabelYPosition = ${maxYLabelYPosition}`); + + // 2). get the minimum chart Y-Axis marker value and Y position + const minYAxisChartMarker = await this.find.byCssSelector( + 'div.visAxis__column--y.visAxis__column--left > div > div > svg:nth-child(2) > g > g:nth-child(1).tick' + ); + const minYLabel = (await minYAxisChartMarker.getVisibleText()).replace(',', ''); + const minYLabelYPosition = (await minYAxisChartMarker.getPosition()).y; + return (Number(maxYLabel) - Number(minYLabel)) / (minYLabelYPosition - maxYLabelYPosition); + } + + public async toggleLegend(show = true) { + const isVisTypeXYChart = await this.isNewLibraryChart(xyChartSelector); + const isVisTypePieChart = await this.isNewLibraryChart(pieChartSelector); + const legendSelector = isVisTypeXYChart || isVisTypePieChart ? '.echLegend' : '.visLegend'; - /** - * Returns bar chart data in pixels - * @param dataLabel data-label value - * @param axis axis value, 'ValueAxis-1' by default - */ - public async getBarChartData(dataLabel = 'Count', axis = 'ValueAxis-1') { - if (await this.isVisTypeXYChart()) { - const bars = (await this.getDebugState())?.bars ?? []; - const values = bars.find(({ name }) => name === dataLabel)?.bars ?? []; - return values.map(({ y }) => y); + await this.retry.try(async () => { + const isVisible = await this.find.existsByCssSelector(legendSelector); + if ((show && !isVisible) || (!show && isVisible)) { + await this.testSubjects.click('vislibToggleLegend'); } + }); + } - const yAxisRatio = await this.getChartYAxisRatio(axis); - const svg = await find.byCssSelector('div.chart'); - const $ = await svg.parseDomContent(); - const chartData = $(`g > g.series > rect[data-label="${dataLabel}"]`) - .toArray() - .map((chart) => { - const barHeight = Number($(chart).attr('height')); - return Math.round(barHeight * yAxisRatio); - }); - - return chartData; - } + public async filterLegend(name: string) { + await this.toggleLegend(); + await this.testSubjects.click(`legend-${name}`); + const filterIn = await this.testSubjects.find(`legend-${name}-filterIn`); + await filterIn.click(); + await this.waitForVisualizationRenderingStabilized(); + } - /** - * Returns the range/pixel ratio - * @param axis axis value, 'ValueAxis-1' by default - */ - private async getChartYAxisRatio(axis = 'ValueAxis-1') { - // 1). get the maximum chart Y-Axis marker value and Y position - const maxYAxisChartMarker = await retry.try( - async () => - await find.byCssSelector( - `div.visAxis__splitAxes--y > div > svg > g.${axis} > g:last-of-type.tick` - ) - ); - const maxYLabel = (await maxYAxisChartMarker.getVisibleText()).replace(/,/g, ''); - const maxYLabelYPosition = (await maxYAxisChartMarker.getPosition()).y; - log.debug(`maxYLabel = ${maxYLabel}, maxYLabelYPosition = ${maxYLabelYPosition}`); + public async doesLegendColorChoiceExist(color: string) { + return await this.testSubjects.exists(`visColorPickerColor-${color}`); + } - // 2). get the minimum chart Y-Axis marker value and Y position - const minYAxisChartMarker = await find.byCssSelector( - 'div.visAxis__column--y.visAxis__column--left > div > div > svg:nth-child(2) > g > g:nth-child(1).tick' - ); - const minYLabel = (await minYAxisChartMarker.getVisibleText()).replace(',', ''); - const minYLabelYPosition = (await minYAxisChartMarker.getPosition()).y; - return (Number(maxYLabel) - Number(minYLabel)) / (minYLabelYPosition - maxYLabelYPosition); - } + public async selectNewLegendColorChoice(color: string) { + await this.testSubjects.click(`visColorPickerColor-${color}`); + } - public async toggleLegend(show = true) { - const isVisTypeXYChart = await this.isVisTypeXYChart(); - const legendSelector = isVisTypeXYChart ? '.echLegend' : '.visLegend'; + public async doesSelectedLegendColorExist(color: string) { + if (await this.isNewLibraryChart(xyChartSelector)) { + const items = (await this.getEsChartDebugState(xyChartSelector))?.legend?.items ?? []; + return items.some(({ color: c }) => c === color); + } - await retry.try(async () => { - const isVisible = await find.existsByCssSelector(legendSelector); - if ((show && !isVisible) || (!show && isVisible)) { - await testSubjects.click('vislibToggleLegend'); - } + if (await this.isNewLibraryChart(pieChartSelector)) { + const slices = + (await this.getEsChartDebugState(pieChartSelector))?.partition?.[0]?.partitions ?? []; + return slices.some(({ color: c }) => { + const rgbColor = new Color(color).rgb().toString(); + return c === rgbColor; }); } - public async filterLegend(name: string) { - await this.toggleLegend(); - await testSubjects.click(`legend-${name}`); - const filterIn = await testSubjects.find(`legend-${name}-filterIn`); - await filterIn.click(); - await this.waitForVisualizationRenderingStabilized(); - } + return await this.testSubjects.exists(`legendSelectedColor-${color}`); + } - public async doesLegendColorChoiceExist(color: string) { - return await testSubjects.exists(`visColorPickerColor-${color}`); + public async expectError() { + if (!this.isNewLibraryChart(xyChartSelector)) { + await this.testSubjects.existOrFail('vislibVisualizeError'); } + } - public async selectNewLegendColorChoice(color: string) { - await testSubjects.click(`visColorPickerColor-${color}`); - } + public async getVisualizationRenderingCount() { + const visualizationLoader = await this.testSubjects.find('visualizationLoader'); + const renderingCount = await visualizationLoader.getAttribute('data-rendering-count'); + return Number(renderingCount); + } - public async doesSelectedLegendColorExist(color: string) { - if (await this.isVisTypeXYChart()) { - const items = (await this.getDebugState())?.legend?.items ?? []; - return items.some(({ color: c }) => c === color); + public async waitForRenderingCount(minimumCount = 1) { + await this.retry.waitFor( + `rendering count to be greater than or equal to [${minimumCount}]`, + async () => { + const currentRenderingCount = await this.getVisualizationRenderingCount(); + this.log.debug(`-- currentRenderingCount=${currentRenderingCount}`); + this.log.debug(`-- expectedCount=${minimumCount}`); + return currentRenderingCount >= minimumCount; } + ); + } - return await testSubjects.exists(`legendSelectedColor-${color}`); - } + public async waitForVisualizationRenderingStabilized() { + // assuming rendering is done when data-rendering-count is constant within 1000 ms + await this.retry.waitFor('rendering count to stabilize', async () => { + const firstCount = await this.getVisualizationRenderingCount(); + this.log.debug(`-- firstCount=${firstCount}`); - public async expectError() { - if (!this.isVisTypeXYChart()) { - await testSubjects.existOrFail('vislibVisualizeError'); - } - } + await this.common.sleep(2000); - public async getVisualizationRenderingCount() { - const visualizationLoader = await testSubjects.find('visualizationLoader'); - const renderingCount = await visualizationLoader.getAttribute('data-rendering-count'); - return Number(renderingCount); - } + const secondCount = await this.getVisualizationRenderingCount(); + this.log.debug(`-- secondCount=${secondCount}`); - public async waitForRenderingCount(minimumCount = 1) { - await retry.waitFor( - `rendering count to be greater than or equal to [${minimumCount}]`, - async () => { - const currentRenderingCount = await this.getVisualizationRenderingCount(); - log.debug(`-- currentRenderingCount=${currentRenderingCount}`); - log.debug(`-- expectedCount=${minimumCount}`); - return currentRenderingCount >= minimumCount; - } - ); - } - - public async waitForVisualizationRenderingStabilized() { - // assuming rendering is done when data-rendering-count is constant within 1000 ms - await retry.waitFor('rendering count to stabilize', async () => { - const firstCount = await this.getVisualizationRenderingCount(); - log.debug(`-- firstCount=${firstCount}`); - - await common.sleep(2000); + return firstCount === secondCount; + }); + } - const secondCount = await this.getVisualizationRenderingCount(); - log.debug(`-- secondCount=${secondCount}`); + public async waitForVisualization() { + await this.waitForVisualizationRenderingStabilized(); - return firstCount === secondCount; - }); + if (!(await this.isNewLibraryChart(xyChartSelector))) { + await this.find.byCssSelector('.visualization'); } + } - public async waitForVisualization() { - await this.waitForVisualizationRenderingStabilized(); - - if (!(await this.isVisTypeXYChart())) { - await find.byCssSelector('.visualization'); - } + public async getLegendEntries() { + const isVisTypeXYChart = await this.isNewLibraryChart(xyChartSelector); + const isVisTypePieChart = await this.isNewLibraryChart(pieChartSelector); + if (isVisTypeXYChart) { + const items = (await this.getEsChartDebugState(xyChartSelector))?.legend?.items ?? []; + return items.map(({ name }) => name); } - public async getLegendEntries() { - if (await this.isVisTypeXYChart()) { - const items = (await this.getDebugState())?.legend?.items ?? []; - return items.map(({ name }) => name); - } - - const legendEntries = await find.allByCssSelector( - '.visLegend__button', - defaultFindTimeout * 2 - ); - return await Promise.all( - legendEntries.map(async (chart) => await chart.getAttribute('data-label')) - ); + if (isVisTypePieChart) { + const slices = + (await this.getEsChartDebugState(pieChartSelector))?.partition?.[0]?.partitions ?? []; + return slices.map(({ name }) => name); } - public async openLegendOptionColors(name: string, chartSelector = elasticChartSelector) { - await this.waitForVisualizationRenderingStabilized(); - await retry.try(async () => { - if (await this.isVisTypeXYChart()) { - const chart = await find.byCssSelector(chartSelector); - const legendItemColor = await chart.findByCssSelector( - `[data-ech-series-name="${name}"] .echLegendItem__color` - ); - legendItemColor.click(); - } else { - // This click has been flaky in opening the legend, hence the retry. See - // https://github.com/elastic/kibana/issues/17468 - await testSubjects.click(`legend-${name}`); - } - - await this.waitForVisualizationRenderingStabilized(); - // arbitrary color chosen, any available would do - const arbitraryColor = (await this.isVisTypeXYChart()) ? '#d36086' : '#EF843C'; - const isOpen = await this.doesLegendColorChoiceExist(arbitraryColor); - if (!isOpen) { - throw new Error('legend color selector not open'); - } - }); - } + const legendEntries = await this.find.allByCssSelector( + '.visLegend__button', + this.defaultFindTimeout * 2 + ); + return await Promise.all( + legendEntries.map(async (chart) => await chart.getAttribute('data-label')) + ); + } - public async filterOnTableCell(columnIndex: number, rowIndex: number) { - await retry.try(async () => { - const cell = await dataGrid.getCellElement(rowIndex, columnIndex); - await cell.click(); - const filterBtn = await testSubjects.findDescendant( - 'tbvChartCell__filterForCellValue', - cell + public async openLegendOptionColors(name: string, chartSelector: string) { + await this.waitForVisualizationRenderingStabilized(); + await this.retry.try(async () => { + if ( + (await this.isNewLibraryChart(xyChartSelector)) || + (await this.isNewLibraryChart(pieChartSelector)) + ) { + const chart = await this.find.byCssSelector(chartSelector); + const legendItemColor = await chart.findByCssSelector( + `[data-ech-series-name="${name}"] .echLegendItem__color` ); - await common.sleep(2000); - filterBtn.click(); - }); - } + legendItemColor.click(); + } else { + // This click has been flaky in opening the legend, hence the this.retry. See + // https://github.com/elastic/kibana/issues/17468 + await this.testSubjects.click(`legend-${name}`); + } - public async getMarkdownText() { - const markdownContainer = await testSubjects.find('markdownBody'); - return markdownContainer.getVisibleText(); - } + await this.waitForVisualizationRenderingStabilized(); + // arbitrary color chosen, any available would do + const arbitraryColor = (await this.isNewLibraryChart(xyChartSelector)) + ? '#d36086' + : '#EF843C'; + const isOpen = await this.doesLegendColorChoiceExist(arbitraryColor); + if (!isOpen) { + throw new Error('legend color selector not open'); + } + }); + } - public async getMarkdownBodyDescendentText(selector: string) { - const markdownContainer = await testSubjects.find('markdownBody'); - const element = await find.descendantDisplayedByCssSelector(selector, markdownContainer); - return element.getVisibleText(); - } + public async filterOnTableCell(columnIndex: number, rowIndex: number) { + await this.retry.try(async () => { + const cell = await this.dataGrid.getCellElement(rowIndex, columnIndex); + await cell.click(); + const filterBtn = await this.testSubjects.findDescendant( + 'tbvChartCell__filterForCellValue', + cell + ); + await this.common.sleep(2000); + filterBtn.click(); + }); + } - // Table visualization + public async getMarkdownText() { + const markdownContainer = await this.testSubjects.find('markdownBody'); + return markdownContainer.getVisibleText(); + } - public async getTableVisNoResult() { - return await testSubjects.find('tbvChartContainer>visNoResult'); - } + public async getMarkdownBodyDescendentText(selector: string) { + const markdownContainer = await this.testSubjects.find('markdownBody'); + const element = await this.find.descendantDisplayedByCssSelector(selector, markdownContainer); + return element.getVisibleText(); + } - /** - * This function returns the text displayed in the Table Vis header - */ - public async getTableVisHeader() { - return await testSubjects.getVisibleText('dataGridHeader'); - } + // Table visualization - public async getFieldLinkInVisTable(fieldName: string, rowIndex: number = 1) { - const headers = await dataGrid.getHeaders(); - const fieldColumnIndex = headers.indexOf(fieldName); - const cell = await dataGrid.getCellElement(rowIndex, fieldColumnIndex + 1); - return await cell.findByTagName('a'); - } + public async getTableVisNoResult() { + return await this.testSubjects.find('tbvChartContainer>visNoResult'); + } - /** - * Function to retrieve data from within a table visualization. - */ - public async getTableVisContent({ stripEmptyRows = true } = {}) { - return await retry.try(async () => { - const container = await testSubjects.find('tbvChart'); - const allTables = await testSubjects.findAllDescendant('dataGridWrapper', container); - - if (allTables.length === 0) { - return []; - } - - const allData = await Promise.all( - allTables.map(async (t) => { - let data = await dataGrid.getDataFromElement(t, 'tbvChartCellContent'); - if (stripEmptyRows) { - data = data.filter( - (row) => row.length > 0 && row.some((cell) => cell.trim().length > 0) - ); - } - return data; - }) - ); + /** + * This function returns the text displayed in the Table Vis header + */ + public async getTableVisHeader() { + return await this.testSubjects.getVisibleText('dataGridHeader'); + } - if (allTables.length === 1) { - // If there was only one table we return only the data for that table - // This prevents an unnecessary array around that single table, which - // is the case we have in most tests. - return allData[0]; - } + public async getFieldLinkInVisTable(fieldName: string, rowIndex: number = 1) { + const headers = await this.dataGrid.getHeaders(); + const fieldColumnIndex = headers.indexOf(fieldName); + const cell = await this.dataGrid.getCellElement(rowIndex, fieldColumnIndex + 1); + return await cell.findByTagName('a'); + } - return allData; - }); - } + /** + * Function to retrieve data from within a table visualization. + */ + public async getTableVisContent({ stripEmptyRows = true } = {}) { + return await this.retry.try(async () => { + const container = await this.testSubjects.find('tbvChart'); + const allTables = await this.testSubjects.findAllDescendant('dataGridWrapper', container); - public async getMetric() { - const elements = await find.allByCssSelector( - '[data-test-subj="visualizationLoader"] .mtrVis__container' - ); - const values = await Promise.all( - elements.map(async (element) => { - const text = await element.getVisibleText(); - return text; - }) - ); - return values - .filter((item) => item.length > 0) - .reduce((arr: string[], item) => arr.concat(item.split('\n')), []); - } + if (allTables.length === 0) { + return []; + } - public async getGaugeValue() { - const elements = await find.allByCssSelector( - '[data-test-subj="visualizationLoader"] .chart svg text' - ); - const values = await Promise.all( - elements.map(async (element) => { - const text = await element.getVisibleText(); - return text; + const allData = await Promise.all( + allTables.map(async (t) => { + let data = await this.dataGrid.getDataFromElement(t, 'tbvChartCellContent'); + if (stripEmptyRows) { + data = data.filter( + (row) => row.length > 0 && row.some((cell) => cell.trim().length > 0) + ); + } + return data; }) ); - return values.filter((item) => item.length > 0); - } - public async getRightValueAxesCount() { - if (await this.isVisTypeXYChart()) { - const yAxes = (await this.getDebugState())?.axes?.y ?? []; - return yAxes.filter(({ position }) => position === Position.Right).length; + if (allTables.length === 1) { + // If there was only one table we return only the data for that table + // This prevents an unnecessary array around that single table, which + // is the case we have in most tests. + return allData[0]; } - const axes = await find.allByCssSelector('.visAxis__column--right g.axis'); - return axes.length; - } - public async clickOnGaugeByLabel(label: string) { - const gauge = await testSubjects.find(`visGauge__meter--${label}`); - const gaugeSize = await gauge.getSize(); - const gaugeHeight = gaugeSize.height; - // To click at Gauge arc instead of the center of SVG element - // the offset for a click is calculated as half arc height without 1 pixel - const yOffset = 1 - Math.floor(gaugeHeight / 2); + return allData; + }); + } - await gauge.clickMouseButton({ xOffset: 0, yOffset }); - } + public async getMetric() { + const elements = await this.find.allByCssSelector( + '[data-test-subj="visualizationLoader"] .mtrVis__container' + ); + const values = await Promise.all( + elements.map(async (element) => { + const text = await element.getVisibleText(); + return text; + }) + ); + return values + .filter((item) => item.length > 0) + .reduce((arr: string[], item) => arr.concat(item.split('\n')), []); + } - public async getHistogramSeriesCount() { - if (await this.isVisTypeXYChart()) { - const bars = (await this.getDebugState())?.bars ?? []; - return bars.filter(({ visible }) => visible).length; - } + public async getGaugeValue() { + const elements = await this.find.allByCssSelector( + '[data-test-subj="visualizationLoader"] .chart svg text' + ); + const values = await Promise.all( + elements.map(async (element) => { + const text = await element.getVisibleText(); + return text; + }) + ); + return values.filter((item) => item.length > 0); + } - const series = await find.allByCssSelector('.series.histogram'); - return series.length; + public async getRightValueAxesCount() { + if (await this.isNewLibraryChart(xyChartSelector)) { + const yAxes = (await this.getEsChartDebugState(xyChartSelector))?.axes?.y ?? []; + return yAxes.filter(({ position }) => position === Position.Right).length; } + const axes = await this.find.allByCssSelector('.visAxis__column--right g.axis'); + return axes.length; + } - public async getGridLines(): Promise> { - if (await this.isVisTypeXYChart()) { - const { x, y } = (await this.getDebugState())?.axes ?? { x: [], y: [] }; - return [...x, ...y].flatMap(({ gridlines }) => gridlines); - } + public async clickOnGaugeByLabel(label: string) { + const gauge = await this.testSubjects.find(`visGauge__meter--${label}`); + const gaugeSize = await gauge.getSize(); + const gaugeHeight = gaugeSize.height; + // To click at Gauge arc instead of the center of SVG element + // the offset for a click is calculated as half arc height without 1 pixel + const yOffset = 1 - Math.floor(gaugeHeight / 2); - const grid = await find.byCssSelector('g.grid'); - const $ = await grid.parseDomContent(); - return $('path') - .toArray() - .map((line) => { - const dAttribute = $(line).attr('d'); - const firstPoint = dAttribute.split('L')[0].replace('M', '').split(','); - return { - x: parseFloat(firstPoint[0]), - y: parseFloat(firstPoint[1]), - }; - }); + await gauge.clickMouseButton({ xOffset: 0, yOffset }); + } + + public async getHistogramSeriesCount() { + if (await this.isNewLibraryChart(xyChartSelector)) { + const bars = (await this.getEsChartDebugState(xyChartSelector))?.bars ?? []; + return bars.filter(({ visible }) => visible).length; } - public async getChartValues() { - if (await this.isVisTypeXYChart()) { - const barSeries = (await this.getDebugState())?.bars ?? []; - return barSeries.filter(({ visible }) => visible).flatMap((bars) => bars.labels); - } + const series = await this.find.allByCssSelector('.series.histogram'); + return series.length; + } - const elements = await find.allByCssSelector('.series.histogram text'); - const values = await Promise.all( - elements.map(async (element) => { - const text = await element.getVisibleText(); - return text; - }) - ); - return values; - } + public async getGridLines(): Promise> { + if (await this.isNewLibraryChart(xyChartSelector)) { + const { x, y } = (await this.getEsChartDebugState(xyChartSelector))?.axes ?? { + x: [], + y: [], + }; + return [...x, ...y].flatMap(({ gridlines }) => gridlines); + } + + const grid = await this.find.byCssSelector('g.grid'); + const $ = await grid.parseDomContent(); + return $('path') + .toArray() + .map((line) => { + const dAttribute = $(line).attr('d'); + const firstPoint = dAttribute.split('L')[0].replace('M', '').split(','); + return { + x: parseFloat(firstPoint[0]), + y: parseFloat(firstPoint[1]), + }; + }); } - return new VisualizeChart(); + public async getChartValues() { + if (await this.isNewLibraryChart(xyChartSelector)) { + const barSeries = (await this.getEsChartDebugState(xyChartSelector))?.bars ?? []; + return barSeries.filter(({ visible }) => visible).flatMap((bars) => bars.labels); + } + + const elements = await this.find.allByCssSelector('.series.histogram text'); + const values = await Promise.all( + elements.map(async (element) => { + const text = await element.getVisibleText(); + return text; + }) + ); + return values; + } } diff --git a/test/functional/page_objects/visualize_editor_page.ts b/test/functional/page_objects/visualize_editor_page.ts index 59e93bd1f57007..ab458c2c0fdc12 100644 --- a/test/functional/page_objects/visualize_editor_page.ts +++ b/test/functional/page_objects/visualize_editor_page.ts @@ -6,528 +6,530 @@ * Side Public License, v 1. */ -import expect from '@kbn/expect/expect.js'; -import { FtrProviderContext } from '../ftr_provider_context'; - -export function VisualizeEditorPageProvider({ getService, getPageObjects }: FtrProviderContext) { - const find = getService('find'); - const log = getService('log'); - const retry = getService('retry'); - const browser = getService('browser'); - const testSubjects = getService('testSubjects'); - const comboBox = getService('comboBox'); - const elasticChart = getService('elasticChart'); - const { common, header, visChart } = getPageObjects(['common', 'header', 'visChart']); - - interface IntervalOptions { - type?: 'default' | 'numeric' | 'custom'; - aggNth?: number; - append?: boolean; - } - - class VisualizeEditorPage { - public async clickDataTab() { - await testSubjects.click('visEditorTab__data'); - } +import expect from '@kbn/expect'; +import { FtrService } from '../ftr_provider_context'; - public async clickOptionsTab() { - await testSubjects.click('visEditorTab__options'); - } +interface IntervalOptions { + type?: 'default' | 'numeric' | 'custom'; + aggNth?: number; + append?: boolean; +} - public async clickMetricsAndAxes() { - await testSubjects.click('visEditorTab__advanced'); - } +export class VisualizeEditorPageObject extends FtrService { + private readonly find = this.ctx.getService('find'); + private readonly log = this.ctx.getService('log'); + private readonly retry = this.ctx.getService('retry'); + private readonly browser = this.ctx.getService('browser'); + private readonly testSubjects = this.ctx.getService('testSubjects'); + private readonly comboBox = this.ctx.getService('comboBox'); + private readonly elasticChart = this.ctx.getService('elasticChart'); + private readonly common = this.ctx.getPageObject('common'); + private readonly header = this.ctx.getPageObject('header'); + private readonly visChart = this.ctx.getPageObject('visChart'); + + public async clickDataTab() { + await this.testSubjects.click('visEditorTab__data'); + } - public async clickVisEditorTab(tabName: string) { - await testSubjects.click(`visEditorTab__${tabName}`); - await header.waitUntilLoadingHasFinished(); - } + public async clickOptionsTab() { + await this.testSubjects.click('visEditorTab__options'); + } - public async addInputControl(type?: string) { - if (type) { - const selectInput = await testSubjects.find('selectControlType'); - await selectInput.type(type); - } - await testSubjects.click('inputControlEditorAddBtn'); - await header.waitUntilLoadingHasFinished(); - } + public async clickMetricsAndAxes() { + await this.testSubjects.click('visEditorTab__advanced'); + } - public async inputControlClear() { - await testSubjects.click('inputControlClearBtn'); - await header.waitUntilLoadingHasFinished(); - } + public async clickVisEditorTab(tabName: string) { + await this.testSubjects.click(`visEditorTab__${tabName}`); + await this.header.waitUntilLoadingHasFinished(); + } - public async inputControlSubmit() { - await testSubjects.clickWhenNotDisabled('inputControlSubmitBtn'); - await visChart.waitForVisualizationRenderingStabilized(); + public async addInputControl(type?: string) { + if (type) { + const selectInput = await this.testSubjects.find('selectControlType'); + await selectInput.type(type); } + await this.testSubjects.click('inputControlEditorAddBtn'); + await this.header.waitUntilLoadingHasFinished(); + } - public async clickGo() { - if (await visChart.isNewChartsLibraryEnabled()) { - await elasticChart.setNewChartUiDebugFlag(); - } + public async inputControlClear() { + await this.testSubjects.click('inputControlClearBtn'); + await this.header.waitUntilLoadingHasFinished(); + } - const prevRenderingCount = await visChart.getVisualizationRenderingCount(); - log.debug(`Before Rendering count ${prevRenderingCount}`); - await testSubjects.clickWhenNotDisabled('visualizeEditorRenderButton'); - await visChart.waitForRenderingCount(prevRenderingCount + 1); - } + public async inputControlSubmit() { + await this.testSubjects.clickWhenNotDisabled('inputControlSubmitBtn'); + await this.visChart.waitForVisualizationRenderingStabilized(); + } - public async removeDimension(aggNth: number) { - await testSubjects.click(`visEditorAggAccordion${aggNth} > removeDimensionBtn`); + public async clickGo() { + if (await this.visChart.isNewChartsLibraryEnabled()) { + await this.elasticChart.setNewChartUiDebugFlag(); } - public async setFilterParams(aggNth: number, indexPattern: string, field: string) { - await comboBox.set(`indexPatternSelect-${aggNth}`, indexPattern); - await comboBox.set(`fieldSelect-${aggNth}`, field); - } + const prevRenderingCount = await this.visChart.getVisualizationRenderingCount(); + this.log.debug(`Before Rendering count ${prevRenderingCount}`); + await this.testSubjects.clickWhenNotDisabled('visualizeEditorRenderButton'); + await this.visChart.waitForRenderingCount(prevRenderingCount + 1); + } - public async setFilterRange(aggNth: number, min: string, max: string) { - const control = await testSubjects.find(`inputControl${aggNth}`); - const inputMin = await control.findByCssSelector('[name$="minValue"]'); - await inputMin.type(min); - const inputMax = await control.findByCssSelector('[name$="maxValue"]'); - await inputMax.type(max); - } + public async removeDimension(aggNth: number) { + await this.testSubjects.click(`visEditorAggAccordion${aggNth} > removeDimensionBtn`); + } - public async clickSplitDirection(direction: string) { - const radioBtn = await find.byCssSelector(`[data-test-subj="visEditorSplitBy-${direction}"]`); - await radioBtn.click(); - } + public async setFilterParams(aggNth: number, indexPattern: string, field: string) { + await this.comboBox.set(`indexPatternSelect-${aggNth}`, indexPattern); + await this.comboBox.set(`fieldSelect-${aggNth}`, field); + } - public async clickAddDateRange() { - await testSubjects.click(`visEditorAddDateRange`); - } + public async setFilterRange(aggNth: number, min: string, max: string) { + const control = await this.testSubjects.find(`inputControl${aggNth}`); + const inputMin = await control.findByCssSelector('[name$="minValue"]'); + await inputMin.type(min); + const inputMax = await control.findByCssSelector('[name$="maxValue"]'); + await inputMax.type(max); + } - public async setDateRangeByIndex(index: string, from: string, to: string) { - await testSubjects.setValue(`visEditorDateRange${index}__from`, from); - await testSubjects.setValue(`visEditorDateRange${index}__to`, to); - } + public async clickSplitDirection(direction: string) { + const radioBtn = await this.find.byCssSelector( + `[data-test-subj="visEditorSplitBy-${direction}"]` + ); + await radioBtn.click(); + } - /** - * Adds new bucket - * @param bucketName bucket name, like 'X-axis', 'Split rows', 'Split series' - * @param type aggregation type, like 'buckets', 'metrics' - */ - public async clickBucket(bucketName: string, type = 'buckets') { - await testSubjects.click(`visEditorAdd_${type}`); - await testSubjects.click(`visEditorAdd_${type}_${bucketName}`); - } + public async clickAddDateRange() { + await this.testSubjects.click(`visEditorAddDateRange`); + } - public async clickEnableCustomRanges() { - await testSubjects.click('heatmapUseCustomRanges'); - } + public async setDateRangeByIndex(index: string, from: string, to: string) { + await this.testSubjects.setValue(`visEditorDateRange${index}__from`, from); + await this.testSubjects.setValue(`visEditorDateRange${index}__to`, to); + } - public async clickAddRange() { - await testSubjects.click(`heatmapColorRange__addRangeButton`); - } + /** + * Adds new bucket + * @param bucketName bucket name, like 'X-axis', 'Split rows', 'Split series' + * @param type aggregation type, like 'buckets', 'metrics' + */ + public async clickBucket(bucketName: string, type = 'buckets') { + await this.testSubjects.click(`visEditorAdd_${type}`); + await this.testSubjects.click(`visEditorAdd_${type}_${bucketName}`); + } - public async setCustomRangeByIndex(index: string | number, from: string, to: string) { - await testSubjects.setValue(`heatmapColorRange${index}__from`, from); - await testSubjects.setValue(`heatmapColorRange${index}__to`, to); - } + public async clickEnableCustomRanges() { + await this.testSubjects.click('heatmapUseCustomRanges'); + } - public async changeHeatmapColorNumbers(value = 6) { - await testSubjects.setValue('heatmapColorsNumber', `${value}`); - } + public async clickAddRange() { + await this.testSubjects.click(`heatmapColorRange__addRangeButton`); + } - public async getBucketErrorMessage() { - const error = await find.byCssSelector( - '[data-test-subj="bucketsAggGroup"] [data-test-subj="defaultEditorAggSelect"] + .euiFormErrorText' - ); - const errorMessage = await error.getAttribute('innerText'); - log.debug(errorMessage); - return errorMessage; - } + public async setCustomRangeByIndex(index: string | number, from: string, to: string) { + await this.testSubjects.setValue(`heatmapColorRange${index}__from`, from); + await this.testSubjects.setValue(`heatmapColorRange${index}__to`, to); + } - public async addNewFilterAggregation() { - await testSubjects.click('visEditorAddFilterButton'); - } + public async changeHeatmapColorNumbers(value = 6) { + await this.testSubjects.setValue('heatmapColorsNumber', `${value}`); + } - public async selectField( - fieldValue: string, - groupName = 'buckets', - isChildAggregation = false - ) { - log.debug(`selectField ${fieldValue}`); - const selector = ` - [data-test-subj="${groupName}AggGroup"] - [data-test-subj^="visEditorAggAccordion"].euiAccordion-isOpen - [data-test-subj="visAggEditorParams"] - ${isChildAggregation ? '.visEditorAgg__subAgg' : ''} - [data-test-subj="visDefaultEditorField"] - `; - const fieldEl = await find.byCssSelector(selector); - await comboBox.setElement(fieldEl, fieldValue); - } + public async getBucketErrorMessage() { + const error = await this.find.byCssSelector( + '[data-test-subj="bucketsAggGroup"] [data-test-subj="defaultEditorAggSelect"] + .euiFormErrorText' + ); + const errorMessage = await error.getAttribute('innerText'); + this.log.debug(errorMessage); + return errorMessage; + } - public async selectOrderByMetric(aggNth: number, metric: string) { - const sortSelect = await testSubjects.find(`visEditorOrderBy${aggNth}`); - const sortMetric = await sortSelect.findByCssSelector(`option[value="${metric}"]`); - await sortMetric.click(); - } + public async addNewFilterAggregation() { + await this.testSubjects.click('visEditorAddFilterButton'); + } - public async selectCustomSortMetric(aggNth: number, metric: string, field: string) { - await this.selectOrderByMetric(aggNth, 'custom'); - await this.selectAggregation(metric, 'buckets', true); - await this.selectField(field, 'buckets', true); - } + public async selectField(fieldValue: string, groupName = 'buckets', isChildAggregation = false) { + this.log.debug(`selectField ${fieldValue}`); + const selector = ` + [data-test-subj="${groupName}AggGroup"] + [data-test-subj^="visEditorAggAccordion"].euiAccordion-isOpen + [data-test-subj="visAggEditorParams"] + ${isChildAggregation ? '.visEditorAgg__subAgg' : ''} + [data-test-subj="visDefaultEditorField"] + `; + const fieldEl = await this.find.byCssSelector(selector); + await this.comboBox.setElement(fieldEl, fieldValue); + } - public async selectAggregation( - aggValue: string, - groupName = 'buckets', - isChildAggregation = false - ) { - const comboBoxElement = await find.byCssSelector(` - [data-test-subj="${groupName}AggGroup"] - [data-test-subj^="visEditorAggAccordion"].euiAccordion-isOpen - ${isChildAggregation ? '.visEditorAgg__subAgg' : ''} - [data-test-subj="defaultEditorAggSelect"] - `); - - await comboBox.setElement(comboBoxElement, aggValue); - await common.sleep(500); - } + public async selectOrderByMetric(aggNth: number, metric: string) { + const sortSelect = await this.testSubjects.find(`visEditorOrderBy${aggNth}`); + const sortMetric = await sortSelect.findByCssSelector(`option[value="${metric}"]`); + await sortMetric.click(); + } - /** - * Set the test for a filter aggregation. - * @param {*} filterValue the string value of the filter - * @param {*} filterIndex used when multiple filters are configured on the same aggregation - * @param {*} aggregationId the ID if the aggregation. On Tests, it start at from 2 - */ - public async setFilterAggregationValue( - filterValue: string, - filterIndex = 0, - aggregationId = 2 - ) { - await testSubjects.setValue( - `visEditorFilterInput_${aggregationId}_${filterIndex}`, - filterValue - ); - } + public async selectCustomSortMetric(aggNth: number, metric: string, field: string) { + await this.selectOrderByMetric(aggNth, 'custom'); + await this.selectAggregation(metric, 'buckets', true); + await this.selectField(field, 'buckets', true); + } - public async setValue(newValue: string) { - const input = await find.byCssSelector('[data-test-subj="visEditorPercentileRanks"] input'); - await input.clearValue(); - await input.type(newValue); - } + public async selectAggregation( + aggValue: string, + groupName = 'buckets', + isChildAggregation = false + ) { + const comboBoxElement = await this.find.byCssSelector(` + [data-test-subj="${groupName}AggGroup"] + [data-test-subj^="visEditorAggAccordion"].euiAccordion-isOpen + ${isChildAggregation ? '.visEditorAgg__subAgg' : ''} + [data-test-subj="defaultEditorAggSelect"] + `); + + await this.comboBox.setElement(comboBoxElement, aggValue); + await this.common.sleep(500); + } - public async clickEditorSidebarCollapse() { - await testSubjects.click('collapseSideBarButton'); - } + /** + * Set the test for a filter aggregation. + * @param {*} filterValue the string value of the filter + * @param {*} filterIndex used when multiple filters are configured on the same aggregation + * @param {*} aggregationId the ID if the aggregation. On Tests, it start at from 2 + */ + public async setFilterAggregationValue(filterValue: string, filterIndex = 0, aggregationId = 2) { + await this.testSubjects.setValue( + `visEditorFilterInput_${aggregationId}_${filterIndex}`, + filterValue + ); + } - public async clickDropPartialBuckets() { - await testSubjects.click('dropPartialBucketsCheckbox'); - } + public async setValue(newValue: string) { + const input = await this.find.byCssSelector( + '[data-test-subj="visEditorPercentileRanks"] input' + ); + await input.clearValue(); + await input.type(newValue); + } - public async expectMarkdownTextArea() { - await testSubjects.existOrFail('markdownTextarea'); - } + public async clickEditorSidebarCollapse() { + await this.testSubjects.click('collapseSideBarButton'); + } - public async setMarkdownTxt(markdownTxt: string) { - const input = await testSubjects.find('markdownTextarea'); - await input.clearValue(); - await input.type(markdownTxt); - } + public async clickDropPartialBuckets() { + await this.testSubjects.click('dropPartialBucketsCheckbox'); + } - public async isSwitchChecked(selector: string) { - const checkbox = await testSubjects.find(selector); - const isChecked = await checkbox.getAttribute('aria-checked'); - return isChecked === 'true'; - } + public async expectMarkdownTextArea() { + await this.testSubjects.existOrFail('markdownTextarea'); + } - public async checkSwitch(selector: string) { - const isChecked = await this.isSwitchChecked(selector); - if (!isChecked) { - log.debug(`checking switch ${selector}`); - await testSubjects.click(selector); - } - } + public async setMarkdownTxt(markdownTxt: string) { + const input = await this.testSubjects.find('markdownTextarea'); + await input.clearValue(); + await input.type(markdownTxt); + } - public async uncheckSwitch(selector: string) { - const isChecked = await this.isSwitchChecked(selector); - if (isChecked) { - log.debug(`unchecking switch ${selector}`); - await testSubjects.click(selector); - } - } + public async isSwitchChecked(selector: string) { + const checkbox = await this.testSubjects.find(selector); + const isChecked = await checkbox.getAttribute('aria-checked'); + return isChecked === 'true'; + } - public async setIsFilteredByCollarCheckbox(value = true) { - await retry.try(async () => { - const isChecked = await this.isSwitchChecked('isFilteredByCollarCheckbox'); - if (isChecked !== value) { - await testSubjects.click('isFilteredByCollarCheckbox'); - throw new Error('isFilteredByCollar not set correctly'); - } - }); + public async checkSwitch(selector: string) { + const isChecked = await this.isSwitchChecked(selector); + if (!isChecked) { + this.log.debug(`checking switch ${selector}`); + await this.testSubjects.click(selector); } + } - public async setCustomLabel(label: string, index: number | string = 1) { - const customLabel = await testSubjects.find(`visEditorStringInput${index}customLabel`); - customLabel.type(label); + public async uncheckSwitch(selector: string) { + const isChecked = await this.isSwitchChecked(selector); + if (isChecked) { + this.log.debug(`unchecking switch ${selector}`); + await this.testSubjects.click(selector); } + } - public async selectYAxisAggregation(agg: string, field: string, label: string, index = 1) { - // index starts on the first "count" metric at 1 - // Each new metric or aggregation added to a visualization gets the next index. - // So to modify a metric or aggregation tests need to keep track of the - // order they are added. - await this.toggleOpenEditor(index); + public async setIsFilteredByCollarCheckbox(value = true) { + await this.retry.try(async () => { + const isChecked = await this.isSwitchChecked('isFilteredByCollarCheckbox'); + if (isChecked !== value) { + await this.testSubjects.click('isFilteredByCollarCheckbox'); + throw new Error('isFilteredByCollar not set correctly'); + } + }); + } - // select our agg - const aggSelect = await find.byCssSelector( - `#visEditorAggAccordion${index} [data-test-subj="defaultEditorAggSelect"]` - ); - await comboBox.setElement(aggSelect, agg); + public async setCustomLabel(label: string, index: number | string = 1) { + const customLabel = await this.testSubjects.find(`visEditorStringInput${index}customLabel`); + customLabel.type(label); + } - const fieldSelect = await find.byCssSelector( - `#visEditorAggAccordion${index} [data-test-subj="visDefaultEditorField"]` - ); - // select our field - await comboBox.setElement(fieldSelect, field); - // enter custom label - await this.setCustomLabel(label, index); - } + public async selectYAxisAggregation(agg: string, field: string, label: string, index = 1) { + // index starts on the first "count" metric at 1 + // Each new metric or aggregation added to a visualization gets the next index. + // So to modify a metric or aggregation tests need to keep track of the + // order they are added. + await this.toggleOpenEditor(index); + + // select our agg + const aggSelect = await this.find.byCssSelector( + `#visEditorAggAccordion${index} [data-test-subj="defaultEditorAggSelect"]` + ); + await this.comboBox.setElement(aggSelect, agg); + + const fieldSelect = await this.find.byCssSelector( + `#visEditorAggAccordion${index} [data-test-subj="visDefaultEditorField"]` + ); + // select our field + await this.comboBox.setElement(fieldSelect, field); + // enter custom label + await this.setCustomLabel(label, index); + } - public async getField() { - return await comboBox.getComboBoxSelectedOptions('visDefaultEditorField'); - } + public async getField() { + return await this.comboBox.getComboBoxSelectedOptions('visDefaultEditorField'); + } - public async sizeUpEditor() { - const resizerPanel = await testSubjects.find('euiResizableButton'); - // Drag panel 100 px left - await browser.dragAndDrop({ location: resizerPanel }, { location: { x: -100, y: 0 } }); - } + public async sizeUpEditor() { + const resizerPanel = await this.testSubjects.find('euiResizableButton'); + // Drag panel 100 px left + await this.browser.dragAndDrop({ location: resizerPanel }, { location: { x: -100, y: 0 } }); + } - public async toggleDisabledAgg(agg: string | number) { - await testSubjects.click(`visEditorAggAccordion${agg} > ~toggleDisableAggregationBtn`); - await header.waitUntilLoadingHasFinished(); - } + public async toggleDisabledAgg(agg: string | number) { + await this.testSubjects.click(`visEditorAggAccordion${agg} > ~toggleDisableAggregationBtn`); + await this.header.waitUntilLoadingHasFinished(); + } - public async toggleAggregationEditor(agg: string | number) { - await find.clickByCssSelector( - `[data-test-subj="visEditorAggAccordion${agg}"] .euiAccordion__button` - ); - await header.waitUntilLoadingHasFinished(); - } + public async toggleAggregationEditor(agg: string | number) { + await this.find.clickByCssSelector( + `[data-test-subj="visEditorAggAccordion${agg}"] .euiAccordion__button` + ); + await this.header.waitUntilLoadingHasFinished(); + } - public async toggleOtherBucket(agg: string | number = 2) { - await testSubjects.click(`visEditorAggAccordion${agg} > otherBucketSwitch`); - } + public async toggleOtherBucket(agg: string | number = 2) { + await this.testSubjects.click(`visEditorAggAccordion${agg} > otherBucketSwitch`); + } - public async toggleMissingBucket(agg: string | number = 2) { - await testSubjects.click(`visEditorAggAccordion${agg} > missingBucketSwitch`); - } + public async toggleMissingBucket(agg: string | number = 2) { + await this.testSubjects.click(`visEditorAggAccordion${agg} > missingBucketSwitch`); + } - public async toggleScaleMetrics() { - await testSubjects.click('scaleMetricsSwitch'); - } + public async toggleScaleMetrics() { + await this.testSubjects.click('scaleMetricsSwitch'); + } - public async toggleAutoMode() { - await testSubjects.click('visualizeEditorAutoButton'); - } + public async toggleAutoMode() { + await this.testSubjects.click('visualizeEditorAutoButton'); + } - public async isApplyEnabled() { - const applyButton = await testSubjects.find('visualizeEditorRenderButton'); - return await applyButton.isEnabled(); - } + public async togglePieLegend() { + await this.testSubjects.click('visTypePieAddLegendSwitch'); + } - public async toggleAccordion(id: string, toState = 'true') { - const toggle = await find.byCssSelector(`button[aria-controls="${id}"]`); - const toggleOpen = await toggle.getAttribute('aria-expanded'); - log.debug(`toggle ${id} expand = ${toggleOpen}`); - if (toggleOpen !== toState) { - log.debug(`toggle ${id} click()`); - await toggle.click(); - } - } + public async togglePieNestedLegend() { + await this.testSubjects.click('visTypePieNestedLegendSwitch'); + } - public async toggleOpenEditor(index: number, toState = 'true') { - // index, see selectYAxisAggregation - await this.toggleAccordion(`visEditorAggAccordion${index}`, toState); - } + public async isApplyEnabled() { + const applyButton = await this.testSubjects.find('visualizeEditorRenderButton'); + return await applyButton.isEnabled(); + } - public async toggleAdvancedParams(aggId: string) { - const accordion = await testSubjects.find(`advancedParams-${aggId}`); - const accordionButton = await find.descendantDisplayedByCssSelector('button', accordion); - await accordionButton.click(); + public async toggleAccordion(id: string, toState = 'true') { + const toggle = await this.find.byCssSelector(`button[aria-controls="${id}"]`); + const toggleOpen = await toggle.getAttribute('aria-expanded'); + this.log.debug(`toggle ${id} expand = ${toggleOpen}`); + if (toggleOpen !== toState) { + this.log.debug(`toggle ${id} click()`); + await toggle.click(); } + } - public async inputValueInCodeEditor(value: string) { - const codeEditor = await find.byCssSelector('.react-monaco-editor-container'); - const textarea = await codeEditor.findByClassName('monaco-mouse-cursor-text'); + public async toggleOpenEditor(index: number, toState = 'true') { + // index, see selectYAxisAggregation + await this.toggleAccordion(`visEditorAggAccordion${index}`, toState); + } - await textarea.click(); - await browser.pressKeys(value); - } + public async toggleAdvancedParams(aggId: string) { + const accordion = await this.testSubjects.find(`advancedParams-${aggId}`); + const accordionButton = await this.find.descendantDisplayedByCssSelector('button', accordion); + await accordionButton.click(); + } - public async clickReset() { - await testSubjects.click('visualizeEditorResetButton'); - await visChart.waitForVisualization(); - } + public async inputValueInCodeEditor(value: string) { + const codeEditor = await this.find.byCssSelector('.react-monaco-editor-container'); + const textarea = await codeEditor.findByClassName('monaco-mouse-cursor-text'); - public async clickYAxisOptions(axisId: string) { - await testSubjects.click(`toggleYAxisOptions-${axisId}`); - } + await textarea.click(); + await this.browser.pressKeys(value); + } - public async changeYAxisShowCheckbox(axisId: string, enabled: boolean) { - const selector = `valueAxisShow-${axisId}`; - const button = await testSubjects.find(selector); - const isEnabled = (await button.getAttribute('aria-checked')) === 'true'; - if (enabled !== isEnabled) { - await button.click(); - } - } + public async clickReset() { + await this.testSubjects.click('visualizeEditorResetButton'); + await this.visChart.waitForVisualization(); + } - public async changeYAxisFilterLabelsCheckbox(axisId: string, enabled: boolean) { - const selector = `yAxisFilterLabelsCheckbox-${axisId}`; - const button = await testSubjects.find(selector); - const isEnabled = (await button.getAttribute('aria-checked')) === 'true'; - if (enabled !== isEnabled) { - await button.click(); - } - } + public async clickYAxisOptions(axisId: string) { + await this.testSubjects.click(`toggleYAxisOptions-${axisId}`); + } - public async setSize(newValue: number, aggId?: number) { - const dataTestSubj = aggId - ? `visEditorAggAccordion${aggId} > sizeParamEditor` - : 'sizeParamEditor'; - await testSubjects.setValue(dataTestSubj, String(newValue)); + public async changeYAxisShowCheckbox(axisId: string, enabled: boolean) { + const selector = `valueAxisShow-${axisId}`; + const button = await this.testSubjects.find(selector); + const isEnabled = (await button.getAttribute('aria-checked')) === 'true'; + if (enabled !== isEnabled) { + await button.click(); } + } - public async selectChartMode(mode: string) { - const selector = await find.byCssSelector(`#seriesMode0 > option[value="${mode}"]`); - await selector.click(); + public async changeYAxisFilterLabelsCheckbox(axisId: string, enabled: boolean) { + const selector = `yAxisFilterLabelsCheckbox-${axisId}`; + const button = await this.testSubjects.find(selector); + const isEnabled = (await button.getAttribute('aria-checked')) === 'true'; + if (enabled !== isEnabled) { + await button.click(); } + } - public async selectYAxisScaleType(axisId: string, scaleType: string) { - const selector = await find.byCssSelector( - `#scaleSelectYAxis-${axisId} > option[value="${scaleType}"]` - ); - await selector.click(); - } + public async setSize(newValue: number, aggId?: number) { + const dataTestSubj = aggId + ? `visEditorAggAccordion${aggId} > sizeParamEditor` + : 'sizeParamEditor'; + await this.testSubjects.setValue(dataTestSubj, String(newValue)); + } - public async selectXAxisPosition(position: string) { - const option = await (await testSubjects.find('categoryAxisPosition')).findByCssSelector( - `option[value="${position}"]` - ); - await option.click(); - } + public async selectChartMode(mode: string) { + const selector = await this.find.byCssSelector(`#seriesMode0 > option[value="${mode}"]`); + await selector.click(); + } - public async selectYAxisMode(mode: string) { - const selector = await find.byCssSelector(`#valueAxisMode0 > option[value="${mode}"]`); - await selector.click(); - } + public async selectYAxisScaleType(axisId: string, scaleType: string) { + const selector = await this.find.byCssSelector( + `#scaleSelectYAxis-${axisId} > option[value="${scaleType}"]` + ); + await selector.click(); + } - public async setAxisExtents(min: string, max: string, axisId = 'ValueAxis-1') { - await this.toggleAccordion(`yAxisAccordion${axisId}`); - await this.toggleAccordion(`yAxisOptionsAccordion${axisId}`); + public async selectXAxisPosition(position: string) { + const option = await (await this.testSubjects.find('categoryAxisPosition')).findByCssSelector( + `option[value="${position}"]` + ); + await option.click(); + } - await testSubjects.click('yAxisSetYExtents'); - await testSubjects.setValue('yAxisYExtentsMax', max); - await testSubjects.setValue('yAxisYExtentsMin', min); - } + public async selectYAxisMode(mode: string) { + const selector = await this.find.byCssSelector(`#valueAxisMode0 > option[value="${mode}"]`); + await selector.click(); + } - public async selectAggregateWith(fieldValue: string) { - await testSubjects.selectValue('visDefaultEditorAggregateWith', fieldValue); - } + public async setAxisExtents(min: string, max: string, axisId = 'ValueAxis-1') { + await this.toggleAccordion(`yAxisAccordion${axisId}`); + await this.toggleAccordion(`yAxisOptionsAccordion${axisId}`); - public async setInterval(newValue: string | number, options: IntervalOptions = {}) { - const newValueString = `${newValue}`; - const { type = 'default', aggNth = 2, append = false } = options; - log.debug(`visEditor.setInterval(${newValueString}, {${type}, ${aggNth}, ${append}})`); - if (type === 'default') { - await comboBox.set('visEditorInterval', newValueString); - } else if (type === 'custom') { - await comboBox.setCustom('visEditorInterval', newValueString); - } else { - if (type === 'numeric') { - const autoMode = await testSubjects.getAttribute( - `visEditorIntervalSwitch${aggNth}`, - 'aria-checked' - ); - if (autoMode === 'true') { - await testSubjects.click(`visEditorIntervalSwitch${aggNth}`); - } - } - if (append) { - await testSubjects.append(`visEditorInterval${aggNth}`, String(newValueString)); - } else { - await testSubjects.setValue(`visEditorInterval${aggNth}`, String(newValueString)); + await this.testSubjects.click('yAxisSetYExtents'); + await this.testSubjects.setValue('yAxisYExtentsMax', max); + await this.testSubjects.setValue('yAxisYExtentsMin', min); + } + + public async selectAggregateWith(fieldValue: string) { + await this.testSubjects.selectValue('visDefaultEditorAggregateWith', fieldValue); + } + + public async setInterval(newValue: string | number, options: IntervalOptions = {}) { + const newValueString = `${newValue}`; + const { type = 'default', aggNth = 2, append = false } = options; + this.log.debug(`visEditor.setInterval(${newValueString}, {${type}, ${aggNth}, ${append}})`); + if (type === 'default') { + await this.comboBox.set('visEditorInterval', newValueString); + } else if (type === 'custom') { + await this.comboBox.setCustom('visEditorInterval', newValueString); + } else { + if (type === 'numeric') { + const autoMode = await this.testSubjects.getAttribute( + `visEditorIntervalSwitch${aggNth}`, + 'aria-checked' + ); + if (autoMode === 'true') { + await this.testSubjects.click(`visEditorIntervalSwitch${aggNth}`); } } + if (append) { + await this.testSubjects.append(`visEditorInterval${aggNth}`, String(newValueString)); + } else { + await this.testSubjects.setValue(`visEditorInterval${aggNth}`, String(newValueString)); + } } + } - public async getInterval() { - return await comboBox.getComboBoxSelectedOptions('visEditorInterval'); - } + public async getInterval() { + return await this.comboBox.getComboBoxSelectedOptions('visEditorInterval'); + } - public async getNumericInterval(aggNth = 2) { - return await testSubjects.getAttribute(`visEditorInterval${aggNth}`, 'value'); - } + public async getNumericInterval(aggNth = 2) { + return await this.testSubjects.getAttribute(`visEditorInterval${aggNth}`, 'value'); + } - public async clickMetricEditor() { - await find.clickByCssSelector('[data-test-subj="metricsAggGroup"] .euiAccordion__button'); - } + public async clickMetricEditor() { + await this.find.clickByCssSelector('[data-test-subj="metricsAggGroup"] .euiAccordion__button'); + } - public async clickMetricByIndex(index: number) { - const metrics = await find.allByCssSelector( - '[data-test-subj="visualizationLoader"] .mtrVis .mtrVis__container' - ); - expect(metrics.length).greaterThan(index); - await metrics[index].click(); - } + public async clickMetricByIndex(index: number) { + const metrics = await this.find.allByCssSelector( + '[data-test-subj="visualizationLoader"] .mtrVis .mtrVis__container' + ); + expect(metrics.length).greaterThan(index); + await metrics[index].click(); + } - public async setSelectByOptionText(selectId: string, optionText: string) { - const selectField = await find.byCssSelector(`#${selectId}`); - const options = await find.allByCssSelector(`#${selectId} > option`); - const $ = await selectField.parseDomContent(); - const optionsText = $('option') - .toArray() - .map((option) => $(option).text()); - const optionIndex = optionsText.indexOf(optionText); - - if (optionIndex === -1) { - throw new Error( - `Unable to find option '${optionText}' in select ${selectId}. Available options: ${optionsText.join( - ',' - )}` - ); - } - await options[optionIndex].click(); + public async setSelectByOptionText(selectId: string, optionText: string) { + const selectField = await this.find.byCssSelector(`#${selectId}`); + const options = await this.find.allByCssSelector(`#${selectId} > option`); + const $ = await selectField.parseDomContent(); + const optionsText = $('option') + .toArray() + .map((option) => $(option).text()); + const optionIndex = optionsText.indexOf(optionText); + + if (optionIndex === -1) { + throw new Error( + `Unable to find option '${optionText}' in select ${selectId}. Available options: ${optionsText.join( + ',' + )}` + ); } + await options[optionIndex].click(); + } - // point series - - async clickAddAxis() { - return await testSubjects.click('visualizeAddYAxisButton'); - } + // point series - async setAxisTitle(title: string, aggNth = 0) { - return await testSubjects.setValue(`valueAxisTitle${aggNth}`, title); - } + async clickAddAxis() { + return await this.testSubjects.click('visualizeAddYAxisButton'); + } - public async toggleGridCategoryLines() { - return await testSubjects.click('showCategoryLines'); - } + async setAxisTitle(title: string, aggNth = 0) { + return await this.testSubjects.setValue(`valueAxisTitle${aggNth}`, title); + } - public async toggleValuesOnChart() { - return await testSubjects.click('showValuesOnChart'); - } + public async toggleGridCategoryLines() { + return await this.testSubjects.click('showCategoryLines'); + } - public async setGridValueAxis(axis: string) { - log.debug(`setGridValueAxis(${axis})`); - await find.selectValue('select#gridAxis', axis); - } + public async toggleValuesOnChart() { + return await this.testSubjects.click('showValuesOnChart'); + } - public async setSeriesAxis(seriesNth: number, axis: string) { - await find.selectValue(`select#seriesValueAxis${seriesNth}`, axis); - } + public async setGridValueAxis(axis: string) { + this.log.debug(`setGridValueAxis(${axis})`); + await this.find.selectValue('select#gridAxis', axis); + } - public async setSeriesType(seriesNth: number, type: string) { - await find.selectValue(`select#seriesType${seriesNth}`, type); - } + public async setSeriesAxis(seriesNth: number, axis: string) { + await this.find.selectValue(`select#seriesValueAxis${seriesNth}`, axis); } - return new VisualizeEditorPage(); + public async setSeriesType(seriesNth: number, type: string) { + await this.find.selectValue(`select#seriesType${seriesNth}`, type); + } } diff --git a/test/functional/page_objects/visualize_page.ts b/test/functional/page_objects/visualize_page.ts index 78a963867b8c23..f77db553e015f9 100644 --- a/test/functional/page_objects/visualize_page.ts +++ b/test/functional/page_objects/visualize_page.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { FtrProviderContext } from '../ftr_provider_context'; +import { FtrService } from '../ftr_provider_context'; import { VisualizeConstants } from '../../../src/plugins/visualize/public/application/visualize_constants'; import { UI_SETTINGS } from '../../../src/plugins/data/common'; @@ -23,455 +23,452 @@ type DashboardPickerOption = | 'existing-dashboard-option' | 'new-dashboard-option'; -export function VisualizePageProvider({ getService, getPageObjects }: FtrProviderContext) { - const kibanaServer = getService('kibanaServer'); - const testSubjects = getService('testSubjects'); - const retry = getService('retry'); - const find = getService('find'); - const log = getService('log'); - const globalNav = getService('globalNav'); - const listingTable = getService('listingTable'); - const queryBar = getService('queryBar'); - const elasticChart = getService('elasticChart'); - const { common, header, visEditor, visChart } = getPageObjects([ - 'common', - 'header', - 'visEditor', - 'visChart', - ]); - - /** - * This page object contains the visualization type selection, the landing page, - * and the open/save dialog functions - */ - class VisualizePage { - index = { - LOGSTASH_TIME_BASED: 'logstash-*', - LOGSTASH_NON_TIME_BASED: 'logstash*', - }; - - public async initTests() { - await kibanaServer.savedObjects.clean({ types: ['visualization'] }); - await kibanaServer.importExport.load('visualize'); - - await kibanaServer.uiSettings.replace({ - defaultIndex: 'logstash-*', - [UI_SETTINGS.FORMAT_BYTES_DEFAULT_PATTERN]: '0,0.[000]b', - }); - } - - public async gotoVisualizationLandingPage() { - await common.navigateToApp('visualize'); - } +/** + * This page object contains the visualization type selection, the landing page, + * and the open/save dialog functions + */ +export class VisualizePageObject extends FtrService { + private readonly kibanaServer = this.ctx.getService('kibanaServer'); + private readonly testSubjects = this.ctx.getService('testSubjects'); + private readonly retry = this.ctx.getService('retry'); + private readonly find = this.ctx.getService('find'); + private readonly log = this.ctx.getService('log'); + private readonly globalNav = this.ctx.getService('globalNav'); + private readonly listingTable = this.ctx.getService('listingTable'); + private readonly queryBar = this.ctx.getService('queryBar'); + private readonly elasticChart = this.ctx.getService('elasticChart'); + private readonly common = this.ctx.getPageObject('common'); + private readonly header = this.ctx.getPageObject('header'); + private readonly visEditor = this.ctx.getPageObject('visEditor'); + private readonly visChart = this.ctx.getPageObject('visChart'); + + index = { + LOGSTASH_TIME_BASED: 'logstash-*', + LOGSTASH_NON_TIME_BASED: 'logstash*', + }; + + public async initTests(isNewLibrary = false) { + await this.kibanaServer.savedObjects.clean({ types: ['visualization'] }); + await this.kibanaServer.importExport.load('visualize'); + + await this.kibanaServer.uiSettings.replace({ + defaultIndex: 'logstash-*', + [UI_SETTINGS.FORMAT_BYTES_DEFAULT_PATTERN]: '0,0.[000]b', + 'visualization:visualize:legacyChartsLibrary': !isNewLibrary, + }); + } - public async clickNewVisualization() { - await listingTable.clickNewButton('createVisualizationPromptButton'); - } + public async gotoVisualizationLandingPage() { + await this.common.navigateToApp('visualize'); + } - public async clickAggBasedVisualizations() { - await testSubjects.click('visGroupAggBasedExploreLink'); - } + public async clickNewVisualization() { + await this.listingTable.clickNewButton('createVisualizationPromptButton'); + } - public async goBackToGroups() { - await testSubjects.click('goBackLink'); - } + public async clickAggBasedVisualizations() { + await this.testSubjects.click('visGroupAggBasedExploreLink'); + } - public async createVisualizationPromptButton() { - await testSubjects.click('createVisualizationPromptButton'); - } + public async goBackToGroups() { + await this.testSubjects.click('goBackLink'); + } - public async getChartTypes() { - const chartTypeField = await testSubjects.find('visNewDialogTypes'); - const $ = await chartTypeField.parseDomContent(); - return $('button') - .toArray() - .map((chart) => $(chart).findTestSubject('visTypeTitle').text().trim()); - } + public async createVisualizationPromptButton() { + await this.testSubjects.click('createVisualizationPromptButton'); + } - public async getPromotedVisTypes() { - const chartTypeField = await testSubjects.find('visNewDialogGroups'); - const $ = await chartTypeField.parseDomContent(); - const promotedVisTypes: string[] = []; - $('button') - .toArray() - .forEach((chart) => { - const title = $(chart).findTestSubject('visTypeTitle').text().trim(); - if (title) { - promotedVisTypes.push(title); - } - }); - return promotedVisTypes; - } + public async getChartTypes() { + const chartTypeField = await this.testSubjects.find('visNewDialogTypes'); + const $ = await chartTypeField.parseDomContent(); + return $('button') + .toArray() + .map((chart) => $(chart).findTestSubject('visTypeTitle').text().trim()); + } - public async waitForVisualizationSelectPage() { - await retry.try(async () => { - const visualizeSelectTypePage = await testSubjects.find('visNewDialogTypes'); - if (!(await visualizeSelectTypePage.isDisplayed())) { - throw new Error('wait for visualization select page'); + public async getPromotedVisTypes() { + const chartTypeField = await this.testSubjects.find('visNewDialogGroups'); + const $ = await chartTypeField.parseDomContent(); + const promotedVisTypes: string[] = []; + $('button') + .toArray() + .forEach((chart) => { + const title = $(chart).findTestSubject('visTypeTitle').text().trim(); + if (title) { + promotedVisTypes.push(title); } }); - } + return promotedVisTypes; + } - public async clickRefresh() { - if (await visChart.isNewChartsLibraryEnabled()) { - await elasticChart.setNewChartUiDebugFlag(); + public async waitForVisualizationSelectPage() { + await this.retry.try(async () => { + const visualizeSelectTypePage = await this.testSubjects.find('visNewDialogTypes'); + if (!(await visualizeSelectTypePage.isDisplayed())) { + throw new Error('wait for visualization select page'); } - await queryBar.clickQuerySubmitButton(); - } - - public async waitForGroupsSelectPage() { - await retry.try(async () => { - const visualizeSelectGroupStep = await testSubjects.find('visNewDialogGroups'); - if (!(await visualizeSelectGroupStep.isDisplayed())) { - throw new Error('wait for vis groups select step'); - } - }); - } - - public async navigateToNewVisualization() { - await this.gotoVisualizationLandingPage(); - await header.waitUntilLoadingHasFinished(); - await this.clickNewVisualization(); - await this.waitForGroupsSelectPage(); - } + }); + } - public async navigateToNewAggBasedVisualization() { - await this.gotoVisualizationLandingPage(); - await header.waitUntilLoadingHasFinished(); - await this.clickNewVisualization(); - await this.clickAggBasedVisualizations(); - await this.waitForVisualizationSelectPage(); + public async clickRefresh() { + if (await this.visChart.isNewChartsLibraryEnabled()) { + await this.elasticChart.setNewChartUiDebugFlag(); } + await this.queryBar.clickQuerySubmitButton(); + } - public async hasVisType(type: string) { - return await testSubjects.exists(`visType-${type}`); - } + public async waitForGroupsSelectPage() { + await this.retry.try(async () => { + const visualizeSelectGroupStep = await this.testSubjects.find('visNewDialogGroups'); + if (!(await visualizeSelectGroupStep.isDisplayed())) { + throw new Error('wait for vis groups select step'); + } + }); + } - public async clickVisType(type: string) { - await testSubjects.click(`visType-${type}`); - await header.waitUntilLoadingHasFinished(); - } + public async navigateToNewVisualization() { + await this.gotoVisualizationLandingPage(); + await this.header.waitUntilLoadingHasFinished(); + await this.clickNewVisualization(); + await this.waitForGroupsSelectPage(); + } - public async clickAreaChart() { - await this.clickVisType('area'); - } + public async navigateToNewAggBasedVisualization() { + await this.gotoVisualizationLandingPage(); + await this.header.waitUntilLoadingHasFinished(); + await this.clickNewVisualization(); + await this.clickAggBasedVisualizations(); + await this.waitForVisualizationSelectPage(); + } - public async clickDataTable() { - await this.clickVisType('table'); - } + public async hasVisType(type: string) { + return await this.testSubjects.exists(`visType-${type}`); + } - public async clickLineChart() { - await this.clickVisType('line'); - } + public async clickVisType(type: string) { + await this.testSubjects.click(`visType-${type}`); + await this.header.waitUntilLoadingHasFinished(); + } - public async clickRegionMap() { - await this.clickVisType('region_map'); - } + public async clickAreaChart() { + await this.clickVisType('area'); + } - public async hasRegionMap() { - return await this.hasVisType('region_map'); - } + public async clickDataTable() { + await this.clickVisType('table'); + } - public async clickMarkdownWidget() { - await this.clickVisType('markdown'); - } + public async clickLineChart() { + await this.clickVisType('line'); + } - public async clickMetric() { - await this.clickVisType('metric'); - } + public async clickRegionMap() { + await this.clickVisType('region_map'); + } - public async clickGauge() { - await this.clickVisType('gauge'); - } + public async hasRegionMap() { + return await this.hasVisType('region_map'); + } - public async clickPieChart() { - await this.clickVisType('pie'); - } + public async clickMarkdownWidget() { + await this.clickVisType('markdown'); + } - public async clickTileMap() { - await this.clickVisType('tile_map'); - } + public async clickMetric() { + await this.clickVisType('metric'); + } - public async hasTileMap() { - return await this.hasVisType('tile_map'); - } + public async clickGauge() { + await this.clickVisType('gauge'); + } - public async clickTagCloud() { - await this.clickVisType('tagcloud'); - } + public async clickPieChart() { + await this.clickVisType('pie'); + } - public async clickVega() { - await this.clickVisType('vega'); - } + public async clickTileMap() { + await this.clickVisType('tile_map'); + } - public async clickVisualBuilder() { - await this.clickVisType('metrics'); - } + public async hasTileMap() { + return await this.hasVisType('tile_map'); + } - public async clickVerticalBarChart() { - await this.clickVisType('histogram'); - } + public async clickTagCloud() { + await this.clickVisType('tagcloud'); + } - public async clickHeatmapChart() { - await this.clickVisType('heatmap'); - } + public async clickVega() { + await this.clickVisType('vega'); + } - public async clickInputControlVis() { - await this.clickVisType('input_control_vis'); - } + public async clickVisualBuilder() { + await this.clickVisType('metrics'); + } - public async clickLensWidget() { - await this.clickVisType('lens'); - } + public async clickVerticalBarChart() { + await this.clickVisType('histogram'); + } - public async clickMapsApp() { - await this.clickVisType('maps'); - } + public async clickHeatmapChart() { + await this.clickVisType('heatmap'); + } - public async hasMapsApp() { - return await this.hasVisType('maps'); - } + public async clickInputControlVis() { + await this.clickVisType('input_control_vis'); + } - public async createSimpleMarkdownViz(vizName: string) { - await this.gotoVisualizationLandingPage(); - await this.navigateToNewVisualization(); - await this.clickMarkdownWidget(); - await visEditor.setMarkdownTxt(vizName); - await visEditor.clickGo(); - await this.saveVisualization(vizName); - } + public async clickLensWidget() { + await this.clickVisType('lens'); + } - public async clickNewSearch(indexPattern = this.index.LOGSTASH_TIME_BASED) { - await testSubjects.click(`savedObjectTitle${indexPattern.split(' ').join('-')}`); - await header.waitUntilLoadingHasFinished(); - } + public async clickMapsApp() { + await this.clickVisType('maps'); + } - public async selectVisSourceIfRequired() { - log.debug('selectVisSourceIfRequired'); - const selectPage = await testSubjects.findAll('visualizeSelectSearch'); - if (selectPage.length) { - log.debug('a search is required for this visualization'); - await this.clickNewSearch(); - } - } + public async hasMapsApp() { + return await this.hasVisType('maps'); + } - /** - * Deletes all existing visualizations - */ - public async deleteAllVisualizations() { - await retry.try(async () => { - await listingTable.checkListingSelectAllCheckbox(); - await listingTable.clickDeleteSelected(); - await common.clickConfirmOnModal(); - await testSubjects.find('createVisualizationPromptButton'); - }); - } + public async createSimpleMarkdownViz(vizName: string) { + await this.gotoVisualizationLandingPage(); + await this.navigateToNewVisualization(); + await this.clickMarkdownWidget(); + await this.visEditor.setMarkdownTxt(vizName); + await this.visEditor.clickGo(); + await this.saveVisualization(vizName); + } - public async isBetaInfoShown() { - return await testSubjects.exists('betaVisInfo'); - } + public async clickNewSearch(indexPattern = this.index.LOGSTASH_TIME_BASED) { + await this.testSubjects.click(`savedObjectTitle${indexPattern.split(' ').join('-')}`); + await this.header.waitUntilLoadingHasFinished(); + } - public async getBetaTypeLinks() { - return await find.allByCssSelector('[data-vis-stage="beta"]'); + public async selectVisSourceIfRequired() { + this.log.debug('selectVisSourceIfRequired'); + const selectPage = await this.testSubjects.findAll('visualizeSelectSearch'); + if (selectPage.length) { + this.log.debug('a search is required for this visualization'); + await this.clickNewSearch(); } + } - public async getExperimentalTypeLinks() { - return await find.allByCssSelector('[data-vis-stage="experimental"]'); - } + /** + * Deletes all existing visualizations + */ + public async deleteAllVisualizations() { + await this.retry.try(async () => { + await this.listingTable.checkListingSelectAllCheckbox(); + await this.listingTable.clickDeleteSelected(); + await this.common.clickConfirmOnModal(); + await this.testSubjects.find('createVisualizationPromptButton'); + }); + } - public async isExperimentalInfoShown() { - return await testSubjects.exists('experimentalVisInfo'); - } + public async isBetaInfoShown() { + return await this.testSubjects.exists('betaVisInfo'); + } - public async getExperimentalInfo() { - return await testSubjects.find('experimentalVisInfo'); - } + public async getBetaTypeLinks() { + return await this.find.allByCssSelector('[data-vis-stage="beta"]'); + } - public async getSideEditorExists() { - return await find.existsByCssSelector('.visEditor__collapsibleSidebar'); - } + public async getExperimentalTypeLinks() { + return await this.find.allByCssSelector('[data-vis-stage="experimental"]'); + } - public async clickSavedSearch(savedSearchName: string) { - await testSubjects.click(`savedObjectTitle${savedSearchName.split(' ').join('-')}`); - await header.waitUntilLoadingHasFinished(); - } + public async isExperimentalInfoShown() { + return await this.testSubjects.exists('experimentalVisInfo'); + } - public async clickUnlinkSavedSearch() { - await testSubjects.click('showUnlinkSavedSearchPopover'); - await testSubjects.click('unlinkSavedSearch'); - await header.waitUntilLoadingHasFinished(); - } + public async getExperimentalInfo() { + return await this.testSubjects.find('experimentalVisInfo'); + } - public async ensureSavePanelOpen() { - log.debug('ensureSavePanelOpen'); - await header.waitUntilLoadingHasFinished(); - const isOpen = await testSubjects.exists('savedObjectSaveModal', { timeout: 5000 }); - if (!isOpen) { - await testSubjects.click('visualizeSaveButton'); - } - } + public async getSideEditorExists() { + return await this.find.existsByCssSelector('.visEditor__collapsibleSidebar'); + } - public async clickLoadSavedVisButton() { - // TODO: Use a test subject selector once we rewrite breadcrumbs to accept each breadcrumb - // element as a child instead of building the breadcrumbs dynamically. - await find.clickByCssSelector('[href="#/"]'); - } + public async clickSavedSearch(savedSearchName: string) { + await this.testSubjects.click(`savedObjectTitle${savedSearchName.split(' ').join('-')}`); + await this.header.waitUntilLoadingHasFinished(); + } - public async loadSavedVisualization(vizName: string, { navigateToVisualize = true } = {}) { - if (navigateToVisualize) { - await this.clickLoadSavedVisButton(); - } - await this.openSavedVisualization(vizName); - } + public async clickUnlinkSavedSearch() { + await this.testSubjects.click('showUnlinkSavedSearchPopover'); + await this.testSubjects.click('unlinkSavedSearch'); + await this.header.waitUntilLoadingHasFinished(); + } - public async openSavedVisualization(vizName: string) { - const dataTestSubj = `visListingTitleLink-${vizName.split(' ').join('-')}`; - await testSubjects.click(dataTestSubj, 20000); - await header.waitUntilLoadingHasFinished(); + public async ensureSavePanelOpen() { + this.log.debug('ensureSavePanelOpen'); + await this.header.waitUntilLoadingHasFinished(); + const isOpen = await this.testSubjects.exists('savedObjectSaveModal', { timeout: 5000 }); + if (!isOpen) { + await this.testSubjects.click('visualizeSaveButton'); } + } - public async waitForVisualizationSavedToastGone() { - await testSubjects.waitForDeleted('saveVisualizationSuccess'); - } + public async clickLoadSavedVisButton() { + // TODO: Use a test subject selector once we rewrite breadcrumbs to accept each breadcrumb + // element as a child instead of building the breadcrumbs dynamically. + await this.find.clickByCssSelector('[href="#/"]'); + } - public async clickLandingPageBreadcrumbLink() { - log.debug('clickLandingPageBreadcrumbLink'); - await find.clickByCssSelector(`a[href="#${VisualizeConstants.LANDING_PAGE_PATH}"]`); + public async loadSavedVisualization(vizName: string, { navigateToVisualize = true } = {}) { + if (navigateToVisualize) { + await this.clickLoadSavedVisButton(); } + await this.openSavedVisualization(vizName); + } - /** - * Returns true if already on the landing page (that page doesn't have a link to itself). - * @returns {Promise} - */ - public async onLandingPage() { - log.debug(`VisualizePage.onLandingPage`); - return await testSubjects.exists('visualizationLandingPage'); - } + public async openSavedVisualization(vizName: string) { + const dataTestSubj = `visListingTitleLink-${vizName.split(' ').join('-')}`; + await this.testSubjects.click(dataTestSubj, 20000); + await this.header.waitUntilLoadingHasFinished(); + } - public async gotoLandingPage() { - log.debug('VisualizePage.gotoLandingPage'); - const onPage = await this.onLandingPage(); - if (!onPage) { - await retry.try(async () => { - await this.clickLandingPageBreadcrumbLink(); - const onLandingPage = await this.onLandingPage(); - if (!onLandingPage) throw new Error('Not on the landing page.'); - }); - } - } + public async waitForVisualizationSavedToastGone() { + await this.testSubjects.waitForDeleted('saveVisualizationSuccess'); + } - public async saveVisualization(vizName: string, saveModalArgs: VisualizeSaveModalArgs = {}) { - await this.ensureSavePanelOpen(); + public async clickLandingPageBreadcrumbLink() { + this.log.debug('clickLandingPageBreadcrumbLink'); + await this.find.clickByCssSelector(`a[href="#${VisualizeConstants.LANDING_PAGE_PATH}"]`); + } - await this.setSaveModalValues(vizName, saveModalArgs); - log.debug('Click Save Visualization button'); + /** + * Returns true if already on the landing page (that page doesn't have a link to itself). + * @returns {Promise} + */ + public async onLandingPage() { + this.log.debug(`VisualizePage.onLandingPage`); + return await this.testSubjects.exists('visualizationLandingPage'); + } - await testSubjects.click('confirmSaveSavedObjectButton'); + public async gotoLandingPage() { + this.log.debug('VisualizePage.gotoLandingPage'); + const onPage = await this.onLandingPage(); + if (!onPage) { + await this.retry.try(async () => { + await this.clickLandingPageBreadcrumbLink(); + const onLandingPage = await this.onLandingPage(); + if (!onLandingPage) throw new Error('Not on the landing page.'); + }); + } + } - // Confirm that the Visualization has actually been saved - await testSubjects.existOrFail('saveVisualizationSuccess'); - const message = await common.closeToast(); - await header.waitUntilLoadingHasFinished(); - await common.waitForSaveModalToClose(); + public async saveVisualization(vizName: string, saveModalArgs: VisualizeSaveModalArgs = {}) { + await this.ensureSavePanelOpen(); - return message; - } + await this.setSaveModalValues(vizName, saveModalArgs); + this.log.debug('Click Save Visualization button'); - public async setSaveModalValues( - vizName: string, - { saveAsNew, redirectToOrigin, addToDashboard, dashboardId }: VisualizeSaveModalArgs = {} - ) { - await testSubjects.setValue('savedObjectTitle', vizName); - - const saveAsNewCheckboxExists = await testSubjects.exists('saveAsNewCheckbox'); - if (saveAsNewCheckboxExists) { - const state = saveAsNew ? 'check' : 'uncheck'; - log.debug('save as new checkbox exists. Setting its state to', state); - await testSubjects.setEuiSwitch('saveAsNewCheckbox', state); - } + await this.testSubjects.click('confirmSaveSavedObjectButton'); - const redirectToOriginCheckboxExists = await testSubjects.exists('returnToOriginModeSwitch'); - if (redirectToOriginCheckboxExists) { - const state = redirectToOrigin ? 'check' : 'uncheck'; - log.debug('redirect to origin checkbox exists. Setting its state to', state); - await testSubjects.setEuiSwitch('returnToOriginModeSwitch', state); - } + // Confirm that the Visualization has actually been saved + await this.testSubjects.existOrFail('saveVisualizationSuccess'); + const message = await this.common.closeToast(); + await this.header.waitUntilLoadingHasFinished(); + await this.common.waitForSaveModalToClose(); - const dashboardSelectorExists = await testSubjects.exists('add-to-dashboard-options'); - if (dashboardSelectorExists) { - let option: DashboardPickerOption = 'add-to-library-option'; - if (addToDashboard) { - option = dashboardId ? 'existing-dashboard-option' : 'new-dashboard-option'; - } - log.debug('save modal dashboard selector, choosing option:', option); - const dashboardSelector = await testSubjects.find('add-to-dashboard-options'); - const label = await dashboardSelector.findByCssSelector(`label[for="${option}"]`); - await label.click(); + return message; + } - if (dashboardId) { - // TODO - selecting an existing dashboard - } + public async setSaveModalValues( + vizName: string, + { saveAsNew, redirectToOrigin, addToDashboard, dashboardId }: VisualizeSaveModalArgs = {} + ) { + await this.testSubjects.setValue('savedObjectTitle', vizName); + + const saveAsNewCheckboxExists = await this.testSubjects.exists('saveAsNewCheckbox'); + if (saveAsNewCheckboxExists) { + const state = saveAsNew ? 'check' : 'uncheck'; + this.log.debug('save as new checkbox exists. Setting its state to', state); + await this.testSubjects.setEuiSwitch('saveAsNewCheckbox', state); + } + + const redirectToOriginCheckboxExists = await this.testSubjects.exists( + 'returnToOriginModeSwitch' + ); + if (redirectToOriginCheckboxExists) { + const state = redirectToOrigin ? 'check' : 'uncheck'; + this.log.debug('redirect to origin checkbox exists. Setting its state to', state); + await this.testSubjects.setEuiSwitch('returnToOriginModeSwitch', state); + } + + const dashboardSelectorExists = await this.testSubjects.exists('add-to-dashboard-options'); + if (dashboardSelectorExists) { + let option: DashboardPickerOption = 'add-to-library-option'; + if (addToDashboard) { + option = dashboardId ? 'existing-dashboard-option' : 'new-dashboard-option'; } - } + this.log.debug('save modal dashboard selector, choosing option:', option); + const dashboardSelector = await this.testSubjects.find('add-to-dashboard-options'); + const label = await dashboardSelector.findByCssSelector(`label[for="${option}"]`); + await label.click(); - public async saveVisualizationExpectSuccess( - vizName: string, - { saveAsNew, redirectToOrigin, addToDashboard, dashboardId }: VisualizeSaveModalArgs = {} - ) { - const saveMessage = await this.saveVisualization(vizName, { - saveAsNew, - redirectToOrigin, - addToDashboard, - dashboardId, - }); - if (!saveMessage) { - throw new Error( - `Expected saveVisualization to respond with the saveMessage from the toast, got ${saveMessage}` - ); + if (dashboardId) { + // TODO - selecting an existing dashboard } } + } - public async saveVisualizationExpectSuccessAndBreadcrumb( - vizName: string, - { saveAsNew = false, redirectToOrigin = false } = {} - ) { - await this.saveVisualizationExpectSuccess(vizName, { saveAsNew, redirectToOrigin }); - await retry.waitFor( - 'last breadcrumb to have new vis name', - async () => (await globalNav.getLastBreadcrumb()) === vizName + public async saveVisualizationExpectSuccess( + vizName: string, + { saveAsNew, redirectToOrigin, addToDashboard, dashboardId }: VisualizeSaveModalArgs = {} + ) { + const saveMessage = await this.saveVisualization(vizName, { + saveAsNew, + redirectToOrigin, + addToDashboard, + dashboardId, + }); + if (!saveMessage) { + throw new Error( + `Expected saveVisualization to respond with the saveMessage from the toast, got ${saveMessage}` ); } + } - public async saveVisualizationAndReturn() { - await header.waitUntilLoadingHasFinished(); - await testSubjects.existOrFail('visualizesaveAndReturnButton'); - await testSubjects.click('visualizesaveAndReturnButton'); - } + public async saveVisualizationExpectSuccessAndBreadcrumb( + vizName: string, + { saveAsNew = false, redirectToOrigin = false } = {} + ) { + await this.saveVisualizationExpectSuccess(vizName, { saveAsNew, redirectToOrigin }); + await this.retry.waitFor( + 'last breadcrumb to have new vis name', + async () => (await this.globalNav.getLastBreadcrumb()) === vizName + ); + } - public async linkedToOriginatingApp() { - await header.waitUntilLoadingHasFinished(); - await testSubjects.existOrFail('visualizesaveAndReturnButton'); - } + public async saveVisualizationAndReturn() { + await this.header.waitUntilLoadingHasFinished(); + await this.testSubjects.existOrFail('visualizesaveAndReturnButton'); + await this.testSubjects.click('visualizesaveAndReturnButton'); + } - public async notLinkedToOriginatingApp() { - await header.waitUntilLoadingHasFinished(); - await testSubjects.missingOrFail('visualizesaveAndReturnButton'); - } + public async linkedToOriginatingApp() { + await this.header.waitUntilLoadingHasFinished(); + await this.testSubjects.existOrFail('visualizesaveAndReturnButton'); + } - public async cancelAndReturn(showConfirmModal: boolean) { - await header.waitUntilLoadingHasFinished(); - await testSubjects.existOrFail('visualizeCancelAndReturnButton'); - await testSubjects.click('visualizeCancelAndReturnButton'); - if (showConfirmModal) { - await retry.waitFor( - 'confirm modal to show', - async () => await testSubjects.exists('appLeaveConfirmModal') - ); - await testSubjects.exists('confirmModalConfirmButton'); - await testSubjects.click('confirmModalConfirmButton'); - } - } + public async notLinkedToOriginatingApp() { + await this.header.waitUntilLoadingHasFinished(); + await this.testSubjects.missingOrFail('visualizesaveAndReturnButton'); } - return new VisualizePage(); + public async cancelAndReturn(showConfirmModal: boolean) { + await this.header.waitUntilLoadingHasFinished(); + await this.testSubjects.existOrFail('visualizeCancelAndReturnButton'); + await this.testSubjects.click('visualizeCancelAndReturnButton'); + if (showConfirmModal) { + await this.retry.waitFor( + 'confirm modal to show', + async () => await this.testSubjects.exists('appLeaveConfirmModal') + ); + await this.testSubjects.exists('confirmModalConfirmButton'); + await this.testSubjects.click('confirmModalConfirmButton'); + } + } } diff --git a/test/functional/services/combo_box.ts b/test/functional/services/combo_box.ts index a198aec1d16960..6706db82ce7086 100644 --- a/test/functional/services/combo_box.ts +++ b/test/functional/services/combo_box.ts @@ -21,7 +21,7 @@ export class ComboBoxService extends FtrService { private readonly log = this.ctx.getService('log'); private readonly retry = this.ctx.getService('retry'); private readonly browser = this.ctx.getService('browser'); - private readonly PageObjects = this.ctx.getPageObjects(['common']); + private readonly common = this.ctx.getPageObject('common'); private readonly WAIT_FOR_EXISTS_TIME: number = this.config.get('timeouts.waitForExists'); @@ -113,7 +113,7 @@ export class ComboBoxService extends FtrService { this.log.debug(`comboBox.setCustom, comboBoxSelector: ${comboBoxSelector}, value: ${value}`); const comboBoxElement = await this.testSubjects.find(comboBoxSelector); await this.setFilterValue(comboBoxElement, value); - await this.PageObjects.common.pressEnterKey(); + await this.common.pressEnterKey(); await this.closeOptionsList(comboBoxElement); } diff --git a/test/functional/services/dashboard/add_panel.ts b/test/functional/services/dashboard/add_panel.ts index 98e947541b52d7..43ab1f966bc9a0 100644 --- a/test/functional/services/dashboard/add_panel.ts +++ b/test/functional/services/dashboard/add_panel.ts @@ -13,20 +13,21 @@ export class DashboardAddPanelService extends FtrService { private readonly retry = this.ctx.getService('retry'); private readonly testSubjects = this.ctx.getService('testSubjects'); private readonly flyout = this.ctx.getService('flyout'); - private readonly PageObjects = this.ctx.getPageObjects(['header', 'common']); + private readonly common = this.ctx.getPageObject('common'); + private readonly header = this.ctx.getPageObject('header'); async clickOpenAddPanel() { this.log.debug('DashboardAddPanel.clickOpenAddPanel'); await this.testSubjects.click('dashboardAddPanelButton'); // Give some time for the animation to complete - await this.PageObjects.common.sleep(500); + await this.common.sleep(500); } async clickCreateNewLink() { this.log.debug('DashboardAddPanel.clickAddNewPanelButton'); await this.testSubjects.click('dashboardAddNewPanelButton'); // Give some time for the animation to complete - await this.PageObjects.common.sleep(500); + await this.common.sleep(500); } async clickQuickButton(visType: string) { @@ -94,7 +95,7 @@ export class DashboardAddPanelService extends FtrService { } await embeddableRows[i].click(); - await this.PageObjects.common.closeToast(); + await this.common.closeToast(); embeddableList.push(name); } }); @@ -104,7 +105,7 @@ export class DashboardAddPanelService extends FtrService { async clickPagerNextButton() { // Clear all toasts that could hide pagination controls - await this.PageObjects.common.clearAllToasts(); + await this.common.clearAllToasts(); const isNext = await this.testSubjects.exists('pagination-button-next'); if (!isNext) { @@ -118,9 +119,9 @@ export class DashboardAddPanelService extends FtrService { return false; } - await this.PageObjects.header.waitUntilLoadingHasFinished(); + await this.header.waitUntilLoadingHasFinished(); await pagerNextButton.click(); - await this.PageObjects.header.waitUntilLoadingHasFinished(); + await this.header.waitUntilLoadingHasFinished(); return true; } diff --git a/test/functional/services/dashboard/expectations.ts b/test/functional/services/dashboard/expectations.ts index 34a4a9de7899a9..c22eddb032cf9e 100644 --- a/test/functional/services/dashboard/expectations.ts +++ b/test/functional/services/dashboard/expectations.ts @@ -16,20 +16,21 @@ export class DashboardExpectService extends FtrService { private readonly testSubjects = this.ctx.getService('testSubjects'); private readonly find = this.ctx.getService('find'); private readonly filterBar = this.ctx.getService('filterBar'); - private readonly PageObjects = this.ctx.getPageObjects(['dashboard', 'visualize', 'visChart']); + private readonly dashboard = this.ctx.getPageObject('dashboard'); + private readonly visChart = this.ctx.getPageObject('visChart'); private readonly findTimeout = 2500; async panelCount(expectedCount: number) { this.log.debug(`DashboardExpect.panelCount(${expectedCount})`); await this.retry.try(async () => { - const panelCount = await this.PageObjects.dashboard.getPanelCount(); + const panelCount = await this.dashboard.getPanelCount(); expect(panelCount).to.be(expectedCount); }); } async visualizationsArePresent(vizList: string[]) { this.log.debug('Checking all visualisations are present on dashsboard'); - let notLoaded = await this.PageObjects.dashboard.getNotLoadedVisualizations(vizList); + let notLoaded = await this.dashboard.getNotLoadedVisualizations(vizList); // TODO: Determine issue occasionally preventing 'geo map' from loading notLoaded = notLoaded.filter((x) => x !== 'Rendering Test: geo map'); expect(notLoaded).to.be.empty(); @@ -231,7 +232,7 @@ export class DashboardExpectService extends FtrService { async dataTableRowCount(expectedCount: number) { this.log.debug(`DashboardExpect.dataTableRowCount(${expectedCount})`); await this.retry.try(async () => { - const dataTableRows = await this.PageObjects.visChart.getTableVisContent(); + const dataTableRows = await this.visChart.getTableVisContent(); expect(dataTableRows.length).to.be(expectedCount); }); } @@ -239,7 +240,7 @@ export class DashboardExpectService extends FtrService { async dataTableNoResult() { this.log.debug(`DashboardExpect.dataTableNoResult`); await this.retry.try(async () => { - await this.PageObjects.visChart.getTableVisNoResult(); + await this.visChart.getTableVisNoResult(); }); } diff --git a/test/functional/services/dashboard/panel_actions.ts b/test/functional/services/dashboard/panel_actions.ts index e7c028acc0e1bf..9aca790b0b4379 100644 --- a/test/functional/services/dashboard/panel_actions.ts +++ b/test/functional/services/dashboard/panel_actions.ts @@ -25,7 +25,9 @@ export class DashboardPanelActionsService extends FtrService { private readonly log = this.ctx.getService('log'); private readonly testSubjects = this.ctx.getService('testSubjects'); private readonly inspector = this.ctx.getService('inspector'); - private readonly PageObjects = this.ctx.getPageObjects(['header', 'common', 'dashboard']); + private readonly header = this.ctx.getPageObject('header'); + private readonly common = this.ctx.getPageObject('common'); + private readonly dashboard = this.ctx.getPageObject('dashboard'); async findContextMenu(parent?: WebElementWrapper) { return parent @@ -78,8 +80,8 @@ export class DashboardPanelActionsService extends FtrService { const isActionVisible = await this.testSubjects.exists(EDIT_PANEL_DATA_TEST_SUBJ); if (!isActionVisible) await this.clickContextMenuMoreItem(); await this.testSubjects.clickWhenNotDisabled(EDIT_PANEL_DATA_TEST_SUBJ); - await this.PageObjects.header.waitUntilLoadingHasFinished(); - await this.PageObjects.common.waitForTopNavToBeVisible(); + await this.header.waitUntilLoadingHasFinished(); + await this.common.waitForTopNavToBeVisible(); } async editPanelByTitle(title?: string) { @@ -146,7 +148,7 @@ export class DashboardPanelActionsService extends FtrService { await this.openContextMenu(); } await this.testSubjects.click(CLONE_PANEL_DATA_TEST_SUBJ); - await this.PageObjects.dashboard.waitForRenderComplete(); + await this.dashboard.waitForRenderComplete(); } async openCopyToModalByTitle(title?: string) { diff --git a/test/functional/services/dashboard/visualizations.ts b/test/functional/services/dashboard/visualizations.ts index a6b88802d7b814..8688d375f7a7b9 100644 --- a/test/functional/services/dashboard/visualizations.ts +++ b/test/functional/services/dashboard/visualizations.ts @@ -13,25 +13,23 @@ export class DashboardVisualizationsService extends FtrService { private readonly queryBar = this.ctx.getService('queryBar'); private readonly testSubjects = this.ctx.getService('testSubjects'); private readonly dashboardAddPanel = this.ctx.getService('dashboardAddPanel'); - private readonly PageObjects = this.ctx.getPageObjects([ - 'dashboard', - 'visualize', - 'visEditor', - 'header', - 'discover', - 'timePicker', - ]); + private readonly dashboard = this.ctx.getPageObject('dashboard'); + private readonly visualize = this.ctx.getPageObject('visualize'); + private readonly visEditor = this.ctx.getPageObject('visEditor'); + private readonly header = this.ctx.getPageObject('header'); + private readonly discover = this.ctx.getPageObject('discover'); + private readonly timePicker = this.ctx.getPageObject('timePicker'); async createAndAddTSVBVisualization(name: string) { this.log.debug(`createAndAddTSVBVisualization(${name})`); - const inViewMode = await this.PageObjects.dashboard.getIsInViewMode(); + const inViewMode = await this.dashboard.getIsInViewMode(); if (inViewMode) { - await this.PageObjects.dashboard.switchToEditMode(); + await this.dashboard.switchToEditMode(); } await this.dashboardAddPanel.clickEditorMenuButton(); await this.dashboardAddPanel.clickAddNewEmbeddableLink('metrics'); - await this.PageObjects.visualize.clickVisualBuilder(); - await this.PageObjects.visualize.saveVisualizationExpectSuccess(name); + await this.visualize.clickVisualBuilder(); + await this.visualize.saveVisualizationExpectSuccess(name); } async createSavedSearch({ @@ -44,8 +42,8 @@ export class DashboardVisualizationsService extends FtrService { fields?: string[]; }) { this.log.debug(`createSavedSearch(${name})`); - await this.PageObjects.header.clickDiscover(true); - await this.PageObjects.timePicker.setHistoricalDataRange(); + await this.header.clickDiscover(true); + await this.timePicker.setHistoricalDataRange(); if (query) { await this.queryBar.setQuery(query); @@ -54,12 +52,12 @@ export class DashboardVisualizationsService extends FtrService { if (fields) { for (let i = 0; i < fields.length; i++) { - await this.PageObjects.discover.clickFieldListItemAdd(fields[i]); + await this.discover.clickFieldListItemAdd(fields[i]); } } - await this.PageObjects.discover.saveSearch(name); - await this.PageObjects.header.waitUntilLoadingHasFinished(); + await this.discover.saveSearch(name); + await this.header.waitUntilLoadingHasFinished(); await this.testSubjects.exists('saveSearchSuccess'); } @@ -75,25 +73,25 @@ export class DashboardVisualizationsService extends FtrService { this.log.debug(`createAndAddSavedSearch(${name})`); await this.createSavedSearch({ name, query, fields }); - await this.PageObjects.header.clickDashboard(); + await this.header.clickDashboard(); - const inViewMode = await this.PageObjects.dashboard.getIsInViewMode(); + const inViewMode = await this.dashboard.getIsInViewMode(); if (inViewMode) { - await this.PageObjects.dashboard.switchToEditMode(); + await this.dashboard.switchToEditMode(); } await this.dashboardAddPanel.addSavedSearch(name); } async createAndAddMarkdown({ name, markdown }: { name: string; markdown: string }) { this.log.debug(`createAndAddMarkdown(${markdown})`); - const inViewMode = await this.PageObjects.dashboard.getIsInViewMode(); + const inViewMode = await this.dashboard.getIsInViewMode(); if (inViewMode) { - await this.PageObjects.dashboard.switchToEditMode(); + await this.dashboard.switchToEditMode(); } await this.dashboardAddPanel.clickMarkdownQuickButton(); - await this.PageObjects.visEditor.setMarkdownTxt(markdown); - await this.PageObjects.visEditor.clickGo(); - await this.PageObjects.visualize.saveVisualizationExpectSuccess(name, { + await this.visEditor.setMarkdownTxt(markdown); + await this.visEditor.clickGo(); + await this.visualize.saveVisualizationExpectSuccess(name, { saveAsNew: false, redirectToOrigin: true, }); @@ -101,9 +99,9 @@ export class DashboardVisualizationsService extends FtrService { async createAndEmbedMetric(name: string) { this.log.debug(`createAndEmbedMetric(${name})`); - const inViewMode = await this.PageObjects.dashboard.getIsInViewMode(); + const inViewMode = await this.dashboard.getIsInViewMode(); if (inViewMode) { - await this.PageObjects.dashboard.switchToEditMode(); + await this.dashboard.switchToEditMode(); } await this.dashboardAddPanel.clickEditorMenuButton(); await this.dashboardAddPanel.clickAggBasedVisualizations(); @@ -115,13 +113,13 @@ export class DashboardVisualizationsService extends FtrService { async createAndEmbedMarkdown({ name, markdown }: { name: string; markdown: string }) { this.log.debug(`createAndEmbedMarkdown(${markdown})`); - const inViewMode = await this.PageObjects.dashboard.getIsInViewMode(); + const inViewMode = await this.dashboard.getIsInViewMode(); if (inViewMode) { - await this.PageObjects.dashboard.switchToEditMode(); + await this.dashboard.switchToEditMode(); } await this.dashboardAddPanel.clickMarkdownQuickButton(); - await this.PageObjects.visEditor.setMarkdownTxt(markdown); - await this.PageObjects.visEditor.clickGo(); + await this.visEditor.setMarkdownTxt(markdown); + await this.visEditor.clickGo(); await this.testSubjects.click('visualizesaveAndReturnButton'); } } diff --git a/test/functional/services/data_grid.ts b/test/functional/services/data_grid.ts index f2079c02ef5b5c..f54e7b65a46e2a 100644 --- a/test/functional/services/data_grid.ts +++ b/test/functional/services/data_grid.ts @@ -10,7 +10,7 @@ import { chunk } from 'lodash'; import { FtrService } from '../ftr_provider_context'; import { WebElementWrapper } from './lib/web_element_wrapper'; -interface TabbedGridData { +export interface TabbedGridData { columns: string[]; rows: string[][]; } @@ -22,7 +22,7 @@ interface SelectOptions { export class DataGridService extends FtrService { private readonly find = this.ctx.getService('find'); private readonly testSubjects = this.ctx.getService('testSubjects'); - private readonly PageObjects = this.ctx.getPageObjects(['common', 'header']); + private readonly header = this.ctx.getPageObject('header'); private readonly retry = this.ctx.getService('retry'); async getDataGridTableData(): Promise { @@ -234,7 +234,7 @@ export class DataGridService extends FtrService { const tableDocViewRow = await this.getTableDocViewRow(detailsRow, fieldName); const addInclusiveFilterButton = await this.getAddInclusiveFilterButton(tableDocViewRow); await addInclusiveFilterButton.click(); - await this.PageObjects.header.awaitGlobalLoadingIndicatorHidden(); + await this.header.awaitGlobalLoadingIndicatorHidden(); } public async getAddInclusiveFilterButton( @@ -263,7 +263,7 @@ export class DataGridService extends FtrService { const tableDocViewRow = await this.getTableDocViewRow(detailsRow, fieldName); const addInclusiveFilterButton = await this.getRemoveInclusiveFilterButton(tableDocViewRow); await addInclusiveFilterButton.click(); - await this.PageObjects.header.awaitGlobalLoadingIndicatorHidden(); + await this.header.awaitGlobalLoadingIndicatorHidden(); } public async hasNoResults() { diff --git a/test/functional/services/doc_table.ts b/test/functional/services/doc_table.ts index 6c73faec16b1a9..685f1748d56b28 100644 --- a/test/functional/services/doc_table.ts +++ b/test/functional/services/doc_table.ts @@ -17,7 +17,7 @@ interface SelectOptions { export class DocTableService extends FtrService { private readonly testSubjects = this.ctx.getService('testSubjects'); private readonly retry = this.ctx.getService('retry'); - private readonly PageObjects = this.ctx.getPageObjects(['common', 'header']); + private readonly header = this.ctx.getPageObject('header'); public async getTable(selector?: string) { return await this.testSubjects.find(selector ? selector : 'docTable'); @@ -126,7 +126,7 @@ export class DocTableService extends FtrService { const tableDocViewRow = await this.getTableDocViewRow(detailsRow, fieldName); const addInclusiveFilterButton = await this.getAddInclusiveFilterButton(tableDocViewRow); await addInclusiveFilterButton.click(); - await this.PageObjects.header.awaitGlobalLoadingIndicatorHidden(); + await this.header.awaitGlobalLoadingIndicatorHidden(); } public async getRemoveInclusiveFilterButton( @@ -142,7 +142,7 @@ export class DocTableService extends FtrService { const tableDocViewRow = await this.getTableDocViewRow(detailsRow, fieldName); const addInclusiveFilterButton = await this.getRemoveInclusiveFilterButton(tableDocViewRow); await addInclusiveFilterButton.click(); - await this.PageObjects.header.awaitGlobalLoadingIndicatorHidden(); + await this.header.awaitGlobalLoadingIndicatorHidden(); } public async getAddExistsFilterButton( @@ -155,7 +155,7 @@ export class DocTableService extends FtrService { const tableDocViewRow = await this.getTableDocViewRow(detailsRow, fieldName); const addInclusiveFilterButton = await this.getAddExistsFilterButton(tableDocViewRow); await addInclusiveFilterButton.click(); - await this.PageObjects.header.awaitGlobalLoadingIndicatorHidden(); + await this.header.awaitGlobalLoadingIndicatorHidden(); } public async toggleRowExpanded({ @@ -163,7 +163,7 @@ export class DocTableService extends FtrService { rowIndex = 0, }: SelectOptions = {}): Promise { await this.clickRowToggle({ isAnchorRow, rowIndex }); - await this.PageObjects.header.awaitGlobalLoadingIndicatorHidden(); + await this.header.awaitGlobalLoadingIndicatorHidden(); return await this.retry.try(async () => { const row = isAnchorRow ? await this.getAnchorRow() : (await this.getBodyRows())[rowIndex]; const detailsRow = await row.findByXpath( diff --git a/test/functional/services/embedding.ts b/test/functional/services/embedding.ts index e394aff19ab8b6..6d168b00c5447d 100644 --- a/test/functional/services/embedding.ts +++ b/test/functional/services/embedding.ts @@ -11,7 +11,7 @@ import { FtrService } from '../ftr_provider_context'; export class EmbeddingService extends FtrService { private readonly browser = this.ctx.getService('browser'); private readonly log = this.ctx.getService('log'); - private readonly PageObjects = this.ctx.getPageObjects(['header']); + private readonly header = this.ctx.getPageObject('header'); /** * Opens current page in embeded mode @@ -20,6 +20,6 @@ export class EmbeddingService extends FtrService { const currentUrl = await this.browser.getCurrentUrl(); this.log.debug(`Opening in embedded mode: ${currentUrl}`); await this.browser.get(`${currentUrl}&embed=true`); - await this.PageObjects.header.waitUntilLoadingHasFinished(); + await this.header.waitUntilLoadingHasFinished(); } } diff --git a/test/functional/services/filter_bar.ts b/test/functional/services/filter_bar.ts index 5f20d3d4f8b7b5..1d0b85eed3a9c5 100644 --- a/test/functional/services/filter_bar.ts +++ b/test/functional/services/filter_bar.ts @@ -12,7 +12,8 @@ import { FtrService } from '../ftr_provider_context'; export class FilterBarService extends FtrService { private readonly comboBox = this.ctx.getService('comboBox'); private readonly testSubjects = this.ctx.getService('testSubjects'); - private readonly PageObjects = this.ctx.getPageObjects(['common', 'header']); + private readonly common = this.ctx.getPageObject('common'); + private readonly header = this.ctx.getPageObject('header'); /** * Checks if specified filter exists @@ -56,7 +57,7 @@ export class FilterBarService extends FtrService { public async removeFilter(key: string): Promise { await this.testSubjects.click(`~filter & ~filter-key-${key}`); await this.testSubjects.click(`deleteFilter`); - await this.PageObjects.header.awaitGlobalLoadingIndicatorHidden(); + await this.header.awaitGlobalLoadingIndicatorHidden(); } /** @@ -65,8 +66,8 @@ export class FilterBarService extends FtrService { public async removeAllFilters(): Promise { await this.testSubjects.click('showFilterActions'); await this.testSubjects.click('removeAllFilters'); - await this.PageObjects.header.waitUntilLoadingHasFinished(); - await this.PageObjects.common.waitUntilUrlIncludes('filters:!()'); + await this.header.waitUntilLoadingHasFinished(); + await this.common.waitUntilUrlIncludes('filters:!()'); } /** @@ -77,13 +78,13 @@ export class FilterBarService extends FtrService { public async toggleFilterEnabled(key: string): Promise { await this.testSubjects.click(`~filter & ~filter-key-${key}`); await this.testSubjects.click(`disableFilter`); - await this.PageObjects.header.awaitGlobalLoadingIndicatorHidden(); + await this.header.awaitGlobalLoadingIndicatorHidden(); } public async toggleFilterPinned(key: string): Promise { await this.testSubjects.click(`~filter & ~filter-key-${key}`); await this.testSubjects.click(`pinFilter`); - await this.PageObjects.header.awaitGlobalLoadingIndicatorHidden(); + await this.header.awaitGlobalLoadingIndicatorHidden(); } public async isFilterPinned(key: string): Promise { @@ -141,7 +142,7 @@ export class FilterBarService extends FtrService { } } await this.testSubjects.click('saveFilter'); - await this.PageObjects.header.awaitGlobalLoadingIndicatorHidden(); + await this.header.awaitGlobalLoadingIndicatorHidden(); } /** @@ -152,7 +153,7 @@ export class FilterBarService extends FtrService { public async clickEditFilter(key: string, value: string): Promise { await this.testSubjects.click(`~filter & ~filter-key-${key} & ~filter-value-${value}`); await this.testSubjects.click(`editFilter`); - await this.PageObjects.header.awaitGlobalLoadingIndicatorHidden(); + await this.header.awaitGlobalLoadingIndicatorHidden(); } /** diff --git a/test/functional/services/index.ts b/test/functional/services/index.ts index a509141390f676..26f562799b2974 100644 --- a/test/functional/services/index.ts +++ b/test/functional/services/index.ts @@ -47,7 +47,7 @@ import { ListingTableService } from './listing_table'; import { SavedQueryManagementComponentService } from './saved_query_management_component'; import { KibanaSupertestProvider } from './supertest'; import { MenuToggleService } from './menu_toggle'; -import { MonacoEditorProvider } from './monaco_editor'; +import { MonacoEditorService } from './monaco_editor'; export const services = { ...commonServiceProviders, @@ -84,6 +84,6 @@ export const services = { elasticChart: ElasticChartService, supertest: KibanaSupertestProvider, managementMenu: ManagementMenuService, - monacoEditor: MonacoEditorProvider, + monacoEditor: MonacoEditorService, menuToggle: MenuToggleService, }; diff --git a/test/functional/services/listing_table.ts b/test/functional/services/listing_table.ts index 79678cf7a812b8..1cd4249df5050c 100644 --- a/test/functional/services/listing_table.ts +++ b/test/functional/services/listing_table.ts @@ -17,8 +17,8 @@ export class ListingTableService extends FtrService { private readonly find = this.ctx.getService('find'); private readonly log = this.ctx.getService('log'); private readonly retry = this.ctx.getService('retry'); - private readonly common = this.ctx.getPageObjects(['common']).common; - private readonly header = this.ctx.getPageObjects(['header']).header; + private readonly common = this.ctx.getPageObject('common'); + private readonly header = this.ctx.getPageObject('header'); private async getSearchFilter() { return await this.testSubjects.find('tableListSearchBox'); diff --git a/test/functional/services/monaco_editor.ts b/test/functional/services/monaco_editor.ts index 4e791e54c4b09c..572606f8964546 100644 --- a/test/functional/services/monaco_editor.ts +++ b/test/functional/services/monaco_editor.ts @@ -6,26 +6,24 @@ * Side Public License, v 1. */ -import { FtrProviderContext } from '../ftr_provider_context'; +import { FtrService } from '../ftr_provider_context'; -export function MonacoEditorProvider({ getService }: FtrProviderContext) { - const retry = getService('retry'); - const browser = getService('browser'); +export class MonacoEditorService extends FtrService { + private readonly retry = this.ctx.getService('retry'); + private readonly browser = this.ctx.getService('browser'); - return new (class MonacoEditor { - public async getCodeEditorValue(nthIndex: number = 0) { - let values: string[] = []; + public async getCodeEditorValue(nthIndex: number = 0) { + let values: string[] = []; - await retry.try(async () => { - values = await browser.execute( - () => - (window as any).MonacoEnvironment.monaco.editor - .getModels() - .map((model: any) => model.getValue()) as string[] - ); - }); + await this.retry.try(async () => { + values = await this.browser.execute( + () => + (window as any).MonacoEnvironment.monaco.editor + .getModels() + .map((model: any) => model.getValue()) as string[] + ); + }); - return values[nthIndex] as string; - } - })(); + return values[nthIndex] as string; + } } diff --git a/test/functional/services/query_bar.ts b/test/functional/services/query_bar.ts index 31586d92d92a9d..f0728f2b022e30 100644 --- a/test/functional/services/query_bar.ts +++ b/test/functional/services/query_bar.ts @@ -13,7 +13,8 @@ export class QueryBarService extends FtrService { private readonly testSubjects = this.ctx.getService('testSubjects'); private readonly retry = this.ctx.getService('retry'); private readonly log = this.ctx.getService('log'); - private readonly PageObjects = this.ctx.getPageObjects(['header', 'common']); + private readonly common = this.ctx.getPageObject('common'); + private readonly header = this.ctx.getPageObject('header'); private readonly find = this.ctx.getService('find'); private readonly browser = this.ctx.getService('browser'); @@ -42,15 +43,15 @@ export class QueryBarService extends FtrService { public async clearQuery(): Promise { await this.setQuery(''); - await this.PageObjects.common.pressTabKey(); // move outside of input into language switcher - await this.PageObjects.common.pressTabKey(); // move outside of language switcher so time picker appears + await this.common.pressTabKey(); // move outside of input into language switcher + await this.common.pressTabKey(); // move outside of language switcher so time picker appears } public async submitQuery(): Promise { this.log.debug('QueryBar.submitQuery'); await this.testSubjects.click('queryInput'); - await this.PageObjects.common.pressEnterKey(); - await this.PageObjects.header.waitUntilLoadingHasFinished(); + await this.common.pressEnterKey(); + await this.header.waitUntilLoadingHasFinished(); } public async clickQuerySubmitButton(): Promise { diff --git a/test/functional/services/remote/prevent_parallel_calls.ts b/test/functional/services/remote/prevent_parallel_calls.ts index d21abc9d268674..338bfbd4278736 100644 --- a/test/functional/services/remote/prevent_parallel_calls.ts +++ b/test/functional/services/remote/prevent_parallel_calls.ts @@ -6,44 +6,49 @@ * Side Public License, v 1. */ -export function preventParallelCalls( - fn: (this: C, arg: A) => Promise, - filter: (arg: A) => boolean -) { - const execQueue: Task[] = []; +class Task { + public promise: Promise; + private resolve!: (result: R) => void; + private reject!: (error: Error) => void; - class Task { - public promise: Promise; - private resolve!: (result: R) => void; - private reject!: (error: Error) => void; - - constructor(private readonly context: C, private readonly arg: A) { - this.promise = new Promise((resolve, reject) => { - this.resolve = resolve; - this.reject = reject; - }); - } + constructor( + private readonly execQueue: Array>, + private readonly fn: (this: C, arg: A) => Promise, + private readonly context: C, + private readonly arg: A + ) { + this.promise = new Promise((resolve, reject) => { + this.resolve = resolve; + this.reject = reject; + }); + } - public async exec() { - try { - this.resolve(await fn.call(this.context, this.arg)); - } catch (error) { - this.reject(error); - } finally { - execQueue.shift(); - if (execQueue.length) { - execQueue[0].exec(); - } + public async exec() { + try { + this.resolve(await this.fn.call(this.context, this.arg)); + } catch (error) { + this.reject(error); + } finally { + this.execQueue.shift(); + if (this.execQueue.length) { + this.execQueue[0].exec(); } } } +} + +export function preventParallelCalls( + fn: (this: C, arg: A) => Promise, + filter: (arg: A) => boolean +) { + const execQueue: Array> = []; return async function (this: C, arg: A) { if (filter(arg)) { return await fn.call(this, arg); } - const task = new Task(this, arg); + const task = new Task(execQueue, fn, this, arg); if (execQueue.push(task) === 1) { // only item in the queue, kick it off task.exec(); diff --git a/test/functional/services/saved_query_management_component.ts b/test/functional/services/saved_query_management_component.ts index aabe8c0aebb0c6..decf1618c78793 100644 --- a/test/functional/services/saved_query_management_component.ts +++ b/test/functional/services/saved_query_management_component.ts @@ -14,7 +14,7 @@ export class SavedQueryManagementComponentService extends FtrService { private readonly queryBar = this.ctx.getService('queryBar'); private readonly retry = this.ctx.getService('retry'); private readonly config = this.ctx.getService('config'); - private readonly PageObjects = this.ctx.getPageObjects(['common']); + private readonly common = this.ctx.getPageObject('common'); public async getCurrentlyLoadedQueryID() { await this.openSavedQueryManagementComponent(); @@ -93,7 +93,7 @@ export class SavedQueryManagementComponentService extends FtrService { public async deleteSavedQuery(title: string) { await this.openSavedQueryManagementComponent(); await this.testSubjects.click(`~delete-saved-query-${title}-button`); - await this.PageObjects.common.clickConfirmOnModal(); + await this.common.clickConfirmOnModal(); } async clearCurrentlyLoadedQuery() { diff --git a/test/functional/services/visualizations/pie_chart.ts b/test/functional/services/visualizations/pie_chart.ts index cac4e8fe64c5e2..7c925318f0211f 100644 --- a/test/functional/services/visualizations/pie_chart.ts +++ b/test/functional/services/visualizations/pie_chart.ts @@ -9,6 +9,8 @@ import expect from '@kbn/expect'; import { FtrService } from '../../ftr_provider_context'; +const pieChartSelector = 'visTypePieChart'; + export class PieChartService extends FtrService { private readonly log = this.ctx.getService('log'); private readonly retry = this.ctx.getService('retry'); @@ -18,20 +20,42 @@ export class PieChartService extends FtrService { private readonly find = this.ctx.getService('find'); private readonly panelActions = this.ctx.getService('dashboardPanelActions'); private readonly defaultFindTimeout = this.config.get('timeouts.find'); + private readonly visChart = this.ctx.getPageObject('visChart'); private readonly filterActionText = 'Apply filter to current view'; async clickOnPieSlice(name?: string) { this.log.debug(`PieChart.clickOnPieSlice(${name})`); - if (name) { - await this.testSubjects.click(`pieSlice-${name.split(' ').join('-')}`); + if (await this.visChart.isNewLibraryChart(pieChartSelector)) { + const slices = + (await this.visChart.getEsChartDebugState(pieChartSelector))?.partition?.[0]?.partitions ?? + []; + let sliceLabel = name || slices[0].name; + if (name === 'Other') { + sliceLabel = '__other__'; + } + const pieSlice = slices.find((slice) => slice.name === sliceLabel); + const pie = await this.testSubjects.find(pieChartSelector); + if (pieSlice) { + const pieSize = await pie.getSize(); + const pieHeight = pieSize.height; + const pieWidth = pieSize.width; + await pie.clickMouseButton({ + xOffset: pieSlice.coords[0] - Math.floor(pieWidth / 2), + yOffset: pieSlice.coords[1] - Math.floor(pieHeight / 2), + }); + } } else { - // If no pie slice has been provided, find the first one available. - await this.retry.try(async () => { - const slices = await this.find.allByCssSelector('svg > g > g.arcs > path.slice'); - this.log.debug('Slices found:' + slices.length); - return slices[0].click(); - }); + if (name) { + await this.testSubjects.click(`pieSlice-${name.split(' ').join('-')}`); + } else { + // If no pie slice has been provided, find the first one available. + await this.retry.try(async () => { + const slices = await this.find.allByCssSelector('svg > g > g.arcs > path.slice'); + this.log.debug('Slices found:' + slices.length); + return slices[0].click(); + }); + } } } @@ -63,12 +87,30 @@ export class PieChartService extends FtrService { async getPieSliceStyle(name: string) { this.log.debug(`VisualizePage.getPieSliceStyle(${name})`); + if (await this.visChart.isNewLibraryChart(pieChartSelector)) { + const slices = + (await this.visChart.getEsChartDebugState(pieChartSelector))?.partition?.[0]?.partitions ?? + []; + const selectedSlice = slices.filter((slice) => { + return slice.name.toString() === name.replace(',', ''); + }); + return selectedSlice[0]?.color; + } const pieSlice = await this.getPieSlice(name); return await pieSlice.getAttribute('style'); } async getAllPieSliceStyles(name: string) { this.log.debug(`VisualizePage.getAllPieSliceStyles(${name})`); + if (await this.visChart.isNewLibraryChart(pieChartSelector)) { + const slices = + (await this.visChart.getEsChartDebugState(pieChartSelector))?.partition?.[0]?.partitions ?? + []; + const selectedSlice = slices.filter((slice) => { + return slice.name.toString() === name.replace(',', ''); + }); + return selectedSlice.map((slice) => slice.color); + } const pieSlices = await this.getAllPieSlices(name); return await Promise.all( pieSlices.map(async (pieSlice) => await pieSlice.getAttribute('style')) @@ -87,6 +129,24 @@ export class PieChartService extends FtrService { } async getPieChartLabels() { + if (await this.visChart.isNewLibraryChart(pieChartSelector)) { + const slices = + (await this.visChart.getEsChartDebugState(pieChartSelector))?.partition?.[0]?.partitions ?? + []; + return slices.map((slice) => { + if (slice.name === '__missing__') { + return 'Missing'; + } else if (slice.name === '__other__') { + return 'Other'; + } else if (typeof slice.name === 'number') { + // debugState of escharts returns the numbers without comma + const val = slice.name as number; + return val.toString().replace(/\B(? await chart.getAttribute('data-label')) @@ -95,10 +155,23 @@ export class PieChartService extends FtrService { async getPieSliceCount() { this.log.debug('PieChart.getPieSliceCount'); + if (await this.visChart.isNewLibraryChart(pieChartSelector)) { + const slices = + (await this.visChart.getEsChartDebugState(pieChartSelector))?.partition?.[0]?.partitions ?? + []; + return slices?.length; + } const slices = await this.find.allByCssSelector('svg > g > g.arcs > path.slice'); return slices.length; } + async expectPieSliceCountEsCharts(expectedCount: number) { + const slices = + (await this.visChart.getEsChartDebugState(pieChartSelector))?.partition?.[0]?.partitions ?? + []; + expect(slices.length).to.be(expectedCount); + } + async expectPieSliceCount(expectedCount: number) { this.log.debug(`PieChart.expectPieSliceCount(${expectedCount})`); await this.retry.try(async () => { @@ -111,7 +184,7 @@ export class PieChartService extends FtrService { this.log.debug(`PieChart.expectPieChartLabels(${expectedLabels.join(',')})`); await this.retry.try(async () => { const pieData = await this.getPieChartLabels(); - expect(pieData).to.eql(expectedLabels); + expect(pieData.sort()).to.eql(expectedLabels); }); } } diff --git a/test/plugin_functional/plugins/core_app_status/tsconfig.json b/test/plugin_functional/plugins/core_app_status/tsconfig.json index 4d979fbf7f15fd..0f0e7caf2b486a 100644 --- a/test/plugin_functional/plugins/core_app_status/tsconfig.json +++ b/test/plugin_functional/plugins/core_app_status/tsconfig.json @@ -1,8 +1,11 @@ { "extends": "../../../../tsconfig.base.json", "compilerOptions": { + "composite": true, "outDir": "./target", - "skipLibCheck": true + "emitDeclarationOnly": true, + "declaration": true, + "declarationMap": true }, "include": [ "index.ts", @@ -10,5 +13,8 @@ "public/**/*.tsx", "../../../../typings/**/*", ], - "exclude": [] + "exclude": [], + "references": [ + { "path": "../../../../src/core/tsconfig.json" }, + ], } diff --git a/test/plugin_functional/plugins/core_plugin_deep_links/kibana.json b/test/plugin_functional/plugins/core_plugin_deep_links/kibana.json new file mode 100644 index 00000000000000..539550974c563a --- /dev/null +++ b/test/plugin_functional/plugins/core_plugin_deep_links/kibana.json @@ -0,0 +1,7 @@ +{ + "id": "corePluginDeepLinks", + "version": "0.0.1", + "kibanaVersion": "kibana", + "configPath": ["core_plugin_deep_links"], + "ui": true +} diff --git a/test/plugin_functional/plugins/core_plugin_deep_links/package.json b/test/plugin_functional/plugins/core_plugin_deep_links/package.json new file mode 100644 index 00000000000000..3fe16ddee53214 --- /dev/null +++ b/test/plugin_functional/plugins/core_plugin_deep_links/package.json @@ -0,0 +1,14 @@ +{ + "name": "core_plugin_deep_links", + "version": "1.0.0", + "main": "target/test/plugin_functional/plugins/core_plugin_deep_links", + "kibana": { + "version": "kibana", + "templateVersion": "1.0.0" + }, + "license": "SSPL-1.0 OR Elastic License 2.0", + "scripts": { + "kbn": "node ../../../../scripts/kbn.js", + "build": "rm -rf './target' && ../../../../node_modules/.bin/tsc" + } +} \ No newline at end of file diff --git a/test/plugin_functional/plugins/core_plugin_deep_links/public/application.tsx b/test/plugin_functional/plugins/core_plugin_deep_links/public/application.tsx new file mode 100644 index 00000000000000..90814bd552d37e --- /dev/null +++ b/test/plugin_functional/plugins/core_plugin_deep_links/public/application.tsx @@ -0,0 +1,158 @@ +/* + * 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 { History } from 'history'; +import React from 'react'; +import ReactDOM from 'react-dom'; +import { Router, Route, withRouter, RouteComponentProps, Redirect } from 'react-router-dom'; + +import { + EuiPage, + EuiPageBody, + EuiPageContent, + EuiPageContentBody, + EuiPageContentHeader, + EuiPageContentHeaderSection, + EuiPageHeader, + EuiPageHeaderSection, + EuiPageSideBar, + EuiTitle, + EuiSideNav, +} from '@elastic/eui'; + +import { CoreStart, AppMountParameters } from 'kibana/public'; + +const Home = () => ( + + + + +

Welcome to DL!

+
+
+
+ + + + +

DL home page section title

+
+
+
+ Wow this is the content! +
+
+); + +const PageA = () => ( + + + + +

DL Page A

+
+
+
+ + + + +

DL Page A section title

+
+
+
+ DL Page A's content goes here +
+
+); + +const PageB = () => ( + + + + +

DL Page B

+
+
+
+ + + + +

DL Page B section title

+
+
+
+ DL Page B's content goes here +
+
+); + +type NavProps = RouteComponentProps & { + navigateToApp: CoreStart['application']['navigateToApp']; +}; +const Nav = withRouter(({ history, navigateToApp }: NavProps) => ( + history.push('/home'), + 'data-test-subj': 'dlNavHome', + }, + { + id: 'page-a', + name: 'DL page A', + onClick: () => history.push('/page-a'), + 'data-test-subj': 'dlNavPageA', + }, + { + id: 'navigateDeepByPath', + name: 'DL section 1 page B', + onClick: () => { + navigateToApp('deeplinks', { path: '/page-b' }); + }, + 'data-test-subj': 'dlNavDeepPageB', + }, + { + id: 'navigateDeepById', + name: 'DL page A deep link', + onClick: () => { + navigateToApp('deeplinks', { deepLinkId: 'pageA' }); + }, + 'data-test-subj': 'dlNavDeepPageAById', + }, + ], + }, + ]} + /> +)); + +const DlApp = ({ history, coreStart }: { history: History; coreStart: CoreStart }) => ( + + + +